source: trunk/essentials/sys-devel/automake-1.8/tests/aclocal6.test

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 2.3 KB
Line 
1#! /bin/sh
2# Copyright (C) 2003 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Automake; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Make sure aclocal.m4 is rebuilt whenever a configure
22# dependency changes. Test for acinclude.m4 and VPATH too.
23
24required='GNUmake'
25. ./defs || exit 1
26
27set -e
28
29cat >> configure.in << 'END'
30SOME_DEFS
31AC_CONFIG_FILES([sub/Makefile])
32AC_OUTPUT
33END
34
35cat > Makefile.am << 'END'
36SUBDIRS = sub
37ACLOCAL_AMFLAGS = -I m4
38END
39
40mkdir sub
41: > sub/Makefile.am
42
43mkdir m4
44echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
45echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
46
47$ACLOCAL -I m4
48$AUTOCONF
49$AUTOMAKE --copy --add-missing
50
51# Users can disable autom4te.cache.
52if test -d autom4te.cache; then
53 test_cache='test -d'
54else
55 test_cache=:
56fi
57
58mkdir build
59cd build
60
61../configure
62$MAKE
63
64# Update an aclocal.m4 dependency, then make sure all Makefiles
65# are updated, even from a sub-directory.
66echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
67# Because aclocal will run again, it should also pick up acinclude.m4.
68echo 'AC_SUBST([METOO])' > ../acinclude.m4
69
70cd sub
71$MAKE
72cd ..
73grep GREPME Makefile
74grep GREPME sub/Makefile
75grep GREPME sub/Makefile
76grep METOO Makefile
77grep METOO sub/Makefile
78grep METOO sub/Makefile
79
80# Make sure configure dependencies are distributed.
81$MAKE distdir
82test -f aclocal6-1.0/m4/moredefs.m4
83test -f aclocal6-1.0/m4/somedefs.m4
84test -f aclocal6-1.0/acinclude.m4
85
86# Make sure maintainer-clean works in VPATH builds.
87# (This is unrelated to the rest of this test.)
88$MAKE clean
89$test_cache ../autom4te.cache
90test -f Makefile
91test -f sub/Makefile
92$MAKE maintainer-clean
93test ! -d ../autom4te.cache
94test ! -f Makefile
95test ! -f sub/Makefile
Note: See TracBrowser for help on using the repository browser.