]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoreconf.in (autoreconf_current_directory): AM_INIT_AUTOMAKE
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Jan 2005 17:15:40 +0000 (17:15 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Jan 2005 17:15:40 +0000 (17:15 +0000)
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.

ChangeLog
THANKS
bin/autoreconf.in
tests/torture.at

index f645e90494c5b7aab0f683e460414c60eaef8815..1a07e44dbf95994688d6074548656f9c38f3a6ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-12-30  Noah Misch  <noah@cs.caltech.edu>
+
+       * 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.
+
 2004-12-30  Noah Misch  <noah@cs.caltech.edu>
 
        * lib/autotest/general.m4 (AT_CAPTURE_FILE): New macro.
diff --git a/THANKS b/THANKS
index 61bb757fc3b81aaaf4afe28f7b730846b1524507..7a47cce15d208428193d6554566ac58c0e46b952 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -32,6 +32,7 @@ Bruno Haible                haible@ilog.fr
 Carl Edman                  cedman@princeton.edu
 Carlos Velasco              carlosev@newipnet.com
 Chad R. Larson              chad@anasazi.com
+Charles 'Buck' Krasic       krasic@cs.ubc.ca
 Chris P. Ross               cross@uu.net
 Chris Provenzano            proven@cygnus.com
 Christian Cornelssen        ccorn@cs.tu-berlin.de
@@ -117,6 +118,7 @@ Larry Schmitt               larry@mail.haleakalawebdesigns.com
 Larry Schwimmer             rosebud@cyclone.stanford.edu
 Lars Hecking                lhecking@nmrc.ucc.ie
 Lars J. Aas                 larsa@sim.no
+Magnus Therning             therning@gforge.natlab.research.philips.com
 Marc Espie                  Marc.Espie@liafa.jussieu.fr
 Marcus Daniels              marcus@sysc.pdx.edu
 Marcus Thiessel             marcus@xemacs.org
index 4028a9be1e366475d7b718c3072128717250735b..598f37196ebff02bc51a84ce3204d363714e4f7f 100644 (file)
@@ -6,7 +6,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
 # autoreconf - install the GNU Build System in a directory tree
-# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -297,7 +297,7 @@ sub run_aclocal ($$)
 # -----------------------------
 sub autoreconf_current_directory ()
 {
-  my $configure_ac = require_configure_ac;
+  my $configure_ac = find_configure_ac;
 
   # ---------------------- #
   # Is it using Autoconf?  #
@@ -305,16 +305,18 @@ sub autoreconf_current_directory ()
 
   my $uses_autoconf;
   my $uses_gettext;
-  my $configure_ac_file = new Autom4te::XFile $configure_ac;
-  while ($_ = $configure_ac_file->getline)
-     {
-       s/#.*//;
-       s/dnl.*//;
-       $uses_autoconf = 1 if /AC_INIT/;
-       # See below for why we look for gettext here.
-       $uses_gettext = 1  if /^AM_GNU_GETTEXT_VERSION/;
-     }
-
+  if (-f $configure_ac)
+    {
+      my $configure_ac_file = new Autom4te::XFile $configure_ac;
+      while ($_ = $configure_ac_file->getline)
+        {
+          s/#.*//;
+          s/dnl.*//;
+          $uses_autoconf = 1 if /AC_INIT/;
+          # See below for why we look for gettext here.
+          $uses_gettext = 1  if /^AM_GNU_GETTEXT_VERSION/;
+        }
+    }
   if (!$uses_autoconf)
     {
       verb "$configure_ac: not using Autoconf";
@@ -431,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
@@ -445,6 +448,7 @@ sub autoreconf_current_directory ()
             'AC_PROG_LIBTOOL',
             'LT_INIT',
             'AM_GNU_GETTEXT',
+            'AM_INIT_AUTOMAKE',
            )
      . ' |');
   while ($_ = $traces->getline)
@@ -454,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:(.*)/;
     }
 
@@ -575,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";
     }
@@ -654,6 +658,7 @@ parse_args;
 # since the list can change at runtime because of AC_CONFIG_SUBDIRS.
 for my $directory (@ARGV)
   {
+    require_configure_ac;
     autoreconf ($directory);
   }
 
index 1f06a3e5b262badb6e0dea465fae45392eddff8c..9f06305aa0d42ffb0153a946d18dbe0ca7710c00 100644 (file)
@@ -533,6 +533,9 @@ AT_CHECK_CONFIGURE([], 1, ignore, ignore)
 AT_CLEANUP
 
 
+
+AT_BANNER([autoreconf.])
+
 ## ---------------------------- ##
 ## Configuring subdirectories.  ##
 ## ---------------------------- ##
@@ -708,3 +711,96 @@ AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,
 ]])
 
 AT_CLEANUP
+
+
+
+## -------------------------------- ##
+## Non-Autoconf AC_CONFIG_SUBDIRS.  ##
+## -------------------------------- ##
+
+AT_SETUP([Non-Autoconf AC_CONFIG_SUBDIRS])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+AT_DATA([install-sh], [])
+AT_DATA([configure.in],
+[[AC_INIT(GNU Outer, 1.0)
+AC_CONFIG_SUBDIRS([inner])
+AC_OUTPUT
+]])
+
+AS_MKDIR_P([inner])
+
+AT_DATA([inner/configure],
+[[#! /bin/sh
+case "$*" in
+    *--help*) echo 'No Autoconf here, folks!' ;;
+    *)        echo got_it >myfile ;;
+esac
+exit 0
+]])
+chmod +x inner/configure
+
+AT_CHECK([autoreconf -Wall -v], 0, [ignore], [ignore])
+
+# Running the outer configure recursively should provide the innermost
+# help strings.
+AT_CHECK([./configure --help=recursive | grep "folks"], 0, [ignore])
+
+# Running the outer configure should trigger the inner.
+AT_CHECK([./configure], 0, [ignore])
+AT_CHECK([test -f inner/myfile], 0)
+
+AT_CLEANUP
+
+
+
+## ----------------- ##
+## Empty directory.  ##
+## ----------------- ##
+
+AT_SETUP([Empty directory])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+# The test group directory is not necessarily _empty_, but it does not contain
+# files meaningful to `autoreconf'.
+
+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