From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13177 invoked by alias); 29 May 2007 16:32:59 -0000 Received: (qmail 13163 invoked by uid 22791); 29 May 2007 16:32:58 -0000 X-Spam-Check-By: sourceware.org Received: from pollux.ds.pg.gda.pl (HELO pollux.ds.pg.gda.pl) (153.19.208.7) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 May 2007 16:32:53 +0000 Received: from localhost (localhost [127.0.0.1]) by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 9D255E1C96; Tue, 29 May 2007 18:32:39 +0200 (CEST) Received: from pollux.ds.pg.gda.pl ([127.0.0.1]) by localhost (pollux.ds.pg.gda.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OS4YPHtepJ1x; Tue, 29 May 2007 18:32:39 +0200 (CEST) Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8]) by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 242D2E1C63; Tue, 29 May 2007 18:32:39 +0200 (CEST) Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6]) by piorun.ds.pg.gda.pl (8.13.8/8.13.8) with ESMTP id l4TGWpOD005811; Tue, 29 May 2007 18:32:51 +0200 Date: Tue, 29 May 2007 17:16:00 -0000 From: "Maciej W. Rozycki" To: Andrew Haley cc: "H. J. Lu" , Paolo Bonzini , Matthias Klose , gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org, libtool-patches@gnu.org Subject: Re: PATCH: PR libjava/32078: Update libtool in classpath In-Reply-To: <18012.17552.775177.92152@zebedee.pink> Message-ID: References: <465C2ECF.3040006@gnu.org> <18012.13131.22905.678441@zebedee.pink> <20070529142459.GA12924@lucon.org> <18012.14391.920909.161358@zebedee.pink> <20070529143628.GA13198@lucon.org> <18012.15175.218349.19687@zebedee.pink> <18012.15270.203430.143935@zebedee.pink> <465C3D67.1000001@gnu.org> <20070529145928.GA13402@lucon.org> <465C4185.7050604@gnu.org> <20070529151552.GA13457@lucon.org> <18012.17552.775177.92152@zebedee.pink> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Status: Clean X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg02008.txt.bz2 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