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 # hp depmode should work with GNU make in VPATH mode (bug similar to
19 # For automake bug#8473.
21 # Here's the bug: hp depmode will prefix VPATH to the object file name,
22 # thus the second gmake will invoke depcomp with object='../../src/foo.o',
23 # causing errors such as (broken on multiple lines for clarity):
24 # cpp: "", line 0: error 4066: Cannot create
25 # "../../gllib/.deps/nonblocking.TPo" file for
26 # "-M../../gllib/.deps/nonblocking.TPo" option.
27 # (No such file or directory[errno=2])
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=hp
77 # Do not error out with the first make, as the forced 'hp' depmode might
78 # not actually work, but we have overridden the _AM_DEPENDENCIES tests.
81 # We must clean and rebuild, as the actual error only happens the second
82 # time the objects are built because 'depcomp' has silently messed up the
83 # .Po files the first time.
86 $MAKE >out 2>&1 || { cat out; Exit 1; }
88 grep 'src/[._]deps' out && Exit 1