From: Akim Demaille Date: Wed, 1 Sep 1999 09:42:37 +0000 (+0000) Subject: 1999-09-01 Akim Demaille X-Git-Tag: exp-1999-09-04~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce28803b045ca8f9589df48200adda364ab91f92;p=thirdparty%2Fautoconf.git 1999-09-01 Akim Demaille * 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. --- diff --git a/ChangeLog b/ChangeLog index d317c87d..8b10b2df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,60 @@ +1999-09-01 Akim Demaille + + * 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 * 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 . - + (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 * 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 . @@ -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 . - + 1999-04-08 Ben Elliston * acspecific.m4 (AC_PROG_CC): Try using the `cl' C compiler under Cygwin. Contributed by Scott Stanton . - + * config.sub: Handle MPE/iX. 1999-04-07 Ben Elliston @@ -275,7 +319,7 @@ * config.guess: Correct typo for detecting ELF on FreeBSD. 1998-03-14 Alexandre Oliva - + * config.guess: Recognise HP 9000/8x0 machines. 1999-03-11 Ben Elliston @@ -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 * config.guess: Recognise MiNT and TOS on Atari machines. Contributed by Guido Flohr . * config.sub: Add aliases for MiNT. - + 1999-03-10 Ben Elliston * config.guess: Recognise HP 9000/800. Merged from the master @@ -359,7 +403,7 @@ by Markus Oberhumer . 1999-02-19 Ben Elliston - + * 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 - * install-sh: Use $mkdirprog, not `mkdir' directly. Contributed by + * install-sh: Use $mkdirprog, not `mkdir' directly. Contributed by Jeff Garzik . * Makefile.in (clean mostlyclean distclean maintainer-clean): @@ -444,7 +488,7 @@ 1999-01-14 Scott Bambrough * config.guess: Recognise armv[234][lb] types (ie. `armv*'). - + 1999-01-13 Ben Elliston * 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 . - + * config.sub: Add rhapsody and openstep aliases. 1999-01-09 Ben Elliston @@ -484,7 +528,7 @@ * Makefile.in (html): New target. Generate HTML documentation. (install-strip): Add. Contributed by Wilfredo Sanchez . - + * autoconf.texi (AC_CHECK_LIB): Explain more. Contributed by Bob Friesenhahn . (UPDATED): Bump to 1999. @@ -495,13 +539,13 @@ 1999-01-09 J"orn Rennecke * acgeneral.m4 (AC_CHECK_FUNC): Don't actually call the function. - + 1999-01-09 H.J. Lu * 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 * 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 * 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 * autoreconf.sh (stamp): Add missing quote. @@ -598,7 +642,7 @@ . 1998-12-11 Matthew D. Langston - + * 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 . - + 1998-10-24 Matthew D. Langston * 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 . - + 1998-10-20 Ben Elliston * acgeneral.m4 (AC_LANG_RESTORE): Fix a typo spotted by Noah @@ -714,7 +758,7 @@ Sun Oct 4 21:57:20 1998 Tom Tromey using $(INSTALL_DATA). (.m4.m4f): Freeze files if m4 supports stored internal state. Contributed by Karl Heuer . - + * install-sh: Import latest version from the FSF. * mkinstalldirs: Likewise. @@ -731,14 +775,14 @@ Sun Oct 4 21:57:20 1998 Tom Tromey Robbins 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 . (dejacheck): Remove unused target. - + 1998-09-26 Ben Elliston * texinfo.tex: Import latest version from the FSF. @@ -754,7 +798,7 @@ Sun Oct 4 21:57:20 1998 Tom Tromey 1998-09-15 Didier Verna - * 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 @@ -864,7 +908,7 @@ Tue Nov 18 14:21:38 1997 Eric Mumpower 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 * 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 * 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 @@ -1044,10 +1088,10 @@ Tue Nov 12 00:06:14 1996 David J MacKenzie 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 and Julian Onions @@ -1055,10 +1099,10 @@ Tue Nov 12 00:06:14 1996 David J MacKenzie * 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 . - + * 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 * 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 * 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 * Test release 2.10.1. @@ -1091,7 +1135,7 @@ Sat Nov 9 01:54:04 1996 David J MacKenzie 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 * acgeneral.m4 (AC_CACHE_SAVE): Accept the HP-UX sh 'set' output format. From Marcus Daniels . - + * acgeneral.m4 (AC_MSG_CHECKING, AC_CHECKING): Write a message to config.log also. From "T.E.Dickey" . (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 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" . @@ -1134,7 +1178,7 @@ Sat Nov 9 01:54:04 1996 David J MacKenzie 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 * 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 C[XX]FLAGS is set. From T.E.Dickey (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 * 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; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -52,6 +52,8 @@ 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 +ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g' ac_prev= for ac_option @@ -333,7 +335,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" + echo "configure generated by autoconf version 2.14.1" exit 0 ;; -with-* | --with-*) @@ -393,7 +395,7 @@ EOF done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + { echo "configure: error: missing argument to --\`echo $ac_prev | sed 's/_/-/g'\`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 @@ -493,7 +495,7 @@ done if test -r "$cache_file"; then echo "loading cache $cache_file" - . $cache_file + test -f "$cache_file" && . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -533,10 +535,10 @@ EOF_SED rm -f conftestsed fi test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,${program_prefix},;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$\$,${program_suffix},;$program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," @@ -546,22 +548,22 @@ for ac_prog in gm4 gnum4 m4 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:551: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_M4'+set}'`\" = set"; then +echo $ac_n "checking for $ac_word... $ac_c" 1>&6 +echo "configure:__oline__: checking for $ac_word" 1>&5 +if test "${ac_cv_path_M4+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$M4" in /*) ac_cv_path_M4="$M4" # Let the user override the test with a path. ;; - ?:/*) + ?:/*) ac_cv_path_M4="$M4" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_M4="$ac_dir/$ac_word" @@ -587,9 +589,9 @@ for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:592: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then +echo $ac_n "checking for $ac_word... $ac_c" 1>&6 +echo "configure:__oline__: checking for $ac_word" 1>&5 +if test "${ac_cv_prog_AWK+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AWK"; then @@ -620,22 +622,22 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:625: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then +echo $ac_n "checking for $ac_word... $ac_c" 1>&6 +echo "configure:__oline__: checking for $ac_word" 1>&5 +if test "${ac_cv_path_PERL+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PERL" in /*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; - ?:/*) + ?:/*) ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PERL="$ac_dir/$ac_word" @@ -675,9 +677,9 @@ done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -690,10 +692,10 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:695: checking for a BSD compatible install" >&5 +echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6 +echo "configure:__oline__: checking for a BSD compatible install" 1>&5 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then +if test "${ac_cv_path_install+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -711,6 +713,10 @@ else grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 @@ -739,7 +745,7 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' @@ -815,8 +821,15 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the cleanup section. Otherwise, +# look for a macro that doesn't take arguments. cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g +t cleanup +s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\1=\2%g +: cleanup s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g @@ -851,7 +864,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" + echo "$CONFIG_STATUS generated by autoconf version 2.14.1" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1013,5 +1026,5 @@ exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index e51adfd7..6f381c53 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.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)