libgcj and MinGW, compilation problem
Marco Trudel
marco@mtsystems.ch
Wed Dec 5 19:46:00 GMT 2007
Mathieu Velten wrote:
> Hello !
> I crosspost here because of a recommendation on the gcc-help mailing
> list, sorry for the double post.
>> I am trying to make a build of GCC 4.2.2 with GCJ for MinGW.
So you're building on MinGW? Building on MinGW is usually very
unreliable. Building in Cygwin is a little better, but not really. The
problem is that there is no Windows GCJ maintainer. The guys who build
GCJ for Windows (Me, Mohan Embar and Ranjit Mathew are the ones who do
or did it frequently) therefore cross-compile it on Linux.
Ranjit Mathew wrote a tutorial in 2004 or so. Although quite old, it
still holds. Unfortunately he took the page offline months (years?) ago.
But waybackmachine.org is our friend:
http://web.archive.org/web/20041102054424/http://ranjitmathew.tripod.com/phartz/gcj/bldgcj.html
Hope that helps
Marco
> I first tried with :
> ../gcc-4.2.2/configure --enable-languages=c,c++,java -v
> --enable-optimize --prefix=/mingw --oldincludedir=/mingw/include
> --enable-threads --disable-nls --disable-win32-registry
> --disable-shared --without-x
>> it compiled without any problem but when I try to launch gcj it
> complains about the lack of libgcj, and effectivly libgcj is not
> present. No problems with gcc or g++.
>> so I tried to add --enable-libgcj
> and then I now have problems at the compilation time. the errors begin
> like that :
>> make[4]: Entering directory
> `/D/SVN/compil/i686-pc-mingw32/libjava/classpath/tools'
> mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
> mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
> mkdir -p classes/gnu/classpath/tools/appletviewer
> mkdir -p classes/gnu/classpath/tools/jarsigner
> mkdir -p classes/gnu/classpath/tools/keytool
> cp ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/*.jav
> classes/gnu/classpath/tools/rmi/rmic/templates
> cp ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/*.jav
> classes/gnu/classpath/tools/giop/grmic/templates
> cp ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/rmi/*.txt
> classes/gnu/classpath/tools/rmi/
> cp ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/giop/*.txt
> classes/gnu/classpath/tools/giop/
> /D/SVN/compil/gcc/gcj -B/D/SVN/compil/i686-pc-mingw32/libjava/
> -B/D/SVN/compil/gcc/ -encoding UTF-8 --bootclasspath
> '../lib':'../lib/glibj.zip' --classpath . -C -d classes
> ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/*.java
> ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/*/*.java
> ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/*/*/*.java
> ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/AbstractMethodGenerator.java:0:
> error: Can't find default package 'java.lang'. Check the CLASSPATH
> environment variable and the access to the archives
>> and finish like that :
>> ../../../../../gcc-4.2.2/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java:0:
> error: cannot find file for class java.lang.Object
> 2651 errors
> make[4]: *** [tools.jar] Error 1
> make[4]: Leaving directory
> `/D/SVN/compil/i686-pc-mingw32/libjava/classpath/tools'
> make[4]: Entering directory `/D/SVN/compil/i686-pc-mingw32/libjava/classpath'
> true DO=all multi-do # make
> make[4]: Leaving directory `/D/SVN/compil/i686-pc-mingw32/libjava/classpath'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/D/SVN/compil/i686-pc-mingw32/libjava/classpath'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/D/SVN/compil/i686-pc-mingw32/libjava'
> make[1]: *** [all-target-libjava] Error 2
> make[1]: Leaving directory `/D/SVN/compil'
> make: *** [bootstrap] Error 2
>> I tried to add also --enable-libjava but I have the same errors.
>> my build environment :
> w32api-3.10.tar.gz
> binutils-2.17.50-20060824-1.tar.gz
> mingw32-make-3.81-2.tar.gz
> mingw-runtime-3.13.tar.gz
> pthreads-2.8.0
> bison-2.1.0
> gcc-4.2.2
>> Any suggestions to solve this problem ?
>> Thanks in advance for your answers.
>> Kind regards,
>> Mathieu Velten
More information about the Java
mailing list