After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339270 - win32 patches and build howto
win32 patches and build howto
Status: RESOLVED OBSOLETE
Product: java-gnome
Classification: Bindings
Component: Obsolete
Not Applicable
Other Windows
: Normal normal
: ---
Assigned To: java-gnome bindings maintainers
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-21 08:55 UTC by Rob Staudinger
Modified: 2008-02-13 02:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-java-0.2.4-win32.diff (4.42 KB, patch)
2006-04-21 08:56 UTC, Rob Staudinger
none Details | Review
cairo-java-1.0.3-win32.diff (8.65 KB, patch)
2006-04-21 08:57 UTC, Rob Staudinger
none Details | Review
libgtk-java-2.8.4-win32.diff (14.80 KB, patch)
2006-04-21 08:58 UTC, Rob Staudinger
none Details | Review
libglade-java-2.12.3-win32.diff (5.22 KB, patch)
2006-04-21 08:58 UTC, Rob Staudinger
none Details | Review
glib-java-0.2.4-win32.diff (4.49 KB, patch)
2006-04-24 12:24 UTC, Rob Staudinger
none Details | Review
cairo-java-1.0.3-win32.diff (8.08 KB, patch)
2006-04-24 12:25 UTC, Rob Staudinger
none Details | Review
libgtk-java-2.8.4-win32.diff (14.74 KB, patch)
2006-04-24 12:26 UTC, Rob Staudinger
none Details | Review
libglade-java-2.12.3-win32-buggy.diff (6.70 KB, patch)
2006-04-24 12:27 UTC, Rob Staudinger
needs-work Details | Review
libglade-java-2.12.3-win32.diff (5.95 KB, patch)
2006-04-24 14:57 UTC, Rob Staudinger
none Details | Review

Description Rob Staudinger 2006-04-21 08:55:38 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
Comment 1 Rob Staudinger 2006-04-21 08:56:55 UTC
Created attachment 64016 [details] [review]
glib-java-0.2.4-win32.diff

Patch for building on win32/mingw.
Comment 2 Rob Staudinger 2006-04-21 08:57:50 UTC
Created attachment 64017 [details] [review]
cairo-java-1.0.3-win32.diff

Patch for building on win32/mingw.
Comment 3 Rob Staudinger 2006-04-21 08:58:19 UTC
Created attachment 64018 [details] [review]
libgtk-java-2.8.4-win32.diff

Patch for building on win32/mingw.
Comment 4 Rob Staudinger 2006-04-21 08:58:43 UTC
Created attachment 64019 [details] [review]
libglade-java-2.12.3-win32.diff

Patch for building on win32/mingw.
Comment 5 Rob Staudinger 2006-04-21 11:32:03 UTC
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.
Comment 6 Rob Staudinger 2006-04-24 12:24:48 UTC
Created attachment 64195 [details] [review]
glib-java-0.2.4-win32.diff

Patch improved not to break linux build.
Comment 7 Rob Staudinger 2006-04-24 12:25:31 UTC
Created attachment 64196 [details] [review]
cairo-java-1.0.3-win32.diff

Patch improved not to break linux build.
Comment 8 Rob Staudinger 2006-04-24 12:26:01 UTC
Created attachment 64197 [details] [review]
libgtk-java-2.8.4-win32.diff

Patch improved not to break linux build.
Comment 9 Rob Staudinger 2006-04-24 12:27:19 UTC
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.
Comment 10 Rob Staudinger 2006-04-24 12:29:24 UTC
(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].
Comment 11 Rob Staudinger 2006-04-24 14:57:34 UTC
Created attachment 64206 [details] [review]
libglade-java-2.12.3-win32.diff
Comment 12 Remy Suen 2006-05-12 00:15:45 UTC
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?
Comment 13 Rob Staudinger 2006-05-12 06:03:38 UTC
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.
Comment 14 Mehdi Rabah 2006-06-15 20:42:37 UTC
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
Comment 15 Rob Staudinger 2006-06-16 07:23:36 UTC
Maybe they added it to the mainline distribution?
Comment 16 Mehdi Rabah 2006-06-16 07:53:06 UTC
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
Comment 17 Andrew Cowie 2006-06-16 07:55:12 UTC
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
Comment 18 Andrew Cowie 2006-06-22 11:20:32 UTC
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
Comment 19 ttest 2006-12-06 17:45:22 UTC
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.
Comment 20 Andrew Cowie 2008-02-13 02:13:59 UTC
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.