2 # Copyright (C) 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 # makedepend should work in VPATH mode.
19 # Here's the bug: makedepend will prefix VPATH to the object file name,
20 # thus the second make will invoke depcomp with object='../../src/foo.o',
21 # causing errors such as:
22 # touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
23 # makedepend: error: cannot open "../../src/.deps/foo.TPo"
24 # ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
26 # We include subfoo only to be sure that we don't remove too much
27 # from the object file name.
32 mkdir src src/sub build
34 cat >> configure.in << 'END'
37 AC_CONFIG_FILES([src/Makefile])
41 cat > Makefile.am << 'END'
45 cat > src/Makefile.am << 'END'
46 AUTOMAKE_OPTIONS = subdir-objects
48 foo_SOURCES = foo.c foo.h sub/subfoo.c
52 extern int subfoo (void);
63 cat >src/sub/subfoo.c <<EOF
76 ../configure am_cv_CC_dependencies_compiler_type=makedepend
78 # Do not error out with the first make, as the forced 'makedepend'
79 # depmode might not actually work, but we have overridden the
80 # _AM_DEPENDENCIES tests.
83 # We must clean and rebuild, as the actual error only happens the second
84 # time the objects are built because 'makedepend' has silently messed up
85 # the .Po files the first time.
88 $MAKE >out 2>&1 || { cat out; Exit 1; }
90 grep 'src/[._]deps' out && Exit 1