2 # Copyright (C) 2012-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 # Related to automake bug#12495: Automake shouldn't generate useless
18 # remake rules for AC_CONFIG_HEADERS arguments after the first one,
19 # not even when subdirs are involved.
23 cat >> configure.ac << 'END'
24 AC_CONFIG_HEADERS([a.h b.h sub/c.h])
25 AC_CONFIG_FILES([sub/Makefile])
30 echo SUBDIRS = sub > Makefile.am
36 # Even if an AC_CONFIG_HEADERS invocation is passed several files in
37 # the first argument, only the first one is considered by autoheader
38 # for automatic generation. Otherwise, the present test case would
39 test -f a.h.in && test ! -f c.h.in && test ! -f sub/c.h.in \
40 || fatal_ "unexpected autoheader behavior with multiple" \
41 "AC_CONFIG_HEADERS arguments"
42 # Automake should require the missing headers though.
43 AUTOMAKE_fails -Wno-error -Wnone
44 grep "^configure\.ac:4:.* required file 'b.h.in' not found" stderr
45 grep "^configure\.ac:4:.* required file 'sub/c.h.in' not found" stderr
52 # Automake should regenerate this.
53 grep '^$(srcdir)/a\.h\.in:' Makefile.in
55 grep '[bc]\.h\.in.*:' Makefile.in sub/Makefile.in && exit 1
57 test -f a.h && test -f b.h && test -f sub/c.h \
58 || fatal_ "unexpected ./configure behavior with multiple" \
59 "AC_CONFIG_HEADERS arguments"
70 run_make -E -e FAIL $x.h.in
73 grep "No rule to make target [\`\"']$x\.h\.in[\`\"']" stderr
76 cd "$ocwd" || fatal_ "cannot chdir back"