#! /bin/sh # Copyright (C) 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # # GNU Automake is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # GNU Automake is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Automake; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. # Make sure setting per-target CPPFLAGS doesn't break dependency tracking. required=gcc . ./defs || exit 1 set -e cat >>configure.in <<'EOF' AC_PROG_CC AM_PROG_CC_C_O AC_OUTPUT EOF cat > Makefile.am <<'EOF' bin_PROGRAMS = prog prog_SOURCES = sub/part.c foo.h prog_CPPFLAGS = $(AM_CPPFLAGS) testdeps: all grep 'foo\.h' ./$(DEPDIR)/prog-part.Po grep 'prog-part\.$(OBJEXT)' ./$(DEPDIR)/prog-part.Po test ! -f ./sub/$(DEPDIR)/prog-part.Po testdeps-subdirs: all grep 'foo\.h' ./sub/$(DEPDIR)/prog-part.Po grep 'sub/prog-part\.$(OBJEXT)' ./sub/$(DEPDIR)/prog-part.Po test ! -f ./$(DEPDIR)/prog-part.Po EOF mkdir sub cat > sub/part.c << 'END' #include "foo.h" int main (int argc, char *argv[]) { return 0; } END : > foo.h $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing # Sanity check: make sure the cache variable we force is used by configure grep am_cv_CC_dependencies_compiler_type configure # Try various dependency modes. '' stands for the default # dependency mode (since we require gcc it might be `gcc3' or `gcc'). for depmode in '' am_cv_CC_dependencies_compiler_type=gcc \ am_cv_CC_dependencies_compiler_type=dashmstdout do ./configure $depmode $MAKE testdeps $MAKE distclean done # Likewise, with subdir-objects. echo AUTOMAKE_OPTIONS = subdir-objects >>Makefile.am $AUTOMAKE for depmode in '' am_cv_CC_dependencies_compiler_type=gcc \ am_cv_CC_dependencies_compiler_type=dashmstdout do ./configure $depmode $MAKE testdeps-subdirs $MAKE distclean done