2 # Copyright (C) 2006, 2007, 2010, 2011 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 # Check dependency generation (libtool case).
24 cat >> configure.in << 'END'
28 AC_CONFIG_FILES([sub2/Makefile])
32 mkdir sub sub2 sub2/sub3
34 cat >Makefile.am <<'END'
37 foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h
38 foo_LDADD = sub2/libbaz.la
41 cat >sub2/Makefile.am <<'END'
42 AUTOMAKE_OPTIONS = subdir-objects
43 noinst_LTLIBRARIES = libbaz.la
44 libbaz_la_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h
51 int main (void) { printf ("foo"); return bar () + baz (); }
59 cat >sub/bar.c <<'END'
61 int bar (void) { return 0; }
64 echo 'extern int x;' > sub2/sub3/ba3.h
66 cat >sub/bar.h <<'END'
68 extern int bar (void);
71 cat >sub2/baz.c <<'END'
73 int baz (void) { return 0; }
76 cat >sub2/baz.h <<'END'
77 extern int baz (void);
80 cat >sub2/sub3/ba3.in <<'END'
82 int ba3 (void) { return 0; }
91 for staticshared in --disable-shared "" --disable-static; do
93 cp sub2/sub3/ba3.in sub2/sub3/ba3.c
94 ./configure --enable-dependency-tracking $staticshared
97 # If we cannot enable dependency tracking, perform only the most basic
98 # checks, and don't consider this test to be PASSed but SKIPped, because
99 # the main purpose of this test is exposing the depmode features.
100 if grep 'depmode=none' Makefile; then
105 echo 'choke me' > sub3/ba3.h
106 # Do not use `$MAKE && Exit 1' here, since even relatively-recent
107 # versions of the BSD shell wrongly exit when the `errexit' shell
108 # flag is active if a command within "&&" fails inside a compound
110 if $MAKE; then Exit 1; else :; fi
112 # Ensure the deleted header bug is fixed.
114 sed 1d sub3/ba3.in >sub3/ba3.c
120 test ! -f sub2/sub3/ba3.u
121 test ! -f sub2/sub3/ba3.d
123 echo 'extern int x;' > sub2/sub3/ba3.h