[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Recompiling SWT

Hello,

I'm currently trying to figure out how to build swt (and all the
other native thingies, but I will start low :) from source. To 
give a bit background: The eclipse debian packages are ITM 
only available on x86 and that's also only because the precompiled 
binaries are used (which is a debian policy violation...). Now 
some users wanted to recompile on linux/ppc... Unfortunatelly I
mostly know, what I have to do with Java errors, but makefiles are
new to me...

My current build skript looks like this (only SWT part, variables
are set and files are found):

----
##########################
## building SWT for GTK
##########################
mkdir -p $BUILD_TREE/plugins/org.eclipse.swt.gtk_2.1.0/os/linux/x86
mkdir -p tmp
cp -r $SOURCE_TREE/plugins/org.eclipse.swt/Eclipse\ SWT\PI/gtk/library/* tmp
cp -r $SOURCE_TREE/plugins/org.eclipse.swt/Eclipse\SWT/common/library/* tmp
(cd tmp ;find . -name "libXm*" -exec rm \{\} \;)
(cd tmp ; bash build.sh )
cp tmp/*.so $BUILD_TREE/plugins/org.eclipse.swt.gtk_*/os/linux/x86
rm -r tmp
----

The problem is, that the make file 'out of the box' fails (most
variables point to files, which probably only exist on the normal
SWT build maschine... Would be nice to provide the normal
./configure mechanism...). After editing the variables I ended up with
this here (which still needs some kind of configure skript to build
on differnt maschines...):
--- make_gtk.mak (comments and some other stuff removed)---

include make_common.mak
SWT_VERSION=$(maj_ver)$(min_ver)
IVE_HOME   = /usr/lib/j2se/1.4

JAVA_JNI=$(IVE_HOME)/include
JAVAH=$(IVE_HOME)/bin/javah
LD_LIBRARY_PATH=$(IVE_HOME)/bin

GTKTARGET = gtk+-2.0

CC = gcc
LD = ld

# Define the various DLL (shared) libraries to be made.

[...]
GNOME_PREFIX = swt-gnome
GNOME_DLL    = lib$(GNOME_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
GNOME_OBJ    = gnome.o

GNOME_CFLAGS = `pkg-config --cflags gnome-vfs-2.0`
GNOME_LIB = -x -shared `pkg-config --libs gnome-vfs-2.0`


# Compile and link options from pkg-config
GTKCFLAGS = `pkg-config --cflags $(GTKTARGET)` `pkg-config --cflags pango`
[...]
GTKLIBS = `pkg-config --libs $(GTKTARGET)` 

all: make_swt  make_gnome

make_swt: $(SWT_DLL) $(SWTPI_DLL)

make_gnome: $(GNOME_DLL)

$(GNOME_DLL): gnome.o
        ld -o $@ $(GNOME_OBJ) $(GNOME_LIB)

$(GNOME_OBJ): gnome.c
        $(CC) $(CFLAGS) $(GNOME_CFLAGS) -c -o gnome.o gnome.c

[... Rest of the file...]

Unfortunately, this isn't working:
[...]
gcc -c -O -s -DSWT_VERSION=2133 -DLINUX -DGTK  `pkg-config --cflags
 gtk+-2.0` `pkg-config --cflags pango` -I/usr/lib/j2se/1.4/include
 -I/usr/lib/j2se/1.4/include/linux `pkg-config --cflags
 gnome-vfs-2.0` -c -o gnome.o gnome.c
ld -o libswt-gnome-gtk-2133.so gnome.o  -x -shared `pkg-config --libs gnome-vfs-2.0`
ld: unrecognized option '-pthread'
ld: use the --help option for usage information
make[1]: *** [libswt-gnome-gtk-2133.so] Error 1

BTW, that's the thing, which give the 'unrecognized option':
# pkg-config --libs gnome-vfs-2.0
-pthread -Wl,--export-dynamic -lgnomevfs-2 -lbonobo-activation
-lORBit-2 -lm -llinc -lgmodule-2.0 -ldl -lgobject-2.0 -lgthread-2.0
-lglib-2.0
(in one line)

I have no idea, what going wrong here :( Any help would be
appreciated!

Do I need 'libswt-gnome-gtk'? What's it actually for?

Thanks in advance! Jan