Avoid leaking TEST_LOG_COMPILER in environment of test scripts.
[automake.git] / tests / aclocal6.test
blob266d64bd2a8ca5f0e8bf0d219d17851710480d60
1 #! /bin/sh
2 # Copyright (C) 2003 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Make sure aclocal.m4 is rebuilt whenever a configure
18 # dependency changes. Test for acinclude.m4 and VPATH too.
20 required='GNUmake'
21 . ./defs || Exit 1
23 set -e
25 cat >> configure.in << 'END'
26 SOME_DEFS
27 AC_CONFIG_FILES([sub/Makefile])
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 SUBDIRS = sub
33 ACLOCAL_AMFLAGS = -I m4
34 END
36 mkdir sub
37 : > sub/Makefile.am
39 mkdir m4
40 echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
41 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
43 $ACLOCAL -I m4
44 $AUTOCONF
45 $AUTOMAKE --copy --add-missing
47 # Users can disable autom4te.cache.
48 if test -d autom4te.cache; then
49 test_cache='test -d'
50 else
51 test_cache=:
54 mkdir build
55 cd build
57 ../configure
58 $MAKE
60 # Update an aclocal.m4 dependency, then make sure all Makefiles
61 # are updated, even from a sub-directory.
62 echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
63 # Because aclocal will run again, it should also pick up acinclude.m4.
64 echo 'AC_SUBST([METOO])' > ../acinclude.m4
66 cd sub
67 $MAKE
68 cd ..
69 grep GREPME Makefile
70 grep GREPME sub/Makefile
71 grep GREPME sub/Makefile
72 grep METOO Makefile
73 grep METOO sub/Makefile
74 grep METOO sub/Makefile
76 # Make sure configure dependencies are distributed.
77 $MAKE distdir
78 test -f aclocal6-1.0/m4/moredefs.m4
79 test -f aclocal6-1.0/m4/somedefs.m4
80 test -f aclocal6-1.0/acinclude.m4
82 # Make sure maintainer-clean works in VPATH builds.
83 # (This is unrelated to the rest of this test.)
84 $MAKE clean
85 $test_cache ../autom4te.cache
86 test -f Makefile
87 test -f sub/Makefile
88 $MAKE maintainer-clean
89 test ! -d ../autom4te.cache
90 test ! -f Makefile
91 test ! -f sub/Makefile