From: Alexandre Duret-Lutz Date: Wed, 30 Aug 2006 18:50:38 +0000 (+0000) Subject: For PR automake/500: X-Git-Tag: Release-1-10~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ae25d96fddea93d469d9b86c78519245dc911d8;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index a8279b452..7f8db0b0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-08-30 Alexandre Duret-Lutz + + 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 * doc/automake.texi, lib/Automake/Rule.pm: Fix some typos. diff --git a/Makefile.in b/Makefile.in index 6aadcbb55..1fe897100 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,7 +42,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 \ diff --git a/aclocal.m4 b/aclocal.m4 index 33c5a750f..d5f9e1688 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -25,4 +25,5 @@ m4_include([m4/options.m4]) 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]) diff --git a/automake.in b/automake.in index 35fb19877..b08c591a6 100755 --- a/automake.in +++ b/automake.in @@ -2301,16 +2301,22 @@ sub handle_compile () 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); diff --git a/configure b/configure index 89bcc108d..23579b6eb 100755 --- a/configure +++ b/configure @@ -609,6 +609,7 @@ am_AUTOCONF INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +am__isrc CYGPATH_W PACKAGE VERSION @@ -2014,12 +2015,16 @@ else 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 @@ -3350,6 +3355,7 @@ am_AUTOCONF!$am_AUTOCONF$ac_delim 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 @@ -3381,7 +3387,7 @@ LIBOBJS!$LIBOBJS$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 diff --git a/doc/Makefile.in b/doc/Makefile.in index de71779c7..f6cd295a4 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -43,7 +43,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 92100854c..732b24c05 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -41,7 +41,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index e23a1356c..7c50263aa 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -39,7 +39,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/lib/Makefile.in b/lib/Makefile.in index fc7670ade..bcab75832 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -44,7 +44,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 63ead4c3e..e89d45f6d 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -41,7 +41,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/m4/Makefile.in b/m4/Makefile.in index 8c71d23b3..222149c0d 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -41,7 +41,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/m4/init.m4 b/m4/init.m4 index 37d73c965..511073c1c 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -30,10 +30,14 @@ dnl the ones we care about. 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 diff --git a/tests/Makefile.in b/tests/Makefile.in index f1db03d3c..3934eacd7 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -40,7 +40,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(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 diff --git a/tests/subpkg.test b/tests/subpkg.test index 69ff96b02..c7015b6b2 100755 --- a/tests/subpkg.test +++ b/tests/subpkg.test @@ -1,5 +1,5 @@ #! /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. # @@ -74,6 +74,7 @@ AC_INIT([lib], [2.3]) AM_INIT_AUTOMAKE AC_PROG_RANLIB AC_PROG_YACC +AC_CONFIG_HEADERS([config.h:config.hin]) AC_CONFIG_FILES([Makefile]) FOO EOF @@ -105,6 +106,7 @@ END cp lib/foo.y lib/bar.y cat >lib/src/x.c <<'EOF' +#include int lib () { return 0; @@ -119,10 +121,12 @@ cd lib $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