]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1999-09-21 Akim Demaille <akim@epita.fr>
authorAkim Demaille <akim@epita.fr>
Tue, 21 Sep 1999 09:58:58 +0000 (09:58 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 21 Sep 1999 09:58:58 +0000 (09:58 +0000)
* 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)

15 files changed:
ChangeLog
Makefile.in
NEWS
THANKS
acgeneral.m4
acspecific.m4
autoconf.sh
autoconf.texi
autoheader.m4
autoheader.sh
configure
doc/Makefile.in
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4

index 661b794021124033d0b115807caef0a6b2973aa2..f3676c0ee0fa2eb0b7b7aec3794a8228d7451225 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+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-21  Ben Elliston  <bje@cygnus.com>
 
        * THANKS: Update some mail addresses.
index 7ccda43e8ab1f004e62f15c625903061404cfce8..b8917d7e866f46f56da053511ec4a4654837afc5 100644 (file)
@@ -190,15 +190,12 @@ uninstall:
        if test -f standards.info || test -f $(srcdir)/standards.info; \
        then cd $(infodir) && rm -f standards.info*; fi
 
-# Why don't we run ./autoconf here?  There are substitutions performed
-# by autoconf which are necessary.  Now, the Makefile breaks configure,
-# and one has to ./autoconf to have the right thing happen.
 ${srcdir}/configure: configure.in $(M4FILES)
-       echo "FIXME: Why not running ./autoconf -m . ?"
        cd $(srcdir) && \
        rm -f configure configure.tmp && \
-       $(M4) autoconf.m4 configure.in > configure.tmp && \
-       chmod +x configure.tmp && mv configure.tmp configure
+       M4=$(M4) AC_MACRODIR=. AWK=$(AWK) \
+         $(SHELL) ./autoconf.sh
+
 Makefile: Makefile.in config.status
        $(SHELL) ./config.status
 config.status: configure
diff --git a/NEWS b/NEWS
index e5f8f175398226f9c437dd3ea4aebe8252298f82..50c81f3b786a557cd4824556c72bedaaa3863c9e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,14 +1,33 @@
-Major changes in release 2.14:
-
-* New macro AC_HELP_STRING to format an Autoconf macro's help string so
-  that it looks pretty when the user executes `configure --help'.  See
-  the Texinfo documentation for details.
+Major changes in release 2.15:
+
+* config.status
+  - much faster on most architectures
+  - now has a useful --help
+  - concurrent executions
+    It is now safe to use `make -j' with configure.
+* New macros
+  - AC_CHECK_DECL and AC_CHECK_DECLS
+    To check whether a symbol is declared.
+  - AC_HELP_STRING
+    To format an Autoconf macro's help string so that it looks pretty
+    when the user executes `configure --help'.
+* Environment variables are kept when reconfiguring.
+  The previous scheme to set envvar before running configure was
+    ENV=VAL ./configure
+  what prevented configure from remembering the environment in which
+  it was run, therefore --recheck was run in an inconsistent environment.
+  Now, one runs
+    ./configure ENV=VAR
+  and the --recheck works correctly.
 * Support for automatically determining a Fortran 77 compilers
   name-mangling scheme.  New CPP macros F77_FUNC and F77_FUNC_ are
   provided to wrap C/C++ identifiers, thus making it easier and more
   transparent for C/C++ to call Fortran 77 routines, and Fortran 77 to
   call C/C++ routines.  See the Texinfo documentation for details.
 \f
+Major changes in release 2.14:
+  There was no release of GNU Autoconf 2.14.
+\f
 Major changes in release 2.13:
 
 * Support for building on Win32 systems where the only available C or
@@ -34,7 +53,7 @@ Major changes in release 2.13:
 * Merge of the FSF version of config.guess and config.sub to modernise
   these scripts. Add support for a few new hosts in config.guess.
   Incorporate latest versions of install-sh, mkinstalldirs and
-  texinfo.tex from the FSF. 
+  texinfo.tex from the FSF.
 * autoreconf is capable of running automake if necessary (and
   applicable).
 * Support for Fortran 77. See the Texinfo documentation for details.
@@ -59,7 +78,7 @@ Major changes in release 2.11:
 * AC_CONFIG_HEADER expands shell variables in its argument.
 * New macros: AC_FUNC_FNMATCH, AC_FUNC_SETPGRP.
 * The "checking..." messages and the source code for test programs that
-  fail are saved in config.log. 
+  fail are saved in config.log.
 * Another workaround has been added for seds with small command length limits.
 * config.sub and config.guess recognize more system types.
 * Bug fixes.
diff --git a/THANKS b/THANKS
index 27eda911d0ced7043d63abed4b78b0c5d9864079..05f260b69de490d0d3899285c7f14ed397ebcacd 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -2,41 +2,45 @@ Autoconf was originally written by David J. MacKenzie <djm@uunet.uu.net>.
 It would not be what it is today without the invaluable help of these
 people:
 
-Aaron Crane <aaronc@pobox.com>
-Akim Demaille <akim@epita.fr>
-Alexandre Oliva <oliva@dcc.unicamp.br>
-Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Ben Elliston <bje@cygnus.com>
-Chris Provenzano <proven@cygnus.com>
-Christian Krone <krischan@sql.de>
-Dave Adams <adams@hpesdwa.fc.hp.com>
-Didier Verna <verna@inf.enst.fr>
-Doug Evans <dje@canuck.cygnus.com>
-Eric Mumpower <nocturne@mit.edu>
-Felix Lee <flee@cygnus.com>
-Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
-Gordon Matzigkeit <gord@trick.fig.org>
-H.J. Lu <hjl@gnu.org>
-Ian Lance Taylor <ian@cygnus.com>
-J"orn Rennecke <amylaar@cygnus.co.uk>
-James A. Lupo <lupoja@feynman.ml.wpafb.af.mil>
-Jason Molenda <jsm@cygnus.com>
-Jeff Garzik <jgarzik@pobox.com>
-Jeffrey A Law (law@cygnus.com)
-Karl Berry <karl@cs.umb.edu>
-Matthew D. Langston <langston@SLAC.Stanford.EDU>
-Mike Stump <mrs@wrs.com>
-Miles Bader <miles@gnu.ai.mit.edu>
-Paul Eggert <eggert@twinsun.com>
-Pavel Roskin <pavel_roskin@geocities.com>
-Philipp Thomas <kthomas@gwdg.de>
-Richard Stallman <rms@gnu.org>
-Roland McGrath <roland@gnu.org>
-Scott Bambrough <scottb@corelcomputer.com>
-Steven G. Johnson <stevenj@alum.mit.edu>
-Stu Grossman <grossman@cygnus.com>
-Syd Polk <spolk@cygnus.com>
-Tom Tromey <tromey@cygnus.com>
+Aaron Crane            aaronc@pobox.com
+Akim Demaille          akim@epita.fr
+Alexandre Oliva                oliva@dcc.unicamp.br
+Andreas Schwab         schwab@issan.informatik.uni-dortmund.de
+Ben Elliston           bje@cygnus.com
+Chris Provenzano       proven@cygnus.com
+Christian Krone                krischan@sql.de
+Dave Adams             adams@hpesdwa.fc.hp.com
+Didier Verna           verna@inf.enst.fr
+Doug Evans             dje@canuck.cygnus.com
+Eric Mumpower          nocturne@mit.edu
+Felix Lee              flee@cygnus.com
+Gary V. Vaughan                gvaughan@oranda.demon.co.uk
+Gordon Matzigkeit      gord@trick.fig.org
+H.J. Lu                        hjl@gnu.org
+Ian Lance Taylor       ian@cygnus.com
+J"orn Rennecke         amylaar@cygnus.co.uk
+James A. Lupo          lupoja@feynman.ml.wpafb.af.mil
+Jason Molenda          jsm@cygnus.com
+Jeff Garzik            jgarzik@pobox.com
+Jeffrey A Law          law@cygnus.com
+Jim Blandy             jimb@wookumz.gnu.ai.mit.edu
+Jim Meyering           meyering@ascend.com
+Karl Berry             karl@cs.umb.edu
+Kaveh R. Ghazi         ghazi@caip.rutgers.edu
+Matthew D. Langston    langston@SLAC.Stanford.EDU
+Mike Stump             mrs@wrs.com
+Miles Bader            miles@gnu.ai.mit.edu
+Noah Friedman          friedman@gnu.ai.mit.edu
+Paul Eggert            eggert@twinsun.com
+Pavel Roskin           pavel_roskin@geocities.com
+Philipp Thomas         kthomas@gwdg.de
+Richard Stallman       rms@gnu.org
+Roland McGrath         roland@gnu.org
+Scott Bambrough                scottb@corelcomputer.com
+Steven G. Johnson      stevenj@alum.mit.edu
+Stu Grossman           grossman@cygnus.com
+Syd Polk               spolk@cygnus.com
+Tom Tromey             tromey@cygnus.com
 
 Many people are not named here because we lost track of them.  We
 thank them!  Please, help us keeping this list up to date.
index e70bd5b8df68067cdaf81ec89dfa7c5e7e88840c..796ec3c729db6e64b4b199bb9f2daf35a0903e8d 100644 (file)
@@ -76,6 +76,7 @@ m4_prefix([format])
 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])])
 
 
@@ -122,7 +123,7 @@ 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
 ])
 
@@ -149,7 +150,7 @@ 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
-dnl If the REPLACED-FUNCTTION and ARGUMENT are defined, then declare that
+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'.
@@ -161,6 +162,29 @@ 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)
 
@@ -206,7 +230,7 @@ define(AC_VAR_GET,
 dnl AC_VAR_TEST_SET(VARIABLE)
 dnl -------------------------
 dnl Expands into the `test' expression which is true if VARIABLE
-dnl is set.  Polymorphic.
+dnl is set.  Polymorphic.  Should be dnl'ed.
 define(AC_VAR_TEST_SET,
 [AC_VAR_IF_INDIR([$1],
            [eval "test \"\${$1+set}\" = set"],
@@ -219,14 +243,8 @@ dnl ------------------------------------------
 dnl Implement a shell `if-then-else' depending whether VARIABLE is set
 dnl or not.  Polymorphic.
 define(AC_VAR_IF_SET,
-[if AC_VAR_TEST_SET([$1]); then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , ,
-[else
-  $3
-])dnl
-fi
-])
+[AC_SHELL_IFELSE(AC_VAR_TEST_SET([$1]), [$2], [$3])])
+
 
 dnl AC_VAR_PUSHDEF and AC_VAR_POPDEF
 dnl --------------------------------
@@ -302,28 +320,30 @@ dnl Include a protection against `%' (used as a sed separator) in FROM and TO.
 dnl Forbid appearence of `-' in FROM elsewhere than in the last position,
 dnl since we might otherwise trigger a GNU m4 bug (version 1.4 included).
 dnl ALPHABET may contain characters interval.
-define(AC_TR,
-[ifelse(regexp([$2$3], [%]), -1,,
-       [AC_FATAL([$0: `%' cannot be used.  Change the definition of $0])])dnl
-ifelse(regexp([$2], [-]), -1,, len([$2]),,
-       [AC_FATAL([$0: `-' cannot be used but in the last position.])])dnl
-ifelse(len([$2]), len([$3]),,
-       [AC_FATAL([$0: argument 2 and 3 should have the same length])])dnl
-AC_VAR_IF_INDIR([$1],
-  [`echo "$1" | sed 'y%$2%$3%;s%[^$4]%$5%g'`],
-  [patsubst(translit([$1], [$2], [$3]),
-                             [[^$4]], [$5])])])
-
-dnl AC_TR_DEFINE(EXPRESSION)
-dnl ------------------------
+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.
-define(AC_TR_DEFINE,
-[AC_TR([$1],
-       [*abcdefghijklmnopqrstuvwxyz],
-       [PABCDEFGHIJKLMNOPQRSTUVWXYZ],
-       [A-Z0-9_],
-       [_])])
+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)
@@ -332,11 +352,12 @@ 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_]], [_])])])
+            [[^a-zA-Z0-9_]], [_])])])
 
 
 
@@ -636,9 +657,10 @@ MFLAGS= MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
-# Sed expression to map a string onto a valid sh variable name
+# 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=
@@ -1063,7 +1085,7 @@ AC_DIVERT_POP()dnl to NORMAL
 dnl AC_INCLUDE
 AC_DEFUN(AC_INCLUDE,
 [ifelse($1, [], [], [dnl
-  esyscmd([for file in $1; do echo "builtin(include,$file)dnl"; done])dnl
+  esyscmd([for file in $1; do echo "m4_include($file)dnl"; done])dnl
 ])])
 
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
@@ -1304,9 +1326,9 @@ 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,
-[AC_FATAL(Autoconf version $7 or higher is required for this script)])])
+[ifelse(
+  m4_eval([$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]),
+  1, [AC_FATAL(Autoconf version $7 or higher is required for this script)])])
 
 dnl Complain and exit if the Autoconf version is less than VERSION.
 dnl AC_PREREQ(VERSION)
@@ -1576,6 +1598,7 @@ 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.
@@ -1585,24 +1608,30 @@ AC_VAR_IF_SET([$1],
               [$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_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
@@ -1638,17 +1667,17 @@ AC_DIVERT_POP()dnl
 
 dnl ### Printing messages at autoconf run time
 
-dnl _AC_MESSAGE(MESSAGE)
+dnl _AC_ERRPRINT(MESSAGE)
 dnl Report the MESSAGE at m4 time, with line and filename.
-define(_AC_MESSAGE, [errprint(__file__:__line__: [$1
+define(_AC_ERRPRINT, [errprint(__file__:__line__: [$1
 ])])
 
 dnl AC_WARNING(MESSAGE)
-define(AC_WARNING, [_AC_MESSAGE([warning: $1])])
+define(AC_WARNING, [_AC_ERRPRINT([warning: $1])])
 
 dnl AC_FATAL(MESSAGE [, EXIT-STATUS])
 define(AC_FATAL,
-[_AC_MESSAGE([error: $1])
+[_AC_ERRPRINT([error: $1])
 m4exit(ifdef([$2], [$2], 1))])
 
 
@@ -1667,7 +1696,7 @@ dnl _AC_ECHO_UNQUOTED(STRING [ , FD ])
 dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG).
 dnl The shell perform its expansions on STRING.
 define([_AC_ECHO_UNQUOTED],
-[echo "$1" 1>&ifelse($2,, AC_FD_MSG, $2)])
+[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),
@@ -1712,6 +1741,10 @@ dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
 define(AC_MSG_ERROR,
 [{ _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
 
@@ -1785,7 +1818,7 @@ define(AC_BEFORE,
 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
 ])])
@@ -2032,6 +2065,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.
@@ -2059,8 +2093,7 @@ dnl            [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
 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"])
@@ -2082,14 +2115,13 @@ 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 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,
+AC_DEFUN(AC_CHECK_LIB,
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_lib_$1_$2])dnl
+AC_CACHE_CHECK([for $2 in -l$1], ac_var,
 [ac_save_LIBS="$LIBS"
 LIBS="-l$1 $5 $LIBS"
 AC_TRY_LINK(dnl
@@ -2104,30 +2136,20 @@ 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_var, yes), AC_VAR_SET(ac_var, no))
+LIBS="$ac_save_LIBS"])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+               [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
   LIBS="-l$1 $LIBS"
-], [$3])
-else
-  AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
+  $3],
+               [$4])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_LIB
 
 dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
 dnl                 [, OTHER-LIBRARIES]]])
+dnl FIXME: Remove
 AC_DEFUN(AC_HAVE_LIBRARY,
 [AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
 changequote(<<, >>)dnl
@@ -2145,7 +2167,7 @@ LIBS="$ac_save_LIBS"
 AC_MSG_RESULT($AC_CV_NAME)
 if test "$AC_CV_NAME" = yes; then
   ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]AC_TR_DEFINE(AC_LIB_NAME))
+[AC_DEFINE([HAVE_LIB]AC_TR_CPP(AC_LIB_NAME))
   LIBS="-l[]AC_LIB_NAME[] $LIBS"
 ], [$2])
 ifelse([$3], , , [else
@@ -2346,31 +2368,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_var_header], [ac_cv_header_$1])dnl
+AC_CACHE_CHECK([for $1], ac_var_header,
+[AC_TRY_CPP([#include <$1>],
+AC_VAR_SET(ac_var_header, yes), AC_VAR_SET(ac_var_header, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var_header) = yes,
+                [$2], [$3])dnl
+AC_VAR_POPDEF([ac_var_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
 ])
 
@@ -2410,19 +2424,52 @@ dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 AC_DEFUN(AC_CHECK_FILES,
 [AC_FOREACH([AC_FILE_NAME], [$1],
   [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
-                 [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_[]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_DEFINE(HAVE_$ac_file)) $2],
+dnl              [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_file)) $2],
 dnl              [$3])dnl
 dnl done
 dnl ])
 
 
+dnl ### Checking for declared symbols
+
+
+dnl AC_CHECK_DECL(SYMBOL, [, INCLUDES,
+dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl --------------------------------------------------------
+dnl Check if SYMBOL (a variable or a function) is declared.
+AC_DEFUN([AC_CHECK_DECL],
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 is declared], ac_var,
+[AC_TRY_COMPILE($2,
+[#ifndef $1
+char *p = (char *) $1;
+#endif
+],
+AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+               [$3], [$4])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_DECL
+
+dnl AC_CHECK_DECL(SYMBOL... , [, INCLUDES,
+dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+AC_DEFUN(AC_CHECK_DECLS,
+[for ac_sym in $1
+do
+AC_CHECK_DECL($ac_sym,
+              [$2],
+              [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $3],
+              [$4])dnl
+done
+])
+
 dnl ### Checking for library functions
 
 
@@ -2457,27 +2504,17 @@ choke me
 f = $1;
 #endif
 ], AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
-dnl The ridiculous following `:' are coming from the fact that we
-dnl need to have a body for these tests, otherwise some shells will
-dnl die.  FIXME: We should write a macro specifically to handle this kind
-dnl of switches, since they are very common in Autoconf.
-if test AC_VAR_GET(ac_var) = yes; then
-  :
-ifset([$2], [  $2
-])dnl
-else
-  :
-ifset([$3], [  $3
-])dnl
-fi
-AC_VAR_POPDEF([ac_var])])
+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,
-              [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_$ac_func)) $2],
+              [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
               [$3])dnl
 done
 ])
@@ -2507,7 +2544,7 @@ main()
   AC_VAR_SET(ac_var, `cat conftestval`),
   AC_VAR_SET(ac_var, 0),
   ifset([$2], AC_VAR_SET(ac_var, $2)))])
-AC_DEFINE_UNQUOTED(AC_TR_DEFINE(sizeof_$1), AC_VAR_GET(ac_var))
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_var))
 AC_VAR_POPDEF([ac_var])dnl
 ])
 
@@ -2516,6 +2553,9 @@ dnl ### Checking for typedefs
 
 
 dnl AC_CHECK_TYPE(TYPE, DEFAULT)
+dnl FIXME: This is an extremely badly choosen 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)
@@ -2679,7 +2719,7 @@ dnl tmp-file config-file', hence their update is atomic.
 : \${CONFIG_FILES="$1"}
 ifdef([AC_LIST_HEADER], [: \${CONFIG_HEADERS=AC_LIST_HEADER}
 ])dnl
-rm -fr \`echo "\$CONFIG_FILES ifdef([AC_LIST_HEADER], \$CONFIG_HEADERS)" | sed "s/:@BKL@^ @BKR@*//g"\`
+rm -fr \`echo "\$CONFIG_FILES" | sed "s/:@BKL@^ @BKR@*//g"\`
 trap 'rm -fr \$confstat*; exit 1' 1 2 15
 EOF
 dnl The following three sections are in charge of their own here
@@ -2822,8 +2862,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.
+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.
@@ -3027,8 +3067,8 @@ 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.
+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
@@ -3070,8 +3110,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.
+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.
@@ -3097,7 +3137,7 @@ changequote([, ])dnl
   fi
 done
 EOF
-])
+])dnl AC_OUTPUT_LINKS
 
 dnl This is a subroutine of AC_OUTPUT.
 dnl It is called after running config.status.
@@ -3145,8 +3185,8 @@ ifdef([AC_PROVIDE_AC_PROG_INSTALL],[  ac_given_INSTALL="$INSTALL"
     case "$srcdir" in
     .) ;;
     *)
-      dnl FIXME: should actually be mkinstalldirs (parents may have
-      dnl to be created too.
+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(cannot create `pwd`/$ac_config_dir)
index 503bf87f0137926893dabf8c04f456ad177c2833..7ac816e8cfef02615190a5325330c8ce38199f35 100644 (file)
@@ -167,7 +167,7 @@ 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
 dnl AC_PROG_F77()
 AC_DEFUN(AC_PROG_F77,
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
@@ -232,7 +232,7 @@ 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
 dnl AC_PROG_F77_WORKS()
 AC_DEFUN(AC_PROG_F77_WORKS,
 [AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
@@ -283,7 +283,7 @@ fi])])
 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
 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,
@@ -322,7 +322,7 @@ rm -f conftest*
 
 dnl Test whether the Fortran 77 compiler can accept the `-g' option to
 dnl enable debugging.
-dnl 
+dnl
 dnl AC_PROG_F77_G()
 AC_DEFUN(AC_PROG_F77_G,
 [AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g,
@@ -414,7 +414,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
@@ -1806,7 +1806,7 @@ fi
 AC_DEFUN(AC_FUNC_STRFTIME,
 [AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)],
 [# strftime is in -lintl on SCO UNIX.
-AC_CHECK_LIB(intl, strftime, 
+AC_CHECK_LIB(intl, strftime,
 [AC_DEFINE(HAVE_STRFTIME)
 LIBS="-lintl $LIBS"])])])
 
@@ -1854,8 +1854,8 @@ 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])
@@ -2988,7 +2988,10 @@ 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))
 ])
 
 AC_DEFUN(AC_MINIX,
index c6934961b48b9e374cc03fb633a8c1a025efef4c..afea20b2963fbb248f7501df7c764ad39709d0cb 100644 (file)
@@ -1,6 +1,6 @@
 #! @SHELL@
 # autoconf -- create `configure' using m4 macros
-# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 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
@@ -145,7 +145,7 @@ if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
   sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout |
     while read macro; do
       grep -n "^[^#]*$macro" $infile /dev/null
-      test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro"
+      test $? -eq 1 && echo "***BUG in Autoconf--please report*** $macro"
     done | sort -u >&2
   status=1
 fi
@@ -167,6 +167,7 @@ $AWK '
 s/@BKL@/[/g
 s/@BKR@/]/g
 s/@DLR@/$/g
+s/@PND@/#/g
 ' >&4
 
 rm -f $tmpout
index 52f3664910dad4d76434775266f7d32cb663461b..9e56720e9e8d4f4ae8685f1a545f26308ee7a6cd 100644 (file)
@@ -138,8 +138,7 @@ package.  This is edition @value{EDITION}, for Autoconf version
 * Preprocessor Symbol Index::   Index of C preprocessor symbols defined
 * Macro Index::                 Index of Autoconf macros
 
-@detailmenu
- --- The Detailed Node Listing ---
+@detailmenu --- The Detailed Node Listing ---
 
 Making @code{configure} Scripts
 
@@ -176,6 +175,7 @@ Existing Tests
 * Libraries::                   Library archives that might be missing
 * Library Functions::           C library functions that might be missing
 * Header Files::                Header files that might be missing
+* Declarations::                Declarations that may be missing
 * Structures::                  Structures or members that might be missing
 * Typedefs::                    @code{typedef}s that might be missing
 * C Compiler Characteristics::
@@ -198,6 +198,11 @@ Header Files
 * Particular Headers::          Special handling to find certain headers
 * Generic Headers::             How to find other headers
 
+Declarations
+
+* Particular Declarations::     Macros to check for certain declarations
+* Generic Declarations::        How to find other declarations
+
 Structures
 
 * Particular Structures::       Macros to check for certain stucture members
@@ -800,11 +805,11 @@ for more information.
 @end defmac
 
 Small packages may store all their macros in @code{aclocal.m4}.  As the
-set of macros grows, or for maintenance reasons, a maintainer may prefer 
+set of macros grows, or for maintenance reasons, a maintainer may prefer
 to split the macros in several files.  In this case, Autoconf must be
 told which files to load, and in which order.
 
-@defmac AC_INCLUDE (@var{file(s)})
+@defmac AC_INCLUDE (@var{file}...)
 @maindex AC_INCLUDE
 Read the macro definitions that appear in the listed files.  A list of
 space-separated filenames or shell globbing patterns is expected.  The
@@ -1539,6 +1544,7 @@ Symbols}, for how to get those symbol definitions into your program.
 * Libraries::                   Library archives that might be missing
 * Library Functions::           C library functions that might be missing
 * Header Files::                Header files that might be missing
+* Declarations::                Declarations that may be missing
 * Structures::                  Structures or members that might be missing
 * Typedefs::                    @code{typedef}s that might be missing
 * C Compiler Characteristics::
@@ -2279,7 +2285,7 @@ declares it in a header file you should be including, so you shouldn't
 redeclare it, lest your declaration conflict.
 @end defmac
 
-@node Header Files, Structures, Library Functions, Existing Tests
+@node Header Files, Declarations, Library Functions, Existing Tests
 @section Header Files
 
 The following macros check for the presence of certain C header files.
@@ -2298,12 +2304,42 @@ it, then you can use one of the general header file check macros.
 These macros check for particular system header files---whether they
 exist, and in some cases whether they declare certain symbols.
 
-@defmac AC_DECL_SYS_SIGLIST
-@maindex DECL_SYS_SIGLIST
-@cvindex SYS_SIGLIST_DECLARED
-Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
-declared in a system header file, either @file{signal.h} or
-@file{unistd.h}.
+@defmac AC_HEADER_STAT
+@maindex HEADER_STAT
+@maindex STAT_MACROS_BROKEN
+If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in
+@file{sys/stat.h} do not work properly (returning false positives),
+define @code{STAT_MACROS_BROKEN}.  This is the case on Tektronix UTekV,
+Amdahl UTS and Motorola System V/88.
+@end defmac
+
+@defmac AC_HEADER_TIME
+@maindex HEADER_TIME
+@cvindex TIME_WITH_SYS_TIME
+If a program may include both @file{time.h} and @file{sys/time.h},
+define @code{TIME_WITH_SYS_TIME}.  On some older systems,
+@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not
+protected against multiple inclusion, so programs should not explicitly
+include both files.  This macro is useful in programs that use, for
+example, @code{struct timeval} or @code{struct timezone} as well as
+@code{struct tm}.  It is best used in conjunction with
+@code{HAVE_SYS_TIME_H}, which can be checked for using
+@code{AC_CHECK_HEADERS(sys/time.h)}.
+
+@example
+@group
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+@end group
+@end example
 @end defmac
 
 @defmac AC_DIR_HEADER
@@ -2564,7 +2600,58 @@ the loop on the first match.  If @var{action-if-not-found} is given, it
 is executed when one of the header files is not found.
 @end defmac
 
-@node Structures, Typedefs, Header Files, Existing Tests
+@node Declarations, Structures, Header Files, Existing Tests
+@section Declarations
+
+The following macros check for the declaration of variables and
+functions.  If there is no macro specifically defined to check for a
+symbol you need, then you can use the general macro (@pxref{Generic
+Declarations}) or, for more complex tests, you may use
+@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}).
+
+@menu
+* Particular Declarations::     Macros to check for certain declarations
+* Generic Declarations::        How to find other declarations
+@end menu
+
+@node Particular Declarations, Generic Declarations, Declarations, Declarations
+@subsection Particular Declaration Checks
+
+The following macros check for certain declarations.
+
+@defmac AC_DECL_SYS_SIGLIST
+@maindex DECL_SYS_SIGLIST
+@cvindex SYS_SIGLIST_DECLARED
+Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist}
+is declared in a system header file, either @file{signal.h} or
+@file{unistd.h}.
+@end defmac
+
+@node Generic Declarations,  , Particular Declarations, Declarations
+@subsection Generic Declaration Checks
+
+These macros are used to find declarations not covered by the particular
+test macros.
+
+@defmac AC_CHECK_DECL (@var{symbol}, @r{[}@var{includes}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]]})
+@maindex CHECK_DECL
+If @var{symbol} (a function or a variable) is declared in
+@var{includes}, run shell commands @var{action-if-found}, otherwise
+@var{action-if-not-found}.
+@end defmac
+
+@defmac AC_CHECK_DECLS (@var{symbol}@dots{}, @r{[}@var{includes} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]]})
+@maindex CHECK_DECLS
+@cvindex @var{symbol}_DECLARED
+For each given @var{symbol} (whitespace-separated), define
+@code{@var{symbol}_DECLARED} (in all capitals) if @var{symbol} is
+declared.  If @var{action-if-found} is given, it is additional shell
+code to execute when one of the function declarations is found,
+otherwise @var{action-if-not-found} is executed.
+@end defmac
+
+
+@node Structures, Typedefs, Declarations, Existing Tests
 @section Structures
 
 The following macros check for the presence of certain members in C
@@ -2583,44 +2670,6 @@ member you need, then you can use the general structure member macro
 
 The following macros check for certain structures or structure members.
 
-@defmac AC_HEADER_STAT
-@maindex HEADER_STAT
-@maindex STAT_MACROS_BROKEN
-If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in
-@file{sys/stat.h} do not work properly (returning false positives),
-define @code{STAT_MACROS_BROKEN}.  This is the case on Tektronix UTekV,
-Amdahl UTS and Motorola System V/88.
-@end defmac
-
-@defmac AC_HEADER_TIME
-@maindex HEADER_TIME
-@cvindex TIME_WITH_SYS_TIME
-If a program may include both @file{time.h} and @file{sys/time.h},
-define @code{TIME_WITH_SYS_TIME}.  On some older systems,
-@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not
-protected against multiple inclusion, so programs should not explicitly
-include both files.  This macro is useful in programs that use, for
-example, @code{struct timeval} or @code{struct timezone} as well as
-@code{struct tm}.  It is best used in conjunction with
-@code{HAVE_SYS_TIME_H}, which can be checked for using
-@code{AC_CHECK_HEADERS(sys/time.h)}.
-
-@example
-@group
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-@end group
-@end example
-@end defmac
-
 @defmac AC_STRUCT_ST_BLKSIZE
 @maindex STRUCT_ST_BLKSIZE
 @cvindex HAVE_ST_BLKSIZE
index 73736c210ae978051d10045923acdd2db0922de7..55c9c23237347ebf51c8181724ec2d220de2d9f9 100644 (file)
@@ -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,8 @@ 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
@@ -65,6 +65,17 @@ $4
 ])
 ])
 
+define([AC_CHECK_DECLS], [#
+  ifelse([$3], , [
+@@@decls="$decls $1"@@@
+], [
+# If it was found, we do:
+$3
+# If it was not found, we do:
+$4
+])
+])
+
 define([AC_HAVE_LIBRARY], [#
 changequote(<<, >>)dnl
 define(<<AC_LIB_NAME>>, dnl
index 66033d2e68b750e4778898766f74903a4ea14716..426fd4dc57b0b8306ec9233e30eaf6de5085d232 100644 (file)
@@ -56,8 +56,6 @@ case "${M4}" in
     test -f "${M4}" || M4=m4 ;;
 esac
 
-ac_LF_and_DOT="`echo; echo .`"
-
 localdir=.
 show_version=no
 
@@ -116,6 +114,7 @@ types=
 funcs=
 headers=
 libs=
+decls=
 
 if test "$localdir" != .; then
   use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
@@ -132,9 +131,9 @@ 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
-# modified autoconf processing of the input file.  The sed hair is
-# necessary to win for multi-line macro invocations.
+# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, LIBS and DECLS
+# 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
@@ -215,7 +214,7 @@ $syms
 EOF
    fgrep -f $fgrep_tmp
    rm -f $fgrep_tmp) |
-  tr @. "$ac_LF_and_DOT"
+  tr @. "`echo; echo .`"
 # 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
@@ -224,7 +223,7 @@ EOF
 # would break.
 fi
 
-echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
+echo "$types" | tr ,. "`echo`." | sort | uniq | while read ctype; do
   test -z "$ctype" && continue
   sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
   echo "
@@ -261,6 +260,15 @@ if test -n "$libs"; then
   done
 fi
 
+if test -n "$decls"; then
+  for decl in `for x in $decls; do echo $x; done | sort | uniq`; do
+   sym="`echo ${decl} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
+    echo "
+/* Define if you have the \`${decl}' declaration.  */
+#undef ${sym}_DECLARED"
+  done
+fi
+
 if test -n "$verbatim"; then
   echo "$verbatim"
 fi
index d482c54fa9d219ff839b301ef28e7d75ae9ac9e3..d7b46a6fe5c39dfc087ef377e224c49def04980c 100755 (executable)
--- a/configure
+++ b/configure
@@ -52,8 +52,9 @@ MFLAGS= MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
-# Sed expression to map a string onto a valid sh variable name
+# Sed expression to map a string onto a valid sh and CPP variable names.
 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'
 
 ac_prev=
 for ac_option
@@ -586,7 +587,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word... $ac_c" 1>&6
-echo "configure:590: checking for $ac_word" 1>&5
+echo "configure:591: checking for $ac_word" 1>&5
 if test "${ac_cv_path_M4+set}" = set; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -627,7 +628,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word... $ac_c" 1>&6
-echo "configure:631: checking for $ac_word" 1>&5
+echo "configure:632: checking for $ac_word" 1>&5
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -660,7 +661,7 @@ done
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word... $ac_c" 1>&6
-echo "configure:664: checking for $ac_word" 1>&5
+echo "configure:665: checking for $ac_word" 1>&5
 if test "${ac_cv_path_PERL+set}" = set; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -730,7 +731,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6
-echo "configure:734: checking for a BSD compatible install" 1>&5
+echo "configure:735: checking for a BSD compatible install" 1>&5
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -944,7 +945,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 : \${CONFIG_FILES="Makefile testsuite/Makefile"}
-rm -fr \`echo "\$CONFIG_FILES " | sed "s/:[^ ]*//g"\`
+rm -fr \`echo "\$CONFIG_FILES" | sed "s/:[^ ]*//g"\`
 trap 'rm -fr \$confstat*; exit 1' 1 2 15
 EOF
 cat >>$CONFIG_STATUS <<EOF
@@ -1042,7 +1043,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
     # The file is in a subdirectory.
-            test ! -d "$ac_dir" && mkdir "$ac_dir"
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
     # A "../" for each directory in $ac_dir_suffix.
     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
index 7ccda43e8ab1f004e62f15c625903061404cfce8..b8917d7e866f46f56da053511ec4a4654837afc5 100644 (file)
@@ -190,15 +190,12 @@ uninstall:
        if test -f standards.info || test -f $(srcdir)/standards.info; \
        then cd $(infodir) && rm -f standards.info*; fi
 
-# Why don't we run ./autoconf here?  There are substitutions performed
-# by autoconf which are necessary.  Now, the Makefile breaks configure,
-# and one has to ./autoconf to have the right thing happen.
 ${srcdir}/configure: configure.in $(M4FILES)
-       echo "FIXME: Why not running ./autoconf -m . ?"
        cd $(srcdir) && \
        rm -f configure configure.tmp && \
-       $(M4) autoconf.m4 configure.in > configure.tmp && \
-       chmod +x configure.tmp && mv configure.tmp configure
+       M4=$(M4) AC_MACRODIR=. AWK=$(AWK) \
+         $(SHELL) ./autoconf.sh
+
 Makefile: Makefile.in config.status
        $(SHELL) ./config.status
 config.status: configure
index 52f3664910dad4d76434775266f7d32cb663461b..9e56720e9e8d4f4ae8685f1a545f26308ee7a6cd 100644 (file)
@@ -138,8 +138,7 @@ package.  This is edition @value{EDITION}, for Autoconf version
 * Preprocessor Symbol Index::   Index of C preprocessor symbols defined
 * Macro Index::                 Index of Autoconf macros
 
-@detailmenu
- --- The Detailed Node Listing ---
+@detailmenu --- The Detailed Node Listing ---
 
 Making @code{configure} Scripts
 
@@ -176,6 +175,7 @@ Existing Tests
 * Libraries::                   Library archives that might be missing
 * Library Functions::           C library functions that might be missing
 * Header Files::                Header files that might be missing
+* Declarations::                Declarations that may be missing
 * Structures::                  Structures or members that might be missing
 * Typedefs::                    @code{typedef}s that might be missing
 * C Compiler Characteristics::
@@ -198,6 +198,11 @@ Header Files
 * Particular Headers::          Special handling to find certain headers
 * Generic Headers::             How to find other headers
 
+Declarations
+
+* Particular Declarations::     Macros to check for certain declarations
+* Generic Declarations::        How to find other declarations
+
 Structures
 
 * Particular Structures::       Macros to check for certain stucture members
@@ -800,11 +805,11 @@ for more information.
 @end defmac
 
 Small packages may store all their macros in @code{aclocal.m4}.  As the
-set of macros grows, or for maintenance reasons, a maintainer may prefer 
+set of macros grows, or for maintenance reasons, a maintainer may prefer
 to split the macros in several files.  In this case, Autoconf must be
 told which files to load, and in which order.
 
-@defmac AC_INCLUDE (@var{file(s)})
+@defmac AC_INCLUDE (@var{file}...)
 @maindex AC_INCLUDE
 Read the macro definitions that appear in the listed files.  A list of
 space-separated filenames or shell globbing patterns is expected.  The
@@ -1539,6 +1544,7 @@ Symbols}, for how to get those symbol definitions into your program.
 * Libraries::                   Library archives that might be missing
 * Library Functions::           C library functions that might be missing
 * Header Files::                Header files that might be missing
+* Declarations::                Declarations that may be missing
 * Structures::                  Structures or members that might be missing
 * Typedefs::                    @code{typedef}s that might be missing
 * C Compiler Characteristics::
@@ -2279,7 +2285,7 @@ declares it in a header file you should be including, so you shouldn't
 redeclare it, lest your declaration conflict.
 @end defmac
 
-@node Header Files, Structures, Library Functions, Existing Tests
+@node Header Files, Declarations, Library Functions, Existing Tests
 @section Header Files
 
 The following macros check for the presence of certain C header files.
@@ -2298,12 +2304,42 @@ it, then you can use one of the general header file check macros.
 These macros check for particular system header files---whether they
 exist, and in some cases whether they declare certain symbols.
 
-@defmac AC_DECL_SYS_SIGLIST
-@maindex DECL_SYS_SIGLIST
-@cvindex SYS_SIGLIST_DECLARED
-Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
-declared in a system header file, either @file{signal.h} or
-@file{unistd.h}.
+@defmac AC_HEADER_STAT
+@maindex HEADER_STAT
+@maindex STAT_MACROS_BROKEN
+If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in
+@file{sys/stat.h} do not work properly (returning false positives),
+define @code{STAT_MACROS_BROKEN}.  This is the case on Tektronix UTekV,
+Amdahl UTS and Motorola System V/88.
+@end defmac
+
+@defmac AC_HEADER_TIME
+@maindex HEADER_TIME
+@cvindex TIME_WITH_SYS_TIME
+If a program may include both @file{time.h} and @file{sys/time.h},
+define @code{TIME_WITH_SYS_TIME}.  On some older systems,
+@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not
+protected against multiple inclusion, so programs should not explicitly
+include both files.  This macro is useful in programs that use, for
+example, @code{struct timeval} or @code{struct timezone} as well as
+@code{struct tm}.  It is best used in conjunction with
+@code{HAVE_SYS_TIME_H}, which can be checked for using
+@code{AC_CHECK_HEADERS(sys/time.h)}.
+
+@example
+@group
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+@end group
+@end example
 @end defmac
 
 @defmac AC_DIR_HEADER
@@ -2564,7 +2600,58 @@ the loop on the first match.  If @var{action-if-not-found} is given, it
 is executed when one of the header files is not found.
 @end defmac
 
-@node Structures, Typedefs, Header Files, Existing Tests
+@node Declarations, Structures, Header Files, Existing Tests
+@section Declarations
+
+The following macros check for the declaration of variables and
+functions.  If there is no macro specifically defined to check for a
+symbol you need, then you can use the general macro (@pxref{Generic
+Declarations}) or, for more complex tests, you may use
+@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}).
+
+@menu
+* Particular Declarations::     Macros to check for certain declarations
+* Generic Declarations::        How to find other declarations
+@end menu
+
+@node Particular Declarations, Generic Declarations, Declarations, Declarations
+@subsection Particular Declaration Checks
+
+The following macros check for certain declarations.
+
+@defmac AC_DECL_SYS_SIGLIST
+@maindex DECL_SYS_SIGLIST
+@cvindex SYS_SIGLIST_DECLARED
+Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist}
+is declared in a system header file, either @file{signal.h} or
+@file{unistd.h}.
+@end defmac
+
+@node Generic Declarations,  , Particular Declarations, Declarations
+@subsection Generic Declaration Checks
+
+These macros are used to find declarations not covered by the particular
+test macros.
+
+@defmac AC_CHECK_DECL (@var{symbol}, @r{[}@var{includes}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]]})
+@maindex CHECK_DECL
+If @var{symbol} (a function or a variable) is declared in
+@var{includes}, run shell commands @var{action-if-found}, otherwise
+@var{action-if-not-found}.
+@end defmac
+
+@defmac AC_CHECK_DECLS (@var{symbol}@dots{}, @r{[}@var{includes} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]]})
+@maindex CHECK_DECLS
+@cvindex @var{symbol}_DECLARED
+For each given @var{symbol} (whitespace-separated), define
+@code{@var{symbol}_DECLARED} (in all capitals) if @var{symbol} is
+declared.  If @var{action-if-found} is given, it is additional shell
+code to execute when one of the function declarations is found,
+otherwise @var{action-if-not-found} is executed.
+@end defmac
+
+
+@node Structures, Typedefs, Declarations, Existing Tests
 @section Structures
 
 The following macros check for the presence of certain members in C
@@ -2583,44 +2670,6 @@ member you need, then you can use the general structure member macro
 
 The following macros check for certain structures or structure members.
 
-@defmac AC_HEADER_STAT
-@maindex HEADER_STAT
-@maindex STAT_MACROS_BROKEN
-If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in
-@file{sys/stat.h} do not work properly (returning false positives),
-define @code{STAT_MACROS_BROKEN}.  This is the case on Tektronix UTekV,
-Amdahl UTS and Motorola System V/88.
-@end defmac
-
-@defmac AC_HEADER_TIME
-@maindex HEADER_TIME
-@cvindex TIME_WITH_SYS_TIME
-If a program may include both @file{time.h} and @file{sys/time.h},
-define @code{TIME_WITH_SYS_TIME}.  On some older systems,
-@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not
-protected against multiple inclusion, so programs should not explicitly
-include both files.  This macro is useful in programs that use, for
-example, @code{struct timeval} or @code{struct timezone} as well as
-@code{struct tm}.  It is best used in conjunction with
-@code{HAVE_SYS_TIME_H}, which can be checked for using
-@code{AC_CHECK_HEADERS(sys/time.h)}.
-
-@example
-@group
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-@end group
-@end example
-@end defmac
-
 @defmac AC_STRUCT_ST_BLKSIZE
 @maindex STRUCT_ST_BLKSIZE
 @cvindex HAVE_ST_BLKSIZE
index e70bd5b8df68067cdaf81ec89dfa7c5e7e88840c..796ec3c729db6e64b4b199bb9f2daf35a0903e8d 100644 (file)
@@ -76,6 +76,7 @@ m4_prefix([format])
 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])])
 
 
@@ -122,7 +123,7 @@ 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
 ])
 
@@ -149,7 +150,7 @@ 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
-dnl If the REPLACED-FUNCTTION and ARGUMENT are defined, then declare that
+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'.
@@ -161,6 +162,29 @@ 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)
 
@@ -206,7 +230,7 @@ define(AC_VAR_GET,
 dnl AC_VAR_TEST_SET(VARIABLE)
 dnl -------------------------
 dnl Expands into the `test' expression which is true if VARIABLE
-dnl is set.  Polymorphic.
+dnl is set.  Polymorphic.  Should be dnl'ed.
 define(AC_VAR_TEST_SET,
 [AC_VAR_IF_INDIR([$1],
            [eval "test \"\${$1+set}\" = set"],
@@ -219,14 +243,8 @@ dnl ------------------------------------------
 dnl Implement a shell `if-then-else' depending whether VARIABLE is set
 dnl or not.  Polymorphic.
 define(AC_VAR_IF_SET,
-[if AC_VAR_TEST_SET([$1]); then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , ,
-[else
-  $3
-])dnl
-fi
-])
+[AC_SHELL_IFELSE(AC_VAR_TEST_SET([$1]), [$2], [$3])])
+
 
 dnl AC_VAR_PUSHDEF and AC_VAR_POPDEF
 dnl --------------------------------
@@ -302,28 +320,30 @@ dnl Include a protection against `%' (used as a sed separator) in FROM and TO.
 dnl Forbid appearence of `-' in FROM elsewhere than in the last position,
 dnl since we might otherwise trigger a GNU m4 bug (version 1.4 included).
 dnl ALPHABET may contain characters interval.
-define(AC_TR,
-[ifelse(regexp([$2$3], [%]), -1,,
-       [AC_FATAL([$0: `%' cannot be used.  Change the definition of $0])])dnl
-ifelse(regexp([$2], [-]), -1,, len([$2]),,
-       [AC_FATAL([$0: `-' cannot be used but in the last position.])])dnl
-ifelse(len([$2]), len([$3]),,
-       [AC_FATAL([$0: argument 2 and 3 should have the same length])])dnl
-AC_VAR_IF_INDIR([$1],
-  [`echo "$1" | sed 'y%$2%$3%;s%[^$4]%$5%g'`],
-  [patsubst(translit([$1], [$2], [$3]),
-                             [[^$4]], [$5])])])
-
-dnl AC_TR_DEFINE(EXPRESSION)
-dnl ------------------------
+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.
-define(AC_TR_DEFINE,
-[AC_TR([$1],
-       [*abcdefghijklmnopqrstuvwxyz],
-       [PABCDEFGHIJKLMNOPQRSTUVWXYZ],
-       [A-Z0-9_],
-       [_])])
+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)
@@ -332,11 +352,12 @@ 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_]], [_])])])
+            [[^a-zA-Z0-9_]], [_])])])
 
 
 
@@ -636,9 +657,10 @@ MFLAGS= MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
-# Sed expression to map a string onto a valid sh variable name
+# 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=
@@ -1063,7 +1085,7 @@ AC_DIVERT_POP()dnl to NORMAL
 dnl AC_INCLUDE
 AC_DEFUN(AC_INCLUDE,
 [ifelse($1, [], [], [dnl
-  esyscmd([for file in $1; do echo "builtin(include,$file)dnl"; done])dnl
+  esyscmd([for file in $1; do echo "m4_include($file)dnl"; done])dnl
 ])])
 
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
@@ -1304,9 +1326,9 @@ 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,
-[AC_FATAL(Autoconf version $7 or higher is required for this script)])])
+[ifelse(
+  m4_eval([$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]),
+  1, [AC_FATAL(Autoconf version $7 or higher is required for this script)])])
 
 dnl Complain and exit if the Autoconf version is less than VERSION.
 dnl AC_PREREQ(VERSION)
@@ -1576,6 +1598,7 @@ 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.
@@ -1585,24 +1608,30 @@ AC_VAR_IF_SET([$1],
               [$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_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
@@ -1638,17 +1667,17 @@ AC_DIVERT_POP()dnl
 
 dnl ### Printing messages at autoconf run time
 
-dnl _AC_MESSAGE(MESSAGE)
+dnl _AC_ERRPRINT(MESSAGE)
 dnl Report the MESSAGE at m4 time, with line and filename.
-define(_AC_MESSAGE, [errprint(__file__:__line__: [$1
+define(_AC_ERRPRINT, [errprint(__file__:__line__: [$1
 ])])
 
 dnl AC_WARNING(MESSAGE)
-define(AC_WARNING, [_AC_MESSAGE([warning: $1])])
+define(AC_WARNING, [_AC_ERRPRINT([warning: $1])])
 
 dnl AC_FATAL(MESSAGE [, EXIT-STATUS])
 define(AC_FATAL,
-[_AC_MESSAGE([error: $1])
+[_AC_ERRPRINT([error: $1])
 m4exit(ifdef([$2], [$2], 1))])
 
 
@@ -1667,7 +1696,7 @@ dnl _AC_ECHO_UNQUOTED(STRING [ , FD ])
 dnl Expands into a sh call to echo onto FD (default is AC_FD_MSG).
 dnl The shell perform its expansions on STRING.
 define([_AC_ECHO_UNQUOTED],
-[echo "$1" 1>&ifelse($2,, AC_FD_MSG, $2)])
+[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),
@@ -1712,6 +1741,10 @@ dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
 define(AC_MSG_ERROR,
 [{ _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
 
@@ -1785,7 +1818,7 @@ define(AC_BEFORE,
 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
 ])])
@@ -2032,6 +2065,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.
@@ -2059,8 +2093,7 @@ dnl            [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
 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"])
@@ -2082,14 +2115,13 @@ 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 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,
+AC_DEFUN(AC_CHECK_LIB,
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_lib_$1_$2])dnl
+AC_CACHE_CHECK([for $2 in -l$1], ac_var,
 [ac_save_LIBS="$LIBS"
 LIBS="-l$1 $5 $LIBS"
 AC_TRY_LINK(dnl
@@ -2104,30 +2136,20 @@ 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_var, yes), AC_VAR_SET(ac_var, no))
+LIBS="$ac_save_LIBS"])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+               [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
   LIBS="-l$1 $LIBS"
-], [$3])
-else
-  AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
+  $3],
+               [$4])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_LIB
 
 dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
 dnl                 [, OTHER-LIBRARIES]]])
+dnl FIXME: Remove
 AC_DEFUN(AC_HAVE_LIBRARY,
 [AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
 changequote(<<, >>)dnl
@@ -2145,7 +2167,7 @@ LIBS="$ac_save_LIBS"
 AC_MSG_RESULT($AC_CV_NAME)
 if test "$AC_CV_NAME" = yes; then
   ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]AC_TR_DEFINE(AC_LIB_NAME))
+[AC_DEFINE([HAVE_LIB]AC_TR_CPP(AC_LIB_NAME))
   LIBS="-l[]AC_LIB_NAME[] $LIBS"
 ], [$2])
 ifelse([$3], , , [else
@@ -2346,31 +2368,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_var_header], [ac_cv_header_$1])dnl
+AC_CACHE_CHECK([for $1], ac_var_header,
+[AC_TRY_CPP([#include <$1>],
+AC_VAR_SET(ac_var_header, yes), AC_VAR_SET(ac_var_header, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var_header) = yes,
+                [$2], [$3])dnl
+AC_VAR_POPDEF([ac_var_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
 ])
 
@@ -2410,19 +2424,52 @@ dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 AC_DEFUN(AC_CHECK_FILES,
 [AC_FOREACH([AC_FILE_NAME], [$1],
   [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
-                 [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_[]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_DEFINE(HAVE_$ac_file)) $2],
+dnl              [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_file)) $2],
 dnl              [$3])dnl
 dnl done
 dnl ])
 
 
+dnl ### Checking for declared symbols
+
+
+dnl AC_CHECK_DECL(SYMBOL, [, INCLUDES,
+dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl --------------------------------------------------------
+dnl Check if SYMBOL (a variable or a function) is declared.
+AC_DEFUN([AC_CHECK_DECL],
+[AC_VAR_PUSHDEF([ac_var], [ac_cv_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 is declared], ac_var,
+[AC_TRY_COMPILE($2,
+[#ifndef $1
+char *p = (char *) $1;
+#endif
+],
+AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes,
+               [$3], [$4])dnl
+AC_VAR_POPDEF([ac_var])dnl
+])dnl AC_CHECK_DECL
+
+dnl AC_CHECK_DECL(SYMBOL... , [, INCLUDES,
+dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+AC_DEFUN(AC_CHECK_DECLS,
+[for ac_sym in $1
+do
+AC_CHECK_DECL($ac_sym,
+              [$2],
+              [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $3],
+              [$4])dnl
+done
+])
+
 dnl ### Checking for library functions
 
 
@@ -2457,27 +2504,17 @@ choke me
 f = $1;
 #endif
 ], AC_VAR_SET(ac_var, yes), AC_VAR_SET(ac_var, no))])
-dnl The ridiculous following `:' are coming from the fact that we
-dnl need to have a body for these tests, otherwise some shells will
-dnl die.  FIXME: We should write a macro specifically to handle this kind
-dnl of switches, since they are very common in Autoconf.
-if test AC_VAR_GET(ac_var) = yes; then
-  :
-ifset([$2], [  $2
-])dnl
-else
-  :
-ifset([$3], [  $3
-])dnl
-fi
-AC_VAR_POPDEF([ac_var])])
+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,
-              [AC_DEFINE_UNQUOTED(AC_TR_DEFINE(HAVE_$ac_func)) $2],
+              [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
               [$3])dnl
 done
 ])
@@ -2507,7 +2544,7 @@ main()
   AC_VAR_SET(ac_var, `cat conftestval`),
   AC_VAR_SET(ac_var, 0),
   ifset([$2], AC_VAR_SET(ac_var, $2)))])
-AC_DEFINE_UNQUOTED(AC_TR_DEFINE(sizeof_$1), AC_VAR_GET(ac_var))
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_var))
 AC_VAR_POPDEF([ac_var])dnl
 ])
 
@@ -2516,6 +2553,9 @@ dnl ### Checking for typedefs
 
 
 dnl AC_CHECK_TYPE(TYPE, DEFAULT)
+dnl FIXME: This is an extremely badly choosen 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)
@@ -2679,7 +2719,7 @@ dnl tmp-file config-file', hence their update is atomic.
 : \${CONFIG_FILES="$1"}
 ifdef([AC_LIST_HEADER], [: \${CONFIG_HEADERS=AC_LIST_HEADER}
 ])dnl
-rm -fr \`echo "\$CONFIG_FILES ifdef([AC_LIST_HEADER], \$CONFIG_HEADERS)" | sed "s/:@BKL@^ @BKR@*//g"\`
+rm -fr \`echo "\$CONFIG_FILES" | sed "s/:@BKL@^ @BKR@*//g"\`
 trap 'rm -fr \$confstat*; exit 1' 1 2 15
 EOF
 dnl The following three sections are in charge of their own here
@@ -2822,8 +2862,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.
+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.
@@ -3027,8 +3067,8 @@ 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.
+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
@@ -3070,8 +3110,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.
+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.
@@ -3097,7 +3137,7 @@ changequote([, ])dnl
   fi
 done
 EOF
-])
+])dnl AC_OUTPUT_LINKS
 
 dnl This is a subroutine of AC_OUTPUT.
 dnl It is called after running config.status.
@@ -3145,8 +3185,8 @@ ifdef([AC_PROVIDE_AC_PROG_INSTALL],[  ac_given_INSTALL="$INSTALL"
     case "$srcdir" in
     .) ;;
     *)
-      dnl FIXME: should actually be mkinstalldirs (parents may have
-      dnl to be created too.
+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(cannot create `pwd`/$ac_config_dir)
index 503bf87f0137926893dabf8c04f456ad177c2833..7ac816e8cfef02615190a5325330c8ce38199f35 100644 (file)
@@ -167,7 +167,7 @@ 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
 dnl AC_PROG_F77()
 AC_DEFUN(AC_PROG_F77,
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
@@ -232,7 +232,7 @@ 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
 dnl AC_PROG_F77_WORKS()
 AC_DEFUN(AC_PROG_F77_WORKS,
 [AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
@@ -283,7 +283,7 @@ fi])])
 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
 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,
@@ -322,7 +322,7 @@ rm -f conftest*
 
 dnl Test whether the Fortran 77 compiler can accept the `-g' option to
 dnl enable debugging.
-dnl 
+dnl
 dnl AC_PROG_F77_G()
 AC_DEFUN(AC_PROG_F77_G,
 [AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g,
@@ -414,7 +414,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
@@ -1806,7 +1806,7 @@ fi
 AC_DEFUN(AC_FUNC_STRFTIME,
 [AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)],
 [# strftime is in -lintl on SCO UNIX.
-AC_CHECK_LIB(intl, strftime, 
+AC_CHECK_LIB(intl, strftime,
 [AC_DEFINE(HAVE_STRFTIME)
 LIBS="-lintl $LIBS"])])])
 
@@ -1854,8 +1854,8 @@ 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])
@@ -2988,7 +2988,10 @@ 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))
 ])
 
 AC_DEFUN(AC_MINIX,