This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Compiling of GCJ and SWT under MacOS X


Hi.    
 
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    
 
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.    
 
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    
 
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 ?   
2) How do you compile a program natively using the swt-carbon-xxxx.jnilib's ? If  
you have a MacOS specific example could you please supply me with it.   I have 
been struggling with it for over a week now and I'm lost....     
 
PLEASE....... Help me.     
 
Francois Hensley 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]