[Pljava-dev] Problems compiling under Mac OS X

p3consulting p3consulting at mac.com
Fri May 14 15:02:54 UTC 2004


Le mai 14, 2004, à 12:58, Thomas Hallgren a écrit :

> Hi Pascal,
> The makefile is easy enough to change. I don't have access to a Mac OS  
> X
> based machine though, so it's hard for me to test that the change is
> correct. I'd very much like your help. Some suggestions and answers to  
> your
> questions:
>
> Instead of adding #ifdef DARWIN to the source code in order to find the
> jni.h, I'd suggest that you instead add a -I flag to the CPPFLAGS. I'm  
> a big
> fan of controlling the environment through the makefile instead of  
> using
> #ifdef whenever possible.
>


whenever possible... I agree

I do have given a try to
-I/System/Library/Frameworks/JavaVM.framework/Headers/
and it works...
a the condtion to change the linking instructions (see below).

> Regarding 'ant'. There are two possibilities. Either the 'depend' task  
> is
> defined in the optional.jar (included in the ant distrib) and you  
> don't have
> that in your classpath, or you ant version is too old. In any case, I'd
> recommend that you uppgrade ant. 1.5.1 whas a while ago...
>

Bingo !
the optional.jar was missing !
Now using the ant shipping with JBuilderX (1.5.4)

so the C/pljava/Makefile is now

#----------------------------------------------------------------------- 
--
#
# Makefile--
#    Makefile for pljava
#
#----------------------------------------------------------------------- 
--
NAME    := pljava

include $(MODULEROOT)/Makefile.global

ifeq ($(PORTNAME), win32)
         DLL_BUILD := 1
else
ifeq ($(PORTNAME), cygwin)
         DLL_BUILD := 1
         override CPPFLAGS := -DCYGWIN $(CPPFLAGS)
else
ifeq ($(PORTNAME), darwin)
         override CPPFLAGS :=  
-I/System/Library/Frameworks/JavaVM.framework/Headers/ $(CPPFLAGS)
else
         JRE_INCL := $(PORTNAME)
         ifeq ($(host_cpu), i686)
                 JRE_LIB := lib/i386/client
         else
                 JRE_LIB := lib/$(host_cpu)/client
         endif
endif
endif
endif

ifdef DLL_BUILD
         JRE_INCL := win32
         JRE_LIB  := bin/client

         # This works but is not very nice since it affects all
         # DLLTOOL invocations in Makefile.shlib. A custom flag
         # is requested from postgres.
         #
         override DLLTOOL := $(DLLTOOL) --add-stdcall-alias
endif

ifdef USE_GCJ
         override CPPFLAGS := -DGCJ $(CPPFLAGS)
         SHLIB_LINK = $(BE_DLLLIBS) -lgcj -lwsock32
else
ifeq ($(PORTNAME), darwin)
         SHLIB_LINK = $(BE_DLLLIBS) -L. -framework JavaVM
else
         override CPPFLAGS := -I$(JDK_HOME)/include  
-I$(JDK_HOME)/include/$(JRE_INCL) $(CPPFLAGS)
         SHLIB_LINK = $(BE_DLLLIBS) -L. -L$(JDK_HOME)/jre/$(JRE_LIB)  
-ljvm
endif
endif

... no changes after that

The change
#ifdef DARWIN
         #include <JavaVM/jni.h>
#else
         #include <jni.h>
#endif
shoudl not be necessary anymore.

Now everything compiles,
regarding the tests : do you have any more precise instructions to  
follow than what is in the README ?


Pascal Pochet
p3consulting at mac.com
----------------------------------
PGP
KeyID: 0x208C5DBF
Fingerprint: 9BFB 245C 5BFE 7F1D 64B7  C473 ABB3 4E83 208C 5DBF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2369 bytes
Desc: not available
Url : http://pgfoundry.org/pipermail/pljava-dev/attachments/20040514/20b3e97d/attachment.bin 


More information about the Pljava-dev mailing list