summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje+keyword+gnu.7caf74@air.net.au>1999-10-30 14:17:20 +0000
committerBen Elliston <bje+keyword+gnu.7caf74@air.net.au>1999-10-30 14:17:20 +0000
commit7e4902123595c1f31617c15a54b7a0082516d0a5 (patch)
treeae428fbfd75acd4ab0753266b3a7f654f12c6a79
parenta0e65b3fd73dc4e76f6a37ab366f08e4a2d08f5f (diff)
downloadautoconf-7e4902123595c1f31617c15a54b7a0082516d0a5.tar.gz
* Merged from the experimental branch.post-exp-merge-1999-10-31
-rw-r--r--ChangeLog899
-rw-r--r--acconfig.h280
-rw-r--r--acgeneral.m41898
-rw-r--r--acspecific.m41116
-rw-r--r--autoheader.in137
-rw-r--r--autoheader.m4207
-rw-r--r--autoheader.sh137
-rw-r--r--bin/autoheader.in137
-rw-r--r--lib/autoconf/general.m41898
-rw-r--r--lib/autoconf/specific.m41116
10 files changed, 5535 insertions, 2290 deletions
diff --git a/ChangeLog b/ChangeLog
index 521aed14..252da9c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
* autoconf.texi (Generic Programs): @defmac for AC_PATH_TOOL may
not span multiple lines.
+1999-10-26 Ben Elliston <bje@cygnus.com>
+
+ * INSTALL: Regenerate.
+
1999-10-16 Ben Elliston <bje@cygnus.com>
* acspecific.m4 (AC_PROG_CXX): gcc is not a C++ compiler.
@@ -19,16 +23,218 @@
trouble caused by autoheader and boilerplate files. Fix for
PR autoconf/45.
+1999-10-07 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * Makefile.in (dist): Fixed for srcdir != objdir.
+
+1999-10-07 Akim Demaille <akim@epita.fr>
+
+ * acspecific.m4 (AC_CHECK_HEADER_DIRENT): Reintroduce its
+ AC_DEFUN.
+
+1999-10-06 Akim Demaille <akim@epita.fr>
+
+ * acspecific.m4: Various formatting changes.
+ * acspecific.m4 (AC_PROG_CC_WORKS): Declare main returns an int.
+
+1999-10-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ Shell meta characters in an argument causes the configure script
+ to freak out and generate a config.status file that contains
+ syntax errors.
+ Bug triggered by ./configure --with-foobar=\''`"$'.
+
+ * acgeneral.m4 (AC_INIT_PARSE_ARGS): Quote single quotes that end
+ up between single quotes. Protect arguments of echo with double
+ quotes.
+ (AC_INIT_PREPARE): Likewise.
+ (AC_PATH_PROG): Protect argument of test.
+ (AC_OUTPUT): Quote meta characters in ac_configure_args.
+
1999-10-05 Ben Elliston <bje@cygnus.com>
* autoconf.texi (AC_PATH_XTRA): Correctly document the behaviour
when X is not available.
+1999-10-05 Akim Demaille <akim@epita.fr>
+
+ The sed quoting script depends on the shape of the commands used
+ by AC_SUBST. The latter was changed, but not the former.
+ Bug triggered with FOO='%\c' AC_SUBST(FOO).
+
+ * acgeneral.m4 (AC_OUTPUT_FILES): Fix the sed quoting script.
+
+1999-10-05 Akim Demaille <akim@epita.fr>
+
+ When you rely on the `t' flag of sed for the immediately
+ preceding substitution, use a combination of `: foo; t foo'.
+ Bug triggered if you AC_DEFINE(FOO, "%").
+ Additionally, work around a bug in IRIX sed.
+ Suggested by Ken Pizzini.
+
+ * acgeneral.m4 (AC_OUTPUT_HEADER): Added a label and a test in the
+ sed code of `$ac_cs_root.hdr'.
+
+1999-10-05 Akim Demaille <akim@epita.fr>
+
+ Implement AC_PATH_TOOL.
+ Submited by Gary V. Vaughan.
+
+ * acgeneral.m4 (AC_PATH_TOOL): New macro.
+ * autoconf.texi (Generic Programs): Document.
+
+1999-10-05 Akim Demaille <akim@epita.fr>
+
+ Handle arbitrary version numbers.
+ Reported by H.J. Lu.
+
+ * acgeneral.m4 (m4_split): Support a second optional argument: a
+ regexp to specify where to split.
+ (m4_compare): New macro, compares arbitrary long m4 lists of
+ integers.
+ (AC_PREREQ_SPLIT, AC_PREREQ_CANON, AC_PREREQ_COMPARE): Removed,
+ replaced by more generic macros.
+ (AC_PREREQ): Reimplemented, using m4_compare and m4_split.
+
+1999-10-04 Akim Demaille <akim@epita.fr>
+
+ Beware of the expansions of $n in comments.
+
+ * acgeneral.m4 (AC_OUTPUT): Changed $1 into $[1] in dnls.
+
+1999-10-04 Akim Demaille <akim@epita.fr>
+
+ Revert partially the previous changes: AC_CHECK_HEADERS_DIRENT is
+ used by AC_HEADER_DIRENT.
+
+ * autoheader.m4: Restablish the hook for AC_CHECK_HEADERS_DIRENT.
+
+ * acspecific.m4 (AC_CHECK_HEADERS_DIRENT, AC_CHECK_HEADER_DIRENT):
+ Reinserted.
+
1999-10-02 Akim Demaille <demaille@inf.enst.fr>
* acgeneral.m4: Instead of just undefining eval, format, include
and shift, rename them to m4_eval, etc.
+1999-10-02 Akim Demaille <akim@epita.fr>
+
+ AC_DIR_HEADERS is hasbeen'ed.
+
+ * acspecific.m4 (AC_DIR_HEADER): Raised from obsolete to hasbeen.
+
+ * acspecific.m4 (AC_CHECK_HEADERS_DIRENT, AC_CHECK_HEADER_DIRENT):
+ Removed, were used only by AC_DIR_HEADER and were not documented.
+
+ * autoheader.m4: Remove the hooks for AC_CHECK_HEADERS_DIRENT.
+
+ * autoconf.texi (Particular Headers): Removed the documentation of
+ AC_DIR_HEADER.
+
+ * autoconf.texi (Environment Variables): Remove the very last
+ traces of documentation of --env-VAR.
+
+1999-10-02 Akim Demaille <akim@epita.fr>
+
+ Remove hasbeen'ed macros from the documentation.
+
+ * autoconf.texi (Obsolete Macros): Document AC_HASBEEN.
+
+ * autoconf.texi (Libraries): Remove the documentation of
+ AC_HAVE_LIB.
+ (Particular Headers): likewise for AC_UNISTD_H, AC_MEMORY_H,
+ AC_USG.
+ (C Compiler Characteristics): Likewise for AC_INT_16_BITS,
+ AC_LONG_64_BITS.
+
+1999-10-01 Akim Demaille <akim@epita.fr>
+
+ Make the handling of the configuration links (AC_LINK_FILES)
+ exactly the same as that of configurations files (AC_OUTPUT_FILES)
+ and headers (AC_CONFIG_HEADERS). As a result, it is sane to run
+ ./config.status src/libmy_lib
+ or
+ CONFIG_LINKS=src/lib_mylib:lib/lib_mylib ./config.status
+
+ * acgeneral.m4 (AC_LINK_FILES): Use AC_FATAL to diagnose bad
+ number of argument.
+ Obsoleted (but implemented) in favor of AC_CONFIG_LINKS.
+
+ * acgeneral.m4 (AC_CONFIG_LINKS): New macro. Takes space
+ separated list of DEST:SOURCES arguments.
+
+ * acgeneral.m4: Rename each occurence of AC_LIST_HEADER as
+ AC_LIST_HEADERS for consistency.
+
+ * acgeneral.m4 (AC_OUTPUT, config.status prologue): Move the
+ definition of config_files and config_headers to the top.
+ Add the definition of config_links.
+ Change the help message to use the aforementioned variables.
+
+ * acgeneral.m4 (AC_OUTPUT_LINKS): Adapted to the new scheme of
+ AC_LIST_LINKS.
+
+ * autoconf.texi (Output, AC_OUTPUT): Mention AC_CONFIG_LINKS.
+ (Invoking config.status): Mention CONFIG_LINKS.
+
+ * autoconf.texi (Using System Type): Document AC_CONFIG_LINKS.
+ Explicit the obsoleteness of AC_LINK_FILES.
+
+1999-10-01 Akim Demaille <akim@epita.fr>
+
+ Moving most of the task of creating config.h.in from sh to m4.
+ Getting rid of acconfig.h by supply a major new family of macros:
+ AH_* which make it possible to insert arbitrary text into
+ config.h.in.
+
+ * autoheader.m4: Major rewrite: introduction of a set of macros
+ AH_ that produce code into config.h.in. There are two sets of
+ macros: generic macros, or specialized, documented below. The
+ basic idea is that an AC_FOO macro which needs an entry in
+ config.h.in should have a sibling AH_FOO which expands into that
+ entry. In a near future, these macros will be moved next to their
+ siblings.
+
+ * autoheader.m4 (AH_VERBATIM, AH_DEFINE, AH_DEFINE, AH_NEED_DECLS,
+ AH_CHECK_SIZEOF, AH_CHECK_FUNCS, AH_CHECK_HEADERS,
+ AH_CHECK_HEADERS, AH_CHECK_LIB, AH_PROG_LEX, AH_FUNC_ALLOCA,
+ AH_C_CHAR_UNSIGNED, AH_AIX, AH_F77_WRAPPERS): New macros.
+
+ * autoheader.m4 (End section): Bind AC_ macros to their
+ AH_siblings.
+
+ * autoheader.sh: Remove the sections in charge of SYMS, TYPES,
+ FUNCS, HEADERS, LIBS and DECLS: autoheader.m4 is now in charge of
+ these.
+
+ * autoheader.sh (options): Added -d, --debug, which does not
+ remove the temporary files.
+
+ * autoheader.sh: Instead of redirecting stdout to the output
+ stream, always output to a temporary file. This allows to change
+ slightly the consistency check: before autoheader would check that
+ each non documented AC_DEFINE is templated in an acconfig. Now it
+ just checks whether the template is in the output file.
+
+ * acconfig.h: Completely emptied, the remaining templates
+ (_ALL_SOURCE, __CHAR_UNSIGNED__, F77_FUNC, F77_FUNC_,
+ HAVE_STRINGIZE, and STACK_DIRECTION) are now either associated to
+ their AC_DEFINE, or to one of the new AH_ macros.
+
+ * acgeneral.m4: Reordering of the m4 macros which are not specific
+ to Autoconf.
+
+ * acgeneral.m4 (AC_HAVE_LIB): Promoted from obsolete to hasbeen.
+
+ * acgeneral.m4 (AC_TR_CPP): Fixed quoting problem, and missing ^
+ in patsubst.
+ (AC_TR_SH): Fixed quoting problem.
+
+1999-09-29 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_WRAP): Don't output an extra space after the
+ last word.
+
1999-09-29 Ben Elliston <bje@cygnus.com>
* acspecific.m4 (AC_FUNC_GETLOADAVG): Check for the kstat_open()
@@ -36,12 +242,139 @@
functions is preferred since they don't require setgid permissions
to use them. Fix for PR autoconf/65.
+1999-09-29 Akim Demaille <akim@epita.fr>
+
+ * acconfig.h: Commit the change announced below.
+
+1999-09-29 Akim Demaille <akim@epita.fr>
+
+ * acspecific.m4 (AC_C_CONST): Changed from
+ const charset x;
+ to
+ const charset x = {0, 0};
+ From Jim Meyering.
+
+1999-09-28 Akim Demaille <akim@epita.fr>
+
+ Start to get rid of acconfig.h. It is an anachronism.
+
+ * acgeneral.m4 (_AC_SH_QUOTE): Both cases must be evaluated the
+ same number of times.
+
+ * acconfig.h (_ALLOCA, CLOSEDIR_VOID, const, CRAY_STACKSEG_END,
+ DGUX, DIRENT, GETGROUPS_T, GETLOADAVG_PRIVILEGED, GETPGRP_VOID,
+ gid_t, HAVE_ALLOCA, HAVE_ALLOCA_H, HAVE_DOPRNT, HAVE_FNMATCH,
+ HAVE_GETLOADAVG, HAVE_GETMNTENT, HAVE_LONG_DOUBLE,
+ HAVE_LONG_FILE_NAMES, HAVE_MMAP, HAVE_RESTARTABLE_SYSCALLS,
+ HAVE_ST_BLKSIZE, HAVE_ST_BLOCKS, HAVE_STRCOLL, HAVE_ST_RDEV,
+ HAVE_STRFTIME, HAVE_SYS_WAIT_H, HAVE_TM_ZONE, HAVE_TZNAME,
+ HAVE_UNISTD_H, HAVE_UTIME_NULL, HAVE_VFORK_H, HAVE_VPRINTF,
+ HAVE_WAIT3, inline, INT_16_BITS, LONG_64_BITS, MAJOR_IN_MKDEV,
+ MAJOR_IN_SYSMACROS, _MINIX, NDIR, NEED_MEMORY_H, NLIST_NAME_UNION,
+ NLIST_STRUCT, NO_MINUS_C_MINUS_O, F77_NO_MINUS_C_MINUS_O,
+ _POSIX_1_SOURCE, _POSIX_SOURCE, RETSIGTYPE, SELECT_TYPE_ARG1,
+ SELECT_TYPE_ARG234, SELECT_TYPE_ARG5, SETPGRP_VOID,
+ SETVBUF_REVERSED, STAT_MACROS_BROKEN, STDC_HEADERS, SVR4, SYSDIR,
+ SYSNDIR, SYS_SIGLIST_DECLARED, TIME_WITH_SYS_TIME, TM_IN_SYS_TIME,
+ uid_t, UMAX, UMAX4_3, USG, vfork, VOID_CLOSEDIR, WORDS_BIGENDIAN,
+ X_DISPLAY_MISSING, YYTEXT_POINTER): Removed their autoheader
+ template. They are now documented with their own AC_DEFINE.
+
+ * acgeneral.m4 (AC_HASBEEN): New macro. Same as AC_OBSOLETE, but
+ dies.
+
+ * acspecific.m4 (AC_UNISTD_H, AC_USG, AC_MEMORY_H, AC_INT_16_BITS,
+ AC_LONG_64_BITS): Promoted from obsolete to hasbeen.
+
+ * autoheader.m4 (AC_DEFINE_UNQUOTED): Define via AC_DEFINE, so
+ that we program things only once.
+ (AC_DEFINE): Use AC_WRAP and _AC_SH_QUOTE. It is now safe to have
+ backquotes and extra spaces in the third argument, without
+ yielding a bad result.
+
+ * autoheader.m4: Instead of a huge `eval', use a temporary file.
+ (option handling): Added --debug, to keep the temporary files.
+ Fixed a couple of missing quotes.
+
+1999-09-28 Akim Demaille <akim@epita.fr>
+
+ Make AC_FOREACH be robust to active symbols.
+
+ * acgeneral.m4 (m4_split, m4_join, m4_strip): New macros.
+ (AC_FOREACH_COMMA): Renamed as...
+ (m4_foreach): this.
+ (_AC_CAR): Renamed as...
+ (_m4_car): this.
+ (_AC_FOREACH): Renamed as...
+ (_m4_foreach): this.
+ (_AC_COMMATIZE): Removed.
+ (AC_FOREACH): Rewritten using m4_split, m4_join, m4_strip, and
+ m4_foreach.
+ * acgeneral.m4: Spell checked.
+ * autoconf.texi: Likewise.
+
+1999-09-28 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_NEED_DECL): When $4 is given, don't provide
+ defaults headers.
+ Change the message from `have' to `need'.
+ Change the actions for `if-(not-)found' to `if-(not-)needed.
+ Remove trailing parentheses.
+
+ * acgeneral.m4 (AC_NEED_DECLS): Change the actions for
+ `if-(not-)found' to `if-(not-)needed.
+ Define NEED_DECL_foo, instead of NEED_foo_DECL.
+
+ * autoheader.sh (decls): Reflect this.
+
+ * autoconf.texi (Generic Declarations): Update.
+
+1999-09-27 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_OUTPUT): Divert AC_OUTPUT_FILE to
+ AC_DIVERSION_KILL if there are no CONFIG_FILES.
+ (AC_OUTPUT, ac_cs_usage): Output the list of files to instanciate
+ only if there are.
+
+1999-09-27 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_CHECK_DECL): Renamed as...
+ (AC_NEED_DECL): This.
+ (AC_CHECK_DECLS): Renamed as...
+ (AC_NEED_DECLS): This.
+ (AC_NEED_DECL): Include <stdio.h>, <memory.h>, <string.h>,
+ <strings.h>, <stdlib.h>, <stddef.h>, and <unistd.h>.
+
+ * autoconf.texi (Generic Declarations): Updated.
+
1999-09-27 Ben Elliston <bje@cygnus.com>
* autoscan.pl (scan_files): Emit an AC_PROG_CC invocation to
configure.scan if there are any C files present. Fix for PR
autoconf/19.
+1999-09-26 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_WRAP): Rewritten.
+ (AC_HELP_STRING): Wrapper of AC_WRAP.
+ * acgeneral.m4 (_AC_SH_QUOTE): Rewritten. Don't try to handle
+ both backslashed and non backslashed backquotes in a single
+ string: consider that either all the backquotes are quoted, or
+ none.
+
+1999-09-26 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_PATH_PROG): Use a single case statement for
+ Unix and DOS absolute paths.
+
+ * acgeneral.m4 (AC_CHECK_SIZEOF): Fix a typo.
+ Allow a third default argument: extra headers.
+ * autoconf.texi (C Compiler Characteristics): Document.
+
+ * acgeneral.m4 (AC_CHECK_TYPE): Convert to the AC_VAR_* family.
+ Allow a third optional argument: extra includes.
+ * autoconf.texi (Generic Typedefs): Documents.
+
1999-09-26 Ben Elliston <bje@cygnus.com>
* acgeneral.m4 (AC_OUTPUT_LINKS): Eliminate gratuitous spaces from
@@ -57,6 +390,21 @@
* acgeneral.m4 (AC_LINK_FILES): Emit an error if an incorrect
number of arguments are collected. Fix for PR autoconf/10.
+1999-09-25 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_OUTPUT, handling of options): Make it possible
+ to specify the files to configure on the command line instead of
+ via envvars. Document it.
+
+1999-09-25 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4: Rename the occurences of the variable `confstat'
+ as `ac_cs_root'. The previous name was breaking the naming
+ scheme.
+
+ * TODO: Updated.
+ Added a section for 2.15 and 3.
+
1999-09-24 Ben Elliston <bje@cygnus.com>
* acspecific.m4 (AC_HEADER_STDC): Define ISLOWER and ISUPPER
@@ -77,6 +425,51 @@
* install.texi: Replace `can not' with `cannot'.
+1999-09-23 Pavel Roskin <pavel_roskin@geocities.com>
+
+ Avoid that comments from aclocal.m4 show up in configure when
+ using AC_REVISION.
+
+ * acgeneral.m4: New diversion levels AC_DIVERSION_KILL and
+ AC_DIVERSION_BINSH introduced. Use AC_DIVERSION_KILL as the
+ initial value for AC_DIVERSION_CURRENT.
+ (AC_INIT_BINSH): Set AC_DIVERSION_BINSH explicitly
+ (AC_REVISION): Likewise.
+ (AC_INIT): Set AC_DIVERSION_NOTICE when calling AC_INIT_NOTICE.
+
+1999-09-23 Akim Demaille <akim@epita.fr>
+
+ * NEWS: Document AC_ARG_VAR.
+
+ * acspecific.m4 (AC_C_LONG_DOUBLE): Avoid a needed execution by
+ using a pure compilation test. Excellent for cross compilation.
+ From Kaveh R. Ghazi.
+
+1999-09-22 Akim Demaille <akim@epita.fr>
+
+ * install.texi: Give more details on envvar handling.
+ * acgeneral.m4 (AC_HELP_STRING): Add a third argument to tune the
+ width of the first column.
+ (AC_INIT_NOTICE): Initialize ac_arg_enable_help, ac_arg_with_help,
+ and ac_arg_var_help.
+ * acgeneral.m4 (AC_INIT_PARSE_ARGS): Remove the handling of
+ --env-var=. After debate, the solution chosen to specify envvars
+ to configure is a` la make: ./configure VAR=VAL.
+ (AC_INIT_PARSE_ARGS, --help): Output ac_arg_enable_help,
+ ac_arg_with_help, and ac_arg_var_help.
+ * acgeneral.m4 (AC_ARG_VAR): New macro, to register and document
+ influent envvars.
+ * acspecific.m4 (AC_PROG_CC): Document CFLAGS.
+ This is mainly to test AC_ARG_VAR. Var to document are to be
+ defined.
+
+1999-09-22 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (m4_default): New macro.
+ (AC_CHECK_LIB): When ACTION-IF-FOUND is specified, don't perform
+ the default action.
+ Reported by Pavel.
+
1999-09-22 Ben Elliston <bje@cygnus.com>
* config.guess: Clear the CCOPTS environment variable before
@@ -100,11 +493,83 @@
Roskin <pavel_roskin@geocities.com>. Fix for PR autoconf/2.
* configure: Regenerate.
+1999-09-21 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_INIT_PARSE_ARGS, --help message): Use quoted
+ heredocs to avoid problems with quotes.
+
+1999-09-21 Akim Demaille <akim@epita.fr>
+
+ * NEWS: Updated.
+ * THANKS: Likewise.
+
+ * acgeneral.m4 (AC_CHECK_HEADER): Use AC_VAR_*.
+ (AC_CHECK_HEADERS): Adapted.
+
+ * acgeneral.m4 (AC_TR): Remove, it is useless.
+ (AC_TR_CPP): Updated version of formerly AC_TR_DEFINE, based on
+ the model of AC_TR_SH.
+ All callers changed.
+
+ * autoconf.sh (Checking for Bugs): Remove the indirection that
+ made the `sort -u' useless.
+
+1999-09-21 Akim Demaille <akim@epita.fr>
+
+ * autoconf.sh (Last sed cmd): Change also @PND@ to `#', since this
+ is also a symbol very hard to quote in m4.
+
+ * acgeneral.m4 (AC_CHECK_LIB): Use AC_VAR_*.
+
+ * acgeneral.m4: Use `m4_BUILTIN' instead of indirection via
+ `builtin'.
+
+1999-09-21 Akim Demaille <akim@epita.fr>
+
+ * autoconf.texi (Particular Structures): Move documentation of
+ AC_HEADER_STAT and AC_HEADER_TIME from here...
+ (Particular Headers): to here.
+ (Declarations): New section.
+ (Particular Headers): Move doc of AC_DECL_SYS_SIGLIST from here...
+ (Particular Declarations): to here.
+
+1999-09-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * acgeneral.m4 (AC_CHECK_FUNC_DECL, AC_CHECK_FUNC_DECLS): New
+ macros.
+
+ * autoconf.texi (AC_CHECK_FUNC_DECL, AC_CHECK_FUNC_DECLS):
+ Document.
+
+ * autoheader.m4: Add support for AC_CHECK_FUNC_DECLS.
+
+ * autoheader.sh: Likewise.
+
+1999-09-21 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_SHELL_IFELSE): New macro.
+ (AC_VAR_IF_SET): Use it.
+ (AC_CHECK_FUNC): Likewise.
+
+ * Makefile.in (${srcdir}/configure): Use autoconf.sh to build
+ Autoconf's configure. Before the building was performed running
+ m4 at hand, but much was not done (e.g., __oline__,
+ @BKL@... expansion)
+
+1999-09-20 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_OUTPUT): Don't remove the CONFIG_HEADERS
+ unconditionaly: it breaks the `config.h has not changed' trick.
+
1999-09-20 Ben Elliston <bje@cygnus.com>
* autoheader.sh: Bourne shell compatibility fix. From Pavel Roskin
<pavel_roskin@geocities.com>.
-
+
+1999-09-20 Pavel Roskin <pavel_roskin@geocities.com>
+
+ * autoheader.sh: Fix the tr invocation.
+
1999-09-17 Ben Elliston <bje@cygnus.com>
* config.guess: Detect QNX version 4.
@@ -115,6 +580,53 @@
* config.guess: Eliminate the trailing dot if ${UNAME_RELEASE} is
1.4-<SOMETHING>. Fix for PR autoconf/22.
+1999-09-17 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_INIT_PARSE_ARGS): Improve configure's --help.
+
+ * acgeneral.m4 (AC_OUTPUT): Change the root of filenames of
+ config.status from $conftest to $confstat.
+ The previous patch to make config.status reentrant was wrong,
+ because it changed some `conftest' that are used by configure into
+ `$conftest', while it was for config.status only. To avoid
+ another confusion like this, all the filenames of config.status
+ should be `$confstat*', and those of configure should be
+ `conftest*'.
+ (AC_OUTPUT): Rename the uses of `ac_file' for the sed fragments as
+ `ac_sed_frag'.
+
+ * acgeneral.m4 (AC_OUTPUT): This macro used to open the here
+ documents that configure uses to generate config.status, included
+ that of the submacros. Now, it no longer handles the here
+ documents for its subroutines (it was far to hard to track).
+ (AC_OUTPUT_FILES): Open and close your here documents to
+ $CONFIG_STATUS.
+ (AC_OUTPUT_HEADER): Likewise.
+ (AC_OUTPUT_LINKS): Likewise.
+
+ * acgeneral.m4 (AC_OUTPUT_FILES): Move $ac_vpsub and $extrasub
+ from the AC_SUBST substitutions (i.e., that of @SHELL@ etc.) to
+ the specific section (that of @srcdir@ etc.).
+ Now the ``general substitution'' section is absolutely uniform.
+
+ * acgeneral.m4 (AC_SUBST): Change sed call from `s%@from@%to%g'
+ into `s%@from@%to%;t t'.
+ (AC_SUBST_FILE): Likewise.
+ (AC_OUTPUT_FILES): Optimize the sed scripts by branching if there
+ are no `@' on the line. Impressive speed up.
+
+ * Makefile.in (DISTFILES): Add THANKS.
+
+ * THANKS: New file.
+
+1999-09-15 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_CHECK_FILE): Use ifset.
+ (AC_CHECK_FUNC): Updated to use AC_VAR_*, and AC_CACHE_CHECK.
+ (AC_CHECK_SIZEOF): Likewise.
+ (AC_CACHE_CHECK): Use AC_MSG_RESULT_UNQUOTED.
+ (AC_MSG_RESULT_UNQUOTED): New macro.
+
1999-09-15 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Fix for PR autoconf/28.
@@ -123,6 +635,57 @@
* autoheader.sh (syms): Likewise.
* configure: Rebuilt.
+1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): Don't assume LF is \012,
+ use `echo` followed by a non-blank, within quotes.
+ * autoheader.sh (syms): Likewise.
+ * configure: Rebuilt.
+ Reported by Christian Krone <krischan@sql.de>
+
+ * acgeneral.m4 (AC_INCLUDE): New macro.
+ * autoconf.texi: Document it.
+
+ * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Save INSTALL in
+ ac_given_INSTALL, so that we can adjust relative pathnames for
+ sub-configures.
+
+ * acgeneral.m4 (Configuration): Accept --env-VAR=VALUE and
+ VAR=value.
+ * autoconf.texi, install.texi: Document it.
+ * configure: Rebuilt.
+
+1999-09-14 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_HELP_STRING): Rewrite in m4. Have m4 work, and
+ give a break to sh.
+ (_AC_FOREACH): Be careful not to evaluate the arguments. A loop
+ over *quoted* macro names should loop over the macro names, not
+ upon their expansion.
+ (_AC_COMMATIZE): Also swallow end of lines.
+
+ * autoconf.texi (Pretty Help Strings): Updated to reflect the
+ changes.
+
+1999-09-13 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (ifset): New helpy tiny macro.
+ (AC_OUTPUT): Improved --help of config.status.
+ (AC_OUTPUT): Remove inconditionaly all the files to be updated.
+ (AC_OUTPUT): Use pid to define the temporary file names in order
+ to allow parallel builds.
+
+ * autoconf.sh: Substitute also /@BKL@/[/ /@BKR@/]/ /@DLR@/$/ so
+ that these characters are more easily accessible from m4 without
+ turning changequote juggling into a nightmare.
+
+ * acgeneral.m4 (AC_WRAP): New macro, for word wrapping.
+
+ * autoconf.texi: Update the direntry for more modern Texinfos.
+ Add pointer to configure and config.status.
+ Remove the dots from the menus: horizontal space is precious.
+ (Invoking config.status): More traditional presentation of the options.
+
1999-09-07 Ben Elliston <bje@cygnus.com>
* autoreconf.sh: Recognise -v as a synonym for --verbose.
@@ -185,6 +748,55 @@
* autoheader.m4 (AC_CHECK_HEADER): Define.
+1999-09-02 Tom Tromey <tromey@cygnus.com>
+
+ * autoheader.sh: Allow multiple spaces between #undef and symbol
+ name.
+
+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-28 Ben Elliston <bje@cygnus.com>
* config.guess: Once and for all, emit the correct string for
@@ -208,7 +820,26 @@
* autoreconf.sh: Run aclocal with the -I option only if
aclocal_dir != `.'. Fix for PR autoconf/44.
-
+
+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
+ which gives the user an opportunity to specify an alternative
+ search list for the compiler.
+
1999-08-18 Ben Elliston <bje@cygnus.com>
* config.guess: Remove "/MP" from the release string on
@@ -242,6 +873,27 @@
* Makefile.in (INSTALL_SCRIPT): Substitute.
(install): Install scripts with $(INSTALL_SCRIPT).
+1999-07-20 Tom Tromey <tromey@cygnus.com>
+
+ * autoheader.sh: Fixed regexp when searching for missing symbol.
+ From Pavel Roskin.
+
+1999-07-16 Tom Tromey <tromey@cygnus.com>
+
+ * autoheader.sh: Be more stringent when looking to see if symbol
+ is in a template file.
+
+1999-07-15 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * acspecific.m4 (AC_F77_LIBRARY_LDFLAGS): New implementation, to
+ make maintenance easier.
+ Grep the initial output so that we don't start parsing "-l" and
+ "-L" too early. From Christopher Lee <chrislee@ri.cmu.edu>
+
+ * acgeneral.m4 (AC_LIST_MEMBER_OF): New "private implementation
+ macro" use by AC_F77_LIBRARY_LDFLAGS.
+ (AC_LINKER_OPTION): Likewise.
+
1999-07-11 Ben Elliston <bje@cygnus.com>
* config.guess: Cray T3E has an Alpha CPU.
@@ -261,6 +913,16 @@
* config.guess: Handle `elf32ppclinux' from ld. Contributed by
Cort Dougan <cort@cs.nmt.edu>.
+1999-06-09 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * autoconf.texi (Pretty Help Strings): Synchronize documentation
+ with implementation.
+
+1999-06-04 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): Fix sed regexp for handling
+ CPP macros with args.
+
1999-06-04 Nick Clifton <nickc@cygnus.com>
* config.sub: Add mcore target.
@@ -271,12 +933,86 @@
* autoconf.texi (EDITION): Likewise.
(VERSION): Likewise.
+1999-06-02 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * autoconf.texi (Pretty Help Strings): Document and regenerate the
+ indices.
+ * acgeneral.m4 (AC_HELP_STRING): New macro.
+
+ * NEWS: Begin documenting "Major changes" for release 2.14.
+
+ * acconfig.h (F77_FUNC): Add.
+ (F77_FUNC_): Likewise.
+
+1999-06-01 Akim Demaille <demaille@inf.enst.fr>
+
+ * acgeneral.m4 (AC_PREFIX_PROGRAM): Use macros of the AC_TR_
+ family.
+ (AC_HAVE_LIBRARY): Likewise.
+ (AC_CHECK_FUNCS): Likewise.
+ (AC_CHECK_FILES): Likewise.
+ (AC_CHECK_SIZEOF): Likewise.
+
+ * acgeneral.m4 (AC_TR): New macro which performs transliteration
+ by m4 when possible, or by `tr' at configure time.
+ (AC_TR_UPCASE_NAME): New macro, transliteration 'a-z' to 'A-Z'.
+ (AC_TR_UPCASE_FILE): New macro, transliteration 'a-z./-' to
+ 'A-Z___'.
+ (AC_TR_SH): New macro, transliteration to valid sh var name.
+
+ * acgeneral.m4 (_AC_SH_QUOTE): New macro which protects non
+ protected backquotes against shell expansion.
+ (AC_MSG_CHECKING): Use it.
+ (AC_CHECKING): Use it.
+ (AC_MSG_RESULT): Use it.
+ (AC_VERBOSE): Use it.
+ (AC_MSG_WARN): Use it.
+ (AC_MSG_ERROR): Use it.
+
+ * acgeneral.m4 (_AC_MESSAGE): New macro to report message at m4
+ time.
+ (AC_WARNING): New macro to report warnings at m4 runtime.
+ (AC_FATAL): New macro, to report fatal error at m4 runtime.
+
+ * acspecific.m4 (AC_RSH): Use AC_FATAL.
+ (AC_ARG_ARRAY): Idem.
+ (AC_HAVE_BOUNDBANG): Idem.
+
+ * acgeneral.m4 (AC_VAR_IF_INDIR): New macro.
+ (AC_VAR_SET): Likewise.
+ (AC_VAR_GET): Likewise.
+
+1999-05-30 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * 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>.
+ (AC_OUTPUT_HEADER): Likewise.
+
+ * autoconf.texi (Fortran 77 Compiler Characteristics): Document
+ new AC_F77_NAME_MANGLING macro.
+
+1999-05-30 Steven G. Johnson <stevenj@alum.mit.edu>
+
+ * autoconf.texi (Fortran 77 Compiler Characteristics): Document
+ new AC_F77_FUNC_WRAPPER macro.
+
+ * acspecific.m4 (AC_F77_WRAPPERS): New macro to define the
+ F77_FUNC and F77_FUNC_ CPP macros to properly mangle the names of
+ C identifiers so that they match the name mangling scheme used by
+ the Fortran 77 compiler.
+ (AC_F77_NAME_MANGLING): New macro to test for the name mangling
+ scheme used by the Fortran 77 compiler.
+
1999-05-27 Matthew D. Langston <langston@SLAC.Stanford.EDU>
* acgeneral.m4 (AC_CHECK_LIB): Translate the ":" character to a
"_", which allows checking for member functions in C++ libraries.
-1995-05-25 H.J. Lu <hjl@gnu.org>
+1999-05-25 H.J. Lu <hjl@gnu.org>
* config.guess (dummy): Changed to $dummy.
@@ -302,16 +1038,16 @@
* config.sub: Handle `t3e' alias for Cray T3E. Contributed by
James A. Lupo <lupoja@feynman.ml.wpafb.af.mil>.
+1999-04-19 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+
+ * acgeneral.m4 (AC_TRY_LINK_FUNC): Add support for Fortran 77.
+
1999-04-17 Paul Eggert <eggert@twinsun.com>
* autoconf.texi, acspecific.m4 (AC_FUNC_MKTIME): New macro.
taken from automake's AM_FUNC_MKTIME.
* acfunctions: mktime now belongs to AC_FUNC_MKTIME.
-1999-04-19 Matthew D. Langston <langston@SLAC.Stanford.EDU>
-
- * acgeneral.m4 (AC_TRY_LINK_FUNC): Add support for Fortran 77.
-
1999-04-11 Philipp Thomas <kthomas@gwdg.de>
* config.sub: Set basic_machine to i586 when target_alias = k6-*.
@@ -344,12 +1080,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>
@@ -417,8 +1153,8 @@
* config.guess: Correct typo for detecting ELF on FreeBSD.
-1998-03-14 Alexandre Oliva <oliva@dcc.unicamp.br>
-
+1999-03-14 Alexandre Oliva <oliva@dcc.unicamp.br>
+
* config.guess: Recognise HP 9000/8x0 machines.
1999-03-11 Ben Elliston <bje@cygnus.com>
@@ -433,14 +1169,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
@@ -502,7 +1238,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.
@@ -541,10 +1277,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):
@@ -587,7 +1323,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
@@ -619,7 +1355,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>
@@ -627,7 +1363,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.
@@ -638,13 +1374,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
@@ -684,7 +1420,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.
@@ -718,7 +1454,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.
@@ -731,7 +1467,7 @@
* NEWS: Update.
* configure: Rebuild.
-
+
1998-12-26 Ben Elliston <bje@cygnus.com>
* autoreconf.sh (stamp): Add missing quote.
@@ -741,7 +1477,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.
@@ -765,7 +1501,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)
@@ -792,7 +1528,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
@@ -857,7 +1593,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.
@@ -874,14 +1610,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.
@@ -897,7 +1633,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>
@@ -913,37 +1649,37 @@ Sat Sep 12 16:25:00 1998 Aaron Crane <aaronc@pobox.com>
Tue Sep 8 14:06:04 1998 Matthew D. Langston <langston@SLAC.Stanford.EDU>
- * acgeneral.m4: Make the following macros Fortran 77 aware
- (i.e. conditionalize whether to `#include "confdefs.h"', etc.):
- (AC_TRY_COMPILE)
- (AC_TRY_LINK)
- (AC_CHECK_LIB)
+ * acgeneral.m4: Make the following macros Fortran 77 aware
+ (i.e. conditionalize whether to `#include "confdefs.h"', etc.):
+ (AC_TRY_COMPILE)
+ (AC_TRY_LINK)
+ (AC_CHECK_LIB)
- * acgeneral.m4 (AC_LANG_FORTRAN77): Rename `AC_LANG_FORTRAN' to
- `AC_LANG_FORTRAN77'. Change the Fortran 77 language macro from
- `FORTRAN' to `FORTRAN77'.
- (AC_LANG_RESTORE): Change the Fortran 77 language macro from
- `FORTRAN' to `FORTRAN77'
+ * acgeneral.m4 (AC_LANG_FORTRAN77): Rename `AC_LANG_FORTRAN' to
+ `AC_LANG_FORTRAN77'. Change the Fortran 77 language macro from
+ `FORTRAN' to `FORTRAN77'.
+ (AC_LANG_RESTORE): Change the Fortran 77 language macro from
+ `FORTRAN' to `FORTRAN77'
- * autoconf.texi: Updated Fortran 77 documentation, particularly
- for `AC_TRY_COMPILE', `AC_TRY_LINK' and `AC_CHECK_LIB'.
+ * autoconf.texi: Updated Fortran 77 documentation, particularly
+ for `AC_TRY_COMPILE', `AC_TRY_LINK' and `AC_CHECK_LIB'.
Thu Sep 3 09:34:39 1998 Matthew D. Langston <langston@SLAC.Stanford.EDU>
- * autoconf.texi: Added Fortran 77 documentation.
+ * autoconf.texi: Added Fortran 77 documentation.
- * acspecific.m4 (AC_PROG_FC): New macro. Determine a Fortran
- compiler to use.
- (AC_PROG_FC_WORKS): New macro.
- (AC_PROG_FC_GNU): New macro.
- (AC_PROG_FC_G): New macro.
- (AC_PROG_FC_C_O): New macro.
+ * acspecific.m4 (AC_PROG_FC): New macro. Determine a Fortran
+ compiler to use.
+ (AC_PROG_FC_WORKS): New macro.
+ (AC_PROG_FC_GNU): New macro.
+ (AC_PROG_FC_G): New macro.
+ (AC_PROG_FC_C_O): New macro.
- * acgeneral.m4: Add FFLAGS (Fortran 77 flags).
- (AC_LANG_FORTRAN): New macro.
- (AC_LANG_RESTORE): Make Fortran 77 aware.
- (AC_TRY_COMPILER): Make Fortran 77 aware (i.e. conditionalize
- whether to `#include "confdefs.h"').
+ * acgeneral.m4: Add FFLAGS (Fortran 77 flags).
+ (AC_LANG_FORTRAN): New macro.
+ (AC_LANG_RESTORE): Make Fortran 77 aware.
+ (AC_TRY_COMPILER): Make Fortran 77 aware (i.e. conditionalize
+ whether to `#include "confdefs.h"').
Thu Jun 18 12:13:27 1998 Ian Lance Taylor <ian@cygnus.com>
@@ -1007,7 +1743,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
@@ -1023,7 +1759,7 @@ Wed Sep 11 15:35:19 1997 Chris Provenzano <proven@cygnus.com>
Thu Sep 4 22:30:40 1997 Jeffrey A Law (law@cygnus.com)
- * acspecific (AC_PROC_INSTALL): Don't use installbsd on OSF..
+ * acspecific (AC_PROC_INSTALL): Don't use installbsd on OSF.
Wed Sep 3 23:00:44 1997 Chris Provenzano <proven@cygnus.com>
@@ -1054,7 +1790,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>
@@ -1187,21 +1923,21 @@ 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
<j.onions@nexor.co.uk>.
* 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.
+ 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
@@ -1220,7 +1956,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.
@@ -1234,7 +1970,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
@@ -1246,7 +1982,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
@@ -1255,13 +1991,13 @@ 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.
+ * acconfig.h (SETPGRP_VOID): New entry.
From "T.E.Dickey" <dickey@clark.net>.
- * acspecific.m4 (AC_PATH_X_DIRECT): Try /lib/usr/lib/X11 for A/UX.
- From Guillermo Gomez <gomez@mi.uni-erlangen.de>.
+ * acspecific.m4 (AC_PATH_X_DIRECT): Try /lib/usr/lib/X11 for A/UX.
+ From Guillermo Gomez <gomez@mi.uni-erlangen.de>.
(AC_PATH_XTRA): Replace -R with adding LD_RUN_PATH to CC in the
Solaris kludge. Suggested by Paul Eggert <eggert@twinsun.com>.
Define X_DISPLAY_MISSING with AC_DEFINE, and
@@ -1276,8 +2012,8 @@ Sat Nov 9 01:54:04 1996 David J MacKenzie <djm@catapult.va.pubnix.com>
From gvran@uddeborg.pp.se.
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.
-
+ * 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
@@ -1295,9 +2031,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
@@ -1524,7 +2260,7 @@ Mon Nov 20 15:26:50 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
Sat Nov 18 14:21:55 1995 Karl Berry <karl@cs.umb.edu>
- * autoconf.sh: Allow lowercase letters in the undefined-macro name.
+ * autoconf.sh: Allow lowercase letters in the undefined-macro name.
Fri Nov 17 15:05:44 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
@@ -1666,8 +2402,9 @@ Wed Mar 8 12:44:34 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
Tue Mar 7 11:48:19 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
- * acspecific.m4 (AC_FUNC_ALLOCA): Keep sh variable namespace clean.
- Put newline after AC_DEFINE_UNQUOTED call to avoid Irix syntax error.
+ * acspecific.m4 (AC_FUNC_ALLOCA): Keep sh variable namespace
+ clean. Put newline after AC_DEFINE_UNQUOTED call to avoid Irix
+ syntax error.
Mon Mar 6 15:07:00 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
@@ -1857,12 +2594,12 @@ Wed Feb 1 11:58:27 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
Tue Dec 6 19:07:07 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* acspecific.m4 (AC_FUNC_GETLOADAVG): Use elf_begin in -lelf
- check, not elf_read.
+ check, not elf_read.
Mon Nov 7 18:18:11 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* acspecific.m4 (AC_PROG_MAKE_SET): Fix msg; $MAKE is not useful
- Make syntax.
+ Make syntax.
Fri Nov 4 09:08:33 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
@@ -2334,10 +3071,10 @@ Fri Aug 26 00:34:11 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
code after AC_OUTPUT (needed for Emacs).
* acgeneral.m4 (AC_CANONICAL_SYSTEM): Move setting of alias vars
- into submacros.
+ into submacros.
* acspecific.m4 (AC_PROG_CPP): If $CPP is set and is a directory,
- ignore it.
+ ignore it.
Thu Aug 25 09:26:36 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
diff --git a/acconfig.h b/acconfig.h
index 0d7f66ae..e69de29b 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,280 +0,0 @@
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define if type char is unsigned and you are not using gcc. */
-#ifndef __CHAR_UNSIGNED__
-#undef __CHAR_UNSIGNED__
-#endif
-
-/* Define if the closedir function returns void instead of int. */
-#undef CLOSEDIR_VOID
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to empty if the volatile keyword does not work. */
-#undef volatile
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define for DGUX with <sys/dg_sys_info.h>. */
-#undef DGUX
-
-/* Define if you have <dirent.h>. */
-#undef DIRENT
-
-/* Define to the type of elements in the array set by `getgroups'.
- Usually this is either `int' or `gid_t'. */
-#undef GETGROUPS_T
-
-/* Define if the `getloadavg' function needs to be run setuid or setgid. */
-#undef GETLOADAVG_PRIVILEGED
-
-/* Define if the `getpgrp' function takes no argument. */
-#undef GETPGRP_VOID
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
-
-/* Define if your system has a working fnmatch function. */
-#undef HAVE_FNMATCH
-
-/* Define if your system has its own `getloadavg' function. */
-#undef HAVE_GETLOADAVG
-
-/* Define if you have the getmntent function. */
-#undef HAVE_GETMNTENT
-
-/* Define if the `long double' type works. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define if you support file names longer than 14 characters. */
-#undef HAVE_LONG_FILE_NAMES
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if system calls automatically restart after interruption
- by a signal. */
-#undef HAVE_RESTARTABLE_SYSCALLS
-
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if your struct stat has st_blocks. */
-#undef HAVE_ST_BLOCKS
-
-/* Define if you have the strcoll function and it is properly defined. */
-#undef HAVE_STRCOLL
-
-/* Define if your struct stat has st_rdev. */
-#undef HAVE_ST_RDEV
-
-/* Define if you have the strftime function. */
-#undef HAVE_STRFTIME
-
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#undef HAVE_STRINGIZE
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if your struct tm has tm_zone. */
-#undef HAVE_TM_ZONE
-
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#undef HAVE_TZNAME
-
-/* Define if you have <unistd.h>. */
-#undef HAVE_UNISTD_H
-
-/* Define if utime(file, NULL) sets file's timestamp to the present. */
-#undef HAVE_UTIME_NULL
-
-/* Define if you have <vfork.h>. */
-#undef HAVE_VFORK_H
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
-/* Define if you have the wait3 system call. */
-#undef HAVE_WAIT3
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if int is 16 bits instead of 32. */
-#undef INT_16_BITS
-
-/* Define if long int is 64 bits. */
-#undef LONG_64_BITS
-
-/* Define if major, minor, and makedev are declared in <mkdev.h>. */
-#undef MAJOR_IN_MKDEV
-
-/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
-#undef MAJOR_IN_SYSMACROS
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef mode_t
-
-/* Define if you don't have <dirent.h>, but have <ndir.h>. */
-#undef NDIR
-
-/* Define if you have <memory.h>, and <string.h> doesn't declare the
- mem* functions. */
-#undef NEED_MEMORY_H
-
-/* Define if your struct nlist has an n_un member. */
-#undef NLIST_NAME_UNION
-
-/* Define if you have <nlist.h>. */
-#undef NLIST_STRUCT
-
-/* Define if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
-#undef F77_NO_MINUS_C_MINUS_O
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define to the type of arg1 for select(). */
-#undef SELECT_TYPE_ARG1
-
-/* Define to the type of args 2, 3 and 4 for select(). */
-#undef SELECT_TYPE_ARG234
-
-/* Define to the type of arg5 for select(). */
-#undef SELECT_TYPE_ARG5
-
-/* Define if the `setpgrp' function takes no argument. */
-#undef SETPGRP_VOID
-
-/* Define if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-#undef SETVBUF_REVERSED
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define on System V Release 4. */
-#undef SVR4
-
-/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
-#undef SYSDIR
-
-/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
-#undef SYSNDIR
-
-/* Define if `sys_siglist' is declared by <signal.h>. */
-#undef SYS_SIGLIST_DECLARED
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
-
-/* Define for Encore UMAX. */
-#undef UMAX
-
-/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
- instead of <sys/cpustats.h>. */
-#undef UMAX4_3
-
-/* Define if you do not have <strings.h>, index, bzero, etc.. */
-#undef USG
-
-/* Define vfork as fork if vfork does not work. */
-#undef vfork
-
-/* Define if the closedir function returns void instead of int. */
-#undef VOID_CLOSEDIR
-
-/* Define if your processor stores words with the most significant
- byte first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-/* Define if lex declares yytext as a char * by default, not a char[]. */
-#undef YYTEXT_POINTER
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/acgeneral.m4 b/acgeneral.m4
index 2dc2f279..94ed89a1 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
@@ -74,6 +74,228 @@ m4_prefix([shift])
m4_prefix([format])
+dnl ------------------------------------------------------------
+dnl Text processing in m4.
+dnl ------------------------------------------------------------
+
+dnl m4_quote(STRING)
+dnl ----------------
+dnl Return STRING quoted.
+dnl
+dnl It is important to realize the difference between `quote(exp)' and
+dnl `[exp]': in the first case you obtain the quoted *result* of the
+dnl expansion of EXP, while in the latter you just obtain the string
+dnl `exp'.
+define([m4_quote], [[$@]])
+
+
+dnl m4_split(STRING, [REGEXP])
+dnl --------------------------
+dnl Split STRING into an m4 list of quoted elements. The elements are
+dnl quoted with [ and ]. Beginning spaces and end spaces *are kept*.
+dnl Use m4_strip to remove them.
+dnl
+dnl REGEXP specifies where to split. Default is [\t ]+.
+dnl
+dnl Pay attention to the changequotes. Inner changequotes exist for
+dnl obvious reasons (we want to insert square brackets). Outer
+dnl changequotes are needed because otherwise the m4 parser, when it
+dnl sees the closing bracket we add to the result, believes it is the
+dnl end of the body of the macro we define.
+dnl
+dnl Also, notice that $1 is quoted twice, since we want the result to be
+dnl quoted. Then you should understand that the argument of patsubst is
+dnl ``STRING'' (i.e., with additional `` and '').
+dnl
+dnl This macro is safe on active symbols, i.e.:
+dnl define(active, ACTIVE)
+dnl m4_split([active active ])end
+dnl => [active], [active], []end
+changequote(<<, >>)
+define(<<m4_split>>,
+<<changequote(``, '')dnl
+[dnl Can't use m4_default here instead of ifelse, because m4_default uses
+dnl [ and ] as quotes.
+patsubst(````$1'''',
+ ifelse(``$2'',, ``[ ]+'', ``$2''),
+ ``], ['')]dnl
+changequote([, ])>>)
+changequote([, ])
+
+
+dnl m4_join(STRING)
+dnl ---------------
+dnl If STRING contains end of lines, replace them with spaces. If there
+dnl are backslashed end of lines, remove them. This macro is safe with
+dnl active symbols.
+dnl define(active, ACTIVE)
+dnl m4_join([active
+dnl act\
+dnl ive])end
+dnl => active activeend
+define([m4_join],
+[translit(patsubst([[[$1]]], [\\
+]), [
+], [ ])])
+
+
+dnl m4_strip(STRING)
+dnl ----------------
+dnl Expands into STRING with tabs and spaces singled out into a single
+dnl space, and removing leading and trailing spaces.
+dnl
+dnl This macro is robust to active symbols.
+dnl define(active, ACTIVE)
+dnl m4_strip([ active active ])end
+dnl => active activeend
+dnl
+dnl This macro is fun! Because we want to preserve active symbols, STRING
+dnl must be quoted for each evaluation, which explains there are 4 levels
+dnl of brackets around $1 (don't forget that the result must be quoted
+dnl too, hence one more quoting than applications).
+dnl
+dnl Then notice the patsubst of the middle: it is in charge of removing
+dnl the leading space. Why not just `patsubst(..., [^ ])'? Because this
+dnl macro will receive the output of the preceding patsubst, i.e. more or
+dnl less [[STRING]]. So if there is a leading space in STRING, then it is
+dnl the *third* character, since there are two leading `['; Equally for
+dnl the outer patsubst.
+define([m4_strip],
+[patsubst(patsubst(patsubst([[[[$1]]]],
+ [[ ]+], [ ]),
+ [^\(..\) ], [\1]),
+ [ \(.\)$], [\1])])
+
+
+dnl ------------------------------------------------------------
+dnl Some additional m4 structural control.
+dnl ------------------------------------------------------------
+
+
+dnl ifset(COND, IF-TRUE[, IF-FALSE])
+dnl --------------------------------
+dnl If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
+dnl Comparable to ifdef.
+define([ifset], [ifelse([$1],,[$3],[$2])])
+
+
+dnl m4_default(EXP1, EXP2)
+dnl ----------------------
+dnl Returns EXP1 if non empty, otherwise EXP2.
+define([m4_default], [ifset([$1], [$1], [$2])])
+
+
+dnl ### Implementing m4 loops
+
+dnl Implementing loops (`foreach' loops) in m4 is much more tricky than it
+dnl may seem. Actually, the example of a `foreach' loop in the m4
+dnl documentation is wrong: it does not quote the arguments properly,
+dnl which leads to undesired expansions.
+dnl
+dnl The example in the documentation is:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach',
+dnl | `pushdef(`$1', `')_foreach(`$1', `$2', `$3')popdef(`$1')')
+dnl | define(`_arg1', `$1')
+dnl | define(`_foreach',
+dnl | `ifelse(`$2', `()', ,
+dnl | `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2), `$3')')')
+dnl
+dnl But then if you run
+dnl
+dnl | define(a, 1)
+dnl | define(b, 2)
+dnl | define(c, 3)
+dnl | foreach(`f', `(`a', `(b', `c)')', `echo f
+dnl | ')
+dnl
+dnl it gives
+dnl
+dnl => echo 1
+dnl => echo (2,3)
+dnl
+dnl which is not what is expected.
+dnl
+dnl Once you understood this, you turn yourself into a quoting wizard,
+dnl and come up with the following solution:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach', `pushdef(`$1', `')_foreach($@)popdef(`$1')')
+dnl | define(`_arg1', ``$1'')
+dnl | define(`_foreach',
+dnl | `ifelse($2, `()', ,
+dnl | `define(`$1', `_arg1$2')$3`'_foreach(`$1', `(shift$2)', `$3')')')
+dnl
+dnl which this time answers
+dnl
+dnl => echo a
+dnl => echo (b
+dnl => echo c)
+dnl
+dnl Bingo!
+
+
+dnl M4_FOREACH(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------
+dnl Expand EXPRESSION assigning to VARIABLE each value of the LIST
+dnl (LIST should have the form `[(item_1, item_2, ..., item_n)]'),
+dnl i.e. the whole list should be *quoted*. Quote members too if
+dnl you don't want them to be expanded.
+dnl
+dnl This macro is robust to active symbols:
+dnl define(active, ACTIVE)
+dnl m4_foreach([Var], [([active], [b], [active])], [-Var-])end
+dnl => -active--b--active-end
+define(m4_foreach,
+[pushdef([$1], [])_m4_foreach($@)popdef([$1])])
+
+dnl Low level macros used to define m4_foreach
+define(m4_car, [[$1]])
+define(_m4_foreach,
+[ifelse($2, [()], ,
+ [define([$1], [m4_car$2])$3[]_m4_foreach([$1],
+ [(m4_shift$2)],
+ [$3])])])
+
+
+dnl m4_list_append(LIST, ELEMENT)
+dnl -----------------------------
+dnl Insert ELEMENT at the end of LIST.
+dnl
+dnl This macro is picky on its input, especially for the empty list: it
+dnl must be either the empty string, or exactly `()' (no spaces allowed).
+dnl This macro is actually purely textual: it basically replaces the
+dnl closing paren of LIST with `, ELEMENT)'. The hair is to preserve
+dnl quotation: this macro is robust to active symbols.
+dnl
+dnl | define(active, ACTIVE)
+dnl | m4_list_append(m4_list_append(m4_list_append((), [1 active]),
+dnl | [2 active]),
+dnl | [3 active])end
+dnl =>(1 active, 2 active, 3 active)end
+dnl
+dnl The combination of this macro and m4_quote is extremely useful to
+dnl build and store lists:
+dnl
+dnl | define(active, ACTIVE)
+dnl | define(list, ())
+dnl | define([list], m4_quote(m4_list_append(list, [1 active])))
+dnl | define([list], m4_quote(m4_list_append(list, [2 active])))
+dnl | define([list], m4_quote(m4_list_append(list, [3 active])))
+dnl | list
+dnl =>(1 active, 2 active, 3 active)
+dnl
+define([m4_list_append],
+[ifelse([$1], [], [([$2])],
+ [$1], [()], [([$2])],
+ [patsubst([[$1]], [^..\(.*\)..$], [[(\1, $2)]])])])
+
+
+define([m4_list_add],
+[define([$1], m4_quote(m4_list_append($1, [$2])))])
+
+
dnl ### Defining macros
@@ -81,7 +303,8 @@ dnl m4 output diversions. We let m4 output them all in order at the end,
dnl except that we explicitly undivert AC_DIVERSION_SED, AC_DIVERSION_CMDS,
dnl and AC_DIVERSION_ICMDS.
-dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line
+define(AC_DIVERSION_KILL, -1)dnl suppress output
+define(AC_DIVERSION_BINSH, 0)dnl AC_REQUIRE'd #! /bin/sh line
define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings
define(AC_DIVERSION_INIT, 2)dnl initialization code
define(AC_DIVERSION_NORMAL_4, 3)dnl AC_REQUIRE'd code, 4 level deep
@@ -109,15 +332,15 @@ divert(AC_DIVERSION_CURRENT)dnl
dnl Initialize the diversion setup.
define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL)
-dnl This will be popped by AC_REQUIRE in AC_INIT.
-pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE)
+dnl Throw away output until AC_INIT is called.
+pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_KILL)
dnl The prologue for Autoconf macros.
dnl AC_PRO(MACRO-NAME)
define(AC_PRO,
[define([AC_PROVIDE_$1], )dnl
ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
+[AC_DIVERT_PUSH(m4_eval(AC_DIVERSION_CURRENT - 1))],
[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
])
@@ -133,6 +356,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,
@@ -141,25 +366,385 @@ 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-FUNCTION 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 ### Some /bin/sh idioms
+
+dnl AC_SHELL_IFELSE(TEST[, IF-TRUE[, IF-FALSE]])
+dnl -------------------------------------------
+dnl Expand into
+dnl | if TEST; then
+dnl | IF-TRUE;
+dnl | else
+dnl | IF-FALSE
+dnl | fi
+dnl with simplifications is IF-TRUE and/or IF-FALSE is empty.
+define([AC_SHELL_IFELSE],
+[ifset([$2$3],
+[if [$1]; then
+ ifset([$2], [$2], :)
+ifset([$3],
+[else
+ $3
+])dnl
+fi
+])])
+
+dnl ### Common m4/sh handling of variables (indirections)
+
+
+dnl The purpose of this section is to provide a uniform API for
+dnl reading/setting sh variables with or without indirection.
+dnl Typically, one can write
+dnl AC_VAR_SET(var, val)
+dnl or
+dnl AC_VAR_SET(ac_$var, val)
+dnl and expect the right thing to happen.
+
+dnl AC_VAR_IF_INDIR(EXPRESSION, IF-INDIR, IF-NOT-INDIR)
+dnl If EXPRESSION has shell indirections ($var or `expr`), expand
+dnl IF-INDIR, else IF-NOT-INDIR.
+define(AC_VAR_IF_INDIR,
+[ifelse(regexp([$1], [[`$]]),
+ -1, [$3],
+ [$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])])
+
+
+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 '${'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. Should be dnl'ed.
+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,
+[AC_SHELL_IFELSE(AC_VAR_TEST_SET([$1]), [$2], [$3])])
+
+
+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
+
+dnl The point of this section is to provide high level functions
+dnl comparable to m4's `translit' primitive, but with the following
+dnl features:
+dnl - hiding portability issues
+dnl tr cannot be used in some cases, because all the tr in this world
+dnl don't behave the same way. In particular there is no portable
+dnl behavior of tr wrt the character `-'. Sed has to be used in these
+dnl cases.
+dnl - m4/sh polymorphism
+dnl Transliteration of manifest strings should be handled by m4, while
+dnl shell variables' content will be translated at runtime (tr or sed).
+
+dnl AC_TR(STRING, FROM, TO, ALPHABET, DEFAULT)
+dnl ------------------------------------------
+dnl Perform tr 'FROM' 'TO' on STRING by m4 when possible, otherwise
+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 appearance 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.
+dnl define(AC_TR,
+dnl [ifelse(regexp([$2$3], [%]), -1,,
+dnl [AC_FATAL([$0: `%' cannot be used. Change the definition of $0])])dnl
+dnl ifelse(regexp([$2], [-]), -1,, len([$2]),,
+dnl [AC_FATAL([$0: `-' cannot be used but in the last position.])])dnl
+dnl ifelse(len([$2]), len([$3]),,
+dnl [AC_FATAL([$0: argument 2 and 3 should have the same length])])dnl
+dnl AC_VAR_IF_INDIR([$1],
+dnl [`echo "$1" | sed 'y%$2%$3%;s%[^$4]%$5%g'`],
+dnl [patsubst(translit([$1], [$2], [$3]),
+dnl [[^$4]], [$5])])])
+
+dnl AC_TR_CPP(EXPRESSION)
+dnl ---------------------
+dnl Map EXPRESSION to an upper case string which is valid as rhs for a
+dnl `#define'. sh/m4 polymorphic. Make sure to update the definition
+dnl of `$ac_tr_cpp' if you change this.
+define(AC_TR_CPP,
+[AC_VAR_IF_INDIR([$1],
+ [`echo "$1" | $ac_tr_cpp`],
+ [patsubst(translit([[$1]],
+ [*abcdefghijklmnopqrstuvwxyz],
+ [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+ [[^A-Z0-9_]], [_])])])
+
+
+dnl AC_TR_SH(EXPRESSION)
+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_], [_])
+dnl Make sure to update the definition of `$ac_tr_cpp' if you change this.
+define(AC_TR_SH,
+[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(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------
+dnl
+dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST.
+dnl LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2
+dnl ... item_n ': white spaces are separators, and leading and trailing
+dnl spaces are meaningless.
+dnl
+dnl This macro is robust to active symbols:
+dnl AC_FOREACH([Var], [ active
+dnl b act\
+dnl ive ], [-Var-])end
+dnl => -active--b--active-end
+define([AC_FOREACH],
+[m4_foreach([$1], (m4_split(m4_strip(m4_join([$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 ## --------------------------------- ##
+dnl ## Helping macros to display strings ##
+dnl ## --------------------------------- ##
+
+
+dnl AC_WRAP(STRING [, PREFIX[, FIRST-PREFIX[, WIDTH]]]]))
+dnl -----------------------------------------------------
+dnl Expands into STRING wrapped to hold in WIDTH columns (default = 79).
+dnl If prefix is set, each line is prefixed with it. If FIRST-PREFIX is
+dnl specified, then the first line is prefixed with it. As a special
+dnl case, if the length of the first prefix is greater than that of
+dnl PREFIX, then FIRST-PREFIX will be left alone on the first line.
+dnl
+dnl Typical outputs are:
+dnl
+dnl AC_WRAP([Short string */], [ ], [/* ], 20)
+dnl => /* Short string */
+dnl
+dnl AC_WRAP([Much longer string */], [ ], [/* ], 20)
+dnl => /* Much longer
+dnl => string */
+dnl
+dnl AC_WRAP([Short doc.], [ ], [ --short ], 30)
+dnl => --short Short doc.
+dnl
+dnl AC_WRAP([Short doc.], [ ], [ --too-wide ], 30)
+dnl => --too-wide
+dnl => Short doc.
+dnl
+dnl AC_WRAP([Super long documentation.], [ ], [ --too-wide ], 30)
+dnl => --too-wide
+dnl => Super long
+dnl => documentation.
+dnl
+dnl FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+dnl we really want to bother with people trying each single corner
+dnl of a software?
+dnl
+dnl This macro does not leave a trailing space behind the last word,
+dnl what complicates it a bit. The algorithm is stupid simple: all the
+dnl words are preceded by AC_Separator which is defined to empty for the
+dnl first word, and then ` ' (single space) for all the others.
+define([AC_WRAP],
+[pushdef([AC_Prefix], m4_default([$2], []))dnl
+pushdef([AC_Prefix1], m4_default([$3], [AC_Prefix]))dnl
+pushdef([AC_Width], m4_default([$4], 79))dnl
+pushdef([AC_Cursor], len(AC_Prefix1))dnl
+pushdef([AC_Separator], [])dnl
+AC_Prefix1[]dnl
+ifelse(m4_eval(AC_Cursor > len(AC_Prefix)),
+ 1, [define([AC_Cursor], len(AC_Prefix))
+AC_Prefix])[]dnl
+AC_FOREACH([AC_Word], [$1],
+[define([AC_Cursor], m4_eval(AC_Cursor + len(AC_Word) + 1))dnl
+dnl New line if too long, else insert a space unless it is the first
+dnl of the words.
+ifelse(m4_eval(AC_Cursor > AC_Width),
+ 1, [define([AC_Cursor], m4_eval(len(AC_Prefix) + len(AC_Word) + 1))]
+AC_Prefix,
+ [AC_Separator])[]dnl
+AC_Word[]dnl
+define([AC_Separator], [ ])])dnl
+popdef([AC_Separator])dnl
+popdef([AC_Cursor])dnl
+popdef([AC_Width])dnl
+popdef([AC_Prefix1])dnl
+popdef([AC_Prefix])dnl
+])
+
+
+dnl AC_HELP_STRING(LHS, RHS[, COLUMN])
+dnl ----------------------------------
+dnl
+dnl Format an Autoconf macro's help string so that it looks pretty when
+dnl the user executes "configure --help". This macro takes three
+dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
+dnl the COLUMN which is a string of white spaces which leads to the
+dnl the RHS column (default: 26 white spaces).
+dnl
+dnl The resulting string is suitable for use in other macros that require
+dnl a help string (e.g. AC_ARG_WITH).
+dnl
+dnl Here is the sample string from the Autoconf manual (Node: External
+dnl Software) which shows the proper spacing for help strings.
+dnl
+dnl --with-readline support fancy command line editing
+dnl ^ ^ ^
+dnl | | |
+dnl | column 2 column 26
+dnl |
+dnl column 0
+dnl
+dnl A help string is made up of a "left hand side" (LHS) and a "right
+dnl hand side" (RHS). In the example above, the LHS is
+dnl "--with-readline", while the RHS is "support fancy command line
+dnl editing".
+dnl
+dnl If the LHS extends past column 24, then the LHS is terminated with a
+dnl newline so that the RHS is on a line of its own beginning in column
+dnl 26.
+dnl
+dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
+dnl then the AC_HELP_STRING macro would expand into:
+dnl
+dnl
+dnl --with-readline-blah-blah-blah
+dnl ^ ^ support fancy command line editing
+dnl | | ^
+dnl | column 2 |
+dnl column 0 column 26
+dnl
+define([AC_HELP_STRING],
+[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
+pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+AC_WRAP([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
+popdef([AC_Prefix_Format])dnl
+popdef([AC_Prefix])dnl
+])
+
dnl ### Initialization
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.
+# Generated automatically using Autoconf version] AC_ACVERSION [
+# 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.
# Defaults:
-ac_help=
+ac_arg_with_help=
+ac_arg_enable_help=
+ac_arg_var_help=
ac_default_prefix=/usr/local
[#] Any additions from configure.in:])
@@ -217,6 +802,11 @@ 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 and CPP variable names.
+changequote(, )dnl
+ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g'
+ac_tr_cpp='sed -e y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g'
+changequote([, ])dnl
ac_prev=
for ac_option
@@ -264,10 +854,10 @@ changequote([, ])dnl
datadir="$ac_optarg" ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`echo "$ac_option"|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ if test -n "`echo "$ac_feature"| sed 's/[-a-zA-Z0-9_]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_feature: invalid feature name)
fi
@@ -275,16 +865,16 @@ changequote([, ])dnl
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`echo "$ac_option"|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ if test -n "`echo "$ac_feature"| sed 's/[-_a-zA-Z0-9]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_feature: invalid feature name)
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
- *=*) ;;
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
@@ -305,16 +895,25 @@ changequote([, ])dnl
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
changequote(, )dnl
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
+ cat << \EOF
+`configure' configures software source code packages to adapt to many kinds
+of systems.
+
+Usage: configure [OPTION]... [VAR=VALUE]... [HOST]
+
+To safely assign special values to environment variables (e.g., CC,
+CFLAGS...), give to `configure' the definition as VAR=VALUE.
+
+Defaults for the options are specified in brackets.
+
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
+
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -335,16 +934,20 @@ Directory and file names:
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
+
+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
+
EOF
- cat << EOF
+ cat << \EOF
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
+
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
@@ -352,11 +955,16 @@ Features and packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
-changequote([, ])dnl
EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
+changequote([, ])dnl
+dnl It would be great to sort, unfortunately, since each entry maybe
+dnl split on several lines, it is not as evident as a simple `| sort'.
+ test -n "$ac_arg_enable_help" && echo "
+--enable options recognized:$ac_arg_enable_help"
+ test -n "$ac_arg_with_help" && echo "
+--with options recognized:$ac_arg_with_help"
+ test -n "$ac_arg_var_help" && echo "
+Some of the influent environment variables:$ac_arg_var_help"
exit 0 ;;
-host | --host | --hos | --ho)
@@ -510,25 +1118,25 @@ EOF
exit 0 ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`echo "$ac_option"|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ if test -n "`echo "$ac_package"| sed 's/[-_a-zA-Z0-9]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_package: invalid package name)
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
- *=*) ;;
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`echo "$ac_option"|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ if test -n "`echo "$ac_package"| sed 's/[-a-zA-Z0-9_]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_package: invalid package name)
fi
@@ -556,9 +1164,20 @@ changequote([, ])dnl
-*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
;;
+ *=*)
+ ac_envvar=`echo $ac_option|sed -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+changequote(, )dnl
+ if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+ AC_MSG_ERROR($ac_envvar: invalid variable name)
+ fi
+ eval "${ac_envvar}='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
changequote(, )dnl
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ if test -n "`echo "$ac_option"| sed 's/[-a-z0-9.]//g'`"; then
changequote([, ])dnl
AC_MSG_WARN($ac_option: invalid host type)
fi
@@ -580,15 +1199,21 @@ dnl Try to have only one #! line, so the script doesn't look funny
dnl for users of AC_REVISION.
dnl AC_INIT_BINSH()
AC_DEFUN(AC_INIT_BINSH,
-[#! /bin/sh
+[AC_DIVERT_PUSH(AC_DIVERSION_BINSH)dnl
+#! /bin/sh
+AC_DIVERT_POP()dnl to KILL
])
dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
+dnl ----------------------------------
+dnl Output the preamble of the `configure' script.
AC_DEFUN(AC_INIT,
[sinclude(acsite.m4)dnl
sinclude(./aclocal.m4)dnl
AC_REQUIRE([AC_INIT_BINSH])dnl
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
AC_INIT_NOTICE
+AC_DIVERT_POP()dnl to KILL
AC_DIVERT_POP()dnl to NORMAL
AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
AC_INIT_PARSE_ARGS
@@ -596,7 +1221,22 @@ AC_INIT_PREPARE($1)dnl
AC_DIVERT_POP()dnl to NORMAL
])
+dnl AC_INCLUDE
+AC_DEFUN(AC_INCLUDE,
+[ifelse($1, [], [], [dnl
+ esyscmd([for file in $1; do echo "m4_include($file)dnl"; done])dnl
+])])
+
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
+dnl ------------------------------------------
+dnl Called by AC_INIT to build the preamble of the `configure' scripts.
+dnl 1. Trap and clean up various tmp files.
+dnl 2. Set up the fd and output files
+dnl 3. Remember the options given to `configure' for `config.status --recheck'.
+dnl 4. Ensure a correct environment
+dnl 5. Find `$srcdir', and check its validity by verifying the presence of
+dnl UNIQUE-FILE-IN-SOURCE-DIR.
+dnl 6. Required macros (cache, default AC_SUBST etc.)
AC_DEFUN(AC_INIT_PREPARE,
[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
@@ -623,7 +1263,7 @@ running configure, to aid debugging if configure makes a mistake.
" 1>&AC_FD_CC
# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
+# Also quote any args containing shell meta-characters.
ac_configure_args=
for ac_arg
do
@@ -636,6 +1276,7 @@ changequote(<<, >>)dnl
dnl If you change this globbing pattern, test it on an old shell --
dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
*" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_arg=`echo "$ac_arg"|sed "s/'/'\\\\\\\\''/g"`
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
changequote([, ])dnl
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
@@ -667,7 +1308,7 @@ if test -z "$srcdir"; then
# Try the directory containing this script, then its parent.
ac_prog=[$]0
changequote(, )dnl
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ ac_confdir=`echo "$ac_prog"|sed 's%/[^/][^/]*$%%'`
changequote([, ])dnl
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
@@ -679,9 +1320,9 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- AC_MSG_ERROR(can not find sources in $ac_confdir or ..)
+ AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
else
- AC_MSG_ERROR(can not find sources in $srcdir)
+ AC_MSG_ERROR(cannot find sources in $srcdir)
fi
fi
dnl Double slashes in pathnames in object file debugging info
@@ -733,9 +1374,10 @@ dnl ### Selecting optional features
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl -----------------------------------------------------------------------
AC_DEFUN(AC_ARG_ENABLE,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
+ac_arg_enable_help="$ac_arg_enable_help
[$2]"
AC_DIVERT_POP()dnl
[#] Check whether --enable-[$1] or --disable-[$1] was given.
@@ -760,7 +1402,7 @@ dnl ### Working with optional software
dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
AC_DEFUN(AC_ARG_WITH,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
+ac_arg_with_help="$ac_arg_with_help
[$2]"
AC_DIVERT_POP()dnl
[#] Check whether --with-[$1] or --without-[$1] was given.
@@ -779,10 +1421,34 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl
])
+
+dnl ### Remembering env vars for reconfiguring
+
+dnl AC_ARG_VAR(VARNAME, DOCUMENTATION)
+dnl ----------------------------------
+dnl Register VARNAME as a variable configure should remember, and
+dnl document it in --help.
+AC_DEFUN(AC_ARG_VAR,
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+ac_arg_var_help="$ac_arg_var_help
+AC_HELP_STRING([$1], [$2], [ ])"
+AC_DIVERT_POP()dnl
+dnl Register if set and not yet registered.
+dnl If there are envvars given as arguments, they are already set,
+dnl therefore they won't be set again, which is the right thing.
+case "${$1+set} $ac_configure_args" in
+ *" $1="* );;
+ "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";;
+esac])
+
+
+
dnl ### Transforming program names.
dnl AC_ARG_PROGRAM()
+dnl ----------------
+dnl FIXME: Must be run only once. Introduce AC_DEFUN_ONCE?
AC_DEFUN(AC_ARG_PROGRAM,
[if test "$program_transform_name" = s,x,x,; then
program_transform_name=
@@ -811,36 +1477,41 @@ dnl ### Version numbers
dnl AC_REVISION(REVISION-INFO)
AC_DEFUN(AC_REVISION,
[AC_REQUIRE([AC_INIT_BINSH])dnl
-[# From configure.in] translit([$1], $")])
+AC_DIVERT_PUSH(AC_DIVERSION_BINSH)dnl
+[# From configure.in] translit([$1], $")
+AC_DIVERT_POP()dnl to KILL
+])
dnl Subroutines of AC_PREREQ.
-dnl Change the dots in NUMBER into commas.
-dnl AC_PREREQ_SPLIT(NUMBER)
-define(AC_PREREQ_SPLIT,
-[translit($1, ., [, ])])
-
-dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
-dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
-define(AC_PREREQ_CANON,
-[$1, $2, ifelse([$3], , 0, [$3])])
-
-dnl Complain and exit if version number 1 is less than version number 2.
-dnl PRINTABLE2 is the printable version of version number 2.
-dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
-dnl PRINTABLE2)
-define(AC_PREREQ_COMPARE,
-[ifelse(builtin([eval],
-[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1,
-[errprint(dnl
-FATAL ERROR: Autoconf version $7 or higher is required for this script
-)m4exit(3)])])
+dnl m4_compare(VERSION-1, VERSION-2)
+dnl --------------------------------
+dnl Compare the two version numbers and expand into
+dnl -1 if VERSION-1 < VERSION-2
+dnl 0 if =
+dnl 1 if >
+dnl The handling of the special values [[]] is a pain, but seems necessary.
+dnl This macro is a excellent tutorial on the order of evaluation of ifelse.
+define(m4_compare,
+[ifelse([$1],, [ifelse([$2],, 0,
+ [$2], [[]], 0,
+ 1)],
+ [$1], [[]], [ifelse([$2],, 0,
+ [$2], [[]], 0,
+ 1)],
+ [$2],, -1,
+ [$2], [[]], -1,
+ [ifelse(m4_eval(m4_car($1) < m4_car($2)), 1, 1,
+ [ifelse(m4_eval(m4_car($1) > m4_car($2)), 1, -1,
+ [m4_compare(m4_quote(m4_shift($1)),
+ m4_quote(m4_shift($2)))])])])])
dnl Complain and exit if the Autoconf version is less than VERSION.
dnl AC_PREREQ(VERSION)
define(AC_PREREQ,
-[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
-AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])
+[ifelse(m4_compare(m4_split([$1], [\.]),
+ m4_split(AC_ACVERSION, [\.])), -1,
+ [AC_FATAL(Autoconf version $1 or higher is required for this script)])])
dnl ### Getting the canonical system type
@@ -881,7 +1552,7 @@ for ac_dir in $1; do
fi
done
if test -z "$ac_aux_dir"; then
- AC_MSG_ERROR([can not find install-sh or install.sh in $1])
+ AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
@@ -923,11 +1594,11 @@ test "$host_alias" != "$target_alias" &&
])
dnl Subroutines of AC_CANONICAL_SYSTEM.
-
+
dnl Worker routine for AC_CANONICAL_{HOST TARGET BUILD}. THING is one of
dnl `host', `target', or `build'. Canonicalize the appropriate thing,
dnl generating the variables THING, THING_{alias cpu vendor os}, and the
-dnl associated cache entries. We also redo the cache entries if the user
+dnl associated cache entries. We also redo the cache entries if the user
dnl specifies something different from ac_cv_$THING_alias on the command line.
dnl AC_CANONICAL_THING(THING)
@@ -940,7 +1611,7 @@ if test "x$ac_cv_$1" = "x" || (test "x$$1" != "xNONE" && test "x$$1" != "x$ac_cv
# Make sure we can run config.sub.
if $ac_config_sub sun4 >/dev/null 2>&1; then :
- else AC_MSG_ERROR(can not run $ac_config_sub)
+ else AC_MSG_ERROR(cannot run $ac_config_sub)
fi
dnl Set $1_alias.
@@ -951,7 +1622,7 @@ dnl Set $1_alias.
NONE)
ifelse($1, [host],[dnl
if ac_cv_$1_alias=`$ac_config_guess`; then :
- else AC_MSG_ERROR(can not guess $1 type; you must specify one)
+ else AC_MSG_ERROR(cannot guess $1 type; you must specify one)
fi ;;],[dnl
ac_cv_$1_alias=$host_alias ;;
])
@@ -1104,37 +1775,46 @@ 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.
+dnl Should be dnl'ed.
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)
+dnl -------------------------------------------
+dnl Do not call this macro with a dnl right behind.
define(AC_CACHE_CHECK,
[AC_MSG_CHECKING([$1])
-AC_CACHE_VAL([$2], [$3])
-AC_MSG_RESULT([$]$2)])
+AC_CACHE_VAL([$2], [$3])dnl
+AC_MSG_RESULT_UNQUOTED(AC_VAR_GET([$2]))])
dnl ### Defining symbols
-dnl Set VARIABLE to VALUE, verbatim, or 1.
-dnl AC_DEFINE(VARIABLE [, VALUE])
+dnl AC_DEFINE(VARIABLE [, VALUE[, DESCRIPTION]])
+dnl --------------------------------------------
+dnl Set VARIABLE to VALUE, verbatim, or 1. Remember the value
+dnl and if VARIABLE is affected the same VALUE, do nothing, else
+dnl die. The third argument is used by autoheader.
define(AC_DEFINE,
[cat >> confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
+
+
+dnl AC_DEFINE_UNQUOTED(VARIABLE [, VALUE[, DESCRIPTION]])
+dnl -----------------------------------------------------
dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
define(AC_DEFINE_UNQUOTED,
[cat >> confdefs.h <<EOF
@@ -1143,60 +1823,120 @@ EOF
])
+
dnl ### Setting output variables
+dnl AC_SUBST(VARIABLE)
+dnl ------------------
dnl This macro protects VARIABLE from being diverted twice
dnl if this macro is called twice for it.
-dnl AC_SUBST(VARIABLE)
+dnl Beware that if you change this macro, you also have to change the
+dnl sed script at the top of AC_OUTPUT_FILES.
define(AC_SUBST,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
-s%@$1@%[$]$1%g
+s%@$1@%[$]$1%;t t
AC_DIVERT_POP()dnl
])])
dnl AC_SUBST_FILE(VARIABLE)
+dnl -----------------------
+dnl Read the comments of the preceding macro.
define(AC_SUBST_FILE,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
/@$1@/r [$]$1
-s%@$1@%%g
+s%@$1@%%;t t
AC_DIVERT_POP()dnl
])])
-dnl ### Printing messages
+dnl ### Printing messages at autoconf runtime
+
+dnl _AC_ERRPRINT(MESSAGE)
+dnl Report the MESSAGE at m4 time, with line and filename.
+define(_AC_ERRPRINT, [errprint(__file__:__line__: [$1
+])])
+dnl AC_WARNING(MESSAGE)
+define(AC_WARNING, [_AC_ERRPRINT([warning: $1])])
+
+dnl AC_FATAL(MESSAGE [, EXIT-STATUS])
+define(AC_FATAL,
+[_AC_ERRPRINT([error: $1])
+m4exit(ifdef([$2], [$2], 1))])
+
+
+dnl ### Printing messages at configure runtime
+
+dnl _AC_SH_QUOTE(STRING)
+dnl --------------------
+dnl If there are quoted (via backslash) backquotes do nothing, else
+dnl backslash all the quotes.
+dnl Note: it is important that both case evaluate STRING the same number
+dnl of times so that both _AC_SH_QUOTE([\`Hello world']) and
+dnl _AC_SH_QUOTE([`Hello world']) answer \`Hello world'.
+define(_AC_SH_QUOTE,
+[ifelse(regexp([$1], [\\`]),
+ -1, [patsubst([$1], [`], [\\`])],
+ [AC_WARNING([backquotes should not be backslashed in: $1])dnl
+$1])])
+
+dnl _AC_ECHO_UNQUOTED(STRING [ , FD ])
+dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG).
+dnl The shell performs its expansions on STRING.
+define([_AC_ECHO_UNQUOTED],
+[echo "[$1]" 1>&ifelse($2,, AC_FD_MSG, $2)])
+
+dnl _AC_ECHO(STRING [ , FD ])
+dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG),
+dnl protecting STRING from backquote expansion.
+define([_AC_ECHO],
+[_AC_ECHO_UNQUOTED(_AC_SH_QUOTE($1), $2)])
+
+dnl _AC_ECHO_N(STRING [ , FD ])
+dnl Same as _AC_ECHO, but echo doesn't return to a new line.
+define(_AC_ECHO_N,
+[echo $ac_n "_AC_SH_QUOTE($1)$ac_c" 1>&ifelse($2,,AC_FD_MSG,$2)])
dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
define(AC_MSG_CHECKING,
-[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG
-echo "configure:__oline__: checking $1" >&AC_FD_CC])
+[_AC_ECHO_N([checking $1... ])
+_AC_ECHO([configure:__oline__: checking $1], AC_FD_CC)])
dnl AC_CHECKING(FEATURE-DESCRIPTION)
define(AC_CHECKING,
-[echo "checking $1" 1>&AC_FD_MSG
-echo "configure:__oline__: checking $1" >&AC_FD_CC])
+[_AC_ECHO([checking $1])
+_AC_ECHO([configure:__oline__: checking $1], AC_FD_CC)])
dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
define(AC_MSG_RESULT,
-[echo "$ac_t""$1" 1>&AC_FD_MSG])
+[_AC_ECHO([$ac_t""$1])])
+
+dnl AC_MSG_RESULT_UNQUOTED(RESULT-DESCRIPTION)
+dnl Likewise, but perform $ ` \ shell substitutions.
+define(AC_MSG_RESULT_UNQUOTED,
+[_AC_ECHO_UNQUOTED([$ac_t""$1])])
dnl AC_VERBOSE(RESULT-DESCRIPTION)
define(AC_VERBOSE,
[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
-echo " $1" 1>&AC_FD_MSG])
+_AC_ECHO([ $1])])
dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
define(AC_MSG_WARN,
-[echo "configure: warning: $1" 1>&2])
+[_AC_ECHO([configure: warning: $1], 2)])
dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
define(AC_MSG_ERROR,
-[{ echo "configure: error: $1" 1>&2; exit 1; }])
+[{ _AC_ECHO([configure: error: $1], 2); exit 1; }])
+
+dnl AC_MSG_ERROR_UNQUOTED(ERROR-DESCRIPTION)
+define(AC_MSG_ERROR_UNQUOTED,
+[{ _AC_ECHO_UNQUOTED([configure: error: $1], 2); exit 1; }])
dnl ### Selecting which language to use for testing
@@ -1266,13 +2006,12 @@ dnl ### Dependencies between macros
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
define(AC_BEFORE,
-[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
-])])])
+[ifdef([AC_PROVIDE_$2], [AC_WARNING([$2 was called before $1])])])
dnl AC_REQUIRE(MACRO-NAME)
define(AC_REQUIRE,
[ifdef([AC_PROVIDE_$1], ,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
+[AC_DIVERT_PUSH(m4_eval(AC_DIVERSION_CURRENT - 1))dnl
indir([$1])
AC_DIVERT_POP()dnl
])])
@@ -1283,8 +2022,12 @@ define(AC_PROVIDE,
dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
define(AC_OBSOLETE,
-[errprint(__file__:__line__: warning: [$1] is obsolete[$2]
-)])
+[AC_WARNING([$1] is obsolete[$2])])
+
+dnl AC_HASBEEN(THIS-MACRO-NAME [, SUGGESTION])
+define(AC_HASBEEN,
+[AC_FATAL([$1] is obsolete[$2])])
+
dnl ### Generic structure checks
@@ -1298,11 +2041,15 @@ AC_DEFUN(AC_C_STRUCT_MEMBER,
$1="$ac_cv_c_struct_member_$1"])
+
+
dnl ### Checking for programs
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]])
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
+dnl [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
+dnl [, PATH [, REJECT]]])
+dnl ------------------------------------------------------
AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
@@ -1365,30 +2112,43 @@ else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
-])
+])dnl AC_CHECK_PROG
+
+
+dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
+dnl [, PATH]])
+dnl -----------------------------------------------------------------
+AC_DEFUN(AC_CHECK_PROGS,
+[for ac_prog in $2
+do
+AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
+test -n "[$]$1" && break
+done
+ifelse([$3], , , [test -n "[$]$1" || $1="$3"
+])])
+
dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
AC_DEFUN(AC_PATH_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
- /*)
+dnl Second pattern matches DOS absolute paths.
+ /* | ?:/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path.
- ;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$4], , $PATH, [$4])"
- 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
+ if test -f "$ac_dir/$ac_word"; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
@@ -1409,19 +2169,10 @@ fi
AC_SUBST($1)dnl
])
-dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
-dnl [, PATH]])
-AC_DEFUN(AC_CHECK_PROGS,
-[for ac_prog in $2
-do
-AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
dnl [, PATH]])
+dnl ----------------------------------------------------------------
AC_DEFUN(AC_PATH_PROGS,
[for ac_prog in $2
do
@@ -1431,6 +2182,11 @@ done
ifelse([$3], , , [test -n "[$]$1" || $1="$3"
])])
+
+
+
+dnl ### Checking for tools
+
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
@@ -1441,18 +2197,35 @@ else
fi
])
+dnl AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl ------------------------------------------------------------------------
+AC_DEFUN(AC_PATH_TOOL,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
+ ifelse([$3], , [$2], ), $4)
+ifelse([$3], , , [
+if test -z "$ac_cv_prog_$1"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_PROG($1, $2, $2, $3)
+ else
+ $1="$3"
+ fi
+fi])
+])
+
dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
AC_DEFUN(AC_CHECK_TOOL,
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
ifelse([$3], , [$2], ), $4)
ifelse([$3], , , [
if test -z "$ac_cv_prog_$1"; then
-if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG($1, $2, $2, $3)
-else
- $1="$3"
-fi
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG($1, $2, $2, $3)
+ else
+ $1="$3"
+ fi
fi])
])
@@ -1466,9 +2239,7 @@ dnl No big loss, I think, since most configures don't use this macro anyway.
dnl AC_PREFIX_PROGRAM(PROGRAM)
AC_DEFUN(AC_PREFIX_PROGRAM,
[if test "x$prefix" = xNONE; then
-changequote(<<, >>)dnl
-define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
-changequote([, ])dnl
+define([AC_VAR_NAME], AC_UPCASE_NAME([$1])dnl
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG
AC_PATH_PROG(AC_VAR_NAME, $1)
@@ -1481,14 +2252,14 @@ fi
undefine([AC_VAR_NAME])dnl
])
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
+dnl -----------------------------------------------------
dnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
dnl `yes' if the current compiler works, otherwise set it ti `no'. Set
dnl CROSS-VAR to `yes' if the compiler and linker produce non-native
dnl executables, otherwise set it to `no'. Before calling
dnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
dnl language.
-dnl
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext << EOF
ifelse(AC_LANG, [FORTRAN77], ,
@@ -1518,6 +2289,7 @@ dnl ### Checking for libraries
dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found)
+dnl ------------------------------------------------------------
dnl Try to link a program that calls FUNC, handling GCC builtins. If
dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute
dnl ACTION-IF-NOT-FOUND.
@@ -1540,13 +2312,14 @@ char $1();
[$3]))
-dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND
-dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
+dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS
+dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
+dnl [, OTHER-LIBRARIES]]])
+dnl --------------------------------------------------------
dnl Search for a library defining FUNC, if it's not already available.
AC_DEFUN(AC_SEARCH_LIBS,
-[AC_PREREQ([2.13])
-AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
+[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
[ac_func_search_save_LIBS="$LIBS"
ac_cv_search_$1="no"
AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
@@ -1568,14 +2341,18 @@ fi])
dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-AC_DEFUN(AC_CHECK_LIB,
-[AC_MSG_CHECKING([for $2 in -l$1])
+dnl ------------------------------------------------------------------------
dnl Use a cache variable name containing both the library and function name,
dnl because the test really is for library $1 defining function $2, not
dnl just for library $1. Separate tests with the same $1 and different $2s
dnl may have different results.
-ac_lib_var=`echo $1['_']$2 | sed 'y%./+-:%__p__%'`
-AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
+dnl
+dnl FIXME: This macro is extremely suspicious. It DEFINEs unconditionnally,
+dnl whatever the FUNCTION, in addition to not being a *S macro. Note
+dnl that the cache does depend upon the function with look for.
+AC_DEFUN(AC_CHECK_LIB,
+[AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
AC_TRY_LINK(dnl
@@ -1590,57 +2367,24 @@ extern "C"
builtin and then its argument prototype would still apply. */
char $2();
])),
- [$2()],
- eval "ac_cv_lib_$ac_lib_var=yes",
- eval "ac_cv_lib_$ac_lib_var=no")
-LIBS="$ac_save_LIBS"
-])dnl
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], ,
-[changequote(, )dnl
- ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_lib)
+[$2()],
+AC_VAR_SET(ac_Lib, yes), AC_VAR_SET(ac_Lib, no))
+LIBS="$ac_save_LIBS"])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Lib) = yes,
+ m4_default([$3],
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
-], [$3])
-else
- AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
+]),
+ [$4])dnl
+AC_VAR_POPDEF([ac_Lib])dnl
+])dnl AC_CHECK_LIB
+
+
dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_HAVE_LIBRARY,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
-changequote(<<, >>)dnl
-define(<<AC_LIB_NAME>>, dnl
-patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
-define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
-changequote([, ])dnl
-AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
-AC_CACHE_VAL(AC_CV_NAME,
-[ac_save_LIBS="$LIBS"
-LIBS="-l[]AC_LIB_NAME[] $4 $LIBS"
-AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)
-LIBS="$ac_save_LIBS"
-])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-if test "$AC_CV_NAME" = yes; then
- ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z]))
- LIBS="-l[]AC_LIB_NAME[] $LIBS"
-], [$2])
-ifelse([$3], , , [else
- $3
-])dnl
-fi
-undefine([AC_LIB_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_LIB])])
dnl ### Examining declarations
@@ -1712,7 +2456,7 @@ dnl ### Examining syntax
dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
-dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_TRY_COMPILE,
[cat > conftest.$ac_ext <<EOF
ifelse(AC_LANG, [FORTRAN77],
@@ -1793,9 +2537,8 @@ dnl [, ACTION-IF-CROSS-COMPILING]]])
AC_DEFUN(AC_TRY_RUN,
[if test "$cross_compiling" = yes; then
ifelse([$4], ,
- [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling
-)dnl
- AC_MSG_ERROR(can not run test program while cross compiling)],
+ [AC_WARNING([[AC_TRY_RUN] called without default to allow cross compiling])dnl
+ AC_MSG_ERROR(cannot run test program while cross compiling)],
[$4])
else
AC_TRY_RUN_NATIVE([$1], [$2], [$3])
@@ -1833,31 +2576,23 @@ dnl ### Checking for header files
dnl AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_HEADER,
-[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_header_$ac_safe,
-[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
- eval "ac_cv_header_$ac_safe=no")])dnl
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
-
-dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+[AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
+AC_CACHE_CHECK([for $1], ac_Header,
+[AC_TRY_CPP([#include <$1>],
+AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Header) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_Header])dnl
+])dnl AC_CHECK_HEADER
+
+dnl AC_CHECK_HEADERS(HEADER-FILE...
+dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_HEADERS,
-[for ac_hdr in $1
+[for ac_header in $1
do
-AC_CHECK_HEADER($ac_hdr,
-[changequote(, )dnl
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
+AC_CHECK_HEADER($ac_header,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_header)) $2],
+ [$3])dnl
done
])
@@ -1865,52 +2600,117 @@ 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_VAR_PUSHDEF([ac_var], [ac_cv_file_$1])dnl
+dnl FIXME: why was there this line? AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_file_$ac_safe,
+AC_CACHE_VAL(ac_var,
[if test "$cross_compiling" = yes; then
- errprint(__file__:__line__: 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_WARNING([Cannot check for file existence when cross compiling])dnl
+ AC_MSG_ERROR([Cannot check for file existence when cross compiling])
fi
+if test -r "[$1]"; then
+ AC_VAR_SET(ac_var, yes)
+else
+ AC_VAR_SET(ac_var, no)
fi])dnl
-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+if test AC_VAR_GET(ac_var) = yes; then
AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
+ifset([$2], [ $2
+])dnl
else
AC_MSG_RESULT(no)
-ifelse([$3], , , [$3])
+ifset([$3], [ $3
+])dnl
fi
-])
+AC_VAR_POPDEF([ac_var])])
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,
-[changequote(, )dnl
- ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
-done
-])
+[AC_FOREACH([AC_FILE_NAME], [$1],
+ [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(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_CPP(HAVE_$ac_file)) $2],
+dnl [$3])dnl
+dnl done
+dnl ])
+
+
+dnl ### Checking for declared symbols
+
+
+dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl [, INCLUDES,]]])
+dnl --------------------------------------------------------------
+dnl Check if SYMBOL (a variable or a function) is declared.
+dnl This macro is not a _CHECK_, because it is better not to declare
+dnl a symbol if you don't really need it.
+AC_DEFUN([AC_NEED_DECL],
+[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_need_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 needs to be declared], ac_Symbol,
+[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
+#ifdef HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]),
+[#ifndef $1
+char *p = (char *) $1;
+#endif
+],
+AC_VAR_SET(ac_Symbol, no), AC_VAR_SET(ac_Symbol, yes))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Symbol) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_Symbol])dnl
+])dnl AC_NEED_DECL
+
+dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl [, INCLUDES]]])
+dnl ---------------------------------------------------------------
+AC_DEFUN([AC_NEED_DECLS],
+[AC_FOREACH([AC_Symbol], [$1],
+ [AC_SPECIALIZE([AC_NEED_DECL], AC_Symbol,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_DECL_[]AC_Symbol))
+$2],
+ [$3],
+ [$4])])
+])dnl AC_NEED_DECLS
dnl ### Checking for library functions
dnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl ------------------------------------------------------------------
AC_DEFUN(AC_CHECK_FUNC,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_func_$1,
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
+AC_CACHE_CHECK([for $1], ac_var,
[AC_TRY_LINK(
dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
dnl which includes <sys/select.h> which contains a prototype for
@@ -1936,29 +2736,23 @@ choke me
#else
f = $1;
#endif
-], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
-if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
+], AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_FUNC
dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_FUNCS,
[for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
-[changequote(, )dnl
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
+ [$3])dnl
done
])
+
dnl AC_REPLACE_FUNCS(FUNCTION...)
AC_DEFUN(AC_REPLACE_FUNCS,
[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"])
@@ -1969,55 +2763,58 @@ AC_SUBST(LIBOBJS)dnl
dnl ### Checking compiler characteristics
-dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
+dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE, [INCLUDES]])
+dnl ------------------------------------------------
+dnl This macro will probably be obsoleted by the macros of Kaveh. In
+dnl addition `CHECK' is not a proper name (is not boolean).
AC_DEFUN(AC_CHECK_SIZEOF,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
+[AC_VAR_PUSHDEF([ac_Sizeof], [ac_cv_sizeof_$1])dnl
+AC_CACHE_CHECK([size of $1], ac_Sizeof,
[AC_TRY_RUN([#include <stdio.h>
+[$3]
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
- fprintf(f, "%d\n", sizeof($1));
+ fprintf(f, "%d\n", sizeof([$1]));
exit(0);
-}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
+}],
+ AC_VAR_SET(ac_Sizeof, `cat conftestval`),
+ AC_VAR_SET(ac_Sizeof, 0),
+ ifset([$2], AC_VAR_SET(ac_Sizeof, $2)))])
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_Sizeof))
+AC_VAR_POPDEF([ac_Sizeof])dnl
])
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES])
+dnl AC_CHECK_TYPE(TYPE, DEFAULT[, INCLUDES])
+dnl ----------------------------------------
+dnl FIXME: This is an extremely badly chosen name, since this
+dnl macro actually performs an AC_REPLACE_TYPE. Some day we
+dnl have to clean this up.
AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
+AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
+AC_CACHE_CHECK([for $1], ac_Type,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), ifelse([$3],,[#include <sys/types.h>
+changequote([,]), m4_default([$3], [#include <stdio.h>
+#include <sys/types.h>
#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif],[$3])
-, eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
-if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_DEFINE_UNQUOTED($1, $2, [Define to \`$2' if <sys/types.h> does not define.])
-fi
-])
+# include <stdlib.h>
+# include <stddef.h>
+#endif
+]), AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,,
+ [AC_DEFINE_UNQUOTED($1, $2,
+ [Define to `$2' if <sys/types.h>
+ does not define.])])dnl
+AC_VAR_POPDEF([ac_Type])dnl
+])dnl AC_CHECK_TYPE
dnl ### Creating output files
@@ -2025,24 +2822,56 @@ dnl ### Creating output files
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
AC_DEFUN(AC_CONFIG_HEADER,
-[define(AC_LIST_HEADER, $1)])
+[define(AC_LIST_HEADERS, $1)])
+
+
+dnl AC_CONFIG_LINKS(DEST:SOURCE...)
+dnl -------------------------------
+dnl Specify that config.status should establish a (symbolic if possible)
+dnl link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
+dnl Reject DEST=., because it is makes it hard for ./config.status
+dnl to guess the links to establish (`./config.status .').
+AC_DEFUN(AC_CONFIG_LINKS,
+[ifelse(regexp([$1], [^.:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
+ifelse(regexp([$1], [ .:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
+define([AC_LIST_LINKS],
+ ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$1])
+])
+
+dnl AC_LINK_FILES(SOURCE..., DEST...)
+dnl ---------------------------------
dnl Link each of the existing files SOURCE... to the corresponding
dnl link name in DEST...
-dnl AC_LINK_FILES(SOURCE..., DEST...)
+dnl This macro, as AC_CONFIG_FILES, produces no sh code, so we don't
+dnl dnl.
AC_DEFUN(AC_LINK_FILES,
-[dnl
-ifelse($#, 2, , dnl
- [errprint(__file__:__line__: incorrect number of arguments to [AC_LINK_FILES]
-)]
- AC_MSG_ERROR([aborting due to error at __file__:__line__]))dnl
-define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl
-define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])])
+[AC_OBSOLETE([$0], [; instead use AC_CONFIG_FILES(DEST:SOURCE...)])
+ifelse($#, 2, ,
+ [AC_FATAL([$0: incorrect number of arguments])])
+
+pushdef([AC_Sources], m4_split(m4_strip(m4_join([$1]))))
+pushdef([AC_Dests], m4_split(m4_strip(m4_join([$2]))))
+m4_foreach([AC_Dummy], (AC_Sources),
+ [AC_CONFIG_LINKS(m4_car(AC_Dests):m4_car(AC_Sources))
+ define([AC_Sources], m4_quote(m4_shift(AC_Sources)))
+ define([AC_Dests], m4_quote(m4_shift(AC_Dests)))])
+
+popdef([AC_Sources])
+popdef([AC_Dests])
+])
+
+define([AC_LIST_LINKS],
+ ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2:$1])])
+
+dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
+dnl -----------------------------------------
dnl Add additional commands for AC_OUTPUT to put into config.status.
dnl Use diversions instead of macros so we can be robust in the
dnl presence of commas in $1 and/or $2.
-dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
AC_DEFUN(AC_OUTPUT_COMMANDS,
[AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl
[$1]
@@ -2059,9 +2888,13 @@ subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
+dnl AC_OUTPUT([CONFIG_FILES...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl ---------------------------------------------------------
dnl The big finish.
dnl Produce config.status, config.h, and links; and configure subdirs.
-dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
+dnl Pay special attention not to have too long here docs: some old
+dnl shells die. Unfortunately the limit is not known precisely...
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
@@ -2082,7 +2915,7 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
+ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -2103,40 +2936,146 @@ dnl so uname gets run too.
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
-changequote(, )dnl
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-changequote([, ])dnl
+# Files that config.status was made for.
+ifset([$1], [config_files="\\
+AC_WRAP($1, [ ])"
+])dnl
+ifdef([AC_LIST_HEADERS], [config_headers="\\
+AC_WRAP(AC_LIST_HEADERS, [ ])"
+])dnl
+ifdef([AC_LIST_LINKS], [config_links="\\
+AC_WRAP(AC_LIST_LINKS, [ ])"
+])dnl
+
+ac_cs_usage="\\
+\\\`$CONFIG_STATUS' instantiates files from templates according to the
+current configuration.
+
+Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@ FILE...
+
+ --recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
+ --version Print the version of Autoconf and exit
+ --help Display this help and exit
+
+dnl Issue this section only if there were actually config files.
+dnl The following test checks if one of AC_LIST_HEADERS, the CONFIG_FILES
+dnl which are given via $[1], or AC_LIST_LINKS is set.
+ifset(ifdef([AC_LIST_HEADERS], 1)ifdef([AC_LIST_LINKS], 1)[$1],
+[Files to instantiate:
+ifset($1, [ Configuration files:
+\$config_files
+])dnl
+ifdef([AC_LIST_HEADERS], [ Configuration headers:
+\$config_headers
+])dnl
+ifdef([AC_LIST_LINKS], [ Links to install:
+\$config_links
+])dnl
+
+])dnl
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\\
+$CONFIG_STATUS generated by autoconf version AC_ACVERSION.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by running
+ [$]0 [$]ac_configure_args"
+
+dnl We use a different name than CONFTEST just to help the maintainers
+dnl to make the difference between `conftest' which is the root of the
+dnl files used by configure, and `ac_cs_root' which is the root of the
+dnl files of config.status.
+# Root of the tmp file names. Use pid to allow concurrent executions.
+ac_cs_root=cs\$\$
+ac_given_srcdir=$srcdir
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+])dnl
+
for ac_option
do
case "[\$]ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
+ echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 `echo "[$]ac_configure_args" | sed 's/[[\\"\`\$]]/\\\\&/g'` --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 AC_ACVERSION"
- exit 0 ;;
+ echo "[\$]ac_cs_version"; exit 0 ;;
-help | --help | --hel | --he | --h)
echo "[\$]ac_cs_usage"; exit 0 ;;
- *) echo "[\$]ac_cs_usage"; exit 1 ;;
+ *) # Find out the files to process.
+ for ac_file in [\$]config_files
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_FILES="[\$]CONFIG_FILES [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ for ac_file in [\$]config_headers
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_HEADERS="[\$]CONFIG_HEADERS [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ for ac_file in [\$]config_links
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_LINKS="[\$]CONFIG_LINKS [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ echo "$CONFIG_STATUS: invalid argument: [\$]ac_option"; exit 1
+ ;;
esac
done
-ac_given_srcdir=$srcdir
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+EOF
+
+dnl Issue this section only if there were actually config files.
+dnl The following test checks if one of AC_LIST_HEADERS, the CONFIG_FILES
+dnl which are given via $[1], or AC_LIST_LINKS is set.
+ifset(ifdef([AC_LIST_HEADERS], 1)ifdef([AC_LIST_LINKS], 1)[$1],
+[cat >> $CONFIG_STATUS <<EOF
+# If there were arguments, don't assign a default value.
+if test \$[#] = 0; then
+ifset([$1], [ : \${CONFIG_FILES="\$config_files"}
+])dnl
+ifdef([AC_LIST_HEADERS], [ : \${CONFIG_HEADERS="\$config_headers"}
])dnl
+ifdef([AC_LIST_LINKS], [ : \${CONFIG_LINKS="\$config_links"}
+])dnl
+fi
-changequote(<<, >>)dnl
-ifdef(<<AC_LIST_HEADER>>,
-<<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>,
-<<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>)
-changequote([, ])dnl
-EOF
-cat >> $CONFIG_STATUS <<EOF
+# Remove all the CONFIG_FILES, and trap to remove the temp files.
+dnl There is no need to trap for the config files since they are built
+dnl from `mv tmp-file config-file', hence their update is atomic.
+rm -fr \`echo "\$CONFIG_FILES" | sed "s/:@BKL@^ @BKR@*//g"\`
+trap 'rm -fr \$ac_cs_root*; exit 1' 1 2 15
-AC_OUTPUT_FILES($1)
-ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
-ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
EOF
+])[]dnl
+
+dnl The following three sections are in charge of their own here
+dnl documenting into $CONFIG_STATUS.
+
+dnl Because AC_OUTPUT_FILES is in charge of undiverting the AC_SUBST
+dnl section, it is better to divert it to void and *call it*, rather
+dnl than not calling it at all
+ifset([$1],
+ [AC_OUTPUT_FILES([$1])],
+ [AC_DIVERT_PUSH(AC_DIVERSION_KILL)dnl
+AC_OUTPUT_FILES([$1])dnl
+AC_DIVERT_POP()])dnl
+ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
+ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS)])dnl
+
cat >> $CONFIG_STATUS <<EOF
undivert(AC_DIVERSION_ICMDS)dnl
$3
@@ -2151,20 +3090,29 @@ rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
-])dnl
+])dnl AC_OUTPUT
+
+dnl AC_OUTPUT_MAKE_DEFS()
+dnl ---------------------
dnl Set the DEFS variable to the -D options determined earlier.
dnl This is a subroutine of AC_OUTPUT.
dnl It is called inside configure, outside of config.status.
-dnl AC_OUTPUT_MAKE_DEFS()
define(AC_OUTPUT_MAKE_DEFS,
[# Transform confdefs.h into DEFS.
dnl Using a here document instead of a string reduces the quoting nightmare.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
+#
+# 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 > $ac_cs_root.defs <<\EOF
changequote(<<, >>)dnl
-s%<<#define>> \([^ ][^ ]*\) *\(.*\)%-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
@@ -2178,70 +3126,79 @@ EOF
# platform that uses two characters for line-breaks (e.g., DOS), tr
# would break.
ac_LF_and_DOT="`echo; echo .`"
-DEFS=`sed -f conftest.defs confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f conftest.defs
+DEFS=`sed -f $ac_cs_root.defs confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f $ac_cs_root.defs
])
+
+dnl AC_OUTPUT_FILES(CONFIG_FILES...)
+dnl --------------------------------
dnl Do the variable substitutions to create the Makefiles or whatever.
-dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
-dnl here document whose contents are going into config.status, but
-dnl upon returning, the here document is being quoted.
-dnl AC_OUTPUT_FILES(FILE...)
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_FILES,
-[# Protect against being on the right side of a sed subst in config.status.
+[cat >>$CONFIG_STATUS <<EOF
+# Protect against being on the right side of a sed subst in config.status.
+dnl Please, pay attention that this sed code depends a lot on the shape
+dnl of the sed commands issued by AC_SUBST. So if you change one, change
+dnl the other too.
changequote(, )dnl
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' > \$ac_cs_root.subs <<\\CEOF
changequote([, ])dnl
dnl These here document variables are unquoted when configure runs
dnl but quoted when config.status runs, so variables are expanded once.
-$ac_vpsub
-dnl Shell code in configure.in might set extrasub.
-$extrasub
dnl Insert the sed substitutions of variables.
-undivert(AC_DIVERSION_SED)
+undivert(AC_DIVERSION_SED)dnl
CEOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
+dnl One cannot portably go further than 100 commands because of HP-UX.
+dnl Here, there are 2 cmd per line, and two cmd are added later.
+ac_max_sed_lines=48
+ac_sed_frag=1 # Number of current file.
ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_end=$ac_max_sed_lines # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs > $ac_cs_root.sfrag
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "${ac_end}q" $ac_cs_root.subs > $ac_cs_root.sfrag
fi
- if test ! -s conftest.s$ac_file; then
+ if test ! -s $ac_cs_root.sfrag; then
ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f $ac_cs_root.sfrag
else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+/@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b' && cat $ac_cs_root.sfrag) > $ac_cs_root.s$ac_sed_frag
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag"
fi
- ac_file=`expr $ac_file + 1`
+ ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"$1"}
EOF
+
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
changequote(, )dnl
@@ -2259,6 +3216,8 @@ changequote(, )dnl
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
@@ -2299,33 +3258,52 @@ changequote([, ])dnl
*) ac_comsub= ;;
esac
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+# Don't redirect the output to AC_FILE directly: use `mv' so that updating
+# is atomic, and doesn't need trapping.
+ ac_file_inputs=`echo $ac_file_in | sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+EOF
+cat >>$CONFIG_STATUS <<EOF
sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
+dnl Neutralize VPATH when `$srcdir' = `.'.
+$ac_vpsub
+dnl Shell code in configure.in might set extrasub.
+dnl FIXME: do we really want to maintain this feature?
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b
+s%@configure_input@%$configure_input%;t t
+s%@srcdir@%$srcdir%;t t
+s%@top_srcdir@%$top_srcdir%;t t
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%;t t
])dnl
dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_cs_root.out
dnl This would break Makefile dependencies.
-dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
+dnl if cmp -s $ac_file $ac_cs_root.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
-dnl rm -f conftest.out
+dnl rm -f $ac_cs_root.out
dnl else
dnl rm -f $ac_file
-dnl mv conftest.out $ac_file
+dnl mv $ac_cs_root.out $ac_file
dnl fi
+ mv $ac_cs_root.out $ac_file
fi; done
-rm -f conftest.s*
-])
+rm -f $ac_cs_root.s*
+EOF
+])dnl AC_OUTPUT_FILES
-dnl Create the config.h files from the config.h.in files.
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
dnl AC_OUTPUT_HEADER(HEADER-FILE...)
+dnl --------------------------------
+dnl Create the config.h files from the config.h.in files.
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_HEADER,
-[changequote(<<, >>)dnl
+[cat >>$CONFIG_STATUS <<\EOF
+changequote(<<, >>)dnl
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
@@ -2346,14 +3324,6 @@ ac_eC=' '
ac_eD='%g'
changequote([, ])dnl
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-dnl Support passing AC_CONFIG_HEADER a value containing shell variables.
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="$1"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
changequote(, )dnl
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
@@ -2366,9 +3336,9 @@ changequote([, ])dnl
echo creating $ac_file
- rm -f conftest.frag conftest.in conftest.out
+ rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
+ cat $ac_file_inputs > $ac_cs_root.in
EOF
@@ -2379,17 +3349,45 @@ EOF
rm -f conftest.vals
dnl Using a here document instead of a string reduces the quoting nightmare.
dnl Putting comments in sed scripts is not portable.
-cat > conftest.hdr <<\EOF
+dnl
+dnl One may be tempted to use the same trick to speed up the sed script
+dnl as for CONFIG_FILES (combination of :t and t t). Here we cannot,
+dnl because of the `#define' templates: we may enter in infinite loops
+dnl replacing `#define foo bar' by itself.
+dnl We ought to get rid of the #define templates.
+dnl
+dnl There are two labels in the following scripts, `cleanup' and `clear'.
+dnl
+dnl `cleanup' is used to avoid that the second main sed command (meant for
+dnl 0-ary CPP macros) applies to n-ary macro definitions. So we use
+dnl `t cleanup' to jump over the second main sed command when it succeeded.
+dnl
+dnl But because in sed the `t' flag is set when there is a substitution
+dnl that succeeded before, and not *right* before (i.e., included the
+dnl first two small commands), we need to clear the `t' flag. This is the
+dnl purpose of `t clear; : clear'.
+dnl
+dnl Additionally, this works around a bug of IRIX' sed which does not
+dnl clear the `t' flag between to cycles.
+cat > $ac_cs_root.hdr <<\EOF
changequote(<<, >>)dnl
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
-s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+t clear
+: clear
+s%^[ ]*<<#>>[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
+t cleanup
+s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+: cleanup
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
changequote([, ])dnl
EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC_DEFINE to be honored.
+uniq confdefs.h | sed -n -f $ac_cs_root.hdr > conftest.vals
+rm -f $ac_cs_root.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
@@ -2400,22 +3398,23 @@ s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
changequote([, ])dnl
EOF
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
+# Break up conftest.vals because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
rm -f conftest.tail
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ # Write a limited-size here document to $ac_cs_root.frag.
+ echo ' cat > $ac_cs_root.frag <<CEOF' >> $CONFIG_STATUS
+dnl A small speed up: don't consider the non `#undef' or `#define' lines.
+ echo '/^#[ ]*u*n*d*e*f*/!b' >> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
+ sed -f $ac_cs_root.frag $ac_cs_root.in > $ac_cs_root.out
+ rm -f $ac_cs_root.in
+ mv $ac_cs_root.out $ac_cs_root.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
@@ -2425,13 +3424,13 @@ rm -f conftest.vals
dnl Now back to your regularly scheduled config.status.
cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
+ rm -f $ac_cs_root.frag $ac_cs_root.h
+ echo "/* $ac_file. Generated automatically by configure. */" > $ac_cs_root.h
+ cat $ac_cs_root.in >> $ac_cs_root.h
+ rm -f $ac_cs_root.in
+ if cmp -s $ac_file $ac_cs_root.h 2>/dev/null; then
echo "$ac_file is unchanged"
- rm -f conftest.h
+ rm -f $ac_cs_root.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@@ -2439,35 +3438,34 @@ cat >> $CONFIG_STATUS <<\EOF
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
- mv conftest.h $ac_file
+ mv $ac_cs_root.h $ac_file
fi
fi; done
+EOF
+])dnl AC_OUTPUT_HEADER
-])
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
+dnl AC_OUTPUT_LINKS(DEST:SOURCE...)
+dnl -------------------------------
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_LINKS,
-[EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$1"
-ac_dests="$2"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
+[cat >> $CONFIG_STATUS <<\EOF
srcdir=$ac_given_srcdir
-# Remove spaces from $ac_sources if it is otherwise empty.
-set -- $ac_sources
-ac_sources=[$]*
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]*
- set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]*
+dnl Here we use : instead of .. because if AC_LINK_FILES was used
+dnl with empty parameters (as in gettext.m4), then we obtain here
+dnl `:', which we want to skip. So let's keep a single exception: `:'.
+for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
+ ac_dest=`echo "$ac_file"|sed 's%:.*%%'`
+ ac_source=`echo "$ac_file"|sed 's%@BKL@^:@BKR@*:%%'`
echo "linking $srcdir/$ac_source to $ac_dest"
@@ -2483,6 +3481,8 @@ changequote(, )dnl
changequote([, ])dnl
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
@@ -2502,12 +3502,13 @@ changequote([, ])dnl
# Make a symlink if possible; otherwise try a hard link.
if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
+ ln $srcdir/$ac_source $ac_dest; then :
else
- AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source)
+ AC_MSG_ERROR(cannot link $ac_dest to $srcdir/$ac_source)
fi
-done
-])
+fi; done
+EOF
+])dnl AC_OUTPUT_LINKS
dnl This is a subroutine of AC_OUTPUT.
dnl It is called after running config.status.
@@ -2539,6 +3540,9 @@ if test "$no_recursion" != yes; then
esac
done
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],[ ac_given_INSTALL="$INSTALL"
+])dnl
+
for ac_config_dir in $1; do
# Do not complain, so a configure script can configure whichever
@@ -2552,9 +3556,11 @@ if test "$no_recursion" != yes; then
case "$srcdir" in
.) ;;
*)
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
else
- AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
+ AC_MSG_ERROR(cannot create `pwd`/$ac_config_dir)
fi
;;
esac
@@ -2617,3 +3623,87 @@ changequote([, ])dnl
done
fi
])
+
+
+dnl AC_LINKER_OPTION
+dnl ----------------
+dnl
+dnl usage: AC_LINKER_OPTION(LINKER-OPTIONS, SHELL-VARIABLE)
+dnl
+dnl Specifying options to the compiler (whether it be the C, C++ or
+dnl Fortran 77 compiler) that are meant for the linker is compiler
+dnl dependent. This macro lets you give options to the compiler that
+dnl are meant for the linker in a portable, compiler-independent way.
+dnl
+dnl This macro take two arguments, a list of linker options that the
+dnl compiler should pass to the linker (LINKER-OPTIONS) and the name of
+dnl a shell variable (SHELL-VARIABLE). The list of linker options are
+dnl appended to the shell variable in a compiler-dependent way.
+dnl
+dnl For example, if the selected language is C, then this:
+dnl
+dnl AC_LINKER_OPTION([-R /usr/local/lib/foo], foo_LDFLAGS)
+dnl
+dnl will expand into this if the selected C compiler is gcc:
+dnl
+dnl foo_LDFLAGS="-Xlinker -R -Xlinker /usr/local/lib/foo"
+dnl
+dnl otherwise, it will expand into this:
+dnl
+dnl foo_LDFLAGS"-R /usr/local/lib/foo"
+dnl
+dnl You are encouraged to add support for compilers that this macro
+dnl doesn't currently support.
+dnl
+dnl pushdef([AC_LINKER_OPTION],
+AC_DEFUN(AC_LINKER_OPTION,
+[
+ using_gnu_compiler=
+
+ ifelse(AC_LANG, [C], test x"$GCC" = xyes && using_gnu_compiler=yes,
+ [ifelse(AC_LANG, [CPLUSPLUS], test x"$GXX" = xyes && using_gnu_compiler=yes,
+ [ifelse(AC_LANG, [FORTRAN77], test x"$G77" = xyes && using_gnu_compiler=yes)])])
+
+ for i in $1; do
+ if test x"$using_gnu_compiler" = xyes; then
+ $2="[$]$2 -Xlinker $i"
+ else
+ $2="[$]$2 $i"
+ fi
+ done
+])
+
+
+dnl AC_LIST_MEMBER_OF
+dnl -----------------
+dnl
+dnl usage: AC_LIST_MEMBER_OF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+dnl Processing the elements of a list is tedious in shell programming,
+dnl as lists tend to be implemented as space delimited strings.
+dnl
+dnl This macro searches LIST for ELEMENT, and executes ACTION-IF-FOUND
+dnl if ELEMENT is a member of LIST, otherwise it executes
+dnl ACTION-IF-NOT-FOUND.
+dnl
+dnl pushdef([AC_LIST_MEMBER_OF],
+AC_DEFUN(AC_LIST_MEMBER_OF,
+[
+ dnl Do some sanity checking of the arguments.
+ ifelse($1, , [AC_MSG_ERROR([$0]: 1st arg must be defined)])
+ ifelse($2, , [AC_MSG_ERROR([$0]: 2nd arg must be defined)])
+
+ exists=false
+ for i in $2; do
+ if test x"$1" = x"$i"; then
+ exists=true
+ break
+ fi
+ done
+
+ if test x"$exists" = xtrue; then
+ ifelse($3, , :, $3)
+ else
+ ifelse($4, , :, $4)
+ fi
+])
diff --git a/acspecific.m4 b/acspecific.m4
index edb6ff32..1dca1d38 100644
--- a/acspecific.m4
+++ b/acspecific.m4
@@ -1,6 +1,6 @@
dnl Macros that test for specific features.
dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+dnl Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -70,19 +70,26 @@ else
fi
])
+dnl AC_PROG_CC([COMPILER ...])
+dnl --------------------------
+dnl COMPILER ... is a space separated list of C compilers to search for.
+dnl This just gives the user an opportunity to specify an alternative
+dnl search list for the C compiler.
AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_CHECK_PROG(CC, gcc, gcc)
-if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
+ifelse([$1], ,
+[
+ AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32* | *CYGWIN*)
- AC_CHECK_PROG(CC, cl, cl) ;;
- esac
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+ if test -z "$CC"; then
+ AC_CHECK_PROGS(CC, cl)
+ fi
fi
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
+], [AC_CHECK_PROGS(CC, [$1])])
+
+test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_PROG_CC_WORKS
AC_PROG_CC_GNU
@@ -117,9 +124,15 @@ else
fi
])
+dnl AC_PROG_CXX([LIST-OF-COMPILERS])
+dnl --------------------------------
+dnl LIST-OF-COMPILERS is a space separated list of C++ compilers to search
+dnl for (if not specified, a default list is used). This just gives the
+dnl user an opportunity to specify an alternative search list for the C++
+dnl compiler.
AC_DEFUN(AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_CHECK_PROGS(CXX, $CCC c++ g++ gpp CC cxx cc++ cl, g++)
+AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
AC_PROG_CXX_WORKS
AC_PROG_CXX_GNU
@@ -154,24 +167,16 @@ else
fi
])
-dnl Determine a Fortran 77 compiler to use. If `F77' is not already set
-dnl in the environment, check for `g77', `f77' and `f2c', in that order.
-dnl Set the output variable `F77' to the name of the compiler found.
-dnl
-dnl If using `g77' (the GNU Fortran 77 compiler), then `AC_PROG_F77'
-dnl will set the shell variable `G77' to `yes', and empty otherwise. If
-dnl the output variable `FFLAGS' was not already set in the environment,
-dnl then set it to `-g -02' for `g77' (or `-O2' where `g77' does not
-dnl accept `-g'). Otherwise, set `FFLAGS' to `-g' for all other Fortran
-dnl 77 compilers.
-dnl
+dnl AC_PROG_F77 takes an optional first argument which, if specified,
+dnl must be a space separated list of Fortran 77 compilers to search
+dnl for. This just gives the user an opportunity to specify an
+dnl alternative search list for the Fortran 77 compiler.
+dnl
dnl AC_PROG_F77()
AC_DEFUN(AC_PROG_F77,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-if test -z "$F77"; then
- AC_CHECK_PROGS(F77, g77 f77 f2c)
- test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran 77 compiler found in \$PATH])
-fi
+AC_CHECK_PROGS(F77,
+ m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
AC_PROG_F77_WORKS
AC_PROG_F77_GNU
@@ -198,11 +203,14 @@ else
fi
])
+dnl AC_PROG_CC_WORKS
+dnl ----------------
AC_DEFUN(AC_PROG_CC_WORKS,
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
AC_LANG_SAVE
AC_LANG_C
-AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
+AC_TRY_COMPILER([int main(){return(0);}],
+ ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_prog_cc_works)
if test $ac_cv_prog_cc_works = no; then
@@ -213,11 +221,14 @@ AC_MSG_RESULT($ac_cv_prog_cc_cross)
cross_compiling=$ac_cv_prog_cc_cross
])
+dnl AC_PROG_CXX_WORKS
+dnl -----------------
AC_DEFUN(AC_PROG_CXX_WORKS,
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
-AC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
+AC_TRY_COMPILER([int main(){return(0);}],
+ ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_prog_cxx_works)
if test $ac_cv_prog_cxx_works = no; then
@@ -228,12 +239,12 @@ AC_MSG_RESULT($ac_cv_prog_cxx_cross)
cross_compiling=$ac_cv_prog_cxx_cross
])
+dnl AC_PROG_F77_WORKS
+dnl -----------------
dnl Test whether the Fortran 77 compiler can compile and link a trivial
dnl Fortran program. Also, test whether the Fortran 77 compiler is a
dnl cross-compiler (which may realistically be the case if the Fortran
dnl compiler is `g77').
-dnl
-dnl AC_PROG_F77_WORKS()
AC_DEFUN(AC_PROG_F77_WORKS,
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
AC_LANG_SAVE
@@ -252,6 +263,8 @@ AC_MSG_RESULT($ac_cv_prog_f77_cross)
cross_compiling=$ac_cv_prog_f77_cross
])
+dnl AC_PROG_CC_GNU
+dnl --------------
AC_DEFUN(AC_PROG_CC_GNU,
[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
@@ -266,6 +279,8 @@ else
ac_cv_prog_gcc=no
fi])])
+dnl AC_PROG_CXX_GNU
+dnl ---------------
AC_DEFUN(AC_PROG_CXX_GNU,
[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
@@ -280,11 +295,11 @@ else
ac_cv_prog_gxx=no
fi])])
+dnl AC_PROG_F77_GNU
+dnl ---------------
dnl Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
dnl Compiler). This test depends on whether the Fortran 77 compiler can
dnl do CPP pre-processing.
-dnl
-dnl AC_PROG_F77_GNU()
AC_DEFUN(AC_PROG_F77_GNU,
[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77,
[cat > conftest.fpp <<EOF
@@ -298,6 +313,9 @@ else
ac_cv_prog_g77=no
fi])])
+
+dnl AC_PROG_CC_G
+dnl ------------
AC_DEFUN(AC_PROG_CC_G,
[AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g,
[echo 'void f(){}' > conftest.c
@@ -309,6 +327,9 @@ fi
rm -f conftest*
])])
+
+dnl AC_PROG_CXX_G
+dnl -------------
AC_DEFUN(AC_PROG_CXX_G,
[AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g,
[echo 'void f(){}' > conftest.cc
@@ -320,10 +341,11 @@ fi
rm -f conftest*
])])
+
+dnl AC_PROG_F77_G
+dnl -------------
dnl Test whether the Fortran 77 compiler can accept the `-g' option to
dnl enable debugging.
-dnl
-dnl AC_PROG_F77_G()
AC_DEFUN(AC_PROG_F77_G,
[AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g,
[cat > conftest.f << EOF
@@ -360,6 +382,8 @@ Autoconf TCGETA],
fi
])
+dnl AC_PROG_CC_C_O
+dnl --------------
AC_DEFUN(AC_PROG_CC_C_O,
[if test "x$CC" != xcc; then
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
@@ -404,9 +428,11 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
- AC_DEFINE(NO_MINUS_C_MINUS_O)
+ AC_DEFINE(NO_MINUS_C_MINUS_O, 1,
+ [Define if your C compiler doesn't accept -c and -o together.])
fi
-])
+])dnl AC_PROG_CC_C_O
+
dnl Test if the Fortran 77 compiler accepts the options `-c' and `-o'
dnl simultaneously, and define `F77_NO_MINUS_C_MINUS_O' if it does not.
@@ -414,7 +440,7 @@ dnl
dnl The usefulness of this macro is questionable, as I can't really see
dnl why anyone would use it. The only reason I include it is for
dnl completeness, since a similar test exists for the C compiler.
-dnl
+dnl
dnl AC_PROG_F77_C_O
AC_DEFUN(AC_PROG_F77_C_O,
[AC_BEFORE([$0], [AC_PROG_F77])dnl
@@ -443,10 +469,13 @@ if eval "test \"`echo '$ac_cv_prog_f77_'${ac_f77}_c_o`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
- AC_DEFINE(F77_NO_MINUS_C_MINUS_O)
+ AC_DEFINE(F77_NO_MINUS_C_MINUS_O, 1,
+ [Define if your Fortran 77 compiler doesn't accept -c and -o together.])
fi
])
+dnl AC_PROG_MAKE_SET
+dnl ----------------
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
AC_DEFUN(AC_PROG_MAKE_SET,
[AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE})
@@ -483,9 +512,70 @@ dnl Check for mawk first since it's generally faster.
AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
+
+dnl AC_PROG_SED
+dnl -----------
+dnl Check whether the first sed in the path supports long scripts.
+dnl Set the variable $ac_cv_prog_sed_max_cmd to the maximum number
+dnl of commands to put in a sed script, `infinite' meaning a priori
+dnl infinite.
+dnl This macro is not documented on purpose.
+AC_DEFUN([AC_PROG_SED],
+[AC_CACHE_CHECK([for max sed script length], ac_cv_prog_sed_max_cmd,
+[echo >conftest.s "\
+s/0/1/;s/1/2/;s/2/3/;s/3/4/;s/4/5/;s/5/6/;s/6/7/;s/7/8/;s/8/9/;s/9/0/;s/9/O/;"
+dnl 2^4 = 16 lines of 10 commands.
+for ac_cnt in 0 1 2 3
+do
+ cat conftest.s conftest.s >conftest.s1
+ mv conftest.s1 conftest.s
+done
+if test "`echo 0 | sed -f conftest.s`" != 0; then
+dnl HP-UX sed dies with scripts longer than 100 commands.
+ ac_cv_prog_sed_max_cmd=100
+else
+ ac_cv_prog_sed_max_cmd=infinite
+fi
+])dnl
+])
+
+dnl AC_PROG_BINSH
+dnl -------------
+dnl Check the maximum length of an here document.
+dnl FIXME: Is this test really reliable?
+AC_DEFUN([AC_PROG_BINSH],
+[AC_CACHE_CHECK([for max here document length], ac_cv_prog_binsh_max_heredoc,
+[echo >conftest.s1 "\
+ac_test='This is a sample string to test here documents.'"
+dnl 2^8 = 256 lines
+for ac_cnt in 0 1 2 3 4 5 6 7
+do
+ cat conftest.s1 conftest.s1 >conftest.sh
+ mv conftest.sh conftest.s1
+done
+echo 'cat >conftest.s1 <<CEOF' >conftest.sh
+cat conftest.s1 >>conftest.sh
+echo 'echo "Success"' >>conftest.sh
+echo 'CEOF' >>conftest.sh
+$SHELL ./conftest.sh
+if test "`$SHELL ./conftest.s1`" != Success; then
+dnl Some people say to limit oneself to 12, which seems incredibly small.
+ ac_cv_prog_binsh_max_heredoc=12
+else
+ ac_cv_prog_binsh_max_heredoc=infinite
+fi
+])dnl
+])dnl AC_PROG_BINSH
+
+
+dnl AC_PROG_YACC
+dnl ------------
AC_DEFUN(AC_PROG_YACC,
[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
+
+dnl AC_PROG_CPP
+dnl -----------
AC_DEFUN(AC_PROG_CPP,
[AC_MSG_CHECKING(how to run the C preprocessor)
# On Suns, sometimes $CPP names a directory.
@@ -516,8 +606,11 @@ else
fi
AC_MSG_RESULT($CPP)
AC_SUBST(CPP)dnl
-])
+])dnl AC_PROG_CPP
+
+dnl AC_PROG_CXXCPP
+dnl --------------
AC_DEFUN(AC_PROG_CXXCPP,
[AC_MSG_CHECKING(how to run the C++ preprocessor)
if test -z "$CXXCPP"; then
@@ -538,8 +631,12 @@ AC_SUBST(CXXCPP)dnl
dnl Require finding the C or C++ preprocessor, whichever is the
dnl current language.
AC_DEFUN(AC_REQUIRE_CPP,
-[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])
+[ifelse(AC_LANG,
+ C, [AC_REQUIRE([AC_PROG_CPP])],
+ [AC_REQUIRE([AC_PROG_CXXCPP])])])
+dnl AC_PROG_LEX
+dnl -----------
AC_DEFUN(AC_PROG_LEX,
[AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
@@ -552,7 +649,10 @@ then
fi
AC_SUBST(LEXLIB)])
+dnl AC_DECL_YYTEXT
+dnl --------------
dnl Check if lex declares yytext as a char * by default, not a char[].
+dnl FIXME: Why the heck is there the following line?
undefine([AC_DECL_YYTEXT])
AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
@@ -586,9 +686,11 @@ rm -f "${LEX_OUTPUT_ROOT}.c"
])
dnl
if test $ac_cv_prog_lex_yytext_pointer = yes; then
- AC_DEFINE(YYTEXT_POINTER)
+ AC_DEFINE(YYTEXT_POINTER, 1,
+ [Define if `lex' declares `yytext' as a `char *' by default,
+ not a `char[]'.])
fi
-])
+])dnl AC_DECL_YYTEXT
AC_DEFUN(AC_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
@@ -683,8 +785,7 @@ AC_SUBST(LN_S)dnl
])
define(AC_RSH,
-[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code
-)m4exit(4)])
+[AC_FATAL([$0 has been removed; replace it with equivalent code], 4)])
dnl ### Checks for header files
@@ -727,31 +828,7 @@ exit (0); }
], , ac_cv_header_stdc=no, :)
fi])
if test $ac_cv_header_stdc = yes; then
- AC_DEFINE(STDC_HEADERS)
-fi
-])
-
-AC_DEFUN(AC_UNISTD_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
-AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])
-
-AC_DEFUN(AC_USG,
-[AC_OBSOLETE([$0],
- [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
-AC_MSG_CHECKING([for BSD string and memory functions])
-AC_TRY_LINK([#include <strings.h>], [rindex(0, 0); bzero(0, 0);],
- [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(USG)])])
-
-
-dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
-dnl To avoid problems, don't check for gcc2 built-ins.
-AC_DEFUN(AC_MEMORY_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
-AC_MSG_CHECKING(whether string.h declares mem functions)
-AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
-AC_MSG_RESULT($ac_found)
-if test $ac_found = no; then
- AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
+ AC_DEFINE(STDC_HEADERS, 1, [Define if you have the ANSI C header files.])
fi
])
@@ -763,29 +840,24 @@ AC_DEFUN(AC_HEADER_MAJOR,
])
if test $ac_cv_header_sys_types_h_makedev = no; then
-AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)])
+AC_CHECK_HEADER(sys/mkdev.h,
+ [AC_DEFINE(MAJOR_IN_MKDEV, 1,
+ [Define if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
if test $ac_cv_header_sys_mkdev_h = no; then
-AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)])
+ AC_CHECK_HEADER(sys/sysmacros.h,
+ [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+ [Define if `major', `minor', and `makedev' are
+ declared in <sysmacros.h>.])])
fi
fi
])
-AC_DEFUN(AC_HEADER_DIRENT,
-[ac_header_dirent=no
-AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
- [ac_header_dirent=$ac_hdr; break])
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
-else
-AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
-fi
-])
-
+dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
+dnl ----------------------------------------------------
dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE
dnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't.
-dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
AC_DEFUN(AC_CHECK_HEADER_DIRENT,
[ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING([for $1 that defines DIR])
@@ -802,9 +874,10 @@ else
fi
])
+dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
+dnl --------------------------------------------------
dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
dnl defines `DIR'.
-dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
define(AC_CHECK_HEADERS_DIRENT,
[for ac_hdr in $1
do
@@ -815,30 +888,19 @@ changequote([, ])dnl
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl
done])
-AC_DEFUN(AC_DIR_HEADER,
-[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break])
-done
-
-case "$ac_header_dirent" in
-dirent.h) AC_DEFINE(DIRENT) ;;
-sys/ndir.h) AC_DEFINE(SYSNDIR) ;;
-sys/dir.h) AC_DEFINE(SYSDIR) ;;
-ndir.h) AC_DEFINE(NDIR) ;;
-esac
-
-AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
-[AC_TRY_RUN([#include <sys/types.h>
-#include <$ac_header_dirent>
-int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
-if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(VOID_CLOSEDIR)
+AC_DEFUN(AC_HEADER_DIRENT,
+[ac_header_dirent=no
+AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
+ [ac_header_dirent=$ac_hdr; break])
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
+else
+ AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
fi
])
+
AC_DEFUN(AC_HEADER_STAT,
[AC_CACHE_CHECK(whether stat file-mode macros are broken,
ac_cv_header_stat_broken,
@@ -870,10 +932,14 @@ You lose.
#endif
], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
if test $ac_cv_header_stat_broken = yes; then
- AC_DEFINE(STAT_MACROS_BROKEN)
+ AC_DEFINE(STAT_MACROS_BROKEN, 1,
+ [Define if the `S_IS*' macros in <sys/stat.h> do not
+ work properly.])
fi
])
+dnl AC_DECL_SYS_SIGLIST
+dnl -------------------
AC_DEFUN(AC_DECL_SYS_SIGLIST,
[AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
ac_cv_decl_sys_siglist,
@@ -882,12 +948,14 @@ AC_DEFUN(AC_DECL_SYS_SIGLIST,
/* NetBSD declares sys_siglist in unistd.h. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif], [char *msg = *(sys_siglist + 1);],
+#endif
+], [char *msg = *(sys_siglist + 1);],
ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])
if test $ac_cv_decl_sys_siglist = yes; then
- AC_DEFINE(SYS_SIGLIST_DECLARED)
+ AC_DEFINE(SYS_SIGLIST_DECLARED, 1,
+ [Define if `sys_siglist' is declared by <signal.h> or <unistd.h>.])
fi
-])
+])dnl AC_DECL_SYS_SIGLIST
AC_DEFUN(AC_HEADER_SYS_WAIT,
[AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
@@ -904,10 +972,29 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])
if test $ac_cv_header_sys_wait_h = yes; then
- AC_DEFINE(HAVE_SYS_WAIT_H)
+ AC_DEFINE(HAVE_SYS_WAIT_H, 1,
+ [Define if you have <sys/wait.h> that is POSIX.1 compatible.])
fi
])
+dnl A few hasbeen'd macros.
+
+AC_DEFUN(AC_UNISTD_H,
+[AC_HASBEEN([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])])
+
+AC_DEFUN(AC_USG,
+[AC_HASBEEN([$0],
+ [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])])
+
+dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
+dnl To avoid problems, don't check for gcc2 built-ins.
+AC_DEFUN(AC_MEMORY_H,
+[AC_HASBEEN([$0],
+ [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])])
+
+AC_DEFUN(AC_DIR_HEADER,
+[AC_HASBEEN([$0], [; instead use AC_HEADER_DIRENT])])
+
dnl ### Checks for typedefs
@@ -949,16 +1036,18 @@ if test $ac_cv_type_getgroups = cross; then
AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
fi])
-AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
-])
+AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups,
+ [Define to the type of elements in the array set by
+ `getgroups'. Usually this is either `int' or `gid_t'.])
+])dnl AC_TYPE_GETGROUPS
AC_DEFUN(AC_TYPE_UID_T,
[AC_CACHE_CHECK(for uid_t in sys/types.h, ac_cv_type_uid_t,
[AC_EGREP_HEADER(uid_t, sys/types.h,
ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])
if test $ac_cv_type_uid_t = no; then
- AC_DEFINE(uid_t, int)
- AC_DEFINE(gid_t, int)
+ AC_DEFINE(uid_t, int, [Define to `int' if <sys/types.h> doesn't define.])
+ AC_DEFINE(gid_t, int, [Define to `int' if <sys/types.h> doesn't define.])
fi
])
@@ -974,6 +1063,8 @@ AC_DEFUN(AC_TYPE_OFF_T,
AC_DEFUN(AC_TYPE_MODE_T,
[AC_CHECK_TYPE(mode_t, int)])
+dnl AC_TYPE_SIGNAL
+dnl --------------
dnl Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN(AC_TYPE_SIGNAL,
[AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
@@ -989,22 +1080,31 @@ void (*signal ()) ();
#endif
],
[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])
-AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal)
+AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal,
+ [Define as the return type of signal handlers
+ (`int' or `void').])
])
dnl ### Checks for functions
+dnl AC_FUNC_CLOSEDIR_VOID
+dnl ---------------------
+dnl Check whether closedir returns void, and #define CLOSEDIR_VOID in
+dnl that case.
AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
[AC_TRY_RUN([#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
+ ac_cv_func_closedir_void=no,
+ ac_cv_func_closedir_void=yes,
+ ac_cv_func_closedir_void=yes)])
if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(CLOSEDIR_VOID)
+ AC_DEFINE(CLOSEDIR_VOID, 1,
+ [Define if the `closedir' function returns void instead of `int'.])
fi
])
@@ -1017,10 +1117,13 @@ AC_DEFUN(AC_FUNC_FNMATCH,
ac_cv_func_fnmatch_works=yes, ac_cv_func_fnmatch_works=no,
ac_cv_func_fnmatch_works=no)])
if test $ac_cv_func_fnmatch_works = yes; then
- AC_DEFINE(HAVE_FNMATCH)
+ AC_DEFINE(HAVE_FNMATCH, 1,
+ [Define if your system has a working `fnmatch' function.])
fi
])
+dnl AC_FUNC_MMAP
+dnl ------------
AC_DEFUN(AC_FUNC_MMAP,
[AC_CHECK_HEADERS(unistd.h)
AC_CHECK_FUNCS(getpagesize)
@@ -1038,7 +1141,7 @@ AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
+ VM page cache was not coherent with the file system buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
propogated back to all the places they're supposed to be.
@@ -1164,10 +1267,14 @@ main()
], ac_cv_func_mmap_fixed_mapped=yes, ac_cv_func_mmap_fixed_mapped=no,
ac_cv_func_mmap_fixed_mapped=no)])
if test $ac_cv_func_mmap_fixed_mapped = yes; then
- AC_DEFINE(HAVE_MMAP)
+ AC_DEFINE(HAVE_MMAP, 1,
+ [Define if you have a working `mmap' system call.])
fi
-])
+])dnl AC_FUNC_MMAP
+
+dnl AC_FUNC_GETPGRP
+dnl ---------------
AC_DEFUN(AC_FUNC_GETPGRP,
[AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
[AC_TRY_RUN([
@@ -1225,9 +1332,10 @@ main()
AC_MSG_ERROR(cannot check getpgrp if cross compiling))
])
if test $ac_cv_func_getpgrp_void = yes; then
- AC_DEFINE(GETPGRP_VOID)
+ AC_DEFINE(GETPGRP_VOID, 1,
+ [Define if the `getpgrp' function takes no argument.])
fi
-])
+])dnl AC_FUNC_GETPGRP
AC_DEFUN(AC_FUNC_SETPGRP,
[AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void,
@@ -1251,20 +1359,32 @@ main()
AC_MSG_ERROR(cannot check setpgrp if cross compiling))
)
if test $ac_cv_func_setpgrp_void = yes; then
- AC_DEFINE(SETPGRP_VOID)
+ AC_DEFINE(SETPGRP_VOID, 1,
+ [Define if the `setpgrp' function takes no argument.])
fi
])
+dnl Why the heck is that _doprnt does not define HAVE__DOPRNT???
+dnl That the logical name! In addition, why doesn't it use
+dnl AC_CHECK_FUNCS(vprintf)? Because old Autoconf uses sh for loops.
+dnl FIXME: To be changed in Autoconf 3?
AC_DEFUN(AC_FUNC_VPRINTF,
-[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
+[AC_CHECK_FUNC(vprintf,
+ AC_DEFINE(HAVE_VPRINTF, 1,
+ [Define if you have the `vprintf' function.]))
if test "$ac_cv_func_vprintf" != yes; then
-AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
+AC_CHECK_FUNC(_doprnt,
+ AC_DEFINE(HAVE_DOPRNT, 1,
+ [Define if you don't have `vprintf' but do have
+ `_doprnt.']))
fi
])
AC_DEFUN(AC_FUNC_VFORK,
[AC_REQUIRE([AC_TYPE_PID_T])dnl
-AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
+AC_CHECK_HEADER(vfork.h,
+ AC_DEFINE(HAVE_VFORK_H, 1,
+ [Define if you have <vfork.h>.]))
AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works,
[AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -1361,7 +1481,7 @@ main() {
ac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork)
ac_cv_func_vfork_works=$ac_cv_func_vfork)])
if test "x$ac_cv_func_vfork_works" = xno; then
- AC_DEFINE(vfork, fork)
+ AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
fi
])
@@ -1397,9 +1517,10 @@ main() {
}], ac_cv_func_wait3_rusage=yes, ac_cv_func_wait3_rusage=no,
ac_cv_func_wait3_rusage=no)])
if test $ac_cv_func_wait3_rusage = yes; then
- AC_DEFINE(HAVE_WAIT3)
+ AC_DEFINE(HAVE_WAIT3, 1,
+ [Define if you have the `wait3' system call.])
fi
-])
+])dnl AC_FUNC_WAIT3
AC_DEFUN(AC_FUNC_ALLOCA,
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
@@ -1409,7 +1530,9 @@ AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
[AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
ac_cv_working_alloca_h=yes, ac_cv_working_alloca_h=no)])
if test $ac_cv_working_alloca_h = yes; then
- AC_DEFINE(HAVE_ALLOCA_H)
+ AC_DEFINE(HAVE_ALLOCA_H, 1,
+ [Define if you have <alloca.h> and it should be used
+ (not on Ultrix).])
fi
AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
@@ -1437,7 +1560,8 @@ char *alloca ();
], [char *p = (char *) alloca(1);],
ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
if test $ac_cv_func_alloca_works = yes; then
- AC_DEFINE(HAVE_ALLOCA)
+ AC_DEFINE(HAVE_ALLOCA, 1,
+ [Define if you have `alloca', as a function or macro.])
fi
if test $ac_cv_func_alloca_works = no; then
@@ -1446,7 +1570,7 @@ if test $ac_cv_func_alloca_works = no; then
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=alloca.${ac_objext}
- AC_DEFINE(C_ALLOCA)
+ AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.])
AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
[AC_EGREP_CPP(webecray,
@@ -1458,7 +1582,12 @@ wenotbecray
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func)
+ AC_CHECK_FUNC($ac_func,
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of _getb67, GETB67, getb67
+ for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c
+ support on those systems.])
break])
done
fi
@@ -1484,7 +1613,7 @@ main ()
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
fi
AC_SUBST(ALLOCA)dnl
-])
+])dnl AC_FUNC_ALLOCA
AC_DEFUN(AC_FUNC_GETLOADAVG,
[ac_have_func=no # yes means we've found a way to get the load average.
@@ -1511,26 +1640,34 @@ fi
AC_REPLACE_FUNCS(getloadavg)
if test $ac_cv_func_getloadavg = yes; then
- AC_DEFINE(HAVE_GETLOADAVG)
+ AC_DEFINE(HAVE_GETLOADAVG, 1,
+ [Define if your system has its own `getloadavg' function.])
ac_have_func=yes
else
# Figure out what our getloadavg.c needs.
ac_have_func=no
AC_CHECK_HEADER(sys/dg_sys_info.h,
- [ac_have_func=yes; AC_DEFINE(DGUX)
- AC_CHECK_LIB(dgc, dg_sys_info)])
+ [ac_have_func=yes;
+ AC_DEFINE(DGUX, 1, [Define for DGUX with <sys/dg_sys_info.h>.])
+ AC_CHECK_LIB(dgc, dg_sys_info)])
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
# Irix 4.0.5F has the header but not the library.
if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then
- ac_have_func=yes; AC_DEFINE(SVR4)
+ ac_have_func=yes;
+ AC_DEFINE(SVR4, 1,
+ [Define on System V Release 4.])
fi
if test $ac_have_func = no; then
AC_CHECK_HEADER(inq_stats/cpustats.h,
- [ac_have_func=yes; AC_DEFINE(UMAX)
- AC_DEFINE(UMAX4_3)])
+ [ac_have_func=yes;
+ AC_DEFINE(UMAX, 1,
+ [Define for Encore UMAX.])
+ AC_DEFINE(UMAX4_3, 1,
+ [Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>.])])
fi
if test $ac_have_func = no; then
@@ -1543,13 +1680,14 @@ else
fi
AC_CHECK_HEADER(nlist.h,
- [AC_DEFINE(NLIST_STRUCT)
+ [AC_DEFINE(NLIST_STRUCT, 1, [Define if you have <nlist.h>.])
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
[AC_TRY_COMPILE([#include <nlist.h>],
[struct nlist n; n.n_un.n_name = 0;],
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
if test $ac_cv_struct_nlist_n_un = yes; then
- AC_DEFINE(NLIST_NAME_UNION)
+ AC_DEFINE(NLIST_NAME_UNION, 1,
+ [Define if your `struct nlist' has an `n_un' member.])
fi
])dnl
fi # Do not have getloadavg in system libraries.
@@ -1565,7 +1703,10 @@ Yowza Am I SETGID yet
#endif],
ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])
if test $ac_cv_func_getloadavg_setgid = yes; then
- NEED_SETGID=true; AC_DEFINE(GETLOADAVG_PRIVILEGED)
+ NEED_SETGID=true;
+ AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
+ [Define if the `getloadavg' function needs to be run setuid
+ or setgid.])
else
NEED_SETGID=false
fi
@@ -1604,7 +1745,9 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
ac_cv_func_utime_null=no)
rm -f core core.* *.core])
if test $ac_cv_func_utime_null = yes; then
- AC_DEFINE(HAVE_UTIME_NULL)
+ AC_DEFINE(HAVE_UTIME_NULL, 1,
+ [Define if `utime(file, NULL)' sets file's timestamp to the
+ present.])
fi
])
@@ -1619,7 +1762,9 @@ main ()
}], ac_cv_func_strcoll_works=yes, ac_cv_func_strcoll_works=no,
ac_cv_func_strcoll_works=no)])
if test $ac_cv_func_strcoll_works = yes; then
- AC_DEFINE(HAVE_STRCOLL)
+ AC_DEFINE(HAVE_STRCOLL, 1,
+ [Define if you have the `strcoll' function and it is properly
+ defined.])
fi
])
@@ -1639,7 +1784,10 @@ main () {
}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
rm -f core core.* *.core])
if test $ac_cv_func_setvbuf_reversed = yes; then
- AC_DEFINE(SETVBUF_REVERSED)
+ AC_DEFINE(SETVBUF_REVERSED, 1,
+ [Define if the `setvbuf' function takes the buffering type as
+ its second argument and the buffer pointer as the third, as on
+ System V before release 3.])
fi
])
@@ -1648,7 +1796,9 @@ AC_DEFUN(AC_FUNC_GETMNTENT,
AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS",
[AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS",
[AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])])
-AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])])
+AC_CHECK_FUNC(getmntent,
+ [AC_DEFINE(HAVE_GETMNTENT, 1,
+ [Define if you have the `getmntent' function.])])])
AC_DEFUN(AC_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
@@ -1813,10 +1963,13 @@ fi
])
AC_DEFUN(AC_FUNC_STRFTIME,
-[AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)],
+[AC_CHECK_FUNC(strftime,
+ [AC_DEFINE(HAVE_STRFTIME, 1,
+ [Define if you have the `strftime' function.])],
[# strftime is in -lintl on SCO UNIX.
-AC_CHECK_LIB(intl, strftime,
-[AC_DEFINE(HAVE_STRFTIME)
+AC_CHECK_LIB(intl, strftime,
+[AC_DEFINE(HAVE_STRFTIME, 1,
+ [Define if you have the `strftime' function.])
LIBS="-lintl $LIBS"])])])
AC_DEFUN(AC_FUNC_MEMCMP,
@@ -1863,14 +2016,17 @@ extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_sel
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
if test "$ac_not_found" = yes; then
- ac_cv_func_select_arg1=int
- ac_cv_func_select_arg234='int *'
+ ac_cv_func_select_arg1=int
+ ac_cv_func_select_arg234='int *'
ac_cv_func_select_arg5='struct timeval *'
fi
AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1)
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234))
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5))
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $ac_cv_func_select_arg1,
+ [Define to the type of arg1 for `select'.])
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ($ac_cv_func_select_arg234),
+ [Define to the type of args 2, 3 and 4 for `select'.])
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ($ac_cv_func_select_arg5),
+ [Define to the type of arg5 for `select'.])
])
@@ -1885,7 +2041,8 @@ AC_DEFUN(AC_HEADER_TIME,
#include <time.h>],
[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])
if test $ac_cv_header_time = yes; then
- AC_DEFINE(TIME_WITH_SYS_TIME)
+ AC_DEFINE(TIME_WITH_SYS_TIME, 1,
+ [Define if you can safely include both <sys/time.h> and <time.h>.])
fi
])
@@ -1897,7 +2054,8 @@ AC_DEFUN(AC_STRUCT_TM,
[struct tm *tp; tp->tm_sec;],
ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])
if test $ac_cv_struct_tm = sys/time.h; then
- AC_DEFINE(TM_IN_SYS_TIME)
+ AC_DEFINE(TM_IN_SYS_TIME, 1,
+ [Define if your <sys/time.h> declares `struct tm'.])
fi
])
@@ -1906,7 +2064,8 @@ AC_DEFUN(AC_STRUCT_TIMEZONE,
AC_C_STRUCT_MEMBER(tm_zone, [#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm], tm_zone)
if test "$ac_cv_c_struct_member_tm_zone" = yes; then
- AC_DEFINE(HAVE_TM_ZONE)
+ AC_DEFINE(HAVE_TM_ZONE, 1,
+ [Define if your `struct tm' has `tm_zone'.])
else
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
@@ -1918,35 +2077,40 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname. */
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
- AC_DEFINE(HAVE_TZNAME)
+ AC_DEFINE(HAVE_TZNAME, 1,
+ [Define if you don't have `tm_zone' but do have the external
+ array `tzname'.])
fi
fi
])
+AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
+[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
+#include <sys/stat.h>], [struct stat], st_blksize)
+if test $ac_cv_c_struct_member_st_blksize = yes; then
+ AC_DEFINE(HAVE_ST_BLKSIZE, 1,
+ [Define if your `struct stat' has `st_blksize'.])
+fi
+])
+
AC_DEFUN(AC_STRUCT_ST_BLOCKS,
[AC_C_STRUCT_MEMBER(st_blocks, [#include <sys/types.h>
#include <sys/stat.h>], [struct stat], st_blocks)
if test $ac_cv_c_struct_member_st_blocks = yes; then
- AC_DEFINE(HAVE_ST_BLOCKS)
+ AC_DEFINE(HAVE_ST_BLOCKS, 1,
+ [Define if your `struct stat' has `st_blocks'.])
else
LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi
AC_SUBST(LIBOBJS)dnl
])
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
-#include <sys/stat.h>], [struct stat], st_blksize)
-if test $ac_cv_c_struct_member_st_blksize = yes; then
- AC_DEFINE(HAVE_ST_BLKSIZE)
-fi
-])
-
AC_DEFUN(AC_STRUCT_ST_RDEV,
[AC_C_STRUCT_MEMBER(st_rdev, [#include <sys/types.h>
#include <sys/stat.h>], [struct stat], st_rdev)
if test $ac_cv_c_struct_member_st_rdev = yes; then
- AC_DEFINE(HAVE_ST_RDEV)
+ AC_DEFINE(HAVE_ST_RDEV, 1,
+ [Define if your `struct stat' has `st_rdev'.])
fi
])
@@ -1979,7 +2143,7 @@ fi])
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
AC_DEFINE(__CHAR_UNSIGNED__)
fi
-])
+])dnl AC_C_CHAR_UNSIGNED
AC_DEFUN(AC_C_LONG_DOUBLE,
[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
@@ -1994,25 +2158,16 @@ exit(sizeof(long double) < sizeof(double)); }],
ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
fi])
if test $ac_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE)
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1,
+ [Define if the `long double' type works.])
fi
])
AC_DEFUN(AC_INT_16_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl
-AC_MSG_CHECKING(whether int is 16 bits)
-AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no))
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_SIZEOF(int)])])
AC_DEFUN(AC_LONG_64_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl
-AC_MSG_CHECKING(whether long int is 64 bits)
-AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no))
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_SIZEOF(long)])])
AC_DEFUN(AC_C_BIGENDIAN,
[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
@@ -2041,7 +2196,9 @@ AC_TRY_RUN([main () {
}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)
fi])
if test $ac_cv_c_bigendian = yes; then
- AC_DEFINE(WORDS_BIGENDIAN)
+ AC_DEFINE(WORDS_BIGENDIAN, 1,
+ [Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX).])
fi
])
@@ -2057,8 +2214,12 @@ done
])
case "$ac_cv_c_inline" in
inline | yes) ;;
- no) AC_DEFINE(inline, ) ;;
- *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
+ no) AC_DEFINE(inline,,
+ [Define as `__inline' if that's what the C compiler calls it,
+ or to nothing if it is not supported.]) ;;
+ *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline,
+ [Define as `__inline' if that's what the C compiler
+ calls it, or to nothing if it is not supported.]) ;;
esac
])
@@ -2070,7 +2231,7 @@ AC_CACHE_CHECK([for working const], ac_cv_c_const,
changequote(<<, >>)dnl
<<
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0, 0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
@@ -2114,34 +2275,39 @@ ccp = (char const *const *) p;
changequote([, ])dnl
ac_cv_c_const=yes, ac_cv_c_const=no)])
if test $ac_cv_c_const = no; then
- AC_DEFINE(const, )
+ AC_DEFINE(const,,
+ [Define to empty if the keyword `const' does not work.])
fi
])
-dnl Note that, unlike const, #defining volatile to be the empty
-dnl string can actually turn a correct program into an incorrect
-dnl one, since removing uses of volatile actually grants the
-dnl compiler permission to perform optimizations that could break
-dnl the user's code. So, do not #define volatile away unless it is
-dnl really necessary to allow the user's code to compile cleanly.
-dnl Benign compiler failures should be tolerated.
+dnl AC_C_VOLATILE
+dnl -------------
+dnl Note that, unlike const, #defining volatile to be the empty string can
+dnl actually turn a correct program into an incorrect one, since removing
+dnl uses of volatile actually grants the compiler permission to perform
+dnl optimizations that could break the user's code. So, do not #define
+dnl volatile away unless it is really necessary to allow the user's code
+dnl to compile cleanly. Benign compiler failures should be tolerated.
AC_DEFUN(AC_C_VOLATILE,
[AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
-[AC_TRY_COMPILE(,
-changequote(<<, >>)dnl
-<<
+[AC_TRY_COMPILE(,[
volatile int x;
-int * volatile y;
->>,
-changequote([, ])dnl
+int * volatile y;],
ac_cv_c_volatile=yes, ac_cv_c_volatile=no)])
if test $ac_cv_c_volatile = no; then
- AC_DEFINE(volatile, )
+ AC_DEFINE(volatile,,
+ [Define to empty if the keyword `volatile' does not work.
+ Warning: valid code using `volatile' can become incorrect
+ without. Disable with care.])
fi
])
-AC_DEFUN(AC_C_STRINGIZE, [
-AC_REQUIRE([AC_PROG_CPP])
+dnl AC_C_STRINGIZE
+dnl --------------
+dnl Checks if `#' can be used to glue strings together at the CPP level.
+dnl Defines HAVE_STRINGIZE if positive.
+AC_DEFUN(AC_C_STRINGIZE,
+[AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for preprocessor stringizing operator])
AC_CACHE_VAL(ac_cv_c_stringize,
AC_EGREP_CPP([#teststring],[
@@ -2149,16 +2315,15 @@ AC_EGREP_CPP([#teststring],[
char *s = x(teststring);
], ac_cv_c_stringize=no, ac_cv_c_stringize=yes))
-if test "${ac_cv_c_stringize}" = yes
-then
- AC_DEFINE(HAVE_STRINGIZE)
+if test "${ac_cv_c_stringize}" = yes; then
+ AC_DEFINE(HAVE_STRINGIZE, 1,
+ [Define if you have the ANSI # stringizing operator in cpp.])
fi
AC_MSG_RESULT([${ac_cv_c_stringize}])
])dnl
define(AC_ARG_ARRAY,
-[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments
-)m4exit(4)])
+[AC_FATAL([$0 has been removed; don't do non-portable things with arguments], 4)])
dnl Check the object extension used by the compiler: typically .o or
dnl .obj. If this is called, some other behaviour will change,
@@ -2184,216 +2349,350 @@ OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext
AC_SUBST(OBJEXT)])
-dnl Determine the linker flags (e.g. `-L' and `-l') for the Fortran 77
+
+dnl AC_F77_LIBRARY_LDFLAGS
+dnl ----------------------
+dnl
+dnl Determine the linker flags (e.g. "-L" and "-l") for the Fortran 77
dnl intrinsic and run-time libraries that are required to successfully
dnl link a Fortran 77 program or shared library. The output variable
dnl FLIBS is set to these flags.
-dnl
+dnl
dnl This macro is intended to be used in those situations when it is
dnl necessary to mix, e.g. C++ and Fortran 77, source code into a single
dnl program or shared library.
-dnl
+dnl
dnl For example, if object files from a C++ and Fortran 77 compiler must
dnl be linked together, then the C++ compiler/linker must be used for
dnl linking (since special C++-ish things need to happen at link time
dnl like calling global constructors, instantiating templates, enabling
dnl exception support, etc.).
-dnl
+dnl
dnl However, the Fortran 77 intrinsic and run-time libraries must be
dnl linked in as well, but the C++ compiler/linker doesn't know how to
dnl add these Fortran 77 libraries. Hence, the macro
-dnl `AC_F77_LIBRARY_LDFLAGS' was created to determine these Fortran 77
+dnl "AC_F77_LIBRARY_LDFLAGS" was created to determine these Fortran 77
dnl libraries.
dnl
dnl This macro was packaged in its current form by Matthew D. Langston
dnl <langston@SLAC.Stanford.EDU>. However, nearly all of this macro
-dnl came from the `OCTAVE_FLIBS' macro in `octave-2.0.13/aclocal.m4',
+dnl came from the "OCTAVE_FLIBS" macro in "octave-2.0.13/aclocal.m4",
dnl and full credit should go to John W. Eaton for writing this
dnl extremely useful macro. Thank you John.
dnl
dnl AC_F77_LIBRARY_LDFLAGS()
+
+dnl We have to "pushdef" this macro for now, because I haven't checked
+dnl this version of the macro into the Autoconf repository yet. --MDL
AC_DEFUN(AC_F77_LIBRARY_LDFLAGS,
-[AC_MSG_CHECKING([for Fortran 77 libraries])
-AC_REQUIRE([AC_PROG_F77])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_VAL(ac_cv_flibs,
-[changequote(, )dnl
-dnl Write a minimal program and compile it with -v. I don't know what
-dnl to do if your compiler doesn't have -v...
-echo " END" > conftest.f
-foutput=`${F77} -v -o conftest conftest.f 2>&1`
+[
+ AC_CACHE_CHECK([for Fortran 77 libraries],
+ ac_cv_flibs,
+ [
+ AC_REQUIRE([AC_PROG_F77])
+ AC_REQUIRE([AC_CYGWIN])
+
+ AC_LANG_SAVE
+ AC_LANG_FORTRAN77
+
+# This is the simplest of all Fortran 77 programs.
+ cat > conftest.$ac_ext <<EOF
+ end
+EOF
+
+ # Save the "compiler output file descriptor" to FD 8.
+ exec 8>&AC_FD_CC
+
+ # Temporarily redirect compiler output to stdout, since this is what
+ # we want to capture in "f77_link_output".
+ exec AC_FD_CC>&1
+
+ # Compile and link our simple test program by passing the "-v" flag
+ # to the Fortran 77 compiler in order to get "verbose" output that
+ # we can then parse for the Fortran 77 linker flags. I don't know
+ # what to do if your compiler doesn't have -v.
+ FFLAGS_SAVE="$FFLAGS"
+ FFLAGS="$FFLAGS -v"
+ f77_link_output=`eval $ac_link 2>&1 | grep -v 'Driving:'`
+ FFLAGS="$FFLAGS_SAVE"
+
+ # Restore the "compiler output file descriptor".
+ exec AC_FD_CC>&8
+
+ rm -f conftest.*
+
+ AC_LANG_RESTORE
+
+ # This will ultimately be our output variable.
+ FLIBS=
+
+changequote(, )dnl
+
+ # If we are using xlf then replace all the commas with spaces.
+ if test `echo $f77_link_output | grep xlfentry > /dev/null 2>&1`; then
+ f77_link_output=`echo $f77_link_output | sed 's/,/ /g'`
+ fi
+
+ # The "save_arg" variable will be set to the current option
+ # (i.e. something beginning with a "-") when we come across an
+ # option that we think will take an argument (e.g. -L
+ # /usr/local/lib/foo). When "save_arg" is set, we append "arg" to
+ # "seen" without any further examination.
+ save_arg=
+
+
+ # This is just a "list" (i.e. space delimited elements) of flags
+ # that we've already seen. This just help us not add the same
+ # linker flags twice to "FLIBS".
+ seen=
+
+ # The basic algorithm is that if "arg" makes it all the way through
+ # down to the bottom of the the "for" loop, then it is added to
+ # "FLIBS".
+ for arg in $f77_link_output; do
+ # Assume that none of the options that take arguments expect the
+ # argument to start with a "-". If we ever see this case, then
+ # reset "previous_arg" so that we don't try and process "arg" as
+ # an argument.
+ previous_arg="$save_arg"
+ test -n "`echo $arg | sed -n -e '/^-/!p'`" && previous_arg=
+ case "$previous_arg" in
+ '')
+ case "$arg" in
+ /*.a)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, seen="$seen $arg")
+ changequote(, )dnl
+ ;;
+ -bI:*)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, [AC_LINKER_OPTION([$arg], seen)])
+ changequote(, )dnl
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt0.o | -l[cm] | -lgcc | -LANG:=*)
+ arg=
+ ;;
+ -lkernel32)
+ # Only ignore this flag under the Cygwin
+ # environment.
+ if test x"$CYGWIN" = xyes; then arg=; else seen="$seen $arg"; fi
+ ;;
+ -[LRu])
+ # These flags, when seen by themselves, take an
+ # argument.
+ save_arg=$arg
+ arg=
+ ;;
+ -YP,*)
+ temp_arg=
+ for i in `echo $arg | sed -e 's%^P,%-L%' -e 's%:% -L%g'`; do
+ # Append to "seen" if it's not already
+ # there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($i, $seen, temp_arg="$temp_arg $i", seen="$seen $i")
+ changequote(, )dnl
+ done
+ arg="$temp_arg"
+ ;;
+ -[lLR]*)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, seen="$seen $arg")
+ changequote(, )dnl
+ ;;
+ *)
+ # Ignore everything else.
+ arg=
+ ;;
+ esac
+ ;;
+ -[LRu])
+ arg="$previous_arg $arg"
+ ;;
+ esac
+
+ # If "arg" has survived up until this point, then put it in
+ # "FLIBS".
+ test -n "$arg" && FLIBS="$FLIBS $arg"
+ done
+
+ # Assumption: We only see "LD_RUN_PATH" on Solaris systems. If this
+ # is seen, then we insist that the "run path" must be an absolute
+ # path (i.e. it must begin with a "/").
+ ld_run_path=`echo $f77_link_output | sed -n -e 's%^.*LD_RUN_PATH *= *\(/[^ ]*\).*$%\1%p'`
+ test -n "$ld_run_path" && FLIBS="$ld_run_path $FLIBS"
+
+changequote([, ])dnl
+
+ ac_cv_flibs="$FLIBS"
+ ])
+
+ AC_SUBST(FLIBS)
+
+])
+
+
+dnl Test for the name mangling scheme used by the Fortran 77 compiler.
+dnl Two variables are set by this macro:
dnl
-dnl The easiest thing to do for xlf output is to replace all the commas
-dnl with spaces. Try to only do that if the output is really from xlf,
-dnl since doing that causes problems on other systems.
+dnl f77_case: Set to either "upper" or "lower", depending on the
+dnl case of the name mangling.
dnl
-xlf_p=`echo $foutput | grep xlfentry`
-if test -n "$xlf_p"; then
- foutput=`echo $foutput | sed 's/,/ /g'`
-fi
+dnl f77_underscore: Set to either "no", "single" or "double", depending
+dnl on how underscores (i.e. "_") are appended to
+dnl identifiers, if at all.
+dnl
+dnl If no underscores are appended, then the value is
+dnl "no".
dnl
-ld_run_path=`echo $foutput | \
- sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`
+dnl If a single underscore is appended, even with
+dnl identifiers which already contain an underscore
+dnl somewhere in their name, then the value is
+dnl "single".
dnl
-dnl We are only supposed to find this on Solaris systems...
-dnl Uh, the run path should be absolute, shouldn't it?
+dnl If a single underscore is appended *and* two
+dnl underscores are appended to identifiers which
+dnl already contain an underscore somewhere in their
+dnl name, then the value is "double".
dnl
-case "$ld_run_path" in
- /*)
- if test "$ac_cv_prog_gcc" = yes; then
- ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
+dnl AC_F77_NAME_MANGLING()
+AC_DEFUN(AC_F77_NAME_MANGLING,
+[
+ AC_CACHE_CHECK([for Fortran 77 name-mangling scheme],
+ ac_cv_f77_mangling,
+ [
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_F77])
+
+ AC_LANG_SAVE
+ AC_LANG_FORTRAN77
+
+cat > conftest.$ac_ext <<EOF
+ subroutine foobar()
+ return
+ end
+ subroutine foo_bar()
+ return
+ end
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+
+ mv conftest.${ac_objext} cf77_test.${ac_objext}
+
+ AC_LANG_SAVE
+ AC_LANG_C
+
+ ac_save_LIBS="$LIBS"
+ LIBS="cf77_test.${ac_objext} $LIBS"
+
+ f77_case=
+ f77_underscore=
+
+ AC_TRY_LINK_FUNC(foobar,
+ f77_case=lower
+ f77_underscore=no
+ foo_bar=foo_bar_,
+ AC_TRY_LINK_FUNC(foobar_,
+ f77_case=lower
+ f77_underscore=single
+ foo_bar=foo_bar__,
+ AC_TRY_LINK_FUNC(FOOBAR,
+ f77_case=upper
+ f77_underscore=no
+ foo_bar=FOO_BAR_,
+ AC_TRY_LINK_FUNC(FOOBAR_,
+ f77_case=upper
+ f77_underscore=single
+ foo_bar=FOO_BAR__))))
+
+ AC_TRY_LINK_FUNC(${foo_bar}, f77_underscore=double)
+
+ if test x"$f77_case" = x -o x"$f77_underscore" = x; then
+ ac_cv_f77_mangling="unknown"
+ else
+ ac_cv_f77_mangling="$f77_case case, $f77_underscore underscores"
+ fi
+
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+
+ rm -f conftest*
+ rm -f cf77_test*
+
else
- ld_run_path="-R $ld_run_path"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
fi
- ;;
- *)
- ld_run_path=
- ;;
-esac
-dnl
-flibs=
-lflags=
-dnl
-dnl If want_arg is set, we know we want the arg to be added to the list,
-dnl so we don't have to examine it.
-dnl
-want_arg=
-dnl
-for arg in $foutput; do
- old_want_arg=$want_arg
- want_arg=
-dnl
-dnl None of the options that take arguments expect the argument to
-dnl start with a -, so pretend we didn't see anything special.
+
+dnl We need to pop the language stack twice.
+ AC_LANG_RESTORE
+ AC_LANG_RESTORE
+])])
+
+
+dnl Defines C macros F77_FUNC(name,NAME) and F77_FUNC_(name,NAME) to
+dnl properly mangle the names of C identifiers, and C identifiers with
+dnl underscores, respectively, so that they match the name mangling
+dnl scheme used by the Fortran 77 compiler.
dnl
- if test -n "$old_want_arg"; then
- case "$arg" in
- -*)
- old_want_arg=
- ;;
- esac
- fi
- case "$old_want_arg" in
- '')
- case $arg in
- /*.a)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- lflags="$lflags $arg"
- fi
- ;;
- -bI:*)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- if test "$ac_cv_prog_gcc" = yes; then
- lflags="$lflags -Xlinker $arg"
- else
- lflags="$lflags $arg"
- fi
- fi
- ;;
- -lang* | -lcrt0.o | -lc | -lgcc)
- arg=
- ;;
- -[lLR])
- want_arg=$arg
- arg=
- ;;
- -[lLR]*)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- case "$arg" in
- -lkernel32)
- case "$canonical_host_type" in
- *-*-cygwin*)
- arg=
- ;;
- *)
- lflags="$lflags $arg"
- ;;
- esac
- ;;
- -lm)
- ;;
- *)
- lflags="$lflags $arg"
- ;;
+dnl AC_F77_WRAPPERS()
+AC_DEFUN(AC_F77_WRAPPERS,
+[
+ AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+ ac_cv_f77_wrappers,
+ [
+dnl Be optimistic at first.
+ ac_cv_f77_wrappers="yes"
+
+ AC_REQUIRE([AC_F77_NAME_MANGLING])
+ case "$f77_case" in
+ lower)
+ case "$f77_underscore" in
+ no)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name])
+ ;;
+ single)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
+ ;;
+ double)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
+ ;;
+ *)
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
+ esac
+ ;;
+ upper)
+ case "$f77_underscore" in
+ no)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
+ ;;
+ single)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
+ ;;
+ double)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
+ ;;
+ *)
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
esac
- fi
- ;;
- -u)
- want_arg=$arg
- arg=
- ;;
- -Y)
- want_arg=$arg
- arg=
- ;;
+ ;;
*)
- arg=
- ;;
- esac
- ;;
- -[lLR])
- arg="$old_want_arg $arg"
- ;;
- -u)
- arg="-u $arg"
- ;;
- -Y)
-dnl
-dnl Should probably try to ensure unique directory options here too.
-dnl This probably only applies to Solaris systems, and then will only
-dnl work with gcc...
-dnl
- arg=`echo $arg | sed -e 's%^P,%%'`
- SAVE_IFS=$IFS
- IFS=:
- list=
- for elt in $arg; do
- list="$list -L$elt"
- done
- IFS=$SAVE_IFS
- arg="$list"
- ;;
- esac
-dnl
- if test -n "$arg"; then
- flibs="$flibs $arg"
- fi
-done
-if test -n "$ld_run_path"; then
- flibs_result="$ld_run_path $flibs"
-else
- flibs_result="$flibs"
-fi
-changequote([, ])dnl
-ac_cv_flibs="$flibs_result"])
-FLIBS="$ac_cv_flibs"
-AC_SUBST(FLIBS)dnl
-AC_MSG_RESULT($FLIBS)
-])
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
+ esac
+])])
dnl ### Checks for operating system services
@@ -2418,8 +2717,7 @@ interpval="$ac_cv_sys_interpreter"
])
define(AC_HAVE_POUNDBANG,
-[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments
-])m4exit(4)])
+[AC_FATAL([$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments], 4)])
AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
[AC_CACHE_CHECK(for long file names, ac_cv_sys_long_file_names,
@@ -2453,7 +2751,8 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
done])
if test $ac_cv_sys_long_file_names = yes; then
- AC_DEFINE(HAVE_LONG_FILE_NAMES)
+ AC_DEFINE(HAVE_LONG_FILE_NAMES, 1,
+ [Define if you support file names longer than 14 characters.])
fi
])
@@ -2476,7 +2775,9 @@ main () {
}
], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
if test $ac_cv_sys_restartable_syscalls = yes; then
- AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
+ AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS, 1,
+ [Define if system calls automatically restart after interruption
+ by a signal.])
fi
])
@@ -2693,7 +2994,8 @@ AC_DEFUN(AC_PATH_XTRA,
[AC_REQUIRE([AC_PATH_X])dnl
if test "$no_x" = yes; then
# Not all programs may use this symbol, but it does not hurt to define it.
- AC_DEFINE(X_DISPLAY_MISSING)
+ AC_DEFINE(X_DISPLAY_MISSING, 1,
+ [Define if the X Window System is missing or not being used.])
X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
if test -n "$x_includes"; then
@@ -2887,19 +3189,27 @@ AC_EGREP_CPP(yes,
[#ifdef _AIX
yes
#endif
-], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
-])
+],
+[AC_MSG_RESULT(yes)
+AC_DEFINE(_ALL_SOURCE)],
+AC_MSG_RESULT(no))
+])dnl AC_AIX
AC_DEFUN(AC_MINIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
if test "$MINIX" = yes; then
- AC_DEFINE(_POSIX_SOURCE)
- AC_DEFINE(_POSIX_1_SOURCE, 2)
- AC_DEFINE(_MINIX)
+ AC_DEFINE(_POSIX_SOURCE, 1,
+ [Define if you need to in order for `stat' and other things to
+ work.])
+ AC_DEFINE(_POSIX_1_SOURCE, 2,
+ [Define if the system does not provide POSIX.1 features except
+ with this defined.])
+ AC_DEFINE(_MINIX, 1,
+ [Define if on MINIX.])
fi
-])
+])dnl AC_MINIX
AC_DEFUN(AC_ISC_POSIX,
[AC_REQUIRE([AC_PROG_CC])dnl
@@ -2911,7 +3221,9 @@ if test -d /etc/conf/kconfig.d &&
then
AC_MSG_RESULT(yes)
ISC=yes # If later tests want to check for ISC.
- AC_DEFINE(_POSIX_SOURCE)
+ AC_DEFINE(_POSIX_SOURCE, 1,
+ [Define if you need to in order for stat and other things to
+ work.])
if test "$GCC" = yes; then
CC="$CC -posix"
else
@@ -2921,7 +3233,7 @@ else
AC_MSG_RESULT(no)
ISC=
fi
-])
+])dnl AC_ISC_POSIX
AC_DEFUN(AC_XENIX_DIR,
[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
@@ -2937,7 +3249,7 @@ if test "$XENIX" = yes; then
test $ac_header_dirent = dirent.h && LIBS="-ldir $LIBS"
LIBS="$LIBS -lx"
fi
-])
+])dnl AC_XENIX_DIR
AC_DEFUN(AC_DYNIX_SEQ,
[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl
diff --git a/autoheader.in b/autoheader.in
index f4cc22a6..403911a1 100644
--- a/autoheader.in
+++ b/autoheader.in
@@ -1,6 +1,6 @@
#! @SHELL@
# autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
given.
+ -d, --debug don't remove temporary files
-m, --macrodir=DIR directory storing macro files
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
-v, --verbose verbosely report processing
@@ -56,15 +57,27 @@ case "${M4}" in
test -f "${M4}" || M4=m4 ;;
esac
+# ac_LF_and_DOT
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
ac_LF_and_DOT="`echo; echo .`"
localdir=.
show_version=no
+debug=0
+# Basename for temporary files.
+ah_base=autoh$$
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}"; exit 0 ;;
+ -d | --debug | --d* )
+ debug=1; shift ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
@@ -101,8 +114,8 @@ if test $show_version = yes; then
exit 0
fi
-TEMPLATES="${AC_MACRODIR}/acconfig.h"
-test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
+acconfigs="${AC_MACRODIR}/acconfig.h"
+test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
case $# in
0) infile=configure.in ;;
@@ -116,6 +129,7 @@ types=
funcs=
headers=
libs=
+decls=
if test "$localdir" != .; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
@@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
esac
-# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
+# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
# modified autoconf processing of the input file. The sed hair is
# necessary to win for multi-line macro invocations.
-eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
- sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }'`"
+$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
+ sed -n -e '
+ : again
+ /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
+ /^@@@/{
+ s/^@@@//p
+ n
+ s/^/@@@/
+ b again
+ }' >$ah_base.decls
+. ./$ah_base.decls
+if test $debug -eq 0; then rm ./$ah_base.decls; fi
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
@@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
*) config_h_in="${config_h}.in" ;;
esac
-if test $# -eq 0; then
- tmpout=autoh$$
- trap "rm -f $tmpout; exit 1" 1 2 15
- exec > $tmpout
-fi
-
+tmpout=$ah_base.out
+if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-cat <<EOF
+cat <<EOF >$tmpout
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
EOF
-test -r ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
test -r $localdir/acconfig.h &&
grep @TOP@ $localdir/acconfig.h >/dev/null &&
- sed '/@TOP@/,$d' $localdir/acconfig.h
+ sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
# Make sure the boundary of template files is also the boundary
# of the paragraph. Extra newlines don't hurt since they will
# be removed.
- # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
+ # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
# is ignored in the systemwide acconfig.h too.
- for t in $TEMPLATES; do
+ for t in $acconfigs; do
sedscript=""
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
@@ -208,94 +220,55 @@ if test -n "$syms"; then
# Some fgrep's have limits on the number of lines that can be in the
# pattern on the command line, so use a temporary file containing the
# pattern.
- (fgrep_tmp=${TMPDIR-/tmp}/autoh$$
+ (fgrep_tmp=$ah_base.fgrep
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
cat > $fgrep_tmp <<EOF
$syms
EOF
fgrep -f $fgrep_tmp
rm -f $fgrep_tmp) |
- tr @. "$ac_LF_and_DOT"
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
+ tr @. "$ac_LF_and_DOT" >>$tmpout
fi
-echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
- test -z "$ctype" && continue
- sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
- echo "
-/* The number of bytes in a ${ctype}. */
-#undef SIZEOF_${sym}"
+for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
+ echo >>$tmpout
+ eval echo >>$tmpout '"${'$verb'}"'
done
-# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
-if test -n "$funcs"; then
- for func in `for x in $funcs; do echo $x; done | sort | uniq`; do
- sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${func} function. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$headers"; then
- for header in `for x in $headers; do echo $x; done | sort | uniq`; do
-
- sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the <${header}> header file. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$libs"; then
- for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
- sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${lib} library (-l${lib}). */
-#undef HAVE_LIB${sym}"
- done
-fi
-
-if test -n "$verbatim"; then
- echo "$verbatim"
-fi
-
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
test -r $localdir/acconfig.h &&
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
- sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
-test -f ${config_h}.bot && cat ${config_h}.bot
+ sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
+test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
+# Check that all the symbols have a template
status=0
if test -n "$syms"; then
for sym in $syms; do
- if fgrep $sym $TEMPLATES >/dev/null; then
+ if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
: # All is well.
else
- echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
+ echo "$0: No template for symbol \`${sym}'" >&2
status=1
fi
done
fi
-if test $# -eq 0; then
- # Force $tmpout to close to avoid Windows file sharing conflicts.
- exec 1>&2
- if test $status -eq 0; then
+# If the run was successful, output the result.
+if test $status -eq 0; then
+ if test $# -eq 0; then
+ # Output is a file
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
- rm -f $tmpout # File didn't change, so don't update its mod time.
+ : # File didn't change, so don't update its mod time.
else
mv -f $tmpout ${config_h_in}
fi
else
- rm -f $tmpout
+ # Output is stdout
+ cat $tmpout
fi
fi
+rm -f $tmpout
exit $status
diff --git a/autoheader.m4 b/autoheader.m4
index 342eec9d..503c8ba7 100644
--- a/autoheader.m4
+++ b/autoheader.m4
@@ -1,6 +1,6 @@
dnl Driver and redefinitions of some Autoconf macros for autoheader.
dnl This file is part of Autoconf.
-dnl Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -20,8 +20,9 @@ dnl
dnl Written by Roland McGrath.
dnl
include(acgeneral.m4)dnl
-builtin(include, acspecific.m4)dnl
-builtin(include, acoldnames.m4)dnl
+m4_include(acspecific.m4)dnl
+m4_include(acoldnames.m4)dnl
+
dnl These are alternate definitions of some macros, which produce
dnl strings in the output marked with "@@@" so we can easily extract
@@ -30,89 +31,153 @@ dnl each definition seems to be necessary to prevent m4 from eating
dnl the newline, which makes the @@@ not always be at the beginning of
dnl a line.
-define([AC_CHECK_FUNCS], [#
-@@@funcs="$funcs $1"@@@
-ifelse([$2], , , [
-# If it was found, we do:
-$2
-# If it was not found, we do:
+dnl AH_DEFINE(VARIABLE [, VALUE[, DESCRIPTION]])
+dnl --------------------------------------------
+dnl When running autoheader, this macro replaces AC_DEFINE and
+dnl AC_DEFINE_UNQUOTED.
+dnl
+dnl We remember the symbols we already defined to avoid to define
+dnl them twice. In the future we may want to use another program
+dnl than sh to issue the templates. For instance with AWK, we
+dnl may fill an associative array (key is $1, value is the template).
+dnl This garantees that there is a unique prototype issued, and also
+dnl that it will be sorted!
+define([AH_DEFINE],
+[ifset([$3],
+ [AH_TEMPLATE([$1], [$3])],
+ [#
+dnl Ignore CPP macro arguments.
+@@@syms="$syms patsubst($1, [(.*$])"@@@
+])])
+
+dnl AH_TEMPLATE(KEY, DESCRIPTION)
+dnl Issue an autoheader template for KEY, i.e., a comment composed
+dnl of DESCRIPTION (properly wrapped), and then #undef KEY.
+define([AH_TEMPLATE],
+[AH_VERBATIM([$1],
+ AC_WRAP(_AC_SH_QUOTE([[$2 */]]), [ ], [/* ])[
+#undef $1])])
+
+dnl AH_VERBATIM(KEY, TEMPLATE)
+dnl --------------------------
+dnl If KEY is direct (i.e., no indirection such as in KEY=$my_func which may
+dnl occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader TEMPLATE
+dnl associated to the KEY. Otherwise, do nothing.
+dnl TEMPLATE is output as is, with no formating.
+define([AH_VERBATIM],
+[AC_VAR_IF_INDIR([$1],,
+[#
+@@@
+ac_verbatim_$1="\
+[$2]"
+@@@
+])])
+
+define([AH_CHECK_LIB],
+[AH_TEMPLATE(AC_TR_CPP(HAVE_$1),
+ [Define if you have the `]$1[' library (-l]$1[).])
+# Success
$3
-])
-])
+# Failure
+$4])
-define([AC_CHECK_HEADERS], [#
-@@@headers="$headers $1"@@@
-ifelse([$2], , , [
-# If it was found, we do:
+define([AH_CHECK_HEADERS],
+[AC_FOREACH([AC_Header], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
+ [Define if you have the <]AC_Header[> header file.])
+# Success
$2
-# If it was not found, we do:
-$3
-])
-])
+# Failure
+$3])])
-define([AC_CHECK_HEADER], [AC_CHECK_HEADERS($1,$2,$3)])
+define([AH_NEED_DECLS],
+[AC_FOREACH([AC_Symbol], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(NEED_DECL_[]AC_Symbol),
+ [Define if you need the declaration of `]AC_Symbol['.])
+# Success
+$2
+# Failure
+$3])])
-define([AC_CHECK_HEADERS_DIRENT], [#
-@@@headers="$headers $1"@@@
-])
+define([AH_CHECK_FUNCS],
+[AC_FOREACH([AC_Func], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
+ [Define if you have the `]AC_Func[' function.])
+# Success
+$2
+# Failure
+$3])])
-define([AC_CHECK_LIB], [#
- ifelse([$3], , [
-@@@libs="$libs $1"@@@
-], [
-# If it was found, we do:
-$3
-# If it was not found, we do:
-$4
-])
-])
+define([AH_CHECK_SIZEOF],
+[AH_TEMPLATE(AC_TR_CPP(SIZEOF_$1),
+ [The number of bytes in a `]$1['.])])
-define([AC_HAVE_LIBRARY], [#
-changequote(<<, >>)dnl
-define(<<AC_LIB_NAME>>, dnl
-patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
-changequote([, ])dnl
- ifelse([$2], , [
-@@@libs="$libs AC_LIB_NAME"@@@
-], [
-# If it was found, we do:
-$2
-# If it was not found, we do:
-$3
-])
-])
+define([AH_PROG_LEX],
+[AH_CHECK_LIB(fl)
+AH_CHECK_LIB(l)])
+
+define([AC_FUNC_ALLOCA],
+[AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+])])
+
+define([AC_C_CHAR_UNSIGNED],
+[AH_VERBATIM([__CHAR_UNSIGNED__],
+[/* Define if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif])])
+
+define([AH_AIX],
+[AH_VERBATIM([_ALL_SOURCE],
+[/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif])])
+
+
+define([AH_F77_WRAPPERS],
+[AH_TEMPLATE([F77_FUNC],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does not* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])
+AH_TEMPLATE([F77_FUNC_],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])])
-define([AC_CHECK_SIZEOF], [#
-@@@types="$types,$1"@@@
-])
define([AC_CONFIG_HEADER], [#
define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl
@@@config_h=AC_CONFIG_H@@@
])
-define([AC_DEFINE], [#
-ifelse([$3],,[#
-@@@syms="$syms $1"@@@
-], [#
-@@@verbatim="$verbatim
-/* $3 */
-#undef $1
-"@@@
-])])
-
-define([AC_DEFINE_UNQUOTED], [#
-ifelse([$3],,[#
-@@@syms="$syms $1"@@@
-], [#
-@@@verbatim="$verbatim
-/* $3 */
-#undef $1
-"@@@
-])])
-
-dnl Autoheader is not the right program to complain about cross-compiling
+dnl Autoheader is not the right program to complain about cross-compiling.
define([AC_TRY_RUN], [
$2
$3
$4])
+
+define([AC_DEFINE], [AH_DEFINE($@)])
+define([AC_DEFINE_UNQUOTED], [AH_DEFINE($@)])
+define([AC_NEED_DECLS], [AH_NEED_DECLS($@)])
+define([AC_CHECK_SIZEOF], [AH_CHECK_SIZEOF($@)])
+define([AC_CHECK_FUNCS], [AH_CHECK_FUNCS($@)])
+define([AC_CHECK_HEADERS], [AH_CHECK_HEADERS($@)])
+define([AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS($@)])
+define([AC_CHECK_LIB], [AH_CHECK_LIB($@)])
+define([AC_PROG_LEX], [AH_PROG_LEX($@)])
+define([AC_FUNC_ALLOCA], [AH_FUNC_ALLOCA($@)])
+define([AC_C_CHAR_UNSIGNED], [AH_C_CHAR_UNSIGNED($@)])
+define([AC_AIX], [AH_AIX($@)])
+define([AC_F77_WRAPPERS], [AH_F77_WRAPPERS($@)])
diff --git a/autoheader.sh b/autoheader.sh
index f4cc22a6..403911a1 100644
--- a/autoheader.sh
+++ b/autoheader.sh
@@ -1,6 +1,6 @@
#! @SHELL@
# autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
given.
+ -d, --debug don't remove temporary files
-m, --macrodir=DIR directory storing macro files
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
-v, --verbose verbosely report processing
@@ -56,15 +57,27 @@ case "${M4}" in
test -f "${M4}" || M4=m4 ;;
esac
+# ac_LF_and_DOT
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
ac_LF_and_DOT="`echo; echo .`"
localdir=.
show_version=no
+debug=0
+# Basename for temporary files.
+ah_base=autoh$$
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}"; exit 0 ;;
+ -d | --debug | --d* )
+ debug=1; shift ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
@@ -101,8 +114,8 @@ if test $show_version = yes; then
exit 0
fi
-TEMPLATES="${AC_MACRODIR}/acconfig.h"
-test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
+acconfigs="${AC_MACRODIR}/acconfig.h"
+test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
case $# in
0) infile=configure.in ;;
@@ -116,6 +129,7 @@ types=
funcs=
headers=
libs=
+decls=
if test "$localdir" != .; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
@@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
esac
-# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
+# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
# modified autoconf processing of the input file. The sed hair is
# necessary to win for multi-line macro invocations.
-eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
- sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }'`"
+$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
+ sed -n -e '
+ : again
+ /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
+ /^@@@/{
+ s/^@@@//p
+ n
+ s/^/@@@/
+ b again
+ }' >$ah_base.decls
+. ./$ah_base.decls
+if test $debug -eq 0; then rm ./$ah_base.decls; fi
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
@@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
*) config_h_in="${config_h}.in" ;;
esac
-if test $# -eq 0; then
- tmpout=autoh$$
- trap "rm -f $tmpout; exit 1" 1 2 15
- exec > $tmpout
-fi
-
+tmpout=$ah_base.out
+if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-cat <<EOF
+cat <<EOF >$tmpout
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
EOF
-test -r ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
test -r $localdir/acconfig.h &&
grep @TOP@ $localdir/acconfig.h >/dev/null &&
- sed '/@TOP@/,$d' $localdir/acconfig.h
+ sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
# Make sure the boundary of template files is also the boundary
# of the paragraph. Extra newlines don't hurt since they will
# be removed.
- # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
+ # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
# is ignored in the systemwide acconfig.h too.
- for t in $TEMPLATES; do
+ for t in $acconfigs; do
sedscript=""
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
@@ -208,94 +220,55 @@ if test -n "$syms"; then
# Some fgrep's have limits on the number of lines that can be in the
# pattern on the command line, so use a temporary file containing the
# pattern.
- (fgrep_tmp=${TMPDIR-/tmp}/autoh$$
+ (fgrep_tmp=$ah_base.fgrep
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
cat > $fgrep_tmp <<EOF
$syms
EOF
fgrep -f $fgrep_tmp
rm -f $fgrep_tmp) |
- tr @. "$ac_LF_and_DOT"
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
+ tr @. "$ac_LF_and_DOT" >>$tmpout
fi
-echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
- test -z "$ctype" && continue
- sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
- echo "
-/* The number of bytes in a ${ctype}. */
-#undef SIZEOF_${sym}"
+for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
+ echo >>$tmpout
+ eval echo >>$tmpout '"${'$verb'}"'
done
-# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
-if test -n "$funcs"; then
- for func in `for x in $funcs; do echo $x; done | sort | uniq`; do
- sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${func} function. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$headers"; then
- for header in `for x in $headers; do echo $x; done | sort | uniq`; do
-
- sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the <${header}> header file. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$libs"; then
- for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
- sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${lib} library (-l${lib}). */
-#undef HAVE_LIB${sym}"
- done
-fi
-
-if test -n "$verbatim"; then
- echo "$verbatim"
-fi
-
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
test -r $localdir/acconfig.h &&
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
- sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
-test -f ${config_h}.bot && cat ${config_h}.bot
+ sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
+test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
+# Check that all the symbols have a template
status=0
if test -n "$syms"; then
for sym in $syms; do
- if fgrep $sym $TEMPLATES >/dev/null; then
+ if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
: # All is well.
else
- echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
+ echo "$0: No template for symbol \`${sym}'" >&2
status=1
fi
done
fi
-if test $# -eq 0; then
- # Force $tmpout to close to avoid Windows file sharing conflicts.
- exec 1>&2
- if test $status -eq 0; then
+# If the run was successful, output the result.
+if test $status -eq 0; then
+ if test $# -eq 0; then
+ # Output is a file
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
- rm -f $tmpout # File didn't change, so don't update its mod time.
+ : # File didn't change, so don't update its mod time.
else
mv -f $tmpout ${config_h_in}
fi
else
- rm -f $tmpout
+ # Output is stdout
+ cat $tmpout
fi
fi
+rm -f $tmpout
exit $status
diff --git a/bin/autoheader.in b/bin/autoheader.in
index f4cc22a6..403911a1 100644
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -1,6 +1,6 @@
#! @SHELL@
# autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
given.
+ -d, --debug don't remove temporary files
-m, --macrodir=DIR directory storing macro files
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
-v, --verbose verbosely report processing
@@ -56,15 +57,27 @@ case "${M4}" in
test -f "${M4}" || M4=m4 ;;
esac
+# ac_LF_and_DOT
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
ac_LF_and_DOT="`echo; echo .`"
localdir=.
show_version=no
+debug=0
+# Basename for temporary files.
+ah_base=autoh$$
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}"; exit 0 ;;
+ -d | --debug | --d* )
+ debug=1; shift ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
@@ -101,8 +114,8 @@ if test $show_version = yes; then
exit 0
fi
-TEMPLATES="${AC_MACRODIR}/acconfig.h"
-test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
+acconfigs="${AC_MACRODIR}/acconfig.h"
+test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
case $# in
0) infile=configure.in ;;
@@ -116,6 +129,7 @@ types=
funcs=
headers=
libs=
+decls=
if test "$localdir" != .; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
@@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
esac
-# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
+# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
# modified autoconf processing of the input file. The sed hair is
# necessary to win for multi-line macro invocations.
-eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
- sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }'`"
+$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
+ sed -n -e '
+ : again
+ /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
+ /^@@@/{
+ s/^@@@//p
+ n
+ s/^/@@@/
+ b again
+ }' >$ah_base.decls
+. ./$ah_base.decls
+if test $debug -eq 0; then rm ./$ah_base.decls; fi
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
@@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
*) config_h_in="${config_h}.in" ;;
esac
-if test $# -eq 0; then
- tmpout=autoh$$
- trap "rm -f $tmpout; exit 1" 1 2 15
- exec > $tmpout
-fi
-
+tmpout=$ah_base.out
+if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-cat <<EOF
+cat <<EOF >$tmpout
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
EOF
-test -r ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
test -r $localdir/acconfig.h &&
grep @TOP@ $localdir/acconfig.h >/dev/null &&
- sed '/@TOP@/,$d' $localdir/acconfig.h
+ sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
# Make sure the boundary of template files is also the boundary
# of the paragraph. Extra newlines don't hurt since they will
# be removed.
- # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
+ # Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
# is ignored in the systemwide acconfig.h too.
- for t in $TEMPLATES; do
+ for t in $acconfigs; do
sedscript=""
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
@@ -208,94 +220,55 @@ if test -n "$syms"; then
# Some fgrep's have limits on the number of lines that can be in the
# pattern on the command line, so use a temporary file containing the
# pattern.
- (fgrep_tmp=${TMPDIR-/tmp}/autoh$$
+ (fgrep_tmp=$ah_base.fgrep
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
cat > $fgrep_tmp <<EOF
$syms
EOF
fgrep -f $fgrep_tmp
rm -f $fgrep_tmp) |
- tr @. "$ac_LF_and_DOT"
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
+ tr @. "$ac_LF_and_DOT" >>$tmpout
fi
-echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
- test -z "$ctype" && continue
- sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
- echo "
-/* The number of bytes in a ${ctype}. */
-#undef SIZEOF_${sym}"
+for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
+ echo >>$tmpout
+ eval echo >>$tmpout '"${'$verb'}"'
done
-# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
-if test -n "$funcs"; then
- for func in `for x in $funcs; do echo $x; done | sort | uniq`; do
- sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${func} function. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$headers"; then
- for header in `for x in $headers; do echo $x; done | sort | uniq`; do
-
- sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the <${header}> header file. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$libs"; then
- for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
- sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "
-/* Define if you have the ${lib} library (-l${lib}). */
-#undef HAVE_LIB${sym}"
- done
-fi
-
-if test -n "$verbatim"; then
- echo "$verbatim"
-fi
-
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
test -r $localdir/acconfig.h &&
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
- sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
-test -f ${config_h}.bot && cat ${config_h}.bot
+ sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
+test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
+# Check that all the symbols have a template
status=0
if test -n "$syms"; then
for sym in $syms; do
- if fgrep $sym $TEMPLATES >/dev/null; then
+ if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
: # All is well.
else
- echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
+ echo "$0: No template for symbol \`${sym}'" >&2
status=1
fi
done
fi
-if test $# -eq 0; then
- # Force $tmpout to close to avoid Windows file sharing conflicts.
- exec 1>&2
- if test $status -eq 0; then
+# If the run was successful, output the result.
+if test $status -eq 0; then
+ if test $# -eq 0; then
+ # Output is a file
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
- rm -f $tmpout # File didn't change, so don't update its mod time.
+ : # File didn't change, so don't update its mod time.
else
mv -f $tmpout ${config_h_in}
fi
else
- rm -f $tmpout
+ # Output is stdout
+ cat $tmpout
fi
fi
+rm -f $tmpout
exit $status
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 2dc2f279..94ed89a1 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
@@ -74,6 +74,228 @@ m4_prefix([shift])
m4_prefix([format])
+dnl ------------------------------------------------------------
+dnl Text processing in m4.
+dnl ------------------------------------------------------------
+
+dnl m4_quote(STRING)
+dnl ----------------
+dnl Return STRING quoted.
+dnl
+dnl It is important to realize the difference between `quote(exp)' and
+dnl `[exp]': in the first case you obtain the quoted *result* of the
+dnl expansion of EXP, while in the latter you just obtain the string
+dnl `exp'.
+define([m4_quote], [[$@]])
+
+
+dnl m4_split(STRING, [REGEXP])
+dnl --------------------------
+dnl Split STRING into an m4 list of quoted elements. The elements are
+dnl quoted with [ and ]. Beginning spaces and end spaces *are kept*.
+dnl Use m4_strip to remove them.
+dnl
+dnl REGEXP specifies where to split. Default is [\t ]+.
+dnl
+dnl Pay attention to the changequotes. Inner changequotes exist for
+dnl obvious reasons (we want to insert square brackets). Outer
+dnl changequotes are needed because otherwise the m4 parser, when it
+dnl sees the closing bracket we add to the result, believes it is the
+dnl end of the body of the macro we define.
+dnl
+dnl Also, notice that $1 is quoted twice, since we want the result to be
+dnl quoted. Then you should understand that the argument of patsubst is
+dnl ``STRING'' (i.e., with additional `` and '').
+dnl
+dnl This macro is safe on active symbols, i.e.:
+dnl define(active, ACTIVE)
+dnl m4_split([active active ])end
+dnl => [active], [active], []end
+changequote(<<, >>)
+define(<<m4_split>>,
+<<changequote(``, '')dnl
+[dnl Can't use m4_default here instead of ifelse, because m4_default uses
+dnl [ and ] as quotes.
+patsubst(````$1'''',
+ ifelse(``$2'',, ``[ ]+'', ``$2''),
+ ``], ['')]dnl
+changequote([, ])>>)
+changequote([, ])
+
+
+dnl m4_join(STRING)
+dnl ---------------
+dnl If STRING contains end of lines, replace them with spaces. If there
+dnl are backslashed end of lines, remove them. This macro is safe with
+dnl active symbols.
+dnl define(active, ACTIVE)
+dnl m4_join([active
+dnl act\
+dnl ive])end
+dnl => active activeend
+define([m4_join],
+[translit(patsubst([[[$1]]], [\\
+]), [
+], [ ])])
+
+
+dnl m4_strip(STRING)
+dnl ----------------
+dnl Expands into STRING with tabs and spaces singled out into a single
+dnl space, and removing leading and trailing spaces.
+dnl
+dnl This macro is robust to active symbols.
+dnl define(active, ACTIVE)
+dnl m4_strip([ active active ])end
+dnl => active activeend
+dnl
+dnl This macro is fun! Because we want to preserve active symbols, STRING
+dnl must be quoted for each evaluation, which explains there are 4 levels
+dnl of brackets around $1 (don't forget that the result must be quoted
+dnl too, hence one more quoting than applications).
+dnl
+dnl Then notice the patsubst of the middle: it is in charge of removing
+dnl the leading space. Why not just `patsubst(..., [^ ])'? Because this
+dnl macro will receive the output of the preceding patsubst, i.e. more or
+dnl less [[STRING]]. So if there is a leading space in STRING, then it is
+dnl the *third* character, since there are two leading `['; Equally for
+dnl the outer patsubst.
+define([m4_strip],
+[patsubst(patsubst(patsubst([[[[$1]]]],
+ [[ ]+], [ ]),
+ [^\(..\) ], [\1]),
+ [ \(.\)$], [\1])])
+
+
+dnl ------------------------------------------------------------
+dnl Some additional m4 structural control.
+dnl ------------------------------------------------------------
+
+
+dnl ifset(COND, IF-TRUE[, IF-FALSE])
+dnl --------------------------------
+dnl If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
+dnl Comparable to ifdef.
+define([ifset], [ifelse([$1],,[$3],[$2])])
+
+
+dnl m4_default(EXP1, EXP2)
+dnl ----------------------
+dnl Returns EXP1 if non empty, otherwise EXP2.
+define([m4_default], [ifset([$1], [$1], [$2])])
+
+
+dnl ### Implementing m4 loops
+
+dnl Implementing loops (`foreach' loops) in m4 is much more tricky than it
+dnl may seem. Actually, the example of a `foreach' loop in the m4
+dnl documentation is wrong: it does not quote the arguments properly,
+dnl which leads to undesired expansions.
+dnl
+dnl The example in the documentation is:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach',
+dnl | `pushdef(`$1', `')_foreach(`$1', `$2', `$3')popdef(`$1')')
+dnl | define(`_arg1', `$1')
+dnl | define(`_foreach',
+dnl | `ifelse(`$2', `()', ,
+dnl | `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2), `$3')')')
+dnl
+dnl But then if you run
+dnl
+dnl | define(a, 1)
+dnl | define(b, 2)
+dnl | define(c, 3)
+dnl | foreach(`f', `(`a', `(b', `c)')', `echo f
+dnl | ')
+dnl
+dnl it gives
+dnl
+dnl => echo 1
+dnl => echo (2,3)
+dnl
+dnl which is not what is expected.
+dnl
+dnl Once you understood this, you turn yourself into a quoting wizard,
+dnl and come up with the following solution:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach', `pushdef(`$1', `')_foreach($@)popdef(`$1')')
+dnl | define(`_arg1', ``$1'')
+dnl | define(`_foreach',
+dnl | `ifelse($2, `()', ,
+dnl | `define(`$1', `_arg1$2')$3`'_foreach(`$1', `(shift$2)', `$3')')')
+dnl
+dnl which this time answers
+dnl
+dnl => echo a
+dnl => echo (b
+dnl => echo c)
+dnl
+dnl Bingo!
+
+
+dnl M4_FOREACH(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------
+dnl Expand EXPRESSION assigning to VARIABLE each value of the LIST
+dnl (LIST should have the form `[(item_1, item_2, ..., item_n)]'),
+dnl i.e. the whole list should be *quoted*. Quote members too if
+dnl you don't want them to be expanded.
+dnl
+dnl This macro is robust to active symbols:
+dnl define(active, ACTIVE)
+dnl m4_foreach([Var], [([active], [b], [active])], [-Var-])end
+dnl => -active--b--active-end
+define(m4_foreach,
+[pushdef([$1], [])_m4_foreach($@)popdef([$1])])
+
+dnl Low level macros used to define m4_foreach
+define(m4_car, [[$1]])
+define(_m4_foreach,
+[ifelse($2, [()], ,
+ [define([$1], [m4_car$2])$3[]_m4_foreach([$1],
+ [(m4_shift$2)],
+ [$3])])])
+
+
+dnl m4_list_append(LIST, ELEMENT)
+dnl -----------------------------
+dnl Insert ELEMENT at the end of LIST.
+dnl
+dnl This macro is picky on its input, especially for the empty list: it
+dnl must be either the empty string, or exactly `()' (no spaces allowed).
+dnl This macro is actually purely textual: it basically replaces the
+dnl closing paren of LIST with `, ELEMENT)'. The hair is to preserve
+dnl quotation: this macro is robust to active symbols.
+dnl
+dnl | define(active, ACTIVE)
+dnl | m4_list_append(m4_list_append(m4_list_append((), [1 active]),
+dnl | [2 active]),
+dnl | [3 active])end
+dnl =>(1 active, 2 active, 3 active)end
+dnl
+dnl The combination of this macro and m4_quote is extremely useful to
+dnl build and store lists:
+dnl
+dnl | define(active, ACTIVE)
+dnl | define(list, ())
+dnl | define([list], m4_quote(m4_list_append(list, [1 active])))
+dnl | define([list], m4_quote(m4_list_append(list, [2 active])))
+dnl | define([list], m4_quote(m4_list_append(list, [3 active])))
+dnl | list
+dnl =>(1 active, 2 active, 3 active)
+dnl
+define([m4_list_append],
+[ifelse([$1], [], [([$2])],
+ [$1], [()], [([$2])],
+ [patsubst([[$1]], [^..\(.*\)..$], [[(\1, $2)]])])])
+
+
+define([m4_list_add],
+[define([$1], m4_quote(m4_list_append($1, [$2])))])
+
+
dnl ### Defining macros
@@ -81,7 +303,8 @@ dnl m4 output diversions. We let m4 output them all in order at the end,
dnl except that we explicitly undivert AC_DIVERSION_SED, AC_DIVERSION_CMDS,
dnl and AC_DIVERSION_ICMDS.
-dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line
+define(AC_DIVERSION_KILL, -1)dnl suppress output
+define(AC_DIVERSION_BINSH, 0)dnl AC_REQUIRE'd #! /bin/sh line
define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings
define(AC_DIVERSION_INIT, 2)dnl initialization code
define(AC_DIVERSION_NORMAL_4, 3)dnl AC_REQUIRE'd code, 4 level deep
@@ -109,15 +332,15 @@ divert(AC_DIVERSION_CURRENT)dnl
dnl Initialize the diversion setup.
define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL)
-dnl This will be popped by AC_REQUIRE in AC_INIT.
-pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE)
+dnl Throw away output until AC_INIT is called.
+pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_KILL)
dnl The prologue for Autoconf macros.
dnl AC_PRO(MACRO-NAME)
define(AC_PRO,
[define([AC_PROVIDE_$1], )dnl
ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
+[AC_DIVERT_PUSH(m4_eval(AC_DIVERSION_CURRENT - 1))],
[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
])
@@ -133,6 +356,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,
@@ -141,25 +366,385 @@ 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-FUNCTION 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 ### Some /bin/sh idioms
+
+dnl AC_SHELL_IFELSE(TEST[, IF-TRUE[, IF-FALSE]])
+dnl -------------------------------------------
+dnl Expand into
+dnl | if TEST; then
+dnl | IF-TRUE;
+dnl | else
+dnl | IF-FALSE
+dnl | fi
+dnl with simplifications is IF-TRUE and/or IF-FALSE is empty.
+define([AC_SHELL_IFELSE],
+[ifset([$2$3],
+[if [$1]; then
+ ifset([$2], [$2], :)
+ifset([$3],
+[else
+ $3
+])dnl
+fi
+])])
+
+dnl ### Common m4/sh handling of variables (indirections)
+
+
+dnl The purpose of this section is to provide a uniform API for
+dnl reading/setting sh variables with or without indirection.
+dnl Typically, one can write
+dnl AC_VAR_SET(var, val)
+dnl or
+dnl AC_VAR_SET(ac_$var, val)
+dnl and expect the right thing to happen.
+
+dnl AC_VAR_IF_INDIR(EXPRESSION, IF-INDIR, IF-NOT-INDIR)
+dnl If EXPRESSION has shell indirections ($var or `expr`), expand
+dnl IF-INDIR, else IF-NOT-INDIR.
+define(AC_VAR_IF_INDIR,
+[ifelse(regexp([$1], [[`$]]),
+ -1, [$3],
+ [$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])])
+
+
+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 '${'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. Should be dnl'ed.
+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,
+[AC_SHELL_IFELSE(AC_VAR_TEST_SET([$1]), [$2], [$3])])
+
+
+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
+
+dnl The point of this section is to provide high level functions
+dnl comparable to m4's `translit' primitive, but with the following
+dnl features:
+dnl - hiding portability issues
+dnl tr cannot be used in some cases, because all the tr in this world
+dnl don't behave the same way. In particular there is no portable
+dnl behavior of tr wrt the character `-'. Sed has to be used in these
+dnl cases.
+dnl - m4/sh polymorphism
+dnl Transliteration of manifest strings should be handled by m4, while
+dnl shell variables' content will be translated at runtime (tr or sed).
+
+dnl AC_TR(STRING, FROM, TO, ALPHABET, DEFAULT)
+dnl ------------------------------------------
+dnl Perform tr 'FROM' 'TO' on STRING by m4 when possible, otherwise
+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 appearance 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.
+dnl define(AC_TR,
+dnl [ifelse(regexp([$2$3], [%]), -1,,
+dnl [AC_FATAL([$0: `%' cannot be used. Change the definition of $0])])dnl
+dnl ifelse(regexp([$2], [-]), -1,, len([$2]),,
+dnl [AC_FATAL([$0: `-' cannot be used but in the last position.])])dnl
+dnl ifelse(len([$2]), len([$3]),,
+dnl [AC_FATAL([$0: argument 2 and 3 should have the same length])])dnl
+dnl AC_VAR_IF_INDIR([$1],
+dnl [`echo "$1" | sed 'y%$2%$3%;s%[^$4]%$5%g'`],
+dnl [patsubst(translit([$1], [$2], [$3]),
+dnl [[^$4]], [$5])])])
+
+dnl AC_TR_CPP(EXPRESSION)
+dnl ---------------------
+dnl Map EXPRESSION to an upper case string which is valid as rhs for a
+dnl `#define'. sh/m4 polymorphic. Make sure to update the definition
+dnl of `$ac_tr_cpp' if you change this.
+define(AC_TR_CPP,
+[AC_VAR_IF_INDIR([$1],
+ [`echo "$1" | $ac_tr_cpp`],
+ [patsubst(translit([[$1]],
+ [*abcdefghijklmnopqrstuvwxyz],
+ [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+ [[^A-Z0-9_]], [_])])])
+
+
+dnl AC_TR_SH(EXPRESSION)
+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_], [_])
+dnl Make sure to update the definition of `$ac_tr_cpp' if you change this.
+define(AC_TR_SH,
+[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(VARIABLE, LIST, EXPRESSION)
+dnl --------------------------------------
+dnl
+dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST.
+dnl LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2
+dnl ... item_n ': white spaces are separators, and leading and trailing
+dnl spaces are meaningless.
+dnl
+dnl This macro is robust to active symbols:
+dnl AC_FOREACH([Var], [ active
+dnl b act\
+dnl ive ], [-Var-])end
+dnl => -active--b--active-end
+define([AC_FOREACH],
+[m4_foreach([$1], (m4_split(m4_strip(m4_join([$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 ## --------------------------------- ##
+dnl ## Helping macros to display strings ##
+dnl ## --------------------------------- ##
+
+
+dnl AC_WRAP(STRING [, PREFIX[, FIRST-PREFIX[, WIDTH]]]]))
+dnl -----------------------------------------------------
+dnl Expands into STRING wrapped to hold in WIDTH columns (default = 79).
+dnl If prefix is set, each line is prefixed with it. If FIRST-PREFIX is
+dnl specified, then the first line is prefixed with it. As a special
+dnl case, if the length of the first prefix is greater than that of
+dnl PREFIX, then FIRST-PREFIX will be left alone on the first line.
+dnl
+dnl Typical outputs are:
+dnl
+dnl AC_WRAP([Short string */], [ ], [/* ], 20)
+dnl => /* Short string */
+dnl
+dnl AC_WRAP([Much longer string */], [ ], [/* ], 20)
+dnl => /* Much longer
+dnl => string */
+dnl
+dnl AC_WRAP([Short doc.], [ ], [ --short ], 30)
+dnl => --short Short doc.
+dnl
+dnl AC_WRAP([Short doc.], [ ], [ --too-wide ], 30)
+dnl => --too-wide
+dnl => Short doc.
+dnl
+dnl AC_WRAP([Super long documentation.], [ ], [ --too-wide ], 30)
+dnl => --too-wide
+dnl => Super long
+dnl => documentation.
+dnl
+dnl FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+dnl we really want to bother with people trying each single corner
+dnl of a software?
+dnl
+dnl This macro does not leave a trailing space behind the last word,
+dnl what complicates it a bit. The algorithm is stupid simple: all the
+dnl words are preceded by AC_Separator which is defined to empty for the
+dnl first word, and then ` ' (single space) for all the others.
+define([AC_WRAP],
+[pushdef([AC_Prefix], m4_default([$2], []))dnl
+pushdef([AC_Prefix1], m4_default([$3], [AC_Prefix]))dnl
+pushdef([AC_Width], m4_default([$4], 79))dnl
+pushdef([AC_Cursor], len(AC_Prefix1))dnl
+pushdef([AC_Separator], [])dnl
+AC_Prefix1[]dnl
+ifelse(m4_eval(AC_Cursor > len(AC_Prefix)),
+ 1, [define([AC_Cursor], len(AC_Prefix))
+AC_Prefix])[]dnl
+AC_FOREACH([AC_Word], [$1],
+[define([AC_Cursor], m4_eval(AC_Cursor + len(AC_Word) + 1))dnl
+dnl New line if too long, else insert a space unless it is the first
+dnl of the words.
+ifelse(m4_eval(AC_Cursor > AC_Width),
+ 1, [define([AC_Cursor], m4_eval(len(AC_Prefix) + len(AC_Word) + 1))]
+AC_Prefix,
+ [AC_Separator])[]dnl
+AC_Word[]dnl
+define([AC_Separator], [ ])])dnl
+popdef([AC_Separator])dnl
+popdef([AC_Cursor])dnl
+popdef([AC_Width])dnl
+popdef([AC_Prefix1])dnl
+popdef([AC_Prefix])dnl
+])
+
+
+dnl AC_HELP_STRING(LHS, RHS[, COLUMN])
+dnl ----------------------------------
+dnl
+dnl Format an Autoconf macro's help string so that it looks pretty when
+dnl the user executes "configure --help". This macro takes three
+dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
+dnl the COLUMN which is a string of white spaces which leads to the
+dnl the RHS column (default: 26 white spaces).
+dnl
+dnl The resulting string is suitable for use in other macros that require
+dnl a help string (e.g. AC_ARG_WITH).
+dnl
+dnl Here is the sample string from the Autoconf manual (Node: External
+dnl Software) which shows the proper spacing for help strings.
+dnl
+dnl --with-readline support fancy command line editing
+dnl ^ ^ ^
+dnl | | |
+dnl | column 2 column 26
+dnl |
+dnl column 0
+dnl
+dnl A help string is made up of a "left hand side" (LHS) and a "right
+dnl hand side" (RHS). In the example above, the LHS is
+dnl "--with-readline", while the RHS is "support fancy command line
+dnl editing".
+dnl
+dnl If the LHS extends past column 24, then the LHS is terminated with a
+dnl newline so that the RHS is on a line of its own beginning in column
+dnl 26.
+dnl
+dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
+dnl then the AC_HELP_STRING macro would expand into:
+dnl
+dnl
+dnl --with-readline-blah-blah-blah
+dnl ^ ^ support fancy command line editing
+dnl | | ^
+dnl | column 2 |
+dnl column 0 column 26
+dnl
+define([AC_HELP_STRING],
+[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
+pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+AC_WRAP([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
+popdef([AC_Prefix_Format])dnl
+popdef([AC_Prefix])dnl
+])
+
dnl ### Initialization
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.
+# Generated automatically using Autoconf version] AC_ACVERSION [
+# 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.
# Defaults:
-ac_help=
+ac_arg_with_help=
+ac_arg_enable_help=
+ac_arg_var_help=
ac_default_prefix=/usr/local
[#] Any additions from configure.in:])
@@ -217,6 +802,11 @@ 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 and CPP variable names.
+changequote(, )dnl
+ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g'
+ac_tr_cpp='sed -e y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g'
+changequote([, ])dnl
ac_prev=
for ac_option
@@ -264,10 +854,10 @@ changequote([, ])dnl
datadir="$ac_optarg" ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`echo "$ac_option"|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ if test -n "`echo "$ac_feature"| sed 's/[-a-zA-Z0-9_]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_feature: invalid feature name)
fi
@@ -275,16 +865,16 @@ changequote([, ])dnl
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`echo "$ac_option"|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ if test -n "`echo "$ac_feature"| sed 's/[-_a-zA-Z0-9]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_feature: invalid feature name)
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
- *=*) ;;
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
@@ -305,16 +895,25 @@ changequote([, ])dnl
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
changequote(, )dnl
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
+ cat << \EOF
+`configure' configures software source code packages to adapt to many kinds
+of systems.
+
+Usage: configure [OPTION]... [VAR=VALUE]... [HOST]
+
+To safely assign special values to environment variables (e.g., CC,
+CFLAGS...), give to `configure' the definition as VAR=VALUE.
+
+Defaults for the options are specified in brackets.
+
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
+
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -335,16 +934,20 @@ Directory and file names:
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
+
+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
+
EOF
- cat << EOF
+ cat << \EOF
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
+
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
@@ -352,11 +955,16 @@ Features and packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
-changequote([, ])dnl
EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
+changequote([, ])dnl
+dnl It would be great to sort, unfortunately, since each entry maybe
+dnl split on several lines, it is not as evident as a simple `| sort'.
+ test -n "$ac_arg_enable_help" && echo "
+--enable options recognized:$ac_arg_enable_help"
+ test -n "$ac_arg_with_help" && echo "
+--with options recognized:$ac_arg_with_help"
+ test -n "$ac_arg_var_help" && echo "
+Some of the influent environment variables:$ac_arg_var_help"
exit 0 ;;
-host | --host | --hos | --ho)
@@ -510,25 +1118,25 @@ EOF
exit 0 ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`echo "$ac_option"|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ if test -n "`echo "$ac_package"| sed 's/[-_a-zA-Z0-9]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_package: invalid package name)
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
- *=*) ;;
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`echo "$ac_option"|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ if test -n "`echo "$ac_package"| sed 's/[-a-zA-Z0-9_]//g'`"; then
changequote([, ])dnl
AC_MSG_ERROR($ac_package: invalid package name)
fi
@@ -556,9 +1164,20 @@ changequote([, ])dnl
-*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
;;
+ *=*)
+ ac_envvar=`echo $ac_option|sed -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+changequote(, )dnl
+ if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+ AC_MSG_ERROR($ac_envvar: invalid variable name)
+ fi
+ eval "${ac_envvar}='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
changequote(, )dnl
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ if test -n "`echo "$ac_option"| sed 's/[-a-z0-9.]//g'`"; then
changequote([, ])dnl
AC_MSG_WARN($ac_option: invalid host type)
fi
@@ -580,15 +1199,21 @@ dnl Try to have only one #! line, so the script doesn't look funny
dnl for users of AC_REVISION.
dnl AC_INIT_BINSH()
AC_DEFUN(AC_INIT_BINSH,
-[#! /bin/sh
+[AC_DIVERT_PUSH(AC_DIVERSION_BINSH)dnl
+#! /bin/sh
+AC_DIVERT_POP()dnl to KILL
])
dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
+dnl ----------------------------------
+dnl Output the preamble of the `configure' script.
AC_DEFUN(AC_INIT,
[sinclude(acsite.m4)dnl
sinclude(./aclocal.m4)dnl
AC_REQUIRE([AC_INIT_BINSH])dnl
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
AC_INIT_NOTICE
+AC_DIVERT_POP()dnl to KILL
AC_DIVERT_POP()dnl to NORMAL
AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
AC_INIT_PARSE_ARGS
@@ -596,7 +1221,22 @@ AC_INIT_PREPARE($1)dnl
AC_DIVERT_POP()dnl to NORMAL
])
+dnl AC_INCLUDE
+AC_DEFUN(AC_INCLUDE,
+[ifelse($1, [], [], [dnl
+ esyscmd([for file in $1; do echo "m4_include($file)dnl"; done])dnl
+])])
+
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
+dnl ------------------------------------------
+dnl Called by AC_INIT to build the preamble of the `configure' scripts.
+dnl 1. Trap and clean up various tmp files.
+dnl 2. Set up the fd and output files
+dnl 3. Remember the options given to `configure' for `config.status --recheck'.
+dnl 4. Ensure a correct environment
+dnl 5. Find `$srcdir', and check its validity by verifying the presence of
+dnl UNIQUE-FILE-IN-SOURCE-DIR.
+dnl 6. Required macros (cache, default AC_SUBST etc.)
AC_DEFUN(AC_INIT_PREPARE,
[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
@@ -623,7 +1263,7 @@ running configure, to aid debugging if configure makes a mistake.
" 1>&AC_FD_CC
# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
+# Also quote any args containing shell meta-characters.
ac_configure_args=
for ac_arg
do
@@ -636,6 +1276,7 @@ changequote(<<, >>)dnl
dnl If you change this globbing pattern, test it on an old shell --
dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
*" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_arg=`echo "$ac_arg"|sed "s/'/'\\\\\\\\''/g"`
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
changequote([, ])dnl
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
@@ -667,7 +1308,7 @@ if test -z "$srcdir"; then
# Try the directory containing this script, then its parent.
ac_prog=[$]0
changequote(, )dnl
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ ac_confdir=`echo "$ac_prog"|sed 's%/[^/][^/]*$%%'`
changequote([, ])dnl
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
@@ -679,9 +1320,9 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- AC_MSG_ERROR(can not find sources in $ac_confdir or ..)
+ AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
else
- AC_MSG_ERROR(can not find sources in $srcdir)
+ AC_MSG_ERROR(cannot find sources in $srcdir)
fi
fi
dnl Double slashes in pathnames in object file debugging info
@@ -733,9 +1374,10 @@ dnl ### Selecting optional features
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl -----------------------------------------------------------------------
AC_DEFUN(AC_ARG_ENABLE,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
+ac_arg_enable_help="$ac_arg_enable_help
[$2]"
AC_DIVERT_POP()dnl
[#] Check whether --enable-[$1] or --disable-[$1] was given.
@@ -760,7 +1402,7 @@ dnl ### Working with optional software
dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
AC_DEFUN(AC_ARG_WITH,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
+ac_arg_with_help="$ac_arg_with_help
[$2]"
AC_DIVERT_POP()dnl
[#] Check whether --with-[$1] or --without-[$1] was given.
@@ -779,10 +1421,34 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl
])
+
+dnl ### Remembering env vars for reconfiguring
+
+dnl AC_ARG_VAR(VARNAME, DOCUMENTATION)
+dnl ----------------------------------
+dnl Register VARNAME as a variable configure should remember, and
+dnl document it in --help.
+AC_DEFUN(AC_ARG_VAR,
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+ac_arg_var_help="$ac_arg_var_help
+AC_HELP_STRING([$1], [$2], [ ])"
+AC_DIVERT_POP()dnl
+dnl Register if set and not yet registered.
+dnl If there are envvars given as arguments, they are already set,
+dnl therefore they won't be set again, which is the right thing.
+case "${$1+set} $ac_configure_args" in
+ *" $1="* );;
+ "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";;
+esac])
+
+
+
dnl ### Transforming program names.
dnl AC_ARG_PROGRAM()
+dnl ----------------
+dnl FIXME: Must be run only once. Introduce AC_DEFUN_ONCE?
AC_DEFUN(AC_ARG_PROGRAM,
[if test "$program_transform_name" = s,x,x,; then
program_transform_name=
@@ -811,36 +1477,41 @@ dnl ### Version numbers
dnl AC_REVISION(REVISION-INFO)
AC_DEFUN(AC_REVISION,
[AC_REQUIRE([AC_INIT_BINSH])dnl
-[# From configure.in] translit([$1], $")])
+AC_DIVERT_PUSH(AC_DIVERSION_BINSH)dnl
+[# From configure.in] translit([$1], $")
+AC_DIVERT_POP()dnl to KILL
+])
dnl Subroutines of AC_PREREQ.
-dnl Change the dots in NUMBER into commas.
-dnl AC_PREREQ_SPLIT(NUMBER)
-define(AC_PREREQ_SPLIT,
-[translit($1, ., [, ])])
-
-dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
-dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
-define(AC_PREREQ_CANON,
-[$1, $2, ifelse([$3], , 0, [$3])])
-
-dnl Complain and exit if version number 1 is less than version number 2.
-dnl PRINTABLE2 is the printable version of version number 2.
-dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
-dnl PRINTABLE2)
-define(AC_PREREQ_COMPARE,
-[ifelse(builtin([eval],
-[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1,
-[errprint(dnl
-FATAL ERROR: Autoconf version $7 or higher is required for this script
-)m4exit(3)])])
+dnl m4_compare(VERSION-1, VERSION-2)
+dnl --------------------------------
+dnl Compare the two version numbers and expand into
+dnl -1 if VERSION-1 < VERSION-2
+dnl 0 if =
+dnl 1 if >
+dnl The handling of the special values [[]] is a pain, but seems necessary.
+dnl This macro is a excellent tutorial on the order of evaluation of ifelse.
+define(m4_compare,
+[ifelse([$1],, [ifelse([$2],, 0,
+ [$2], [[]], 0,
+ 1)],
+ [$1], [[]], [ifelse([$2],, 0,
+ [$2], [[]], 0,
+ 1)],
+ [$2],, -1,
+ [$2], [[]], -1,
+ [ifelse(m4_eval(m4_car($1) < m4_car($2)), 1, 1,
+ [ifelse(m4_eval(m4_car($1) > m4_car($2)), 1, -1,
+ [m4_compare(m4_quote(m4_shift($1)),
+ m4_quote(m4_shift($2)))])])])])
dnl Complain and exit if the Autoconf version is less than VERSION.
dnl AC_PREREQ(VERSION)
define(AC_PREREQ,
-[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
-AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])
+[ifelse(m4_compare(m4_split([$1], [\.]),
+ m4_split(AC_ACVERSION, [\.])), -1,
+ [AC_FATAL(Autoconf version $1 or higher is required for this script)])])
dnl ### Getting the canonical system type
@@ -881,7 +1552,7 @@ for ac_dir in $1; do
fi
done
if test -z "$ac_aux_dir"; then
- AC_MSG_ERROR([can not find install-sh or install.sh in $1])
+ AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
@@ -923,11 +1594,11 @@ test "$host_alias" != "$target_alias" &&
])
dnl Subroutines of AC_CANONICAL_SYSTEM.
-
+
dnl Worker routine for AC_CANONICAL_{HOST TARGET BUILD}. THING is one of
dnl `host', `target', or `build'. Canonicalize the appropriate thing,
dnl generating the variables THING, THING_{alias cpu vendor os}, and the
-dnl associated cache entries. We also redo the cache entries if the user
+dnl associated cache entries. We also redo the cache entries if the user
dnl specifies something different from ac_cv_$THING_alias on the command line.
dnl AC_CANONICAL_THING(THING)
@@ -940,7 +1611,7 @@ if test "x$ac_cv_$1" = "x" || (test "x$$1" != "xNONE" && test "x$$1" != "x$ac_cv
# Make sure we can run config.sub.
if $ac_config_sub sun4 >/dev/null 2>&1; then :
- else AC_MSG_ERROR(can not run $ac_config_sub)
+ else AC_MSG_ERROR(cannot run $ac_config_sub)
fi
dnl Set $1_alias.
@@ -951,7 +1622,7 @@ dnl Set $1_alias.
NONE)
ifelse($1, [host],[dnl
if ac_cv_$1_alias=`$ac_config_guess`; then :
- else AC_MSG_ERROR(can not guess $1 type; you must specify one)
+ else AC_MSG_ERROR(cannot guess $1 type; you must specify one)
fi ;;],[dnl
ac_cv_$1_alias=$host_alias ;;
])
@@ -1104,37 +1775,46 @@ 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.
+dnl Should be dnl'ed.
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)
+dnl -------------------------------------------
+dnl Do not call this macro with a dnl right behind.
define(AC_CACHE_CHECK,
[AC_MSG_CHECKING([$1])
-AC_CACHE_VAL([$2], [$3])
-AC_MSG_RESULT([$]$2)])
+AC_CACHE_VAL([$2], [$3])dnl
+AC_MSG_RESULT_UNQUOTED(AC_VAR_GET([$2]))])
dnl ### Defining symbols
-dnl Set VARIABLE to VALUE, verbatim, or 1.
-dnl AC_DEFINE(VARIABLE [, VALUE])
+dnl AC_DEFINE(VARIABLE [, VALUE[, DESCRIPTION]])
+dnl --------------------------------------------
+dnl Set VARIABLE to VALUE, verbatim, or 1. Remember the value
+dnl and if VARIABLE is affected the same VALUE, do nothing, else
+dnl die. The third argument is used by autoheader.
define(AC_DEFINE,
[cat >> confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
+
+
+dnl AC_DEFINE_UNQUOTED(VARIABLE [, VALUE[, DESCRIPTION]])
+dnl -----------------------------------------------------
dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
define(AC_DEFINE_UNQUOTED,
[cat >> confdefs.h <<EOF
@@ -1143,60 +1823,120 @@ EOF
])
+
dnl ### Setting output variables
+dnl AC_SUBST(VARIABLE)
+dnl ------------------
dnl This macro protects VARIABLE from being diverted twice
dnl if this macro is called twice for it.
-dnl AC_SUBST(VARIABLE)
+dnl Beware that if you change this macro, you also have to change the
+dnl sed script at the top of AC_OUTPUT_FILES.
define(AC_SUBST,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
-s%@$1@%[$]$1%g
+s%@$1@%[$]$1%;t t
AC_DIVERT_POP()dnl
])])
dnl AC_SUBST_FILE(VARIABLE)
+dnl -----------------------
+dnl Read the comments of the preceding macro.
define(AC_SUBST_FILE,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
/@$1@/r [$]$1
-s%@$1@%%g
+s%@$1@%%;t t
AC_DIVERT_POP()dnl
])])
-dnl ### Printing messages
+dnl ### Printing messages at autoconf runtime
+
+dnl _AC_ERRPRINT(MESSAGE)
+dnl Report the MESSAGE at m4 time, with line and filename.
+define(_AC_ERRPRINT, [errprint(__file__:__line__: [$1
+])])
+dnl AC_WARNING(MESSAGE)
+define(AC_WARNING, [_AC_ERRPRINT([warning: $1])])
+
+dnl AC_FATAL(MESSAGE [, EXIT-STATUS])
+define(AC_FATAL,
+[_AC_ERRPRINT([error: $1])
+m4exit(ifdef([$2], [$2], 1))])
+
+
+dnl ### Printing messages at configure runtime
+
+dnl _AC_SH_QUOTE(STRING)
+dnl --------------------
+dnl If there are quoted (via backslash) backquotes do nothing, else
+dnl backslash all the quotes.
+dnl Note: it is important that both case evaluate STRING the same number
+dnl of times so that both _AC_SH_QUOTE([\`Hello world']) and
+dnl _AC_SH_QUOTE([`Hello world']) answer \`Hello world'.
+define(_AC_SH_QUOTE,
+[ifelse(regexp([$1], [\\`]),
+ -1, [patsubst([$1], [`], [\\`])],
+ [AC_WARNING([backquotes should not be backslashed in: $1])dnl
+$1])])
+
+dnl _AC_ECHO_UNQUOTED(STRING [ , FD ])
+dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG).
+dnl The shell performs its expansions on STRING.
+define([_AC_ECHO_UNQUOTED],
+[echo "[$1]" 1>&ifelse($2,, AC_FD_MSG, $2)])
+
+dnl _AC_ECHO(STRING [ , FD ])
+dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG),
+dnl protecting STRING from backquote expansion.
+define([_AC_ECHO],
+[_AC_ECHO_UNQUOTED(_AC_SH_QUOTE($1), $2)])
+
+dnl _AC_ECHO_N(STRING [ , FD ])
+dnl Same as _AC_ECHO, but echo doesn't return to a new line.
+define(_AC_ECHO_N,
+[echo $ac_n "_AC_SH_QUOTE($1)$ac_c" 1>&ifelse($2,,AC_FD_MSG,$2)])
dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
define(AC_MSG_CHECKING,
-[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG
-echo "configure:__oline__: checking $1" >&AC_FD_CC])
+[_AC_ECHO_N([checking $1... ])
+_AC_ECHO([configure:__oline__: checking $1], AC_FD_CC)])
dnl AC_CHECKING(FEATURE-DESCRIPTION)
define(AC_CHECKING,
-[echo "checking $1" 1>&AC_FD_MSG
-echo "configure:__oline__: checking $1" >&AC_FD_CC])
+[_AC_ECHO([checking $1])
+_AC_ECHO([configure:__oline__: checking $1], AC_FD_CC)])
dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
define(AC_MSG_RESULT,
-[echo "$ac_t""$1" 1>&AC_FD_MSG])
+[_AC_ECHO([$ac_t""$1])])
+
+dnl AC_MSG_RESULT_UNQUOTED(RESULT-DESCRIPTION)
+dnl Likewise, but perform $ ` \ shell substitutions.
+define(AC_MSG_RESULT_UNQUOTED,
+[_AC_ECHO_UNQUOTED([$ac_t""$1])])
dnl AC_VERBOSE(RESULT-DESCRIPTION)
define(AC_VERBOSE,
[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
-echo " $1" 1>&AC_FD_MSG])
+_AC_ECHO([ $1])])
dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
define(AC_MSG_WARN,
-[echo "configure: warning: $1" 1>&2])
+[_AC_ECHO([configure: warning: $1], 2)])
dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
define(AC_MSG_ERROR,
-[{ echo "configure: error: $1" 1>&2; exit 1; }])
+[{ _AC_ECHO([configure: error: $1], 2); exit 1; }])
+
+dnl AC_MSG_ERROR_UNQUOTED(ERROR-DESCRIPTION)
+define(AC_MSG_ERROR_UNQUOTED,
+[{ _AC_ECHO_UNQUOTED([configure: error: $1], 2); exit 1; }])
dnl ### Selecting which language to use for testing
@@ -1266,13 +2006,12 @@ dnl ### Dependencies between macros
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
define(AC_BEFORE,
-[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
-])])])
+[ifdef([AC_PROVIDE_$2], [AC_WARNING([$2 was called before $1])])])
dnl AC_REQUIRE(MACRO-NAME)
define(AC_REQUIRE,
[ifdef([AC_PROVIDE_$1], ,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
+[AC_DIVERT_PUSH(m4_eval(AC_DIVERSION_CURRENT - 1))dnl
indir([$1])
AC_DIVERT_POP()dnl
])])
@@ -1283,8 +2022,12 @@ define(AC_PROVIDE,
dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
define(AC_OBSOLETE,
-[errprint(__file__:__line__: warning: [$1] is obsolete[$2]
-)])
+[AC_WARNING([$1] is obsolete[$2])])
+
+dnl AC_HASBEEN(THIS-MACRO-NAME [, SUGGESTION])
+define(AC_HASBEEN,
+[AC_FATAL([$1] is obsolete[$2])])
+
dnl ### Generic structure checks
@@ -1298,11 +2041,15 @@ AC_DEFUN(AC_C_STRUCT_MEMBER,
$1="$ac_cv_c_struct_member_$1"])
+
+
dnl ### Checking for programs
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]])
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
+dnl [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
+dnl [, PATH [, REJECT]]])
+dnl ------------------------------------------------------
AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
@@ -1365,30 +2112,43 @@ else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
-])
+])dnl AC_CHECK_PROG
+
+
+dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
+dnl [, PATH]])
+dnl -----------------------------------------------------------------
+AC_DEFUN(AC_CHECK_PROGS,
+[for ac_prog in $2
+do
+AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
+test -n "[$]$1" && break
+done
+ifelse([$3], , , [test -n "[$]$1" || $1="$3"
+])])
+
dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
AC_DEFUN(AC_PATH_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
- /*)
+dnl Second pattern matches DOS absolute paths.
+ /* | ?:/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path.
- ;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$4], , $PATH, [$4])"
- 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
+ if test -f "$ac_dir/$ac_word"; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
@@ -1409,19 +2169,10 @@ fi
AC_SUBST($1)dnl
])
-dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
-dnl [, PATH]])
-AC_DEFUN(AC_CHECK_PROGS,
-[for ac_prog in $2
-do
-AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
dnl [, PATH]])
+dnl ----------------------------------------------------------------
AC_DEFUN(AC_PATH_PROGS,
[for ac_prog in $2
do
@@ -1431,6 +2182,11 @@ done
ifelse([$3], , , [test -n "[$]$1" || $1="$3"
])])
+
+
+
+dnl ### Checking for tools
+
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
@@ -1441,18 +2197,35 @@ else
fi
])
+dnl AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl ------------------------------------------------------------------------
+AC_DEFUN(AC_PATH_TOOL,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
+ ifelse([$3], , [$2], ), $4)
+ifelse([$3], , , [
+if test -z "$ac_cv_prog_$1"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_PROG($1, $2, $2, $3)
+ else
+ $1="$3"
+ fi
+fi])
+])
+
dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
AC_DEFUN(AC_CHECK_TOOL,
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
ifelse([$3], , [$2], ), $4)
ifelse([$3], , , [
if test -z "$ac_cv_prog_$1"; then
-if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG($1, $2, $2, $3)
-else
- $1="$3"
-fi
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG($1, $2, $2, $3)
+ else
+ $1="$3"
+ fi
fi])
])
@@ -1466,9 +2239,7 @@ dnl No big loss, I think, since most configures don't use this macro anyway.
dnl AC_PREFIX_PROGRAM(PROGRAM)
AC_DEFUN(AC_PREFIX_PROGRAM,
[if test "x$prefix" = xNONE; then
-changequote(<<, >>)dnl
-define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
-changequote([, ])dnl
+define([AC_VAR_NAME], AC_UPCASE_NAME([$1])dnl
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG
AC_PATH_PROG(AC_VAR_NAME, $1)
@@ -1481,14 +2252,14 @@ fi
undefine([AC_VAR_NAME])dnl
])
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
+dnl -----------------------------------------------------
dnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
dnl `yes' if the current compiler works, otherwise set it ti `no'. Set
dnl CROSS-VAR to `yes' if the compiler and linker produce non-native
dnl executables, otherwise set it to `no'. Before calling
dnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
dnl language.
-dnl
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext << EOF
ifelse(AC_LANG, [FORTRAN77], ,
@@ -1518,6 +2289,7 @@ dnl ### Checking for libraries
dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found)
+dnl ------------------------------------------------------------
dnl Try to link a program that calls FUNC, handling GCC builtins. If
dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute
dnl ACTION-IF-NOT-FOUND.
@@ -1540,13 +2312,14 @@ char $1();
[$3]))
-dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND
-dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
+dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS
+dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
+dnl [, OTHER-LIBRARIES]]])
+dnl --------------------------------------------------------
dnl Search for a library defining FUNC, if it's not already available.
AC_DEFUN(AC_SEARCH_LIBS,
-[AC_PREREQ([2.13])
-AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
+[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
[ac_func_search_save_LIBS="$LIBS"
ac_cv_search_$1="no"
AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
@@ -1568,14 +2341,18 @@ fi])
dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-AC_DEFUN(AC_CHECK_LIB,
-[AC_MSG_CHECKING([for $2 in -l$1])
+dnl ------------------------------------------------------------------------
dnl Use a cache variable name containing both the library and function name,
dnl because the test really is for library $1 defining function $2, not
dnl just for library $1. Separate tests with the same $1 and different $2s
dnl may have different results.
-ac_lib_var=`echo $1['_']$2 | sed 'y%./+-:%__p__%'`
-AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
+dnl
+dnl FIXME: This macro is extremely suspicious. It DEFINEs unconditionnally,
+dnl whatever the FUNCTION, in addition to not being a *S macro. Note
+dnl that the cache does depend upon the function with look for.
+AC_DEFUN(AC_CHECK_LIB,
+[AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
AC_TRY_LINK(dnl
@@ -1590,57 +2367,24 @@ extern "C"
builtin and then its argument prototype would still apply. */
char $2();
])),
- [$2()],
- eval "ac_cv_lib_$ac_lib_var=yes",
- eval "ac_cv_lib_$ac_lib_var=no")
-LIBS="$ac_save_LIBS"
-])dnl
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], ,
-[changequote(, )dnl
- ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_lib)
+[$2()],
+AC_VAR_SET(ac_Lib, yes), AC_VAR_SET(ac_Lib, no))
+LIBS="$ac_save_LIBS"])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Lib) = yes,
+ m4_default([$3],
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
-], [$3])
-else
- AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
+]),
+ [$4])dnl
+AC_VAR_POPDEF([ac_Lib])dnl
+])dnl AC_CHECK_LIB
+
+
dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_HAVE_LIBRARY,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
-changequote(<<, >>)dnl
-define(<<AC_LIB_NAME>>, dnl
-patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
-define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
-changequote([, ])dnl
-AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
-AC_CACHE_VAL(AC_CV_NAME,
-[ac_save_LIBS="$LIBS"
-LIBS="-l[]AC_LIB_NAME[] $4 $LIBS"
-AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)
-LIBS="$ac_save_LIBS"
-])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-if test "$AC_CV_NAME" = yes; then
- ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z]))
- LIBS="-l[]AC_LIB_NAME[] $LIBS"
-], [$2])
-ifelse([$3], , , [else
- $3
-])dnl
-fi
-undefine([AC_LIB_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_LIB])])
dnl ### Examining declarations
@@ -1712,7 +2456,7 @@ dnl ### Examining syntax
dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
-dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_TRY_COMPILE,
[cat > conftest.$ac_ext <<EOF
ifelse(AC_LANG, [FORTRAN77],
@@ -1793,9 +2537,8 @@ dnl [, ACTION-IF-CROSS-COMPILING]]])
AC_DEFUN(AC_TRY_RUN,
[if test "$cross_compiling" = yes; then
ifelse([$4], ,
- [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling
-)dnl
- AC_MSG_ERROR(can not run test program while cross compiling)],
+ [AC_WARNING([[AC_TRY_RUN] called without default to allow cross compiling])dnl
+ AC_MSG_ERROR(cannot run test program while cross compiling)],
[$4])
else
AC_TRY_RUN_NATIVE([$1], [$2], [$3])
@@ -1833,31 +2576,23 @@ dnl ### Checking for header files
dnl AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_HEADER,
-[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_header_$ac_safe,
-[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
- eval "ac_cv_header_$ac_safe=no")])dnl
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
-
-dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+[AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
+AC_CACHE_CHECK([for $1], ac_Header,
+[AC_TRY_CPP([#include <$1>],
+AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Header) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_Header])dnl
+])dnl AC_CHECK_HEADER
+
+dnl AC_CHECK_HEADERS(HEADER-FILE...
+dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_HEADERS,
-[for ac_hdr in $1
+[for ac_header in $1
do
-AC_CHECK_HEADER($ac_hdr,
-[changequote(, )dnl
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
+AC_CHECK_HEADER($ac_header,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_header)) $2],
+ [$3])dnl
done
])
@@ -1865,52 +2600,117 @@ 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_VAR_PUSHDEF([ac_var], [ac_cv_file_$1])dnl
+dnl FIXME: why was there this line? AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_file_$ac_safe,
+AC_CACHE_VAL(ac_var,
[if test "$cross_compiling" = yes; then
- errprint(__file__:__line__: 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_WARNING([Cannot check for file existence when cross compiling])dnl
+ AC_MSG_ERROR([Cannot check for file existence when cross compiling])
fi
+if test -r "[$1]"; then
+ AC_VAR_SET(ac_var, yes)
+else
+ AC_VAR_SET(ac_var, no)
fi])dnl
-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+if test AC_VAR_GET(ac_var) = yes; then
AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
+ifset([$2], [ $2
+])dnl
else
AC_MSG_RESULT(no)
-ifelse([$3], , , [$3])
+ifset([$3], [ $3
+])dnl
fi
-])
+AC_VAR_POPDEF([ac_var])])
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,
-[changequote(, )dnl
- ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
-done
-])
+[AC_FOREACH([AC_FILE_NAME], [$1],
+ [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(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_CPP(HAVE_$ac_file)) $2],
+dnl [$3])dnl
+dnl done
+dnl ])
+
+
+dnl ### Checking for declared symbols
+
+
+dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl [, INCLUDES,]]])
+dnl --------------------------------------------------------------
+dnl Check if SYMBOL (a variable or a function) is declared.
+dnl This macro is not a _CHECK_, because it is better not to declare
+dnl a symbol if you don't really need it.
+AC_DEFUN([AC_NEED_DECL],
+[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_need_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 needs to be declared], ac_Symbol,
+[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
+#ifdef HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]),
+[#ifndef $1
+char *p = (char *) $1;
+#endif
+],
+AC_VAR_SET(ac_Symbol, no), AC_VAR_SET(ac_Symbol, yes))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Symbol) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_Symbol])dnl
+])dnl AC_NEED_DECL
+
+dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl [, INCLUDES]]])
+dnl ---------------------------------------------------------------
+AC_DEFUN([AC_NEED_DECLS],
+[AC_FOREACH([AC_Symbol], [$1],
+ [AC_SPECIALIZE([AC_NEED_DECL], AC_Symbol,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_DECL_[]AC_Symbol))
+$2],
+ [$3],
+ [$4])])
+])dnl AC_NEED_DECLS
dnl ### Checking for library functions
dnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl ------------------------------------------------------------------
AC_DEFUN(AC_CHECK_FUNC,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_func_$1,
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
+AC_CACHE_CHECK([for $1], ac_var,
[AC_TRY_LINK(
dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
dnl which includes <sys/select.h> which contains a prototype for
@@ -1936,29 +2736,23 @@ choke me
#else
f = $1;
#endif
-], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
-if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
+], AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+ [$2], [$3])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_FUNC
dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_CHECK_FUNCS,
[for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
-[changequote(, )dnl
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
+ [$3])dnl
done
])
+
dnl AC_REPLACE_FUNCS(FUNCTION...)
AC_DEFUN(AC_REPLACE_FUNCS,
[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"])
@@ -1969,55 +2763,58 @@ AC_SUBST(LIBOBJS)dnl
dnl ### Checking compiler characteristics
-dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
+dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE, [INCLUDES]])
+dnl ------------------------------------------------
+dnl This macro will probably be obsoleted by the macros of Kaveh. In
+dnl addition `CHECK' is not a proper name (is not boolean).
AC_DEFUN(AC_CHECK_SIZEOF,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
+[AC_VAR_PUSHDEF([ac_Sizeof], [ac_cv_sizeof_$1])dnl
+AC_CACHE_CHECK([size of $1], ac_Sizeof,
[AC_TRY_RUN([#include <stdio.h>
+[$3]
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
- fprintf(f, "%d\n", sizeof($1));
+ fprintf(f, "%d\n", sizeof([$1]));
exit(0);
-}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
+}],
+ AC_VAR_SET(ac_Sizeof, `cat conftestval`),
+ AC_VAR_SET(ac_Sizeof, 0),
+ ifset([$2], AC_VAR_SET(ac_Sizeof, $2)))])
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_Sizeof))
+AC_VAR_POPDEF([ac_Sizeof])dnl
])
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES])
+dnl AC_CHECK_TYPE(TYPE, DEFAULT[, INCLUDES])
+dnl ----------------------------------------
+dnl FIXME: This is an extremely badly chosen name, since this
+dnl macro actually performs an AC_REPLACE_TYPE. Some day we
+dnl have to clean this up.
AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
+AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
+AC_CACHE_CHECK([for $1], ac_Type,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), ifelse([$3],,[#include <sys/types.h>
+changequote([,]), m4_default([$3], [#include <stdio.h>
+#include <sys/types.h>
#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif],[$3])
-, eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
-if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_DEFINE_UNQUOTED($1, $2, [Define to \`$2' if <sys/types.h> does not define.])
-fi
-])
+# include <stdlib.h>
+# include <stddef.h>
+#endif
+]), AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,,
+ [AC_DEFINE_UNQUOTED($1, $2,
+ [Define to `$2' if <sys/types.h>
+ does not define.])])dnl
+AC_VAR_POPDEF([ac_Type])dnl
+])dnl AC_CHECK_TYPE
dnl ### Creating output files
@@ -2025,24 +2822,56 @@ dnl ### Creating output files
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
AC_DEFUN(AC_CONFIG_HEADER,
-[define(AC_LIST_HEADER, $1)])
+[define(AC_LIST_HEADERS, $1)])
+
+
+dnl AC_CONFIG_LINKS(DEST:SOURCE...)
+dnl -------------------------------
+dnl Specify that config.status should establish a (symbolic if possible)
+dnl link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
+dnl Reject DEST=., because it is makes it hard for ./config.status
+dnl to guess the links to establish (`./config.status .').
+AC_DEFUN(AC_CONFIG_LINKS,
+[ifelse(regexp([$1], [^.:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
+ifelse(regexp([$1], [ .:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
+define([AC_LIST_LINKS],
+ ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$1])
+])
+
+dnl AC_LINK_FILES(SOURCE..., DEST...)
+dnl ---------------------------------
dnl Link each of the existing files SOURCE... to the corresponding
dnl link name in DEST...
-dnl AC_LINK_FILES(SOURCE..., DEST...)
+dnl This macro, as AC_CONFIG_FILES, produces no sh code, so we don't
+dnl dnl.
AC_DEFUN(AC_LINK_FILES,
-[dnl
-ifelse($#, 2, , dnl
- [errprint(__file__:__line__: incorrect number of arguments to [AC_LINK_FILES]
-)]
- AC_MSG_ERROR([aborting due to error at __file__:__line__]))dnl
-define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl
-define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])])
+[AC_OBSOLETE([$0], [; instead use AC_CONFIG_FILES(DEST:SOURCE...)])
+ifelse($#, 2, ,
+ [AC_FATAL([$0: incorrect number of arguments])])
+
+pushdef([AC_Sources], m4_split(m4_strip(m4_join([$1]))))
+pushdef([AC_Dests], m4_split(m4_strip(m4_join([$2]))))
+m4_foreach([AC_Dummy], (AC_Sources),
+ [AC_CONFIG_LINKS(m4_car(AC_Dests):m4_car(AC_Sources))
+ define([AC_Sources], m4_quote(m4_shift(AC_Sources)))
+ define([AC_Dests], m4_quote(m4_shift(AC_Dests)))])
+
+popdef([AC_Sources])
+popdef([AC_Dests])
+])
+
+define([AC_LIST_LINKS],
+ ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2:$1])])
+
+dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
+dnl -----------------------------------------
dnl Add additional commands for AC_OUTPUT to put into config.status.
dnl Use diversions instead of macros so we can be robust in the
dnl presence of commas in $1 and/or $2.
-dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
AC_DEFUN(AC_OUTPUT_COMMANDS,
[AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl
[$1]
@@ -2059,9 +2888,13 @@ subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
+dnl AC_OUTPUT([CONFIG_FILES...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl ---------------------------------------------------------
dnl The big finish.
dnl Produce config.status, config.h, and links; and configure subdirs.
-dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
+dnl Pay special attention not to have too long here docs: some old
+dnl shells die. Unfortunately the limit is not known precisely...
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
@@ -2082,7 +2915,7 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
+ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -2103,40 +2936,146 @@ dnl so uname gets run too.
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
-changequote(, )dnl
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-changequote([, ])dnl
+# Files that config.status was made for.
+ifset([$1], [config_files="\\
+AC_WRAP($1, [ ])"
+])dnl
+ifdef([AC_LIST_HEADERS], [config_headers="\\
+AC_WRAP(AC_LIST_HEADERS, [ ])"
+])dnl
+ifdef([AC_LIST_LINKS], [config_links="\\
+AC_WRAP(AC_LIST_LINKS, [ ])"
+])dnl
+
+ac_cs_usage="\\
+\\\`$CONFIG_STATUS' instantiates files from templates according to the
+current configuration.
+
+Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@ FILE...
+
+ --recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
+ --version Print the version of Autoconf and exit
+ --help Display this help and exit
+
+dnl Issue this section only if there were actually config files.
+dnl The following test checks if one of AC_LIST_HEADERS, the CONFIG_FILES
+dnl which are given via $[1], or AC_LIST_LINKS is set.
+ifset(ifdef([AC_LIST_HEADERS], 1)ifdef([AC_LIST_LINKS], 1)[$1],
+[Files to instantiate:
+ifset($1, [ Configuration files:
+\$config_files
+])dnl
+ifdef([AC_LIST_HEADERS], [ Configuration headers:
+\$config_headers
+])dnl
+ifdef([AC_LIST_LINKS], [ Links to install:
+\$config_links
+])dnl
+
+])dnl
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\\
+$CONFIG_STATUS generated by autoconf version AC_ACVERSION.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by running
+ [$]0 [$]ac_configure_args"
+
+dnl We use a different name than CONFTEST just to help the maintainers
+dnl to make the difference between `conftest' which is the root of the
+dnl files used by configure, and `ac_cs_root' which is the root of the
+dnl files of config.status.
+# Root of the tmp file names. Use pid to allow concurrent executions.
+ac_cs_root=cs\$\$
+ac_given_srcdir=$srcdir
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+])dnl
+
for ac_option
do
case "[\$]ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
+ echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 `echo "[$]ac_configure_args" | sed 's/[[\\"\`\$]]/\\\\&/g'` --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 AC_ACVERSION"
- exit 0 ;;
+ echo "[\$]ac_cs_version"; exit 0 ;;
-help | --help | --hel | --he | --h)
echo "[\$]ac_cs_usage"; exit 0 ;;
- *) echo "[\$]ac_cs_usage"; exit 1 ;;
+ *) # Find out the files to process.
+ for ac_file in [\$]config_files
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_FILES="[\$]CONFIG_FILES [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ for ac_file in [\$]config_headers
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_HEADERS="[\$]CONFIG_HEADERS [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ for ac_file in [\$]config_links
+ do
+ case [\$]ac_file in
+ [\$]ac_option | [\$]ac_option:* )
+ CONFIG_LINKS="[\$]CONFIG_LINKS [\$]ac_file"
+ ac_option=
+ break ;;
+ esac
+ done
+ test -z "[\$]ac_option" && continue
+ echo "$CONFIG_STATUS: invalid argument: [\$]ac_option"; exit 1
+ ;;
esac
done
-ac_given_srcdir=$srcdir
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+EOF
+
+dnl Issue this section only if there were actually config files.
+dnl The following test checks if one of AC_LIST_HEADERS, the CONFIG_FILES
+dnl which are given via $[1], or AC_LIST_LINKS is set.
+ifset(ifdef([AC_LIST_HEADERS], 1)ifdef([AC_LIST_LINKS], 1)[$1],
+[cat >> $CONFIG_STATUS <<EOF
+# If there were arguments, don't assign a default value.
+if test \$[#] = 0; then
+ifset([$1], [ : \${CONFIG_FILES="\$config_files"}
+])dnl
+ifdef([AC_LIST_HEADERS], [ : \${CONFIG_HEADERS="\$config_headers"}
])dnl
+ifdef([AC_LIST_LINKS], [ : \${CONFIG_LINKS="\$config_links"}
+])dnl
+fi
-changequote(<<, >>)dnl
-ifdef(<<AC_LIST_HEADER>>,
-<<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>,
-<<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>)
-changequote([, ])dnl
-EOF
-cat >> $CONFIG_STATUS <<EOF
+# Remove all the CONFIG_FILES, and trap to remove the temp files.
+dnl There is no need to trap for the config files since they are built
+dnl from `mv tmp-file config-file', hence their update is atomic.
+rm -fr \`echo "\$CONFIG_FILES" | sed "s/:@BKL@^ @BKR@*//g"\`
+trap 'rm -fr \$ac_cs_root*; exit 1' 1 2 15
-AC_OUTPUT_FILES($1)
-ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
-ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
EOF
+])[]dnl
+
+dnl The following three sections are in charge of their own here
+dnl documenting into $CONFIG_STATUS.
+
+dnl Because AC_OUTPUT_FILES is in charge of undiverting the AC_SUBST
+dnl section, it is better to divert it to void and *call it*, rather
+dnl than not calling it at all
+ifset([$1],
+ [AC_OUTPUT_FILES([$1])],
+ [AC_DIVERT_PUSH(AC_DIVERSION_KILL)dnl
+AC_OUTPUT_FILES([$1])dnl
+AC_DIVERT_POP()])dnl
+ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
+ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS)])dnl
+
cat >> $CONFIG_STATUS <<EOF
undivert(AC_DIVERSION_ICMDS)dnl
$3
@@ -2151,20 +3090,29 @@ rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
-])dnl
+])dnl AC_OUTPUT
+
+dnl AC_OUTPUT_MAKE_DEFS()
+dnl ---------------------
dnl Set the DEFS variable to the -D options determined earlier.
dnl This is a subroutine of AC_OUTPUT.
dnl It is called inside configure, outside of config.status.
-dnl AC_OUTPUT_MAKE_DEFS()
define(AC_OUTPUT_MAKE_DEFS,
[# Transform confdefs.h into DEFS.
dnl Using a here document instead of a string reduces the quoting nightmare.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
+#
+# 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 > $ac_cs_root.defs <<\EOF
changequote(<<, >>)dnl
-s%<<#define>> \([^ ][^ ]*\) *\(.*\)%-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
@@ -2178,70 +3126,79 @@ EOF
# platform that uses two characters for line-breaks (e.g., DOS), tr
# would break.
ac_LF_and_DOT="`echo; echo .`"
-DEFS=`sed -f conftest.defs confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f conftest.defs
+DEFS=`sed -f $ac_cs_root.defs confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f $ac_cs_root.defs
])
+
+dnl AC_OUTPUT_FILES(CONFIG_FILES...)
+dnl --------------------------------
dnl Do the variable substitutions to create the Makefiles or whatever.
-dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
-dnl here document whose contents are going into config.status, but
-dnl upon returning, the here document is being quoted.
-dnl AC_OUTPUT_FILES(FILE...)
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_FILES,
-[# Protect against being on the right side of a sed subst in config.status.
+[cat >>$CONFIG_STATUS <<EOF
+# Protect against being on the right side of a sed subst in config.status.
+dnl Please, pay attention that this sed code depends a lot on the shape
+dnl of the sed commands issued by AC_SUBST. So if you change one, change
+dnl the other too.
changequote(, )dnl
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' > \$ac_cs_root.subs <<\\CEOF
changequote([, ])dnl
dnl These here document variables are unquoted when configure runs
dnl but quoted when config.status runs, so variables are expanded once.
-$ac_vpsub
-dnl Shell code in configure.in might set extrasub.
-$extrasub
dnl Insert the sed substitutions of variables.
-undivert(AC_DIVERSION_SED)
+undivert(AC_DIVERSION_SED)dnl
CEOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
+dnl One cannot portably go further than 100 commands because of HP-UX.
+dnl Here, there are 2 cmd per line, and two cmd are added later.
+ac_max_sed_lines=48
+ac_sed_frag=1 # Number of current file.
ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_end=$ac_max_sed_lines # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs > $ac_cs_root.sfrag
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "${ac_end}q" $ac_cs_root.subs > $ac_cs_root.sfrag
fi
- if test ! -s conftest.s$ac_file; then
+ if test ! -s $ac_cs_root.sfrag; then
ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f $ac_cs_root.sfrag
else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+/@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b' && cat $ac_cs_root.sfrag) > $ac_cs_root.s$ac_sed_frag
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag"
fi
- ac_file=`expr $ac_file + 1`
+ ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"$1"}
EOF
+
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
changequote(, )dnl
@@ -2259,6 +3216,8 @@ changequote(, )dnl
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
@@ -2299,33 +3258,52 @@ changequote([, ])dnl
*) ac_comsub= ;;
esac
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+# Don't redirect the output to AC_FILE directly: use `mv' so that updating
+# is atomic, and doesn't need trapping.
+ ac_file_inputs=`echo $ac_file_in | sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+EOF
+cat >>$CONFIG_STATUS <<EOF
sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
+dnl Neutralize VPATH when `$srcdir' = `.'.
+$ac_vpsub
+dnl Shell code in configure.in might set extrasub.
+dnl FIXME: do we really want to maintain this feature?
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b
+s%@configure_input@%$configure_input%;t t
+s%@srcdir@%$srcdir%;t t
+s%@top_srcdir@%$top_srcdir%;t t
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%;t t
])dnl
dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_cs_root.out
dnl This would break Makefile dependencies.
-dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
+dnl if cmp -s $ac_file $ac_cs_root.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
-dnl rm -f conftest.out
+dnl rm -f $ac_cs_root.out
dnl else
dnl rm -f $ac_file
-dnl mv conftest.out $ac_file
+dnl mv $ac_cs_root.out $ac_file
dnl fi
+ mv $ac_cs_root.out $ac_file
fi; done
-rm -f conftest.s*
-])
+rm -f $ac_cs_root.s*
+EOF
+])dnl AC_OUTPUT_FILES
-dnl Create the config.h files from the config.h.in files.
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
dnl AC_OUTPUT_HEADER(HEADER-FILE...)
+dnl --------------------------------
+dnl Create the config.h files from the config.h.in files.
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_HEADER,
-[changequote(<<, >>)dnl
+[cat >>$CONFIG_STATUS <<\EOF
+changequote(<<, >>)dnl
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
@@ -2346,14 +3324,6 @@ ac_eC=' '
ac_eD='%g'
changequote([, ])dnl
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-dnl Support passing AC_CONFIG_HEADER a value containing shell variables.
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="$1"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
changequote(, )dnl
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
@@ -2366,9 +3336,9 @@ changequote([, ])dnl
echo creating $ac_file
- rm -f conftest.frag conftest.in conftest.out
+ rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
+ cat $ac_file_inputs > $ac_cs_root.in
EOF
@@ -2379,17 +3349,45 @@ EOF
rm -f conftest.vals
dnl Using a here document instead of a string reduces the quoting nightmare.
dnl Putting comments in sed scripts is not portable.
-cat > conftest.hdr <<\EOF
+dnl
+dnl One may be tempted to use the same trick to speed up the sed script
+dnl as for CONFIG_FILES (combination of :t and t t). Here we cannot,
+dnl because of the `#define' templates: we may enter in infinite loops
+dnl replacing `#define foo bar' by itself.
+dnl We ought to get rid of the #define templates.
+dnl
+dnl There are two labels in the following scripts, `cleanup' and `clear'.
+dnl
+dnl `cleanup' is used to avoid that the second main sed command (meant for
+dnl 0-ary CPP macros) applies to n-ary macro definitions. So we use
+dnl `t cleanup' to jump over the second main sed command when it succeeded.
+dnl
+dnl But because in sed the `t' flag is set when there is a substitution
+dnl that succeeded before, and not *right* before (i.e., included the
+dnl first two small commands), we need to clear the `t' flag. This is the
+dnl purpose of `t clear; : clear'.
+dnl
+dnl Additionally, this works around a bug of IRIX' sed which does not
+dnl clear the `t' flag between to cycles.
+cat > $ac_cs_root.hdr <<\EOF
changequote(<<, >>)dnl
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
-s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+t clear
+: clear
+s%^[ ]*<<#>>[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
+t cleanup
+s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+: cleanup
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
changequote([, ])dnl
EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC_DEFINE to be honored.
+uniq confdefs.h | sed -n -f $ac_cs_root.hdr > conftest.vals
+rm -f $ac_cs_root.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
@@ -2400,22 +3398,23 @@ s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
changequote([, ])dnl
EOF
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
+# Break up conftest.vals because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
rm -f conftest.tail
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ # Write a limited-size here document to $ac_cs_root.frag.
+ echo ' cat > $ac_cs_root.frag <<CEOF' >> $CONFIG_STATUS
+dnl A small speed up: don't consider the non `#undef' or `#define' lines.
+ echo '/^#[ ]*u*n*d*e*f*/!b' >> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
+ sed -f $ac_cs_root.frag $ac_cs_root.in > $ac_cs_root.out
+ rm -f $ac_cs_root.in
+ mv $ac_cs_root.out $ac_cs_root.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
@@ -2425,13 +3424,13 @@ rm -f conftest.vals
dnl Now back to your regularly scheduled config.status.
cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
+ rm -f $ac_cs_root.frag $ac_cs_root.h
+ echo "/* $ac_file. Generated automatically by configure. */" > $ac_cs_root.h
+ cat $ac_cs_root.in >> $ac_cs_root.h
+ rm -f $ac_cs_root.in
+ if cmp -s $ac_file $ac_cs_root.h 2>/dev/null; then
echo "$ac_file is unchanged"
- rm -f conftest.h
+ rm -f $ac_cs_root.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@@ -2439,35 +3438,34 @@ cat >> $CONFIG_STATUS <<\EOF
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
- mv conftest.h $ac_file
+ mv $ac_cs_root.h $ac_file
fi
fi; done
+EOF
+])dnl AC_OUTPUT_HEADER
-])
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
+dnl AC_OUTPUT_LINKS(DEST:SOURCE...)
+dnl -------------------------------
+dnl This is a subroutine of AC_OUTPUT.
+dnl
+dnl It has to send itself into $CONFIG_STATUS (eg, via here documents).
+dnl Upon exit, no here document shall be opened.
define(AC_OUTPUT_LINKS,
-[EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$1"
-ac_dests="$2"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
+[cat >> $CONFIG_STATUS <<\EOF
srcdir=$ac_given_srcdir
-# Remove spaces from $ac_sources if it is otherwise empty.
-set -- $ac_sources
-ac_sources=[$]*
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]*
- set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]*
+dnl Here we use : instead of .. because if AC_LINK_FILES was used
+dnl with empty parameters (as in gettext.m4), then we obtain here
+dnl `:', which we want to skip. So let's keep a single exception: `:'.
+for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
+ ac_dest=`echo "$ac_file"|sed 's%:.*%%'`
+ ac_source=`echo "$ac_file"|sed 's%@BKL@^:@BKR@*:%%'`
echo "linking $srcdir/$ac_source to $ac_dest"
@@ -2483,6 +3481,8 @@ changequote(, )dnl
changequote([, ])dnl
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
@@ -2502,12 +3502,13 @@ changequote([, ])dnl
# Make a symlink if possible; otherwise try a hard link.
if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
+ ln $srcdir/$ac_source $ac_dest; then :
else
- AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source)
+ AC_MSG_ERROR(cannot link $ac_dest to $srcdir/$ac_source)
fi
-done
-])
+fi; done
+EOF
+])dnl AC_OUTPUT_LINKS
dnl This is a subroutine of AC_OUTPUT.
dnl It is called after running config.status.
@@ -2539,6 +3540,9 @@ if test "$no_recursion" != yes; then
esac
done
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],[ ac_given_INSTALL="$INSTALL"
+])dnl
+
for ac_config_dir in $1; do
# Do not complain, so a configure script can configure whichever
@@ -2552,9 +3556,11 @@ if test "$no_recursion" != yes; then
case "$srcdir" in
.) ;;
*)
+dnl FIXME: should actually be mkinstalldirs (parents may have
+dnl to be created too.
if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
else
- AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
+ AC_MSG_ERROR(cannot create `pwd`/$ac_config_dir)
fi
;;
esac
@@ -2617,3 +3623,87 @@ changequote([, ])dnl
done
fi
])
+
+
+dnl AC_LINKER_OPTION
+dnl ----------------
+dnl
+dnl usage: AC_LINKER_OPTION(LINKER-OPTIONS, SHELL-VARIABLE)
+dnl
+dnl Specifying options to the compiler (whether it be the C, C++ or
+dnl Fortran 77 compiler) that are meant for the linker is compiler
+dnl dependent. This macro lets you give options to the compiler that
+dnl are meant for the linker in a portable, compiler-independent way.
+dnl
+dnl This macro take two arguments, a list of linker options that the
+dnl compiler should pass to the linker (LINKER-OPTIONS) and the name of
+dnl a shell variable (SHELL-VARIABLE). The list of linker options are
+dnl appended to the shell variable in a compiler-dependent way.
+dnl
+dnl For example, if the selected language is C, then this:
+dnl
+dnl AC_LINKER_OPTION([-R /usr/local/lib/foo], foo_LDFLAGS)
+dnl
+dnl will expand into this if the selected C compiler is gcc:
+dnl
+dnl foo_LDFLAGS="-Xlinker -R -Xlinker /usr/local/lib/foo"
+dnl
+dnl otherwise, it will expand into this:
+dnl
+dnl foo_LDFLAGS"-R /usr/local/lib/foo"
+dnl
+dnl You are encouraged to add support for compilers that this macro
+dnl doesn't currently support.
+dnl
+dnl pushdef([AC_LINKER_OPTION],
+AC_DEFUN(AC_LINKER_OPTION,
+[
+ using_gnu_compiler=
+
+ ifelse(AC_LANG, [C], test x"$GCC" = xyes && using_gnu_compiler=yes,
+ [ifelse(AC_LANG, [CPLUSPLUS], test x"$GXX" = xyes && using_gnu_compiler=yes,
+ [ifelse(AC_LANG, [FORTRAN77], test x"$G77" = xyes && using_gnu_compiler=yes)])])
+
+ for i in $1; do
+ if test x"$using_gnu_compiler" = xyes; then
+ $2="[$]$2 -Xlinker $i"
+ else
+ $2="[$]$2 $i"
+ fi
+ done
+])
+
+
+dnl AC_LIST_MEMBER_OF
+dnl -----------------
+dnl
+dnl usage: AC_LIST_MEMBER_OF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+dnl Processing the elements of a list is tedious in shell programming,
+dnl as lists tend to be implemented as space delimited strings.
+dnl
+dnl This macro searches LIST for ELEMENT, and executes ACTION-IF-FOUND
+dnl if ELEMENT is a member of LIST, otherwise it executes
+dnl ACTION-IF-NOT-FOUND.
+dnl
+dnl pushdef([AC_LIST_MEMBER_OF],
+AC_DEFUN(AC_LIST_MEMBER_OF,
+[
+ dnl Do some sanity checking of the arguments.
+ ifelse($1, , [AC_MSG_ERROR([$0]: 1st arg must be defined)])
+ ifelse($2, , [AC_MSG_ERROR([$0]: 2nd arg must be defined)])
+
+ exists=false
+ for i in $2; do
+ if test x"$1" = x"$i"; then
+ exists=true
+ break
+ fi
+ done
+
+ if test x"$exists" = xtrue; then
+ ifelse($3, , :, $3)
+ else
+ ifelse($4, , :, $4)
+ fi
+])
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
index edb6ff32..1dca1d38 100644
--- a/lib/autoconf/specific.m4
+++ b/lib/autoconf/specific.m4
@@ -1,6 +1,6 @@
dnl Macros that test for specific features.
dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+dnl Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -70,19 +70,26 @@ else
fi
])
+dnl AC_PROG_CC([COMPILER ...])
+dnl --------------------------
+dnl COMPILER ... is a space separated list of C compilers to search for.
+dnl This just gives the user an opportunity to specify an alternative
+dnl search list for the C compiler.
AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_CHECK_PROG(CC, gcc, gcc)
-if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
+ifelse([$1], ,
+[
+ AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32* | *CYGWIN*)
- AC_CHECK_PROG(CC, cl, cl) ;;
- esac
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+ if test -z "$CC"; then
+ AC_CHECK_PROGS(CC, cl)
+ fi
fi
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
+], [AC_CHECK_PROGS(CC, [$1])])
+
+test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_PROG_CC_WORKS
AC_PROG_CC_GNU
@@ -117,9 +124,15 @@ else
fi
])
+dnl AC_PROG_CXX([LIST-OF-COMPILERS])
+dnl --------------------------------
+dnl LIST-OF-COMPILERS is a space separated list of C++ compilers to search
+dnl for (if not specified, a default list is used). This just gives the
+dnl user an opportunity to specify an alternative search list for the C++
+dnl compiler.
AC_DEFUN(AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_CHECK_PROGS(CXX, $CCC c++ g++ gpp CC cxx cc++ cl, g++)
+AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
AC_PROG_CXX_WORKS
AC_PROG_CXX_GNU
@@ -154,24 +167,16 @@ else
fi
])
-dnl Determine a Fortran 77 compiler to use. If `F77' is not already set
-dnl in the environment, check for `g77', `f77' and `f2c', in that order.
-dnl Set the output variable `F77' to the name of the compiler found.
-dnl
-dnl If using `g77' (the GNU Fortran 77 compiler), then `AC_PROG_F77'
-dnl will set the shell variable `G77' to `yes', and empty otherwise. If
-dnl the output variable `FFLAGS' was not already set in the environment,
-dnl then set it to `-g -02' for `g77' (or `-O2' where `g77' does not
-dnl accept `-g'). Otherwise, set `FFLAGS' to `-g' for all other Fortran
-dnl 77 compilers.
-dnl
+dnl AC_PROG_F77 takes an optional first argument which, if specified,
+dnl must be a space separated list of Fortran 77 compilers to search
+dnl for. This just gives the user an opportunity to specify an
+dnl alternative search list for the Fortran 77 compiler.
+dnl
dnl AC_PROG_F77()
AC_DEFUN(AC_PROG_F77,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-if test -z "$F77"; then
- AC_CHECK_PROGS(F77, g77 f77 f2c)
- test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran 77 compiler found in \$PATH])
-fi
+AC_CHECK_PROGS(F77,
+ m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
AC_PROG_F77_WORKS
AC_PROG_F77_GNU
@@ -198,11 +203,14 @@ else
fi
])
+dnl AC_PROG_CC_WORKS
+dnl ----------------
AC_DEFUN(AC_PROG_CC_WORKS,
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
AC_LANG_SAVE
AC_LANG_C
-AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
+AC_TRY_COMPILER([int main(){return(0);}],
+ ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_prog_cc_works)
if test $ac_cv_prog_cc_works = no; then
@@ -213,11 +221,14 @@ AC_MSG_RESULT($ac_cv_prog_cc_cross)
cross_compiling=$ac_cv_prog_cc_cross
])
+dnl AC_PROG_CXX_WORKS
+dnl -----------------
AC_DEFUN(AC_PROG_CXX_WORKS,
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
-AC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
+AC_TRY_COMPILER([int main(){return(0);}],
+ ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_prog_cxx_works)
if test $ac_cv_prog_cxx_works = no; then
@@ -228,12 +239,12 @@ AC_MSG_RESULT($ac_cv_prog_cxx_cross)
cross_compiling=$ac_cv_prog_cxx_cross
])
+dnl AC_PROG_F77_WORKS
+dnl -----------------
dnl Test whether the Fortran 77 compiler can compile and link a trivial
dnl Fortran program. Also, test whether the Fortran 77 compiler is a
dnl cross-compiler (which may realistically be the case if the Fortran
dnl compiler is `g77').
-dnl
-dnl AC_PROG_F77_WORKS()
AC_DEFUN(AC_PROG_F77_WORKS,
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
AC_LANG_SAVE
@@ -252,6 +263,8 @@ AC_MSG_RESULT($ac_cv_prog_f77_cross)
cross_compiling=$ac_cv_prog_f77_cross
])
+dnl AC_PROG_CC_GNU
+dnl --------------
AC_DEFUN(AC_PROG_CC_GNU,
[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
@@ -266,6 +279,8 @@ else
ac_cv_prog_gcc=no
fi])])
+dnl AC_PROG_CXX_GNU
+dnl ---------------
AC_DEFUN(AC_PROG_CXX_GNU,
[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
@@ -280,11 +295,11 @@ else
ac_cv_prog_gxx=no
fi])])
+dnl AC_PROG_F77_GNU
+dnl ---------------
dnl Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
dnl Compiler). This test depends on whether the Fortran 77 compiler can
dnl do CPP pre-processing.
-dnl
-dnl AC_PROG_F77_GNU()
AC_DEFUN(AC_PROG_F77_GNU,
[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77,
[cat > conftest.fpp <<EOF
@@ -298,6 +313,9 @@ else
ac_cv_prog_g77=no
fi])])
+
+dnl AC_PROG_CC_G
+dnl ------------
AC_DEFUN(AC_PROG_CC_G,
[AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g,
[echo 'void f(){}' > conftest.c
@@ -309,6 +327,9 @@ fi
rm -f conftest*
])])
+
+dnl AC_PROG_CXX_G
+dnl -------------
AC_DEFUN(AC_PROG_CXX_G,
[AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g,
[echo 'void f(){}' > conftest.cc
@@ -320,10 +341,11 @@ fi
rm -f conftest*
])])
+
+dnl AC_PROG_F77_G
+dnl -------------
dnl Test whether the Fortran 77 compiler can accept the `-g' option to
dnl enable debugging.
-dnl
-dnl AC_PROG_F77_G()
AC_DEFUN(AC_PROG_F77_G,
[AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g,
[cat > conftest.f << EOF
@@ -360,6 +382,8 @@ Autoconf TCGETA],
fi
])
+dnl AC_PROG_CC_C_O
+dnl --------------
AC_DEFUN(AC_PROG_CC_C_O,
[if test "x$CC" != xcc; then
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
@@ -404,9 +428,11 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
- AC_DEFINE(NO_MINUS_C_MINUS_O)
+ AC_DEFINE(NO_MINUS_C_MINUS_O, 1,
+ [Define if your C compiler doesn't accept -c and -o together.])
fi
-])
+])dnl AC_PROG_CC_C_O
+
dnl Test if the Fortran 77 compiler accepts the options `-c' and `-o'
dnl simultaneously, and define `F77_NO_MINUS_C_MINUS_O' if it does not.
@@ -414,7 +440,7 @@ dnl
dnl The usefulness of this macro is questionable, as I can't really see
dnl why anyone would use it. The only reason I include it is for
dnl completeness, since a similar test exists for the C compiler.
-dnl
+dnl
dnl AC_PROG_F77_C_O
AC_DEFUN(AC_PROG_F77_C_O,
[AC_BEFORE([$0], [AC_PROG_F77])dnl
@@ -443,10 +469,13 @@ if eval "test \"`echo '$ac_cv_prog_f77_'${ac_f77}_c_o`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
- AC_DEFINE(F77_NO_MINUS_C_MINUS_O)
+ AC_DEFINE(F77_NO_MINUS_C_MINUS_O, 1,
+ [Define if your Fortran 77 compiler doesn't accept -c and -o together.])
fi
])
+dnl AC_PROG_MAKE_SET
+dnl ----------------
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
AC_DEFUN(AC_PROG_MAKE_SET,
[AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE})
@@ -483,9 +512,70 @@ dnl Check for mawk first since it's generally faster.
AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
+
+dnl AC_PROG_SED
+dnl -----------
+dnl Check whether the first sed in the path supports long scripts.
+dnl Set the variable $ac_cv_prog_sed_max_cmd to the maximum number
+dnl of commands to put in a sed script, `infinite' meaning a priori
+dnl infinite.
+dnl This macro is not documented on purpose.
+AC_DEFUN([AC_PROG_SED],
+[AC_CACHE_CHECK([for max sed script length], ac_cv_prog_sed_max_cmd,
+[echo >conftest.s "\
+s/0/1/;s/1/2/;s/2/3/;s/3/4/;s/4/5/;s/5/6/;s/6/7/;s/7/8/;s/8/9/;s/9/0/;s/9/O/;"
+dnl 2^4 = 16 lines of 10 commands.
+for ac_cnt in 0 1 2 3
+do
+ cat conftest.s conftest.s >conftest.s1
+ mv conftest.s1 conftest.s
+done
+if test "`echo 0 | sed -f conftest.s`" != 0; then
+dnl HP-UX sed dies with scripts longer than 100 commands.
+ ac_cv_prog_sed_max_cmd=100
+else
+ ac_cv_prog_sed_max_cmd=infinite
+fi
+])dnl
+])
+
+dnl AC_PROG_BINSH
+dnl -------------
+dnl Check the maximum length of an here document.
+dnl FIXME: Is this test really reliable?
+AC_DEFUN([AC_PROG_BINSH],
+[AC_CACHE_CHECK([for max here document length], ac_cv_prog_binsh_max_heredoc,
+[echo >conftest.s1 "\
+ac_test='This is a sample string to test here documents.'"
+dnl 2^8 = 256 lines
+for ac_cnt in 0 1 2 3 4 5 6 7
+do
+ cat conftest.s1 conftest.s1 >conftest.sh
+ mv conftest.sh conftest.s1
+done
+echo 'cat >conftest.s1 <<CEOF' >conftest.sh
+cat conftest.s1 >>conftest.sh
+echo 'echo "Success"' >>conftest.sh
+echo 'CEOF' >>conftest.sh
+$SHELL ./conftest.sh
+if test "`$SHELL ./conftest.s1`" != Success; then
+dnl Some people say to limit oneself to 12, which seems incredibly small.
+ ac_cv_prog_binsh_max_heredoc=12
+else
+ ac_cv_prog_binsh_max_heredoc=infinite
+fi
+])dnl
+])dnl AC_PROG_BINSH
+
+
+dnl AC_PROG_YACC
+dnl ------------
AC_DEFUN(AC_PROG_YACC,
[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
+
+dnl AC_PROG_CPP
+dnl -----------
AC_DEFUN(AC_PROG_CPP,
[AC_MSG_CHECKING(how to run the C preprocessor)
# On Suns, sometimes $CPP names a directory.
@@ -516,8 +606,11 @@ else
fi
AC_MSG_RESULT($CPP)
AC_SUBST(CPP)dnl
-])
+])dnl AC_PROG_CPP
+
+dnl AC_PROG_CXXCPP
+dnl --------------
AC_DEFUN(AC_PROG_CXXCPP,
[AC_MSG_CHECKING(how to run the C++ preprocessor)
if test -z "$CXXCPP"; then
@@ -538,8 +631,12 @@ AC_SUBST(CXXCPP)dnl
dnl Require finding the C or C++ preprocessor, whichever is the
dnl current language.
AC_DEFUN(AC_REQUIRE_CPP,
-[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])
+[ifelse(AC_LANG,
+ C, [AC_REQUIRE([AC_PROG_CPP])],
+ [AC_REQUIRE([AC_PROG_CXXCPP])])])
+dnl AC_PROG_LEX
+dnl -----------
AC_DEFUN(AC_PROG_LEX,
[AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
@@ -552,7 +649,10 @@ then
fi
AC_SUBST(LEXLIB)])
+dnl AC_DECL_YYTEXT
+dnl --------------
dnl Check if lex declares yytext as a char * by default, not a char[].
+dnl FIXME: Why the heck is there the following line?
undefine([AC_DECL_YYTEXT])
AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
@@ -586,9 +686,11 @@ rm -f "${LEX_OUTPUT_ROOT}.c"
])
dnl
if test $ac_cv_prog_lex_yytext_pointer = yes; then
- AC_DEFINE(YYTEXT_POINTER)
+ AC_DEFINE(YYTEXT_POINTER, 1,
+ [Define if `lex' declares `yytext' as a `char *' by default,
+ not a `char[]'.])
fi
-])
+])dnl AC_DECL_YYTEXT
AC_DEFUN(AC_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
@@ -683,8 +785,7 @@ AC_SUBST(LN_S)dnl
])
define(AC_RSH,
-[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code
-)m4exit(4)])
+[AC_FATAL([$0 has been removed; replace it with equivalent code], 4)])
dnl ### Checks for header files
@@ -727,31 +828,7 @@ exit (0); }
], , ac_cv_header_stdc=no, :)
fi])
if test $ac_cv_header_stdc = yes; then
- AC_DEFINE(STDC_HEADERS)
-fi
-])
-
-AC_DEFUN(AC_UNISTD_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
-AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])
-
-AC_DEFUN(AC_USG,
-[AC_OBSOLETE([$0],
- [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
-AC_MSG_CHECKING([for BSD string and memory functions])
-AC_TRY_LINK([#include <strings.h>], [rindex(0, 0); bzero(0, 0);],
- [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(USG)])])
-
-
-dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
-dnl To avoid problems, don't check for gcc2 built-ins.
-AC_DEFUN(AC_MEMORY_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
-AC_MSG_CHECKING(whether string.h declares mem functions)
-AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
-AC_MSG_RESULT($ac_found)
-if test $ac_found = no; then
- AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
+ AC_DEFINE(STDC_HEADERS, 1, [Define if you have the ANSI C header files.])
fi
])
@@ -763,29 +840,24 @@ AC_DEFUN(AC_HEADER_MAJOR,
])
if test $ac_cv_header_sys_types_h_makedev = no; then
-AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)])
+AC_CHECK_HEADER(sys/mkdev.h,
+ [AC_DEFINE(MAJOR_IN_MKDEV, 1,
+ [Define if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
if test $ac_cv_header_sys_mkdev_h = no; then
-AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)])
+ AC_CHECK_HEADER(sys/sysmacros.h,
+ [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+ [Define if `major', `minor', and `makedev' are
+ declared in <sysmacros.h>.])])
fi
fi
])
-AC_DEFUN(AC_HEADER_DIRENT,
-[ac_header_dirent=no
-AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
- [ac_header_dirent=$ac_hdr; break])
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
-else
-AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
-fi
-])
-
+dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
+dnl ----------------------------------------------------
dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE
dnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't.
-dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
AC_DEFUN(AC_CHECK_HEADER_DIRENT,
[ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING([for $1 that defines DIR])
@@ -802,9 +874,10 @@ else
fi
])
+dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
+dnl --------------------------------------------------
dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
dnl defines `DIR'.
-dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
define(AC_CHECK_HEADERS_DIRENT,
[for ac_hdr in $1
do
@@ -815,30 +888,19 @@ changequote([, ])dnl
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl
done])
-AC_DEFUN(AC_DIR_HEADER,
-[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break])
-done
-
-case "$ac_header_dirent" in
-dirent.h) AC_DEFINE(DIRENT) ;;
-sys/ndir.h) AC_DEFINE(SYSNDIR) ;;
-sys/dir.h) AC_DEFINE(SYSDIR) ;;
-ndir.h) AC_DEFINE(NDIR) ;;
-esac
-
-AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
-[AC_TRY_RUN([#include <sys/types.h>
-#include <$ac_header_dirent>
-int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
-if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(VOID_CLOSEDIR)
+AC_DEFUN(AC_HEADER_DIRENT,
+[ac_header_dirent=no
+AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
+ [ac_header_dirent=$ac_hdr; break])
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
+else
+ AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
fi
])
+
AC_DEFUN(AC_HEADER_STAT,
[AC_CACHE_CHECK(whether stat file-mode macros are broken,
ac_cv_header_stat_broken,
@@ -870,10 +932,14 @@ You lose.
#endif
], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
if test $ac_cv_header_stat_broken = yes; then
- AC_DEFINE(STAT_MACROS_BROKEN)
+ AC_DEFINE(STAT_MACROS_BROKEN, 1,
+ [Define if the `S_IS*' macros in <sys/stat.h> do not
+ work properly.])
fi
])
+dnl AC_DECL_SYS_SIGLIST
+dnl -------------------
AC_DEFUN(AC_DECL_SYS_SIGLIST,
[AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
ac_cv_decl_sys_siglist,
@@ -882,12 +948,14 @@ AC_DEFUN(AC_DECL_SYS_SIGLIST,
/* NetBSD declares sys_siglist in unistd.h. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif], [char *msg = *(sys_siglist + 1);],
+#endif
+], [char *msg = *(sys_siglist + 1);],
ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])
if test $ac_cv_decl_sys_siglist = yes; then
- AC_DEFINE(SYS_SIGLIST_DECLARED)
+ AC_DEFINE(SYS_SIGLIST_DECLARED, 1,
+ [Define if `sys_siglist' is declared by <signal.h> or <unistd.h>.])
fi
-])
+])dnl AC_DECL_SYS_SIGLIST
AC_DEFUN(AC_HEADER_SYS_WAIT,
[AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
@@ -904,10 +972,29 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])
if test $ac_cv_header_sys_wait_h = yes; then
- AC_DEFINE(HAVE_SYS_WAIT_H)
+ AC_DEFINE(HAVE_SYS_WAIT_H, 1,
+ [Define if you have <sys/wait.h> that is POSIX.1 compatible.])
fi
])
+dnl A few hasbeen'd macros.
+
+AC_DEFUN(AC_UNISTD_H,
+[AC_HASBEEN([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])])
+
+AC_DEFUN(AC_USG,
+[AC_HASBEEN([$0],
+ [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])])
+
+dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
+dnl To avoid problems, don't check for gcc2 built-ins.
+AC_DEFUN(AC_MEMORY_H,
+[AC_HASBEEN([$0],
+ [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])])
+
+AC_DEFUN(AC_DIR_HEADER,
+[AC_HASBEEN([$0], [; instead use AC_HEADER_DIRENT])])
+
dnl ### Checks for typedefs
@@ -949,16 +1036,18 @@ if test $ac_cv_type_getgroups = cross; then
AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
fi])
-AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
-])
+AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups,
+ [Define to the type of elements in the array set by
+ `getgroups'. Usually this is either `int' or `gid_t'.])
+])dnl AC_TYPE_GETGROUPS
AC_DEFUN(AC_TYPE_UID_T,
[AC_CACHE_CHECK(for uid_t in sys/types.h, ac_cv_type_uid_t,
[AC_EGREP_HEADER(uid_t, sys/types.h,
ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])
if test $ac_cv_type_uid_t = no; then
- AC_DEFINE(uid_t, int)
- AC_DEFINE(gid_t, int)
+ AC_DEFINE(uid_t, int, [Define to `int' if <sys/types.h> doesn't define.])
+ AC_DEFINE(gid_t, int, [Define to `int' if <sys/types.h> doesn't define.])
fi
])
@@ -974,6 +1063,8 @@ AC_DEFUN(AC_TYPE_OFF_T,
AC_DEFUN(AC_TYPE_MODE_T,
[AC_CHECK_TYPE(mode_t, int)])
+dnl AC_TYPE_SIGNAL
+dnl --------------
dnl Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN(AC_TYPE_SIGNAL,
[AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
@@ -989,22 +1080,31 @@ void (*signal ()) ();
#endif
],
[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])
-AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal)
+AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal,
+ [Define as the return type of signal handlers
+ (`int' or `void').])
])
dnl ### Checks for functions
+dnl AC_FUNC_CLOSEDIR_VOID
+dnl ---------------------
+dnl Check whether closedir returns void, and #define CLOSEDIR_VOID in
+dnl that case.
AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
[AC_TRY_RUN([#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
+ ac_cv_func_closedir_void=no,
+ ac_cv_func_closedir_void=yes,
+ ac_cv_func_closedir_void=yes)])
if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(CLOSEDIR_VOID)
+ AC_DEFINE(CLOSEDIR_VOID, 1,
+ [Define if the `closedir' function returns void instead of `int'.])
fi
])
@@ -1017,10 +1117,13 @@ AC_DEFUN(AC_FUNC_FNMATCH,
ac_cv_func_fnmatch_works=yes, ac_cv_func_fnmatch_works=no,
ac_cv_func_fnmatch_works=no)])
if test $ac_cv_func_fnmatch_works = yes; then
- AC_DEFINE(HAVE_FNMATCH)
+ AC_DEFINE(HAVE_FNMATCH, 1,
+ [Define if your system has a working `fnmatch' function.])
fi
])
+dnl AC_FUNC_MMAP
+dnl ------------
AC_DEFUN(AC_FUNC_MMAP,
[AC_CHECK_HEADERS(unistd.h)
AC_CHECK_FUNCS(getpagesize)
@@ -1038,7 +1141,7 @@ AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
+ VM page cache was not coherent with the file system buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
propogated back to all the places they're supposed to be.
@@ -1164,10 +1267,14 @@ main()
], ac_cv_func_mmap_fixed_mapped=yes, ac_cv_func_mmap_fixed_mapped=no,
ac_cv_func_mmap_fixed_mapped=no)])
if test $ac_cv_func_mmap_fixed_mapped = yes; then
- AC_DEFINE(HAVE_MMAP)
+ AC_DEFINE(HAVE_MMAP, 1,
+ [Define if you have a working `mmap' system call.])
fi
-])
+])dnl AC_FUNC_MMAP
+
+dnl AC_FUNC_GETPGRP
+dnl ---------------
AC_DEFUN(AC_FUNC_GETPGRP,
[AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
[AC_TRY_RUN([
@@ -1225,9 +1332,10 @@ main()
AC_MSG_ERROR(cannot check getpgrp if cross compiling))
])
if test $ac_cv_func_getpgrp_void = yes; then
- AC_DEFINE(GETPGRP_VOID)
+ AC_DEFINE(GETPGRP_VOID, 1,
+ [Define if the `getpgrp' function takes no argument.])
fi
-])
+])dnl AC_FUNC_GETPGRP
AC_DEFUN(AC_FUNC_SETPGRP,
[AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void,
@@ -1251,20 +1359,32 @@ main()
AC_MSG_ERROR(cannot check setpgrp if cross compiling))
)
if test $ac_cv_func_setpgrp_void = yes; then
- AC_DEFINE(SETPGRP_VOID)
+ AC_DEFINE(SETPGRP_VOID, 1,
+ [Define if the `setpgrp' function takes no argument.])
fi
])
+dnl Why the heck is that _doprnt does not define HAVE__DOPRNT???
+dnl That the logical name! In addition, why doesn't it use
+dnl AC_CHECK_FUNCS(vprintf)? Because old Autoconf uses sh for loops.
+dnl FIXME: To be changed in Autoconf 3?
AC_DEFUN(AC_FUNC_VPRINTF,
-[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
+[AC_CHECK_FUNC(vprintf,
+ AC_DEFINE(HAVE_VPRINTF, 1,
+ [Define if you have the `vprintf' function.]))
if test "$ac_cv_func_vprintf" != yes; then
-AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
+AC_CHECK_FUNC(_doprnt,
+ AC_DEFINE(HAVE_DOPRNT, 1,
+ [Define if you don't have `vprintf' but do have
+ `_doprnt.']))
fi
])
AC_DEFUN(AC_FUNC_VFORK,
[AC_REQUIRE([AC_TYPE_PID_T])dnl
-AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
+AC_CHECK_HEADER(vfork.h,
+ AC_DEFINE(HAVE_VFORK_H, 1,
+ [Define if you have <vfork.h>.]))
AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works,
[AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -1361,7 +1481,7 @@ main() {
ac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork)
ac_cv_func_vfork_works=$ac_cv_func_vfork)])
if test "x$ac_cv_func_vfork_works" = xno; then
- AC_DEFINE(vfork, fork)
+ AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
fi
])
@@ -1397,9 +1517,10 @@ main() {
}], ac_cv_func_wait3_rusage=yes, ac_cv_func_wait3_rusage=no,
ac_cv_func_wait3_rusage=no)])
if test $ac_cv_func_wait3_rusage = yes; then
- AC_DEFINE(HAVE_WAIT3)
+ AC_DEFINE(HAVE_WAIT3, 1,
+ [Define if you have the `wait3' system call.])
fi
-])
+])dnl AC_FUNC_WAIT3
AC_DEFUN(AC_FUNC_ALLOCA,
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
@@ -1409,7 +1530,9 @@ AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
[AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
ac_cv_working_alloca_h=yes, ac_cv_working_alloca_h=no)])
if test $ac_cv_working_alloca_h = yes; then
- AC_DEFINE(HAVE_ALLOCA_H)
+ AC_DEFINE(HAVE_ALLOCA_H, 1,
+ [Define if you have <alloca.h> and it should be used
+ (not on Ultrix).])
fi
AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
@@ -1437,7 +1560,8 @@ char *alloca ();
], [char *p = (char *) alloca(1);],
ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
if test $ac_cv_func_alloca_works = yes; then
- AC_DEFINE(HAVE_ALLOCA)
+ AC_DEFINE(HAVE_ALLOCA, 1,
+ [Define if you have `alloca', as a function or macro.])
fi
if test $ac_cv_func_alloca_works = no; then
@@ -1446,7 +1570,7 @@ if test $ac_cv_func_alloca_works = no; then
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=alloca.${ac_objext}
- AC_DEFINE(C_ALLOCA)
+ AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.])
AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
[AC_EGREP_CPP(webecray,
@@ -1458,7 +1582,12 @@ wenotbecray
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func)
+ AC_CHECK_FUNC($ac_func,
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of _getb67, GETB67, getb67
+ for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c
+ support on those systems.])
break])
done
fi
@@ -1484,7 +1613,7 @@ main ()
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
fi
AC_SUBST(ALLOCA)dnl
-])
+])dnl AC_FUNC_ALLOCA
AC_DEFUN(AC_FUNC_GETLOADAVG,
[ac_have_func=no # yes means we've found a way to get the load average.
@@ -1511,26 +1640,34 @@ fi
AC_REPLACE_FUNCS(getloadavg)
if test $ac_cv_func_getloadavg = yes; then
- AC_DEFINE(HAVE_GETLOADAVG)
+ AC_DEFINE(HAVE_GETLOADAVG, 1,
+ [Define if your system has its own `getloadavg' function.])
ac_have_func=yes
else
# Figure out what our getloadavg.c needs.
ac_have_func=no
AC_CHECK_HEADER(sys/dg_sys_info.h,
- [ac_have_func=yes; AC_DEFINE(DGUX)
- AC_CHECK_LIB(dgc, dg_sys_info)])
+ [ac_have_func=yes;
+ AC_DEFINE(DGUX, 1, [Define for DGUX with <sys/dg_sys_info.h>.])
+ AC_CHECK_LIB(dgc, dg_sys_info)])
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
# Irix 4.0.5F has the header but not the library.
if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then
- ac_have_func=yes; AC_DEFINE(SVR4)
+ ac_have_func=yes;
+ AC_DEFINE(SVR4, 1,
+ [Define on System V Release 4.])
fi
if test $ac_have_func = no; then
AC_CHECK_HEADER(inq_stats/cpustats.h,
- [ac_have_func=yes; AC_DEFINE(UMAX)
- AC_DEFINE(UMAX4_3)])
+ [ac_have_func=yes;
+ AC_DEFINE(UMAX, 1,
+ [Define for Encore UMAX.])
+ AC_DEFINE(UMAX4_3, 1,
+ [Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>.])])
fi
if test $ac_have_func = no; then
@@ -1543,13 +1680,14 @@ else
fi
AC_CHECK_HEADER(nlist.h,
- [AC_DEFINE(NLIST_STRUCT)
+ [AC_DEFINE(NLIST_STRUCT, 1, [Define if you have <nlist.h>.])
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
[AC_TRY_COMPILE([#include <nlist.h>],
[struct nlist n; n.n_un.n_name = 0;],
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
if test $ac_cv_struct_nlist_n_un = yes; then
- AC_DEFINE(NLIST_NAME_UNION)
+ AC_DEFINE(NLIST_NAME_UNION, 1,
+ [Define if your `struct nlist' has an `n_un' member.])
fi
])dnl
fi # Do not have getloadavg in system libraries.
@@ -1565,7 +1703,10 @@ Yowza Am I SETGID yet
#endif],
ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])
if test $ac_cv_func_getloadavg_setgid = yes; then
- NEED_SETGID=true; AC_DEFINE(GETLOADAVG_PRIVILEGED)
+ NEED_SETGID=true;
+ AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
+ [Define if the `getloadavg' function needs to be run setuid
+ or setgid.])
else
NEED_SETGID=false
fi
@@ -1604,7 +1745,9 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
ac_cv_func_utime_null=no)
rm -f core core.* *.core])
if test $ac_cv_func_utime_null = yes; then
- AC_DEFINE(HAVE_UTIME_NULL)
+ AC_DEFINE(HAVE_UTIME_NULL, 1,
+ [Define if `utime(file, NULL)' sets file's timestamp to the
+ present.])
fi
])
@@ -1619,7 +1762,9 @@ main ()
}], ac_cv_func_strcoll_works=yes, ac_cv_func_strcoll_works=no,
ac_cv_func_strcoll_works=no)])
if test $ac_cv_func_strcoll_works = yes; then
- AC_DEFINE(HAVE_STRCOLL)
+ AC_DEFINE(HAVE_STRCOLL, 1,
+ [Define if you have the `strcoll' function and it is properly
+ defined.])
fi
])
@@ -1639,7 +1784,10 @@ main () {
}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
rm -f core core.* *.core])
if test $ac_cv_func_setvbuf_reversed = yes; then
- AC_DEFINE(SETVBUF_REVERSED)
+ AC_DEFINE(SETVBUF_REVERSED, 1,
+ [Define if the `setvbuf' function takes the buffering type as
+ its second argument and the buffer pointer as the third, as on
+ System V before release 3.])
fi
])
@@ -1648,7 +1796,9 @@ AC_DEFUN(AC_FUNC_GETMNTENT,
AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS",
[AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS",
[AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])])
-AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])])
+AC_CHECK_FUNC(getmntent,
+ [AC_DEFINE(HAVE_GETMNTENT, 1,
+ [Define if you have the `getmntent' function.])])])
AC_DEFUN(AC_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
@@ -1813,10 +1963,13 @@ fi
])
AC_DEFUN(AC_FUNC_STRFTIME,
-[AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)],
+[AC_CHECK_FUNC(strftime,
+ [AC_DEFINE(HAVE_STRFTIME, 1,
+ [Define if you have the `strftime' function.])],
[# strftime is in -lintl on SCO UNIX.
-AC_CHECK_LIB(intl, strftime,
-[AC_DEFINE(HAVE_STRFTIME)
+AC_CHECK_LIB(intl, strftime,
+[AC_DEFINE(HAVE_STRFTIME, 1,
+ [Define if you have the `strftime' function.])
LIBS="-lintl $LIBS"])])])
AC_DEFUN(AC_FUNC_MEMCMP,
@@ -1863,14 +2016,17 @@ extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_sel
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
if test "$ac_not_found" = yes; then
- ac_cv_func_select_arg1=int
- ac_cv_func_select_arg234='int *'
+ ac_cv_func_select_arg1=int
+ ac_cv_func_select_arg234='int *'
ac_cv_func_select_arg5='struct timeval *'
fi
AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1)
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234))
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5))
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $ac_cv_func_select_arg1,
+ [Define to the type of arg1 for `select'.])
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ($ac_cv_func_select_arg234),
+ [Define to the type of args 2, 3 and 4 for `select'.])
+ AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ($ac_cv_func_select_arg5),
+ [Define to the type of arg5 for `select'.])
])
@@ -1885,7 +2041,8 @@ AC_DEFUN(AC_HEADER_TIME,
#include <time.h>],
[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])
if test $ac_cv_header_time = yes; then
- AC_DEFINE(TIME_WITH_SYS_TIME)
+ AC_DEFINE(TIME_WITH_SYS_TIME, 1,
+ [Define if you can safely include both <sys/time.h> and <time.h>.])
fi
])
@@ -1897,7 +2054,8 @@ AC_DEFUN(AC_STRUCT_TM,
[struct tm *tp; tp->tm_sec;],
ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])
if test $ac_cv_struct_tm = sys/time.h; then
- AC_DEFINE(TM_IN_SYS_TIME)
+ AC_DEFINE(TM_IN_SYS_TIME, 1,
+ [Define if your <sys/time.h> declares `struct tm'.])
fi
])
@@ -1906,7 +2064,8 @@ AC_DEFUN(AC_STRUCT_TIMEZONE,
AC_C_STRUCT_MEMBER(tm_zone, [#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm], tm_zone)
if test "$ac_cv_c_struct_member_tm_zone" = yes; then
- AC_DEFINE(HAVE_TM_ZONE)
+ AC_DEFINE(HAVE_TM_ZONE, 1,
+ [Define if your `struct tm' has `tm_zone'.])
else
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
@@ -1918,35 +2077,40 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname. */
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
- AC_DEFINE(HAVE_TZNAME)
+ AC_DEFINE(HAVE_TZNAME, 1,
+ [Define if you don't have `tm_zone' but do have the external
+ array `tzname'.])
fi
fi
])
+AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
+[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
+#include <sys/stat.h>], [struct stat], st_blksize)
+if test $ac_cv_c_struct_member_st_blksize = yes; then
+ AC_DEFINE(HAVE_ST_BLKSIZE, 1,
+ [Define if your `struct stat' has `st_blksize'.])
+fi
+])
+
AC_DEFUN(AC_STRUCT_ST_BLOCKS,
[AC_C_STRUCT_MEMBER(st_blocks, [#include <sys/types.h>
#include <sys/stat.h>], [struct stat], st_blocks)
if test $ac_cv_c_struct_member_st_blocks = yes; then
- AC_DEFINE(HAVE_ST_BLOCKS)
+ AC_DEFINE(HAVE_ST_BLOCKS, 1,
+ [Define if your `struct stat' has `st_blocks'.])
else
LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi
AC_SUBST(LIBOBJS)dnl
])
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
-#include <sys/stat.h>], [struct stat], st_blksize)
-if test $ac_cv_c_struct_member_st_blksize = yes; then
- AC_DEFINE(HAVE_ST_BLKSIZE)
-fi
-])
-
AC_DEFUN(AC_STRUCT_ST_RDEV,
[AC_C_STRUCT_MEMBER(st_rdev, [#include <sys/types.h>
#include <sys/stat.h>], [struct stat], st_rdev)
if test $ac_cv_c_struct_member_st_rdev = yes; then
- AC_DEFINE(HAVE_ST_RDEV)
+ AC_DEFINE(HAVE_ST_RDEV, 1,
+ [Define if your `struct stat' has `st_rdev'.])
fi
])
@@ -1979,7 +2143,7 @@ fi])
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
AC_DEFINE(__CHAR_UNSIGNED__)
fi
-])
+])dnl AC_C_CHAR_UNSIGNED
AC_DEFUN(AC_C_LONG_DOUBLE,
[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
@@ -1994,25 +2158,16 @@ exit(sizeof(long double) < sizeof(double)); }],
ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
fi])
if test $ac_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE)
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1,
+ [Define if the `long double' type works.])
fi
])
AC_DEFUN(AC_INT_16_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl
-AC_MSG_CHECKING(whether int is 16 bits)
-AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no))
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_SIZEOF(int)])])
AC_DEFUN(AC_LONG_64_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl
-AC_MSG_CHECKING(whether long int is 64 bits)
-AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no))
-])
+[AC_HASBEEN([$0], [; instead use AC_CHECK_SIZEOF(long)])])
AC_DEFUN(AC_C_BIGENDIAN,
[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
@@ -2041,7 +2196,9 @@ AC_TRY_RUN([main () {
}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)
fi])
if test $ac_cv_c_bigendian = yes; then
- AC_DEFINE(WORDS_BIGENDIAN)
+ AC_DEFINE(WORDS_BIGENDIAN, 1,
+ [Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX).])
fi
])
@@ -2057,8 +2214,12 @@ done
])
case "$ac_cv_c_inline" in
inline | yes) ;;
- no) AC_DEFINE(inline, ) ;;
- *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
+ no) AC_DEFINE(inline,,
+ [Define as `__inline' if that's what the C compiler calls it,
+ or to nothing if it is not supported.]) ;;
+ *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline,
+ [Define as `__inline' if that's what the C compiler
+ calls it, or to nothing if it is not supported.]) ;;
esac
])
@@ -2070,7 +2231,7 @@ AC_CACHE_CHECK([for working const], ac_cv_c_const,
changequote(<<, >>)dnl
<<
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0, 0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
@@ -2114,34 +2275,39 @@ ccp = (char const *const *) p;
changequote([, ])dnl
ac_cv_c_const=yes, ac_cv_c_const=no)])
if test $ac_cv_c_const = no; then
- AC_DEFINE(const, )
+ AC_DEFINE(const,,
+ [Define to empty if the keyword `const' does not work.])
fi
])
-dnl Note that, unlike const, #defining volatile to be the empty
-dnl string can actually turn a correct program into an incorrect
-dnl one, since removing uses of volatile actually grants the
-dnl compiler permission to perform optimizations that could break
-dnl the user's code. So, do not #define volatile away unless it is
-dnl really necessary to allow the user's code to compile cleanly.
-dnl Benign compiler failures should be tolerated.
+dnl AC_C_VOLATILE
+dnl -------------
+dnl Note that, unlike const, #defining volatile to be the empty string can
+dnl actually turn a correct program into an incorrect one, since removing
+dnl uses of volatile actually grants the compiler permission to perform
+dnl optimizations that could break the user's code. So, do not #define
+dnl volatile away unless it is really necessary to allow the user's code
+dnl to compile cleanly. Benign compiler failures should be tolerated.
AC_DEFUN(AC_C_VOLATILE,
[AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
-[AC_TRY_COMPILE(,
-changequote(<<, >>)dnl
-<<
+[AC_TRY_COMPILE(,[
volatile int x;
-int * volatile y;
->>,
-changequote([, ])dnl
+int * volatile y;],
ac_cv_c_volatile=yes, ac_cv_c_volatile=no)])
if test $ac_cv_c_volatile = no; then
- AC_DEFINE(volatile, )
+ AC_DEFINE(volatile,,
+ [Define to empty if the keyword `volatile' does not work.
+ Warning: valid code using `volatile' can become incorrect
+ without. Disable with care.])
fi
])
-AC_DEFUN(AC_C_STRINGIZE, [
-AC_REQUIRE([AC_PROG_CPP])
+dnl AC_C_STRINGIZE
+dnl --------------
+dnl Checks if `#' can be used to glue strings together at the CPP level.
+dnl Defines HAVE_STRINGIZE if positive.
+AC_DEFUN(AC_C_STRINGIZE,
+[AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for preprocessor stringizing operator])
AC_CACHE_VAL(ac_cv_c_stringize,
AC_EGREP_CPP([#teststring],[
@@ -2149,16 +2315,15 @@ AC_EGREP_CPP([#teststring],[
char *s = x(teststring);
], ac_cv_c_stringize=no, ac_cv_c_stringize=yes))
-if test "${ac_cv_c_stringize}" = yes
-then
- AC_DEFINE(HAVE_STRINGIZE)
+if test "${ac_cv_c_stringize}" = yes; then
+ AC_DEFINE(HAVE_STRINGIZE, 1,
+ [Define if you have the ANSI # stringizing operator in cpp.])
fi
AC_MSG_RESULT([${ac_cv_c_stringize}])
])dnl
define(AC_ARG_ARRAY,
-[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments
-)m4exit(4)])
+[AC_FATAL([$0 has been removed; don't do non-portable things with arguments], 4)])
dnl Check the object extension used by the compiler: typically .o or
dnl .obj. If this is called, some other behaviour will change,
@@ -2184,216 +2349,350 @@ OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext
AC_SUBST(OBJEXT)])
-dnl Determine the linker flags (e.g. `-L' and `-l') for the Fortran 77
+
+dnl AC_F77_LIBRARY_LDFLAGS
+dnl ----------------------
+dnl
+dnl Determine the linker flags (e.g. "-L" and "-l") for the Fortran 77
dnl intrinsic and run-time libraries that are required to successfully
dnl link a Fortran 77 program or shared library. The output variable
dnl FLIBS is set to these flags.
-dnl
+dnl
dnl This macro is intended to be used in those situations when it is
dnl necessary to mix, e.g. C++ and Fortran 77, source code into a single
dnl program or shared library.
-dnl
+dnl
dnl For example, if object files from a C++ and Fortran 77 compiler must
dnl be linked together, then the C++ compiler/linker must be used for
dnl linking (since special C++-ish things need to happen at link time
dnl like calling global constructors, instantiating templates, enabling
dnl exception support, etc.).
-dnl
+dnl
dnl However, the Fortran 77 intrinsic and run-time libraries must be
dnl linked in as well, but the C++ compiler/linker doesn't know how to
dnl add these Fortran 77 libraries. Hence, the macro
-dnl `AC_F77_LIBRARY_LDFLAGS' was created to determine these Fortran 77
+dnl "AC_F77_LIBRARY_LDFLAGS" was created to determine these Fortran 77
dnl libraries.
dnl
dnl This macro was packaged in its current form by Matthew D. Langston
dnl <langston@SLAC.Stanford.EDU>. However, nearly all of this macro
-dnl came from the `OCTAVE_FLIBS' macro in `octave-2.0.13/aclocal.m4',
+dnl came from the "OCTAVE_FLIBS" macro in "octave-2.0.13/aclocal.m4",
dnl and full credit should go to John W. Eaton for writing this
dnl extremely useful macro. Thank you John.
dnl
dnl AC_F77_LIBRARY_LDFLAGS()
+
+dnl We have to "pushdef" this macro for now, because I haven't checked
+dnl this version of the macro into the Autoconf repository yet. --MDL
AC_DEFUN(AC_F77_LIBRARY_LDFLAGS,
-[AC_MSG_CHECKING([for Fortran 77 libraries])
-AC_REQUIRE([AC_PROG_F77])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_VAL(ac_cv_flibs,
-[changequote(, )dnl
-dnl Write a minimal program and compile it with -v. I don't know what
-dnl to do if your compiler doesn't have -v...
-echo " END" > conftest.f
-foutput=`${F77} -v -o conftest conftest.f 2>&1`
+[
+ AC_CACHE_CHECK([for Fortran 77 libraries],
+ ac_cv_flibs,
+ [
+ AC_REQUIRE([AC_PROG_F77])
+ AC_REQUIRE([AC_CYGWIN])
+
+ AC_LANG_SAVE
+ AC_LANG_FORTRAN77
+
+# This is the simplest of all Fortran 77 programs.
+ cat > conftest.$ac_ext <<EOF
+ end
+EOF
+
+ # Save the "compiler output file descriptor" to FD 8.
+ exec 8>&AC_FD_CC
+
+ # Temporarily redirect compiler output to stdout, since this is what
+ # we want to capture in "f77_link_output".
+ exec AC_FD_CC>&1
+
+ # Compile and link our simple test program by passing the "-v" flag
+ # to the Fortran 77 compiler in order to get "verbose" output that
+ # we can then parse for the Fortran 77 linker flags. I don't know
+ # what to do if your compiler doesn't have -v.
+ FFLAGS_SAVE="$FFLAGS"
+ FFLAGS="$FFLAGS -v"
+ f77_link_output=`eval $ac_link 2>&1 | grep -v 'Driving:'`
+ FFLAGS="$FFLAGS_SAVE"
+
+ # Restore the "compiler output file descriptor".
+ exec AC_FD_CC>&8
+
+ rm -f conftest.*
+
+ AC_LANG_RESTORE
+
+ # This will ultimately be our output variable.
+ FLIBS=
+
+changequote(, )dnl
+
+ # If we are using xlf then replace all the commas with spaces.
+ if test `echo $f77_link_output | grep xlfentry > /dev/null 2>&1`; then
+ f77_link_output=`echo $f77_link_output | sed 's/,/ /g'`
+ fi
+
+ # The "save_arg" variable will be set to the current option
+ # (i.e. something beginning with a "-") when we come across an
+ # option that we think will take an argument (e.g. -L
+ # /usr/local/lib/foo). When "save_arg" is set, we append "arg" to
+ # "seen" without any further examination.
+ save_arg=
+
+
+ # This is just a "list" (i.e. space delimited elements) of flags
+ # that we've already seen. This just help us not add the same
+ # linker flags twice to "FLIBS".
+ seen=
+
+ # The basic algorithm is that if "arg" makes it all the way through
+ # down to the bottom of the the "for" loop, then it is added to
+ # "FLIBS".
+ for arg in $f77_link_output; do
+ # Assume that none of the options that take arguments expect the
+ # argument to start with a "-". If we ever see this case, then
+ # reset "previous_arg" so that we don't try and process "arg" as
+ # an argument.
+ previous_arg="$save_arg"
+ test -n "`echo $arg | sed -n -e '/^-/!p'`" && previous_arg=
+ case "$previous_arg" in
+ '')
+ case "$arg" in
+ /*.a)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, seen="$seen $arg")
+ changequote(, )dnl
+ ;;
+ -bI:*)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, [AC_LINKER_OPTION([$arg], seen)])
+ changequote(, )dnl
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt0.o | -l[cm] | -lgcc | -LANG:=*)
+ arg=
+ ;;
+ -lkernel32)
+ # Only ignore this flag under the Cygwin
+ # environment.
+ if test x"$CYGWIN" = xyes; then arg=; else seen="$seen $arg"; fi
+ ;;
+ -[LRu])
+ # These flags, when seen by themselves, take an
+ # argument.
+ save_arg=$arg
+ arg=
+ ;;
+ -YP,*)
+ temp_arg=
+ for i in `echo $arg | sed -e 's%^P,%-L%' -e 's%:% -L%g'`; do
+ # Append to "seen" if it's not already
+ # there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($i, $seen, temp_arg="$temp_arg $i", seen="$seen $i")
+ changequote(, )dnl
+ done
+ arg="$temp_arg"
+ ;;
+ -[lLR]*)
+ # Append to "seen" if it's not already there.
+ changequote([, ])dnl
+ AC_LIST_MEMBER_OF($arg, $seen, arg=, seen="$seen $arg")
+ changequote(, )dnl
+ ;;
+ *)
+ # Ignore everything else.
+ arg=
+ ;;
+ esac
+ ;;
+ -[LRu])
+ arg="$previous_arg $arg"
+ ;;
+ esac
+
+ # If "arg" has survived up until this point, then put it in
+ # "FLIBS".
+ test -n "$arg" && FLIBS="$FLIBS $arg"
+ done
+
+ # Assumption: We only see "LD_RUN_PATH" on Solaris systems. If this
+ # is seen, then we insist that the "run path" must be an absolute
+ # path (i.e. it must begin with a "/").
+ ld_run_path=`echo $f77_link_output | sed -n -e 's%^.*LD_RUN_PATH *= *\(/[^ ]*\).*$%\1%p'`
+ test -n "$ld_run_path" && FLIBS="$ld_run_path $FLIBS"
+
+changequote([, ])dnl
+
+ ac_cv_flibs="$FLIBS"
+ ])
+
+ AC_SUBST(FLIBS)
+
+])
+
+
+dnl Test for the name mangling scheme used by the Fortran 77 compiler.
+dnl Two variables are set by this macro:
dnl
-dnl The easiest thing to do for xlf output is to replace all the commas
-dnl with spaces. Try to only do that if the output is really from xlf,
-dnl since doing that causes problems on other systems.
+dnl f77_case: Set to either "upper" or "lower", depending on the
+dnl case of the name mangling.
dnl
-xlf_p=`echo $foutput | grep xlfentry`
-if test -n "$xlf_p"; then
- foutput=`echo $foutput | sed 's/,/ /g'`
-fi
+dnl f77_underscore: Set to either "no", "single" or "double", depending
+dnl on how underscores (i.e. "_") are appended to
+dnl identifiers, if at all.
+dnl
+dnl If no underscores are appended, then the value is
+dnl "no".
dnl
-ld_run_path=`echo $foutput | \
- sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`
+dnl If a single underscore is appended, even with
+dnl identifiers which already contain an underscore
+dnl somewhere in their name, then the value is
+dnl "single".
dnl
-dnl We are only supposed to find this on Solaris systems...
-dnl Uh, the run path should be absolute, shouldn't it?
+dnl If a single underscore is appended *and* two
+dnl underscores are appended to identifiers which
+dnl already contain an underscore somewhere in their
+dnl name, then the value is "double".
dnl
-case "$ld_run_path" in
- /*)
- if test "$ac_cv_prog_gcc" = yes; then
- ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
+dnl AC_F77_NAME_MANGLING()
+AC_DEFUN(AC_F77_NAME_MANGLING,
+[
+ AC_CACHE_CHECK([for Fortran 77 name-mangling scheme],
+ ac_cv_f77_mangling,
+ [
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_F77])
+
+ AC_LANG_SAVE
+ AC_LANG_FORTRAN77
+
+cat > conftest.$ac_ext <<EOF
+ subroutine foobar()
+ return
+ end
+ subroutine foo_bar()
+ return
+ end
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+
+ mv conftest.${ac_objext} cf77_test.${ac_objext}
+
+ AC_LANG_SAVE
+ AC_LANG_C
+
+ ac_save_LIBS="$LIBS"
+ LIBS="cf77_test.${ac_objext} $LIBS"
+
+ f77_case=
+ f77_underscore=
+
+ AC_TRY_LINK_FUNC(foobar,
+ f77_case=lower
+ f77_underscore=no
+ foo_bar=foo_bar_,
+ AC_TRY_LINK_FUNC(foobar_,
+ f77_case=lower
+ f77_underscore=single
+ foo_bar=foo_bar__,
+ AC_TRY_LINK_FUNC(FOOBAR,
+ f77_case=upper
+ f77_underscore=no
+ foo_bar=FOO_BAR_,
+ AC_TRY_LINK_FUNC(FOOBAR_,
+ f77_case=upper
+ f77_underscore=single
+ foo_bar=FOO_BAR__))))
+
+ AC_TRY_LINK_FUNC(${foo_bar}, f77_underscore=double)
+
+ if test x"$f77_case" = x -o x"$f77_underscore" = x; then
+ ac_cv_f77_mangling="unknown"
+ else
+ ac_cv_f77_mangling="$f77_case case, $f77_underscore underscores"
+ fi
+
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+
+ rm -f conftest*
+ rm -f cf77_test*
+
else
- ld_run_path="-R $ld_run_path"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
fi
- ;;
- *)
- ld_run_path=
- ;;
-esac
-dnl
-flibs=
-lflags=
-dnl
-dnl If want_arg is set, we know we want the arg to be added to the list,
-dnl so we don't have to examine it.
-dnl
-want_arg=
-dnl
-for arg in $foutput; do
- old_want_arg=$want_arg
- want_arg=
-dnl
-dnl None of the options that take arguments expect the argument to
-dnl start with a -, so pretend we didn't see anything special.
+
+dnl We need to pop the language stack twice.
+ AC_LANG_RESTORE
+ AC_LANG_RESTORE
+])])
+
+
+dnl Defines C macros F77_FUNC(name,NAME) and F77_FUNC_(name,NAME) to
+dnl properly mangle the names of C identifiers, and C identifiers with
+dnl underscores, respectively, so that they match the name mangling
+dnl scheme used by the Fortran 77 compiler.
dnl
- if test -n "$old_want_arg"; then
- case "$arg" in
- -*)
- old_want_arg=
- ;;
- esac
- fi
- case "$old_want_arg" in
- '')
- case $arg in
- /*.a)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- lflags="$lflags $arg"
- fi
- ;;
- -bI:*)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- if test "$ac_cv_prog_gcc" = yes; then
- lflags="$lflags -Xlinker $arg"
- else
- lflags="$lflags $arg"
- fi
- fi
- ;;
- -lang* | -lcrt0.o | -lc | -lgcc)
- arg=
- ;;
- -[lLR])
- want_arg=$arg
- arg=
- ;;
- -[lLR]*)
- exists=false
- for f in $lflags; do
- if test x$arg = x$f; then
- exists=true
- fi
- done
- if $exists; then
- arg=
- else
- case "$arg" in
- -lkernel32)
- case "$canonical_host_type" in
- *-*-cygwin*)
- arg=
- ;;
- *)
- lflags="$lflags $arg"
- ;;
- esac
- ;;
- -lm)
- ;;
- *)
- lflags="$lflags $arg"
- ;;
+dnl AC_F77_WRAPPERS()
+AC_DEFUN(AC_F77_WRAPPERS,
+[
+ AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+ ac_cv_f77_wrappers,
+ [
+dnl Be optimistic at first.
+ ac_cv_f77_wrappers="yes"
+
+ AC_REQUIRE([AC_F77_NAME_MANGLING])
+ case "$f77_case" in
+ lower)
+ case "$f77_underscore" in
+ no)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name])
+ ;;
+ single)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
+ ;;
+ double)
+ AC_DEFINE([F77_FUNC(name,NAME)], [name ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
+ ;;
+ *)
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
+ esac
+ ;;
+ upper)
+ case "$f77_underscore" in
+ no)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
+ ;;
+ single)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
+ ;;
+ double)
+ AC_DEFINE([F77_FUNC(name,NAME)], [NAME ## _])
+ AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
+ ;;
+ *)
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
esac
- fi
- ;;
- -u)
- want_arg=$arg
- arg=
- ;;
- -Y)
- want_arg=$arg
- arg=
- ;;
+ ;;
*)
- arg=
- ;;
- esac
- ;;
- -[lLR])
- arg="$old_want_arg $arg"
- ;;
- -u)
- arg="-u $arg"
- ;;
- -Y)
-dnl
-dnl Should probably try to ensure unique directory options here too.
-dnl This probably only applies to Solaris systems, and then will only
-dnl work with gcc...
-dnl
- arg=`echo $arg | sed -e 's%^P,%%'`
- SAVE_IFS=$IFS
- IFS=:
- list=
- for elt in $arg; do
- list="$list -L$elt"
- done
- IFS=$SAVE_IFS
- arg="$list"
- ;;
- esac
-dnl
- if test -n "$arg"; then
- flibs="$flibs $arg"
- fi
-done
-if test -n "$ld_run_path"; then
- flibs_result="$ld_run_path $flibs"
-else
- flibs_result="$flibs"
-fi
-changequote([, ])dnl
-ac_cv_flibs="$flibs_result"])
-FLIBS="$ac_cv_flibs"
-AC_SUBST(FLIBS)dnl
-AC_MSG_RESULT($FLIBS)
-])
+ AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+ ;;
+ esac
+])])
dnl ### Checks for operating system services
@@ -2418,8 +2717,7 @@ interpval="$ac_cv_sys_interpreter"
])
define(AC_HAVE_POUNDBANG,
-[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments
-])m4exit(4)])
+[AC_FATAL([$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments], 4)])
AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
[AC_CACHE_CHECK(for long file names, ac_cv_sys_long_file_names,
@@ -2453,7 +2751,8 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
done])
if test $ac_cv_sys_long_file_names = yes; then
- AC_DEFINE(HAVE_LONG_FILE_NAMES)
+ AC_DEFINE(HAVE_LONG_FILE_NAMES, 1,
+ [Define if you support file names longer than 14 characters.])
fi
])
@@ -2476,7 +2775,9 @@ main () {
}
], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
if test $ac_cv_sys_restartable_syscalls = yes; then
- AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
+ AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS, 1,
+ [Define if system calls automatically restart after interruption
+ by a signal.])
fi
])
@@ -2693,7 +2994,8 @@ AC_DEFUN(AC_PATH_XTRA,
[AC_REQUIRE([AC_PATH_X])dnl
if test "$no_x" = yes; then
# Not all programs may use this symbol, but it does not hurt to define it.
- AC_DEFINE(X_DISPLAY_MISSING)
+ AC_DEFINE(X_DISPLAY_MISSING, 1,
+ [Define if the X Window System is missing or not being used.])
X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
if test -n "$x_includes"; then
@@ -2887,19 +3189,27 @@ AC_EGREP_CPP(yes,
[#ifdef _AIX
yes
#endif
-], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
-])
+],
+[AC_MSG_RESULT(yes)
+AC_DEFINE(_ALL_SOURCE)],
+AC_MSG_RESULT(no))
+])dnl AC_AIX
AC_DEFUN(AC_MINIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
if test "$MINIX" = yes; then
- AC_DEFINE(_POSIX_SOURCE)
- AC_DEFINE(_POSIX_1_SOURCE, 2)
- AC_DEFINE(_MINIX)
+ AC_DEFINE(_POSIX_SOURCE, 1,
+ [Define if you need to in order for `stat' and other things to
+ work.])
+ AC_DEFINE(_POSIX_1_SOURCE, 2,
+ [Define if the system does not provide POSIX.1 features except
+ with this defined.])
+ AC_DEFINE(_MINIX, 1,
+ [Define if on MINIX.])
fi
-])
+])dnl AC_MINIX
AC_DEFUN(AC_ISC_POSIX,
[AC_REQUIRE([AC_PROG_CC])dnl
@@ -2911,7 +3221,9 @@ if test -d /etc/conf/kconfig.d &&
then
AC_MSG_RESULT(yes)
ISC=yes # If later tests want to check for ISC.
- AC_DEFINE(_POSIX_SOURCE)
+ AC_DEFINE(_POSIX_SOURCE, 1,
+ [Define if you need to in order for stat and other things to
+ work.])
if test "$GCC" = yes; then
CC="$CC -posix"
else
@@ -2921,7 +3233,7 @@ else
AC_MSG_RESULT(no)
ISC=
fi
-])
+])dnl AC_ISC_POSIX
AC_DEFUN(AC_XENIX_DIR,
[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
@@ -2937,7 +3249,7 @@ if test "$XENIX" = yes; then
test $ac_header_dirent = dirent.h && LIBS="-ldir $LIBS"
LIBS="$LIBS -lx"
fi
-])
+])dnl AC_XENIX_DIR
AC_DEFUN(AC_DYNIX_SEQ,
[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl