c9106aeec2f27b43dcb4bb93af9439217eb3070f
[platform/upstream/automake.git] / tests / m4-inclusion.test
1 #! /bin/sh
2 # Copyright (C) 1998, 2001, 2002, 2003, 2005, 2010, 2011 Free Software
3 # Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Test to see if `m4_sinclude' and `m4_include' works.
19
20 . ./defs || Exit 1
21
22 cat >> configure.in <<'EOF'
23 sinclude([doesntexist.m4])
24 EOF
25
26 mkdir sub
27
28 cat > sub/p.m4 << 'END'
29 AC_SUBST([MAGICALPIG])
30 END
31
32 cat > sub/h.m4 << 'END'
33 AC_SUBST([MAGICALHOG])
34 END
35
36 cat > sub/g.m4 << 'END'
37 AC_SUBST([GREPME])
38 END
39
40 : > Makefile.am
41
42 echo 'sinclude([sub/g.m4])' >> acinclude.m4
43 echo 'm4_sinclude([sub/doesntexist.m4])' >> acinclude.m4
44
45 $ACLOCAL
46
47 echo 'm4_sinclude([sub/p.m4])' >> aclocal.m4
48 echo 'm4_include([sub/h.m4])' >> aclocal.m4
49
50 $AUTOMAKE
51
52 grep doesntexist Makefile.in && Exit 1
53 grep MAGICALPIG Makefile.in
54 grep MAGICALHOG Makefile.in
55 grep GREPME Makefile.in
56
57 :