2 # Copyright (C) 2011-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 remake rules when a new C header "guarded" by AC_SUBST'd
19 # This test overlaps with others, and is not strictly necessary per se,
20 # but it exercises a real use case (from gnulib, see:
21 # <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00005.html>
27 cat >> configure.ac <<'END'
28 AC_CONFIG_HEADERS([config.h])
34 cat > Makefile.am <<'END'
35 ACLOCAL_AMFLAGS = -I .
38 BUILT_SOURCES = $(STDIO_H)
40 cp $(srcdir)/stdio.in.h $@
41 MOSTLYCLEANFILES = stdio.h
42 EXTRA_DIST = stdio.in.h
45 if test -n '$(STDIO_H)'; then \
46 test -f stdio.h || exit 1; \
48 test ! -f stdio.h || exit 1; \
52 cat > macros.m4 <<'END'
53 AC_DEFUN([MY_MACROS], [
55 if $override_stdio; then
63 AC_DEFINE_UNQUOTED([USE_DUMMIES], [$use_dummies],
64 [Whether to use dummy types.])
68 cat > stdio.in.h <<'END'
69 typedef struct dummyfile { void *p; } DUMMYFILE;
80 int main () { return 0; }
93 # Also try our build rules in a VPATH build.
96 # No need to sleep here: "./configure" and "make distcheck" above
97 # have already slept enough.
99 sed -e 's/^\( *override_stdio\)=.*$/\1=:/' macros.m4 > t
102 using_gmake || $MAKE Makefile
106 # Also try our build rules in a VPATH build.