+2006-08-30 Alexandre Duret-Lutz <adl@gnu.org>
+
+ For PR automake/500:
+ * automake.in (handle_compile) <$default_includes>: Do not output
+ the same -I twice. Use @am__isrc@ instead of ` -I$(srcdir)'.
+ * m4/init.m4: Define am__isrc as ` -I$(srcdir)' only in
+ non-VPATH builds since we always have `-I.'.
+ * tests/subpkg.test: Make sure config headers are found in VPATH
+ and non-VPATH builds.
+
2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/automake.texi, lib/Automake/Rule.pm: Fix some typos.
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
m4_include([m4/runlog.m4])
m4_include([m4/sanity.m4])
m4_include([m4/strip.m4])
+m4_include([m4/substnot.m4])
m4_include([m4/tar.m4])
my $default_includes = '';
if (! option 'nostdinc')
{
- $default_includes = ' -I. -I$(srcdir)';
+ my @incs = ('-I.');
my $var = var 'CONFIG_HEADER';
if ($var)
{
foreach my $hdr (split (' ', $var->variable_value))
{
- $default_includes .= ' -I' . dirname ($hdr);
+ push @incs, '-I' . dirname ($hdr);
}
}
+ # We want `-I. -I$(srcdir)', but the latter -I is redundant
+ # and unaesthetic in non-VPATH builds. We use `-I.@am__isrc@`
+ # instead. It will be replaced by '-I.' or '-I. -I$(srcdir)'.
+ # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
+ # to just append @am__isrc@.
+ $default_includes = ' ' . uniq (@incs) . '@am__isrc@';
}
my (@mostly_rms, @dist_rms);
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
+am__isrc
CYGPATH_W
PACKAGE
VERSION
fi
rmdir .tst 2>/dev/null
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
+ fi
fi
# test whether we have cygpath
INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
CYGPATH_W!$CYGPATH_W$ac_delim
PACKAGE!$PACKAGE$ac_delim
VERSION!$VERSION$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
fi
# test whether we have cygpath
$(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
$(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
- $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
#! /bin/sh
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
AM_INIT_AUTOMAKE
AC_PROG_RANLIB
AC_PROG_YACC
+AC_CONFIG_HEADERS([config.h:config.hin])
AC_CONFIG_FILES([Makefile])
FOO
EOF
cp lib/foo.y lib/bar.y
cat >lib/src/x.c <<'EOF'
+#include <config.h>
int lib ()
{
return 0;
$ACLOCAL -I ../m4
$FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
$AUTOCONF
+$AUTOHEADER
$AUTOMAKE -Wno-override --add-missing
cd ..
./configure
+$MAKE
$MAKE distcheck
test ! -d subpack-1 # make sure distcheck cleans up after itself
test -f subpack-1.tar.gz