2 # Copyright (C) 1996-2013 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 # -----------------------------------------------------------------------
29 # Test for bug reported by François Pinard.
30 # If \ is in AC_OUTPUT, automake barfs.
31 # This was the old test 'acoutbs.test'.
33 # Also test for bug reported by David A. Swierczek.
34 # Another bug with \ in AC_OUTPUT (this time with whitespace).
35 # This was the old test 'acoutbs2.test'.
43 touch Makefile.am zot.in
44 command_ok_ "aclocal groks '\\' in AC_OUTPUT ($dir)" $ACLOCAL
45 command_ok_ "automake groks '\\' in AC_OUTPUT ($dir)" $AUTOMAKE
46 command_ok_ "autoconf groks '\\' in AC_OUTPUT ($dir)" $AUTOCONF
47 command_ok_ "can ./configure in $dir" ./configure
48 command_ok_ "zot created in $dir" test -f zot
49 ls -a > lst || bailout_ "cannot get file listing in $dir"
50 command_ok_ "'\\' not leaked in filenames in $dir" not grep '\\' lst
54 acoutbs_check 1 << 'END'
55 AC_INIT([acoutbs1], [1.0])
61 acoutbs_check 2 << 'END'
62 AC_INIT([acoutbs2], [1.0])
70 # -----------------------------------------------------------------------
72 # Test for bug reported by Jerome Santini.
73 # If I put this line in my configure.ac:
74 # AC_OUTPUT(Makefile src/Makefile tests/Makefile, echo timestamp > stamp-h)dnl
75 # automake is not happy:
77 # This was the old test 'acoutnoq.test'.
82 cat > configure.ac << 'END'
83 AC_INIT([acoutnoq], [1.0])
85 AC_OUTPUT(Makefile, [true])
90 command_ok_ "aclocal and quoted AC_OUTPUT second argument" $ACLOCAL
91 command_ok_ "automake and quoted AC_OUTPUT second argument" $AUTOMAKE
95 # -----------------------------------------------------------------------
97 # Test for bug when AC_OUTPUT has 2 args on the same line, eg:
98 # AC_OUTPUT([Makefile automake tests/Makefile],[chmod +x automake])
99 # This was the old test 'acoutpt.test'.
104 cat > configure.ac << 'END'
105 AC_INIT([acoutpt], [1.0])
107 AC_OUTPUT([Makefile], [true])
112 command_ok_ "aclocal and two AC_OUTPUT arguments on same line" $ACLOCAL
113 command_ok_ "automake and two AC_OUTPUT arguments on same line" $AUTOMAKE
117 # -----------------------------------------------------------------------
119 # Test for bug reported by Eric Magnien.
120 # This was the old test 'acoutpt2.test'.
125 # Name of the current "subtest".
128 cat > configure.ac <<END
129 AC_INIT([$cur], [1.0])
131 AC_OUTPUT([subdir/Makefile subdir/foo Makefile foo], [true])
137 : > subdir/Makefile.am
141 command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
142 command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
143 command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
144 test $($FGREP -c 'foo.in' Makefile.in) -eq 2
146 # This ought to work as well.
147 command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
148 $AUTOMAKE --add-missing --force-missing
152 # -----------------------------------------------------------------------
154 # Test for bug reported by François Pinard.
155 # This was the old test 'acoutqnl.test'.
160 cat > configure.ac << 'END'
161 AC_INIT([acoutqnl], [1.0])
163 AC_OUTPUT([Makefile],
164 [echo zardoz has spoken])
169 command_ok_ "aclocal and two AC_OUTPUT arguments on two lines" $ACLOCAL
170 command_ok_ "automake and two AC_OUTPUT arguments on two lines" $AUTOMAKE
174 # -----------------------------------------------------------------------