autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoreconf and e.g. GNUmakefile.am


From: Noah Misch
Subject: autoreconf and e.g. GNUmakefile.am
Date: Thu, 30 Dec 2004 09:21:18 -0800
User-agent: Mutt/1.5.6i

Given FOO.am and AC_CONFIG_FILES([FOO]), Automake will create FOO.in for any
FOO; it just so happens that FOO := `Makefile' is most common.  Apparently a few
projects use or have used `GNUmakefile.am' in particular.  autoreconf looked for
Makefile.am to decide whether the package used Automake, and therefore it did
not work for such packages.

This patch makes autoreconf trace for AM_INIT_AUTOMAKE and assume the package
uses Automake iff its configure.{in,ac} calls that macro.

This applies atop the autoreconf patch I posted earlier.  I took the opportunity
to fix a style wart I introduced, add a banner for the autoreconf tests, and
clean up the new test names accordingly.

Original report:
http://lists.gnu.org/archive/html/autoconf/2004-10/msg00035.html

2004-12-30  Noah Misch  <address@hidden>

        * bin/autoreconf.in (autoreconf_current_directory):  AM_INIT_AUTOMAKE
        signals that the package uses Automake; a `Makefile.am' is typical but
        not essential.  Reported by Magnus Therning.
        * tests/torture.at (autoreconf.): New banner.
        (autoreconf and non-AC configure): Rename to `Non-Autoconf
        AC_CONFIG_SUBDIRS'.
        (autoreconf an empty directory): Rename to `Empty directory'.
        (Unusual Automake input files): New test.

diff -urp -X dontdiff ac-reconf_base/bin/autoreconf.in 
ac-foo_am/bin/autoreconf.in
--- ac-reconf_base/bin/autoreconf.in    2004-12-30 09:50:38.955439588 -0500
+++ ac-foo_am/bin/autoreconf.in 2004-12-30 11:31:37.187259340 -0500
@@ -305,7 +305,7 @@ sub autoreconf_current_directory ()
 
   my $uses_autoconf;
   my $uses_gettext;
-  if(-f $configure_ac)
+  if (-f $configure_ac)
     {
       my $configure_ac_file = new Autom4te::XFile $configure_ac;
       while ($_ = $configure_ac_file->getline)
@@ -433,6 +433,7 @@ sub autoreconf_current_directory ()
   my $uses_gettext_via_traces;
   my $uses_libtool;
   my $uses_autoheader;
+  my $uses_automake;
   my @subdir;
   verb "$configure_ac: tracing";
   my $traces = new Autom4te::XFile
@@ -447,6 +448,7 @@ sub autoreconf_current_directory ()
             'AC_PROG_LIBTOOL',
             'LT_INIT',
             'AM_GNU_GETTEXT',
+            'AM_INIT_AUTOMAKE',
            )
      . ' |');
   while ($_ = $traces->getline)
@@ -456,6 +458,7 @@ sub autoreconf_current_directory ()
       $uses_gettext_via_traces = 1  if /AM_GNU_GETTEXT/;
       $uses_libtool = 1             if /(AC_PROG_LIBTOOL|LT_INIT)/;
       $uses_autoheader = 1          if /AC_CONFIG_HEADERS/;
+      $uses_automake = 1            if /AM_INIT_AUTOMAKE/;
       push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
     }
 
@@ -577,8 +580,7 @@ sub autoreconf_current_directory ()
   # Running automake.  #
   # ------------------ #
 
-  # Assumes that there is a Makefile.am in the topmost directory.
-  if (!-f 'Makefile.am')
+  if (!$uses_automake)
     {
       verb "$configure_ac: not using Automake";
     }
Only in ac-foo_am/bin: autoreconf.in.orig
diff -urp -X dontdiff ac-reconf_base/tests/torture.at ac-foo_am/tests/torture.at
--- ac-reconf_base/tests/torture.at     2004-12-30 09:50:38.957440332 -0500
+++ ac-foo_am/tests/torture.at  2004-12-30 11:43:25.844781390 -0500
@@ -533,6 +533,9 @@ AT_CHECK_CONFIGURE([], 1, ignore, ignore
 AT_CLEANUP
 
 
+
+AT_BANNER([autoreconf.])
+
 ## ---------------------------- ##
 ## Configuring subdirectories.  ##
 ## ---------------------------- ##
@@ -711,11 +714,11 @@ AT_CLEANUP
 
 
 
-## ------------------------------- ##
-## autoreconf and non-AC configure ##
-## ------------------------------- ##
+## -------------------------------- ##
+## Non-Autoconf AC_CONFIG_SUBDIRS.  ##
+## -------------------------------- ##
 
-AT_SETUP([autoreconf and non-AC configure])
+AT_SETUP([Non-Autoconf AC_CONFIG_SUBDIRS])
 AT_KEYWORDS([autoreconf])
 
 # We use aclocal (via autoreconf).
@@ -754,11 +757,11 @@ AT_CLEANUP
 
 
 
-## ----------------------------- ##
-## autoreconf an empty directory ##
-## ----------------------------- ##
+## ----------------- ##
+## Empty directory.  ##
+## ----------------- ##
 
-AT_SETUP([autoreconf an empty directory])
+AT_SETUP([Empty directory])
 AT_KEYWORDS([autoreconf])
 
 # We use aclocal (via autoreconf).
@@ -770,3 +773,34 @@ AT_CHECK([aclocal --version || exit 77],
 AT_CHECK([autoreconf -Wall -v], 1, [ignore], [ignore])
 
 AT_CLEANUP
+
+
+
+## ------------------------------ ##
+## Unusual Automake input files.  ##
+## ------------------------------ ##
+
+# This parallels gnumake.test in Automake.
+
+AT_SETUP([Unusual Automake input files])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal and automake via autoreconf.
+AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])
+
+AT_DATA([configure.in],
+[[AC_INIT(GNU foo, 1.0)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([HeeHee])
+AC_OUTPUT
+]])
+
+AT_DATA([HeeHee.am],
+[[# Humans do no worse than `GNUmakefile.am'.
+AUTOMAKE_OPTIONS = foreign
+]])
+
+AT_CHECK([autoreconf -Wall -v -i], 0, [ignore], [ignore])
+AT_CHECK([test -f HeeHee.in])
+
+AT_CLEANUP
diff -urp -X dontdiff ac-reconf_base/THANKS ac-foo_am/THANKS
--- ac-reconf_base/THANKS       2004-12-30 09:50:38.958440704 -0500
+++ ac-foo_am/THANKS    2004-12-30 11:47:13.147306319 -0500
@@ -118,6 +118,7 @@ Larry Schmitt               address@hidden
 Larry Schwimmer             address@hidden
 Lars Hecking                address@hidden
 Lars J. Aas                 address@hidden
+Magnus Therning             address@hidden
 Marc Espie                  address@hidden
 Marcus Daniels              address@hidden
 Marcus Thiessel             address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]