Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Re: looking into SWT 3.0 M8 for native compilation with GCJ

>>>>> "Erik" == Erik Poupaert <erik.poupaert@xxxxxxxxx> writes:

Erik> The truth is, your nightly build.xml doesn't actually build
Erik> them. As a matter of fact, the build system doesn't compile them
Erik> at all.

As I understand it, that just isn't how the eclipse build system
works.  Both Red Hat and jpackage.org ended up hacking things to make
it easier to rebuild the native bits on each platform.

Erik> By the way, thanks the folks for hardcoding
Erik> /bluebird/teamswt/swt-builddir/jdk1.5.0,
Erik> /bluebird/teamswt/swt-builddir/IBMJava2-141. That's really user-friendly.

We use the appended, but much of this is just sugar (since we changed
all the native code to use JAVA_HOME, and this simplifies things).
You can override any Makefile variable from the `make' command line.

Erik> By the way, I just hope that there were no new reflection calls
Erik> added in between 2.132 and 3.044. I haven't bothered to compile
Erik> any version in between natively with GCJ. I just know from
Erik> experience that GCJ chokes on reflection calls, and that it's a
Erik> lot of work to figure out where they are and then add the
Erik> "artificial dragger constants" in to make things work anyway.

This is a problem with the Windows port, or with static linking, not
gcj per se.  For the former, I'd like to see someone finish making
libgcj work as a DLL, if that is possible.  For the latter, well,
static linking is just weird for precompiled Java.  Perhaps someone
could make it a little friendlier, but I doubt it will ever be simple.

Tom

Index: make_gtk.mak
===================================================================
RCS file: /usr/cygnus/eclipse-cvsroot/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_gtk.mak,v
retrieving revision 1.1.1.1
retrieving revision 1.4
diff -u -r1.1.1.1 -r1.4
--- make_gtk.mak	22 Aug 2003 17:25:34 -0000	1.1.1.1
+++ make_gtk.mak	9 Jan 2004 20:29:15 -0000	1.4
@@ -21,10 +21,11 @@
 # Define the installation directories for various products.
 # Your system may have these in a different place.
 #    IVE_HOME   - IBM's version of Java (J9)
-IVE_HOME   = /bluebird/teamswt/swt-builddir/ive
+IVE_HOME   = $(JAVA_HOME)
 #IVE_HOME   = /opt/IBMvame1.4/ive
 
-JAVA_JNI=$(IVE_HOME)/bin/include
+JAVA_JNI=$(IVE_HOME)/include
+JAVA_PLAT_JNI=$(JAVA_JNI)/$(OS)
 JAVAH=$(IVE_HOME)/bin/javah
 LD_LIBRARY_PATH=$(IVE_HOME)/bin
 
@@ -74,7 +75,7 @@
 make_gnome: $(GNOME_DLL)
 
 $(GNOME_DLL): gnome.o
-	ld -o $@ $(GNOME_OBJ) $(GNOME_LIB)
+	$(CC) -shared -o $@ $(GNOME_OBJ) $(GNOME_LIB)
 
 $(GNOME_OBJ): gnome.c 
 	$(CC) $(CFLAGS) $(GNOME_CFLAGS) -c -o gnome.o gnome.c
@@ -84,11 +85,11 @@
 PI_OBJECTS = swt.o structs.o
 
 $(SWT_DLL): callback.o
-	$(LD) -x -shared \
+	$(CC) -shared \
 	    -o $(SWT_DLL) callback.o
 	    
 $(SWTPI_DLL): $(PI_OBJECTS) structs.o
-	$(LD) -x -shared \
+	$(CC) -shared \
 	    $(GTKLIBS) \
 	    -o $(SWTPI_DLL) $(PI_OBJECTS)
 
@@ -105,7 +106,8 @@
 		$(SWT_WARNINGS) \
 	    -fpic -fPIC \
 	    $(GTKCFLAGS) \
-	    -I$(JAVA_JNI)
+	    -I$(JAVA_JNI) \
+	    -I$(JAVA_PLAT_JNI)
 
 callback.o: callback.c
 	$(CC) $(CFLAGS) callback.c


Back to the top