When gcc is configured with, for example, "--without-pkgversion", this part of libjava configure script parses "gcj -v" output incorrectly, thus encoding garbage as preprocessor macro and failing: gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'` An obvious fix would be: Index: gcc43/libjava/configure.ac =================================================================== --- gcc43.orig/libjava/configure.ac +++ gcc43/libjava/configure.ac @@ -1369,7 +1369,7 @@ AC_SUBST(toolexecmainlibdir) AC_SUBST(toolexeclibdir) # Determine gcj and libgcj version number. -gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'` +gcjversion=`$GCJ -v 2>&1 | awk '/^gcc version/ { print $3 }'` libgcj_soversion=`awk -F: '/^[[^#]].*:/ { print $1 }' $srcdir/libtool-version` GCJVERSION=$gcjversion AC_SUBST(GCJVERSION) Introduced by: r127025 | doko | 2007-07-29 00:32:27 +0400 (Sun, 29 Jul 2007) | 6 lines 2007-07-28 Matthias Klose <doko@ubuntu.com> * configure.ac: Encode the libgcj soversion in dbexecdir, pass --with-native-libdir to classpath configure. * configure: Regenerate.
Subject: Re: New: [4.3 Regression] libjava fails to compile if configure argument contains "version" belyshev at depni dot sinp dot msu dot ru schrieb: > When gcc is configured with, for example, "--without-pkgversion", this part of > libjava configure script parses "gcj -v" output incorrectly, thus encoding > garbage as preprocessor macro and failing: > > gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'` > > An obvious fix would be: > -gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'` > +gcjversion=`$GCJ -v 2>&1 | awk '/^gcc version/ { print $3 }'` doesn't look robust either; what about gcjversion=`cat $srcdir/../gcc/BASE-VER`
(In reply to comment #1) >> doesn't look robust either; what about > > gcjversion=`cat $srcdir/../gcc/BASE-VER` > Agreed, that's much better. To be even more robust, add quotes: gcjversion=`cat "$srcdir/../gcc/BASE-VER"`
Subject: Bug 33278 Author: doko Date: Tue Sep 4 21:32:41 2007 New Revision: 128104 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128104 Log: 2007-09-05 Matthias Klose <doko@ubuntu.com> PR libgcj/33278 * configure.ac: Robustify extraction of gcj version. * configure: Regenerate. Modified: trunk/libjava/ChangeLog trunk/libjava/configure trunk/libjava/configure.ac
Since a patch has been checked in, can this issue be closed?
Fixed.