This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Avoiding cross-dependencies for aclocal.m4



This guy looks good to me.  Any objection?

----------------------------------------------------------------------

Hello!
"ACLOCAL_AMFLAGS = -I ." causes circular dependencies. The patch fixes
this problem, eliminates an extra occurence of acinclude.m4 and strips
"./" from the remaining macro files in "."

A test for the above patch is also provided.

Regards,
Pavel Roskin

====================
Index: ChangeLog
--- ChangeLog	Tue Aug 29 08:22:50 2000
+++ ChangeLog	Tue Aug 29 16:50:52 2000
@@ -0,0 +1,7 @@
+2000-08-29  Pavel Roskin  <proski@gnu.org>
+
+	* automake.in (handle_aclocal_m4): exclude aclocal.m4 and
+	acinclude.m4 from the dependencies of aclocal.m4 to avoid
+	circular and duplicated dependencies. Strip "./" from the
+	dependencies.
+
Index: automake.in
--- automake.in	Tue Aug 29 16:44:49 2000
+++ automake.in	Tue Aug 29 16:47:58 2000
@@ -3178,7 +3178,13 @@
 		    $examine_next = 0;
 		    if ($amdir !~ /^\// && -d $amdir)
 		    {
-			push (@ac_deps, &my_glob ($amdir . '/*.m4'));
+			foreach $ac_dep (&my_glob ($amdir . '/*.m4'))
+			{
+			    $ac_dep =~ s/^\.\/*//;
+			    push (@ac_deps, $ac_dep)
+				unless $ac_dep eq "aclocal.m4"
+				    || $ac_dep eq "acinclude.m4";
+			}
 		    }
 		}
 		elsif ($amdir eq '-I')
Index: tests/ChangeLog
--- tests/ChangeLog	Tue Aug 29 17:08:10 2000
+++ tests/ChangeLog	Tue Aug 29 16:59:54 2000
@@ -0,0 +1,5 @@
+2000-08-29  Pavel Roskin  <proski@gnu.org>
+
+	* Makefile.am (TESTS): Added aclocali1.test.
+	* aclocali1.test: New file.
+
Index: tests/Makefile.am
--- tests/Makefile.am	Tue Aug 29 08:22:50 2000
+++ tests/Makefile.am	Tue Aug 29 17:00:05 2000
@@ -7,6 +7,7 @@
 acinclude.test \
 aclocal.test \
 aclocali.test \
+aclocali1.test \
 aclocalii.test \
 acoutnoq.test \
 acoutput.test \
Index: tests/aclocali1.test
--- tests/aclocali1.test	Thu Jan  1 00:00:00 1970
+++ tests/aclocali1.test	Tue Aug 29 17:06:33 2000
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+# Make sure that ACLOCAL_AMFLAGS doesn't cause circular dependencies.
+. $srcdir/defs || exit 1
+
+echo AM_QUUX >> configure.in
+
+cat > quux.m4 << 'END'
+AC_DEFUN([AM_QUUX], [
+])
+END
+
+cat > Makefile.am << 'END'
+ACLOCAL_AMFLAGS = -I .
+END
+
+# We have to run aclocal first to make sure that aclocal.m4 exists.
+# Otherwise automake won't guess that we want to auto-generate it.
+$ACLOCAL -I . || exit 1
+
+$AUTOMAKE || exit 1
+
+grep "\$(ACLOCAL_M4): *configure.in *quux.m4" Makefile.in || exit 1
====================






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]