diff options
-rw-r--r-- | ChangeLog | 29 | ||||
-rwxr-xr-x | automake.in | 43 | ||||
-rwxr-xr-x | tests/cond4.test | 4 | ||||
-rwxr-xr-x | tests/condincl.test | 4 | ||||
-rwxr-xr-x | tests/confdeps.test | 14 | ||||
-rw-r--r-- | tests/defs | 44 | ||||
-rwxr-xr-x | tests/defun2.test | 2 | ||||
-rwxr-xr-x | tests/header.test | 5 | ||||
-rwxr-xr-x | tests/installsh.test | 3 | ||||
-rwxr-xr-x | tests/ldflags.test | 2 | ||||
-rwxr-xr-x | tests/lex.test | 1 | ||||
-rwxr-xr-x | tests/listval.test | 4 | ||||
-rwxr-xr-x | tests/suffix2.test | 3 |
13 files changed, 120 insertions, 38 deletions
@@ -1,3 +1,26 @@ +2001-10-21 Akim Demaille <akim@epita.fr> + + * tests/defs (ACLOCAL): Point to the installed aclocaldir is + libtool is required. + * tests/lex.test: Run AC_INIT once. + * tests/ldflags.test, tests/listval.test, tests/suffix2.test: + Libtool is required. + * tests/header.test: Built a correct configure.in. + * tests/defun2.test (configure.in): Be a bit respectful with + Autoconf, close the macro invocations. + * tests/confdeps.test: Even when not using aclocal, aclocal.m4 + must be correct. + + * automake.in (scan_autoconf_traces): Add support for + AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM, A[CM]_PROG_LIBTOOL, + AM_CONFIG_HEADER, AM_MAINTAINER_MODE. + * tests/condincl.test (target): Better pattern, to avoid matching + the definition of `target_alias' which is now properly discovered + as an AC_SUBST by traces. + * cond4.test: Better grep pattern: After all, why shouldn't + TWO_FALSE be AC_SUBST properly. + * tests/installsh.test (AUTOMAKE, ACLOCAL): Adjust. + 2001-10-20 Kevin Ryde <user42@zip.com.au> * lib/am/ansi2knr.am (mostlyclean-kr): Only rm *_.c when @@ -19,20 +42,17 @@ AC_CONFIG_AUX_DIR. * tests/alpha.test (configure.in): Automake wants a Makefile. - 2001-10-20 Akim Demaille <akim@epita.fr> * automake.in (scan_autoconf_traces): Use an unlikely to be used separator between trace arguments, in particular not `:' as it is within AC_CONFIG_FILES's $1. - 2001-10-20 Akim Demaille <akim@epita.fr> * tests/alpha.test (configure.in): Create, don't append. A single AC_INIT is enough. - 2001-10-20 Akim Demaille <akim@epita.fr> * tests/acoutnoq.test, tests/acoutput.test, tests/acoutput2.test, @@ -113,7 +133,6 @@ AC_ARG_PROGRAM, AC_PROG_INSTALL and AC_PROG_MAKE_SET invocation since AM_INIT_AUTOMAKE requires them. - 2001-10-20 Akim Demaille <akim@epita.fr> * tests/defs (configure.in): Use credible AM_INIT_AUTOMAKE @@ -159,13 +178,11 @@ (&scan_autoconf_files): Using autoconf traces is no longer a complement of the previous ad hoc scheme: use either. - 2001-10-20 Akim Demaille <akim@epita.fr> * automake.in (&scan_one_autoconf_file): `%generalize' is new, and factors dedicated $libsources assignments. - 2001-10-20 Akim Demaille <akim@epita.fr> * m4/error.m4, m4/obstack.m4, m4/ptrdiff.m4, m4/strtod.m4: diff --git a/automake.in b/automake.in index 953bf691f..b43dde5f2 100755 --- a/automake.in +++ b/automake.in @@ -4445,14 +4445,19 @@ sub scan_autoconf_traces ($) my ($filename) = @_; my @traced = ( + 'AC_CANONICAL_HOST', + 'AC_CANONICAL_SYSTEM', 'AC_CONFIG_AUX_DIR', 'AC_CONFIG_FILES', 'AC_LIBSOURCE', + 'AC_PROG_LIBTOOL', 'AM_PROG_LIBTOOL', 'AC_SUBST', 'AM_CONDITIONAL', + 'AM_CONFIG_HEADER', 'AM_C_PROTOTYPES', 'AM_GNU_GETTEXT', 'AM_INIT_AUTOMAKE', + 'AM_MAINTAINER_MODE', 'AM_PROG_CC_C_O', ); @@ -4474,7 +4479,16 @@ sub scan_autoconf_traces ($) my $here = "$file:$line"; # Alphabetical ordering please. - if ($macro eq 'AC_CONFIG_AUX_DIR') + if ($macro eq 'AC_CANONICAL_HOST') + { + $seen_canonical = $AC_CANONICAL_HOST + if ! $seen_canonical; + } + elsif ($macro eq 'AC_CANONICAL_SYSTEM') + { + $seen_canonical = $AC_CANONICAL_SYSTEM; + } + elsif ($macro eq 'AC_CONFIG_AUX_DIR') { @config_aux_path = $args[1]; $config_aux_dir_set_in_configure_in = 1; @@ -4496,10 +4510,33 @@ sub scan_autoconf_traces ($) { $configure_vars{$args[1]} = $here; } + elsif ($macro =~ /A(C|M)_PROG_LIBTOOL/) + { + $seen_libtool = $here; + $libtool_line = $line; + } elsif ($macro eq 'AM_CONDITIONAL') { $configure_cond{$args[1]} = $here; } + elsif ($macro eq 'AM_CONFIG_HEADER') + { + $config_header_line = $.; + foreach my $one_hdr (split (' ', $args[1])) + { + push (@config_fullnames, $one_hdr); + if ($one_hdr =~ /^([^:]+):(.+)$/) + { + push (@config_names, $1); + push (@config_headers, $2); + } + else + { + push (@config_names, $one_hdr); + push (@config_headers, $one_hdr . '.in'); + } + } + } elsif ($macro eq 'AM_C_PROTOTYPES') { $am_c_prototypes = $here; @@ -4515,6 +4552,10 @@ sub scan_autoconf_traces ($) $package_version_line = $line; $seen_init_automake = 1; } + elsif ($macro eq 'AM_MAINTAINER_MODE') + { + $seen_maint_mode = $here; + } elsif ($macro eq 'AM_PROG_CC_C_O') { $seen_cc_c_o = $here; diff --git a/tests/cond4.test b/tests/cond4.test index 7ba79ad1e..c7cf043c5 100755 --- a/tests/cond4.test +++ b/tests/cond4.test @@ -34,7 +34,9 @@ $needs_autoconf $ACLOCAL || exit 1 $AUTOMAKE || exit 1 -test "`grep TWO_FALSE Makefile.in | wc -l`" -eq 0 || exit 1 + +# We should not output useless definitions. +test "`grep '^@TWO_FALSE@' Makefile.in | wc -l`" -eq 0 || exit 1 $AUTOCONF || exit 1 (gcc -v) > /dev/null 2>&1 || exit 77 diff --git a/tests/condincl.test b/tests/condincl.test index 22f0753d7..e55e10c58 100755 --- a/tests/condincl.test +++ b/tests/condincl.test @@ -22,8 +22,8 @@ END $ACLOCAL || exit 1 $AUTOMAKE || exit 1 -grep '^target' Makefile.in && exit 1 +grep '^target:' Makefile.in && exit 1 -grep '^@TOBE_TRUE@target' Makefile.in || exit 1 +grep '^@TOBE_TRUE@target:' Makefile.in || exit 1 exit 0 diff --git a/tests/confdeps.test b/tests/confdeps.test index e6763f26a..3ad6bb7e3 100755 --- a/tests/confdeps.test +++ b/tests/confdeps.test @@ -7,15 +7,17 @@ echo "FOO = foo" > Makefile.am set -e -echo "$me: Not generated by aclocal..." -echo "Hello, universe!" > aclocal.m4 -$AUTOMAKE -grep '^\$(ACLOCAL_M4):' Makefile.in && exit 1 - - echo "$me: Generated by aclocal..." $ACLOCAL $AUTOMAKE grep '^\$(ACLOCAL_M4):' Makefile.in +echo "$me: Not generated by aclocal..." +# Pretend it is not from aclocal (remove the signature), +# but keep it correct, i.e., with AM_INIT_AUTOMAKE etc. +sed -n '3,$p' aclocal.m4 >aclocal.m4t +mv aclocal.m4t aclocal.m4 +$AUTOMAKE +grep '^\$(ACLOCAL_M4):' Makefile.in && exit 1 + exit 0 diff --git a/tests/defs b/tests/defs index c482eec53..de940809c 100644 --- a/tests/defs +++ b/tests/defs @@ -1,4 +1,4 @@ -# -*- ksh -*- +# -*- shell-script -*- # Defines for Automake testing environment. # Tom Tromey <tromey@cygnus.com> @@ -10,6 +10,21 @@ test -f $srcdir/defs || { me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` +# See how redirections should work. User can set VERBOSE to see all +# output. +test -z "$VERBOSE" && { + exec > /dev/null 2>&1 +} + +if test -n "$required" +then + for tool in $required + do + echo "$me: running $tool --version" + ( $tool --version ) || exit 77 + done +fi + # Always use an absolute srcdir. Otherwise symlinks made in subdirs # of the test dir just won't work. case "$srcdir" in @@ -34,20 +49,17 @@ cd ./testSubDir # Build appropriate environment in test directory. Eg create # configure.in, touch all necessary files, etc. +# Don't use AC_OUTPUT, but AC_CONFIG_FILES so that appending +# still produces a valid configure.ac. But then, tests running +# config.status really need to append AC_OUTPUT. cat > configure.in << END AC_INIT AM_INIT_AUTOMAKE($me, 1.0) AC_PROG_INSTALL AC_PROG_MAKE_SET -AC_OUTPUT(Makefile) +AC_CONFIG_FILES(Makefile) END -# See how redirections should work. User can set VERBOSE to see all -# output. -test -z "$VERBOSE" && { - exec > /dev/null 2>&1 -} - # User can set PERL to change the perl interpreter used. test -z "$PERL" && PERL=perl @@ -91,5 +103,17 @@ if test -z "$AUTOMAKE"; then fi # See how aclocal should be run. -test -z "$ACLOCAL" \ - && ACLOCAL="$PERL ../../aclocal --acdir=$srcdir/../m4" +if test -z "$ACLOCAL"; then + perllibdir=$srcdir/../lib + export perllibdir + ACLOCAL="$PERL ../../aclocal --acdir=$srcdir/../m4" +fi + +# We might need extra macros, e.g., from Libtool or Gettext. +# Find them on the system. +aclocaldir=`(aclocal --print-ac-dir) 2>/dev/null` +case $required in + *libtool*) + ACLOCAL="$ACLOCAL -I $aclocaldir" + ;; +esac diff --git a/tests/defun2.test b/tests/defun2.test index 6f58cab62..d51b301db 100755 --- a/tests/defun2.test +++ b/tests/defun2.test @@ -8,7 +8,7 @@ cat >> configure.in << 'END' dnl if buggy this will require getloadavg.c AC_PROG_CC -AC_DEFUN([AC_FUNC_GETLOADAVG], +AC_DEFUN([AC_FUNC_GETLOADAVG]) dnl need this to avoid LIBOBJS used but not defined. AC_FUNC_MEMCMP END diff --git a/tests/header.test b/tests/header.test index 106ff8c1a..be4e57591 100755 --- a/tests/header.test +++ b/tests/header.test @@ -5,13 +5,8 @@ . $srcdir/defs || exit 1 cat >> configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -PACKAGE=nonesuch -VERSION=nonesuch AC_SUBST(MY_HEADERS) AC_PROG_CC -AC_OUTPUT(Makefile) END cat > Makefile.am << 'END' diff --git a/tests/installsh.test b/tests/installsh.test index 214f822ee..ccd02dcc6 100755 --- a/tests/installsh.test +++ b/tests/installsh.test @@ -25,7 +25,8 @@ case "$srcdir" in ;; esac -AUTOMAKE="$PERL ../../../automake --libdir=$srcdir/../lib --foreign" +AUTOMAKE="$PERL ../../../automake --libdir=$srcdir/../lib --foreign --Werror" +ACLOCAL="$PERL ../../../aclocal --acdir=$srcdir/../m4" # Now we proceed with the test $ACLOCAL || exit 1 diff --git a/tests/ldflags.test b/tests/ldflags.test index 18f818da8..47844623a 100755 --- a/tests/ldflags.test +++ b/tests/ldflags.test @@ -2,7 +2,7 @@ # Check for LDFLAGS in conditional. # PR 77. - +required=libtool . $srcdir/defs || exit 1 cat > configure.in << 'END' diff --git a/tests/lex.test b/tests/lex.test index 6fdfd23f3..3ca4ec7c9 100755 --- a/tests/lex.test +++ b/tests/lex.test @@ -3,7 +3,6 @@ . $srcdir/defs || exit 1 cat >> configure.in << 'END' -AC_INIT AC_PROG_CC AM_PROG_LEX END diff --git a/tests/listval.test b/tests/listval.test index 824289c7b..ce9b074a2 100755 --- a/tests/listval.test +++ b/tests/listval.test @@ -2,7 +2,7 @@ # Test to make sure variable is expanded properly. # From Adam J. Richter. - +required=libtool . $srcdir/defs || exit 1 cat >> configure.in << 'END' @@ -23,5 +23,5 @@ END : > config.guess : > config.sub -$ACLOCAL || exit 1 +$ACLOCAL -I $aclocaldir || exit 1 $AUTOMAKE diff --git a/tests/suffix2.test b/tests/suffix2.test index 4348a8aa9..0411c69bb 100755 --- a/tests/suffix2.test +++ b/tests/suffix2.test @@ -1,6 +1,7 @@ #! /bin/sh # Test to make sure .c.o rule is only included once. +required=libtoolize . $srcdir/defs || exit 1 @@ -27,7 +28,7 @@ END set -e -$ACLOCAL || exit 1 +$ACLOCAL -I $aclocaldir || exit 1 $AUTOMAKE -a grep -c '^\.c\.o:' Makefile.in | grep '^1$' |