summaryrefslogtreecommitdiff
path: root/m4/ax_enable_builddir.m4
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2007-08-21 00:11:14 +0200
committerPeter Simons <simons@cryp.to>2007-08-21 00:11:14 +0200
commitd83225978e632724d2dd8eecccfbbcfe3e46b5fd (patch)
treecda2549a99ff00cf8b7d0e65ed76825acc7e773b /m4/ax_enable_builddir.m4
parent9b051ca8fb19c650592ab0b9836c7d96e7a2eaae (diff)
downloadautoconf-archive-d83225978e632724d2dd8eecccfbbcfe3e46b5fd.tar.gz
AX_ENABLE_BUILDDIR: Revert renaming of variable HOST to BUILD.
Further discussion on the Autoconf mailing list has reached the following consensus: although BUILD is the right choice in most cases, in case of cross-compilation it is not. Cross-compilation needs HOST to be set, so the original version of this macro is the safer choice. This patch reverts commit 41da8f494cd209a9836ebeae8f211cb84dde9153. An unpleasant property of HOST is that most shell environments define that variable to the local hostname. When configure uses $HOST as a default setting, however, that is not what it expects to find -- HOST is supposed to be config.guess tripple. Thus, the user is forced to specify HOST explicitly or to undefine $HOST in the shell before calling configure. That's a bit of mess. Bright ideas and patches are welcome.
Diffstat (limited to 'm4/ax_enable_builddir.m4')
-rw-r--r--m4/ax_enable_builddir.m449
1 files changed, 24 insertions, 25 deletions
diff --git a/m4/ax_enable_builddir.m4 b/m4/ax_enable_builddir.m4
index df99613..88c3eaf 100644
--- a/m4/ax_enable_builddir.m4
+++ b/m4/ax_enable_builddir.m4
@@ -13,7 +13,7 @@
#
# Defaults:
#
-# $1 = $build (overridden with $BUILD)
+# $1 = $host (overridden with $HOST)
# $2 = Makefile.mk
# $3 = -all
#
@@ -21,15 +21,15 @@
# default toplevel srcdir Makefile from the information found in the
# created toplevel builddir Makefile. It just copies the variables
# and rule-targets, each extended with a default rule-execution that
-# recurses into the build directory of the current "BUILD". You can
+# recurses into the build directory of the current "HOST". You can
# override the auto-dection through `config.guess` and build-time of
# course, as in
#
-# make BUILD=i386-mingw-cross
+# make HOST=i386-mingw-cross
#
# which can of course set at configure time as well using
#
-# configure --build=i386-mingw-cross
+# configure --host=i386-mingw-cross
#
# After the default has been created, additional rules can be
# appended that will not just recurse into the subdirectories and
@@ -37,10 +37,10 @@
# read from the $2 = Makefile.mk file
#
# The automatic rules are usually scanning the toplevel Makefile for
-# lines like '#### $build |$builddir' to recognize the place where to
+# lines like '#### $host |$builddir' to recognize the place where to
# recurse into. Usually, the last one is the only one used. However,
# almost all targets have an additional "*-all" rule which makes the
-# script to recurse into _all_ variants of the current BUILD (!!)
+# script to recurse into _all_ variants of the current HOST (!!)
# setting. The "-all" suffix can be overriden for the macro as well.
#
# a special rule is only given for things like "dist" that will copy
@@ -49,12 +49,11 @@
#
# LAST MODIFICATION
#
-# 2007-08-04
+# 2007-02-01
#
# COPYLEFT
#
# Copyright (c) 2007 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2007 Julian C. Cummings <cummings@cacr.caltech.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -87,7 +86,7 @@
# modified version as well.
AC_DEFUN([AX_ENABLE_BUILDDIR],[
-AC_REQUIRE([AC_CANONICAL_BUILD])[]dnl
+AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
@@ -201,11 +200,11 @@ all-configured : all[]_ALL
dnl dist-all exists... and would make for dist-all-all
/[]_ALL[]_ALL/d
/^.*[[=]]/!a\\
- @ BUILD="\$(BUILD)\" \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD=$x sh $AUX/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$BUILD " Makefile | sed -e 's/.*|//' $x \\\\\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$BUILD : \$\$n * \$\@"; if test "\$\$n" = "0" ; then : \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" = "0" ; then : \\\\\\
; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
@@ -213,11 +212,11 @@ dnl dist-all exists... and would make for dist-all-all
; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
/dist[]_ALL *:/a\\
- @ BUILD="\$(BUILD)\" \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD=$x sh $AUX/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$BUILD " Makefile | sed -e 's/.*|//' $x \\\\\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
; found=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$BUILD : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
; if test "\$\$found" = "0" ; then : \\\\\\
; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
@@ -225,11 +224,11 @@ dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
dnl special rule add-on: "distclean" removes all local builddirs completely
/distclean[]_ALL *:/a\\
- @ BUILD="\$(BUILD)\" \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD=$x sh $AUX/config.guess $x \\\\\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
; BUILD=$x grep "^#### .*| *\\./" Makefile | sed -e 's/.*|//' $x \\\\\\
; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$BUILD : \$\$n * \$\@ (all local builds)" \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
@@ -246,13 +245,13 @@ _EOF
# sanity check
if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
- $SED -e '/^@ BUILD=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
+ $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
>$SRC/Makefile~
(test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
fi
else
xxxx="\\#\\#\\#\\#"
- # echo "/^$xxxx *$ax_enable_builddir_build /d" >$tmp/conftemp.sed
+ # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
$SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
@@ -265,9 +264,9 @@ _EOF
mv "$tmp/mkfile.tmp" "$SRC/Makefile"
fi
fi
- AC_MSG_NOTICE([build in $SUB (BUILD=$ax_enable_builddir_build)])
+ AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
xxxx="####"
- echo "$xxxx" "$ax_enable_builddir_build" "|$SUB" >>$SRC/Makefile
+ echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
fi
popdef([END])dnl
AS_VAR_POPDEF([SED])dnl
@@ -277,7 +276,7 @@ AS_VAR_POPDEF([TOP])dnl
AS_VAR_POPDEF([SUB])dnl
],[dnl
ax_enable_builddir_srcdir="$srcdir" # $srcdir
-ax_enable_builddir_build="$BUILD" # $BUILD / $build
+ax_enable_builddir_host="$HOST" # $HOST / $host
ax_enable_builddir_version="$VERSION" # $VERSION
ax_enable_builddir_package="$PACKAGE" # $PACKAGE
ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX