From: Alexandre Duret-Lutz Date: Sun, 1 Aug 2004 22:16:03 +0000 (+0000) Subject: * automake.in (AC_CANONICAL_HOST, AC_CANONICAL_SYSTEM): Replace by ... X-Git-Tag: Release-1-9b~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1947468fc2915f89251e4c1010d4eee8efe24001;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 99bbc7b79..9138940ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-08-02 Alexandre Duret-Lutz + + * 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 * aclocal.in (scan_file): Update "#Extending%20aclocal" URL, makeinfo diff --git a/Makefile.in b/Makefile.in index 5d5750757..5bda54352 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 \ diff --git a/automake.in b/automake.in index 5a3b4bd33..3fe035b34 100755 --- a/automake.in +++ b/automake.in @@ -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; diff --git a/doc/Makefile.in b/doc/Makefile.in index 798735d89..a194722aa 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -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 \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 311b19c5f..d1b33cfb8 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -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 diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 29339c877..d3a94efda 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -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 diff --git a/lib/Makefile.in b/lib/Makefile.in index d7347ff8b..d002f302f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -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 \ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index e87828640..5af8322fe 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -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 diff --git a/m4/Makefile.in b/m4/Makefile.in index 33dc6d6fe..252715fc0 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index d62c7d84c..aedb8b4a8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -245,6 +245,7 @@ gnits2.test \ gnits3.test \ header.test \ help.test \ +hosts.test \ implicit.test \ include.test \ include2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 61d760a03..b91e96bc8 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..46b3ebd20 --- /dev/null +++ b/tests/hosts.test @@ -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<