On Jul  9, 2000, Alexandre Oliva <[EMAIL PROTECTED]> wrote:

> On Jul  9, 2000, Mo DeJong <[EMAIL PROTECTED]> wrote:
>> appending configuration tag "GCJ" to libtool

> Huh?  What the hack is GCJ doing here?

I've just figured it out.  Even though your autoconf didn't refer to
GCJ, libtool.m4 did, so aclocal brought automake's AM_PROG_GCJ into
aclocal.m4, but after having copied libtool.m4 there.  Since
libtool.m4's hooks were always run, AM_PROG_GCJ would be defined to
[AC_LIBTOOL_GCJ ] before automake's definition.  Then, automake's .m4
fragment would:

AC_DEFUN(AM_PROG_GCJ, ...)

without quoting AM_PROG_GCJ, so it would be expanded as previously
defined by libtool, and things would fall from there on.

The failure would have been different if automake defined AM_PROG_GCJ
with proper quoting.  OTOH, we might have failed to notice that
AM_PROG_GCJ might not expand AC_LIBTOOL_GCJ for a longer time :-)

Here's a patch that fixes this problem.  I'm checking it in right now.

Index: ChangeLog
from  Alexandre Oliva  <[EMAIL PROTECTED]>

	* libtool.m4 (AM_PROG_GCJ): Quote it so that aclocal won't bring
	it in if it only appears in libtool.m4.
	(AC_PROG_LIBTOOL): Move AC_PROG_CXX, AC_PROG_GCJ and AM_PROG_GCJ
	hooks here, so that they can be far simpler!

Index: libtool.m4
===================================================================
RCS file: /home/cvs/libtool/libtool.m4,v
retrieving revision 1.71.2.21
diff -u -r1.71.2.21 libtool.m4
--- libtool.m4	2000/06/18 03:02:52	1.71.2.21
+++ libtool.m4	2000/07/10 04:16:50
@@ -22,7 +22,28 @@
 ## the same distribution terms that you use for the rest of that program.
 
 # serial 45 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])])
+AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
+# If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+# immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+])])
+#
+# Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+# If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+# AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+        [AC_LIBTOOL_GCJ],
+	[ifdef([AC_PROG_GCJ],
+	       [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])#
+	 ifdef([A][M_PROG_GCJ],
+	       [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])])])])
+
 AC_DEFUN(_AC_PROG_LIBTOOL,
 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
@@ -787,50 +808,6 @@
 # clobbered by the next message.
 exec 5>>./config.log
 ])
-
-# If both AC_PROG_CXX and AC_PROG_LIBTOOL have already been expanded,
-# run AC_LIBTOOL_CXX immediately, otherwise, only expand it after the
-# latter of them.
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_CXX],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_CXX
-])])],
-    [define([AC_PROG_CXX],
-	    defn([AC_PROG_CXX])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_CXX],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_CXX
-])])])])
-
-# If both A[CM]_PROG_CXX and AC_PROG_LIBTOOL have already been
-# expanded, run AC_LIBTOOL_GCJ immediately, otherwise, only expand it
-# after the latter of them.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_GCJ],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
-])])],
-    [define([AC_PROG_GCJ],
-	    defn([AC_PROG_GCJ])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_GCJ],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
-])])])])
-AC_PROVIDE_IFELSE([AM_PROG_GCJ],
-    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_GCJ],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
-])])],
-    [define([AM_PROG_GCJ],
-	    defn([AM_PROG_GCJ])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
-	[AC_LIBTOOL_GCJ],
-	[define([AC_PROG_LIBTOOL],
-		defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
-])])])])
 
 dnl old names
 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Reply via email to