+Fri Nov 8 16:02:08 1996 David J MacKenzie <djm@catapult.va.pubnix.com>
+
+ * acspecific.m4 (AC_PATH_X_DIRECT): Search for /usr/X11 before
+ /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" <davis@unidata.ucar.edu>.
+ (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 <cedman@princeton.edu>.
+ (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 <dickey@clark.net>
+ (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 <djm@catapult.va.pubnix.com>
* acgeneral.m4 (AC_CANONICAL_HOST, AC_CANONICAL_TARGET,
Tue May 7 13:20:33 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
- * acgeneral.m4: Verion 2.10 released.
+ * acgeneral.m4: Version 2.10 released.
Tue Mar 26 13:03:12 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+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.
+\f
Major changes in release 2.10:
* Bug fixes.
------------------------------------------------------------------------------
-* 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.
* Look at user contributed macros:
prototypes
IEEE double precision math
- shared libraries
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-Make easy macros for checking for X functions and libraries.
+Make easy macros for checking for X functions and libraries, such as Motif.
------------------------------------------------------------------------------
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 <rsalz@osf.org>
+
+------------------------------------------------------------------------------
+
+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 <j.onions@nexor.co.uk>
+
+------------------------------------------------------------------------------
+
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
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'
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ifelse([$2], , :, [$2])
ifelse([$3], , , [else
+ rm -fr conftest*
$3
])dnl
fi
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
])
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
+#include <stddef.h>
#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
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
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=
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.
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
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=
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,
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 \
[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 \
])
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)
{ 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_"
{ 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_"
@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
* 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.
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.
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
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
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
@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
@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.
@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.
@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
@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
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
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
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
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
@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
@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
@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
@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
@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
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
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
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
{ 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_"
@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
* 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.
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.
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
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
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
@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
@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.
@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.
@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
@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
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
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
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
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
@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
@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
@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
@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
@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
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
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
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
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
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'
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ifelse([$2], , :, [$2])
ifelse([$3], , , [else
+ rm -fr conftest*
$3
])dnl
fi
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
])
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
+#include <stddef.h>
#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
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
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=
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.
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
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=
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,
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 \
[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 \
])
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)