2 # Copyright (C) 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 # Check that dependency tracking can also work with compilers that
18 # doesn't understand '-c -o', even if the AM_PROG_CC_C_O macro is not
21 required=gcc # For 'cc-no-c-o'.
24 echo '#define myStr "Hello"' > foobar.h
31 printf ("%s\n", myStr);
36 cat > Makefile.am <<'END'
38 foo_SOURCES = foo.c foobar.h
40 test -n '$(DEPDIR)' && test -d '$(DEPDIR)'
42 grep 'stdio\.h' $(DEPDIR)/foo.Po
43 grep 'foobar\.h' $(DEPDIR)/foo.Po
45 is_newest foo foobar.h
48 # We deliberately don't invoke AM_PROG_CC_C_O here.
49 cat >> configure.ac << 'END'
56 $AUTOMAKE --add-missing
58 # Make sure the compiler doesn't understand '-c -o'.
59 CC=$am_testaux_builddir/cc-no-c-o; export CC
61 ./configure >stdout || { cat stdout; exit 1; }
63 $EGREP 'understands? -c and -o together.* no$' stdout
64 grep '^checking dependency style .*\.\.\. gcc' stdout
68 if ! cross_compiling; then
70 test "$(./foo)" = Hello
74 echo '#define myStr "Howdy"' > foobar.h
77 if ! cross_compiling; then
79 test "$(./foo)" = Howdy