#! /bin/sh
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
cat >> configure.in << 'END'
-MORE_DEFS
+AM_TEST([GREPME])
AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
END
: > sub/Makefile.am
mkdir m4
-echo 'AC_DEFUN([MORE_DEFS], [])' > m4/moredefs.m4
+echo 'AC_DEFUN([AM_TEST], [echo $@])' > m4/moredefs.m4
$ACLOCAL -I m4
$AUTOCONF
./configure
$MAKE
-# Update an aclocal.m4 dependency, then make sure all Makefiles
-# are updated, even from a sub-directory.
-echo 'AC_DEFUN_ONCE([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
+# Update an aclocal.m4 dependency, then make sure all Makefiles are
+# updated, even from a sub-directory. Check that AU_ALIAS is
+# recognized. Change the definition of AM_TEST to check that its new
+# definition is used.
+echo 'AU_ALIAS([AM_TEST], [AC_SUBST])' > m4/moredefs.m4
cd sub
$MAKE
cd ..
# Make sure configure dependencies are distributed.
$MAKE distdir
test -f aclocal5-1.0/m4/moredefs.m4
+
+# Change the definition of AM_TEST to check that its new definition is
+# used. Check that AC_DEFUN_ONCE is caught.
+echo 'AC_DEFUN_ONCE([AM_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4
+$MAKE
+grep 'm4/moredefs\.m4' aclocal.m4
+grep '@__GREPME__@' configure