autoconf: 1999-09-01 Akim Demaille <akim@epita.fr>

From ce28803b045ca8f9589df48200adda364ab91f92 Mon Sep 17 00:00:00 2001
From: Akim Demaille <[EMAIL REDACTED]>
Date: Wed, 1 Sep 1999 09:42:37 +0000
Subject: [PATCH] 1999-09-01  Akim Demaille  <akim@epita.fr>

	* acgeneral.m4 (AC_ACVERSION): Bump to 2.14.1 to differenciate the
	experimental branch from the main trunk.

	* acgeneral.m4 (AC_FOREACH_COMMA): New macro, to perform m4 loops
 	on m4 lists (i.e., list='(item_1, item_2, ..., item_n)').
	(AC_FOREACH): New macro, to perform m4 loops on shell lists (i.e.,
 	list='item_1 item_2 ... item_n').

	* acgeneral.m4 (AC_DEFUN): Now accept two other optionnal
 	parameters: the name of the macro which is specialized here, and
 	the name of the first argument.  For instance `AC_CHECK_FNMATCH'
 	should be declared as specializing `AC_CHECK_FUNC' for `fnmatch'
 	as first argument.

	* acgeneral.m4 (AC_CHECK_FILES): Use AC_FOREACH for looping,
 	instead of the shell's loop.

	* acgeneral.m4 (AC_TR): In addition to transliteration, provide a
 	mean to specify the valid destination alphabet and a default
 	character for aliens characters.  This is in order to remove
	characters such as `+:-' etc. that may appear in file names,
	but are not valid for shell variables or #defines.
	(AC_TR_DEFINE): New macro, maps anything to a valid uppercase
 	#define rhs.
	(AC_TR_UPCASE_NAME): Replaced by AC_TR_DEFINE.  All callers
 	changed.
	(AC_TR_UPCASE_FILE): Likewise.

	* acgeneral.m4 (AC_TR_SH): Don't use the generic AC_TR: there is a
 	difficult problem of quoting between m4 and sh.  Use the variable
 	$ac_tr_sh to work around this difficulty.
	(AC_VAR_TEST_SET): New macro, which tests if a variable is set.
	(AC_VAR_IF_SET): New `ifelse' macro.
	(AC_CACHE_VAL): Use AC_VAR_IF_SET.
	(AC_INIT_NOTICE): Define $ac_tr_sh.

	* acgeneral.m4 (AC_CHECK_FILE): Converted to use AC_TR and AC_VAR
 	families.

	* acgeneral.m4: Fixed the regular expressions: `$' shall not be
	portably in a sed \(\) group.
---
 ChangeLog               | 126 +++++++++++------
 acgeneral.m4            | 300 +++++++++++++++++++++++++++++++---------
 configure               |  73 ++++++----
 lib/autoconf/general.m4 | 300 +++++++++++++++++++++++++++++++---------
 4 files changed, 592 insertions(+), 207 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d317c87d..8b10b2df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,60 @@
+1999-09-01  Akim Demaille  <akim@epita.fr>
+
+	* acgeneral.m4 (AC_ACVERSION): Bump to 2.14.1 to differenciate the
+	experimental branch from the main trunk.
+
+	* acgeneral.m4 (AC_FOREACH_COMMA): New macro, to perform m4 loops
+ 	on m4 lists (i.e., list='(item_1, item_2, ..., item_n)').
+	(AC_FOREACH): New macro, to perform m4 loops on shell lists (i.e.,
+ 	list='item_1 item_2 ... item_n').
+
+	* acgeneral.m4 (AC_DEFUN): Now accept two other optionnal
+ 	parameters: the name of the macro which is specialized here, and
+ 	the name of the first argument.  For instance `AC_CHECK_FNMATCH'
+ 	should be declared as specializing `AC_CHECK_FUNC' for `fnmatch'
+ 	as first argument.
+
+	* acgeneral.m4 (AC_CHECK_FILES): Use AC_FOREACH for looping,
+ 	instead of the shell's loop.
+
+	* acgeneral.m4 (AC_TR): In addition to transliteration, provide a
+ 	mean to specify the valid destination alphabet and a default
+ 	character for aliens characters.  This is in order to remove
+	characters such as `+:-' etc. that may appear in file names,
+	but are not valid for shell variables or #defines.
+	(AC_TR_DEFINE): New macro, maps anything to a valid uppercase
+ 	#define rhs.
+	(AC_TR_UPCASE_NAME): Replaced by AC_TR_DEFINE.  All callers
+ 	changed.
+	(AC_TR_UPCASE_FILE): Likewise.
+
+	* acgeneral.m4 (AC_TR_SH): Don't use the generic AC_TR: there is a
+ 	difficult problem of quoting between m4 and sh.  Use the variable
+ 	$ac_tr_sh to work around this difficulty.
+	(AC_VAR_TEST_SET): New macro, which tests if a variable is set.
+	(AC_VAR_IF_SET): New `ifelse' macro.
+	(AC_CACHE_VAL): Use AC_VAR_IF_SET.
+	(AC_INIT_NOTICE): Define $ac_tr_sh.
+
+	* acgeneral.m4 (AC_CHECK_FILE): Converted to use AC_TR and AC_VAR
+ 	families.
+
+	* acgeneral.m4: Fixed the regular expressions: `$' shall not be
+	portably in a sed \(\) group.
+
 1999-08-22  Matthew D. Langston  <langston@SLAC.Stanford.EDU>
 
 	* acspecific.m4 (AC_PROG_CC): Remove uname test for win32/Cygwin,
 	and just test for `cl' as a last resort.
- 
+
 	* autoconf.texi (Particular Programs): Document new optional
 	argument to AC_PROG_CC, AC_PROG_CXX and AC_PROG_F77.  Document
 	additions to the Fortran 77 compiler search list.
- 
+
  	* acspecific.m4 (AC_PROG_F77): Add more Fortran 77 compilers to
 	the search list.  Contributed by Steven G. Johnson
 	<stevenj@alum.mit.edu>.
- 
+
 	(AC_PROG_CC): Likewise.
 	(AC_PROG_CXX): Likewise.
 	* acspecific.m4 (AC_PROG_F77): Add an optional first argument
@@ -37,7 +81,7 @@
 	* acgeneral.m4 (AC_LIST_MEMBER_OF): New "private implementation
 	macro" use by AC_F77_LIBRARY_LDFLAGS.
 	(AC_LINKER_OPTION): Likewise.
-	
+
 1999-06-09  Matthew D. Langston  <langston@SLAC.Stanford.EDU>
 
 	* autoconf.texi (Pretty Help Strings): Synchronize documentation
@@ -107,7 +151,7 @@
 
 	* autoheader.m4 (AC_DEFINE): Ignore CPP macro arguments.
 	(AC_DEFINE_UNQUOTED): Likewise.
-	
+
 	* acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): Change sed regexps to
 	recognize CPP macros that take arguments.  Reported, and based on
 	a patch, by Steven G. Johnson <stevenj@alum.mit.edu>.
@@ -201,12 +245,12 @@
 	* mkinstalldirs: Add `-m' flag to specify the mode of a newly
 	created directory. Add command line usage and `-h', `--help'
 	options. Contributed by Jeff Garzik <jgarzik@pobox.com>.
-	
+
 1999-04-08  Ben Elliston  <bje@cygnus.com>
 
 	* acspecific.m4 (AC_PROG_CC): Try using the `cl' C compiler under
 	Cygwin. Contributed by Scott Stanton <stanton@scriptics.com>.
-	
+
 	* config.sub: Handle MPE/iX.
 
 1999-04-07  Ben Elliston  <bje@cygnus.com>
@@ -275,7 +319,7 @@
 	* config.guess: Correct typo for detecting ELF on FreeBSD.
 
 1998-03-14  Alexandre Oliva  <oliva@dcc.unicamp.br>
-	
+
 	* config.guess: Recognise HP 9000/8x0 machines.
 
 1999-03-11  Ben Elliston  <bje@cygnus.com>
@@ -290,14 +334,14 @@
 	with the value of $BUILD_CC in cross-compilation environments
 	where the native compiler must be used for running tests on the
 	host.
-		
+
 1999-03-11  Ben Elliston  <bje@cygnus.com>
 
 	* config.guess: Recognise MiNT and TOS on Atari machines.
 	Contributed by Guido Flohr <gufl0000@stud.uni-sb.de>.
 
 	* config.sub: Add aliases for MiNT.
-	
+
 1999-03-10  Ben Elliston  <bje@cygnus.com>
 
 	* config.guess: Recognise HP 9000/800. Merged from the master
@@ -359,7 +403,7 @@
 	by Markus Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>.
 
 1999-02-19  Ben Elliston <bje@cygnus.com>
-	
+
 	* config.guess: Automatically recognise ELF on FreeBSD. From Niall
 	Smart and improved by Andrew Cagney.
 
@@ -398,10 +442,10 @@
 	* acspecific.m4 (AC_PROG_INSTALL): set INSTALL_SCRIPT to
 	${INSTALL} so that automake doesn't propogate install time flags
 	for INSTALL_PROGRAM into INSTALL_SCRIPT.
-	
+
 1999-01-25  Ben Elliston  <bje@cygnus.com>
 
-	* install-sh: Use $mkdirprog, not `mkdir' directly. Contributed by 
+	* install-sh: Use $mkdirprog, not `mkdir' directly. Contributed by
 	Jeff Garzik <jgarzik@pobox.com>.
 
 	* Makefile.in (clean mostlyclean distclean maintainer-clean):
@@ -444,7 +488,7 @@
 1999-01-14  Scott Bambrough  <scottb@corelcomputer.com>
 
 	* config.guess: Recognise armv[234][lb] types (ie. `armv*').
-		
+
 1999-01-13  Ben Elliston  <bje@cygnus.com>
 
 	* autoconf.sh: Remove -v and --verbose from the command line usage
@@ -476,7 +520,7 @@
 
 	* config.guess: Detect Rhapsody on PowerPC and other machines.
 	Contributed by Wilfredo Sanchez <wsanchez@apple.com>.
-	
+
 	* config.sub: Add rhapsody and openstep aliases.
 
 1999-01-09  Ben Elliston  <bje@cygnus.com>
@@ -484,7 +528,7 @@
 	* Makefile.in (html): New target. Generate HTML documentation.
 	(install-strip): Add.
 	Contributed by Wilfredo Sanchez <wsanchez@apple.com>.
-	
+
 	* autoconf.texi (AC_CHECK_LIB): Explain more. Contributed by Bob
 	Friesenhahn <bfriesen@simple.dallas.tx.us>.
 	(UPDATED): Bump to 1999.
@@ -495,13 +539,13 @@
 1999-01-09  J"orn Rennecke  <amylaar@cygnus.co.uk>
 
 	* acgeneral.m4 (AC_CHECK_FUNC): Don't actually call the function.
-	
+
 1999-01-09  H.J. Lu  <hjl@lucon.org>
 
 	* config.guess: Permit multiple concurrent instances by including
 	the process ID of the shell running this script in temporary
 	filenames.
-		
+
 1999-01-08  Ben Elliston  <bje@cygnus.com>
 
 	* autoconf.sh: More useful and up-to-date help from the --help
@@ -541,7 +585,7 @@
 	(AC_MINGW32): Likewise.
 	(AC_TRY_LINK_FUNC): Likewise.
 	(AC_VALIDATE_CACHED_SYSTEM_TUPLE): Likewise.
-	
+
 1999-01-01  Ben Elliston  <bje@cygnus.com>
 
 	* NEWS: Update.
@@ -575,7 +619,7 @@
 	(AC_FUNC_SELECT_ARGTYPES): Document.
 	(AC_C_STRINGIZE): Likewise.
 	(AC_VALIDATE_CACHED_SYSTEM_TUPLE): Likewise.
-	
+
 	* acspecific.m4 (AC_CYGWIN): Rename from `AC_CYGWIN32'.
 	(AC_CYGWIN32): Warn about deprecated usage. Forward to AC_CYGWIN.
 
@@ -588,7 +632,7 @@
 	* NEWS: Update.
 
 	* configure: Rebuild.
-	
+
 1998-12-26  Ben Elliston  <bje@cygnus.com>
 
 	* autoreconf.sh (stamp): Add missing quote.
@@ -598,7 +642,7 @@
 	<steve@nyongwa.montreal.qc.ca>.
 
 1998-12-11  Matthew D. Langston  <langston@SLAC.Stanford.EDU>
-	
+
 	* acconfig.h, acgeneral.m4, acspecific.m4, autoconf.texi: Change
 	all of the Fortran 77 code to use the new `F77' prefix instead of
 	the older `FC' prefix.
@@ -622,7 +666,7 @@
 	and run aclocal and automake when needed. Also, create stamp files
 	just like automake's Makefiles would do for config headers.
 	Additional contributions from Tom Tromey <tromey@cygnus.com>.
-	
+
 1998-10-24  Matthew D. Langston  <langston@SLAC.Stanford.EDU>
 
 	* acgeneral.m4 (AC_LANG_FORTRAN77): Remove [] (i.e. the m4 quotes)
@@ -649,7 +693,7 @@
 	* config.guess: Hide warnings emitted by the HP linker when
 	generating a PA 2.0 object file. Contributed by Marcus Thiessel
 	<marcus@xemacs.org>.
-	
+
 1998-10-20  Ben Elliston  <bje@cygnus.com>
 
 	* acgeneral.m4 (AC_LANG_RESTORE): Fix a typo spotted by Noah
@@ -714,7 +758,7 @@ Sun Oct  4 21:57:20 1998  Tom Tromey  <tromey@cygnus.com>
 	using $(INSTALL_DATA).
 	(.m4.m4f): Freeze files if m4 supports stored internal state.
 	Contributed by Karl Heuer <kwzh@gnu.org>.
-	
+
 	* install-sh: Import latest version from the FSF.
 
 	* mkinstalldirs: Likewise.
@@ -731,14 +775,14 @@ Sun Oct  4 21:57:20 1998  Tom Tromey  <tromey@cygnus.com>
 	Robbins <arnold@gnu.org> on behalf of the GNU AWK project.
 
 	* acconfig.h (HAVE_STRINGIZE): Add for the AC_C_STRINGIZE macro.
-		
+
 	* testsuite/Makefile.in (check): If DejaGNU is not installed,
 	print a warning and skip the `dejacheck' target (which will fail).
 	(site.exp): Use tests to guard commands from generating error
 	messages if `site.exp' or `site.bak' do not exist. Contributed by
 	Karl Heuer <kwzh@gnu.org>.
 	(dejacheck): Remove unused target.
-	
+
 1998-09-26  Ben Elliston  <bje@cygnus.com>
 
 	* texinfo.tex: Import latest version from the FSF.
@@ -754,7 +798,7 @@ Sun Oct  4 21:57:20 1998  Tom Tromey  <tromey@cygnus.com>
 
 1998-09-15  Didier Verna  <verna@inf.enst.fr>
 
-	* acspecific.m4 (AC_PATH_XTRA): use X_EXTRA_LIBS add-on libraries 
+	* acspecific.m4 (AC_PATH_XTRA): use X_EXTRA_LIBS add-on libraries
 	in the test for libICE. It is needed at least under Solaris.
 
 1998-09-15  Ben Elliston  <bje@cygnus.com>
@@ -864,7 +908,7 @@ Tue Nov 18 14:21:38 1997  Eric Mumpower  <nocturne@cygnus.com>
 	autoreconf would end up executing incorrect shell code (e.g.
 	"test ! -f 1.h 2.h.in") in such cases.
 	Patch submitted in parallel to bug-gnu-utils@prep.ai.mit.edu.
-	
+
 Fri Oct  3 18:10:39 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* acgeneral.m4 (AC_CACHE_SAVE): Add a grep when checking whether
@@ -911,7 +955,7 @@ Mon Dec  9 23:39:17 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
 	* acspecific.m4 (AC_FUNC_GETLOADAVG): Add a semicolon between
 	shell variable assignments; the evaluation order varies between
-	implementations. 
+	implementations.
 
 Tue Nov 26 13:00:28 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
@@ -1044,10 +1088,10 @@ Tue Nov 12 00:06:14 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	These macros don't change the linkage options.
 
 	* Test release 2.10.2.
-	
+
 	* acspecific.m4 (AC_PROG_CC, AC_PROG_CXX) [GCC]: Use -O2 instead
 	of -O.  Suggested by fnf@ninemoons.com (Fred Fish).
-	
+
 	* acgeneral.m4 (AC_OUTPUT_HEADER): Support passing
  	AC_CONFIG_HEADER a value containing shell variables.  Suggested by
  	Markku Savela <msa@msa.tte.vtt.fi> and Julian Onions
@@ -1055,10 +1099,10 @@ Tue Nov 12 00:06:14 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	* acgeneral.m4 (AC_TRY_RUN_NATIVE, AC_TRY_LINK, AC_TRY_COMPILE,
         AC_TRY_CPP): Show the test program in config.log if the test fails.
 	From Karl Berry <karl@cs.umb.edu>.
-	
+
 	* testsuite/config/unix.exp: Run the configure script as "./script"
 	in case the user doesn't have "." in their PATH.
-	
+
 Mon Nov 11 18:02:58 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
 	* acgeneral.m4 (AC_TRY_COMPILE, AC_TRY_LINK): Deal with smart
@@ -1077,7 +1121,7 @@ Mon Nov 11 18:02:58 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	* autoheader.sh: Don't cmp with config.h.in if it doesn't exist yet.
 	Don't frob lines 1-@TOP@ or @BOTTOM@-end of acconfig.h's.
 	Accept TAB as well as SPC after #undef in acconfig.h's.
-	
+
 Sat Nov  9 01:54:04 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
 	* Test release 2.10.1.
@@ -1091,7 +1135,7 @@ Sat Nov  9 01:54:04 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	isn't eaten.
 
 	* autoheader.sh: Add multiple-inclusion protection for config.h.
-	
+
 	* acgeneral.m4 (AC_PREFIX_PROGRAM): Pretty up the output.
 	(AC_CHECK_LIB): Include the function being tested in the message.
 	(AC_CHECK_PROG, AC_PATH_PROG): Add a dummy variable to force word
@@ -1103,7 +1147,7 @@ Sat Nov  9 01:54:04 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
 	* acgeneral.m4 (AC_CACHE_SAVE): Accept the HP-UX sh 'set' output
 	format.  From Marcus Daniels <marcus@sysc.pdx.edu>.
-	
+
 	* acgeneral.m4 (AC_MSG_CHECKING, AC_CHECKING): Write a message to
 	config.log also.  From "T.E.Dickey" <dickey@clark.net>.
 	(AC_CHECK_LIB, AC_CHECK_HEADER, AC_CHECK_HEADERS): Replace use of
@@ -1112,7 +1156,7 @@ Sat Nov  9 01:54:04 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	tr interprets \055 as a range specifier, like an unquoted -.
 	* acspecific.m4 (AC_PROG_MAKE_SET, AC_CHECK_HEADER_DIRENT,
 	AC_CHECK_HEADERS_DIRENT): Ditto.
-	
+
 	* acspecific.m4 (AC_FUNC_SETPGRP): New macro.
         * acconfig.h (SETPGRP_VOID): New entry.
 	From "T.E.Dickey" <dickey@clark.net>.
@@ -1134,7 +1178,7 @@ Sat Nov  9 01:54:04 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	Don't blather about being called before AC_TRY_LINK,
 	which is now called in AC_PROG_CC.  Don't encourage using this macro.
         * acconfig.h (X_DISPLAY_MISSING): Add entry.
-	
+
 Fri Nov  8 16:02:08 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
 	* acspecific.m4 (AC_PATH_X_DIRECT): Search for /usr/X11 before
@@ -1152,9 +1196,9 @@ Fri Nov  8 16:02:08 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 	C[XX]FLAGS is set.  From T.E.Dickey <dickey@clark.net>
 	(AC_FUNC_FNMATCH): New macro.
 	* acconfig.h (HAVE_FNMATCH): New entry.
-	
+
 	* acgeneral.m4 (AC_REPLACE_FUNCS): Call AC_CHECK_FUNCS to do the work.
-	
+
 Tue Oct 29 13:03:44 1996  Doug Evans  <dje@canuck.cygnus.com>
 
 	* acgeneral.m4 (AC_OUTPUT_SUBDIRS): Fix thinko in computation of
diff --git a/acgeneral.m4 b/acgeneral.m4
index e51adfd7..6f381c53 100644
--- a/acgeneral.m4
+++ b/acgeneral.m4
@@ -52,7 +52,7 @@ dnl
 divert(-1)dnl Throw away output until AC_INIT is called.
 changequote([, ])
 
-define(AC_ACVERSION, 2.13.1)
+define(AC_ACVERSION, 2.14.1)
 
 dnl Some old m4's don't support m4exit.  But they provide
 dnl equivalent functionality by core dumping because of the
@@ -62,10 +62,16 @@ Install it before installing Autoconf or set the
 M4 environment variable to its path name.
 )m4exit(2)])
 
-undefine([eval])
-undefine([include])
-undefine([shift])
-undefine([format])
+dnl Some m4 internals have names colliding with tokens we might use.
+dnl Rename them a` la `m4 --prefix-builtins'.
+define([m4_prefix],
+[define([m4_$1], defn([$1]))
+undefine([$1])])
+
+m4_prefix([eval])
+m4_prefix([include])
+m4_prefix([shift])
+m4_prefix([format])
 
 
 dnl ### Defining macros
@@ -127,6 +133,8 @@ undivert(AC_DIVERSION_NORMAL_1)dnl
 ])dnl
 ])
 
+dnl AC_DEFUN(NAME, [REPLACED-FUNCTION, ARGUMENT, ]EXPANSION)
+dnl --------------------------------------------------------
 dnl Define a macro which automatically provides itself.  Add machinery
 dnl so the macro automatically switches expansion to the diversion
 dnl stack if it is not already using it.  In this case, once finished,
@@ -135,9 +143,18 @@ dnl This, combined with AC_REQUIRE, achieves the topological ordering of
 dnl macros.  We don't use this macro to define some frequently called
 dnl macros that are not involved in ordering constraints, to save m4
 dnl processing.
-dnl AC_DEFUN(NAME, EXPANSION)
+dnl
+dnl If the REPLACED-FUNCTTION and ARGUMENT are defined, then declare that
+dnl NAME is a specialized version of REPLACED-FUNCTION when its first
+dnl argument is ARGUMENT.  For instance AC_TYPE_SIZE_T is a specialization
+dnl of AC_CHECK_TYPE applied to `size_t'.
 define([AC_DEFUN],
-[define($1, [AC_PRO([$1])$2[]AC_EPI()])])
+[ifelse([$3],,
+[define([$1], [AC_PRO([$1])$2[]AC_EPI()])],
+[define([$2-$3], [$1])
+define([$1], [AC_PRO([$1])$4[]AC_EPI()])])])
+
+
 
 
 dnl ### Common m4/sh handling of variables (indirections)
@@ -160,18 +177,93 @@ define(AC_VAR_IF_INDIR,
         [$2])])
 
 dnl AC_VAR_SET(VARIABLE, VALUE)
+dnl ---------------------------
 dnl Set the VALUE of the shell VARIABLE.
 dnl If the variable contains indirections (e.g. `ac_cv_func_$ac_func`)
 dnl perform whenever possible at m4 level, otherwise sh level.
 define(AC_VAR_SET,
-[AC_VAR_IF_INDIR([$1], eval "[$1]=[$2]", [$1]=[$2])])
+[AC_VAR_IF_INDIR([$1],
+                 [eval "$1=$2"],
+                 [$1=$2])])
+
 
 dnl AC_VAR_GET(VARIABLE)
+dnl --------------------
 dnl Get the value of the shell VARIABLE.
 dnl Evaluates to $VARIABLE if there are no indirection in VARIABLE,
 dnl else into the appropriate `eval' sequence.
 define(AC_VAR_GET,
-[AC_VAR_IF_INDIR([$1], [`eval "echo \`echo $\"$1\"\`"`], $[$1])])
+[AC_VAR_IF_INDIR([$1],
+                 [`eval echo '${'patsubst($1, [[\\`]], [\\\&])'}'`],
+                 [$[]$1])])
+
+
+dnl AC_VAR_TEST_SET(VARIABLE)
+dnl -------------------------
+dnl Expands into the `test' expression which is true if VARIABLE
+dnl is set.  Polymorphic.
+define(AC_VAR_TEST_SET,
+[AC_VAR_IF_INDIR([$1],
+           [eval "test \"\${$1+set}\" = set"],
+           [test "${$1+set}" = set])])
+
+
+
+dnl AC_VAR_IF_SET(VARIABLE, IF-TRUE, IF-FALSE)
+dnl ------------------------------------------
+dnl Implement a shell `if-then-else' depending whether VARIABLE is set
+dnl or not.  Polymorphic.
+define(AC_VAR_IF_SET,
+[if AC_VAR_TEST_SET([$1]); then
+  ifelse([$2], , :, [$2])
+ifelse([$3], , ,
+[else
+  $3
+])dnl
+fi
+])
+
+dnl AC_VAR_PUSHDEF and AC_VAR_POPDEF
+dnl --------------------------------
+dnl
+
+dnl The idea behind these macros is that we may sometimes have to handle
+dnl manifest values (e.g. `stdlib.h'), while at other moments, the same
+dnl code may have to get the value from a variable (e.g., `ac_header').
+dnl To have a uniform handling of both case, when a new value is about to
+dnl be processed, declare a local variable, e.g.:
+dnl
+dnl   AC_VAR_PUSHDEF([header], [ac_cv_header_$1])
+dnl
+dnl and then in the body of the macro, use `header' as is.  It is of first
+dnl importance to use `AC_VAR_*' to access this variable.  Don't quote its
+dnl name: it must be used right away by m4.
+dnl
+dnl If the value `$1' was manifest (e.g. `stdlib.h'), then `header' is in
+dnl fact the value `ac_cv_header_stdlib_h'.  If `$1' was indirect, then
+dnl `header's value in m4 is in fact `$ac_header', the shell variable that
+dnl holds all of the magic to get the expansion right.
+dnl
+dnl At the end of the block, free the variable with
+dnl
+dnl   AC_VAR_POPDEF([header])
+
+dnl AC_VAR_PUSHDEF(VARNAME, VALUE)
+dnl ------------------------------
+dnl Define the m4 macro VARNAME to an accessor to the shell variable
+dnl named VALUE.  VALUE does not need to be a valid shell variable name:
+dnl the transliteration is handled here.
+define(AC_VAR_PUSHDEF,
+[AC_VAR_IF_INDIR([$2],
+[ac_$1=AC_TR_SH($2)
+pushdef([$1], [$ac_[$1]])],
+[pushdef([$1], [AC_TR_SH($2)])])])
+
+dnl AC_VAR_POPDEF(VARNAME)
+dnl ----------------------
+dnl Free the shell variable accessor VARNAME.
+define(AC_VAR_POPDEF,
+[popdef([$1])])
 
 
 dnl ### Common m4/sh character translation
@@ -188,18 +280,24 @@ dnl - m4/sh polymorphism
 dnl   Transliteration of manifest strings should be handled by m4, while
 dnl   shell variables' content will be translated at run time (tr or sed).
 
-dnl AC_TR(STRING, FROM, TO)
+dnl AC_TR(STRING, FROM, TO, ALPHABET, DEFAULT)
+dnl ------------------------------------------
+dnl
 dnl Perform tr 'FROM' 'TO' on STRING by m4 when possible, otherwise
-dnl by the shell at configure time.
+dnl by the shell at configure time.  After transliteration, any character
+dnl which is not part of ALPHABET is then mapped to DEFAULT.
+dnl
 dnl We use `sed' and not `tr' when there is a `-', because:
 dnl - if `-' is in the middle, it is taken as a range.
 dnl - if `-' is at the beginning, some `tr' think it is an option.
 dnl - if `-' is at the end, Solaris, `/usr/bin/tr' hangs.  I suspect
 dnl   that it takes `a-' as the C string "a-\0", and when expanding
 dnl   from `a' to `\0' never ends...
+dnl
 dnl Include a protection against `%' (used as a sed separator) in FROM and TO.
-dnl Forbid appearence of `-' elsewhere than in the last position,
+dnl Forbid appearence of `-' in FROM elsewhere than in the last position,
 dnl since we might otherwise trigger a GNU m4 bug (version 1.4 included).
+dnl ALPHABET may contain characters interval.
 define(AC_TR,
 [ifelse(regexp([$2$3], [%]), -1,,
 	[AC_FATAL([$0: `%' cannot be used.  Change the definition of $0])])dnl
@@ -208,34 +306,90 @@ ifelse(regexp([$2], [-]), -1,, len([$2]),,
 ifelse(len([$2]), len([$3]),,
        [AC_FATAL([$0: argument 2 and 3 should have the same length])])dnl
 AC_VAR_IF_INDIR([$1],
-                `echo "[$1]" | ifelse(regexp([$2], [-]), -1,
-                                      tr '[$2]' '[$3]',
-                                      sed 'y%[$2]%[$3]%')`,
-                [translit([$1], [$2], [$3])])])
-
-dnl AC_TR_UPCASE_NAME(EXPRESSION)
-dnl If EXPRESSION has to be shell expanded (contains ` or $), late
-dnl upper casing is performed (at configure time), else at autoconf time.
-dnl Space and star are included because they may appear as part of a type.
-define(AC_TR_UPCASE_NAME,
-[AC_TR([$1],
-       [* abcdefghijklmnopqrstuvwxyz],
-       [P_ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
+  [`echo "$1" | sed 'y%$2%$3%;s%[^$4]%$5%g'`],
+  [patsubst(translit([$1], [$2], [$3]),
+                             [[^$4]], [$5])])])
 
-dnl AC_TR_UPCASE_FILE(EXPRESSION)
-dnl Same as AC_UPCASE_NAME, but also maps `.-/' to `___'.
-dnl Used for CPP macros.
-define(AC_TR_UPCASE_FILE,
+dnl AC_TR_DEFINE(EXPRESSION)
+dnl ------------------------
+dnl
+dnl Map EXPRESSION to an upper case string which is valid as rhs for a
+dnl `#define'.  sh/m4 polymorphic.
+define(AC_TR_DEFINE,
 [AC_TR([$1],
-       [abcdefghijklmnopqrstuvwxyz./-],
-       [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+       [*abcdefghijklmnopqrstuvwxyz],
+       [PABCDEFGHIJKLMNOPQRSTUVWXYZ],
+       [A-Z0-9_],
+       [_])])
+
 
 dnl AC_TR_SH(EXPRESSION)
+dnl --------------------
+dnl
 dnl Transform EXPRESSION into a valid shell variable name.
+dnl sh/m4 polymorphic.  Because of a delicate problem of quoting,
+dnl we cannot use the definition we had before:
+dnl    AC_TR([$1],[*+], [pp], [a-zA-Z0-9_], [_])
 define(AC_TR_SH,
-[AC_TR([$1],
-       [ *+./-],
-       [_pp___])])
+[AC_VAR_IF_INDIR([$1],
+  [`echo "$1" | $ac_tr_sh`],
+  [patsubst(translit([$1], [*+], [pp]),
+                     [[^a-zA-Z0-9_]], [_])])])
+
+
+
+dnl ### Implementing m4 loops
+
+
+dnl AC_FOREACH_COMMA(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------------
+dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST
+dnl (LIST has the form `(item_1, item_2, ..., item_n)').
+define(AC_FOREACH_COMMA,
+[pushdef([$1], [])_AC_FOREACH([$1], [$2], [$3])popdef([$1])])
+
+dnl Low level macros used to define AC_FOREACH_COMMA.
+define(_AC_CAR, [$1])
+define(_AC_CDR, [builtin(shift, $@)])
+define(_AC_FOREACH,
+[ifelse([$2], [()], ,
+        [define([$1], _AC_CAR$2)$3[]_AC_FOREACH([$1],
+                                                (_AC_CDR$2),
+                                                [$3])])])
+
+dnl _AC_COMMATIZE(LIST)
+dnl -------------------
+dnl Use patsubst to go from an AC_FOREACH_COMMA list to a AC_FOREACH
+dnl list.  Do not use `patsubst([$2], [\>\W+\<], [,])', since it swallows
+dnl the `$' from the variable names, so, 1. swallow `\[CR]' (I don't
+dnl understand why I need two backslashes), 2. remove trailing spaces, 3.
+dnl replace remaining sequences of spaces with commas.
+define([_AC_COMMATIZE],
+[patsubst(patsubst(patsubst([$1], [\\
+]), [[  ]+$]), [[       ]+], [,])])
+
+
+dnl AC_FOREACH(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------
+dnl
+dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST.
+dnl (LIST has the form `item_1 item_2 ... item_n': there are no commas.)
+dnl
+define(AC_FOREACH,
+[AC_FOREACH_COMMA([$1], (_AC_COMMATIZE([$2])), [$3])])
+
+
+dnl AC_SPECIALIZE(MACRO, ARG1 [, ARGS...])
+dnl --------------------------------------
+dnl
+dnl Basically calls the macro MACRO with arguments ARG1, ARGS... But if
+dnl there exist a specialized version of MACRO for ARG1, use this macro
+dnl instead with arguments ARGS (i.e., ARG1 is *not* given).  See the
+dnl definition of `AC_DEFUN'.
+AC_DEFUN(AC_SPECIALIZE,
+[ifdef([$1-$2],
+       [indir([$1-$2], m4_shift(m4_shift($@)))],
+       [indir([$1], m4_shift($@))])])
 
 
 dnl ### Initialization
@@ -245,7 +399,7 @@ dnl AC_INIT_NOTICE()
 AC_DEFUN(AC_INIT_NOTICE,
 [# Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version] AC_ACVERSION [
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
@@ -309,6 +463,10 @@ MFLAGS= MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
+# Sed expression to map a string onto a valid sh variable name
+changequote(, )dnl
+ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g'
+changequote([, ])dnl
 
 ac_prev=
 for ac_option
@@ -1301,18 +1459,17 @@ fi
 rm -f confcache
 ])
 
-dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
 dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
+dnl ------------------------------------------
+dnl
+dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
 define(AC_CACHE_VAL,
 [dnl We used to use the below line, but it fails if the 1st arg is a
 dnl shell variable, so we need the eval.
 dnl if test "${$1+set}" = set; then
-if eval "test \"\${$1+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG
-else
-  $2
-fi
-])
+AC_VAR_IF_SET([$1],
+              [echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG],
+              [$2])])
 
 dnl AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
 define(AC_CACHE_CHECK,
@@ -1383,8 +1540,6 @@ m4exit(ifdef([$2], [$2], 1))])
 
 dnl ### Printing messages at configure run time
 
-define(echo1, [$1])
-
 dnl _AC_SH_QUOTE(STRING)
 dnl Quote the back quotes but if they are already quoted.
 dnl This exception is to provide backwards compatibility.
@@ -1865,7 +2020,7 @@ LIBS="$ac_save_LIBS"
 AC_MSG_RESULT($AC_CV_NAME)
 if test "$AC_CV_NAME" = yes; then
   ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]AC_TR_UPCASE_NAME(AC_LIB_NAME))
+[AC_DEFINE([HAVE_LIB]AC_TR_DEFINE(AC_LIB_NAME))
   LIBS="-l[]AC_LIB_NAME[] $LIBS"
 ], [$2])
 ifelse([$3], , , [else
@@ -2098,40 +2253,49 @@ done
 dnl ### Checking for the existence of files
 
 dnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl --------------------------------------------------------------
+dnl
+dnl Check for the existence of FILE.
 AC_DEFUN(AC_CHECK_FILE,
-[AC_REQUIRE([AC_PROG_CC])
-dnl Do the transliteration at runtime so arg 1 can be a shell variable.
-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+[#AC_REQUIRE([AC_PROG_CC])dnl
 AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_file_$ac_safe,
+AC_VAR_PUSHDEF([var_name], [ac_cv_file_$1])dnl
+AC_CACHE_VAL(var_name,
 [if test "$cross_compiling" = yes; then
   AC_WARNING([Cannot check for file existence when cross compiling])dnl
-  AC_MSG_ERROR(Cannot check for file existence when cross compiling)
-else
-  if test -r $1; then
-    eval "ac_cv_file_$ac_safe=yes"
-  else
-    eval "ac_cv_file_$ac_safe=no"
+  AC_MSG_ERROR([Cannot check for file existence when cross compiling])
   fi
+if test -r "[$1]"; then
+  AC_VAR_SET(var_name, yes)
+else
+  AC_VAR_SET(var_name, no)
 fi])dnl
-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+if test AC_VAR_GET(var_name) = yes; then
   AC_MSG_RESULT(yes)
-  ifelse([$2], , :, [$2])
+ifelse([$2], , , [  $2
+])dnl
 else
   AC_MSG_RESULT(no)
-ifelse([$3], , , [$3])
+ifelse([$3], , , [  $3
+])dnl
 fi
-])
+AC_VAR_POPDEF([var_name])])
 
 dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 AC_DEFUN(AC_CHECK_FILES,
-[for ac_file in $1
-do
-AC_CHECK_FILE($ac_file,
-              [AC_DEFINE_UNQUOTED(AC_TR_UPCASE_FILE(HAVE_$ac_file)) $2],
-              [$3])dnl
-done
-])
+[AC_FOREACH([AC_FILE_NAME], [$1],
+  [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
+                 [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_[]AC_FILE_NAME))
+$2],
+                 [$3])])])
+
+dnl [for ac_file in $1
+dnl do
+dnl AC_CHECK_FILE($ac_file,
+dnl 		  [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_$ac_file)) $2],
+dnl 		  [$3])dnl
+dnl done
+dnl ])
 
 
 dnl ### Checking for library functions
@@ -2182,7 +2346,7 @@ AC_DEFUN(AC_CHECK_FUNCS,
 [for ac_func in $1
 do
 AC_CHECK_FUNC($ac_func,
-              [AC_DEFINE_UNQUOTED(AC_TR_UPCASE_NAME(HAVE_$ac_func)) $2],
+              [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_$ac_func)) $2],
               [$3])dnl
 done
 ])
@@ -2200,7 +2364,7 @@ dnl ### Checking compiler characteristics
 dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
 AC_DEFUN(AC_CHECK_SIZEOF,
 [dnl The name to #define.
-define([AC_TYPE_NAME], AC_TR_UPCASE_NAME(sizeof_$1))dnl
+define([AC_TYPE_NAME], AC_TR_DEFINE(sizeof_$1))dnl
 dnl The cache variable name.
 define([AC_CV_NAME], AC_TR_SH(ac_cv_sizeof_$1))dnl
 AC_MSG_CHECKING(size of $1)
diff --git a/configure b/configure
index 7c2ad021..a295a8e8 100755
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated automatically using autoconf version 2.14.1 
+# Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
 #
 # This configure script is free software;

(Patch may be truncated, please check the link at the top of this post.)