>>>>> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes:
Alexandre> On Apr 21, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote:
>>>>>>> "Pavel" == Pavel Roskin <[EMAIL PROTECTED]> writes:
Pavel> Usage of HOST without --host= is error-prone and should be
Pavel> connsidered as deprecated (IMHO).
>> So, would there be a strong opposition to its complete removal?
Alexandre> Certainly.
:) :) :)
OK :). Just for my information, where would that be bad? Are there
scripts that depend upon this?
This is a proposal of removal of nonopt. I tried to make it
independent from the changes suggested by Mo, but it was making it
more difficult for free, so this proposal includes the relevant part
of Mo's proposal. The doc and ChangeLog adjustments will be sent if
this patch is accepted. But it is just meant to be a base for
discussion. Mo feel free to adjust it how you think it should.
Akim
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.437
diff -u -r1.437 acgeneral.m4
--- acgeneral.m4 2000/04/13 08:25:12 1.437
+++ acgeneral.m4 2000/04/21 15:11:48
@@ -898,7 +898,6 @@
AC_SUBST(exec_prefix, NONE)dnl
host=NONE
no_create=
-nonopt=NONE
no_recursion=
AC_SUBST(prefix, NONE)dnl
program_prefix=NONE
@@ -1214,13 +1213,11 @@
export $ac_envvar ;;
*)
- if echo "$ac_option" | grep '[[^-a-zA-Z0-9.]]' >/dev/null 2>&1; then
- AC_MSG_WARN(invalid host type: $ac_option)
- fi
- if test "x$nonopt" != xNONE; then
- AC_MSG_ERROR(can only configure for one host and one target at a time)
- fi
- nonopt=$ac_option
+ echo "$ac_option" | grep '[[^-a-zA-Z0-9.]]' >/dev/null 2>&1 &&
+ AC_MSG_WARN([invalid host type: $ac_option])
+ test "x$host" != xNONE &&
+ AC_MSG_ERROR([can only configure for one host at a time])
+ host=$ac_option
;;
esac
@@ -1263,7 +1260,7 @@
[AC_PACKAGE_STRING],
[this package]) to adapt to many kinds of systems.
-Usage: $[0] [[OPTION]... [VAR=VALUE]... [HOST]]
+Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
[To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.
@@ -1313,10 +1310,10 @@
cat <<\EOF
-Host type:
- --host=HOST configure for HOST [guessed]
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --target=TARGET configure for TARGET [TARGET=HOST]
+Hosts type:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST configure for building programs running on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
EOF
cat <<\EOF]
AC_DIVERT_POP()dnl
@@ -1751,31 +1748,21 @@
# -------------------
# Canonicalize the host, target, and build system types.
AC_DEFUN(AC_CANONICAL_SYSTEM,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_TARGET])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_BEFORE([$0], [AC_ARG_PROGRAM])
# Do some error checking and defaulting for the host and target type.
# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+# configure --host=HOST --target=TARGET --build=BUILD
#
# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
+# 1. Build defaults to the current host, as determined by config.guess.
+# 2. Host defaults to build.
+# 3. Target defaults to host.
# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) AC_MSG_ERROR(can only configure for one host and one target at a time) ;;
-esac
-
test "$host_alias" != "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
@@ -1790,32 +1777,31 @@
# generating the variables THING, THING_{alias cpu vendor os}, and the
# associated cache entries. We also redo the cache entries if the user
# specifies something different from ac_cv_$THING_alias on the command line.
-define(_AC_CANONICAL_THING,
+define([_AC_CANONICAL_THING],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-ifelse([$1], [host], , [AC_REQUIRE([AC_CANONICAL_HOST])])dnl
AC_MSG_CHECKING([$1 system type])
-if test "x$ac_cv_$1" = "x" || (test "x$$1" != "xNONE" && test "x$$1" !=
"x$ac_cv_$1_alias"); then
+if test "x$ac_cv_$1" = "x" ||
+ (test "x$$1" != "xNONE" &&
+ test "x$$1" != "x$ac_cv_$1_alias"); then
# Make sure we can run config.sub.
- if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
- AC_MSG_ERROR(cannot run $ac_config_sub)
- fi
+ $ac_config_sub sun4 >/dev/null 2>&1 ||
+ AC_MSG_ERROR([cannot run $ac_config_sub])
dnl Set $1_alias.
ac_cv_$1_alias=$$1
- case "$ac_cv_$1_alias" in
- NONE)
- case $nonopt in
- NONE)
-ifelse([$1], [host],[dnl
- if ac_cv_$1_alias=`$ac_config_guess`; then :
- else AC_MSG_ERROR(cannot guess $1 type; you must specify one)
- fi ;;],[dnl
- ac_cv_$1_alias=$host_alias ;;
-])dnl
- *) ac_cv_$1_alias=$nonopt ;;
- esac ;;
- esac
+ test "x$ac_cv_$1_alias" = "xNONE" &&
+ m4_case([$1],
+[build],
+ [{ ac_cv_build_alias=`$ac_config_guess` ||
+ AC_MSG_ERROR(
+ [cannot guess build (this machine) type; you must specify one]); }],
+[host],
+ [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ ac_cv_host_alias=$build_alias],
+[target],
+ [AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ ac_cv_target_alias=$host_alias])
dnl Set the other $[1] vars. Propagate the failures of config.sub.
ac_cv_$1=`$ac_config_sub $ac_cv_$1_alias` || exit 1
@@ -1828,16 +1814,11 @@
AC_MSG_RESULT($ac_cv_$1)
-$1=$ac_cv_$1
-$1_alias=$ac_cv_$1_alias
-$1_cpu=$ac_cv_$1_cpu
-$1_vendor=$ac_cv_$1_vendor
-$1_os=$ac_cv_$1_os
-AC_SUBST($1)dnl
-AC_SUBST($1_alias)dnl
-AC_SUBST($1_cpu)dnl
-AC_SUBST($1_vendor)dnl
-AC_SUBST($1_os)dnl
+AC_SUBST([$1], [$ac_cv_$1])dnl
+AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
+AC_SUBST([$1_cpu], [$ac_cv_$1_cpu])dnl
+AC_SUBST([$1_vendor], [$ac_cv_$1_vendor])dnl
+AC_SUBST([$1_os], [$ac_cv_$1_os])dnl
])# _AC_CANONICAL_THING
AC_DEFUN(AC_CANONICAL_HOST, [_AC_CANONICAL_THING([host])])