tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / aclocal-deps-subdir.sh
1 #! /bin/sh
2 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test to make sure that aclocal.m4's dependencies are honored in
18 # sub-directories.  See also related tests 'remake-subdir*.sh'.
19
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_CONFIG_MACRO_DIR([m4])
24 FOO_TEST([GREPME])
25 AC_CONFIG_FILES([sub/Makefile])
26 AC_OUTPUT
27 END
28
29 cat > Makefile.am << 'END'
30 SUBDIRS = sub
31 END
32
33 mkdir sub
34 : > sub/Makefile.am
35
36 mkdir m4
37 echo 'AC_DEFUN([FOO_TEST], [echo $@])' > m4/moredefs.m4
38
39 $ACLOCAL
40 $AUTOCONF
41 $AUTOMAKE --copy --add-missing
42 ./configure
43 $MAKE
44
45 # Update an aclocal.m4 dependency, then make sure all Makefiles are
46 # updated, even from a sub-directory.  Check that AU_ALIAS is
47 # recognized. Change the definition of FOO_TEST to check that its new
48 # definition is used.
49 $sleep # Modified configure dependencies must be newer than config.status.
50 echo 'AU_ALIAS([FOO_TEST], [AC_SUBST])' > m4/moredefs.m4
51 cd sub
52 $MAKE
53 cd ..
54 grep GREPME Makefile
55 grep GREPME sub/Makefile
56
57 # Make sure configure dependencies are distributed.
58 $MAKE distdir
59 test -f $me-1.0/m4/moredefs.m4
60
61 # Change the definition of FOO_TEST to check that its new definition is
62 # used.  Check that AC_DEFUN_ONCE is caught.
63 $sleep # Modified configure dependencies must be newer than config.status.
64 echo 'AC_DEFUN_ONCE([FOO_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4
65 $MAKE
66 grep 'm4/moredefs\.m4' aclocal.m4
67 grep '__GREPME__' configure
68
69 :