GNOME Bugzilla – Bug 339270
win32 patches and build howto
Last modified: 2008-02-13 02:13:59 UTC
(1) Setup --------- - Set up msys (+DTK), mingw, gtk+ (e.g. with gladewin32-devel). - C:\GTK mounted on /target. - For building against gtk a few symlinks are required, this is explained at [1]: cd /target/lib ln -s ../bin/intl.dll libintl.dll ln -s ../bin/iconv.dll libiconv.dll (2) glib-java ------------- - Depending on the automake version manual creation of .deps/src/jni might be required. - Apply patch, configure (--without-javadocs --without-gcj-compile) and build. (3) cairo-java -------------- - Get fontconfig 2.3.2 (+devel), e.g. from [2], extract in / - Make sure they are found before the (too old 2.2.2) ones from gladewin32, e.g. by copying its /bin, /lib and /lib/pkgconfig content over to the gtk prefix. - Set PKG_CONFIG_PATH so glib-java would be found. - Depending on the automake version manual creation of .deps/src/jni might be required. - Apply patch, configure (--without-javadocs --without-gcj-compile) and build. (4) libgtk-java --------------- - cd /usr/lib && ln -s /c/WINDOW/system32/gdi32.dll libgdi32.dll #(see [1]). - Depending on the automake version manual creation of .deps/src/jni might be required. - Apply patch, configure (--without-javadocs --without-gcj-compile) and build. - src/jni/org_gnu_glib_GObject.[ch] might bail because of "conflicting types for 'Java_org_gnu_glib_GObject_instantiateJGObjectFromGType'". Fix by manually changing "int type" to "jint type" in the c file and restart the build. (5) libglade-java ----------------- - cd /target/lib && ln -s ../bin/zlib1.dll libz.dll #(see [1]). - cd /usr/lib && ln -s /c/WINDOW/system32/ws2_32.dll libws2_32.dll #(see [1]). - Depending on the automake version manual creation of .deps/src/jni might be required. - Apply patch, configure (--without-javadocs --without-gcj-compile) and build. [1] http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html [2] http://www.lilypond.org/download/binaries/mingw/uploads/fontconfig
Created attachment 64016 [details] [review] glib-java-0.2.4-win32.diff Patch for building on win32/mingw.
Created attachment 64017 [details] [review] cairo-java-1.0.3-win32.diff Patch for building on win32/mingw.
Created attachment 64018 [details] [review] libgtk-java-2.8.4-win32.diff Patch for building on win32/mingw.
Created attachment 64019 [details] [review] libglade-java-2.12.3-win32.diff Patch for building on win32/mingw.
Quite possibly there's a problem with regard to the libglade binding. The gtk binding uses a library name of "libgtkjni-$version" for System.loadLibrary() whereas for libglade "gladejni-$version" is used. The built gladejni dll however has a "lib" prefix and is therefore not found.
Created attachment 64195 [details] [review] glib-java-0.2.4-win32.diff Patch improved not to break linux build.
Created attachment 64196 [details] [review] cairo-java-1.0.3-win32.diff Patch improved not to break linux build.
Created attachment 64197 [details] [review] libgtk-java-2.8.4-win32.diff Patch improved not to break linux build.
Created attachment 64198 [details] [review] libglade-java-2.12.3-win32-buggy.diff Patch improved not to break linux build. Needs work tho, looks like libglade is not initialised correctly.
(In reply to comment #5) > Quite possibly there's a problem with regard to the libglade binding. > The gtk binding uses a library name of "libgtkjni-$version" for > System.loadLibrary() whereas for libglade "gladejni-$version" is used. The > built gladejni dll however has a "lib" prefix and is therefore not found. This issue is addressed in attachment #64197 [details].
Created attachment 64206 [details] [review] libglade-java-2.12.3-win32.diff
I'm having difficulties performing the mount for step 1. Just which packages am I supposed to download and install for MingW? Does it matter if I install MSYS first or MingW first?
According to my mtimes it seems i ordered (1) msys, (2) mingw, (3) gtk. If you keep the default installation prefixes you'll get c:\msys\1.0\etc\fstab where you can mount stuff.
Hi Rob, I just wanted to point you the fact that the second list you gave in empty for now (http://lilypond.org/download/binaries/mingw/uploads/fontconfig/) I found other versions of libfontconfig-1.dll (if it's what's needed) but I was not able to use them to compile the project. Regards, --- Mehdi
Maybe they added it to the mainline distribution?
I installed lilypond and indeed I found a libfontconfig-1.dll file. (it's that ?) I will try to write a detailled howto for win32 (coz I had a hard time - and it still didn't compile) but I may have a lot of questions, I hope you can help me answer them. For example how do you know which is the version of libfontconfig, which one is the right, how can we directly rebuild it (if, for example, the lilypond website is down) ?? Regards, Mehdi
Wow. Hadn't seen this one before - there are a lot of patches here! As ever with build system modifications to allow a new architecture to work, we'd need some indication that a) it works for the target architecture. b) it doesn't screw over the existing architectures! :) Comments to either of these points welcome; once there is a level of comfortableness I'm sure we can get these committed to java-gnome 2.14.x AfC
Incidentally, once this reaches maturity, we'll need to update http://java-gnome.sourceforge.net/cgi-bin/bin/view/Main/WindowsCompilation as that information is considerably out of date and obsoleted by the knowledge in this bug. AfC Sydney
I have been trying to reproduce the howto from the original poster with the current versions of the libraries. In my case: cairo-java-1.0.6 glib-java-0.4.1 libgtk-java-2.10.1 First of all I was not really able to use the patches because that would involve running autoconf/automake within MSYS which didn't work for me even though I had working versions of those tools. So what I had to do was to modify the Makefile of glib.java itself to include the extra linker flags that are included in the glib-java patch. Here are my modifications: 414c414 < libglibjava_la_LDFLAGS = -release $(apiversion) -Wl,--export-all-symbols -no-undefined -Wl,--export-dynamic --- > libglibjava_la_LDFLAGS = -no-undefined -release $(apiversion) 424c424 < libglibjni_la_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) $(PLATFORM_LDFLAGS) -release $(apiversion) -Wl,--export-all-symbols -no-undefined -Wl,--export-dynamic --- > libglibjni_la_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) $(PLATFORM_LDFLAGS) -no-undefined -release $(apiversion) I hope this may help other people who try to compile java-gnome for Windows.
Thanks for taking the time to report this bug. However, you are using a version that is too old and not supported anymore. GNOME developers are no longer working on that version, so unfortunately there will not be any bug fixes for the version that you use. By upgrading to a newer version of GNOME you could receive bug fixes and new functionality. You may need to upgrade your Linux distribution to obtain a newer version of GNOME. Please feel free to reopen this bug if the problem still occurs with a newer version of GNOME.