From: Paul Eggert Date: Sun, 2 Jan 2005 17:15:40 +0000 (+0000) Subject: * bin/autoreconf.in (autoreconf_current_directory): AM_INIT_AUTOMAKE X-Git-Tag: AUTOCONF-2.59c~518 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8660164d69b4aa7bb7b69671ce84fa9af4559380;p=thirdparty%2Fautoconf.git * 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 --git a/ChangeLog b/ChangeLog index f645e9049..1a07e44db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-12-30 Noah Misch + + * 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 * lib/autotest/general.m4 (AT_CAPTURE_FILE): New macro. diff --git a/THANKS b/THANKS index 61bb757fc..7a47cce15 100644 --- 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 diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 4028a9be1..598f37196 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -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); } diff --git a/tests/torture.at b/tests/torture.at index 1f06a3e5b..9f06305aa 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -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