From: David MacKenzie Date: Sat, 9 Nov 1996 00:44:49 +0000 (+0000) Subject: various bug fixes and small improvements X-Git-Tag: fsf-origin~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f8338d7e503829b59ac6b5a387542452ab8f80;p=thirdparty%2Fautoconf.git various bug fixes and small improvements --- diff --git a/ChangeLog b/ChangeLog index 7e394dcd..ae705c68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Fri Nov 8 16:02:08 1996 David J MacKenzie + + * acspecific.m4 (AC_PATH_X_DIRECT): Search for /usr/X11 before + /usr/X11Rn, etc. From bostic@bsdi.com (Keith Bostic). + + * acgeneral.m4 (AC_CHECK_TYPE) [STDC_HEADERS]: Check in stddef.h, too. + From "Glenn P. Davis" . + (AC_TRY_RUN): Remove the test files before executing the "failure" + case code. + + * acspecific.m4 (AC_PROG_CXX): Check for cc++ for NexT. + From Carl Edman . + (AC_ISC_POSIX): Require AC_PROG_CC, since it uses $GCC. + From gvran@uddeborg.pp.se. + (AC_PROG_CC, AC_PROG_CXX): Check whether -g works even if + C[XX]FLAGS is set. From T.E.Dickey + (AC_FUNC_FNMATCH): New macro. + + * acgeneral.m4 (AC_REPLACE_FUNCS): Call AC_CHECK_FUNCS to do the work. + Thu Oct 10 22:29:37 1996 David J MacKenzie * acgeneral.m4 (AC_CANONICAL_HOST, AC_CANONICAL_TARGET, @@ -43,7 +63,7 @@ Sun May 26 19:07:15 1996 Roland McGrath Tue May 7 13:20:33 1996 Roland McGrath - * acgeneral.m4: Verion 2.10 released. + * acgeneral.m4: Version 2.10 released. Tue Mar 26 13:03:12 1996 Roland McGrath diff --git a/NEWS b/NEWS index aa01cad1..dd082e46 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +Major changes in release 2.11: + +* AC_CHECK_LIB can handle any funny characters in library names. +* AC_REPLACE_FUNCS defines HAVE_FUNCTION if the system has the function. +* New macro: AC_FUNC_FNMATCH. +* config.sub and config.guess recognize more system types. +* Other bug fixes. + Major changes in release 2.10: * Bug fixes. diff --git a/TODO b/TODO index 819a5033..e600ffd8 100644 --- a/TODO +++ b/TODO @@ -61,11 +61,6 @@ these suggestions... their presence here doesn't imply my endorsement. ------------------------------------------------------------------------------ -* Add a Makefile generator that supports the standard GNU targets. - (Being worked on.) - ------------------------------------------------------------------------------- - * Mike Haertel's suggestions: ** Provide header files containing decls for alloca, strings, etc. @@ -94,7 +89,6 @@ in a dnl comment. (Seems to be hard.) * Look at user contributed macros: prototypes IEEE double precision math - shared libraries ------------------------------------------------------------------------------ @@ -307,7 +301,7 @@ From Paul Eggert. ------------------------------------------------------------------------------ -Make easy macros for checking for X functions and libraries. +Make easy macros for checking for X functions and libraries, such as Motif. ------------------------------------------------------------------------------ @@ -328,3 +322,55 @@ From: tom@vlsivie.tuwien.ac.AT (Thomas Winder) and so does AC_CONFIG_HEADER when autoconf is run. ------------------------------------------------------------------------------ + +Autoheader in autoconf-2.4 doesn't produce entries for: + + AC_CHECK_TYPE(ssize_t, int) + +and it seems like it could easily do so. + +In general, it seems to me like autoconf isn't set up to +let me periodically run autoheader, and then include my +"local" tests -- autoheader gets most stuff right, I'd like +to rerun it periodically without losing my local changes +to config.h.in. + +One of the things that I need is to know is the type to use +for a fixed size on disk, e.g., what is the system's name +for an unsigned-32-bit integer? + +I can use: + + AC_CHECK_SIZEOF(unsigned int) + +and, in fact, that's what I do. But I still have to build +sets of #if tests to get from there to the name of the type. + +From: bostic@bsdi.com (Keith Bostic) + +------------------------------------------------------------------------------ + +There are basically three ways to lock files + lockf, fnctl, flock +I'd be interested in adding a macro to pick the "right one" if you're +interested. + +From: Rich Salz + +------------------------------------------------------------------------------ + +It is IMHO a bug that `config.status' cannot handle multiple +simultaneous invocations. It should include the process id (`$$' in sh) +as part of the name of any temporary files it creates. + +From: fjh@kryten.cs.mu.oz.au (Fergus Henderson) + +------------------------------------------------------------------------------ + +I think it would be useful to be able to have the variables expanded in +AC_CONFIG_HEADER just like AC_OUTPUT allows. + +From: Julian Onions + +------------------------------------------------------------------------------ + diff --git a/acgeneral.m4 b/acgeneral.m4 index 0834862f..10e04b71 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.10) +define(AC_ACVERSION, 2.10.1) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -185,6 +185,9 @@ verbose= x_includes=NONE x_libraries=NONE dnl Installation directory options. +dnl These are left unexpanded so users can "make install exec_prefix=/foo" +dnl and all the variables that are supposed to be based on exec_prefix +dnl by default will actually change. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -1638,6 +1641,7 @@ AC_TRY_EVAL(ac_link) if test -s conftest && (./conftest; exit) 2>/dev/null; then ifelse([$2], , :, [$2]) ifelse([$3], , , [else + rm -fr conftest* $3 ])dnl fi @@ -1733,12 +1737,9 @@ changequote([, ])dnl done ]) -dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) +dnl AC_REPLACE_FUNCS(FUNCTION...) AC_DEFUN(AC_REPLACE_FUNCS, -[for ac_func in $1 -do -AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) -done +[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) AC_SUBST(LIBOBJS)dnl ]) @@ -1785,6 +1786,7 @@ $1[^a-zA-Z_0-9] dnl changequote([,]), [#include #if STDC_HEADERS #include +#include #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then diff --git a/acspecific.m4 b/acspecific.m4 index f2f7d6c1..f5922ef4 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -90,10 +90,16 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g, +dnl Check whether -g works even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g, [echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_gcc_g=yes @@ -102,11 +108,12 @@ else fi rm -f conftest* ]) - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" fi else GCC= @@ -116,7 +123,7 @@ fi AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl -AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. @@ -132,8 +139,13 @@ else fi]) if test $ac_cv_prog_gxx = yes; then GXX=yes - if test "${CXXFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g, +dnl Check whether -g works even if CXXFLAGS is set, in case the package +dnl plays around with CXXFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g, [echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_gxx_g=yes @@ -143,11 +155,12 @@ fi rm -f conftest* ]) dnl - if test $ac_cv_prog_gxx_g = yes; then - CXXFLAGS="-g -O" - else - CXXFLAGS="-O" - fi + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" + elif test $ac_cv_prog_gxx_g = yes; then + CXXFLAGS="-g -O" + else + CXXFLAGS="-O" fi else GXX= @@ -765,6 +778,21 @@ if test $ac_cv_func_closedir_void = yes; then fi ]) +AC_DEFUN(AC_FUNC_FNMATCH, +[AC_CACHE_CHECK(for working fnmatch, ac_cv_func_fnmatch, +# Some versions of Solaris or SCO have a broken fnmatch function. +# So we run a test program. If we are cross-compiling, take no chance. +# Thanks to John Oleynick and Franc,ois Pinard for this test. +[AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }], +ac_cv_func_fnmatch=yes, ac_cv_func_fnmatch=no, ac_cv_func_fnmatch=no)]) +if test $ac_cv_func_fnmatch = yes; then + AC_DEFINE(HAVE_FNMATCH) +else + LIBOBJS="$LIBOBJS fnmatch.o" +fi +AC_SUBST(LIBOBJS)dnl +]) + AC_DEFUN(AC_FUNC_MMAP, [AC_CHECK_FUNCS(valloc getpagesize) AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap, @@ -1746,27 +1774,26 @@ AC_TRY_CPP([#include <$x_direct_test_include>], ac_x_includes=], [# Look for the header file in a standard set of common directories. for ac_dir in \ + /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ + /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ + /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ + /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ - /usr/X11/include \ - /usr/include/X11 \ - /usr/local/X11/include \ - /usr/local/include/X11 \ - \ /usr/X386/include \ /usr/x386/include \ /usr/XFree86/include/X11 \ @@ -1806,27 +1833,26 @@ ac_x_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ + /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ /usr/lib/X11R4 \ \ + /usr/local/X11/lib \ /usr/local/X11R6/lib \ /usr/local/X11R5/lib \ /usr/local/X11R4/lib \ \ + /usr/local/lib/X11 \ /usr/local/lib/X11R6 \ /usr/local/lib/X11R5 \ /usr/local/lib/X11R4 \ \ - /usr/X11/lib \ - /usr/lib/X11 \ - /usr/local/X11/lib \ - /usr/local/lib/X11 \ - \ /usr/X386/lib \ /usr/x386/lib \ /usr/XFree86/lib/X11 \ @@ -1955,7 +1981,8 @@ fi ]) AC_DEFUN(AC_ISC_POSIX, -[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl +[AC_REQUIRE([AC_PROG_CC])dnl +AC_BEFORE([$0], [AC_TRY_COMPILE])dnl AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl AC_MSG_CHECKING(for POSIXized ISC) diff --git a/autoconf.in b/autoconf.in index 466ceb97..ee64ca5d 100644 --- a/autoconf.in +++ b/autoconf.in @@ -122,7 +122,7 @@ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for -# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do # alternation. pattern="AC_" diff --git a/autoconf.sh b/autoconf.sh index 466ceb97..ee64ca5d 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -122,7 +122,7 @@ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for -# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do # alternation. pattern="AC_" diff --git a/autoconf.texi b/autoconf.texi index 92354729..40273509 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -6,9 +6,9 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 2.8 -@set VERSION 2.8 -@set UPDATED January 1996 +@set EDITION 2.10.1 +@set VERSION 2.10.1 +@set UPDATED November 1996 @iftex @finalout @@ -114,7 +114,7 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. * Questions:: Questions about Autoconf, with answers. * Upgrading:: Tips for upgrading from version 1. * History:: History of Autoconf. -* Old Macro Names:: Backward compatibility macros. +* Old Macro Names:: Backward compatibility macros. * Environment Variable Index:: Index of environment variables used. * Output Variable Index:: Index of variables set in output files. * Preprocessor Symbol Index:: Index of C preprocessor symbols defined. @@ -124,16 +124,16 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. Making @code{configure} Scripts -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. Initialization and Output Files * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -142,26 +142,26 @@ Initialization and Output Files Substitutions in Makefiles -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. Configuration Header Files * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. Existing Tests -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. Alternative Programs @@ -185,44 +185,44 @@ Typedefs Writing Tests -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. Checking Run Time Behavior * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. Results of Tests * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. Caching Results * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. Writing Macros -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. Dependencies Between Macros -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. Manual Configuration @@ -275,11 +275,11 @@ Upgrading From Version 1 History of Autoconf -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Introduction, Making configure Scripts, Top, Top @@ -437,10 +437,10 @@ Makefile.in ---' `-> Makefile ---' @end example @menu -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. @end menu @@ -734,7 +734,7 @@ initialization and creating output files. @menu * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -790,7 +790,8 @@ required macro is @code{AC_INIT} (@pxref{Input}). @defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]}) @maindex OUTPUT -Create output files. The @var{file}@dots{} argument is a +Create output files. Call this macro once, at the end of @file{configure.in}. +The @var{file}@dots{} argument is a whitespace-separated list of output files; it may be empty. This macro creates each file @file{@var{file}} by copying an input file (by default named @file{@var{file}.in}), substituting the output variable values. @@ -877,9 +878,9 @@ GNU Coding Standards}, for more information on what to put in @file{Makefile}s. @menu -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. @end menu @node Preset Output Variables, Build Directories, , Makefile Substitutions @@ -1190,7 +1191,7 @@ Doing this allows you to keep your filenames acceptable to MS-DOS. @menu * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. @end menu @node Header Templates, Invoking autoheader, , Configuration Headers @@ -1441,15 +1442,15 @@ preprocessor symbol @var{name} to the value 1''. @xref{Defining Symbols}, for how to get those symbol definitions into your program. @menu -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. @end menu @node Alternative Programs, Libraries, , Existing Tests @@ -1536,9 +1537,9 @@ specific test macros use the value of @code{CPP} indirectly by calling Determine a C++ compiler to use. Check if the environment variable @code{CXX} or @code{CCC} (in that order) is set; if so, set output variable @code{CXX} to its value. Otherwise search for a C++ compiler -under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and -@code{cxx}). If none of those checks succeed, as a last resort set -@code{CXX} to @code{gcc}. +under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, +@code{cxx}, and @code{cc++}). If none of those checks succeed, as a +last resort set @code{CXX} to @code{gcc}. If using the GNU C++ compiler, set shell variable @code{GXX} to @samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was @@ -1826,6 +1827,15 @@ define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its return value for an error indicator. @end defmac +@defmac AC_FUNC_FNMATCH +@maindex FUNC_FNMATCH +@ovindex LIBOBJS +If the @code{fnmatch} function is not available, or does not work (like +the one on SunOS 5.4), add @samp{fnmatch.o} to output variable +@code{LIBOBJS}. If a working @code{fnmatch} is found, define +@code{HAVE_FNMATCH}. +@end defmac + @defmac AC_FUNC_GETLOADAVG @maindex FUNC_GETLOADAVG @cvindex SVR4 @@ -2001,12 +2011,16 @@ when one of the functions is found. You can give it a value of functions is not found. @end defmac -@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{}) +@defmac AC_REPLACE_FUNCS (@var{function}@dots{}) @maindex REPLACE_FUNCS @ovindex LIBOBJS -For each given @var{function-name} in the whitespace-separated argument -list that is not in the C library, add @samp{@var{function-name}.o} to -the value of the output variable @code{LIBOBJS}. +Like calling @code{AC_CHECK_FUNCS} using an @var{action-if-not-found} +that adds @samp{@var{function}.o} to the value of the output variable +@code{LIBOBJS}. You can declare a function for which your replacement +version is used by enclosing the prototype in @samp{#ifndef +HAVE_@var{function}}. If the system has the function, it probably +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 @@ -2467,9 +2481,10 @@ test macros. @defmac AC_CHECK_TYPE (@var{type}, @var{default}) @maindex CHECK_TYPE -If the type @var{type} is not defined in @file{sys/types.h} or -@file{stdlib.h} (if it exists), define it to be the C (or C++) -builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}. +If the type @var{type} is not defined in @file{sys/types.h}, or +@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the +C (or C++) builtin type @var{default}; e.g., @samp{short} or +@samp{unsigned}. @end defmac @node Compiler Characteristics, System Services, Typedefs, Existing Tests @@ -2722,13 +2737,13 @@ software package, the best thing to do is encapsulate it in a new macro. @xref{Writing Macros}, for how to do that. @menu -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. @end menu @@ -2878,8 +2893,8 @@ package for cross-compiling. @menu * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. @end menu @node Test Programs, Guidelines, , Run Time @@ -3173,7 +3188,7 @@ print a message letting the user know the result of the test. @menu * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. @end menu @@ -3357,7 +3372,7 @@ common way to use these macros. It calls @code{AC_MSG_CHECKING} for @menu * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. @end menu @node Cache Variable Names, Cache Files, , Caching Results @@ -3541,10 +3556,10 @@ software package, the best thing to do is encapsulate it in a new macro. Here are some instructions and guidelines for writing Autoconf macros. @menu -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. @end menu @node Macro Definitions, Macro Names, , Writing Macros @@ -3692,8 +3707,8 @@ macros are called if needed and a way to warn the user if macros are called in an order that might cause incorrect operation. @menu -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. @end menu @@ -4844,11 +4859,11 @@ to you, and you might as well skip it. If you @emph{are} wondering, then let there be light@dots{} @menu -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Genesis, Exodus, , History diff --git a/bin/autoconf.in b/bin/autoconf.in index 466ceb97..ee64ca5d 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -122,7 +122,7 @@ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for -# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do # alternation. pattern="AC_" diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 92354729..40273509 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -6,9 +6,9 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 2.8 -@set VERSION 2.8 -@set UPDATED January 1996 +@set EDITION 2.10.1 +@set VERSION 2.10.1 +@set UPDATED November 1996 @iftex @finalout @@ -114,7 +114,7 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. * Questions:: Questions about Autoconf, with answers. * Upgrading:: Tips for upgrading from version 1. * History:: History of Autoconf. -* Old Macro Names:: Backward compatibility macros. +* Old Macro Names:: Backward compatibility macros. * Environment Variable Index:: Index of environment variables used. * Output Variable Index:: Index of variables set in output files. * Preprocessor Symbol Index:: Index of C preprocessor symbols defined. @@ -124,16 +124,16 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. Making @code{configure} Scripts -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. Initialization and Output Files * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -142,26 +142,26 @@ Initialization and Output Files Substitutions in Makefiles -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. Configuration Header Files * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. Existing Tests -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. Alternative Programs @@ -185,44 +185,44 @@ Typedefs Writing Tests -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. Checking Run Time Behavior * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. Results of Tests * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. Caching Results * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. Writing Macros -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. Dependencies Between Macros -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. Manual Configuration @@ -275,11 +275,11 @@ Upgrading From Version 1 History of Autoconf -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Introduction, Making configure Scripts, Top, Top @@ -437,10 +437,10 @@ Makefile.in ---' `-> Makefile ---' @end example @menu -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. @end menu @@ -734,7 +734,7 @@ initialization and creating output files. @menu * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -790,7 +790,8 @@ required macro is @code{AC_INIT} (@pxref{Input}). @defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]}) @maindex OUTPUT -Create output files. The @var{file}@dots{} argument is a +Create output files. Call this macro once, at the end of @file{configure.in}. +The @var{file}@dots{} argument is a whitespace-separated list of output files; it may be empty. This macro creates each file @file{@var{file}} by copying an input file (by default named @file{@var{file}.in}), substituting the output variable values. @@ -877,9 +878,9 @@ GNU Coding Standards}, for more information on what to put in @file{Makefile}s. @menu -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. @end menu @node Preset Output Variables, Build Directories, , Makefile Substitutions @@ -1190,7 +1191,7 @@ Doing this allows you to keep your filenames acceptable to MS-DOS. @menu * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. @end menu @node Header Templates, Invoking autoheader, , Configuration Headers @@ -1441,15 +1442,15 @@ preprocessor symbol @var{name} to the value 1''. @xref{Defining Symbols}, for how to get those symbol definitions into your program. @menu -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. @end menu @node Alternative Programs, Libraries, , Existing Tests @@ -1536,9 +1537,9 @@ specific test macros use the value of @code{CPP} indirectly by calling Determine a C++ compiler to use. Check if the environment variable @code{CXX} or @code{CCC} (in that order) is set; if so, set output variable @code{CXX} to its value. Otherwise search for a C++ compiler -under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and -@code{cxx}). If none of those checks succeed, as a last resort set -@code{CXX} to @code{gcc}. +under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, +@code{cxx}, and @code{cc++}). If none of those checks succeed, as a +last resort set @code{CXX} to @code{gcc}. If using the GNU C++ compiler, set shell variable @code{GXX} to @samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was @@ -1826,6 +1827,15 @@ define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its return value for an error indicator. @end defmac +@defmac AC_FUNC_FNMATCH +@maindex FUNC_FNMATCH +@ovindex LIBOBJS +If the @code{fnmatch} function is not available, or does not work (like +the one on SunOS 5.4), add @samp{fnmatch.o} to output variable +@code{LIBOBJS}. If a working @code{fnmatch} is found, define +@code{HAVE_FNMATCH}. +@end defmac + @defmac AC_FUNC_GETLOADAVG @maindex FUNC_GETLOADAVG @cvindex SVR4 @@ -2001,12 +2011,16 @@ when one of the functions is found. You can give it a value of functions is not found. @end defmac -@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{}) +@defmac AC_REPLACE_FUNCS (@var{function}@dots{}) @maindex REPLACE_FUNCS @ovindex LIBOBJS -For each given @var{function-name} in the whitespace-separated argument -list that is not in the C library, add @samp{@var{function-name}.o} to -the value of the output variable @code{LIBOBJS}. +Like calling @code{AC_CHECK_FUNCS} using an @var{action-if-not-found} +that adds @samp{@var{function}.o} to the value of the output variable +@code{LIBOBJS}. You can declare a function for which your replacement +version is used by enclosing the prototype in @samp{#ifndef +HAVE_@var{function}}. If the system has the function, it probably +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 @@ -2467,9 +2481,10 @@ test macros. @defmac AC_CHECK_TYPE (@var{type}, @var{default}) @maindex CHECK_TYPE -If the type @var{type} is not defined in @file{sys/types.h} or -@file{stdlib.h} (if it exists), define it to be the C (or C++) -builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}. +If the type @var{type} is not defined in @file{sys/types.h}, or +@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the +C (or C++) builtin type @var{default}; e.g., @samp{short} or +@samp{unsigned}. @end defmac @node Compiler Characteristics, System Services, Typedefs, Existing Tests @@ -2722,13 +2737,13 @@ software package, the best thing to do is encapsulate it in a new macro. @xref{Writing Macros}, for how to do that. @menu -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. @end menu @@ -2878,8 +2893,8 @@ package for cross-compiling. @menu * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. @end menu @node Test Programs, Guidelines, , Run Time @@ -3173,7 +3188,7 @@ print a message letting the user know the result of the test. @menu * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. @end menu @@ -3357,7 +3372,7 @@ common way to use these macros. It calls @code{AC_MSG_CHECKING} for @menu * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. @end menu @node Cache Variable Names, Cache Files, , Caching Results @@ -3541,10 +3556,10 @@ software package, the best thing to do is encapsulate it in a new macro. Here are some instructions and guidelines for writing Autoconf macros. @menu -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. @end menu @node Macro Definitions, Macro Names, , Writing Macros @@ -3692,8 +3707,8 @@ macros are called if needed and a way to warn the user if macros are called in an order that might cause incorrect operation. @menu -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. @end menu @@ -4844,11 +4859,11 @@ to you, and you might as well skip it. If you @emph{are} wondering, then let there be light@dots{} @menu -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Genesis, Exodus, , History diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 0834862f..10e04b71 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.10) +define(AC_ACVERSION, 2.10.1) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -185,6 +185,9 @@ verbose= x_includes=NONE x_libraries=NONE dnl Installation directory options. +dnl These are left unexpanded so users can "make install exec_prefix=/foo" +dnl and all the variables that are supposed to be based on exec_prefix +dnl by default will actually change. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -1638,6 +1641,7 @@ AC_TRY_EVAL(ac_link) if test -s conftest && (./conftest; exit) 2>/dev/null; then ifelse([$2], , :, [$2]) ifelse([$3], , , [else + rm -fr conftest* $3 ])dnl fi @@ -1733,12 +1737,9 @@ changequote([, ])dnl done ]) -dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) +dnl AC_REPLACE_FUNCS(FUNCTION...) AC_DEFUN(AC_REPLACE_FUNCS, -[for ac_func in $1 -do -AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) -done +[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) AC_SUBST(LIBOBJS)dnl ]) @@ -1785,6 +1786,7 @@ $1[^a-zA-Z_0-9] dnl changequote([,]), [#include #if STDC_HEADERS #include +#include #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index f2f7d6c1..f5922ef4 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -90,10 +90,16 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g, +dnl Check whether -g works even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g, [echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_gcc_g=yes @@ -102,11 +108,12 @@ else fi rm -f conftest* ]) - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" fi else GCC= @@ -116,7 +123,7 @@ fi AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl -AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. @@ -132,8 +139,13 @@ else fi]) if test $ac_cv_prog_gxx = yes; then GXX=yes - if test "${CXXFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g, +dnl Check whether -g works even if CXXFLAGS is set, in case the package +dnl plays around with CXXFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g, [echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_gxx_g=yes @@ -143,11 +155,12 @@ fi rm -f conftest* ]) dnl - if test $ac_cv_prog_gxx_g = yes; then - CXXFLAGS="-g -O" - else - CXXFLAGS="-O" - fi + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" + elif test $ac_cv_prog_gxx_g = yes; then + CXXFLAGS="-g -O" + else + CXXFLAGS="-O" fi else GXX= @@ -765,6 +778,21 @@ if test $ac_cv_func_closedir_void = yes; then fi ]) +AC_DEFUN(AC_FUNC_FNMATCH, +[AC_CACHE_CHECK(for working fnmatch, ac_cv_func_fnmatch, +# Some versions of Solaris or SCO have a broken fnmatch function. +# So we run a test program. If we are cross-compiling, take no chance. +# Thanks to John Oleynick and Franc,ois Pinard for this test. +[AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }], +ac_cv_func_fnmatch=yes, ac_cv_func_fnmatch=no, ac_cv_func_fnmatch=no)]) +if test $ac_cv_func_fnmatch = yes; then + AC_DEFINE(HAVE_FNMATCH) +else + LIBOBJS="$LIBOBJS fnmatch.o" +fi +AC_SUBST(LIBOBJS)dnl +]) + AC_DEFUN(AC_FUNC_MMAP, [AC_CHECK_FUNCS(valloc getpagesize) AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap, @@ -1746,27 +1774,26 @@ AC_TRY_CPP([#include <$x_direct_test_include>], ac_x_includes=], [# Look for the header file in a standard set of common directories. for ac_dir in \ + /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ + /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ + /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ + /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ - /usr/X11/include \ - /usr/include/X11 \ - /usr/local/X11/include \ - /usr/local/include/X11 \ - \ /usr/X386/include \ /usr/x386/include \ /usr/XFree86/include/X11 \ @@ -1806,27 +1833,26 @@ ac_x_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ + /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ /usr/lib/X11R4 \ \ + /usr/local/X11/lib \ /usr/local/X11R6/lib \ /usr/local/X11R5/lib \ /usr/local/X11R4/lib \ \ + /usr/local/lib/X11 \ /usr/local/lib/X11R6 \ /usr/local/lib/X11R5 \ /usr/local/lib/X11R4 \ \ - /usr/X11/lib \ - /usr/lib/X11 \ - /usr/local/X11/lib \ - /usr/local/lib/X11 \ - \ /usr/X386/lib \ /usr/x386/lib \ /usr/XFree86/lib/X11 \ @@ -1955,7 +1981,8 @@ fi ]) AC_DEFUN(AC_ISC_POSIX, -[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl +[AC_REQUIRE([AC_PROG_CC])dnl +AC_BEFORE([$0], [AC_TRY_COMPILE])dnl AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl AC_MSG_CHECKING(for POSIXized ISC)