This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR libjava/32078: Update libtool in classpath
On Tue, 29 May 2007, Andrew Haley wrote:
> > Bulding an XXX language run-time library is a very special case. You
> > can't build an XXX language run-time library, assuming the XXX language
> > compiler is fully functional. If upstream libtool can support it, it
> > is great. Otherwise, we have to do one of these 4:
> >
> > 1. Drop Java.
> > 2. Drop libtool for libjava.
> > 3. Hack libtool for libjava.
> > 4. Hack libjava configure to work around the libtool problem.
> >
> > I proposed #3 with a simple and straightforward work around. We may
> > have to keep it around forever.
>
> Perhaps we do #3 now, with a view to doing #4 later.
FYI, I built libjava of GCC 4.1.1 with upstream libtool 1.5.22
successfully a while ago with the patch as follows. No changes required
to libtool itself whatsoever. Of course the patch is on my ever pending
list of patches to submit, but given the version there would normally be
no point to in its current form.
Now given the issue discussed here, it may save somebody unnecessary
work. It applies almost successfully ;-) and the rejects do not seem to
look terribly hopeless, so I guess with little effort it could get
integrated. I might do the work if this approach looked interesting, but
I am afraid I may not be able to afford the resources to switch to HEAD
for testing right now.
Maciej
gcc-4.1.1-libjava-ac25.patch
diff -bup --recursive --new-file gcc-4.1.1.macro/libjava/configure.ac gcc-4.1.1/libjava/configure.ac
--- gcc-4.1.1.macro/libjava/configure.ac 2006-04-11 20:09:32.000000000 +0000
+++ gcc-4.1.1/libjava/configure.ac 2007-02-02 00:02:55.000000000 +0000
@@ -160,6 +160,8 @@ AC_ARG_ENABLE(libgcj-debug,
LIBGCJDEBUG="enable"
fi])
+AC_PATH_XTRA
+
# Determine which AWT peer libraries to build
AC_ARG_ENABLE(java-awt,
AS_HELP_STRING([--enable-java-awt],
@@ -238,6 +240,55 @@ if test "$use_qt_awt" != yes; then
echo gnu/java/awt/peer/qt >> standard.omit
fi
+# Create it, so that compile/link tests don't fail
+test -f libgcj.spec || touch libgcj.spec
+
+# We must search the source tree for java.lang, since we still don't
+# have libgcj.jar nor java/lang/*.class
+GCJ_SAVE_CPPFLAGS=$CPPFLAGS
+GCJ_srcdir=`cd $srcdir && ${PWDCMD-pwd}`
+CPPFLAGS="$CPPFLAGS -Wno-deprecated -I`${PWDCMD-pwd}` -I$GCJ_srcdir -I$GCJ_srcdir/classpath -I$GCJ_srcdir/classpath/external/w3c_dom -I$GCJ_srcdir/classpath/external/sax"
+
+# Since some classes depend on this one, we need its source available
+# before we can do any GCJ compilation test :-(
+if test ! -f gnu/classpath/Configuration.java; then
+ test -d gnu || mkdir gnu
+ test -d gnu/classpath || mkdir gnu/classpath
+ # Note that it is not crucial that all the values here be correct.
+ sed -e "s,@prefix@,$prefix," \
+ -e "s,@VERSION@,$VERSION," \
+ -e "s,@LIBDEBUG@,false," \
+ -e "s,@INIT_LOAD_LIBRARY@,false," \
+ -e "s,@@,$LIBGCJDEBUG," \
+ -e "s,@default_toolkit@,$TOOLKIT," \
+ -e "s,@JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@,false," \
+ -e "s,@GTK_CAIRO_ENABLED@,false," \
+ < $srcdir/classpath/gnu/classpath/Configuration.java.in \
+ > gnu/classpath/Configuration.java
+ # We do not want to redirect the output of the grep below to /dev/null,
+ # but we add /dev/null to the input list so that grep will print the
+ # filename of Configuration.java in case it finds any matches.
+ if grep '@.*@' gnu/classpath/Configuration.java /dev/null; then
+ AC_MSG_ERROR([configure.ac is missing the substitutions above])
+ fi
+fi
+
+# Only use libltdl for non-newlib builds.
+if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
+ AC_LIBLTDL_CONVENIENCE
+ AC_LIBTOOL_DLOPEN
+ DIRLTDL=libltdl
+ AC_DEFINE(USE_LTDL, 1, [Define if libltdl is in use.])
+ # Sigh. Libtool's macro doesn't do the right thing.
+ INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
+ # FIXME: this is a hack.
+ sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
+ ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
+fi
+AC_SUBST(INCLTDL)
+AC_SUBST(LIBLTDL)
+AC_SUBST(DIRLTDL)
+
if test -z "${with_multisubdir}"; then
builddotdot=.
else
@@ -313,9 +364,6 @@ esac
AC_SUBST(GCJH)
AC_SUBST(ZIP)
-# Create it, so that compile/link tests don't fail
-test -f libgcj.spec || touch libgcj.spec
-
# Set up to configure Classpath.
@@ -345,24 +393,15 @@ dnl gjdoc?
dnl gtk-cairo -- just export here...
dnl --enable-regen-headers?
-# Only use libltdl for non-newlib builds.
-if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
- AC_LIBLTDL_CONVENIENCE
- AC_LIBTOOL_DLOPEN
- DIRLTDL=libltdl
- AC_DEFINE(USE_LTDL, 1, [Define if libltdl is in use.])
- # Sigh. Libtool's macro doesn't do the right thing.
- INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
- # FIXME: this is a hack.
- sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
- ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
-fi
-AC_SUBST(INCLTDL)
-AC_SUBST(LIBLTDL)
-AC_SUBST(DIRLTDL)
AC_PROG_LIBTOOL
AM_PROG_GCJ
AM_PROG_CC_C_O
+LT_AC_PROG_GCJ
+
+# Now remove it.
+rm -f gnu/classpath/Configuration.java
+
+CPPFLAGS=$GCJ_SAVE_CPPFLAGS
AC_CONFIG_SUBDIRS(classpath libltdl)
@@ -676,8 +715,6 @@ AC_SUBST(ZLIBSPEC)
ZLIBTESTSPEC=
AC_SUBST(ZLIBTESTSPEC)
-AC_PATH_XTRA
-
# determine whether to enable the cairo GTK Graphics2D backend
AC_ARG_ENABLE(gtk-cairo,
AS_HELP_STRING([--enable-gtk-cairo],
@@ -1165,42 +1202,6 @@ case $build in
esac
AC_SUBST(CLASSPATH_SEPARATOR)
-# We must search the source tree for java.lang, since we still don't
-# have libgcj.jar nor java/lang/*.class
-GCJ_SAVE_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`"
-
-# Since some classes depend on this one, we need its source available
-# before we can do any GCJ compilation test :-(
-if test ! -f gnu/classpath/Configuration.java; then
- test -d gnu || mkdir gnu
- test -d gnu/classpath || mkdir gnu/classpath
- # Note that it is not crucial that all the values here be correct.
- sed -e "s,@prefix@,$prefix," \
- -e "s,@VERSION@,$VERSION," \
- -e "s,@LIBDEBUG@,false," \
- -e "s,@INIT_LOAD_LIBRARY@,false," \
- -e "s,@@,$LIBGCJDEBUG," \
- -e "s,@default_toolkit@,$TOOLKIT," \
- -e "s,@JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@,false," \
- -e "s,@GTK_CAIRO_ENABLED@,false," \
- < $srcdir/classpath/gnu/classpath/Configuration.java.in \
- > gnu/classpath/Configuration.java
- # We do not want to redirect the output of the grep below to /dev/null,
- # but we add /dev/null to the input list so that grep will print the
- # filename of Configuration.java in case it finds any matches.
- if grep '@.*@' gnu/classpath/Configuration.java /dev/null; then
- AC_MSG_ERROR([configure.ac is missing the substitutions above])
- fi
-fi
-
-LT_AC_PROG_GCJ
-
-# Now remove it.
-rm -f gnu/classpath/Configuration.java
-
-CPPFLAGS=$GCJ_SAVE_CPPFLAGS
-
AC_CHECK_SIZEOF(void *)
AC_C_BIGENDIAN