>>>>> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes:
Akim> This is one of the things I dislike in this approach.
In addition that I think it is wrong that TIMTOWTDI :)
Akim> How does it sound?
Well, how does it look? Autoconf's own configure now says:
-------------------------------------------------------------------------------
~ace % ./configure --help nostromo 17:52
`configure' configures Autoconf 2.14a to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or ..]
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
-------------------------------------------------------------------------------
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:56:57
@@ -290,7 +290,7 @@
define(AC_REQUIRE,
[AC_PROVIDE_IFELSE([$1],
[],
- [AC_DIVERT(m4_eval(AC_DIVERT_DIVERSION - 1), [$1])])
+ [AC_DIVERT(m4_eval(AC_DIVERT_DIVERSION - 1), [$1])])dnl
])
@@ -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.
@@ -1311,13 +1308,6 @@
--mandir=DIR man documentation [PREFIX/man]
EOF
- 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]
-EOF
cat <<\EOF]
AC_DIVERT_POP()dnl
dnl The order of the diversions here is
@@ -1751,31 +1741,36 @@
# -------------------
# 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_TARGET])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_BEFORE([$0], [AC_ARG_PROGRAM])
+[AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+dnl Document the options.
+AC_DIVERT_PUSH([HELP_BEGIN])dnl
+
+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]
+AC_DIVERT_POP()dnl
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ AC_MSG_ERROR([cannot run $ac_config_sub])
+
+_AC_CANONICAL_THING([build])
+
+_AC_CANONICAL_THING([host])
+
+_AC_CANONICAL_THING([target])
# 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, &&
@@ -1785,37 +1780,30 @@
# _AC_CANONICAL_THING(THING)
# --------------------------
-# Worker routine for AC_CANONICAL_{HOST TARGET BUILD}. THING is one of
-# `host', `target', or `build'. Canonicalize the appropriate thing,
+# Worker routine for AC_CANONICAL_SYSTEM. THING is one of `host',
+# `target', or `build'. Canonicalize the appropriate thing,
# 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,
-[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
-
- # 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
+# 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],
+[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
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_cv_host_alias=$build_alias],
+[target],
+ [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
@@ -1826,23 +1814,19 @@
echo $ECHO_N "(cached) $ECHO_C" >&AC_FD_MSG
fi
-AC_MSG_RESULT($ac_cv_$1)
+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
-$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_MSG_RESULT($ac_cv_$1)
])# _AC_CANONICAL_THING
+
-AC_DEFUN(AC_CANONICAL_HOST, [_AC_CANONICAL_THING([host])])
-AC_DEFUN(AC_CANONICAL_TARGET, [_AC_CANONICAL_THING([target])])
-AC_DEFUN(AC_CANONICAL_BUILD, [_AC_CANONICAL_THING([build])])
+AU_DEFUN(AC_CANONICAL_HOST, [AC_REQUIRE([AC_CANONICAL_SYSTEM])])
+AU_DEFUN(AC_CANONICAL_TARGET, [AC_REQUIRE([AC_CANONICAL_SYSTEM])])
+AU_DEFUN(AC_CANONICAL_BUILD, [AC_REQUIRE([AC_CANONICAL_SYSTEM])])
# AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
Index: doc/autoconf.texi
===================================================================
RCS file: /cvs/autoconf/doc/autoconf.texi,v
retrieving revision 1.257
diff -u -r1.257 autoconf.texi
--- doc/autoconf.texi 2000/04/13 08:25:12 1.257
+++ doc/autoconf.texi 2000/04/21 15:58:41
@@ -2559,9 +2559,10 @@
@defmac AC_CHECK_TOOL (@var{variable}, @var{prog-to-check-for},
@ovar{value-if-not-found}, @ovar{path})
@maindex CHECK_TOOL
Like @code{AC_CHECK_PROG}, but first looks for @var{prog-to-check-for}
-with a prefix of the host type as determined by @code{AC_CANONICAL_HOST},
-followed by a dash (@pxref{Canonicalizing}). For example, if the user
-runs @samp{configure --host=i386-gnu}, then this call:
+with a prefix of the host type as determined by
+@code{AC_CANONICAL_SYSTEM}, followed by a dash (@pxref{Canonicalizing}).
+For example, if the user runs @samp{configure --host=i386-gnu}, then
+this call:
@example
AC_CHECK_TOOL(RANLIB, ranlib, :)
@end example
@@ -2588,9 +2589,9 @@
@maindex PATH_TOOL
Like @code{AC_PATH_PROG}, but first looks for @var{prog-to-check-for}
with a prefix of the host type as determined by
-@code{AC_CANONICAL_HOST},
-followed by a dash (@pxref{Canonicalizing}). For example, if the user
-runs @samp{configure --host=i386-gnu}, then this call:
+@code{AC_CANONICAL_SYSTEM}, followed by a dash (@pxref{Canonicalizing}).
+For example, if the user runs @samp{configure --host=i386-gnu}, then
+this call:
@example
AC_PATH_TOOL(FILE, file, :, /usr/bin:$PATH)
@end example
@@ -5711,17 +5712,6 @@
the variables this macro sets.
@end defmac
-@defmac AC_CANONICAL_HOST
-@defmacx AC_CANONICAL_BUILD
-@defmacx AC_CANONICAL_TARGET
-@maindex CANONICAL_HOST
-@maindex CANONICAL_BUILD
-@maindex CANONICAL_TARGET
-Perform only the subset of @code{AC_CANONICAL_SYSTEM} relevant to the
-host or build or target type. @code{AC_CANONICAL_HOST} is all that is
-needed for programs that are not part of a compiler tool chain.
-@end defmac
-
@defmac AC_VALIDATE_CACHED_SYSTEM_TUPLE (@var{cmd})
@maindex VALIDATE_CACHED_SYSTEM_TUPLE
If the cache file is inconsistent with the current host,
@@ -5733,9 +5723,7 @@
@section System Type Variables
After calling @code{AC_CANONICAL_SYSTEM}, the following output variables
-contain the system type information. After @code{AC_CANONICAL_HOST},
-@code{AC_CANONICAL_BUILD}, or @code{AC_CANONICAL_TARGET}, only the
-@code{host}, @code{build}, or @code{target} variables below are set.
+contain the system type information.
@table @code
@ovindex build