]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM): Replace by ...
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 1 Aug 2004 22:16:03 +0000 (22:16 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 1 Aug 2004 22:16:03 +0000 (22:16 +0000)
(AC_CANONICAL_BUILD, AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM): ... these.
(scan_autoconf_traces): Scan for the latter three macros instead of
the former two.
(make_paragraphs): Adjust definitions of %BUILD%, %HOST%, and %TARGET%.
* tests/hosts.test: New file.
* tests/Makefile.am (TESTS): Add hosts.test.
Report and test case from Norman Gray.

12 files changed:
ChangeLog
Makefile.in
automake.in
doc/Makefile.in
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
m4/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/hosts.test [new file with mode: 0755]

index 99bbc7b797f6d516845e07885b7646d8eaa8c1b0..9138940eeaa9f034cc8e4aacc6f498b700be3c75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-08-02  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM): Replace by ...
+       (AC_CANONICAL_BUILD, AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM): ... these.
+       (scan_autoconf_traces): Scan for the latter three macros instead of
+       the former two.
+       (make_paragraphs): Adjust definitions of %BUILD%, %HOST%, and %TARGET%.
+       * tests/hosts.test: New file.
+       * tests/Makefile.am (TESTS): Add hosts.test.
+       Report and test case from Norman Gray.
+
 2004-08-01  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * aclocal.in (scan_file): Update "#Extending%20aclocal" URL, makeinfo
index 5d5750757dea793d3c3516e60793a40b79903901..5bda543526219f954b4d1a67e57eb8380d37645e 100644 (file)
@@ -34,6 +34,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
index 5a3b4bd33e61000243a2eeddc118bf30b4661bda..3fe035b3476455cf89eb1515a1d484cf03c02405 100755 (executable)
@@ -201,8 +201,9 @@ my $EXEC_DIR_PATTERN =
   '^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
 
 # Values for AC_CANONICAL_*
-use constant AC_CANONICAL_HOST   => 1;
-use constant AC_CANONICAL_SYSTEM => 2;
+use constant AC_CANONICAL_BUILD  => 1;
+use constant AC_CANONICAL_HOST   => 2;
+use constant AC_CANONICAL_TARGET => 3;
 
 # Values indicating when something should be cleaned.
 use constant MOSTLY_CLEAN     => 0;
@@ -346,8 +347,9 @@ my $ac_gettext_location;
 # Lists of tags supported by Libtool.
 my %libtool_tags = ();
 
-# TRUE if we've seen AC_CANONICAL_(HOST|SYSTEM).
+# Most important AC_CANONICAL_* macro seen so far.
 my $seen_canonical = 0;
+# Location of that macro.
 my $canonical_location;
 
 # Where AM_MAINTAINER_MODE appears.
@@ -4644,8 +4646,9 @@ sub scan_autoconf_traces ($)
   # IMPORTANT: If you add a macro here, you should also add this macro
   # =========  to Automake-preselection in autoconf/lib/autom4te.in.
   my %traced = (
+               AC_CANONICAL_BUILD => 0,
                AC_CANONICAL_HOST => 0,
-               AC_CANONICAL_SYSTEM => 0,
+               AC_CANONICAL_TARGET => 0,
                AC_CONFIG_AUX_DIR => 1,
                AC_CONFIG_FILES => 1,
                AC_CONFIG_HEADERS => 1,
@@ -4696,17 +4699,25 @@ sub scan_autoconf_traces ($)
        }
 
       # Alphabetical ordering please.
-      if ($macro eq 'AC_CANONICAL_HOST')
+      if ($macro eq 'AC_CANONICAL_BUILD')
        {
-         if (! $seen_canonical)
+         if ($seen_canonical <= AC_CANONICAL_BUILD)
+           {
+             $seen_canonical = AC_CANONICAL_BUILD;
+             $canonical_location = $where;
+           }
+       }
+      elsif ($macro eq 'AC_CANONICAL_HOST')
+       {
+         if ($seen_canonical <= AC_CANONICAL_HOST)
            {
              $seen_canonical = AC_CANONICAL_HOST;
              $canonical_location = $where;
            }
        }
-      elsif ($macro eq 'AC_CANONICAL_SYSTEM')
+      elsif ($macro eq 'AC_CANONICAL_TARGET')
        {
-         $seen_canonical = AC_CANONICAL_SYSTEM;
+         $seen_canonical = AC_CANONICAL_TARGET;
          $canonical_location = $where;
        }
       elsif ($macro eq 'AC_CONFIG_AUX_DIR')
@@ -6110,9 +6121,9 @@ sub make_paragraphs ($%)
                 'TOPDIR'       => backname ($relative_dir),
                 'TOPDIR_P'     => $relative_dir eq '.',
 
-                'BUILD'    => $seen_canonical == AC_CANONICAL_SYSTEM,
-                'HOST'     => $seen_canonical,
-                'TARGET'   => $seen_canonical == AC_CANONICAL_SYSTEM,
+                'BUILD'    => ($seen_canonical >= AC_CANONICAL_BUILD),
+                'HOST'     => ($seen_canonical >= AC_CANONICAL_HOST),
+                'TARGET'   => ($seen_canonical >= AC_CANONICAL_TARGET),
 
                 'LIBTOOL'      => !! var ('LIBTOOL'),
                 'NONLIBTOOL'   => 1,
@@ -7125,8 +7136,8 @@ sub generate_makefile ($$)
   # handle_libtool.)
   if ($relative_dir eq '.')
     {
-      # AC_CANONICAL_HOST and AC_CANONICAL_SYSTEM need config.guess and
-      # config.sub.
+      # AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM, and AC_CANONICAL_TARGET
+      # need config.guess and config.sub.
       require_conf_file ($canonical_location, FOREIGN,
                         'config.guess', 'config.sub')
        if $seen_canonical;
index 798735d89bc1e136e1baf21b8bfcc2893a7ee971..a194722aa24758b8c51d8c824aa756937dd028e4 100644 (file)
@@ -33,6 +33,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = doc
 DIST_COMMON = $(automake_TEXINFOS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(srcdir)/stamp-vti \
index 311b19c5f3623b0b61a3352358879f45d723f7ae..d1b33cfb8590f894e82334e6fa509c56641fb212 100644 (file)
@@ -34,6 +34,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = lib/Automake
 DIST_COMMON = $(dist_perllib_DATA) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
index 29339c8772cfea7353f2126f84aaadd91f151584..d3a94efdab055bbb816420211b21cd0a45f49d1b 100644 (file)
@@ -33,6 +33,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = lib/Automake/tests
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
index d7347ff8b8f7f788acca066048fb72607800c461..d002f302f3138802e9a063d9c3ee43fa3109aad1 100644 (file)
@@ -34,6 +34,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = lib
 DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \
        $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING INSTALL \
index e87828640b806de8dff840bf8dfa6ab3b8312d29..5af8322fee40bfb856d96bdcda6fe6e01b841411 100644 (file)
@@ -34,6 +34,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = lib/am
 DIST_COMMON = $(dist_am_DATA) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
index 33dc6d6fe4d242c95658ca80bee5daed3376e8fc..252715fc0976db024b6905043a5df1a4ffb2c094 100644 (file)
@@ -34,6 +34,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = m4
 DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
index d62c7d84c4925095b6925b0a1e62dae3d215cbac..aedb8b4a8d1833559ad4ffe46f065133f880f3a6 100644 (file)
@@ -245,6 +245,7 @@ gnits2.test \
 gnits3.test \
 header.test \
 help.test \
+hosts.test \
 implicit.test \
 include.test \
 include2.test \
index 61d760a035587efa8accd8c0e6a976c7893f861d..b91e96bc824fbc6aa77cf5cc91357111f9338b13 100644 (file)
@@ -33,6 +33,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 subdir = tests
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in
@@ -361,6 +362,7 @@ gnits2.test \
 gnits3.test \
 header.test \
 help.test \
+hosts.test \
 implicit.test \
 include.test \
 include2.test \
diff --git a/tests/hosts.test b/tests/hosts.test
new file mode 100755 (executable)
index 0000000..46b3ebd
--- /dev/null
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2004  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.
+
+# Test to make sure automake correctly recognizes presence of
+# AC_CANONICAL_(BUILD|HOST|SYSTEM|TARGET), and creates config.* in all
+# those cases.
+# From Norman Gray.
+
+. ./defs || exit 1
+
+set -e
+
+: >Makefile.am
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+test ! -f config.guess
+test ! -f config.sub
+
+# Test all four of the AC_CANONICAL_* targets, including _SYSTEM, which is
+# supported but deprecated by autoconf.
+for macro in AC_CANONICAL_BUILD AC_CANONICAL_HOST \
+             AC_CANONICAL_SYSTEM AC_CANONICAL_TARGET
+do
+  rm -rf autom4te.cache config.sub config.guess
+
+  cat >configure.in<<EOF
+AC_INIT([hosts], [1.0])
+$macro
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+EOF
+
+  $ACLOCAL
+  $AUTOMAKE --add-missing
+
+  # Show the files which were installed
+  ls
+
+  test -f config.guess
+  test -f config.sub
+done