This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Compiling of GCJ and SWT under MacOS X
- From: Andrew Haley <aph at redhat dot com>
- To: <cyberdeth at spymac dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 9 Feb 2005 13:31:38 +0000
- Subject: Re: Compiling of GCJ and SWT under MacOS X
- References: <20050209095048.9A50C4C04D@webmail1.spymac.net>
cyberdeth@spymac.com writes:
> I have downloaded gnu gcc 3.4.3 and compiled it with the following command line
> parameters :
>
> configure --prefix=/usr --enable-languages=c,c++,java,f77,objc
> --enable-threads=posix --enable-shared
>
> make bootstrap
>
> make install
>
> Now this compiles everything fine under MacOS X.3 using the gcc compiler that
> comes with the Developer Tools ie. gcc 3.3 When I compile a Hello World
> program using gcj, like so :
>
> gcj Test.java -o Test --classpath /usr/share/java/libgcjxxx.jar:$CLASSPATH
> --main=Test -lgcj
You should not do this. If gcj is faliing to find libgcj.jar,
something is wrong.
> Then it compiles fine and the output from the program is as
> expected.
>
> But. When I try to link against the libswt-carbon-xxxx.jnilib all
> hell breaks loose. I have tried to make a symlink from *.jnilib to
> *.dylib and even to .a. When I do a file on the jnilib it says it's
> a bundle.
Where did this library come from?
> I have tried to copy the jnilib files
> into /System/Library/Frameworks/JavaVM.framework/Libraries and linking the
> program as follows.
>
> gcj Test.java -o Test --classpath /usr/share/java/libgcjxxx.jar:$CLASSPATH
> --main=Test -lgcj -framework JavaVM
Don't use "-lgcj".
> which fails.
>
> When I do an ld style
>
> ld Test.o -o Test -lgcj -framework JavaVM then it gives me an error that no __main is
> found hence the --main=Test option.
>
> when doing a gcj Test.o -o Test -lgcj libswt-carbon-xxxx.jnilib it fails as well telling
> me that i can't call a static link editor using a dynamic link editor or something like
> this. And this is where I'm struggling with.
>
> I mean if I link against any other jnilib in the JavaVM framework it compiles
> correctly. Maybe the jnilibs shouldn't be bundles ???
>
> My long winded questions is :
>
> 1) Is my gcc configuration flags correct ?
Yes.
Andrew.