* aclocal.in ($ac_defun_rx): Match AU_ALIAS.
[platform/upstream/automake.git] / tests / aclocal5.test
index 950ce1d..72dfffa 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -29,7 +29,7 @@ required='GNUmake'
 set -e
 
 cat >> configure.in << 'END'
-MORE_DEFS
+AM_TEST([GREPME])
 AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
@@ -43,7 +43,7 @@ mkdir sub
 : > 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
@@ -51,9 +51,11 @@ $AUTOMAKE --copy --add-missing
 ./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 ..
@@ -63,3 +65,10 @@ grep GREPME sub/Makefile
 # 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