2 # Copyright (C) 1996-2012 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)
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 # Test for various older bugs related to quoting, escaping and
18 # line breaking in the use of AC_OUTPUT. Synthesised by a bunch
19 # of older tests (referenced below).
25 rm -f configure.ac depcomp # Not required.
27 AUTOMAKE="$AUTOMAKE -Wno-obsolete"
29 # -----------------------------------------------------------------------
31 # Test for bug reported by François Pinard.
32 # If \ is in AC_OUTPUT, automake barfs.
33 # This was the old test 'acoutbs.test'.
35 # Also test for bug reported by David A. Swierczek.
36 # Another bug with \ in AC_OUTPUT (this time with whitespace).
37 # This was the old test 'acoutbs2.test'.
45 touch Makefile.am zot.in
46 command_ok_ "aclocal groks '\\' in AC_OUTPUT ($dir)" $ACLOCAL
47 command_ok_ "automake groks '\\' in AC_OUTPUT ($dir)" $AUTOMAKE
48 command_ok_ "autoconf groks '\\' in AC_OUTPUT ($dir)" $AUTOCONF
49 command_ok_ "can ./configure in $dir" ./configure
50 command_ok_ "zot created in $dir" test -f zot
51 ls -a > lst || bailout_ "cannot get file listing in $dir"
52 command_ok_ "'\\' not leaked in filenames in $dir" not grep '\\' lst
56 acoutbs_check 1 << 'END'
58 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
63 acoutbs_check 2 << 'END'
65 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
75 # -----------------------------------------------------------------------
77 # Test for bug reported by Jerome Santini.
78 # If I put this line in my configure.ac:
79 # AC_OUTPUT(Makefile src/Makefile tests/Makefile, echo timestamp > stamp-h)dnl
80 # automake is not happy:
82 # This was the old test 'acoutnoq.test'.
87 cat > configure.ac << 'END'
89 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
90 AC_OUTPUT(Makefile, [true])
95 command_ok_ "aclocal and quoted AC_OUTPUT second argument" $ACLOCAL
96 command_ok_ "automake and quoted AC_OUTPUT second argument" $AUTOMAKE
100 # -----------------------------------------------------------------------
102 # Test for bug when AC_OUTPUT has 2 args on the same line, eg:
103 # AC_OUTPUT([Makefile automake tests/Makefile],[chmod +x automake])
104 # This was the old test 'acoutpt.test'.
109 cat > configure.ac << 'END'
111 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
112 AC_OUTPUT([Makefile], [true])
117 command_ok_ "aclocal and two AC_OUTPUT arguments on same line" $ACLOCAL
118 command_ok_ "automake and two AC_OUTPUT arguments on same line" $AUTOMAKE
122 # -----------------------------------------------------------------------
124 # Test for bug reported by Eric Magnien.
125 # This was the old test 'acoutpt2.test'.
130 # Name of the current "subtest".
133 cat > configure.ac <<END
134 AC_INIT([$cur], [1.0])
136 AC_OUTPUT([subdir/Makefile subdir/foo Makefile foo], [true])
142 : > subdir/Makefile.am
146 command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
147 command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
148 command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
149 test `$FGREP foo.in Makefile.in | wc -l` -eq 2
151 # This ought to work as well.
152 command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
153 $AUTOMAKE --add-missing --force-missing
157 # -----------------------------------------------------------------------
159 # Test for bug reported by François Pinard.
160 # This was the old test 'acoutqnl.test'.
165 cat > configure.ac << 'END'
167 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
168 AC_OUTPUT([Makefile],
169 [echo zardoz has spoken])
174 command_ok_ "aclocal and two AC_OUTPUT arguments on two lines" $ACLOCAL
175 command_ok_ "automake and two AC_OUTPUT arguments on two lines" $AUTOMAKE
179 # -----------------------------------------------------------------------