Bug 30384 - configure should check gcj version
Summary: configure should check gcj version
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.93
: P3 normal
Target Milestone: 0.97
Assignee: Dalibor Topic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-05 16:21 UTC by Nick
Modified: 2008-06-15 22:27 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2007-07-31 16:23:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2007-01-05 16:21:00 UTC
Hello!

I tried to compile the latest classpath release and receive following error:

make[2]: Entering directory `/tmp/tt/classpath-0.93/lib'
/usr/bin/gcj -Wno-deprecated --encoding=UTF-8 --bootclasspath '' --classpath ..:../vm/reference:..:../external/w3c_dom:../external/sax:../external/relaxngDatatype:.:: -C -d . -MD -MF lists/gnu-CORBA-CDR.deps -MT lists/gnu-CORBA-CDR.stamp -MP @lists/gnu-CORBA-CDR.list
../javax/swing/text/html/HTMLDocument.java:1557: error: Type `ElementSpec' not found in the declaration of the local variable `elems'.
         ElementSpec[] elems = new ElementSpec[size];
         ^
1 error
make[2]: *** [lists/gnu-CORBA-CDR.stamp] error 1
make[2]: Leaving directory `/tmp/tt/classpath-0.93/lib'
make[1]: *** [compile-classes] error 2
make[1]: Leaving directory `/tmp/tt/classpath-0.93/lib'
make: *** [all-recursive] error 1
Comment 1 Mark Wielaard 2007-01-05 16:48:09 UTC
Which version of gcj are you using to compile? Note that the INSTALL notes say GCJ 4.0+ (part of the GNU GCC package), but in reality you might actually need 4.1+.
Comment 2 Nick 2007-01-05 17:01:30 UTC
I'm using gcc-3.4.6!

Btw, it would be better to test version of GCJ during configuring phase!!!
Comment 3 Nick 2007-01-05 17:19:24 UTC
I tried to compile with gcc-4.1.1 but result is the same!!!
Comment 4 Mark Wielaard 2007-01-05 17:28:59 UTC
Yeah, you are right, the configure script should have checked for that.

Are you sure you configured with the new gcj in the PATH? Is the build really using the new gcj?
Comment 5 Nick 2007-01-05 18:56:31 UTC
For gcc-4.1.1 I'm running this command:
CC=gcc4 ./configure
Comment 6 Mark Wielaard 2007-01-05 20:49:21 UTC
And which gcj does configure detect?
You might need/want to use --with-gcj=/path/to/gcj
Comment 7 Nick 2007-01-06 09:14:04 UTC
Thanks!

With using the key:
 --with-gcj=/usr/local/bin/gcj
I was able to compile classpath-0.93!

/usr/local/bin/gcj --version
gcj (GCC) 4.1.1
Comment 8 Mark Wielaard 2007-01-06 09:57:46 UTC
Thanks for trying and sorry that configure didn't detect the right gcj to use. I'll keep this bug open, but retitled it. For 0.94 we need ecj or gcj that understands the 1.5 language extensions. We need to add a configure check for that.
Comment 9 Dalibor Topic 2007-07-31 16:23:40 UTC
I think we could use http://autoconf-archive.cryp.to/ac_try_compile_java.html to compile a small test file using generics, and abort configure if that fails.
Comment 10 Andrew John Hughes 2008-03-07 10:37:44 UTC
We do this now by checking that the compiler (whether ecj, javac or gcj) can compile 1.5 code.

Do we still need a check for gcc however?
Comment 11 Dalibor Topic 2008-03-07 18:22:11 UTC
I don't think we need a specific gcc check, as distributions tend to ship gcj in mashed up versions that don't really correspond to a specific FSF release, so testing for a gcc version wouldn't be nearly as useful as the current test.
Comment 12 Andrew John Hughes 2008-06-15 22:27:00 UTC
I believe this is now fixed. Closing.