]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix default includes ordering to be `-I. -I$(srcdir) ...' again.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 10 Nov 2007 09:20:08 +0000 (10:20 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 10 Nov 2007 09:20:08 +0000 (10:20 +0100)
* automake.in (handle_compile): Put -I$(srcdir) before include
paths for config headers, as was done before Automake 1.10, but
keep uniquified list without multiple adjacent spaces.
* doc/automake.texi (Program variables): List include paths
in order.
* NEWS: Mention 1.10 regression.
* tests/stdinc.test: New test.
* tests/Makefile.am: Adjust.
* THANKS: Update.
Report by Kent Boortz.

ChangeLog
NEWS
THANKS
automake.in
doc/automake.texi
tests/Makefile.am
tests/Makefile.in
tests/stdinc.test [new file with mode: 0755]

index 22cab109ddcd1a1473ac7c66d0c2df0bb18b6198..fa941b46b5eef1b3e935fab84664a79a2b6dce57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
+2007-11-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix default includes ordering to be `-I. -I$(srcdir) ...' again.
+       * automake.in (handle_compile): Put -I$(srcdir) before include
+       paths for config headers, as was done before Automake 1.10, but
+       keep uniquified list without multiple adjacent spaces.
+       * doc/automake.texi (Program variables): List include paths
+       in order.
+       * NEWS: Mention 1.10 regression.
+       * tests/stdinc.test: New test.
+       * tests/Makefile.am: Adjust.
+       * THANKS: Update.
+       Report by Kent Boortz.
+
 2007-11-08  Akim Demaille  <akim@lrde.epita.fr>
-           Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-           Bob Proulx <bob@proulx.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+           Bob Proulx  <bob@proulx.com>
 
        Implement colorized test output.
        * automake.in (handle_tests): Set COLOR depending on `color-tests'.
diff --git a/NEWS b/NEWS
index 79a3deac17fd95d3f68cee91c06032999920de5e..d4f81b11f92c424a271422d7b496d8dace65ffc5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,9 @@ Bugs fixed in 1.10a:
   - $(EXEEXT) is automatically appended to filenames of XFAIL_TESTS
     that have been declared as programs in the same Makefile.
     This is for consistency with the analogous change to TESTS in 1.10.
+
+  - Fix order of standard includes to again be `-I. -I$(srcdir)',
+    followed by directories containing config headers.
 \f
 New in 1.10:
 
diff --git a/THANKS b/THANKS
index 0e031c25161520d7a997b0acca3fc882a8d41e18..4533fb5501a1cb7fa3a11316ddca0de32aeeb549 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -152,6 +152,7 @@ Julien Sopena               julien.sopena@lip6.fr
 Karl Berry             kb@cs.umb.edu
 Karl Heuer             kwzh@gnu.org
 Kelley Cook            kcook@gcc.gnu.org
+Kent Boortz            kent@mysql.com
 Kevin Dalley           kevin@aimnet.com
 Kevin P. Fleming.      kpfleming@cox.net
 Kevin Ryde             user42@zip.com.au
index 127a6072beefaf318d4046b958e6766a113ee6c7..ee1391fa4bf33e11c861a3b738031f06dbfd1122 100755 (executable)
@@ -2312,7 +2312,7 @@ sub handle_compile ()
     my $default_includes = '';
     if (! option 'nostdinc')
       {
-       my @incs = ('-I.');
+       my @incs = ('-I.', subst ('am__isrc'));
 
        my $var = var 'CONFIG_HEADER';
        if ($var)
@@ -2326,8 +2326,9 @@ sub handle_compile ()
        # 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) . subst ('am__isrc');
+       # to just put @am__isrc@ right after `-I.', without a space.
+       ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
+       print "D: $default_includes";
       }
 
     my (@mostly_rms, @dist_rms);
index 2a39ec180a735afb9c80177c5a04c770cec7e6e0..3b705573f08f783c8cea0b780df3ba91483a0c60 100644 (file)
@@ -5748,8 +5748,8 @@ instance, @option{-I} and @option{-D} options should be listed here.
 
 Automake already provides some @option{-I} options automatically, in a
 separate variable that is also passed to every compilation that invokes
-the C preprocessor.  In particular it generates @samp{-I$(srcdir)},
-@samp{-I.}, and a @option{-I} pointing to the directory holding
+the C preprocessor.  In particular it generates @samp{-I.},
+@samp{-I$(srcdir)}, and a @option{-I} pointing to the directory holding
 @file{config.h} (if you've used @code{AC_CONFIG_HEADERS} or
 @code{AM_CONFIG_HEADER}).  You can disable the default @option{-I}
 options using the @option{nostdinc} option.
index 79a89d0b3c674b7704a1e33b7024295326f6429b..81a038221983bdfc9f727f049ac26e19ab11decc 100644 (file)
@@ -501,6 +501,7 @@ spell2.test \
 spell3.test \
 spelling.test \
 spy.test \
+stdinc.test \
 stamph2.test \
 stdlib.test \
 stdlib2.test \
index e0e30ca94d50c335ecdb5ddad7e1cf9b043f13b4..999ed24094011369904f56e78b6b6cea711dbe71 100644 (file)
@@ -649,6 +649,7 @@ spell2.test \
 spell3.test \
 spelling.test \
 spy.test \
+stdinc.test \
 stamph2.test \
 stdlib.test \
 stdlib2.test \
diff --git a/tests/stdinc.test b/tests/stdinc.test
new file mode 100755 (executable)
index 0000000..04301be
--- /dev/null
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 2007  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 3, 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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test to make sure the standard include order is stable.
+# Report by Kent Boortz.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_CONFIG_HEADERS([sub/config.h])
+AC_CONFIG_FILES([sub/bar.h])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c
+BUILT_SOURCES = bar.h
+END
+
+mkdir sub
+
+cat >foo.c <<'END'
+#include <config.h>
+#include <bar.h>
+int main() { return bar (); }
+END
+cat >bar.h <<'END'
+int bar () { return 0; }
+END
+cat >sub/bar.h.in <<'END'
+choke me
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE
+
+mkdir build
+cd build
+../configure -C
+$MAKE
+
+cd ..
+./configure -C
+$MAKE