Here's a partial patch to compile xmingw-gcc-3.4.1 with gcj support. However at the moment it doesn't create or install the libgcj.spec file, and I can't figure out how to get it to. Configure options are based on those I found at http://ranjitmathew.tripod.com/phartz/gcj/bldgcj.html
Created attachment 40130 [details, diff] gcj support for xmingw-gcc Patch for gcj and debug use flags
If you get this working I will happily add it. I think it should use the java use variable as I think that is what the normal gcc ebuild uses to enable gcj. Will have a play when I have time. Thanks
All the latest sys-devel/gcc ebuilds declare IUSE="... gcj ..." no java flag. Plus # euse -i gcj gcj [+] [C] [L] [sys-devel/gcc] : Build gcj (java compiler included with gcc package)
Looks like you have modified your patch after you tested it to neaten it up! All minor stuff. Like config being set and not being used, $myconf="" not being right. For the spec file, it needs to be moved after the make install step has finished, see the regular gcc ebuild. Same problem there, also google has some information.
Done. See xmingw-gcc-3.4.1-r1.ebuild I had to remove --enable-version-specific-runtime-libs config option as that was causing problems with finding libraries and spec files. Also fixed up the typos. Tested with: hello.java class hello { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } } $ i386-mingw32msvc-gcj hello.java --main=hello $ ls -l a.exe -rwxr-xr-x 1 saj users 15347637 Sep 22 11:01 a.exe $ wine ./a.exe Hello World! All works then ... but gcj and java is horrible, 15Mb exe ?!?!