From: Mark Eichin Date: Wed, 26 Oct 1994 05:57:22 +0000 (+0000) Subject: autoconf 1.126. This will be released as autoconf 2 on 94/10/27, please X-Git-Tag: krb5-1.0-beta5~1067 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48a2b77760350db67c2adcb040f4a65bdf1d223a;p=krb5.git autoconf 1.126. This will be released as autoconf 2 on 94/10/27, please don't release before then without checking with Mark Eichin. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4577 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/autoconf/ChangeLog b/src/util/autoconf/ChangeLog index 04a085321..083888359 100644 --- a/src/util/autoconf/ChangeLog +++ b/src/util/autoconf/ChangeLog @@ -1,2272 +1,1145 @@ -Fri Oct 7 14:30:28 1994 Theodore Y. Ts'o (tytso@dcl) +Tue Oct 25 11:04:16 1994 David J. MacKenzie - * Makefile.in: Use check:: instead of check: + * acgeneral.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Change - + in file names to _. + * acspecific.m4 (AC_CHECK_HEADER_DIRENT, AC_CHECK_HEADERS_DIRENT): + Likewise. -Thu May 12 15:55:40 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Mon Oct 24 11:28:20 1994 David J. MacKenzie - * Version 1.11. + * Makefile.in (uninstall): Remove the transformed names. + (SCRIPTS): Rename from PROGS. + * configure.in: Likewise. - * autoconf.texi: Document filename restriction on CPP. +Fri Oct 21 07:14:23 1994 David J. MacKenzie -Thu May 12 10:11:20 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu) + * acgeneral.m4 (AC_TRY_COMPILE): New macro. + (AC_LANG_C, AC_LANG_CPLUSPLUS): Set $ac_compile. + (AC_TRY_LINK): Don't declare exit. + * acspecific.m4 (AC_C_INLINE, AC_C_CONST, AC_CHECK_HEADER_DIRENT, + AC_DECL_SYS_SIGLIST, AC_HEADER_SYS_WAIT, AC_TYPE_SIGNAL, + AC_FUNC_GETLOADAVG, AC_HEADER_TIME, AC_STRUCT_TM, + AC_STRUCT_TIMEZONE, AC_STRUCT_ST_BLOCKS, AC_STRUCT_ST_BLKSIZE, + AC_STRUCT_ST_RDEV): Use AC_TRY_COMPILE instead of AC_TRY_LINK. + (AC_AIX, AC_MINIX, AC_ISC_POSIX): Must come before AC_TRY_COMPILE. - * acgeneral.m4 (AC_OUTPUT): Treat "./Makefile" like "Makefile". - From Karl Berry. - -Tue May 10 00:08:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Set prefix and exec_prefix if they - weren't set already. - -Sat May 7 20:06:59 1994 Noah Friedman (friedman@kropotkin.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PROG_INSTALL): If using install.sh, add `-c' - to INSTALL. - -Sat May 7 15:36:22 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - - * acgeneral.m4 (AC_OUTPUT): If configuring in the source tree, - don't end top_srcdir with "/.". - * acspecific.m4 (AC_SET_MAKE): Remove temp file. - From John Interrante . - -Fri May 6 15:26:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - - * acgeneral.m4 (AC_SIZEOF_TYPE): Fatal error if test program fails. - -Fri May 6 12:52:19 1994 David J. MacKenzie (djm@gamera.eng.umd.edu) - - * acgeneral.m4 (AC_OUTPUT): Run "./config.status", not "config.status". - From Kevin Gallagher . - -Fri May 6 00:45:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - - * acspecific.m4 (AC_WAIT3): Sleep in the parent to avoid rm - problems on fast machines. From david d zuhn. - -Thu May 5 12:51:32 1994 David J. MacKenzie (djm@gamera.eng.umd.edu) - - * Version 1.10. - - * Makefile.in (install): Don't install INSTALL. - (installcheck, install-info): New targets. - -Mon May 2 16:31:33 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - - * autoconf.sh, autoheader.sh: If M4 is an absolute file name that - no longer exists, use M4=m4. - -Mon May 2 13:06:06 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - - * acspecific.m4 (AC_HAVE_POUNDBANG): Quote # in message. - From schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). - - * autoconf.texi: Document config.h.bot. Fix typo in AC_HAVE_POUNDBANG. - - * acspecific.m4 (AC_PROG_CXX): Look for "cxx" (DEC C++ compiler) too. - - * autoheader.sh: Fix tr string for Solaris tr. - Add config.h.bot if present. - From richard@sol.kbsi.com (Richard Henderson). - -Fri Apr 29 12:53:53 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - - * acspecific.m4 (AC_PROG_INSTALL): Use install.sh from srcdir - or srcdir/.. or srcdir/../.. and never default to cp. + * acspecific.m4 (AC_PROG_LEX): Don't assume -ll if using lex; + check for it. From Mark Eichin. -Thu Apr 28 12:01:01 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - - * acconfig.h: Add HAVE_MMAP entry. - * acspecific.m4 (AC_MMAP): If NBPC is not defined, use PAGESIZE. - From "Kaveh R. Ghazi" . - - * acgeneral.m4 (AC_OUTPUT_HEADER): For each file being created, - munge a copy of conftest.sed rather than the original. - From brook@trillium.botany.utexas.edu (Brook Milligan). - -Tue Apr 26 00:27:21 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_LANG_C, AC_LANG_CPLUSPLUS): Remove CFLAGS and - CXXFLAGS from ac_cpp. - -Thu Apr 21 19:43:20 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Version 1.9. - - * autoconf.texi: Document special AC_FIND_XTRA ordering - dependencies. - - * acspecific.m4 (AC_FIND_XTRA): Reorder AC_REQUIREs. - - * acspecific.m4 (AC_FIND_X): AC_REQUIRE_CPP. - - * acspecific.m4 (AC_PROG_LEX): Say what we set LEXLIB to. - -Wed Apr 20 13:17:05 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PARSEARGS): Allow . in hostnames. Use string - comparison on them. - (AC_HAVE_LIBRARY): namespace cleanup. - - * autoconf.texi: Describe changes to AC_FIND_X, AC_FIND_XTRA, and - AC_YYTEXT_POINTER. - - * acconfig.h: Replace DECLARE_YYTEXT with YYTEXT_POINTER. - - * acgeneral.m4 (AC_PARSEARGS): --gas and --x set with_gas and - with_x to yes, not 1. +Thu Oct 20 07:11:22 1994 David J. MacKenzie - * acspecific.m4 (AC_YYTEXT_POINTER): New macro, replacing - AC_DECLARE_YYTEXT. - (AC_FIND_X): Assume no X if --without-x was given. - (AC_FIND_XTRA): Quotes AC_REQUIRE args. Run uname in a subshell in - case it's missing. Put -l options in X_EXTRA_LIBS. Print values - of the variables we set if verbose. + * acgeneral.m4 (AC_PARSE_ARGS): Ignore --site. -Tue Apr 19 14:14:25 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * autoscan.pl: Add more blank lines to the output. Pacify perl -w. - * autoconf.texi: Note GNU m4 1.0 bugs. +Wed Oct 19 09:14:50 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - * acspecific.m4 (AC_FIND_X_XMKMF): Set variables correctly. + * acgeneral.m4 (AC_PREREQ_COMPARE): Allow secondary and ternary + numbers >99. From John Eaton . - * autoconf.texi: Don't @setchapternewpage odd by default. Mention - autoheader AC_SIZEOF_TYPE symbol generation. +Wed Oct 19 00:06:40 1994 David J. MacKenzie - * acgeneral.m4 (AC_SIZEOF_TYPE): Fix typo. + * ifnames.sh: Take comments out of sed script. - * Makefile.in (install): Don't install aclocal.m4. +Tue Oct 18 00:20:04 1994 David J. MacKenzie - * autoheader.sh: Generate entries for AC_SIZEOF_TYPE - automatically. + * acgeneral.m4 (AC_INIT_NOTICE): Set ac_default_prefix. + (AC_INIT_PARSE_ARGS, AC_SITE_LOAD, AC_OUTPUT): Use it. + (AC_PREFIX_DEFAULT): New macro. + From Ken Raeburn. -Mon Apr 18 22:14:59 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * testsuite/autoconf.s/syntax.exp: Renamed from specific.exp. - * acgeneral.m4 (AC_SIZEOF_TYPE): Remove second arg, and generate a - symbol name automatically. + * acgeneral.m4 (AC_SITE_LOAD): Change where to look for config.site. - * autoconf.texi: Document new AC_SIZEOF_TYPE usage. + * configure.in: Call AC_ARG_PROGRAM. + * Makefile.in (install): Use program_transform_name. - * acspecific.m4 (AC_PROG_INSTALL): Only filter out "install" - containing "dspmsg". - (AC_FIND_X_XMKMF): Fix variable names to not conflict with grep -v. + * acgeneral.m4 acspecific.m4 acoldnames.m4: Clarify copying terms. - * autoconf.texi: Various small fixes. + * acgeneral.m4 (AC_CANONICAL_BUILD): Default build to host, not empty. - * INSTALL: Say configure takes "awhile". + * acspecific.m4 (AC_PROG_CC): Recognize NeXT cpp as GNU C. + From tom@basil.icce.rug.NL (Tom R.Hageman). -Sat Apr 16 15:05:31 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Mon Oct 17 18:25:53 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) - * acgeneral.m4: Call AC_LANG_C in AC_PREPARE, not AC_INIT. - -Fri Apr 15 07:00:37 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Version 1.8. - - * acgeneral.m4: Rename ac_configure_args back to configure_args, - since some people have been using it. - -Thu Apr 14 14:45:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * autoconf.texi: Note that AC_ENABLE and AC_WITH arguments - shouldn't contain blanks, for now. - -Wed Apr 13 17:26:36 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_SET_MAKE): Use $MAKE if defined, else "make". - - * autoconf.texi: Add missing files to diagram. - - * acgeneral.m4 (AC_TEST_CPP): Propogate comment about Coherent - lossage into configures. - -Sat Apr 9 17:34:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PARSEARGS): Unknown option is a fatal error. - - * acgeneral.m4: Remove ac_ prefix from some variables set by - options, for consistency and backward compatibility. - -Fri Apr 8 13:24:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_FIND_XTRA): Don't test for -lsocket on IRIX. - From Karl Berry. + * acspecific.m4 (AC_PROG_CPP): Use assert.h (comes with gcc), not + stdio.h (loses for new cross-compilers). From Roland McGrath. - * acspecific.m4 (AC_FIND_X_XMKMF, AC_FIND_X_DIRECT): Don't - override --x-includes and --x-libraries. Check openwin last due - to its bugs. +Tue Oct 11 13:22:22 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) - * acgeneral.m4: Add --x-includes, --x-libraries options. Document - them and --build, --host, --target. + * acspecific.m4 (AC_PATH_XTRA): Add X_PRE_LIBS variable and assume + -lSM if -lICE is found. From Karl Berry. - * autoconf.texi: Mention --x-includes and --x-libraries. +Mon Oct 3 20:12:36 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) - * INSTALL: Mention --x-includes and --x-libraries. + * testsuite/Makefile.in (AUTOCONF, AUTOCONFFLAGS): Test + ../autoconf, not installed autoconf. -Tue Apr 5 12:46:47 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Sat Oct 1 04:43:43 1994 Paul Eggert - * autoconf.texi: Document top_srcdir substitution. + * acspecific.m4: Catch `const' bug in NEC SVR4.0.2 mips cc. - * acspecific.m4 (AC_PROG_INSTALL): Look for install.sh in - @top_srcdir@, not $srcdir. + * Makefile.in (.sh, .pl, configure): Do chmod before mv. - * acgeneral.m4 (AC_OUTPUT): AC_SUBST top_srcdir. Set it. + * acheaders, acspecific.m4 (AC_HEADER_SYS_WAIT): New entry. -Mon Apr 4 20:13:08 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * acconfig.h (HAVE_SYS_WAIT_H): New entry. - * autoconf.texi: Fix dependencies examples. +Wed Sep 28 08:59:01 1994 David MacKenzie - * Makefile.in: Update configuration dependencies. + * Makefile.in: Set datadir to $(prefix)/share. - * acgeneral.m4: Add back --no-create option. Make config.status - --recheck use it. +Tue Sep 27 08:00:38 1994 David MacKenzie - * autoheader.sh: Go back to doing move-if-change. (Work around in - dependencies by using stamp files.) - -Thu Mar 31 11:34:50 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu) - - * Makefile.in (autoconf, autoheader, configure): Write to $@.tmp - instead of to $@ directly so that after a disk full error, the - targets to not exist. Otherwise, a subsequent make could install - a corrupt (but not executable) script. From Jim Meyering. - -Thu Mar 31 08:22:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * autoconf.texi: Re-document --with argument. - - * acgeneral.m4 (AC_PARSEARGS): --with can take an argument again. - -Wed Mar 30 20:01:57 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * autoconf.texi: Document --disable- options. - - * acgeneral.m4 (AC_PARSEARGS): Add --disable-FEATURE. - - * INSTALL: Mention --enable- options. - -Mon Mar 28 17:43:22 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PARSEARGS): Make multiple non-option args a - fatal error. - - * acspecific.m4: Change all occurrences of $(MAKE_VAR) to - ${MAKE_VAR}. - - * autoconf.texi (Command Line): New node. Move some descriptions - here from General Feature Tests. Describe --without- options. - - * acgeneral.m4 (AC_PARSEARGS): Rewrite again, using ideas from the - GNU libc configure.in. All options that take an argument set - shell variables. - (AC_COMPILE_CHECK): Add `return' in `int' function. - - * INSTALL: Fix typo. - -Sun Mar 27 00:44:07 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_NOTICE): Don't save original args or initialize - options here. - (AC_PARSEARGS): Do them here. - (AC_PREPARE): Save a copy of original args here, if it hasn't been - done yet. - -Sat Mar 26 01:32:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - - * acgeneral.m4: Omit obsolete options from usage message. - Quote args to AC_CHECKING that contain m4 variables. - - * INSTALL: Note that env can be used to set env vars. - - * autoconf.texi: Document AC_SET_MAKE. - Note that vsprintf and vfprintf come with vprintf. - Note that env can be used to set env vars. + * Makefile.in: Use implicit rules to make scripts. + From Jim Meyering. - * acspecific.m4 (AC_SET_MAKE): New macro. - (AC_PROG_INSTALL): Find scoinst as a good install program. + * acconfig.h: Remove #undefs of unused symbols. + From Paul Eggert. + * testsuite/autoconf.s/defines.exp: New file. + * testsuite/autoconf.s/specific.exp: Extract the list of macros to + test from acspecific.m4 instead of hardcoding it. + * acspecific.m4 (AC_PROG_CXXCPP): Default CXX to gcc, not c++. - * acgeneral.m4: Initialize variables set by options. - (AC_HAVE_HEADERS): Require cpp. +Mon Sep 26 12:32:46 1994 David MacKenzie - * autoconf.texi: Document AC_ENABLE and @prefix@ and @exec_prefix@ - substitutions. + * acspecific.m4 (AC_HEADER_DIRENT): Only check for -lx if not + using dirent. + * autoreconf.sh: Shorten sed label for OSF/1. + * acgeneral.m4 acspecific.m4: Change licensing terms for output. - * acgeneral.m4: Recognize all the Cygnus configure options; warn - about other arguments. Make default value for --with "yes", not - "1". AC_SUBST for prefix and exec_prefix. - (AC_ENABLE): New macro. +Thu Sep 22 15:36:56 1994 David MacKenzie -Thu Mar 24 18:11:00 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + * autoconf.sh (tmpin): Always set. - * INSTALL: Describe recently added configure options. +Wed Sep 21 13:12:10 1994 David MacKenzie - * autoconf.texi: Style cleanups. Mention config.h.top. + * acgeneral.m4 (AC_INIT_PREPARE): Remove trailing slashes from + srcdir. - * autoheader.sh: Add ${config_h}.top to the output, if it's - present. +Mon Sep 19 17:11:39 1994 David MacKenzie -Thu Mar 24 13:36:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * acgeneral.m4 (AC_INIT, AC_INIT_PARSE_ARGS, AC_CANONICAL_SYSTEM, + AC_ARG_PROGRAM): Make the default for program_transform_name be + a valid sed script, and substitute it always. - * autoconf.sh: Remove all temp files when exiting. If m4 fails, - produce no output and exit with the m4 exit status. +Sat Sep 17 08:27:58 1994 David MacKenzie - * autoconf.texi: Document AC_PREREQ. + * autoheader.sh: Protect `for' loop from checking empty $syms. - * acgeneral.m4 (AC_PREREQ): New macro, with some helper macros. + * ifnames.sh: Use % instead of , as sed s separator. -Thu Mar 24 01:20:49 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + * autoscan.pl: Update output comments. - * Makefile.in (acdatadir): New variable based on datadir, giving - Autoconf lib files their own subdirectory. Use it instead of - datadir. +Fri Sep 16 11:20:02 1994 David MacKenzie (djm@geech.gnu.ai.mit.edu) -Wed Mar 23 22:41:54 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + * acspecific.m4 (AC_TYPE_GETGROUPS): Provide a cross compiling + default. From Jim Meyering. - * autoconf.texi: Change names of nodes that describe invoking - configure and config.status to conform to coding standards. - Document --version, --help, --silent/--quiet, --verbose options to - configure and config.status. + * acgeneral.m4 (AC_INIT_PARSE_ARGS): Document + --program-transform-name. - * acgeneral.m4 (AC_PARSEARGS): Add --help and --version to - configure. Simplify getting option arguments. Complain about - impossible host arguments. - (AC_OUTPUT): Add --help and --version to config.status. +Thu Sep 15 16:26:36 1994 David MacKenzie (djm@geech.gnu.ai.mit.edu) -Wed Mar 23 00:16:28 1994 Roland McGrath (roland@mole.gnu.ai.mit.edu) + * acgeneral.m4 (AC_INIT_NOTICE): Clarify copying notice. + Fix up comments between sections. - * acgeneral.m4 (AC_CHECKING): Do nothing if $ac_silent is set. - (AC_PARSEARGS): Grok -q/--quiet/--silent and set $ac_silent. + * acspecific.m4 (AC_PROG_LEX): Omit extra checking message. -Tue Mar 22 18:28:30 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * autoreconf.sh: Give usage if non-option args are given. + * autoconf.sh autoheader.sh: Define AC_LOCALDIR for configure.in. - * autoconf.texi: Document AC_SIZEOF_TYPE. +Thu Sep 15 11:31:13 1994 Ian Lance Taylor (ian@airs.com) - * acspecific.m4 (AC_INT_16_BITS, AC_LONG_64_BITS): Mark obsolete - with advice to use AC_SIZEOF_TYPE instead. + * Makefile.in (check): Set AUTOCONFFLAGS from srcdir, not objdir. - * acgeneral.m4 (AC_SIZEOF_TYPE): New macro. +Thu Sep 15 09:06:40 1994 David MacKenzie (djm@churchy.gnu.ai.mit.edu) -Tue Mar 22 08:44:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + * acgeneral.m4 (AC_MSG_ERROR): Say that it's an error in the message. - * autoconf.texi: Describe AC_CHECKING et al. + * Makefile.in (check): Copy install-sh from srcdir if needed. - * acspecific.m4: Use AC_CHECKING et al. where appropriate. + * autoreconf.sh: Only regenerate autoheader-generated header file + templates. Pass relative macrodir properly. + * autoconf.sh autoheader.sh autoreconf.sh: Add -l --localdir option. + Based on work by Mark Eichin. - * acgeneral.m4 (AC_CHECKING, AC_VERBOSE, AC_ERROR, AC_WARN): New - macros. Use them where appropriate. - (AC_LANG_C, AC_LANG_CPLUSPLUS): Fix quoting of ac_cpp. + * ifnames.sh: Add -h option. + * autoconf.sh autoheader.sh: Remove -v option. - * acspecific.m4 (AC_PROG_CPP): Don't add $CFLAGS to CPP. - (AC_PROG_CXXCPP): Don't add $CXXFLAGS to CXXCPP. + * acgeneral.m4 (AC_CHECK_TYPE): Require AC_HEADER_STDC and check + stdlib.h if present. - * acgeneral.m4 (AC_OUTPUT): Don't remove VPATH lines containing - colons. From Jim Meyering (meyering@comco.com). - (AC_LANG_C): Add CFLAGS to ac_cpp. - (AC_LANG_CPLUSPLUS): Add CXXFLAGS to ac_cpp. + * acgeneral.m4 (AC_OUTPUT): Protect cache save from interruptions. -Sat Mar 19 16:38:03 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) +Tue Sep 13 09:46:23 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - * acgeneral.m4 (AC_LANG_RESTORE): Only emit shell code to change - the current language if it actually changed. + * Makefile.in (install): Use srcdir. From Mark Eichin. - * autoconf.texi: Add info dir entry. Describe new C++ macros and - AC_MMAP. - (Language Choice): New section. - Add another example of dependencies. + * acgeneral.m4 (AC_OUTPUT_FILES): Automatically add + configure_input comment to Makefiles again. + * Makefile.in testsuite/Makefile.in: Remove configure_input ref. - * acspecific.m4 (AC_PROG_CXX, AC_PROG_CXXCPP, AC_REQUIRE_CPP): New - macros based on work by zoo@aggregate.com (david d zuhn). - (AC_DECLARE_YYTEXT): Use AC_REQUIRE_CPP. Warn that it's broken. - (AC_STDC_HEADERS): Use AC_REQUIRE_CPP. - (AC_MMAP): New macro from Mike Haertel and Jim Avera. + * acgeneral.m4 (AC_LINK_FILES, AC_OUTPUT_LINKS): Reverse the order + of the arguments. Support relative symlinks. - * acgeneral.m4 (AC_PARSEARGS): Check for missing arguments to - options. Recognize --target. Save the original args before - modifying them. - (AC_INIT): Call AC_LANG_C. - (AC_PREPARE): Don't save the original args here (too late). - (AC_LANG_C, AC_LANG_CPLUSPLUS, AC_LANG_SAVE, AC_LANG_RESTORE): - New macros based on work by zoo@aggregate.com (david d zuhn). - (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_COMPILE_CHECK, - AC_TEST_PROGRAM, AC_TEST_CPP): Use AC_REQUIRE_CPP and ac_ext and - ac_cpp. + * acgeneral.m4 acspecific.m4: Remove some gratuitous {} in shell + variable references. - * autoheader.sh: Update the file even if it is unchanged, to avoid - foiling a Makefile rule that makes it from configure.in. If you - let the rule for making config.status from configure create - config.h from config.h.in, then an unnecessary update here will - not cause unneeded recompilation. Recompilation should only - happen if config.h is updated, which won't occur if config.h.in - had the same contents, even if its timestamp changed. (Ick.) + * acgeneral.m4 (AC_OUTPUT_FILES): New output variable + configure_input replaces big kludge for adding output comment. + * Makefile.in, testsuite/Makefile.in: Use it. - * Makefile.in (Makefile): Don't depend on config.status, to avoid - running config.status too many times. +Mon Sep 12 23:06:08 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) -Fri Mar 18 00:43:21 1994 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * acgeneral.m4 (AC_INIT_PREPARE, AC_OUTPUT_SUBDIRS): Make command + line quoting work for shell metachars besides blanks. - * autoconf.texi: Document AC_FIND_XTRA. +Sun Sep 11 23:34:24 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acgeneral.m4 (AC_OUTPUT): Remove VPATH lines if srcdir=., to - work around Sun make bug. From Karl Berry. - - Rename internal use shell variables to start with "ac_". - - Trap signal 2 (SIGINT), not signal 3 (SIGQUIT), which means stop - without cleaning up. From eggert@twinsun.com (Paul Eggert). + * acspecific.m4 (AC_PATH_XTRA): Link with X_EXTRA_LIBS when + checking for -lSM. - * acspecific.m4 (AC_FIND_XTRA): New macro from Karl Berry - (karl@cs.umb.edu). - (AC_FIND_X, AC_ISC_POSIX): Provide self. - - (AC_DECLARE_YYTEXT): Move AC_SUBST. Don't quote value of - DECLARE_YYTEXT. From Karl Berry. - - (AC_PROG_CPP): Include $CFLAGS in CPP. + * acfunctions (memcmp): Use AC_FUNC_MEMCMP. From Paul Eggert. - Rename internal use shell variables to start with "ac_". + * acgeneral.m4 (AC_COMPILE_CHECK): Mark obsolete. - * autoconf.sh, autoheader.sh: Trap signal 2 (SIGINT), not signal 3 - (SIGQUIT), which means stop without cleaning up. From - eggert@twinsun.com (Paul Eggert). +Sat Sep 10 10:59:19 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * autoconf.texi: Mention shell variable prefixes. + * Makefile.in (DISTFILES): Include install-sh, not install.sh. - * autoconf.texi: Work around RCS substitution in AC_REVISION - example. + * autoscan.pl: Check AC_MACRODIR. -Wed Mar 16 19:55:17 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * acgeneral.m4 (AC_INIT_PARSE_ARGS, AC_INIT_PREPARE, + AC_CONFIG_SUBDIRS, AC_OUTPUT_SUBDIRS): Make quoting of command + line options work. + (AC_CONFIG_AUX_DIRS): Check for install-sh over install.sh. - * acgeneral.m4 (compile): Include $LDFLAGS. + * acspecific.m4 (AC_FUNC_GETMNTENT): Only check for second lib if + first lib isn't found. From Jim Meyering. -Thu Mar 10 01:27:20 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Fri Sep 9 10:41:42 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acgeneral.m4 (AC_PREPARE): Don't absolutize relative paths. - (AC_OUTPUT): For relative paths, prepend to $srcdir as many - "../" as the number of subdirectories deep the file being created is. + * acspecific.m4 (AC_FUNC_MEMCMP): New macro, from Jim Meyering. + * testsuite/autoconf.s/specific.exp: Test it. -Tue Feb 15 16:02:19 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * testsuite/Makefile.in (site.exp): Simplify. - * acspecific.m4 (AC_PROG_INSTALL): Reject /sbin/install. + * acgeneral.m4 (AC_CACHE_SAVE): Use a shorter syntax for setting + the variables. Idea from Karl Berry. + (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Take an action-if-not-found. + From Jim Meyering. -Sun Feb 13 21:15:45 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * acconfig.h: Add entries for getmntent and strftime. + * acspecific.m4 (AC_C_CHAR_UNSIGNED): If GCC, don't run a test + program. - * autoconf.texi (Setting Variables, Sample configure.in): Replace - references to AC_UNISTD_H with AC_HAVE_HEADERS(unistd.h). +Thu Sep 8 10:53:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) -Thu Feb 10 21:39:43 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acspecific.m4 (AC_USG): Was passing too many args to AC_TRY_LINK. + (AC_FUNC_STRFTIME, AC_FUNC_GETMNTENT): New macros. + (AC_HEADER_DIRENT): Check for Xenix dir libs. + (AC_XENIX_DIR, AC_SCO_INTL, AC_IRIX_SUN, AC_DYNIX_SEQ, AC_AIX, + AC_ISC_POSIX, AC_MINIX): Go back to the v1 names. + * acoldnames.m4: Delete their aliases. + * testsuite/autoconf.s/specific.exp: Check them. - * acspecific.m4 (AC_SYS_SIGLIST_DECLARED): New macro. + * acgeneral.m4 (AC_ARG_PROGRAM): Use `;' instead of `-e' to + separate sed arguments, to simplify Makefile usage and support + sed arguments containing spaces. + (AC_CANONICAL_HOST): Move check for config.sub here from + AC_CANONICAL_SYSTEM. -Sat Feb 5 13:35:52 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * autoheader.m4 (AC_CHECK_HEADERS_DIRENT): Redefine. From Paul Eggert. + (AC_CHECK_SIZEOF): Redefine this, not the old name. + (AC_HAVE_LIBRARY): Redefine. - * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm separately after - -lutil check. +Wed Sep 7 09:32:31 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Fri Feb 4 17:17:11 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * testsuite/lib/common.exp: Ignore warnings about test programs. + * testsuite/autoconf.s/specific.exp: Check AC_FUNC_CLOSEDIR_VOID. - * acgeneral.m4 (AC_OUTPUT_HEADER): Move creation of conftest.sed - outside of `for' loop. We need only do this once for all the - output files. + * Makefile.in (*clean): Remove the new index. + (dist): Undo adding write perms. Screws up RCS. + * acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): Remove comments from sed + program. + * acoldnames.m4: Change a couple of AC_DEFUN to define. -Fri Jan 21 16:35:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) +Wed Sep 7 01:27:19 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acspecific.m4 (AC_PROG_INSTALL_INSTALL_SH): New macro for - INSTALL value to use install.sh. - (AC_PROG_INSTALL): Use it. + * acgeneral.m4 (AC_SITE_LOAD): Check whether $CONFIG_SITE is empty. -Thu Jan 6 16:22:25 1994 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Tue Sep 6 09:55:30 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acgeneral.m4 (AC_DEFINE): Use AC_QUOTE_SQUOTE instead of - AC_DEFINE_QUOTE on AC_VAL. From Bruno Haible - . - * acgeneral.m4 (AC_DEFINE_UNQUOTED): pushdef/popdef - AC_QUOTE_SQUOTE instead of AC_DEFINE_QUOTE. + * acgeneral.m4 (AC_ARG_PROGRAM): New macro. + (AC_INIT_PARSE_ARGS, AC_CANONICAL_SYSTEM): Do a little setup for it. -Wed Dec 22 03:51:53 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * acspecific.m4 (AC_PROG_INSTALL): Clarify comment. Remove check + for bsdinst, since it's no better than our install.sh. + (AC_CHECK_HEADER_DIRENT, AC_CHECK_HEADERS_DIRENT): New macros. + (AC_HEADER_DIRENT, AC_DIR_HEADER): Use them. + (AC_PROG_CC, AC_PROG_CXX): Check whether GCC accepts -g. - * acgeneral.m4 (AC_DEFINE): in verbose strings, put - AC_DEFINE_QUOTE exprs in double quotes to avoid shell wildcard - expansion. - - * acgeneral.m4 (AC_PROGRAM_PATH, AC_PROGRAMS_PATH): New macros. - * autoconf.texi (General Tests): Document them. + * acgeneral.m4 (AC_INIT_PREPARE): Call AC_PROG_ECHO_N. + Use define instead of AC_DEFUN for some frequently called or + internal macros that aren't involved in ordering constraints. - * configure.in: Use AC_PROGRAMS_PATH to find m4, not AC_PROGRAMS_CHECK. - Put `m4' in the list of progs-to-check, since we want the absolute - pathname for that too if we can get it. +Mon Sep 5 17:37:36 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) -Fri Dec 17 13:44:24 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * acspecific.m4 (AC_C_CROSS): Provide default argument to AC_TRY_RUN. - * acspecific.m4 (AC_ALLOCA): define HAVE_ALLOCA if alloca is - present in system libraries. +Fri Sep 2 09:30:41 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) -Tue Dec 14 14:53:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acgeneral.m4 (AC_TRY_CPP): Use a temp file so sh -x works. + From Mark Nudelman. - * acgeneral.m4 (AC_PREPARE): Remove $ac_clean_files in traps. + * acgeneral.m4: --norecursion -> --no-recursion. + (AC_OUTPUT_LINKS): Reset srcdir to ac_given_srcdir. - * acspecific.m4 (AC_STDC_HEADERS): Check that free appears in stdlib.h. + * acspecific.m4 (AC_PATH_X): Call AC_ARG_WITH(x, ...). + (AC_PROG_INSTALL): Search for bsdinst too. -Fri Dec 10 06:35:25 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * Makefile.in (dist): Make distribution files writable. - * acspecific.m4 (AC_PROG_INSTALL): Don't look for install in `.'. + * acgeneral.m4 (AC_OUTPUT): Move trap 0 commands to near the end + of configure, to work around shell bug in failing to execute the + trap when there are commands after AC_OUTPUT. -Wed Dec 8 12:10:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) +Sat Sep 3 19:47:06 1994 Roland McGrath - * acspecific.m4 (AC_FIND_X_XMKMF): Redirect stderr to /dev/null in - eval'd make pipeline. + * acgeneral.m4 (AC_OUTPUT_FILES): Write CONFIG_FILES defn + unquoted, so $1 can contain references to shell variables in configure. - * acgeneral.m4 (AC_QUOTE_SED): Quote ! as well. +Thu Sep 1 15:34:15 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) -Mon Dec 6 23:41:05 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * acgeneral.m4 (AC_TRY_RUN): Always warn if no cross-compile + default is given. + * acspecific.m4 (AC_FUNC_MMAP, AC_FUNC_VFORK, AC_FUNC_WAIT3, + AC_FUNC_UTIME_NULL, AC_FUNC_STRCOLL): Provide a default + for AC_TRY_RUN. + (AC_FUNC_CLOSEDIR_VOID): New macro, broken out of AC_HEADER_DIRENT. - * acspecific.m4 (AC_PROG_CPP): Try 'cc -E -traditional-cpp' for NeXT. +Thu Sep 1 00:06:38 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Thu Dec 2 02:25:39 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * acgeneral.m4 acspecific.m4: Discard all output until AC_INIT is + called. Remove now-unnecessary dnl's between macro definitions. + (AC_OUTPUT): Add exit 0 and optional unquoted here document to + end of config.status. - * acgeneral.m4 (AC_PREPARE): use rm -r to remove conftest* both in - exit traps and at start of script. +Wed Aug 31 00:11:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Wed Dec 1 03:22:21 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * acspecific.m4 (AC_PATH_X_DIRECT): Use AC_TRY_LINK instead of + AC_CHECK_LIB, so we don't add the library to $LIBS or print anything. + (AC_PATH_XTRA): Remove initial checking message. + (AC_HEADER_STDC): In test program, default to no STDC headers if + cross compiling. - * acspecific.m4 (AC_FIND_X_DIRECT): Search for includes and libs - in more places. +Tue Aug 30 16:16:29 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Sun Nov 28 21:57:31 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * autoreconf.sh: Add -h option. + * autoupdate.sh: Remove -v option. - * acgeneral.m4 (AC_NOTICE): Replace "this program" with "this - configure script" to disambiguate between configure and the - program it is distributed with (which can have different terms). + * acgeneral.m4 (AC_EGREP_CPP, AC_TRY_CPP): Add parens around eval + for old shells. From Kaveh Ghazi. + (AC_TRY_RUN): Warn when generating configure, if called without + a default parameter and AC_CANONICAL_SYSTEM has been called. -Tue Nov 23 19:41:53 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * autoheader.sh: Don't run `for' loops on empty lists. + From Ken Raeburn. - * acspecific.m4 (AC_FIND_X_DIRECT): Use the shell variable - `x_direct_test_include' to choose the include file to search for. + * autoconf.sh autoheader.sh: Print the version number using grep + like the other scripts, not using m4. + * acgeneral.m4: Remove conditional for printing version number. + It broke with frozen files. -Sat Nov 20 17:58:09 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + * autoheader.m4: New file. + * autoheader.sh: Use it; the frozen version if possible. + * Makefile.in (install): Install a frozen autoheader.m4f if possible. + * autoconf.m4: Don't sinclude acsite.m4 here. + * acgeneral.m4 (AC_INIT): Include it here. - * acspecific.m4 (AC_FIND_X_DIRECT): Search for R6 includes & libs - in various places. Look for /usr/athena/include & /usr/athena/lib. - Make AC_HAVE_LIBRARY check for the library specified by the shell - variable `x_direct_test_library', rather than hardcoding Xt (to - which the shell variable now defaults). +Tue Aug 30 14:02:07 1994 David J. MacKenzie (djm@mole.gnu.ai.mit.edu) -Thu Nov 18 18:17:21 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acgeneral.m4 (AC_CHECK_LIB): Use AC_DEFINE_UNQUOTED. + From Jim Meyering. - * acgeneral.m4 (AC_OUTPUT_HEADER): Use ! instead of @ as the - sed substitution separator. + * acgeneral.m4: Revise diversions, to topologically order + macros called via AC_REQUIRE. + (AC_DIVERT_PUSH, AC_DIVERT_POP): New macros. + (AC_INIT, AC_ARG_ENABLE, AC_ARG_WITH, AC_SUBST, AC_SUBST_FILE, + AC_REQUIRE): Use them. + From Franc,ois Pinard (bless his soul!). + (AC_PRO, AC_EPI): New macros. + (AC_DEFUN): Use them. + (AC_INIT): sinclude aclocal.m4 herea. + * autoconf.m4: Not here. - * install.sh: New file. - * Makefile.in (DISTFILES): Add it. - * acspecific.m4 (AC_PROG_INSTALL): Use it as the default - instead of cp, if it's there. + * autoconf.sh: Use a freeze file if available and m4 can do it. + * Makefile.in (install): Install a freeze file if m4 supports it. -Sat Nov 13 12:24:57 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) +Mon Aug 29 16:18:22 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acgeneral.m4 (AC_OUTPUT): Extend that last change to also - happen for .C, .cc, and .m (objc) files. + * acgeneral.m4 (AC_TRY_CPP): Remove subshell and move quotes. -Wed Nov 10 09:26:35 1993 Noah Friedman (friedman@gnu.ai.mit.edu) +Sun Aug 28 17:37:26 1994 David J. MacKenzie (djm@bennett.eng.umd.edu) - * acgeneral.m4 (AC_OUTPUT): When substituting .c or .h files, put - autoconf-added comments in '/* ... */'. + * acspecific.m4 (AC_C_CHAR_UNSIGNED, AC_C_LONG_DOUBLE, + AC_C_INLINE): Don't AC_REQUIRE AC_PROG_CC. -Mon Nov 8 16:22:48 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * acspecific.m4 (AC_RSH, AC_ARG_ARRAY, AC_HAVE_POUNDBANG): Define + to print error messages. - * acgeneral.m4 (AC_NOTICE): Put autoconf version number in configure. + * acgeneral.m4 (AC_OUTPUT_LINKS): Insert ac_links and ac_files + into config.status using an *un*quoted here document. + From Ken Raeburn. -Fri Nov 5 23:31:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Sat Aug 27 13:31:58 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acspecific.m4 (AC_FIND_X_XMKMF): properly quote `acfindx' rule. + * acgeneral.m4 (AC_OUTPUT_HEADER): Remove comments from within sed + script. From Kaveh Ghazi . -Fri Oct 29 21:46:57 1993 Jim Meyering (meyering@comco.com) +Fri Aug 26 17:03:18 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) - * acspecific.m4 (HAVE_LONG_DOUBLE): Add code to detect Stardent - Vistra lossage. From Kaveh R. Ghazi (ghazi@noc.rutgers.edu). + * autoconf.sh, acgeneral.m4: __LINE__ -> __oline__. -Tue Oct 26 15:24:33 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + * acgeneral.m4 (AC_TRY_CPP, AC_EGREP_CPP): Append any error output + to config.log. + (AC_EGREP_CPP): Don't use a temp file. - * Version 1.7. + * acspecific.m4 (AC_FUNC_ALLOCA): Require CPP. -Tue Oct 19 23:49:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acgeneral.m4 (AC_INIT_PREPARE): Replace AC_SUBST_DEFAULT calls + with AC_SUBST. + (AC_SUBST_DEFAULT): Macro removed. + * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): If CFLAGS or CXXFLAGS + was not set already, give it a default value according to whether + we have gcc. - * acgeneral.m4 (AC_TEST_PROGRAM): Don't remove conftest* before - running $2 or $3 or $4; just once at the end. + * acspecific.m4 (AC_PATH_XTRA): Use AC_CHECK_LIB, not AC_HAVE_LIBRARY. -Mon Oct 18 01:38:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) +Fri Aug 26 00:34:11 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acgeneral.m4 (AC_PREPARE): Echo a newline into confdefs.h so it - is never empty. + * acconfig.h (HAVE_UNION_WAIT): Entry removed; it wasn't defined + anywhere. -Fri Oct 15 18:49:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acgeneral.m4 (AC_OUTPUT_HEADER): rm files before mv onto them. + (AC_OUTPUT): Remove explicit exit at end of configure, to allow + code after AC_OUTPUT (needed for Emacs). - * acspecific.m4 (AC_CONST): Added test of trivial use for broken - Ultrix-32 V3.1 Rev 9 vcc. + * acgeneral.m4 (AC_CANONICAL_SYSTEM): Move setting of alias vars + into submacros. -Fri Oct 15 15:44:39 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * acspecific.m4 (AC_PROG_CPP): If $CPP is set and is a directory, + ignore it. - * acgeneral.m4 (AC_OBSOLETE): New macro. - * acspecific.m4 (AC_UNISTD_H, AC_USG, AC_MEMORY_H): Call it. +Thu Aug 25 09:26:36 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_LONG_FILE_NAMES): Try to create files in - ${prefix}/lib and ${exec_prefix}/lib instead of ${prefix} and - ${exec_prefix}; they are more likely to be writable. + * acspecific.m4 (AC_SYS_INTERPRETER): Move hash mark out of macro + call. + (AC_FUNC_MMAP): If C++, put malloc decls in extern "C". - * Makefile.in (clean): Remove *.ma and *.mas, the macro index files. + * acgeneral.m4 (AC_INIT_PARSE_ARGS): Untabify help message + and indent options. -Tue Oct 12 16:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * Makefile.in (DISTFILES): Remove ChangeLog.0. - * acspecific.m4 (AC_RETSIGTYPE): AC_PROVIDE self. + * acgeneral.m4 (AC_CHECK_LIB): Do uppercasing of library name at + runtime. + (AC_HAVE_LIBRARY): Retain old behavior. -Mon Oct 11 19:09:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acspecific.m4 (AC_FUNC_VFORK): If C++, use a prototype for the + function in the test program. + (AC_C_ARG_ARRAY): Macro deleted. + * acoldnames.m4, acconfig.h, testsuite/autoconf.s/specific.exp: + Remove references to it. - * Makefile.in (editsh): Obfuscate @M4@ and @datadir@ references so - configure doesn't edit them. + * autoupdate.sh: Make sure $infile can be read, and $tmpout has + the same permissions. Make sure $infile can be written. From + Paul Eggert. -Sun Oct 10 14:01:35 1993 Jim Meyering (meyering@comco.com) + * acgeneral.m4 (AC_INIT*): Remove now-incorrect AC_BEFORE calls. + (AC_CHECK_FUNC): If C++, use extern "C". + (AC_TRY_LINK, AC_TRY_RUN): If C++, declare exit. - * autoconf.sh (--help): Exit successfully. + * acspecific.m4 (AC_PATH_XTRA): Check for more libraries. + From Karl Berry. -Sat Oct 9 08:29:15 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acgeneral.m4 (AC_INIT_PREPARE): Substitute CPPFLAGS. + (AC_LANG_C, AC_LANG_CPLUSPLUS): Include CPPFLAGS in the commands. - * Version 1.6. + * acgeneral.m4 (AC_OUTPUT_FILES): Move protection for right side + of sed substitution here from AC_MAKE_DEFS, so it applies to all + AC_SUBST'd variables. - * acconfig.h (inline): New entry. + * Makefile.in (install): Use for loops. From Jim Meyering. - * acspecific.m4 (AC_DIR_HEADER_CHECK): Don't call opendir, in - case the needed libraries (e.g., -ldir on Xenix) aren't in - LIBS yet. From Jim Meyering (meyering@comco.com). + * acgeneral.m4: Revise diversions to rely on implicit flushing at + the end of the m4 run. Idea from Franc,ois Pinard. + (AC_INIT_PREPARE, AC_ARG_ENABLE, AC_ARG_WITH, AC_PREFIX_PROGRAM): + Write to the appropriate diversions. + (AC_ENABLE, AC_WITH): Supply default help string. + (AC_ENABLE_INTERNAL, AC_WITH_INTERNAL, AC_PREFIX_INTERNAL): + Macros removed. + (AC_CONFIG_SUBDIRS): Set `subdirs' here instead of in + AC_INIT_PREPARE. + (AC_PREFIX): Macro removed. + * acoldnames.m4 (AC_PREFIX): Make it an alias for AC_PREFIX_PROGRAM. - * acspecific.m4 (AC_PROG_LEX): Fix typo. + * acoldnames.m4: We don't officially support calling + the subroutines of AC_INIT directly, or replacing them, so don't + document it. - * acgeneral.m4 (AC_HEADER_EGREP, AC_PROGRAM_EGREP, - AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove any - temporary files before doing the actions, in case they're - nested tests. From gray@antaire.com (Gray Watson). +Wed Aug 24 00:19:05 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * configure.in: Check for GNU m4 under several names. - * Makefile.in: Use that value. + * acgeneral.m4 (AC_EGREP_CPP, AC_TRY_LINK, AC_TRY_RUN, + AC_TRY_CPP): Add #line directives. + * autoconf.sh: Make the #line directives accurate. From Franc,ois Pinard. - * acspecific.m4 (AC_STRUCT_TM): Use a member of struct tm, to - make sure the compiler complains if it's not defined. - From Bruno Haible (haible@ma2s2.mathematik.uni-karlsruhe.de). - - * acspecific.m4 (AC_FIND_X_XMKMF): If libX11.a isn't in - USRLIBDIR, check in LIBDIR. Filter out any make verbose messages. - -Tue Oct 05 19:21:29 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_LONG_DOUBLE): Announce that this feature is being - checked even if the test is simply whether $CC is gcc. - -Tue Oct 5 14:23:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh: Produce HAVE_LIBfoo for AC_HAVE_LIBRARY. - -Sun Oct 3 15:41:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Write assignment for `extrasub'; in sed - cmds, write "$extrasub" so configure.in can set it to do sed frobs. - Take second arg and write it to config.status before `exit 0'. - - * acspecific.m4 (AC_CONST): Say `checking for lack of working - const'. That is precisely accurate. - -Wed Sep 22 15:47:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4: If not using GNU m4, abort. - - * acgeneral.m4 (AC_PREPARE): Lose if we're not in the srcdir, - not if we're in it. But disable the check for now. - -Mon Sep 20 15:32:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PREPARE): Check for $srcdir being configured, - diagnose and lose. - - * acgeneral.m4 (AC_QUOTE_SED): Quote @ and %. - - * acgeneral.m4 (AC_OUTPUT): Say "$file is unchanged" when it is. - -Sat Sep 18 14:32:04 1993 Ian Lance Taylor (ian@airs.com) - - * acgeneral.m4: Substitute for CONFIG_FILES and CONFIG_HEADERS - before using them, in case they have multiple values. - -Fri Sep 17 14:40:20 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_WAIT3): wait3 works if ru_stime is - nonzero, too. - -Thu Sep 16 15:39:53 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_FIND_X_XMKMF): Code moved from AC_FIND_X. - (AC_FIND_X_DIRECT): New function, derived from code by Karl - Berry and Rob Savoye. - (AC_FIND_X): Call them. - -Wed Sep 15 19:06:46 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PREPARE): Remove confdefs* on exit with trap 0. - (AC_OUTPUT): Don't bother removing it. - - * acgeneral.m4: Remove --no-create option; not useful. - -Mon Sep 13 21:54:46 1993 Paul Eggert (eggert@twinsun.com) - - * autoheader.sh: Rename the temporary output to the real - output if their contents differ, not if their contents are identical. - This fixes bug introduced in Aug 30 change. - -Mon Sep 13 16:50:30 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Run config.status with - CONFIG_SHELL if defined. Same for configure run from config.status. - Rename gen_files to CONFIG_FILES and gen_config to CONFIG_HEADERS. - - * acgeneral.m4 (AC_PREPARE): Remove confdefs* in trap. - -Fri Sep 10 00:29:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_LONG_FILE_NAMES): Test /var/tmp as well. - In loop, skip past nonexistent dirs. - - * acspecific.m4 (AC_CONST): Say "working", not "broken". We are - checking for a working const as opposed to a broken or absent - const, not for a broken const as opposed to a working one. - -Thu Sep 9 09:25:49 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4, acconfig.h (AC_LONG_64_BITS): New macro. - -Wed Sep 1 18:54:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PROGRAM_CHECK): Use && instead of test -a. - -Tue Aug 31 19:21:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT_HEADER): Support generating multiple - .h files. From gray@antaire.com (Gray Watson). - - * acspecific.m4 (AC_ALLOCA): If using alloca.o, define C_ALLOCA. - - * acgeneral.m4 (compile, AC_HEADER_EGREP, AC_PROGRAM_EGREP, - AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove $DEFS - from cc and cpp command lines; include "confdefs.h" in test - files. - (AC_DEFINE): Append a #define to confdefs.h. - Reduce duplicated code by introducing a temp variable, AC_VAL. - -Mon Aug 30 17:36:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh: Don't write output if it is the same as output file. - -Wed Aug 25 14:14:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_VFORK): Check for SunOS 5.2 bug with ignoring - signal in parent before vfork. From eggert. - -Fri Aug 20 10:14:42 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PARSEARGS): Support giving values to --with - options. Go back to using sed for invalid test, but without - using '*' in the regex. - -Thu Aug 19 14:53:29 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_LONG_FILE_NAMES): eval the args. - - * acgeneral.m4 (AC_PARSEARGS): Use case instead of sed and - test to detect invalid package names. Remove =value from - --with options until we support it. - -Wed Aug 11 18:52:41 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_FIND_X): Don't set x_includes if it's - /usr/include or x_libraries if it's /lib or /usr/lib. - -Wed Aug 11 13:00:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_LONG_FILE_NAMES): If we cannot write $dir, echo - a warning msg and continue the loop to skip that directory. - - * acgeneral.m4 (AC_REVISION): Also eat double quotes. - -Thu Aug 5 14:55:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acconfig.h: Add TIME_WITH_SYS_TIME. - -Mon Aug 2 14:55:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_DECLARE_YYTEXT): \-escape "s in rhs of - AC_DEFINE_UNQUOTED. - Remove gratuitous second arg to AC_SUBST. - -Sun Aug 1 19:13:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Define HAVE_GETLOADAVG if we find - one and don't use our own getloadavg.c. - * acconfig.h: Add HAVE_GETLOADAVG. - -Sat Jul 31 17:28:48 1993 Karl Berry (karl@cs.umb.edu) - - * acspecific.m4 (AC_PROG_INSTALL): Report results under -v. - -Fri Jul 30 18:08:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh (syms, headers, funcs, libs): Run values through - sort|uniq to remove duplicates. - -Wed Jul 28 00:02:34 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * Makefile.in (config.status): Run config.status --recheck, - not configure. - (install): Remove refs to install-info until it's released, - because people are getting confused. - - * acgeneral.m4 (AC_OUTPUT): For config.status --recheck, echo - the configure command line that we run. - - * acspecific.m4 (AC_PROG_FLEX): Use AC_HAVE_LIBRARY. - -Mon Jul 26 19:11:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Check that both -lutil and -lkvm - exist before choosing them in hopes they will define getloadavg. - - * autoheader.sh (frob): Put $2 and $3 in the expansion of - AC_HAVE_LIBRARY, so AC_DEFINE there is noticed. - -Mon Jul 26 14:21:33 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acspecific.m4 (INT_16_BITS): Check the obvious way, so it - doesn't pick up machines with 64 bit longs. - -Mon Jul 26 14:01:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Check for -lelf with - AC_HAVE_LIBRARY instead of checking for with AC_HEADER_CHECK. - -Mon Jul 26 13:58:39 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acspecific.m4 (AC_SCO_INTL, AC_IRIX_SUN, AC_DYNIX_SEQ): Use - AC_HAVE_LIBRARY. - -Mon Jul 26 13:55:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh (eval frob): Restore hairy sed use; we need it to - handle multi-line macro invocations. - -Mon Jul 26 00:50:43 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acspecific.m4 (AC_FIND_X): Quote the Imakefile. - -Sun Jul 25 08:17:11 1993 Jim Meyering (meyering@comco.com) - - * acconfig.h (CRAY_STACKSEG_END): New #undef. - -Thu Jul 22 20:26:12 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Version 1.5. - - * acspecific.m4 (AC_FIND_X): Let make substitute any variables - in INCROOT and USRLIBDIR, instead of using sed. - From wojo@veritas.com (Jack Woychowski). - - * acgeneral.m4 (AC_DEFINE): When printing value verbosely, use - double quotes and AC_DEFINE_QUOTE, like we do when assigning - the value, so shell variables get expanded the same way. - - * acgeneral.m4 (AC_REVISION): New macro. - From wollman@uvm-gen.EMBA.UVM.EDU (Garrett Wollman). - - * acgeneral.m4 (AC_DEFINE): Add newline before open brace. - -Thu Jul 22 17:07:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_STAT_MACROS_BROKEN): New macro. - * acconfig.h (STAT_MACROS_BROKEN): New #undef. - -Wed Jul 21 15:44:32 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_DECLARE_YYTEXT): Use AC_DEFINE_UNQUOTED so - shell var is replaced in rhs. - -Wed Jul 21 13:31:38 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acconfig.h (size_t, mode_t, off_t): Added. - * acspecific.m4 (AC_OFF_T): New macro. - -Tue Jul 20 15:39:44 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * autoheader.sh: Put header-file.in in comment at top. - - * acconfig.h (NDIR): Added. - -Mon Jul 19 22:10:49 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - - * Makefile.in (info, dvi): New targets. - -Sun Jul 18 22:36:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh (frob): Use `#' as the first line of each definition. - (eval frob): Totally simplify sed use to just handle "^@@@.*@@@$". - -Wed Jul 14 22:44:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acconfig.h: Restore blank lines between paragraphs. - - * autoheader.sh (libs): New variable and frob to set it from - AC_HAVE_LIBRARY uses. Produce #undef HAVE_* for each $libs. - -Tue Jul 13 19:03:46 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acconfig.h: Sort the entries, like the comment says. - - * acspecific.m4 (AC_GETLOADAVG): Only check for the AIX library - once, looking in both local and system dirs. - Consolidate SVR4 and Solaris cases. - -Mon Jul 12 20:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): If we find sys/dg_sys_info.h, do - AC_HAVE_LIBRARY on -ldgc. - -Sun Jul 11 00:43:51 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): BSD library is -lutil, not - -lutils, and requires -lkvm too. - Check for local AIX library using AC_HAVE_LIBRARY, not - AC_COMPILE_CHECK. - Un-nest some conditionals. Stop checking once we've - found a way to get getloadavg. - -Thu Jul 8 20:21:28 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in: Remove rules for making *.conf; make - Autoconf's configure script semi-normally. - -Wed Jul 7 14:37:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * autoheader.sh (--help): Print help message to stdout and exit 0. - (--version): Exit after printing version number. - * autoconf.sh (--version): Exit after printing version number. - - * acspecific.m4 (AC_LONG_DOUBLE): Make sure that long double - isn't smaller than double, as in Ultrix 4.[23] cc. - - * acgeneral.m4 (AC_REPLACE_FUNCS): Include ctype.h in the test - program to get stubs. - - * acspecific.m4 (AC_FIND_X): New macro. - -Tue Jul 6 19:15:17 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Try ls -L first, in case - /dev/kmem is a symlink (as on Solaris). - -Wed Jun 30 22:08:22 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_MINUS_C_MINUS_O): Remove spurious `then'. - -Fri Jun 25 23:16:42 1993 Paul Eggert (eggert@twinsun.com) - - * acspecific.m4 (AC_CONST): Replace `p = ' - with `ccp = '; the former wasn't ANSI C, and - was causing working compilers to be rejected. - -Fri Jun 25 13:26:34 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_LONG_FILE_NAMES): Redirect rm's stderr to - /dev/null. - -Thu Jun 24 15:58:04 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Undo - change of Jun 16 1993. Only set `LANG' and `LC_ALL' to "C" if - already set. - -Sat Jun 19 00:01:51 1993 Jim Meyering (meyering@comco.com) - - * acgeneral.m4: Undefine m4's `format' builtin. - * acspecific.m4 (AC_HAVE_POUNDBANG): Make conftest executable, - but not necessarily writable by group or other. - -Thu Jun 17 21:10:33 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PROG_CPP): Put double quotes around ${CC-cc}, - not single quotes. - If --verbose option given, say what CPP is being set to. - -Wed Jun 16 17:50:00 1993 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PROG_CPP): Make sure that `cc -E` doesn't - run the program through the C compiler too. Bob Olson - says it does on the NeXT. - -Wed Jun 16 16:17:05 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Always set - `LANG' and `LC_ALL' environment variables to `C'. - -Fri Jun 11 14:29:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_MINUS_C_MINUS_O): Test that cc works at all, - and only test it for -c -o if it does. - -Tue Jun 8 01:47:22 1993 Paul Eggert (eggert@twinsun.com) - - * acgeneral.m4 (AC_OUTPUT): The line - DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`" - doesn't work in some shells, which don't allow nesting - \"\" inside `` inside "", and which don't unescape \\\& in the - expected (?) way. Also, some versions of echo interpret - backslashes inside $DEFS. Put $DEFS into a temporary file - to avoid these portability minefields. - -Mon Jun 7 20:11:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): In setting KMEM_GROUP, use new sed - magic from friedman which should win with both meanings of ls -lg. - -Mon Jun 7 06:48:49 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * Makefile.in (dist): Change gzipped tar file extension to `.gz'. - Use explicit --gzip option to tar to make sure tar uses the right - compression program (or else exits from failure to understand the - option). - - * acgeneral.m4 (AC_OUTPUT): Don't split sed expr for exec_prefix - across two lines, since not all versions of sed understand that. - - * acspecific.m4 (AC_HAVE_POUNDBANG): Complete rewrite which doesn't - depend on csh. - -Tue Jun 1 03:06:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * Version 1.4.1 (not announced to the general public, but - a snapshot was put on the June '93 GNU CDROM). - - * Makefile.in (dist): If ln fails (e.g. because of cross-device - links), mention on stdout that file is being copied. - - * acgeneral.m4 (AC_PREPARE): Use `[$]*' in assignment to - configure_args to get shell positional args, rather than m4 args to - AC_PREPARE. - (AC_OUTPUT): Use `configure_args' in config.status - when invoked with --recheck, rather than $*. - -Mon May 31 13:12:56 1993 Paul Eggert (eggert@twinsun.com) - - * acspecific.m4 (AC_LONG_FILE_NAMES): rm $dir/conftest*, - not conftest*. - -Mon May 31 04:18:18 1993 Roland McGrath (friedman@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_HAVE_LIBRARY): Quote libname in define. - -Sun May 30 19:52:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_SETVBUF_REVERSED): Pass (char *) main to - setvbuf instead of zero. - -Thu May 27 20:30:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PREPARE): Save $* in shell var `configure_args'. - (AC_OUTPUT): Use $configure_args in place of $*. + * acgeneral.m4 (AC_OUTPUT): Set ac_given_INSTALL from INSTALL. + (AC_SUBST_FILE): Replace with what was AC_INSERT_FILE. + (AC_SUBST_DEFAULT): New macro. + (AC_INIT_BINSH): Renamed from AC_BINSH. + (AC_INIT_PREPARE): Call AC_SUBST_DEFAULT for CFLAGS, CXXFLAGS, and + LDFLAGS. -Wed May 26 16:19:51 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * acspecific.m4 (AC_HEADER_MAJOR): Don't nest caching tests. - * autoconf.texi (AC_PROG_INSTALL): Doc fix. - (Automatic Remaking): Put code fragment in @example ... @end example. + * Makefile.in (clean): Remove the new index files. -Mon May 24 15:46:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * configure.in: Check for gm4 before gnum4. - * autoheader.sh (frob): Redefine AC_CONFIG_HEADER to set shell - variable `config_h'. - (config_h): New variable, initialize to "config.h" before frobbing. - (final output): Write ${config_h}.in. + * acspecific.m4 (AC_PROG_RSH): Macro removed. -Sat May 22 17:45:19 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * Makefile.in (install): Install autoconf.m4. - * Version 1.4 released. + * acspecific.m4 (AC_SYS_INTERPRETER): New name and calling + convention for AC_HAVE_POUNDBANG. + (AC_OS_XENIX): Check ac_header_dir instead of DEFS. -Thu May 20 20:25:45 1993 Jim Blandy (jimb@geech.gnu.ai.mit.edu) + * testsuite/autoconf.s/specific.exp: Add AC_HEADER_DIRENT. + Remove AC_SYS_REMOTE_TAPE. Replace AC_HAVE_POUNDBANG with + AC_SYS_INTERPRETER. - * acgeneral.m4 (AC_IDENTITY): New function. - (AC_DEFINE_UNQUOTED): Use it to fix this; due to a - misunderstanding of m4, this was using its first argument as - the definition. + * acspecific.m4 (AC_INT_16_BITS, AC_LONG_64_BITS): Reword messages. -Thu May 20 09:21:55 1993 Jim Meyering (meyering@comco.com) + * acgeneral.m4 (AC_CHECK_LIB): Use our standard alternate m4 quote + characters << and >> instead of /. - * acspecific.m4 (AC_ALLOCA) [find_stack_direction]: Return the - value from the recursive call. If it worked before, it was by luck. - From Bruno Haible . + * acspecific.m4 (AC_C_CONST, AC_TYPE_GETGROUPS, + AC_PROG_GCC_TRADITIONAL): Don't put the test program in a + temporary variable. -Tue May 18 23:40:21 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * acgeneral.m4 (AC_CHECK_HEADERS, AC_CHECK_FUNCS): Use + AC_DEFINE_UNQUOTED. + * autoheader.sh (AC_DEFINE_UNQUOTED): Define. - * acspecific.m4 (AC_STDC_HEADERS): Require AC_PROG_CPP. +Tue Aug 23 00:03:06 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Mon May 17 18:01:09 1993 Karl Berry (karl@hal.gnu.ai.mit.edu) + * acgeneral.m4: Improve comments on some macros. + Fix improperly quoted undefine calls. + (AC_QUOTE_DQUOTE, AC_QUOTE_SQUOTE, AC_QUOTE_HERE, AC_QUOTE_SED, + AC_QUOTE_TOKEN, AC_DEFINE_QUOTE, AC_DEFINE_SEDQUOTE, + AC_QUOTE_IDENTITY): Macros removed. + (AC_DEFINE, AC_DEFINE_UNQUOTED): Only write the (correct) value to + confdefs.h. + (AC_OUTPUT_MAKE_DEFS): New macro. + (AC_OUTPUT): Call it. Move AC_SUBST calls to AC_INIT_PREPARE. + (AC_OUTPUT_FILES): Put most variable substitutions in a here document + instead of a string, to avoid unwanted changes to the values. + (AC_OUTPUT_HEADER): Generate the sed script to transform + config.h.in from conftest.h. Only split up the sed script in + configure, not also in config.status. - * acgeneral.m4 (AC_OUTPUT): Use variables gen_files and - gen_config in the loop that generates the output (Make)files, - instead of hardwiring the filenames. + * acspecific.m4 (AC_PROG_ECHO_N): Work around some greps lacking -e. -Sat May 15 17:23:19 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + * acspecific.m4 (AC_PATH_X, AC_PATH_X_XMKMF, AC_PATH_X_DIRECT, + AC_PATH_XTRA): Fix cache use and message printing. - * autoconf.sh: Accept `-' to mean read stdin as input. - * autoheader.sh: Likewise. - -Fri May 14 12:41:02 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * autoheader.sh, acspecific.m4 (AC_PREPARE): If `LANG' environment - variable is set, reset its value to `C'. This is so `tr [...]' - works more portably. - -Thu May 13 22:56:20 1993 Paul Eggert (eggert@twinsun.com) - - * acspecific.m4 (VOID_CLOSEDIR): Test closedir instead of assuming - that it works. E.g. dynix closedir yields garbage, but has no - prototype. Presumably Xenix closedir had the same problem, so - stop special-casing it. - -Wed May 12 20:25:36 1993 Jim Meyering (meyering@comco.com) - - * acconfig.h: Add HAVE_LONG_DOUBLE. - -Wed May 12 15:07:36 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_DEFINE_UNQUOTED): New macro. - - * acgeneral.m4 (AC_FUNC_CHECK): Include ctype.h instead of stdio.h. - We want it only to define __stub_* in glibc. Using stdio.h lost - when it contained a conflicting prototype for $1; ctype.h has fewer - prototypes. - - * acconfig.h: Add GETGROUPS_T. - - * acspecific.m4 (AC_PROG_RANLIB): Use : instead of @: for no-op. - Some braindead make does bizarre magical things with @ in variables. - -Mon May 10 14:24:27 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_HAVE_POUNDBANG): New feature. - - * acgeneral.m4 (AC_OUTPUT): Add more backslashes to character class - in DEFS filter (sigh). - -Sun May 9 14:04:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_DEFINE_QUOTE): No AC_QUOTE_SED (was innermost). - (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_TEST_CPP): Put a \ before - $DEFS in string to be evalled. - (AC_OUTPUT): Run DEFS through a sed filter that quotes things in it - from sed (woo woo!) before writing it into config.status. - - * acspecific.m4 (AC_ALLOCA): Use AC_PROGRAM_EGREP to test for [CRAY - && !CRAY2], instead of AC_TEST_PROGRAM. No need to run a program - for this. - - * acgeneral.m4 (AC_PROGRAM_CHECK): Extract the first word of $2 - when looking for it in PATH, so it can be a program name with args. - Omit default assignment if $4 is empty. - Only write verbose msg if $1 was set nonempty. - * acspecific.m4 (AC_PROG_YACC): Pass 'bison -y' (quoted like that) - in list to AC_PROGRAMS_CHECK. Don't test for bison later to add -y - flag. - -Sat May 8 00:23:58 1993 Jim Meyering (meyering@comco.com) - - * acgeneral.m4 (AC_REPLACE_FUNCS): Add a trailing newline in - code for AC_COMPILE_CHECK. Otherwise it got spurious failures. - - * acspecific.m4 (TIME_WITH_SYS_TIME): New macro. - - * Makefile.in (dist): Depend on Makefile. Use gzip instead - of compress. Link files individually instead of en masse; - if a link fails, use `cp -f' on the losing file. - - * acspecific.m4 (AC_ALLOCA): Define CRAY_STACKSEG_END (the - name of a function used in alloca.c) for CRAY-1, CRAY X-MP, - and CRAY Y-MP. - -Fri May 7 15:56:26 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Check for mach/mach.h, but don't - disable nlist checks if found. - -Fri May 7 04:59:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PROG_INSTALL): Don't look for `install' in - /usr/ucb. - -Thu May 6 20:41:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_FUNC_CHECK): The test program should choke on - #ifdef __stub___$1 as well. - (AC_REPLACE_FUNCS): Make the test program choke on stubs. - -Wed May 5 20:43:13 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoconf.sh ($infile existence check): Fixed test for - nonemptiness of $print_version to not always be true. - -Wed May 5 17:22:42 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PREFIX, AC_PROGRAM_CHECK), acspecific.m4 - (AC_PROG_INSTALL): If IFS wasn't set initially, give it a - normal default value. Happens on LynxOS (x86), says - Pete Klammer . - -Wed May 5 13:22:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4: Undefine the `shift' builtin. - - * acspecific.m4 (AC_PROG_YACC): Use AC_PROGRAMS_CHECK to check for - both bison and yacc, instead of two AC_PROGRAM_CHECK uses. - - * autoheader.sh ($# -eq 0): Set var $tmpout to name of temp file, - send stdout there instead of config.h.in. - (just before exit): If $# -eq 0, then move $tmpout to config.h.in - if $status -eq 0, or remove $tmpout otherwise. - - * acspecific.m4 (AC_STRCOLL): Rewritten to use a test program that - verifies that `strcoll' does vaguely reasonable ordering. - -Tue May 4 19:59:00 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_LONG_DOUBLE): Don't explicitely echo - `checking for long double'. - -Mon May 3 22:04:35 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_GETGROUPS_T): New macro. - -Sat May 1 22:37:55 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_LONG_DOUBLE): New macro. - -Wed Apr 28 15:52:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PROGRAM_CHECK): Write msg under --verbose. - -Thu Apr 22 18:24:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_FUNC_CHECK): Remove spurious `#endif' line at end. - - * acgeneral.m4 (AC_WITH): Fix reversed args to patsubst. - Test $with_FOO, not $FOO. - -Wed Apr 21 18:14:19 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_QUOTE_TOKEN): New macro. - (AC_DEFINE_QUOTE): Use it. - -Tue Apr 20 18:02:46 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_DECLARE_YYTEXT): Guess name of lex output file - and do AC_SUBST of `LEX_OUTPUT_ROOT'. - Add `dnl' after calling some autoconf macros. - -Mon Apr 19 15:46:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_MINUS_C_MINUS_O): Do each compile a second time - after testing for the existence of the output. Some compilers - refuse to overwrite an existing .o file with -o, though they will - create one. - - * acspecific.m4 (AC_DECLARE_YYTEXT): Changed lex input to two lines - of "%%", not just one. - -Sat Apr 17 17:26:12 1993 Jim Meyering (meyering@comco.com) - - * acgeneral.m4 (AC_COMPILE_CHECK): Don't print `checking for ...' - message if first argument is empty. - -Sat Apr 17 01:18:41 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PID_T): provide self. - (AC_VFORK): Require AC_PID_T. - -Fri Apr 16 11:57:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PROGRAMS_CHECK): Take optional third arg; if - given, use it as the default value. - -Thu Apr 15 16:43:45 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_REPLACE_FUNCS): Print a message under --verbose. - - * acgeneral.m4 (AC_HAVE_LIBRARY): Use m4's patsubst and translit - instead of running sed and tr at runtime. - - * acconfig.h: Add STACK_DIRECTION. - -Wed Apr 14 17:08:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_ALLOCA): If we chose alloca.c, run a test - program to define STACK_DIRECTION. - -Mon Apr 5 19:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_LONG_FILE_NAMES): Put test inside a for loop on - several directories: . /tmp $prefix $exec_prefix. Define - HAVE_LONG_FILE_NAMES iff long names win in all those directories. - -Sun Apr 4 18:38:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Makefile.in (%.info): Removed pattern rule. - (autoconf.info, standards.info): New rules. - - * autoconf.sh (version_only): New variable, set nonempty for - `autoconf --version' with no input file. - (output writing): No output if $version_only is set. - -Wed Mar 31 17:33:57 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_CONST): Uncomment and fix second AIX test. - -Wed Mar 31 16:58:12 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acspecific.m4 (AC_CONST): Rewrite first AIX XL C 1.02.0.0 test. - Comment out bogosity in second AIX test. - -Wed Mar 31 12:45:59 1993 Jim Meyering (meyering@comco.com) - - * acgeneral.m4 (AC_DEFINE): Put single quotes around definition - that is echoed with --verbose. AC_DEFINE(MVDIR, "$(libdir)/mvdir") - was generating losing code. - -Mon Mar 29 15:44:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acspecific.m4 (AC_STDC_HEADERS): Add a missing pair of [quotes]. - -Mon Mar 29 14:54:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_DECLARE_YYTEXT): Change sed regexp so it won't - match other identifiers beginning with `yytext'. - -Sat Mar 27 00:11:16 1993 Paul Eggert (eggert@twinsun.com) - - * acspecific.m4 (AC_CONST): Detect broken AIX XL C 1.2.0.0 compiler. - -Thu Mar 25 19:54:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_CONST): Remove single quotes from the C - program; they produce shell syntax errors. - - * acgeneral.m4 (AC_DEFINE): Add a newline after "}" to prevent - commands following on the same line of configure.in from - generating shell syntax errors. - - * acgeneral.m4 (AC_COMPILE_CHECK): Use explicit return types - to avoid warnings. - (AC_TEST_CPP): Add parens to force redirection order. - (AC_OUTPUT): Allow hostname to return bogus exit status. - From Jean-loup Gailly . - -Mon Mar 22 16:53:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoconf.sh: Use $M4, not m4 explicitly. - (M4): If unset in env, initialize to @m4@. - * autoheader.sh: Likewise. - * Makefile.in (M4): Define new variable. - (autoconf.conf, %.conf): Use it. - (editsh): New variable: sed command to replace @datadir@; also - replace @M4@ with $(M4). - (autoconf, autoheader): Use $(editsh) instead of explicit sed command. - -Mon Mar 22 13:08:10 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_CONST): IBM's /bin/cc under AIX-3.2 on an rs6000 - rejects attempts to modify *any* member of a struct that has a - member declared like `const int *ap[2]'. - -Wed Mar 17 18:08:30 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * autoconf.sh, autoheader.sh (MACRODIR): Variable renamed to - AC_MACRODIR. Don't initialize it at runtime if it is already set - in the environment. - (MACROFILES): Don't set until after options are processed. - (print_version): New temp variable. - - * autoconf.sh, autoheader.sh: Rewrote argument parsing. - Added `-m', `--macrodir', `-h', `--help', and `--' options. - Updated usage string. - - * autoconf.texi: Documented --macrodir option and its effects for - both scripts. - -Tue Mar 16 09:10:48 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_CONST): Sun's SC1.0 ANSI compiler (acc) won't - increment a `const int *' pointer declared through a typedef. - -Mon Mar 15 16:08:42 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_PARSEARGS): Grok `--verbose' flag; set verbose=yes. - (AC_DEFINE): Only echo "defining $1" if $verbose is set. - -Sun Mar 14 18:19:21 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acspecific.m4 (AC_PROG_INSTALL): Choose `installbsd' if we find - it, in preference to `install'. - - * acspecific.m4 (AC_CONST): Add a check for `const int *foo' not - allowing modification of FOO (not *FOO). - -Fri Mar 12 15:27:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT_HEADER): Remove conftest.sh before - creating it. - -Thu Mar 11 12:57:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_DEFINE): Surround defn with { and }. - - * acgeneral.m4 (AC_OUTPUT_HEADER): Split up $SEDDEFS into smaller - chunks, since some shells can't handle large here documents. - We write several commands in config.status to create conftest.sed - in pieces. - -Mon Mar 8 14:40:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_WITH): Don't echo anything. - Use the m4 patsubst fn instead of a run-time sed invocation to - massage $1. - - * acspecific.m4 (AC_DIR_HEADER_CHECK): #include - before the header we are testing. - - * acgeneral.m4 (AC_DEFINE): If $2 is empty, echo "defining $1 to be - empty", rather than "defining $1 to be ". - - * acspecific.m4 (AC_DIR_HEADER_CHECK): New; subr of AC_DIR_HEADER. - (AC_DIR_HEADER): Use it to test for each possible header file. - -Tue Mar 2 01:06:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * autoheader.sh: Don't use /p1/,/p2/ construct with sed---it's not - portable. Handle broken AIX sed that strips \n from hold space - when it shouldn't. From Jun Hamano . - -Tue Mar 02 00:08:39 1993 Jim Meyering (meyering@comco.com) - - * acspecific.m4 (AC_CONST): Fix typo that caused spurious lossage - with /bin/cc from Irix-4. From Karl Berry. - -Fri Feb 26 17:14:58 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acspecific.m4 (AC_CONST): Add bizarre case that loses on SCO 3.2v4. - -Mon Feb 22 13:02:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_QUOTE_HERE, AC_QUOTE_SED): Change the quote - chars to { and } instead of nothing. Then use {} (empty quotes) to - separate the patsubst forms from the following dnl. Otherwise the - result of patsubst is pasted together with dnl and the result is - seen as a single token. - - * acspecific.m4 (AC_MINUS_C_MINUS_O): Print msg saying what we are - doing before we do it. - - * acgeneral.m4 (AC_PREFIX): Print out the choice made. - (AC_DEFINE): Print out the definition being done. - - * acgeneral.m4 (AC_DEFINE_QUOTE): Add dnl at end of line. - - * acspecific.m4 (AC_GETLOADAVG): Do changequote around listing of - /dev/kmem and sed frobbing which needs to use [ and ]. - -Sun Feb 21 13:57:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh: Use brackets in tr range args. - - * acspecific.m4 (AC_SETVBUF_REVERSED): Make the test fail if - setvbuf returns nonzero. - - * acspecific.m4 (AC_GETLOADAVG): If we need to install setgid, - figure out what group owns /dev/kmem, and set KMEM_GROUP to that. - - * acspecific.m4 (AC_MINUS_C_MINUS_O): Test plain `cc' after testing - $CC. We want to make sure both compilers grok -c -o. - -Thu Feb 18 18:05:14 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_QUOTE_{DQUOTE,SQUOTE,HERE,SED}): New macros. - (AC_DEFINE_{QUOTE,SEDQUOTE}): New macros; subrs of AC_DEFINE. - (AC_DEFINE): Use them to quote $2. - -Wed Feb 17 14:49:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_TIMEZONE): Fixed quoting in tzname check. - changequote inside quotes lost. - -Mon Feb 8 14:22:11 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acconfig.h (_ALL_SOURCE): Use #ifndef; AIX compiler way too dumb. - -Sun Jan 31 16:39:46 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acspecific.m4 (AC_TIMEZONE): Put newlines before `#include ...' - in $defs value. - -Thu Jan 28 18:06:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acconfig.h (_ALL_SOURCE): Use "!defined (_ALL_SOURCE) || - _ALL_SOURCE == 0" rather than "!_ALL_SOURCE", which bombs on the - AIX compiler. - -Mon Jan 25 12:09:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acconfig.h (HAVE_UNION_WAIT, SYS_SIGLIST_DECLARED): New #undef's. - - * acconfig.h (_ALL_SOURCE): Surround with #if !_ALL_SOURCE. - -Fri Jan 22 15:08:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): If /usr/local/lib/libgetloadavg.a - exists, add -L/usr/local/lib to LDFLAGS. - -Fri Jan 22 12:49:11 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT_HEADER): Only comment out the #undef NAME - part of the line, to avoid causing errors from existing comments. - -Thu Jan 21 14:50:20 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_HAVE_LIBRARY): Use $libname in "checking for" - message, not $1, to avoid "checking for -l-lfoo". - - * acgeneral.m4 (AC_PREPARE): In compile defn, include $CFLAGS. - - * acgeneral.m4 (AC_OUTPUT): Broke AC_CONFIG_NAME writing out into: + * acgeneral.m4 (AC_SITE_LOAD): Check env var CONFIG_SITE first. (AC_OUTPUT_HEADER): New macro broken out of AC_OUTPUT. - Add to conftest.sed a new sed command to turn #undef's into comments. - - * acgeneral.m4 (AC_OUTPUT): Use new shell variable, $maxsedlines, - for max number of lines to feed to one sed invocation. - Lower this limit to 20; UTekV 3.2e can't cope with 40. - -Tue Jan 19 13:21:02 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * Version 1.3. - -Fri Jan 15 16:28:18 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_CONFIG_HEADER, AC_HEADER_EGREP, - AC_TEST_PROGRAM): Make DEFS always contain -D commands, - not C code. - -Thu Jan 14 17:05:17 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm; don't assume it. - -Thu Jan 14 16:46:41 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * autoheader.sh (selecting $syms from $TEMPLATES): Use sed to - replace lines containing only blanks with empty lines. - -Thu Jan 14 15:15:31 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acspecific.m4 (AC_MODE_T): New macro. - - * acgeneral.m4 (AC_OUTPUT): Check for grep -c returning - nothing (AIX 3.1) as well as returning 0. - -Wed Jan 13 16:05:59 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_FUNC_CHECK): Add missing #endif. - - * acgeneral.m4 (AC_OUTPUT): Use sed, not basename. - From Francois Pinard. - -Wed Jan 13 15:49:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Set exec_prefix to ${prefix}, not - $(prefix); it now works in both makefiles and shell scripts. - -Wed Jan 13 15:29:04 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * autoheader.sh: If input is empty, don't print all of - acconfig.h. From Francois Pinard. - - * acgeneral.m4 (AC_OUTPUT): Have config.status check all of its - args for validity. - -Tue Jan 12 11:11:45 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Preserve whitespace around = in prefix - and exec_prefix assignments. - - * acspecific.m4 (AC_GETLOADAVG): Values for getloadavg_missing were - reversed. - -Fri Jan 8 18:45:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Make config.status not complain with - usage msg when given no args. - - * acgeneral.m4 (AC_HAVE_LIBRARY): Say "checking for -lfoo", not - just "checking for foo". - - * acgeneral.m4 (AC_HAVE_LIBRARY): Remove excess quoting around $2 - and $3. - - * acspecific.m4 (AC_GETLOADAVG): Check for getloadavg library, both - a normally installed one, and one in /usr/local/lib. - After figuring out params for getloadavg.c, figure out whether it - defined LDAV_PRIVILEGED, and if so, set NEED_SETGID to true, and - define GETLOADAVG_PRIVILEGED. - * acconfig.h: Added GETLOADAVG_PRIVILEGED. - -Fri Jan 8 16:16:35 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_DEFINE, AC_OUTPUT): Restore the third sed string. - - * acgeneral.m4 (AC_FUNC_CHECK): Use __stub_funcname. - - * autoheader.sh: Use Autoconf version number. - - * acgeneral.m4 (AC_OUTPUT): Diagnose usage errors for - config.status. Use grep -c to count nonempty lines instead of - test -s. - * acspecific.m4 (AC_GETLOADAVG): Use AC_HAVE_LIBRARY. + * acgeneral.m4, acspecific.m4 (AC_FD_MSG, AC_FD_CC): New + symbolic constants. -Wed Jan 6 19:54:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acgeneral.m4, acoldnames.m4 (AC_INIT_PARSE_ARGS): Renamed from + AC_INIT_PARSEARGS. - * autoheader.sh (coverage check): Use $TEMPLATES in error msg, not - hard-wired "config.h". + * autoupdate.sh: Use $SIMPLE_BACKUP_SUFFIX, if set. -Wed Jan 6 18:24:41 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * autoheader.sh (AC_CHECK_LIB): Reflect the added arg. - * acgeneral.m4 (AC_OUTPUT): If AC_CONFIG_NAME, change - @DEFS@ to -DHAVE_CONFIG_H in Makefiles etc. Idea from Roland McGrath. - - * acgeneral.m4 (AC_FUNC_CHECK): If __STUB_funcname is defined, - assume the function isn't present. - - * acgeneral.m4 (AC_OUTPUT): Make no args to AC_OUTPUT work - again. From Ian Lance Taylor. - - * acspecific.m4 (AC_CONST): Fix quoting problem. - - * acconfig.h [const]: New addition. - -Thu Dec 31 17:56:18 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_HAVE_LIBRARY): New macro from Noah Friedman. - - * acconfig.h: Renamed from config.h. - - * autoheader.sh: Renamed from autohead.sh. - Support a local acconfig.h. - Use \\012 instead of \\n for tr for portability. - -Thu Dec 31 12:30:34 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * config.h: Added #undef vfork. - -Tue Dec 29 14:26:43 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_COMPILE_CHECK): Use cat rather than echo to - create conftest.c, to avoid " problems. - -Fri Dec 25 15:07:06 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * acspecific.m4 (AC_CONST): Don't define HAVE_CONST. - - * acgeneral.m4 (AC_OUTPUT, AC_DEFINE): Combine the two sed - commands for #undef lines. - * acgeneral.m4 (AC_PROGRAM_EGREP, AC_TEST_PROGRAM, - AC_TEST_CPP, AC_OUTPUT), acspecific.m4 (AC_PROG_CC): Put > - before << when using both, to avoid HP-UX sh bug. + * autoconf.m4: New file. + * Makefile.in (DISTFILES): Add it. + * autoconf.sh, autoheader.sh, Makefile.in: Use it. -Wed Dec 23 20:47:53 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acspecific.m4 (AC_SYS_REMOTE_TAPE): Macro removed. - * acgeneral.m4 (AC_PARSEARGS): Use if, not &&, for --with. - From Jan Brittenson. + * acfunctions, acheaders, acidentifiers, acmakevars, acprograms, + autoscan.pl: Use new macro names. -Mon Dec 21 17:13:57 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acgeneral.m4 (AC_MSG_ERROR): Enclose within {} so it acts like a + single statement. From mjshield@nyx.cs.du.edu (Michael Shields). + (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Only compute the uppercase + name if we're going to define that symbol. + (global): Remove AC_DIVERSION_VAR. + (AC_OUTPUT): Adjust quoting and substitutions to replace most + variable values directly in the sed script. Handle srcdir, + top_srcdir, and INSTALL specially. + Add .cpp and .hpp to c-ish suffixes list. - * acgeneral.m4 (AC_OUTPUT): Use sed instead of head and tail. - Trap to remove the temp files. + * configure.in: Use the new macro names. - * acgeneral.m4 (AC_OUTPUT): Quote DEFS assignment. - From Ian Lance Taylor. + * ChangeLog.0: New file, broken out of ChangeLog.1. + * Makefile.in (DISTFILES): Add it. -Mon Dec 21 14:27:44 1992 Jim Meyering (meyering@comco.com) + * autoupdate.sh: Update the regexps to account for changes to + acoldnames.m4. - * acspecific.m4 (AC_STDC_HEADERS): Make sure ctype.h macros - are ANSI. Nest tests so we don't need shell temporary variable. +Mon Aug 22 23:57:18 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Sun Dec 20 18:12:33 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) + * testsuite/autoconf.s/specific.exp: Use new macro names. - * Makefile.in (%.h: %.in): New rule using autohead. - (all): Do autohead. - (install): Install autohead and config.h. - (autohead): New rule. - (DISTFILES): Added autohead.sh. - * autohead: New script. +Fri Aug 12 10:15:51 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Fri Dec 18 00:21:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acspecific.m4 (AC_HEADER_DIRENT, AC_DIR_HEADER): Use one cache + variable for each header file, not one for all of them. - * acgeneral.m4 (AC_HAVE_FUNCS, AC_HAVE_HEADERS): Change method - of tr quoting to keep old shells happy. From Ian Lance Taylor. + * acgeneral.m4 (AC_CACHE_SAVE): Print a message noting when cache + is unwritable. + (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Take an optional arg to + execute on a match. - * acgeneral.m4 (AC_DEFINE): Add to SEDDEFS. - (AC_OUTPUT): Use sed instead of awk. - From Ian Lance Taylor. + * acspecific (AC_OS_AIX, AC_OS_MINIX, AC_OS_ISC): Don't need to be + called before AC_TRY_CPP, since that doesn't use CFLAGS. -Mon Dec 14 14:33:29 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Print a result + whether or not we found the program. + (AC_CHECKING): Not obsolete. + (AC_WITH, AC_ENABLE, AC_INIT_PREPARE): Merge the --enable and + --with diversions. - * acspecific.m4 (AC_STDC_HEADERS): Check for string.h - declaring memchr. + * acgeneral.m4 (AC_DEFUN): New macro. + Use it globally to define macros that are used as functions, + as opposed to macros that are used as variables. Remove calls to + AC_PROVIDE. - * acgeneral.m4 (AC_NOTICE): Fix comment. +Thu Aug 11 08:25:08 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Fri Dec 11 17:59:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + * acspecific.m4 (AC_OS_XENIX): Fix assignments. From Franc,ois + Pinard. + (AC_SYS_REMOTE_TAPE): Fix typo. - * acspecific.m4 (AC_ALLOCA): Don't use libPW; it causes too - much trouble. +Wed Aug 10 09:30:11 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Wed Dec 9 14:04:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + * acspecific.m4 (AC_C_CHAR_UNSIGNED): Don't lie about the result + if gcc, just ignore it. - * config.h: Added HAVE_SYS_WAIT, HAVE_WAITPID, SVR4, UMAX, - [ugp]id_t, UMAX4_3, DGUX. + * acgeneral.m4 (AC_CHECK_LIB): Add a function argument. + * acgeneral.m4 (AC_HAVE_LIBRARY): Make it a wrapper around + AC_CHECK_LIB. + * acoldnames.m4: Remove its alias. + * acspecific.m4: Add argument to callers. -Thu Dec 3 13:37:17 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * acspecific.m4 (AC_PROG_ECHO_N): Move from acgeneral.m4 AC_MSG_ECHO_N. + * acgeneral.m4: Callers changed. - * acspecific.m4 (AC_PROG_INSTALL): Ignore AFS install. - From James Clark, jjc@jclark.com. + * acgeneral.m4 (AC_CACHE_LOAD, AC_CACHE_SAVE, AC_SITE_LOAD, + AC_MSG_CHECKING): Aesthetic changes to messages, suggested by + Franc,ois Pinard. -Tue Nov 24 07:47:45 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * acspecific.m4 acgeneral.m4 acoldnames.m4: Rename + AC_TRY_CROSS to AC_C_CROSS. - * acspecific.m4 (AC_PROG_LEX, AC_DECLARE_YYTEXT, AC_VFORK, AC_WAIT3, - AC_INT_16_BITS, AC_WORDS_BIGENDIAN, AC_ARG_ARRAY): End with a newline. + * acgeneral.m4 (AC_INIT_PARSEARGS): Don't mention --verbose in + help message. + (AC_INIT_PREPARE): Use file descriptor 5 for config.log, and 6 for + nothing. --verbose no longer does anything. + (AC_MSG_ECHO_N): New macro. + (AC_MSG_CHECKING, AC_MSG_RESULT, AC_CACHE_VAL): Require it and use + the shell variables it sets. + (AC_MSG_RESULT, AC_VERBOSE): Print unless --silent/--quiet is given, + not only when --verbose is given. + (AC_DEFINE): Don't echo anything. + (AC_CACHE_VAL): Use a custom echo instead of AC_MSG_RESULT. + * acgeneral.m4 (AC_CHECKING, AC_VERBOSE): Put back real versions, + marked obsolete. + * acoldnames.m4: Delete their aliases. + * acgeneral.m4, acspecific.m4 (many macros): Make sure each call + to AC_MSG_CHECKING has exactly one matching AC_MSG_RESULT, and + make the result messages make sense with the checking messages. - * acspecific.m4 (AC_DIR_HEADER): If ndir.h exists and the other - choices don't, define NDIR. + * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Use echo, not AC_MSG_RESULT, + to print recursion notice. -Sat Nov 21 00:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) +Tue Aug 9 00:17:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_RETSIGTYPE): Instead of grepping for the signal - declaration, try redeclaring it and see if we get an error. - Always define RETSIGTYPE, not just if it's int. - From Ian Lance Taylor. + * acgeneral.m4 (AC_OUTPUT): Add comment mentioning config.log. -Fri Nov 20 17:06:09 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * ChangeLog.1: File split out of ChangeLog. + * Makefile.in (DISTFILES): Add it. - * acgeneral.m4 (AC_DEFINE): Only put -D option in quotes if it - actually contains blanks. + * acgeneral.m4 (AC_OUTPUT, AC_OUTPUT_HEADER), autoheader.sh: + Support optional input-file specification in output-file names. + * autoheader.sh: Support top and bottom comments for config.h.in + in acconfig.h. -Thu Nov 19 17:18:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * acgeneral.m4, README: Say more about requiring GNU m4. - * acgeneral.m4 (AC_PARSEARGS): Set a shell var for --with-*. - (AC_WITH): New macro. + * autoheader.sh: In the list of symbols to get template entries + for, start each symbol with a blank. - * acspecific.m4 (AC_CONST): If const works, define HAVE_CONST. + * autoupdate.sh: Add sed substitutions for replacing macro + calls without parameters. - * acspecific.m4 (AC_ALLOCA): Don't use libPW on HP-UX. + * acgeneral.m4 (AC_CACHE_VAL): Omit the cache var name from the + result message. -Wed Nov 18 17:36:08 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acspecific.m4 (AC_DIR_HEADER): Define to be similar to + AC_HEADER_DIRENT, but only define the old cpp macros. + (AC_HEADER_DIRENT): Only define the new ones. + * acoldnames.m4: Don't say that those two macros are synonyms. + * acconfig.h: Add the new cpp macros. Add <> to some comments. - * acgeneral.m4 (AC_DEFINE): When writing a -D with a value, - surround it with 's so the value can contain spaces. + * acgeneral.m4 (AC_OUTPUT): Don't mess with $INSTALL if it starts + with a $, due to user intervention. -Thu Nov 12 22:49:35 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * Makefile.in, testsuite/Makefile.in: Fix *clean targets. - * acspecific.m4 (AC_PROG_CC): Don't add -O to CC if GNU C. - (-O2, or nothing, might be more appropriate.) + * acgeneral.m4 (AC_CACHE_SAVE, AC_CACHE_LOAD, AC_SITE_LOAD): + Use echo instead of AC_MSG_RESULT. + (AC_INIT_PARSEARGS): Group options by topic in help message. Idea + from Franc,ois Pinard. -Sun Nov 8 23:33:23 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + * TODO: New file. - * acspecific.m4 (AC_GETLOADAVG): Check for dwarf.h for general - svr4, then elf.h for Solaris 2, which needs additional libraries. +Mon Aug 8 23:04:01 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Thu Nov 12 22:18:54 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * acgeneral.m4 (AC_OUTPUT): Tighten up srcdir handling code slightly. + Add one or more ../ to $INSTALL when it's a relative path and + creating a file in a subdirectory. - * acgeneral.m4 (AC_PARSEARGS): --exec_prefix -> --exec-prefix. +Tue Aug 2 19:54:26 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Tue Nov 10 16:15:10 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * autoheader.sh: Read acoldnames.m4. Redefine the new macro names. + Only define HAVE_LIBFOO where AC_CHECK_LIB is called with only one + argument. - * acgeneral.m4: undef m4 `include' builtin. +Sat Jul 30 09:53:38 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_STDC_HEADERS): Don't test for limits.h - due to Ultrix conflict with float.h. + * acgeneral.m4 acspecific.m4: The Great Renaming. + (Well, I think it's great. You may have your own opinion.) -Thu Oct 29 16:16:11 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + * acspecific.m4 (AC_DIR_HEADER): Define HAVE__H as well as + the old DIRENT, SYSDIR, etc. - * acgeneral.m4 (AC_PARSEARGS, AC_PREPARE): New macros, broken out - parts of AC_INIT. - (AC_INIT): Use them. + * acgeneral.m4 acspecific.m4: Add missing spaces between arguments + to m4 calls. From Franc,ois Pinard. -Thu Oct 22 20:48:12 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * autoconf.sh: Read acoldnames.m4. + * Makefile.in (DISTFILES, PROGS, install, clean): Add + acoldnames.m4 and autoupdate.sh. - * acspecific.m4 (AC_INSTALL): Comment out arg to `:'. - AIX doesn't like it. +Tue Jul 26 08:52:17 1994 David J. MacKenzie (djm@aria.eng.umd.edu) -Wed Oct 14 12:41:02 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + * testsuite/Makefile.in (check): Print a message noting that + runtest is part of DejaGNU. - * Version 1.2. + * autoscan.pl: Remove unneeded backslash. - * acspecific.m4 (AC_INSTALL): Avoid the AIX install script. +Sun Jul 24 23:30:27 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_RESTARTABLE_SYSCALLS): Wait for child if - sys calls are not restarted, to avoid leaving the child still - running. From Ian Lance Taylor. + * Makefile.in (clean mostlyclean distclean realclean): Recurse + into testsuite directory. -Tue Oct 13 15:43:56 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) +Wed Jul 20 09:38:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_CONST): Add more tests for brokenness. + * Makefile.in (install): Add missing else and fi. + * acspecific.m4 (GETGROUPS_T, RETSIGTYPE, STACK_DIRECTION): Use + AC_DEFINE_UNQUOTED rather than AC_DEFINE. From Jim Meyering. - * acgeneral.m4: Use % instead of ? to avoid shell variable expansion. - -Fri Oct 2 06:55:05 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acgeneral.m4: Use ? instead of , to separate parts of sed arg. - -Mon Sep 14 12:33:41 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) - - * acspecific.m4 (AC_STDC_HEADERS): Also check for float.h. - - * acspecific.m4 (AC_TIMEZONE): Protect [] from being quotes. - -Thu Sep 10 17:12:10 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_OUTPUT): Include the hostname in config.status. - - * acgeneral.m4 (AC_OUTPUT): Use a separate flag in the awk - script instead of checking for non-empty values, so things - like defining const as empty work. From - Steve Emmerson . - -Fri Aug 28 18:51:13 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_INIT): If there's no path on $0, use '.'. - -Thu Aug 27 16:15:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * config.h: New file. - - * acgeneral.m4 (AC_INIT): Look for source files in the - directory containing `configure', if not given explicitly. +Tue Jul 19 14:49:02 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_TIMEZONE): Adjust tzname decl for RS6000. + * acspecific.m4 (AC_MEMORY_H): Add more quotes. - * acspecific.m4 (AC_GETLOADAVG): Don't use double quotes in - the test program. + * acgeneral.m4 (AC_TEST_RUN): Check for cross_compiling = yes, not + whether it's non-empty. -Thu Aug 27 15:26:49 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) + * acspecific.m4 (AC_MINUS_C_MINUS_O, AC_SET_MAKE): Eval the cache var + assignments. + (AC_YYTEXT_POINTER): Fix typo. - * acspecific.m4 (AC_GETLOADAVG): Don't check nlist.h if we found - one of specific things. + * testsuite/autoconf.s/specific.exp, + testsuite/autoconf.g/sizeof_type.exp, + testsuite/autoconf.g/init.exp: New files. + * testsuite/lib/common.exp, testsuite/config/unix.exp: Many + changes to make them work. -Mon Aug 24 16:22:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * acgeneral.m4 (AC_DEFINE): Use redirection for echo, not $verbose. - * Version 1.1. +Sat Jul 2 22:07:18 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_TIMEZONE): Include time.h. Don't - declare tzname if it's a macro. From Jim Meyering. + * acspecific.m4 (AC_REMOTE_TAPE): Substitute PROGS. -Fri Aug 21 14:12:35 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Thu Jun 30 16:29:15 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_ALLOCA): Check whether the alloca defined by - alloca.h works when given a non-constant argument. + * acgeneral.m4 (AC_SUBST_FILE): New version from Ken Raeburn. - * acspecific.m4 (AC_GETLOADAVG): Define NLIST_STRUCT and - NLIST_NAME_UNION if appropriate. + * ifnames: Add --help, --version, --macrodir options. - * acgeneral.m4 (AC_OUTPUT): If no args are given, omit the loop to - produce output files. +Fri Jun 24 06:03:35 1994 Paul Eggert (eggert@twinsun.com) - * acgeneral.m4 (AC_TEST_PROGRAM): Add a call to exit to try to - suppress core dumped message. From Ian Lance Taylor. + * acspecific.m4 (AC_VFORK): Improve test for the gcc-sparc vfork bug. - * acgeneral.m4 (AC_PREFIX): Only print the message if prefix - hasn't been set. From James Clark. +Thu Jun 30 09:47:17 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_SIZE_T, AC_UID_T, AC_PID_T, - AC_RETSIGTYPE): Print a message saying what it's checking for. - (AC_SIZE_T): Define size_t to be unsigned, not int, for - ANSI-friendliness. + * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Pass correct --srcdir option + to sub configures. Quote args containing spaces. + (AC_PREPARE): Set and substitute `subdirs'. Quote args containing + spaces. + (AC_CANONICAL_HOST, AC_CANONICAL_TARGET, AC_CANONICAL_BUILD): + Substitute the cpu, vendor, os variables. - * acspecific.m4 (AC_GETLOADAVG): Just check for elf.h, not - dwarf.h too. + * acspecific.m4 (AC_PROG_INSTALL): Look for ginstall before other + names. - * autoconf.sh: Exit with status 1 if there are unresolved macros. - Isolate the pattern to make adding other prefixes easy. - Look for aclocal.m4 in . as well as MACRODIR. + * acgeneral.m4 (AC_TEST_LINK): Add newlines around argument code. + From mjshield@nyx.cs.du.edu (Michael Shields). -Tue Aug 18 16:35:46 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) +Wed Jun 29 16:56:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) - * acspecific.m4 (AC_STRCOLL): New macro. + * autoscan.pl: Add --macrodir option. -Tue Aug 18 15:22:45 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + * acgeneral.m4 (AC_CACHE_SAVE): Capture stderr for Ultrix sh. - * acspecific.m4 (AC_GETLOADAVG): elf.h implies SVR4. +Tue Jun 28 18:05:00 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Mon Jul 27 14:20:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * Makefile.in: Make INSTALL from install.texi. - * acgeneral.m4 (AC_TEST_PROGRAM): Check for cross-compiling - was missing "test -n". From Ian Lance Taylor. +Thu Jun 23 02:03:19 1994 David J. MacKenzie (djm@vortex.eng.umd.edu) -Sun Jul 26 16:25:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * ifnames.sh: New file. + * Makefile.in: Add it in various places. - * acgeneral.m4 (AC_SUBST): Support multiple substitutions in a - line. +Tue Jun 14 12:58:38 1994 David J. MacKenzie (djm@bleen.eng.umd.edu) -Mon Jul 20 01:08:01 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * Makefile.in (DISTFILES): Add testsuite files. - * Version 1.0. + * autoconf.sh: Print version number on stdout, not stderr. + * acgeneral.m4: Ditto. - * acspecific.m4 (AC_ALLOCA): Don't try -lucb -- it's too often broken. + * acgeneral.m4 (AC_HAVE_LIBRARY): Add OTHER-LIBRARIES arg. + Treat empty commands args as if they weren't given. -Sat Jul 18 13:40:46 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Thu Jun 9 11:39:14 1994 David J. MacKenzie (djm@bleen.eng.umd.edu) - * acspecific.m4 (AC_MAJOR_HEADER): Add missing "$". + * acgeneral.m4 (AC_CHECK_TYPE): New macro. - * acspecific.m4 (AC_ALLOCA): Put -lc before -lucb. + * acspecific.m4 (AC_PROG_CPP, AC_PROG_CXXCPP, AC_YYTEXT_POINTER, + AC_LN_S, AC_RSH, AC_STDC_HEADERS, AC_MAJOR_HEADER, AC_DIR_HEADER, + AC_STAT_MACROS_BROKEN, AC_SYS_SIGLIST_DECLARED, AC_GETGROUPS_T, + AC_UID_T, AC_RETSIGTYPE, AC_MMAP, AC_VFORK, AC_WAIT3, AC_ALLOCA, + AC_GETLOADAVG, AC_UTIME_NULL, AC_STRCOLL, AC_SETVBUF_REVERSED, + AC_STRUCT_TM, AC_TIME_WITH_SYS_TIME, AC_TIMEZONE, AC_ST_BLOCKS, + AC_ST_BLKSIZE, AC_ST_RDEV, AC_CROSS_CHECK, AC_CHAR_UNSIGNED, + AC_LONG_DOUBLE, AC_WORDS_BIGENDIAN, AC_ARG_ARRAY, AC_INLINE, + AC_CONST, AC_HAVE_POUNDBANG, AC_REMOTE_TAPE, AC_LONG_FILE_NAMES, + AC_RESTARTABLE_SYSCALLS, AC_FIND_X, AC_FIND_X_XMKMF, + AC_FIND_X_DIRECT): Cache results. + (AC_SIZE_T, AC_PID_T, AC_OFF_T, AC_MODE_T): Use AC_CHECK_TYPE. + (AC_DIR_HEADER_CHECK): Macro removed. -Fri Jul 17 00:00:07 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Wed Jun 8 18:03:45 1994 David J. MacKenzie (djm@bleen.eng.umd.edu) - * autoconf.sh: Print the lines of the input file where - unresolved macros occur. From Francois Pinard. + * acspecific.m4 (AC_MINUS_C_MINUS_O): Cache results. - * acspecific.m4 (AC_PROG_INSTALL), acgeneral.m4 - (AC_PROGRAM_CHECK): Use test -f instead of -s. +Thu May 26 09:43:37 1994 David J. Mackenzie (djm@poseidon.cygnus.com) - * autoconf.sh: grep for undefined macros in output. + * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): Cache results. + Eliminate temp file in gcc test. + (AC_GCC_TRADITIONAL): Cache results. -Tue Jul 14 01:19:26 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) +Wed May 25 14:45:44 1994 David J. Mackenzie (djm@poseidon.cygnus.com) - * acgeneral.m4 (AC_PROGRAM_CHECK): Search PATH manually to - avoid "command not found" messages on /dev/tty. Remove "args - for check" argument. - (AC_INIT): Don't define checkfor; no longer needed. - * acspecific.m4 (AC_PROG_CC, AC_PROG_RANLIB, AC_PROG_YACC, - AC_PROG_LEX): Don't pass "args for check" argument. + * acspecific.m4 (AC_VPRINTF): Use AC_FUNC_CHECK. - * acgeneral.m4 (AC_PROGRAMS_CHECK): New macro. - * acspecific.m4 (AC_PROG_AWK): Use it. Check for mawk, gawk, - nawk, and awk. - (AC_PROG_YACC): Check for byacc if bison isn't found. + * acgeneral.m4 (AC_CONFIG_AUX_DIR): Renamed from AC_CONFIG_AUXDIR. + (AC_SUBST_FILE): Macro deleted; didn't work, not clear it's needed. - * acspecific.m4 (AC_PROG_CC): Renamed from AC_PROG_GCC. - (AC_PROG_YACC): Renamed from AC_PROG_BISON. - (AC_PROG_AWK): Renamed from AC_PROG_GAWK. - (AC_PROG_LEX): Renamed from AC_PROG_FLEX. + * acgeneral.m4 (AC_SITE_LOAD): New macro. + (AC_PREPARE): Call it. - * acgeneral.m4 (AC_TEST_PROGRAM): Redirect stderr to /dev/null - both inside and outside the subshell to try to prevent core - dumped messages. Who knows, it might even help. +Wed May 25 08:18:07 1994 David J. Mackenzie (djm@rtl.cygnus.com) -Thu Jul 9 21:37:45 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + * acgeneral.m4: m4exit if --version, to reduce needless delay. - * acspecific.m4 (AC_GETLOADAVG): Check for DGUX before SVR4. + * acgeneral.m4 (AC_PREPARE): Redirect file descriptor 6 to + config.log. + (AC_LANG_C, AC_LANG_CPLUSPLUS): Send compiler messages to desc 6. + * acspecific.m4 (AC_MINUS_C_MINUS_O): Likewise. + * Makefile.in (distclean): Remove config.log. -Fri Jul 3 01:01:50 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * acgeneral.m4 (AC_PREPARE): Add AC_BEFORE calls for AC_CONFIG_HEADER, + AC_REVISION, AC_PREREQ, and AC_CONFIG_SUBDIRS. + Add AC_PROVIDE calls to those macros and AC_ARG_ENABLE and AC_ARG_WITH. - * acspecific.m4 (AC_REMOTE_TAPE): Renamed from AC_MTIO. - Define HAVE_SYS_MTIO_H instead of NO_MTIO. - (AC_LONG_FILE_NAMES): Renamed from AC_LONG_FILENAMES. - (AC_RSH): Define HAVE_NETDB_H instead of USE_REXEC. - Above mostly from Richard Stallman. + * acgeneral.m4 (AC_CANONICAL_SYSTEM, AC_CANONICAL_HOST, + AC_CANONICAL_TARGET, AC_CANONICAL_BUILD): Add "ICAL" to names. + (AC_LINK_FILES): Renamed from AC_MAKE_LINKS. + (AC_TEST_RUN): Renamed from AC_TEST_PROGRAM, which is now an alias. + * acspecific.m4: Change callers to use new name. - * acgeneral.m4 (AC_MISSING_FUNCS): Macro removed. - * acspecific.m4 (AC_VPRINTF, AC_WAIT3, AC_UTIME_NULL, - AC_TIMEZONE, AC_ST_BLOCKS, AC_ST_BLKSIZE): Change from - FOO_MISSING to HAVE_FOO. - (AC_WAIT3): Renamed from AC_WAIT3_RUSAGE. - (AC_TIMEZONE): Require AC_STRUCT_TM. - (AC_STRUCT_TM): Provide itself. + * acgeneral.m4 (AC_PREFIX_INTERNAL): Renamed from AC_PREFIX. + (AC_PREFIX): Obsolete wrapper for it. + (AC_PREFIX_PROGRAM): Define a variable. + (AC_PREPARE): Call AC_PREFIX_INTERNAL if that variable is set. - * acgeneral.m4 (AC_OUTPUT): Add --recheck option to config.status. +Tue May 24 18:49:35 1994 David J. Mackenzie (djm@rtl.cygnus.com) - * acspecific.m4 (AC_ST_RDEV, AC_CONST): New macros. + * acspecific.m4 (AC_ALLOCA): Don't declare alloca if it's already + defined. From Bill Sommerfeld . - * acgeneral.m4 (AC_DEFINE): Don't consider an empty value arg to - be an omitted arg. + * acgeneral.m4 (AC_TEST_PROGRAM): Verbosely note when using the + cross-compiling default. + (AC_CACHE_WRITE): Set the cache values only if not already set. + (AC_PARSEARGS, AC_OUTPUT): Allow giving an empty prefix or exec_prefix. -Thu Jul 2 16:05:05 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + AC_CONFIG_AUXDIR*. - * acspecific.m4 (AC_GETLOADAVG): New macro. + * acgeneral.m4, acspecific.m4: Rename AC_CONFIG_AUX* to + AC_CONFIG_AUXDIR*. - * autoconf.sh: Only reject an arg that's not a known option if it - is an option. + * acgeneral.m4 (AC_OUTPUT, AC_OUTPUT_HEADER): Add an env var + CONFIG_STATUS to allow overriding the name of config.status. -Tue Jun 30 16:08:04 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * acspecific.m4 (AC_MINUS_C_MINUS_O): If $CC=cc, don't duplicate + the check. From Jim Meyering. - * acgeneral.m4 (AC_INIT, AC_OUTPUT): Eliminate vpsub. - -Thu Jun 25 12:42:10 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) - - * autoconf.sh: Add --version option. - * acgeneral.m4: Support it. - -Wed Jun 24 14:04:13 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * acspecific.m4 (AC_TIMEZONE): Do the checks unconditionally, - not only if strftime.o is in LIBOBJS. - - * acspecific.m4 (AC_DIR_HEADER): Don't assume sys/dir.h exists. - - * acgeneral.m4 (AC_PROGRAM_CHECK): Don't include the program - name in the value-if-found. From Rich Murphey. - * acspecific.m4 (AC_PROG_{GCC,RANLIB,GAWK,BISON,FLEX}): Change - callers. - - * acgeneral.m4 (AC_OUTPUT): Mention the args given to - configure in a comment in config.status. - -Fri Jun 19 13:18:12 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_FUNC_CHECK): Use the third arg when it's - non-null, not when it's null. From Ian Lance Taylor. - -Thu Jun 18 12:10:27 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_BEFORE): Print message in next-error format. - From Franc,ois Pinard. - - * acgeneral.m4 (AC_PROGRAM_CHECK): If args-for-use is empty, - don't put a space after the program name. - - * acspecific.m4 (AC_DECLARE_YYTEXT): Move AC_REQUIREs from - AC_PROG_FLEX to here, where they belong. - - * acspecific.m4 (AC_MEMORY_H): Look for memchr instead of memcpy. - From Karl Berry. - -Wed Jun 17 09:56:59 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * acgeneral.m4 (AC_BEFORE): New macro. - * acspecific.m4 (AC_PROG_GCC, AC_DIR_HEADER, AC_AIX, - AC_MINIX, AC_ISC_POSIX): Use it. - -Tue Jun 16 14:46:29 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * autoconf.sh: Remove incomplete output file if interrupted. - - * acgeneral.m4 (AC_INIT): Avoid running an extra subshell for pwd. - From Franc,ois Pinard. + * acgeneral.m4 (AC_TEST_PROGRAM): Add missing newline. + Always include 'fi' for cross-compiling if. + From Jim Meyering. -Mon Jun 15 21:27:49 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * Makefile.in (prefix, exec_prefix): Use @ substitutions. - * acgeneral.m4 (AC_TEST_PROGRAM): Take another arg for - cross-compiling. - * acspecific.m4 (AC_CROSS_CHECK): New program. + * acgeneral.m4: Make default cache file ./config.cache, + so PATH is not used by "." command. From Jim Meyering. - * acgeneral.m4 (AC_REQUIRE, AC_PROVIDE): New macros. - (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_TEST_CPP): Use them. - * acspecific.m4 (AC_PROG_GCC, AC_GCC_TRADITIONAL, AC_PROG_CPP, - AC_PROG_FLEX, AC_INLINE): Ditto. +Thu May 19 06:05:07 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) -Sat Jun 13 17:54:24 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * acspecific.m4 (AC_STRUCT_TM): Fixed checking message to be less + confusing. - * acspecific.m4 (AC_MEMORY_H): echo what it's doing. +Wed May 18 22:11:45 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) -Thu Jun 11 14:18:35 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * acgeneral.m4 (AC_BINSH): New macro. + (AC_INIT, AC_REVISION): Require AC_BINSH first thing. - * acspecific.m4 (AC_MINUS_C_MINUS_O, AC_INLINE, - AC_SETVBUF_REVERSED): New macros. - (AC_ALLOCA): Define HAVE_ALLOCA_H if appropriate. +Wed May 18 09:08:39 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - * acgeneral.m4 (AC_INIT): Do pwd in the srcdir, not current dir. - Scan through "$@" (implicitly) instead of $*. - (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_COMPILE_CHECK, - AC_TEST_PROGRAM, AC_TEST_CPP): Supply a `:' if `true' argument - is empty. - * acgeneral.m4, acspecific.m4: Omit `:' in callers. + * acgeneral.m4: Rename some internal macros. + Give the diversions symbolic names. + (AC_ARG_ENABLE, AC_ARG_WITH, AC_ENABLE_INTERNAL, AC_WITH_INTERNAL): + New macros. + (AC_PARSEARGS): Print --with and --enable help strings. + (AC_ENABLE, AC_WITH): Make wrappers around _INTERNAL functions. + Mark obsolete. + (AC_PREPARE): Execute any saved up --with or --enable code. -Wed Jun 10 12:03:11 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Tue May 17 15:18:00 1994 David J. MacKenzie (djm@bleen.eng.umd.edu) - * acgeneral.m4 (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_HEADER_CHECK, - AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP, AC_FUNC_CHECK): - Make the last argument (program to run if test fails) optional. - (AC_HAVE_FUNCS, AC_HAVE_HEADERS): Don't pass optional last args. - * acspecific.m4 (most macros): Likewise. + * acgeneral.m4 (AC_REVISION): Move quotes around to make it work + again. -Mon Jun 8 16:27:10 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) +Sat May 14 07:30:57 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_VFORK): Get rid of backquotes. + * acgeneral.m4, acspecific.m4: Clean up some comments. - * acgeneral.m4 (AC_OUTPUT): Exit with 0 status when - --no-create was given. - Only write to the AC_CONFIG_NAME file if it doesn't exist or is - different from what we'd write. From Ian Lance Taylor. +Tue May 10 09:50:12 1994 David J. MacKenzie (djm@aria.eng.umd.edu) -Thu Jun 4 14:46:22 1992 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + * acspecific.m4 (AC_PROG_INSTALL): set the _path_ cache variable, + not the _program_ one. + * acgeneral.m4 (AC_PREFIX): Call AC_PROGRAM_PATH instead of + duplicating it. + (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): If the user set the variable + in the environment, cache that value. + (AC_PREPARE, AC_CHECKING, AC_VERBOSE): Use file descriptors 4 and + 5 for checking and results messages. Idea from metaconfig 3.0. - * acspecific.m4 (AC_UNISTD_H, AC_UID_T, AC_SIZE_T, AC_PID_T, - AC_ST_BLKSIZE, AC_STRUCT_TM): Quote the whole macro body. +Mon May 9 08:20:14 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_OUTPUT): Look for config header.in in - top_srcdir, not srcdir. From Garrett Wollman. + * acgeneral.m4 (AC_TEST_PROGRAM): If no default for + cross-compiling is given, but we are cross-compiling, give an error. + (AC_PROGRAM_EGREP, AC_TEST_LINK, AC_TEST_PROGRAM, AC_TEST_CPP): + Don't add an extra blank line after the if-clause. + (AC_REVISION): Merge AC_DOREV into this macro. + Rename some macros: + AC_SYSTEM_TYPE -> AC_CANON_SYSTEM + AC_HOST_TYPE -> AC_CANON_HOST + AC_TARGET_TYPE -> AC_CANON_TARGET + AC_BUILD_TYPE -> AC_CANON_BUILD + (AC_OUTPUT): Don't do Cygnus-style magic + substitutions on prefix and exec_prefix, just initialize and + substitute them normally. - * acgeneral.m4 (AC_OUTPUT): Don't add make .NOEXPORT rule to - output files. +Sun May 8 01:09:42 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - * acgeneral.m4, acspecific.m4: Rename AC_PROG_CHECK to - AC_PROGRAM_CHECK, AC_PROG_EGREP to AC_PROGRAM_EGREP, - AC_TEST_PROG to AC_TEST_PROGRAM. + * acspecific.m4 (AC_AIX, AC_MINIX, AC_ISC_POSIX): Don't call + AC_BEFORE for AC_HEADER_EGREP, to avoid require loops. + * acgeneral.m4 (AC_HEADER_EGREP): Call AC_PROGRAM_EGREP instead of + duplicating most of it. -Wed Jun 3 14:00:07 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) +Fri May 6 15:26:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_INIT, AC_OUTPUT): Add --no-create option. + * acspecific.m4 (AC_YYTEXT_POINTER): Use AC_TEST_LINK, not + AC_TEST_PROGRAM. - * acgeneral.m4 (AC_COMPILE_CHECK): Check the C compiler exit - status instead of trying to run the test program. +Fri May 6 00:45:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_RESTARTABLE_SYSCALLS): Use AC_TEST_PROG - instead of doing it by hand. + * acspecific.m4, acgeneral.m4: Add dnl after AC_PROVIDE, + AC_REQUIRE, and AC_BEFORE calls. + Use AC_CHECKING and AC_TEST_LINK instead of AC_COMPILE_CHECK. - * acspecific.m4 (AC_PROG_GCC, AC_AIX, AC_XENIX_DIR, - AC_SCO_INTL, AC_DYNIX_SEQ): Use AC_PROG_EGREP instead of - AC_TEST_PROG. + * acgeneral.m4 (AC_TEST_LINK): New macro. + (AC_COMPILE_CHECK): Mark obsolete. Call AC_CHECKING and + AC_TEST_LINK. + (AC_PROGRAM_CHECK, AC_PROGRAM_PATH, AC_HAVE_LIBRARY, AC_HEADER_CHECK, + AC_FUNC_CHECK, AC_SIZEOF_TYPE): Print "checking" messages even if + using cached values. Use AC_TEST_LINK instead of AC_COMPILE_CHECK. + * acspecific.m4 (AC_PROG_INSTALL): Ditto. - * acgeneral.m4 (AC_TEST_PROG): Renamed from AC_TEST_PROGRAM. + * acgeneral.m4 (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Fix nesting in + cache use. - * acgeneral.m4 (AC_INIT): Don't relativize `.'. - (AC_OUTPUT): Substitute the subdirectory path, not the top - path, for srcdir, unless the top path is `.'. + * acspecific.m4 (AC_PROG_INSTALL): Ditto. - * acgeneral.m4 (AC_OUTPUT): Special-case substituting DEFS. - From Ian Lance Taylor. + * acgeneral.m4 (AC_OUTPUT_CONFIG_SUBDIRS): Adjust relative cache + file paths before passing them to sub-configures. Omit existing + --cache-file arguments. - * acspecific.m4 (AC_GCC_TRADITIONAL): Use CPP instead of - compiling a test program. +Thu May 5 21:38:51 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_TEST_CPP): Pass DEFS to CPP. - (AC_HEADER_EGREP): Don't echo anything. - (AC_PROG_EGREP): New macro. + * acgeneral.m4 (AC_FUNC_CHECK, AC_HEADER_CHECK): Combine redundant + code. Use AC_CACHE_VAL. + (AC_SIZEOF_TYPE): Use AC_CACHE_VAL. -Tue Jun 2 14:07:27 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Thu May 5 12:51:32 1994 David J. MacKenzie (djm@gamera.eng.umd.edu) - * acgeneral.m4 (AC_CONFIG_HEADER): Renamed from AC_HEADER_FILE. - Rename AC_HEADER_NAME TO AC_CONFIG_NAME. - (AC_SUBST): Add the arg variable to a diversion for config.status. - (AC_OUTPUT): Write the code to create output files into config.status, - then run that. Always use `awk'; checking for nawk in a subshell - doesn't seem to work on 4.3BSD. + * Makefile.in (all): Don't depend on info files. + (install): Don't install INSTALL. + (installcheck, install-info): New targets. - * acgeneral.m4 (AC_HEADER_EGREP): Pass DEFS to CPP. +Thu May 5 08:49:39 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - * acspecific.m4 (AC_SIZE_T): Define size_t as int, not long. - From Ian Lance Taylor. + * Makefile.in (dist): chmod the dist directory, not the current + directory. Don't depend on DISTFILES. - * acspecific.m4 (AC_STDC_HEADERS): Also check for stdarg.h. - From Garrett Wollman. + * autoconf.sh: Go back to old way of doing NLS nuisance test. + * autoheader.sh: Ditto. + * acgeneral.m4: Ditto. -Wed May 20 00:34:03 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Thu May 5 08:36:19 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_OUTPUT): Use nawk if available. + * acgeneral.m4: Use "yes" and "no" or "" uniformly for boolean + variables' values. Don't assume default values. + (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Always set the cache variable + and use different ones. - * acgeneral.m4 (AC_INIT): Make srcdir=`.' absolute. + * acspecific.m4: Use "yes" and "no" or "" uniformly for boolean + variables' values. Don't assume default values. + (AC_STDC_HEADERS, AC_ALLOCA): Untangle nested tests. - * acspecific.m4 (AC_DIR_HEADER): Include sys/types.h before - dir header in closedir test. +Thu May 5 07:51:38 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - * acgeneral.m4, acspecific.m4: AC_LIBTHING_CHECK renamed to - AC_COMPILE_CHECK. + * Makefile.in (distclean): Remove config.cache. - * acspecific.m4 (AC_AIX, AC_XENIX_DIR, AC_SCO_INTL, AC_DYNIX_SEQ): - Use the C preprocessor instead of just looking for files. +Wed May 4 19:41:35 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) -Mon May 18 20:51:50 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + * acgeneral.m4 (AC_HAVE_LIBRARY): Use AC_CACHE_VAL. - * acspecific.m4 (WORDS_BIGENDIAN): Fix exit expression. - (AC_DECLARE_YYTEXT): Eval $CPP. - (AC_DIR_HEADER): Compile the test program; don't just - preprocess it. Above all from Karl Berry. + * Makefile.in (install): Depend on all again. + (install-info): Depend on info again. -Fri May 15 00:57:01 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Wed May 4 15:05:11 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4 (AC_AIX): Don't define _BSD, to avoid getting - union wait. + * acspecific.m4 (AC_PROG_INSTALL): Use AC_CACHE_VAL. + * acgeneral.m4 (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Use AC_CACHE_VAL. + (AC_REPLACE_FUNCS): Use AC_FUNC_CHECK. + Rearrange general tests into 4 categories: + Checking for files - fundamental (caching) + Checking for files - derived (caching) + Checking for C features - fundamental (no caching) + Checking for C features - derived (caching) - * acgeneral.m4 (AC_HEADER_EGREP): New macro, replacing AC_IDENT*. - * acspecific.m4 (AC_MEMORY_H, AC_RETSIGTYPE, AC_{UID,SIZE,PID}_T): - Use it. + * acgeneral.m4 (AC_CACHE_LOAD, AC_CACHE_SAVE, AC_CACHE_VAL): + New macros. + (AC_PREPARE): Call AC_CACHE_LOAD. + (AC_OUTPUT): Call AC_CACHE_SAVE. + (AC_PARSEARGS): Add --cache-file=FILE option. + (AC_CONFIG_SUBDIRS): Pass --cache-file to subdirectory configures. - * acgeneral.m4 (AC_TEST_CPP): New macro. - (AC_IDENT_{PRESENT,MISSING}): Macros deleted. - (AC_HEADER_CHECK): Use AC_TEST_CPP, replaces AC_HEADER_{PRESENT, - MISSING}. - (AC_LIBTHING_CHECK): Replace AC_LIBTHING_{PRESENT,MISSING}. - (AC_FUNC_CHECK): Replace AC_FUNC_PRESENT. - (AC_INIT): Don't set INCLUDEDIR. - * acspecific.m4 (AC_DIR_HEADER): Use AC_TEST_CPP. - * All other macros: Don't refer to INCLUDEDIR; use - AC_HEADER_CHECK instead. + * acgeneral.m4 (AC_OUTPUT_CONFIG_SUBDIRS): Renamed from + AC_CONFIG_SUBDIRS. + (AC_CONFIG_SUBDIRS): Just define AC_SUBDIR_LIST. + (AC_OUTPUT): Call AC_OUTPUT_CONFIG_SUBDIRS if AC_SUBDIR_LIST is + defined. + Make config.status --recheck pass --norecursion to configure. - * acspecific.m4 (AC_PROG_CPP): Don't evaluate $CC until called. - Try $CC -E before /lib/cpp. + * acspecific.m4 (AC_SETVBUF_REVERSED): Print "checking" message. -Thu May 14 23:15:02 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Wed May 4 10:40:56 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - * acgeneral.m4 (AC_OUTPUT): Remove each file before creating it. + * autoreconf.sh: Add options [--help] [--macrodir=dir] [--verbose] + [--version]. -Sat May 9 14:52:57 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + * acspecific.m4 (AC_GCC_TRADITIONAL, AC_SET_MAKE, AC_RSH, + AC_GETLOADAVG, AC_CROSS_CHECK): Print results verbosely. + (AC_GETLOADAVG): Namespace cleanup. - * acspecific.m4 (AC_WAIT3_RUSAGE): New macro. +Wed May 4 09:32:04 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_INIT, AC_OUTPUT): Use AC_SUBST instead of a - special mechanism to substitute for srcdir. + * autoheader.sh, autoconf.sh, acgeneral.m4: Make the NLS + nuisance test actually do something. - * acgeneral.m4 (AC_OUTPUT): Substitute for exec_prefix if it - was given, even if not substituting for prefix. +Mon May 2 16:31:33 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acgeneral.m4 (AC_INIT, AC_OUTPUT): Remove @VPATH@ - substitution; use @srcdir@ instead. + * configure.in: Check for standards.texi. + * Makefile.in: Put everything back into one directory. + Don't assume standards.* exist. -Sun May 3 01:21:47 1992 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) +Sat Apr 30 09:37:06 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - * acgeneral.m4 (AC_NOTICE): New macro taken from AC_INIT, to avoid - m4 coredump. From Karl Berry. + * acgeneral.m4 (AC_OUTPUT): Change >> to > in sed command. - * acgeneral.m4 (AC_OUTPUT): Look for header-file.in in $srcdir, - not current dir. +Fri Apr 29 21:56:33 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - * acgeneral.m4 (AC_IDENT_{MISSING,PRESENT}): Make them agree - with the documentation -- the third arg is a shell command, - not an identifier to define. - * acspecific.m4 (AC_DIR_HEADER): Change the caller. + * Makefile.in (all): Make autoreconf too. -Mon Apr 27 09:15:15 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Fri Apr 29 21:03:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu) - * acspecific.m4: Use AC_TEST_PROGRAM wherever $compile was - being used directly. + * acgeneral.m4 (AC_OUTPUT): When doing substitutions on files, if + the file starts with "#!", put the "automatically generated" + comment on the second line instead of the first. - * acgeneral.m4 (AC_HAVE_HEADERS, AC_HAVE_FUNCS, - AC_FUNC_PRESENT, AC_TEST_PROGRAM): New macros from Ian Lance Taylor. +Fri Apr 29 12:53:53 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - * acspecific.m4 (AC_PROG_INSTALL): Screen out /usr/sbin/install. - (AC_CHAR_UNSIGNED): Don't define __CHAR_UNSIGNED__ if it's - predefined. + * acgeneral.m4 (AC_CONFIG_AUX, AC_CONFIG_AUX_DEFAULT, + AC_CONFIG_AUX_DIRS, AC_SYSTEM_TYPE, AC_HOST_TYPE, AC_TARGET_TYPE, + AC_BUILD_TYPE, AC_SUBST_FILE, AC_MAKE_LINKS, AC_OUTPUT_MAKE_LINKS, + AC_CONFIG_SUBDIRS): New macros. -Fri Apr 24 10:08:21 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + * acspecific.m4 (AC_PROG_INSTALL): Use install.sh from ac_aux_dir. - * acgeneral.m4 (AC_OUTPUT): Make the arg a list of files instead of - directories. + * Makefile.in: Remove references to standards.*. + Add autoreconf. - * acspecific.m4 (AC_ALLOCA): Check whether the alternate libraries - actually contain alloca. From Ian Lance Taylor. +Thu Apr 28 12:01:01 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) - * acspecific.m4 (AC_PROG_CPP): New macro. + * Makefile.in (dist): Add .., ../etc, and ../texinfo files. - * acgeneral.m4 (AC_OUTPUT): Allow newly defined values to be more - than one word for AC_HEADER_FILE. From Karl Berry. + * acspecific.m4 (AC_LN_S): Add verbose messages. - * acgeneral.m4 (AC_OUTPUT): Don't substitute DEFS if AC_HEADER_FILE. - (AC_LIBTHING{PRESENT,MISSING}): Run conftest in subshell. - From Ian Lance Taylor. - -Local Variables: -mode: indented-text -left-margin: 8 -version-control: never -End: + * Makefile.in, configure.in: Add autoscan and its data files. + Check for perl. diff --git a/src/util/autoconf/ChangeLog.1 b/src/util/autoconf/ChangeLog.1 new file mode 100644 index 000000000..5e2f017e2 --- /dev/null +++ b/src/util/autoconf/ChangeLog.1 @@ -0,0 +1,1920 @@ +Thu May 12 15:55:40 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 1.11. + + * autoconf.texi: Document filename restriction on CPP. + +Thu May 12 10:11:20 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Treat "./Makefile" like "Makefile". + From Karl Berry. + +Tue May 10 00:08:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Set prefix and exec_prefix if they + weren't set already. + +Sat May 7 20:06:59 1994 Noah Friedman (friedman@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): If using install.sh, add `-c' + to INSTALL. + +Sat May 7 15:36:22 1994 David J. MacKenzie (djm@aria.eng.umd.edu) + + * acgeneral.m4 (AC_OUTPUT): If configuring in the source tree, + don't end top_srcdir with "/.". + * acspecific.m4 (AC_SET_MAKE): Remove temp file. + From John Interrante . + +Fri May 6 15:26:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu) + + * acgeneral.m4 (AC_SIZEOF_TYPE): Fatal error if test program fails. + +Fri May 6 12:52:19 1994 David J. MacKenzie (djm@gamera.eng.umd.edu) + + * acgeneral.m4 (AC_OUTPUT): Run "./config.status", not "config.status". + From Kevin Gallagher . + +Fri May 6 00:45:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu) + + * acspecific.m4 (AC_WAIT3): Sleep in the parent to avoid rm + problems on fast machines. From david d zuhn. + +Thu May 5 12:51:32 1994 David J. MacKenzie (djm@gamera.eng.umd.edu) + + * Version 1.10. + + * Makefile.in (install): Don't install INSTALL. + (installcheck, install-info): New targets. + +Mon May 2 16:31:33 1994 David J. MacKenzie (djm@aria.eng.umd.edu) + + * autoconf.sh, autoheader.sh: If M4 is an absolute file name that + no longer exists, use M4=m4. + +Mon May 2 13:06:06 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) + + * acspecific.m4 (AC_HAVE_POUNDBANG): Quote # in message. + From schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). + + * autoconf.texi: Document config.h.bot. Fix typo in AC_HAVE_POUNDBANG. + + * acspecific.m4 (AC_PROG_CXX): Look for "cxx" (DEC C++ compiler) too. + + * autoheader.sh: Fix tr string for Solaris tr. + Add config.h.bot if present. + From richard@sol.kbsi.com (Richard Henderson). + +Fri Apr 29 12:53:53 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Use install.sh from srcdir + or srcdir/.. or srcdir/../.. and never default to cp. + +Thu Apr 28 12:01:01 1994 David J. MacKenzie (djm@burnout.eng.umd.edu) + + * acconfig.h: Add HAVE_MMAP entry. + * acspecific.m4 (AC_MMAP): If NBPC is not defined, use PAGESIZE. + From "Kaveh R. Ghazi" . + + * acgeneral.m4 (AC_OUTPUT_HEADER): For each file being created, + munge a copy of conftest.sed rather than the original. + From brook@trillium.botany.utexas.edu (Brook Milligan). + +Tue Apr 26 00:27:21 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_LANG_C, AC_LANG_CPLUSPLUS): Remove CFLAGS and + CXXFLAGS from ac_cpp. + +Thu Apr 21 19:43:20 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 1.9. + + * autoconf.texi: Document special AC_FIND_XTRA ordering + dependencies. + + * acspecific.m4 (AC_FIND_XTRA): Reorder AC_REQUIREs. + + * acspecific.m4 (AC_FIND_X): AC_REQUIRE_CPP. + + * acspecific.m4 (AC_PROG_LEX): Say what we set LEXLIB to. + +Wed Apr 20 13:17:05 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Allow . in hostnames. Use string + comparison on them. + (AC_HAVE_LIBRARY): namespace cleanup. + + * autoconf.texi: Describe changes to AC_FIND_X, AC_FIND_XTRA, and + AC_YYTEXT_POINTER. + + * acconfig.h: Replace DECLARE_YYTEXT with YYTEXT_POINTER. + + * acgeneral.m4 (AC_PARSEARGS): --gas and --x set with_gas and + with_x to yes, not 1. + + * acspecific.m4 (AC_YYTEXT_POINTER): New macro, replacing + AC_DECLARE_YYTEXT. + (AC_FIND_X): Assume no X if --without-x was given. + (AC_FIND_XTRA): Quotes AC_REQUIRE args. Run uname in a subshell in + case it's missing. Put -l options in X_EXTRA_LIBS. Print values + of the variables we set if verbose. + +Tue Apr 19 14:14:25 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Note GNU m4 1.0 bugs. + + * acspecific.m4 (AC_FIND_X_XMKMF): Set variables correctly. + + * autoconf.texi: Don't @setchapternewpage odd by default. Mention + autoheader AC_SIZEOF_TYPE symbol generation. + + * acgeneral.m4 (AC_SIZEOF_TYPE): Fix typo. + + * Makefile.in (install): Don't install aclocal.m4. + + * autoheader.sh: Generate entries for AC_SIZEOF_TYPE + automatically. + +Mon Apr 18 22:14:59 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_SIZEOF_TYPE): Remove second arg, and generate a + symbol name automatically. + + * autoconf.texi: Document new AC_SIZEOF_TYPE usage. + + * acspecific.m4 (AC_PROG_INSTALL): Only filter out "install" + containing "dspmsg". + (AC_FIND_X_XMKMF): Fix variable names to not conflict with grep -v. + + * autoconf.texi: Various small fixes. + + * INSTALL: Say configure takes "awhile". + +Sat Apr 16 15:05:31 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4: Call AC_LANG_C in AC_PREPARE, not AC_INIT. + +Fri Apr 15 07:00:37 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 1.8. + + * acgeneral.m4: Rename ac_configure_args back to configure_args, + since some people have been using it. + +Thu Apr 14 14:45:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Note that AC_ENABLE and AC_WITH arguments + shouldn't contain blanks, for now. + +Wed Apr 13 17:26:36 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_SET_MAKE): Use $MAKE if defined, else "make". + + * autoconf.texi: Add missing files to diagram. + + * acgeneral.m4 (AC_TEST_CPP): Propogate comment about Coherent + lossage into configures. + +Sat Apr 9 17:34:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Unknown option is a fatal error. + + * acgeneral.m4: Remove ac_ prefix from some variables set by + options, for consistency and backward compatibility. + +Fri Apr 8 13:24:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_XTRA): Don't test for -lsocket on IRIX. + From Karl Berry. + + * acspecific.m4 (AC_FIND_X_XMKMF, AC_FIND_X_DIRECT): Don't + override --x-includes and --x-libraries. Check openwin last due + to its bugs. + + * acgeneral.m4: Add --x-includes, --x-libraries options. Document + them and --build, --host, --target. + + * autoconf.texi: Mention --x-includes and --x-libraries. + + * INSTALL: Mention --x-includes and --x-libraries. + +Tue Apr 5 12:46:47 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Document top_srcdir substitution. + + * acspecific.m4 (AC_PROG_INSTALL): Look for install.sh in + @top_srcdir@, not $srcdir. + + * acgeneral.m4 (AC_OUTPUT): AC_SUBST top_srcdir. Set it. + +Mon Apr 4 20:13:08 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Fix dependencies examples. + + * Makefile.in: Update configuration dependencies. + + * acgeneral.m4: Add back --no-create option. Make config.status + --recheck use it. + + * autoheader.sh: Go back to doing move-if-change. (Work around in + dependencies by using stamp files.) + +Thu Mar 31 11:34:50 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu) + + * Makefile.in (autoconf, autoheader, configure): Write to $@.tmp + instead of to $@ directly so that after a disk full error, the + targets to not exist. Otherwise, a subsequent make could install + a corrupt (but not executable) script. From Jim Meyering. + +Thu Mar 31 08:22:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Re-document --with argument. + + * acgeneral.m4 (AC_PARSEARGS): --with can take an argument again. + +Wed Mar 30 20:01:57 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Document --disable- options. + + * acgeneral.m4 (AC_PARSEARGS): Add --disable-FEATURE. + + * INSTALL: Mention --enable- options. + +Mon Mar 28 17:43:22 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Make multiple non-option args a + fatal error. + + * acspecific.m4: Change all occurrences of $(MAKE_VAR) to + ${MAKE_VAR}. + + * autoconf.texi (Command Line): New node. Move some descriptions + here from General Feature Tests. Describe --without- options. + + * acgeneral.m4 (AC_PARSEARGS): Rewrite again, using ideas from the + GNU libc configure.in. All options that take an argument set + shell variables. + (AC_COMPILE_CHECK): Add `return' in `int' function. + + * INSTALL: Fix typo. + +Sun Mar 27 00:44:07 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_NOTICE): Don't save original args or initialize + options here. + (AC_PARSEARGS): Do them here. + (AC_PREPARE): Save a copy of original args here, if it hasn't been + done yet. + +Sat Mar 26 01:32:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * acgeneral.m4: Omit obsolete options from usage message. + Quote args to AC_CHECKING that contain m4 variables. + + * INSTALL: Note that env can be used to set env vars. + + * autoconf.texi: Document AC_SET_MAKE. + Note that vsprintf and vfprintf come with vprintf. + Note that env can be used to set env vars. + + * acspecific.m4 (AC_SET_MAKE): New macro. + (AC_PROG_INSTALL): Find scoinst as a good install program. + + * acgeneral.m4: Initialize variables set by options. + (AC_HAVE_HEADERS): Require cpp. + + * autoconf.texi: Document AC_ENABLE and @prefix@ and @exec_prefix@ + substitutions. + + * acgeneral.m4: Recognize all the Cygnus configure options; warn + about other arguments. Make default value for --with "yes", not + "1". AC_SUBST for prefix and exec_prefix. + (AC_ENABLE): New macro. + +Thu Mar 24 18:11:00 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * INSTALL: Describe recently added configure options. + + * autoconf.texi: Style cleanups. Mention config.h.top. + + * autoheader.sh: Add ${config_h}.top to the output, if it's + present. + +Thu Mar 24 13:36:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.sh: Remove all temp files when exiting. If m4 fails, + produce no output and exit with the m4 exit status. + + * autoconf.texi: Document AC_PREREQ. + + * acgeneral.m4 (AC_PREREQ): New macro, with some helper macros. + +Thu Mar 24 01:20:49 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * Makefile.in (acdatadir): New variable based on datadir, giving + Autoconf lib files their own subdirectory. Use it instead of + datadir. + +Wed Mar 23 22:41:54 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * autoconf.texi: Change names of nodes that describe invoking + configure and config.status to conform to coding standards. + Document --version, --help, --silent/--quiet, --verbose options to + configure and config.status. + + * acgeneral.m4 (AC_PARSEARGS): Add --help and --version to + configure. Simplify getting option arguments. Complain about + impossible host arguments. + (AC_OUTPUT): Add --help and --version to config.status. + +Wed Mar 23 00:16:28 1994 Roland McGrath (roland@mole.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_CHECKING): Do nothing if $ac_silent is set. + (AC_PARSEARGS): Grok -q/--quiet/--silent and set $ac_silent. + +Tue Mar 22 18:28:30 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi: Document AC_SIZEOF_TYPE. + + * acspecific.m4 (AC_INT_16_BITS, AC_LONG_64_BITS): Mark obsolete + with advice to use AC_SIZEOF_TYPE instead. + + * acgeneral.m4 (AC_SIZEOF_TYPE): New macro. + +Tue Mar 22 08:44:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * autoconf.texi: Describe AC_CHECKING et al. + + * acspecific.m4: Use AC_CHECKING et al. where appropriate. + + * acgeneral.m4 (AC_CHECKING, AC_VERBOSE, AC_ERROR, AC_WARN): New + macros. Use them where appropriate. + (AC_LANG_C, AC_LANG_CPLUSPLUS): Fix quoting of ac_cpp. + + * acspecific.m4 (AC_PROG_CPP): Don't add $CFLAGS to CPP. + (AC_PROG_CXXCPP): Don't add $CXXFLAGS to CXXCPP. + + * acgeneral.m4 (AC_OUTPUT): Don't remove VPATH lines containing + colons. From Jim Meyering (meyering@comco.com). + (AC_LANG_C): Add CFLAGS to ac_cpp. + (AC_LANG_CPLUSPLUS): Add CXXFLAGS to ac_cpp. + +Sat Mar 19 16:38:03 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_LANG_RESTORE): Only emit shell code to change + the current language if it actually changed. + + * autoconf.texi: Add info dir entry. Describe new C++ macros and + AC_MMAP. + (Language Choice): New section. + Add another example of dependencies. + + * acspecific.m4 (AC_PROG_CXX, AC_PROG_CXXCPP, AC_REQUIRE_CPP): New + macros based on work by zoo@aggregate.com (david d zuhn). + (AC_DECLARE_YYTEXT): Use AC_REQUIRE_CPP. Warn that it's broken. + (AC_STDC_HEADERS): Use AC_REQUIRE_CPP. + (AC_MMAP): New macro from Mike Haertel and Jim Avera. + + * acgeneral.m4 (AC_PARSEARGS): Check for missing arguments to + options. Recognize --target. Save the original args before + modifying them. + (AC_INIT): Call AC_LANG_C. + (AC_PREPARE): Don't save the original args here (too late). + (AC_LANG_C, AC_LANG_CPLUSPLUS, AC_LANG_SAVE, AC_LANG_RESTORE): + New macros based on work by zoo@aggregate.com (david d zuhn). + (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_COMPILE_CHECK, + AC_TEST_PROGRAM, AC_TEST_CPP): Use AC_REQUIRE_CPP and ac_ext and + ac_cpp. + + * autoheader.sh: Update the file even if it is unchanged, to avoid + foiling a Makefile rule that makes it from configure.in. If you + let the rule for making config.status from configure create + config.h from config.h.in, then an unnecessary update here will + not cause unneeded recompilation. Recompilation should only + happen if config.h is updated, which won't occur if config.h.in + had the same contents, even if its timestamp changed. (Ick.) + + * Makefile.in (Makefile): Don't depend on config.status, to avoid + running config.status too many times. + +Fri Mar 18 00:43:21 1994 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * autoconf.texi: Document AC_FIND_XTRA. + + * acgeneral.m4 (AC_OUTPUT): Remove VPATH lines if srcdir=., to + work around Sun make bug. From Karl Berry. + + Rename internal use shell variables to start with "ac_". + + Trap signal 2 (SIGINT), not signal 3 (SIGQUIT), which means stop + without cleaning up. From eggert@twinsun.com (Paul Eggert). + + * acspecific.m4 (AC_FIND_XTRA): New macro from Karl Berry + (karl@cs.umb.edu). + (AC_FIND_X, AC_ISC_POSIX): Provide self. + + (AC_DECLARE_YYTEXT): Move AC_SUBST. Don't quote value of + DECLARE_YYTEXT. From Karl Berry. + + (AC_PROG_CPP): Include $CFLAGS in CPP. + + Rename internal use shell variables to start with "ac_". + + * autoconf.sh, autoheader.sh: Trap signal 2 (SIGINT), not signal 3 + (SIGQUIT), which means stop without cleaning up. From + eggert@twinsun.com (Paul Eggert). + + * autoconf.texi: Mention shell variable prefixes. + + * autoconf.texi: Work around RCS substitution in AC_REVISION + example. + +Wed Mar 16 19:55:17 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * acgeneral.m4 (compile): Include $LDFLAGS. + +Thu Mar 10 01:27:20 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Don't absolutize relative paths. + (AC_OUTPUT): For relative paths, prepend to $srcdir as many + "../" as the number of subdirectories deep the file being created is. + +Tue Feb 15 16:02:19 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Reject /sbin/install. + +Sun Feb 13 21:15:45 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * autoconf.texi (Setting Variables, Sample configure.in): Replace + references to AC_UNISTD_H with AC_HAVE_HEADERS(unistd.h). + +Thu Feb 10 21:39:43 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_SYS_SIGLIST_DECLARED): New macro. + +Sat Feb 5 13:35:52 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm separately after + -lutil check. + +Fri Feb 4 17:17:11 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT_HEADER): Move creation of conftest.sed + outside of `for' loop. We need only do this once for all the + output files. + +Fri Jan 21 16:35:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL_INSTALL_SH): New macro for + INSTALL value to use install.sh. + (AC_PROG_INSTALL): Use it. + +Thu Jan 6 16:22:25 1994 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE): Use AC_QUOTE_SQUOTE instead of + AC_DEFINE_QUOTE on AC_VAL. From Bruno Haible + . + * acgeneral.m4 (AC_DEFINE_UNQUOTED): pushdef/popdef + AC_QUOTE_SQUOTE instead of AC_DEFINE_QUOTE. + +Wed Dec 22 03:51:53 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE): in verbose strings, put + AC_DEFINE_QUOTE exprs in double quotes to avoid shell wildcard + expansion. + + * acgeneral.m4 (AC_PROGRAM_PATH, AC_PROGRAMS_PATH): New macros. + * autoconf.texi (General Tests): Document them. + + * configure.in: Use AC_PROGRAMS_PATH to find m4, not AC_PROGRAMS_CHECK. + Put `m4' in the list of progs-to-check, since we want the absolute + pathname for that too if we can get it. + +Fri Dec 17 13:44:24 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_ALLOCA): define HAVE_ALLOCA if alloca is + present in system libraries. + +Tue Dec 14 14:53:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Remove $ac_clean_files in traps. + + * acspecific.m4 (AC_STDC_HEADERS): Check that free appears in stdlib.h. + +Fri Dec 10 06:35:25 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Don't look for install in `.'. + +Wed Dec 8 12:10:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_XMKMF): Redirect stderr to /dev/null in + eval'd make pipeline. + + * acgeneral.m4 (AC_QUOTE_SED): Quote ! as well. + +Mon Dec 6 23:41:05 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_CPP): Try 'cc -E -traditional-cpp' for NeXT. + +Thu Dec 2 02:25:39 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): use rm -r to remove conftest* both in + exit traps and at start of script. + +Wed Dec 1 03:22:21 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_DIRECT): Search for includes and libs + in more places. + +Sun Nov 28 21:57:31 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acgeneral.m4 (AC_NOTICE): Replace "this program" with "this + configure script" to disambiguate between configure and the + program it is distributed with (which can have different terms). + +Tue Nov 23 19:41:53 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_DIRECT): Use the shell variable + `x_direct_test_include' to choose the include file to search for. + +Sat Nov 20 17:58:09 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_DIRECT): Search for R6 includes & libs + in various places. Look for /usr/athena/include & /usr/athena/lib. + Make AC_HAVE_LIBRARY check for the library specified by the shell + variable `x_direct_test_library', rather than hardcoding Xt (to + which the shell variable now defaults). + +Thu Nov 18 18:17:21 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT_HEADER): Use ! instead of @ as the + sed substitution separator. + + * install.sh: New file. + * Makefile.in (DISTFILES): Add it. + * acspecific.m4 (AC_PROG_INSTALL): Use it as the default + instead of cp, if it's there. + +Sat Nov 13 12:24:57 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Extend that last change to also + happen for .C, .cc, and .m (objc) files. + +Wed Nov 10 09:26:35 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): When substituting .c or .h files, put + autoconf-added comments in '/* ... */'. + +Mon Nov 8 16:22:48 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_NOTICE): Put autoconf version number in configure. + +Fri Nov 5 23:31:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_XMKMF): properly quote `acfindx' rule. + +Fri Oct 29 21:46:57 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (HAVE_LONG_DOUBLE): Add code to detect Stardent + Vistra lossage. From Kaveh R. Ghazi (ghazi@noc.rutgers.edu). + +Tue Oct 26 15:24:33 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * Version 1.7. + +Tue Oct 19 23:49:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_TEST_PROGRAM): Don't remove conftest* before + running $2 or $3 or $4; just once at the end. + +Mon Oct 18 01:38:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Echo a newline into confdefs.h so it + is never empty. + +Fri Oct 15 18:49:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Added test of trivial use for broken + Ultrix-32 V3.1 Rev 9 vcc. + +Fri Oct 15 15:44:39 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OBSOLETE): New macro. + * acspecific.m4 (AC_UNISTD_H, AC_USG, AC_MEMORY_H): Call it. + + * acspecific.m4 (AC_LONG_FILE_NAMES): Try to create files in + ${prefix}/lib and ${exec_prefix}/lib instead of ${prefix} and + ${exec_prefix}; they are more likely to be writable. + + * Makefile.in (clean): Remove *.ma and *.mas, the macro index files. + +Tue Oct 12 16:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_RETSIGTYPE): AC_PROVIDE self. + +Mon Oct 11 19:09:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in (editsh): Obfuscate @M4@ and @datadir@ references so + configure doesn't edit them. + +Sun Oct 10 14:01:35 1993 Jim Meyering (meyering@comco.com) + + * autoconf.sh (--help): Exit successfully. + +Sat Oct 9 08:29:15 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * Version 1.6. + + * acconfig.h (inline): New entry. + + * acspecific.m4 (AC_DIR_HEADER_CHECK): Don't call opendir, in + case the needed libraries (e.g., -ldir on Xenix) aren't in + LIBS yet. From Jim Meyering (meyering@comco.com). + + * acspecific.m4 (AC_PROG_LEX): Fix typo. + + * acgeneral.m4 (AC_HEADER_EGREP, AC_PROGRAM_EGREP, + AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove any + temporary files before doing the actions, in case they're + nested tests. From gray@antaire.com (Gray Watson). + + * configure.in: Check for GNU m4 under several names. + * Makefile.in: Use that value. + From Franc,ois Pinard. + + * acspecific.m4 (AC_STRUCT_TM): Use a member of struct tm, to + make sure the compiler complains if it's not defined. + From Bruno Haible (haible@ma2s2.mathematik.uni-karlsruhe.de). + + * acspecific.m4 (AC_FIND_X_XMKMF): If libX11.a isn't in + USRLIBDIR, check in LIBDIR. Filter out any make verbose messages. + +Tue Oct 05 19:21:29 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_LONG_DOUBLE): Announce that this feature is being + checked even if the test is simply whether $CC is gcc. + +Tue Oct 5 14:23:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh: Produce HAVE_LIBfoo for AC_HAVE_LIBRARY. + +Sun Oct 3 15:41:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Write assignment for `extrasub'; in sed + cmds, write "$extrasub" so configure.in can set it to do sed frobs. + Take second arg and write it to config.status before `exit 0'. + + * acspecific.m4 (AC_CONST): Say `checking for lack of working + const'. That is precisely accurate. + +Wed Sep 22 15:47:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4: If not using GNU m4, abort. + + * acgeneral.m4 (AC_PREPARE): Lose if we're not in the srcdir, + not if we're in it. But disable the check for now. + +Mon Sep 20 15:32:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Check for $srcdir being configured, + diagnose and lose. + + * acgeneral.m4 (AC_QUOTE_SED): Quote @ and %. + + * acgeneral.m4 (AC_OUTPUT): Say "$file is unchanged" when it is. + +Sat Sep 18 14:32:04 1993 Ian Lance Taylor (ian@airs.com) + + * acgeneral.m4: Substitute for CONFIG_FILES and CONFIG_HEADERS + before using them, in case they have multiple values. + +Fri Sep 17 14:40:20 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_WAIT3): wait3 works if ru_stime is + nonzero, too. + +Thu Sep 16 15:39:53 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X_XMKMF): Code moved from AC_FIND_X. + (AC_FIND_X_DIRECT): New function, derived from code by Karl + Berry and Rob Savoye. + (AC_FIND_X): Call them. + +Wed Sep 15 19:06:46 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Remove confdefs* on exit with trap 0. + (AC_OUTPUT): Don't bother removing it. + + * acgeneral.m4: Remove --no-create option; not useful. + +Mon Sep 13 21:54:46 1993 Paul Eggert (eggert@twinsun.com) + + * autoheader.sh: Rename the temporary output to the real + output if their contents differ, not if their contents are identical. + This fixes bug introduced in Aug 30 change. + +Mon Sep 13 16:50:30 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Run config.status with + CONFIG_SHELL if defined. Same for configure run from config.status. + Rename gen_files to CONFIG_FILES and gen_config to CONFIG_HEADERS. + + * acgeneral.m4 (AC_PREPARE): Remove confdefs* in trap. + +Fri Sep 10 00:29:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_LONG_FILE_NAMES): Test /var/tmp as well. + In loop, skip past nonexistent dirs. + + * acspecific.m4 (AC_CONST): Say "working", not "broken". We are + checking for a working const as opposed to a broken or absent + const, not for a broken const as opposed to a working one. + +Thu Sep 9 09:25:49 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4, acconfig.h (AC_LONG_64_BITS): New macro. + +Wed Sep 1 18:54:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PROGRAM_CHECK): Use && instead of test -a. + +Tue Aug 31 19:21:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT_HEADER): Support generating multiple + .h files. From gray@antaire.com (Gray Watson). + + * acspecific.m4 (AC_ALLOCA): If using alloca.o, define C_ALLOCA. + + * acgeneral.m4 (compile, AC_HEADER_EGREP, AC_PROGRAM_EGREP, + AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove $DEFS + from cc and cpp command lines; include "confdefs.h" in test + files. + (AC_DEFINE): Append a #define to confdefs.h. + Reduce duplicated code by introducing a temp variable, AC_VAL. + +Mon Aug 30 17:36:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh: Don't write output if it is the same as output file. + +Wed Aug 25 14:14:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_VFORK): Check for SunOS 5.2 bug with ignoring + signal in parent before vfork. From eggert. + +Fri Aug 20 10:14:42 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Support giving values to --with + options. Go back to using sed for invalid test, but without + using '*' in the regex. + +Thu Aug 19 14:53:29 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_LONG_FILE_NAMES): eval the args. + + * acgeneral.m4 (AC_PARSEARGS): Use case instead of sed and + test to detect invalid package names. Remove =value from + --with options until we support it. + +Wed Aug 11 18:52:41 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X): Don't set x_includes if it's + /usr/include or x_libraries if it's /lib or /usr/lib. + +Wed Aug 11 13:00:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_LONG_FILE_NAMES): If we cannot write $dir, echo + a warning msg and continue the loop to skip that directory. + + * acgeneral.m4 (AC_REVISION): Also eat double quotes. + +Thu Aug 5 14:55:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acconfig.h: Add TIME_WITH_SYS_TIME. + +Mon Aug 2 14:55:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_DECLARE_YYTEXT): \-escape "s in rhs of + AC_DEFINE_UNQUOTED. + Remove gratuitous second arg to AC_SUBST. + +Sun Aug 1 19:13:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Define HAVE_GETLOADAVG if we find + one and don't use our own getloadavg.c. + * acconfig.h: Add HAVE_GETLOADAVG. + +Sat Jul 31 17:28:48 1993 Karl Berry (karl@cs.umb.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Report results under -v. + +Fri Jul 30 18:08:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (syms, headers, funcs, libs): Run values through + sort|uniq to remove duplicates. + +Wed Jul 28 00:02:34 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * Makefile.in (config.status): Run config.status --recheck, + not configure. + (install): Remove refs to install-info until it's released, + because people are getting confused. + + * acgeneral.m4 (AC_OUTPUT): For config.status --recheck, echo + the configure command line that we run. + + * acspecific.m4 (AC_PROG_FLEX): Use AC_HAVE_LIBRARY. + +Mon Jul 26 19:11:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Check that both -lutil and -lkvm + exist before choosing them in hopes they will define getloadavg. + + * autoheader.sh (frob): Put $2 and $3 in the expansion of + AC_HAVE_LIBRARY, so AC_DEFINE there is noticed. + +Mon Jul 26 14:21:33 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * acspecific.m4 (INT_16_BITS): Check the obvious way, so it + doesn't pick up machines with 64 bit longs. + +Mon Jul 26 14:01:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Check for -lelf with + AC_HAVE_LIBRARY instead of checking for with AC_HEADER_CHECK. + +Mon Jul 26 13:58:39 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * acspecific.m4 (AC_SCO_INTL, AC_IRIX_SUN, AC_DYNIX_SEQ): Use + AC_HAVE_LIBRARY. + +Mon Jul 26 13:55:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (eval frob): Restore hairy sed use; we need it to + handle multi-line macro invocations. + +Mon Jul 26 00:50:43 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * acspecific.m4 (AC_FIND_X): Quote the Imakefile. + +Sun Jul 25 08:17:11 1993 Jim Meyering (meyering@comco.com) + + * acconfig.h (CRAY_STACKSEG_END): New #undef. + +Thu Jul 22 20:26:12 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Version 1.5. + + * acspecific.m4 (AC_FIND_X): Let make substitute any variables + in INCROOT and USRLIBDIR, instead of using sed. + From wojo@veritas.com (Jack Woychowski). + + * acgeneral.m4 (AC_DEFINE): When printing value verbosely, use + double quotes and AC_DEFINE_QUOTE, like we do when assigning + the value, so shell variables get expanded the same way. + + * acgeneral.m4 (AC_REVISION): New macro. + From wollman@uvm-gen.EMBA.UVM.EDU (Garrett Wollman). + + * acgeneral.m4 (AC_DEFINE): Add newline before open brace. + +Thu Jul 22 17:07:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STAT_MACROS_BROKEN): New macro. + * acconfig.h (STAT_MACROS_BROKEN): New #undef. + +Wed Jul 21 15:44:32 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_DECLARE_YYTEXT): Use AC_DEFINE_UNQUOTED so + shell var is replaced in rhs. + +Wed Jul 21 13:31:38 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acconfig.h (size_t, mode_t, off_t): Added. + * acspecific.m4 (AC_OFF_T): New macro. + +Tue Jul 20 15:39:44 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * autoheader.sh: Put header-file.in in comment at top. + + * acconfig.h (NDIR): Added. + +Mon Jul 19 22:10:49 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * Makefile.in (info, dvi): New targets. + +Sun Jul 18 22:36:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (frob): Use `#' as the first line of each definition. + (eval frob): Totally simplify sed use to just handle "^@@@.*@@@$". + +Wed Jul 14 22:44:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acconfig.h: Restore blank lines between paragraphs. + + * autoheader.sh (libs): New variable and frob to set it from + AC_HAVE_LIBRARY uses. Produce #undef HAVE_* for each $libs. + +Tue Jul 13 19:03:46 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acconfig.h: Sort the entries, like the comment says. + + * acspecific.m4 (AC_GETLOADAVG): Only check for the AIX library + once, looking in both local and system dirs. + Consolidate SVR4 and Solaris cases. + +Mon Jul 12 20:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): If we find sys/dg_sys_info.h, do + AC_HAVE_LIBRARY on -ldgc. + +Sun Jul 11 00:43:51 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): BSD library is -lutil, not + -lutils, and requires -lkvm too. + Check for local AIX library using AC_HAVE_LIBRARY, not + AC_COMPILE_CHECK. + Un-nest some conditionals. Stop checking once we've + found a way to get getloadavg. + +Thu Jul 8 20:21:28 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Makefile.in: Remove rules for making *.conf; make + Autoconf's configure script semi-normally. + +Wed Jul 7 14:37:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * autoheader.sh (--help): Print help message to stdout and exit 0. + (--version): Exit after printing version number. + * autoconf.sh (--version): Exit after printing version number. + + * acspecific.m4 (AC_LONG_DOUBLE): Make sure that long double + isn't smaller than double, as in Ultrix 4.[23] cc. + + * acgeneral.m4 (AC_REPLACE_FUNCS): Include ctype.h in the test + program to get stubs. + + * acspecific.m4 (AC_FIND_X): New macro. + +Tue Jul 6 19:15:17 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Try ls -L first, in case + /dev/kmem is a symlink (as on Solaris). + +Wed Jun 30 22:08:22 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_MINUS_C_MINUS_O): Remove spurious `then'. + +Fri Jun 25 23:16:42 1993 Paul Eggert (eggert@twinsun.com) + + * acspecific.m4 (AC_CONST): Replace `p = ' + with `ccp = '; the former wasn't ANSI C, and + was causing working compilers to be rejected. + +Fri Jun 25 13:26:34 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_LONG_FILE_NAMES): Redirect rm's stderr to + /dev/null. + +Thu Jun 24 15:58:04 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Undo + change of Jun 16 1993. Only set `LANG' and `LC_ALL' to "C" if + already set. + +Sat Jun 19 00:01:51 1993 Jim Meyering (meyering@comco.com) + + * acgeneral.m4: Undefine m4's `format' builtin. + * acspecific.m4 (AC_HAVE_POUNDBANG): Make conftest executable, + but not necessarily writable by group or other. + +Thu Jun 17 21:10:33 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_CPP): Put double quotes around ${CC-cc}, + not single quotes. + If --verbose option given, say what CPP is being set to. + +Wed Jun 16 17:50:00 1993 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_CPP): Make sure that `cc -E` doesn't + run the program through the C compiler too. Bob Olson + says it does on the NeXT. + +Wed Jun 16 16:17:05 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Always set + `LANG' and `LC_ALL' environment variables to `C'. + +Fri Jun 11 14:29:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_MINUS_C_MINUS_O): Test that cc works at all, + and only test it for -c -o if it does. + +Tue Jun 8 01:47:22 1993 Paul Eggert (eggert@twinsun.com) + + * acgeneral.m4 (AC_OUTPUT): The line + DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`" + doesn't work in some shells, which don't allow nesting + \"\" inside `` inside "", and which don't unescape \\\& in the + expected (?) way. Also, some versions of echo interpret + backslashes inside $DEFS. Put $DEFS into a temporary file + to avoid these portability minefields. + +Mon Jun 7 20:11:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): In setting KMEM_GROUP, use new sed + magic from friedman which should win with both meanings of ls -lg. + +Mon Jun 7 06:48:49 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * Makefile.in (dist): Change gzipped tar file extension to `.gz'. + Use explicit --gzip option to tar to make sure tar uses the right + compression program (or else exits from failure to understand the + option). + + * acgeneral.m4 (AC_OUTPUT): Don't split sed expr for exec_prefix + across two lines, since not all versions of sed understand that. + + * acspecific.m4 (AC_HAVE_POUNDBANG): Complete rewrite which doesn't + depend on csh. + +Tue Jun 1 03:06:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * Version 1.4.1 (not announced to the general public, but + a snapshot was put on the June '93 GNU CDROM). + + * Makefile.in (dist): If ln fails (e.g. because of cross-device + links), mention on stdout that file is being copied. + + * acgeneral.m4 (AC_PREPARE): Use `[$]*' in assignment to + configure_args to get shell positional args, rather than m4 args to + AC_PREPARE. + (AC_OUTPUT): Use `configure_args' in config.status + when invoked with --recheck, rather than $*. + +Mon May 31 13:12:56 1993 Paul Eggert (eggert@twinsun.com) + + * acspecific.m4 (AC_LONG_FILE_NAMES): rm $dir/conftest*, + not conftest*. + +Mon May 31 04:18:18 1993 Roland McGrath (friedman@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_HAVE_LIBRARY): Quote libname in define. + +Sun May 30 19:52:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_SETVBUF_REVERSED): Pass (char *) main to + setvbuf instead of zero. + +Thu May 27 20:30:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREPARE): Save $* in shell var `configure_args'. + (AC_OUTPUT): Use $configure_args in place of $*. + +Wed May 26 16:19:51 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoconf.texi (AC_PROG_INSTALL): Doc fix. + (Automatic Remaking): Put code fragment in @example ... @end example. + +Mon May 24 15:46:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (frob): Redefine AC_CONFIG_HEADER to set shell + variable `config_h'. + (config_h): New variable, initialize to "config.h" before frobbing. + (final output): Write ${config_h}.in. + +Sat May 22 17:45:19 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * Version 1.4 released. + +Thu May 20 20:25:45 1993 Jim Blandy (jimb@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_IDENTITY): New function. + (AC_DEFINE_UNQUOTED): Use it to fix this; due to a + misunderstanding of m4, this was using its first argument as + the definition. + +Thu May 20 09:21:55 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_ALLOCA) [find_stack_direction]: Return the + value from the recursive call. If it worked before, it was by luck. + From Bruno Haible . + +Tue May 18 23:40:21 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STDC_HEADERS): Require AC_PROG_CPP. + +Mon May 17 18:01:09 1993 Karl Berry (karl@hal.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Use variables gen_files and + gen_config in the loop that generates the output (Make)files, + instead of hardwiring the filenames. + +Sat May 15 17:23:19 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * autoconf.sh: Accept `-' to mean read stdin as input. + * autoheader.sh: Likewise. + +Fri May 14 12:41:02 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoheader.sh, acspecific.m4 (AC_PREPARE): If `LANG' environment + variable is set, reset its value to `C'. This is so `tr [...]' + works more portably. + +Thu May 13 22:56:20 1993 Paul Eggert (eggert@twinsun.com) + + * acspecific.m4 (VOID_CLOSEDIR): Test closedir instead of assuming + that it works. E.g. dynix closedir yields garbage, but has no + prototype. Presumably Xenix closedir had the same problem, so + stop special-casing it. + +Wed May 12 20:25:36 1993 Jim Meyering (meyering@comco.com) + + * acconfig.h: Add HAVE_LONG_DOUBLE. + +Wed May 12 15:07:36 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE_UNQUOTED): New macro. + + * acgeneral.m4 (AC_FUNC_CHECK): Include ctype.h instead of stdio.h. + We want it only to define __stub_* in glibc. Using stdio.h lost + when it contained a conflicting prototype for $1; ctype.h has fewer + prototypes. + + * acconfig.h: Add GETGROUPS_T. + + * acspecific.m4 (AC_PROG_RANLIB): Use : instead of @: for no-op. + Some braindead make does bizarre magical things with @ in variables. + +Mon May 10 14:24:27 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_HAVE_POUNDBANG): New feature. + + * acgeneral.m4 (AC_OUTPUT): Add more backslashes to character class + in DEFS filter (sigh). + +Sun May 9 14:04:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE_QUOTE): No AC_QUOTE_SED (was innermost). + (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_TEST_CPP): Put a \ before + $DEFS in string to be evalled. + (AC_OUTPUT): Run DEFS through a sed filter that quotes things in it + from sed (woo woo!) before writing it into config.status. + + * acspecific.m4 (AC_ALLOCA): Use AC_PROGRAM_EGREP to test for [CRAY + && !CRAY2], instead of AC_TEST_PROGRAM. No need to run a program + for this. + + * acgeneral.m4 (AC_PROGRAM_CHECK): Extract the first word of $2 + when looking for it in PATH, so it can be a program name with args. + Omit default assignment if $4 is empty. + Only write verbose msg if $1 was set nonempty. + * acspecific.m4 (AC_PROG_YACC): Pass 'bison -y' (quoted like that) + in list to AC_PROGRAMS_CHECK. Don't test for bison later to add -y + flag. + +Sat May 8 00:23:58 1993 Jim Meyering (meyering@comco.com) + + * acgeneral.m4 (AC_REPLACE_FUNCS): Add a trailing newline in + code for AC_COMPILE_CHECK. Otherwise it got spurious failures. + + * acspecific.m4 (TIME_WITH_SYS_TIME): New macro. + + * Makefile.in (dist): Depend on Makefile. Use gzip instead + of compress. Link files individually instead of en masse; + if a link fails, use `cp -f' on the losing file. + + * acspecific.m4 (AC_ALLOCA): Define CRAY_STACKSEG_END (the + name of a function used in alloca.c) for CRAY-1, CRAY X-MP, + and CRAY Y-MP. + +Fri May 7 15:56:26 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Check for mach/mach.h, but don't + disable nlist checks if found. + +Fri May 7 04:59:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Don't look for `install' in + /usr/ucb. + +Thu May 6 20:41:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_FUNC_CHECK): The test program should choke on + #ifdef __stub___$1 as well. + (AC_REPLACE_FUNCS): Make the test program choke on stubs. + +Wed May 5 20:43:13 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoconf.sh ($infile existence check): Fixed test for + nonemptiness of $print_version to not always be true. + +Wed May 5 17:22:42 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PREFIX, AC_PROGRAM_CHECK), acspecific.m4 + (AC_PROG_INSTALL): If IFS wasn't set initially, give it a + normal default value. Happens on LynxOS (x86), says + Pete Klammer . + +Wed May 5 13:22:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4: Undefine the `shift' builtin. + + * acspecific.m4 (AC_PROG_YACC): Use AC_PROGRAMS_CHECK to check for + both bison and yacc, instead of two AC_PROGRAM_CHECK uses. + + * autoheader.sh ($# -eq 0): Set var $tmpout to name of temp file, + send stdout there instead of config.h.in. + (just before exit): If $# -eq 0, then move $tmpout to config.h.in + if $status -eq 0, or remove $tmpout otherwise. + + * acspecific.m4 (AC_STRCOLL): Rewritten to use a test program that + verifies that `strcoll' does vaguely reasonable ordering. + +Tue May 4 19:59:00 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_LONG_DOUBLE): Don't explicitely echo + `checking for long double'. + +Mon May 3 22:04:35 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_GETGROUPS_T): New macro. + +Sat May 1 22:37:55 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_LONG_DOUBLE): New macro. + +Wed Apr 28 15:52:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PROGRAM_CHECK): Write msg under --verbose. + +Thu Apr 22 18:24:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_FUNC_CHECK): Remove spurious `#endif' line at end. + + * acgeneral.m4 (AC_WITH): Fix reversed args to patsubst. + Test $with_FOO, not $FOO. + +Wed Apr 21 18:14:19 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_QUOTE_TOKEN): New macro. + (AC_DEFINE_QUOTE): Use it. + +Tue Apr 20 18:02:46 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_DECLARE_YYTEXT): Guess name of lex output file + and do AC_SUBST of `LEX_OUTPUT_ROOT'. + Add `dnl' after calling some autoconf macros. + +Mon Apr 19 15:46:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_MINUS_C_MINUS_O): Do each compile a second time + after testing for the existence of the output. Some compilers + refuse to overwrite an existing .o file with -o, though they will + create one. + + * acspecific.m4 (AC_DECLARE_YYTEXT): Changed lex input to two lines + of "%%", not just one. + +Sat Apr 17 17:26:12 1993 Jim Meyering (meyering@comco.com) + + * acgeneral.m4 (AC_COMPILE_CHECK): Don't print `checking for ...' + message if first argument is empty. + +Sat Apr 17 01:18:41 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PID_T): provide self. + (AC_VFORK): Require AC_PID_T. + +Fri Apr 16 11:57:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PROGRAMS_CHECK): Take optional third arg; if + given, use it as the default value. + +Thu Apr 15 16:43:45 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_REPLACE_FUNCS): Print a message under --verbose. + + * acgeneral.m4 (AC_HAVE_LIBRARY): Use m4's patsubst and translit + instead of running sed and tr at runtime. + + * acconfig.h: Add STACK_DIRECTION. + +Wed Apr 14 17:08:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_ALLOCA): If we chose alloca.c, run a test + program to define STACK_DIRECTION. + +Mon Apr 5 19:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_LONG_FILE_NAMES): Put test inside a for loop on + several directories: . /tmp $prefix $exec_prefix. Define + HAVE_LONG_FILE_NAMES iff long names win in all those directories. + +Sun Apr 4 18:38:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in (%.info): Removed pattern rule. + (autoconf.info, standards.info): New rules. + + * autoconf.sh (version_only): New variable, set nonempty for + `autoconf --version' with no input file. + (output writing): No output if $version_only is set. + +Wed Mar 31 17:33:57 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_CONST): Uncomment and fix second AIX test. + +Wed Mar 31 16:58:12 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Rewrite first AIX XL C 1.02.0.0 test. + Comment out bogosity in second AIX test. + +Wed Mar 31 12:45:59 1993 Jim Meyering (meyering@comco.com) + + * acgeneral.m4 (AC_DEFINE): Put single quotes around definition + that is echoed with --verbose. AC_DEFINE(MVDIR, "$(libdir)/mvdir") + was generating losing code. + +Mon Mar 29 15:44:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STDC_HEADERS): Add a missing pair of [quotes]. + +Mon Mar 29 14:54:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_DECLARE_YYTEXT): Change sed regexp so it won't + match other identifiers beginning with `yytext'. + +Sat Mar 27 00:11:16 1993 Paul Eggert (eggert@twinsun.com) + + * acspecific.m4 (AC_CONST): Detect broken AIX XL C 1.2.0.0 compiler. + +Thu Mar 25 19:54:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Remove single quotes from the C + program; they produce shell syntax errors. + + * acgeneral.m4 (AC_DEFINE): Add a newline after "}" to prevent + commands following on the same line of configure.in from + generating shell syntax errors. + + * acgeneral.m4 (AC_COMPILE_CHECK): Use explicit return types + to avoid warnings. + (AC_TEST_CPP): Add parens to force redirection order. + (AC_OUTPUT): Allow hostname to return bogus exit status. + From Jean-loup Gailly . + +Mon Mar 22 16:53:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoconf.sh: Use $M4, not m4 explicitly. + (M4): If unset in env, initialize to @m4@. + * autoheader.sh: Likewise. + * Makefile.in (M4): Define new variable. + (autoconf.conf, %.conf): Use it. + (editsh): New variable: sed command to replace @datadir@; also + replace @M4@ with $(M4). + (autoconf, autoheader): Use $(editsh) instead of explicit sed command. + +Mon Mar 22 13:08:10 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_CONST): IBM's /bin/cc under AIX-3.2 on an rs6000 + rejects attempts to modify *any* member of a struct that has a + member declared like `const int *ap[2]'. + +Wed Mar 17 18:08:30 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoconf.sh, autoheader.sh (MACRODIR): Variable renamed to + AC_MACRODIR. Don't initialize it at runtime if it is already set + in the environment. + (MACROFILES): Don't set until after options are processed. + (print_version): New temp variable. + + * autoconf.sh, autoheader.sh: Rewrote argument parsing. + Added `-m', `--macrodir', `-h', `--help', and `--' options. + Updated usage string. + + * autoconf.texi: Documented --macrodir option and its effects for + both scripts. + +Tue Mar 16 09:10:48 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_CONST): Sun's SC1.0 ANSI compiler (acc) won't + increment a `const int *' pointer declared through a typedef. + +Mon Mar 15 16:08:42 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Grok `--verbose' flag; set verbose=yes. + (AC_DEFINE): Only echo "defining $1" if $verbose is set. + +Sun Mar 14 18:19:21 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Choose `installbsd' if we find + it, in preference to `install'. + + * acspecific.m4 (AC_CONST): Add a check for `const int *foo' not + allowing modification of FOO (not *FOO). + +Fri Mar 12 15:27:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT_HEADER): Remove conftest.sh before + creating it. + +Thu Mar 11 12:57:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE): Surround defn with { and }. + + * acgeneral.m4 (AC_OUTPUT_HEADER): Split up $SEDDEFS into smaller + chunks, since some shells can't handle large here documents. + We write several commands in config.status to create conftest.sed + in pieces. + +Mon Mar 8 14:40:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_WITH): Don't echo anything. + Use the m4 patsubst fn instead of a run-time sed invocation to + massage $1. + + * acspecific.m4 (AC_DIR_HEADER_CHECK): #include + before the header we are testing. + + * acgeneral.m4 (AC_DEFINE): If $2 is empty, echo "defining $1 to be + empty", rather than "defining $1 to be ". + + * acspecific.m4 (AC_DIR_HEADER_CHECK): New; subr of AC_DIR_HEADER. + (AC_DIR_HEADER): Use it to test for each possible header file. + +Tue Mar 2 01:06:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * autoheader.sh: Don't use /p1/,/p2/ construct with sed---it's not + portable. Handle broken AIX sed that strips \n from hold space + when it shouldn't. From Jun Hamano . + +Tue Mar 02 00:08:39 1993 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_CONST): Fix typo that caused spurious lossage + with /bin/cc from Irix-4. From Karl Berry. + +Fri Feb 26 17:14:58 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Add bizarre case that loses on SCO 3.2v4. + +Mon Feb 22 13:02:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_QUOTE_HERE, AC_QUOTE_SED): Change the quote + chars to { and } instead of nothing. Then use {} (empty quotes) to + separate the patsubst forms from the following dnl. Otherwise the + result of patsubst is pasted together with dnl and the result is + seen as a single token. + + * acspecific.m4 (AC_MINUS_C_MINUS_O): Print msg saying what we are + doing before we do it. + + * acgeneral.m4 (AC_PREFIX): Print out the choice made. + (AC_DEFINE): Print out the definition being done. + + * acgeneral.m4 (AC_DEFINE_QUOTE): Add dnl at end of line. + + * acspecific.m4 (AC_GETLOADAVG): Do changequote around listing of + /dev/kmem and sed frobbing which needs to use [ and ]. + +Sun Feb 21 13:57:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh: Use brackets in tr range args. + + * acspecific.m4 (AC_SETVBUF_REVERSED): Make the test fail if + setvbuf returns nonzero. + + * acspecific.m4 (AC_GETLOADAVG): If we need to install setgid, + figure out what group owns /dev/kmem, and set KMEM_GROUP to that. + + * acspecific.m4 (AC_MINUS_C_MINUS_O): Test plain `cc' after testing + $CC. We want to make sure both compilers grok -c -o. + +Thu Feb 18 18:05:14 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_QUOTE_{DQUOTE,SQUOTE,HERE,SED}): New macros. + (AC_DEFINE_{QUOTE,SEDQUOTE}): New macros; subrs of AC_DEFINE. + (AC_DEFINE): Use them to quote $2. + +Wed Feb 17 14:49:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_TIMEZONE): Fixed quoting in tzname check. + changequote inside quotes lost. + +Mon Feb 8 14:22:11 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acconfig.h (_ALL_SOURCE): Use #ifndef; AIX compiler way too dumb. + +Sun Jan 31 16:39:46 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_TIMEZONE): Put newlines before `#include ...' + in $defs value. + +Thu Jan 28 18:06:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acconfig.h (_ALL_SOURCE): Use "!defined (_ALL_SOURCE) || + _ALL_SOURCE == 0" rather than "!_ALL_SOURCE", which bombs on the + AIX compiler. + +Mon Jan 25 12:09:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acconfig.h (HAVE_UNION_WAIT, SYS_SIGLIST_DECLARED): New #undef's. + + * acconfig.h (_ALL_SOURCE): Surround with #if !_ALL_SOURCE. + +Fri Jan 22 15:08:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): If /usr/local/lib/libgetloadavg.a + exists, add -L/usr/local/lib to LDFLAGS. + +Fri Jan 22 12:49:11 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT_HEADER): Only comment out the #undef NAME + part of the line, to avoid causing errors from existing comments. + +Thu Jan 21 14:50:20 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_HAVE_LIBRARY): Use $libname in "checking for" + message, not $1, to avoid "checking for -l-lfoo". + + * acgeneral.m4 (AC_PREPARE): In compile defn, include $CFLAGS. + + * acgeneral.m4 (AC_OUTPUT): Broke AC_CONFIG_NAME writing out into: + (AC_OUTPUT_HEADER): New macro broken out of AC_OUTPUT. + Add to conftest.sed a new sed command to turn #undef's into comments. + + * acgeneral.m4 (AC_OUTPUT): Use new shell variable, $maxsedlines, + for max number of lines to feed to one sed invocation. + Lower this limit to 20; UTekV 3.2e can't cope with 40. + +Tue Jan 19 13:21:02 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * Version 1.3. + +Fri Jan 15 16:28:18 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_CONFIG_HEADER, AC_HEADER_EGREP, + AC_TEST_PROGRAM): Make DEFS always contain -D commands, + not C code. + +Thu Jan 14 17:05:17 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm; don't assume it. + +Thu Jan 14 16:46:41 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (selecting $syms from $TEMPLATES): Use sed to + replace lines containing only blanks with empty lines. + +Thu Jan 14 15:15:31 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_MODE_T): New macro. + + * acgeneral.m4 (AC_OUTPUT): Check for grep -c returning + nothing (AIX 3.1) as well as returning 0. + +Wed Jan 13 16:05:59 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_FUNC_CHECK): Add missing #endif. + + * acgeneral.m4 (AC_OUTPUT): Use sed, not basename. + From Francois Pinard. + +Wed Jan 13 15:49:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Set exec_prefix to ${prefix}, not + $(prefix); it now works in both makefiles and shell scripts. + +Wed Jan 13 15:29:04 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * autoheader.sh: If input is empty, don't print all of + acconfig.h. From Francois Pinard. + + * acgeneral.m4 (AC_OUTPUT): Have config.status check all of its + args for validity. + +Tue Jan 12 11:11:45 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Preserve whitespace around = in prefix + and exec_prefix assignments. + + * acspecific.m4 (AC_GETLOADAVG): Values for getloadavg_missing were + reversed. + +Fri Jan 8 18:45:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Make config.status not complain with + usage msg when given no args. + + * acgeneral.m4 (AC_HAVE_LIBRARY): Say "checking for -lfoo", not + just "checking for foo". + + * acgeneral.m4 (AC_HAVE_LIBRARY): Remove excess quoting around $2 + and $3. + + * acspecific.m4 (AC_GETLOADAVG): Check for getloadavg library, both + a normally installed one, and one in /usr/local/lib. + After figuring out params for getloadavg.c, figure out whether it + defined LDAV_PRIVILEGED, and if so, set NEED_SETGID to true, and + define GETLOADAVG_PRIVILEGED. + * acconfig.h: Added GETLOADAVG_PRIVILEGED. + +Fri Jan 8 16:16:35 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE, AC_OUTPUT): Restore the third sed string. + + * acgeneral.m4 (AC_FUNC_CHECK): Use __stub_funcname. + + * autoheader.sh: Use Autoconf version number. + + * acgeneral.m4 (AC_OUTPUT): Diagnose usage errors for + config.status. Use grep -c to count nonempty lines instead of + test -s. + + * acspecific.m4 (AC_GETLOADAVG): Use AC_HAVE_LIBRARY. + +Wed Jan 6 19:54:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * autoheader.sh (coverage check): Use $TEMPLATES in error msg, not + hard-wired "config.h". + +Wed Jan 6 18:24:41 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): If AC_CONFIG_NAME, change + @DEFS@ to -DHAVE_CONFIG_H in Makefiles etc. Idea from Roland McGrath. + + * acgeneral.m4 (AC_FUNC_CHECK): If __STUB_funcname is defined, + assume the function isn't present. + + * acgeneral.m4 (AC_OUTPUT): Make no args to AC_OUTPUT work + again. From Ian Lance Taylor. + + * acspecific.m4 (AC_CONST): Fix quoting problem. + + * acconfig.h [const]: New addition. + +Thu Dec 31 17:56:18 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_HAVE_LIBRARY): New macro from Noah Friedman. + + * acconfig.h: Renamed from config.h. + + * autoheader.sh: Renamed from autohead.sh. + Support a local acconfig.h. + Use \\012 instead of \\n for tr for portability. + +Thu Dec 31 12:30:34 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * config.h: Added #undef vfork. + +Tue Dec 29 14:26:43 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_COMPILE_CHECK): Use cat rather than echo to + create conftest.c, to avoid " problems. + +Fri Dec 25 15:07:06 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Don't define HAVE_CONST. + + * acgeneral.m4 (AC_OUTPUT, AC_DEFINE): Combine the two sed + commands for #undef lines. + * acgeneral.m4 (AC_PROGRAM_EGREP, AC_TEST_PROGRAM, + AC_TEST_CPP, AC_OUTPUT), acspecific.m4 (AC_PROG_CC): Put > + before << when using both, to avoid HP-UX sh bug. + +Wed Dec 23 20:47:53 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Use if, not &&, for --with. + From Jan Brittenson. + +Mon Dec 21 17:13:57 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Use sed instead of head and tail. + Trap to remove the temp files. + + * acgeneral.m4 (AC_OUTPUT): Quote DEFS assignment. + From Ian Lance Taylor. + +Mon Dec 21 14:27:44 1992 Jim Meyering (meyering@comco.com) + + * acspecific.m4 (AC_STDC_HEADERS): Make sure ctype.h macros + are ANSI. Nest tests so we don't need shell temporary variable. + +Sun Dec 20 18:12:33 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) + + * Makefile.in (%.h: %.in): New rule using autohead. + (all): Do autohead. + (install): Install autohead and config.h. + (autohead): New rule. + (DISTFILES): Added autohead.sh. + * autohead: New script. + +Fri Dec 18 00:21:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_HAVE_FUNCS, AC_HAVE_HEADERS): Change method + of tr quoting to keep old shells happy. From Ian Lance Taylor. + + * acgeneral.m4 (AC_DEFINE): Add to SEDDEFS. + (AC_OUTPUT): Use sed instead of awk. + From Ian Lance Taylor. + +Mon Dec 14 14:33:29 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STDC_HEADERS): Check for string.h + declaring memchr. + + * acgeneral.m4 (AC_NOTICE): Fix comment. + +Fri Dec 11 17:59:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * acspecific.m4 (AC_ALLOCA): Don't use libPW; it causes too + much trouble. + +Wed Dec 9 14:04:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * config.h: Added HAVE_SYS_WAIT, HAVE_WAITPID, SVR4, UMAX, + [ugp]id_t, UMAX4_3, DGUX. + +Thu Dec 3 13:37:17 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_INSTALL): Ignore AFS install. + From James Clark, jjc@jclark.com. + +Tue Nov 24 07:47:45 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_LEX, AC_DECLARE_YYTEXT, AC_VFORK, AC_WAIT3, + AC_INT_16_BITS, AC_WORDS_BIGENDIAN, AC_ARG_ARRAY): End with a newline. + + * acspecific.m4 (AC_DIR_HEADER): If ndir.h exists and the other + choices don't, define NDIR. + +Sat Nov 21 00:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_RETSIGTYPE): Instead of grepping for the signal + declaration, try redeclaring it and see if we get an error. + Always define RETSIGTYPE, not just if it's int. + From Ian Lance Taylor. + +Fri Nov 20 17:06:09 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE): Only put -D option in quotes if it + actually contains blanks. + +Thu Nov 19 17:18:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): Set a shell var for --with-*. + (AC_WITH): New macro. + + * acspecific.m4 (AC_CONST): If const works, define HAVE_CONST. + + * acspecific.m4 (AC_ALLOCA): Don't use libPW on HP-UX. + +Wed Nov 18 17:36:08 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_DEFINE): When writing a -D with a value, + surround it with 's so the value can contain spaces. + +Thu Nov 12 22:49:35 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_PROG_CC): Don't add -O to CC if GNU C. + (-O2, or nothing, might be more appropriate.) + +Sun Nov 8 23:33:23 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * acspecific.m4 (AC_GETLOADAVG): Check for dwarf.h for general + svr4, then elf.h for Solaris 2, which needs additional libraries. + +Thu Nov 12 22:18:54 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS): --exec_prefix -> --exec-prefix. + +Tue Nov 10 16:15:10 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4: undef m4 `include' builtin. + + * acspecific.m4 (AC_STDC_HEADERS): Don't test for limits.h + due to Ultrix conflict with float.h. + +Thu Oct 29 16:16:11 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_PARSEARGS, AC_PREPARE): New macros, broken out + parts of AC_INIT. + (AC_INIT): Use them. + +Thu Oct 22 20:48:12 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_INSTALL): Comment out arg to `:'. + AIX doesn't like it. + +Wed Oct 14 12:41:02 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Version 1.2. + + * acspecific.m4 (AC_INSTALL): Avoid the AIX install script. + + * acspecific.m4 (AC_RESTARTABLE_SYSCALLS): Wait for child if + sys calls are not restarted, to avoid leaving the child still + running. From Ian Lance Taylor. + +Tue Oct 13 15:43:56 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acspecific.m4 (AC_CONST): Add more tests for brokenness. + From Jim Meyering. + + * acgeneral.m4: Use % instead of ? to avoid shell variable expansion. + +Fri Oct 2 06:55:05 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * acgeneral.m4: Use ? instead of , to separate parts of sed arg. + +Mon Sep 14 12:33:41 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STDC_HEADERS): Also check for float.h. + + * acspecific.m4 (AC_TIMEZONE): Protect [] from being quotes. + +Thu Sep 10 17:12:10 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_OUTPUT): Include the hostname in config.status. + + * acgeneral.m4 (AC_OUTPUT): Use a separate flag in the awk + script instead of checking for non-empty values, so things + like defining const as empty work. From + Steve Emmerson . + +Fri Aug 28 18:51:13 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_INIT): If there's no path on $0, use '.'. + +Thu Aug 27 16:15:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * config.h: New file. + + * acgeneral.m4 (AC_INIT): Look for source files in the + directory containing `configure', if not given explicitly. + + * acspecific.m4 (AC_TIMEZONE): Adjust tzname decl for RS6000. + + * acspecific.m4 (AC_GETLOADAVG): Don't use double quotes in + the test program. + +Thu Aug 27 15:26:49 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): Don't check nlist.h if we found + one of specific things. + +Mon Aug 24 16:22:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 1.1. + + * acspecific.m4 (AC_TIMEZONE): Include time.h. Don't + declare tzname if it's a macro. From Jim Meyering. + +Fri Aug 21 14:12:35 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acspecific.m4 (AC_ALLOCA): Check whether the alloca defined by + alloca.h works when given a non-constant argument. + + * acspecific.m4 (AC_GETLOADAVG): Define NLIST_STRUCT and + NLIST_NAME_UNION if appropriate. + + * acgeneral.m4 (AC_OUTPUT): If no args are given, omit the loop to + produce output files. + + * acgeneral.m4 (AC_TEST_PROGRAM): Add a call to exit to try to + suppress core dumped message. From Ian Lance Taylor. + + * acgeneral.m4 (AC_PREFIX): Only print the message if prefix + hasn't been set. From James Clark. + + * acspecific.m4 (AC_SIZE_T, AC_UID_T, AC_PID_T, + AC_RETSIGTYPE): Print a message saying what it's checking for. + (AC_SIZE_T): Define size_t to be unsigned, not int, for + ANSI-friendliness. + + * acspecific.m4 (AC_GETLOADAVG): Just check for elf.h, not + dwarf.h too. + + * autoconf.sh: Exit with status 1 if there are unresolved macros. + Isolate the pattern to make adding other prefixes easy. + Look for aclocal.m4 in . as well as MACRODIR. + +Tue Aug 18 16:35:46 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_STRCOLL): New macro. + +Tue Aug 18 15:22:45 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * acspecific.m4 (AC_GETLOADAVG): elf.h implies SVR4. + +Mon Jul 27 14:20:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_TEST_PROGRAM): Check for cross-compiling + was missing "test -n". From Ian Lance Taylor. + +Sun Jul 26 16:25:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * acgeneral.m4 (AC_SUBST): Support multiple substitutions in a + line. + +Mon Jul 20 01:08:01 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * Version 1.0. diff --git a/src/util/autoconf/INSTALL b/src/util/autoconf/INSTALL index 8a7d026f7..0338fbce2 100644 --- a/src/util/autoconf/INSTALL +++ b/src/util/autoconf/INSTALL @@ -1,146 +1,167 @@ - This is a generic INSTALL file for utilities distributions. -If this package does not come with, e.g., installable documentation or -data files, please ignore the references to them below. +Basic Installation +================== - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation, and -creates the Makefile(s) (one in each subdirectory of the source -directory). In some packages it creates a C header file containing -system-dependent definitions. It also creates a file `config.status' -that you can run in the future to recreate the current configuration. - -To compile this package: - -1. Configure the package for your system. - - Normally, you just `cd' to the directory containing the package's -source code and type `./configure'. If you're using `csh' on an old -version of System V, you might need to type `sh configure' instead to -prevent `csh' from trying to execute `configure' itself. - - Running `configure' takes awhile. While it is running, it -prints some messages that tell what it is doing. If you don't want to -see any messages, run `configure' with its standard output redirected -to `/dev/null'; for example, `./configure >/dev/null'. - - To compile the package in a different directory from the one -containing the source code, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. If -for some reason `configure' is not in the source code directory that -you are configuring, then it will report that it can't find the source -code. In that case, run `configure' with the option `--srcdir=DIR', -where DIR is the directory that contains the source code. - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. Alternately, you can do so by consistently -giving a value for the `prefix' variable when you run `make', e.g., - make prefix=/usr/gnu - make prefix=/usr/gnu install - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH' or set the `make' -variable `exec_prefix' to PATH, the package will use PATH as the prefix -for installing programs and libraries. Data files and documentation -will still use the regular prefix. Normally, all files are installed -using the same prefix. - - Some packages pay attention to `--with-PACKAGE' options to -`configure', where PACKAGE is something like `gnu-as' or `x' (for the -X Window System). They may also pay attention to `--enable-FEATURE' -options, where FEATURE indicates an optional part of the package. The -README should mention any `--with-' and `--enable-' options that the -package recognizes. + These are generic installation instructions. - `configure' also recognizes the following options: - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' - Do not print messages saying which checks are being made. + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. -`--verbose' - Print the results of the checks. + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. +The simplest way to compile this package is: -`--x-includes=DIR' - X include files are in DIR. + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. -`--x-libraries=DIR' - X library files are in DIR. + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. - `configure' also accepts and ignores some other options. + 2. Type `make' to compile the package. - On systems that require unusual options for compilation or linking -that the package's `configure' script does not know about, you can give -`configure' initial values for variables by setting them in the -environment. In Bourne-compatible shells, you can do that on the -command line like this: + 3. Optionally, type `make check' to run any self-tests that come with + the package. - CC='gcc -traditional' LIBS=-lposix ./configure + 4. Type `make install' to install the programs and any data files and + documentation. -On systems that have the `env' program, you can do it like this: + 5. You can remove the program binaries and object files from the + source directory by typing `make clean'. To also remove the files + that `configure' created (so you can compile the package for a + different kind of computer), type `make distclean'. - env CC='gcc -traditional' LIBS=-lposix ./configure +Compilers and Options +===================== - Here are the `make' variables that you might want to override with -environment variables when running `configure'. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - For these variables, any value given in the environment overrides the -value that `configure' would choose: +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - - Variable: CC - C compiler program. The default is `cc'. +Using a Different Build Directory +================================= - - Variable: INSTALL - Program to use to install files. The default is `install' if you - have it, `cp' otherwise. + You can compile the package in a different directory from the one +containing the source code. Doing so allows you to compile it on more +than one kind of computer at the same time. To do this, you must use a +version of `make' that supports the `VPATH' variable, such as GNU +`make'. `cd' to the directory where you want the object files and +executables to go and run the `configure' script. `configure' +automatically checks for the source code in the directory that +`configure' is in and in `..'. - For these variables, any value given in the environment is added to -the value that `configure' chooses: +Installation Names +================== - - Variable: DEFS - Configuration options, in the form `-Dfoo -Dbar...'. Do not use - this variable in packages that create a configuration header file. + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. - - Variable: LIBS - Libraries to link with, in the form `-lfoo -lbar...'. + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. - If you need to do unusual things to compile the package, we encourage -you to figure out how `configure' could check whether to do them, and -mail diffs or instructions to the address given in the README so we -can include them in the next release. + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Save the results of the tests in FILE instead of `config.cache'. + Set FILE to `/dev/null' to disable caching, for debugging + `configure'. -2. Type `make' to compile the package. If you want, you can override -the `make' variables CFLAGS and LDFLAGS like this: +`--help' + Print a summary of the options to `configure', and exit. - make CFLAGS=-O2 LDFLAGS=-s +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. -3. If the package comes with self-tests and you want to run them, -type `make check'. If you're not sure whether there are any, try it; -if `make' responds with something like - make: *** No way to make target `check'. Stop. -then the package does not come with self-tests. +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. -4. Type `make install' to install programs, data files, and -documentation. +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. -5. You can remove the program binaries and object files from the -source directory by typing `make clean'. To also remove the -Makefile(s), the header file containing system-dependent definitions -(if the package uses one), and `config.status' (all the files that -`configure' created), type `make distclean'. +`configure' also accepts some other, not widely useful, options. - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need it if you want to regenerate -`configure' using a newer version of `autoconf'. diff --git a/src/util/autoconf/Makefile.in b/src/util/autoconf/Makefile.in index b63d9c8d8..e7aab1db8 100644 --- a/src/util/autoconf/Makefile.in +++ b/src/util/autoconf/Makefile.in @@ -26,15 +26,22 @@ INSTALL_DATA = @INSTALL_DATA@ MAKEINFO = makeinfo TEXI2DVI = texi2dvi M4 = @M4@ +PERL = @PERL@ -prefix = /usr/local -exec_prefix = $(prefix) +# Programs that are always installed. +ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames +SCRIPTS = $(ASCRIPTS) @SCRIPTS@ + +transform=@program_transform_name@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ # Directory in which to install scripts. bindir = $(exec_prefix)/bin # Directory in which to install library files. -datadir = $(prefix)/lib +datadir = $(prefix)/share acdatadir = $(datadir)/autoconf # Directory in which to install documentation info files. @@ -44,32 +51,54 @@ infodir = $(prefix)/info SHELL = /bin/sh -DISTFILES = README Makefile.in INSTALL NEWS COPYING ChangeLog \ -autoconf.texi acconfig.h autoconf.sh acgeneral.m4 acspecific.m4 \ -configure configure.in autoheader.sh mkinstalldirs install.sh \ -autoconf.info standards.texi make-stds.texi standards.info texinfo.tex +SUBDIRS = testsuite + +M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4 + +# Files that can be generated, but should be up to date for a distribution. +DISTDEP = info Makefile +# Files to distribute. +DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \ + Makefile.in NEWS README TODO $(M4FILES) \ + acconfig.h acfunctions acheaders acidentifiers \ + acmakevars acprograms autoconf.info* \ + autoconf.sh autoconf.texi install.texi \ + autoheader.sh autoscan.pl autoreconf.sh autoupdate.sh ifnames.sh \ + config.guess config.sub configure configure.in \ + install-sh mkinstalldirs texinfo.tex \ + testsuite/Makefile.in testsuite/config/*.exp \ + testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \ + standards.texi make-stds.texi standards.info* editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g' +editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g' -all:: autoconf autoheader +all: ${SCRIPTS} -autoconf: autoconf.sh +.SUFFIXES: +.SUFFIXES: .sh .pl + +.sh: rm -f $@ $@.tmp - $(editsh) $(srcdir)/autoconf.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@ + $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@ -autoheader: autoheader.sh +.pl: rm -f $@ $@.tmp - $(editsh) $(srcdir)/autoheader.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@ + $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@ + +info: autoconf.info @standards_info@ INSTALL -info: autoconf.info standards.info +autoconf.info: autoconf.texi install.texi + $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --output=$@ -autoconf.info: autoconf.texi - $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --no-split --output=$@ +INSTALL: install.texi + $(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \ + --no-headers --no-validate standards.info: standards.texi make-stds.texi - $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --no-split --output=$@ + $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --output=$@ -dvi: autoconf.dvi standards.dvi +dvi: autoconf.dvi @standards_dvi@ autoconf.dvi: autoconf.texi $(TEXI2DVI) $(srcdir)/autoconf.texi @@ -77,67 +106,102 @@ autoconf.dvi: autoconf.texi standards.dvi: standards.texi make-stds.texi $(TEXI2DVI) $(srcdir)/standards.texi -check:: +check: all + rootme=`pwd`; srcrootme=`cd $(srcdir); pwd`; \ + test -r install-sh || cp $(srcdir)/install-sh .; \ + cd testsuite && ${MAKE} $@ AUTOCONF=$$rootme/autoconf \ + AUTOCONFFLAGS="-m $$srcrootme" -installcheck: +installcheck: all install + cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@ installdirs: $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir) -# References to install-info have been removed until it's released. -install: all acgeneral.m4 acspecific.m4 acconfig.h installdirs install-info - $(INSTALL_PROGRAM) autoconf $(bindir)/autoconf - $(INSTALL_PROGRAM) autoheader $(bindir)/autoheader - $(INSTALL_DATA) $(srcdir)/acgeneral.m4 $(acdatadir)/acgeneral.m4 - $(INSTALL_DATA) $(srcdir)/acspecific.m4 $(acdatadir)/acspecific.m4 - $(INSTALL_DATA) $(srcdir)/acconfig.h $(acdatadir)/acconfig.h +install: all $(M4FILES) acconfig.h installdirs install-info + @case `$(M4) --help < /dev/null 2>&1` in \ + *reload-state*) echo installing frozen m4 files; \ + $(M4) -F $(acdatadir)/autoconf.m4f -I${srcdir} ${srcdir}/autoconf.m4 ; \ + $(M4) -F $(acdatadir)/autoheader.m4f -I${srcdir} ${srcdir}/autoheader.m4 ;; \ + *traditional*) ;; \ + *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ + esac + for p in $(ASCRIPTS); do \ + $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + done + for i in $(M4FILES) acconfig.h; do \ + $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \ + done + -if test -f autoscan; then \ + $(INSTALL_PROGRAM) autoscan $(bindir)/`echo autoscan|sed '$(transform)'`; \ + for i in acfunctions acheaders acidentifiers acprograms \ + acmakevars; do \ + $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \ + done; \ + else :; fi install-info: info installdirs - -if test -f autoconf.info; then d=.; else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/autoconf.info $(infodir)/autoconf.info - -if test -f standards.info; then d=.; else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/standards.info $(infodir)/standards.info + -test -f autoconf.info || cd $(srcdir); \ + for i in autoconf.info*; do \ + $(INSTALL_DATA) $$i $(infodir)/$$i; \ + done + -test -f standards.info || cd $(srcdir); \ + for i in standards.info*; do \ + $(INSTALL_DATA) $$i $(infodir)/$$i; \ + done uninstall: - rm -f $(bindir)/autoconf $(bindir)/autoheader - cd $(acdatadir); rm -f acgeneral.m4 acspecific.m4 aclocal.m4 acconfig.h - -rmdir $(acdatadir) - cd $(infodir); rm -f autoconf.info standards.info + for p in $(SCRIPTS); do \ + rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ + done + rm -fr $(acdatadir) + cd $(infodir); rm -f autoconf.info* + if test -f standards.info || test -f $(srcdir)/standards.info; \ + then cd $(infodir); rm -f standards.info*; fi -configure: configure.in acgeneral.m4 acspecific.m4 +${srcdir}/configure: configure.in $(M4FILES) cd $(srcdir); \ rm -f $@ $@.tmp; \ - $(M4) acgeneral.m4 acspecific.m4 configure.in > $@.tmp && \ - mv $@.tmp $@ && \ - chmod +x $@ + $(M4) autoconf.m4 configure.in > $@.tmp && \ + chmod +x $@.tmp && mv $@.tmp $@ Makefile: Makefile.in config.status ./config.status config.status: configure ./config.status --recheck -clean:: - rm -f autoconf autoheader *.tmp - rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log - rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs *.ma *.mas +clean mostlyclean distclean realclean:: + for dir in $(SUBDIRS); do \ + echo making $@ in $$dir ; \ + (cd $$dir; $(MAKE) $@) ; \ + done -mostlyclean: clean +clean mostlyclean distclean realclean:: + rm -f $(SCRIPTS) *.tmp + rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log + rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs + rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas -distclean: clean - rm -f Makefile config.status +distclean realclean:: + rm -f Makefile config.status config.cache config.log -realclean: distclean - rm -f TAGS *.info* +realclean:: + rm -f TAGS *.info* INSTALL TAGS: etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi -dist: Makefile $(DISTFILES) - echo autoconf-`sed -e '/define(AC_ACVERSION,/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q acgeneral.m4` > .fname - rm -rf `cat .fname` - mkdir `cat .fname` +# Don't depend on DISTFILES because there's no rule for "standards.info*". +dist: $(DISTDEP) + distname=`sed -e '/define(AC_ACVERSION,/!d' \ + -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \ + rm -fr $$distname; \ + mkdir $$distname $$distname/testsuite $$distname/testsuite/config \ + $$distname/testsuite/lib $$distname/testsuite/autoconf.g \ + $$distname/testsuite/autoconf.s; \ for file in $(DISTFILES); do \ - ln $$file `cat .fname` \ - || { echo copying $$file instead; cp -p $$file `cat .fname`; }; \ - done - tar --gzip -chf `cat .fname`.tar.gz `cat .fname` - rm -rf `cat .fname` .fname + ln $$file $$distname/$$file \ + || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \ + done; \ + chmod -R a+rX $$distname; \ + tar -chz -f $$distname.tar.gz $$distname; \ + rm -fr $$distname diff --git a/src/util/autoconf/NEWS b/src/util/autoconf/NEWS index 982a81f92..eaab94303 100644 --- a/src/util/autoconf/NEWS +++ b/src/util/autoconf/NEWS @@ -1,3 +1,113 @@ +Thanks to everybody who's submitted changes and additions to Autoconf! +I've incorporated many of them, and am still considering others for +future releases -- but I didn't want to postpone this release indefinitely. + +Caution: don't indiscriminantly rebuild configure scripts with +Autoconf version 2. Some configure.in files need minor adjustments to +work with it; the documentation has a chapter on upgrading. A few +configure.in files, including those for GNU Emacs and the GNU C +Library, need major changes because they relied on undocumented +internals of version 1. Future releases of those packages will have +updated configure.in files. + +It's best to use GNU m4 1.3 (or later) with Autoconf version 2. +Autoconf now makes heavy use of m4 diversions, which were implemented +inefficiently in GNU m4 releases before 1.3. + +Major changes in release 2.0: + +** New copyright terms: +* There are no restrictions on distribution or use of configure scripts. + +** Documentation: +* Autoconf manual is reorganized to make information easier to find + and has several new indexes. +* INSTALL is reorganized and clearer and is now made from Texinfo source. + +** New utilities: +* autoscan to generate a preliminary configure.in for a package by + scanning its source code for commonly used nonportable functions, + programs, and header files. +* autoupdate to update a configure.in to use the new macro names. +* ifnames to list the symbols used in #if and #ifdef directives in a + source tree. +* autoreconf to recursively remake configure and configuration header + files in a source tree. + +** Changed utilities: +* autoheader can take pieces of acconfig.h to replace config.h.{top,bot}. +* autoconf and autoheader can look for package-local definition files + in an alternate directory. + +** New macros: +* AC_CACHE_VAL to share results of tests between configure runs. +* AC_DEFUN to define macros, automatically AC_PROVIDE them, and ensure + that macros invoked with AC_REQUIRE don't interrupt other macros. +* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_CANONICAL_HOST, AC_LINK_FILES to + support deciding unguessable features based on the host and target types. +* AC_CONFIG_SUBDIRS to recursively configure a source tree. +* AC_ARG_PROGRAM to use the options --program-prefix, + --program-suffix, and --program-transform-name to change the names + of programs being installed. +* AC_PREFIX_DEFAULT to change the default prefix. +* AC_TRY_COMPILE to compile a test program without linking it. +* AC_CHECK_TYPE to check whether sys/types.h defines a given type. +* AC_CHECK_LIB to check for a particular function in a library. +* AC_MSG_CHECKING and AC_MSG_RESULT to print test results, on a single line, + whether or not the test succeeds. They obsolete AC_CHECKING and AC_VERBOSE. +* AC_SUBST_FILE to insert one file into another. +* AC_FUNC_MEMCMP to check whether memcmp is 8-bit clean. +* AC_FUNC_STRFTIME to find strftime even if it's in -lintl. +* AC_FUNC_GETMNTENT to find getmntent even if it's in -lsun or -lseq. +* AC_HEADER_SYS_WAIT to check whether sys/wait.h is POSIX.1 compatible. + +** Changed macros: +* Many macros renamed systematically, but old names are accepted for + backward compatibility. +* AC_OUTPUT adds the "automatically generated" comment to + non-Makefiles where it finds @configure_input@ in an input file, to + support files with various comment syntaxes. +* AC_OUTPUT does not replace "prefix" and "exec_prefix" in generated + files when they are not enclosed in @ signs. +* AC_OUTPUT allows the optional environment variable CONFIG_STATUS to + override the file name "config.status". +* AC_OUTPUT takes an optional argument for passing variables from + configure to config.status. +* AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names. +* AC_OUTPUT automatically substitutes the values of CFLAGS, CXXFLAGS, + CPPFLAGS, and LDFLAGS from the environment. +* AC_PROG_CC and AC_PROG_CXX now set CFLAGS and CXXFLAGS, respectively. +* AC_PROG_INSTALL looks for install-sh or install.sh in the directory + specified by AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or + srcdir/../.. by default. +* AC_DEFINE, AC_DEFINE_UNQUOTED, and AC_SUBST are more robust and smaller. +* AC_DEFINE no longer prints anything, because of the new result reporting + mechanism (AC_MSG_CHECKING and AC_MSG_RESULT). +* AC_ARG_ENABLE and AC_ARG_WITH support whitespace in the arguments to + --enable- and --with- options. +* AC_VERBOSE pays attention to --quiet/--silent, not --verbose. +* AC_CHECK_FUNCS and AC_CHECK_HEADERS take optional shell commands to + execute on success or failure. +* Checking for C functions in C++ works. + +** Removed macros: +* AC_REMOTE_TAPE and AC_RSH removed; too specific to tar and cpio, and + better maintained with them. +* AC_ARG_ARRAY removed because no one was likely using it. +* AC_HAVE_POUNDBANG replaced with AC_SYS_INTERPRETER, which doesn't + take arguments, for consistency with all of the other specific checks. + +** New files: +* Comes with config.sub and config.guess, and uses them optionally. +* Uses config.cache to cache test results. An alternate cache file + can be selected with the --cache-file=FILE option. +* Uses optional shell scripts $prefix/share/config.site and + $prefix/etc/config.site to perform site or system specific initializations. +* configure saves compiler output to ./config.log for debugging. +* New files autoconf.m4 and autoheader.m4 load the other Autoconf macros. +* acsite.m4 is the new name for the system-wide aclocal.m4. +* Has the beginnings of a DejaGnu test suite. + Major changes in release 1.11: * AC_PROG_INSTALL calls install.sh with the -c option. @@ -10,8 +120,8 @@ Plus a few other bug fixes. Major changes in release 1.10: * autoheader uses config.h.bot if present, analogous to config.h.top. -* AC_PROG_INSTALL looks for install.sh in srcdir or srcdir/.. or - srcdir/../.. and never uses cp. +* AC_PROG_INSTALL looks for install.sh in srcdir or srcdir/.. and + never uses cp. * AC_PROG_CXX looks for cxx as a C++ compiler. Plus several bugs fixed. diff --git a/src/util/autoconf/README b/src/util/autoconf/README index 2cc58e295..959b195e0 100644 --- a/src/util/autoconf/README +++ b/src/util/autoconf/README @@ -1,4 +1,4 @@ -Autoconf -- generate automatic software configuration scripts from templates +Autoconf Autoconf is an extensible package of m4 macros that produce shell scripts to automatically configure software source code packages. @@ -8,9 +8,17 @@ configuration script for a package from a template file that lists the operating system features that the package can use, in the form of m4 macro calls. -Autoconf requires GNU m4. The configuration scripts produced by -Autoconf are independent of Autoconf when they are run, so their users -do not need to have Autoconf (or GNU m4). +Producing configuration scripts using Autoconf requires GNU m4. You +must install GNU m4 (version 1.1 or later, preferably 1.3 or later +for better performance) before configuring Autoconf, so that +Autoconf's configure script can find it. The configuration scripts +produced by Autoconf are self-contained, so their users do not need to +have Autoconf (or GNU m4). + +Also, some optional utilities that come with Autoconf use Perl, TCL, +and the TCL packages Expect and DejaGNU. However, none of those +are required in order to use the main Autoconf program. If they are +not present, the affected Autoconf utilities will not be installed. The file INSTALL can be distributed with packages that use Autoconf-generated configure scripts and Makefiles that conform to the @@ -22,7 +30,7 @@ to maintain many similar sets of installation instructions. The file `acconfig.h' contains short descriptions of the C preprocessor variables that Autoconf can define, suitable for copying into other packages' configuration headers or Makefile.in files. You can use the -program `autoheader' to automatically creates a configuration header +program `autoheader' to automatically create a configuration header from a `configure.in', based on the information in `acconfig.h'. Mail suggestions and bug reports for Autoconf to diff --git a/src/util/autoconf/TODO b/src/util/autoconf/TODO new file mode 100644 index 000000000..89c32295d --- /dev/null +++ b/src/util/autoconf/TODO @@ -0,0 +1,102 @@ +-*- outline -*- + +Things it might be nice to do someday: + +------------------------------------------------------------------------------ + +* Make AC_CHECK_LIB check whether the function is already available + before checking for the library. This might involve adding another + kind of cache variable to indicate whether a given function needs a + given library. The current ac_cv_func_ variables are intended to + indicate whether the function is in the default libraries, but + actually also take into account whatever value LIBS had when they + were checked for. + +------------------------------------------------------------------------------ + +* Add AC_PROG_CC_POSIX to replace the current ad-hoc macros for AIX, + Minix, ISC, etc. + +------------------------------------------------------------------------------ + +* Use AC_EGREP_CPP instead of AC_TRY_LINK to detect structures and members. + +------------------------------------------------------------------------------ + +* Make AC_CHECK_FUNC[S] automatically use any particular macros for the + listed functions. + +------------------------------------------------------------------------------ + +* Support creating both config.h and DEFS in the same configure. + +------------------------------------------------------------------------------ + +* Select the right CONFIG_SHELL automatically (for Ultrix, Lynx especially.) + +------------------------------------------------------------------------------ + +* Doc: Add concept index. + +------------------------------------------------------------------------------ + +* Doc: Centralize information on POSIX, MS-DOS, cross-compiling, and + other important topics. + +------------------------------------------------------------------------------ + +* Split up AC_SUBST substitutions using a loop to accomodate shells + with severely limited here document sizes, if it turns out to be a problem. + I'm not sure whether the limit is on lines or bytes; if bytes, it + will be less of a problem than it was with the long lines used for + creating a header file. + There has also been a report that HPUX and OSF/1 seds only allow 100 + commands. + +------------------------------------------------------------------------------ + +* Allow [ and ] in egrep patterns and AC_DEFINE args. + +------------------------------------------------------------------------------ + +* Add a Makefile generator that supports the standard GNU targets. + (Being worked on.) + +------------------------------------------------------------------------------ + +* Mike Haertel's suggestions: + +** Provide files containing decls for alloca, strings, etc. + +** Cross compiling: + +*** Error messages include instructions for overriding defaults using +config.site. + +*** Distribute a config.site corresponding to a hypothetical bare POSIX system with c89. + +*** Cache consistency checking: ignore cache if environment +(CC or PATH) differs. + +** Site defaults: + +*** Convention for consistency checking of env vars and options in config.site so config.site can print obnoxious messages if it doesn't like options or env vars that users use. + +------------------------------------------------------------------------------ + +* autoscan: Tell the files that caused inclusion of each macro, +in a dnl comment. (Seems to be hard.) + +------------------------------------------------------------------------------ + +* Look at user contributed macros: prototypes, IEEE double precision math, +shared libraries, various other things. + +------------------------------------------------------------------------------ + +* Test suite: more things to test: +** That the shell scripts produce correct output on some simple data. +** Configuration header files. That autoheader does the right thing, + and so does AC_CONFIG_HEADER when autoconf is run. + +------------------------------------------------------------------------------ diff --git a/src/util/autoconf/acconfig.h b/src/util/autoconf/acconfig.h index 97e976fa8..801a8ac8b 100644 --- a/src/util/autoconf/acconfig.h +++ b/src/util/autoconf/acconfig.h @@ -27,6 +27,9 @@ /* Define if type char is unsigned and you are not using gcc. */ #undef __CHAR_UNSIGNED__ +/* Define if the closedir function returns void instead of int. */ +#undef CLOSEDIR_VOID + /* Define to empty if the keyword does not work. */ #undef const @@ -37,7 +40,7 @@ /* Define for DGUX with . */ #undef DGUX -/* Define if you have dirent.h. */ +/* Define if you have . */ #undef DIRENT /* Define to the type of elements in the array set by `getgroups'. @@ -50,7 +53,10 @@ /* Define to `int' if doesn't define. */ #undef gid_t -/* Define if you have alloca.h and it should be used (not Ultrix). */ +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if you don't have vprintf but do have _doprnt. */ @@ -59,6 +65,9 @@ /* Define if your system has its own `getloadavg' function. */ #undef HAVE_GETLOADAVG +/* Define if you have the getmntent function. */ +#undef HAVE_GETMNTENT + /* Define if the `long double' type works. */ #undef HAVE_LONG_DOUBLE @@ -68,9 +77,6 @@ /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP -/* Define if you have netdb.h (and thus the rexec function). */ -#undef HAVE_NETDB_H - /* Define if system calls automatically restart after interruption by a signal. */ #undef HAVE_RESTARTABLE_SYSCALLS @@ -87,11 +93,11 @@ /* Define if your struct stat has st_rdev. */ #undef HAVE_ST_RDEV -/* Define if you have sys/mtio.h. */ -#undef HAVE_SYS_MTIO_H +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME -/* Define if you have a with `union wait'. */ -#undef HAVE_SYS_WAIT +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H /* Define if your struct tm has tm_zone. */ #undef HAVE_TM_ZONE @@ -100,16 +106,13 @@ tzname. */ #undef HAVE_TZNAME -/* Define if `union wait' is the type of the first arg to wait functions. */ -#undef HAVE_UNION_WAIT - -/* Define if you have unistd.h. */ +/* Define if you have . */ #undef HAVE_UNISTD_H /* Define if utime(file, NULL) sets file's timestamp to the present. */ #undef HAVE_UTIME_NULL -/* Define if you have vfork.h. */ +/* Define if you have . */ #undef HAVE_VFORK_H /* Define if you have the vprintf function. */ @@ -118,9 +121,6 @@ /* Define if you have the wait3 system call. */ #undef HAVE_WAIT3 -/* Define if you have the POSIX.1 `waitpid' function. */ -#undef HAVE_WAITPID - /* Define as __inline if that's what the C compiler calls it. */ #undef inline @@ -130,10 +130,10 @@ /* Define if long int is 64 bits. */ #undef LONG_64_BITS -/* Define if major, minor, and makedev are declared in mkdev.h. */ +/* Define if major, minor, and makedev are declared in . */ #undef MAJOR_IN_MKDEV -/* Define if major, minor, and makedev are declared in sysmacros.h. */ +/* Define if major, minor, and makedev are declared in . */ #undef MAJOR_IN_SYSMACROS /* Define if on MINIX. */ @@ -142,29 +142,22 @@ /* Define to `int' if doesn't define. */ #undef mode_t -/* Define if you don't have dirent.h, but have ndir.h. */ +/* Define if you don't have , but have . */ #undef NDIR -/* Define if you have memory.h, and string.h doesn't declare the +/* Define if you have , and doesn't declare the mem* functions. */ #undef NEED_MEMORY_H /* Define if your struct nlist has an n_un member. */ #undef NLIST_NAME_UNION -/* Define if you have nlist.h. */ +/* Define if you have . */ #undef NLIST_STRUCT -/* Define if you can't use the address of an argument to a function - as the start of an array. */ -#undef NO_ARG_ARRAY - /* Define if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* Define if you have neither a remote shell nor the rexec function. */ -#undef NO_REMOTE - /* Define to `long' if doesn't define. */ #undef off_t @@ -207,10 +200,10 @@ /* Define on System V Release 4. */ #undef SVR4 -/* Define if you don't have dirent.h, but have sys/dir.h. */ +/* Define if you don't have , but have . */ #undef SYSDIR -/* Define if you don't have dirent.h, but have sys/ndir.h. */ +/* Define if you don't have , but have . */ #undef SYSNDIR /* Define if `sys_siglist' is declared by . */ @@ -232,7 +225,7 @@ instead of . */ #undef UMAX4_3 -/* Define if you do not have strings.h, index, bzero, etc.. */ +/* Define if you do not have , index, bzero, etc.. */ #undef USG /* Define vfork as fork if vfork does not work. */ diff --git a/src/util/autoconf/acfunctions b/src/util/autoconf/acfunctions new file mode 100644 index 000000000..5947ba69a --- /dev/null +++ b/src/util/autoconf/acfunctions @@ -0,0 +1,58 @@ +# Ones that have their own macros. +major AC_HEADER_MAJOR +minor AC_HEADER_MAJOR +makedev AC_HEADER_MAJOR +bcopy AC_HEADER_STDC +bcmp AC_HEADER_STDC +bzero AC_HEADER_STDC +ioctl AC_PROG_GCC_TRADITIONAL +memchr AC_HEADER_STDC +memcpy AC_HEADER_STDC +memcmp AC_FUNC_MEMCMP +memmove AC_HEADER_STDC +memset AC_HEADER_STDC +index AC_HEADER_STDC +rindex AC_HEADER_STDC +getgroups AC_TYPE_GETGROUPS +signal AC_TYPE_SIGNAL +alloca AC_FUNC_ALLOCA +getloadavg AC_FUNC_GETLOADAVG +mmap AC_FUNC_MMAP +setvbuf AC_FUNC_SETVBUF_REVERSED +strcoll AC_FUNC_STRCOLL +utime AC_FUNC_UTIME_NULL +vfork AC_FUNC_VFORK +vprintf AC_FUNC_VPRINTF +vfprintf AC_FUNC_VPRINTF +vsprintf AC_FUNC_VPRINTF +wait3 AC_FUNC_WAIT3 + +# Others. +fnmatch AC_CHECK_FUNCS +ftime AC_CHECK_FUNCS +gethostname AC_CHECK_FUNCS +gettimeofday AC_CHECK_FUNCS +getusershell AC_CHECK_FUNCS +getcwd AC_CHECK_FUNCS +getwd AC_CHECK_FUNCS +mkdir AC_CHECK_FUNCS +mkfifo AC_CHECK_FUNCS +mktime AC_CHECK_FUNCS +putenv AC_CHECK_FUNCS +re_comp AC_CHECK_FUNCS +regcmp AC_CHECK_FUNCS +regcomp AC_CHECK_FUNCS +rmdir AC_CHECK_FUNCS +select AC_CHECK_FUNCS +socket AC_CHECK_FUNCS +stime AC_CHECK_FUNCS +strcspn AC_CHECK_FUNCS +strdup AC_CHECK_FUNCS +strerror AC_CHECK_FUNCS +strftime AC_CHECK_FUNCS +strspn AC_CHECK_FUNCS +strstr AC_CHECK_FUNCS +strtod AC_CHECK_FUNCS +strtol AC_CHECK_FUNCS +strtoul AC_CHECK_FUNCS +uname AC_CHECK_FUNCS diff --git a/src/util/autoconf/acgeneral.m4 b/src/util/autoconf/acgeneral.m4 index 3597524ad..b0bdfc0a3 100644 --- a/src/util/autoconf/acgeneral.m4 +++ b/src/util/autoconf/acgeneral.m4 @@ -1,4 +1,5 @@ -dnl Parameterized macros that do not check for something specific. +dnl Parameterized macros. +dnl Requires GNU m4. dnl This file is part of Autoconf. dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. dnl @@ -16,126 +17,208 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl +dnl As a special exception, the Free Software Foundation gives unlimited +dnl permission to copy, distribute and modify the configure scripts that +dnl are the output of Autoconf. You need not follow the terms of the GNU +dnl General Public License when using or distributing such scripts, even +dnl though portions of the text of Autoconf appear in them. The GNU +dnl General Public License (GPL) does govern all other use of the material +dnl that constitutes the Autoconf program. +dnl +dnl Certain portions of the Autoconf source text are designed to be copied +dnl (in certain cases, depending on the input) into the output of +dnl Autoconf. We call these the "data" portions. The rest of the Autoconf +dnl source text consists of comments plus executable code that decides which +dnl of the data portions to output in any given case. We call these +dnl comments and executable code the "non-data" portions. Autoconf never +dnl copies any of the non-data portions into its output. +dnl +dnl This special exception to the GPL applies to versions of Autoconf +dnl released by the Free Software Foundation. When you make and +dnl distribute a modified version of Autoconf, you may extend this special +dnl exception to the GPL to apply to your modified version as well, *unless* +dnl your modified version has the potential to copy into its output some +dnl of the text that was the non-data portion of the version that you started +dnl with. (In other words, unless your change moves or copies text from +dnl the non-data portions to the data portions.) If your modification has +dnl such potential, you must delete any notice of this special exception +dnl to the GPL from your modified version. +dnl dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, Noah Friedman, and david d zuhn. dnl -changequote([,])dnl -undefine([eval])dnl -undefine([include])dnl -undefine([shift])dnl -undefine([format])dnl -dnl -ifdef([__gnu__], , [errprint(Autoconf requires GNU m4 -)m4exit(2)])dnl -dnl -dnl -dnl Utility functions for stamping the configure script. -dnl -dnl -define(AC_ACVERSION, 1.11)dnl -dnl This is defined by the --version option of the autoconf script. -ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION -)])dnl -dnl -dnl These are currently not used, for the sake of people who diff -dnl configure scripts and don't want spurious differences. -dnl But they are too clever to just delete. -dnl -define(AC_USER, [esyscmd( -changequote({,})dnl -# Extract the user name from the first pair of parentheses. -({ac_sedcmd='s/[^(]*(\([^)]*\)).*/\1/';} -changequote([,])dnl -whoami || id|sed "$ac_sedcmd") 2>/dev/null|tr -d '\012')])dnl -dnl -define(AC_HOST, [esyscmd((hostname || uname -n) 2>/dev/null|tr -d '\012')])dnl -dnl -define(AC_DATE, [esyscmd(date|tr -d '\012')])dnl -dnl -dnl -dnl Controlling Autoconf operation -dnl -dnl -dnl This is separate from AC_INIT to prevent GNU m4 1.0 from coredumping -dnl when AC_CONFIG_HEADER is used. -define(AC_NOTICE, +divert(-1)dnl Throw away output until AC_INIT is called. +changequote([, ]) + +define(AC_ACVERSION, 1.126) + +dnl Some old m4's don't support m4exit. But they provide +dnl equivalent functionality by core dumping because of the +dnl long macros we define. +ifdef([__gnu__], , [errprint(Autoconf requires GNU m4. +Install it before installing Autoconf or set the +M4 environment variable to its path name. +)m4exit(2)]) + +undefine([eval]) +undefine([include]) +undefine([shift]) +undefine([format]) + + +dnl ### Defining macros + + +dnl m4 output diversions. We let m4 output them all in order at the end, +dnl except that we explicitly undivert AC_DIVERSION_SED. + +dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line +define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings +define(AC_DIVERSION_INIT, 2)dnl initialization code +define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status +define(AC_DIVERSION_NORMAL_4, 4)dnl AC_REQUIRE'd code, 4 level deep +define(AC_DIVERSION_NORMAL_3, 5)dnl AC_REQUIRE'd code, 3 level deep +define(AC_DIVERSION_NORMAL_2, 6)dnl AC_REQUIRE'd code, 2 level deep +define(AC_DIVERSION_NORMAL_1, 7)dnl AC_REQUIRE'd code, 1 level deep +define(AC_DIVERSION_NORMAL, 8)dnl the tests and output code + +dnl Change the diversion stream to STREAM, while stacking old values. +dnl AC_DIVERT_PUSH(STREAM) +define(AC_DIVERT_PUSH, +[pushdef([AC_DIVERSION_CURRENT], $1)dnl +divert(AC_DIVERSION_CURRENT)dnl +]) + +dnl Change the diversion stream to its previous value, unstacking it. +dnl AC_DIVERT_POP() +define(AC_DIVERT_POP, +[popdef([AC_DIVERSION_CURRENT])dnl +divert(AC_DIVERSION_CURRENT)dnl +]) + +dnl Initialize the diversion setup. +define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL) +dnl This will be popped by AC_REQUIRE in AC_INIT. +pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE) + +dnl The prologue for Autoconf macros. +dnl AC_PRO(MACRO-NAME) +define(AC_PRO, +[define([AC_PROVIDE_$1], )dnl +ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, +[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))], +[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl +]) + +dnl The Epilogue for Autoconf macros. +dnl AC_EPI() +define(AC_EPI, +[AC_DIVERT_POP()dnl +ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, +[undivert(AC_DIVERSION_NORMAL_4)dnl +undivert(AC_DIVERSION_NORMAL_3)dnl +undivert(AC_DIVERSION_NORMAL_2)dnl +undivert(AC_DIVERSION_NORMAL_1)dnl +])dnl +]) + +dnl Define a macro which automatically provides itself. Add machinery +dnl so the macro automatically switches expansion to the diversion +dnl stack if it is not already using it. In this case, once finished, +dnl it will bring back all the code accumulated in the diversion stack. +dnl This, combined with AC_REQUIRE, achieves the topological ordering of +dnl macros. We don't use this macro to define some frequently called +dnl macros that are not involved in ordering constraints, to save m4 +dnl processing. +dnl AC_DEFUN(NAME, EXPANSION) +define([AC_DEFUN], +[define($1, [AC_PRO([$1])$2[]AC_EPI()])]) + + +dnl ### Initialization + + +dnl AC_INIT_NOTICE() +AC_DEFUN(AC_INIT_NOTICE, [# Guess values for system-dependent variables and create Makefiles. -dnl [#] Generated automatically using autoconf. # Generated automatically using autoconf version] AC_ACVERSION [ -dnl [#] by AC_USER@AC_HOST on AC_DATE -# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. - -# This configure script is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This script is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -])dnl -dnl -define(AC_PARSEARGS, -[# Save the original args to write them into config.status later. -# Do argument quoting in a sane fashion so things don't break while recursing. -configure_args= -for arg do - case $arg in - *\"*|*\\*|*\[$]*|*\`*) - arg=`echo $arg|sed -e 's/\\\\/\\\\\\\\/g;s/"/\\\\"/g;s/\\$/\\\\$/g;s/\`/\\\\\`/g'` - ;; - esac - configure_args="$configure_args \"$arg\"" -done -# configure_args="[$]*" +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +[#] Any additions from configure.in:]) -# Only options that might do something get documented. -changequote(,)dnl +dnl AC_PREFIX_DEFAULT(PREFIX) +AC_DEFUN(AC_PREFIX_DEFAULT, +[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl +ac_default_prefix=$1 +AC_DIVERT_POP()]) + +dnl AC_INIT_PARSE_ARGS() +AC_DEFUN(AC_INIT_PARSE_ARGS, +[ +# Omit some internal or obsolete options to make the list less imposing. +changequote(, )dnl ac_usage="Usage: configure [options] [host] Options: [defaults in brackets after descriptions] ---build=BUILD configure for building on BUILD [BUILD=HOST] ---disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ---enable-FEATURE[=ARG] include FEATURE [ARG=yes] ---exec-prefix=PREFIX install host dependent files in PREFIX [/usr/local] ---help print this message ---host=HOST configure for HOST [guessed] ---prefix=PREFIX install host independent files in PREFIX [/usr/local] ---quiet, --silent do not print \`checking for...' messages ---srcdir=DIR find the sources in DIR [configure dir or ..] ---target=TARGET configure for TARGET [TARGET=HOST] ---verbose print results of checks ---version print the version of autoconf that created configure ---with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ---without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ---x-includes=DIR X include files are in DIR ---x-libraries=DIR X library files are in DIR" -changequote([,])dnl +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=PREFIX install architecture-dependent files in PREFIX + [same as prefix] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +--enable and --with options recognized:$ac_help" +changequote([, ])dnl # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE -exec_prefix= +cache_file=./config.cache +exec_prefix=NONE host=NONE no_create= nonopt=NONE -norecursion= -prefix= -program_prefix= -program_suffix= -program_transform_name= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, silent= +site= srcdir= target=NONE verbose= -x_includes= -x_libraries= +x_includes=NONE +x_libraries=NONE + +# Initialize some other variables. +subdirs= ac_prev= for ac_option @@ -148,16 +231,15 @@ do continue fi - # Accept (but ignore some of) the important Cygnus configure - # options, so we can diagnose typos. - case "$ac_option" in -changequote(,)dnl +changequote(, )dnl -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; -changequote([,])dnl +changequote([, ])dnl *) ac_optarg= ;; esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case "$ac_option" in -build | --build | --buil | --bui | --bu | --b) @@ -165,24 +247,31 @@ changequote([,])dnl -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) build="$ac_optarg" ;; + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that aren't valid shell variable names. -changequote(,)dnl + # Reject names that are not valid shell variable names. +changequote(, )dnl if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then -changequote([,])dnl - AC_ERROR($ac_feature: invalid feature name) +changequote([, ])dnl + AC_MSG_ERROR($ac_feature: invalid feature name) fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that aren't valid shell variable names. -changequote(,)dnl + # Reject names that are not valid shell variable names. +changequote(, )dnl if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then -changequote([,])dnl - AC_ERROR($ac_feature: invalid feature name) +changequote([, ])dnl + AC_MSG_ERROR($ac_feature: invalid feature name) fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in @@ -191,7 +280,6 @@ changequote([,])dnl esac eval "enable_${ac_feature}='$ac_optarg'" ;; - # For backward compatibility, recognize -exec-prefix and --exec_prefix. -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) @@ -202,7 +290,8 @@ changequote([,])dnl exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) - with_gas=yes ;; # Obsolete; use --with-gas. + # Obsolete; use --with-gas. + with_gas=yes ;; -help | --help | --hel | --he) cat << EOF @@ -216,15 +305,16 @@ EOF host="$ac_optarg" ;; -nfp | --nfp | --nf) - with_fp=no ;; # Obsolete; use --without-fp. + # Obsolete; use --without-fp. + with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; - -norecursion | --norecursion | --norecursio | --norecursi \ - | --norecurs | --norecur | --norecu | --norec | --nore | --nor) - norecursion=yes ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; @@ -266,6 +356,11 @@ EOF | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -285,11 +380,11 @@ EOF -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that aren't valid shell variable names. -changequote(,)dnl + # Reject names that are not valid shell variable names. +changequote(, )dnl if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then -changequote([,])dnl - AC_ERROR($ac_package: invalid package name) +changequote([, ])dnl + AC_MSG_ERROR($ac_package: invalid package name) fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in @@ -300,16 +395,18 @@ changequote([,])dnl -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that aren't valid shell variable names. -changequote(,)dnl + # Reject names that are not valid shell variable names. +changequote(, )dnl if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then -changequote([,])dnl - AC_ERROR($ac_package: invalid package name) +changequote([, ])dnl + AC_MSG_ERROR($ac_package: invalid package name) fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; - --x) with_x=yes ;; # Obsolete; use --with-x. + --x) + # Obsolete; use --with-x. + with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) @@ -325,17 +422,17 @@ changequote([,])dnl | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; - -*) AC_ERROR([$ac_option: invalid option; use --help to show usage]) + -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage]) ;; *) -changequote(,)dnl +changequote(, )dnl if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then -changequote([,])dnl - AC_WARN($ac_option: invalid host type) +changequote([, ])dnl + AC_MSG_WARN($ac_option: invalid host type) fi if test "x$nonopt" != xNONE; then - AC_ERROR(can only configure for one host and one target at a time) + AC_MSG_ERROR(can only configure for one host and one target at a time) fi nonopt="$ac_option" ;; @@ -344,40 +441,81 @@ changequote([,])dnl done if test -n "$ac_prev"; then - AC_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) + AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) fi -])dnl -dnl -define(AC_INIT, +]) + +dnl Try to have only one #! line, so the script doesn't look funny +dnl for users of AC_REVISION. +dnl AC_INIT_BINSH() +AC_DEFUN(AC_INIT_BINSH, [#!/bin/sh -AC_NOTICE -AC_PARSEARGS -AC_PREPARE($1)])dnl -dnl -define(AC_PREPARE, +]) + +dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) +AC_DEFUN(AC_INIT, +[sinclude(acsite.m4)dnl +sinclude(./aclocal.m4)dnl +AC_REQUIRE([AC_INIT_BINSH])dnl +AC_INIT_NOTICE +AC_DIVERT_POP()dnl to NORMAL +AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl +AC_INIT_PARSE_ARGS +AC_INIT_PREPARE($1)dnl +AC_DIVERT_POP()dnl to NORMAL +]) + +dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) +AC_DEFUN(AC_INIT_PREPARE, [trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 -trap 'rm -fr confdefs* $ac_clean_files' 0 - -# Save the original args if we used an alternate arg parser. -ac_configure_temp="${configure_args-[$]*}" -# Strip out --no-create and --norecursion so they don't pile up. -configure_args= -for ac_arg in $ac_configure_temp; do - eval ac_unquoted="$ac_arg" - case "$ac_unquoted" in + +# File descriptor usage: +# 0 unused; standard input +# 1 file creation +# 2 errors and warnings +# 3 unused; some systems may open it to /dev/tty +define(AC_FD_MSG, 4)dnl +[#] AC_FD_MSG checking for... messages and results +define(AC_FD_CC, 5)dnl +[#] AC_FD_CC compiler messages saved in config.log +if test "$silent" = yes; then + exec AC_FD_MSG>/dev/null +else + exec AC_FD_MSG>&1 +fi +exec AC_FD_CC>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&AC_FD_CC + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; - -norecursion | --norecursion | --norecursio | --norecursi \ - | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;; - *) configure_args="$configure_args $ac_arg" ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; +changequote(<<, >>)dnl +dnl If you change this globbing pattern, test it on an old shell -- +dnl it's sensitive. Putting any kind of quote in it causes syntax errors. + *" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; +changequote([, ])dnl + *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. +# Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = 'set'; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -391,454 +529,914 @@ ac_unique_file=$1 # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then `..'. + # Try the directory containing this script, then its parent. ac_prog=[$]0 -changequote(,)dnl +changequote(, )dnl ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` -changequote([,])dnl +changequote([, ])dnl test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi +else + ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then - if test x$ac_srcdir_defaulted = xyes; then - AC_ERROR(can not find sources in ${ac_confdir} or ..) + if test "$ac_srcdir_defaulted" = yes; then + AC_MSG_ERROR(can not find sources in $ac_confdir or ..) else - AC_ERROR(can not find sources in ${srcdir}) + AC_MSG_ERROR(can not find sources in $srcdir) fi fi +dnl Double slashes in pathnames in object file debugging info +dnl mess up M-x gdb in Emacs. +changequote(, )dnl +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +changequote([, ])dnl + +dnl Let the site file select an alternate cache file if it wants to. +AC_SITE_LOAD +AC_CACHE_LOAD AC_LANG_C -])dnl -dnl -define(AC_ENABLE, -[[#] check whether --enable-$1 was given -enableval="[$enable_]patsubst($1,-,_)" +AC_PROG_ECHO_N +dnl Substitute for predefined variables. +AC_SUBST(CFLAGS)dnl +AC_SUBST(CPPFLAGS)dnl +AC_SUBST(CXXFLAGS)dnl +AC_SUBST(DEFS)dnl +AC_SUBST(LDFLAGS)dnl +AC_SUBST(LIBS)dnl +AC_SUBST(exec_prefix)dnl +AC_SUBST(prefix)dnl +AC_SUBST(program_transform_name)dnl +]) + + +dnl ### Selecting optional features + + +dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) +AC_DEFUN(AC_ARG_ENABLE, +[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl +ac_help="$ac_help +[$2]" +AC_DIVERT_POP()dnl +[#] Check whether --enable-$1 or --disable-$1 was given. +enableval="[$enable_]patsubst($1, -, _)" if test -n "$enableval"; then - ifelse([$2], , :, [$2]) -ifelse([$3], , , [else - $3 + ifelse([$3], , :, [$3]) +ifelse([$4], , , [else + $4 ])dnl fi -])dnl -dnl -dnl Giving --with an argument is deprecated. -define(AC_WITH, -[[#] check whether --with-$1 or --without-$1 was given. -withval="[$with_]patsubst($1,-,_)" +]) + +AC_DEFUN(AC_ENABLE, +[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl +AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl +]) + + +dnl ### Working with optional software + + +dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) +AC_DEFUN(AC_ARG_WITH, +[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl +ac_help="$ac_help +[$2]" +AC_DIVERT_POP()dnl +[#] Check whether --with-$1 or --without-$1 was given. +withval="[$with_]patsubst($1, -, _)" if test -n "$withval"; then - ifelse([$2], , :, [$2]) -ifelse([$3], , , [else - $3 + ifelse([$3], , :, [$3]) +ifelse([$4], , , [else + $4 ])dnl fi -])dnl -dnl -dnl Guess the value for the `prefix' variable by looking for -dnl the argument program along PATH and taking its parent. -dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, -dnl set `prefix' to /usr/local/gnu. -define(AC_PREFIX, -[if test -z "$prefix" -then - AC_CHECKING([for $1 to derive installation directory prefix]) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$IFS:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test $ac_dir != . && test -f $ac_dir/$1; then -changequote(,)dnl - # Not all systems have dirname. - prefix=`echo $ac_dir|sed 's%/[^/][^/]*$%%'` -changequote([,])dnl - break - fi - done - IFS="$ac_save_ifs" - AC_VERBOSE(chose installation directory prefix ${prefix}) +]) + +AC_DEFUN(AC_WITH, +[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl +AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl +]) + + +dnl ### Transforming program names. + + +dnl AC_ARG_PROGRAM() +AC_DEFUN(AC_ARG_PROGRAM, +[if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. + echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed fi -])dnl -dnl -define(AC_CONFIG_HEADER, [define(AC_CONFIG_NAMES, $1)])dnl -dnl -define(AC_DOREV, [#!/bin/sh -# From configure.in $1 -])dnl -define(AC_REVISION, [AC_DOREV(translit($1,$"))])dnl -dnl +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," +]) + + +dnl ### Version numbers + + +dnl AC_REVISION(REVISION-INFO) +AC_DEFUN(AC_REVISION, +[AC_REQUIRE([AC_INIT_BINSH])dnl +[# From configure.in] translit([$1], $")]) + dnl Subroutines of AC_PREREQ. -dnl -dnl Change the dots in version number $1 into commas. -define(AC_PREREQ_SPLIT, [translit($1,.,[,])])dnl -dnl -dnl Default the ternary version number to 0 (e.g., 1,7 -> 1,7,0). -define(AC_PREREQ_CANON, [$1,$2,ifelse([$3],,0,[$3])])dnl -dnl -dnl Complain and exit if the version number in $1 through $3 is less than -dnl the version number in $4 through $6. -dnl $7 is the printable version of the second version number. + +dnl Change the dots in NUMBER into commas. +dnl AC_PREREQ_SPLIT(NUMBER) +define(AC_PREREQ_SPLIT, +[translit($1, ., [, ])]) + +dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0). +dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY]) +define(AC_PREREQ_CANON, +[$1, $2, ifelse([$3], , 0, [$3])]) + +dnl Complain and exit if version number 1 is less than version number 2. +dnl PRINTABLE2 is the printable version of version number 2. +dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2, +dnl PRINTABLE2) define(AC_PREREQ_COMPARE, [ifelse(builtin([eval], -[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]),1, -[errprint(Autoconf version $7 or higher is required -)m4exit(3)])])dnl -dnl -dnl Complain and exit if the Autoconf version is less than $1. +[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1, +[errprint(Autoconf version $7 or higher is required for this script +)m4exit(3)])]) + +dnl Complain and exit if the Autoconf version is less than VERSION. +dnl AC_PREREQ(VERSION) define(AC_PREREQ, [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), -AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl -dnl -dnl -dnl Setting variables -dnl -dnl -dnl Several simple subroutines to do various flavors of quoting. -dnl -dnl Quote $1 against shell "s. -define(AC_QUOTE_DQUOTE, [dnl We use \1 instead of \& to avoid an m4 1.0.3 bug. -patsubst($1, changequote(,)\([$"`\\]\)changequote([,]), \\\1)])dnl -dnl -dnl Quote $1 against shell 's. -define(AC_QUOTE_SQUOTE, [patsubst($1, ', '\\'')])dnl -dnl -dnl Quote $1 against shell here documents (<> confdefs.h -dnl Define DEFS even if AC_CONFIG_NAMES for use in user case statements. -DEFS="$DEFS -D$1=AC_QUOTE_SQUOTE(AC_VAL)" -ifdef([AC_CONFIG_NAMES], -ac_sed_defs="dnl -${ac_sed_defs}\${ac_dA}$1\${ac_dB}$1\${ac_dC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_dD} -\${ac_uA}$1\${ac_uB}$1\${ac_uC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_uD} -\${ac_eA}$1\${ac_eB}$1\${ac_eC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_eD} -" -)dnl -} -])dnl -dnl -dnl Unsafe version of AC_DEFINE. -dnl Users are responsible for the quoting nightmare. -dnl Well, not all of it. We need to pull the identify function out to -dnl the top level, because m4 doesn't really support nested functions; -dnl it doesn't distinguish between the arguments to the outer -dnl function, which should be expanded, and the arguments to the inner -dnl function, which shouldn't yet. -define(AC_IDENTITY,$1)dnl -define(AC_DEFINE_UNQUOTED,[dnl -pushdef([AC_QUOTE_SQUOTE],defn([AC_IDENTITY]))dnl -pushdef([AC_DEFINE_SEDQUOTE],defn([AC_IDENTITY]))dnl -AC_DEFINE($1,$2)dnl -popdef([AC_DEFINE_SEDQUOTE])dnl -popdef([AC_QUOTE_SQUOTE])dnl -])dnl -dnl -dnl Protects the argument from being diverted twice +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])]) + + +dnl ### Getting the canonical system type + + +dnl Find install-sh, config.sub, config.guess, and Cygnus configure +dnl in directory DIR. These are auxiliary files used in configuration. +dnl DIR can be either absolute or relative to $srcdir. +dnl AC_CONFIG_AUX_DIR(DIR) +AC_DEFUN(AC_CONFIG_AUX_DIR, +[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)]) + +dnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'. +dnl There's no need to call this macro explicitly; just AC_REQUIRE it. +AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT, +[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)]) + +dnl Internal subroutine. +dnl Search for the configuration auxiliary files in directory list $1. +dnl We look only for install-sh, so users of AC_PROG_INSTALL +dnl do not automatically need to distribute the other auxiliary files. +dnl AC_CONFIG_AUX_DIRS(DIR ...) +AC_DEFUN(AC_CONFIG_AUX_DIRS, +[ac_aux_dir= +for ac_dir in $1; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + AC_MSG_ERROR([can not find install-sh or install.sh in $1]) +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +]) + +dnl Canonicalize the host, target, and build system types. +AC_DEFUN(AC_CANONICAL_SYSTEM, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [AC_ARG_PROGRAM]) +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) AC_MSG_ERROR(can only configure for one host and one target at a time) ;; +esac + +AC_CANONICAL_HOST +AC_CANONICAL_TARGET +AC_CANONICAL_BUILD +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && program_prefix=${target_alias}- +]) + +dnl Subroutines of AC_CANONICAL_SYSTEM. + +AC_DEFUN(AC_CANONICAL_HOST, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl + +# Make sure we can run config.sub. +if $ac_config_sub sun4 >/dev/null 2>&1; then : +else AC_MSG_ERROR(can not run $ac_config_sub) +fi + +AC_MSG_CHECKING(host system type) + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`$ac_config_guess`; then : + else AC_MSG_ERROR(can not guess host type; you must specify one) + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`$ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +AC_MSG_RESULT($host) +AC_SUBST(host)dnl +AC_SUBST(host_alias)dnl +AC_SUBST(host_cpu)dnl +AC_SUBST(host_vendor)dnl +AC_SUBST(host_os)dnl +]) + +dnl Internal use only. +AC_DEFUN(AC_CANONICAL_TARGET, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_MSG_CHECKING(target system type) + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`$ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +AC_MSG_RESULT($target) +AC_SUBST(target)dnl +AC_SUBST(target_alias)dnl +AC_SUBST(target_cpu)dnl +AC_SUBST(target_vendor)dnl +AC_SUBST(target_os)dnl +]) + +dnl Internal use only. +AC_DEFUN(AC_CANONICAL_BUILD, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_MSG_CHECKING(build system type) + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`$ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +AC_MSG_RESULT($build) +AC_SUBST(build)dnl +AC_SUBST(build_alias)dnl +AC_SUBST(build_cpu)dnl +AC_SUBST(build_vendor)dnl +AC_SUBST(build_os)dnl +]) + + +dnl ### Caching test results + + +dnl Look for site or system specific initialization scripts. +dnl AC_SITE_LOAD() +define(AC_SITE_LOAD, +[# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done +]) + +dnl AC_CACHE_LOAD() +define(AC_CACHE_LOAD, +[if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi +]) + +dnl AC_CACHE_SAVE() +define(AC_CACHE_SAVE, +[if test -w $cache_file; then +echo "updating cache $cache_file" +cat > $cache_file <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +changequote(, )dnl +dnl Allow a site initialization script to override cache values. +# Ultrix sh set writes to stderr and can't be redirected directly. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \ + >> $cache_file +changequote([, ])dnl +else +echo "not updating unwritable cache $cache_file" +fi +]) + +dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved. +dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) +define(AC_CACHE_VAL, +[dnl We used to use the below line, but it fails if the 1st arg is a +dnl shell variable, so we need the eval. +dnl if test "${$1+set}" = set; then +if eval "test \"`echo '${'$1'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG +else + $2 +fi +]) + + +dnl ### Defining symbols + + +dnl Set VARIABLE to VALUE, verbatim, or 1. +dnl AC_DEFINE(VARIABLE [, VALUE]) +define(AC_DEFINE, +[cat >> confdefs.h <<\EOF +[#define] $1 ifelse($#, 2, [$2], 1) +EOF +]) + +dnl Similar, but perform shell substitutions $ ` \ once on VALUE. +define(AC_DEFINE_UNQUOTED, +[cat >> confdefs.h <&AC_FD_MSG]) + +dnl AC_CHECKING(FEATURE-DESCRIPTION) define(AC_CHECKING, -[test -n "$silent" || echo "checking $1"])dnl -dnl +[echo "checking $1" 1>&AC_FD_MSG]) + +dnl AC_MSG_RESULT(RESULT-DESCRIPTION) +define(AC_MSG_RESULT, +[echo "$ac_t""$1" 1>&AC_FD_MSG]) + +dnl AC_VERBOSE(RESULT-DESCRIPTION) define(AC_VERBOSE, -[test -n "$verbose" && echo " $1"])dnl -dnl -define(AC_WARN, -[echo "configure: warning: $1" >&2])dnl -dnl -define(AC_ERROR, -[echo "configure: $1" >&2; exit 1])dnl -dnl -dnl -dnl Selecting which language to use for testing -dnl -dnl -define(AC_LANG_C, -[define([AC_LANG],[C])AC_PROVIDE([$0])ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='${CPP}' -ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' -])dnl -dnl -define(AC_LANG_CPLUSPLUS, -[define([AC_LANG],[CPLUSPLUS])AC_PROVIDE([$0])ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='${CXXCPP}' -ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' -])dnl -dnl +[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl +echo " $1" 1>&AC_FD_MSG]) + +dnl AC_MSG_WARN(PROBLEM-DESCRIPTION) +define(AC_MSG_WARN, +[echo "configure: warning: $1" 1>&2]) + +dnl AC_MSG_ERROR(ERROR-DESCRIPTION) +define(AC_MSG_ERROR, +[{ echo "configure: error: $1" 1>&2; exit 1; }]) + + +dnl ### Selecting which language to use for testing + + +dnl AC_LANG_C() +AC_DEFUN(AC_LANG_C, +[define([AC_LANG], [C])dnl +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&AC_FD_CC 2>&AC_FD_CC' +ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' +]) + +dnl AC_LANG_CPLUSPLUS() +AC_DEFUN(AC_LANG_CPLUSPLUS, +[define([AC_LANG], [CPLUSPLUS])dnl +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-gcc} $CXXFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&AC_FD_CC 2>&AC_FD_CC' +ac_link='${CXX-gcc} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' +]) + dnl Push the current language on a stack. -define(AC_LANG_SAVE, [pushdef([AC_LANG_STACK], AC_LANG)])dnl -dnl +dnl AC_LANG_SAVE() +define(AC_LANG_SAVE, +[pushdef([AC_LANG_STACK], AC_LANG)]) + dnl Restore the current language from the stack. +dnl AC_LANG_RESTORE() define(AC_LANG_RESTORE, -[ifelse(AC_LANG_STACK,C,[ifelse(AC_LANG,C,,[AC_LANG_C])],[ifelse(AC_LANG,CPLUSPLUS,,[AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl -dnl -dnl -dnl Enforcing ordering constraints -dnl -dnl +[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])]) + + +dnl ### Dependencies between macros + + +dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) define(AC_BEFORE, [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 -])])])dnl -dnl +])])]) + +dnl AC_REQUIRE(MACRO-NAME) define(AC_REQUIRE, -[ifdef([AC_PROVIDE_$1],,[indir([$1]) -])])dnl -dnl +[ifdef([AC_PROVIDE_$1], , +[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl +indir([$1]) +AC_DIVERT_POP()dnl +])]) + +dnl AC_PROVIDE(MACRO-NAME) define(AC_PROVIDE, -[define([AC_PROVIDE_$1],)])dnl -dnl +[define([AC_PROVIDE_$1], )]) + +dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION]) define(AC_OBSOLETE, [errprint(__file__:__line__: warning: [$1] is obsolete[$2] -)])dnl -dnl -dnl -dnl Checking for kinds of features -dnl -dnl -define(AC_PROGRAM_CHECK, -[if test -z "[$]$1"; then - # Extract the first word of `$2', so it can be a program name with args. - set ac_dummy $2; ac_word=[$]2 - AC_CHECKING([for $ac_word]) +)]) + + +dnl ### Checking for programs + + +dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND +dnl [, VALUE-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_PROG, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_prog_$1, +[if test -n "[$]$1"; then + ac_cv_prog_$1="[$]$1" # Let the user override the test. +else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - $1="$3" + ac_cv_prog_$1="$3" break fi done IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_CHECK_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" +])dnl +fi])dnl +$1="$ac_cv_prog_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) fi -ifelse([$4],,, [test -z "[$]$1" && $1="$4"]) -test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) AC_SUBST($1)dnl -])dnl -dnl -define(AC_PROGRAMS_CHECK, -[for ac_prog in $2 -do -AC_PROGRAM_CHECK($1, [$]ac_prog, [$]ac_prog, ) -test -n "[$]$1" && break -done -ifelse([$3],,, [test -n "[$]$1" || $1="$3" -])])dnl -dnl -define(AC_PROGRAM_PATH, -[if test -z "[$]$1"; then - # Extract the first word of `$2', so it can be a program name with args. - set ac_dummy $2; ac_word=[$]2 - AC_CHECKING([for $ac_word]) +]) + +dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) +AC_DEFUN(AC_PATH_PROG, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - $1="$ac_dir/$ac_word" + ac_cv_path_$1="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" +dnl If no 3rd arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) fi -ifelse([$3],,, [test -z "[$]$1" && $1="$3"]) -test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) AC_SUBST($1)dnl -])dnl -define(AC_PROGRAMS_PATH, +]) + +dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_PROGS, [for ac_prog in $2 do -AC_PROGRAM_PATH($1, [$]ac_prog) +AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, ) test -n "[$]$1" && break done -ifelse([$3],,, [test -n "[$]$1" || $1="$3" -])])dnl -define(AC_HEADER_EGREP, -[AC_REQUIRE_CPP()AC_PROVIDE([$0])echo '#include "confdefs.h" -#include <$2>' > conftest.${ac_ext} -eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1" -if egrep "$1" conftest.out >/dev/null 2>&1; then - ifelse([$3], , :, [rm -rf conftest* +ifelse([$3], , , [test -n "[$]$1" || $1="$3" +])]) + +dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) +AC_DEFUN(AC_PATH_PROGS, +[for ac_prog in $2 +do +AC_PATH_PROG($1, [$]ac_prog) +test -n "[$]$1" && break +done +ifelse([$3], , , [test -n "[$]$1" || $1="$3" +])]) + +dnl Guess the value for the `prefix' variable by looking for +dnl the argument program along PATH and taking its parent. +dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, +dnl set `prefix' to /usr/local/gnu. +dnl This comes too late to find a site file based on the prefix, +dnl and it might use a cached value for the path. +dnl No big loss, I think, since most configures don't use this macro anyway. +dnl AC_PREFIX_PROGRAM(PROGRAM) +AC_DEFUN(AC_PREFIX_PROGRAM, +[if test "x$prefix" = xNONE; then +changequote(<<, >>)dnl +define(<>, translit($1, [a-z], [A-Z]))dnl +changequote([, ])dnl +AC_PATH_PROG(AC_VAR_NAME, $1) +changequote(<<, >>)dnl + if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then + prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'` +changequote([, ])dnl + fi +fi +undefine([AC_VAR_NAME])dnl +]) + + +dnl ### Checking for libraries + + +dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND +dnl [, OTHER-LIBRARIES]]]) +AC_DEFUN(AC_CHECK_LIB, +[AC_MSG_CHECKING([for -l$1]) +AC_CACHE_VAL(ac_cv_lib_$1, +[ac_save_LIBS="$LIBS" +LIBS="$LIBS -l$1 $5" +AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$1=yes", eval "ac_cv_lib_$1=no")dnl +LIBS="$ac_save_LIBS" +])dnl +if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , +[changequote(, )dnl + ac_tr_lib=HAVE_LIB`echo $1 | tr '[a-z]' '[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="$LIBS -l$1" +], [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +]) + +dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND +dnl [, OTHER-LIBRARIES]]]) +AC_DEFUN(AC_HAVE_LIBRARY, +[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl +changequote(<<, >>)dnl +define(<>, dnl +patsubst(patsubst($1, <>, <<\1>>), <<-l>>, <<>>))dnl +define(<>, ac_cv_lib_<<>>AC_LIB_NAME)dnl +changequote([, ])dnl +AC_MSG_CHECKING([for -l[]AC_LIB_NAME]) +AC_CACHE_VAL(AC_CV_NAME, +[ac_save_LIBS="$LIBS" +LIBS="$LIBS -l[]AC_LIB_NAME[] $4" +AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)dnl +LIBS="$ac_save_LIBS" +])dnl +AC_MSG_RESULT($AC_CV_NAME) +if test "$AC_CV_NAME" = yes; then + ifelse([$2], , +[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) + LIBS="$LIBS -l[]AC_LIB_NAME[]" +], [$2]) +ifelse([$3], , , [else $3 +])dnl +fi +undefine([AC_LIB_NAME])dnl +undefine([AC_CV_NAME])dnl ]) + + +dnl ### Examining declarations + + +dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE]) +AC_DEFUN(AC_TRY_CPP, +[AC_REQUIRE_CPP()dnl +cat > conftest.$ac_ext </dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + ifelse([$2], , :, [rm -rf conftest* + $2]) +else + echo "$ac_err" >&AC_FD_CC +ifelse([$3], , , [ rm -rf conftest* + $3 +])dnl +fi +rm -f conftest*]) + +dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [, +dnl ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_EGREP_HEADER, +[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])]) + +dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must +dnl come early, it is not included in AC_BEFORE checks. +dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [, +dnl ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_EGREP_CPP, +[AC_REQUIRE_CPP()dnl +cat > conftest.$ac_ext <&AC_FD_CC | + egrep "$1" >/dev/null 2>&1; then + ifelse([$3], , :, [rm -rf conftest* + $3]) ifelse([$4], , , [else rm -rf conftest* $4 ])dnl fi rm -f conftest* -])dnl -dnl -dnl Because this macro is used by AC_GCC_TRADITIONAL, which must come early, -dnl it is not included in AC_BEFORE checks. -define(AC_PROGRAM_EGREP, -[AC_REQUIRE_CPP()AC_PROVIDE([$0])cat > conftest.${ac_ext} < conftest.$ac_ext < conftest.out 2>&1" -if egrep "$1" conftest.out >/dev/null 2>&1; then +if eval $ac_compile; then ifelse([$3], , :, [rm -rf conftest* - $3 -]) + $3]) ifelse([$4], , , [else rm -rf conftest* $4 ])dnl fi -rm -f conftest* -])dnl -dnl -define(AC_HEADER_CHECK, -[AC_CHECKING([for $1]) -ifelse([$3], , [AC_TEST_CPP([#include <$1>], [$2])], -[AC_TEST_CPP([#include <$1>], [$2], [$3])]) +rm -f conftest*] +) + + +dnl ### Examining libraries + + +dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, +dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_COMPILE_CHECK, +[AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK])dnl +ifelse([$1], , , [AC_CHECKING([for $1]) ])dnl -dnl -define(AC_COMPILE_CHECK, -[AC_PROVIDE([$0])dnl -ifelse([$1], , , [AC_CHECKING([for $1])] -)dnl -dnl We use return because because C++ requires a prototype for exit. -cat > conftest.${ac_ext} < conftest.$ac_ext < conftest.${ac_ext} < conftest.$ac_ext </dev/null; then - ifelse([$2], , :, [$2 -]) + ifelse([$2], , :, [$2]) ifelse([$3], , , [else $3 ])dnl fi -ifelse([$4], , , fi -)dnl -rm -fr conftest*])dnl -dnl -define(AC_TEST_CPP, -[AC_REQUIRE_CPP()dnl -cat > conftest.${ac_ext} </dev/null) 2>&1"` -if test -z "$ac_err"; then - ifelse([$2], , :, [rm -rf conftest* - $2 -]) -ifelse([$3], , , [else - rm -rf conftest* - $3 +fi +rm -fr conftest*]) + + +dnl ### Checking for header files + + +dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_HEADER, +[dnl Do the transliteration at runtime so arg 1 can be a shell variable. +ac_safe=`echo "$1" | tr './\055' '___'` +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_header_$ac_safe, +[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes", + eval "ac_cv_header_$ac_safe=no")])dnl +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) +ifelse([$3], , , [$3 ])dnl fi -rm -f conftest*])dnl -dnl -define(AC_REPLACE_FUNCS, -[for ac_func in $1 +]) + +dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_HEADERS, +[for ac_hdr in $1 do -AC_COMPILE_CHECK([${ac_func}], [#include ], [ -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_${ac_func}) || defined (__stub___${ac_func}) -choke me -#else -/* Override any gcc2 internal prototype to avoid an error. */ -extern char ${ac_func}(); ${ac_func}(); -#endif -], , [LIBOBJS="$LIBOBJS ${ac_func}.o" -AC_VERBOSE(using ${ac_func}.o instead)]) +AC_CHECK_HEADER($ac_hdr, +[changequote(, )dnl + ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl done -AC_SUBST(LIBOBJS)dnl -])dnl -dnl -define(AC_FUNC_CHECK, -[ifelse([$3], , [AC_COMPILE_CHECK($1, [#include ], [ +]) + + +dnl ### Checking for library functions + + +dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_FUNC, +[AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_func_$1, +[AC_TRY_LINK( +[#include /* Arbitrary system header to define __stub macros. */], [ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -846,163 +1444,144 @@ define(AC_FUNC_CHECK, choke me #else /* Override any gcc2 internal prototype to avoid an error. */ -extern char $1(); $1(); +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" #endif -], -$2)], [AC_COMPILE_CHECK($1, [#include ], [ -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$1) || defined (__stub___$1) -choke me -#else -/* Override any gcc2 internal prototype to avoid an error. */ -extern char $1(); $1(); +])dnl +[char $1(); $1(); #endif -], -$2, $3)])dnl +], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl +if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) +ifelse([$3], , , [$3 ])dnl -dnl -define(AC_HAVE_FUNCS, +fi +]) + +dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_FUNCS, [for ac_func in $1 do -changequote(,)dnl -ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` -changequote([,])dnl -AC_FUNC_CHECK(${ac_func}, -AC_DEFINE(${ac_tr_func}))dnl +AC_CHECK_FUNC($ac_func, +[changequote(, )dnl + ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl done -])dnl -dnl -define(AC_HAVE_HEADERS, -[AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. -for ac_hdr in $1 +]) + +dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) +AC_DEFUN(AC_REPLACE_FUNCS, +[for ac_func in $1 do -changequote(,)dnl -ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` -changequote([,])dnl -AC_HEADER_CHECK(${ac_hdr}, -AC_DEFINE(${ac_tr_hdr}))dnl +AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) done -])dnl -dnl -define(AC_HAVE_LIBRARY, [dnl -changequote(/,/)dnl -define(/AC_LIB_NAME/, dnl -patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl -changequote([,])dnl -ac_save_LIBS="${LIBS}" -LIBS="${LIBS} -l[]AC_LIB_NAME[]" -ac_have_lib="" -AC_COMPILE_CHECK([-l[]AC_LIB_NAME[]], , [main();], [ac_have_lib="1"])dnl -LIBS="${ac_save_LIBS}" -ifelse($#, 1, [dnl -if test -n "${ac_have_lib}"; then - AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) - LIBS="${LIBS} -l[]AC_LIB_NAME[]" -fi -undefine(AC_LIB_NAME)dnl -], [dnl -if test -n "${ac_have_lib}"; then - :; $2 -else - :; $3 -fi -])])dnl -dnl -define(AC_SIZEOF_TYPE, -[AC_CHECKING(size of $1) -AC_TEST_PROGRAM([#include +AC_SUBST(LIBOBJS)dnl +]) + + +dnl ### Checking compiler characteristics + + +dnl AC_CHECK_SIZEOF(TYPE) +AC_DEFUN(AC_CHECK_SIZEOF, +[changequote(<<, >>)dnl +dnl The name to #define. +define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $1) +AC_CACHE_VAL(AC_CV_NAME, +[AC_TRY_RUN([#include main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0); -}], ac_size=`cat conftestval`, AC_ERROR(can not determine size of $1)) -AC_DEFINE_UNQUOTED(changequote(<<,>>) translit(sizeof_$1, [a-z *], [A-Z_P])<<>>changequote([,]), $ac_size)])dnl -dnl -dnl -dnl The big finish -dnl -dnl -define(AC_OUTPUT, -[ -dnl If we have AC_TOPDIR, check for a top/config/pre.in and post.in -ifelse(AC_TOPDIR, [], ac_top=, ac_top=AC_TOPDIR/) -changequote(,)dnl -case $ac_top in - /*) ;; # it's fine as is - *) ac_top=$srcdir/$ac_top ;; -esac - ac_tmpin="${ac_top}config/pre.in" - if test -r $ac_tmpin; then - ac_prepend=$ac_tmpin - else - ac_prepend= - fi - ac_tmpin="${ac_top}config/post.in" - if test -r $ac_tmpin; then - ac_postpend=$ac_tmpin - else - ac_postpend= - fi +}], AC_CV_NAME=`cat conftestval`)])dnl +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) -# The preferred way to propogate these variables is regular @ substitutions. -if test -n "$prefix"; then - ac_prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" -else - prefix=/usr/local -fi -if test -n "$exec_prefix"; then - ac_prsub="$ac_prsub -s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" -else - exec_prefix='${prefix}' # Let make expand it. + +dnl ### Checking for typedefs + + +dnl AC_CHECK_TYPE(TYPE, DEFAULT) +AC_DEFUN(AC_CHECK_TYPE, +[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(ac_cv_type_$1, +[AC_EGREP_CPP($1, [#include +#if STDC_HEADERS +#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 + AC_DEFINE($1, $2) fi +]) + + +dnl ### Creating output files + + +dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...) +AC_DEFUN(AC_CONFIG_HEADER, +[define(AC_LIST_HEADER, $1)]) + +dnl Link each of the existing files SOURCE... to the corresponding +dnl link name in DEST... +dnl AC_LINK_FILES(SOURCE..., DEST...) +AC_DEFUN(AC_LINK_FILES, +[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])]) + +dnl AC_CONFIG_SUBDIRS(DIR ...) +AC_DEFUN(AC_CONFIG_SUBDIRS, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +define([AC_LIST_SUBDIRS], [$1])dnl +subdirs="AC_LIST_SUBDIRS" +AC_SUBST(subdirs)dnl +]) + +dnl The big finish. +dnl Produce config.status, config.h, and links, and configure subdirs. +dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) +define(AC_OUTPUT, +[trap '' 1 2 15 +AC_CACHE_SAVE +trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then +changequote(, )dnl ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +changequote([, ])dnl fi -# Quote sed substitution magic chars in DEFS. -cat >conftest.def < config.status < $CONFIG_STATUS </dev/null | sed 1q`: # -[#] [$]0 [$]configure_args +[#] [$]0 [$]ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. -changequote(,)dnl -ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]" -changequote([,])dnl +changequote(, )dnl +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +changequote([, ])dnl for ac_option do case "[\$]ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create - exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create ;; + echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion" + exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "config.status generated by autoconf version AC_ACVERSION" + echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION" exit 0 ;; -help | --help | --hel | --he | --h) echo "[\$]ac_cs_usage"; exit 0 ;; @@ -1031,37 +1613,108 @@ do esac done -ifdef([AC_CONFIG_NAMES], -[trap 'rm -fr $1 AC_CONFIG_NAMES conftest*; exit 1' 1 2 15], +ac_given_srcdir=$srcdir +ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL" +])dnl + +ifdef([AC_LIST_HEADER], +[trap 'rm -fr $1 AC_LIST_HEADER conftest*; exit 1' 1 2 15], [trap 'rm -f $1; exit 1' 1 2 15]) -dnl Insert the variable assignments. -undivert(2)dnl + +AC_OUTPUT_FILES($1) +ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl +ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl +ifelse([$3], , , +[EOF +cat >> $CONFIG_STATUS <> config.status <<\EOF +cat >> $CONFIG_STATUS <<\EOF]) +$2 +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS +dnl config.status should not do recursion. +ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl +])dnl -ac_given_srcdir=$srcdir +dnl This is a subroutine of AC_OUTPUT. +dnl It is called inside configure, outside of config.status. +dnl AC_OUTPUT_MAKE_DEFS() +define(AC_OUTPUT_MAKE_DEFS, +[# Transform confdefs.h into DEFS. +dnl Using a here document instead of a string reduces the quoting nightmare. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +changequote(<<, >>)dnl +s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +changequote([, ])dnl +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs +]) + +dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted +dnl here document whose contents are going into config.status. +dnl AC_OUTPUT_FILES(FILE...) +define(AC_OUTPUT_FILES, +[# Protect against being on the right side of a sed subst in config.status. +changequote(, )dnl +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +changequote([, ])dnl +dnl These here document variables are unquoted when configure runs +dnl but quoted when config.status runs, so variables are expanded once. +$ac_vpsub +dnl Shell code in configure.in might set extrasub. +$extrasub +dnl Insert the sed substitutions of variables. +undivert(AC_DIVERSION_SED) +CEOF +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +dnl Specifying an input file breaks the trap to clean up on interrupt, +dnl but that's not a huge problem. + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. -CONFIG_FILES=${CONFIG_FILES-"$1"} -for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then # Remove last slash and all that follows it. Not all systems have dirname. -changequote(,)dnl +changequote(, )dnl ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` -changequote([,])dnl +changequote([, ])dnl if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/$ac_dir" + # A "../" for each directory in $ac_dir_suffix. +changequote(, )dnl + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` +changequote([, ])dnl else - ac_dir_suffix= + ac_dir_suffix= ac_dots= fi -changequote(,)dnl - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` -changequote([,])dnl case "$ac_given_srcdir" in .) srcdir=. - if test -z "$ac_dir_suffix"; then top_srcdir=. + if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. @@ -1069,131 +1722,134 @@ changequote([,])dnl top_srcdir="$ac_dots$ac_given_srcdir" ;; esac +ifdef([AC_PROVIDE_AC_PROG_INSTALL], +[ case "$ac_given_INSTALL" in +changequote(, )dnl + [/$]*) INSTALL="$ac_given_INSTALL" ;; +changequote([, ])dnl + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac +])dnl echo creating "$ac_file" rm -f "$ac_file" - comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure." + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in - *.c | *.h | *.C | *.cc | *.m ) echo "/* $comment_str */" > "$ac_file" ;; - * ) echo "# $comment_str" > "$ac_file" ;; + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; esac - sed -e " -$ac_prsub -$ac_vpsub -dnl Shell code in configure.in might set extrasub. -$extrasub -dnl Insert the sed substitutions. -undivert(1)dnl -" $ac_prepend $ac_given_srcdir/${ac_file}.in $ac_postpend >> $ac_file -fi; done -AC_OUTPUT_HEADER -$2 -exit 0 -EOF -chmod +x config.status -# Some shells look in PATH for config.status without the "./". -test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g ])dnl -dnl This is a subroutine of AC_OUTPUT, broken out primarily to avoid bugs -dnl with long definitions in GNU m4 1.0. This is called inside a quoted +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs +]) + +dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted dnl here document whose contents are going into config.status. -define(AC_OUTPUT_HEADER,[dnl -ifdef([AC_CONFIG_NAMES],[dnl -changequote(<<,>>)dnl - -# These sed commands are put into ac_sed_defs when defining a macro. -# They are broken into pieces to make the sed script easier to manage. -# They are passed to sed as "A NAME B NAME C VALUE D", where NAME -# is the cpp macro being defined and VALUE is the value it is being given. -# Each defining turns into a single global substitution command. -# Hopefully no one uses "!" as a variable value. -# Other candidates for the sed separators, like , and @, do get used. +dnl AC_OUTPUT_HEADER(HEADER-FILE...) +define(AC_OUTPUT_HEADER, +[changequote(<<, >>)dnl +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s!^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*!\1#\2' +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' -ac_dD='!g' +ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)!\1#\2define\3' +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' -ac_uD='\4!g' +ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='<<$>>!\1#\2define\3' +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='<<$>>%\1#\2define\3' ac_eC=' ' -ac_eD='!g' -changequote([,])dnl -rm -f conftest.sed +ac_eD='%g' +changequote([, ])dnl + +CONFIG_HEADERS=${CONFIG_HEADERS-"$1"} +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + cp $ac_given_srcdir/$ac_file_in conftest.in + EOF -# Turn off quoting long enough to insert the sed commands. -rm -f conftest.sh -cat > conftest.sh < conftest.hdr <<\EOF +changequote(<<, >>)dnl +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +changequote([, ])dnl EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr -# Break up $ac_sed_defs (now in conftest.sh) because some shells have a limit -# on the size of here documents. +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +changequote(, )dnl +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +changequote([, ])dnl +EOF +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. # Maximum number of lines to put in a single here document. -ac_max_sh_lines=9 +ac_max_here_lines=12 +rm -f conftest.tail while : do - # wc gives bogus results for an empty file on some AIX systems. - ac_lines=`grep -c . conftest.sh` + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - rm -f conftest.s1 conftest.s2 - sed ${ac_max_sh_lines}q conftest.sh > conftest.s1 # Like head -9. - sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10. - # Write a limited-size here document to append to conftest.sed. - echo 'cat >> conftest.sed <> config.status - cat conftest.s1 >> config.status - echo 'CONFEOF' >> config.status - rm -f conftest.s1 conftest.sh - mv conftest.s2 conftest.sh + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals done -rm -f conftest.sh - -# Now back to your regularly scheduled config.status. -cat >> config.status <<\EOF -# This sed command replaces #undef's with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it in -[#] AC_CONFIG_NAMES. -cat >> conftest.sed <<\CONFEOF -changequote(,)dnl -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -changequote([,])dnl -CONFEOF -rm -f conftest.h -# Break up the sed commands because old seds have small limits. -ac_max_sed_lines=20 - -CONFIG_HEADERS=${CONFIG_HEADERS-"AC_CONFIG_NAMES"} -for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then - echo creating $ac_file +rm -f conftest.vals - cp $ac_given_srcdir/$ac_file.in conftest.h1 - cp conftest.sed conftest.stm - while : - do - ac_lines=`grep -c . conftest.stm` - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - rm -f conftest.s1 conftest.s2 conftest.h2 - sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20. - sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21. - sed -f conftest.s1 < conftest.h1 > conftest.h2 - rm -f conftest.s1 conftest.h1 conftest.stm - mv conftest.h2 conftest.h1 - mv conftest.s2 conftest.stm - done - rm -f conftest.stm conftest.h +dnl Now back to your regularly scheduled config.status. +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.h1 >> conftest.h - rm -f conftest.h1 + cat conftest.in >> conftest.h + rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then - # The file exists and we would not be changing it. echo "$ac_file is unchanged" rm -f conftest.h else @@ -1201,6 +1857,161 @@ for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then mv conftest.h $ac_file fi fi; done -rm -f conftest.sed -])])dnl +]) + +dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted +dnl here document whose contents are going into config.status. +dnl AC_OUTPUT_LINKS(SOURCE..., DEST...) +define(AC_OUTPUT_LINKS, +[EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]* + set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + AC_MSG_ERROR($srcdir/$ac_source: File not found) + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. +changequote(, )dnl + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` +changequote([, ])dnl + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/$ac_dest_dir" + # A "../" for each directory in $ac_dest_dir_suffix. +changequote(, )dnl + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` +changequote([, ])dnl + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in +changequote(, )dnl + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; +changequote([, ])dnl + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source) + fi +done +]) + +This is a subroutine of AC_OUTPUT. It is called after running config.status. +dnl AC_OUTPUT_SUBDIRS(DIRECTORY...) +define(AC_OUTPUT_SUBDIRS, +[ +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in $1; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=../$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + AC_MSG_WARN(no configuration information is in $ac_config_dir) + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. +changequote(, )dnl + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo /$ac_config_dir|sed 's%/[^/]*%../%g'` +changequote([, ])dnl + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + + echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) + fi + fi + + cd $ac_popdir + done +fi +]) diff --git a/src/util/autoconf/acheaders b/src/util/autoconf/acheaders new file mode 100644 index 000000000..0363a38a1 --- /dev/null +++ b/src/util/autoconf/acheaders @@ -0,0 +1,27 @@ +# Ones that have their own macros. +dirent.h AC_HEADER_DIRENT +sys/ndir.h AC_HEADER_DIRENT +sys/dir.h AC_HEADER_DIRENT +ndir.h AC_HEADER_DIRENT +sys/mkdev.h AC_HEADER_MAJOR +string.h AC_HEADER_STDC +strings.h AC_HEADER_STDC +stdlib.h AC_HEADER_STDC +stddef.h AC_HEADER_STDC +stdarg.h AC_HEADER_STDC +float.h AC_HEADER_STDC +sys/wait.h AC_HEADER_SYS_WAIT +X11/Xlib.h AC_PATH_X + +# Others. +fcntl.h AC_CHECK_HEADERS +limits.h AC_CHECK_HEADERS +paths.h AC_CHECK_HEADERS +sgtty.h AC_CHECK_HEADERS +sys/file.h AC_CHECK_HEADERS +sys/ioctl.h AC_CHECK_HEADERS +sys/time.h AC_CHECK_HEADERS +sys/window.h AC_CHECK_HEADERS +syslog.h AC_CHECK_HEADERS +termio.h AC_CHECK_HEADERS +unistd.h AC_CHECK_HEADERS diff --git a/src/util/autoconf/acidentifiers b/src/util/autoconf/acidentifiers new file mode 100644 index 000000000..a7979c018 --- /dev/null +++ b/src/util/autoconf/acidentifiers @@ -0,0 +1,22 @@ +sys_siglist AC_DECL_SYS_SIGLIST +mode_t AC_TYPE_MODE_T +off_t AC_TYPE_OFF_T +pid_t AC_TYPE_PID_T +size_t AC_TYPE_SIZE_T +uid_t AC_TYPE_UID_T +gid_t AC_TYPE_UID_T +S_ISDIR AC_HEADER_STAT +S_ISREG AC_HEADER_STAT +S_ISCHR AC_HEADER_STAT +S_ISBLK AC_HEADER_STAT +S_ISFIFO AC_HEADER_STAT +S_ISLNK AC_HEADER_STAT +S_ISSOCK AC_HEADER_STAT +st_blksize AC_STRUCT_ST_BLKSIZE +st_blocks AC_STRUCT_ST_BLOCKS +st_rdev AC_STRUCT_ST_RDEV +timeval AC_HEADER_TIME +tm AC_STRUCT_TM +tm_zone AC_STRUCT_TIMEZONE +const AC_C_CONST +inline AC_C_INLINE diff --git a/src/util/autoconf/acmakevars b/src/util/autoconf/acmakevars new file mode 100644 index 000000000..721b79ba2 --- /dev/null +++ b/src/util/autoconf/acmakevars @@ -0,0 +1,11 @@ +LN AC_PROG_LN_S +AWK AC_PROG_AWK +CC AC_PROG_CC +CPP AC_PROG_CPP +CXX AC_PROG_CXX +INSTALL AC_PROG_INSTALL +LEX AC_PROG_LEX +RANLIB AC_PROG_RANLIB +YACC AC_PROG_YACC +BISON AC_PROG_YACC +MAKE AC_PROG_MAKE_SET diff --git a/src/util/autoconf/acoldnames.m4 b/src/util/autoconf/acoldnames.m4 new file mode 100644 index 000000000..39e20b733 --- /dev/null +++ b/src/util/autoconf/acoldnames.m4 @@ -0,0 +1,79 @@ +dnl Map old names of Autoconf macros to new regularized names. +dnl This file is part of Autoconf. +dnl Copyright (C) 1994 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl +dnl General macros. +dnl +define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl +define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl +AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl +AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl +AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl +AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl +AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl +AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl +AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl +AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl +AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl +AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl +AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl +AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl +AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl +AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl +dnl +dnl Specific macros. +dnl +AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl +AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl +AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl +AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl +AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl +AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl +AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl +AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl +AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl +AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl +AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl +AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl +AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl +AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl +AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl +AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl +AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl +AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl +AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl +AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl +AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl +AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl +AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl +AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl +AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl +AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl +AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl +AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl +AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl +AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl +AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl +AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl +AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl +AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl +AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl +AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl +AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl +AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl +AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl +AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl diff --git a/src/util/autoconf/acprograms b/src/util/autoconf/acprograms new file mode 100644 index 000000000..be237e31c --- /dev/null +++ b/src/util/autoconf/acprograms @@ -0,0 +1,18 @@ +ln AC_PROG_LN_S +awk AC_PROG_AWK +nawk AC_PROG_AWK +gawk AC_PROG_AWK +mawk AC_PROG_AWK +cc AC_PROG_CC +gcc AC_PROG_CC +cpp AC_PROG_CPP +CC AC_PROG_CXX +g++ AC_PROG_CXX +install AC_PROG_INSTALL +lex AC_PROG_LEX +flex AC_PROG_LEX +ranlib AC_PROG_RANLIB +yacc AC_PROG_YACC +byacc AC_PROG_YACC +bison AC_PROG_YACC +make AC_PROG_MAKE_SET diff --git a/src/util/autoconf/acspecific.m4 b/src/util/autoconf/acspecific.m4 index 5a74a0aac..876ac15cf 100644 --- a/src/util/autoconf/acspecific.m4 +++ b/src/util/autoconf/acspecific.m4 @@ -16,218 +16,361 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl +dnl As a special exception, the Free Software Foundation gives unlimited +dnl permission to copy, distribute and modify the configure scripts that +dnl are the output of Autoconf. You need not follow the terms of the GNU +dnl General Public License when using or distributing such scripts, even +dnl though portions of the text of Autoconf appear in them. The GNU +dnl General Public License (GPL) does govern all other use of the material +dnl that constitutes the Autoconf program. +dnl +dnl Certain portions of the Autoconf source text are designed to be copied +dnl (in certain cases, depending on the input) into the output of +dnl Autoconf. We call these the "data" portions. The rest of the Autoconf +dnl source text consists of comments plus executable code that decides which +dnl of the data portions to output in any given case. We call these +dnl comments and executable code the "non-data" portions. Autoconf never +dnl copies any of the non-data portions into its output. +dnl +dnl This special exception to the GPL applies to versions of Autoconf +dnl released by the Free Software Foundation. When you make and +dnl distribute a modified version of Autoconf, you may extend this special +dnl exception to the GPL to apply to your modified version as well, *unless* +dnl your modified version has the potential to copy into its output some +dnl of the text that was the non-data portion of the version that you started +dnl with. (In other words, unless your change moves or copies text from +dnl the non-data portions to the data portions.) If your modification has +dnl such potential, you must delete any notice of this special exception +dnl to the GPL from your modified version. +dnl dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, and Noah Friedman. -dnl -dnl -dnl checks for programs -dnl -dnl -define(AC_PROG_CC, -[AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])AC_PROGRAM_CHECK(CC, gcc, gcc, cc) -# Find out if we are using GNU C, under whatever name. + + +dnl ### Checks for programs + + +dnl Check whether to use -n, \c, or newline-tab to separate +dnl checking messages from result messages. +dnl Idea borrowed from dist 3.0. +dnl Internal use only. +AC_DEFUN(AC_PROG_ECHO_N, +[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi +]) + +AC_DEFUN(AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc, cc) + +AC_MSG_CHECKING(whether we are using GNU C) +AC_CACHE_VAL(ac_cv_prog_gcc, +[dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat > conftest.c < conftest.out 2>&1 -if egrep yes conftest.out >/dev/null 2>&1; then - GCC=1 # For later tests. +if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi])dnl +AC_MSG_RESULT($ac_cv_prog_gcc) +if test $ac_cv_prog_gcc = yes; then + GCC=yes + if test "${CFLAGS+set}" != set; then + AC_MSG_CHECKING(whether ${CC-cc} accepts -g) +AC_CACHE_VAL(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 +else + ac_cv_prog_gcc_g=no fi rm -f conftest* ])dnl -dnl -define(AC_PROG_CXX, -[AC_BEFORE([$0], [AC_PROG_CXXCPP])AC_PROVIDE([$0]) -AC_PROGRAMS_CHECK(CXX, $CCC c++ g++ gcc CC cxx, gcc) + AC_MSG_RESULT($ac_cv_prog_gcc_g) + if test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" + fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +AC_DEFUN(AC_PROG_CXX, +[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) + # Find out if we are using GNU C++, under whatever name. -cat > conftest.C < conftest.C < conftest.out 2>&1 -if egrep yes conftest.out >/dev/null 2>&1; then - GXX=1 # For later tests. +if ${CXX-gcc} -E conftest.C 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi])dnl +if test $ac_cv_prog_gxx = yes; then + GXX=yes + if test "${CXXFLAGS+set}" != set; then + AC_MSG_CHECKING(whether ${CXX-gcc} accepts -g) +AC_CACHE_VAL(ac_cv_prog_gxx_g, +[echo 'void f(){}' > conftest.cc +if test -z "`${CXX-gcc} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_gxx_g=yes +else + ac_cv_prog_gxx_g=no fi rm -f conftest* ])dnl -dnl -define(AC_GCC_TRADITIONAL, -[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])if test -n "$GCC"; then - AC_CHECKING(whether -traditional is needed) -changequote(,)dnl - ac_pattern="Autoconf.*'x'" -changequote([,])dnl - ac_prog='#include -Autoconf TIOCGETP' - AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1) - - if test -z "$ac_need_trad"; then - ac_prog='#include -Autoconf TCGETA' - AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1) + AC_MSG_RESULT($ac_cv_prog_gxx_g) + if test $ac_cv_prog_gxx_g = yes; then + CXXFLAGS="-g -O" + else + CXXFLAGS="-O" + fi fi - test -n "$ac_need_trad" && CC="$CC -traditional" +else + GXX= + test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" fi -])dnl -dnl -define(AC_MINUS_C_MINUS_O, -[AC_CHECKING(whether $CC and cc understand -c and -o together) +]) + +AC_DEFUN(AC_PROG_GCC_TRADITIONAL, +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_CPP])dnl +if test $ac_cv_prog_gcc = yes; then + AC_MSG_CHECKING(whether ${CC-cc} needs -traditional) +AC_CACHE_VAL(ac_cv_prog_gcc_traditional, +[ ac_pattern="Autoconf.*'x'" + AC_EGREP_CPP($ac_pattern, [#include +Autoconf TIOCGETP], + ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no) + + if test $ac_cv_prog_gcc_traditional = no; then + AC_EGREP_CPP($ac_pattern, [#include +Autoconf TCGETA], + ac_cv_prog_gcc_traditional=yes) + fi])dnl + AC_MSG_RESULT($ac_cv_prog_gcc_traditional) + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi +]) + +AC_DEFUN(AC_PROG_CC_C_O, +[if test "x$CC" != xcc; then + AC_MSG_CHECKING(whether $CC and cc understand -c and -o together) +else + AC_MSG_CHECKING(whether cc understands -c and -o together) +fi +set dummy $CC; ac_cc=[$]2 +AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, +[eval ac_cv_prog_cc_${ac_cc}_c_o=no echo 'foo(){}' > conftest.c # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \ - && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 +if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC && + test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC then - # Test first that cc exists at all. - if cc -c conftest.c >/dev/null 2>&1 - then - if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \ - test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1 + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC then - : - else - AC_DEFINE(NO_MINUS_C_MINUS_O) + if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC && + test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC + then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + fi fi fi -else - AC_DEFINE(NO_MINUS_C_MINUS_O) fi rm -f conftest* ])dnl -dnl +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_DEFINE(NO_MINUS_C_MINUS_O) +fi +]) + dnl Define SET_MAKE to set ${MAKE} if make doesn't. -define(AC_SET_MAKE, -[cat > conftestmake <<'EOF' +AC_DEFUN(AC_PROG_MAKE_SET, +[AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE) +set dummy ${MAKE-make}; ac_make=[$]2 +AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set, +[cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF -changequote(,)dnl +changequote(, )dnl # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -changequote([,])dnl -if test -n "$ac_maketemp"; then SET_MAKE= -else SET_MAKE="MAKE=${MAKE-make}"; fi -rm -f conftestmake +changequote([, ])dnl +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake])dnl +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + AC_MSG_RESULT(yes) + SET_MAKE= +else + AC_MSG_RESULT(no) + SET_MAKE="MAKE=${MAKE-make}" +fi AC_SUBST([SET_MAKE])dnl -])dnl -dnl -define(AC_PROG_RANLIB, [AC_PROGRAM_CHECK(RANLIB, ranlib, ranlib, :)])dnl -dnl -define(AC_PROG_AWK, [AC_PROGRAMS_CHECK(AWK, mawk gawk nawk awk,)])dnl -dnl -define(AC_PROG_YACC,[AC_PROGRAMS_CHECK(YACC, 'bison -y' byacc, yacc)])dnl -dnl -define(AC_PROG_CPP, -[AC_PROVIDE([$0])AC_CHECKING(how to run the C preprocessor) +]) + +AC_DEFUN(AC_PROG_RANLIB, +[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) + +dnl Check for mawk first since it's said to be faster. +AC_DEFUN(AC_PROG_AWK, +[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) + +AC_DEFUN(AC_PROG_YACC, +[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)]) + +AC_DEFUN(AC_PROG_CPP, +[AC_MSG_CHECKING(how to run the C preprocessor) +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi if test -z "$CPP"; then - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and ``${CC-cc}'' will simply confuse - # make. It must be expanded now. +AC_CACHE_VAL(ac_cv_prog_CPP, +[ # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" -dnl On the NeXT, cc -E runs the code through the compiler's parser, -dnl not just through cpp. - AC_TEST_CPP([#include + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. +dnl Use a header file that comes with gcc, so configuring glibc +dnl with a fresh cross-compiler works. + AC_TRY_CPP([#include Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" - AC_TEST_CPP([#include -Syntax Error], ,CPP=/lib/cpp)) + AC_TRY_CPP([#include +Syntax Error], , CPP=/lib/cpp)) + ac_cv_prog_CPP="$CPP"])dnl fi -AC_VERBOSE(setting CPP to $CPP) +CPP="$ac_cv_prog_CPP" +AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl -])dnl -dnl -define(AC_PROG_CXXCPP, -[AC_PROVIDE([$0])AC_CHECKING(how to run the C++ preprocessor) -AC_LANG_SAVE[]dnl -AC_LANG_CPLUSPLUS[]dnl +]) + +AC_DEFUN(AC_PROG_CXXCPP, +[AC_MSG_CHECKING(how to run the C++ preprocessor) if test -z "$CXXCPP"; then - CXXCPP="${CXX-c++} -E" - AC_TEST_CPP([#include ], , CXXCPP=/lib/cpp) -fi -AC_VERBOSE(setting CXXCPP to $CXXCPP) +AC_CACHE_VAL(ac_cv_prog_CXXCPP, +[AC_LANG_SAVE[]dnl +AC_LANG_CPLUSPLUS[]dnl + CXXCPP="${CXX-gcc} -E" + AC_TRY_CPP([#include ], , CXXCPP=/lib/cpp) + ac_cv_prog_CXXCPP="$CXXCPP" AC_LANG_RESTORE[]dnl +fi])dnl +CXXCPP="$ac_cv_prog_CXXCPP" +AC_MSG_RESULT($CXXCPP) AC_SUBST(CXXCPP)dnl -])dnl -dnl +]) + dnl Require finding the C or C++ preprocessor, whichever is the dnl current language. -define(AC_REQUIRE_CPP, -[ifelse(AC_LANG,C,[AC_REQUIRE([AC_PROG_CPP])],[AC_REQUIRE([AC_PROG_CXXCPP])])])dnl -dnl -define(AC_PROG_LEX, -[AC_PROVIDE([$0])AC_PROGRAM_CHECK(LEX, flex, flex, lex) +AC_DEFUN(AC_REQUIRE_CPP, +[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])]) + +AC_DEFUN(AC_PROG_LEX, +[AC_CHECK_PROG(LEX, flex, flex, lex) if test -z "$LEXLIB" then case "$LEX" in - flex*) AC_HAVE_LIBRARY(fl, LEXLIB="-lfl") ;; - *) LEXLIB="-ll" ;; + flex*) ac_lib=fl ;; + *) ac_lib=l ;; esac + AC_CHECK_LIB($ac_lib, main, LEXLIB="-l$ac_lib") fi -AC_VERBOSE(setting LEXLIB to $LEXLIB) -AC_SUBST(LEXLIB)])dnl -dnl -define(AC_YYTEXT_POINTER,[dnl -AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl -AC_CHECKING(for yytext declaration) -# POSIX says lex can declare yytext either as a pointer or an array; the +AC_SUBST(LEXLIB)]) + +AC_DEFUN(AC_DECL_YYTEXT, +[AC_REQUIRE_CPP()dnl +AC_REQUIRE([AC_PROG_LEX])dnl +AC_MSG_CHECKING(for yytext declaration) +AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer, +[# POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. # # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. +ac_cv_prog_lex_yytext_pointer=no echo '%% -%%' | ${LEX} +%%' | $LEX if test -f lex.yy.c; then LEX_OUTPUT_ROOT=lex.yy elif test -f lexyy.c; then LEX_OUTPUT_ROOT=lexyy else - # Don't know what to do here. - AC_ERROR(cannot find output from $LEX, giving up on yytext declaration) - LEX_OUTPUT_ROOT= -fi -if test -n "$LEX_OUTPUT_ROOT"; then - echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LEXLIB" - AC_TEST_PROGRAM(`cat $LEX_OUTPUT_ROOT.c`, AC_DEFINE(YYTEXT_POINTER)) - LIBS="$ac_save_LIBS" - rm -f "${LEX_OUTPUT_ROOT}.c" + AC_MSG_ERROR(cannot find output from $LEX, giving up) +fi +echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS="$LIBS" +LIBS="$LIBS $LEXLIB" +AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes) +LIBS="$ac_save_LIBS" +rm -f "${LEX_OUTPUT_ROOT}.c"])dnl +AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer) +if test $ac_cv_prog_lex_yytext_pointer = yes; then + AC_DEFINE(YYTEXT_POINTER) fi AC_SUBST(LEX_OUTPUT_ROOT)dnl -])dnl -dnl -define(AC_PROG_INSTALL, -[# Make sure to not get the incompatible SysV /etc/install and -# /usr/sbin/install, which might be in PATH before a BSD-like install, -# or the SunOS /usr/etc/install directory, or the AIX /bin/install, -# or the AFS install, which mishandles nonexistent args, or -# /usr/ucb/install on SVR4, which tries to use the nonexistent group -# `staff', or /sbin/install on IRIX which has incompatible command-line -# syntax. Sigh. -# -# On most BSDish systems install is in /usr/bin, not /usr/ucb -# anyway. -# This turns out not to be true, so the mere pathname isn't an indication -# of whether the program works. What we really need is a set of tests for -# the install program to see if it actually works in all the required ways. -# -# Avoid using ./install, which might have been erroneously created -# by make from ./install.sh. -if test -z "${INSTALL}"; then - AC_CHECKING(for a BSD compatible install) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +]) + +AC_DEFUN(AC_PROG_INSTALL, +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +AC_MSG_CHECKING(for a BSD compatible install) +if test -z "$INSTALL"; then +AC_CACHE_VAL(ac_cv_path_install, +[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do case "$ac_dir" in - ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; + ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in installbsd scoinst install; do + for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then @@ -235,7 +378,7 @@ if test -z "${INSTALL}"; then # OSF/1 installbsd also uses dspmsg, but is usable. : else - INSTALL="$ac_dir/$ac_prog -c" + ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi @@ -244,154 +387,284 @@ if test -z "${INSTALL}"; then esac done IFS="$ac_save_ifs" -fi - -if test -z "$INSTALL"; then # As a last resort, use the slow shell script. - for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do - if test -f $ac_dir/install.sh; then - INSTALL="$ac_dir/install.sh -c"; break - fi - done -fi -if test -z "$INSTALL"; then - AC_ERROR([can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../..]) + test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl + INSTALL="$ac_cv_path_install" fi -AC_SUBST(INSTALL)dnl -AC_VERBOSE(setting INSTALL to $INSTALL) +dnl We do special magic for INSTALL instead of AC_SUBST, to get +dnl relative paths right. +AC_MSG_RESULT($INSTALL) -# Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}. +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' AC_SUBST(INSTALL_PROGRAM)dnl -AC_VERBOSE(setting INSTALL_PROGRAM to $INSTALL_PROGRAM) test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA)dnl -AC_VERBOSE(setting INSTALL_DATA to $INSTALL_DATA) -])dnl -dnl -define(AC_LN_S, -[AC_CHECKING(for ln -s) -rm -f conftestdata +]) + +AC_DEFUN(AC_PROG_LN_S, +[AC_MSG_CHECKING(whether ln -s works) +AC_CACHE_VAL(ac_cv_prog_LN_S, +[rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata - LN_S="ln -s" + ac_cv_prog_LN_S="ln -s" else - LN_S=ln -fi -AC_SUBST(LN_S) -])dnl -dnl -define(AC_RSH, -[AC_CHECKING(for remote shell) -if test -f /usr/ucb/rsh || test -f /usr/bin/remsh || test -f /usr/bin/rsh || - test -f /usr/bsd/rsh || test -f /usr/bin/nsh; then - RTAPELIB=rtapelib.o + ac_cv_prog_LN_S=ln +fi])dnl +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + AC_MSG_RESULT(yes) else - AC_HEADER_CHECK(netdb.h, AC_DEFINE(HAVE_NETDB_H) RTAPELIB=rtapelib.o, - AC_DEFINE(NO_REMOTE)) + AC_MSG_RESULT(no) fi -AC_SUBST(RTAPELIB)dnl -])dnl -dnl -dnl -dnl checks for header files -dnl -dnl -define(AC_STDC_HEADERS, +AC_SUBST(LN_S)dnl +]) + +define(AC_RSH, +[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code +)m4exit(4)]) + + +dnl ### Checks for header files + + +AC_DEFUN(AC_HEADER_STDC, [AC_REQUIRE_CPP()dnl -AC_CHECKING(for ANSI C header files) -AC_TEST_CPP([#include +AC_MSG_CHECKING(for ANSI C header files) +AC_CACHE_VAL(ac_cv_header_stdc, +[AC_TRY_CPP([#include #include #include -#include ], -[# SunOS 4.x string.h does not declare mem*, contrary to ANSI. -AC_HEADER_EGREP(memchr, string.h, -# SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -AC_TEST_PROGRAM([#include +#include ], ac_cv_header_stdc=yes, ac_cv_header_stdc=no) + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +AC_EGREP_HEADER(memchr, string.h, , ac_cv_header_stdc=no) +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +AC_EGREP_HEADER(free, stdlib.h, , ac_cv_header_stdc=no) +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +AC_TRY_RUN([#include #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e,f) (((e) && !(f)) || (!(e) && (f))) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } -], -[# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -AC_HEADER_EGREP(free, stdlib.h, AC_DEFINE(STDC_HEADERS))]))]) -])dnl -dnl -define(AC_UNISTD_H, [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(unistd.h)])AC_HEADER_CHECK(unistd.h, - AC_DEFINE(HAVE_UNISTD_H))])dnl -dnl -define(AC_USG, -[AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(string.h) and HAVE_STRING_H])AC_COMPILE_CHECK([BSD string and memory functions], -[#include ], [rindex(0, 0); bzero(0, 0);], , AC_DEFINE(USG))])dnl -dnl -dnl +], , ac_cv_header_stdc=no, ac_cv_header_stdc=no) +fi])dnl +AC_MSG_RESULT($ac_cv_header_stdc) +if test $ac_cv_header_stdc = yes; then + AC_DEFINE(STDC_HEADERS) +fi +]) + +AC_DEFUN(AC_UNISTD_H, +[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl +AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))]) + +AC_DEFUN(AC_USG, +[AC_OBSOLETE([$0], + [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl +AC_MSG_CHECKING([for BSD string and memory functions]) +AC_TRY_LINK([#include ], [rindex(0, 0); bzero(0, 0);], + [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])]) + + dnl If memchr and the like aren't declared in , include . dnl To avoid problems, don't check for gcc2 built-ins. -define(AC_MEMORY_H, -[AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(memory.h) and HAVE_MEMORY_H])AC_CHECKING(whether string.h declares mem functions) -AC_HEADER_EGREP(memchr, string.h, , - AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H)))] -)dnl -dnl -define(AC_MAJOR_HEADER, -[AC_COMPILE_CHECK([major, minor and makedev header], -[#include ], -[return makedev(0, 0);], ac_makedev=1) -if test -z "$ac_makedev"; then -AC_HEADER_CHECK(sys/mkdev.h, AC_DEFINE(MAJOR_IN_MKDEV) ac_makedev=1) -fi -if test -z "$ac_makedev"; then -AC_HEADER_CHECK(sys/sysmacros.h, AC_DEFINE(MAJOR_IN_SYSMACROS)) -fi] -)dnl -dnl -define(AC_DIR_HEADER, -[AC_PROVIDE([$0])AC_CHECKING(for directory library header) -ac_dir_header= -AC_DIR_HEADER_CHECK(dirent.h, DIRENT) -AC_DIR_HEADER_CHECK(sys/ndir.h, SYSNDIR) -AC_DIR_HEADER_CHECK(sys/dir.h, SYSDIR) -AC_DIR_HEADER_CHECK(ndir.h, NDIR) - -AC_CHECKING(for closedir return value) -AC_TEST_PROGRAM([#include -#include <$ac_dir_header> -int closedir(); main() { exit(closedir(opendir(".")) != 0); }], , -AC_DEFINE(VOID_CLOSEDIR)) +AC_DEFUN(AC_MEMORY_H, +[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl +AC_MSG_CHECKING(whether string.h declares mem functions) +AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no) +AC_MSG_RESULT($ac_found) +if test $ac_found = no; then + AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)]) +fi +]) + +AC_DEFUN(AC_HEADER_MAJOR, +[AC_MSG_CHECKING(whether sys/types.h defines makedev) +AC_CACHE_VAL(ac_cv_header_sys_types_h_makedev, +[AC_TRY_LINK([#include ], [return makedev(0, 0);], + ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no) ])dnl -dnl Subroutine of AC_DIR_HEADER. -dnl ??? I tried to put this define inside AC_DIR_HEADER, but when I did -dnl that, $1 and $2 did not get expanded. --roland -dnl Check if $1 is the winning directory library header file. -dnl It must not only exist, but also correctly define the `DIR' type. -dnl If it is really winning, define $2 and set shell var `ac_dir_header' to $1. -define(AC_DIR_HEADER_CHECK, [dnl -if test -z "$ac_dir_header"; then - AC_COMPILE_CHECK($1, [#include -#include <]$1[>], - [DIR *dirp = 0;], - AC_DEFINE($2) ac_dir_header=$1)dnl -fi])dnl -dnl -dnl -dnl checks for typedefs -dnl -dnl -define(AC_GETGROUPS_T, -[AC_REQUIRE([AC_UID_T])dnl -AC_CHECKING(for type of array argument to getgroups) -changequote(,)dnl -dnl Do not put single quotes in the C program text!! -ac_prog='/* Thanks to Mike Rendell for this test. */ +AC_MSG_RESULT($ac_cv_header_sys_types_h_makedev) + +if test $ac_cv_header_sys_types_h_makedev = no; then +AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)]) + + if test $ac_cv_header_sys_mkdev_h = no; then +AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)]) + fi +fi +]) + +AC_DEFUN(AC_HEADER_DIRENT, +[ac_header_dirent=no +AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h, + [ac_header_dirent=$ac_hdr; break]) +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir") +else +AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx") +fi +]) + +dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE +dnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't. +dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND) +AC_DEFUN(AC_CHECK_HEADER_DIRENT, +[ac_safe=`echo "$1" | tr './\055' '___'` +AC_MSG_CHECKING([for $1 that defines DIR]) +AC_CACHE_VAL(ac_cv_header_dirent_$ac_safe, +[AC_TRY_COMPILE([#include +#include <$1>], [DIR *dirp = 0;], + eval "ac_cv_header_dirent_$ac_safe=yes", + eval "ac_cv_header_dirent_$ac_safe=no")])dnl +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + $2 +else + AC_MSG_RESULT(no) +fi +]) + +dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that +dnl defines `DIR'. +dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION]) +AC_DEFUN(AC_CHECK_HEADERS_DIRENT, +[for ac_hdr in $1 +do +AC_CHECK_HEADER_DIRENT($ac_hdr, +[changequote(, )dnl + ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl +done]) + +AC_DEFUN(AC_DIR_HEADER, +[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break]) +done + +case "$ac_header_dirent" in +dirent.h) AC_DEFINE(DIRENT) ;; +sys/ndir.h) AC_DEFINE(SYSNDIR) ;; +sys/dir.h) AC_DEFINE(SYSDIR) ;; +ndir.h) AC_DEFINE(NDIR) ;; +esac + +AC_MSG_CHECKING(whether closedir returns void) +AC_CACHE_VAL(ac_cv_func_closedir_void, +[AC_TRY_RUN([#include +#include <$ac_header_dirent> +int closedir(); main() { exit(closedir(opendir(".")) != 0); }], + ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl +AC_MSG_RESULT($ac_cv_func_closedir_void) +if test $ac_cv_func_closedir_void = yes; then + AC_DEFINE(VOID_CLOSEDIR) +fi +]) + +AC_DEFUN(AC_HEADER_STAT, +[AC_MSG_CHECKING(whether stat file-mode macros are broken) +AC_CACHE_VAL(ac_cv_header_stat_broken, +[AC_EGREP_CPP([You lose], [#include +#include +#ifdef S_ISBLK +# if S_ISBLK (S_IFDIR) +You lose. +# endif +# ifdef S_IFCHR +# if S_ISBLK (S_IFCHR) +You lose. +# endif +# endif +#endif + +#ifdef S_ISLNK +# if S_ISLNK (S_IFREG) +You lose. +# endif +#endif + +#ifdef S_ISSOCK +# if S_ISSOCK (S_IFREG) +You lose. +# endif +#endif +], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])dnl +AC_MSG_RESULT($ac_cv_header_stat_broken) +if test $ac_cv_header_stat_broken = yes; then + AC_DEFINE(STAT_MACROS_BROKEN) +fi +]) + +AC_DEFUN(AC_DECL_SYS_SIGLIST, +[AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h]) +AC_CACHE_VAL(ac_cv_decl_sys_siglist, +[AC_TRY_COMPILE([#include +#include +/* NetBSD declares sys_siglist in unistd.h. */ +#ifdef HAVE_UNISTD_H +#include +#endif], [char *msg = *(sys_siglist + 1);], + ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])dnl +AC_MSG_RESULT($ac_cv_decl_sys_siglist) +if test $ac_cv_decl_sys_siglist = yes; then + AC_DEFINE(SYS_SIGLIST_DECLARED) +fi +]) + +AC_DEFUN(AC_HEADER_SYS_WAIT, +[AC_MSG_CHECKING([for sys/wait.h that is POSIX.1 compatible]) +AC_CACHE_VAL(ac_cv_header_sys_wait_h, +[AC_TRY_COMPILE([#include +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif], [int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;], +ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])dnl +AC_MSG_RESULT($ac_cv_header_sys_wait_h) +if test $ac_cv_header_sys_wait_h = yes; then + AC_DEFINE(HAVE_SYS_WAIT_H) +fi +]) + + +dnl ### Checks for typedefs + + +AC_DEFUN(AC_TYPE_GETGROUPS, +[AC_REQUIRE([AC_TYPE_UID_T])dnl +AC_MSG_CHECKING(type of array argument to getgroups) +AC_CACHE_VAL(ac_cv_type_getgroups, +[AC_TRY_RUN( +changequote(<<, >>)dnl +<< +/* Thanks to Mike Rendell for this test. */ #include #define NGID 256 #undef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) +#define MAX(x, y) ((x) > (y) ? (x) : (y)) main() { gid_t gidset[NGID]; @@ -406,89 +679,123 @@ main() /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short but getgroups modifies an array of ints. */ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); -}' -changequote([,])dnl -AC_TEST_PROGRAM([$ac_prog], - AC_DEFINE(GETGROUPS_T, gid_t), - AC_DEFINE(GETGROUPS_T, int)) -])dnl -dnl -define(AC_UID_T, -[AC_PROVIDE([$0])AC_CHECKING(for uid_t in sys/types.h) -AC_HEADER_EGREP(uid_t, sys/types.h, , - AC_DEFINE(uid_t, int) AC_DEFINE(gid_t, int))])dnl -dnl -define(AC_SIZE_T, -[AC_CHECKING(for size_t in sys/types.h) -AC_HEADER_EGREP(size_t, sys/types.h, , AC_DEFINE(size_t, unsigned))])dnl -dnl -define(AC_PID_T, -[AC_PROVIDE([$0])AC_CHECKING(for pid_t in sys/types.h) -AC_HEADER_EGREP(pid_t, sys/types.h, , AC_DEFINE(pid_t, int))])dnl -dnl -define(AC_OFF_T, -[AC_PROVIDE([$0])AC_CHECKING(for off_t in sys/types.h) -AC_HEADER_EGREP(off_t, sys/types.h, , AC_DEFINE(off_t, long))])dnl -dnl -define(AC_MODE_T, -[AC_CHECKING(for mode_t in sys/types.h) -AC_HEADER_EGREP(mode_t, sys/types.h, , AC_DEFINE(mode_t, int))])dnl -dnl -define(AC_RETSIGTYPE, -[AC_PROVIDE([$0])AC_COMPILE_CHECK([return type of signal handlers], -[#include +} +>>, +changequote([, ])dnl + ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int, + ac_cv_type_getgroups=cross) +if test $ac_cv_type_getgroups = cross; then + dnl When we can't run the test program (we are cross compiling), presume + dnl that has either an accurate prototype for getgroups or none. + dnl Old systems without prototypes probably use int. + AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h, + ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int) +fi])dnl +AC_MSG_RESULT($ac_cv_type_getgroups) +AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) +]) + +AC_DEFUN(AC_TYPE_UID_T, +[AC_MSG_CHECKING(for uid_t in sys/types.h) +AC_CACHE_VAL(ac_cv_type_uid_t, +[AC_EGREP_HEADER(uid_t, sys/types.h, + ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])dnl +AC_MSG_RESULT($ac_cv_type_uid_t) +if test $ac_cv_type_uid_t = no; then + AC_DEFINE(uid_t, int) + AC_DEFINE(gid_t, int) +fi +]) + +AC_DEFUN(AC_TYPE_SIZE_T, +[AC_CHECK_TYPE(size_t, unsigned)]) + +AC_DEFUN(AC_TYPE_PID_T, +[AC_CHECK_TYPE(pid_t, int)]) + +AC_DEFUN(AC_TYPE_OFF_T, +[AC_CHECK_TYPE(off_t, long)]) + +AC_DEFUN(AC_TYPE_MODE_T, +[AC_CHECK_TYPE(mode_t, int)]) + +dnl Note that identifiers starting with SIG are reserved by ANSI C. +AC_DEFUN(AC_TYPE_SIGNAL, +[AC_MSG_CHECKING([return type of signal handlers]) +AC_CACHE_VAL(ac_cv_type_signal, +[AC_TRY_COMPILE([#include #include #ifdef signal #undef signal #endif extern void (*signal ()) ();], -[int i;], -[AC_DEFINE(RETSIGTYPE, void)], -[AC_DEFINE(RETSIGTYPE, int)])] -)dnl -dnl -dnl -dnl checks for functions -dnl -dnl -define(AC_MMAP, [ -AC_CHECKING(for working mmap) -AC_TEST_PROGRAM([/* Thanks to Mike Haertel and Jim Avera for this test. */ +[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])dnl +AC_MSG_RESULT($ac_cv_type_signal) +AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal) +]) + + +dnl ### Checks for functions + + +AC_DEFUN(AC_FUNC_CLOSEDIR_VOID, +[AC_REQUIRE([AC_HEADER_DIRENT])dnl +AC_MSG_CHECKING(whether closedir returns void) +AC_CACHE_VAL(ac_cv_func_closedir_void, +[AC_TRY_RUN([#include +#include <$ac_header_dirent> +int closedir(); main() { exit(closedir(opendir(".")) != 0); }], + ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl +AC_MSG_RESULT($ac_cv_func_closedir_void) +if test $ac_cv_func_closedir_void = yes; then + AC_DEFINE(CLOSEDIR_VOID) +fi +]) + +AC_DEFUN(AC_FUNC_MMAP, +[AC_MSG_CHECKING(for working mmap) +AC_CACHE_VAL(ac_cv_func_mmap, +[AC_TRY_RUN([ +/* Thanks to Mike Haertel and Jim Avera for this test. */ #include #include #include #ifdef BSD -#ifndef BSD4_1 -#define HAVE_GETPAGESIZE -#endif +# ifndef BSD4_1 +# define HAVE_GETPAGESIZE +# endif #endif + #ifndef HAVE_GETPAGESIZE -#include -#ifdef EXEC_PAGESIZE -#define getpagesize() EXEC_PAGESIZE -#else -#ifdef NBPG -#define getpagesize() NBPG * CLSIZE -#ifndef CLSIZE -#define CLSIZE 1 -#endif /* no CLSIZE */ -#else /* no NBPG */ -#ifdef NBPC -#define getpagesize() NBPC -#else /* no NBPC */ -#define getpagesize() PAGESIZE /* SVR4 */ -#endif /* no NBPC */ -#endif /* no NBPG */ -#endif /* no EXEC_PAGESIZE */ -#endif /* not HAVE_GETPAGESIZE */ +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# else +# ifdef NBPC +# define getpagesize() NBPC +# else +# define getpagesize() PAGESIZE /* SVR4 */ +# endif +# endif +# endif +#endif #ifdef __osf__ -#define valloc malloc +# define valloc malloc #endif -extern char *valloc(); -extern char *malloc(); +#ifdef __cplusplus +extern "C" { void *valloc(unsigned), *malloc(unsigned); } +#else +char *valloc(), *malloc(); +#endif int main() @@ -498,9 +805,9 @@ main() int i2 = getpagesize()*2; int fd; - buf1 = valloc(i2); - buf2 = valloc(i); - buf3 = malloc(i2); + buf1 = (char *)valloc(i2); + buf2 = (char *)valloc(i); + buf3 = (char *)malloc(i2); for (j = 0; j < i2; ++j) *(buf1 + j) = rand(); fd = open("conftestmmap", O_CREAT | O_RDWR, 0666); @@ -511,7 +818,7 @@ main() exit(1); lseek(fd, (long)i, 0); read(fd, buf2, i); /* read into mapped memory -- file should not change */ - /* (it does in i386 SVR4.0 - Jim Avera) */ + /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */ lseek(fd, (long)0, 0); read(fd, buf3, i2); for (j = 0; j < i2; ++j) @@ -519,22 +826,27 @@ main() exit(1); exit(0); } -], AC_DEFINE(HAVE_MMAP)) -])dnl -dnl -define(AC_VPRINTF, -[AC_COMPILE_CHECK([vprintf], , [vprintf();], AC_DEFINE(HAVE_VPRINTF), -ac_vprintf_missing=1) -if test -n "$ac_vprintf_missing"; then -AC_COMPILE_CHECK([_doprnt], , [_doprnt();], AC_DEFINE(HAVE_DOPRNT)) +], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])dnl +AC_MSG_RESULT($ac_cv_func_mmap) +if test $ac_cv_func_mmap = yes; then + AC_DEFINE(HAVE_MMAP) fi -])dnl -dnl -define(AC_VFORK, -[AC_REQUIRE([AC_PID_T])AC_HEADER_CHECK(vfork.h, AC_DEFINE(HAVE_VFORK_H)) -AC_CHECKING(for working vfork) -AC_REQUIRE([AC_RETSIGTYPE]) -AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test. */ +]) + +AC_DEFUN(AC_FUNC_VPRINTF, +[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) +if test "$ac_cv_func_vprintf" != yes; then +AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) +fi +]) + +AC_DEFUN(AC_FUNC_VFORK, +[AC_REQUIRE([AC_TYPE_PID_T])dnl +AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) +AC_MSG_CHECKING(for working vfork) +AC_CACHE_VAL(ac_cv_func_vfork, +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */ #include #include #include @@ -545,22 +857,46 @@ AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test. */ #ifdef HAVE_VFORK_H #include #endif +/* On sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. + The compiler is told about this with #include , + but some compilers (e.g. gcc -O) don't grok . + Test for this by using a static variable whose address + is put into a register that is clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +#else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) + perror ("vfork"); + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} static int signalled; static RETSIGTYPE catch (s) int s; { signalled = 1; } main() { pid_t parent = getpid (); pid_t child; + sparc_address_test (); + signal (SIGINT, catch); child = vfork (); if (child == 0) { - /* On sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. - The compiler is told about this with #include , - but some compilers (e.g. gcc -O) don't grok . - Test for this by using lots of local variables, at least + /* Here is another test for sparc vfork register problems. + This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a sparc, but we use 8 to be safe. @@ -614,12 +950,17 @@ main() { || fstat(fileno(stdout), &st) != 0 ); } -}], , AC_DEFINE(vfork, fork)) -])dnl -dnl -define(AC_WAIT3, -[AC_CHECKING(for wait3 that fills in rusage) -AC_TEST_PROGRAM([#include +}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no, ac_cv_func_vfork=no)])dnl +AC_MSG_RESULT($ac_cv_func_vfork) +if test $ac_cv_func_vfork = no; then + AC_DEFINE(vfork, fork) +fi +]) + +AC_DEFUN(AC_FUNC_WAIT3, +[AC_MSG_CHECKING(for wait3 that fills in rusage) +AC_CACHE_VAL(ac_cv_func_wait3, +[AC_TRY_RUN([#include #include #include #include @@ -645,43 +986,52 @@ main() { exit(r.ru_nvcsw == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } -}], AC_DEFINE(HAVE_WAIT3)) -])dnl -dnl -define(AC_ALLOCA, -[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl +AC_MSG_RESULT($ac_cv_func_wait3) +if test $ac_cv_func_wait3 = yes; then + AC_DEFINE(HAVE_WAIT3) +fi +]) + +AC_DEFUN(AC_FUNC_ALLOCA, +[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -AC_COMPILE_CHECK(working alloca.h, [#include ], - [char *p = alloca(2 * sizeof(int));], AC_DEFINE(HAVE_ALLOCA_H)) -ac_decl="#ifdef __GNUC__ -#define alloca __builtin_alloca -#else -#if HAVE_ALLOCA_H -#include +AC_MSG_CHECKING([for working alloca.h]) +AC_CACHE_VAL(ac_cv_header_alloca_h, +[AC_TRY_LINK([#include ], [char *p = alloca(2 * sizeof(int));], + ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])dnl +AC_MSG_RESULT($ac_cv_header_alloca_h) +if test $ac_cv_header_alloca_h = yes; then + AC_DEFINE(HAVE_ALLOCA_H) +fi + +AC_MSG_CHECKING([for alloca]) +AC_CACHE_VAL(ac_cv_func_alloca, +[AC_TRY_LINK([ +#ifdef __GNUC__ +# define alloca __builtin_alloca #else -#ifdef _AIX +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX #pragma alloca -#else +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); +# endif +# endif +# endif #endif -#endif -#endif -" -AC_COMPILE_CHECK([alloca], $ac_decl, -[char *p = (char *) alloca(1);], [AC_DEFINE([HAVE_ALLOCA])], [dnl -ac_alloca_missing=1 -AC_PROGRAM_EGREP(winnitude, [ -#if defined(CRAY) && ! defined(CRAY2) -winnitude -#else -lossage -#endif -], -AC_FUNC_CHECK([_getb67],AC_DEFINE([CRAY_STACKSEG_END],[_getb67]), -AC_FUNC_CHECK([GETB67],AC_DEFINE([CRAY_STACKSEG_END],[GETB67]), -AC_FUNC_CHECK([getb67],AC_DEFINE([CRAY_STACKSEG_END],[getb67]))))) -]) -if test -n "$ac_alloca_missing"; then +], [char *p = (char *) alloca(1);], + ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])dnl +AC_MSG_RESULT($ac_cv_func_alloca) +if test $ac_cv_func_alloca = yes; then + AC_DEFINE(HAVE_ALLOCA) +fi + +if test $ac_cv_func_alloca = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, @@ -689,8 +1039,25 @@ if test -n "$ac_alloca_missing"; then ALLOCA=alloca.o AC_DEFINE(C_ALLOCA) - AC_CHECKING(stack direction for C alloca) - AC_TEST_PROGRAM([find_stack_direction () +AC_MSG_CHECKING(whether alloca needs Cray hooks) +AC_CACHE_VAL(ac_cv_os_cray, +[AC_EGREP_CPP(webecray, +[#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif +], ac_cv_os_cray=yes, ac_cv_os_cray=no)])dnl +AC_MSG_RESULT($ac_cv_os_cray) +if test $ac_cv_os_cray = yes; then +AC_CHECK_FUNC(_getb67, AC_DEFINE(CRAY_STACKSEG_END, _getb67), +AC_CHECK_FUNC(GETB67, AC_DEFINE(CRAY_STACKSEG_END, GETB67), +AC_CHECK_FUNC(getb67, AC_DEFINE(CRAY_STACKSEG_END, getb67)))) +fi + +AC_MSG_CHECKING(stack direction for C alloca) +AC_CACHE_VAL(ac_cv_c_stack_direction, +[AC_TRY_RUN([find_stack_direction () { static char *addr = 0; auto char dummy; @@ -705,120 +1072,155 @@ if test -n "$ac_alloca_missing"; then main () { exit (find_stack_direction() < 0); -}], dnl -AC_DEFINE(STACK_DIRECTION,1), AC_DEFINE(STACK_DIRECTION,-1), dnl -AC_DEFINE(STACK_DIRECTION,0)) +}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, + ac_cv_c_stack_direction=0)])dnl +AC_MSG_RESULT($ac_cv_c_stack_direction) +AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) fi AC_SUBST(ALLOCA)dnl -])dnl -dnl -define(AC_GETLOADAVG, +]) + +AC_DEFUN(AC_FUNC_GETLOADAVG, [# Some definitions of getloadavg require that the program be installed setgid. -AC_SUBST(NEED_SETGID)NEED_SETGID=false -ac_need_func=true +NEED_SETGID=false +AC_SUBST(NEED_SETGID)dnl +ac_have_func=no # Check for the 4.4BSD definition of getloadavg. -AC_HAVE_LIBRARY(util, LIBS="$LIBS -lutil" ac_need_func=false) +AC_CHECK_LIB(util, getloadavg, [LIBS="$LIBS -lutil" ac_have_func=yes # Some systems with -lutil have (and need) -lkvm as well, some do not. -AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm") +AC_CHECK_LIB(kvm, kvm_open, LIBS="$LIBS -lkvm")]) -if $ac_need_func; then +if test $ac_have_func = no; then # There is a commonly available library for RS/6000 AIX. # Since it is not a standard part of AIX, it might be installed locally. -LIBS_old="$LIBS" -LIBS="-L/usr/local/lib $LIBS" -AC_HAVE_LIBRARY(getloadavg, LIBS="$LIBS -lgetloadavg" ac_need_func=false, - LIBS="$LIBS_old") +ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" +AC_CHECK_LIB(getloadavg, getloadavg, LIBS="$LIBS -lgetloadavg", LIBS="$ac_save_LIBS") fi -# Make sure it is really in the library, if we think we found it at all. +# Make sure it is really in the library, if we think we found it. AC_REPLACE_FUNCS(getloadavg) -case "$LIBOBJS" in -*getloadavg*) -ac_need_func=true -AC_HEADER_CHECK(sys/dg_sys_info.h, [dnl -AC_DEFINE(DGUX) ac_need_func=false -# Some versions of DGUX need -ldgc for dg_sys_info. -AC_HAVE_LIBRARY(dgc)]) -if $ac_need_func; then +if test $ac_cv_func_getloadavg = yes; then + AC_DEFINE(HAVE_GETLOADAVG) +else +ac_have_func=no +AC_CHECK_HEADER(sys/dg_sys_info.h, +[ac_have_func=yes AC_DEFINE(DGUX) +AC_CHECK_LIB(dgc, dg_sys_info)]) +if test $ac_have_func = no; then # We cannot check for , because Solaris 2 does not use dwarf (it -# uses stabs), but it's still SVR4. We cannot check for because +# uses stabs), but it is still SVR4. We cannot check for because # Irix 4.0.5F has the header but not the library. -AC_HAVE_LIBRARY(elf, AC_DEFINE(SVR4) LIBS="$LIBS -lelf" ac_need_func=false - AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm")) +AC_CHECK_LIB(elf, elf_read, + [LIBS="$LIBS -lelf" ac_have_func=yes AC_DEFINE(SVR4) + AC_CHECK_LIB(kvm, kvm_open, LIBS="$LIBS -lkvm")]) fi -if $ac_need_func; then -AC_HEADER_CHECK(inq_stats/cpustats.h, AC_DEFINE(UMAX4_3) AC_DEFINE(UMAX) - ac_need_func=false) +if test $ac_have_func = no; then +AC_CHECK_HEADER(inq_stats/cpustats.h, + [ac_have_func=yes AC_DEFINE(UMAX) + AC_DEFINE(UMAX4_3)]) fi -if $ac_need_func; then -AC_HEADER_CHECK(sys/cpustats.h, AC_DEFINE(UMAX) ac_need_func=false) +if test $ac_have_func = no; then +AC_CHECK_HEADER(sys/cpustats.h, + [ac_have_func=yes AC_DEFINE(UMAX)]) fi -if $ac_need_func; then -AC_HAVE_HEADERS(mach/mach.h) +if test $ac_have_func = no; then +AC_CHECK_HEADERS(mach/mach.h) fi -AC_HEADER_CHECK(nlist.h, +AC_CHECK_HEADER(nlist.h, [AC_DEFINE(NLIST_STRUCT) -AC_COMPILE_CHECK(n_un in struct nlist, [#include ], +AC_MSG_CHECKING([for n_un in struct nlist]) +AC_CACHE_VAL(ac_cv_struct_nlist_n_un, +[AC_TRY_COMPILE([#include ], [struct nlist n; n.n_un.n_name = 0;], -AC_DEFINE(NLIST_NAME_UNION))])dnl +ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl +AC_MSG_RESULT($ac_cv_struct_nlist_n_un) +if test $ac_cv_struct_nlist_n_un = yes; then + AC_DEFINE(NLIST_NAME_UNION) +fi +])dnl -# Figure out whether we will need to install setgid. -AC_PROGRAM_EGREP([Yowza Am I SETGID yet], [dnl -#include "${srcdir}/getloadavg.c" +dnl FIXME two bugs here: +dnl Hardwiring the path of getloadavg.c in the top-level directory, +dnl and not checking whether a getloadavg from a library needs privileges. +AC_MSG_CHECKING(whether getloadavg requires setgid) +AC_CACHE_VAL(ac_cv_func_getloadavg_setgid, +[AC_EGREP_CPP([Yowza Am I SETGID yet], +[#include "$srcdir/getloadavg.c" #ifdef LDAV_PRIVILEGED Yowza Am I SETGID yet -#endif], [AC_DEFINE(GETLOADAVG_PRIVILEGED) NEED_SETGID=true])dnl -;; +#endif], + ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])dnl +AC_MSG_RESULT($ac_cv_func_getloadavg_setgid) +if test $ac_cv_func_getloadavg_setgid = yes; then + NEED_SETGID=true AC_DEFINE(GETLOADAVG_PRIVILEGED) +fi -*) AC_DEFINE(HAVE_GETLOADAVG) ;; -esac +fi # Do not have getloadavg in system libraries. -if $NEED_SETGID; then -AC_SUBST(KMEM_GROUP)dnl - # Figure out what group owns /dev/kmem. - # The installed program will need to be setgid and owned by that group. -changequote(,)dnl +if test "$NEED_SETGID" = true; then + AC_MSG_CHECKING(group of /dev/kmem) +AC_CACHE_VAL(ac_cv_group_kmem, +[changequote(, )dnl # On Solaris, /dev/kmem is a symlink. Get info on the real file. ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` # If we got an error (system does not support symlinks), try without -L. test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` - KMEM_GROUP=`echo $ac_ls_output \ + ac_cv_group_kmem=`echo $ac_ls_output \ | sed -ne 's/[ ][ ]*/ /g; s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; / /s/.* //;p;'` -changequote([,])dnl -fi +changequote([, ])dnl ])dnl -dnl -define(AC_UTIME_NULL, -[AC_CHECKING(utime with null argument) -rm -f conftestdata; > conftestdata + KMEM_GROUP=$ac_cv_group_kmem + AC_MSG_RESULT($KMEM_GROUP) +fi +AC_SUBST(KMEM_GROUP)dnl +]) + +AC_DEFUN(AC_FUNC_UTIME_NULL, +[AC_MSG_CHECKING(whether utime accepts a null argument) +AC_CACHE_VAL(ac_cv_func_utime_null, +[rm -f conftestdata; > conftestdata # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. -AC_TEST_PROGRAM([#include +AC_TRY_RUN([#include #include main() { struct stat s, t; exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime && t.st_mtime - s.st_mtime < 120)); -}], AC_DEFINE(HAVE_UTIME_NULL)) -rm -f core -])dnl -dnl -define(AC_STRCOLL, [AC_CHECKING(for strcoll) -AC_TEST_PROGRAM([#include +}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no, + ac_cv_func_utime_null=no) +rm -f core])dnl +AC_MSG_RESULT($ac_cv_func_utime_null) +if test $ac_cv_func_utime_null = yes; then + AC_DEFINE(HAVE_UTIME_NULL) +fi +]) + +AC_DEFUN(AC_FUNC_STRCOLL, +[AC_MSG_CHECKING(for strcoll) +AC_CACHE_VAL(ac_cv_func_strcoll, +[AC_TRY_RUN([#include main () { exit (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || strcoll ("123", "456") >= 0); -}], AC_DEFINE(HAVE_STRCOLL))])dnl -dnl -define(AC_SETVBUF_REVERSED, -[AC_TEST_PROGRAM([#include +}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])dnl +AC_MSG_RESULT($ac_cv_func_strcoll) +if test $ac_cv_func_strcoll = yes; then + AC_DEFINE(HAVE_STRCOLL) +fi +]) + +AC_DEFUN(AC_FUNC_SETVBUF_REVERSED, +[AC_MSG_CHECKING(whether setvbuf arguments are reversed) +AC_CACHE_VAL(ac_cv_func_setvbuf_reversed, +[AC_TRY_RUN([#include /* If setvbuf has the reversed format, exit 0. */ main () { /* This call has the arguments reversed. @@ -828,128 +1230,216 @@ main () { exit(1); putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ -}], AC_DEFINE(SETVBUF_REVERSED)) -rm -f core -])dnl -dnl -dnl -dnl checks for structure members -dnl -dnl -define(AC_STRUCT_TM, -[AC_PROVIDE([$0])AC_COMPILE_CHECK([struct tm in time.h], -[#include -#include ], -[struct tm *tp; tp->tm_sec;], , AC_DEFINE(TM_IN_SYS_TIME))])dnl -dnl -define(AC_TIME_WITH_SYS_TIME, -[AC_COMPILE_CHECK([whether time.h and sys/time.h may both be included], -[#include +}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no) +rm -f core])dnl +AC_MSG_RESULT($ac_cv_func_setvbuf_reversed) +if test $ac_cv_func_setvbuf_reversed = yes; then + AC_DEFINE(SETVBUF_REVERSED) +fi +]) + +AC_DEFUN(AC_FUNC_GETMNTENT, +[# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX. +AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun", + [AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")]) +AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])]) + +AC_DEFUN(AC_FUNC_STRFTIME, +[# strftime is in -lintl on SCO UNIX. +AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl") +AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)])]) + +AC_DEFUN(AC_FUNC_MEMCMP, +[AC_MSG_CHECKING(for 8-bit clean memcmp) +AC_CACHE_VAL(ac_cv_func_memcmp, +[AC_TRY_RUN([ +main() +{ + char c0 = 0x40, c1 = 0x80, c2 = 0x81; + exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1); +} +], ac_cv_func_memcmp=yes, ac_cv_func_memcmp=no, ac_cv_func_memcmp=no)])dnl +AC_MSG_RESULT($ac_cv_func_memcmp) +test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o" +AC_SUBST(LIBOBJS)dnl +]) + + +dnl ### Checks for structure members + + +AC_DEFUN(AC_HEADER_TIME, +[AC_MSG_CHECKING([whether time.h and sys/time.h may both be included]) +AC_CACHE_VAL(ac_cv_header_time, +[AC_TRY_COMPILE([#include #include #include ], -[struct tm *tp;], AC_DEFINE(TIME_WITH_SYS_TIME))])dnl -dnl -define(AC_TIMEZONE, -[AC_REQUIRE([AC_STRUCT_TM])ac_decl='#include -' -case "$DEFS" in - *TM_IN_SYS_TIME*) ac_decl="$ac_decl -#include -" ;; - *) ac_decl="$ac_decl -#include -" ;; -esac -AC_COMPILE_CHECK([tm_zone in struct tm], $ac_decl, -[struct tm tm; tm.tm_zone;], AC_DEFINE(HAVE_TM_ZONE), ac_no_tm_zone=1) -if test -n "$ac_no_tm_zone"; then -AC_COMPILE_CHECK(tzname, changequote(<<,>>)dnl +[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])dnl +AC_MSG_RESULT($ac_cv_header_time) +if test $ac_cv_header_time = yes; then + AC_DEFINE(TIME_WITH_SYS_TIME) +fi +]) + +AC_DEFUN(AC_STRUCT_TM, +[AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h]) +AC_CACHE_VAL(ac_cv_struct_tm, +[AC_TRY_COMPILE([#include +#include ], +[struct tm *tp; tp->tm_sec;], + ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])dnl +AC_MSG_RESULT($ac_cv_struct_tm) +if test $ac_cv_struct_tm = sys/time.h; then + AC_DEFINE(TM_IN_SYS_TIME) +fi +]) + +AC_DEFUN(AC_STRUCT_TIMEZONE, +[AC_REQUIRE([AC_STRUCT_TM])dnl +AC_MSG_CHECKING([for tm_zone in struct tm]) +AC_CACHE_VAL(ac_cv_struct_tm_zone, +[AC_TRY_COMPILE([#include +#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;], + ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])dnl +AC_MSG_RESULT($ac_cv_struct_tm_zone) +if test "$ac_cv_struct_tm_zone" = yes; then + AC_DEFINE(HAVE_TM_ZONE) +else + AC_MSG_CHECKING([for tzname]) +AC_CACHE_VAL(ac_cv_var_tzname, +[AC_TRY_LINK( +changequote(<<, >>)dnl <<#include #ifndef tzname /* For SGI. */ -extern char *tzname[]; /* RS6000 and others want it this way. */ -#endif>>, changequote([,])dnl -[atoi(*tzname);], AC_DEFINE(HAVE_TZNAME)) +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif>>, +changequote([, ])dnl +[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])dnl + AC_MSG_RESULT($ac_cv_var_tzname) + if test $ac_cv_var_tzname = yes; then + AC_DEFINE(HAVE_TZNAME) + fi fi -])dnl -dnl -define(AC_ST_BLOCKS, -[AC_COMPILE_CHECK([st_blocks in struct stat], -[#include +]) + +AC_DEFUN(AC_STRUCT_ST_BLOCKS, +[AC_MSG_CHECKING([for st_blocks in struct stat]) +AC_CACHE_VAL(ac_cv_struct_st_blocks, +[AC_TRY_COMPILE([#include #include ], [struct stat s; s.st_blocks;], -AC_DEFINE(HAVE_ST_BLOCKS), LIBOBJS="$LIBOBJS fileblocks.o")dnl +ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])dnl +AC_MSG_RESULT($ac_cv_struct_st_blocks) +if test $ac_cv_struct_st_blocks = yes; then + AC_DEFINE(HAVE_ST_BLOCKS) +else + LIBOBJS="$LIBOBJS fileblocks.o" +fi AC_SUBST(LIBOBJS)dnl -])dnl -dnl -define(AC_ST_BLKSIZE, -[AC_COMPILE_CHECK([st_blksize in struct stat], -[#include +]) + +AC_DEFUN(AC_STRUCT_ST_BLKSIZE, +[AC_MSG_CHECKING([for st_blksize in struct stat]) +AC_CACHE_VAL(ac_cv_struct_st_blksize, +[AC_TRY_COMPILE([#include #include ], [struct stat s; s.st_blksize;], -AC_DEFINE(HAVE_ST_BLKSIZE))])dnl -dnl -define(AC_ST_RDEV, -[AC_COMPILE_CHECK([st_rdev in struct stat], -[#include +ac_cv_struct_st_blksize=yes, ac_cv_struct_st_blksize=no)])dnl +AC_MSG_RESULT($ac_cv_struct_st_blksize) +if test $ac_cv_struct_st_blksize = yes; then + AC_DEFINE(HAVE_ST_BLKSIZE) +fi +]) + +AC_DEFUN(AC_STRUCT_ST_RDEV, +[AC_MSG_CHECKING([for st_rdev in struct stat]) +AC_CACHE_VAL(ac_cv_struct_st_rdev, +[AC_TRY_COMPILE([#include #include ], [struct stat s; s.st_rdev;], -AC_DEFINE(HAVE_ST_RDEV))])dnl -dnl -dnl -dnl checks for compiler characteristics -dnl -dnl -define(AC_CROSS_CHECK, -[AC_PROVIDE([$0])AC_CHECKING(whether cross-compiling) -# If we cannot run a trivial program, we must be cross compiling. -AC_TEST_PROGRAM([main(){exit(0);}], , cross_compiling=1) -])dnl -dnl -define(AC_CHAR_UNSIGNED, -[AC_CHECKING(for unsigned characters) -AC_TEST_PROGRAM( +ac_cv_struct_st_rdev=yes, ac_cv_struct_st_rdev=no)])dnl +AC_MSG_RESULT($ac_cv_struct_st_rdev) +if test $ac_cv_struct_st_rdev = yes; then + AC_DEFINE(HAVE_ST_RDEV) +fi +]) + + +dnl ### Checks for compiler characteristics + + +AC_DEFUN(AC_C_CROSS, +[# If we cannot run a trivial program, we must be cross compiling. +AC_MSG_CHECKING(whether cross-compiling) +AC_CACHE_VAL(ac_cv_c_cross, +[AC_TRY_RUN([main(){return(0);}], + ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl +cross_compiling=$ac_cv_c_cross +AC_MSG_RESULT($ac_cv_c_cross) +]) + +AC_DEFUN(AC_C_CHAR_UNSIGNED, +[AC_MSG_CHECKING(whether char is unsigned) +AC_CACHE_VAL(ac_cv_c_char_unsigned, +[if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. +AC_EGREP_CPP(yes, +[#ifdef __CHAR_UNSIGNED__ + yes +#endif +], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no) +else +AC_TRY_RUN( [/* volatile prevents gcc2 from optimizing the test away on sparcs. */ -#if !__STDC__ +#if !defined(__STDC__) || __STDC__ != 1 #define volatile #endif main() { -#ifdef __CHAR_UNSIGNED__ - exit(1); /* No need to redefine it. */ -#else volatile char c = 255; exit(c < 0); -#endif -}], AC_DEFINE(__CHAR_UNSIGNED__))] -)dnl -dnl -define(AC_LONG_DOUBLE, -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CHECKING(for long double) -if test -n "$GCC"; then -AC_DEFINE(HAVE_LONG_DOUBLE) +}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no) +fi])dnl +AC_MSG_RESULT($ac_cv_c_char_unsigned) +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + AC_DEFINE(__CHAR_UNSIGNED__) +fi +]) + +AC_DEFUN(AC_C_LONG_DOUBLE, +[AC_MSG_CHECKING(for long double) +AC_CACHE_VAL(ac_cv_c_long_double, +[if test "$GCC" = yes; then + ac_cv_c_long_double=yes else -AC_TEST_PROGRAM([int main() { +AC_TRY_RUN([int main() { /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ exit(sizeof(long double) < sizeof(double)); }], -AC_DEFINE(HAVE_LONG_DOUBLE)) +ac_cv_c_long_double=yes, ac_cv_c_long_double=no) +fi])dnl +AC_MSG_RESULT($ac_cv_c_long_double) +if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE) fi -])dnl -dnl -define(AC_INT_16_BITS, -[AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(int)]) -AC_CHECKING(integer size) -AC_TEST_PROGRAM([main() { exit(sizeof(int) != 2); }], - AC_DEFINE(INT_16_BITS)) -])dnl -dnl -define(AC_LONG_64_BITS, -[AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(long)]) -AC_CHECKING(for 64-bit long ints) -AC_TEST_PROGRAM([main() { exit(sizeof(long int) != 8); }], - AC_DEFINE(LONG_64_BITS)) -])dnl -dnl -define(AC_WORDS_BIGENDIAN, -[AC_CHECKING(byte ordering) -AC_TEST_PROGRAM([main () { +]) + +AC_DEFUN(AC_INT_16_BITS, +[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl +AC_MSG_CHECKING(whether int is 16 bits) +AC_TRY_RUN([main() { exit(sizeof(int) != 2); }], + [AC_MSG_RESULT(yes) + AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no)) +]) + +AC_DEFUN(AC_LONG_64_BITS, +[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl +AC_MSG_CHECKING(whether long int is 64 bits) +AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }], + [AC_MSG_RESULT(yes) + AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no)) +]) + +AC_DEFUN(AC_C_BIGENDIAN, +[AC_MSG_CHECKING(whether byte ordering is bigendian) +AC_CACHE_VAL(ac_cv_c_bigendian, +[AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { @@ -958,38 +1448,43 @@ AC_TEST_PROGRAM([main () { } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); -}], , AC_DEFINE(WORDS_BIGENDIAN)) -])dnl -dnl -define(AC_ARG_ARRAY, -[AC_CHECKING(whether the address of an argument can be used as an array) -AC_TEST_PROGRAM([main() { -/* Return 0 iff arg arrays are ok. */ -exit(!x(1, 2, 3, 4)); -} -x(a, b, c, d) { - return y(a, &b); -} -/* Return 1 iff arg arrays are ok. */ -y(a, b) int *b; { - return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4; -}], , AC_DEFINE(NO_ARG_ARRAY)) -rm -f core -])dnl -dnl -define(AC_INLINE, -[AC_REQUIRE([AC_PROG_CC])if test -n "$GCC"; then -AC_COMPILE_CHECK([inline], , [} inline foo() {], , AC_DEFINE(inline, __inline)) +}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)])dnl +AC_MSG_RESULT($ac_cv_c_bigendian) +if test $ac_cv_c_bigendian = yes; then + AC_DEFINE(WORDS_BIGENDIAN) fi -])dnl -define(AC_CONST, -[changequote(,)dnl -dnl Do not put single quotes in the C program text!! -ac_prog='/* Ultrix mips cc rejects this. */ +]) + +AC_DEFUN(AC_C_INLINE, +[AC_MSG_CHECKING([for inline]) +AC_CACHE_VAL(ac_cv_c_inline, +[if test "$GCC" = yes; then +AC_TRY_COMPILE(, [} inline foo() {], ac_cv_c_inline=yes, ac_cv_c_inline=no) +else + ac_cv_c_inline=no +fi])dnl +AC_MSG_RESULT($ac_cv_c_inline) +if test $ac_cv_c_inline = no; then + AC_DEFINE(inline, __inline) +fi +]) + +AC_DEFUN(AC_C_CONST, +[dnl This message is consistent in form with the other checking messages, +dnl and with the result message. +AC_MSG_CHECKING([for working const]) +AC_CACHE_VAL(ac_cv_c_const, +[AC_TRY_COMPILE(, +changequote(<<, >>)dnl +<< +/* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -1006,7 +1501,7 @@ ccp = (char const *const *) p; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25,17}; + int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } @@ -1022,41 +1517,51 @@ ccp = (char const *const *) p; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; -}' -changequote([,])dnl -AC_COMPILE_CHECK([dnl Do not "break" this again. -lack of working const], , [$ac_prog], , AC_DEFINE(const,))])dnl -dnl -dnl -dnl checks for operating system services -dnl -dnl -define(AC_HAVE_POUNDBANG, [dnl -AC_CHECKING(whether \`[#]!' works in shell scripts) -echo '#!/bin/cat +} +>>, +changequote([, ])dnl +ac_cv_c_const=yes, ac_cv_c_const=no)])dnl +AC_MSG_RESULT($ac_cv_c_const) +if test $ac_cv_c_const = no; then + AC_DEFINE(const, ) +fi +]) + +define(AC_ARG_ARRAY, +[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments +)m4exit(4)]) + + +dnl ### Checks for operating system services + + +AC_DEFUN(AC_SYS_INTERPRETER, +[# Pull the hash mark out of the macro call to avoid m4 problems. +ac_msg="whether #! works in shell scripts" +AC_MSG_CHECKING($ac_msg) +AC_CACHE_VAL(ac_cv_sys_interpreter, +[echo '#!/bin/cat exit 69 ' > conftest chmod u+x conftest -(SHELL=/bin/sh; export SHELL; ./conftest > /dev/null) +(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null) if test $? -ne 69; then - :; $1 + ac_cv_sys_interpreter=yes else - :; $2 -fi -rm -f conftest -])dnl -define(AC_REMOTE_TAPE, -[AC_CHECKING(for remote tape and socket header files) -AC_HEADER_CHECK(sys/mtio.h, AC_DEFINE(HAVE_SYS_MTIO_H) ac_have_mtio_h=1) -if test -n "$ac_have_mtio_h"; then -AC_TEST_CPP([#include -#include ], PROGS="$PROGS rmt") + ac_cv_sys_interpreter=no fi -])dnl -dnl -define(AC_LONG_FILE_NAMES, -[AC_CHECKING(for long file names) -ac_some_dir_failed=false +rm -f conftest])dnl +AC_MSG_RESULT($ac_cv_sys_interpreter) +]) + +define(AC_HAVE_POUNDBANG, +[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments +])m4exit(4)]) + +AC_DEFUN(AC_SYS_LONG_FILE_NAMES, +[AC_MSG_CHECKING(for long file names) +AC_CACHE_VAL(ac_cv_sys_long_file_names, +[ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen # /tmp where it might want to write temporary files @@ -1067,19 +1572,27 @@ ac_some_dir_failed=false # eval it to expand exec_prefix. for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue - test -w $ac_dir || continue # It's less confusing to not echo anything here. + test -w $ac_dir || continue # It is less confusing to not echo anything here. (echo 1 > $ac_dir/conftest9012345) 2>/dev/null (echo 2 > $ac_dir/conftest9012346) 2>/dev/null val=`cat $ac_dir/conftest9012345 2>/dev/null` - test -f $ac_dir/conftest9012345 && test "$val" = 1 || ac_some_dir_failed=true - rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2> /dev/null -done -$ac_some_dir_failed || AC_DEFINE(HAVE_LONG_FILE_NAMES) -])dnl -dnl -define(AC_RESTARTABLE_SYSCALLS, -[AC_CHECKING(for restartable system calls) -AC_TEST_PROGRAM( + if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then + ac_cv_sys_long_file_names=no + rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null + break + fi + rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null +done])dnl +AC_MSG_RESULT($ac_cv_sys_long_file_names) +if test $ac_cv_sys_long_file_names = yes; then + AC_DEFINE(HAVE_LONG_FILE_NAMES) +fi +]) + +AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS, +[AC_MSG_CHECKING(for restartable system calls) +AC_CACHE_VAL(ac_cv_sys_restartable_syscalls, +[AC_TRY_RUN( [/* Exit 0 (true) if wait returns something other than -1, i.e. the pid of the child, which means that wait was restarted after getting the signal. */ @@ -1094,27 +1607,58 @@ main () { if (status == -1) wait(&i); exit (status == -1); } -], AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)) -])dnl -dnl -define(AC_FIND_X, -[AC_REQUIRE_CPP()dnl Set CPP; we run AC_FIND_X_DIRECT conditionally. -AC_PROVIDE([$0])# If we find X, set shell vars x_includes and x_libraries to the paths. -no_x=true -if test "x$with_x" != xno; then -AC_FIND_X_XMKMF -if test -z "$ac_im_usrlibdir"; then -AC_FIND_X_DIRECT -fi -test -n "$x_includes" && AC_VERBOSE(X11 headers are in $x_includes) -test -n "$x_libraries" && AC_VERBOSE(X11 libraries are in $x_libraries) +], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])dnl +AC_MSG_RESULT($ac_cv_sys_restartable_syscalls) +if test $ac_cv_sys_restartable_syscalls = yes; then + AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS) fi -])dnl -dnl -dnl Internal subroutine of AC_FIND_X. -define(AC_FIND_X_XMKMF, -[AC_CHECKING(for X include and library files with xmkmf) -rm -fr conftestdir +]) + +AC_DEFUN(AC_PATH_X, +[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally. +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +AC_MSG_CHECKING(for X) + +AC_ARG_WITH(x, [ --with-x use the X Window System]) +if test "x$with_x" = xno; then + no_x=yes +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + no_x= + else +AC_CACHE_VAL(ac_cv_path_x, +[# One or both of the vars are not set, and there is no cached value. +no_x=yes +AC_PATH_X_XMKMF +if test "$no_x" = yes; then +AC_PATH_X_DIRECT +fi +if test "$no_x" = yes; then + ac_cv_path_x="no_x=yes" +else + ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi])dnl + fi + eval "$ac_cv_path_x" +fi # $with_x != no + +if test "$no_x" = yes; then + AC_MSG_RESULT(no) +else + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) +fi +]) + +dnl Internal subroutine of AC_PATH_X. +dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). +AC_DEFUN(AC_PATH_X_XMKMF, +[rm -fr conftestdir if mkdir conftestdir; then cd conftestdir # Make sure to not put "make" in the Imakefile rules, since we grep it out. @@ -1133,29 +1677,27 @@ EOF fi case "$ac_im_incroot" in /usr/include) ;; - *) test -z "$x_includes" && x_includes="$ac_im_incroot" ;; + *) ac_x_includes="$ac_im_incroot" ;; esac case "$ac_im_usrlibdir" in /usr/lib | /lib) ;; - *) test -z "$x_libraries" && x_libraries="$ac_im_usrlibdir" ;; + *) ac_x_libraries="$ac_im_usrlibdir" ;; esac fi cd .. rm -fr conftestdir fi -])dnl -dnl -dnl Internal subroutine of AC_FIND_X. -define(AC_FIND_X_DIRECT, -[AC_CHECKING(for X include and library files directly) -if test ".$x_direct_test_library" = . ; then - x_direct_test_library='Xt' -fi -if test ".$x_direct_test_include" = . ; then - x_direct_test_include='X11/Intrinsic.h' -fi -AC_TEST_CPP([#include <$x_direct_test_include>], no_x=, - for ac_dir in \ +]) + +dnl Internal subroutine of AC_PATH_X. +dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). +AC_DEFUN(AC_PATH_X_DIRECT, +[test -z "$x_direct_test_library" && x_direct_test_library=Xt +test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc +test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h +AC_TRY_CPP([#include <$x_direct_test_include>], +[no_x= ac_x_includes=], +[ for ac_dir in \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ @@ -1193,16 +1735,21 @@ AC_TEST_CPP([#include <$x_direct_test_include>], no_x=, ; \ do if test -r "$ac_dir/$x_direct_test_include"; then - test -z "$x_includes" && x_includes=$ac_dir - no_x= + no_x= ac_x_includes=$ac_dir break fi - done) + done]) -# Check for the libraries. First see if replacing the `include' by -# `lib' works. -AC_HAVE_LIBRARY("$x_direct_test_library", no_x=, -for ac_dir in `echo "$x_includes" | sed s/include/lib/` \ +# Check for the libraries. +# See if we find them without any special options. +# Don't add to $LIBS permanently. +ac_save_LIBS="$LIBS" +LIBS="$LIBS -l$x_direct_test_library" +AC_TRY_LINK(, [${x_direct_test_function}()], +[LIBS="$ac_save_LIBS" no_x= 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/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ @@ -1241,162 +1788,161 @@ for ac_dir in `echo "$x_includes" | sed s/include/lib/` \ do for ac_extension in a so sl; do if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - test -z "$x_libraries" && x_libraries=$ac_dir - no_x= + no_x= ac_x_libraries=$ac_dir break 2 fi done -done)])dnl -dnl +done])]) + dnl Find additional X libraries, magic flags, etc. -define(AC_FIND_XTRA, [AC_REQUIRE([AC_ISC_POSIX])AC_REQUIRE([AC_FIND_X]) -AC_CHECKING(for additional X libraries and flags) -if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" -elif test -n "$no_x"; then - # Not all programs may use this symbol, but it won't hurt to define it. +AC_DEFUN(AC_PATH_XTRA, +[AC_REQUIRE([AC_ISC_POSIX])dnl +AC_REQUIRE([AC_PATH_X])dnl +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING" -fi +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi -# It would be nice to have a more robust check for the -R ld option than -# just checking for Solaris. -# It would also be nice to do this for all -L options, not just this one. -if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - if test "`(uname) 2>/dev/null`" = SunOS \ - && uname -r | grep '^5' >/dev/null; then - X_LIBS="$X_LIBS -R$x_libraries" + # It would be nice to have a more robust check for the -R ld option than + # just checking for Solaris. + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + if test "`(uname) 2>/dev/null`" = SunOS && + uname -r | grep '^5' >/dev/null; then + X_LIBS="$X_LIBS -R$x_libraries" + fi fi -fi -# Check for additional X libraries. + # Check for libraries that X11R6 Xt/Xaw programs need. -if test -n "$ISC"; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" -else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu's Alpha - # needs dnet_stub (dnet doesn't exist). - AC_HAVE_LIBRARY(dnet, - [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" - ac_have_dnet=t]) - if test -z "$ac_have_dnet"; then - AC_HAVE_LIBRARY(dnet_stub, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) - fi - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT 2.0. - # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch. - if test "`(uname) 2>/dev/null`" != IRIX; then - AC_HAVE_LIBRARY(socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"]) + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + AC_CHECK_LIB(ICE, IceConnectionNumbers, + [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"]) + LDFLAGS="$ac_save_LDFLAGS" + + # Check for system-dependent libraries X programs must link with. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Not sure which flavor of 386 UNIX this is, but it seems harmless to + # check for it. + AC_CHECK_LIB(nsl, t_accept, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"]) + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT 2.0. + # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch. + if test "`(uname) 2>/dev/null`" != IRIX; then + AC_CHECK_LIB(socket, socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"]) + fi fi fi -# -AC_VERBOSE(X compiler flags: $X_CFLAGS) -AC_VERBOSE(X library flags: $X_LIBS) -AC_VERBOSE(extra X libraries: $X_EXTRA_LIBS) AC_SUBST(X_CFLAGS)dnl +AC_SUBST(X_PRE_LIBS)dnl AC_SUBST(X_LIBS)dnl AC_SUBST(X_EXTRA_LIBS)dnl -])dnl -dnl -dnl -dnl checks for UNIX variants -dnl -dnl -define(AC_AIX, -[AC_CHECKING(for AIX) -AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes, +]) + + +dnl ### Checks for UNIX variants +dnl These are kludges which should be replaced by a single POSIX check. + + +AC_DEFUN(AC_AIX, +[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 AIX) +AC_EGREP_CPP(yes, [#ifdef _AIX yes #endif -], AC_DEFINE(_ALL_SOURCE)) -])dnl -dnl -define(AC_MINIX, -[AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_HEADER_CHECK(minix/config.h, MINIX=1) -# The Minix shell can't assign to the same variable on the same line! -if test -n "$MINIX"; then +], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no)) +]) + +AC_DEFUN(AC_MINIX, +[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl +AC_BEFORE([$0], [AC_TRY_LINK])dnl +AC_BEFORE([$0], [AC_TRY_RUN])dnl +AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=) +if test "$MINIX" = yes; then AC_DEFINE(_POSIX_SOURCE) AC_DEFINE(_POSIX_1_SOURCE, 2) AC_DEFINE(_MINIX) fi -])dnl -dnl -define(AC_ISC_POSIX, -[AC_PROVIDE([$0])AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_CHECKING(for POSIXized ISC) +]) + +AC_DEFUN(AC_ISC_POSIX, +[AC_BEFORE([$0], [AC_TRY_LINK])dnl +AC_BEFORE([$0], [AC_TRY_LINK])dnl +AC_BEFORE([$0], [AC_TRY_RUN])dnl +AC_MSG_CHECKING(for POSIXized ISC) if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1 then - ISC=1 # If later tests want to check for ISC. + AC_MSG_RESULT(yes) + ISC=yes # If later tests want to check for ISC. AC_DEFINE(_POSIX_SOURCE) - if test -n "$GCC"; then + if test "$GCC" = yes; then CC="$CC -posix" else CC="$CC -Xp" fi +else + AC_MSG_RESULT(no) + ISC= fi -])dnl -dnl -define(AC_XENIX_DIR, -[AC_REQUIRE([AC_DIR_HEADER])AC_CHECKING(for Xenix) -AC_PROGRAM_EGREP(yes, +]) + +AC_DEFUN(AC_XENIX_DIR, +[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl +AC_REQUIRE([AC_DIR_HEADER])dnl +AC_MSG_CHECKING(for Xenix) +AC_EGREP_CPP(yes, [#if defined(M_XENIX) && !defined(M_UNIX) yes #endif -], XENIX=1) -if test -n "$XENIX"; then +], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=]) +if test "$XENIX" = yes; then + # Make sure -ldir precedes -lx. + test $ac_header_dirent = dirent.h && LIBS="$LIBS -ldir" LIBS="$LIBS -lx" - case "$DEFS" in - *SYSNDIR*) ;; - *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx. - esac fi -])dnl -dnl -define(AC_SCO_INTL, -[AC_HAVE_LIBRARY(intl, LIBS="$LIBS -lintl") -])dnl -dnl -define(AC_IRIX_SUN, -[AC_HAVE_LIBRARY(sun, LIBS="$LIBS -lsun") -])dnl -dnl -define(AC_DYNIX_SEQ, -[AC_HAVE_LIBRARY(seq, LIBS="$LIBS -lseq") -])dnl -dnl -define(AC_STAT_MACROS_BROKEN,[AC_CHECKING(for broken stat file mode macros) -AC_PROGRAM_EGREP([You lose], [#include -#include -#ifdef S_ISBLK -#if S_ISBLK (S_IFDIR) -You lose. -#endif -#ifdef S_IFCHR -#if S_ISBLK (S_IFCHR) -You lose. -#endif -#endif /* S_IFCHR */ -#endif /* S_ISBLK */ -#ifdef S_ISLNK -#if S_ISLNK (S_IFREG) -You lose. -#endif -#endif /* S_ISLNK */ -#ifdef S_ISSOCK -#if S_ISSOCK (S_IFREG) -You lose. -#endif -#endif /* S_ISSOCK */ -], AC_DEFINE(STAT_MACROS_BROKEN))])dnl -dnl -dnl -define(AC_SYS_SIGLIST_DECLARED,[dnl -AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h, - [#include -/* NetBSD declares sys_siglist in . */ -#ifdef HAVE_UNISTD_H -#include -#endif], [char *msg = *(sys_siglist + 1);], - AC_DEFINE(SYS_SIGLIST_DECLARED))])dnl -dnl +]) + +AC_DEFUN(AC_DYNIX_SEQ, +[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl +AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq") +]) + +AC_DEFUN(AC_IRIX_SUN, +[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT or AC_CHECK_LIB(sun, getpwnam)])dnl +AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun") +]) + +AC_DEFUN(AC_SCO_INTL, +[AC_OBSOLETE([$0], [; instead use AC_FUNC_STRFTIME])dnl +AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl") +]) diff --git a/src/util/autoconf/autoconf.info b/src/util/autoconf/autoconf.info index d0b9fe30b..90d19f92b 100644 --- a/src/util/autoconf/autoconf.info +++ b/src/util/autoconf/autoconf.info @@ -2,7 +2,7 @@ This is Info file autoconf.info, produced by Makeinfo-1.55 from the input file ./autoconf.texi. START-INFO-DIR-ENTRY -* autoconf: (autoconf). The Autoconf configuration system. +* Autoconf: (autoconf). Create source code configuration scripts. END-INFO-DIR-ENTRY This file documents the GNU Autoconf package for creating scripts to @@ -26,2893 +26,127 @@ versions, except that this permission notice may be stated in a translation approved by the Foundation.  -File: autoconf.info, Node: Top, Next: Introduction, Up: (dir) - - This file documents the GNU Autoconf package for creating scripts to -configure source code packages using templates and an `m4' macro -package. This is edition 1.11, for Autoconf version 1.11. - -* Menu: - -* Introduction:: Autoconf's purpose, strengths, and weaknesses. -* Distributing:: Legal restrictions on Autoconf output. -* Making configure Scripts:: How to organize and produce Autoconf scripts. -* Specific Tests:: Macros that check for particular features. -* General Purpose Macros:: Macros that check for kinds of features. -* Writing Macros:: How to add your own macros to Autoconf. -* Makefiles:: Information Autoconf uses in `Makefile's. -* Invoking configure:: How to use the Autoconf output. -* Example:: Sample Autoconf input files. -* Preprocessor Symbol Index:: Index of C preprocessor symbols defined. -* Macro Index:: Index of Autoconf macros. - - -- The Detailed Node Listing -- - -Making `configure' Scripts - -* Writing configure.in:: What to put in an Autoconf input file. -* Invoking autoconf:: How to create configuration scripts. -* Invoking autoheader:: How to create configuration header files. - -Specific Tests - -* Alternative Programs:: Selecting between alternative programs. -* Header Files:: Header files that might be missing. -* Typedefs:: `typedef's that might be missing. -* Library Functions:: C library functions that might be missing. -* Structures:: Structures or members that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special cases for specific UNIX variants. - -General Purpose Macros - -* Setup:: Controlling Autoconf operation. -* General Feature Tests:: Checking for kinds of features. -* Command Line:: Checking command line arguments. -* Setting Variables:: Setting shell and `make' variables. -* Printing Messages:: Notifying users of progress or problems. -* Language Choice:: Selecting which language to use for testing. -* Macro Ordering:: Enforcing ordering constraints. - -Writing Macros - -* Macro Format:: Basic format of an Autoconf macro. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. -* Checking for Files:: Finding whether a file exists. -* Checking for Symbols:: Finding whether a symbol is defined. -* Test Programs:: Writing programs to test for features. -* Multiple Cases:: Tests for several possible values. - -Dependencies Between Macros - -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. - -Test Programs - -* Guidelines:: General rules for writing test programs. -* Tricks:: Special ways to work around problems. - -Makefiles - -* Predefined Variables:: Heavily used `make' variables. -* Installation Prefixes:: A special variable substitution. -* VPATH Substitutions:: Compiling in a different directory. -* Automatic Remaking:: Makefile rules for configuring. - -Running `configure' Scripts - -* Overriding variables:: Workarounds for unusual systems. -* Invoking config.status:: Recreating a configuration. - -An Example - -* Sample configure.in:: An example of a `configure' template. -* Sample Makefile.in:: An example of a `Makefile' template. - - -File: autoconf.info, Node: Introduction, Next: Distributing, Prev: Top, Up: Top - -Introduction -************ - - Autoconf is a tool for producing shell scripts that automatically -configure software source code packages to adapt to many kinds of -UNIX-like systems. The configuration scripts produced by Autoconf are -independent of Autoconf when they are run, so their users do not need to -have Autoconf. - - The configuration scripts produced by Autoconf normally require no -manual user intervention when run; they do not even take an argument -specifying the system type. Instead, they test for the presence of each -feature that the software package they are for might need individually. -(Before each check, they print a one-line message stating what they are -checking for, so the user doesn't get too bored while waiting for the -script to finish.) As a result, they deal well with systems that are -hybrids or customized from the more common UNIX variants. There is no -need to maintain files that list the features supported by each release -of each variant of UNIX. - - For each software package that Autoconf is used with, it creates a -configuration script from a template file that lists the operating -system features that the package can use. After the shell code to -recognize and respond to an operating system feature has been written, -Autoconf allows it to be shared by many software packages that can use -(or need) that feature. If it later turns out that the shell code -needs adjustment for some reason, it needs to be changed in only one -place; all of the the configuration scripts can be regenerated -automatically to take advantage of the updated code. - - Larry Wall's Metaconfig package is similar in purpose to Autoconf, -but is more general. The scripts it produces require manual user -intervention, which is quite inconvenient when configuring large source -trees. - - Unlike Metaconfig scripts, Autoconf scripts can support -cross-compiling, if some care is taken in writing them. They should -avoid executing test programs, since test programs compiled with a -cross-compiler can not be executed on the host system. Also, they -shouldn't do anything that tests features of the host system instead of -the target system. - - Autoconf imposes some restrictions on the names of macros used with -`#ifdef' in C programs (*note Preprocessor Symbol Index::.). - - Autoconf requires GNU `m4' in order to generate the scripts. It -uses features that some UNIX versions of `m4' do not have. It also -overflows internal limits of some versions of `m4', including GNU `m4' -1.0; so use a later version of GNU `m4'. - - Autoconf does not work well with GNU C library releases before 1.06. -The GNU C library contains stubs (which always return an error) for -functions that are not available instead of omitting them from the -library. As a result, Autoconf scripts are fooled into thinking that -those functions are available. This problem does not exist with -releases 1.06 and later of the GNU C library, which define C -preprocessor macros that the Autoconf macros `AC_FUNC_CHECK' and -`AC_REPLACE_FUNCS' test, indicating that certain functions are stubs -(*note General Feature Tests::., for more information on checking for -functions). - - Autoconf was written by David MacKenzie, with help from Franc,ois -Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, Roland McGrath, -Noah Friedman, and david d zuhn. It was inspired by Brian Fox's -automatic configuration system for Bash, by Larry Wall's Metaconfig, and -by Richard Stallman, Richard Pixley, and John Gilmore's configuration -tools for the GNU compiler and object file utilities. - - Mail suggestions and bug reports for Autoconf to -`bug-gnu-utils@prep.ai.mit.edu'. Please include the Autoconf version -number, which you can get by running `autoconf --version'. - - -File: autoconf.info, Node: Distributing, Next: Making configure Scripts, Prev: Introduction, Up: Top - -Distributing Autoconf Output -**************************** - - The configuration scripts that Autoconf produces are covered by the -GNU General Public License. This is because they consist almost -entirely of parts of Autoconf itself, rearranged somewhat, and Autoconf -is distributed under the terms of the GPL. As applied to Autoconf, the -GPL just means that you need to distribute `configure.in', and -`aclocal.m4', `acconfig.h', and `CONFIG.h.top' and `CONFIG.h.bot' if -you use them, along with `configure'. - - Programs that use Autoconf scripts to configure themselves do not -automatically come under the GPL. Distributing an Autoconf -configuration script as part of a program is considered to be *mere -aggregation* of that work with the Autoconf script. Such programs are -not derivative works based on Autoconf; only their configuration scripts -are. We still encourage software authors to distribute their work under -terms like those of the GPL, but doing so is not required to use -Autoconf. - - -File: autoconf.info, Node: Making configure Scripts, Next: Specific Tests, Prev: Distributing, Up: Top - -Making `configure' Scripts -************************** - - The configuration scripts that Autoconf produces are by convention -called `configure'. When run, `configure' creates several files, -replacing configuration parameters in them with values appropriate for -the system being configured. The files that `configure' creates are: - - * one or more `Makefile' files (one in each subdirectory of the - package), from template `Makefile.in' files (*note Makefiles::.); - - * optionally, a C header file, the name of which is configurable, - containing `#define' statements (*note Setup::.); - - * a shell script called `config.status' that, when run, will recreate - the files listed above (*note Invoking config.status::.). - - To create a `configure' script with Autoconf, you need to write an -Autoconf input file (`configure.in') and run Autoconf on it to produce -the script. If you write your own feature tests to supplement those -that come with Autoconf, you might also write a file called -`aclocal.m4'. If you use a C header file to contain `#define' -directives, you might also write `config.h.top', `config.h.bot', and -`acconfig.h', and you will distribute the Autoconf-generated file -`config.h.in' with the package. - - Here is a diagram showing how the files that can be used in -configuration are produced. Programs that are executed are suffixed by -`*'. Optional files are enclosed in square brackets (`[]'). -`autoconf' and `autoheader' also read the installed files -`acgeneral.m4' and `acspecific.m4', and also an installed `aclocal.m4' -if it exists. - -Files used in preparing a software package for distribution: - configure.in --. .------> autoconf* -----> configure - +---+ - [aclocal.m4] --' `---. - +--> [autoheader*] -> [config.h.in] - [acconfig.h] ----. | - +-----' - [config.h.top] --+ - [config.h.bot] --' - - Makefile.in -------------------------------> Makefile.in - -Files used in configuring a software package: - configure* ------------. - | - [config.h.in] -. v .-> [config.h] -. - +--> config.status* -+ +--> make* - Makefile.in ---' `-> Makefile ---' - -* Menu: - -* Writing configure.in:: What to put in an Autoconf input file. -* Invoking autoconf:: How to create configuration scripts. -* Invoking autoheader:: How to create configuration header files. - - -File: autoconf.info, Node: Writing configure.in, Next: Invoking autoconf, Up: Making configure Scripts - -Writing `configure.in' -====================== - - To produce a `configure' script for a software package, create a -file called `configure.in' that contains invocations of the Autoconf -macros that test the system features your package needs or can use. -Autoconf macros already exist to check for many features; see *Note -Specific Tests::, for their descriptions. For most other features, you -can use Autoconf template macros to produce custom checks; see *Note -General Feature Tests::, for information about them. For especially -tricky or specialized features, `configure.in' might need to contain -some hand-crafted shell commands. *Note Writing Macros::, for -guidelines on writing tests from scratch. - - Every `configure.in' must begin with a call to `AC_INIT' and end -with a call to `AC_OUTPUT' (*note Setup::.). Other than that, the -order in which `configure.in' calls the Autoconf macros is generally -not important, except that some macros rely on other macros having been -called first, because they check previously set values of some -variables to decide what to do. These macros are noted in the -individual descriptions (*note Specific Tests::.). - - To encourage consistency, here is a suggested order for calling the -Autoconf macros. A few macros need to be called in a different order -from the one given here; they are noted in their individual descriptions -(*note Specific Tests::.). Note that there must not be any space -between the macro name and the open parentheses. - - `AC_INIT(FILE)' - checks for alternative programs - checks for UNIX variants that set C preprocessor variables - checks for header files - checks for typedefs - checks for library functions - checks for structures - checks for compiler characteristics - checks for system services - other checks for UNIX variants - `AC_OUTPUT([FILE...])' - - You can include comments in `configure.in' files by starting them -with the `m4' predefined macro `dnl', which discards text up through -the next newline. These comments do not appear in the generated -`configure' scripts. For example, it is helpful to begin -`configure.in' files with a line like this: - - dnl Process this file with autoconf to produce a configure script. - - *Note Sample configure.in::, for an example of a real `configure.in' -script. - - -File: autoconf.info, Node: Invoking autoconf, Next: Invoking autoheader, Prev: Writing configure.in, Up: Making configure Scripts - -Invoking `autoconf' -=================== - - To create `configure' from `configure.in', run the `autoconf' -program with no arguments. `autoconf' processes `configure.in' with -the `m4' macro processor, using the Autoconf macros. If you give -`autoconf' an argument, it reads that file instead of `configure.in' -and writes the configuration script to the standard output instead of -to `configure'. If you give `autoconf' the argument `-', it reads the -standard input instead of `configure.in' and writes the configuration -script on the standard output. - - The Autoconf macros are defined in two or more files. Two of the -files are distributed with Autoconf: `autoconf' first reads -`acgeneral.m4' (*note General Purpose Macros::.), then `acspecific.m4' -(*note Specific Tests::.). After reading them, `autoconf' looks for an -optional file called `aclocal.m4', first in the directory that contains -other installed Autoconf macro files, and then in the current -directory. If both files exist, it uses both of them. Those files can -contain your site's own locally written Autoconf macro definitions -(*note Writing Macros::., for more information). If a macro is defined -in more than one of the files that `autoconf' reads, the last -definition it reads overrides the earlier ones. - - You can override the directory where `autoconf' looks for the -installed macro files by setting the `AC_MACRODIR' environment variable -to a different directory. You can also give `autoconf' the -`--macrodir' option, which overrides `AC_MACRODIR'. - - `autoconf' also accepts the options `--version', which prints the -Autoconf version number and exits, and `--help', which prints a summary -of the command-line options and exits. - - -File: autoconf.info, Node: Invoking autoheader, Prev: Invoking autoconf, Up: Making configure Scripts - -Invoking `autoheader' -===================== - - You can use the `autoheader' program to create a template file of C -`#define' statements for `configure' to use. By default, the file that -`autoheader' creates is called `config.h.in'; if `configure.in' invokes -`AC_CONFIG_HEADER(FILE)', `autoheader' creates `FILE.in'. - - `autoheader' scans `configure.in' and figures out which C -preprocessor symbols it might define. It copies comments and `#define' -and `#undef' statements from a file called `acconfig.h', which comes -with and is installed with Autoconf. It also uses a file called -`acconfig.h' in the current directory, if present; you must create that -file to contain entries for any additional symbols that you -`AC_DEFINE'. For symbols defined by `AC_HAVE_HEADERS', -`AC_HAVE_FUNCS', `AC_SIZEOF_TYPE', or `AC_HAVE_LIBRARY', `autoheader' -generates comments and `#undef' statements itself rather than copying -them from a file, since the possible symbols are effectively limitless. - - The file that `autoheader' creates usually contains only `#define' -and `#undef' statements and their accompanying comments. However, if a -file called `FILE.top' (typically `config.h.top') exists in the current -directory, `autoheader' copies that file to the beginning of its output. - - If you give `autoheader' an argument, it uses that file instead of -`configure.in' and writes the header file to the standard output -instead of to `config.h.in'. If you give `autoheader' an argument of -`-', it reads the standard input instead of `configure.in' and writes -the header file to the standard output. - - You can override the directory where `autoheader' looks for the -installed macro and `acconfig.h' files by setting the `AC_MACRODIR' -environment variable to a different directory. You can also give -`autoheader' the `--macrodir' option, which overrides `AC_MACRODIR'. - - `autoheader' also accepts the options `--version', which prints the -Autoconf version number and exits, and `--help', which prints a summary -of the command-line options and exits. - - -File: autoconf.info, Node: Specific Tests, Next: General Purpose Macros, Prev: Making configure Scripts, Up: Top - -Specific Tests -************** - - These macros test for particular operating system features that -packages might need or want to use. If you need to test for a feature -that none of these macros check for, you can probably do it by calling -one of the general purpose test macros with appropriate arguments -(*note General Feature Tests::.). - - All of these macros that set `make' variables call `AC_SUBST' on -those variables (*note Setting Variables::., for details about -`AC_SUBST'). The phrase "define NAME" is used below as a shorthand to -mean either add `-DNAME=1' to the `make' variable `DEFS', or put -`#define NAME 1' in the configuration header file, depending on whether -`AC_CONFIG_HEADER' has been called. *Note Setting Variables::, for -more information. - - Within each section below, the macros are listed in alphabetical -order. The macros are generally named for the `make' variables or C -preprocessor macros that they define; those names are based largely on -what existing GNU programs use. These macros are defined in the file -`acspecific.m4'. - -* Menu: - -* Alternative Programs:: Selecting between alternative programs. -* Header Files:: Header files that might be missing. -* Typedefs:: `typedef's that might be missing. -* Library Functions:: C library functions that might be missing. -* Structures:: Structures or members that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special cases for specific UNIX variants. - - -File: autoconf.info, Node: Alternative Programs, Next: Header Files, Up: Specific Tests - -Alternative Programs -==================== - - The following macros check for the presence or behavior of particular -programs: - - - Macro: AC_GCC_TRADITIONAL - Add `-traditional' to `make' variable `CC' if using the GNU C - compiler and `ioctl' does not work properly without - `-traditional'. This macro calls `AC_PROG_CC' and `AC_PROG_CPP' - if they haven't been called already. - - - Macro: AC_LN_S - If `ln -s' works on the current filesystem (the O.S. and filesystem - support symbolic links), set shell and `make' variable `LN_S' to - `ln -s', otherwise set it to `ln'. - - - Macro: AC_MINUS_C_MINUS_O - If the C compiler does not accept the `-c' and `-o' options - simultaneously, define `NO_MINUS_C_MINUS_O'. - - - Macro: AC_PROG_AWK - Check for `mawk', `gawk', `nawk', and `awk', in that order, and - set `make' variable `AWK' to the first one that it finds. - - - Macro: AC_PROG_CC - If `gcc' is found, set `make' variable `CC' to `gcc', and set - shell variable `GCC' to 1 for use by macros such as - `AC_GCC_TRADITIONAL'. - - - Macro: AC_PROG_CPP - Set shell and `make' variable `CPP' to a command that runs the C - preprocessor. If `$CC -E' doesn't work, it uses `/lib/cpp'. It - is only portable to run `CPP' on files with a `.c' extension. - - If the current language is C (*note Language Choice::.), many of - the specific test macros use the value of `CPP' indirectly by - calling `AC_TEST_CPP', `AC_HEADER_CHECK', `AC_HEADER_EGREP', or - `AC_PROGRAM_EGREP'. Those macros call this macro first if it - hasn't been called already. It calls `AC_PROG_CC' if it hasn't - been called already. - - - Macro: AC_PROG_CXX - Determine a C++ compiler to use. Check if the environment variable - CXX or CCC (in that order) is set; if so, set `make' variable - `CXX' to its value. Otherwise search for a C++ compiler under - likely names (`c++', `g++', `gcc', and `CC'). If none of those - checks succeed, as a last resort set `CXX' to `gcc'. - - - Macro: AC_PROG_CXXCPP - Set shell and `make' variable `CXXCPP' to a command that runs the - C++ preprocessor. If `$CXX -E' doesn't work, it uses `/lib/cpp'. - It is only portable to run `CXXCPP' on files with a `.C' or `.cc' - extension. - - If the current language is C++ (*note Language Choice::.), many of - the specific test macros use the value of `CXXCPP' indirectly by - calling `AC_TEST_CPP', `AC_HEADER_CHECK', `AC_HEADER_EGREP', or - `AC_PROGRAM_EGREP'. Those macros call this macro first if it - hasn't been called already. This macro calls `AC_PROG_CXX' if it - hasn't been called already. - - - Macro: AC_PROG_INSTALL - Set `make' variable `INSTALL' to `install -c' if `install' is - found and is compatible with the BSD and GNU versions. Otherwise, - set `INSTALL' to `DIR/install.sh -c', where it checks for - `install.sh' in the directories `$srcdir', `$srcdir/..', and - `$srcdir/../..' to determine DIR. - - This macro screens out the false matches `/etc/install', - `/usr/sbin/install', and other instances of `install' known not to - work. It also sets the variable `INSTALL_PROGRAM' to `${INSTALL}' - and `INSTALL_DATA' to `${INSTALL} -m 644'. - - If you need to use your own `install.sh' because it has features - not found in standard `install' programs, there is no reason to use - `AC_PROG_INSTALL'; just put the pathname of your script into your - `Makefile.in' files. - - - Macro: AC_PROG_LEX - If `flex' is found, set `make' variable `LEX' to `flex' and - `LEXLIB' to `-lfl', if that library is in a standard place. - Otherwise set `LEX' to `lex' and `LEXLIB' to `-ll'. - - - Macro: AC_PROG_RANLIB - Set `make' variable `RANLIB' to `ranlib' if `ranlib' is found, - otherwise to `:' (do nothing). - - - Macro: AC_PROG_YACC - If `bison' is found, set `make' variable `YACC' to `bison -y'. - Otherwise, if `byacc' is found, set `YACC' to `byacc'. Otherwise - set `YACC' to `yacc'. - - - Macro: AC_RSH - If a remote shell is available, put `rtapelib.o' in `make' - variable `RTAPELIB'. Otherwise, also do so if `netdb.h' exists - (implying the `rexec' function), and in addition define - `HAVE_NETDB_H'. If neither a remote shell nor `rexec' is - available, define `NO_REMOTE'. - - - Macro: AC_SET_MAKE - If `make' predefines the variable `MAKE', define `make' variable - `SET_MAKE' to be empty. Otherwise, define `SET_MAKE' to contain - `MAKE=make'. Calls `AC_SUBST' for `SET_MAKE'. - - In recent versions of `make', the variable `MAKE' contains the - name of the `make' program plus options it was given. It is used - when running `make' recursively in subdirectories. But some old - versions of `make' don't set the `MAKE' variable. This macro - allows use of `MAKE' on all systems. - - If you use this macro, simply place a line like this in your - `Makefile.in' file(s): - - @SET_MAKE@ - - - Macro: AC_YYTEXT_POINTER - Define `YYTEXT_POINTER' if `yytext' is a `char *' instead of a - `char []'. This depends on whether `lex' or `flex' is being used. - This macro calls `AC_PROG_CPP' (or `AC_PROG_CXXCPP' if C++ is the - current language, *note Language Choice::.) and `AC_PROG_LEX' if - they haven't been called already. - - This macro replaces `AC_DECLARE_YYTEXT', which didn't work. - - -File: autoconf.info, Node: Header Files, Next: Typedefs, Prev: Alternative Programs, Up: Specific Tests - -Header Files -============ - - The following macros check for the presence of certain C header -files: - - - Macro: AC_DIR_HEADER - If the system has `dirent.h', define `DIRENT'; otherwise, if it - has `sys/ndir.h', define `SYSNDIR'; otherwise, if it has - `sys/dir.h', define `SYSDIR'; otherwise, if it has `ndir.h', - define `NDIR'. Also, if the directory library header file - contains a declaration of the `closedir' function with a `void' - return type, define `VOID_CLOSEDIR'. - - The directory library declarations in the source code should look - something like the following, which assumes that you have also - called `AC_HAVE_HEADERS(unistd.h)': - - #ifdef HAVE_UNISTD_H - #include - #include - #endif - - /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */ - #if defined(DIRENT) || defined(_POSIX_VERSION) - #include - #define NLENGTH(dirent) (strlen((dirent)->d_name)) - #else /* not (DIRENT or _POSIX_VERSION) */ - #define dirent direct - #define NLENGTH(dirent) ((dirent)->d_namlen) - #ifdef SYSNDIR - #include - #endif /* SYSNDIR */ - #ifdef SYSDIR - #include - #endif /* SYSDIR */ - #ifdef NDIR - #include - #endif /* NDIR */ - #endif /* not (DIRENT or _POSIX_VERSION) */ - - Using the above declarations, the program would declare variables - to be type `struct dirent', not `struct direct', and would access - the length of a directory entry name by passing a pointer to a - `struct dirent' to the `NLENGTH' macro. - - - Macro: AC_MAJOR_HEADER - If `sys/types.h' does not define `major', `minor', and `makedev', - but `sys/mkdev.h' does, define `MAJOR_IN_MKDEV'; otherwise, if - `sys/sysmacros.h' does, define `MAJOR_IN_SYSMACROS'. - - - Macro: AC_MEMORY_H - Define `NEED_MEMORY_H' if `memcpy', `memcmp', etc. are not - declared in `string.h' and `memory.h' exists. This macro is - obsolete; instead, use `AC_HAVE_HEADERS(memory.h)'. See the - example for `AC_STDC_HEADERS'. - - - Macro: AC_STDC_HEADERS - Define `STDC_HEADERS' if the system has ANSI C header files. - Specifically, this macro checks for `stdlib.h', `stdarg.h', - `string.h', and `float.h'; if the system has those, it probably - has the rest of the ANSI C header files. This macro also checks - whether `string.h' declares `memchr' (and thus presumably the - other `mem' functions), whether `stdlib.h' declare `free' (and - thus presumably `malloc' and other related functions), and whether - the `ctype.h' macros work on characters with the high bit set, as - ANSI C requires. - - Use `STDC_HEADERS' instead of `__STDC__' to determine whether the - system has ANSI-compliant header files (and probably C library - functions) because many systems that have GCC do not have ANSI C - header files. - - To check whether to use the System V/ANSI C string functions and - header file, you can put the following in `configure.in': - - AC_STDC_HEADERS - AC_HAVE_HEADERS(string.h memory.h) - - Then, in the code, use a test like this: - - #if STDC_HEADERS || HAVE_STRING_H - #include - /* An ANSI string.h and pre-ANSI memory.h might conflict. */ - #if !STDC_HEADERS && HAVE_MEMORY_H - #include - #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ - #define index strchr - #define rindex strrchr - #define bcopy(s, d, n) memcpy ((d), (s), (n)) - #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) - #define bzero(s, n) memset ((s), 0, (n)) - #else /* not STDC_HEADERS and not HAVE_STRING_H */ - #include - /* memory.h and strings.h conflict on some systems. */ - #endif /* not STDC_HEADERS and not HAVE_STRING_H */ - - This example asssumes that your code uses the BSD style functions. - If you use the System V/ANSI C style functions, you will need to - replace the macro definitions with ones that go in the other - direction. - - This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on - which language is current, *note Language Choice::.), if it hasn't - been called already. - - - Macro: AC_UNISTD_H - Define `HAVE_UNISTD_H' if the system has `unistd.h'. This macro - is obsolete; instead, use `AC_HAVE_HEADERS(unistd.h)'. - - The way to check if the system supports POSIX.1 is: - - #if HAVE_UNISTD_H - #include - #include - #endif - - #ifdef _POSIX_VERSION - /* Code for POSIX.1 systems. */ - #endif - - `_POSIX_VERSION' is defined when `unistd.h' is included on POSIX.1 - systems. If there is no `unistd.h', it is definitely not a - POSIX.1 system. However, some non-POSIX.1 systems do have - `unistd.h'. - - - Macro: AC_USG - Define `USG' if the system does not have `strings.h', `rindex', - `bzero', etc. This implies that it has `string.h', `strrchr', - `memset', etc. - - The symbol `USG' is obsolete. Instead of this macro, use - `AC_HAVE_HEADERS(string.h)' and use `HAVE_STRING_H' in your code. - See the example for `AC_STDC_HEADERS'. - - - Macro: AC_SYS_SIGLIST_DECLARED - Define `SYS_SIGLIST_DECLARED' if the variable `sys_siglist' is - declared in a system header file, either `signal.h' or `unistd.h'. - - -File: autoconf.info, Node: Typedefs, Next: Library Functions, Prev: Header Files, Up: Specific Tests - -Typedefs -======== - - The following macros check for predefined C types: - - - Macro: AC_GETGROUPS_T - Define `GETGROUPS_T' to be whichever of `gid_t' or `int' is the - base type of the array argument to `getgroups'. - - - Macro: AC_MODE_T - If `mode_t' is not defined in `sys/types.h', define `mode_t' to be - `int'. - - - Macro: AC_OFF_T - If `off_t' is not defined in `sys/types.h', define `off_t' to be - `long'. - - - Macro: AC_PID_T - If `pid_t' is not defined in `sys/types.h', define `pid_t' to be - `int'. - - - Macro: AC_RETSIGTYPE - If `signal.h' declares `signal' as returning a pointer to a - function returning `void', define `RETSIGTYPE' to be `void'; - otherwise, define it to be `int'. - - Define signal handlers as returning type `RETSIGTYPE': - - RETSIGTYPE - hup_handler () - { - ... - } - - - Macro: AC_SIZE_T - If `size_t' is not defined in `sys/types.h', define `size_t' to be - `unsigned'. - - - Macro: AC_UID_T - If `uid_t' is not defined in `sys/types.h', define `uid_t' to be - `int' and `gid_t' to be `int'. - - -File: autoconf.info, Node: Library Functions, Next: Structures, Prev: Typedefs, Up: Specific Tests - -Library Functions -================= - - The following macros check for particular C library functions: - - - Macro: AC_ALLOCA - Check how to get `alloca'. Tries to get a builtin version by - checking for `alloca.h' or the predefined C preprocessor macros - `__GNUC__' and `_AIX'. If that fails, it looks for a function in - the standard C library. If that fails, it sets the `make' - variable `ALLOCA' to `alloca.o' and defines `C_ALLOCA' (so - programs can periodically call `alloca(0)' to garbage collect). - This variable is separate from `LIBOBJS' so multiple programs can - share the value of `ALLOCA' without needing to create an actual - library, in case only some of them use the code in `LIBOBJS'. - - If this macro finds `alloca.h', it defines `HAVE_ALLOCA_H'. - - This macro does not try to get `alloca' from the SVR3 `libPW' or - the SVR4 `libucb' because those libraries contain some - incompatible functions that cause trouble. Some versions do not - even contain `alloca' or contain a buggy version. If you still - want to use their `alloca', use `ar' to extract `alloca.o' from - them instead of compiling `alloca.c'. - - Source files that use `alloca' should start with a piece of code - like the following, to declare it properly. Note that in some - versions of AIX, the declaration of `alloca' must precede - everything else except for comments and preprocessor directives. - The `#pragma' directive is indented so that pre-ANSI C compilers - will ignore it, rather than choke on it. - - /* AIX requires this to be the first thing in the file. */ - #ifdef __GNUC__ - #define alloca __builtin_alloca - #else /* not __GNUC__ */ - #if HAVE_ALLOCA_H - #include - #else /* not HAVE_ALLOCA_H */ - #ifdef _AIX - #pragma alloca - #else /* not _AIX */ - char *alloca (); - #endif /* not _AIX */ - #endif /* not HAVE_ALLOCA_H */ - #endif /* not __GNUC__ */ - - - Macro: AC_GETLOADAVG - Check how to get the system load averages. If the system has the - `getloadavg' function, this macro defines `HAVE_GETLOADAVG', and - adds to `LIBS' any libraries needed to get that function. - - Otherwise, it adds `getloadavg.o' to the `make' variable - `LIBOBJS', and possibly defines several other C preprocessor - macros and `make' variables: - - 1. It defines `SVR4', `DGUX', `UMAX', or `UMAX4_3' if on those - systems. - - 2. If it finds `nlist.h', it defines `NLIST_STRUCT'. - - 3. If `struct nlist' has an `n_un' member, it defines - `NLIST_NAME_UNION'. - - 4. If compiling `getloadavg.c' defines `LDAV_PRIVILEGED', - programs need to be installed specially on this system for - `getloadavg' to work, and this macro defines - `GETLOADAVG_PRIVILEGED'. - - 5. This macro always defines `NEED_SETGID', for `make'. The - value is `true' if special installation is required, `false' - if not. If `NEED_SETGID' is `true', it sets `KMEM_GROUP' to - the name of the group that should own the installed program. - - - Macro: AC_MMAP - If the `mmap' function exists and works correctly, define - `HAVE_MMAP'. - - - Macro: AC_SETVBUF_REVERSED - If `setvbuf' takes the buffering type as its second argument and - the buffer pointer as the third, instead of the other way around, - define `SETVBUF_REVERSED'. This is the case on System V before - release 3. - - - Macro: AC_STRCOLL - If the `strcoll' function exists and works correctly, define - `HAVE_STRCOLL'. This does a bit more than - `AC_HAVE_FUNCS(strcoll)', because some systems have incorrect - definitions of `strcoll', which should not be used. - - - Macro: AC_UTIME_NULL - If `utime(FILE, NULL)' sets FILE's timestamp to the present, - define `HAVE_UTIME_NULL'. - - - Macro: AC_VFORK - If `vfork.h' is found, define `HAVE_VFORK_H'. If a working - `vfork' is not found, define `vfork' to be `fork'. This macro - checks for several known errors in implementations of `vfork' and - considers the system to not have a working `vfork' if it detects - any of them. - - - Macro: AC_VPRINTF - If `vprintf' is found, define `HAVE_VPRINTF'. Otherwise, if - `_doprnt' is found, define `HAVE_DOPRNT'. (If `vprintf' is - available, you may assume that `vfprintf' and `vsprintf' are also - available.) - - - Macro: AC_WAIT3 - If `wait3' is found and fills in the contents of its third argument - (a `struct rusage *'), which HP-UX does not do, define - `HAVE_WAIT3'. - - -File: autoconf.info, Node: Structures, Next: Compiler Characteristics, Prev: Library Functions, Up: Specific Tests - -Structures -========== - - The following macros check for certain structures or structure -members: - - - Macro: AC_STAT_MACROS_BROKEN - If the macros `S_ISDIR', `S_ISREG' et al. defined in `sys/stat.h' - do not work properly (returning false positives), define - `STAT_MACROS_BROKEN'. This is the case on Tektronix UTekV, Amdahl - UTS and Motorola System V/88. - - - Macro: AC_ST_BLKSIZE - If `struct stat' contains an `st_blksize' member, define - `HAVE_ST_BLKSIZE'. - - - Macro: AC_ST_BLOCKS - If `struct stat' contains an `st_blocks' member, define - `HAVE_ST_BLOCKS'. Otherwise, add `fileblocks.o' to the `make' - variable `LIBOBJS'. - - - Macro: AC_ST_RDEV - If `struct stat' contains an `st_rdev' member, define - `HAVE_ST_RDEV'. - - - Macro: AC_TIME_WITH_SYS_TIME - If a program may include both `time.h' and `sys/time.h', define - `TIME_WITH_SYS_TIME'. On some older systems, `sys/time.h' - includes `time.h', but `time.h' is not protected against multiple - inclusion, so programs should not explicitly include both files. - This macro is useful in programs that use, for example, `struct - timeval' or `struct timezone' as well as `struct tm'. It is best - used in conjunction with `HAVE_SYS_TIME_H'. - - #ifdef TIME_WITH_SYS_TIME - #include - #include - #else - #ifdef HAVE_SYS_TIME_H - #include - #else - #include - #endif - #endif - - - Macro: AC_STRUCT_TM - If `time.h' does not define `struct tm', define `TM_IN_SYS_TIME', - which means that including `sys/time.h' defines `struct tm'. - - - Macro: AC_TIMEZONE - Figure out how to get the current timezone. If `struct tm' has a - `tm_zone' member, define `HAVE_TM_ZONE'. Otherwise, if the - external array `tzname' is found, define `HAVE_TZNAME'. This - macro calls `AC_STRUCT_TM' if it hasn't been called already. - - -File: autoconf.info, Node: Compiler Characteristics, Next: System Services, Prev: Structures, Up: Specific Tests - -Compiler Characteristics -======================== - - The following macros check for C compiler or machine architecture -features: - - - Macro: AC_ARG_ARRAY - If the address of an argument to a C function can not be used like - the start of an array, define `NO_ARG_ARRAY'. This ability allows - a sequence of arguments with the same type to be accessed as if - they were an array of values. - - - Macro: AC_CROSS_CHECK - If the C compiler being used does not produce executables that can - run on the system where `configure' is being run, set the shell - variable `cross_compiling' to 1. This information can be used by - `AC_TEST_PROGRAM' to determine whether to take a default action - instead of trying to run a test program (*note General Feature - Tests::.). - - - Macro: AC_CHAR_UNSIGNED - If the C type `char' is unsigned, define `__CHAR_UNSIGNED__', - unless the C compiler predefines it. - - - Macro: AC_CONST - If the C compiler does not fully support the keyword `const', - define `const' to be empty. Some C compilers that do not define - `__STDC__' do support `const'; some compilers that define - `__STDC__' do not completely support `const'. Programs can simply - use `const' as if every C compiler supported it; for those that - don't, the `Makefile' or configuration header file will define it - as empty. (If using a configuration header file, the program - should include it before any other header files, to prevent - inconsistencies in declarations.) - - - Macro: AC_INLINE - If the C compiler is a version of GCC that supports the keyword - `__inline' but not `inline' (such as some NeXT versions), define - `inline' to be `__inline'. This macro calls `AC_PROG_CC' if it - hasn't been called already. - - - Macro: AC_INT_16_BITS - If the C type `int' is 16 bits wide, define `INT_16_BITS'. This - macro is obsolete; it is more general to use `AC_SIZEOF_TYPE(int)' - instead (*note General Feature Tests::.). - - - Macro: AC_LONG_64_BITS - If the C type `long int' is 64 bits wide, define `LONG_64_BITS'. - This macro is obsolete; it is more general to use - `AC_SIZEOF_TYPE(long)' instead (*note General Feature Tests::.). - - - Macro: AC_LONG_DOUBLE - If the C compiler supports the `long double' type, define - `HAVE_LONG_DOUBLE'. Some C compilers that do not define - `__STDC__' do support the `long double' type; some compilers that - define `__STDC__' do not support `long double'. - - - Macro: AC_WORDS_BIGENDIAN - If words are stored with the most significant byte first (like - Motorola and SPARC, but not Intel and VAX, CPUs), define - `WORDS_BIGENDIAN'. - - -File: autoconf.info, Node: System Services, Next: UNIX Variants, Prev: Compiler Characteristics, Up: Specific Tests - -System Services -=============== - - The following macros check for operating system services: - - - Macro: AC_FIND_X - Try to locate the X Window System include files and libraries. Try - first by running `xmkmf' on a trivial `Imakefile' and examining - the `Makefile' that it produces. If that fails (such as if - `xmkmf' is not present), look for them in several directories - where they often reside. If either method is successful, set the - shell variables `x_includes' and `x_libraries' to their locations, - unless they are in directories the compiler searches by default. - - If both methods fail, or the user gave the command line option - `--without-x', set the shell variable `no_x' to `true'; otherwise - set it to the empty string. - - The command line options `--x-includes=DIR' and - `--x-libraries=DIR' override the values chosen by this macro. - - - Macro: AC_FIND_XTRA - An enhanced version of `AC_FIND_X'. Put the C compiler flags that - X needs into `make' variable `X_CFLAGS', and the X linker flags - into `X_LIBS'. If X is not available, put `-DX_DISPLAY_MISSING' - into `X_CFLAGS'. - - Also check for special libraries that some systems need in order to - compile X programs. Add any that the system needs to `make' - variable `X_EXTRA_LIBS'. This macro calls `AC_FIND_X' and - `AC_ISC_POSIX' (*note UNIX Variants::.) if they have not already - been called. Because of the macro dependencies, if you call this - macro, you should let it call `AC_FIND_X' rather than doing that - yourself. - - - Macro: AC_HAVE_POUNDBANG (ACTION-IF-SUPPORTED [, - ACTION-IF-NOT-SUPPORTED]) - Check whether the system supports starting shell scripts with a - line of the form `#!/bin/csh' to select the shell to use. If `#!' - works, execute shell commands ACTION-IF-SUPPORTED; if not, execute - ACTION-IF-NOT-SUPPORTED. - - - Macro: AC_LONG_FILE_NAMES - If the system supports file names longer than 14 characters, define - `HAVE_LONG_FILE_NAMES'. - - - Macro: AC_REMOTE_TAPE - If BSD tape drive ioctls are available, define `HAVE_SYS_MTIO_H', - and if sockets are available add `rmt' to `make' variable `PROGS'. - - - Macro: AC_RESTARTABLE_SYSCALLS - If the system automatically restarts a system call that is - interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'. - - -File: autoconf.info, Node: UNIX Variants, Prev: System Services, Up: Specific Tests - -UNIX Variants -============= - - The following macros check for certain operating systems that need -special treatment for some programs, due to exceptional oddities in -their header files or libraries: - - - Macro: AC_AIX - If on AIX, define `_ALL_SOURCE'. Allows the use of some BSD - functions. Should be called before any macros that run the C - compiler. - - - Macro: AC_DYNIX_SEQ - If on DYNIX/ptx (Sequent UNIX), add `-lseq' to `make' variable - `LIBS'. Allows use of some BSD system calls and `getmntent'. - - - Macro: AC_IRIX_SUN - If on IRIX (Silicon Graphics UNIX), add `-lsun' to `make' variable - `LIBS'. Needed to get `getmntent'. At sites using Yellow - Pages/NIS, it is also needed to get properly working `gethostby*', - `getpw*', `getgr*', `getnetby*', and so on. - - - Macro: AC_ISC_POSIX - If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add - `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers) - to `make' variable `CC'. This allows the use of POSIX facilities. - Must be called after `AC_PROG_CC' and before any other macros - that run the C compiler. - - - Macro: AC_MINIX - If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define - `_POSIX_1_SOURCE' to be 2. This allows the use of POSIX - facilities. Should be called before any macros that run the C - compiler. - - - Macro: AC_SCO_INTL - If on SCO UNIX, add `-lintl' to `make' variable `LIBS'. Used to - get `strftime'. It must be called before checking for `strftime'. - - - Macro: AC_XENIX_DIR - If on Xenix, define `VOID_CLOSEDIR' and add `-lx' to `make' - variable `LIBS'. Also, if `sys/ndir.h' is not being used, add - `-ldir' to `LIBS'. Needed when using the directory reading - functions. This macro must be called after `AC_DIR_HEADER'. - - -File: autoconf.info, Node: General Purpose Macros, Next: Writing Macros, Prev: Specific Tests, Up: Top - -General Purpose Macros -********************** - - These macros provide ways for other macros to control the kind of -output that Autoconf produces or to check whether various kinds of -features are available. They all take arguments. When calling these -macros, there must not be any blank space between the macro name and -the open parentheses. - - Arguments to these macros can be more than one line long if they are -enclosed within the `m4' quote characters `[' and `]'. - - Within each section below, the macros are listed in alphabetical -order. These macros are defined in the file `acgeneral.m4'. - -* Menu: - -* Setup:: Controlling Autoconf operation. -* General Feature Tests:: Checking for kinds of features. -* Command Line:: Checking command line arguments. -* Setting Variables:: Setting shell and `make' variables. -* Printing Messages:: Notifying users of progress or problems. -* Language Choice:: Selecting which language to use for testing. -* Macro Ordering:: Enforcing ordering constraints. - - -File: autoconf.info, Node: Setup, Next: General Feature Tests, Up: General Purpose Macros - -Controlling Autoconf Setup -========================== - - The following macros control the kind of output that Autoconf -produces. - - - Macro: AC_CONFIG_HEADER (HEADER-TO-CREATE ...) - Make `AC_OUTPUT' create the file(s) in the whitespace-separated - list HEADER-TO-CREATE containing C preprocessor `#define' - statements and replace `@DEFS@' in generated files with - `-DHAVE_CONFIG_H' instead of the value of `DEFS'. This macro - should be called right after `AC_INIT'. The usual name for - HEADER-TO-CREATE is `config.h'. - - If HEADER-TO-CREATE already exists and its contents are identical - to what `AC_OUTPUT' would put in it, it is left alone. Doing this - allows some changes in configuration without needlessly causing - object files that depend on the header file to be recompiled. - - Your distribution should contain a file `HEADER-TO-CREATE.in' that - looks as you want the final header file to look, including - comments, with default values in the `#define' statements. A - default value can be to `#undef' the variable instead of to define - it to a value, if your code tests for configuration options using - `#ifdef' instead of `#if'. - - You can use the program `autoheader' to create - `HEADER-TO-CREATE.in' (*note Invoking autoheader::.). - - - Macro: AC_INIT (UNIQUE-FILE-IN-SOURCE-DIR) - Process the command-line arguments and find the source code - directory. UNIQUE-FILE-IN-SOURCE-DIR is some file that is in the - package's source directory; `configure' checks for this file's - existence to make sure that the directory that it is told contains - the source code in fact does (*note Invoking configure::., for - more information). - - - Macro: AC_OUTPUT ([FILE...] [,EXTRA-CMDS]) - Create output files (typically one or more `Makefile's) and - `config.status'. If `AC_CONFIG_HEADER' has been called, also - create the header file that was named as its argument. The - argument is a whitespace-separated list of files to create; if it - is omitted, no files are created. `AC_OUTPUT' creates each file - `FILE' in the list by copying `FILE.in', substituting the variable - values that have been selected by calling `AC_SUBST'. It creates - the directory that each file is in if it doesn't exist (but not the - parents of that directory). A plausible value for the argument to - `AC_OUTPUT' is `Makefile src/Makefile man/Makefile X/Imakefile'. - - If you pass EXTRA-CMDS, those commands will be inserted into - `config.status' to be run after all its other processing. - - - Macro: AC_PREPARE (UNIQUE-FILE-IN-SOURCE-DIR) - Find the source code directory and set up shell variables - necessary for other Autoconf macros to work. - uNIQUE-FILE-IN-SOURCE-DIR is some file that is in the package's - source directory; `configure' checks for this file's existence to - make sure that the directory that it is told contains the source - code in fact does (*note Invoking configure::., for more - information). `AC_PREPARE' is the last thing done by `AC_INIT'. - Use `AC_PREPARE' instead of `AC_INIT' if you want to do argument - parsing yourself; never use both. - - - Macro: AC_PREREQ (VERSION) - Ensure that a recent enough version of Autoconf is being used. If - the version of Autoconf being used to create `configure' is earlier - than VERSION (e.g., `1.8'), print an error message on the standard - error output and do not create `configure'. - - This macro is useful if your `configure.in' relies on non-obvious - behavior that changed between Autoconf releases. If it merely - needs recently added macros, then `AC_PREREQ' is less useful, - because the `autoconf' program already tells the user which macros - are not found. The same thing happens if `configure.in' is - processed by a version of Autoconf older than when `AC_PREREQ' was - added. - - - Macro: AC_REVISION (REVISION-INFO) - Copy revision stamp REVISION-INFO into the `configure' script, - with any dollar signs or double-quotes removed. This macro lets - you put a revision stamp from `configure.in' into `configure' - without RCS or CVS changing it when you check in `configure'. That - way, you can determine easily which revision of `configure.in' a - particular `configure' corresponds to. - - It is a good idea to call this macro before `AC_INIT' so that the - revision number is near the top of both `configure.in' and - `configure'. To support doing that, the `AC_REVISION' output - begins with `#!/bin/sh', like the normal start of a `configure' - script does. - - For example, this line in `configure.in': - - AC_REVISION($Revision$)dnl - - produces this in `configure': - - #!/bin/sh - # From configure.in Revision: 1.30 - - -File: autoconf.info, Node: General Feature Tests, Next: Command Line, Prev: Setup, Up: General Purpose Macros - -Checking for Kinds of Features -============================== - - These macros are templates that, when called with actual parameters, -check for various kinds of features. Many of these macros handle two -cases: what to do if the given condition is met, and what to do if the -condition is not met. In some places you you might want to do something -if a condition is true but do nothing if it's false, or vice versa. To -omit the true case, pass an empty value for the ACTION-IF-FOUND -argument to the macro. To omit the false case, omit the -ACTION-IF-NOT-FOUND argument to the macro, including the comma before -it. - - One shell programming construction that you should not use in the -action arguments to these macros is `VAR=${VAR:-VALUE}'. Old BSD -shells, including the Ultrix `sh', don't understand the colon, and -complain and die. If you omit the colon, it works fine: -`VAR=${VAR-VALUE}'. Using the form without the colon has one small -disadvantage. Users can not select a default value by giving a -variable an empty value, e.g., `CC= configure'. Instead, they must -unset the variable, e.g., `unset CC; configure'. - - *Note Writing Macros::, for more information on how best to use these -macros. - - - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY, - ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) - Print `checking for ECHO-TEXT' to the standard output (using - `AC_CHECKING', *note Printing Messages::.). Create a test C - program to see whether a function whose body consists of - FUNCTION-BODY can be compiled and linked; INCLUDES is any - `#include' statements needed by the code in FUNCTION-BODY. If the - file compiles and links successfully, run shell commands - ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. - - - Macro: AC_FUNC_CHECK (FUNCTION, ACTION-IF-FOUND [, - ACTION-IF-NOT-FOUND]) - If FUNCTION is available, run shell commands ACTION-IF-FOUND, - otherwise ACTION-IF-NOT-FOUND. If the functions might be in - libraries other than the default C library, first call - `AC_HAVE_LIBRARY' for those libraries. If you just want to define - a symbol if the function is available, consider using - `AC_HAVE_FUNCS' instead. - - - Macro: AC_HAVE_FUNCS (FUNCTION...) - For each given FUNCTION in the whitespace-separated argument list - that is available, define `HAVE_FUNCTION' (in all caps). *Note - Specific Tests::, for a precise definition of "define" as it is - used here. If the functions might be in libraries other than the - default C library, first call `AC_HAVE_LIBRARY' for those - libraries. - - - Macro: AC_HAVE_HEADERS (HEADER-FILE...) - For each given HEADER-FILE in the whitespace-separated argument - list that exists, define `HAVE_HEADER-FILE' (in all caps). *Note - Specific Tests::, for a precise definition of "define" as it is - used here. - - - Macro: AC_HAVE_LIBRARY (LIBRARY [, ACTION-IF-FOUND [, - ACTION-IF-NOT-FOUND]]) - Create a test C program to see whether that program can be linked - with the specified library. ACTION-IF-FOUND is a list of shell - commands to run if the link succeeds (which means that the library - is present); ACTION-IF-NOT-FOUND is a list of shell commands to run - if the link fails. If ACTION-IF-FOUND and ACTION-IF-NOT-FOUND are - not specified, the default action is to add `-lfoo' to `LIBS' and - define `HAVE_LIBfoo' for library `foo'. LIBRARY can be written as - any of `foo', `-lfoo', or `libfoo.a'. In all of those cases, the - compiler is passed `-lfoo'. - - - Macro: AC_HEADER_CHECK (HEADER-FILE, ACTION-IF-FOUND [, - ACTION-IF-NOT-FOUND]) - If HEADER-FILE exists, execute shell commands ACTION-IF-FOUND, - otherwise execute ACTION-IF-NOT-FOUND. If you just want to define - a symbol if the header file is available, consider using - `AC_HAVE_HEADERS' instead. - - - Macro: AC_HEADER_EGREP (PATTERN, HEADER-FILE, ACTION-IF-FOUND [, - ACTION-IF-NOT-FOUND]) - If the output of running the preprocessor on HEADER-FILE contains - the `egrep' regular expression PATTERN, execute shell commands - ACTION-IF-FOUND, otherwise execute - - This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on - which language is current, *note Language Choice::.), if it hasn't - been called already. ACTION-IF-NOT-FOUND. - - You can not check whether preprocessor symbols are defined this - way, because they get expanded before `egrep' sees them. But you - can almost always detect them by simply using `#ifdef' directives - in your programs. - - - Macro: AC_PROGRAM_CHECK (VARIABLE, PROG-TO-CHECK-FOR, - VALUE-IF-FOUND, VALUE-IF-NOT-FOUND) - Check whether program PROG-TO-CHECK-FOR exists in `PATH'. If it - is found, set VARIABLE to VALUE-IF-FOUND, otherwise to - VALUE-IF-NOT-FOUND. If VARIABLE was already set, do nothing. - Calls `AC_SUBST' for VARIABLE. - - - Macro: AC_PROGRAM_EGREP (PATTERN, PROGRAM, ACTION-IF-FOUND [, - ACTION-IF-NOT-FOUND]) - PROGRAM is the text of a C or C++ program, on which shell variable - and backquote substitutions are performed. If the output of - running the preprocessor on PROGRAM contains the `egrep' regular - expression PATTERN, execute shell commands ACTION-IF-FOUND, - otherwise execute ACTION-IF-NOT-FOUND. (It is an unfortunate - oversight that we use the word `PROGRAM' in Autoconf macro names to - sometimes mean C or C++ source code and sometimes mean a UNIX - command.) - - This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on - which language is current, *note Language Choice::.), if it hasn't - been called already. - - - Macro: AC_PROGRAM_PATH (VARIABLE, PROG-TO-CHECK-FOR, - VALUE-IF-NOT-FOUND) - Similar to `AC_PROGRAM_CHECK', but set VARIABLE to the entire path - of PROG-TO-CHECK-FOR if found. Otherwise, set VARIABLE to the - value VALUE-IF-NOT-FOUND and perform no path checking. If - VARIABLE was already set, do nothing. Calls `AC_SUBST' for - VARIABLE. - - - Macro: AC_PROGRAMS_CHECK (VARIABLE, PROGS-TO-CHECK-FOR [, - VALUE-IF-NOT-FOUND]) - Check for each program in the whitespace-separated list - PROGS-TO-CHECK-FOR exists in `PATH'. If it is found, set VARIABLE - to the name of that program. Otherwise, continue checking the - next program in the list. If none of the programs in the list are - found, set VARIABLE to VALUE-IF-NOT-FOUND; if VALUE-IF-NOT-FOUND - is not specified, the value of VARIABLE will not be changed. - Calls `AC_SUBST' for VARIABLE. - - - Macro: AC_PROGRAMS_PATH (VARIABLE, PROGS-TO-CHECK-FOR [, - VALUE-IF-NOT-FOUND]) - Like `AC_PROGRAMS_CHECK', but if any of PROGS-TO-CHECK-FOR are - found, set VARIABLE to the entire pathname of the program found. - - - Macro: AC_REPLACE_FUNCS (FUNCTION-NAME...) - For each given FUNCTION-NAME in the whitespace-separated argument - list that is not in the C library, add `FUNCTION-NAME.o' to the - value of the `make' variable `LIBOBJS'. If the functions might be - in libraries other than the default C library, first call - `AC_HAVE_LIBRARY' for those libraries. - - - Macro: AC_SIZEOF_TYPE (TYPE) - Define `SIZEOF_UCTYPE' to be the size in bytes of the C (or C++) - builtin type TYPE, e.g. `int' or `char *'. If `type' is unknown - to the compiler, gets a size of 0. UCTYPE is TYPE, with lowercase - converted to uppercase, spaces changed to underscores, and - asterisks changed to `P'. For example, the call - AC_SIZEOF_TYPE(int *) - - defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems. - - - Macro: AC_TEST_PROGRAM (PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE - [, ACTION-IF-CROSS-COMPILING]]) - PROGRAM is the text of a C program, on which shell variable and - backquote substitutions are performed. If it compiles and links - successfully and returns an exit status of 0 when executed, run - shell commands ACTION-IF-TRUE. Otherwise run shell commands - ACTION-IF-FALSE. - - If the optional argument ACTION-IF-CROSS-COMPILING is given and - the C compiler being used does not produce executables that run on - the system where `configure' is being run, then the test program - is not run. Instead, the shell commands ACTION-IF-CROSS-COMPILING - are run. If that argument is given, this macro calls - `AC_CROSS_CHECK' if it has not already been called (*note Compiler - Characteristics::.). - - - Macro: AC_TEST_CPP (INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE]) - INCLUDES is C or C++ `#include' statements and declarations, on - which shell variable and backquote substitutions are performed. - (Actually, it can be any C program, but other statements are - probably not useful.) If the preprocessor produces no error - messages while processing it, run shell commands ACTION-IF-TRUE. - Otherwise run shell commands ACTION-IF-FALSE. - - This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on - which language is current, *note Language Choice::.), if it hasn't - been called already. - - -File: autoconf.info, Node: Command Line, Next: Setting Variables, Prev: General Feature Tests, Up: General Purpose Macros - -Checking Command Line Arguments -=============================== - - These macros check whether the user gave `configure' various command -line arguments. Like the general feature tests (*note General Feature -Tests::.), they may take an argument to use if the argument was given -and one for if it was not given. - - - Macro: AC_ENABLE (FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE]) - If the user gave `configure' the option `--enable-FEATURE' or - `--disable-FEATURE', run shell commands ACTION-IF-TRUE. Otherwise - run shell commands ACTION-IF-FALSE. The name FEATURE should - consist only of alphanumeric characters and dashes. - - The FEATURE indicates an optional user-level facility. This - option allows users to choose which optional features to build and - install. `--enable-FEATURE' options should never make a feature - behave differently or cause one feature to replace another. They - should only cause parts of the program to be built rather than left - out. - - The user can give an argument by following the feature name with - `=' and the argument. Giving an argument of `no' indicates that - the feature is *not* available. A feature with an argument looks - like `--enable-debug=stabs'. - - The argument is available to the shell commands ACTION-IF-TRUE in - the shell variable `enableval'. If no argument was given to - `--enable-FEATURE', `enableval' is `yes'. `--disable-FEATURE' is - equivalent to `--enable-FEATURE=no'. At present, arguments - containing blanks are not handled correctly; if you need an - argument to contain a list, require the items to be separated by - commas instead. (This restriction might disappear in the future.) - - - Macro: AC_PREFIX (PROGRAM) - If the user did not specify an installation prefix (using the - `--prefix' option), guess a value for it by looking for PROGRAM in - `PATH', the way the shell does. If PROGRAM is found, set the - prefix to the parent of the directory containing PROGRAM; - otherwise leave the prefix specified in `Makefile.in' unchanged. - For example, if PROGRAM is `gcc' and the `PATH' contains - `/usr/local/gnu/bin/gcc', set the prefix to `/usr/local/gnu'. - - - Macro: AC_WITH (PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE]) - If the user gave `configure' the option `--with-PACKAGE' or - `--without-PACKAGE', run shell commands ACTION-IF-TRUE. Otherwise - run shell commands ACTION-IF-FALSE. The name PACKAGE should - consist only of alphanumeric characters and dashes. - - The PACKAGE indicates another software package that this program - should work with. For example, `--with-gnu-ld' means work with the - GNU linker instead of some other linker. `--with-x11' means work - with X11. - - The user can give an argument by following the package name with - `=' and the argument. Giving an argument of `no' is for packages - that would be used by default; it says to *not* use the package. - An argument that is neither `yes' nor `no' could include a name or - number of a version of the other package, to specify more - precisely which other package this program is supposed to work - with. - - The argument is available to the shell commands ACTION-IF-TRUE in - the shell variable `withval'. If no argument was given to - `--with-PACKAGE', `withval' is `yes'. `--without-PACKAGE' is - equivalent to `--with-PACKAGE=no'. At present, arguments - containing blanks are not handled correctly; if you need an - argument to contain a list, require the items to be separated by - commas instead. (This restriction might disappear in the future.) - - -File: autoconf.info, Node: Setting Variables, Next: Printing Messages, Prev: Command Line, Up: General Purpose Macros - -Setting Variables -================= - - These macros help other macros to define shell and `make' variables. - - - Macro: AC_DEFINE (VARIABLE [, VALUE]) - Define C preprocessor variable VARIABLE. If VALUE is given, set - VARIABLE to that value, otherwise set it to 1. To use a shell - variable as the value, use `AC_DEFINE_UNQUOTED' instead and precede - double quotes in the value with backslashes. - - This macro adds to the shell variable `DEFS'. `AC_OUTPUT' later - substitutes the values in `DEFS' into the file(s) that it - generates (typically `Makefile'). Alternately, if - `AC_CONFIG_HEADER' has been called, `AC_OUTPUT' creates a header - file by substituting the correct values into `#define' statements - in a template file. - - For example, suppose your `configure.in' calls - `AC_CONFIG_HEADER(conf.h)' and `AC_HAVE_HEADERS(unistd.h)'. You - could have code like this in `conf.h.in': - - /* Define as 1 if you have unistd.h. */ - #define HAVE_UNISTD_H 0 - - On systems that have `unistd.h', `configure' will change the 0 to - a 1. On other systems, it will leave the line unchanged. - Alternately, if you prefer to use `#ifdef', your `conf.h.in' could - have code like this: - - /* Define if you have unistd.h. */ - #undef HAVE_UNISTD_H - - On systems that have `unistd.h', `configure' will change the - second line to read `#define HAVE_UNISTD_H 1'. On other systems, - it will comment that line out (in case the system predefines that - symbol). - - Due to the syntactical bizarreness of the Bourne shell, do not use - semicolons to separate `AC_DEFINE' calls from other macro calls or - shell code; that can cause syntax errors in the resulting - `configure' script. Use either spaces or newlines. That is, do - this: - - AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf") - - or this: - - AC_HEADER_CHECK(elf.h, - AC_DEFINE(SVR4) - LIBS="$LIBS -lelf") - - instead of this: - - AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf") - - - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE]) - Like `AC_DEFINE', but it does nothing to quote VALUE from various - shell and `sed' expansions it will undergo. VALUE will be used in - many different contexts requiring different quoting, and it is up - to you to make sure it works right. Use this macro instead of - `AC_DEFINE' when VALUE contains a shell variable. For example: - - AC_DEFINE_UNQUOTED(config_machfile, ${machfile}) - - - Macro: AC_SUBST (VARIABLE) - Substitute the variable VARIABLE when creating the output files - (typically one or more `Makefile's). This means replace instances - of `@VARIABLE@', e.g. in `Makefile.in', with the current value of - the shell variable VARIABLE. If this macro were not called, the - value of VARIABLE would not be set in the output files, even - though `configure' had figured out a value for it. - - You can set or add to the value of VARIABLE in the usual shell - way. For example, to add `-ltermcap' to the value of the variable - `LIBS': - - LIBS="$LIBS -ltermcap" - - -File: autoconf.info, Node: Printing Messages, Next: Language Choice, Prev: Setting Variables, Up: General Purpose Macros - -Printing Messages -================= - - `configure' scripts need to give users running them several kinds of -information. The following macros print messages in ways appropriate -for different kinds of information. The arguments to all of them get -enclosed in shell double quotes, so the shell performs variable and -backquote substitution on them. - - These macros are all wrappers around the `echo' shell command. -Other macros should rarely need to run `echo' directly to print -messages for the `configure' user. Using these macros makes it easy to -change how and when each kind of message is printed; such changes need -only be made to the macro definitions, and all of the callers change -automatically. - - - Macro: AC_CHECKING (FEATURE-DESCRIPTION) - Notify the user that `configure' is checking for a particular - feature. This macro prints a message that starts with `checking '. - It prints nothing if `configure' is run with the `--silent' or - `--quiet' option. The FEATURE-DESCRIPTION should be something - like `whether the Fortran compiler accepts C++ comments' or `for - c89'. - - - Macro: AC_ERROR (ERROR-DESCRIPTION) - Notify the user of an error that prevents `configure' from - completing. This macro prints an error message on the standard - error stream and exits `configure' with a nonzero status. - eRROR-DESCRIPTION should be something like `invalid value $HOME - for \$HOME'. - - - Macro: AC_VERBOSE (RESULT-DESCRIPTION) - Notify the user of the results of a check. This information is - only printed if `configure' is run with the `--verbose' option. - rESULT-DESCRIPTION should be something like `setting ADA to $ADA'. - - - Macro: AC_WARN (PROBLEM-DESCRIPTION) - Notify the `configure' user of a possible problem. This macro - prints the message on the standard error stream; `configure' - continues running afterward, so macros that call `AC_WARN' should - provide a default (back-up) behavior for the situations they warn - about. PROBLEM-DESCRIPTION should be something like `ln -s seems - to make hard links'. - - -File: autoconf.info, Node: Language Choice, Next: Macro Ordering, Prev: Printing Messages, Up: General Purpose Macros - -Language Choice -=============== - - Packages that use both C and C++ need to test features of both -compilers. Autoconf-generated `configure' scripts check for C features -by default. The following macros determine which language's compiler -is used in tests that follow in `configure.in'. - - - Macro: AC_LANG_C - Do compilation tests using `CC' and `CPP' and use extension `.c' - for test programs. - - This is the initial state. - - - Macro: AC_LANG_CPLUSPLUS - Do compilation tests using `CXX' and `CXXCPP' and use extension - `.C' for test programs. - - - Macro: AC_LANG_RESTORE - Select the language that is saved on the top of the stack, as set - by `AC_LANG_SAVE', and remove it from the stack. This macro is - equivalent to either `AC_LANG_C' or `AC_LANG_CPLUSPLUS', whichever - had been run most recently when `AC_LANG_SAVE' was last called. - - Do not call this macro more times than `AC_LANG_SAVE'. - - - Macro: AC_LANG_SAVE - Remember the current language (as set by `AC_LANG_C' or - `AC_LANG_CPLUSPLUS') on a stack. Does not change which language is - current. Use this macro and `AC_LANG_RESTORE' in macros that need - to temporarily switch to a particular language. - - - Macro: AC_REQUIRE_CPP - Ensure that whichever preprocessor would currently be used for - tests has been found. Calls `AC_REQUIRE' (*note Macro - Ordering::.) with an argument of either `AC_PROG_CPP' or - `AC_PROG_CXXCPP', depending on which language is current. - - -File: autoconf.info, Node: Macro Ordering, Prev: Language Choice, Up: General Purpose Macros - -Macro Ordering -============== - - These macros provide ways for other macros to make sure that they are -called in the correct order. - - - Macro: AC_BEFORE (THIS-MACRO-NAME, CALLED-MACRO-NAME) - Make `m4' print a warning message on the standard error output if - CALLED-MACRO-NAME has already been called. THIS-MACRO-NAME should - be the name of the macro that is calling `AC_BEFORE'. The macro - CALLED-MACRO-NAME must contain a call to `AC_PROVIDE' to indicate - that it has been called. - - This macro should be used when one macro makes changes that might - affect another macro, so that the other macro should probably not - be called first. For example, `AC_PROG_CPP' checks whether the C - compiler can run the C preprocessor when given the `-E' option. - It should therefore be called after any macros that change which C - compiler is being used, such as `AC_PROG_CC'. So `AC_PROG_CC' - contains: - - AC_BEFORE([$0], [AC_PROG_CPP]) - - This warns the user if a call to `AC_PROG_CPP' has already occurred - when `AC_PROG_CC' is called. - - - Macro: AC_OBSOLETE (THIS-MACRO-NAME [, SUGGESTION]) - Make `m4' print a message on the standard error output warning that - THIS-MACRO-NAME is obsolete, and giving the file and line number - where it was called. THIS-MACRO-NAME should be the name of the - macro that is calling `AC_BEFORE'. If SUGGESTION is given, it is - printed at the end of the warning message; for example, it can be - a suggestion for what to use instead of THIS-MACRO-NAME. - - A sample call is: - - AC_OBSOLETE([$0], [; use AC_HAVE_HEADERS(unistd.h) instead]) - - - Macro: AC_PROVIDE (MACRO-NAME) - Set a flag recording that MACRO-NAME has been called. The - argument should be the name of the macro that is calling - `AC_PROVIDE'. An easy way to get it is from the `m4' builtin - variable `$0', like this: - - AC_PROVIDE([$0]) - - - Macro: AC_REQUIRE (MACRO-NAME) - If the `m4' macro MACRO-NAME has not already been called, call it - (without any arguments). Make sure to quote MACRO-NAME with - square brackets. The body of MACRO-NAME must contain a call to - `AC_PROVIDE' to indicate that it has been called. - - Macros that need some other macro to be called before they are - called can use `AC_REQUIRE' to ensure that it has been, in case - the person who made `configure.in' forgot or didn't know to do it. - `AC_REQUIRE' and `AC_PROVIDE' together can ensure that a macro is - only called if it is needed, and only called once. *Note - Dependencies Between Macros::, for more information. - - -File: autoconf.info, Node: Writing Macros, Next: Makefiles, Prev: General Purpose Macros, Up: Top - -Writing Macros -************** - - If your package needs to test for some feature that none of the -macros supplied with Autoconf handles, you'll need to write one or more -new Autoconf macros. Here are some suggestions and some of the -rationale behind why the existing macros are written the way they are. -You can also learn a lot about how to write Autoconf macros by looking -at the existing ones. If something goes wrong in one or more of the -Autoconf tests, this information can help you understand why they work -the way they do and the assumptions behind them, which might help you -figure out how to best solve the problem. - - If you add macros that you think would be useful to other people, or -find problems with the distributed macros, please send electronic mail -to `bug-gnu-utils@prep.ai.mit.edu', so we can consider them for future -releases of Autoconf. Please include the Autoconf version number, -which you can get by running `autoconf --version'. - -* Menu: - -* Macro Format:: Basic format of an Autoconf macro. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. -* Checking for Files:: Finding whether a file exists. -* Checking for Symbols:: Finding whether a symbol is defined. -* Test Programs:: Writing programs to test for features. -* Multiple Cases:: Tests for several possible values. - - -File: autoconf.info, Node: Macro Format, Next: Quoting, Up: Writing Macros - -Macro Format -============ - - Autoconf macros are defined as arguments to the `m4' builtin command -`define'. Their overall structure looks like this: - - define(MACRO-NAME, [MACRO-BODY])dnl - -The square brackets here do not indicate optional text: they should -literally be present in the macro definition. - - All of the Autoconf macros have names starting with `AC_' to prevent -them from accidentally conflicting with other text. All shell -variables that they use for internal purposes have names starting with -`ac_'. To ensure that your macros don't conflict with present or -future Autoconf macros, you should prefix your own macro names and any -shell variables they use with some other sequence. Possibilities -include your initials, or an abbreviation for the name of your -organization or software package. - - The `m4' builtin `dnl' prevents a newline from being inserted in the -output where the macro is defined; without it, the generated -`configure' script would begin with dozens of blank lines. `dnl' is -also used to introduce comments in `m4'; it causes `m4' to discard the -rest of the input line. - - You should quote the entire macro body with square brackets to avoid -macro expansion problems (*note Quoting::.). You can refer to any -arguments passed to the macro as `$1', `$2', etc. - - *Note How to define new macros: (m4.info)Definitions, for more -complete information on writing `m4' macros. - - -File: autoconf.info, Node: Quoting, Next: Dependencies Between Macros, Prev: Macro Format, Up: Writing Macros - -Quoting -======= - - Macros that are called by other macros are evaluated by `m4' several -times; each evaluation might require another layer of quotes to prevent -unwanted expansions of macros or `m4' builtins, such as `define' and -`$1'. Quotes are also required around macro arguments that contain -commas, since commas separate the arguments from each other. - - Autoconf (in `acgeneral.m4') changes the `m4' quote characters from -the default ``' and `'' to `[' and `]', because many of the macros use -``' and `'', mismatched. However, in a few places the macros need to -use brackets. In those places, they use the `m4' builtin command -`changequote' to temporarily disable quoting before the code that uses -brackets, like this: - - changequote(,)dnl - -Then they turn quoting back on again with another call to `changequote': - - changequote([,])dnl - - When you create a `configure' script using newly written macros, -examine it carefully to check whether you need to add more quotes in -your macros. If one or more words have disappeared in the `m4' output, -you need more quotes. When in doubt, quote. - - However, it's also possible to put on too many layers of quotes. If -this happens, the resulting `configure' script will contain unexpanded -macros. The `autoconf' program checks for this problem by doing `grep -AC_ configure'. - - -File: autoconf.info, Node: Dependencies Between Macros, Next: Checking for Files, Prev: Quoting, Up: Writing Macros - -Dependencies Between Macros -=========================== - - Some Autoconf macros depend on other macros having been called first -in order to work correctly. Autoconf provides a way to ensure that -certain 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. - - -File: autoconf.info, Node: Prerequisite Macros, Next: Suggested Ordering, Up: Dependencies Between Macros - -Prerequisite Macros -------------------- - - A macro that you write might need to use values that have previously -been computed by other macros. For example, if you write a new macro -that uses the C preprocessor, it depends on `AC_PROG_CPP' having been -called first to set the shell variable `CPP' (*note Alternative -Programs::.). - - Rather than forcing the user of the macros to keep track of all of -the dependencies between them, you can use the macros `AC_PROVIDE' and -`AC_REQUIRE' to do it automatically. *Note Macro Ordering::, for more -information on their syntax. - - The new macro that runs the C preprocessor should contain, somewhere -before `CPP' is used, the statement - - AC_REQUIRE([AC_PROG_CPP]) - -and the macro `AC_PROG_CPP' should contain the statement (anywhere in -its body) - - AC_PROVIDE([$0]) - -Then, when the new macro is run, it will invoke `AC_PROG_CPP' if and -only if `AC_PROG_CPP' has not already been run. - - -File: autoconf.info, Node: Suggested Ordering, Prev: Prerequisite Macros, Up: Dependencies Between Macros - -Suggested Ordering ------------------- - - Some macros should be run before another macro if both are called, -but neither requires the other to be called. For example, a macro like -`AC_AIX' that changes the behavior of the C compiler (*note UNIX -Variants::.) should be called before any macros that run the C compiler. -Many of these dependencies are noted in the documentation. - - Autoconf provides a way to warn users when macros with this kind of -dependency appear out of order in a `configure.in' file. The warning -occurs when creating `configure' from `configure.in', not when running -`configure'. It is not a fatal error; `configure' is created as usual. - - The `AC_BEFORE' macro causes `m4' to print a warning message on the -standard error output when a macro is used before another macro which -might change its behavior. The macro which should come first should -contain a call to `AC_BEFORE' and the macro which should come later -should contain a call to `AC_PROVIDE'. - - For example, `AC_AIX' contains - - AC_BEFORE([$0], [AC_COMPILE_CHECK]) - -and `AC_COMPILE_CHECK' contains - - AC_PROVIDE([$0]) - -As a result, if `AC_AIX' is called after `AC_COMPILE_CHECK', it will -note that `AC_COMPILE_CHECK' has already been called and print a -warning message. - - -File: autoconf.info, Node: Checking for Files, Next: Checking for Symbols, Prev: Dependencies Between Macros, Up: Writing Macros - -Checking for Files -================== - - If you need to check whether a file other than a C header file -exists, use `test -f FILENAME'. If you need to make multiple checks -using `test', combine them with the shell operators `&&' and `||' -instead of using the `test' operators `-a' and `-o'. On System V, the -precedence of `-a' and `-o' is wrong relative to the unary operators; -consequently, POSIX does not specify them, so using them is -nonportable. If you combine `&&' and `||' in the same statement, keep -in mind that they have equal precedence. - - Do not use `test -x', because 4.3BSD does not have it. Use `test --f' or `test -r' instead. - - -File: autoconf.info, Node: Checking for Symbols, Next: Test Programs, Prev: Checking for Files, Up: Writing Macros - -Checking for Symbols -==================== - - If you need to check whether a symbol is defined in a C header file, -you can use `AC_HEADER_EGREP' if the symbol is not a C preprocessor -macro (*note General Feature Tests::.), or compile a small test program -that includes the file and references the symbol (*note Test -Programs::.). Don't directly `grep' for the symbol in the file, -because on some systems it might be defined in another header file that -the file you are checking `#include's. - - However, if you need to check for a particular UNIX variant which is -distinguished by having certain text in a certain file, then use `grep' -(or `egrep'). But don't use `grep -s' to suppress output, because -`grep -s' on System V does not suppress output, only error messages. -Instead, redirect the standard output and standard error (in case the -file doesn't exist) of `grep' to `/dev/null'. Check the exit status of -`grep' to determine whether it found a match. - - To check whether the Autoconf macros have already defined a certain C -preprocessor symbol, you can use a `case' statement like this: - - case "$DEFS" in - *HAVE_FOO*) ;; - *) LIBOBJS="$LIBOBJS foo.o" ;; - esac - -Make sure to enclose the variable name you are checking (usually -`DEFS') in double quotes, because otherwise some old versions of `bash' -misinterpret the statement. - - -File: autoconf.info, Node: Test Programs, Next: Multiple Cases, Prev: Checking for Symbols, Up: Writing Macros - -Test Programs -============= - - Autoconf checks for many features by compiling small test programs. -To find out whether a library function is available, Autoconf tries to -compile a small program that uses it. This is unlike Larry Wall's -Metaconfig, which uses `nm' or `ar' on the C library to try to figure -out which functions are available. Trying to link with the function is -usually a more reliable and flexible approach because it avoids dealing -with the variations in the options and output formats of `nm' and `ar' -and in the location of the standard libraries. It also allows -`configure' to check aspects of the function's runtime behavior if -needed. On the other hand, it is sometimes slower than scanning the -libraries. - - If you need to check for a condition other than whether some symbol -exists on the system or has a certain value, then you can't use -`AC_COMPILE_CHECK' (*note General Feature Tests::.). You have to write -a test program by hand. You can compile and run it using -`AC_TEST_PROGRAM' (*note General Feature Tests::.). - - Try to avoid writing test programs if possible, because using them -prevents people from configuring your package for cross-compiling. If -it's really best that you test for a run-time behavior, try to provide a -default "worst case" value to use when cross-compiling makes run-time -tests impossible. You do this by passing the optional last argument to -`AC_TEST_PROGRAM'. - -* Menu: - -* Guidelines:: General rules for writing test programs. -* Tricks:: Special ways to work around problems. - - -File: autoconf.info, Node: Guidelines, Next: Tricks, Up: Test Programs - -Guidelines for Test Programs ----------------------------- - - Test programs should return 0 if the test succeeds, nonzero -otherwise, so that success can be distinguished easily from a core dump -or other failure; segmentation violations and other failures produce a -nonzero exit status. Test programs should `exit', not `return', from -`main', because on some systems the argument to `return' in `main' is -ignored. They should not write anything to the standard output. - - Test programs can use `#if' or `#ifdef' to check the values of -preprocessor macros defined by tests that have already run. For -example, if you call `AC_STDC_HEADERS', then later on in `configure.in' -you can have a test program that includes an ANSI C header file -conditionally: - - #if STDC_HEADERS - #include - #endif - - If a test program needs to use or create a data file, give it a name -that starts with `conftest', such as `conftestdata'. The `configure' -script cleans up by running `rm -rf conftest*' after running test -programs and if the script is interrupted. - - -File: autoconf.info, Node: Tricks, Prev: Guidelines, Up: Test Programs - -Tricks for Test Programs ------------------------- - - If a test program calls a function with invalid parameters (just to -see whether it exists), organize the program to ensure that it never -invokes that function. You can do this by calling it in another -function that is never invoked. You can't do it by putting it after a -call to `exit', because GCC version 2 knows that `exit' never returns -and optimizes out any code that follows it in the same block. - - If you include any header files, make sure to call the functions -relevant to them with the correct number of arguments, even if they are -just 0, to avoid compilation errors due to prototypes. GCC version 2 -has internal prototypes for several functions that it automatically -inlines; for example, `memcpy'. To avoid errors when checking for -them, either pass them the correct number of arguments or redeclare them -with a different return type (such as `char'). - - -File: autoconf.info, Node: Multiple Cases, Prev: Test Programs, Up: Writing Macros - -Multiple Cases -============== - - Some operations are accomplished in several possible ways, depending -on the UNIX variant. Checking for them essentially requires a "case -statement". Autoconf does not directly provide one; however, it is -easy to simulate by using a shell variable to keep track of whether a -way to perform the operation has been found yet. - - Here is an example excerpted from the `configure.in' for GNU `find'. -It uses the shell variable `fstype' to keep track of whether the -remaining cases need to be checked. There are several more cases which -are not shown here but follow the same pattern. - - echo checking how to get filesystem type - # SVR4. - AC_TEST_CPP([#include - #include ], AC_DEFINE(FSTYPE_STATVFS) fstype=1) - if test -z "$fstype"; then - # SVR3. - AC_TEST_CPP([#include - #include ], AC_DEFINE(FSTYPE_USG_STATFS) fstype=1) - fi - if test -z "$fstype"; then - # AIX. - AC_TEST_CPP([#include - #include ], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=1) - fi - - -File: autoconf.info, Node: Makefiles, Next: Invoking configure, Prev: Writing Macros, Up: Top - -Makefiles -********* - - Each subdirectory in a distribution should come with a file -`Makefile.in', from which `configure' will produce a `Makefile' in that -directory. Most of the substitutions that `configure' does are simple: -for each configuration variable that the package uses, it just replaces -occurrences of `@VARIABLE@' with the value that `configure' has -determined for that variable. Any occurrences of `@VARIABLE@' for -variables that `configure' does not know about are passed through -unchanged. - - There is no point in checking for the correct value to give a -variable that is never used. Every variable that the `configure' script -might set a value for should appear in a `@VARIABLE@' reference in at -least one `Makefile.in'. If `AC_CONFIG_HEADER' is called, `configure' -replaces `@DEFS@' with `-DHAVE_CONFIG_H', since the contents of `DEFS' -would be redundant. - - *Note Makefile Conventions: (standards.info)Makefiles, for more -information on what to put in Makefiles. *Note Sample Makefile.in::, -for an example of a real `Makefile.in'. - -* Menu: - -* Predefined Variables:: Heavily used `make' variables. -* Installation Prefixes:: A special variable substitution. -* VPATH Substitutions:: Compiling in a different directory. -* Automatic Remaking:: Makefile rules for configuring. - - -File: autoconf.info, Node: Predefined Variables, Next: Installation Prefixes, Up: Makefiles - -Predefined Variables -==================== - - Some `make' variables are predefined by the Autoconf macros. -`AC_SUBST' is called for them automatically (*note Setting -Variables::.), so in your `Makefile.in' files you can get their values -by enclosing their names in `@' characters. *Note Makefiles::, for -more information on `@' substitutions. The variables that are defined -by the general purpose Autoconf macros are: - - - Variable: exec_prefix - The installation prefix for architecture-specific files. - - - Variable: prefix - The installation prefix for architecture-independent files. *Note - Installation Prefixes::, for an alternate way to set this variable. - - - Variable: srcdir - The directory that contains the source code for that `Makefile'. - *Note Installation Prefixes::, for an alternate way to set this - variable. - - - Variable: top_srcdir - The top-level source code directory for the package. In the - top-level directory, this is the same as `srcdir'. - - - Variable: DEFS - `-D' options to pass to the C compiler. If `AC_CONFIG_HEADER' is - called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H', - since the contents of `DEFS' would be redundant. - - - Variable: LIBS - `-l' and `-L' options to pass to the linker. - - - Variable: LIBOBJS - Names of object files (ending in `.o'). Set by `AC_REPLACE_FUNCS' - (*note General Feature Tests::.). - - -File: autoconf.info, Node: Installation Prefixes, Next: VPATH Substitutions, Prev: Predefined Variables, Up: Makefiles - -Installation Prefixes -===================== - - Autoconf-generated `configure' scripts support an alternate method -for substituting two particular variables, for compatibility with -Cygnus `configure'. This method is not recommended. - - If `configure' has figured out a value for the installation prefix, -either by the user supplying one on the command line (*note Invoking -configure::.) or with `AC_PREFIX' (*note General Feature Tests::.), -then it substitutes that value in `Makefile's that it creates. -Wherever a `Makefile.in' contains lines like - - prefix = /usr/local - exec_prefix = ${prefix} - -`configure' substitutes the value it figured out. The substitution -only occurs if the word `prefix' or `exec_prefix' is not preceded by -any other characters on the line, and `configure' has figured out a -value for the prefix. - - There can be separate installation prefixes for architecture-specific -files (`exec_prefix') and architecture-independent files (`prefix'). -*Note Invoking configure::, for more information on setting them. - - Autoconf `configure' scripts replace these two variables without -requiring them to be enclosed in `@' characters, and only if they have -been set, because the Cygnus `configure' does so. In retrospect, being -compatible in this way was a bad decision, because it created an -inconsistency in Autoconf without giving significant benefits. This -wart will be removed in a future release of Autoconf. - - -File: autoconf.info, Node: VPATH Substitutions, Next: Automatic Remaking, Prev: Installation Prefixes, Up: Makefiles - -`VPATH' Substitutions -===================== - - You might want to compile a software package in a different directory -from the one that contains the source code. Doing this allows you to -compile the package for several architectures simultaneously from the -same copy of the source code and keep multiple sets of object files on -disk. - - To support doing this, `make' uses the `VPATH' variable to find the -files that are in the source directory. GNU `make' and most other -recent `make' programs can do this. Older `make' programs do not -support `VPATH'; when using them, the source code must be in the same -directory as the object files. - - To support `VPATH', each `Makefile.in' should contain two lines that -look like: - - srcdir = @srcdir@ - VPATH = @srcdir@ - - Do not set `VPATH' to the value of another variable, for example -`VPATH = $(srcdir)', because some versions of `make' do not do variable -substitutions on the value of `VPATH'. - - `configure' substitutes in the correct value for `srcdir' when it -produces `Makefile.in'. - - Do not use the `make' variable `$<', which expands to the pathname -of the file in the source directory (found with `VPATH'), except in -implicit rules. (An implicit rule is one such as `.c.o', which tells -how to create a `.o' file from a `.c' file.) Some versions of `make' -do not set `$<' in explicit rules; they expand it to an empty value. - - Instead, `Makefile' command lines should always refer to source -files by prefixing them with `$(srcdir)/'. For example: - - time.info: time.texinfo - $(MAKEINFO) $(srcdir)/time.texinfo - - -File: autoconf.info, Node: Automatic Remaking, Prev: VPATH Substitutions, Up: Makefiles - -Automatic Remaking -================== - - You can put rules like the following in the top-level `Makefile.in' -for a package to automatically update the configuration information when -you change the configuration files. This example includes all of the -optional files, such as `aclocal.m4' and those related to configuration -header files. Omit from the `Makefile.in' rules any of these files -that your package does not use. - - The `stamp-' files are necessary because the timestamps of -`config.h.in' and `config.h' will not be changed if remaking them does -not change their contents. This feature avoids unnecessary -recompilation. You should include the file `stamp-h.in' your package's -distribution, so `make' will consider `config.h.in' up to date. - - configure: configure.in aclocal.m4 - cd ${srcdir} && autoconf - - # autoheader might not change config.h.in - config.h.in: stamp-h.in - stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top - cd ${srcdir} && autoheader - touch ${srcdir}/stamp-h.in - - # config.status might not change config.h - config.h: stamp-h - stamp-h: config.h.in config.status - ./config.status - touch stamp-h - - Makefile: Makefile.in config.status - ./config.status - - config.status: configure - ./config.status --recheck - - *Note Invoking config.status::, for more information on handling -configuration-related dependencies. - - -File: autoconf.info, Node: Invoking configure, Next: Example, Prev: Makefiles, Up: Top - -Running `configure' Scripts -*************************** - - A software package that uses a `configure' script should be -distributed with a file `Makefile.in', but no `Makefile'; that way, the -user has to properly configure the package for the local system before -compiling it. Here is how to configure a package that uses a -`configure' script. - - Normally, you just `cd' to the directory containing the package's -source code and type `./configure'. If you're using `csh' on an old -version of System V, you might need to type `sh configure' instead to -prevent `csh' from trying to execute `configure' itself. - - Running `configure' takes awhile. While it is running, it prints -some messages that tell what it is doing. If you don't want to see any -messages, run `configure' with its standard output redirected to -`/dev/null'; for example, `./configure >/dev/null'. - - To compile the package in a different directory from the one -containing the source code, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. If -for some reason `configure' is not in the source code directory that -you are configuring, then it will report that it can't find the source -code. In that case, run `configure' with the option `--srcdir=DIR', -where DIR is the directory that contains the source code. - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. Alternately, you can do so by consistently -giving a value for the `prefix' variable when you run `make', e.g., - make prefix=/usr/gnu - make prefix=/usr/gnu install - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH' or set the `make' -variable `exec_prefix' to PATH, the package will use PATH as the prefix -for installing programs and libraries. Data files and documentation -will still use the regular prefix. Normally, all files are installed -using the same prefix. - - Some packages pay attention to `--with-PACKAGE' options to -`configure', where PACKAGE is something like `gnu-as' or `x' (for the X -Window System). They may also pay attention to `--enable-FEATURE' -options, where FEATURE indicates an optional part of the package. The -README should mention any `--with-' and `--enable-' options that the -package recognizes. - - `configure' also recognizes the following options: - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' - Do not print messages saying which checks are being made. - -`--verbose' - Print the results of the checks. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--x-includes=DIR' - X include files are in DIR. - -`--x-libraries=DIR' - X library files are in DIR. - - `configure' also accepts and ignores some other options. - -* Menu: - -* Overriding variables:: Workarounds for unusual systems. -* Invoking config.status:: Recreating a configuration. - - -File: autoconf.info, Node: Overriding variables, Next: Invoking config.status, Up: Invoking configure - -Overriding variables -==================== - - On systems that require unusual options for compilation or linking -that the package's `configure' script does not know about, you can give -`configure' initial values for variables by setting them in the -environment. In Bourne-compatible shells, you can do that on the -command line like this: - - CC='gcc -traditional' LIBS=-lposix ./configure - -On systems that have the `env' program, you can do it like this: - - env CC='gcc -traditional' LIBS=-lposix ./configure - - Here are the `make' variables that you might want to override with -environment variables when running `configure'. - - For these variables, any value given in the environment overrides the -value that `configure' would choose: - - - Variable: CC - C compiler program. The default is `cc'. - - - Variable: INSTALL - Program to use to install files. The default is `install' if you - have it, `cp' otherwise. - - For these variables, any value given in the environment is added to -the value that `configure' chooses: - - - Variable: DEFS - Configuration options, in the form `-Dfoo -Dbar...'. Do not use - this variable in packages that create a configuration header file. - - - Variable: LIBS - Libraries to link with, in the form `-lfoo -lbar...'. - - In the long term, most problems requiring manual intervention should -be fixed by updating either the Autoconf macros or the `configure.in' -file for that package. *Note Making configure Scripts::, for a -discussion of that subject. - - -File: autoconf.info, Node: Invoking config.status, Prev: Overriding variables, Up: Invoking configure - -Recreating a Configuration -========================== - - The `configure' script creates a file named `config.status' which -describes which configuration options were specified when the package -was last configured. This file is a shell script which, if run, will -recreate the same configuration. - - You can give `config.status' the `--recheck' option to update -itself. This option is useful if you change `configure', so that the -results of some tests might be different from the previous run. The -`--recheck' option re-runs `configure' with the same arguments you used -before, plus the `--no-create' option, which prevents `configure' from -running `config.status' and creating `Makefile' and other files. (This -is so other `Makefile' rules can run `config.status' when it changes; -*note Automatic Remaking::., for an example). - - `config.status' also accepts the options `--help', which prints a -summary of the options to `config.status', and `--version', which -prints the version of Autoconf used to create the `configure' script -that generated `config.status'. - - `config.status' checks several optional environment variables that -can alter its behavior: - - - Variable: CONFIG_SHELL - The shell with which to run `configure' for the `--recheck' - option. The default is `/bin/sh'. - - The following two variables provide one way for separately -distributed packages to share the values computed by `configure'. -Doing so can be useful if some of the packages need a superset of the -features that one of them, perhaps a common library, does. These -variables allow a `config.status' file to create files other than the -ones that its `configure.in' specifies, so it can be used for a -different package. - - - Variable: CONFIG_FILES - The files in which to perform `@VARIABLE@' substitutions. The - default is the arguments given to `AC_OUTPUT' in `configure.in'. - - - Variable: CONFIG_HEADERS - The files in which to substitute C `#define' statements. The - default is the arguments given to `AC_CONFIG_HEADER'; if that - macro was not called, `config.status' ignores this variable. - - These variables also allow you to write `Makefile' rules that -regenerate only some of the files. For example, in the dependencies -given above (*note Automatic Remaking::.), `config.status' is run twice -when `configure.in' has changed. If that bothers you, you can make -each run only regenerate the files for that rule: - - # config.status might not change config.h - config.h: stamp-h - stamp-h: config.h.in config.status - CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status - touch stamp-h - - Makefile: Makefile.in config.status - CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status - -(If `configure.in' does not call `AC_CONFIG_HEADER', there is no need -to set `CONFIG_HEADERS' in the `make' rules.) - - -File: autoconf.info, Node: Example, Next: Preprocessor Symbol Index, Prev: Invoking configure, Up: Top - -An Example -********** - - Here are sample `configure.in' and `Makefile.in' files, to give a -real illustration of using Autoconf. They are from the GNU `cpio' -package, which also includes the `mt' and `rmt' programs. This package -does not use a configuration header file; it passes `-D' options to the -C compiler on the command line. - -* Menu: - -* Sample configure.in:: An example of a `configure' template. -* Sample Makefile.in:: An example of a `Makefile' template. - - -File: autoconf.info, Node: Sample configure.in, Next: Sample Makefile.in, Up: Example - -Sample `configure.in' -===================== - -Here is `configure.in' from GNU `cpio'. The `dnl' macro after -`AC_SUBST' is suppresses an extra (though harmless) newline in the -generated `configure' script (because the `AC_SUBST' macro does not -produce any output where it is called). - - dnl Process this file with autoconf to produce a configure script. - AC_INIT(cpio.h) - PROGS="cpio" - AC_SUBST(PROGS)dnl - AC_PROG_CC - AC_PROG_CPP - AC_GCC_TRADITIONAL - AC_PROG_INSTALL - AC_AIX - AC_MINIX - AC_ISC_POSIX - AC_RETSIGTYPE - AC_MAJOR_HEADER - AC_REMOTE_TAPE - test -n "$have_mtio" && PROGS="$PROGS mt" - AC_RSH - AC_CONST - AC_UID_T - AC_STDC_HEADERS - AC_HAVE_HEADERS(string.h fcntl.h utime.h unistd.h sys/io/trioctl.h) - AC_REPLACE_FUNCS(fnmatch bcopy mkdir strdup) - AC_HAVE_FUNCS(strerror lchown) - AC_VPRINTF - AC_ALLOCA - AC_XENIX_DIR - AC_HAVE_LIBRARY(socket, [LIBS="$LIBS -lsocket"]) - AC_HAVE_LIBRARY(nsl, [LIBS="$LIBS -lnsl"]) - AC_OUTPUT(Makefile) - - -File: autoconf.info, Node: Sample Makefile.in, Prev: Sample configure.in, Up: Example - -Sample `Makefile.in' -==================== - -Here is `Makefile.in' from GNU `cpio', with some irrelevant lines -omitted, for brevity. - - srcdir = @srcdir@ - VPATH = @srcdir@ - - CC = @CC@ - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ - - DEFS = @DEFS@ - LIBS = @LIBS@ - RTAPELIB = @RTAPELIB@ - - CFLAGS = -g - LDFLAGS = -g - - prefix = /usr/local - exec_prefix = $(prefix) - binprefix = - manprefix = - - bindir = $(exec_prefix)/bin - libdir = $(exec_prefix)/lib - mandir = $(prefix)/man/man1 - manext = 1 - - SHELL = /bin/sh - - SRCS = copyin.c copyout.c copypass.c defer.c dstring.c global.c \ - main.c tar.c util.c error.c getopt.c getopt1.c filemode.c version.c \ - rtapelib.c dirname.c idcache.c makepath.c xmalloc.c stripslash.c \ - userspec.c xstrdup.c bcopy.c fnmatch.c mkdir.c strdup.c - OBJS = copyin.o copyout.o copypass.o defer.o dstring.o global.o \ - main.o tar.o util.o error.o getopt.o getopt1.o filemode.o version.o \ - $(RTAPELIB) dirname.o idcache.o makepath.o xmalloc.o stripslash.o \ - userspec.o xstrdup.o @LIBOBJS@ @ALLOCA@ - # mt source files not shared with cpio. - MT_SRCS = mt.c argmatch.c - MT_OBJS = mt.o argmatch.o error.o getopt.o getopt1.o \ - xmalloc.o version.o $(RTAPELIB) @ALLOCA@ - HDRS = cpio.h cpiohdr.h tar.h tarhdr.h defer.h dstring.h extern.h filetypes.h \ - system.h fnmatch.h getopt.h rmt.h - DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in \ - README NEWS INSTALL cpio.1 mt.1 makefile.pc makefile.os2 cpio.def \ - configure configure.in mkinstalldirs $(MT_SRCS) rmt.c tcexparg.c alloca.c - - all: @PROGS@ - - .c.o: - $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $< - - install: installdirs all $(srcdir)/cpio.1 $(srcdir)/mt.1 - $(INSTALL_PROGRAM) cpio $(bindir)/$(binprefix)cpio - test ! -f mt || $(INSTALL_PROGRAM) mt $(bindir)/$(binprefix)mt - -test ! -f rmt || $(INSTALL_PROGRAM) rmt $(libdir)/rmt - $(INSTALL_DATA) $(srcdir)/cpio.1 $(mandir)/$(manprefix)cpio.$(manext) - test ! -f mt || \ - $(INSTALL_DATA) $(srcdir)/mt.1 $(mandir)/$(manprefix)mt.$(manext) - - installdirs: - $(srcdir)/mkinstalldirs $(bindir) $(libdir) $(mandir) - - uninstall: - cd $(bindir); rm -f $(binprefix)cpio $(binprefix)mt - -rm -f $(libdir)/rmt - cd $(mandir); rm -f $(manprefix)cpio.$(manext) $(manprefix)mt.$(manext) - - check: - @echo No tests are supplied. - - cpio: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - - rmt: rmt.o - $(CC) $(LDFLAGS) -o $@ rmt.o $(LIBS) - - mt: $(MT_OBJS) - $(CC) $(LDFLAGS) -o $@ $(MT_OBJS) $(LIBS) - - Makefile: Makefile.in config.status - $(SHELL) config.status - config.status: configure - $(SHELL) config.status --recheck - configure: configure.in - cd $(srcdir); autoconf - - TAGS: $(SRCS) - etags $(SRCS) - - clean: - rm -f cpio rmt mt *.o core - - mostlyclean: clean - - distclean: clean - rm -f Makefile config.status - - realclean: distclean - rm -f TAGS - - dist: $(DISTFILES) - echo cpio-`sed -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname - rm -rf `cat .fname` - mkdir `cat .fname` - -ln $(DISTFILES) `cat .fname` - for file in $(DISTFILES); do \ - test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \ - done - tar chzf `cat .fname`.tar.gz `cat .fname` - rm -rf `cat .fname` .fname - - -File: autoconf.info, Node: Preprocessor Symbol Index, Next: Macro Index, Prev: Example, Up: Top - -Preprocessor Symbol Index -************************* - - This is an alphabetical list of the C preprocessor symbols that the -Autoconf macros define. To work with Autoconf, C source code needs to -use these names in `#if' directives. - -* Menu: - -* CC: Overriding variables. -* CONFIG_FILES: Invoking config.status. -* CONFIG_HEADERS: Invoking config.status. -* CONFIG_SHELL: Invoking config.status. -* const: Compiler Characteristics. -* C_ALLOCA: Library Functions. -* DEFS: Overriding variables. -* DEFS: Predefined Variables. -* DGUX: Library Functions. -* DIRENT: Header Files. -* exec_prefix: Predefined Variables. -* GETGROUPS_T: Typedefs. -* GETLODAVG_PRIVILEGED: Library Functions. -* gid_t: Typedefs. -* HAVE_FUNCTION: General Feature Tests. -* HAVE_HEADER: General Feature Tests. -* HAVE_ALLOCA_H: Library Functions. -* HAVE_CONFIG_H: Setup. -* HAVE_DOPRNT: Library Functions. -* HAVE_LONG_DOUBLE: Compiler Characteristics. -* HAVE_LONG_FILE_NAMES: System Services. -* HAVE_MMAP: Library Functions. -* HAVE_NETDB_H: Alternative Programs. -* HAVE_RESTARTABLE_SYSCALLS: System Services. -* HAVE_STRCOLL: Library Functions. -* HAVE_ST_BLKSIZE: Structures. -* HAVE_ST_BLOCKS: Structures. -* HAVE_ST_RDEV: Structures. -* HAVE_SYS_MTIO_H: System Services. -* HAVE_TM_ZONE: Structures. -* HAVE_TZNAME: Structures. -* HAVE_UNISTD_H: Header Files. -* HAVE_UTIME_NULL: Library Functions. -* HAVE_VFORK_H: Library Functions. -* HAVE_VPRINTF: Library Functions. -* HAVE_WAIT3: Library Functions. -* inline: Compiler Characteristics. -* INSTALL: Overriding variables. -* INT_16_BITS: Compiler Characteristics. -* LIBOBJS: Predefined Variables. -* LIBS: Predefined Variables. -* LIBS: Overriding variables. -* LONG_64_BITS: Compiler Characteristics. -* MAJOR_IN_MKDEV: Header Files. -* MAJOR_IN_SYSMACROS: Header Files. -* mode_t: Typedefs. -* NDIR: Header Files. -* NEED_MEMORY_H: Header Files. -* NEED_SETGID: Library Functions. -* NLIST_NAME_UNION: Library Functions. -* NLIST_STRUCT: Library Functions. -* NO_ARG_ARRAY: Compiler Characteristics. -* NO_MINUS_C_MINUS_O: Alternative Programs. -* NO_REMOTE: Alternative Programs. -* off_t: Typedefs. -* pid_t: Typedefs. -* prefix: Predefined Variables. -* RETSIGTYPE: Typedefs. -* SETVBUF_REVERSED: Library Functions. -* size_t: Typedefs. -* srcdir: Predefined Variables. -* STDC_HEADERS: Header Files. -* SVR4: Library Functions. -* SYSDIR: Header Files. -* SYSNDIR: Header Files. -* SYS_SIGLIST_DECLARED: Header Files. -* TIME_WITH_SYS_TIME: Structures. -* TM_IN_SYS_TIME: Structures. -* top_srcdir: Predefined Variables. -* uid_t: Typedefs. -* UMAX: Library Functions. -* UMAX4_3: Library Functions. -* USG: Header Files. -* vfork: Library Functions. -* VOID_CLOSEDIR: Header Files. -* VOID_CLOSEDIR: UNIX Variants. -* WORDS_BIGENDIAN: Compiler Characteristics. -* YYTEXT_POINTER: Alternative Programs. -* _ALL_SOURCE: UNIX Variants. -* _MINIX: UNIX Variants. -* _POSIX_1_SOURCE: UNIX Variants. -* _POSIX_SOURCE: UNIX Variants. -* _POSIX_SOURCE: UNIX Variants. -* _POSIX_VERSION: Header Files. -* __CHAR_UNSIGNED__: Compiler Characteristics. - - -File: autoconf.info, Node: Macro Index, Prev: Preprocessor Symbol Index, Up: Top - -Macro Index -*********** - - This is an alphabetical list of the Autoconf macros. To make the -list easier to use, the macros are listed without their preceding `AC_'. - -* Menu: - -* AIX: UNIX Variants. -* ALLOCA: Library Functions. -* ARG_ARRAY: Compiler Characteristics. -* BEFORE: Macro Ordering. -* CHAR_UNSIGNED: Compiler Characteristics. -* CHECKING: Printing Messages. -* COMPILE_CHECK: General Feature Tests. -* CONFIG_HEADER: Setup. -* CONST: Compiler Characteristics. -* CROSS_CHECK: Compiler Characteristics. -* DEFINE: Setting Variables. -* DEFINE_UNQUOTED: Setting Variables. -* DIR_HEADER: Header Files. -* DYNIX_SEQ: UNIX Variants. -* ENABLE: Command Line. -* ERROR: Printing Messages. -* FIND_X: System Services. -* FIND_XTRA: System Services. -* FUNC_CHECK: General Feature Tests. -* GCC_TRADITIONAL: Alternative Programs. -* GETGROUPS_T: Typedefs. -* GETLOADAVG: Library Functions. -* HAVE_FUNCS: General Feature Tests. -* HAVE_HEADERS: General Feature Tests. -* HAVE_LIBRARY: General Feature Tests. -* HAVE_LONG_DOUBLE: Compiler Characteristics. -* HAVE_POUNDBANG: System Services. -* HEADER_CHECK: General Feature Tests. -* HEADER_EGREP: General Feature Tests. -* INIT: Setup. -* INLINE: Compiler Characteristics. -* INT_16_BITS: Compiler Characteristics. -* IRIX_SUN: UNIX Variants. -* ISC_POSIX: UNIX Variants. -* LANG_C: Language Choice. -* LANG_CPLUSPLUS: Language Choice. -* LANG_RESTORE: Language Choice. -* LANG_SAVE: Language Choice. -* LN_S: Alternative Programs. -* LONG_64_BITS: Compiler Characteristics. -* LONG_FILE_NAMES: System Services. -* MAJOR_HEADER: Header Files. -* MEMORY_H: Header Files. -* MINIX: UNIX Variants. -* MINUS_C_MINUS_O: Alternative Programs. -* MMAP: Library Functions. -* MODE_T: Typedefs. -* OBSOLETE: Macro Ordering. -* OFF_T: Typedefs. -* OUTPUT: Setup. -* PID_T: Typedefs. -* PREFIX: Command Line. -* PREPARE: Setup. -* PREREQ: Setup. -* PROGRAMS_CHECK: General Feature Tests. -* PROGRAMS_PATH: General Feature Tests. -* PROGRAM_CHECK: General Feature Tests. -* PROGRAM_EGREP: General Feature Tests. -* PROGRAM_PATH: General Feature Tests. -* PROG_AWK: Alternative Programs. -* PROG_CC: Alternative Programs. -* PROG_CPP: Alternative Programs. -* PROG_CXX: Alternative Programs. -* PROG_CXXCPP: Alternative Programs. -* PROG_INSTALL: Alternative Programs. -* PROG_LEX: Alternative Programs. -* PROG_RANLIB: Alternative Programs. -* PROG_YACC: Alternative Programs. -* PROVIDE: Macro Ordering. -* REMOTE_TAPE: System Services. -* REPLACE_FUNCS: General Feature Tests. -* REQUIRE: Macro Ordering. -* REQUIRE_CPP: Language Choice. -* RESTARTABLE_SYSCALLS: System Services. -* RETSIGTYPE: Typedefs. -* REVISION: Setup. -* RSH: Alternative Programs. -* SCO_INTL: UNIX Variants. -* SETVBUF_REVERSED: Library Functions. -* SET_MAKE: Alternative Programs. -* SIZEOF_TYPE: General Feature Tests. -* SIZE_T: Typedefs. -* STAT_MACROS_BROKEN: Structures. -* STAT_MACROS_BROKEN: Structures. -* STDC_HEADERS: Header Files. -* STRCOLL: Library Functions. -* STRUCT_TM: Structures. -* ST_BLKSIZE: Structures. -* ST_BLOCKS: Structures. -* ST_RDEV: Structures. -* SUBST: Setting Variables. -* SYS_SIGLIST_DECLARED: Header Files. -* TEST_CPP: General Feature Tests. -* TEST_PROGRAM: General Feature Tests. -* TIMEZONE: Structures. -* TIME_WITH_SYS_TIME: Structures. -* UID_T: Typedefs. -* UNISTD_H: Header Files. -* USG: Header Files. -* UTIME_NULL: Library Functions. -* VERBOSE: Printing Messages. -* VFORK: Library Functions. -* VPRINTF: Library Functions. -* WAIT3: Library Functions. -* WARN: Printing Messages. -* WITH: Command Line. -* WORDS_BIGENDIAN: Compiler Characteristics. -* XENIX_DIR: UNIX Variants. -* YYTEXT_POINTER: Alternative Programs. - - +Indirect: +autoconf.info-1: 1085 +autoconf.info-2: 49676 +autoconf.info-3: 99256 +autoconf.info-4: 148276 +autoconf.info-5: 195482  Tag Table: -Node: Top1070 -Node: Introduction4458 -Node: Distributing8287 -Node: Making configure Scripts9395 -Node: Writing configure.in11992 -Node: Invoking autoconf14425 -Node: Invoking autoheader16274 -Node: Specific Tests18427 -Node: Alternative Programs20099 -Node: Header Files25593 -Node: Typedefs31278 -Node: Library Functions32495 -Node: Structures37266 -Node: Compiler Characteristics39356 -Node: System Services42168 -Node: UNIX Variants44673 -Node: General Purpose Macros46581 -Node: Setup47732 -Node: General Feature Tests52686 -Node: Command Line61952 -Node: Setting Variables65766 -Node: Printing Messages69098 -Node: Language Choice71326 -Node: Macro Ordering72947 -Node: Writing Macros75693 -Node: Macro Format77189 -Node: Quoting78686 -Node: Dependencies Between Macros80144 -Node: Prerequisite Macros80731 -Node: Suggested Ordering81780 -Node: Checking for Files83159 -Node: Checking for Symbols83945 -Node: Test Programs85424 -Node: Guidelines87089 -Node: Tricks88232 -Node: Multiple Cases89235 -Node: Makefiles90439 -Node: Predefined Variables91840 -Node: Installation Prefixes93348 -Node: VPATH Substitutions94918 -Node: Automatic Remaking96639 -Node: Invoking configure98223 -Node: Overriding variables101711 -Node: Invoking config.status103334 -Node: Example106313 -Node: Sample configure.in106893 -Node: Sample Makefile.in108030 -Node: Preprocessor Symbol Index112015 -Node: Macro Index117272 +(Indirect) +Node: Top1085 +Node: Introduction9214 +Node: Making configure Scripts13054 +Node: Writing configure.in16119 +Node: Invoking autoscan19366 +Node: Invoking ifnames21671 +Node: Invoking autoconf23161 +Node: Invoking autoreconf24999 +Node: Setup26562 +Node: Input27448 +Node: Output29064 +Node: Makefile Substitutions31814 +Node: Preset Output Variables33396 +Node: Build Directories36634 +Node: Automatic Remaking38360 +Node: Configuration Headers40296 +Node: Header Templates42663 +Node: Invoking autoheader43842 +Node: Subdirectories46929 +Node: Default Prefix48272 +Node: Versions49676 +Node: Existing Tests51578 +Node: Alternative Programs53043 +Node: Particular Programs53707 +Node: Generic Programs59017 +Node: Libraries60694 +Node: Library Functions62523 +Node: Particular Functions63081 +Node: Generic Functions68828 +Node: Header Files70669 +Node: Particular Headers71228 +Node: Generic Headers78199 +Node: Structures79499 +Node: Typedefs81736 +Node: Particular Typedefs82240 +Node: Generic Typedefs83498 +Node: Compiler Characteristics83947 +Node: System Services86403 +Node: UNIX Variants88724 +Node: Writing Tests90743 +Node: Examining Declarations92515 +Node: Examining Syntax94981 +Node: Examining Libraries96036 +Node: Run Time98295 +Node: Test Programs99256 +Node: Guidelines101791 +Node: Test Functions102980 +Node: Portable Shell104523 +Node: Testing Values and Files106175 +Node: Multiple Cases107830 +Node: Language Choice109028 +Node: Results110586 +Node: Defining Symbols111345 +Node: Setting Output Variables114354 +Node: Caching Results116205 +Node: Cache Variable Names118107 +Node: Cache Files119656 +Node: Printing Messages121441 +Node: Writing Macros124728 +Node: Macro Definitions125347 +Node: Macro Names126452 +Node: Quoting128903 +Node: Dependencies Between Macros130805 +Node: Prerequisite Macros131437 +Node: Suggested Ordering132892 +Node: Obsolete Macros134422 +Node: Manual Configuration135646 +Node: Specifying Names136555 +Node: Canonicalizing138427 +Node: System Type Variables139741 +Node: Using System Type140488 +Node: Site Configuration141768 +Node: External Software142541 +Node: Package Options145006 +Node: Site Details147062 +Node: Transforming Names148276 +Node: Transformation Options149455 +Node: Transformation Examples149921 +Node: Transformation Rules151421 +Node: Site Defaults152044 +Node: Invoking configure155184 +Node: Basic Installation156051 +Node: Compilers and Options158373 +Node: Build Directory159015 +Node: Installation Names159716 +Node: Optional Features160634 +Node: System Type161404 +Node: Sharing Defaults162426 +Node: Operation Controls163050 +Node: Invoking config.status163914 +Node: Questions167302 +Node: Distributing167834 +Node: Why GNU m4168960 +Node: Bootstrapping169773 +Node: Why Not Imake170389 +Node: Upgrading174970 +Node: Changed File Names176491 +Node: Changed Makefiles177227 +Node: Changed Macros178307 +Node: Invoking autoupdate179521 +Node: Changed Results181112 +Node: Changed Macro Writing183214 +Node: History184477 +Node: Genesis185184 +Node: Exodus186357 +Node: Leviticus189406 +Node: Numbers190929 +Node: Deuteronomy192845 +Node: Old Macro Names195482 +Node: Environment Variable Index198531 +Node: Output Variable Index199533 +Node: Preprocessor Symbol Index203614 +Node: Macro Index208422  End Tag Table diff --git a/src/util/autoconf/autoconf.info-1 b/src/util/autoconf/autoconf.info-1 new file mode 100644 index 000000000..cd067c672 --- /dev/null +++ b/src/util/autoconf/autoconf.info-1 @@ -0,0 +1,1128 @@ +This is Info file autoconf.info, produced by Makeinfo-1.55 from the +input file ./autoconf.texi. + +START-INFO-DIR-ENTRY +* Autoconf: (autoconf). Create source code configuration scripts. +END-INFO-DIR-ENTRY + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. + + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: autoconf.info, Node: Top, Next: Introduction, Up: (dir) + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. This is edition 1.125, for Autoconf version 1.125. + +* Menu: + +* Introduction:: Autoconf's purpose, strengths, and weaknesses. +* Making configure Scripts:: How to organize and produce Autoconf scripts. +* Setup:: Initialization and output. +* Existing Tests:: Macros that check for particular features. +* Writing Tests:: How to write new feature checks. +* Results:: What to do with results from feature checks. +* Writing Macros:: Adding new macros to Autoconf. +* Manual Configuration:: Selecting features that can't be guessed. +* Site Configuration:: Local defaults for `configure'. +* Invoking configure:: How to use the Autoconf output. +* Invoking config.status:: Recreating a configuration. +* Questions:: Questions about Autoconf, with answers. +* Upgrading:: Tips for upgrading from version 1. +* History:: History of Autoconf. +* 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. +* Macro Index:: Index of Autoconf macros. + + -- The Detailed Node Listing -- + +Making `configure' Scripts + +* Writing configure.in:: What to put in an Autoconf input file. +* Invoking autoscan:: Semi-automatic `configure.in' writing. +* Invoking ifnames:: Listing the conditionals in source code. +* Invoking autoconf:: How to create configuration scripts. +* Invoking autoreconf:: Remaking multiple `configure' scripts. + +Initialization and Output Files + +* Input:: Where Autoconf should find files. +* Output:: Creating output files. +* Makefile Substitutions:: Using output variables in `Makefile's. +* Configuration Headers:: Creating a configuration header file. +* Subdirectories:: Configuring independent packages together. +* Default Prefix:: Changing the default installation prefix. +* Versions:: Version numbers in `configure'. + +Substitutions in Makefiles + +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Compiling in a different directory. +* Automatic Remaking:: Makefile rules for configuring. + +Configuration Header Files + +* Header Templates:: Input for the configuration headers. +* Invoking autoheader:: How to create configuration templates. + +Existing Tests + +* 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:: `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 + +* Particular Programs:: Special handling to find certain programs. +* Generic Programs:: How to find other programs. + +Library Functions + +* Particular Functions:: Special handling to find certain functions. +* Generic Functions:: How to find other functions. + +Header Files + +* Particular Headers:: Special handling to find certain headers. +* Generic Headers:: How to find other headers. + +Typedefs + +* Particular Typedefs:: Special handling to find certain types. +* Generic Typedefs:: How to find other types. + +Writing Tests + +* 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. +* Portable Shell:: Shell script portability pitfalls. +* Testing Values and Files:: Checking strings and files. +* 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. + +Results of Tests + +* Defining Symbols:: Defining C preprocessor symbols. +* Setting Output Variables:: Replacing variables in output files. +* Caching Results:: Speeding up subsequent `configure' runs. +* Printing Messages:: Notifying users of progress or problems. + +Caching Results + +* Cache Variable Names:: Shell variables used in caches. +* Cache Files:: Files `configure' uses for caching. + +Writing Macros + +* 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. + +Dependencies Between Macros + +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. +* Obsolete Macros:: Warning about old ways of doing things. + +Manual Configuration + +* Specifying Names:: Specifying the system type. +* Canonicalizing:: Getting the canonical system type. +* System Type Variables:: Variables containing the system type. +* Using System Type:: What to do with the system type. + +Site Configuration + +* External Software:: Working with other optional software. +* Package Options:: Selecting optional features. +* Site Details:: Configuring site details. +* Transforming Names:: Changing program names when installing. +* Site Defaults:: Giving `configure' local defaults. + +Transforming Program Names When Installing + +* Transformation Options:: `configure' options to transforme names. +* Transformation Examples:: Sample uses of transforming names. +* Transformation Rules:: `Makefile' uses of transforming names. + +Running `configure' Scripts + +* Basic Installation:: Instructions for typical cases. +* Compilers and Options:: Selecting compilers and optimization. +* Build Directory:: Configuring in a different directory. +* Installation Names:: Installing in different directories. +* Optional Features:: Selecting optional features. +* System Type:: Specifying the system type. +* Sharing Defaults:: Setting site-wide defaults for `configure'. +* Operation Controls:: Changing how `configure' runs. + +Questions About Autoconf + +* Distributing:: Distributing `configure' scripts. +* Why GNU m4:: Why not use the standard `m4'? +* Bootstrapping:: Autoconf and GNU `m4' require each other? +* Why Not Imake:: Why GNU uses `configure' instead of Imake. + +Upgrading From Version 1 + +* Changed File Names:: Files you might rename. +* Changed Makefiles:: New things to put in `Makefile.in'. +* Changed Macros:: Macro calls you might replace. +* Invoking autoupdate:: Replacing old macro names in `configure.in'. +* Changed Results:: Changes in how to check test results. +* Changed Macro Writing:: Better ways to write your own macros. + +History of Autoconf + +* Genesis:: Prehistory and naming of `configure'. +* Exodus:: The plagues of `m4' and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. + + +File: autoconf.info, Node: Introduction, Next: Making configure Scripts, Prev: Top, Up: Top + +Introduction +************ + + A physicist, an engineer, and a computer scientist were + discussing the nature of God. Surely a Physicist, said the + physicist, because early in the Creation, God made Light; and you + know, Maxwell's equations, the dual nature of electro-magnetic + waves, the relativist consequences... An Engineer!, said the + engineer, because before making Light, God split the Chaos into + Land and Water; it takes a hell of an engineer to handle that big + amount of mud, and orderly separation of solids from + liquids... The computer scientist shouted: And the Chaos, + where do you think it was coming from, hmm? + + ---Anonymous + + Autoconf is a tool for producing shell scripts that automatically +configure software source code packages to adapt to many kinds of +UNIX-like systems. The configuration scripts produced by Autoconf are +independent of Autoconf when they are run, so their users do not need to +have Autoconf. + + The configuration scripts produced by Autoconf require no manual user +intervention when run; they do not normally even need an argument +specifying the system type. Instead, they test for the presence of each +feature that the software package they are for might need individually. +(Before each check, they print a one-line message stating what they are +checking for, so the user doesn't get too bored while waiting for the +script to finish.) As a result, they deal well with systems that are +hybrids or customized from the more common UNIX variants. There is no +need to maintain files that list the features supported by each release +of each variant of UNIX. + + For each software package that Autoconf is used with, it creates a +configuration script from a template file that lists the system +features that the package needs or can use. After the shell code to +recognize and respond to a system feature has been written, Autoconf +allows it to be shared by many software packages that can use (or need) +that feature. If it later turns out that the shell code needs +adjustment for some reason, it needs to be changed in only one place; +all of the configuration scripts can be regenerated automatically to +take advantage of the updated code. + + The Metaconfig package is similar in purpose to Autoconf, but the +scripts it produces require manual user intervention, which is quite +inconvenient when configuring large source trees. Unlike Metaconfig +scripts, Autoconf scripts can support cross-compiling, if some care is +taken in writing them. + + There are several jobs related to making portable software packages +that Autoconf currently does not do. Among these are automatically +creating `Makefile' files with all of the standard targets, and +supplying replacements for standard library functions and header files +on systems that lack them. Work is in progress to add those features in +the future. + + Autoconf imposes some restrictions on the names of macros used with +`#ifdef' in C programs (*note Preprocessor Symbol Index::.). + + Autoconf requires GNU `m4' in order to generate the scripts. It +uses features that some UNIX versions of `m4' do not have. It also +overflows internal limits of some versions of `m4', including GNU `m4' +1.0. You must use version 1.1 or later of GNU `m4'. Using version 1.3 +or later will be much faster than 1.1 or 1.2. + + *Note Upgrading::, for information about upgrading from version 1. +*Note History::, for the story of Autoconf's development. *Note +Questions::, for answers to some common questions about Autoconf. + + Mail suggestions and bug reports for Autoconf to +`bug-gnu-utils@prep.ai.mit.edu'. Please include the Autoconf version +number, which you can get by running `autoconf --version'. + + +File: autoconf.info, Node: Making configure Scripts, Next: Setup, Prev: Introduction, Up: Top + +Making `configure' Scripts +************************** + + The configuration scripts that Autoconf produces are by convention +called `configure'. When run, `configure' creates several files, +replacing configuration parameters in them with appropriate values. +The files that `configure' creates are: + + * one or more `Makefile' files, one in each subdirectory of the + package (*note Makefile Substitutions::.); + + * optionally, a C header file, the name of which is configurable, + containing `#define' directives (*note Configuration Headers::.); + + * a shell script called `config.status' that, when run, will recreate + the files listed above (*note Invoking config.status::.); + + * a shell script called `config.cache' that saves the results of + running many of the tests (*note Cache Files::.); + + * a file called `config.log' containing any messages produced by + compilers, to help debugging if `configure' makes a mistake. + + To create a `configure' script with Autoconf, you need to write an +Autoconf input file `configure.in' and run `autoconf' on it. If you +write your own feature tests to supplement those that come with +Autoconf, you might also write files called `aclocal.m4' and +`acsite.m4'. If you use a C header file to contain `#define' +directives, you might also write `acconfig.h', and you will distribute +the Autoconf-generated file `config.h.in' with the package. + + Here is a diagram showing how the files that can be used in +configuration are produced. Programs that are executed are suffixed by +`*'. Optional files are enclosed in square brackets (`[]'). +`autoconf' and `autoheader' also read the installed Autoconf macro +files (by reading `autoconf.m4'). + +Files used in preparing a software package for distribution: + your source files --> [autoscan*] --> [configure.scan] --> configure.in + + configure.in --. .------> autoconf* -----> configure + +---+ + [aclocal.m4] --+ `---. + [acsite.m4] ---' | + +--> [autoheader*] -> [config.h.in] + [acconfig.h] ----. | + +-----' + [config.h.top] --+ + [config.h.bot] --' + + Makefile.in -------------------------------> Makefile.in + +Files used in configuring a software package: + .-------------> config.cache + configure* ------------+-------------> config.log + | + [config.h.in] -. v .-> [config.h] -. + +--> config.status* -+ +--> make* + Makefile.in ---' `-> Makefile ---' + +* Menu: + +* Writing configure.in:: What to put in an Autoconf input file. +* Invoking autoscan:: Semi-automatic `configure.in' writing. +* Invoking ifnames:: Listing the conditionals in source code. +* Invoking autoconf:: How to create configuration scripts. +* Invoking autoreconf:: Remaking multiple `configure' scripts. + + +File: autoconf.info, Node: Writing configure.in, Next: Invoking autoscan, Up: Making configure Scripts + +Writing `configure.in' +====================== + + To produce a `configure' script for a software package, create a +file called `configure.in' that contains invocations of the Autoconf +macros that test the system features your package needs or can use. +Autoconf macros already exist to check for many features; see *Note +Existing Tests::, for their descriptions. For most other features, you +can use Autoconf template macros to produce custom checks; see *Note +Writing Tests::, for information about them. For especially tricky or +specialized features, `configure.in' might need to contain some +hand-crafted shell commands. The `autoscan' program can give you a +good start in writing `configure.in' (*note Invoking autoscan::., for +more information). + + The order in which `configure.in' calls the Autoconf macros is not +important, with a few exceptions. Every `configure.in' must contain a +call to `AC_INIT' before the checks, and a call to `AC_OUTPUT' at the +end (*note Output::.). Additionally, some macros rely on other macros +having been called first, because they check previously set values of +some variables to decide what to do. These macros are noted in the +individual descriptions (*note Existing Tests::.), and they also warn +you when creating `configure' if they are called out of order. + + To encourage consistency, here is a suggested order for calling the +Autoconf macros. Generally speaking, the things near the end of this +list could depend on things earlier in it. For example, library +functions could be affected by typedefs and libraries. + + `AC_INIT(FILE)' + checks for programs + checks for libraries + checks for header files + checks for typedefs + checks for structures + checks for compiler characteristics + checks for library functions + checks for system services + `AC_OUTPUT([FILE...])' + + When calling macros that take arguments, there must not be any blank +space between the macro name and the open parenthesis. Arguments can be +more than one line long if they are enclosed within the `m4' quote +characters `[' and `]'. If you have a long line such as a list of file +names, you can generally use a backslash at the end of a line to +continue it logically on the next line (this is implemented by the +shell, not by anything special that Autoconf does). + + Some macros handle two cases: what to do if the given condition is +met, and what to do if the condition is not met. In some places you +might want to do something if a condition is true but do nothing if it's +false, or vice versa. To omit the true case, pass an empty value for +the ACTION-IF-FOUND argument to the macro. To omit the false case, +omit the ACTION-IF-NOT-FOUND argument to the macro, including the comma +before it. + + You can include comments in `configure.in' files by starting them +with the `m4' builtin macro `dnl', which discards text up through the +next newline. These comments do not appear in the generated +`configure' scripts. For example, it is helpful to begin +`configure.in' files with a line like this: + + dnl Process this file with autoconf to produce a configure script. + + +File: autoconf.info, Node: Invoking autoscan, Next: Invoking ifnames, Prev: Writing configure.in, Up: Making configure Scripts + +Using `autoscan' to Create `configure.in' +========================================= + + The `autoscan' program can help you create a `configure.in' file for +a software package. `autoscan' examines source files in the directory +tree rooted at a directory given as a command line argument, or the +current directory if none is given. It searches the source files for +common portability problems and creates a file `configure.scan' which +is a preliminary `configure.in' for that package. + + You should manually examine `configure.scan' before renaming it to +`configure.in'; it will probably need some adjustments. Occasionally +`autoscan' outputs a macro in the wrong order relative to another +macro, so that `autoconf' produces a warning; you need to move such +macros manually. Also, if you want the package to use a configuration +header file, you must add a call to `AC_CONFIG_HEADER' (*note +Configuration Headers::.). You might also have to change or add some +`#if' directives to your program in order to make it work with Autoconf +(*note Invoking ifnames::., for information about a program that can +help with that job). + + `autoscan' uses several data files, which are installed along with +the distributed Autoconf macro files, to determine which macros to +output when it finds particular symbols in a package's source files. +These files all have the same format. Each line consists of a symbol, +whitespace, and the Autoconf macro to output if that symbol is +encountered. Lines starting with `#' are comments. + + `autoscan' is only installed if you already have Perl installed. +`autoscan' accepts the following options: + +`--help' + Print a summary of the command line options and exit. + +`--macrodir=DIR' + Look for the data files in directory DIR instead of the default + installation directory. You can also set the `AC_MACRODIR' + environment variable to a directory; this option overrides the + environment variable. + +`--verbose' + Print the names of the files it examines and the potentially + interesting symbols it finds in them. This output can be + voluminous. + +`--version' + Print the version number of Autoconf and exit. + + +File: autoconf.info, Node: Invoking ifnames, Next: Invoking autoconf, Prev: Invoking autoscan, Up: Making configure Scripts + +Using `ifnames' to List Conditionals +==================================== + + `ifnames' can help when writing a `configure.in' for a software +package. It prints the identifiers that the package already uses in C +preprocessor conditionals. If a package has already been set up to +have some portability, this program can help you figure out what its +`configure' needs to check for. It may help fill in some gaps in a +`configure.in' generated by `autoscan' (*note Invoking autoscan::.). + + `ifnames' scans all of the C source files named on the command line +(or the standard input, if none are given) and writes to the standard +output a sorted list of all the identifiers that appear in those files +in `#if', `#elif', `#ifdef', or `#ifndef' directives. It prints each +identifier on a line, followed by a space-separated list of the files +in which that identifier occurs. + +`ifnames' accepts the following options: + +`--help' +`-h' + Print a summary of the command line options and exit. + +`--macrodir=DIR' +`-m DIR' + Look for the Autoconf macro files in directory DIR instead of the + default installation directory. Only used to get the version + number. You can also set the `AC_MACRODIR' environment variable + to a directory; this option overrides the environment variable. + +`--version' + Print the version number of Autoconf and exit. + + +File: autoconf.info, Node: Invoking autoconf, Next: Invoking autoreconf, Prev: Invoking ifnames, Up: Making configure Scripts + +Using `autoconf' to Create `configure' +====================================== + + To create `configure' from `configure.in', run the `autoconf' +program with no arguments. `autoconf' processes `configure.in' with +the `m4' macro processor, using the Autoconf macros. If you give +`autoconf' an argument, it reads that file instead of `configure.in' +and writes the configuration script to the standard output instead of +to `configure'. If you give `autoconf' the argument `-', it reads the +standard input instead of `configure.in' and writes the configuration +script on the standard output. + + The Autoconf macros are defined in several files. Some of the files +are distributed with Autoconf; `autoconf' reads them first. Then it +looks for the optional file `acsite.m4' in the directory that contains +the distributed Autoconf macro files, and for the optional file +`aclocal.m4' in the current directory. Those files can contain your +site's or the package's own Autoconf macro definitions (*note Writing +Macros::., for more information). If a macro is defined in more than +one of the files that `autoconf' reads, the last definition it reads +overrides the earlier ones. + + `autoconf' accepts the following options: + +`--help' +`-h' + Print a summary of the command line options and exit. + +`--localdir=DIR' +`-l DIR' + Look for the package file `aclocal.m4' in directory DIR instead of + in the current directory. + +`--macrodir=DIR' +`-m DIR' + Look for the installed macro files in directory DIR. You can also + set the `AC_MACRODIR' environment variable to a directory; this + option overrides the environment variable. + +`--version' + Print the version number of Autoconf and exit. + + +File: autoconf.info, Node: Invoking autoreconf, Prev: Invoking autoconf, Up: Making configure Scripts + +Using `autoreconf' to Update `configure' Scripts +================================================ + + If you have a lot of Autoconf-generated `configure' scripts and you +get a new version of Autoconf, the `autoreconf' program can be handy. +It runs `autoconf' (and `autoheader', where appropriate) repeatedly to +remake all of the Autoconf `configure' scripts in the directory tree +rooted at the current directory. If you give the `--macrodir=DIR' or +`--localdir=DIR' options, it passes them down (with relative paths +adjusted properly). + + *Note Automatic Remaking::, for information about automatic remaking +of `configure' scripts when their source files change. + +`autoreconf' accepts the following options: + +`--help' +`-h' + Print a summary of the command line options and exit. + +`--localdir=DIR' +`-l DIR' + Look for the package files `aclocal.m4' and `acconfig.h' (but not + `FILE.top' and `FILE.bot') in directory DIR instead of in the + directory containing each `configure.in'. + +`--macrodir=DIR' +`-m DIR' + Look for the Autoconf macro files in directory DIR instead of the + default installation directory. You can also set the `AC_MACRODIR' + environment variable to a directory; this option overrides the + environment variable. + +`--verbose' + Print the name of each directory where `autoreconf' runs + `autoconf' (and `autoheader', if appropriate). + +`--version' + Print the version number of Autoconf and exit. + + +File: autoconf.info, Node: Setup, Next: Existing Tests, Prev: Making configure Scripts, Up: Top + +Initialization and Output Files +******************************* + + Autoconf-generated `configure' scripts need some information about +how to initialize, such as how to find the package's source files; and +about the output files to produce. The following sections describe +initialization and creating output files. + +* Menu: + +* Input:: Where Autoconf should find files. +* Output:: Creating output files. +* Makefile Substitutions:: Using output variables in `Makefile's. +* Configuration Headers:: Creating a configuration header file. +* Subdirectories:: Configuring independent packages together. +* Default Prefix:: Changing the default installation prefix. +* Versions:: Version numbers in `configure'. + + +File: autoconf.info, Node: Input, Next: Output, Up: Setup + +Finding `configure' Input +========================= + + Every `configure' script must call `AC_INIT' before doing anything +else. The only other required macro is `AC_OUTPUT' (*note Output::.). + + - Macro: AC_INIT (UNIQUE-FILE-IN-SOURCE-DIR) + Process any command-line arguments and find the source code + directory. UNIQUE-FILE-IN-SOURCE-DIR is some file that is in the + package's source directory; `configure' checks for this file's + existence to make sure that the directory that it is told contains + the source code in fact does (*note Invoking configure::., for + more information). + + Packages that do manual configuration or use the `install' program +might need to tell `configure' where to find some other shell scripts +by calling `AC_CONFIG_AUX_DIR', though the default places it looks are +correct for most cases. + + - Macro: AC_CONFIG_AUX_DIR(DIR) + Use the `install-sh', `config.sub', `config.guess', and Cygnus + `configure' scripts that are in directory DIR. These are + auxiliary files used in configuration. DIR can be either absolute + or relative to `SRCDIR'. The default is `SRCDIR' or `SRCDIR/..' or + `SRCDIR/../..', whichever is the first that contains `install-sh'. + The other files are not checked for, so that using + `AC_PROG_INSTALL' does not automatically require distributing the + other auxiliary files. It checks for `install.sh' also, but that + name is obsolete because some `make' programs have a rule that + creates `install' from it if there is no `Makefile'. + + +File: autoconf.info, Node: Output, Next: Makefile Substitutions, Prev: Input, Up: Setup + +Creating Output Files +===================== + + Every Autoconf-generated `configure' script must finish by calling +`AC_OUTPUT'. It is the macro that creates the `Makefile's and optional +other files resulting from configuration. The only other required +macro is `AC_INIT' (*note Input::.). + + - Macro: AC_OUTPUT ([FILE...] [,EXTRA-CMDS] [,INIT-CMDS]) + Create output files. The FILE... argument is a + whitespace-separated list of output files; it may be empty. This + macro creates each file `FILE' by copying an input file (by default + named `FILE.in'), substituting the output variable values. *Note + Makefile Substitutions::, for more information on using output + variables. *Note Setting Output Variables::, for more information + on creating them. This macro creates the directory that the file + is in if it doesn't exist (but not the parents of that directory). + Usually, `Makefile's are created this way, but other files, such + as `.gdbinit', can be specified as well. + + If `AC_CONFIG_HEADER', `AC_LINK_FILES', or `AC_CONFIG_SUBDIRS' has + been called, this macro also creates the files named as their + arguments. + + A typical call to `AC_OUTPUT' looks like this: + AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile) + + You can override an input file name by appending it to FILE, + separated by a colon. For example, + AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) + + If you pass EXTRA-CMDS, those commands will be inserted into + `config.status' to be run after all its other processing. If + INIT-CMDS are given, they are inserted just before EXTRA-CMDS, + with shell variable, command, and backslash substitutions + performed on them in `configure'. You can use INIT-CMDS to pass + variables from `configure' to the EXTRA-CMDS. + + If you run `make' on subdirectories, you should run it using the +`make' variable `MAKE'. Most versions of `make' set `MAKE' to the name +of the `make' program plus any options it was given. (But many do not +include in it the values of any variables set on the command line, so +those are not passed on automatically.) Some old versions of `make' do +not set this variable. The following macro allows you to use it even +with those versions. + + - Macro: AC_PROG_MAKE_SET + If `make' predefines the variable `MAKE', define output variable + `SET_MAKE' to be empty. Otherwise, define `SET_MAKE' to contain + `MAKE=make'. Calls `AC_SUBST' for `SET_MAKE'. + + To use this macro, place a line like this in each `Makefile.in' that +runs `MAKE' on other directories: + + @SET_MAKE@ + + +File: autoconf.info, Node: Makefile Substitutions, Next: Configuration Headers, Prev: Output, Up: Setup + +Substitutions in Makefiles +========================== + + Each subdirectory in a distribution that contains something to be +compiled or installed should come with a file `Makefile.in', from which +`configure' will create a `Makefile' in that directory. To create a +`Makefile', `configure' performs a simple variable substitution, +replacing occurrences of `@VARIABLE@' in `Makefile.in' with the value +that `configure' has determined for that variable. Variables that are +substituted into output files in this way are called "output +variables". They are ordinary shell variables that are set in +`configure'. To make `configure' substitute a particular variable into +the output files, the macro `AC_SUBST' must be called with that +variable name as an argument. Any occurrences of `@VARIABLE@' for +other variables are left unchanged. *Note Setting Output Variables::, +for more information on creating output variables with `AC_SUBST'. + + A software package that uses a `configure' script should be +distributed with a file `Makefile.in', but no `Makefile'; that way, the +user has to properly configure the package for the local system before +compiling it. + + *Note Makefile Conventions: (standards.info)Makefile Conventions, +for more information on what to put in `Makefile's. + +* Menu: + +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Compiling in a different directory. +* Automatic Remaking:: Makefile rules for configuring. + + +File: autoconf.info, Node: Preset Output Variables, Next: Build Directories, Up: Makefile Substitutions + +Preset Output Variables +----------------------- + + Some output variables are preset by the Autoconf macros. Some of the +Autoconf macros set additional output variables, which are mentioned in +the descriptions for those macros. *Note Output Variable Index::, for a +complete list of output variables. Here is what each of the preset ones +contains. + + - Variable: configure_input + A comment saying that the file was generated automatically by + `configure' and giving the name of the input file. `AC_OUTPUT' + adds a comment line containing this variable to the top of every + `Makefile' it creates. For other files, you should reference this + variable in a comment at the top of each input file. For example, + an input shell script should begin like this: + + #!/bin/sh + # @configure_input@ + + The presence of that line also reminds people editing the file + that it needs to be processed by `configure' in order to be used. + + - Variable: exec_prefix + The installation prefix for architecture-dependent files. + + - Variable: prefix + The installation prefix for architecture-independent files. + + - Variable: srcdir + The directory that contains the source code for that `Makefile'. + + - Variable: top_srcdir + The top-level source code directory for the package. In the + top-level directory, this is the same as `srcdir'. + + - Variable: CFLAGS + Debugging and optimization options for the C compiler. If it is + not set in the environment when `configure' runs, the default + value is set when you call `AC_PROG_CC' (or empty if you don't). + `configure' uses this variable when compiling programs to test for + C features. + + - Variable: CPPFLAGS + Header file search directory (`-IDIR') and any other miscellaneous + options for the C preprocessor and compiler. If it is not set in + the environment when `configure' runs, the default value is empty. + `configure' uses this variable when compiling or preprocessing + programs to test for C features. + + - Variable: CXXFLAGS + Debugging and optimization options for the C++ compiler. If it is + not set in the environment when `configure' runs, the default + value is set when you call `AC_PROG_CXX' (or empty if you don't). + `configure' uses this variable when compiling programs to test for + C++ features. + + - Variable: DEFS + `-D' options to pass to the C compiler. If `AC_CONFIG_HEADER' is + called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H' + instead (*note Configuration Headers::.). This variable is not + defined while `configure' is performing its tests, only when + creating the output files. *Note Setting Output Variables::, for + how to check the results of previous tests. + + - Variable: LDFLAGS + Stripping (`-s') and any other miscellaneous options for the + linker. If it is not set in the environment when `configure' runs, + the default value is empty. `configure' uses this variable when + linking programs to test for C features. + + - Variable: LIBS + `-l' and `-L' options to pass to the linker. + + +File: autoconf.info, Node: Build Directories, Next: Automatic Remaking, Prev: Preset Output Variables, Up: Makefile Substitutions + +Build Directories +----------------- + + You might want to compile a software package in a different directory +from the one that contains the source code. Doing this allows you to +compile the package for several architectures simultaneously from the +same copy of the source code and keep multiple sets of object files on +disk. + + To support doing this, `make' uses the `VPATH' variable to find the +files that are in the source directory. GNU `make' and most other +recent `make' programs can do this. Older `make' programs do not +support `VPATH'; when using them, the source code must be in the same +directory as the object files. + + To support `VPATH', each `Makefile.in' should contain two lines that +look like: + + srcdir = @srcdir@ + VPATH = @srcdir@ + + Do not set `VPATH' to the value of another variable, for example +`VPATH = $(srcdir)', because some versions of `make' do not do variable +substitutions on the value of `VPATH'. + + `configure' substitutes in the correct value for `srcdir' when it +produces `Makefile.in'. + + Do not use the `make' variable `$<', which expands to the pathname +of the file in the source directory (found with `VPATH'), except in +implicit rules. (An implicit rule is one such as `.c.o', which tells +how to create a `.o' file from a `.c' file.) Some versions of `make' +do not set `$<' in explicit rules; they expand it to an empty value. + + Instead, `Makefile' command lines should always refer to source +files by prefixing them with `$(srcdir)/'. For example: + + time.info: time.texinfo + $(MAKEINFO) $(srcdir)/time.texinfo + + +File: autoconf.info, Node: Automatic Remaking, Prev: Build Directories, Up: Makefile Substitutions + +Automatic Remaking +------------------ + + You can put rules like the following in the top-level `Makefile.in' +for a package to automatically update the configuration information when +you change the configuration files. This example includes all of the +optional files, such as `aclocal.m4' and those related to configuration +header files. Omit from the `Makefile.in' rules any of these files +that your package does not use. + + The `stamp-' files are necessary because the timestamps of +`config.h.in' and `config.h' will not be changed if remaking them does +not change their contents. This feature avoids unnecessary +recompilation. You should include the file `stamp-h.in' your package's +distribution, so `make' will consider `config.h.in' up to date. On +some old BSD systems, `touch' or any command that results in an empty +file does not update the timestamps, so use a command like `date' as a +workaround. + + configure: configure.in aclocal.m4 + cd ${srcdir} && autoconf + + # autoheader might not change config.h.in, so touch a stamp file. + config.h.in: stamp-h.in + stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot + cd ${srcdir} && autoheader + date > ${srcdir}/stamp-h.in + + config.h: stamp-h + stamp-h: config.h.in config.status + ./config.status + + Makefile: Makefile.in config.status + ./config.status + + config.status: configure + ./config.status --recheck + + In addition, you should pass `date > stamp-h' in the EXTRA-CMDS +argument to `AC_OUTPUT', so `config.status' will ensure that `config.h' +is considered up to date. *Note Output::, for more information about +`AC_OUTPUT'. + + *Note Invoking config.status::, for more examples of handling +configuration-related dependencies. + + +File: autoconf.info, Node: Configuration Headers, Next: Subdirectories, Prev: Makefile Substitutions, Up: Setup + +Configuration Header Files +========================== + + When a package tests more than a few C preprocessor symbols, the +command lines to pass `-D' options to the compiler can get quite long. +This causes two problems. One is that the `make' output is hard to +visually scan for errors. More seriously, the command lines can exceed +the length limits of some operating systems. As an alternative to +passing `-D' options to the compiler, `configure' scripts can create a +C header file containing `#define' directives. The `AC_CONFIG_HEADER' +macro selects this kind of output. It should be called right after +`AC_INIT'. + + The package should `#include' the configuration header file before +any other header files, to prevent inconsistencies in declarations (for +example, if it redefines `const'). Use `#include ' instead +of `#include "config.h"', and pass the C compiler a `-I.' option (or +`-I..'; whichever directory contains `config.h'). That way, even if +the source directory is configured itself (perhaps to make a +distribution), other build directories can also be configured without +finding the `config.h' from the source directory. + + - Macro: AC_CONFIG_HEADER (HEADER-TO-CREATE ...) + Make `AC_OUTPUT' create the file(s) in the whitespace-separated + list HEADER-TO-CREATE containing C preprocessor `#define' + statements, and replace `@DEFS@' in generated files with + `-DHAVE_CONFIG_H' instead of the value of `DEFS'. The usual name + for HEADER-TO-CREATE is `config.h'. + + If HEADER-TO-CREATE already exists and its contents are identical + to what `AC_OUTPUT' would put in it, it is left alone. Doing this + allows some changes in configuration without needlessly causing + object files that depend on the header file to be recompiled. + + Usually the input file is named `HEADER-TO-CREATE.in'; however, + you can override the input file name by appending it to + HEADER-TO-CREATE, separated by a colon. For example, + AC_CONFIG_HEADER(defines.h:defines.hin) + + 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. + + +File: autoconf.info, Node: Header Templates, Next: Invoking autoheader, Up: Configuration Headers + +Configuration Header Templates +------------------------------ + + Your distribution should contain a template file that looks as you +want the final header file to look, including comments, with default +values in the `#define' statements. For example, suppose your +`configure.in' makes these calls: + + AC_CONFIG_HEADER(conf.h) + AC_CHECK_HEADERS(unistd.h) + +Then you could have code like the following in `conf.h.in'. On systems +that have `unistd.h', `configure' will change the 0 to a 1. On other +systems, it will leave the line unchanged. + + /* Define as 1 if you have unistd.h. */ + #define HAVE_UNISTD_H 0 + + Alternately, if your code tests for configuration options using +`#ifdef' instead of `#if', a default value can be to `#undef' the +variable instead of to define it to a value. On systems that have +`unistd.h', `configure' will change the second line to read `#define +HAVE_UNISTD_H 1'. On other systems, it will comment that line out (in +case the system predefines that symbol). + + /* Define if you have unistd.h. */ + #undef HAVE_UNISTD_H + + +File: autoconf.info, Node: Invoking autoheader, Prev: Header Templates, Up: Configuration Headers + +Using `autoheader' to Create `config.h.in' +------------------------------------------ + + The `autoheader' program can create a template file of C `#define' +statements for `configure' to use. If `configure.in' invokes +`AC_CONFIG_HEADER(FILE)', `autoheader' creates `FILE.in'. Otherwise, +`autoheader' creates `config.h.in'. + + If you give `autoheader' an argument, it uses that file instead of +`configure.in' and writes the header file to the standard output +instead of to `config.h.in'. If you give `autoheader' an argument of +`-', it reads the standard input instead of `configure.in' and writes +the header file to the standard output. + + `autoheader' scans `configure.in' and figures out which C +preprocessor symbols it might define. It copies comments and `#define' +and `#undef' statements from a file called `acconfig.h', which comes +with and is installed with Autoconf. It also uses a file called +`acconfig.h' in the current directory, if present. If you `AC_DEFINE' +any additional symbols, you must create that file with entries for +them. For symbols defined by `AC_CHECK_HEADERS', `AC_CHECK_FUNCS', +`AC_CHECK_SIZEOF', or `AC_CHECK_LIB', `autoheader' generates comments +and `#undef' statements itself rather than copying them from a file, +since the possible symbols are effectively limitless. + + The file that `autoheader' creates contains mainly `#define' and +`#undef' statements and their accompanying comments. If `./acconfig.h' +contains the string `@TOP@', `autoheader' copies the lines before the +line containing `@TOP@' into the top of the file that it generates. +Similarly, if `./acconfig.h' contains the string `@BOTTOM@', +`autoheader' copies the lines after that line to the end of the file it +generates. Either or both of those strings may be omitted. + + An alternate way to produce the same effect is to create the files +`FILE.top' (typically `config.h.top') and/or `FILE.bot' in the current +directory. If they exist, `autoheader' copies them to the beginning +and end, respectively, of its output. Their use is discouraged because +they have file names that contain two periods, and so can not be stored +on MS-DOS; also, they are two more files to clutter up the directory. +But if you use the `--localdir=DIR' option to use an `acconfig.h' in +another directory, they give you a way to put custom boilerplate in each +individual `config.h.in'. + + `autoheader' accepts the following options: + +`--help' +`-h' + Print a summary of the command line options and exit. + +`--localdir=DIR' +`-l DIR' + Look for the package files `aclocal.m4' and `acconfig.h' (but not + `FILE.top' and `FILE.bot') in directory DIR instead of in the + current directory. + +`--macrodir=DIR' +`-m DIR' + Look for the installed macro files and `acconfig.h' in directory + DIR. You can also set the `AC_MACRODIR' environment variable to a + directory; this option overrides the environment variable. + +`--version' + Print the version number of Autoconf and exit. + + +File: autoconf.info, Node: Subdirectories, Next: Default Prefix, Prev: Configuration Headers, Up: Setup + +Configuring Other Packages in Subdirectories +============================================ + + In most situations, calling `AC_OUTPUT' is sufficient to produce +`Makefile's in subdirectories. However, `configure' scripts that +control more than one independent package can use `AC_CONFIG_SUBDIRS' +to run `configure' scripts for other packages in subdirectories. + + - Macro: AC_CONFIG_SUBDIRS (DIR ...) + Make `AC_OUTPUT' run `configure' in each subdirectory DIR in the + given whitespace-separated list. If a given DIR is not found, no + error is reported, so a `configure' script can configure whichever + parts of a large source tree are present. If a given DIR contains + `configure.in' but no `configure', the Cygnus `configure' script + found by `AC_CONFIG_AUXDIR' is used. The subdirectory `configure' + scripts are given the same command line options that were given to + this `configure' script, with minor changes if needed (e.g., to + adjust a relative path for the cache file or source directory). + This macro also sets the output variable `subdirs' to the list of + directories `DIR ...'. `Makefile' rules can use this variable to + determine which subdirectories to recurse into. + + +File: autoconf.info, Node: Default Prefix, Next: Versions, Prev: Subdirectories, Up: Setup + +Default Prefix +============== + + By default, `configure' sets the prefix for files it installs to +`/usr/local'. The user of `configure' can select a different prefix +using the `--prefix' and `--exec-prefix' options. There are two ways +to change the default: when creating `configure', and when running it. + + Some software packages might want to install in a directory besides +`/usr/local' by default. To accomplish that, use the +`AC_PREFIX_DEFAULT' macro. + + - Macro: AC_PREFIX_DEFAULT (PREFIX) + Set the default installation prefix to PREFIX instead of + `/usr/local'. + + It may be convenient for users to have `configure' guess the +installation prefix from the location of a related program that they +have already installed. If you wish to do that, you can call +`AC_PREFIX_PROGRAM'. + + - Macro: AC_PREFIX_PROGRAM (PROGRAM) + If the user did not specify an installation prefix (using the + `--prefix' option), guess a value for it by looking for PROGRAM in + `PATH', the way the shell does. If PROGRAM is found, set the + prefix to the parent of the directory containing PROGRAM; + otherwise leave the prefix specified in `Makefile.in' unchanged. + For example, if PROGRAM is `gcc' and the `PATH' contains + `/usr/local/gnu/bin/gcc', set the prefix to `/usr/local/gnu'. + diff --git a/src/util/autoconf/autoconf.info-2 b/src/util/autoconf/autoconf.info-2 new file mode 100644 index 000000000..e695fc2db --- /dev/null +++ b/src/util/autoconf/autoconf.info-2 @@ -0,0 +1,1230 @@ +This is Info file autoconf.info, produced by Makeinfo-1.55 from the +input file ./autoconf.texi. + +START-INFO-DIR-ENTRY +* Autoconf: (autoconf). Create source code configuration scripts. +END-INFO-DIR-ENTRY + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. + + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: autoconf.info, Node: Versions, Prev: Default Prefix, Up: Setup + +Version Numbers in `configure' +============================== + + The following macros manage version numbers for `configure' scripts. +Using them is optional. + + - Macro: AC_PREREQ (VERSION) + Ensure that a recent enough version of Autoconf is being used. If + the version of Autoconf being used to create `configure' is earlier + than VERSION, print an error message on the standard error output + and do not create `configure'. For example: + + AC_PREREQ(1.8) + + This macro is useful if your `configure.in' relies on non-obvious + behavior that changed between Autoconf releases. If it merely + needs recently added macros, then `AC_PREREQ' is less useful, + because the `autoconf' program already tells the user which macros + are not found. The same thing happens if `configure.in' is + processed by a version of Autoconf older than when `AC_PREREQ' was + added. + + - Macro: AC_REVISION (REVISION-INFO) + Copy revision stamp REVISION-INFO into the `configure' script, + with any dollar signs or double-quotes removed. This macro lets + you put a revision stamp from `configure.in' into `configure' + without RCS or CVS changing it when you check in `configure'. That + way, you can determine easily which revision of `configure.in' a + particular `configure' corresponds to. + + It is a good idea to call this macro before `AC_INIT' so that the + revision number is near the top of both `configure.in' and + `configure'. To support doing that, the `AC_REVISION' output + begins with `#!/bin/sh', like the normal start of a `configure' + script does. + + For example, this line in `configure.in': + + AC_REVISION($Revision$)dnl + + produces this in `configure': + + #!/bin/sh + # From configure.in Revision: 1.30 + + +File: autoconf.info, Node: Existing Tests, Next: Writing Tests, Prev: Setup, Up: Top + +Existing Tests +************** + + These macros test for particular system features that packages might +need or want to use. If you need to test for a kind of feature that +none of these macros check for, you can probably do it by calling +primitive test macros with appropriate arguments (*note Writing +Tests::.). + + These tests print messages telling the user which feature they're +checking for, and what they find. They cache their results for future +`configure' runs (*note Caching Results::.). + + Some of these macros set output variables. *Note Makefile +Substitutions::, for how to get their values. The phrase "define NAME" +is used below as a shorthand to mean "define C preprocessor symbol NAME +to the value 1". *Note Defining Symbols::, for how to get those symbol +definitions into your program. + +* Menu: + +* 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:: `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. + + +File: autoconf.info, Node: Alternative Programs, Next: Libraries, Up: Existing Tests + +Alternative Programs +==================== + + These macros check for the presence or behavior of particular +programs. They are used to choose between several alternative programs +and to decide what to do once one has been chosen. If there is no +macro specifically defined to check for a program you need, and you +don't need to check for any special properties of it, then you can use +one of the general program check macros. + +* Menu: + +* Particular Programs:: Special handling to find certain programs. +* Generic Programs:: How to find other programs. + + +File: autoconf.info, Node: Particular Programs, Next: Generic Programs, Up: Alternative Programs + +Particular Program Checks +------------------------- + + These macros check for particular programs--whether they exist, and +in some cases whether they support certain features. + + - Macro: AC_DECL_YYTEXT + Define `YYTEXT_POINTER' if `yytext' is a `char *' instead of a + `char []'. Also set output variable `LEX_OUTPUT_ROOT' to the base + of the file name that the lexer generates; usually `lex.yy', but + sometimes something else. These results vary according to whether + `lex' or `flex' is being used. + + - Macro: AC_PROG_AWK + Check for `mawk', `gawk', `nawk', and `awk', in that order, and + set output variable `AWK' to the first one that it finds. It + tries `mawk' first because that is reported to be the fastest + implementation. + + - Macro: AC_PROG_CC + Determine a C compiler to use. If `CC' is not already set in the + environment, check for `gcc', and use `cc' if it's not found. Set + output variable `CC' to the name of the compiler found. + + If using the GNU C compiler, set shell variable `GCC' to `yes', + empty otherwise. If output variable `CFLAGS' was not already set, + set it to `-g -O' for the GNU C compiler (`-O' on systems where + GCC does not accept `-g'), or `-g' for other compilers. + + - Macro: AC_PROG_CC_C_O + If the C compiler does not accept the `-c' and `-o' options + simultaneously, define `NO_MINUS_C_MINUS_O'. + + - Macro: AC_PROG_CPP + Set output variable `CPP' to a command that runs the C + preprocessor. If `$CC -E' doesn't work, it uses `/lib/cpp'. It + is only portable to run `CPP' on files with a `.c' extension. + + If the current language is C (*note Language Choice::.), many of + the specific test macros use the value of `CPP' indirectly by + calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or + `AC_EGREP_CPP'. + + - Macro: AC_PROG_CXX + Determine a C++ compiler to use. Check if the environment variable + `CXX' or `CCC' (in that order) is set; if so, set output variable + `CXX' to its value. Otherwise search for a C++ compiler under + likely names (`c++', `g++', `gcc', `CC', and `cxx'). If none of + those checks succeed, as a last resort set `CXX' to `gcc'. + + If using the GNU C++ compiler, set shell variable `GXX' to `yes', + empty otherwise. If output variable `CXXFLAGS' was not already + set, set it to `-g -O' for the GNU C++ compiler (`-O' on systems + where G++ does not accept `-g'), or `-g' for other compilers. + + - Macro: AC_PROG_CXXCPP + Set output variable `CXXCPP' to a command that runs the C++ + preprocessor. If `$CXX -E' doesn't work, it uses `/lib/cpp'. It + is only portable to run `CXXCPP' on files with a `.c', `.C', or + `.cc' extension. + + If the current language is C++ (*note Language Choice::.), many of + the specific test macros use the value of `CXXCPP' indirectly by + calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or + `AC_EGREP_CPP'. + + - Macro: AC_PROG_GCC_TRADITIONAL + Add `-traditional' to output variable `CC' if using the GNU C + compiler and `ioctl' does not work properly without + `-traditional'. That usually happens when the fixed header files + have not been installed on an old system. Since recent versions + of the GNU C compiler fix the header files automatically when + installed, this is becoming a less prevalent problem. + + - Macro: AC_PROG_INSTALL + Set output variable `INSTALL' to the path of a BSD compatible + `install' program, if one is found in the current `PATH'. + Otherwise, set `INSTALL' to `DIR/install-sh -c', checking the + directories specified to `AC_CONFIG_AUX_DIR' (or its default + directories) to determine DIR (*note Output::.). Also set the + variable `INSTALL_PROGRAM' to `${INSTALL}' and `INSTALL_DATA' to + `${INSTALL} -m 644'. + + This macro screens out various instances of `install' known to not + work. It prefers to find a C program rather than a shell script, + for speed. Instead of `install-sh', it can also use `install.sh', + but that name is obsolete because some `make' programs have a rule + that creates `install' from it if there is no `Makefile'. + + If you need to use your own installation program because it has + features not found in standard `install' programs, there is no + reason to use `AC_PROG_INSTALL'; just put the pathname of your + program into your `Makefile.in' files. + + - Macro: AC_PROG_LEX + If `flex' is found, set output variable `LEX' to `flex' and + `LEXLIB' to `-lfl', if that library is in a standard place. + Otherwise set `LEX' to `lex' and `LEXLIB' to `-ll'. + + - Macro: AC_PROG_LN_S + If `ln -s' works on the current filesystem (the operating system + and filesystem support symbolic links), set output variable `LN_S' + to `ln -s', otherwise set it to `ln'. + + - Macro: AC_PROG_RANLIB + Set output variable `RANLIB' to `ranlib' if `ranlib' is found, + otherwise to `:' (do nothing). + + - Macro: AC_PROG_YACC + If `bison' is found, set output variable `YACC' to `bison -y'. + Otherwise, if `byacc' is found, set `YACC' to `byacc'. Otherwise + set `YACC' to `yacc'. + + +File: autoconf.info, Node: Generic Programs, Prev: Particular Programs, Up: Alternative Programs + +Generic Program Checks +---------------------- + + These macros are used to find programs not covered by the particular +test macros. If you need to check the behavior of a program as well as +find out whether it is present, you have to write your own test for it +(*note Writing Tests::.). + + - Macro: AC_CHECK_PROG (VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND [, + VALUE-IF-NOT-FOUND]) + Check whether program PROG-TO-CHECK-FOR exists in `PATH'. If it + is found, set VARIABLE to VALUE-IF-FOUND, otherwise to + VALUE-IF-NOT-FOUND, if given. If VARIABLE was already set, do + nothing. Calls `AC_SUBST' for VARIABLE. + + - Macro: AC_CHECK_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [, + VALUE-IF-NOT-FOUND]) + Check for each program in the whitespace-separated list + PROGS-TO-CHECK-FOR exists in `PATH'. If it is found, set VARIABLE + to the name of that program. Otherwise, continue checking the + next program in the list. If none of the programs in the list are + found, set VARIABLE to VALUE-IF-NOT-FOUND; if VALUE-IF-NOT-FOUND + is not specified, the value of VARIABLE is not changed. Calls + `AC_SUBST' for VARIABLE. + + - Macro: AC_PATH_PROG (VARIABLE, PROG-TO-CHECK-FOR [, + VALUE-IF-NOT-FOUND]) + Like `AC_CHECK_PROG', but set VARIABLE to the entire path of + PROG-TO-CHECK-FOR if found. + + - Macro: AC_PATH_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [, + VALUE-IF-NOT-FOUND]) + Like `AC_CHECK_PROGS', but if any of PROGS-TO-CHECK-FOR are found, + set VARIABLE to the entire path of the program found. + + +File: autoconf.info, Node: Libraries, Next: Library Functions, Prev: Alternative Programs, Up: Existing Tests + +Library Files +============= + + The following macros check for the presence of certain C library +archive files. + + - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + Try to ensure that C function FUNCTION is available by checking + whether a test C program can be linked with the library LIBRARY to + get the function. LIBRARY is the base name of the library; e.g., + to check for `-lmp', use `mp' as the LIBRARY argument. + + ACTION-IF-FOUND is a list of shell commands to run if the link + with the library succeeds; ACTION-IF-NOT-FOUND is a list of shell + commands to run if the link fails. If ACTION-IF-FOUND and + ACTION-IF-NOT-FOUND are not specified, the default action is to + add `-lLIBRARY' to `LIBS' and define `HAVE_LIBLIBRARY' (in all + capitals). + + If linking with LIBRARY results in unresolved symbols, which would + be resolved by linking with additional libraries, give those + libraries as the OTHER-LIBRARIES argument, separated by spaces: + `-lX11 -lXt'. Otherwise this macro will fail to detect that + LIBRARY is present, because linking the test program will always + fail with unresolved symbols. + + - Macro: AC_HAVE_LIBRARY (LIBRARY, [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + This macro is equivalent to calling `AC_CHECK_LIB' with a FUNCTION + argument of `main'. In addition, LIBRARY can be written as any of + `foo', `-lfoo', or `libfoo.a'. In all of those cases, the + compiler is passed `-lfoo'. However, LIBRARY can not be a shell + variable; it must be a literal name. This macro is considered + obsolete. + + +File: autoconf.info, Node: Library Functions, Next: Header Files, Prev: Libraries, Up: Existing Tests + +Library Functions +================= + + The following macros check for particular C library functions. If +there is no macro specifically defined to check for a function you need, +and you don't need to check for any special properties of it, then you +can use one of the general function check macros. + +* Menu: + +* Particular Functions:: Special handling to find certain functions. +* Generic Functions:: How to find other functions. + + +File: autoconf.info, Node: Particular Functions, Next: Generic Functions, Up: Library Functions + +Particular Function Checks +-------------------------- + + These macros check for particular C functions--whether they exist, +and in some cases how they respond when given certain arguments. + + - Macro: AC_FUNC_ALLOCA + Check how to get `alloca'. Tries to get a builtin version by + checking for `alloca.h' or the predefined C preprocessor macros + `__GNUC__' and `_AIX'. If this macro finds `alloca.h', it defines + `HAVE_ALLOCA_H'. + + If those attempts fail, it looks for the function in the standard C + library. If any of those methods succeed, it defines + `HAVE_ALLOCA'. Otherwise, it sets the output variable `ALLOCA' to + `alloca.o' and defines `C_ALLOCA' (so programs can periodically + call `alloca(0)' to garbage collect). This variable is separate + from `LIBOBJS' so multiple programs can share the value of + `ALLOCA' without needing to create an actual library, in case only + some of them use the code in `LIBOBJS'. + + This macro does not try to get `alloca' from the System V R3 + `libPW' or the System V R4 `libucb' because those libraries + contain some incompatible functions that cause trouble. Some + versions do not even contain `alloca' or contain a buggy version. + If you still want to use their `alloca', use `ar' to extract + `alloca.o' from them instead of compiling `alloca.c'. + + Source files that use `alloca' should start with a piece of code + like the following, to declare it properly. In some versions of + AIX, the declaration of `alloca' must precede everything else + except for comments and preprocessor directives. The `#pragma' + directive is indented so that pre-ANSI C compilers will ignore it, + rather than choke on it. + + /* AIX requires this to be the first thing in the file. */ + #ifdef __GNUC__ + # define alloca __builtin_alloca + #else + # if HAVE_ALLOCA_H + # include + # else + # ifdef _AIX + #pragma alloca + # else + # ifndef alloca /* predefined by HP cc +Olibcalls */ + char *alloca (); + # endif + # endif + # endif + #endif + + - Macro: AC_FUNC_CLOSEDIR_VOID + If the `closedir' function does not return a meaningful value, + define `CLOSEDIR_VOID'. Otherwise, callers ought to check its + return value for an error indicator. + + - Macro: AC_FUNC_GETLOADAVG + Check how to get the system load averages. If the system has the + `getloadavg' function, this macro defines `HAVE_GETLOADAVG', and + adds to `LIBS' any libraries needed to get that function. + + Otherwise, it adds `getloadavg.o' to the output variable + `LIBOBJS', and possibly defines several other C preprocessor + macros and output variables: + + 1. It defines `SVR4', `DGUX', `UMAX', or `UMAX4_3' if on those + systems. + + 2. If it finds `nlist.h', it defines `NLIST_STRUCT'. + + 3. If `struct nlist' has an `n_un' member, it defines + `NLIST_NAME_UNION'. + + 4. If compiling `getloadavg.c' defines `LDAV_PRIVILEGED', + programs need to be installed specially on this system for + `getloadavg' to work, and this macro defines + `GETLOADAVG_PRIVILEGED'. + + 5. This macro sets the output variable `NEED_SETGID'. The value + is `true' if special installation is required, `false' if not. + If `NEED_SETGID' is `true', this macro sets `KMEM_GROUP' to + the name of the group that should own the installed program. + + - Macro: AC_FUNC_GETMNTENT + Check for the `getmntent' in the `sun' and `seq' libraries, for + Irix 4 and PTX, respectively. Then, if `getmntent' is available, + define `HAVE_GETMNTENT'. + + - Macro: AC_FUNC_MEMCMP + If the `memcmp' function is not available, or does not work on + 8-bit data (like the one on SunOS 4.1.3), add `memcmp.o' to output + variable `LIBOBJS'. + + - Macro: AC_FUNC_MMAP + If the `mmap' function exists and works correctly on memory mapped + files, define `HAVE_MMAP'. + + - Macro: AC_FUNC_SETVBUF_REVERSED + If `setvbuf' takes the buffering type as its second argument and + the buffer pointer as the third, instead of the other way around, + define `SETVBUF_REVERSED'. This is the case on System V before + release 3. + + - Macro: AC_FUNC_STRCOLL + If the `strcoll' function exists and works correctly, define + `HAVE_STRCOLL'. This does a bit more than + `AC_CHECK_FUNCS(strcoll)', because some systems have incorrect + definitions of `strcoll', which should not be used. + + - Macro: AC_FUNC_STRFTIME + Check for `strftime' in the `intl' library, for SCO UNIX. Then, + if `strftime' is available, define `HAVE_STRFTIME'. + + - Macro: AC_FUNC_UTIME_NULL + If `utime(FILE, NULL)' sets FILE's timestamp to the present, + define `HAVE_UTIME_NULL'. + + - Macro: AC_FUNC_VFORK + If `vfork.h' is found, define `HAVE_VFORK_H'. If a working + `vfork' is not found, define `vfork' to be `fork'. This macro + checks for several known errors in implementations of `vfork' and + considers the system to not have a working `vfork' if it detects + any of them. + + - Macro: AC_FUNC_VPRINTF + If `vprintf' is found, define `HAVE_VPRINTF'. Otherwise, if + `_doprnt' is found, define `HAVE_DOPRNT'. (If `vprintf' is + available, you may assume that `vfprintf' and `vsprintf' are also + available.) + + - Macro: AC_FUNC_WAIT3 + If `wait3' is found and fills in the contents of its third argument + (a `struct rusage *'), which HP-UX does not do, define + `HAVE_WAIT3'. + + +File: autoconf.info, Node: Generic Functions, Prev: Particular Functions, Up: Library Functions + +Generic Function Checks +----------------------- + + These macros are used to find functions not covered by the particular +test macros. If the functions might be in libraries other than the +default C library, first call `AC_CHECK_LIB' for those libraries. If +you need to check the behavior of a function as well as find out +whether it is present, you have to write your own test for it (*note +Writing Tests::.). + + - Macro: AC_CHECK_FUNC (FUNCTION, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + If C function FUNCTION is available, run shell commands + ACTION-IF-FOUND, otherwise ACTION-IF-NOT-FOUND. If you just want + to define a symbol if the function is available, consider using + `AC_CHECK_FUNCS' instead. This macro checks for functions with C + linkage even when `AC_LANG_CPLUSPLUS' has been called, since C++ is + more standardized than C is. (*note Language Choice::., for more + information about selecting the language for checks.) + + - Macro: AC_CHECK_FUNCS (FUNCTION... [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + For each given FUNCTION in the whitespace-separated argument list + that is available, define `HAVE_FUNCTION' (in all capitals). If + ACTION-IF-FOUND is given, it is additional shell code to execute + when one of the functions is found. You can give it a value of + `break' to break out of the loop on the first match. If + ACTION-IF-NOT-FOUND is given, it is executed when one of the + functions is not found. + + - Macro: AC_REPLACE_FUNCS (FUNCTION-NAME...) + For each given FUNCTION-NAME in the whitespace-separated argument + list that is not in the C library, add `FUNCTION-NAME.o' to the + value of the output variable `LIBOBJS'. + + +File: autoconf.info, Node: Header Files, Next: Structures, Prev: Library Functions, Up: Existing Tests + +Header Files +============ + + The following macros check for the presence of certain C header +files. If there is no macro specifically defined to check for a header +file you need, and you don't need to check for any special properties of +it, then you can use one of the general header file check macros. + +* Menu: + +* Particular Headers:: Special handling to find certain headers. +* Generic Headers:: How to find other headers. + + +File: autoconf.info, Node: Particular Headers, Next: Generic Headers, Up: Header Files + +Particular Header Checks +------------------------ + + These macros check for particular system header files--whether they +exist, and in some cases whether they declare certain symbols. + + - Macro: AC_DECL_SYS_SIGLIST + Define `SYS_SIGLIST_DECLARED' if the variable `sys_siglist' is + declared in a system header file, either `signal.h' or `unistd.h'. + + - Macro: AC_DIR_HEADER + Like calling `AC_HEADER_DIRENT' and `AC_FUNC_CLOSEDIR_VOID', but + defines a different set of C preprocessor macros to indicate which + header file is found. This macro and the names it defines are + considered obsolete. The names it defines are: + + `dirent.h' + `DIRENT' + + `sys/ndir.h' + `SYSNDIR' + + `sys/dir.h' + `SYSDIR' + + `ndir.h' + `NDIR' + + In addition, if the `closedir' function does not return a + meaningful value, define `VOID_CLOSEDIR'. + + - Macro: AC_HEADER_DIRENT + Check for the following header files, and for the first one that is + found and defines `DIR', define the listed C preprocessor macro: + + `dirent.h' + `HAVE_DIRENT_H' + + `sys/ndir.h' + `HAVE_SYS_NDIR_H' + + `sys/dir.h' + `HAVE_SYS_DIR_H' + + `ndir.h' + `HAVE_NDIR_H' + + The directory library declarations in the source code should look + something like the following: + + #if HAVE_DIRENT_H + # include + # define NAMLEN(dirent) strlen((dirent)->d_name) + #else + # define dirent direct + # define NAMLEN(dirent) (dirent)->d_namlen + # if HAVE_SYS_NDIR_H + # include + # endif + # if HAVE_SYS_DIR_H + # include + # endif + # if HAVE_NDIR_H + # include + # endif + #endif + + Using the above declarations, the program would declare variables + to be type `struct dirent', not `struct direct', and would access + the length of a directory entry name by passing a pointer to a + `struct dirent' to the `NAMLEN' macro. + + This macro also checks for the SCO Xenix `dir' and `x' libraries. + + - Macro: AC_HEADER_MAJOR + If `sys/types.h' does not define `major', `minor', and `makedev', + but `sys/mkdev.h' does, define `MAJOR_IN_MKDEV'; otherwise, if + `sys/sysmacros.h' does, define `MAJOR_IN_SYSMACROS'. + + - Macro: AC_HEADER_STDC + Define `STDC_HEADERS' if the system has ANSI C header files. + Specifically, this macro checks for `stdlib.h', `stdarg.h', + `string.h', and `float.h'; if the system has those, it probably + has the rest of the ANSI C header files. This macro also checks + whether `string.h' declares `memchr' (and thus presumably the + other `mem' functions), whether `stdlib.h' declare `free' (and + thus presumably `malloc' and other related functions), and whether + the `ctype.h' macros work on characters with the high bit set, as + ANSI C requires. + + Use `STDC_HEADERS' instead of `__STDC__' to determine whether the + system has ANSI-compliant header files (and probably C library + functions) because many systems that have GCC do not have ANSI C + header files. + + On systems without ANSI C headers, there is so much variation that + it is probably easier to declare the functions you use than to + figure out exactly what the system header files declare. Some + systems contain a mix of functions ANSI and BSD; some are mostly + ANSI but lack `memmove'; some define the BSD functions as macros in + `string.h' or `strings.h'; some have only the BSD functions but + `string.h'; some declare the memory functions in `memory.h', some + in `string.h'; etc. It is probably sufficient to check for one + string function and one memory function; if the library has the + ANSI versions of those then it probably has most of the others. + If you put the following in `configure.in': + + AC_HEADER_STDC + AC_CHECK_FUNCS(strchr memcpy) + + then, in your code, you can put declarations like this: + + #if STDC_HEADERS + # include + #else + # ifndef HAVE_STRCHR + # define strchr index + # define strrchr rindex + # endif + char *strchr (), *strrchr (); + # ifndef HAVE_MEMCPY + # define memcpy(d, s, n) bcopy ((s), (d), (n)) + # define memmove(d, s, n) bcopy ((s), (d), (n)) + # endif + #endif + + If you use a function like `memchr', `memset', `strtok', or + `strspn', which have no BSD equivalent, then macros won't suffice; + you must provide an implementation of each function. An easy way + to incorporate your implementations only when needed (since the + ones in system C libraries may be hand optimized) is to, taking + `memchr' for example, put it in `memchr.c' and use + `AC_REPLACE_FUNCS(memchr)'. + + - Macro: AC_HEADER_SYS_WAIT + If `sys/wait.h' exists and is compatible with POSIX.1, define + `HAVE_SYS_WAIT_H'. Incompatibility can occur if `sys/wait.h' does + not exist, or if it uses the old BSD `union wait' instead of `int' + to store a status value. If `sys/wait.h' is not POSIX.1 + compatible, then instead of including it, define the POSIX.1 + macros with their usual interpretations. Here is an example: + + #include + #if HAVE_SYS_WAIT_H + # include + #endif + #ifndef WEXITSTATUS + # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) + #endif + #ifndef WIFEXITED + # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) + #endif + + - Macro: AC_MEMORY_H + Define `NEED_MEMORY_H' if `memcpy', `memcmp', etc. are not + declared in `string.h' and `memory.h' exists. This macro is + obsolete; instead, use `AC_CHECK_HEADERS(memory.h)'. See the + example for `AC_HEADER_STDC'. + + - Macro: AC_UNISTD_H + Define `HAVE_UNISTD_H' if the system has `unistd.h'. This macro + is obsolete; instead, use `AC_CHECK_HEADERS(unistd.h)'. + + The way to check if the system supports POSIX.1 is: + + #if HAVE_UNISTD_H + # include + # include + #endif + + #ifdef _POSIX_VERSION + /* Code for POSIX.1 systems. */ + #endif + + `_POSIX_VERSION' is defined when `unistd.h' is included on POSIX.1 + systems. If there is no `unistd.h', it is definitely not a + POSIX.1 system. However, some non-POSIX.1 systems do have + `unistd.h'. + + - Macro: AC_USG + Define `USG' if the system does not have `strings.h', `rindex', + `bzero', etc. This implies that it has `string.h', `strrchr', + `memset', etc. + + The symbol `USG' is obsolete. Instead of this macro, see the + example for `AC_HEADER_STDC'. + + +File: autoconf.info, Node: Generic Headers, Prev: Particular Headers, Up: Header Files + +Generic Header Checks +--------------------- + + These macros are used to find system header files not covered by the +particular test macros. If you need to check the contents of a header +as well as find out whether it is present, you have to write your own +test for it (*note Writing Tests::.). + + - Macro: AC_CHECK_HEADER (HEADER-FILE, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + If the system header file HEADER-FILE exists, execute shell + commands ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND. + If you just want to define a symbol if the header file is + available, consider using `AC_CHECK_HEADERS' instead. + + - Macro: AC_CHECK_HEADERS (HEADER-FILE... [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + For each given system header file HEADER-FILE in the + whitespace-separated argument list that exists, define + `HAVE_HEADER-FILE' (in all capitals). If ACTION-IF-FOUND is + given, it is additional shell code to execute when one of the + header files is found. You can give it a value of `break' to + break out of the loop on the first match. If ACTION-IF-NOT-FOUND + is given, it is executed when one of the header files is not found. + + +File: autoconf.info, Node: Structures, Next: Typedefs, Prev: Header Files, Up: Existing Tests + +Structures +========== + + The following macros check for certain structures or structure +members. To check structures not listed here, use `AC_EGREP_CPP' +(*note Examining Declarations::.) or `AC_TRY_COMPILE' (*note Examining +Syntax::.). + + - Macro: AC_HEADER_STAT + If the macros `S_ISDIR', `S_ISREG' et al. defined in `sys/stat.h' + do not work properly (returning false positives), define + `STAT_MACROS_BROKEN'. This is the case on Tektronix UTekV, Amdahl + UTS and Motorola System V/88. + + - Macro: AC_HEADER_TIME + If a program may include both `time.h' and `sys/time.h', define + `TIME_WITH_SYS_TIME'. On some older systems, `sys/time.h' + includes `time.h', but `time.h' is not protected against multiple + inclusion, so programs should not explicitly include both files. + This macro is useful in programs that use, for example, `struct + timeval' or `struct timezone' as well as `struct tm'. It is best + used in conjunction with `HAVE_SYS_TIME_H', which can be checked + for using `AC_CHECK_HEADERS(sys/time.h)'. + + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + - Macro: AC_STRUCT_ST_BLKSIZE + If `struct stat' contains an `st_blksize' member, define + `HAVE_ST_BLKSIZE'. + + - Macro: AC_STRUCT_ST_BLOCKS + If `struct stat' contains an `st_blocks' member, define + `HAVE_ST_BLOCKS'. Otherwise, add `fileblocks.o' to the output + variable `LIBOBJS'. + + - Macro: AC_STRUCT_ST_RDEV + If `struct stat' contains an `st_rdev' member, define + `HAVE_ST_RDEV'. + + - Macro: AC_STRUCT_TM + If `time.h' does not define `struct tm', define `TM_IN_SYS_TIME', + which means that including `sys/time.h' had better define `struct + tm'. + + - Macro: AC_STRUCT_TIMEZONE + Figure out how to get the current timezone. If `struct tm' has a + `tm_zone' member, define `HAVE_TM_ZONE'. Otherwise, if the + external array `tzname' is found, define `HAVE_TZNAME'. + + +File: autoconf.info, Node: Typedefs, Next: Compiler Characteristics, Prev: Structures, Up: Existing Tests + +Typedefs +======== + + The following macros check for C typedefs. If there is no macro +specifically defined to check for a typedef you need, and you don't need +to check for any special properties of it, then you can use a general +typedef check macro. + +* Menu: + +* Particular Typedefs:: Special handling to find certain types. +* Generic Typedefs:: How to find other types. + + +File: autoconf.info, Node: Particular Typedefs, Next: Generic Typedefs, Up: Typedefs + +Particular Typedef Checks +------------------------- + + These macros check for particular C typedefs. + + - Macro: AC_TYPE_GETGROUPS + Define `GETGROUPS_T' to be whichever of `gid_t' or `int' is the + base type of the array argument to `getgroups'. + + - Macro: AC_TYPE_MODE_T + If `mode_t' is not defined in `sys/types.h', define `mode_t' to be + `int'. + + - Macro: AC_TYPE_OFF_T + If `off_t' is not defined in `sys/types.h', define `off_t' to be + `long'. + + - Macro: AC_TYPE_PID_T + If `pid_t' is not defined in `sys/types.h', define `pid_t' to be + `int'. + + - Macro: AC_TYPE_SIGNAL + If `signal.h' declares `signal' as returning a pointer to a + function returning `void', define `RETSIGTYPE' to be `void'; + otherwise, define it to be `int'. + + Define signal handlers as returning type `RETSIGTYPE': + + RETSIGTYPE + hup_handler () + { + ... + } + + - Macro: AC_TYPE_SIZE_T + If `size_t' is not defined in `sys/types.h', define `size_t' to be + `unsigned'. + + - Macro: AC_TYPE_UID_T + If `uid_t' is not defined in `sys/types.h', define `uid_t' to be + `int' and `gid_t' to be `int'. + + +File: autoconf.info, Node: Generic Typedefs, Prev: Particular Typedefs, Up: Typedefs + +Generic Typedef Checks +---------------------- + + This macro is used to check for typedefs not covered by the +particular test macros. + + - Macro: AC_CHECK_TYPE (TYPE, DEFAULT) + If the type TYPE is not defined in `sys/types.h' or `stdlib.h' (if + that is present), define it to be the C (or C++) builtin type + DEFAULT; e.g., `short' or `unsigned'. + + +File: autoconf.info, Node: Compiler Characteristics, Next: System Services, Prev: Typedefs, Up: Existing Tests + +Compiler Characteristics +======================== + + The following macros check for C compiler or machine architecture +features. To check for characteristics not listed here, use +`AC_TRY_COMPILE' (*note Examining Syntax::.) or `AC_TRY_RUN' (*note Run +Time::.) + + - Macro: AC_C_BIGENDIAN + If words are stored with the most significant byte first (like + Motorola and SPARC, but not Intel and VAX, CPUs), define + `WORDS_BIGENDIAN'. + + - Macro: AC_C_CONST + If the C compiler does not fully support the keyword `const', + define `const' to be empty. Some C compilers that do not define + `__STDC__' do support `const'; some compilers that define + `__STDC__' do not completely support `const'. Programs can simply + use `const' as if every C compiler supported it; for those that + don't, the `Makefile' or configuration header file will define it + as empty. + + - Macro: AC_C_INLINE + If the C compiler is a version of GCC that supports the keyword + `__inline' but not `inline' (such as some NeXT versions), define + `inline' to be `__inline'. + + - Macro: AC_C_CHAR_UNSIGNED + If the C type `char' is unsigned, define `__CHAR_UNSIGNED__', + unless the C compiler predefines it. + + - Macro: AC_C_LONG_DOUBLE + If the C compiler supports the `long double' type, define + `HAVE_LONG_DOUBLE'. Some C compilers that do not define + `__STDC__' do support the `long double' type; some compilers that + define `__STDC__' do not support `long double'. + + - Macro: AC_CHECK_SIZEOF (TYPE) + Define `SIZEOF_UCTYPE' to be the size in bytes of the C (or C++) + builtin type TYPE, e.g. `int' or `char *'. If `type' is unknown + to the compiler, it gets a size of 0. UCTYPE is TYPE, with + lowercase converted to uppercase, spaces changed to underscores, + and asterisks changed to `P'. For example, the call + AC_CHECK_SIZEOF(int *) + + defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems. + + - Macro: AC_INT_16_BITS + If the C type `int' is 16 bits wide, define `INT_16_BITS'. This + macro is obsolete; it is more general to use + `AC_CHECK_SIZEOF(int)' instead. + + - Macro: AC_LONG_64_BITS + If the C type `long int' is 64 bits wide, define `LONG_64_BITS'. + This macro is obsolete; it is more general to use + `AC_CHECK_SIZEOF(long)' instead. + + +File: autoconf.info, Node: System Services, Next: UNIX Variants, Prev: Compiler Characteristics, Up: Existing Tests + +System Services +=============== + + The following macros check for operating system services or +capabilities. + + - Macro: AC_SYS_INTERPRETER + Check whether the system supports starting scripts with a line of + the form `#!/bin/csh' to select the interpreter to use for the + script. After running this macro, shell code in `configure.in' + can check the variable `ac_cv_sys_interpreter'; it will be set to + `yes' if the system supports `#!', `no' if not. + + - Macro: AC_PATH_X + Try to locate the X Window System include files and libraries. If + the user gave the command line options `--x-includes=DIR' and + `--x-libraries=DIR', use those directories. If either or both + were not given, get the missing values by running `xmkmf' on a + trivial `Imakefile' and examining the `Makefile' that it produces. + If that fails (such as if `xmkmf' is not present), look for them + in several directories where they often reside. If either method + is successful, set the shell variables `x_includes' and + `x_libraries' to their locations, unless they are in directories + the compiler searches by default. + + If both methods fail, or the user gave the command line option + `--without-x', set the shell variable `no_x' to `yes'; otherwise + set it to the empty string. + + - Macro: AC_PATH_XTRA + An enhanced version of `AC_PATH_X'. Add the C compiler flags that + X needs to output variable `X_CFLAGS', and the X linker flags to + `X_LIBS'. If X is not available, add `-DX_DISPLAY_MISSING' to + `X_CFLAGS'. + + Also check for special libraries that some systems need in order to + compile X programs. Add any that the system needs to output + variable `X_EXTRA_LIBS'. And check for special X11R6 libraries + that need to be linked with before `-lX11', and add any found to + the output variable `X_PRE_LIBS'. + + - Macro: AC_SYS_LONG_FILE_NAMES + If the system supports file names longer than 14 characters, define + `HAVE_LONG_FILE_NAMES'. + + - Macro: AC_SYS_RESTARTABLE_SYSCALLS + If the system automatically restarts a system call that is + interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'. + + +File: autoconf.info, Node: UNIX Variants, Prev: System Services, Up: Existing Tests + +UNIX Variants +============= + + The following macros check for certain operating systems that need +special treatment for some programs, due to exceptional oddities in +their header files or libraries. These macros are warts; they will be +replaced by a more systematic approach, based on the functions they make +available or the environments they provide. + + - Macro: AC_AIX + If on AIX, define `_ALL_SOURCE'. Allows the use of some BSD + functions. Should be called before any macros that run the C + compiler. + + - Macro: AC_DYNIX_SEQ + If on Dynix/PTX (Sequent UNIX), add `-lseq' to output variable + `LIBS'. This macro is obsolete; instead, use `AC_FUNC_GETMNTENT'. + + - Macro: AC_IRIX_SUN + If on IRIX (Silicon Graphics UNIX), add `-lsun' to output variable + `LIBS'. This macro is obsolete. If you were using it to get + `getmntent', use `AC_FUNC_GETMNTENT' instead. If you used it for + the NIS versions of the password and group functions, use + `AC_CHECK_LIB(sun, getpwnam)'. + + - Macro: AC_ISC_POSIX + If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add + `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers) + to output variable `CC'. This allows the use of POSIX facilities. + Must be called after `AC_PROG_CC' and before any other macros + that run the C compiler. + + - Macro: AC_MINIX + If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define + `_POSIX_1_SOURCE' to be 2. This allows the use of POSIX + facilities. Should be called before any macros that run the C + compiler. + + - Macro: AC_SCO_INTL + If on SCO UNIX, add `-lintl' to output variable `LIBS'. This + macro is obsolete; instead, use `AC_FUNC_STRFTIME'. + + - Macro: AC_XENIX_DIR + If on Xenix, add `-lx' to output variable `LIBS'. Also, if + `dirent.h' is being used, add `-ldir' to `LIBS'. This macro is + obsolete; use `AC_HEADER_DIRENT' instead. + + +File: autoconf.info, Node: Writing Tests, Next: Results, Prev: Existing Tests, Up: Top + +Writing Tests +************* + + If the existing feature tests don't do something you need, you have +to write new ones. These macros are the building blocks. They provide +ways for other macros to check whether various kinds of features are +available and report the results. + + This chapter contains some suggestions and some of the reasons why +the existing tests are written the way they are. You can also learn a +lot about how to write Autoconf tests by looking at the existing ones. +If something goes wrong in one or more of the Autoconf tests, this +information can help you understand the assumptions behind them, which +might help you figure out how to best solve the problem. + + These macros check the output of the C compiler system. They do not +cache the results of their tests for future use (*note Caching +Results::.), because they don't know enough about the information they +are checking for to generate a cache variable name. They also do not +print any messages, for the same reason. The checks for particular +kinds of C features call these macros and do cache their results and +print messages about what they're checking for. + +* Menu: + +* 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. +* Portable Shell:: Shell script portability pitfalls. +* Testing Values and Files:: Checking strings and files. +* Multiple Cases:: Tests for several possible values. +* Language Choice:: Selecting which language to use for testing. + + +File: autoconf.info, Node: Examining Declarations, Next: Examining Syntax, Up: Writing Tests + +Examining Declarations +====================== + + The macro `AC_TRY_CPP' is used to check whether particular header +files exist. You can check for one at a time, or more than one if you +need several header files to all exist for some purpose. + + - Macro: AC_TRY_CPP (INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE]) + INCLUDES is C or C++ `#include' statements and declarations, on + which shell variable, backquote, and backslash substitutions are + performed. (Actually, it can be any C program, but other + statements are probably not useful.) If the preprocessor produces + no error messages while processing it, run shell commands + ACTION-IF-TRUE. Otherwise run shell commands ACTION-IF-FALSE. + + This macro uses `CPPFLAGS', but not `CFLAGS', because `-g', `-O', + etc. are not valid options to many C preprocessors. + + Here is now to find out whether a header file contains a particular +declaration, such as a typedef, a structure, a structure member, or a +function. Use `AC_EGREP_HEADER' instead of running `grep' directly on +the header file; on some systems the symbol might be defined in another +header file that the file you are checking `#include's. + + - Macro: AC_EGREP_HEADER (PATTERN, HEADER-FILE, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + If the output of running the preprocessor on the system header file + HEADER-FILE matches the `egrep' regular expression PATTERN, + execute shell commands ACTION-IF-FOUND, otherwise execute + ACTION-IF-NOT-FOUND. + + To check for C preprocessor symbols, either defined by header files +or predefined by the C preprocessor, use `AC_EGREP_CPP'. Here is an +example of the latter: + + AC_EGREP_CPP(yes, + [#ifdef _AIX + yes + #endif + ], is_aix=yes, is_aix=no) + + - Macro: AC_EGREP_CPP (PATTERN, PROGRAM, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + PROGRAM is the text of a C or C++ program, on which shell + variable, backquote, and backslash substitutions are performed. + If the output of running the preprocessor on PROGRAM matches the + `egrep' regular expression PATTERN, execute shell commands + ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND. + + This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on + which language is current, *note Language Choice::.), if it hasn't + been called already. + + +File: autoconf.info, Node: Examining Syntax, Next: Examining Libraries, Prev: Examining Declarations, Up: Writing Tests + +Examining Syntax +================ + + To check for a syntax feature of the C or C++ compiler, such as +whether it recognizes a certain keyword, use `AC_TRY_COMPILE' to try to +compile a small program that uses that feature. You can also use it to +check for structures and structure members that are not present on all +systems. + + - Macro: AC_TRY_COMPILE (INCLUDES, FUNCTION-BODY, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + Create a test C program to see whether a function whose body + consists of FUNCTION-BODY can be compiled; INCLUDES is any + `#include' statements needed by the code in FUNCTION-BODY. If the + file compiles successfully, run shell commands ACTION-IF-FOUND, + otherwise run ACTION-IF-NOT-FOUND. This macro uses `CFLAGS' or + `CXXFLAGS', and `CPPFLAGS', when compiling. It does not try to + link; use `AC_TRY_LINK' if you need to do that (*note Examining + Libraries::.). + + +File: autoconf.info, Node: Examining Libraries, Next: Run Time, Prev: Examining Syntax, Up: Writing Tests + +Examining Libraries +=================== + + To check for a library, a function, or a global variable, Autoconf +`configure' scripts try to compile and link a small program that uses +it. This is unlike Metaconfig, which by default uses `nm' or `ar' on +the C library to try to figure out which functions are available. +Trying to link with the function is usually a more reliable approach +because it avoids dealing with the variations in the options and output +formats of `nm' and `ar' and in the location of the standard libraries. +It also allows configuring for cross-compilation or checking a +function's runtime behavior if needed. On the other hand, it can be +slower than scanning the libraries once. + + A few systems have linkers that do not return a failure exit status +when there are unresolved functions in the link. This bug makes the +configuration scripts produced by Autoconf unusable on those systems. +However, some of them can be given options that make the exit status +correct. This is a problem that Autoconf does not currently handle +automatically. + + `AC_TRY_LINK' is used to compile test programs to test for functions +and global variables. It is also used (by `AC_CHECK_LIB') to check for +libraries, by adding the library being checked for to `LIBS' +temporarily and trying to link a small program. + + - Macro: AC_TRY_LINK (INCLUDES, FUNCTION-BODY, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]) + Create a test C program to see whether a function whose body + consists of FUNCTION-BODY can be compiled and linked; INCLUDES is + any `#include' statements needed by the code in FUNCTION-BODY. If + the file compiles and links successfully, run shell commands + ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. This macro + uses `CFLAGS' or `CXXFLAGS', `CPPFLAGS', `LDFLAGS', and `LIBS' + when compiling. + + - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY, + ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) + This is an obsolete version of `AC_TRY_LINK', with the addition + that it prints `checking for ECHO-TEXT' to the standard output + first, if ECHO-TEXT is non-empty. + + +File: autoconf.info, Node: Run Time, Next: Portable Shell, Prev: Examining Libraries, Up: Writing Tests + +Checking Run Time Behavior +========================== + + Sometimes you need to find out how a system performs at run time, +such as whether a given function has a certain capability or bug. If +you can, make such checks when your program runs instead of when it is +configured. You can check for things like the machine's endianness when +your program initializes itself. + + If you really need to test for a run-time behavior while configuring, +you can write a test program to determine the result, and compile and +run it using `AC_TRY_RUN'. Avoid running test programs if possible, +because using them prevents people from configuring your package for +cross-compiling. + +* Menu: + +* Test Programs:: Running test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. + diff --git a/src/util/autoconf/autoconf.info-3 b/src/util/autoconf/autoconf.info-3 new file mode 100644 index 000000000..5cc6b5748 --- /dev/null +++ b/src/util/autoconf/autoconf.info-3 @@ -0,0 +1,1174 @@ +This is Info file autoconf.info, produced by Makeinfo-1.55 from the +input file ./autoconf.texi. + +START-INFO-DIR-ENTRY +* Autoconf: (autoconf). Create source code configuration scripts. +END-INFO-DIR-ENTRY + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. + + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: autoconf.info, Node: Test Programs, Next: Guidelines, Up: Run Time + +Running Test Programs +--------------------- + + Use the following macro if you need to test run-time behavior of the +system while configuring. + + - Macro: AC_TRY_RUN (PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE [, + ACTION-IF-CROSS-COMPILING]]) + PROGRAM is the text of a C program, on which shell variable and + backquote substitutions are performed. If it compiles and links + successfully and returns an exit status of 0 when executed, run + shell commands ACTION-IF-TRUE. Otherwise run shell commands + ACTION-IF-FALSE; the exit status of the program is available in + the shell variable `$?'. This macro uses `CFLAGS' or `CXXFLAGS', + `CPPFLAGS', `LDFLAGS', and `LIBS' when compiling. + + If the C compiler being used does not produce executables that run + on the system where `configure' is being run, then the test + program is not run. If the optional shell commands + ACTION-IF-CROSS-COMPILING are given, they are run instead and this + macro calls `AC_C_CROSS' if it has not already been called. + Otherwise, `configure' prints an error message and exits. + + Try to provide a pessimistic default value to use when +cross-compiling makes run-time tests impossible. You do this by +passing the optional last argument to `AC_TRY_RUN'. `autoconf' prints +a warning message when creating `configure' each time it encounters a +call to `AC_TRY_RUN' with no ACTION-IF-CROSS-COMPILING argument given. +You may ignore the warning, though users will not be able to configure +your package for cross-compiling. A few of the macros distributed with +Autoconf produce this warning message. + + To configure for cross-compiling you can also choose a value for +those parameters based on the canonical system name (*note Manual +Configuration::.). Alternatively, set up a test results cache file with +the correct values for the target system (*note Caching Results::.). + + To provide a default for calls of `AC_TRY_RUN' that are embedded in +other macros, including a few of the ones that come with Autoconf, you +can call `AC_C_CROSS' before running them. Then, if the shell variable +`cross_compiling' is set to `yes', use an alternate method to get the +results instead of calling the macros. + + - Macro: AC_C_CROSS + If the C compiler being used does not produce executables that can + run on the system where `configure' is being run, set the shell + variable `cross_compiling' to `yes', otherwise `no'. + + +File: autoconf.info, Node: Guidelines, Next: Test Functions, Prev: Test Programs, Up: Run Time + +Guidelines for Test Programs +---------------------------- + + Test programs should not write anything to the standard output. They +should return 0 if the test succeeds, nonzero otherwise, so that success +can be distinguished easily from a core dump or other failure; +segmentation violations and other failures produce a nonzero exit +status. Test programs should `exit', not `return', from `main', +because on some systems (old Suns, at least) the argument to `return' +in `main' is ignored. + + Test programs can use `#if' or `#ifdef' to check the values of +preprocessor macros defined by tests that have already run. For +example, if you call `AC_HEADER_STDC', then later on in `configure.in' +you can have a test program that includes an ANSI C header file +conditionally: + + #if STDC_HEADERS + # include + #endif + + If a test program needs to use or create a data file, give it a name +that starts with `conftest', such as `conftestdata'. The `configure' +script cleans up by running `rm -rf conftest*' after running test +programs and if the script is interrupted. + + +File: autoconf.info, Node: Test Functions, Prev: Guidelines, Up: Run Time + +Test Functions +-------------- + + Function declarations in test programs should have a prototype +conditionalized for C++. In practice, though, test programs rarely need +functions that take arguments. + + #ifdef __cplusplus + foo(int i) + #else + foo(i) int i; + #endif + + Functions that test programs declare should also be conditionalized +for C++, which requires `extern "C"' prototypes. Make sure to not +include any header files containing clashing prototypes. + + #ifdef __cplusplus + extern "C" void *malloc(size_t); + #else + char *malloc(); + #endif + + If a test program calls a function with invalid parameters (just to +see whether it exists), organize the program to ensure that it never +invokes that function. You can do this by calling it in another +function that is never invoked. You can't do it by putting it after a +call to `exit', because GCC version 2 knows that `exit' never returns +and optimizes out any code that follows it in the same block. + + If you include any header files, make sure to call the functions +relevant to them with the correct number of arguments, even if they are +just 0, to avoid compilation errors due to prototypes. GCC version 2 +has internal prototypes for several functions that it automatically +inlines; for example, `memcpy'. To avoid errors when checking for +them, either pass them the correct number of arguments or redeclare them +with a different return type (such as `char'). + + +File: autoconf.info, Node: Portable Shell, Next: Testing Values and Files, Prev: Run Time, Up: Writing Tests + +Portable Shell Programming +========================== + + When writing your own checks, there are some shell script programming +techniques you should avoid in order to make your code portable. The +Bourne shell and upward-compatible shells like Bash and the Korn shell +have evolved over the years, but to prevent trouble, do not take +advantage of features that were added after UNIX version 7, circa 1977. +You should not use shell functions, aliases, negated character classes, +or other features that are not found in all Bourne-compatible shells; +restrict yourself to the lowest common denominator. Even `unset' is +not supported by all shells! + + The set of external programs you should run in a `configure' script +is fairly small. *Note Utilities in Makefiles: +(standards.info)Utilities in Makefiles, for the list. This restriction +allows users to start out with a fairly small set of programs and build +the rest, avoiding too many interdependencies between packages. + + Some of these external utilities have a portable subset of features, +as well; for example, don't rely on `ln' having a `-f' option or `cat' +having any options. `sed' scripts should not contain comments or use +branch labels longer than 8 characters. Don't use `grep -s' to +suppress output, because `grep -s' on System V does not suppress +output, only error messages. Instead, redirect the standard output and +standard error (in case the file doesn't exist) of `grep' to +`/dev/null'. Check the exit status of `grep' to determine whether it +found a match. + + +File: autoconf.info, Node: Testing Values and Files, Next: Multiple Cases, Prev: Portable Shell, Up: Writing Tests + +Testing Values and Files +======================== + + `configure' scripts need to test properties of many files and +strings. Here are some portability problems to watch out for when doing +those tests. + + The `test' program is the way to perform many file and string tests. +It is often invoked by the alternate name `[', but using that name in +Autoconf code is asking for trouble since it is an `m4' quote character. + + If you need to make multiple checks using `test', combine them with +the shell operators `&&' and `||' instead of using the `test' operators +`-a' and `-o'. On System V, the precedence of `-a' and `-o' is wrong +relative to the unary operators; consequently, POSIX does not specify +them, so using them is nonportable. If you combine `&&' and `||' in +the same statement, keep in mind that they have equal precedence. + + To enable `configure' scripts to support cross-compilation, they +shouldn't do anything that tests features of the host system instead of +the target system. But occasionally you may find it necessary to check +whether some arbitrary file exists. To do so, use `test -f' or `test +-r'. Do not use `test -x', because 4.3BSD does not have it. + + Another nonportable shell programming construction is + VAR=${VAR:-VALUE} + +The intent is to set VAR to VALUE only if it is not already set, but if +VAR has any value, even the empty string, to leave it alone. Old BSD +shells, including the Ultrix `sh', don't accept the colon, and complain +and die. A portable equivalent is + : ${VAR=VALUE} + + +File: autoconf.info, Node: Multiple Cases, Next: Language Choice, Prev: Testing Values and Files, Up: Writing Tests + +Multiple Cases +============== + + Some operations are accomplished in several possible ways, depending +on the UNIX variant. Checking for them essentially requires a "case +statement". Autoconf does not directly provide one; however, it is +easy to simulate by using a shell variable to keep track of whether a +way to perform the operation has been found yet. + + Here is an example that uses the shell variable `fstype' to keep +track of whether the remaining cases need to be checked. + + AC_MSG_CHECKING(how to get filesystem type) + fstype=no + # The order of these tests is important. + AC_TRY_CPP([#include + #include ], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4) + if test $fstype = no; then + AC_TRY_CPP([#include + #include ], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3) + fi + if test $fstype = no; then + AC_TRY_CPP([#include + #include ], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX) + fi + # (more cases omitted here) + AC_MSG_RESULT($fstype) + + +File: autoconf.info, Node: Language Choice, Prev: Multiple Cases, Up: Writing Tests + +Language Choice +=============== + + Packages that use both C and C++ need to test features of both +compilers. Autoconf-generated `configure' scripts check for C features +by default. The following macros determine which language's compiler +is used in tests that follow in `configure.in'. + + - Macro: AC_LANG_C + Do compilation tests using `CC' and `CPP' and use extension `.c' + for test programs. + + - Macro: AC_LANG_CPLUSPLUS + Do compilation tests using `CXX' and `CXXCPP' and use extension + `.C' for test programs. + + - Macro: AC_LANG_SAVE + Remember the current language (as set by `AC_LANG_C' or + `AC_LANG_CPLUSPLUS') on a stack. Does not change which language is + current. Use this macro and `AC_LANG_RESTORE' in macros that need + to temporarily switch to a particular language. + + - Macro: AC_LANG_RESTORE + Select the language that is saved on the top of the stack, as set + by `AC_LANG_SAVE', and remove it from the stack. This macro is + equivalent to either `AC_LANG_C' or `AC_LANG_CPLUSPLUS', whichever + had been run most recently when `AC_LANG_SAVE' was last called. + + Do not call this macro more times than `AC_LANG_SAVE'. + + - Macro: AC_REQUIRE_CPP + Ensure that whichever preprocessor would currently be used for + tests has been found. Calls `AC_REQUIRE' (*note Prerequisite + Macros::.) with an argument of either `AC_PROG_CPP' or + `AC_PROG_CXXCPP', depending on which language is current. + + +File: autoconf.info, Node: Results, Next: Writing Macros, Prev: Writing Tests, Up: Top + +Results of Tests +**************** + + Once `configure' has determined whether a feature exists, what can +it do to record that information? There are four sorts of things it can +do: define a C preprocessor symbol, set a variable in the output files, +save the result in a cache file for future `configure' runs, and 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. +* Caching Results:: Speeding up subsequent `configure' runs. +* Printing Messages:: Notifying users of progress or problems. + + +File: autoconf.info, Node: Defining Symbols, Next: Setting Output Variables, Up: Results + +Defining C Preprocessor Symbols +=============================== + + A common action to take in response to a feature test is to define a +C preprocessor symbol indicating the results of the test. That is done +by calling `AC_DEFINE' or `AC_DEFINE_UNQUOTED'. + + By default, `AC_OUTPUT' places the symbols defined by these macros +into the output variable `DEFS', which contains an option +`-DSYMBOL=VALUE' for each symbol defined. Unlike in Autoconf version +1, there is no variable `DEFS' defined while `configure' is running. +To check whether Autoconf macros have already defined a certain C +preprocessor symbol, test the value of the appropriate cache variable, +as in this example: + + AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) + if test "$ac_cv_func_vprintf" != yes; then + AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) + fi + + If `AC_CONFIG_HEADER' has been called, then instead of creating +`DEFS', `AC_OUTPUT' creates a header file by substituting the correct +values into `#define' statements in a template file. *Note +Configuration Headers::, for more information about this kind of output. + + - Macro: AC_DEFINE (VARIABLE [, VALUE]) + Define C preprocessor variable VARIABLE. If VALUE is given, set + VARIABLE to that value (verbatim), otherwise set it to 1. VALUE + should not contain literal newlines, and if you are not using + `AC_CONFIG_HEADER' it should not contain any `#' characters, as + `make' tends to eat them. To use a shell variable (which you need + to do in order to define a value containing the `m4' quote + characters `[' or `]'), use `AC_DEFINE_UNQUOTED' instead. The + following example defines the C preprocessor variable `EQUATION' + to be the string constant `"$a > $b"': + + AC_DEFINE(EQUATION, "$a > $b") + + - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE]) + Like `AC_DEFINE', but three shell expansions are + performed--once--on VARIABLE and VALUE: variable expansion (`$'), + command substitution (``'), and backslash escaping (`\'). Single + and double quote characters in the value have no special meaning. + Use this macro instead of `AC_DEFINE' when VARIABLE or VALUE is a + shell variable. Examples: + + AC_DEFINE_UNQUOTED(config_machfile, "${machfile}") + AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) + AC_DEFINE_UNQUOTED(${ac_tr_hdr}) + + Due to the syntactical bizarreness of the Bourne shell, do not use +semicolons to separate `AC_DEFINE' or `AC_DEFINE_UNQUOTED' calls from +other macro calls or shell code; that can cause syntax errors in the +resulting `configure' script. Use either spaces or newlines. That is, +do this: + + AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf") + +or this: + + AC_CHECK_HEADER(elf.h, + AC_DEFINE(SVR4) + LIBS="$LIBS -lelf") + +instead of this: + + AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf") + + +File: autoconf.info, Node: Setting Output Variables, Next: Caching Results, Prev: Defining Symbols, Up: Results + +Setting Output Variables +======================== + + One way to record the results of tests is to set "output variables", +which are shell variables whose values are substituted into files that +`configure' outputs. The two macros below create new output variables. +*Note Preset Output Variables::, for a list of output variables that +are always available. + + - Macro: AC_SUBST (VARIABLE) + Create an output variable from a shell variable. Make `AC_OUTPUT' + substitute the variable VARIABLE into output files (typically one + or more `Makefile's). This means that `AC_OUTPUT' will replace + instances of `@VARIABLE@' in input files with the value that the + shell variable VARIABLE has when `AC_OUTPUT' is called. The value + of VARIABLE should not contain literal newlines. + + - Macro: AC_SUBST_FILE (VARIABLE) + Another way to create an output variable from a shell variable. + Make `AC_OUTPUT' substitute the contents of the file named by shell + variable VARIABLE into output files (typically one or more + `Makefile's). This means that `AC_OUTPUT' will replace instances + of `@VARIABLE@' in the `Makefile.in' files with the contents of + the file that the shell variable VARIABLE names when `AC_OUTPUT' + is called. Set the variable to `/dev/null' for cases which do not + have a file to insert. + + This macro is useful for inserting `Makefile' fragments containing + special dependencies or other `make' directives for particular host + or target types into `Makefile's. For example, `configure.in' + could contain: + + AC_SUBST_FILE(host_frag)dnl + host_frag=$srcdir/conf/sun4.mh + + and then a `Makefile.in' could contain: + + @host_frag@ + + +File: autoconf.info, Node: Caching Results, Next: Printing Messages, Prev: Setting Output Variables, Up: Results + +Caching Results +=============== + + To avoid checking for the same features repeatedly in various +`configure' scripts (or repeated runs of one script), `configure' saves +the results of many of its checks in a "cache file". If, when a +`configure' script runs, it finds a cache file, it reads from it the +results from previous runs and avoids rerunning those checks. As a +result, `configure' can run much faster than if it had to perform all +of the checks every time. + + - Macro: AC_CACHE_VAL (CACHE-ID, COMMANDS-TO-SET-IT) + Ensure that the results of the check identified by CACHE-ID are + available. If the results of the check were in the cache file + that was read, and `configure' was not given the `--quiet' or + `--silent' option, print a message saying that the result was + cached; otherwise, run the shell commands COMMANDS-TO-SET-IT. + Those commands should have no side effects except for setting the + variable CACHE-ID. In particular, they should not call + `AC_DEFINE'; the code that follows the call to `AC_CACHE_VAL' + should do that, based on the cached value. Also, they should not + print any messages, for example with `AC_MSG_CHECKING'; do that + before calling `AC_CACHE_VAL', so the messages are printed + regardless of whether the results of the check are retrieved from + the cache or determined by running the shell commands. If the + shell commands are run to determine the value, the value will be + saved in the cache file just before `configure' creates its output + files. *Note Cache Variable Names::, for how to choose the name + of the CACHE-ID variable. + +* Menu: + +* Cache Variable Names:: Shell variables used in caches. +* Cache Files:: Files `configure' uses for caching. + + +File: autoconf.info, Node: Cache Variable Names, Next: Cache Files, Up: Caching Results + +Cache Variable Names +-------------------- + + The names of cache variables should have the following format: + + PACKAGE-PREFIX_cv_VALUE-TYPE_SPECIFIC-VALUE[_ADDITIONAL-OPTIONS] + +for example, `ac_cv_header_stat_broken' or +`ac_cv_prog_gcc_traditional'. The parts of the variable name are: + +PACKAGE-PREFIX + An abbreviation for your package or organization; the same prefix + you begin local Autoconf macros with, except lowercase by + convention. For cache values used by the distributed Autoconf + macros, this value is `ac'. + +`_cv_' + Indicates that this shell variable is a cache value. + +VALUE-TYPE + A convention for classifying cache values, to produce a rational + naming system. The values used in Autoconf are listed in *Note + Macro Names::. + +SPECIFIC-VALUE + Which member of the class of cache values this test applies to. + For example, which function (`alloca'), program (`gcc'), or output + variable (`INSTALL'). + +ADDITIONAL-OPTIONS + Any particular behavior of the specific member that this test + applies to. For example, `broken' or `set'. This part of the + name may be omitted if it does not apply. + + Like their names, the values that may be assigned to cache variables +have a few restrictions. The values may not contain single quotes or +curly braces. Usually, their values will be boolean (`yes' or `no') or +the names of files or functions; so this is not an important +restriction. + + +File: autoconf.info, Node: Cache Files, Prev: Cache Variable Names, Up: Caching Results + +Cache Files +----------- + + A cache file is a shell script that caches the results of configure +tests run on one system so they can be shared between configure scripts +and configure runs. It is not useful on other systems. If its contents +are invalid for some reason, the user may delete or edit it. + + By default, configure uses `./config.cache' as the cache file, +creating it if it does not exist already. `configure' accepts the +`--cache-file=FILE' option to use a different cache file; that is what +`configure' does when it calls `configure' scripts in subdirectories, +so they share the cache. Giving `--cache-file=/dev/null' disables +caching, for debugging `configure'. *Note Subdirectories::, for +information on configuring subdirectories with the `AC_CONFIG_SUBDIRS' +macro. `config.status' only pays attention to the cache file if it is +given the `--recheck' option, which makes it rerun `configure'. + + It is wrong to try to distribute cache files for particular system +types. There is too much room for error in doing that, and too much +administrative overhead in maintaining them. For any features that +can't be guessed automatically, use the standard method of the canonical +system type and linking files (*note Manual Configuration::.). + + The cache file on a particular system will gradually accumulate +whenever someone runs a `configure' script; it will be initially +nonexistent. Running `configure' merges the new cache results with the +existing cache file. The site initialization script can specify a +site-wide cache file to use instead of the default, to make it work +transparently, as long as the same C compiler is used every time (*note +Site Defaults::.). + + +File: autoconf.info, Node: Printing Messages, Prev: Caching Results, Up: Results + +Printing Messages +================= + + `configure' scripts need to give users running them several kinds of +information. The following macros print messages in ways appropriate +for each kind. The arguments to all of them get enclosed in shell +double quotes, so the shell performs variable and backquote substitution +on them. + + These macros are all wrappers around the `echo' shell command. +`configure' scripts should rarely need to run `echo' directly to print +messages for the user. Using these macros makes it easy to change how +and when each kind of message is printed; such changes need only be +made to the macro definitions, and all of the callers change +automatically. + + - Macro: AC_MSG_CHECKING (FEATURE-DESCRIPTION) + Notify the user that `configure' is checking for a particular + feature. This macro prints a message that starts with `checking ' + and ends with `...' and no newline. It must be followed by a call + to `AC_MSG_RESULT' to print the result of the check and the + newline. The FEATURE-DESCRIPTION should be something like + `whether the Fortran compiler accepts C++ comments' or `for c89'. + + This macro prints nothing if `configure' is run with the `--quiet' + or `--silent' option. + + - Macro: AC_MSG_RESULT (RESULT-DESCRIPTION) + Notify the user of the results of a check. RESULT-DESCRIPTION is + almost always the value of the cache variable for the check, + typically `yes', `no', or a file name. This macro should follow a + call to `AC_MSG_CHECKING', and the RESULT-DESCRIPTION should be + the completion of the message printed by the call to + `AC_MSG_CHECKING'. + + This macro prints nothing if `configure' is run with the `--quiet' + or `--silent' option. + + - Macro: AC_MSG_ERROR (ERROR-DESCRIPTION) + Notify the user of an error that prevents `configure' from + completing. This macro prints an error message on the standard + error stream and exits `configure' with a nonzero status. + eRROR-DESCRIPTION should be something like `invalid value $HOME + for \$HOME'. + + - Macro: AC_MSG_WARN (PROBLEM-DESCRIPTION) + Notify the `configure' user of a possible problem. This macro + prints the message on the standard error stream; `configure' + continues running afterward, so macros that call `AC_MSG_WARN' + should provide a default (back-up) behavior for the situations + they warn about. PROBLEM-DESCRIPTION should be something like `ln + -s seems to make hard links'. + + The following two macros are an obsolete alternative to +`AC_MSG_CHECKING' and `AC_MSG_RESULT'. + + - Macro: AC_CHECKING (FEATURE-DESCRIPTION) + This macro is similar to `AC_MSG_CHECKING', except that it prints a + newline after the FEATURE-DESCRIPTION. It is useful mainly to + print a general description of the overall purpose of a group of + feature checks, e.g., + + AC_CHECKING(if stack overflow is detectable) + + - Macro: AC_VERBOSE (RESULT-DESCRIPTION) + This macro is similar to `AC_MSG_RESULT', except that it is meant + to follow a call to `AC_CHECKING' instead of `AC_MSG_CHECKING'; it + starts the message it prints with a tab. It is considered + obsolete. + + +File: autoconf.info, Node: Writing Macros, Next: Manual Configuration, Prev: Results, Up: Top + +Writing Macros +************** + + When you write a feature test that could be applicable to more than +one 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 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. + + +File: autoconf.info, Node: Macro Definitions, Next: Macro Names, Up: Writing Macros + +Macro Definitions +================= + + Autoconf macros are defined using the `AC_DEFUN' macro, which is +similar to the `m4' builtin `define' macro. In addition to defining a +macro, `AC_DEFUN' adds to it some code which is used to constrain the +order in which macros are called (*note Prerequisite Macros::.). + + An Autoconf macro definition looks like this: + + AC_DEFUN(MACRO-NAME, [MACRO-BODY]) + +The square brackets here do not indicate optional text: they should +literally be present in the macro definition to avoid macro expansion +problems (*note Quoting::.). You can refer to any arguments passed to +the macro as `$1', `$2', etc. + + To introduce comments in `m4', use the `m4' builtin `dnl'; it causes +`m4' to discard the text through the next newline. It is not needed +between macro definitions in `acsite.m4' and `aclocal.m4', because all +output is discarded until `AC_INIT' is called. + + *Note How to define new macros: (m4.info)Definitions, for more +complete information on writing `m4' macros. + + +File: autoconf.info, Node: Macro Names, Next: Quoting, Prev: Macro Definitions, Up: Writing Macros + +Macro Names +=========== + + All of the Autoconf macros have all-uppercase names starting with +`AC_' to prevent them from accidentally conflicting with other text. +All shell variables that they use for internal purposes have +mostly-lowercase names starting with `ac_'. To ensure that your macros +don't conflict with present or future Autoconf macros, you should +prefix your own macro names and any shell variables they use with some +other sequence. Possibilities include your initials, or an abbreviation +for the name of your organization or software package. + + Most of the Autoconf macros' names follow a structured naming +convention that indicates the kind of feature check by the name. The +macro names consist of several words, separated by underscores, going +from most general to most specific. The names of their cache +variables use the same convention (*note Cache Variable Names::., for +more information on them). + + The first word of the name after `AC_' usually tells the category of +feature being tested. Here are the categories used in Autoconf for +specific test macros, the kind of macro that you are more likely to +write. They are also used for cache variables, in all-lowercase. Use +them where applicable; where they're not, invent your own categories. + +`C' + C language builtin features. + +`DECL' + Declarations of C variables in header files. + +`FUNC' + Functions in libraries. + +`GROUP' + UNIX group owners of files. + +`HEADER' + Header files. + +`LIB' + C libraries. + +`PATH' + The full path names to files, including programs. + +`PROG' + The base names of programs. + +`STRUCT' + Definitions of C structures in header files. + +`SYS' + Operating system features. + +`TYPE' + C builtin or declared types. + +`VAR' + C variables in libraries. + + After the category comes the name of the particular feature being +tested. Any further words in the macro name indicate particular aspects +of the feature. For example, `AC_FUNC_UTIME_NULL' checks the behavior +of the `utime' function when called with a `NULL' pointer. + + A macro that is an internal subroutine of another macro should have a +name that starts with the name of that other macro, followed by one or +more words saying what the internal macro does. For example, +`AC_PATH_X' has internal macros `AC_PATH_X_XMKMF' and +`AC_PATH_X_DIRECT'. + + +File: autoconf.info, Node: Quoting, Next: Dependencies Between Macros, Prev: Macro Names, Up: Writing Macros + +Quoting +======= + + Macros that are called by other macros are evaluated by `m4' several +times; each evaluation might require another layer of quotes to prevent +unwanted expansions of macros or `m4' builtins, such as `define' and +`$1'. Quotes are also required around macro arguments that contain +commas, since commas separate the arguments from each other. It's a +good idea to quote any macro arguments that contain newlines or calls +to other macros, as well. + + Autoconf changes the `m4' quote characters from the default ``' and +`'' to `[' and `]', because many of the macros use ``' and `'', +mismatched. However, in a few places the macros need to use brackets +(usually in C program text or regular expressions). In those places, +they use the `m4' builtin command `changequote' to temporarily change +the quote characters to `<<' and `>>'. (Sometimes, if they don't need +to quote anything, they disable quoting entirely instead by setting the +quote characters to empty strings.) Here is an example: + + AC_TRY_LINK( + changequote(<<, >>)dnl + <<#include + #ifndef tzname /* For SGI. */ + extern char *tzname[]; /* RS6000 and others reject char **tzname. */ + #endif>>, + changequote([, ])dnl + [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no) + + When you create a `configure' script using newly written macros, +examine it carefully to check whether you need to add more quotes in +your macros. If one or more words have disappeared in the `m4' output, +you need more quotes. When in doubt, quote. + + However, it's also possible to put on too many layers of quotes. If +this happens, the resulting `configure' script will contain unexpanded +macros. The `autoconf' program checks for this problem by doing `grep +AC_ configure'. + + +File: autoconf.info, Node: Dependencies Between Macros, Prev: Quoting, Up: Writing Macros + +Dependencies Between Macros +=========================== + + Some Autoconf macros depend on other macros having been called first +in order to work correctly. Autoconf provides a way to ensure that +certain 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. +* Obsolete Macros:: Warning about old ways of doing things. + + +File: autoconf.info, Node: Prerequisite Macros, Next: Suggested Ordering, Up: Dependencies Between Macros + +Prerequisite Macros +------------------- + + A macro that you write might need to use values that have previously +been computed by other macros. For example, `AC_DECL_YYTEXT' examines +the output of `flex' or `lex', so it depends on `AC_PROG_LEX' having +been called first to set the shell variable `LEX'. + + Rather than forcing the user of the macros to keep track of the +dependencies between them, you can use the `AC_REQUIRE' macro to do it +automatically. `AC_REQUIRE' can ensure that a macro is only called if +it is needed, and only called once. + + - Macro: AC_REQUIRE (MACRO-NAME) + If the `m4' macro MACRO-NAME has not already been called, call it + (without any arguments). Make sure to quote MACRO-NAME with + square brackets. MACRO-NAME must have been defined using + `AC_DEFUN' or else contain a call to `AC_PROVIDE' to indicate that + it has been called. + + An alternative to using `AC_DEFUN' is to use `define' and call +`AC_PROVIDE'. Because this technique does not prevent nested messages, +it is considered obsolete. + + - Macro: AC_PROVIDE (THIS-MACRO-NAME) + Record the fact that THIS-MACRO-NAME has been called. + tHIS-MACRO-NAME should be the name of the macro that is calling + `AC_PROVIDE'. An easy way to get it is from the `m4' builtin + variable `$0', like this: + + AC_PROVIDE([$0]) + + +File: autoconf.info, Node: Suggested Ordering, Next: Obsolete Macros, Prev: Prerequisite Macros, Up: Dependencies Between Macros + +Suggested Ordering +------------------ + + Some macros should be run before another macro if both are called, +but neither *requires* that the other be called. For example, a macro +that changes the behavior of the C compiler should be called before any +macros that run the C compiler. Many of these dependencies are noted in +the documentation. + + Autoconf provides the `AC_BEFORE' macro to warn users when macros +with this kind of dependency appear out of order in a `configure.in' +file. The warning occurs when creating `configure' from +`configure.in', not when running `configure'. For example, +`AC_PROG_CPP' checks whether the C compiler can run the C preprocessor +when given the `-E' option. It should therefore be called after any +macros that change which C compiler is being used, such as +`AC_PROG_CC'. So `AC_PROG_CC' contains: + + AC_BEFORE([$0], [AC_PROG_CPP])dnl + +This warns the user if a call to `AC_PROG_CPP' has already occurred +when `AC_PROG_CC' is called. + + - Macro: AC_BEFORE (THIS-MACRO-NAME, CALLED-MACRO-NAME) + Make `m4' print a warning message on the standard error output if + CALLED-MACRO-NAME has already been called. THIS-MACRO-NAME should + be the name of the macro that is calling `AC_BEFORE'. The macro + CALLED-MACRO-NAME must have been defined using `AC_DEFUN' or else + contain a call to `AC_PROVIDE' to indicate that it has been called. + + +File: autoconf.info, Node: Obsolete Macros, Prev: Suggested Ordering, Up: Dependencies Between Macros + +Obsolete Macros +--------------- + + Configuration and portability technology has evolved over the years. +Often better ways of solving a particular problem are developed, or +ad-hoc approaches are systematized. This process has occurred in many +parts of Autoconf. One result is that some of the macros are now +considered "obsolete"; they still work, but are no longer considered +the best thing to do. Autoconf provides the `AC_OBSOLETE' macro to +warn users producing `configure' scripts when they use obsolete macros, +to encourage them to modernize. A sample call is: + + AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl + + - Macro: AC_OBSOLETE (THIS-MACRO-NAME [, SUGGESTION]) + Make `m4' print a message on the standard error output warning that + THIS-MACRO-NAME is obsolete, and giving the file and line number + where it was called. THIS-MACRO-NAME should be the name of the + macro that is calling `AC_OBSOLETE'. If SUGGESTION is given, it + is printed at the end of the warning message; for example, it can + be a suggestion for what to use instead of THIS-MACRO-NAME. + + +File: autoconf.info, Node: Manual Configuration, Next: Site Configuration, Prev: Writing Macros, Up: Top + +Manual Configuration +******************** + + A few kinds of features can't be guessed automatically by running +test programs. For example, the details of the object file format, or +special options that need to be passed to the compiler or linker. It is +possible to check for such features using ad-hoc means, such as having +`configure' check the output of the `uname' program, or looking for +libraries that are unique to particular systems. However, Autoconf +provides a uniform method for handling unguessable features. + +* Menu: + +* Specifying Names:: Specifying the system type. +* Canonicalizing:: Getting the canonical system type. +* System Type Variables:: Variables containing the system type. +* Using System Type:: What to do with the system type. + + +File: autoconf.info, Node: Specifying Names, Next: Canonicalizing, Up: Manual Configuration + +Specifying the System Type +========================== + + Like other GNU `configure' scripts, Autoconf-generated `configure' +scripts can make decisions based on a canonical name for the system +type, which has the form: + + CPU-COMPANY-SYSTEM + + `configure' can usually guess the canonical name for the type of +system it's running on. To do so it runs a script called +`config.guess', which derives the name using the `uname' command or +symbols predefined by the C preprocessor. + + Alternately, the user can specify the system type with command line +arguments to `configure'. Doing so is necessary when cross-compiling. +In the most complex case of cross-compiling, three system types are +involved. The options to specify them are: + +`--build=BUILD-TYPE' + the type of system on which the package is being configured and + compiled (rarely needed); + +`--host=HOST-TYPE' + the type of system on which the package will run; + +`--target=TARGET-TYPE' + the type of system for which any compiler tools in the package will + produce code. + +If the user gives `configure' a non-option argument, it is used as the +default for the host, target, and build system types if the user does +not specify them explicitly with options. The target and build types +default to the host type if it is given and they are not. If you are +cross-compiling, you still have to specify the names of the cross-tools +you use, in particular the C compiler, on the `configure' command line, +e.g., + + CC=m68k-coff-gcc configure --target=m68k-coff + + `configure' recognizes short aliases for many system types; for +example, `decstation' can be given on the command line instead of +`mips-dec-ultrix4.2'. `configure' runs a script called `config.sub' to +canonicalize system type aliases. + + +File: autoconf.info, Node: Canonicalizing, Next: System Type Variables, Prev: Specifying Names, Up: Manual Configuration + +Getting the Canonical System Type +================================= + + The following macros make the system type available to `configure' +scripts. They run the shell script `config.guess' to determine any +values for the host, target, and build types that they need and the user +did not specify on the command line. They run `config.sub' to +canonicalize any aliases the user gave. If you use these macros, you +must distribute those two shell scripts along with your source code. +*Note Output::, for information about the `AC_CONFIG_AUX_DIR' macro +which you can use to control which directory `configure' looks for +those scripts in. If you do not use either of these macros, +`configure' ignores any `--host', `--target', and `--build' options +given to it. + + - Macro: AC_CANONICAL_SYSTEM + Determine the system type and set output variables to the names of + the canonical system types. *Note System Type Variables::, for + details about the variables this macro sets. + + - Macro: AC_CANONICAL_HOST + Perform only the subset of `AC_CANONICAL_SYSTEM' relevant to the + host type. This is all that is needed for programs that are not + part of a compiler toolchain. + + +File: autoconf.info, Node: System Type Variables, Next: Using System Type, Prev: Canonicalizing, Up: Manual Configuration + +System Type Variables +===================== + + After calling `AC_CANONICAL_SYSTEM', the following output variables +contain the system type information. After `AC_CANONICAL_HOST', only +the `host' variables below are set. + +``build', `host', `target'' + the canonical system names; + +``build_alias', `host_alias', `target_alias'' + the names the user specified, or the canonical names if + `config.guess' was used; + +``build_cpu', `build_vendor', `build_os'' +``host_cpu', `host_vendor', `host_os'' +``target_cpu', `target_vendor', `target_os'' + the individual parts of the canonical names (for convenience). + + +File: autoconf.info, Node: Using System Type, Prev: System Type Variables, Up: Manual Configuration + +Using the System Type +===================== + + How do you use a canonical system type? Usually, you use it in one +or more `case' statements in `configure.in' to select system-specific C +files. Then link those files, which have names based on the system +name, to generic names, such as `host.h' or `target.c'. The `case' +statement patterns can use shell wildcards to group several cases +together, like in this fragment: + + case "$target" in + i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;; + i960-*-bout) obj_format=bout ;; + esac + + - Macro: AC_LINK_FILES (SOURCE..., DEST...) + Make `AC_OUTPUT' link each of the existing files SOURCE to the + corresponding link name DEST. Makes a symbolic link if possible, + otherwise a hard link. The DEST and SOURCE names should be + relative to the top level source or build directory. + + For example, this call: + + AC_LINK_FILES(config/${machine}.h config/${obj_format}.h, host.h object.h) + + creates in the current directory `host.h', which is a link to + `SRCDIR/config/${machine}.h', and `object.h', which is a link to + `SRCDIR/config/${obj_format}.h'. + + +File: autoconf.info, Node: Site Configuration, Next: Invoking configure, Prev: Manual Configuration, Up: Top + +Site Configuration +****************** + + `configure' scripts support several kinds of local configuration +decisions. There are ways for users to specify where external software +packages are, include or exclude optional features, install programs +under modified names, and set default values for `configure' options. + +* Menu: + +* External Software:: Working with other optional software. +* Package Options:: Selecting optional features. +* Site Details:: Configuring site details. +* Transforming Names:: Changing program names when installing. +* Site Defaults:: Giving `configure' local defaults. + + +File: autoconf.info, Node: External Software, Next: Package Options, Up: Site Configuration + +Working With External Software +============================== + + Some packages require, or can optionally use, other software packages +which are already installed. The user can give `configure' command +line options to specify which such external software to use. The +options have one of these forms: + + --with-PACKAGE[=ARG] + --without-PACKAGE + + For example, `--with-gnu-ld' means work with the GNU linker instead +of some other linker. `--with-x11' means work with X11. + + The user can give an argument by following the package name with `=' +and the argument. Giving an argument of `no' is for packages that are +used by default; it says to *not* use the package. An argument that is +neither `yes' nor `no' could include a name or number of a version of +the other package, to specify more precisely which other package this +program is supposed to work with. If no argument is given, it defaults +to `yes'. `--without-PACKAGE' is equivalent to `--with-PACKAGE=no'. + + For each external software package that may be used, `configure.in' +should call `AC_ARG_WITH' to detect whether the `configure' user asked +to use it. Whether each package is used or not by default, and which +arguments are valid, is up to you. + + - Macro: AC_ARG_WITH (PACKAGE, HELP-STRING, ACTION-IF-TRUE [, + ACTION-IF-FALSE]) + If the user gave `configure' the option `--with-PACKAGE' or + `--without-PACKAGE', run shell commands ACTION-IF-TRUE. Otherwise + run shell commands ACTION-IF-FALSE. The name PACKAGE indicates + another software package that this program should work with. It + should consist only of alphanumeric characters and dashes. + + The option's argument is available to the shell commands + ACTION-IF-TRUE in the shell variable `withval'. + + The argument HELP-STRING is a description of the option which + looks like this: + --with-readline support fancy command line editing + + HELP-STRING may be more than one line long, if more detail is + needed. Just make sure the columns line up in `configure --help'. + Avoid tabs in the help string. You'll need to enclose it in `[' + and `]' in order to produce the leading spaces. + + - Macro: AC_WITH (PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE]) + This is an obsolete version of `AC_ARG_WITH' that does not support + providing a help string. + + +File: autoconf.info, Node: Package Options, Next: Site Details, Prev: External Software, Up: Site Configuration + +Choosing Package Options +======================== + + If a software package has optional compile-time features, the user +can give `configure' command line options to specify whether to compile +them. The options have one of these forms: + + --enable-FEATURE[=ARG] + --disable-FEATURE + + These options allow users to choose which optional features to build +and install. `--enable-FEATURE' options should never make a feature +behave differently or cause one feature to replace another. They +should only cause parts of the program to be built rather than left out. + + The user can give an argument by following the feature name with `=' +and the argument. Giving an argument of `no' requests that the feature +*not* be made available. A feature with an argument looks like +`--enable-debug=stabs'. If no argument is given, it defaults to `yes'. +`--disable-FEATURE' is equivalent to `--enable-FEATURE=no'. + + For each optional feature, `configure.in' should call +`AC_ARG_ENABLE' to detect whether the `configure' user asked to include +it. Whether each feature is included or not by default, and which +arguments are valid, is up to you. + + - Macro: AC_ARG_ENABLE (FEATURE, HELP-STRING, ACTION-IF-TRUE [, + ACTION-IF-FALSE]) + If the user gave `configure' the option `--enable-FEATURE' or + `--disable-FEATURE', run shell commands ACTION-IF-TRUE. Otherwise + run shell commands ACTION-IF-FALSE. The name FEATURE indicates an + optional user-level facility. It should consist only of + alphanumeric characters and dashes. + + The option's argument is available to the shell commands + ACTION-IF-TRUE in the shell variable `enableval'. The HELP-STRING + argument is like that of `AC_ARG_WITH' (*note External + Software::.). + + - Macro: AC_ENABLE (FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE]) + This is an obsolete version of `AC_ARG_ENABLE' that does not + support providing a help string. + + +File: autoconf.info, Node: Site Details, Next: Transforming Names, Prev: Package Options, Up: Site Configuration + +Configuring Site Details +======================== + + Some software packages require complex site-specific information. +Some examples are host names to use for certain services, company +names, and email addresses to contact. Since some configuration +scripts generated by Metaconfig ask for such information interactively, +people sometimes wonder how to get that information in +Autoconf-generated configuration scripts, which aren't interactive. + + Such site configuration information should be put in a file that is +edited *only by users*, not by programs. The location of the file can +either be based on the `prefix' variable, or be a standard location +such as the user's home directory. It could even be specified by an +environment variable. The programs should examine that file at run +time, rather than at compile time. That approach is more convenient +for users and makes the configuration process simpler than getting the +information while configuring. *Note Variables for Installation +Directories: (standards)Directory Variables, for more information on +where to put data files. + diff --git a/src/util/autoconf/autoconf.info-4 b/src/util/autoconf/autoconf.info-4 new file mode 100644 index 000000000..7f33e6502 --- /dev/null +++ b/src/util/autoconf/autoconf.info-4 @@ -0,0 +1,1101 @@ +This is Info file autoconf.info, produced by Makeinfo-1.55 from the +input file ./autoconf.texi. + +START-INFO-DIR-ENTRY +* Autoconf: (autoconf). Create source code configuration scripts. +END-INFO-DIR-ENTRY + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. + + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: autoconf.info, Node: Transforming Names, Next: Site Defaults, Prev: Site Details, Up: Site Configuration + +Transforming Program Names When Installing +========================================== + + Autoconf supports changing the names of programs when installing +them. In order to use these transformations, `configure.in' must call +the macro `AC_ARG_PROGRAM'. + + - Macro: AC_ARG_PROGRAM + Place in output variable `program_transform_name' a sequence of + `sed' commands for changing the names of installed programs. + + If any of the options described below are given to `configure', + program names are transformed accordingly. Otherwise, if + `AC_CANONICAL_SYSTEM' has been called and a `--target' value is + given that differs from the host type (specified with `--host' or + defaulted by `config.sub'), the target type followed by a dash is + used as a prefix. Otherwise, no program name transformation is + done. + +* Menu: + +* Transformation Options:: `configure' options to transforme names. +* Transformation Examples:: Sample uses of transforming names. +* Transformation Rules:: `Makefile' uses of transforming names. + + +File: autoconf.info, Node: Transformation Options, Next: Transformation Examples, Up: Transforming Names + +Transformation Options +---------------------- + + You can specify name transformations by giving `configure' these +command line options: + +`--program-prefix=PREFIX' + prepend PREFIX to the names; + +`--program-suffix=SUFFIX' + append SUFFIX to the names; + +`--program-transform-name=EXPRESSION' + perform `sed' substitution EXPRESSION on the names. + + +File: autoconf.info, Node: Transformation Examples, Next: Transformation Rules, Prev: Transformation Options, Up: Transforming Names + +Transformation Examples +----------------------- + + These transformations are useful with programs that can be part of a +cross-compilation development environment. For example, a +cross-assembler running on a Sun 4 configured with +`--target=i960-vxworks' is normally installed as `i960-vxworks-as', +rather than `as', which could be confused with a native Sun 4 assembler. + + You can force a program name to begin with `g', if you don't want +GNU programs installed on your system to shadow other programs with the +same name. For example, if you configure GNU `diff' with +`--program-prefix=g', then when you run `make install' it is installed +as `/usr/local/bin/gdiff'. + + As a more sophistocated example, you could use + --program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/' + +to prepend `g' to most of the program names in a source tree, excepting +those like `gdb' that already have one and those like `less' and +`lesskey' that aren't GNU programs. (That is assuming that you have a +source tree containing those programs that is set up to use this +feature.) + + One way to install multiple versions of some programs simultaneously +is to append a version number to the name of one or both. For example, +you can configure Autoconf using `--program-suffix=2' to install the +programs as `/usr/local/bin/autoconf2', `/usr/local/bin/autoheader2', +etc. + + +File: autoconf.info, Node: Transformation Rules, Prev: Transformation Examples, Up: Transforming Names + +Transformation Rules +-------------------- + + Here is how to use the variable `program_transform_name' in a +`Makefile.in': + + transform=@program_transform_name@ + install: all + $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'` + +If you have more than one program to install, you can do it in a loop: + + PROGRAMS=cp ls rm + install: + for p in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + done + + +File: autoconf.info, Node: Site Defaults, Prev: Transforming Names, Up: Site Configuration + +Setting Site Defaults +===================== + + Autoconf-generated `configure' scripts allow your site to provide +default values for some configuration values. You do this by creating +site- and system-wide initialization files. + + If the environment variable `CONFIG_SITE' is set, `configure' uses +its value as the name of a shell script to read. Otherwise, it reads +the shell script `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Thus, settings in +machine-specific files override those in machine-independent ones in +case of conflict. + + Site files can be arbitrary shell scripts, but only certain kinds of +code are really appropriate to be in them. Because `configure' reads +any cache file after it has read any site files, a site file can define +a default cache file to be shared between all Autoconf-generated +`configure' scripts run on that system. If you set a default cache +file in a site file, it is a good idea to also set the output variable +`CC' in that site file, because the cache file is only valid for a +particular compiler, but many systems have several available. + + Site files are also good places to set default values for other +output variables, such as `CFLAGS', if you need to give them non-default +values: anything you would normally do, repetitively, on the command +line. If you use non-default values for PREFIX or EXEC_PREFIX +(wherever you locate the site file), you can set them in the site file +if you specify it with the `CONFIG_SITE' environment variable. + + You can set some cache values in the site file itself. Doing this is +useful if you are cross-compiling, so it is impossible to check features +that require running a test program. You could "prime the cache" by +setting those values correctly for that system in +`PREFIX/etc/config.site'. To find out the names of the cache variables +you need to set, look for shell variables with `_cv_' in their names in +the affected configure scripts, or in the Autoconf `m4' source code for +those macros. + + The cache file is careful to not override any variables set in the +site files. Similarly, you should not override command-line options in +the site files. Your code should check that variables such as `prefix' +and `cache_file' have their default values (as set near the top of +`configure') before changing them. + + Here is a sample file `/usr/share/local/gnu/share/config.site'. The +command `configure --prefix=/usr/share/local/gnu' would read this file +(if `CONFIG_SITE' is not set). + + # config.site for configure + # + # Default --prefix and --exec-prefix. + test "$prefix" = NONE && prefix=/usr/share/local/gnu + test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu + # + # Give Autoconf 2.x generated configure scripts a shared default + # cache file for feature test results, architecture-specific. + if test "$cache_file" = ./config.cache; then + cache_file="$prefix/var/config.cache" + # A cache file is only valid for one C compiler. + CC=gcc + fi + + +File: autoconf.info, Node: Invoking configure, Next: Invoking config.status, Prev: Site Configuration, Up: Top + +Running `configure' Scripts +*************************** + + Below are instructions on how to configure a package that uses a +`configure' script, suitable for inclusion as an `INSTALL' file in the +package. + +* Menu: + +* Basic Installation:: Instructions for typical cases. +* Compilers and Options:: Selecting compilers and optimization. +* Build Directory:: Configuring in a different directory. +* Installation Names:: Installing in different directories. +* Optional Features:: Selecting optional features. +* System Type:: Specifying the system type. +* Sharing Defaults:: Setting site-wide defaults for `configure'. +* Operation Controls:: Changing how `configure' runs. + + +File: autoconf.info, Node: Basic Installation, Next: Compilers and Options, Up: Invoking configure + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source directory by typing `make clean'. To also remove the files + that `configure' created (so you can compile the package for a + different kind of computer), type `make distclean'. + + +File: autoconf.info, Node: Compilers and Options, Next: Build Directory, Prev: Basic Installation, Up: Invoking configure + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + + +File: autoconf.info, Node: Build Directory, Next: Installation Names, Prev: Compilers and Options, Up: Invoking configure + +Using a Different Build Directory +================================= + + You can compile the package in a different directory from the one +containing the source code. Doing so allows you to compile it on more +than one kind of computer at the same time. To do this, you must use a +version of `make' that supports the `VPATH' variable, such as GNU +`make'. `cd' to the directory where you want the object files and +executables to go and run the `configure' script. `configure' +automatically checks for the source code in the directory that +`configure' is in and in `..'. + + +File: autoconf.info, Node: Installation Names, Next: Optional Features, Prev: Build Directory, Up: Invoking configure + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + +File: autoconf.info, Node: Optional Features, Next: System Type, Prev: Installation Names, Up: Invoking configure + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + +File: autoconf.info, Node: System Type, Next: Sharing Defaults, Prev: Optional Features, Up: Invoking configure + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + + +File: autoconf.info, Node: Sharing Defaults, Next: Operation Controls, Prev: System Type, Up: Invoking configure + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + + +File: autoconf.info, Node: Operation Controls, Prev: Sharing Defaults, Up: Invoking configure + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Save the results of the tests in FILE instead of `config.cache'. + Set FILE to `/dev/null' to disable caching, for debugging + `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + + +File: autoconf.info, Node: Invoking config.status, Next: Questions, Prev: Invoking configure, Up: Top + +Recreating a Configuration +************************** + + The `configure' script creates a file named `config.status' which +describes which configuration options were specified when the package +was last configured. This file is a shell script which, if run, will +recreate the same configuration. + + You can give `config.status' the `--recheck' option to update +itself. This option is useful if you change `configure', so that the +results of some tests might be different from the previous run. The +`--recheck' option re-runs `configure' with the same arguments you used +before, plus the `--no-create' option, which prevent `configure' from +running `config.status' and creating `Makefile' and other files, and +the `--no-recursion' option, which prevents `configure' from running +other `configure' scripts in subdirectories. (This is so other +`Makefile' rules can run `config.status' when it changes; *note +Automatic Remaking::., for an example). + + `config.status' also accepts the options `--help', which prints a +summary of the options to `config.status', and `--version', which +prints the version of Autoconf used to create the `configure' script +that generated `config.status'. + + `config.status' checks several optional environment variables that +can alter its behavior: + + - Variable: CONFIG_SHELL + The shell with which to run `configure' for the `--recheck' + option. It must be Bourne-compatible. The default is `/bin/sh'. + + - Variable: CONFIG_STATUS + The file name to use for the shell script that records the + configuration. The default is `./config.status'. This variable is + useful when one package uses parts of another and the `configure' + scripts shouldn't be merged because they are maintained separately. + + The following variables provide one way for separately distributed +packages to share the values computed by `configure'. Doing so can be +useful if some of the packages need a superset of the features that one +of them, perhaps a common library, does. These variables allow a +`config.status' file to create files other than the ones that its +`configure.in' specifies, so it can be used for a different package. + + - Variable: CONFIG_FILES + The files in which to perform `@VARIABLE@' substitutions. The + default is the arguments given to `AC_OUTPUT' in `configure.in'. + + - Variable: CONFIG_HEADERS + The files in which to substitute C `#define' statements. The + default is the arguments given to `AC_CONFIG_HEADER'; if that + macro was not called, `config.status' ignores this variable. + + These variables also allow you to write `Makefile' rules that +regenerate only some of the files. For example, in the dependencies +given above (*note Automatic Remaking::.), `config.status' is run twice +when `configure.in' has changed. If that bothers you, you can make +each run only regenerate the files for that rule: + + config.h: stamp-h + stamp-h: config.h.in config.status + CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status + echo > stamp-h + + Makefile: Makefile.in config.status + CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status + +(If `configure.in' does not call `AC_CONFIG_HEADER', there is no need +to set `CONFIG_HEADERS' in the `make' rules.) + + +File: autoconf.info, Node: Questions, Next: Upgrading, Prev: Invoking config.status, Up: Top + +Questions About Autoconf +************************ + + Several questions about Autoconf come up occasionally. Here some of +them are addressed. + +* Menu: + +* Distributing:: Distributing `configure' scripts. +* Why GNU m4:: Why not use the standard `m4'? +* Bootstrapping:: Autoconf and GNU `m4' require each other? +* Why Not Imake:: Why GNU uses `configure' instead of Imake. + + +File: autoconf.info, Node: Distributing, Next: Why GNU m4, Up: Questions + +Distributing `configure' Scripts +================================ + + What are the restrictions on distributing `configure' + scripts that Autoconf generates? How does that affect my + programs that use them? + + There are no restrictions on how the configuration scripts that +Autoconf produces may be distributed or used. In Autoconf version 1, +they were covered by the GNU General Public License. We still +encourage software authors to distribute their work under terms like +those of the GPL, but doing so is not required to use Autoconf. + + Of the other files that might be used with `configure', +`config.h.in' is under whatever copyright you use for your +`configure.in', since it is derived from that file and from the public +domain file `acconfig.h'. `config.sub' and `config.guess' have an +exception to the GPL when they are used with an Autoconf-generated +`configure' script, which permits you to distribute them under the same +terms as the rest of your package. `install-sh' is from the X +Consortium and is not copyrighted. + + +File: autoconf.info, Node: Why GNU m4, Next: Bootstrapping, Prev: Distributing, Up: Questions + +Why Require GNU `m4'? +===================== + + Why does Autoconf require GNU `m4'? + + Many `m4' implementations have hard-coded limitations on the size +and number of macros, which Autoconf exceeds. They also lack several +builtin macros that it would be difficult to get along without in a +sophisticated application like Autoconf, including: + + builtin + indir + patsubst + __file__ + __line__ + + Since only software maintainers need to use Autoconf, and since GNU +`m4' is simple to configure and install, it seems reasonable to require +GNU `m4' to be installed also. Many maintainers of GNU and other free +software already have most of the GNU utilities installed, since they +prefer them. + + +File: autoconf.info, Node: Bootstrapping, Next: Why Not Imake, Prev: Why GNU m4, Up: Questions + +How Can I Bootstrap? +==================== + + If Autoconf requires GNU `m4' and GNU `m4' has an + Autoconf `configure' script, how do I bootstrap? It seems + like a chicken and egg problem! + + This is a misunderstanding. Although GNU `m4' does come with a +`configure' script produced by Autoconf, Autoconf is not required in +order to run the script and install GNU `m4'. Autoconf is only +required if you want to change the `m4' `configure' script, which few +people have to do (mainly its maintainer). + + +File: autoconf.info, Node: Why Not Imake, Prev: Bootstrapping, Up: Questions + +Why Not Imake? +============== + + Why not use Imake instead of `configure' scripts? + + Several people have written addressing this question, so I include +adaptations of their explanations here. + + The following answer is based on one written by Richard Pixley: + + Autoconf generated scripts frequently work on machines which it has +never been set up to handle before. That is, it does a good job of +inferring a configuration for a new system. Imake cannot do this. + + Imake uses a common database of host specific data. For X11, this +makes sense because the distribution is made as a collection of tools, +by one central authority who has control over the database. + + GNU tools are not released this way. Each GNU tool has a maintainer; +these maintainers are scattered across the world. Using a common +database would be a maintenance nightmare. Autoconf may appear to be +this kind of database, but in fact it is not. Instead of listing host +dependencies, it lists program requirements. + + Imake is special-purpose. It is directed at building the X11 +distribution. By comparison to the GNU tools, this is a simple problem. +If you view the GNU suite as a collection of native tools, then the +problems are similar. But the GNU tools are more powerful than that. +The development tools can be configured as cross tools in almost any +host+target permutation. All of these configurations can be installed +concurrently. They can even be configured to share host independent +files across hosts. Imake doesn't address these issues. + + Imake templates are a form of standardization. The GNU coding +standards address the same issues without necessarily imposing the same +restrictions. + + Here is some further explanation, written by Per Bothner: + + One of the advantages of Imake is that it easy to generate large +Makefiles using `cpp''s `#include' and macro mechanisms. However, +`cpp' is not programmable: it has limited conditional facilities, and +no looping. And `cpp' cannot inspect its environment. + + All of these problems are solved by using `sh' instead of `cpp'. +The shell is fully programmable, has macro substitution, can execute +(or source) other shell scripts, and can inspect its environment. + + Paul Eggert elaborates more: + + With Autoconf, installers need not assume that Imake itself is +already installed and working well. This may not seem like much of an +advantage to people who are accustomed to Imake. But on many hosts +Imake is not installed or the default installation is not working well, +and requiring Imake to install a package hinders the acceptance of that +package on those hosts. For example, the Imake template and +configuration files might not be installed properly on a host, or the +Imake build procedure might wrongly assume that all source files are in +one big directory tree, or the Imake configuration might assume one +compiler whereas the package or the installer needs to use another, or +there might be a version mismatch between the Imake expected by the +package and the Imake suported by the host. These problems are much +rarer with Autoconf, where each package comes with its own independent +configuration processor. + + Also, Imake often suffers from unexpected interactions between +`make' and the installer's C preprocessor. The fundamental problem +here is that the C preprocessor was designed to preprocess C programs, +not `Makefile's. This is much less of a problem with Autoconf, which +uses the general-purpose preprocessor `m4', and where the package's +author (rather than the installer) does the preprocessing in a standard +way. + + Finally, Mark Eichin notes: + + Imake isn't all that extensible, either. In order to add new +features to Imake, you need to provide you own project template, and +duplicate most of the features of the existing one. This means that +for a sophisticated project, using the vendor-provided Imake templates +fails to provide any leverage--since they don't cover anything that +your own project needs (unless it is an X11 program). + + On the other side, though: + + The one advantage that Imake has over `configure': `Imakefile's tend +to be much shorter (likewise, less redundant) than `Makefile.in's. +There is a fix to this, however--at least for the Kerberos V5 tree, +we've modified things to call in common `post.in' and `pre.in' +`Makefile' fragments for the entire tree. This means that a lot of +common things don't have to be duplicated, even though they normally +are in `configure' setups. + + +File: autoconf.info, Node: Upgrading, Next: History, Prev: Questions, Up: Top + +Upgrading From Version 1 +************************ + + Autoconf version 2 is mostly backward compatible with version 1. +However, it introduces better ways to do some things, and doesn't +support some of the ugly things in version 1. So, depending on how +sophisticated your `configure.in' files are, you might have to do some +manual work in order to upgrade to version 2. This chapter points out +some problems to watch for when upgrading. Also, perhaps your +`configure' scripts could benefit from some of the new features in +version 2; the changes are summarized in the file `NEWS' in the +Autoconf distribution. + + First, make sure you have GNU `m4' version 1.1 or higher installed, +preferably 1.3 or higher. Versions before 1.1 have bugs that prevent +them from working with Autoconf version 2. Versions 1.3 and later are +much faster than earlier versions, because as of version 1.3, GNU `m4' +has a more efficient implementation of diversions and can freeze its +internal state in a file that it can read back quickly. + +* Menu: + +* Changed File Names:: Files you might rename. +* Changed Makefiles:: New things to put in `Makefile.in'. +* Changed Macros:: Macro calls you might replace. +* Invoking autoupdate:: Replacing old macro names in `configure.in'. +* Changed Results:: Changes in how to check test results. +* Changed Macro Writing:: Better ways to write your own macros. + + +File: autoconf.info, Node: Changed File Names, Next: Changed Makefiles, Up: Upgrading + +Changed File Names +================== + + If you have an `aclocal.m4' installed with Autoconf (as opposed to +in a particular package's source directory), you must rename it to +`acsite.m4'. *Note Invoking autoconf::. + + If you distribute `install.sh' with your package, rename it to +`install-sh' so `make' builtin rules won't inadvertantly create a file +called `install' from it. `AC_PROG_INSTALL' looks for the script under +both names, but it is best to use the new name. + + If you were using `config.h.top' or `config.h.bot', you still can, +but you will have less clutter if you merge them into `acconfig.h'. +*Note Invoking autoheader::. + + +File: autoconf.info, Node: Changed Makefiles, Next: Changed Macros, Prev: Changed File Names, Up: Upgrading + +Changed Makefiles +================= + + Add `@CFLAGS@', `@CPPFLAGS@', and `@LDFLAGS@' in your `Makefile.in' +files, so they can take advantage of the values of those variables in +the environment when `configure' is run. Doing this isn't necessary, +but it's a convenience for users. + + Also add `@configure_input@' in a comment to each input file for +`AC_OUTPUT', so that the output files will contain a comment saying +they were produced by `configure'. Automatically selecting the right +comment syntax for all the kinds of files that people call `AC_OUTPUT' +on became too much work. + + Add `config.log' and `config.cache' to the list of files you remove +in `distclean' targets. + + If you have the following in `Makefile.in': + + prefix = /usr/local + exec_prefix = ${prefix} + +you must change it to: + + prefix = @prefix@ + exec_prefix = @exec_prefix@ + +The old feature of replacing those variables without `@' characters +around them has been removed. + + +File: autoconf.info, Node: Changed Macros, Next: Invoking autoupdate, Prev: Changed Makefiles, Up: Upgrading + +Changed Macros +============== + + Many of the macros were renamed in Autoconf version 2. You can still +use the old names, but the new ones are clearer, and it's easier to find +the documentation for them. *Note Old Macro Names::, for a table +showing the new names for the old macros. Use the `autoupdate' program +to convert your `configure.in' to using the new macro names. *Note +Invoking autoupdate::. + + Some macros have been superseded by similar ones that do the job +better, but are not call-compatible. If you get warnings about calling +obsolete macros while running `autoconf', you may safely ignore them, +but your `configure' script will generally work better if you follow the +advice it prints about what to replace the obsolete macros with. In +particular, the mechanism for reporting the results of tests has +changed. If you were using `echo' or `AC_VERBOSE', your `configure' +script's output will look better if you switch to `AC_MSG_CHECKING' and +`AC_MSG_RESULT'. *Note Printing Messages::. Those macros work best in +conjunction with cache variables. *Note Caching Results::. + + +File: autoconf.info, Node: Invoking autoupdate, Next: Changed Results, Prev: Changed Macros, Up: Upgrading + +Using `autoupdate' to Modernize `configure' +=========================================== + + The `autoupdate' program updates a `configure.in' file that calls +Autoconf macros by their old names to use the current macro names. In +version 2 of Autoconf, most of the macros were renamed to use a more +uniform and descriptive naming scheme. *Note Macro Names::, for a +description of the new scheme. Although the old names still work +(*note Old Macro Names::., for a list of the old macro names and the +corresponding new names), you can make your `configure.in' files more +readable and make it easier to use the current Autoconf documentation +if you update them to use the new macro names. + + If given no arguments, `autoupdate' updates `configure.in', backing +up the original version with the suffix `~' (or the value of the +environment variable `SIMPLE_BACKUP_SUFFIX', if that is set). If you +give `autoupdate' an argument, it reads that file instead of +`configure.in' and writes the updated file to the standard output. + +`autoupdate' accepts the following options: + +`--help' +`-h' + Print a summary of the command line options and exit. + +`--macrodir=DIR' +`-m DIR' + Look for the Autoconf macro files in directory DIR instead of the + default installation directory. You can also set the `AC_MACRODIR' + environment variable to a directory; this option overrides the + environment variable. + +`--version' + Print the version number of `autoupdate' and exit. + + +File: autoconf.info, Node: Changed Results, Next: Changed Macro Writing, Prev: Invoking autoupdate, Up: Upgrading + +Changed Results +=============== + + If you were checking the results of previous tests by examining the +shell variable `DEFS', you need to switch to checking the values of the +cache variables for those tests. `DEFS' no longer exists while +`configure' is running; it is only created when generating output +files. This difference from version 1 is because properly quoting the +contents of that variable turned out to be too cumbersome and +inefficient to do every time `AC_DEFINE' is called. *Note Cache +Variable Names::. + + For example, here is a `configure.in' fragment written for Autoconf +version 1: + + AC_HAVE_FUNCS(syslog) + case "$DEFS" in + *-DHAVE_SYSLOG*) ;; + *) # syslog is not in the default libraries. See if it's in some other. + saved_LIBS="$LIBS" + for lib in bsd socket inet; do + AC_CHECKING(for syslog in -l$lib) + LIBS="$saved_LIBS -l$lib" + AC_HAVE_FUNCS(syslog) + case "$DEFS" in + *-DHAVE_SYSLOG*) break ;; + *) ;; + esac + LIBS="$saved_LIBS" + done ;; + esac + + Here is a way to write it for version 2: + + AC_CHECK_FUNCS(syslog) + if test $ac_cv_func_syslog = no; then + # syslog is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG) + LIBS="$LIBS $lib"; break]) + done + fi + + If you were working around bugs in `AC_DEFINE_UNQUOTED' by adding +backslashes before quotes, you need to remove them. It now works +predictably, and does not treat quotes (except backquotes) specially. +*Note Setting Output Variables::. + + All of the boolean shell variables set by Autoconf macros now use +`yes' for the true value. Most of them use `no' for false, though for +backward compatibility some use the empty string instead. If you were +relying on a shell variable being set to something like 1 or `t' for +true, you need to change your tests. + + +File: autoconf.info, Node: Changed Macro Writing, Prev: Changed Results, Up: Upgrading + +Changed Macro Writing +===================== + + When defining your own macros, you should now use `AC_DEFUN' instead +of `define'. `AC_DEFUN' automatically calls `AC_PROVIDE' and ensures +that macros called via `AC_REQUIRE' do not interrupt other macros, to +prevent nested `checking...' messages on the screen. There's no actual +harm in continuing to use the older way, but it's less convenient and +attractive. *Note Macro Definitions::. + + You probably looked at the macros that came with Autoconf as a guide +for how to do things. It would be a good idea to take a look at the new +versions of them, as the style is somewhat improved and they take +advantage of some new features. + + If you were doing tricky things with undocumented Autoconf internals +(macros, variables, diversions), check whether you need to change +anything to account for changes that have been made. Perhaps you can +even use an officially supported technique in version 2 instead of +kludging. Or perhaps not. + + To speed up your locally written feature tests, add caching to them. +See whether any of your tests are of general enough usefulness to +encapsulate into macros that you can share. + + +File: autoconf.info, Node: History, Next: Old Macro Names, Prev: Upgrading, Up: Top + +History of Autoconf +******************* + + You may be wondering, Why was Autoconf originally written? How did +it get into its present form? (Why does it look like gorilla spit?) If +you're not wondering, then this chapter contains no information useful +to you, and you might as well skip it. If you *are* wondering, then +let there be light... + +* Menu: + +* Genesis:: Prehistory and naming of `configure'. +* Exodus:: The plagues of `m4' and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. + + +File: autoconf.info, Node: Genesis, Next: Exodus, Up: History + +Genesis +======= + + In June 1991 I was maintaining many of the GNU utilities for the Free +Software Foundation. As they were ported to more platforms and more +programs were added, the number of `-D' options that users had to +select in the `Makefile' (around 20) became burdensome. Especially for +me--I had to test each new release on a bunch of different systems. So +I wrote a little shell script to guess some of the correct settings for +the fileutils package, and released it as part of fileutils 2.0. That +`configure' script worked well enough that the next month I adapted it +(by hand) to create similar `configure' scripts for several other GNU +utilities packages. Brian Berliner also adapted one of my scripts for +his CVS revision control system. + + Later that summer, I learned that Richard Stallman and Richard Pixley +were developing similar scripts to use in the GNU compiler tools; so I +adapted my `configure' scripts to support their evolving interface: +using the file name `Makefile.in' as the templates; adding `+srcdir', +the first option (of many); and creating `config.status' files. + + +File: autoconf.info, Node: Exodus, Next: Leviticus, Prev: Genesis, Up: History + +Exodus +====== + + As I got feedback from users, I incorporated many improvements, using +Emacs to search and replace, cut and paste, similar changes in each of +the scripts. As I adapted more GNU utilities packages to use +`configure' scripts, updating them all by hand became impractical. +Rich Murphey, the maintainer of the GNU graphics utilities, sent me mail +saying that the `configure' scripts were great, and asking if I had a +tool for generating them that I could send him. No, I thought, but I +should! So I started to work out how to generate them. And the +journey from the slavery of hand-written `configure' scripts to the +abundance and ease of Autoconf began. + + Cygnus `configure', which was being developed at around that time, +is table driven; it is meant to deal mainly with a discrete number of +system types with a small number of mainly unguessable features (such as +details of the object file format). The automatic configuration system +that Brian Fox had developed for Bash takes a similar approach. For +general use, it seems to me a hopeless cause to try to maintain an +up-to-date database of which features each variant of each operating +system has. It's easier and more reliable to check for most features on +the fly--especially on hybrid systems that people have hacked on +locally or that have patches from vendors installed. + + I considered using an architecture similar to that of Cygnus +`configure', where there is a single `configure' script that reads +pieces of `configure.in' when run. But I didn't want to have to +distribute all of the feature tests with every package, so I settled on +having a different `configure' made from each `configure.in' by a +preprocessor. That approach also offered more control and flexibility. + + I looked briefly into using the Metaconfig package, by Larry Wall, +Harlan Stenn, and Raphael Manfredi, but I decided not to for several +reasons. The `Configure' scripts it produces are interactive, which I +find quite inconvenient; I didn't like the ways it checked for some +features (such as library functions); I didn't know that it was still +being maintained, and the `Configure' scripts I had seen didn't work on +many modern systems (such as System V R4 and NeXT); it wasn't very +flexible in what it could do in response to a feature's presence or +absence; I found it confusing to learn; and it was too big and complex +for my needs (I didn't realize then how much Autoconf would eventually +have to grow). + + I considered using Perl to generate my style of `configure' scripts, +but decided that `m4' was better suited to the job of simple textual +substitutions: it gets in the way less, because output is implicit. +Plus, everyone already has it. (Initially I didn't rely on the GNU +extensions to `m4'.) Also, some of my friends at the University of +Maryland had recently been putting `m4' front ends on several programs, +including `tvtwm', and I was interested in trying out a new language. + + +File: autoconf.info, Node: Leviticus, Next: Numbers, Prev: Exodus, Up: History + +Leviticus +========= + + Since my `configure' scripts determine the system's capabilities +automatically, with no interactive user intervention, I decided to call +the program that generates them Autoconfig. But with a version number +tacked on, that name would be too long for old UNIX file systems, so I +shortened it to Autoconf. + + In the fall of 1991 I called together a group of fellow questers +after the Holy Grail of portability (er, that is, alpha testers) to +give me feedback as I encapsulated pieces of my handwritten scripts in +`m4' macros and continued to add features and improve the techniques +used in the checks. Prominent among the testers were Franc,ois Pinard, +who came up with the idea of making an `autoconf' shell script to run +`m4' and check for unresolved macro calls; Richard Pixley, who +suggested running the compiler instead of searching the file system to +find include files and symbols, for more accurate results; Karl Berry, +who got Autoconf to configure TeX and added the macro index to the +documentation; and Ian Taylor, who added support for creating a C +header file as an alternative to putting `-D' options in a `Makefile', +so he could use Autoconf for his UUCP package. The alpha testers +cheerfully adjusted their files again and again as the names and +calling conventions of the Autoconf macros changed from release to +release. They all contributed many specific checks, great ideas, and +bug fixes. + + +File: autoconf.info, Node: Numbers, Next: Deuteronomy, Prev: Leviticus, Up: History + +Numbers +======= + + In July 1992, after months of alpha testing, I released Autoconf 1.0, +and converted many GNU packages to use it. I was surprised by how +positive the reaction to it was. More people started using it than I +could keep track of, including people working on software that wasn't +part of the GNU Project (such as TCL, FSP, and Kerberos V5). Autoconf +continued to improve rapidly, as many people using the `configure' +scripts reported problems they encountered. + + Autoconf turned out to be a good torture test for `m4' +implementations. UNIX `m4' started to dump core because of the length +of the macros that Autoconf defined, and several bugs showed up in GNU +`m4' as well. Eventually, we realized that we needed to use some +features that only GNU `m4' has. 4.3BSD `m4', in particular, has an +impoverished set of builtin macros; the System V version is better, but +still doesn't provide everything we need. + + More development occurred as people put Autoconf under more stresses +(and to uses I hadn't anticipated). Karl Berry added checks for X11. +david zuhn contributed C++ support. Franc,ois Pinard made it diagnose +invalid arguments. Jim Blandy bravely coerced it into configuring GNU +Emacs, laying the groundwork for several later improvements. Roland +McGrath got it to configure the GNU C Library, wrote the `autoheader' +script to automate the creation of C header file templates, and added a +`--verbose' option to `configure'. Noah Friedman added the +`--macrodir' option and `AC_MACRODIR' environment variable. (He also +coined the term "autoconfiscate" to mean "adapt a software package to +use Autoconf".) Roland and Noah improved the quoting protection in +`AC_DEFINE' and fixed many bugs, especially when I got sick of dealing +with portability problems from February through June, 1993. + + +File: autoconf.info, Node: Deuteronomy, Prev: Numbers, Up: History + +Deuteronomy +=========== + + A long wish list for major features had accumulated, and the effect +of several years of patching by various people had left some residual +cruft. In April 1994, while working for Cygnus Support, I began a major +revision of Autoconf. I added most of the features of the Cygnus +`configure' that Autoconf had lacked, largely by adapting the relevant +parts of Cygnus `configure' with the help of david zuhn and Ken +Raeburn. These features include support for using `config.sub', +`config.guess', `--host', and `--target'; making links to files; and +running `configure' scripts in subdirectories. Adding these features +enabled Ken to convert GNU `as', and Rob Savoye to convert DejaGNU, to +using Autoconf. + + I added more features in response to other peoples' requests. Many +people had asked for `configure' scripts to share the results of the +checks between runs, because (particularly when configuring a large +source tree, like Cygnus does) they were frustratingly slow. Mike +Haertel suggested adding site-specific initialization scripts. People +distributing software that had to unpack on MS-DOS asked for a way to +override the `.in' extension on the file names, which produced file +names like `config.h.in' containing two dots. Jim Avera did an +extensive examination of the problems with quoting in `AC_DEFINE' and +`AC_SUBST'; his insights led to significant improvements. Richard +Stallman asked that compiler output be sent to `config.log' instead of +`/dev/null', to help people debug the Emacs `configure' script. + + I made some other changes because of my dissatisfaction with the +quality of the program. I made the messages showing results of the +checks less ambiguous, always printing a result. I regularized the +names of the macros and cleaned up coding style inconsistencies. I +added some auxiliary utilities that I had developed to help convert +source code packages to use Autoconf. With the help of Franc,ois +Pinard, I made the macros not interrupt each others' messages. (That +feature revealed some performance bottlenecks in GNU `m4', which he +hastily corrected!) I reorganized the documentation around problems +people want to solve. And I began a testsuite, because experience had +shown that Autoconf has a pronounced tendency to regress when we change +it. + + Again, several alpha testers gave invaluable feedback, especially +Franc,ois Pinard, Jim Meyering, Karl Berry, Rob Savoye, and Ken Raeburn. + + Finally, version 2.0 was ready. And there was much rejoicing. (And +I have free time again. I think.) + diff --git a/src/util/autoconf/autoconf.info-5 b/src/util/autoconf/autoconf.info-5 new file mode 100644 index 000000000..b18e2b3dd --- /dev/null +++ b/src/util/autoconf/autoconf.info-5 @@ -0,0 +1,607 @@ +This is Info file autoconf.info, produced by Makeinfo-1.55 from the +input file ./autoconf.texi. + +START-INFO-DIR-ENTRY +* Autoconf: (autoconf). Create source code configuration scripts. +END-INFO-DIR-ENTRY + + This file documents the GNU Autoconf package for creating scripts to +configure source code packages using templates and an `m4' macro +package. + + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: autoconf.info, Node: Old Macro Names, Next: Environment Variable Index, Prev: History, Up: Top + +Old Macro Names +*************** + + In version 2 of Autoconf, most of the macros were renamed to use a +more uniform and descriptive naming scheme. Here are the old names of +the macros that were renamed, followed by the current names of those +macros. Although the old names are still accepted by the `autoconf' +program for backward compatibility, the old names are considered +obsolete. *Note Macro Names::, for a description of the new naming +scheme. + +`AC_ALLOCA' + `AC_FUNC_ALLOCA' + +`AC_ARG_ARRAY' + removed because of limited usefulness + +`AC_CHAR_UNSIGNED' + `AC_C_CHAR_UNSIGNED' + +`AC_CONST' + `AC_C_CONST' + +`AC_CROSS_CHECK' + `AC_C_CROSS' + +`AC_ERROR' + `AC_MSG_ERROR' + +`AC_FIND_X' + `AC_PATH_X' + +`AC_FIND_XTRA' + `AC_PATH_XTRA' + +`AC_FUNC_CHECK' + `AC_CHECK_FUNC' + +`AC_GCC_TRADITIONAL' + `AC_PROG_GCC_TRADITIONAL' + +`AC_GETGROUPS_T' + `AC_TYPE_GETGROUPS' + +`AC_GETLOADAVG' + `AC_FUNC_GETLOADAVG' + +`AC_HAVE_FUNCS' + `AC_CHECK_FUNCS' + +`AC_HAVE_HEADERS' + `AC_CHECK_HEADERS' + +`AC_HAVE_POUNDBANG' + `AC_SYS_INTERPRETER' (different calling convention) + +`AC_HEADER_CHECK' + `AC_CHECK_HEADER' + +`AC_HEADER_EGREP' + `AC_EGREP_HEADER' + +`AC_INLINE' + `AC_C_INLINE' + +`AC_LN_S' + `AC_PROG_LN_S' + +`AC_LONG_DOUBLE' + `AC_C_LONG_DOUBLE' + +`AC_LONG_FILE_NAMES' + `AC_SYS_LONG_FILE_NAMES' + +`AC_MAJOR_HEADER' + `AC_HEADER_MAJOR' + +`AC_MINUS_C_MINUS_O' + `AC_PROG_CC_C_O' + +`AC_MMAP' + `AC_FUNC_MMAP' + +`AC_MODE_T' + `AC_TYPE_MODE_T' + +`AC_OFF_T' + `AC_TYPE_OFF_T' + +`AC_PID_T' + `AC_TYPE_PID_T' + +`AC_PREFIX' + `AC_PREFIX_PROGRAM' + +`AC_PROGRAMS_CHECK' + `AC_CHECK_PROGS' + +`AC_PROGRAMS_PATH' + `AC_PATH_PROGS' + +`AC_PROGRAM_CHECK' + `AC_CHECK_PROG' + +`AC_PROGRAM_EGREP' + `AC_EGREP_CPP' + +`AC_PROGRAM_PATH' + `AC_PATH_PROG' + +`AC_REMOTE_TAPE' + removed because of limited usefulness + +`AC_RESTARTABLE_SYSCALLS' + `AC_SYS_RESTARTABLE_SYSCALLS' + +`AC_RETSIGTYPE' + `AC_TYPE_SIGNAL' + +`AC_RSH' + removed because of limited usefulness + +`AC_SETVBUF_REVERSED' + `AC_FUNC_SETVBUF_REVERSED' + +`AC_SET_MAKE' + `AC_PROG_MAKE_SET' + +`AC_SIZEOF_TYPE' + `AC_CHECK_SIZEOF' + +`AC_SIZE_T' + `AC_TYPE_SIZE_T' + +`AC_STAT_MACROS_BROKEN' + `AC_HEADER_STAT' + +`AC_STDC_HEADERS' + `AC_HEADER_STDC' + +`AC_STRCOLL' + `AC_FUNC_STRCOLL' + +`AC_ST_BLKSIZE' + `AC_STRUCT_ST_BLKSIZE' + +`AC_ST_BLOCKS' + `AC_STRUCT_ST_BLOCKS' + +`AC_ST_RDEV' + `AC_STRUCT_ST_RDEV' + +`AC_SYS_SIGLIST_DECLARED' + `AC_DECL_SYS_SIGLIST' + +`AC_TEST_CPP' + `AC_TRY_CPP' + +`AC_TEST_PROGRAM' + `AC_TRY_RUN' + +`AC_TIMEZONE' + `AC_STRUCT_TIMEZONE' + +`AC_TIME_WITH_SYS_TIME' + `AC_HEADER_TIME' + +`AC_UID_T' + `AC_TYPE_UID_T' + +`AC_UTIME_NULL' + `AC_FUNC_UTIME_NULL' + +`AC_VFORK' + `AC_FUNC_VFORK' + +`AC_VPRINTF' + `AC_FUNC_VPRINTF' + +`AC_WAIT3' + `AC_FUNC_WAIT3' + +`AC_WARN' + `AC_MSG_WARN' + +`AC_WORDS_BIGENDIAN' + `AC_C_BIGENDIAN' + +`AC_YYTEXT_POINTER' + `AC_DECL_YYTEXT' + + +File: autoconf.info, Node: Environment Variable Index, Next: Output Variable Index, Prev: Old Macro Names, Up: Top + +Environment Variable Index +************************** + + This is an alphabetical list of the environment variables that +Autoconf checks. + +* Menu: + +* AC_MACRODIR: Invoking autoupdate. +* AC_MACRODIR: Invoking autoscan. +* AC_MACRODIR: Invoking autoreconf. +* AC_MACRODIR: Invoking ifnames. +* AC_MACRODIR: Invoking autoheader. +* AC_MACRODIR: Invoking autoconf. +* CONFIG_FILES: Invoking config.status. +* CONFIG_HEADERS: Invoking config.status. +* CONFIG_SHELL: Invoking config.status. +* CONFIG_SITE: Site Defaults. +* CONFIG_STATUS: Invoking config.status. +* SIMPLE_BACKUP_SUFFIX: Invoking autoupdate. + + +File: autoconf.info, Node: Output Variable Index, Next: Preprocessor Symbol Index, Prev: Environment Variable Index, Up: Top + +Output Variable Index +********************* + + This is an alphabetical list of the variables that Autoconf can +substitute into files that it creates, typically one or more +`Makefile's. *Note Setting Output Variables::, for more information on +how this is done. + +* Menu: + +* ALLOCA: Particular Functions. +* AWK: Particular Programs. +* build: System Type Variables. +* build_alias: System Type Variables. +* build_cpu: System Type Variables. +* build_os: System Type Variables. +* build_vendor: System Type Variables. +* CC: Particular Programs. +* CC: UNIX Variants. +* CC: Particular Programs. +* CFLAGS: Preset Output Variables. +* CFLAGS: Particular Programs. +* configure_input: Preset Output Variables. +* CPP: Particular Programs. +* CPPFLAGS: Preset Output Variables. +* CXX: Particular Programs. +* CXXCPP: Particular Programs. +* CXXFLAGS: Preset Output Variables. +* CXXFLAGS: Particular Programs. +* DEFS: Preset Output Variables. +* exec_prefix: Preset Output Variables. +* host: System Type Variables. +* host_alias: System Type Variables. +* host_cpu: System Type Variables. +* host_os: System Type Variables. +* host_vendor: System Type Variables. +* INSTALL: Particular Programs. +* INSTALL_DATA: Particular Programs. +* INSTALL_PROGRAM: Particular Programs. +* KMEM_GROUP: Particular Functions. +* LDFLAGS: Preset Output Variables. +* LEX: Particular Programs. +* LEXLIB: Particular Programs. +* LEX_OUTPUT_ROOT: Particular Programs. +* LIBOBJS: Particular Functions. +* LIBOBJS: Particular Functions. +* LIBOBJS: Generic Functions. +* LIBOBJS: Structures. +* LIBS: UNIX Variants. +* LIBS: UNIX Variants. +* LIBS: Preset Output Variables. +* LN_S: Particular Programs. +* NEED_SETGID: Particular Functions. +* prefix: Preset Output Variables. +* program_transform_name: Transforming Names. +* RANLIB: Particular Programs. +* SET_MAKE: Output. +* srcdir: Preset Output Variables. +* subdirs: Subdirectories. +* target: System Type Variables. +* target_alias: System Type Variables. +* target_cpu: System Type Variables. +* target_os: System Type Variables. +* target_vendor: System Type Variables. +* top_srcdir: Preset Output Variables. +* X_CFLAGS: System Services. +* X_EXTRA_LIBS: System Services. +* X_LIBS: System Services. +* X_PRE_LIBS: System Services. +* YACC: Particular Programs. + + +File: autoconf.info, Node: Preprocessor Symbol Index, Next: Macro Index, Prev: Output Variable Index, Up: Top + +Preprocessor Symbol Index +************************* + + This is an alphabetical list of the C preprocessor symbols that the +Autoconf macros define. To work with Autoconf, C source code needs to +use these names in `#if' directives. + +* Menu: + +* CLOSEDIR_VOID: Particular Functions. +* const: Compiler Characteristics. +* C_ALLOCA: Particular Functions. +* DGUX: Particular Functions. +* DIRENT: Particular Headers. +* GETGROUPS_T: Particular Typedefs. +* GETLODAVG_PRIVILEGED: Particular Functions. +* gid_t: Particular Typedefs. +* HAVE_FUNCTION: Generic Functions. +* HAVE_HEADER: Generic Headers. +* HAVE_ALLOCA_H: Particular Functions. +* HAVE_CONFIG_H: Configuration Headers. +* HAVE_DIRENT_H: Particular Headers. +* HAVE_DOPRNT: Particular Functions. +* HAVE_GETMNTENT: Particular Functions. +* HAVE_LONG_DOUBLE: Compiler Characteristics. +* HAVE_LONG_FILE_NAMES: System Services. +* HAVE_MMAP: Particular Functions. +* HAVE_NDIR_H: Particular Headers. +* HAVE_RESTARTABLE_SYSCALLS: System Services. +* HAVE_STRCOLL: Particular Functions. +* HAVE_STRFTIME: Particular Functions. +* HAVE_ST_BLKSIZE: Structures. +* HAVE_ST_BLOCKS: Structures. +* HAVE_ST_RDEV: Structures. +* HAVE_SYS_DIR_H: Particular Headers. +* HAVE_SYS_NDIR_H: Particular Headers. +* HAVE_SYS_WAIT_H: Particular Headers. +* HAVE_TM_ZONE: Structures. +* HAVE_TZNAME: Structures. +* HAVE_UNISTD_H: Particular Headers. +* HAVE_UTIME_NULL: Particular Functions. +* HAVE_VFORK_H: Particular Functions. +* HAVE_VPRINTF: Particular Functions. +* HAVE_WAIT3: Particular Functions. +* inline: Compiler Characteristics. +* INT_16_BITS: Compiler Characteristics. +* LONG_64_BITS: Compiler Characteristics. +* MAJOR_IN_MKDEV: Particular Headers. +* MAJOR_IN_SYSMACROS: Particular Headers. +* mode_t: Particular Typedefs. +* NDIR: Particular Headers. +* NEED_MEMORY_H: Particular Headers. +* NEED_SETGID: Particular Functions. +* NLIST_NAME_UNION: Particular Functions. +* NLIST_STRUCT: Particular Functions. +* NO_MINUS_C_MINUS_O: Particular Programs. +* off_t: Particular Typedefs. +* pid_t: Particular Typedefs. +* RETSIGTYPE: Particular Typedefs. +* SETVBUF_REVERSED: Particular Functions. +* size_t: Particular Typedefs. +* STDC_HEADERS: Particular Headers. +* SVR4: Particular Functions. +* SYSDIR: Particular Headers. +* SYSNDIR: Particular Headers. +* SYS_SIGLIST_DECLARED: Particular Headers. +* TIME_WITH_SYS_TIME: Structures. +* TM_IN_SYS_TIME: Structures. +* uid_t: Particular Typedefs. +* UMAX: Particular Functions. +* UMAX4_3: Particular Functions. +* USG: Particular Headers. +* vfork: Particular Functions. +* VOID_CLOSEDIR: Particular Headers. +* WORDS_BIGENDIAN: Compiler Characteristics. +* YYTEXT_POINTER: Particular Programs. +* _ALL_SOURCE: UNIX Variants. +* _MINIX: UNIX Variants. +* _POSIX_1_SOURCE: UNIX Variants. +* _POSIX_SOURCE: UNIX Variants. +* _POSIX_SOURCE: UNIX Variants. +* _POSIX_VERSION: Particular Headers. +* __CHAR_UNSIGNED__: Compiler Characteristics. + + +File: autoconf.info, Node: Macro Index, Prev: Preprocessor Symbol Index, Up: Top + +Macro Index +*********** + + This is an alphabetical list of the Autoconf macros. To make the +list easier to use, the macros are listed without their preceding `AC_'. + +* Menu: + +* AIX: UNIX Variants. +* ALLOCA: Old Macro Names. +* ARG_ARRAY: Old Macro Names. +* ARG_ENABLE: Package Options. +* ARG_PROGRAM: Transforming Names. +* ARG_WITH: External Software. +* BEFORE: Suggested Ordering. +* CACHE_VAL: Caching Results. +* CANONICAL_HOST: Canonicalizing. +* CANONICAL_SYSTEM: Canonicalizing. +* CHAR_UNSIGNED: Old Macro Names. +* CHECKING: Printing Messages. +* CHECK_FUNC: Generic Functions. +* CHECK_FUNCS: Generic Functions. +* CHECK_HEADER: Generic Headers. +* CHECK_HEADERS: Generic Headers. +* CHECK_LIB: Libraries. +* CHECK_PROG: Generic Programs. +* CHECK_PROGS: Generic Programs. +* CHECK_SIZEOF: Compiler Characteristics. +* CHECK_TYPE: Generic Typedefs. +* COMPILE_CHECK: Examining Libraries. +* CONFIG_AUX_DIR: Input. +* CONFIG_HEADER: Configuration Headers. +* CONFIG_SUBDIRS: Subdirectories. +* CONST: Old Macro Names. +* CROSS_CHECK: Old Macro Names. +* C_BIGENDIAN: Compiler Characteristics. +* C_CHAR_UNSIGNED: Compiler Characteristics. +* C_CONST: Compiler Characteristics. +* C_CROSS: Test Programs. +* C_INLINE: Compiler Characteristics. +* C_LONG_DOUBLE: Compiler Characteristics. +* DECL_SYS_SIGLIST: Particular Headers. +* DECL_YYTEXT: Particular Programs. +* DEFINE: Defining Symbols. +* DEFINE_UNQUOTED: Defining Symbols. +* DEFUN: Macro Definitions. +* DIR_HEADER: Particular Headers. +* DYNIX_SEQ: UNIX Variants. +* EGREP_CPP: Examining Declarations. +* EGREP_HEADER: Examining Declarations. +* ENABLE: Package Options. +* ERROR: Old Macro Names. +* FIND_X: Old Macro Names. +* FIND_XTRA: Old Macro Names. +* FUNC_ALLOCA: Particular Functions. +* FUNC_CHECK: Old Macro Names. +* FUNC_CLOSEDIR_VOID: Particular Functions. +* FUNC_GETLOADAVG: Particular Functions. +* FUNC_GETMNTENT: Particular Functions. +* FUNC_MEMCMP: Particular Functions. +* FUNC_MMAP: Particular Functions. +* FUNC_SETVBUF_REVERSED: Particular Functions. +* FUNC_STRCOLL: Particular Functions. +* FUNC_STRFTIME: Particular Functions. +* FUNC_UTIME_NULL: Particular Functions. +* FUNC_VFORK: Particular Functions. +* FUNC_VPRINTF: Particular Functions. +* FUNC_WAIT3: Particular Functions. +* GCC_TRADITIONAL: Old Macro Names. +* GETGROUPS_T: Old Macro Names. +* GETLOADAVG: Old Macro Names. +* HAVE_FUNCS: Old Macro Names. +* HAVE_HEADERS: Old Macro Names. +* HAVE_LIBRARY: Libraries. +* HAVE_POUNDBANG: Old Macro Names. +* HEADER_CHECK: Old Macro Names. +* HEADER_DIRENT: Particular Headers. +* HEADER_EGREP: Old Macro Names. +* HEADER_MAJOR: Particular Headers. +* HEADER_STAT: Structures. +* HEADER_STDC: Particular Headers. +* HEADER_SYS_WAIT: Particular Headers. +* HEADER_TIME: Structures. +* INIT: Input. +* INLINE: Old Macro Names. +* INT_16_BITS: Compiler Characteristics. +* IRIX_SUN: UNIX Variants. +* ISC_POSIX: UNIX Variants. +* LANG_C: Language Choice. +* LANG_CPLUSPLUS: Language Choice. +* LANG_RESTORE: Language Choice. +* LANG_SAVE: Language Choice. +* LINK_FILES: Using System Type. +* LN_S: Old Macro Names. +* LONG_64_BITS: Compiler Characteristics. +* LONG_DOUBLE: Old Macro Names. +* LONG_FILE_NAMES: Old Macro Names. +* MAJOR_HEADER: Old Macro Names. +* MEMORY_H: Particular Headers. +* MINIX: UNIX Variants. +* MINUS_C_MINUS_O: Old Macro Names. +* MMAP: Old Macro Names. +* MODE_T: Old Macro Names. +* MSG_CHECKING: Printing Messages. +* MSG_ERROR: Printing Messages. +* MSG_RESULT: Printing Messages. +* MSG_WARN: Printing Messages. +* OBSOLETE: Obsolete Macros. +* OFF_T: Old Macro Names. +* OUTPUT: Output. +* PATH_PROG: Generic Programs. +* PATH_PROGS: Generic Programs. +* PATH_X: System Services. +* PATH_XTRA: System Services. +* PID_T: Old Macro Names. +* PREFIX: Old Macro Names. +* PREFIX_PROGRAM: Default Prefix. +* PREREQ: Versions. +* PROGRAMS_CHECK: Old Macro Names. +* PROGRAMS_PATH: Old Macro Names. +* PROGRAM_CHECK: Old Macro Names. +* PROGRAM_EGREP: Old Macro Names. +* PROGRAM_PATH: Old Macro Names. +* PROG_AWK: Particular Programs. +* PROG_CC: Particular Programs. +* PROG_CC_C_O: Particular Programs. +* PROG_CPP: Particular Programs. +* PROG_CXX: Particular Programs. +* PROG_CXXCPP: Particular Programs. +* PROG_GCC_TRADITIONAL: Particular Programs. +* PROG_INSTALL: Particular Programs. +* PROG_LEX: Particular Programs. +* PROG_LN_S: Particular Programs. +* PROG_MAKE_SET: Output. +* PROG_RANLIB: Particular Programs. +* PROG_YACC: Particular Programs. +* PROVIDE: Prerequisite Macros. +* REMOTE_TAPE: Old Macro Names. +* REPLACE_FUNCS: Generic Functions. +* REQUIRE: Prerequisite Macros. +* REQUIRE_CPP: Language Choice. +* RESTARTABLE_SYSCALLS: Old Macro Names. +* RETSIGTYPE: Old Macro Names. +* REVISION: Versions. +* RSH: Old Macro Names. +* SCO_INTL: UNIX Variants. +* SETVBUF_REVERSED: Old Macro Names. +* SET_MAKE: Old Macro Names. +* SIZEOF_TYPE: Old Macro Names. +* SIZE_T: Old Macro Names. +* STAT_MACROS_BROKEN: Structures. +* STAT_MACROS_BROKEN: Old Macro Names. +* STDC_HEADERS: Old Macro Names. +* STRCOLL: Old Macro Names. +* STRUCT_ST_BLKSIZE: Structures. +* STRUCT_ST_BLOCKS: Structures. +* STRUCT_ST_RDEV: Structures. +* STRUCT_TIMEZONE: Structures. +* STRUCT_TM: Structures. +* ST_BLKSIZE: Old Macro Names. +* ST_BLOCKS: Old Macro Names. +* ST_RDEV: Old Macro Names. +* SUBST: Setting Output Variables. +* SUBST_FILE: Setting Output Variables. +* SYS_INTERPRETER: System Services. +* SYS_LONG_FILE_NAMES: System Services. +* SYS_RESTARTABLE_SYSCALLS: System Services. +* SYS_SIGLIST_DECLARED: Old Macro Names. +* TEST_CPP: Old Macro Names. +* TEST_PROGRAM: Old Macro Names. +* TIMEZONE: Old Macro Names. +* TIME_WITH_SYS_TIME: Old Macro Names. +* TRY_COMPILE: Examining Syntax. +* TRY_CPP: Examining Declarations. +* TRY_LINK: Examining Libraries. +* TRY_RUN: Test Programs. +* TYPE_GETGROUPS: Particular Typedefs. +* TYPE_MODE_T: Particular Typedefs. +* TYPE_OFF_T: Particular Typedefs. +* TYPE_PID_T: Particular Typedefs. +* TYPE_SIGNAL: Particular Typedefs. +* TYPE_SIZE_T: Particular Typedefs. +* TYPE_UID_T: Particular Typedefs. +* UID_T: Old Macro Names. +* UNISTD_H: Particular Headers. +* USG: Particular Headers. +* UTIME_NULL: Old Macro Names. +* VERBOSE: Printing Messages. +* VFORK: Old Macro Names. +* VPRINTF: Old Macro Names. +* WAIT3: Old Macro Names. +* WARN: Old Macro Names. +* WITH: External Software. +* WORDS_BIGENDIAN: Old Macro Names. +* XENIX_DIR: UNIX Variants. +* YYTEXT_POINTER: Old Macro Names. + + diff --git a/src/util/autoconf/autoconf.m4 b/src/util/autoconf/autoconf.m4 new file mode 100644 index 000000000..2b1743559 --- /dev/null +++ b/src/util/autoconf/autoconf.m4 @@ -0,0 +1,27 @@ +dnl Driver that loads the Autoconf macro files. +dnl Requires GNU m4. +dnl This file is part of Autoconf. +dnl Copyright (C) 1994 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl +dnl Written by David MacKenzie. +dnl +include(acgeneral.m4)dnl +builtin(include, acspecific.m4)dnl +builtin(include, acoldnames.m4)dnl +dnl Do not sinclude acsite.m4 here, because it may not be installed +dnl yet when Autoconf is frozen. +dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen. diff --git a/src/util/autoconf/autoconf.sh b/src/util/autoconf/autoconf.sh index d5f490a75..5ae95c710 100644 --- a/src/util/autoconf/autoconf.sh +++ b/src/util/autoconf/autoconf.sh @@ -20,20 +20,16 @@ # With one arg, create a configure script on standard output from # the given template file. -usage="Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] - [--recur] [--topdir=dir] - [-v] [--version] [template-file]" - -# Note that for now, the only arguments passed down by --recur are: -# --macrodir (-m) (modified if needed) -# --topdir (modified or synthesized if needed) -# They're the only ones that make sense. +usage="\ +Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] + [-l dir] [--localdir=dir] [--version] [template-file]" # NLS nuisances. +# Only set `LANG' and `LC_ALL' to "C" if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ test -z "${M4}" && M4=@M4@ @@ -44,80 +40,83 @@ case "${M4}" in esac tmpout=/tmp/acout.$$ -recur=false -set_topdir="-DAC_TOPDIR=" +localdir= +show_version=no -print_version= while test $# -gt 0 ; do - case "z${1}" in - z-h | z--help | z--h* ) + case "${1}" in + -h | --help | --h* ) echo "${usage}" 1>&2; exit 0 ;; - z--macrodir=* | z--m*=* ) - AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + --localdir=* | --l*=* ) + localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" shift ;; - z-m | z--macrodir | z--m* ) + -l | --localdir | --l*) shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - AC_MACRODIR="${1}" + localdir="${1}" shift ;; - z--topdir=* ) - AC_TOPDIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" - set_topdir="-DAC_TOPDIR=${AC_TOPDIR}" + --macrodir=* | --m*=* ) + AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" shift ;; - z--topdir ) + -m | --macrodir | --m* ) shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - AC_TOPDIR="${1}" - set_topdir="-DAC_TOPDIR=${AC_TOPDIR}" - shift ;; - z-v | z--version | z--v* ) - print_version="-DAC_PRINT_VERSION" - infile=/dev/null tmpout=/dev/null + AC_MACRODIR="${1}" shift ;; - z--recur ) - recur=true - shift ;; - z-- ) # Stop option processing + --version | --v* ) + show_version=yes; shift ;; + -- ) # Stop option processing shift; break ;; - z- ) # Use stdin as input. + - ) # Use stdin as input. break ;; - z-* ) + -* ) echo "${usage}" 1>&2; exit 1 ;; * ) break ;; esac done -if test -z "$print_version"; then - case $# in - 0) infile=configure.in ;; - 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; - esac - - trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 - - if test z$infile = z-; then - tmpin=/tmp/acin.$$ - infile=$tmpin - cat > $infile - elif test ! -s "${infile}"; then - echo "autoconf: ${infile}: No such file or directory" >&2 - exit 1 - fi +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 fi -MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" -test -r ${AC_MACRODIR}/aclocal.m4 \ - && MACROFILES="${MACROFILES} ${AC_MACRODIR}/aclocal.m4" -test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" -test -r ${AC_TOPDIR}/aclocal.m4 && MACROFILES="${MACROFILES} ${AC_TOPDIR}/aclocal.m4" -MACROFILES="${print_version} ${MACROFILES}" +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + +tmpin=/tmp/acin.$$ # Always set this, to avoid bogus errors from some rm's. +if test z$infile = z-; then + infile=$tmpin + cat > $infile +elif test ! -r "$infile"; then + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 +fi -# echo "running: $M4 $set_topdir $MACROFILES $infile" -$M4 $set_topdir $MACROFILES $infile > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; } +if test -n "$localdir"; then + use_localdir="-I$localdir -DAC_LOCALDIR=$localdir" +else + use_localdir= +fi -test -n "$print_version" && exit 0 +# Use the frozen version of Autoconf if available. +r= f= +# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +case `$M4 --help < /dev/null 2>&1` in +*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;; +*traditional*) ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +esac + +$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 @@ -134,43 +133,20 @@ if grep "${pattern}" $tmpout > /dev/null 2>&1; then status=1 fi -case $# in - 0) cat $tmpout > configure; chmod +x configure ;; - 1) cat $tmpout ;; -esac - -rm -f $tmpout - -case $0 in - /*) autoconf=$0 ;; - */*) autoconf=../$0 ;; - *) autoconf=$0 ;; -esac -# echo "autoconf=$autoconf" +if test $# -eq 0; then + exec 4> configure; chmod +x configure +else + exec 4>&1 +fi -case $AC_TOPDIR in - "") topdown=.. ;; - /*) topdown=$AC_TOPDIR ;; - *) topdown=../$AC_TOPDIR ;; -esac -# echo "topdown=$topdown" +# Put the real line numbers into configure to make config.log more helpful. +awk ' +/__oline__/ { printf "%d:", NR + 1 } + { print } +' $tmpout | sed ' +/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__\(.*\)$/\2\1\3/ +' >&4 -case $AC_MACRODIR in - "") macdown= ;; - /*) macdown=--macrodir=$AC_MACRODIR ;; - *) macdown=--macrodir=../$AC_MACRODIR ;; -esac -# echo "macdown=$macdown" - -if $recur ; then - for i in *; do - if [ -d $i ] ; then - if [ -r $i/configure.in ] ; then - echo "cd $i; $autoconf --recur --topdir=$topdown $macdown" - (cd $i; $autoconf --recur --topdir=$topdown $macdown) - fi - fi - done -fi +rm -f $tmpout exit $status diff --git a/src/util/autoconf/autoconf.texi b/src/util/autoconf/autoconf.texi index 230218214..a6383703c 100644 --- a/src/util/autoconf/autoconf.texi +++ b/src/util/autoconf/autoconf.texi @@ -6,9 +6,9 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 1.11 -@set VERSION 1.11 -@set UPDATED May 1994 +@set EDITION 1.126 +@set VERSION 1.126 +@set UPDATED October 1994 @iftex @finalout @@ -17,7 +17,7 @@ @ifinfo @format START-INFO-DIR-ENTRY -* autoconf: (autoconf). The Autoconf configuration system. +* Autoconf: (autoconf). Create source code configuration scripts. END-INFO-DIR-ENTRY @end format @@ -51,10 +51,11 @@ by the Foundation. @titlepage @title Autoconf -@subtitle Generating Automatic Configuration Scripts +@subtitle Creating Automatic Configuration Scripts @subtitle Edition @value{EDITION}, for Autoconf version @value{VERSION} @subtitle @value{UPDATED} -@author by David MacKenzie, Roland McGrath, and Noah Friedman +@author by David MacKenzie +@c I think I've rewritten all of Noah and Roland's contributions by now. @page @vskip 0pt plus 1filll @@ -75,6 +76,12 @@ except that this permission notice may be stated in a translation approved by the Foundation. @end titlepage +@c Define an environment variable index. +@defcodeindex ev +@c Define an output variable index. +@defcodeindex ov +@c Define a CPP variable index. +@defcodeindex cv @c Define a macro index that @@defmac doesn't write to. @defcodeindex ma @@ -91,96 +98,215 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. @c The master menu, created with texinfo-master-menu, goes here. @menu -* Introduction:: Autoconf's purpose, strengths, and weaknesses. -* Distributing:: Legal restrictions on Autoconf output. -* Making configure Scripts:: How to organize and produce Autoconf scripts. -* Specific Tests:: Macros that check for particular features. -* General Purpose Macros:: Macros that check for kinds of features. -* Writing Macros:: How to add your own macros to Autoconf. -* Makefiles:: Information Autoconf uses in @file{Makefile}s. -* Invoking configure:: How to use the Autoconf output. -* Example:: Sample Autoconf input files. -* Preprocessor Symbol Index:: Index of C preprocessor symbols defined. -* Macro Index:: Index of Autoconf macros. +* Introduction:: Autoconf's purpose, strengths, and weaknesses. +* Making configure Scripts:: How to organize and produce Autoconf scripts. +* Setup:: Initialization and output. +* Existing Tests:: Macros that check for particular features. +* Writing Tests:: How to write new feature checks. +* Results:: What to do with results from feature checks. +* Writing Macros:: Adding new macros to Autoconf. +* Manual Configuration:: Selecting features that can't be guessed. +* Site Configuration:: Local defaults for @code{configure}. +* Invoking configure:: How to use the Autoconf output. +* Invoking config.status:: Recreating a configuration. +* Questions:: Questions about Autoconf, with answers. +* Upgrading:: Tips for upgrading from version 1. +* History:: History of Autoconf. +* 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. +* Macro Index:: Index of Autoconf macros. --- The Detailed Node Listing --- Making @code{configure} Scripts * 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 autoheader:: How to create configuration header files. +* Invoking autoreconf:: Remaking multiple @code{configure} scripts. + +Initialization and Output Files + +* Input:: Where Autoconf should find 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. +* Default Prefix:: Changing the default installation prefix. +* Versions:: Version numbers in @code{configure}. + +Substitutions in Makefiles + +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Compiling in a different directory. +* Automatic Remaking:: Makefile rules for configuring. + +Configuration Header Files + +* Header Templates:: Input for the configuration headers. +* Invoking autoheader:: How to create configuration templates. -Specific Tests +Existing Tests * Alternative Programs:: Selecting between alternative programs. -* Header Files:: Header files that might be missing. -* Typedefs:: @code{typedef}s that might be missing. +* 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 cases for specific UNIX variants. +* UNIX Variants:: Special kludges for specific UNIX variants. -General Purpose Macros +Alternative Programs -* Setup:: Controlling Autoconf operation. -* General Feature Tests:: Checking for kinds of features. -* Command Line:: Checking command line arguments. -* Setting Variables:: Setting shell and @code{make} variables. -* Printing Messages:: Notifying users of progress or problems. +* Particular Programs:: Special handling to find certain programs. +* Generic Programs:: How to find other programs. + +Library Functions + +* Particular Functions:: Special handling to find certain functions. +* Generic Functions:: How to find other functions. + +Header Files + +* Particular Headers:: Special handling to find certain headers. +* Generic Headers:: How to find other headers. + +Typedefs + +* Particular Typedefs:: Special handling to find certain types. +* Generic Typedefs:: How to find other types. + +Writing Tests + +* 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. +* Portable Shell:: Shell script portability pitfalls. +* Testing Values and Files:: Checking strings and files. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. -* Macro Ordering:: Enforcing ordering constraints. + +Checking Run Time Behavior + +* Test Programs:: Running 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. +* 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. Writing Macros -* Macro Format:: 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. -* Checking for Files:: Finding whether a file exists. -* Checking for Symbols:: Finding whether a symbol is defined. -* Test Programs:: Writing programs to test for features. -* Multiple Cases:: Tests for several possible values. Dependencies Between Macros * Prerequisite Macros:: Ensuring required information. * Suggested Ordering:: Warning about possible ordering problems. +* Obsolete Macros:: Warning about old ways of doing things. -Test Programs +Manual Configuration -* Guidelines:: General rules for writing test programs. -* Tricks:: Special ways to work around problems. +* Specifying Names:: Specifying the system type. +* Canonicalizing:: Getting the canonical system type. +* System Type Variables:: Variables containing the system type. +* Using System Type:: What to do with the system type. -Makefiles +Site Configuration -* Predefined Variables:: Heavily used @code{make} variables. -* Installation Prefixes:: A special variable substitution. -* VPATH Substitutions:: Compiling in a different directory. -* Automatic Remaking:: Makefile rules for configuring. +* External Software:: Working with other optional software. +* Package Options:: Selecting optional features. +* Site Details:: Configuring site details. +* Transforming Names:: Changing program names when installing. +* Site Defaults:: Giving @code{configure} local defaults. -Running @code{configure} Scripts +Transforming Program Names When Installing -* Overriding variables:: Workarounds for unusual systems. -* Invoking config.status:: Recreating a configuration. +* Transformation Options:: @code{configure} options to transforme names. +* Transformation Examples:: Sample uses of transforming names. +* Transformation Rules:: @file{Makefile} uses of transforming names. -An Example +Running @code{configure} Scripts -* Sample configure.in:: An example of a @file{configure} template. -* Sample Makefile.in:: An example of a @file{Makefile} template. +* Basic Installation:: Instructions for typical cases. +* Compilers and Options:: Selecting compilers and optimization. +* Build Directory:: Configuring in a different directory. +* Installation Names:: Installing in different directories. +* Optional Features:: Selecting optional features. +* System Type:: Specifying the system type. +* Sharing Defaults:: Setting site-wide defaults for @code{configure}. +* Operation Controls:: Changing how @code{configure} runs. + +Questions About Autoconf + +* Distributing:: Distributing @code{configure} scripts. +* Why GNU m4:: Why not use the standard @code{m4}? +* Bootstrapping:: Autoconf and GNU @code{m4} require each other? +* Why Not Imake:: Why GNU uses @code{configure} instead of Imake. + +Upgrading From Version 1 + +* Changed File Names:: Files you might rename. +* Changed Makefiles:: New things to put in @file{Makefile.in}. +* Changed Macros:: Macro calls you might replace. +* Invoking autoupdate:: Replacing old macro names in @code{configure.in}. +* Changed Results:: Changes in how to check test results. +* Changed Macro Writing:: Better ways to write your own macros. + +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. @end menu -@node Introduction, Distributing, Top, Top +@node Introduction, Making configure Scripts, Top, Top @chapter Introduction +@display +A physicist, an engineer, and a computer scientist were +discussing the nature of God. Surely a Physicist, said the +physicist, because early in the Creation, God made Light; and you +know, Maxwell's equations, the dual nature of electro-magnetic +waves, the relativist consequences@dots{} An Engineer!, said the +engineer, because before making Light, God split the Chaos into +Land and Water; it takes a hell of an engineer to handle that big +amount of mud, and orderly separation of solids from +liquids@dots{} The computer scientist shouted: And the Chaos, +where do you think it was coming from, hmm? + +---Anonymous +@end display +@c (via Franc,ois Pinard) + Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. The configuration scripts produced by Autoconf are independent of Autoconf when they are run, so their users do not need to have Autoconf. -The configuration scripts produced by Autoconf normally require no -manual user intervention when run; they do not even take an argument +The configuration scripts produced by Autoconf require no manual user +intervention when run; they do not normally even need an argument specifying the system type. Instead, they test for the presence of each feature that the software package they are for might need individually. (Before each check, they print a one-line message stating what they are @@ -191,25 +317,27 @@ need to maintain files that list the features supported by each release of each variant of UNIX. For each software package that Autoconf is used with, it creates a -configuration script from a template file that lists the operating -system features that the package can use. After the shell code to -recognize and respond to an operating system feature has been written, +configuration script from a template file that lists the +system features that the package needs or can use. After the shell code to +recognize and respond to a system feature has been written, Autoconf allows it to be shared by many software packages that can use (or need) that feature. If it later turns out that the shell code needs adjustment for some reason, it needs to be changed in only one -place; all of the the configuration scripts can be regenerated +place; all of the configuration scripts can be regenerated automatically to take advantage of the updated code. -Larry Wall's Metaconfig package is similar in purpose to Autoconf, but -is more general. The scripts it produces require manual user -intervention, which is quite inconvenient when configuring large source -trees. +The Metaconfig package is similar in purpose to Autoconf, but +the scripts it produces require manual user intervention, which is quite +inconvenient when configuring large source trees. Unlike Metaconfig +scripts, Autoconf scripts can support cross-compiling, if some care is +taken in writing them. -Unlike Metaconfig scripts, Autoconf scripts can support cross-compiling, -if some care is taken in writing them. They should avoid executing test -programs, since test programs compiled with a cross-compiler can not be -executed on the host system. Also, they shouldn't do anything that -tests features of the host system instead of the target system. +There are several jobs related to making portable software packages +that Autoconf currently does not do. Among these are automatically +creating @file{Makefile} files with all of the standard targets, and +supplying replacements for standard library functions and header files on +systems that lack them. Work is in progress to add those features in +the future. Autoconf imposes some restrictions on the names of macros used with @code{#ifdef} in C programs (@pxref{Preprocessor Symbol Index}). @@ -217,101 +345,72 @@ Autoconf imposes some restrictions on the names of macros used with Autoconf requires GNU @code{m4} in order to generate the scripts. It uses features that some UNIX versions of @code{m4} do not have. It also overflows internal limits of some versions of @code{m4}, including GNU -@code{m4} 1.0; so use a later version of GNU @code{m4}. - -Autoconf does not work well with GNU C library releases before 1.06. -The GNU C library contains stubs (which always return an error) for -functions that are not available instead of omitting them from the -library. As a result, Autoconf scripts are fooled into thinking that -those functions are available. This problem does not exist with -releases 1.06 and later of the GNU C library, which define C -preprocessor macros that the Autoconf macros @code{AC_FUNC_CHECK} and -@code{AC_REPLACE_FUNCS} test, indicating that certain functions are -stubs (@pxref{General Feature Tests}, for more information on checking for -functions). +@code{m4} 1.0. You must use version 1.1 or later of GNU @code{m4}. +Using version 1.3 or later will be much faster than 1.1 or 1.2. -@ifinfo -Autoconf was written by David MacKenzie, with help from Franc,ois -@end ifinfo -@tex -Autoconf was written by David MacKenzie, with help from Fran\c cois -@end tex -Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, Roland McGrath, -Noah Friedman, and david d zuhn. It was inspired by Brian Fox's -automatic configuration system for Bash, by Larry Wall's Metaconfig, and -by Richard Stallman, Richard Pixley, and John Gilmore's configuration -tools for the GNU compiler and object file utilities. +@xref{Upgrading}, for information about upgrading from version 1. +@xref{History}, for the story of Autoconf's development. +@xref{Questions}, for answers to some common questions about Autoconf. Mail suggestions and bug reports for Autoconf to @code{bug-gnu-utils@@prep.ai.mit.edu}. Please include the Autoconf version number, which you can get by running @samp{autoconf --version}. -@node Distributing, Making configure Scripts, Introduction, Top -@chapter Distributing Autoconf Output - -The configuration scripts that Autoconf produces are covered by the GNU -General Public License. This is because they consist almost entirely of -parts of Autoconf itself, rearranged somewhat, and Autoconf is -distributed under the terms of the GPL. As applied to Autoconf, the GPL -just means that you need to distribute @file{configure.in}, and -@file{aclocal.m4}, @file{acconfig.h}, and @file{@var{config}.h.top} and -@file{@var{config}.h.bot} if you use them, along with @file{configure}. - -Programs that use Autoconf scripts to configure themselves do not -automatically come under the GPL. Distributing an Autoconf -configuration script as part of a program is considered to be @emph{mere -aggregation} of that work with the Autoconf script. Such programs are -not derivative works based on Autoconf; only their configuration scripts -are. We still encourage software authors to distribute their work under -terms like those of the GPL, but doing so is not required to use -Autoconf. - -@node Making configure Scripts, Specific Tests, Distributing, Top +@node Making configure Scripts, Setup, Introduction, Top @chapter Making @code{configure} Scripts The configuration scripts that Autoconf produces are by convention called @code{configure}. When run, @code{configure} creates several -files, replacing configuration parameters in them with values -appropriate for the system being configured. The files that -@code{configure} creates are: +files, replacing configuration parameters in them with appropriate +values. The files that @code{configure} creates are: @itemize @bullet @item -one or more @file{Makefile} files (one in each subdirectory of the -package), from template @file{Makefile.in} files (@pxref{Makefiles}); +one or more @file{Makefile} files, one in each subdirectory of the +package (@pxref{Makefile Substitutions}); @item optionally, a C header file, the name of which is configurable, -containing @code{#define} statements (@pxref{Setup}); +containing @code{#define} directives (@pxref{Configuration Headers}); @item a shell script called @file{config.status} that, when run, will recreate -the files listed above (@pxref{Invoking config.status}). +the files listed above (@pxref{Invoking config.status}); + +@item +a shell script called @file{config.cache} that saves the results of +running many of the tests (@pxref{Cache Files}); + +@item +a file called @file{config.log} containing any messages produced by +compilers, to help debugging if @code{configure} makes a mistake. @end itemize To create a @code{configure} script with Autoconf, you need to write an -Autoconf input file (@file{configure.in}) and run Autoconf on it to -produce the script. If you write your own feature tests to supplement -those that come with Autoconf, you might also write a file called -@file{aclocal.m4}. If you use a C header file to contain @code{#define} -directives, you might also write @file{config.h.top}, -@file{config.h.bot}, and @file{acconfig.h}, and you will distribute the -Autoconf-generated file @file{config.h.in} with the package. +Autoconf input file @file{configure.in} and run @code{autoconf} on it. +If you write your own feature tests to supplement those that come with +Autoconf, you might also write files called @file{aclocal.m4} and +@file{acsite.m4}. If you use a C header file to contain @code{#define} +directives, you might also write @file{acconfig.h}, and you will +distribute the Autoconf-generated file @file{config.h.in} with the +package. Here is a diagram showing how the files that can be used in configuration are produced. Programs that are executed are suffixed by @samp{*}. Optional files are enclosed in square brackets (@samp{[]}). -@code{autoconf} and @code{autoheader} also read the installed files -@file{acgeneral.m4} and @file{acspecific.m4}, and also an installed -@file{aclocal.m4} if it exists. +@code{autoconf} and @code{autoheader} also read the installed Autoconf +macro files (by reading @file{autoconf.m4}). @noindent Files used in preparing a software package for distribution: @example @group +your source files --> [autoscan*] --> [configure.scan] --> configure.in + configure.in --. .------> autoconf* -----> configure +---+ -[aclocal.m4] --' `---. +[aclocal.m4] --+ `---. +[acsite.m4] ---' | +--> [autoheader*] -> [config.h.in] [acconfig.h] ----. | +-----' @@ -326,7 +425,8 @@ Makefile.in -------------------------------> Makefile.in Files used in configuring a software package: @example @group -configure* ------------. + .-------------> config.cache +configure* ------------+-------------> config.log | [config.h.in] -. v .-> [config.h] -. +--> config.status* -+ +--> make* @@ -336,56 +436,76 @@ Makefile.in ---' `-> Makefile ---' @menu * 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 autoheader:: How to create configuration header files. +* Invoking autoreconf:: Remaking multiple @code{configure} scripts. @end menu -@node Writing configure.in, Invoking autoconf, , Making configure Scripts +@node Writing configure.in, Invoking autoscan, , Making configure Scripts @section Writing @file{configure.in} To produce a @code{configure} script for a software package, create a file called @file{configure.in} that contains invocations of the Autoconf macros that test the system features your package needs or can use. Autoconf macros already exist to check for many features; see -@ref{Specific Tests}, for their descriptions. For most other +@ref{Existing Tests}, for their descriptions. For most other features, you can use Autoconf template macros to produce custom checks; -see @ref{General Feature Tests}, for information about them. For especially +see @ref{Writing Tests}, for information about them. For especially tricky or specialized features, @file{configure.in} might need to -contain some hand-crafted shell commands. @xref{Writing Macros}, for -guidelines on writing tests from scratch. - -Every @file{configure.in} must begin with a call to @code{AC_INIT} and -end with a call to @code{AC_OUTPUT} (@pxref{Setup}). Other than that, -the order in which @file{configure.in} calls the Autoconf macros is -generally not important, except that some macros rely on other macros -having been called first, because they check previously set values of -some variables to decide what to do. These macros are noted in the -individual descriptions (@pxref{Specific Tests}). +contain some hand-crafted shell commands. The @code{autoscan} +program can give you a good start in writing @file{configure.in} +(@pxref{Invoking autoscan}, for more information). + +The order in which @file{configure.in} calls the Autoconf macros +is not important, with a few exceptions. Every +@file{configure.in} must contain a call to @code{AC_INIT} before +the checks, and a call to @code{AC_OUTPUT} at the end +(@pxref{Output}). Additionally, some macros rely on other macros +having been called first, because they check previously set +values of some variables to decide what to do. These macros are +noted in the individual descriptions (@pxref{Existing Tests}), +and they also warn you when creating @code{configure} if they are +called out of order. To encourage consistency, here is a suggested order for calling the -Autoconf macros. A few macros need to be called in a different order -from the one given here; they are noted in their individual descriptions -(@pxref{Specific Tests}). Note that there must not be any space -between the macro name and the open parentheses. +Autoconf macros. Generally speaking, the things near the end of this +list could depend on things earlier in it. For example, library +functions could be affected by typedefs and libraries. @display @group @code{AC_INIT(@var{file})} -checks for alternative programs -checks for UNIX variants that set C preprocessor variables +checks for programs +checks for libraries checks for header files checks for typedefs -checks for library functions checks for structures checks for compiler characteristics +checks for library functions checks for system services -other checks for UNIX variants @code{AC_OUTPUT(@r{[}@var{file@dots{}}@r{]})} @end group @end display +When calling macros that take arguments, there must not be any blank +space between the macro name and the open parenthesis. Arguments can be +more than one line long if they are enclosed within the @code{m4} quote +characters @samp{[} and @samp{]}. If you have a long line such as a +list of file names, you can generally use a backslash at the end of a +line to continue it logically on the next line (this is implemented by +the shell, not by anything special that Autoconf does). + +Some macros handle two cases: what to do if the given condition is met, +and what to do if the condition is not met. In some places you might +want to do something if a condition is true but do nothing if it's +false, or vice versa. To omit the true case, pass an empty value for +the @var{action-if-found} argument to the macro. To omit the false +case, omit the @var{action-if-not-found} argument to the macro, +including the comma before it. + You can include comments in @file{configure.in} files by starting them -with the @code{m4} predefined macro @code{dnl}, which discards text up +with the @code{m4} builtin macro @code{dnl}, which discards text up through the next newline. These comments do not appear in the generated @code{configure} scripts. For example, it is helpful to begin @file{configure.in} files with a line like this: @@ -394,567 +514,1151 @@ through the next newline. These comments do not appear in the generated dnl Process this file with autoconf to produce a configure script. @end example -@xref{Sample configure.in}, for an example of a real @file{configure.in} -script. +@node Invoking autoscan, Invoking ifnames, Writing configure.in, Making configure Scripts +@section Using @code{autoscan} to Create @file{configure.in} + +The @code{autoscan} program can help you create a @file{configure.in} +file for a software package. @code{autoscan} examines source files in +the directory tree rooted at a directory given as a command line +argument, or the current directory if none is given. It searches the +source files for common portability problems and creates a file +@file{configure.scan} which is a preliminary @file{configure.in} for +that package. + +You should manually examine @file{configure.scan} before renaming it to +@file{configure.in}; it will probably need some adjustments. +Occasionally @code{autoscan} outputs a macro in the wrong order relative +to another macro, so that @code{autoconf} produces a warning; you need +to move such macros manually. Also, if you want the package to use a +configuration header file, you must add a call to +@code{AC_CONFIG_HEADER} (@pxref{Configuration Headers}). You might also +have to change or add some @code{#if} directives to your program in +order to make it work with Autoconf (@pxref{Invoking ifnames}, for +information about a program that can help with that job). + +@code{autoscan} uses several data files, which are installed along with the +distributed Autoconf macro files, to determine which macros to output +when it finds particular symbols in a package's source files. These +files all have the same format. Each line consists of a symbol, +whitespace, and the Autoconf macro to output if that symbol is +encountered. Lines starting with @samp{#} are comments. + +@code{autoscan} is only installed if you already have Perl installed. +@code{autoscan} accepts the following options: + +@table @code +@item --help +Print a summary of the command line options and exit. + +@item --macrodir=@var{dir} +@evindex AC_MACRODIR +Look for the data files in directory @var{dir} instead of the default +installation directory. You can also set the @code{AC_MACRODIR} +environment variable to a directory; this option overrides the +environment variable. + +@item --verbose +Print the names of the files it examines and the potentially interesting +symbols it finds in them. This output can be voluminous. + +@item --version +Print the version number of Autoconf and exit. +@end table + +@node Invoking ifnames, Invoking autoconf, Invoking autoscan, Making configure Scripts +@section Using @code{ifnames} to List Conditionals + +@code{ifnames} can help when writing a @file{configure.in} for a +software package. It prints the identifiers that the package already +uses in C preprocessor conditionals. If a package has already been set +up to have some portability, this program can help you figure out what +its @code{configure} needs to check for. It may help fill in some gaps +in a @file{configure.in} generated by @code{autoscan} (@pxref{Invoking +autoscan}). -@node Invoking autoconf, Invoking autoheader, Writing configure.in, Making configure Scripts -@section Invoking @code{autoconf} +@code{ifnames} scans all of the C source files named on the command line +(or the standard input, if none are given) and writes to the standard +output a sorted list of all the identifiers that appear in those files +in @code{#if}, @code{#elif}, @code{#ifdef}, or @code{#ifndef} +directives. It prints each identifier on a line, followed by a +space-separated list of the files in which that identifier occurs. + +@noindent +@code{ifnames} accepts the following options: + +@table @code +@item --help +@itemx -h +Print a summary of the command line options and exit. + +@item --macrodir=@var{dir} +@itemx -m @var{dir} +@evindex AC_MACRODIR +Look for the Autoconf macro files in directory @var{dir} instead of the +default installation directory. Only used to get the version number. +You can also set the @code{AC_MACRODIR} +environment variable to a directory; this option overrides the +environment variable. + +@item --version +Print the version number of Autoconf and exit. +@end table + +@node Invoking autoconf, Invoking autoreconf, Invoking ifnames, Making configure Scripts +@section Using @code{autoconf} to Create @code{configure} To create @code{configure} from @file{configure.in}, run the @code{autoconf} program with no arguments. @code{autoconf} processes @file{configure.in} with the @code{m4} macro processor, using the Autoconf macros. If you give @code{autoconf} an argument, it reads that file instead of @file{configure.in} and writes the configuration script -to the standard output instead of to @file{configure}. If you give +to the standard output instead of to @code{configure}. If you give @code{autoconf} the argument @samp{-}, it reads the standard input instead of @file{configure.in} and writes the configuration script on the standard output. -The Autoconf macros are defined in two or more files. Two of the files -are distributed with Autoconf: @code{autoconf} first reads -@file{acgeneral.m4} (@pxref{General Purpose Macros}), then -@file{acspecific.m4} (@pxref{Specific Tests}). After reading them, -@code{autoconf} looks for an optional file called @file{aclocal.m4}, -first in the directory that contains other installed Autoconf macro -files, and then in the current directory. If both files exist, it uses -both of them. Those files can contain your site's own locally written -Autoconf macro definitions (@pxref{Writing Macros}, for more -information). If a macro is defined in more than one of the files that -@code{autoconf} reads, the last definition it reads overrides the -earlier ones. - -You can override the directory where @code{autoconf} looks for the -installed macro files by setting the @code{AC_MACRODIR} environment -variable to a different directory. You can also give @code{autoconf} -the @samp{--macrodir} option, which overrides @code{AC_MACRODIR}. - -@code{autoconf} also accepts the options @code{--version}, which prints -the Autoconf version number and exits, and @code{--help}, which prints a -summary of the command-line options and exits. - -@node Invoking autoheader, , Invoking autoconf, Making configure Scripts -@section Invoking @code{autoheader} - -You can use the @code{autoheader} program to create a template file of C -@samp{#define} statements for @code{configure} to use. By default, the -file that @code{autoheader} creates is called @file{config.h.in}; if -@file{configure.in} invokes @code{AC_CONFIG_HEADER(@var{file})}, -@code{autoheader} creates @file{@var{file}.in}. - -@code{autoheader} scans @file{configure.in} and figures out which C -preprocessor symbols it might define. It copies comments and -@code{#define} and @code{#undef} statements from a file called -@file{acconfig.h}, which comes with and is installed with Autoconf. It -also uses a file called @file{acconfig.h} in the current directory, if -present; you must create that file to contain entries for any additional -symbols that you @code{AC_DEFINE}. For symbols defined by -@code{AC_HAVE_HEADERS}, @code{AC_HAVE_FUNCS}, @code{AC_SIZEOF_TYPE}, -or @code{AC_HAVE_LIBRARY}, -@code{autoheader} generates comments and @code{#undef} statements itself -rather than copying them from a file, since the possible symbols are -effectively limitless. - -The file that @code{autoheader} creates usually contains only -@code{#define} and @code{#undef} statements and their accompanying -comments. However, if a file called @file{@var{file}.top} (typically -@file{config.h.top}) exists in the current directory, @code{autoheader} -copies that file to the beginning of its output. - -If you give @code{autoheader} an argument, it uses that file instead of -@file{configure.in} and writes the header file to the standard output -instead of to @file{config.h.in}. If you give @code{autoheader} an -argument of @samp{-}, it reads the standard input instead of -@file{configure.in} and writes the header file to the standard output. +The Autoconf macros are defined in several files. Some of the files are +distributed with Autoconf; @code{autoconf} reads them first. Then it +looks for the optional file @file{acsite.m4} in the directory that +contains the distributed Autoconf macro files, and for the optional file +@file{aclocal.m4} in the current directory. Those files can contain +your site's or the package's own Autoconf macro definitions +(@pxref{Writing Macros}, for more information). If a macro is defined +in more than one of the files that @code{autoconf} reads, the last +definition it reads overrides the earlier ones. -You can override the directory where @code{autoheader} looks for the -installed macro and @file{acconfig.h} files by setting the -@code{AC_MACRODIR} environment variable to a different directory. You -can also give @code{autoheader} the @samp{--macrodir} option, which -overrides @code{AC_MACRODIR}. - -@code{autoheader} also accepts the options @code{--version}, which prints -the Autoconf version number and exits, and @code{--help}, which prints a -summary of the command-line options and exits. - -@node Specific Tests, General Purpose Macros, Making configure Scripts, Top -@chapter Specific Tests - -These macros test for particular operating system features that packages -might need or want to use. If you need to test for a feature that none -of these macros check for, you can probably do it by calling one of the -general purpose test macros with appropriate arguments (@pxref{General -Feature Tests}). - -All of these macros that set @code{make} variables call @code{AC_SUBST} -on those variables (@pxref{Setting Variables}, for details about -@code{AC_SUBST}). The phrase ``define @var{name}'' is used below as a -shorthand to mean either add @samp{-D@var{name}=1} to the @code{make} -variable @code{DEFS}, or put @samp{#define @var{name} 1} in the -configuration header file, depending on whether @code{AC_CONFIG_HEADER} has -been called. @xref{Setting Variables}, for more information. - -Within each section below, the macros are listed in alphabetical order. -The macros are generally named for the @code{make} variables or C -preprocessor macros that they define; those names are based largely on -what existing GNU programs use. These macros are defined in the file -@file{acspecific.m4}. +@code{autoconf} accepts the following options: -@menu -* Alternative Programs:: Selecting between alternative programs. -* Header Files:: Header files that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Library Functions:: C library functions that might be missing. -* Structures:: Structures or members that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special cases for specific UNIX variants. -@end menu +@table @code +@item --help +@itemx -h +Print a summary of the command line options and exit. -@node Alternative Programs, Header Files, , Specific Tests -@section Alternative Programs +@item --localdir=@var{dir} +@itemx -l @var{dir} +Look for the package file @file{aclocal.m4} in directory @var{dir} +instead of in the current directory. -The following macros check for the presence or behavior of particular -programs: +@item --macrodir=@var{dir} +@itemx -m @var{dir} +@evindex AC_MACRODIR +Look for the installed macro files in directory @var{dir}. You can also +set the @code{AC_MACRODIR} environment variable to a directory; this +option overrides the environment variable. -@defmac AC_GCC_TRADITIONAL -@maindex GCC_TRADITIONAL -Add @samp{-traditional} to @code{make} variable @code{CC} if using the -GNU C compiler and @code{ioctl} does not work properly without -@samp{-traditional}. This macro calls @code{AC_PROG_CC} and -@code{AC_PROG_CPP} if they haven't been called already. -@end defmac +@item --version +Print the version number of Autoconf and exit. +@end table -@defmac AC_LN_S -@maindex LN_S -If @samp{ln -s} works on the current filesystem (the O.S. and filesystem -support symbolic links), set shell and @code{make} variable @code{LN_S} -to @samp{ln -s}, otherwise set it to @samp{ln}. -@end defmac +@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts +@section Using @code{autoreconf} to Update @code{configure} Scripts -@defmac AC_MINUS_C_MINUS_O -@maindex MINUS_C_MINUS_O -@vindex NO_MINUS_C_MINUS_O -If the C compiler does not accept the @samp{-c} and @samp{-o} options -simultaneously, define @code{NO_MINUS_C_MINUS_O}. -@end defmac +If you have a lot of Autoconf-generated @code{configure} scripts and you +get a new version of Autoconf, the @code{autoreconf} program can be +handy. It runs @code{autoconf} (and @code{autoheader}, where +appropriate) repeatedly to remake all of the Autoconf @code{configure} +scripts in the directory tree rooted at the current directory. If you +give the @samp{--macrodir=@var{dir}} or @samp{--localdir=@var{dir}} +options, it passes them down (with relative paths adjusted properly). -@defmac AC_PROG_AWK -@maindex PROG_AWK -Check for @code{mawk}, @code{gawk}, @code{nawk}, and @code{awk}, in that -order, and set @code{make} variable @code{AWK} to the first one that it -finds. -@end defmac +@xref{Automatic Remaking}, for information about automatic remaking of +@code{configure} scripts when their source files change. -@defmac AC_PROG_CC -@maindex PROG_CC -If @code{gcc} is found, set @code{make} variable @code{CC} to @samp{gcc}, -and set shell variable @code{GCC} to 1 for use by macros such as -@code{AC_GCC_TRADITIONAL}. -@end defmac +@noindent +@code{autoreconf} accepts the following options: -@defmac AC_PROG_CPP -@maindex PROG_CPP -Set shell and @code{make} variable @code{CPP} to a command that runs the -C preprocessor. If @samp{$CC -E} doesn't work, it uses @file{/lib/cpp}. -It is only portable to run @code{CPP} on files with a @file{.c} -extension. +@table @code +@item --help +@itemx -h +Print a summary of the command line options and exit. + +@item --localdir=@var{dir} +@itemx -l @var{dir} +Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but +not @file{@var{file}.top} and @file{@var{file}.bot}) in directory +@var{dir} instead of in the directory containing each @file{configure.in}. + +@item --macrodir=@var{dir} +@itemx -m @var{dir} +@evindex AC_MACRODIR +Look for the Autoconf macro files in directory @var{dir} instead of the +default installation directory. +You can also set the @code{AC_MACRODIR} +environment variable to a directory; this option overrides the +environment variable. -If the current language is C (@pxref{Language Choice}), many of the -specific test macros use the value of @code{CPP} indirectly by calling -@code{AC_TEST_CPP}, @code{AC_HEADER_CHECK}, @code{AC_HEADER_EGREP}, or -@code{AC_PROGRAM_EGREP}. Those macros call this macro first if it -hasn't been called already. It calls @code{AC_PROG_CC} if it hasn't -been called already. -@end defmac +@item --verbose +Print the name of each directory where @code{autoreconf} runs +@code{autoconf} (and @code{autoheader}, if appropriate). + +@item --version +Print the version number of Autoconf and exit. +@end table -@defmac AC_PROG_CXX -@maindex PROG_CXX -Determine a C++ compiler to use. Check if the environment variable -@var{CXX} or @var{CCC} (in that order) is set; if so, set @code{make} -variable @code{CXX} to its value. Otherwise search for a C++ compiler -under likely names (@code{c++}, @code{g++}, @code{gcc}, and @code{CC}). -If none of those checks succeed, as a last resort set @code{CXX} to -@code{gcc}. -@end defmac +@node Setup, Existing Tests, Making configure Scripts, Top +@chapter Initialization and Output Files -@defmac AC_PROG_CXXCPP -@maindex PROG_CXXCPP -Set shell and @code{make} variable @code{CXXCPP} to a command that runs the -C++ preprocessor. If @samp{$CXX -E} doesn't work, it uses @file{/lib/cpp}. -It is only portable to run @code{CXXCPP} on files with a @file{.C} or -@file{.cc} extension. +Autoconf-generated @code{configure} scripts need some information about +how to initialize, such as how to find the package's source files; and +about the output files to produce. The following sections describe +initialization and creating output files. -If the current language is C++ (@pxref{Language Choice}), many of the -specific test macros use the value of @code{CXXCPP} indirectly by -calling @code{AC_TEST_CPP}, @code{AC_HEADER_CHECK}, -@code{AC_HEADER_EGREP}, or @code{AC_PROGRAM_EGREP}. Those macros call -this macro first if it hasn't been called already. This macro calls -@code{AC_PROG_CXX} if it hasn't been called already. -@end defmac +@menu +* Input:: Where Autoconf should find 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. +* Default Prefix:: Changing the default installation prefix. +* Versions:: Version numbers in @code{configure}. +@end menu -@defmac AC_PROG_INSTALL -@maindex PROG_INSTALL -Set @code{make} variable @code{INSTALL} to @samp{install -c} if -@code{install} is found and is compatible with the BSD and GNU versions. -Otherwise, set @code{INSTALL} to @samp{@var{dir}/install.sh -c}, where -it checks for @file{install.sh} in the directories @file{$srcdir}, -@file{$srcdir/..}, and @file{$srcdir/../..} to determine @var{dir}. +@node Input, Output, , Setup +@section Finding @code{configure} Input -This macro screens out the false matches @file{/etc/install}, -@file{/usr/sbin/install}, and other instances of @code{install} known -not to work. It also sets the variable @code{INSTALL_PROGRAM} to -@samp{$@{INSTALL@}} and @code{INSTALL_DATA} to @samp{$@{INSTALL@} -m -644}. +Every @code{configure} script must call @code{AC_INIT} before doing +anything else. The only other required macro is @code{AC_OUTPUT} +(@pxref{Output}). -If you need to use your own @file{install.sh} because it has features -not found in standard @code{install} programs, there is no reason to use -@code{AC_PROG_INSTALL}; just put the pathname of your script into your -@file{Makefile.in} files. +@defmac AC_INIT (@var{unique-file-in-source-dir}) +@maindex INIT +Process any command-line arguments and find the source code directory. +@var{unique-file-in-source-dir} is some file that is in the package's +source directory; @code{configure} checks for this file's existence to +make sure that the directory that it is told contains the source code in +fact does (@pxref{Invoking configure}, for more information). @end defmac -@defmac AC_PROG_LEX -@maindex PROG_LEX -If @code{flex} is found, set @code{make} variable @code{LEX} to -@samp{flex} and @code{LEXLIB} to @samp{-lfl}, if that library is in a -standard place. Otherwise set @code{LEX} to @samp{lex} and -@code{LEXLIB} to @samp{-ll}. +Packages that do manual configuration or use the @code{install} program +might need to tell @code{configure} where to find some other shell +scripts by calling @code{AC_CONFIG_AUX_DIR}, though the default places +it looks are correct for most cases. + +@defmac AC_CONFIG_AUX_DIR(@var{dir}) +@maindex CONFIG_AUX_DIR +Use the @file{install-sh}, @file{config.sub}, @file{config.guess}, and +Cygnus @code{configure} scripts that are in directory @var{dir}. These +are auxiliary files used in configuration. @var{dir} can be either +absolute or relative to @file{@var{srcdir}}. The default is +@file{@var{srcdir}} or @file{@var{srcdir}/..} or +@file{@var{srcdir}/../..}, whichever is the first that contains +@file{install-sh}. The other files are not checked for, so that using +@code{AC_PROG_INSTALL} does not automatically require distributing the +other auxiliary files. It checks for @file{install.sh} also, but that +name is obsolete because some @code{make} programs have a rule that +creates @file{install} from it if there is no @file{Makefile}. @end defmac -@defmac AC_PROG_RANLIB -@maindex PROG_RANLIB -Set @code{make} variable @code{RANLIB} to @samp{ranlib} if @code{ranlib} -is found, otherwise to @samp{:} (do nothing). -@end defmac +@node Output, Makefile Substitutions, Input, Setup +@section Creating Output Files -@defmac AC_PROG_YACC -@maindex PROG_YACC -If @code{bison} is found, set @code{make} variable @code{YACC} to -@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC} -to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}. -@end defmac +Every Autoconf-generated @code{configure} script must finish by calling +@code{AC_OUTPUT}. It is the macro that creates the @file{Makefile}s and +optional other files resulting from configuration. The only other +required macro is @code{AC_INIT} (@pxref{Input}). -@defmac AC_RSH -@maindex RSH -@vindex NO_REMOTE -@vindex HAVE_NETDB_H -If a remote shell is available, put @samp{rtapelib.o} in @code{make} -variable @code{RTAPELIB}. Otherwise, also do so if @file{netdb.h} -exists (implying the @code{rexec} function), and in addition define -@code{HAVE_NETDB_H}. If neither a remote shell nor @code{rexec} is -available, define @code{NO_REMOTE}. +@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 +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. +@xref{Makefile Substitutions}, for more information on using output variables. +@xref{Setting Output Variables}, for more information on creating them. This +macro creates the directory that the file is in if it doesn't exist (but +not the parents of that directory). Usually, @file{Makefile}s are +created this way, but other files, such as @file{.gdbinit}, can be +specified as well. + +If @code{AC_CONFIG_HEADER}, @code{AC_LINK_FILES}, or +@code{AC_CONFIG_SUBDIRS} has been called, this macro also creates the +files named as their arguments. + +A typical call to @code{AC_OUTPUT} looks like this: +@example +AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile) +@end example + +You can override an input file name by appending it to @var{file}, +separated by a colon. For example, +@example +AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) +@end example + +If you pass @var{extra-cmds}, those commands will be inserted into +@file{config.status} to be run after all its other processing. If +@var{init-cmds} are given, they are inserted just before +@var{extra-cmds}, with shell variable, command, and backslash +substitutions performed on them in @code{configure}. You can use +@var{init-cmds} to pass variables from @code{configure} to the +@var{extra-cmds}. @end defmac -@defmac AC_SET_MAKE -@maindex SET_MAKE -If @code{make} predefines the variable @code{MAKE}, define @code{make} +If you run @code{make} on subdirectories, you should run it using the +@code{make} variable @code{MAKE}. Most versions of @code{make} set +@code{MAKE} to the name of the @code{make} program plus any options it +was given. (But many do not include in it the values of any variables +set on the command line, so those are not passed on automatically.) +Some old versions of @code{make} do not set this variable. The +following macro allows you to use it even with those versions. + +@defmac AC_PROG_MAKE_SET +@maindex PROG_MAKE_SET +@ovindex SET_MAKE +If @code{make} predefines the variable @code{MAKE}, define output variable @code{SET_MAKE} to be empty. Otherwise, define @code{SET_MAKE} to contain @samp{MAKE=make}. Calls @code{AC_SUBST} for @code{SET_MAKE}. +@end defmac -In recent versions of @code{make}, the variable @code{MAKE} contains the -name of the @code{make} program plus options it was given. It is used -when running @code{make} recursively in subdirectories. But some old -versions of @code{make} don't set the @code{MAKE} variable. -This macro allows use of @code{MAKE} on all systems. - -If you use this macro, simply place a line like this in your -@file{Makefile.in} file(s): +To use this macro, place a line like this in each @file{Makefile.in} +that runs @code{MAKE} on other directories: @example @@SET_MAKE@@ @end example -@end defmac - -@defmac AC_YYTEXT_POINTER -@maindex YYTEXT_POINTER -@vindex YYTEXT_POINTER -Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead -of a @samp{char []}. This depends on whether @code{lex} or @code{flex} -is being used. This macro calls @code{AC_PROG_CPP} (or -@code{AC_PROG_CXXCPP} if C++ is the current language, @pxref{Language -Choice}) and @code{AC_PROG_LEX} if they haven't been called already. -This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work. -@end defmac +@node Makefile Substitutions, Configuration Headers, Output, Setup +@section Substitutions in Makefiles + +Each subdirectory in a distribution that contains something to be +compiled or installed should come with a file @file{Makefile.in}, from +which @code{configure} will create a @file{Makefile} in that directory. +To create a @file{Makefile}, @code{configure} performs a simple variable +substitution, replacing occurrences of @samp{@@@var{variable}@@} in +@file{Makefile.in} with the value that @code{configure} has determined +for that variable. Variables that are substituted into output files in +this way are called @dfn{output variables}. They are ordinary shell +variables that are set in @code{configure}. To make @code{configure} +substitute a particular variable into the output files, the macro +@code{AC_SUBST} must be called with that variable name as an argument. +Any occurrences of @samp{@@@var{variable}@@} for other variables are +left unchanged. @xref{Setting Output Variables}, for more information on +creating output variables with @code{AC_SUBST}. + +A software package that uses a @code{configure} script should be +distributed with a file @file{Makefile.in}, but no @file{Makefile}; that +way, the user has to properly configure the package for the local system +before compiling it. + +@xref{Makefile Conventions, , Makefile Conventions, standards.info, The +GNU Coding Standards}, for more information on what to put in +@file{Makefile}s. -@node Header Files, Typedefs, Alternative Programs, Specific Tests -@section Header Files +@menu +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Compiling in a different directory. +* Automatic Remaking:: Makefile rules for configuring. +@end menu -The following macros check for the presence of certain C header files: +@node Preset Output Variables, Build Directories, , Makefile Substitutions +@subsection Preset Output Variables -@defmac AC_DIR_HEADER -@maindex DIR_HEADER -@vindex DIRENT -@vindex SYSDIR -@vindex SYSNDIR -@vindex NDIR -@vindex VOID_CLOSEDIR -If the system has @file{dirent.h}, define @code{DIRENT}; otherwise, if -it has @file{sys/ndir.h}, define @code{SYSNDIR}; otherwise, if it has -@file{sys/dir.h}, define @code{SYSDIR}; otherwise, if it has -@file{ndir.h}, define @code{NDIR}. Also, if the directory library -header file contains a declaration of the @code{closedir} function with -a @code{void} return type, define @code{VOID_CLOSEDIR}. +Some output variables are preset by the Autoconf macros. Some of the +Autoconf macros set additional output variables, which are mentioned in +the descriptions for those macros. @xref{Output Variable Index}, for a +complete list of output variables. Here is what each of the preset ones +contains. -The directory library declarations in the source code should look -something like the following, which assumes that you have also called -@samp{AC_HAVE_HEADERS(unistd.h)}: +@defvar configure_input +@ovindex configure_input +A comment saying that the file was generated automatically by +@code{configure} and giving the name of the input file. +@code{AC_OUTPUT} adds a comment line containing this variable to the top +of every @file{Makefile} it creates. For other files, you should +reference this variable in a comment at the top of each input file. For +example, an input shell script should begin like this: @example -@group -#ifdef HAVE_UNISTD_H -#include -#include -#endif - -/* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */ -#if defined(DIRENT) || defined(_POSIX_VERSION) -#include -#define NLENGTH(dirent) (strlen((dirent)->d_name)) -#else /* not (DIRENT or _POSIX_VERSION) */ -#define dirent direct -#define NLENGTH(dirent) ((dirent)->d_namlen) -#ifdef SYSNDIR -#include -#endif /* SYSNDIR */ -#ifdef SYSDIR -#include -#endif /* SYSDIR */ -#ifdef NDIR -#include -#endif /* NDIR */ -#endif /* not (DIRENT or _POSIX_VERSION) */ -@end group +#!/bin/sh +# @@configure_input@@ @end example -Using the above declarations, the program would declare variables to be -type @code{struct dirent}, not @code{struct direct}, and would access -the length of a directory entry name by passing a pointer to a -@code{struct dirent} to the @code{NLENGTH} macro. -@end defmac +@noindent +The presence of that line also reminds people editing the file that it +needs to be processed by @code{configure} in order to be used. +@end defvar -@defmac AC_MAJOR_HEADER -@maindex MAJOR_HEADER -@vindex MAJOR_IN_MKDEV -@vindex MAJOR_IN_SYSMACROS -If @file{sys/types.h} does not define @code{major}, @code{minor}, and -@code{makedev}, but @file{sys/mkdev.h} does, define -@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define -@code{MAJOR_IN_SYSMACROS}. -@end defmac +@defvar exec_prefix +@ovindex exec_prefix +The installation prefix for architecture-dependent files. +@end defvar -@defmac AC_MEMORY_H -@maindex MEMORY_H -@vindex NEED_MEMORY_H -Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are -not declared in @file{string.h} and @file{memory.h} exists. This macro -is obsolete; instead, use @code{AC_HAVE_HEADERS(memory.h)}. See the -example for @code{AC_STDC_HEADERS}. -@end defmac +@defvar prefix +@ovindex prefix +The installation prefix for architecture-independent files. +@end defvar -@defmac AC_STDC_HEADERS -@maindex STDC_HEADERS -@vindex STDC_HEADERS -Define @code{STDC_HEADERS} if the system has ANSI C header files. -Specifically, this macro checks for @file{stdlib.h}, @file{stdarg.h}, -@file{string.h}, and @file{float.h}; if the system has those, it -probably has the rest of the ANSI C header files. This macro also -checks whether @file{string.h} declares @code{memchr} (and thus -presumably the other @code{mem} functions), whether @file{stdlib.h} -declare @code{free} (and thus presumably @code{malloc} and other related -functions), and whether the @file{ctype.h} macros work on characters -with the high bit set, as ANSI C requires. +@defvar srcdir +@ovindex srcdir +The directory that contains the source code for that @file{Makefile}. +@end defvar -Use @code{STDC_HEADERS} instead of @code{__STDC__} to determine whether -the system has ANSI-compliant header files (and probably C library -functions) because many systems that have GCC do not have ANSI C header -files. +@defvar top_srcdir +@ovindex top_srcdir +The top-level source code directory for the package. In the top-level +directory, this is the same as @code{srcdir}. +@end defvar -To check whether to use the System V/ANSI C string functions and header -file, you can put the following in @file{configure.in}: +@defvar CFLAGS +@ovindex CFLAGS +Debugging and optimization options for the C compiler. If it is not set +in the environment when @code{configure} runs, the default value is set +when you call @code{AC_PROG_CC} (or empty if you don't). @code{configure} +uses this variable when compiling programs to test for C features. +@end defvar -@example -AC_STDC_HEADERS -AC_HAVE_HEADERS(string.h memory.h) -@end example +@defvar CPPFLAGS +@ovindex CPPFLAGS +Header file search directory (@samp{-I@var{dir}}) and any other +miscellaneous options for the C preprocessor and compiler. If it is not +set in the environment when @code{configure} runs, the default value is +empty. @code{configure} uses this variable when compiling or +preprocessing programs to test for C features. +@end defvar -@noindent -Then, in the code, use a test like this: +@defvar CXXFLAGS +@ovindex CXXFLAGS +Debugging and optimization options for the C++ compiler. If it is not +set in the environment when @code{configure} runs, the default value is +set when you call @code{AC_PROG_CXX} (or empty if you don't). +@code{configure} uses this variable when compiling programs to test for +C++ features. +@end defvar -@example -@group -#if STDC_HEADERS || HAVE_STRING_H -#include -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -#if !STDC_HEADERS && HAVE_MEMORY_H -#include -#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -#define index strchr -#define rindex strrchr -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) -#define bzero(s, n) memset ((s), 0, (n)) -#else /* not STDC_HEADERS and not HAVE_STRING_H */ -#include -/* memory.h and strings.h conflict on some systems. */ -#endif /* not STDC_HEADERS and not HAVE_STRING_H */ -@end group -@end example +@defvar DEFS +@ovindex DEFS +@samp{-D} options to pass to the C compiler. If @code{AC_CONFIG_HEADER} +is called, @code{configure} replaces @samp{@@DEFS@@} with +@samp{-DHAVE_CONFIG_H} instead (@pxref{Configuration Headers}). This +variable is not defined while @code{configure} is performing its tests, +only when creating the output files. @xref{Setting Output Variables}, for +how to check the results of previous tests. +@end defvar -@noindent -This example asssumes that your code uses the BSD style functions. If -you use the System V/ANSI C style functions, you will need to replace -the macro definitions with ones that go in the other direction. +@defvar LDFLAGS +@ovindex LDFLAGS +Stripping (@samp{-s}) and any other miscellaneous options for the +linker. If it is not set in the environment when @code{configure} runs, +the default value is empty. @code{configure} uses this variable when +linking programs to test for C features. +@end defvar -This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending -on which language is current, @pxref{Language Choice}), if it hasn't -been called already. +@defvar LIBS +@ovindex LIBS +@samp{-l} and @samp{-L} options to pass to the linker. +@end defvar + +@node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions +@subsection Build Directories + +You might want to compile a software package in a different directory +from the one that contains the source code. Doing this allows you to +compile the package for several architectures simultaneously from the +same copy of the source code and keep multiple sets of object files on +disk. + +To support doing this, @code{make} uses the @code{VPATH} variable to +find the files that are in the source directory. GNU @code{make} and +most other recent @code{make} programs can do this. Older @code{make} +programs do not support @code{VPATH}; when using them, the source code +must be in the same directory as the object files. + +To support @code{VPATH}, each @file{Makefile.in} should contain two +lines that look like: + +@example +srcdir = @@srcdir@@ +VPATH = @@srcdir@@ +@end example + +Do not set @code{VPATH} to the value of another variable, for example +@samp{VPATH = $(srcdir)}, because some versions of @code{make} do not do +variable substitutions on the value of @code{VPATH}. + +@code{configure} substitutes in the correct value for @code{srcdir} when +it produces @file{Makefile.in}. + +Do not use the @code{make} variable @code{$<}, which expands to the +pathname of the file in the source directory (found with @code{VPATH}), +except in implicit rules. (An implicit rule is one such as @samp{.c.o}, +which tells how to create a @file{.o} file from a @file{.c} file.) Some +versions of @code{make} do not set @code{$<} in explicit rules; they +expand it to an empty value. + +Instead, @file{Makefile} command lines should always refer to source +files by prefixing them with @samp{$(srcdir)/}. For example: + +@example +time.info: time.texinfo + $(MAKEINFO) $(srcdir)/time.texinfo +@end example + +@node Automatic Remaking, , Build Directories, Makefile Substitutions +@subsection Automatic Remaking + +You can put rules like the following in the top-level @file{Makefile.in} +for a package to automatically update the configuration information when +you change the configuration files. This example includes all of the +optional files, such as @file{aclocal.m4} and those related to +configuration header files. Omit from the @file{Makefile.in} rules any +of these files that your package does not use. + +The @samp{$@{srcdir@}/} prefix is included to work around limitations of +the @code{VPATH} implementations in some non-GNU @code{make}s. + +The @file{stamp-} files are necessary because the timestamps of +@file{config.h.in} and @file{config.h} will not be changed if remaking +them does not change their contents. This feature avoids unnecessary +recompilation. You should include the file @file{stamp-h.in} your +package's distribution, so @code{make} will consider @file{config.h.in} +up to date. On some old BSD systems, @code{touch} or any command that +results in an empty file does not update the timestamps, so use a +command like @code{date} as a workaround. + +@example +@group +$@{srcdir@}/configure: configure.in aclocal.m4 + cd $@{srcdir@} && autoconf + +# autoheader might not change config.h.in, so touch a stamp file. +$@{srcdir@}/config.h.in: stamp-h.in +stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot + cd $@{srcdir@} && autoheader + date > $@{srcdir@}/stamp-h.in + +config.h: stamp-h +stamp-h: config.h.in config.status + ./config.status + +Makefile: Makefile.in config.status + ./config.status + +config.status: configure + ./config.status --recheck +@end group +@end example + +In addition, you should pass @samp{date > stamp-h} in the @var{extra-cmds} +argument to @code{AC_OUTPUT}, so @file{config.status} will ensure that +@file{config.h} is considered up to date. @xref{Output}, for more +information about @code{AC_OUTPUT}. + +@xref{Invoking config.status}, for more examples of handling +configuration-related dependencies. + +@node Configuration Headers, Subdirectories, Makefile Substitutions, Setup +@section Configuration Header Files + +When a package tests more than a few C preprocessor symbols, the command +lines to pass @samp{-D} options to the compiler can get quite long. +This causes two problems. One is that the @code{make} output is hard to +visually scan for errors. More seriously, the command lines can exceed +the length limits of some operating systems. As an alternative to +passing @samp{-D} options to the compiler, @code{configure} scripts can +create a C header file containing @samp{#define} directives. The +@code{AC_CONFIG_HEADER} macro selects this kind of output. It should be +called right after @code{AC_INIT}. + +The package should @samp{#include} the configuration header file before +any other header files, to prevent inconsistencies in declarations (for +example, if it redefines @code{const}). Use @samp{#include } +instead of @samp{#include "config.h"}, and pass the C compiler a +@samp{-I.} option (or @samp{-I..}; whichever directory contains +@file{config.h}). That way, even if the source directory is configured +itself (perhaps to make a distribution), other build directories can +also be configured without finding the @file{config.h} from the source +directory. + +@defmac AC_CONFIG_HEADER (@var{header-to-create} @dots{}) +@maindex CONFIG_HEADER +@cvindex HAVE_CONFIG_H +Make @code{AC_OUTPUT} create the file(s) in the whitespace-separated +list @var{header-to-create} containing C preprocessor @code{#define} +statements, and replace @samp{@@DEFS@@} in generated files with +@samp{-DHAVE_CONFIG_H} instead of the value of @code{DEFS}. The usual +name for @var{header-to-create} is @file{config.h}. + +If @var{header-to-create} already exists and its contents are identical +to what @code{AC_OUTPUT} would put in it, it is left alone. Doing this +allows some changes in configuration without needlessly causing object +files that depend on the header file to be recompiled. + +Usually the input file is named @file{@var{header-to-create}.in}; +however, you can override the input file name by appending it to +@var{header-to-create}, separated by a colon. For example, +@example +AC_CONFIG_HEADER(defines.h:defines.hin) +@end example +@noindent +Doing this allows you to keep your filenames acceptable to MS-DOS. @end defmac -@defmac AC_UNISTD_H -@maindex UNISTD_H -@vindex HAVE_UNISTD_H -Define @code{HAVE_UNISTD_H} if the system has @file{unistd.h}. This -macro is obsolete; instead, use @samp{AC_HAVE_HEADERS(unistd.h)}. +@menu +* Header Templates:: Input for the configuration headers. +* Invoking autoheader:: How to create configuration templates. +@end menu -The way to check if the system supports POSIX.1 is: +@node Header Templates, Invoking autoheader, , Configuration Headers +@subsection Configuration Header Templates + +Your distribution should contain a template file that looks as you want +the final header file to look, including comments, with default values +in the @code{#define} statements. For example, suppose your +@file{configure.in} makes these calls: + +@example +AC_CONFIG_HEADER(conf.h) +AC_CHECK_HEADERS(unistd.h) +@end example + +@noindent +Then you could have code like the following in @file{conf.h.in}. +On systems that have @file{unistd.h}, @code{configure} will change the 0 +to a 1. On other systems, it will leave the line unchanged. @example @group -#if HAVE_UNISTD_H -#include -#include -#endif +/* Define as 1 if you have unistd.h. */ +#define HAVE_UNISTD_H 0 +@end group +@end example -#ifdef _POSIX_VERSION -/* Code for POSIX.1 systems. */ -#endif +Alternately, if your code tests for configuration options using +@code{#ifdef} instead of @code{#if}, a default value can be to +@code{#undef} the variable instead of to define it to a value. On +systems that have @file{unistd.h}, @code{configure} will change the +second line to read @samp{#define HAVE_UNISTD_H 1}. On other systems, +it will comment that line out (in case the system predefines that +symbol). + +@example +@group +/* Define if you have unistd.h. */ +#undef HAVE_UNISTD_H @end group @end example -@vindex _POSIX_VERSION -@code{_POSIX_VERSION} is defined when @file{unistd.h} is included on -POSIX.1 systems. If there is no @file{unistd.h}, it is definitely not a -POSIX.1 system. However, some non-POSIX.1 systems do have @file{unistd.h}. +@node Invoking autoheader, , Header Templates, Configuration Headers +@subsection Using @code{autoheader} to Create @file{config.h.in} + +The @code{autoheader} program can create a template file of C +@samp{#define} statements for @code{configure} to use. If +@file{configure.in} invokes @code{AC_CONFIG_HEADER(@var{file})}, +@code{autoheader} creates @file{@var{file}.in}. Otherwise, +@code{autoheader} creates @file{config.h.in}. + +If you give @code{autoheader} an argument, it uses that file instead of +@file{configure.in} and writes the header file to the standard output +instead of to @file{config.h.in}. If you give @code{autoheader} an +argument of @samp{-}, it reads the standard input instead of +@file{configure.in} and writes the header file to the standard output. + +@code{autoheader} scans @file{configure.in} and figures out which C +preprocessor symbols it might define. It copies comments and +@code{#define} and @code{#undef} statements from a file called +@file{acconfig.h}, which comes with and is installed with Autoconf. It +also uses a file called @file{acconfig.h} in the current directory, if +present. If you @code{AC_DEFINE} any additional symbols, you must +create that file with entries for them. For symbols defined by +@code{AC_CHECK_HEADERS}, @code{AC_CHECK_FUNCS}, @code{AC_CHECK_SIZEOF}, +or @code{AC_CHECK_LIB}, @code{autoheader} generates comments and +@code{#undef} statements itself rather than copying them from a file, +since the possible symbols are effectively limitless. + +The file that @code{autoheader} creates contains mainly @code{#define} +and @code{#undef} statements and their accompanying comments. If +@file{./acconfig.h} contains the string @samp{@@TOP@@}, +@code{autoheader} copies the lines before the line containing +@samp{@@TOP@@} into the top of the file that it generates. Similarly, +if @file{./acconfig.h} contains the string @samp{@@BOTTOM@@}, +@code{autoheader} copies the lines after that line to the end of the +file it generates. Either or both of those strings may be omitted. + +An alternate way to produce the same effect is to create the files +@file{@var{file}.top} (typically @file{config.h.top}) and/or +@file{@var{file}.bot} in the current directory. If they exist, +@code{autoheader} copies them to the beginning and end, respectively, of +its output. Their use is discouraged because they have file names that +contain two periods, and so can not be stored on MS-DOS; also, they are +two more files to clutter up the directory. But if you use the +@samp{--localdir=@var{dir}} option to use an @file{acconfig.h} in another +directory, they give you a way to put custom boilerplate in each +individual @file{config.h.in}. + +@code{autoheader} accepts the following options: + +@table @code +@item --help +@itemx -h +Print a summary of the command line options and exit. + +@item --localdir=@var{dir} +@itemx -l @var{dir} +Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but +not @file{@var{file}.top} and @file{@var{file}.bot}) in directory +@var{dir} instead of in the current directory. + +@item --macrodir=@var{dir} +@itemx -m @var{dir} +@evindex AC_MACRODIR +Look for the installed macro files and @file{acconfig.h} in directory +@var{dir}. You can also set the @code{AC_MACRODIR} environment variable +to a directory; this option overrides the environment variable. + +@item --version +Print the version number of Autoconf and exit. +@end table + +@node Subdirectories, Default Prefix, Configuration Headers, Setup +@section Configuring Other Packages in Subdirectories + +In most situations, calling @code{AC_OUTPUT} is sufficient to produce +@file{Makefile}s in subdirectories. However, @code{configure} scripts +that control more than one independent package can use +@code{AC_CONFIG_SUBDIRS} to run @code{configure} scripts for other +packages in subdirectories. + +@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{}) +@maindex CONFIG_SUBDIRS +@ovindex subdirs +Make @code{AC_OUTPUT} run @code{configure} in each subdirectory +@var{dir} in the given whitespace-separated list. If a given @var{dir} +is not found, no error is reported, so a @code{configure} script can +configure whichever parts of a large source tree are present. If a +given @var{dir} contains @file{configure.in} but no @code{configure}, +the Cygnus @code{configure} script found by @code{AC_CONFIG_AUXDIR} is +used. The subdirectory @code{configure} scripts are given the same +command line options that were given to this @code{configure} script, +with minor changes if needed (e.g., to adjust a relative path for the +cache file or source directory). This macro also sets the output +variable @code{subdirs} to the list of directories @samp{@var{dir} +@dots{}}. @file{Makefile} rules can use this variable to determine +which subdirectories to recurse into. @end defmac -@defmac AC_USG -@maindex USG -@vindex USG -Define @code{USG} if the system does not have @file{strings.h}, -@code{rindex}, @code{bzero}, etc. This implies that it has -@file{string.h}, @code{strrchr}, @code{memset}, etc. +@node Default Prefix, Versions, Subdirectories, Setup +@section Default Prefix + +By default, @code{configure} sets the prefix for files it installs to +@file{/usr/local}. The user of @code{configure} can select a different +prefix using the @samp{--prefix} and @samp{--exec-prefix} options. +There are two ways to change the default: when creating +@code{configure}, and when running it. -The symbol @code{USG} is obsolete. Instead of this macro, use -@code{AC_HAVE_HEADERS(string.h)} and use @code{HAVE_STRING_H} in your -code. See the example for @code{AC_STDC_HEADERS}. +Some software packages might want to install in a directory besides +@file{/usr/local} by default. To accomplish that, use the +@code{AC_PREFIX_DEFAULT} macro. + +@defmac AC_PREFIX_DEFAULT (@var{prefix}) +Set the default installation prefix to @var{prefix} instead of @file{/usr/local}. @end defmac -@defmac AC_SYS_SIGLIST_DECLARED -@maindex SYS_SIGLIST_DECLARED -@vindex SYS_SIGLIST_DECLARED -Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is -declared in a system header file, either @file{signal.h} or -@file{unistd.h}. +It may be convenient for users to have @code{configure} guess the +installation prefix from the location of a related program that they +have already installed. If you wish to do that, you can call +@code{AC_PREFIX_PROGRAM}. + +@defmac AC_PREFIX_PROGRAM (@var{program}) +@maindex PREFIX_PROGRAM +If the user did not specify an installation prefix (using the +@samp{--prefix} option), guess a value for it by looking for +@var{program} in @code{PATH}, the way the shell does. If @var{program} +is found, set the prefix to the parent of the directory containing +@var{program}; otherwise leave the prefix specified in +@file{Makefile.in} unchanged. For example, if @var{program} is +@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc}, +set the prefix to @file{/usr/local/gnu}. @end defmac -@node Typedefs, Library Functions, Header Files, Specific Tests -@section Typedefs +@node Versions, , Default Prefix, Setup +@section Version Numbers in @code{configure} -The following macros check for predefined C types: +The following macros manage version numbers for @code{configure} +scripts. Using them is optional. -@defmac AC_GETGROUPS_T -@maindex GETGROUPS_T -@vindex GETGROUPS_T -Define @code{GETGROUPS_T} to be whichever of @code{gid_t} or @code{int} -is the base type of the array argument to @code{getgroups}. +@defmac AC_PREREQ (@var{version}) +@maindex PREREQ +Ensure that a recent enough version of Autoconf is being used. If the +version of Autoconf being used to create @code{configure} is earlier +than @var{version}, print an error message on the standard error output +and do not create @code{configure}. For example: + +@example +AC_PREREQ(1.8) +@end example + +This macro is useful if your @file{configure.in} relies on non-obvious +behavior that changed between Autoconf releases. If it merely needs +recently added macros, then @code{AC_PREREQ} is less useful, because the +@code{autoconf} program already tells the user which macros are not +found. The same thing happens if @file{configure.in} is processed by a +version of Autoconf older than when @code{AC_PREREQ} was added. @end defmac -@defmac AC_MODE_T -@maindex MODE_T -@vindex mode_t -If @code{mode_t} is not defined in @file{sys/types.h}, define -@code{mode_t} to be @code{int}. +@defmac AC_REVISION (@var{revision-info}) +@maindex REVISION +Copy revision stamp @var{revision-info} into the @code{configure} +script, with any dollar signs or double-quotes removed. This macro lets +you put a revision stamp from @file{configure.in} into @code{configure} +without RCS or CVS changing it when you check in @code{configure}. That +way, you can determine easily which revision of @file{configure.in} a +particular @code{configure} corresponds to. + +It is a good idea to call this macro before @code{AC_INIT} so that the +revision number is near the top of both @file{configure.in} and +@code{configure}. To support doing that, the @code{AC_REVISION} output +begins with @samp{#!/bin/sh}, like the normal start of a +@code{configure} script does. + +For example, this line in @file{configure.in}: + +@c The asis prevents RCS from changing the example in the manual. +@example +AC_REVISION($@asis{Revision: 1.30 }$)dnl +@end example + +@noindent +produces this in @code{configure}: + +@example +#!/bin/sh +# From configure.in Revision: 1.30 +@end example +@end defmac + +@node Existing Tests, Writing Tests, Setup, Top +@chapter Existing Tests + +These macros test for particular system features that packages +might need or want to use. If you need to test for a kind of feature +that none of these macros check for, you can probably do it by calling +primitive test macros with appropriate arguments (@pxref{Writing Tests}). + +These tests print messages telling the user which feature they're +checking for, and what they find. They cache their results for future +@code{configure} runs (@pxref{Caching Results}). + +Some of these macros set output variables. @xref{Makefile +Substitutions}, for how to get their values. The phrase ``define +@var{name}'' is used below as a shorthand to mean ``define C +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. +* 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. +@end menu + +@node Alternative Programs, Libraries, , Existing Tests +@section Alternative Programs + +These macros check for the presence or behavior of particular programs. +They are used to choose between several alternative programs and to +decide what to do once one has been chosen. +If there is no macro specifically defined to check for a program you need, +and you don't need to check for any special properties of +it, then you can use one of the general program check macros. + +@menu +* Particular Programs:: Special handling to find certain programs. +* Generic Programs:: How to find other programs. +@end menu + +@node Particular Programs, Generic Programs, , Alternative Programs +@subsection Particular Program Checks + +These macros check for particular programs---whether they exist, and +in some cases whether they support certain features. + +@defmac AC_DECL_YYTEXT +@maindex DECL_YYTEXT +@cvindex YYTEXT_POINTER +@ovindex LEX_OUTPUT_ROOT +Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead +of a @samp{char []}. Also set output variable @code{LEX_OUTPUT_ROOT} to +the base of the file name that the lexer generates; usually +@file{lex.yy}, but sometimes something else. These results vary +according to whether @code{lex} or @code{flex} is being used. +@end defmac + +@defmac AC_PROG_AWK +@maindex PROG_AWK +@ovindex AWK +Check for @code{mawk}, @code{gawk}, @code{nawk}, and @code{awk}, in that +order, and set output variable @code{AWK} to the first one that it +finds. It tries @code{mawk} first because that is reported to be the +fastest implementation. +@end defmac + +@defmac AC_PROG_CC +@maindex PROG_CC +@ovindex CC +@ovindex CFLAGS +Determine a C compiler to use. If @code{CC} is not already set in the +environment, check for @code{gcc}, and use @code{cc} if it's not found. +Set output variable @code{CC} to the name of the compiler found. + +If using the GNU C compiler, set shell variable @code{GCC} to +@samp{yes}, empty otherwise. If output variable @code{CFLAGS} was +not already set, set it to @samp{-g -O} for the GNU C compiler +(@samp{-O} on systems where GCC does not accept @samp{-g}), or @samp{-g} +for other compilers. +@end defmac + +@defmac AC_PROG_CC_C_O +@maindex PROG_CC_C_O +@cvindex NO_MINUS_C_MINUS_O +If the C compiler does not accept the @samp{-c} and @samp{-o} options +simultaneously, define @code{NO_MINUS_C_MINUS_O}. +@end defmac + +@defmac AC_PROG_CPP +@maindex PROG_CPP +@ovindex CPP +Set output variable @code{CPP} to a command that runs the +C preprocessor. If @samp{$CC -E} doesn't work, it uses @file{/lib/cpp}. +It is only portable to run @code{CPP} on files with a @file{.c} +extension. + +If the current language is C (@pxref{Language Choice}), many of the +specific test macros use the value of @code{CPP} indirectly by calling +@code{AC_TRY_CPP}, @code{AC_CHECK_HEADER}, @code{AC_EGREP_HEADER}, or +@code{AC_EGREP_CPP}. +@end defmac + +@defmac AC_PROG_CXX +@maindex PROG_CXX +@ovindex CXX +@ovindex CXXFLAGS +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}. + +If using the GNU C++ compiler, set shell variable @code{GXX} to +@samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was +not already set, set it to @samp{-g -O} for the GNU C++ compiler +(@samp{-O} on systems where G++ does not accept @samp{-g}), or @samp{-g} +for other compilers. +@end defmac + +@defmac AC_PROG_CXXCPP +@maindex PROG_CXXCPP +@ovindex CXXCPP +Set output variable @code{CXXCPP} to a command that runs the +C++ preprocessor. If @samp{$CXX -E} doesn't work, it uses @file{/lib/cpp}. +It is only portable to run @code{CXXCPP} on files with a @file{.c}, +@file{.C}, or @file{.cc} extension. + +If the current language is C++ (@pxref{Language Choice}), many of the +specific test macros use the value of @code{CXXCPP} indirectly by +calling @code{AC_TRY_CPP}, @code{AC_CHECK_HEADER}, +@code{AC_EGREP_HEADER}, or @code{AC_EGREP_CPP}. +@end defmac + +@defmac AC_PROG_GCC_TRADITIONAL +@maindex PROG_GCC_TRADITIONAL +@ovindex CC +Add @samp{-traditional} to output variable @code{CC} if using the +GNU C compiler and @code{ioctl} does not work properly without +@samp{-traditional}. That usually happens when the fixed header files +have not been installed on an old system. Since recent versions of the +GNU C compiler fix the header files automatically when installed, this +is becoming a less prevalent problem. +@end defmac + +@defmac AC_PROG_INSTALL +@maindex PROG_INSTALL +@ovindex INSTALL +@ovindex INSTALL_PROGRAM +@ovindex INSTALL_DATA +Set output variable @code{INSTALL} to the path of a BSD compatible +@code{install} program, if one is found in the current @code{PATH}. +Otherwise, set @code{INSTALL} to @samp{@var{dir}/install-sh -c}, +checking the directories specified to @code{AC_CONFIG_AUX_DIR} (or its +default directories) to determine @var{dir} (@pxref{Output}). Also set +the variable @code{INSTALL_PROGRAM} to @samp{$@{INSTALL@}} and +@code{INSTALL_DATA} to @samp{$@{INSTALL@} -m 644}. + +This macro screens out various instances of @code{install} known to not +work. It prefers to find a C program rather than a shell script, for +speed. Instead of @file{install-sh}, it can also use @file{install.sh}, +but that name is obsolete because some @code{make} programs have a rule +that creates @file{install} from it if there is no @file{Makefile}. + +If you need to use your own installation program because it has +features not found in standard @code{install} programs, there is no +reason to use @code{AC_PROG_INSTALL}; just put the pathname of your +program into your @file{Makefile.in} files. +@end defmac + +@defmac AC_PROG_LEX +@maindex PROG_LEX +@ovindex LEX +@ovindex LEXLIB +If @code{flex} is found, set output variable @code{LEX} to +@samp{flex} and @code{LEXLIB} to @samp{-lfl}, if that library is in a +standard place. Otherwise set @code{LEX} to @samp{lex} and +@code{LEXLIB} to @samp{-ll}. +@end defmac + +@defmac AC_PROG_LN_S +@maindex PROG_LN_S +@ovindex LN_S +If @samp{ln -s} works on the current filesystem (the operating system +and filesystem support symbolic links), set output +variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}. +@end defmac + +@defmac AC_PROG_RANLIB +@maindex PROG_RANLIB +@ovindex RANLIB +Set output variable @code{RANLIB} to @samp{ranlib} if @code{ranlib} +is found, otherwise to @samp{:} (do nothing). +@end defmac + +@defmac AC_PROG_YACC +@maindex PROG_YACC +@ovindex YACC +If @code{bison} is found, set output variable @code{YACC} to +@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC} +to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}. +@end defmac + +@node Generic Programs, , Particular Programs, Alternative Programs +@subsection Generic Program Checks + +These macros are used to find programs not covered by the particular +test macros. If you need to check the behavior of a program as well as +find out whether it is present, you have to write your own test for +it (@pxref{Writing Tests}). + +@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]}) +@maindex CHECK_PROG +Check whether program @var{prog-to-check-for} exists in @code{PATH}. If +it is found, set @var{variable} to @var{value-if-found}, otherwise to +@var{value-if-not-found}, if given. If @var{variable} was already set, +do nothing. Calls @code{AC_SUBST} for @var{variable}. @end defmac -@defmac AC_OFF_T -@maindex OFF_T -@vindex off_t -If @code{off_t} is not defined in @file{sys/types.h}, define -@code{off_t} to be @code{long}. +@defmac AC_CHECK_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) +@maindex CHECK_PROGS +Check for each program in the whitespace-separated list +@var{progs-to-check-for} exists in @code{PATH}. If it is found, set +@var{variable} to the name of that program. Otherwise, continue +checking the next program in the list. If none of the programs in the +list are found, set @var{variable} to @var{value-if-not-found}; if +@var{value-if-not-found} is not specified, the value of @var{variable} +is not changed. Calls @code{AC_SUBST} for @var{variable}. @end defmac -@defmac AC_PID_T -@maindex PID_T -@vindex pid_t -If @code{pid_t} is not defined in @file{sys/types.h}, define -@code{pid_t} to be @code{int}. +@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) +@maindex PATH_PROG +Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire +path of @var{prog-to-check-for} if found. @end defmac -@defmac AC_RETSIGTYPE -@maindex RETSIGTYPE -@vindex RETSIGTYPE -If @file{signal.h} declares @code{signal} as returning a pointer to a -function returning @code{void}, define @code{RETSIGTYPE} to be -@code{void}; otherwise, define it to be @code{int}. +@defmac AC_PATH_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) +@maindex PATH_PROGS +Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for} +are found, set @var{variable} to the entire path of the program +found. +@end defmac -Define signal handlers as returning type @code{RETSIGTYPE}: +@node Libraries, Library Functions, Alternative Programs, Existing Tests +@section Library Files -@example -@group -RETSIGTYPE -hup_handler () -@{ -@dots{} -@} -@end group -@end example -@end defmac +The following macros check for the presence of certain C library archive +files. -@defmac AC_SIZE_T -@maindex SIZE_T -@vindex size_t -If @code{size_t} is not defined in @file{sys/types.h}, define -@code{size_t} to be @code{unsigned}. +@defmac AC_CHECK_LIB (@var{library}, @var{function} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]}) +@maindex CHECK_LIB +Try to ensure that C function @var{function} is available by checking +whether a test C program can be linked with the library @var{library} to +get the function. @var{library} is the base name of the library; e.g., +to check for @samp{-lmp}, use @samp{mp} as the @var{library} argument. + +@var{action-if-found} is a list of shell commands to run if the link +with the library succeeds; @var{action-if-not-found} is a list of shell +commands to run if the link fails. If @var{action-if-found} and +@var{action-if-not-found} are not specified, the default action is to +add @samp{-l@var{library}} to @code{LIBS} and define +@samp{HAVE_LIB@var{library}} (in all capitals). + +If linking with @var{library} results in unresolved symbols, which would +be resolved by linking with additional libraries, give those libraries +as the @var{other-libraries} argument, separated by spaces: @samp{-lX11 +-lXt}. Otherwise this macro will fail to detect that @var{library} is +present, because linking the test program will always fail with +unresolved symbols. @end defmac -@defmac AC_UID_T -@maindex UID_T -@vindex uid_t -@vindex gid_t -If @code{uid_t} is not defined in @file{sys/types.h}, define -@code{uid_t} to be @code{int} and @code{gid_t} to be @code{int}. +@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]}) +@maindex HAVE_LIBRARY +This macro is equivalent to calling @code{AC_CHECK_LIB} with a +@var{function} argument of @code{main}. In addition, @var{library} can +be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}. In +all of those cases, the compiler is passed @samp{-lfoo}. However, +@var{library} can not be a shell variable; it must be a literal name. +This macro is considered obsolete. @end defmac -@node Library Functions, Structures, Typedefs, Specific Tests +@node Library Functions, Header Files, Libraries, Existing Tests @section Library Functions -The following macros check for particular C library functions: +The following macros check for particular C library functions. +If there is no macro specifically defined to check for a function you need, +and you don't need to check for any special properties of +it, then you can use one of the general function check macros. -@defmac AC_ALLOCA -@maindex ALLOCA -@vindex C_ALLOCA -@vindex HAVE_ALLOCA_H +@menu +* Particular Functions:: Special handling to find certain functions. +* Generic Functions:: How to find other functions. +@end menu + +@node Particular Functions, Generic Functions, , Library Functions +@subsection Particular Function Checks + +These macros check for particular C functions---whether they exist, and +in some cases how they respond when given certain arguments. + +@defmac AC_FUNC_ALLOCA +@maindex FUNC_ALLOCA +@cvindex C_ALLOCA +@cvindex HAVE_ALLOCA_H +@ovindex ALLOCA Check how to get @code{alloca}. Tries to get a builtin version by checking for @file{alloca.h} or the predefined C preprocessor macros -@code{__GNUC__} and @code{_AIX}. If that fails, it looks for a function -in the standard C library. If that fails, it sets the @code{make} -variable @code{ALLOCA} to @samp{alloca.o} and defines @code{C_ALLOCA} -(so programs can periodically call @samp{alloca(0)} to garbage collect). +@code{__GNUC__} and @code{_AIX}. If this macro finds @file{alloca.h}, +it defines @code{HAVE_ALLOCA_H}. + +If those attempts fail, it looks for the function in the standard C +library. If any of those methods succeed, it defines +@code{HAVE_ALLOCA}. Otherwise, it sets the output variable +@code{ALLOCA} to @samp{alloca.o} and defines @code{C_ALLOCA} (so +programs can periodically call @samp{alloca(0)} to garbage collect). This variable is separate from @code{LIBOBJS} so multiple programs can share the value of @code{ALLOCA} without needing to create an actual library, in case only some of them use the code in @code{LIBOBJS}. -If this macro finds @file{alloca.h}, it defines @code{HAVE_ALLOCA_H}. - -This macro does not try to get @code{alloca} from the SVR3 @file{libPW} -or the SVR4 @file{libucb} because those libraries contain some -incompatible functions that cause trouble. Some versions do not even -contain @code{alloca} or contain a buggy version. If you still want to -use their @code{alloca}, use @code{ar} to extract @file{alloca.o} from -them instead of compiling @file{alloca.c}. +This macro does not try to get @code{alloca} from the System V R3 +@file{libPW} or the System V R4 @file{libucb} because those libraries +contain some incompatible functions that cause trouble. Some versions +do not even contain @code{alloca} or contain a buggy version. If you +still want to use their @code{alloca}, use @code{ar} to extract +@file{alloca.o} from them instead of compiling @file{alloca.c}. Source files that use @code{alloca} should start with a piece of code -like the following, to declare it properly. Note that in some versions +like the following, to declare it properly. In some versions of AIX, the declaration of @code{alloca} must precede everything else except for comments and preprocessor directives. The @code{#pragma} directive is indented so that pre-ANSI C compilers will ignore it, @@ -964,39 +1668,52 @@ rather than choke on it. @group /* AIX requires this to be the first thing in the file. */ #ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not __GNUC__ */ -#if HAVE_ALLOCA_H -#include -#else /* not HAVE_ALLOCA_H */ -#ifdef _AIX +# define alloca __builtin_alloca +#else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX #pragma alloca -#else /* not _AIX */ +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); -#endif /* not _AIX */ -#endif /* not HAVE_ALLOCA_H */ -#endif /* not __GNUC__ */ +# endif +# endif +# endif +#endif @end group @end example @end defmac -@defmac AC_GETLOADAVG -@maindex GETLOADAVG -@vindex SVR4 -@vindex DGUX -@vindex UMAX -@vindex UMAX4_3 -@vindex NLIST_STRUCT -@vindex NLIST_NAME_UNION -@vindex GETLODAVG_PRIVILEGED -@vindex NEED_SETGID +@defmac AC_FUNC_CLOSEDIR_VOID +@maindex FUNC_CLOSEDIR_VOID +@cvindex CLOSEDIR_VOID +If the @code{closedir} function does not return a meaningful value, +define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its +return value for an error indicator. +@end defmac + +@defmac AC_FUNC_GETLOADAVG +@maindex FUNC_GETLOADAVG +@cvindex SVR4 +@cvindex DGUX +@cvindex UMAX +@cvindex UMAX4_3 +@cvindex NLIST_STRUCT +@cvindex NLIST_NAME_UNION +@cvindex GETLODAVG_PRIVILEGED +@cvindex NEED_SETGID +@ovindex LIBOBJS +@ovindex NEED_SETGID +@ovindex KMEM_GROUP Check how to get the system load averages. If the system has the @code{getloadavg} function, this macro defines @code{HAVE_GETLOADAVG}, and adds to @code{LIBS} any libraries needed to get that function. -Otherwise, it adds @samp{getloadavg.o} to the @code{make} variable +Otherwise, it adds @samp{getloadavg.o} to the output variable @code{LIBOBJS}, and possibly defines several other C preprocessor -macros and @code{make} variables: +macros and output variables: @enumerate @item @@ -1017,48 +1734,71 @@ programs need to be installed specially on this system for @code{GETLOADAVG_PRIVILEGED}. @item -This macro always defines @code{NEED_SETGID}, for @code{make}. The -value is @samp{true} if special installation is required, @samp{false} -if not. If @code{NEED_SETGID} is @samp{true}, it sets @code{KMEM_GROUP} +This macro sets the output variable @code{NEED_SETGID}. The value is +@samp{true} if special installation is required, @samp{false} if not. +If @code{NEED_SETGID} is @samp{true}, this macro sets @code{KMEM_GROUP} to the name of the group that should own the installed program. @end enumerate @end defmac -@defmac AC_MMAP -@maindex MMAP -@vindex HAVE_MMAP -If the @code{mmap} function exists and works correctly, define -@code{HAVE_MMAP}. +@defmac AC_FUNC_GETMNTENT +@maindex FUNC_GETMNTENT +@cvindex HAVE_GETMNTENT +Check for the @code{getmntent} in the @file{sun} and @file{seq} +libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is +available, define @code{HAVE_GETMNTENT}. @end defmac -@defmac AC_SETVBUF_REVERSED -@maindex SETVBUF_REVERSED -@vindex SETVBUF_REVERSED +@defmac AC_FUNC_MEMCMP +@maindex FUNC_MEMCMP +@ovindex LIBOBJS +If the @code{memcmp} function is not available, or does not work on +8-bit data (like the one on SunOS 4.1.3), add @samp{memcmp.o} to output +variable @code{LIBOBJS}. +@end defmac + +@defmac AC_FUNC_MMAP +@maindex FUNC_MMAP +@cvindex HAVE_MMAP +If the @code{mmap} function exists and works correctly on memory mapped +files, define @code{HAVE_MMAP}. +@end defmac + +@defmac AC_FUNC_SETVBUF_REVERSED +@maindex FUNC_SETVBUF_REVERSED +@cvindex SETVBUF_REVERSED If @code{setvbuf} takes the buffering type as its second argument and the buffer pointer as the third, instead of the other way around, define @code{SETVBUF_REVERSED}. This is the case on System V before release 3. @end defmac -@defmac AC_STRCOLL -@maindex STRCOLL -@vindex HAVE_STRCOLL +@defmac AC_FUNC_STRCOLL +@maindex FUNC_STRCOLL +@cvindex HAVE_STRCOLL If the @code{strcoll} function exists and works correctly, define @code{HAVE_STRCOLL}. This does a bit more than -@samp{AC_HAVE_FUNCS(strcoll)}, because some systems have incorrect +@samp{AC_CHECK_FUNCS(strcoll)}, because some systems have incorrect definitions of @code{strcoll}, which should not be used. @end defmac -@defmac AC_UTIME_NULL -@maindex UTIME_NULL -@vindex HAVE_UTIME_NULL +@defmac AC_FUNC_STRFTIME +@maindex FUNC_STRFTIME +@cvindex HAVE_STRFTIME +Check for @code{strftime} in the @file{intl} library, for SCO UNIX. +Then, if @code{strftime} is available, define @code{HAVE_STRFTIME}. +@end defmac + +@defmac AC_FUNC_UTIME_NULL +@maindex FUNC_UTIME_NULL +@cvindex HAVE_UTIME_NULL If @samp{utime(@var{file}, NULL)} sets @var{file}'s timestamp to the present, define @code{HAVE_UTIME_NULL}. @end defmac -@defmac AC_VFORK -@maindex VFORK -@vindex HAVE_VFORK_H -@vindex vfork +@defmac AC_FUNC_VFORK +@maindex FUNC_VFORK +@cvindex HAVE_VFORK_H +@cvindex vfork If @file{vfork.h} is found, define @code{HAVE_VFORK_H}. If a working @code{vfork} is not found, define @code{vfork} to be @code{fork}. This macro checks for several known errors in implementations of @code{vfork} @@ -1066,304 +1806,723 @@ and considers the system to not have a working @code{vfork} if it detects any of them. @end defmac -@defmac AC_VPRINTF -@maindex VPRINTF -@vindex HAVE_VPRINTF -@vindex HAVE_DOPRNT +@defmac AC_FUNC_VPRINTF +@maindex FUNC_VPRINTF +@cvindex HAVE_VPRINTF +@cvindex HAVE_DOPRNT If @code{vprintf} is found, define @code{HAVE_VPRINTF}. Otherwise, if @code{_doprnt} is found, define @code{HAVE_DOPRNT}. (If @code{vprintf} is available, you may assume that @code{vfprintf} and @code{vsprintf} are also available.) @end defmac -@defmac AC_WAIT3 -@maindex WAIT3 -@vindex HAVE_WAIT3 +@defmac AC_FUNC_WAIT3 +@maindex FUNC_WAIT3 +@cvindex HAVE_WAIT3 If @code{wait3} is found and fills in the contents of its third argument (a @samp{struct rusage *}), which HP-UX does not do, define @code{HAVE_WAIT3}. @end defmac -@node Structures, Compiler Characteristics, Library Functions, Specific Tests -@section Structures +@node Generic Functions, , Particular Functions, Library Functions +@subsection Generic Function Checks + +These macros are used to find functions not covered by the particular +test macros. If the functions might be in libraries other than the +default C library, first call @code{AC_CHECK_LIB} for those libraries. +If you need to check the behavior of a function as well as find out +whether it is present, you have to write your own test for +it (@pxref{Writing Tests}). + +@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex CHECK_FUNC +If C function @var{function} is available, run shell commands +@var{action-if-found}, otherwise @var{action-if-not-found}. If you just +want to define a symbol if the function is available, consider using +@code{AC_CHECK_FUNCS} instead. This macro checks for functions with C +linkage even when @code{AC_LANG_CPLUSPLUS} has been called, since C++ is +more standardized than C is. (@pxref{Language Choice}, for more +information about selecting the language for checks.) +@end defmac + +@defmac AC_CHECK_FUNCS (@var{function}@dots{} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex CHECK_FUNCS +@cvindex HAVE_@var{function} +For each given @var{function} in the whitespace-separated argument list +that is available, define @code{HAVE_@var{function}} (in all capitals). If +@var{action-if-found} is given, it is additional shell code to execute +when one of the functions is found. You can give it a value of +@samp{break} to break out of the loop on the first match. If +@var{action-if-not-found} is given, it is executed when one of the +functions is not found. +@end defmac + +@defmac AC_REPLACE_FUNCS (@var{function-name}@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}. +@end defmac + +@node Header Files, Structures, Library Functions, Existing Tests +@section Header Files + +The following macros check for the presence of certain C header files. +If there is no macro specifically defined to check for a header file you need, +and you don't need to check for any special properties of +it, then you can use one of the general header file check macros. + +@menu +* Particular Headers:: Special handling to find certain headers. +* Generic Headers:: How to find other headers. +@end menu + +@node Particular Headers, Generic Headers, , Header Files +@subsection Particular Header Checks + +These macros check for particular system header files---whether they +exist, and in some cases whether they declare certain symbols. + +@defmac AC_DECL_SYS_SIGLIST +@maindex DECL_SYS_SIGLIST +@cvindex SYS_SIGLIST_DECLARED +Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is +declared in a system header file, either @file{signal.h} or +@file{unistd.h}. +@end defmac + +@defmac AC_DIR_HEADER +@maindex DIR_HEADER +@cvindex DIRENT +@cvindex SYSDIR +@cvindex SYSNDIR +@cvindex NDIR +@cvindex VOID_CLOSEDIR +Like calling @code{AC_HEADER_DIRENT} and @code{AC_FUNC_CLOSEDIR_VOID}, +but defines a different set of C preprocessor macros to indicate which +header file is found. This macro and the names it defines are +considered obsolete. The names it defines are: + +@c The printed table looks too spaced out with blank lines between the entries. +@table @file +@item dirent.h +@code{DIRENT} +@item sys/ndir.h +@code{SYSNDIR} +@item sys/dir.h +@code{SYSDIR} +@item ndir.h +@code{NDIR} +@end table + +In addition, if the @code{closedir} function does not return a +meaningful value, define @code{VOID_CLOSEDIR}. +@end defmac + +@defmac AC_HEADER_DIRENT +@maindex HEADER_DIRENT +@cvindex HAVE_DIRENT_H +@cvindex HAVE_NDIR_H +@cvindex HAVE_SYS_DIR_H +@cvindex HAVE_SYS_NDIR_H +Check for the following header files, and for the first one that is +found and defines @samp{DIR}, define the listed C preprocessor macro: + +@c The printed table looks too spaced out with blank lines between the entries. +@table @file +@item dirent.h +@code{HAVE_DIRENT_H} +@item sys/ndir.h +@code{HAVE_SYS_NDIR_H} +@item sys/dir.h +@code{HAVE_SYS_DIR_H} +@item ndir.h +@code{HAVE_NDIR_H} +@end table + +The directory library declarations in the source code should look +something like the following: + +@example +@group +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif +@end group +@end example + +Using the above declarations, the program would declare variables to be +type @code{struct dirent}, not @code{struct direct}, and would access +the length of a directory entry name by passing a pointer to a +@code{struct dirent} to the @code{NAMLEN} macro. + +This macro also checks for the SCO Xenix @file{dir} and @file{x} libraries. +@end defmac + +@defmac AC_HEADER_MAJOR +@maindex HEADER_MAJOR +@cvindex MAJOR_IN_MKDEV +@cvindex MAJOR_IN_SYSMACROS +If @file{sys/types.h} does not define @code{major}, @code{minor}, and +@code{makedev}, but @file{sys/mkdev.h} does, define +@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define +@code{MAJOR_IN_SYSMACROS}. +@end defmac + +@defmac AC_HEADER_STDC +@maindex HEADER_STDC +@cvindex STDC_HEADERS +Define @code{STDC_HEADERS} if the system has ANSI C header files. +Specifically, this macro checks for @file{stdlib.h}, @file{stdarg.h}, +@file{string.h}, and @file{float.h}; if the system has those, it +probably has the rest of the ANSI C header files. This macro also +checks whether @file{string.h} declares @code{memchr} (and thus +presumably the other @code{mem} functions), whether @file{stdlib.h} +declare @code{free} (and thus presumably @code{malloc} and other related +functions), and whether the @file{ctype.h} macros work on characters +with the high bit set, as ANSI C requires. + +Use @code{STDC_HEADERS} instead of @code{__STDC__} to determine whether +the system has ANSI-compliant header files (and probably C library +functions) because many systems that have GCC do not have ANSI C header +files. + +On systems without ANSI C headers, there is so much variation that it is +probably easier to declare the functions you use than to figure out +exactly what the system header files declare. Some systems contain a +mix of functions ANSI and BSD; some are mostly ANSI but lack +@samp{memmove}; some define the BSD functions as macros in +@file{string.h} or @file{strings.h}; some have only the BSD functions +but @file{string.h}; some declare the memory functions in +@file{memory.h}, some in @file{string.h}; etc. It is probably +sufficient to check for one string function and one memory function; if +the library has the ANSI versions of those then it probably has most of +the others. If you put the following in @file{configure.in}: + +@example +AC_HEADER_STDC +AC_CHECK_FUNCS(strchr memcpy) +@end example + +@noindent +then, in your code, you can put declarations like this: + +@example +@group +#if STDC_HEADERS +# include +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr (), *strrchr (); +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif +@end group +@end example + +@noindent +If you use a function like @code{memchr}, @code{memset}, @code{strtok}, +or @code{strspn}, which have no BSD equivalent, then macros won't +suffice; you must provide an implementation of each function. An easy +way to incorporate your implementations only when needed (since the ones +in system C libraries may be hand optimized) is to, taking @code{memchr} +for example, put it in @file{memchr.c} and use +@samp{AC_REPLACE_FUNCS(memchr)}. +@end defmac + +@defmac AC_HEADER_SYS_WAIT +@maindex HEADER_SYS_WAIT +@cvindex HAVE_SYS_WAIT_H +If @file{sys/wait.h} exists and is compatible with POSIX.1, define +@code{HAVE_SYS_WAIT_H}. Incompatibility can occur if @file{sys/wait.h} +does not exist, or if it uses the old BSD @code{union wait} instead of +@code{int} to store a status value. If @file{sys/wait.h} is not POSIX.1 +compatible, then instead of including it, define the POSIX.1 macros with +their usual interpretations. Here is an example: + +@example +@group +#include +#if HAVE_SYS_WAIT_H +# include +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +@end group +@end example +@end defmac + +@defmac AC_MEMORY_H +@maindex MEMORY_H +@cvindex NEED_MEMORY_H +Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are +not declared in @file{string.h} and @file{memory.h} exists. This macro +is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the +example for @code{AC_HEADER_STDC}. +@end defmac + +@defmac AC_UNISTD_H +@maindex UNISTD_H +@cvindex HAVE_UNISTD_H +Define @code{HAVE_UNISTD_H} if the system has @file{unistd.h}. This +macro is obsolete; instead, use @samp{AC_CHECK_HEADERS(unistd.h)}. + +The way to check if the system supports POSIX.1 is: + +@example +@group +#if HAVE_UNISTD_H +# include +# include +#endif + +#ifdef _POSIX_VERSION +/* Code for POSIX.1 systems. */ +#endif +@end group +@end example + +@cvindex _POSIX_VERSION +@code{_POSIX_VERSION} is defined when @file{unistd.h} is included on +POSIX.1 systems. If there is no @file{unistd.h}, it is definitely not a +POSIX.1 system. However, some non-POSIX.1 systems do have @file{unistd.h}. +@end defmac + +@defmac AC_USG +@maindex USG +@cvindex USG +Define @code{USG} if the system does not have @file{strings.h}, +@code{rindex}, @code{bzero}, etc. This implies that it has +@file{string.h}, @code{strrchr}, @code{memset}, etc. + +The symbol @code{USG} is obsolete. Instead of this macro, see the +example for @code{AC_HEADER_STDC}. +@end defmac + +@node Generic Headers, , Particular Headers, Header Files +@subsection Generic Header Checks + +These macros are used to find system header files not covered by the +particular test macros. If you need to check the contents of a header +as well as find out whether it is present, you have to write your own +test for it (@pxref{Writing Tests}). + +@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex CHECK_HEADER +If the system header file @var{header-file} exists, execute shell commands +@var{action-if-found}, otherwise execute @var{action-if-not-found}. If +you just want to define a symbol if the header file is available, +consider using @code{AC_CHECK_HEADERS} instead. +@end defmac + +@defmac AC_CHECK_HEADERS (@var{header-file}@dots{} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex CHECK_HEADERS +@cvindex HAVE_@var{header} +For each given system header file @var{header-file} in the +whitespace-separated argument list that exists, define +@code{HAVE_@var{header-file}} (in all capitals). If @var{action-if-found} +is given, it is additional shell code to execute when one of the header +files is found. You can give it a value of @samp{break} to break out of +the loop on the first match. If @var{action-if-not-found} is given, it +is executed when one of the header files is not found. +@end defmac + +@node Structures, Typedefs, Header Files, Existing Tests +@section Structures + +The following macros check for certain structures or structure members. +To check structures not listed here, use @code{AC_EGREP_CPP} +(@pxref{Examining Declarations}) or @code{AC_TRY_COMPILE} +(@pxref{Examining Syntax}). + +@defmac AC_HEADER_STAT +@maindex HEADER_STAT +@maindex STAT_MACROS_BROKEN +If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in +@file{sys/stat.h} do not work properly (returning false positives), +define @code{STAT_MACROS_BROKEN}. This is the case on Tektronix UTekV, +Amdahl UTS and Motorola System V/88. +@end defmac + +@defmac AC_HEADER_TIME +@maindex HEADER_TIME +@cvindex TIME_WITH_SYS_TIME +If a program may include both @file{time.h} and @file{sys/time.h}, +define @code{TIME_WITH_SYS_TIME}. On some older systems, +@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not +protected against multiple inclusion, so programs should not explicitly +include both files. This macro is useful in programs that use, for +example, @code{struct timeval} or @code{struct timezone} as well as +@code{struct tm}. It is best used in conjunction with +@code{HAVE_SYS_TIME_H}, which can be checked for using +@code{AC_CHECK_HEADERS(sys/time.h)}. + +@example +@group +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +@end group +@end example +@end defmac + +@defmac AC_STRUCT_ST_BLKSIZE +@maindex STRUCT_ST_BLKSIZE +@cvindex HAVE_ST_BLKSIZE +If @code{struct stat} contains an @code{st_blksize} member, define +@code{HAVE_ST_BLKSIZE}. +@end defmac + +@defmac AC_STRUCT_ST_BLOCKS +@maindex STRUCT_ST_BLOCKS +@cvindex HAVE_ST_BLOCKS +@ovindex LIBOBJS +If @code{struct stat} contains an @code{st_blocks} member, define +@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the +output variable @code{LIBOBJS}. +@end defmac + +@defmac AC_STRUCT_ST_RDEV +@maindex STRUCT_ST_RDEV +@cvindex HAVE_ST_RDEV +If @code{struct stat} contains an @code{st_rdev} member, define +@code{HAVE_ST_RDEV}. +@end defmac + +@defmac AC_STRUCT_TM +@maindex STRUCT_TM +@cvindex TM_IN_SYS_TIME +If @file{time.h} does not define @code{struct tm}, define +@code{TM_IN_SYS_TIME}, which means that including @file{sys/time.h} +had better define @code{struct tm}. +@end defmac + +@defmac AC_STRUCT_TIMEZONE +@maindex STRUCT_TIMEZONE +@cvindex HAVE_TM_ZONE +@cvindex HAVE_TZNAME +Figure out how to get the current timezone. If @code{struct tm} has a +@code{tm_zone} member, define @code{HAVE_TM_ZONE}. Otherwise, if the +external array @code{tzname} is found, define @code{HAVE_TZNAME}. +@end defmac + +@node Typedefs, Compiler Characteristics, Structures, Existing Tests +@section Typedefs + +The following macros check for C typedefs. If there is no macro +specifically defined to check for a typedef you need, and you don't need +to check for any special properties of it, then you can use a general +typedef check macro. + +@menu +* Particular Typedefs:: Special handling to find certain types. +* Generic Typedefs:: How to find other types. +@end menu + +@node Particular Typedefs, Generic Typedefs, , Typedefs +@subsection Particular Typedef Checks -The following macros check for certain structures or structure members: +These macros check for particular C typedefs. -@defmac AC_STAT_MACROS_BROKEN -@maindex STAT_MACROS_BROKEN -@maindex STAT_MACROS_BROKEN -If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in -@file{sys/stat.h} do not work properly (returning false positives), -define @code{STAT_MACROS_BROKEN}. This is the case on Tektronix UTekV, -Amdahl UTS and Motorola System V/88. +@defmac AC_TYPE_GETGROUPS +@maindex TYPE_GETGROUPS +@cvindex GETGROUPS_T +Define @code{GETGROUPS_T} to be whichever of @code{gid_t} or @code{int} +is the base type of the array argument to @code{getgroups}. @end defmac -@defmac AC_ST_BLKSIZE -@maindex ST_BLKSIZE -@vindex HAVE_ST_BLKSIZE -If @code{struct stat} contains an @code{st_blksize} member, define -@code{HAVE_ST_BLKSIZE}. +@defmac AC_TYPE_MODE_T +@maindex TYPE_MODE_T +@cvindex mode_t +If @code{mode_t} is not defined in @file{sys/types.h}, define +@code{mode_t} to be @code{int}. @end defmac -@defmac AC_ST_BLOCKS -@maindex ST_BLOCKS -@vindex HAVE_ST_BLOCKS -If @code{struct stat} contains an @code{st_blocks} member, define -@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the -@code{make} variable @code{LIBOBJS}. +@defmac AC_TYPE_OFF_T +@maindex TYPE_OFF_T +@cvindex off_t +If @code{off_t} is not defined in @file{sys/types.h}, define +@code{off_t} to be @code{long}. @end defmac -@defmac AC_ST_RDEV -@maindex ST_RDEV -@vindex HAVE_ST_RDEV -If @code{struct stat} contains an @code{st_rdev} member, define -@code{HAVE_ST_RDEV}. +@defmac AC_TYPE_PID_T +@maindex TYPE_PID_T +@cvindex pid_t +If @code{pid_t} is not defined in @file{sys/types.h}, define +@code{pid_t} to be @code{int}. @end defmac -@defmac AC_TIME_WITH_SYS_TIME -@maindex TIME_WITH_SYS_TIME -@vindex TIME_WITH_SYS_TIME -If a program may include both @file{time.h} and @file{sys/time.h}, -define @code{TIME_WITH_SYS_TIME}. On some older systems, -@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not -protected against multiple inclusion, so programs should not explicitly -include both files. This macro is useful in programs that use, for -example, @code{struct timeval} or @code{struct timezone} as well as -@code{struct tm}. It is best used in conjunction with -@code{HAVE_SYS_TIME_H}. +@defmac AC_TYPE_SIGNAL +@maindex TYPE_SIGNAL +@cvindex RETSIGTYPE +If @file{signal.h} declares @code{signal} as returning a pointer to a +function returning @code{void}, define @code{RETSIGTYPE} to be +@code{void}; otherwise, define it to be @code{int}. + +Define signal handlers as returning type @code{RETSIGTYPE}: @example -#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif +@group +RETSIGTYPE +hup_handler () +@{ +@dots{} +@} +@end group @end example @end defmac -@defmac AC_STRUCT_TM -@maindex STRUCT_TM -@vindex TM_IN_SYS_TIME -If @file{time.h} does not define @code{struct tm}, define -@code{TM_IN_SYS_TIME}, which means that including @file{sys/time.h} -defines @code{struct tm}. +@defmac AC_TYPE_SIZE_T +@maindex TYPE_SIZE_T +@cvindex size_t +If @code{size_t} is not defined in @file{sys/types.h}, define +@code{size_t} to be @code{unsigned}. @end defmac -@defmac AC_TIMEZONE -@maindex TIMEZONE -@vindex HAVE_TM_ZONE -@vindex HAVE_TZNAME -Figure out how to get the current timezone. If @code{struct tm} has a -@code{tm_zone} member, define @code{HAVE_TM_ZONE}. Otherwise, if the -external array @code{tzname} is found, define @code{HAVE_TZNAME}. This -macro calls @code{AC_STRUCT_TM} if it hasn't been called already. +@defmac AC_TYPE_UID_T +@maindex TYPE_UID_T +@cvindex uid_t +@cvindex gid_t +If @code{uid_t} is not defined in @file{sys/types.h}, define +@code{uid_t} to be @code{int} and @code{gid_t} to be @code{int}. @end defmac -@node Compiler Characteristics, System Services, Structures, Specific Tests -@section Compiler Characteristics +@node Generic Typedefs, , Particular Typedefs, Typedefs +@subsection Generic Typedef Checks -The following macros check for C compiler or machine architecture -features: +This macro is used to check for typedefs not covered by the particular +test macros. -@defmac AC_ARG_ARRAY -@maindex ARG_ARRAY -@vindex NO_ARG_ARRAY -If the address of an argument to a C function can not be used like -the start of an array, define @code{NO_ARG_ARRAY}. This ability allows -a sequence of arguments with the same type to be accessed as if they -were an array of values. +@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 that is present), define it to be the C (or C++) +builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}. @end defmac -@defmac AC_CROSS_CHECK -@maindex CROSS_CHECK -If the C compiler being used does not produce executables that can run -on the system where @code{configure} is being run, set the shell -variable @code{cross_compiling} to 1. This information can be used by -@code{AC_TEST_PROGRAM} to determine whether to take a default action -instead of trying to run a test program (@pxref{General Feature Tests}). -@end defmac +@node Compiler Characteristics, System Services, Typedefs, Existing Tests +@section Compiler Characteristics -@defmac AC_CHAR_UNSIGNED -@maindex CHAR_UNSIGNED -@vindex __CHAR_UNSIGNED__ -If the C type @code{char} is unsigned, define @code{__CHAR_UNSIGNED__}, -unless the C compiler predefines it. +The following macros check for C compiler or machine architecture +features. To check for characteristics not listed here, use +@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}) or @code{AC_TRY_RUN} +(@pxref{Run Time}) + +@defmac AC_C_BIGENDIAN +@maindex C_BIGENDIAN +@cvindex WORDS_BIGENDIAN +If words are stored with the most significant byte first (like Motorola +and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}. @end defmac -@defmac AC_CONST -@maindex CONST -@vindex const +@defmac AC_C_CONST +@maindex C_CONST +@cvindex const If the C compiler does not fully support the keyword @code{const}, define @code{const} to be empty. Some C compilers that do not define @code{__STDC__} do support @code{const}; some compilers that define @code{__STDC__} do not completely support @code{const}. Programs can simply use @code{const} as if every C compiler supported it; for those that don't, the @file{Makefile} or configuration header file will define -it as empty. (If using a configuration header file, the program should -include it before any other header files, to prevent inconsistencies in -declarations.) +it as empty. @end defmac -@defmac AC_INLINE -@maindex INLINE -@vindex inline +@defmac AC_C_INLINE +@maindex C_INLINE +@cvindex inline If the C compiler is a version of GCC that supports the keyword @code{__inline} but not @code{inline} (such as some NeXT versions), -define @code{inline} to be @code{__inline}. This macro calls -@code{AC_PROG_CC} if it hasn't been called already. +define @code{inline} to be @code{__inline}. +@end defmac + +@defmac AC_C_CHAR_UNSIGNED +@maindex C_CHAR_UNSIGNED +@cvindex __CHAR_UNSIGNED__ +If the C type @code{char} is unsigned, define @code{__CHAR_UNSIGNED__}, +unless the C compiler predefines it. +@end defmac + +@defmac AC_C_LONG_DOUBLE +@maindex C_LONG_DOUBLE +@cvindex HAVE_LONG_DOUBLE +If the C compiler supports the @code{long double} type, define +@code{HAVE_LONG_DOUBLE}. Some C compilers that do not define +@code{__STDC__} do support the @code{long double} type; some compilers +that define @code{__STDC__} do not support @code{long double}. +@end defmac + +@defmac AC_CHECK_SIZEOF (@var{type}) +@maindex CHECK_SIZEOF +Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or +C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If +@samp{type} is unknown to the compiler, it gets a size of 0. @var{uctype} +is @var{type}, with lowercase converted to uppercase, spaces changed to +underscores, and asterisks changed to @samp{P}. For example, the call +@example +AC_CHECK_SIZEOF(int *) +@end example +@noindent +defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems. @end defmac @defmac AC_INT_16_BITS @maindex INT_16_BITS -@vindex INT_16_BITS +@cvindex INT_16_BITS If the C type @code{int} is 16 bits wide, define @code{INT_16_BITS}. This macro is obsolete; it is more general to use -@samp{AC_SIZEOF_TYPE(int)} instead (@pxref{General Feature Tests}). +@samp{AC_CHECK_SIZEOF(int)} instead. @end defmac @defmac AC_LONG_64_BITS @maindex LONG_64_BITS -@vindex LONG_64_BITS +@cvindex LONG_64_BITS If the C type @code{long int} is 64 bits wide, define @code{LONG_64_BITS}. This macro is obsolete; it is more general to use -@samp{AC_SIZEOF_TYPE(long)} instead (@pxref{General Feature Tests}). -@end defmac - -@defmac AC_LONG_DOUBLE -@maindex HAVE_LONG_DOUBLE -@vindex HAVE_LONG_DOUBLE -If the C compiler supports the @code{long double} type, define -@code{HAVE_LONG_DOUBLE}. Some C compilers that do not define -@code{__STDC__} do support the @code{long double} type; some compilers -that define @code{__STDC__} do not support @code{long double}. +@samp{AC_CHECK_SIZEOF(long)} instead. @end defmac -@defmac AC_WORDS_BIGENDIAN -@maindex WORDS_BIGENDIAN -@vindex WORDS_BIGENDIAN -If words are stored with the most significant byte first (like Motorola -and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}. -@end defmac - -@node System Services, UNIX Variants, Compiler Characteristics, Specific Tests +@node System Services, UNIX Variants, Compiler Characteristics, Existing Tests @section System Services -The following macros check for operating system services: +The following macros check for operating system services or capabilities. -@defmac AC_FIND_X -@maindex FIND_X -Try to locate the X Window System include files and libraries. Try -first by running @code{xmkmf} on a trivial @file{Imakefile} and -examining the @file{Makefile} that it produces. If that fails (such as -if @code{xmkmf} is not present), look for them in several directories -where they often reside. If either method is successful, set the shell -variables @code{x_includes} and @code{x_libraries} to their locations, -unless they are in directories the compiler searches by default. +@defmac AC_SYS_INTERPRETER +@maindex SYS_INTERPRETER +Check whether the system supports starting scripts with a line of the +form @samp{#!/bin/csh} to select the interpreter to use for the script. +After running this macro, shell code in @code{configure.in} can check +the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes} +if the system supports @samp{#!}, @samp{no} if not. +@end defmac + +@defmac AC_PATH_X +@maindex PATH_X +Try to locate the X Window System include files and libraries. If the +user gave the command line options @samp{--x-includes=@var{dir}} and +@samp{--x-libraries=@var{dir}}, use those directories. If either or +both were not given, get the missing values by running @code{xmkmf} on a +trivial @file{Imakefile} and examining the @file{Makefile} that it +produces. If that fails (such as if @code{xmkmf} is not present), look +for them in several directories where they often reside. If either +method is successful, set the shell variables @code{x_includes} and +@code{x_libraries} to their locations, unless they are in directories +the compiler searches by default. If both methods fail, or the user gave the command line option -@samp{--without-x}, set the shell variable @code{no_x} to @samp{true}; +@samp{--without-x}, set the shell variable @code{no_x} to @samp{yes}; otherwise set it to the empty string. - -The command line options @samp{--x-includes=@var{dir}} and -@samp{--x-libraries=@var{dir}} override the values chosen by this macro. @end defmac -@defmac AC_FIND_XTRA -@maindex FIND_XTRA -An enhanced version of @code{AC_FIND_X}. Put the C compiler flags that -X needs into @code{make} variable @code{X_CFLAGS}, and the X linker -flags into @code{X_LIBS}. If X is not available, put -@samp{-DX_DISPLAY_MISSING} into @code{X_CFLAGS}. +@defmac AC_PATH_XTRA +@maindex PATH_XTRA +@ovindex X_CFLAGS +@ovindex X_LIBS +@ovindex X_EXTRA_LIBS +@ovindex X_PRE_LIBS +An enhanced version of @code{AC_PATH_X}. Add the C compiler flags that +X needs to output variable @code{X_CFLAGS}, and the X linker flags to +@code{X_LIBS}. If X is not available, add @samp{-DX_DISPLAY_MISSING} to +@code{X_CFLAGS}. Also check for special libraries that some systems need in order to -compile X programs. Add any that the system needs to @code{make} -variable @code{X_EXTRA_LIBS}. This macro calls @code{AC_FIND_X} and -@code{AC_ISC_POSIX} (@pxref{UNIX Variants}) if they have not already -been called. Because of the macro dependencies, if you call this macro, -you should let it call @code{AC_FIND_X} rather than doing that yourself. -@end defmac - -@defmac AC_HAVE_POUNDBANG (@var{action-if-supported} @r{[}, @var{action-if-not-supported}@r{]}) -@maindex HAVE_POUNDBANG -Check whether the system supports starting shell scripts with a line of -the form @samp{#!/bin/csh} to select the shell to use. If @samp{#!} -works, execute shell commands @var{action-if-supported}; if not, execute -@var{action-if-not-supported}. +compile X programs. Add any that the system needs to output variable +@code{X_EXTRA_LIBS}. And check for special X11R6 libraries that need to +be linked with before @samp{-lX11}, and add any found to the output +variable @code{X_PRE_LIBS}. @end defmac -@defmac AC_LONG_FILE_NAMES -@maindex LONG_FILE_NAMES -@vindex HAVE_LONG_FILE_NAMES +@defmac AC_SYS_LONG_FILE_NAMES +@maindex SYS_LONG_FILE_NAMES +@cvindex HAVE_LONG_FILE_NAMES If the system supports file names longer than 14 characters, define @code{HAVE_LONG_FILE_NAMES}. @end defmac -@defmac AC_REMOTE_TAPE -@maindex REMOTE_TAPE -@vindex HAVE_SYS_MTIO_H -If BSD tape drive ioctls are available, define @code{HAVE_SYS_MTIO_H}, -and if sockets are available add @code{rmt} to @code{make} variable -@code{PROGS}. -@end defmac - -@defmac AC_RESTARTABLE_SYSCALLS -@maindex RESTARTABLE_SYSCALLS -@vindex HAVE_RESTARTABLE_SYSCALLS +@defmac AC_SYS_RESTARTABLE_SYSCALLS +@maindex SYS_RESTARTABLE_SYSCALLS +@cvindex HAVE_RESTARTABLE_SYSCALLS If the system automatically restarts a system call that is interrupted by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. @end defmac -@node UNIX Variants, , System Services, Specific Tests +@node UNIX Variants, , System Services, Existing Tests @section UNIX Variants The following macros check for certain operating systems that need special treatment for some programs, due to exceptional oddities in -their header files or libraries: +their header files or libraries. These macros are warts; they will be +replaced by a more systematic approach, based on the functions they make +available or the environments they provide. @defmac AC_AIX @maindex AIX -@vindex _ALL_SOURCE +@cvindex _ALL_SOURCE If on AIX, define @code{_ALL_SOURCE}. Allows the use of some BSD functions. Should be called before any macros that run the C compiler. @end defmac @defmac AC_DYNIX_SEQ @maindex DYNIX_SEQ -If on DYNIX/ptx (Sequent UNIX), add @samp{-lseq} to @code{make} -variable @code{LIBS}. Allows use of some BSD system calls and -@code{getmntent}. +If on Dynix/PTX (Sequent UNIX), add @samp{-lseq} to output +variable @code{LIBS}. This macro is obsolete; instead, use +@code{AC_FUNC_GETMNTENT}. @end defmac @defmac AC_IRIX_SUN @maindex IRIX_SUN -If on IRIX (Silicon Graphics UNIX), add @samp{-lsun} to @code{make} -variable @code{LIBS}. Needed to get @code{getmntent}. At sites using -Yellow Pages/NIS, it is also needed to get properly working -@code{gethostby*}, @code{getpw*}, @code{getgr*}, @code{getnetby*}, and -so on. -@c (According to Garrett.Wollman@uvm.edu.) +If on IRIX (Silicon Graphics UNIX), add @samp{-lsun} to output variable +@code{LIBS}. This macro is obsolete. If you were using it to get +@code{getmntent}, use @code{AC_FUNC_GETMNTENT} instead. If you used it +for the NIS versions of the password and group functions, use +@samp{AC_CHECK_LIB(sun, getpwnam)}. @end defmac @defmac AC_ISC_POSIX @maindex ISC_POSIX -@vindex _POSIX_SOURCE +@cvindex _POSIX_SOURCE +@ovindex CC If on a POSIXized ISC UNIX, define @code{_POSIX_SOURCE} and add @samp{-posix} (for the GNU C compiler) or @samp{-Xp} (for other C -compilers) to @code{make} variable @code{CC}. This allows the use of +compilers) to output variable @code{CC}. This allows the use of POSIX facilities. Must be called after @code{AC_PROG_CC} and before any other macros that run the C compiler. @end defmac @defmac AC_MINIX @maindex MINIX -@vindex _MINIX -@vindex _POSIX_SOURCE -@vindex _POSIX_1_SOURCE +@cvindex _MINIX +@cvindex _POSIX_SOURCE +@cvindex _POSIX_1_SOURCE If on Minix, define @code{_MINIX} and @code{_POSIX_SOURCE} and define @code{_POSIX_1_SOURCE} to be 2. This allows the use of POSIX facilities. Should be called before any macros that run the C compiler. @@ -1371,799 +2530,934 @@ facilities. Should be called before any macros that run the C compiler. @defmac AC_SCO_INTL @maindex SCO_INTL -If on SCO UNIX, add @samp{-lintl} to @code{make} variable @code{LIBS}. -Used to get @code{strftime}. It must be called before checking for -@code{strftime}. +@ovindex LIBS +If on SCO UNIX, add @samp{-lintl} to output variable @code{LIBS}. +This macro is obsolete; instead, use @code{AC_FUNC_STRFTIME}. @end defmac @defmac AC_XENIX_DIR @maindex XENIX_DIR -@vindex VOID_CLOSEDIR -If on Xenix, define @code{VOID_CLOSEDIR} and add @samp{-lx} to -@code{make} variable @code{LIBS}. Also, if @file{sys/ndir.h} is not -being used, add @samp{-ldir} to @code{LIBS}. Needed when using the -directory reading functions. This macro must be called after -@code{AC_DIR_HEADER}. +@ovindex LIBS +If on Xenix, add @samp{-lx} to output variable @code{LIBS}. Also, if +@file{dirent.h} is being used, add @samp{-ldir} to @code{LIBS}. This +macro is obsolete; use @code{AC_HEADER_DIRENT} instead. @end defmac -@node General Purpose Macros, Writing Macros, Specific Tests, Top -@chapter General Purpose Macros - -These macros provide ways for other macros to control the kind of output -that Autoconf produces or to check whether various kinds of features are -available. They all take arguments. When calling these macros, there -must not be any blank space between the macro name and the open -parentheses. - -Arguments to these macros can be more than one line long if they are -enclosed within the @code{m4} quote characters @samp{[} and @samp{]}. - -Within each section below, the macros are listed in alphabetical order. -These macros are defined in the file @file{acgeneral.m4}. +@node Writing Tests, Results, Existing Tests, Top +@chapter Writing Tests + +If the existing feature tests don't do something you need, you have to +write new ones. These macros are the building blocks. They provide +ways for other macros to check whether various kinds of features are +available and report the results. + +This chapter contains some suggestions and some of the reasons why the +existing tests are written the way they are. You can also learn a lot +about how to write Autoconf tests by looking at the existing ones. If +something goes wrong in one or more of the Autoconf tests, this +information can help you understand the assumptions behind them, which +might help you figure out how to best solve the problem. + +These macros check the output of the C compiler system. They do +not cache the results of their tests for future use (@pxref{Caching +Results}), because they don't know enough about the information they are +checking for to generate a cache variable name. They also do not print +any messages, for the same reason. The checks for particular kinds of C +features call these macros and do cache their results and print messages +about what they're checking for. @menu -* Setup:: Controlling Autoconf operation. -* General Feature Tests:: Checking for kinds of features. -* Command Line:: Checking command line arguments. -* Setting Variables:: Setting shell and @code{make} variables. -* Printing Messages:: Notifying users of progress or problems. -* Language Choice:: Selecting which language to use for testing. -* Macro Ordering:: Enforcing ordering constraints. -@end menu - -@node Setup, General Feature Tests, , General Purpose Macros -@section Controlling Autoconf Setup - -The following macros control the kind of output that Autoconf produces. - -@defmac AC_CONFIG_HEADER (@var{header-to-create} @dots{}) -@maindex CONFIG_HEADER -@vindex HAVE_CONFIG_H -Make @code{AC_OUTPUT} create the file(s) in the -whitespace-separated list @var{header-to-create} containing C -preprocessor @code{#define} statements and replace @samp{@@DEFS@@} in -generated files with @samp{-DHAVE_CONFIG_H} instead of the value of -@code{DEFS}. -This macro should be called right after @code{AC_INIT}. The usual name -for @var{header-to-create} is @file{config.h}. - -If @var{header-to-create} already exists and its contents are identical -to what @code{AC_OUTPUT} would put in it, it is left alone. Doing this -allows some changes in configuration without needlessly causing object -files that depend on the header file to be recompiled. - -Your distribution should contain a file @file{@var{header-to-create}.in} -that looks as you want the final header file to look, including -comments, with default values in the @code{#define} statements. A -default value can be to @code{#undef} the variable instead of to define -it to a value, if your code tests for configuration options using -@code{#ifdef} instead of @code{#if}. - -You can use the program @code{autoheader} to create -@file{@var{header-to-create}.in} (@pxref{Invoking autoheader}). -@end defmac - -@defmac AC_INIT (@var{unique-file-in-source-dir}) -@maindex INIT -Process the command-line arguments and find the source code directory. -@var{unique-file-in-source-dir} is some file that is in the package's -source directory; @code{configure} checks for this file's existence to -make sure that the directory that it is told contains the source code in -fact does (@pxref{Invoking configure}, for more information). -@end defmac - -@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]}) -@maindex OUTPUT -Create output files (typically one or more @file{Makefile}s) and -@file{config.status}. If @code{AC_CONFIG_HEADER} has been called, also -create the header file that was named as its argument. The argument is -a whitespace-separated list of files to create; if it is omitted, no -files are created. @code{AC_OUTPUT} creates each file @file{@var{file}} -in the list by copying @file{@var{file}.in}, substituting the variable -values that have been selected by calling @code{AC_SUBST}. It creates -the directory that each file is in if it doesn't exist (but not the -parents of that directory). A plausible value for the argument to -@code{AC_OUTPUT} is @samp{Makefile src/Makefile man/Makefile -X/Imakefile}. - -If you pass @var{extra-cmds}, those commands will be inserted into -@file{config.status} to be run after all its other processing. -@end defmac - -@defmac AC_PREPARE (@var{unique-file-in-source-dir}) -@maindex PREPARE -Find the source code directory and set up shell variables necessary for -other Autoconf macros to work. @var{unique-file-in-source-dir} is some -file that is in the package's source directory; @code{configure} checks -for this file's existence to make sure that the directory that it is -told contains the source code in fact does (@pxref{Invoking configure}, -for more information). @code{AC_PREPARE} is the last thing done by -@code{AC_INIT}. Use @code{AC_PREPARE} instead of @code{AC_INIT} if you -want to do argument parsing yourself; never use both. -@end defmac - -@defmac AC_PREREQ (@var{version}) -@maindex PREREQ -Ensure that a recent enough version of Autoconf is being used. If the -version of Autoconf being used to create @code{configure} is earlier -than @var{version} (e.g., @samp{1.8}), print an error message on the -standard error output and do not create @code{configure}. - -This macro is useful if your @file{configure.in} relies on non-obvious -behavior that changed between Autoconf releases. If it merely needs -recently added macros, then @code{AC_PREREQ} is less useful, because the -@code{autoconf} program already tells the user which macros are not -found. The same thing happens if @file{configure.in} is processed by a -version of Autoconf older than when @code{AC_PREREQ} was added. -@end defmac - -@defmac AC_REVISION (@var{revision-info}) -@maindex REVISION -Copy revision stamp @var{revision-info} into the @file{configure} -script, with any dollar signs or double-quotes removed. This macro lets -you put a revision stamp from @file{configure.in} into @file{configure} -without RCS or CVS changing it when you check in @file{configure}. That -way, you can determine easily which revision of @file{configure.in} a -particular @file{configure} corresponds to. - -It is a good idea to call this macro before @code{AC_INIT} so that the -revision number is near the top of both @file{configure.in} and -@file{configure}. To support doing that, the @code{AC_REVISION} output -begins with @samp{#!/bin/sh}, like the normal start of a -@file{configure} script does. - -For example, this line in @file{configure.in}: - -@example -AC_REVISION($@asis{Revision: 1.30 }$)dnl -@end example - -@noindent -produces this in @file{configure}: - -@example -#!/bin/sh -# From configure.in Revision: 1.30 -@end example -@end defmac - -@node General Feature Tests, Command Line, Setup, General Purpose Macros -@section Checking for Kinds of Features - -These macros are templates that, when called with actual parameters, -check for various kinds of features. Many of these macros handle two -cases: what to do if the given condition is met, and what to do if the -condition is not met. In some places you you might want to do something -if a condition is true but do nothing if it's false, or vice versa. To -omit the true case, pass an empty value for the @var{action-if-found} -argument to the macro. To omit the false case, omit the -@var{action-if-not-found} argument to the macro, including the comma -before it. - -One shell programming construction that you should not use in the action -arguments to these macros is -@samp{@var{var}=$@{@var{var}:-@var{value}@}}. Old BSD shells, including -the Ultrix @code{sh}, don't understand the colon, and complain and die. -If you omit the colon, it works fine: -@samp{@var{var}=$@{@var{var}-@var{value}@}}. Using the form without the -colon has one small disadvantage. Users can not select a default value -by giving a variable an empty value, e.g., @samp{CC= configure}. -Instead, they must unset the variable, e.g., @samp{unset CC; configure}. - -@xref{Writing Macros}, for more information on how best to use these -macros. - -@defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) -@maindex COMPILE_CHECK - -Print @samp{checking for @var{echo-text}} to the standard output -(using @code{AC_CHECKING}, @pxref{Printing Messages}). -Create a test C program to see whether a function whose body consists of -@var{function-body} can be compiled and linked; @var{includes} is any -@code{#include} statements needed by the code in @var{function-body}. -If the file compiles and links successfully, run shell commands -@var{action-if-found}, otherwise run @var{action-if-not-found}. -@end defmac - -@defmac AC_FUNC_CHECK (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) -@maindex FUNC_CHECK -If @var{function} is available, run shell commands -@var{action-if-found}, otherwise @var{action-if-not-found}. If the -functions might be in libraries other than the default C library, first -call @code{AC_HAVE_LIBRARY} for those libraries. If you just want to -define a symbol if the function is available, consider using -@code{AC_HAVE_FUNCS} instead. -@end defmac - -@defmac AC_HAVE_FUNCS (@var{function}@dots{}) -@maindex HAVE_FUNCS -@vindex HAVE_@var{function} -For each given @var{function} in the whitespace-separated argument list -that is available, define @code{HAVE_@var{function}} (in all caps). -@xref{Specific Tests}, for a precise definition of ``define'' as it -is used here. If the functions might be in libraries other than the -default C library, first call @code{AC_HAVE_LIBRARY} for those libraries. -@end defmac - -@defmac AC_HAVE_HEADERS (@var{header-file}@dots{}) -@maindex HAVE_HEADERS -@vindex HAVE_@var{header} -For each given @var{header-file} in the whitespace-separated argument -list that exists, define @code{HAVE_@var{header-file}} (in all caps). -@xref{Specific Tests}, for a precise definition of ``define'' as -it is used here. -@end defmac - -@defmac AC_HAVE_LIBRARY (@var{library} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) -@maindex HAVE_LIBRARY -Create a test C program to see whether that program can be linked with -the specified library. @var{action-if-found} is a list of shell -commands to run if the link succeeds (which means that the library is -present); @var{action-if-not-found} is a list of shell commands to run -if the link fails. If @var{action-if-found} and -@var{action-if-not-found} are not specified, the default action is to -add @samp{-lfoo} to @code{LIBS} and define @samp{HAVE_LIBfoo} -for library @samp{foo}. @var{library} can be written as any of -@samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}. In all of those cases, -the compiler is passed @samp{-lfoo}. -@end defmac - -@defmac AC_HEADER_CHECK (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) -@maindex HEADER_CHECK -If @var{header-file} exists, execute shell commands -@var{action-if-found}, otherwise execute @var{action-if-not-found}. If -you just want to define a symbol if the header file is available, -consider using @code{AC_HAVE_HEADERS} instead. -@end defmac - -@defmac AC_HEADER_EGREP (@var{pattern}, @var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) -@maindex HEADER_EGREP -If the output of running the preprocessor on @var{header-file} -contains the @code{egrep} regular expression @var{pattern}, execute -shell commands @var{action-if-found}, otherwise execute - -This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending -on which language is current, @pxref{Language Choice}), if it hasn't -been called already. -@var{action-if-not-found}. - -You can not check whether preprocessor symbols are defined this way, -because they get expanded before @code{egrep} sees them. But you can -almost always detect them by simply using @code{#ifdef} directives in -your programs. -@end defmac - -@defmac AC_PROGRAM_CHECK (@var{variable}, @var{prog-to-check-for}, @var{value-if-found}, @var{value-if-not-found}) -@maindex PROGRAM_CHECK -Check whether program @var{prog-to-check-for} exists in @code{PATH}. If -it is found, set @var{variable} to @var{value-if-found}, otherwise to -@var{value-if-not-found}. If @var{variable} was already set, do nothing. -Calls @code{AC_SUBST} for @var{variable}. -@end defmac - -@defmac AC_PROGRAM_EGREP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) -@maindex PROGRAM_EGREP -@var{program} is the text of a C or C++ program, on which shell variable and -backquote substitutions are performed. If the output of running the -preprocessor on @var{program} contains the @code{egrep} regular -expression @var{pattern}, execute shell commands @var{action-if-found}, -otherwise execute @var{action-if-not-found}. (It is an unfortunate -oversight that we use the word @code{PROGRAM} in Autoconf macro names to -sometimes mean C or C++ source code and sometimes mean a UNIX command.) - -This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending -on which language is current, @pxref{Language Choice}), if it hasn't -been called already. -@end defmac - -@defmac AC_PROGRAM_PATH (@var{variable}, @var{prog-to-check-for}, @var{value-if-not-found}) -@maindex PROGRAM_PATH -Similar to @code{AC_PROGRAM_CHECK}, but set @var{variable} to the entire -path of @var{prog-to-check-for} if found. Otherwise, set @var{variable} -to the value @var{value-if-not-found} and perform no path checking. -If @var{variable} was already set, do nothing. -Calls @code{AC_SUBST} for @var{variable}. -@end defmac - -@defmac AC_PROGRAMS_CHECK (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) -@maindex PROGRAMS_CHECK -Check for each program in the whitespace-separated list -@var{progs-to-check-for} exists in @code{PATH}. If it is found, set -@var{variable} to the name of that program. Otherwise, continue -checking the next program in the list. If none of the programs in the -list are found, set @var{variable} to @var{value-if-not-found}; if -@var{value-if-not-found} is not specified, the value of @var{variable} -will not be changed. Calls @code{AC_SUBST} for @var{variable}. -@end defmac +* 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. +* Portable Shell:: Shell script portability pitfalls. +* Testing Values and Files:: Checking strings and files. +* Multiple Cases:: Tests for several possible values. +* Language Choice:: Selecting which language to use for testing. +@end menu -@defmac AC_PROGRAMS_PATH (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) -@maindex PROGRAMS_PATH -Like @code{AC_PROGRAMS_CHECK}, but if any of @var{progs-to-check-for} -are found, set @var{variable} to the entire pathname of the program -found. +@node Examining Declarations, Examining Syntax, , Writing Tests +@section Examining Declarations + +The macro @code{AC_TRY_CPP} is used to check whether particular header +files exist. You can check for one at a time, or more than one if you +need several header files to all exist for some purpose. + +@defmac AC_TRY_CPP (@var{includes}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@maindex TRY_CPP +@var{includes} is C or C++ @code{#include} statements and declarations, +on which shell variable, backquote, and backslash substitutions are +performed. (Actually, it can be any C program, but other statements are +probably not useful.) If the preprocessor produces no error messages +while processing it, run shell commands @var{action-if-true}. Otherwise +run shell commands @var{action-if-false}. + +This macro uses @code{CPPFLAGS}, but not @code{CFLAGS}, because +@samp{-g}, @samp{-O}, etc. are not valid options to many C +preprocessors. @end defmac -@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{}) -@maindex REPLACE_FUNCS -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 @code{make} variable @code{LIBOBJS}. If the functions -might be in libraries other than the default C library, first call -@code{AC_HAVE_LIBRARY} for those libraries. +Here is now to find out whether a header file contains a particular +declaration, such as a typedef, a structure, a structure member, or a +function. Use @code{AC_EGREP_HEADER} instead of running @code{grep} +directly on the header file; on some systems the symbol might be defined +in another header file that the file you are checking @samp{#include}s. + +@defmac AC_EGREP_HEADER (@var{pattern}, @var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex EGREP_HEADER +If the output of running the preprocessor on the system header file +@var{header-file} matches the @code{egrep} regular expression +@var{pattern}, execute shell commands @var{action-if-found}, otherwise +execute @var{action-if-not-found}. @end defmac -@defmac AC_SIZEOF_TYPE (@var{type}) -@maindex SIZEOF_TYPE -Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or -C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If -@samp{type} is unknown to the compiler, gets a size of 0. @var{uctype} -is @var{type}, with lowercase converted to uppercase, spaces changed to -underscores, and asterisks changed to @samp{P}. For example, the call +To check for C preprocessor symbols, either defined by header files or +predefined by the C preprocessor, use @code{AC_EGREP_CPP}. Here is an +example of the latter: + @example -AC_SIZEOF_TYPE(int *) +AC_EGREP_CPP(yes, +[#ifdef _AIX + yes +#endif +], is_aix=yes, is_aix=no) @end example -@noindent -defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems. -@end defmac - -@defmac AC_TEST_PROGRAM (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]}) -@maindex TEST_PROGRAM -@var{program} is the text of a C program, on which shell variable and -backquote substitutions are performed. If it compiles and links -successfully and returns an exit status of 0 when executed, run shell -commands @var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. - -If the optional argument @var{action-if-cross-compiling} is given and -the C compiler being used does not produce executables that run on the -system where @code{configure} is being run, then the test program is not -run. Instead, the shell commands @var{action-if-cross-compiling} are -run. If that argument is given, this macro calls @code{AC_CROSS_CHECK} -if it has not already been called (@pxref{Compiler Characteristics}). -@end defmac -@defmac AC_TEST_CPP (@var{includes}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) -@maindex TEST_CPP -@var{includes} is C or C++ @code{#include} statements and declarations, on -which shell variable and backquote substitutions are performed. -(Actually, it can be any C program, but other statements are probably -not useful.) If the preprocessor produces no error messages while -processing it, run shell commands @var{action-if-true}. Otherwise run -shell commands @var{action-if-false}. +@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex EGREP_CPP +@var{program} is the text of a C or C++ program, on which shell +variable, backquote, and backslash substitutions are performed. If the +output of running the preprocessor on @var{program} matches the +@code{egrep} regular expression @var{pattern}, execute shell commands +@var{action-if-found}, otherwise execute @var{action-if-not-found}. This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending on which language is current, @pxref{Language Choice}), if it hasn't been called already. @end defmac -@node Command Line, Setting Variables, General Feature Tests, General Purpose Macros -@section Checking Command Line Arguments - -These macros check whether the user gave @code{configure} various -command line arguments. Like the general feature tests (@pxref{General -Feature Tests}), they may take an argument to use if the argument was -given and one for if it was not given. - -@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) -@maindex ENABLE -If the user gave @code{configure} the option -@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run -shell commands @var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{feature} should consist only of -alphanumeric characters and dashes. +@node Examining Syntax, Examining Libraries, Examining Declarations, Writing Tests +@section Examining Syntax -The @var{feature} indicates an optional user-level facility. This -option allows users to choose which optional features to build and -install. @samp{--enable-@var{feature}} options should never make a -feature behave differently or cause one feature to replace another. -They should only cause parts of the program to be built rather than left -out. +To check for a syntax feature of the C or C++ compiler, such as whether +it recognizes a certain keyword, use @code{AC_TRY_COMPILE} to try to +compile a small program that uses that feature. You can also use it to +check for structures and structure members that are not present on all +systems. -The user can give an argument by following the feature name with -@samp{=} and the argument. Giving an argument of @samp{no} indicates -that the feature is @emph{not} available. A feature with an argument -looks like @samp{--enable-debug=stabs}. +@defmac AC_TRY_COMPILE (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex TRY_COMPILE +Create a test C program to see whether a function whose body consists of +@var{function-body} can be compiled; @var{includes} is any +@code{#include} statements needed by the code in @var{function-body}. +If the file compiles successfully, run shell commands +@var{action-if-found}, otherwise run @var{action-if-not-found}. This +macro uses @code{CFLAGS} or @code{CXXFLAGS}, and @code{CPPFLAGS}, when +compiling. It does not try to link; use @code{AC_TRY_LINK} if you need +to do that (@pxref{Examining Libraries}). +@end defmac -The argument is available to the shell commands @var{action-if-true} in -the shell variable @code{enableval}. If no argument was given to -@samp{--enable-@var{feature}}, @code{enableval} is @samp{yes}. -@samp{--disable-@var{feature}} is equivalent to -@samp{--enable-@var{feature}=no}. At present, arguments containing blanks -are not handled correctly; if you need an argument to contain a list, -require the items to be separated by commas instead. (This restriction -might disappear in the future.) +@node Examining Libraries, Run Time, Examining Syntax, Writing Tests +@section Examining Libraries + +To check for a library, a function, or a global variable, Autoconf +@code{configure} scripts try to compile and link a small program that +uses it. This is unlike Metaconfig, which by default uses @code{nm} +or @code{ar} on the C library to try to figure out which functions are +available. Trying to link with the function is usually a more reliable +approach because it avoids dealing with the variations in the options +and output formats of @code{nm} and @code{ar} and in the location of the +standard libraries. It also allows configuring for cross-compilation or +checking a function's runtime behavior if needed. On the other hand, it +can be slower than scanning the libraries once. + +A few systems have linkers that do not return a failure exit status when +there are unresolved functions in the link. This bug makes the +configuration scripts produced by Autoconf unusable on those systems. +However, some of them can be given options that make the exit status +correct. This is a problem that Autoconf does not currently handle +automatically. + +@code{AC_TRY_LINK} is used to compile test programs to test for +functions and global variables. It is also used (by +@code{AC_CHECK_LIB}) to check for libraries, by adding the library being +checked for to @code{LIBS} temporarily and trying to link a small +program. + +@defmac AC_TRY_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex TRY_LINK +Create a test C program to see whether a function whose body consists of +@var{function-body} can be compiled and linked; @var{includes} is any +@code{#include} statements needed by the code in @var{function-body}. +If the file compiles and links successfully, run shell commands +@var{action-if-found}, otherwise run @var{action-if-not-found}. This +macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS}, +@code{LDFLAGS}, and @code{LIBS} when compiling. @end defmac -@defmac AC_PREFIX (@var{program}) -@maindex PREFIX -If the user did not specify an installation prefix (using the -@samp{--prefix} option), guess a value for it by looking for -@var{program} in @code{PATH}, the way the shell does. If @var{program} -is found, set the prefix to the parent of the directory containing -@var{program}; otherwise leave the prefix specified in -@file{Makefile.in} unchanged. For example, if @var{program} is -@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc}, -set the prefix to @file{/usr/local/gnu}. +@defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) +@maindex COMPILE_CHECK +This is an obsolete version of @code{AC_TRY_LINK}, with the addition that it +prints @samp{checking for @var{echo-text}} to the standard output first, +if @var{echo-text} is non-empty. @end defmac -@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) -@maindex WITH -If the user gave @code{configure} the option @samp{--with-@var{package}} -or @samp{--without-@var{package}}, run shell commands -@var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{package} should consist only of -alphanumeric characters and dashes. +@node Run Time, Portable Shell, Examining Libraries, Writing Tests +@section Checking Run Time Behavior -The @var{package} indicates another software package that this program -should work with. For example, @samp{--with-gnu-ld} means work with the -GNU linker instead of some other linker. @samp{--with-x11} means work -with X11. +Sometimes you need to find out how a system performs at run time, such +as whether a given function has a certain capability or bug. If you +can, make such checks when your program runs instead of when it is +configured. You can check for things like the machine's endianness when +your program initializes itself. -The user can give an argument by following the package name with -@samp{=} and the argument. Giving an argument of @samp{no} is for -packages that would be used by default; it says to @emph{not} use the -package. An argument that is neither @samp{yes} nor @samp{no} could -include a name or number of a version of the other package, to specify -more precisely which other package this program is supposed to work -with. +If you really need to test for a run-time behavior while configuring, +you can write a test program to determine the result, and compile and +run it using @code{AC_TRY_RUN}. Avoid running test programs if +possible, because using them prevents people from configuring your +package for cross-compiling. -The argument is available to the shell commands @var{action-if-true} in -the shell variable @code{withval}. If no argument was given to -@samp{--with-@var{package}}, @code{withval} is @samp{yes}. -@samp{--without-@var{package}} is equivalent to -@samp{--with-@var{package}=no}. At present, arguments containing blanks -are not handled correctly; if you need an argument to contain a list, -require the items to be separated by commas instead. (This restriction -might disappear in the future.) -@end defmac +@menu +* Test Programs:: Running test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. +@end menu -@node Setting Variables, Printing Messages, Command Line, General Purpose Macros -@section Setting Variables +@node Test Programs, Guidelines, , Run Time +@subsection Running Test Programs -These macros help other macros to define shell and @code{make} -variables. +Use the following macro if you need to test run-time behavior of the +system while configuring. -@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]}) -@maindex DEFINE -Define C preprocessor variable @var{variable}. If @var{value} is given, -set @var{variable} to that value, otherwise set it to 1. To use a shell -variable as the value, use @code{AC_DEFINE_UNQUOTED} instead and precede -double quotes in the value with backslashes. +@defmac AC_TRY_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]}) +@maindex TRY_RUN +@var{program} is the text of a C program, on which shell variable and +backquote substitutions are performed. If it compiles and links +successfully and returns an exit status of 0 when executed, run shell +commands @var{action-if-true}. Otherwise run shell commands +@var{action-if-false}; the exit status of the program is available in +the shell variable @samp{$?}. This macro uses @code{CFLAGS} or +@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when +compiling. + +If the C compiler being used does not produce executables that run on +the system where @code{configure} is being run, then the test program is +not run. If the optional shell commands @var{action-if-cross-compiling} +are given, they are run instead and this macro calls @code{AC_C_CROSS} +if it has not already been called. Otherwise, @code{configure} prints +an error message and exits. +@end defmac -This macro adds to the shell variable @code{DEFS}. @code{AC_OUTPUT} -later substitutes the values in @code{DEFS} into the file(s) that it -generates (typically @file{Makefile}). Alternately, if -@code{AC_CONFIG_HEADER} has been called, @code{AC_OUTPUT} creates a -header file by substituting the correct values into @code{#define} -statements in a template file. +Try to provide a pessimistic default value to use when cross-compiling +makes run-time tests impossible. You do this by passing the optional +last argument to @code{AC_TRY_RUN}. @code{autoconf} prints a warning +message when creating @code{configure} each time it encounters a call to +@code{AC_TRY_RUN} with no @var{action-if-cross-compiling} argument +given. You may ignore the warning, though users will not be able to +configure your package for cross-compiling. A few of the macros +distributed with Autoconf produce this warning message. + +To configure for cross-compiling you can also choose a value for those +parameters based on the canonical system name (@pxref{Manual +Configuration}). Alternatively, set up a test results cache file with +the correct values for the target system (@pxref{Caching Results}). + +To provide a default for calls of @code{AC_TRY_RUN} that are embedded in +other macros, including a few of the ones that come with Autoconf, you +can call @code{AC_C_CROSS} before running them. Then, if the shell +variable @code{cross_compiling} is set to @samp{yes}, use an alternate +method to get the results instead of calling the macros. + +@defmac AC_C_CROSS +@maindex C_CROSS +If the C compiler being used does not produce executables that can run +on the system where @code{configure} is being run, set the shell +variable @code{cross_compiling} to @samp{yes}, otherwise @samp{no}. +@end defmac -For example, suppose your @file{configure.in} calls -@code{AC_CONFIG_HEADER(conf.h)} and @code{AC_HAVE_HEADERS(unistd.h)}. -You could have code like this in @file{conf.h.in}: +@node Guidelines, Test Functions, Test Programs, Run Time +@subsection Guidelines for Test Programs -@example -@group -/* Define as 1 if you have unistd.h. */ -#define HAVE_UNISTD_H 0 -@end group -@end example +Test programs should not write anything to the standard output. They +should return 0 if the test succeeds, nonzero otherwise, so that success +can be distinguished easily from a core dump or other failure; +segmentation violations and other failures produce a nonzero exit +status. Test programs should @code{exit}, not @code{return}, from +@code{main}, because on some systems (old Suns, at least) the argument +to @code{return} in @code{main} is ignored. -On systems that have @file{unistd.h}, @code{configure} will change the 0 -to a 1. On other systems, it will leave the line unchanged. -Alternately, if you prefer to use @code{#ifdef}, your @file{conf.h.in} -could have code like this: +Test programs can use @code{#if} or @code{#ifdef} to check the values of +preprocessor macros defined by tests that have already run. For +example, if you call @code{AC_HEADER_STDC}, then later on in +@file{configure.in} you can have a test program that includes an ANSI C +header file conditionally: @example @group -/* Define if you have unistd.h. */ -#undef HAVE_UNISTD_H +#if STDC_HEADERS +# include +#endif @end group @end example -On systems that have @file{unistd.h}, @code{configure} will change the -second line to read @samp{#define HAVE_UNISTD_H 1}. On other systems, -it will comment that line out (in case the system predefines that symbol). +If a test program needs to use or create a data file, give it a name +that starts with @file{conftest}, such as @file{conftestdata}. The +@code{configure} script cleans up by running @samp{rm -rf conftest*} +after running test programs and if the script is interrupted. -Due to the syntactical bizarreness of the Bourne shell, do not use -semicolons to separate @code{AC_DEFINE} calls from other macro calls or -shell code; that can cause syntax errors in the resulting -@code{configure} script. Use either spaces or newlines. That is, do -this: +@node Test Functions, , Guidelines, Run Time +@subsection Test Functions + +Function declarations in test programs should have a prototype +conditionalized for C++. In practice, though, test programs rarely need +functions that take arguments. @example -AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf") +#ifdef __cplusplus +foo(int i) +#else +foo(i) int i; +#endif @end example -@noindent -or this: +Functions that test programs declare should also be conditionalized for +C++, which requires @samp{extern "C"} prototypes. Make sure to not +include any header files containing clashing prototypes. @example -AC_HEADER_CHECK(elf.h, - AC_DEFINE(SVR4) - LIBS="$LIBS -lelf") +#ifdef __cplusplus +extern "C" void *malloc(size_t); +#else +char *malloc(); +#endif @end example -@noindent -instead of this: +If a test program calls a function with invalid parameters (just to see +whether it exists), organize the program to ensure that it never invokes +that function. You can do this by calling it in another function that is +never invoked. You can't do it by putting it after a call to +@code{exit}, because GCC version 2 knows that @code{exit} never returns +and optimizes out any code that follows it in the same block. + +If you include any header files, make sure to call the functions +relevant to them with the correct number of arguments, even if they are +just 0, to avoid compilation errors due to prototypes. GCC version 2 +has internal prototypes for several functions that it automatically +inlines; for example, @code{memcpy}. To avoid errors when checking for +them, either pass them the correct number of arguments or redeclare them +with a different return type (such as @code{char}). +@node Portable Shell, Testing Values and Files, Run Time, Writing Tests +@section Portable Shell Programming + +When writing your own checks, there are some shell script programming +techniques you should avoid in order to make your code portable. The +Bourne shell and upward-compatible shells like Bash and the Korn shell +have evolved over the years, but to prevent trouble, do not take +advantage of features that were added after UNIX version 7, circa 1977. +You should not use shell functions, aliases, negated character classes, +or other features that are not found in all Bourne-compatible shells; +restrict yourself to the lowest common denominator. Even @code{unset} +is not supported by all shells! + +The set of external programs you should run in a @code{configure} script +is fairly small. @xref{Utilities in Makefiles, , Utilities in +Makefiles, standards.info, GNU Coding Standards}, for the list. This +restriction allows users to start out with a fairly small set of +programs and build the rest, avoiding too many interdependencies between +packages. + +Some of these external utilities have a portable subset of features, as +well; for example, don't rely on @code{ln} having a @samp{-f} option or +@code{cat} having any options. @code{sed} scripts should not contain +comments or use branch labels longer than 8 characters. Don't use +@samp{grep -s} to suppress output, because @samp{grep -s} on System V +does not suppress output, only error messages. Instead, redirect the +standard output and standard error (in case the file doesn't exist) of +@code{grep} to @file{/dev/null}. Check the exit status of @code{grep} +to determine whether it found a match. + +@node Testing Values and Files, Multiple Cases, Portable Shell, Writing Tests +@section Testing Values and Files + +@code{configure} scripts need to test properties of many files and +strings. Here are some portability problems to watch out for when doing +those tests. + +The @code{test} program is the way to perform many file and string +tests. It is often invoked by the alternate name @samp{[}, but using +that name in Autoconf code is asking for trouble since it is an +@code{m4} quote character. + +If you need to make multiple checks using @code{test}, combine +them with the shell operators @samp{&&} and @samp{||} instead of using +the @code{test} operators @samp{-a} and @samp{-o}. On System V, the +precedence of @samp{-a} and @samp{-o} is wrong relative to the unary +operators; consequently, POSIX does not specify them, so using them is +nonportable. If you combine @samp{&&} and @samp{||} in the same +statement, keep in mind that they have equal precedence. + +To enable @code{configure} scripts to support cross-compilation, they +shouldn't do anything that tests features of the host system instead of +the target system. But occasionally you may find it necessary to check +whether some arbitrary file exists. To do so, use @samp{test -f} or +@samp{test -r}. Do not use @samp{test -x}, because 4.3BSD does not have +it. + +Another nonportable shell programming construction is @example -AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf") +@var{var}=$@{@var{var}:-@var{value}@} @end example -@end defmac - -@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]}) -@maindex DEFINE_UNQUOTED -Like @code{AC_DEFINE}, but it does nothing to quote @var{value} from -various shell and @code{sed} expansions it will undergo. @var{value} -will be used in many different contexts requiring different quoting, and -it is up to you to make sure it works right. Use this macro instead of -@code{AC_DEFINE} when @var{value} contains a shell variable. For -example: - +@noindent +The intent is to set @var{var} to @var{value} only if it is not already +set, but if @var{var} has any value, even the empty string, to leave it +alone. Old BSD shells, including the Ultrix @code{sh}, don't accept +the colon, and complain and die. A portable equivalent is @example -AC_DEFINE_UNQUOTED(config_machfile, $@{machfile@}) +: $@{@var{var}=@var{value}@} @end example -@end defmac -@defmac AC_SUBST (@var{variable}) -@maindex SUBST -Substitute the variable @var{variable} when creating the output files -(typically one or more @file{Makefile}s). This means replace instances -of @samp{@@@var{variable}@@}, e.g. in @file{Makefile.in}, with the -current value of the shell variable @var{variable}. If this macro were -not called, the value of @var{variable} would not be set in the output -files, even though @code{configure} had figured out a value for it. +@node Multiple Cases, Language Choice, Testing Values and Files, Writing Tests +@section Multiple Cases + +Some operations are accomplished in several possible ways, depending on +the UNIX variant. Checking for them essentially requires a ``case +statement''. Autoconf does not directly provide one; however, it is +easy to simulate by using a shell variable to keep track of whether a +way to perform the operation has been found yet. -You can set or add to the value of @var{variable} in the usual shell -way. For example, to add @samp{-ltermcap} to the value of the variable -@code{LIBS}: +Here is an example that uses the shell variable @code{fstype} to keep +track of whether the remaining cases need to be checked. @example -LIBS="$LIBS -ltermcap" +@group +AC_MSG_CHECKING(how to get filesystem type) +fstype=no +# The order of these tests is important. +AC_TRY_CPP([#include +#include ], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4) +if test $fstype = no; then +AC_TRY_CPP([#include +#include ], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3) +fi +if test $fstype = no; then +AC_TRY_CPP([#include +#include ], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX) +fi +# (more cases omitted here) +AC_MSG_RESULT($fstype) +@end group @end example + +@node Language Choice, , Multiple Cases, Writing Tests +@section Language Choice + +Packages that use both C and C++ need to test features of both +compilers. Autoconf-generated @code{configure} scripts check for C +features by default. The following macros determine which language's +compiler is used in tests that follow in @file{configure.in}. + +@defmac AC_LANG_C +@maindex LANG_C +Do compilation tests using @code{CC} and @code{CPP} and use extension +@file{.c} for test programs. @end defmac -@node Printing Messages, Language Choice, Setting Variables, General Purpose Macros -@section Printing Messages +@defmac AC_LANG_CPLUSPLUS +@maindex LANG_CPLUSPLUS +Do compilation tests using @code{CXX} and @code{CXXCPP} and use +extension @file{.C} for test programs. +@end defmac -@code{configure} scripts need to give users running them several kinds -of information. The following macros print messages in ways appropriate -for different kinds of information. The arguments to all of them get -enclosed in shell double quotes, so the shell performs variable and -backquote substitution on them. +@defmac AC_LANG_SAVE +@maindex LANG_SAVE +Remember the current language (as set by @code{AC_LANG_C} or +@code{AC_LANG_CPLUSPLUS}) on a stack. Does not change which language is +current. Use this macro and @code{AC_LANG_RESTORE} in macros that need +to temporarily switch to a particular language. +@end defmac -These macros are all wrappers around the @code{echo} shell command. -Other macros should rarely need to run @code{echo} directly to print -messages for the @code{configure} user. Using these macros makes it -easy to change how and when each kind of message is printed; such -changes need only be made to the macro definitions, and all of the -callers change automatically. +@defmac AC_LANG_RESTORE +@maindex LANG_RESTORE +Select the language that is saved on the top of the stack, as set by +@code{AC_LANG_SAVE}, and remove it from the stack. This macro is +equivalent to either @code{AC_LANG_C} or @code{AC_LANG_CPLUSPLUS}, +whichever had been run most recently when @code{AC_LANG_SAVE} was last +called. -@defmac AC_CHECKING (@var{feature-description}) -@maindex CHECKING -Notify the user that @code{configure} is checking for a particular -feature. This macro prints a message that starts with @samp{checking }. -It prints nothing if @code{configure} is run with the @samp{--silent} or -@samp{--quiet} option. The @var{feature-description} should be -something like @samp{whether the Fortran compiler accepts C++ comments} -or @samp{for c89}. +Do not call this macro more times than @code{AC_LANG_SAVE}. @end defmac -@defmac AC_ERROR (@var{error-description}) -@maindex ERROR -Notify the user of an error that prevents @code{configure} from -completing. This macro prints an error message on the standard error -stream and exits @code{configure} with a nonzero status. -@var{error-description} should be something like @samp{invalid value -$HOME for \$HOME}. +@defmac AC_REQUIRE_CPP +@maindex REQUIRE_CPP +Ensure that whichever preprocessor would currently be used for tests has +been found. Calls @code{AC_REQUIRE} (@pxref{Prerequisite Macros}) with an +argument of either @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP}, +depending on which language is current. @end defmac -@defmac AC_VERBOSE (@var{result-description}) -@maindex VERBOSE -Notify the user of the results of a check. This information is -only printed if @code{configure} is run with the @samp{--verbose} -option. @var{result-description} should be something like @samp{setting -ADA to $ADA}. +@node Results, Writing Macros, Writing Tests, Top +@chapter Results of Tests + +Once @code{configure} has determined whether a feature exists, what can +it do to record that information? There are four sorts of things it can +do: define a C preprocessor symbol, set a variable in the output files, +save the result in a cache file for future @code{configure} runs, and +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. +* Caching Results:: Speeding up subsequent @code{configure} runs. +* Printing Messages:: Notifying users of progress or problems. +@end menu + +@node Defining Symbols, Setting Output Variables, , Results +@section Defining C Preprocessor Symbols + +A common action to take in response to a feature test is to define a C +preprocessor symbol indicating the results of the test. That is done by +calling @code{AC_DEFINE} or @code{AC_DEFINE_UNQUOTED}. + +By default, @code{AC_OUTPUT} places the symbols defined by these macros +into the output variable @code{DEFS}, which contains an option +@samp{-D@var{symbol}=@var{value}} for each symbol defined. Unlike in +Autoconf version 1, there is no variable @code{DEFS} defined while +@code{configure} is running. To check whether Autoconf macros have +already defined a certain C preprocessor symbol, test the value of the +appropriate cache variable, as in this example: + +@example +AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) +if test "$ac_cv_func_vprintf" != yes; then +AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) +fi +@end example + +If @code{AC_CONFIG_HEADER} has been called, then instead of creating +@code{DEFS}, @code{AC_OUTPUT} creates a header file by substituting the +correct values into @code{#define} statements in a template file. +@xref{Configuration Headers}, for more information about this kind of +output. + +@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]}) +@maindex DEFINE +Define C preprocessor variable @var{variable}. If @var{value} is given, +set @var{variable} to that value (verbatim), otherwise set it to 1. +@var{value} should not contain literal newlines, and if you are not +using @code{AC_CONFIG_HEADER} it should not contain any @samp{#} +characters, as @code{make} tends to eat them. To use a shell variable +(which you need to do in order to define a value containing the +@code{m4} quote characters @samp{[} or @samp{]}), use +@code{AC_DEFINE_UNQUOTED} instead. The following example defines the C +preprocessor variable @code{EQUATION} to be the string constant +@samp{"$a > $b"}: + +@example +AC_DEFINE(EQUATION, "$a > $b") +@end example @end defmac -@defmac AC_WARN (@var{problem-description}) -@maindex WARN -Notify the @code{configure} user of a possible problem. This macro -prints the message on the standard error stream; @code{configure} -continues running afterward, so macros that call @code{AC_WARN} should -provide a default (back-up) behavior for the situations they warn about. -@var{problem-description} should be something like @samp{ln -s seems to -make hard links}. +@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]}) +@maindex DEFINE_UNQUOTED +Like @code{AC_DEFINE}, but three shell expansions are +performed---once---on @var{variable} and @var{value}: variable expansion +(@samp{$}), command substitution (@samp{`}), and backslash escaping +(@samp{\}). Single and double quote characters in the value have no +special meaning. Use this macro instead of @code{AC_DEFINE} when +@var{variable} or @var{value} is a shell variable. Examples: + +@example +AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}") +AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) +AC_DEFINE_UNQUOTED($@{ac_tr_hdr@}) +@end example @end defmac -@node Language Choice, Macro Ordering, Printing Messages, General Purpose Macros -@section Language Choice +Due to the syntactical bizarreness of the Bourne shell, do not use +semicolons to separate @code{AC_DEFINE} or @code{AC_DEFINE_UNQUOTED} +calls from other macro calls or shell code; that can cause syntax errors +in the resulting @code{configure} script. Use either spaces or +newlines. That is, do this: -Packages that use both C and C++ need to test features of both -compilers. Autoconf-generated @code{configure} scripts check for C -features by default. The following macros determine which language's -compiler is used in tests that follow in @file{configure.in}. +@example +AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf") +@end example + +@noindent +or this: + +@example +AC_CHECK_HEADER(elf.h, + AC_DEFINE(SVR4) + LIBS="$LIBS -lelf") +@end example + +@noindent +instead of this: + +@example +AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf") +@end example -@defmac AC_LANG_C -@maindex LANG_C -Do compilation tests using @code{CC} and @code{CPP} and use extension -@file{.c} for test programs. +@node Setting Output Variables, Caching Results, Defining Symbols, Results +@section Setting Output Variables -This is the initial state. -@end defmac +One way to record the results of tests is to set @dfn{output variables}, +which are shell variables whose values are substituted into files that +@code{configure} outputs. The two macros below create new output +variables. @xref{Preset Output Variables}, for a list of output +variables that are always available. -@defmac AC_LANG_CPLUSPLUS -@maindex LANG_CPLUSPLUS -Do compilation tests using @code{CXX} and @code{CXXCPP} and use -extension @file{.C} for test programs. +@defmac AC_SUBST (@var{variable}) +@maindex SUBST +Create an output variable from a shell variable. Make @code{AC_OUTPUT} +substitute the variable @var{variable} into output files (typically one +or more @file{Makefile}s). This means that @code{AC_OUTPUT} will +replace instances of @samp{@@@var{variable}@@} in input files with the +value that the shell variable @var{variable} has when @code{AC_OUTPUT} +is called. The value of @var{variable} should not contain literal +newlines. @end defmac -@defmac AC_LANG_RESTORE -@maindex LANG_RESTORE -Select the language that is saved on the top of the stack, as set by -@code{AC_LANG_SAVE}, and remove it from the stack. This macro is -equivalent to either @code{AC_LANG_C} or @code{AC_LANG_CPLUSPLUS}, -whichever had been run most recently when @code{AC_LANG_SAVE} was last -called. +@defmac AC_SUBST_FILE (@var{variable}) +@maindex SUBST_FILE +Another way to create an output variable from a shell variable. Make +@code{AC_OUTPUT} substitute the contents of the file named by shell +variable @var{variable} into output files (typically one or more +@file{Makefile}s). This means that @code{AC_OUTPUT} will replace +instances of @samp{@@@var{variable}@@} in the @file{Makefile.in} files +with the contents of the file that the shell variable @var{variable} +names when @code{AC_OUTPUT} is called. Set the variable to +@file{/dev/null} for cases which do not have a file to insert. + +This macro is useful for inserting @file{Makefile} fragments containing +special dependencies or other @code{make} directives for particular host +or target types into @file{Makefile}s. For example, @file{configure.in} +could contain: -Do not call this macro more times than @code{AC_LANG_SAVE}. -@end defmac +@example +AC_SUBST_FILE(host_frag)dnl +host_frag=$srcdir/conf/sun4.mh +@end example -@defmac AC_LANG_SAVE -@maindex LANG_SAVE -Remember the current language (as set by @code{AC_LANG_C} or -@code{AC_LANG_CPLUSPLUS}) on a stack. Does not change which language is -current. Use this macro and @code{AC_LANG_RESTORE} in macros that need -to temporarily switch to a particular language. -@end defmac +@noindent +and then a @file{Makefile.in} could contain: -@defmac AC_REQUIRE_CPP -@maindex REQUIRE_CPP -Ensure that whichever preprocessor would currently be used for tests has -been found. Calls @code{AC_REQUIRE} (@pxref{Macro Ordering}) with an -argument of either @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP}, -depending on which language is current. +@example +@@host_frag@@ +@end example @end defmac -@node Macro Ordering, , Language Choice, General Purpose Macros -@section Macro Ordering +@node Caching Results, Printing Messages, Setting Output Variables, Results +@section Caching Results + +To avoid checking for the same features repeatedly in various +@code{configure} scripts (or repeated runs of one script), +@code{configure} saves the results of many of its checks in a @dfn{cache +file}. If, when a @code{configure} script runs, it finds a cache file, +it reads from it the results from previous runs and avoids rerunning +those checks. As a result, @code{configure} can run much faster than if +it had to perform all of the checks every time. + +@defmac AC_CACHE_VAL (@var{cache-id}, @var{commands-to-set-it}) +@maindex CACHE_VAL +Ensure that the results of the check identified by @var{cache-id} are +available. If the results of the check were in the cache file that was +read, and @code{configure} was not given the @samp{--quiet} or +@samp{--silent} option, print a message saying that the result was +cached; otherwise, run the shell commands @var{commands-to-set-it}. +Those commands should have no side effects except for setting the +variable @var{cache-id}. In particular, they should not call +@code{AC_DEFINE}; the code that follows the call to @code{AC_CACHE_VAL} +should do that, based on the cached value. Also, they should not print +any messages, for example with @code{AC_MSG_CHECKING}; do that before +calling @code{AC_CACHE_VAL}, so the messages are printed regardless of +whether the results of the check are retrieved from the cache or +determined by running the shell commands. If the shell commands are run +to determine the value, the value will be saved in the cache file just +before @code{configure} creates its output files. @xref{Cache +Variable Names}, for how to choose the name of the @var{cache-id} variable. +@end defmac -These macros provide ways for other macros to make sure that they are -called in the correct order. +@menu +* Cache Variable Names:: Shell variables used in caches. +* Cache Files:: Files @code{configure} uses for caching. +@end menu -@defmac AC_BEFORE (@var{this-macro-name}, @var{called-macro-name}) -@maindex BEFORE -Make @code{m4} print a warning message on the standard error output if -@var{called-macro-name} has already been called. @var{this-macro-name} -should be the name of the macro that is calling @code{AC_BEFORE}. The -macro @var{called-macro-name} must contain a call to @code{AC_PROVIDE} -to indicate that it has been called. +@node Cache Variable Names, Cache Files, , Caching Results +@subsection Cache Variable Names -This macro should be used when one macro makes changes that might affect -another macro, so that the other macro should probably not be called -first. For example, @code{AC_PROG_CPP} checks whether the C compiler -can run the C preprocessor when given the @samp{-E} option. It should -therefore be called after any macros that change which C compiler is -being used, such as @code{AC_PROG_CC}. So @code{AC_PROG_CC} contains: +The names of cache variables should have the following format: @example -AC_BEFORE([$0], [AC_PROG_CPP]) +@var{package-prefix}_cv_@var{value-type}_@var{specific-value}@r{[}_@var{additional-options}@r{]} @end example @noindent -This warns the user if a call to @code{AC_PROG_CPP} has already occurred -when @code{AC_PROG_CC} is called. +for example, @samp{ac_cv_header_stat_broken} or +@samp{ac_cv_prog_gcc_traditional}. The parts of the variable name are: + +@table @asis +@item @var{package-prefix} +An abbreviation for your package or organization; the same prefix you +begin local Autoconf macros with, except lowercase by convention. +For cache values used by the distributed Autoconf macros, this value is +@samp{ac}. + +@item @code{_cv_} +Indicates that this shell variable is a cache value. + +@item @var{value-type} +A convention for classifying cache values, to produce a rational naming +system. The values used in Autoconf are listed in @ref{Macro Names}. + +@item @var{specific-value} +Which member of the class of cache values this test applies to. +For example, which function (@samp{alloca}), program (@samp{gcc}), or +output variable (@samp{INSTALL}). + +@item @var{additional-options} +Any particular behavior of the specific member that this test applies to. +For example, @samp{broken} or @samp{set}. This part of the name may +be omitted if it does not apply. +@end table + +Like their names, the values that may be assigned to cache variables +have a few restrictions. The values may not contain single quotes or +curly braces. Usually, their values will be boolean (@samp{yes} or +@samp{no}) or the names of files or functions; so this is not an +important restriction. + +@node Cache Files, , Cache Variable Names, Caching Results +@subsection Cache Files + +A cache file is a shell script that caches the results of configure +tests run on one system so they can be shared between configure scripts +and configure runs. It is not useful on other systems. If its contents +are invalid for some reason, the user may delete or edit it. + +By default, configure uses @file{./config.cache} as the cache file, +creating it if it does not exist already. @code{configure} accepts the +@samp{--cache-file=@var{file}} option to use a different cache file; +that is what @code{configure} does when it calls @code{configure} +scripts in subdirectories, so they share the cache. Giving +@samp{--cache-file=/dev/null} disables caching, for debugging +@code{configure}. @xref{Subdirectories}, for information on configuring +subdirectories with the @code{AC_CONFIG_SUBDIRS} macro. +@file{config.status} only pays attention to the cache file if it is +given the @samp{--recheck} option, which makes it rerun +@code{configure}. + +It is wrong to try to distribute cache files for particular system types. +There is too much room for error in doing that, and too much +administrative overhead in maintaining them. For any features that +can't be guessed automatically, use the standard method of the canonical +system type and linking files (@pxref{Manual Configuration}). + +The cache file on a particular system will gradually accumulate whenever +someone runs a @code{configure} script; it will be initially +nonexistent. Running @code{configure} merges the new cache results with +the existing cache file. The site initialization script can specify a +site-wide cache file to use instead of the default, to make it work +transparently, as long as the same C compiler is used every time +(@pxref{Site Defaults}). + +@node Printing Messages, , Caching Results, Results +@section Printing Messages + +@code{configure} scripts need to give users running them several kinds +of information. The following macros print messages in ways appropriate +for each kind. The arguments to all of them get enclosed in shell +double quotes, so the shell performs variable and backquote substitution +on them. + +These macros are all wrappers around the @code{echo} shell command. +@code{configure} scripts should rarely need to run @code{echo} directly +to print messages for the user. Using these macros makes it easy to +change how and when each kind of message is printed; such changes need +only be made to the macro definitions, and all of the callers change +automatically. + +@defmac AC_MSG_CHECKING (@var{feature-description}) +@maindex MSG_CHECKING +Notify the user that @code{configure} is checking for a particular +feature. This macro prints a message that starts with @samp{checking } +and ends with @samp{...} and no newline. It must be followed by a call +to @code{AC_MSG_RESULT} to print the result of the check and the +newline. The @var{feature-description} should be something like +@samp{whether the Fortran compiler accepts C++ comments} or @samp{for +c89}. + +This macro prints nothing if @code{configure} is run with the +@samp{--quiet} or @samp{--silent} option. @end defmac -@defmac AC_OBSOLETE (@var{this-macro-name} @r{[}, @var{suggestion}@r{]}) -@maindex OBSOLETE -Make @code{m4} print a message on the standard error output warning that -@var{this-macro-name} is obsolete, and giving the file and line number -where it was called. @var{this-macro-name} should be the name of the -macro that is calling @code{AC_BEFORE}. If @var{suggestion} is given, -it is printed at the end of the warning message; for example, it can be -a suggestion for what to use instead of @var{this-macro-name}. +@defmac AC_MSG_RESULT (@var{result-description}) +@maindex MSG_RESULT +Notify the user of the results of a check. @var{result-description} is +almost always the value of the cache variable for the check, typically +@samp{yes}, @samp{no}, or a file name. This macro should follow a call +to @code{AC_MSG_CHECKING}, and the @var{result-description} should be +the completion of the message printed by the call to +@code{AC_MSG_CHECKING}. + +This macro prints nothing if @code{configure} is run with the +@samp{--quiet} or @samp{--silent} option. +@end defmac -A sample call is: +@defmac AC_MSG_ERROR (@var{error-description}) +@maindex MSG_ERROR +Notify the user of an error that prevents @code{configure} from +completing. This macro prints an error message on the standard error +stream and exits @code{configure} with a nonzero status. +@var{error-description} should be something like @samp{invalid value +$HOME for \$HOME}. +@end defmac -@example -AC_OBSOLETE([$0], [; use AC_HAVE_HEADERS(unistd.h) instead]) -@end example +@defmac AC_MSG_WARN (@var{problem-description}) +@maindex MSG_WARN +Notify the @code{configure} user of a possible problem. This macro +prints the message on the standard error stream; @code{configure} +continues running afterward, so macros that call @code{AC_MSG_WARN} should +provide a default (back-up) behavior for the situations they warn about. +@var{problem-description} should be something like @samp{ln -s seems to +make hard links}. @end defmac -@defmac AC_PROVIDE (@var{macro-name}) -@maindex PROVIDE -Set a flag recording that @var{macro-name} has been called. The -argument should be the name of the macro that is calling -@code{AC_PROVIDE}. An easy way to get it is from the @code{m4} builtin -variable @code{$0}, like this: +The following two macros are an obsolete alternative to +@code{AC_MSG_CHECKING} and @code{AC_MSG_RESULT}. + +@defmac AC_CHECKING (@var{feature-description}) +@maindex CHECKING +This macro is similar to @code{AC_MSG_CHECKING}, except that it prints a +newline after the @var{feature-description}. It is useful mainly to +print a general description of the overall purpose of a group of feature +checks, e.g., @example -AC_PROVIDE([$0]) +AC_CHECKING(if stack overflow is detectable) @end example @end defmac -@defmac AC_REQUIRE (@var{macro-name}) -@maindex REQUIRE -If the @code{m4} macro @var{macro-name} has not already been called, -call it (without any arguments). Make sure to quote @var{macro-name} -with square brackets. The body of @var{macro-name} must contain a call -to @code{AC_PROVIDE} to indicate that it has been called. - -Macros that need some other macro to be called before they are called -can use @code{AC_REQUIRE} to ensure that it has been, in case the person -who made @file{configure.in} forgot or didn't know to do it. -@code{AC_REQUIRE} and @code{AC_PROVIDE} together can ensure that a macro -is only called if it is needed, and only called once. -@xref{Dependencies Between Macros}, for more information. +@defmac AC_VERBOSE (@var{result-description}) +@maindex VERBOSE +This macro is similar to @code{AC_MSG_RESULT}, except that it is meant +to follow a call to @code{AC_CHECKING} instead of +@code{AC_MSG_CHECKING}; it starts the message it prints with a tab. It +is considered obsolete. @end defmac -@node Writing Macros, Makefiles, General Purpose Macros, Top +@node Writing Macros, Manual Configuration, Results, Top @chapter Writing Macros -If your package needs to test for some feature that none of the macros -supplied with Autoconf handles, you'll need to write one or more new -Autoconf macros. Here are some suggestions and some of the rationale -behind why the existing macros are written the way they are. You can -also learn a lot about how to write Autoconf macros by looking at the -existing ones. If something goes wrong in one or more of the Autoconf -tests, this information can help you understand why they work the way -they do and the assumptions behind them, which might help you figure out -how to best solve the problem. - -If you add macros that you think would be useful to other people, or -find problems with the distributed macros, please send electronic mail -to @file{bug-gnu-utils@@prep.ai.mit.edu}, so we can consider them for -future releases of Autoconf. Please include the Autoconf version -number, which you can get by running @samp{autoconf --version}. +When you write a feature test that could be applicable to more than one +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 Format:: 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. -* Checking for Files:: Finding whether a file exists. -* Checking for Symbols:: Finding whether a symbol is defined. -* Test Programs:: Writing programs to test for features. -* Multiple Cases:: Tests for several possible values. @end menu -@node Macro Format, Quoting, , Writing Macros -@section Macro Format +@node Macro Definitions, Macro Names, , Writing Macros +@section Macro Definitions -Autoconf macros are defined as arguments to the @code{m4} builtin -command @code{define}. Their overall structure looks like this: +@maindex DEFUN +Autoconf macros are defined using the @code{AC_DEFUN} macro, which is +similar to the @code{m4} builtin @code{define} macro. In addition to +defining a macro, @code{AC_DEFUN} adds to it some code which is used to +constrain the order in which macros are called (@pxref{Prerequisite +Macros}). + +An Autoconf macro definition looks like this: @example -define(@var{macro-name}, [@var{macro-body}])dnl +AC_DEFUN(@var{macro-name}, [@var{macro-body}]) @end example @noindent The square brackets here do not indicate optional text: they should -literally be present in the macro definition. - -All of the Autoconf macros have names starting with @samp{AC_} to -prevent them from accidentally conflicting with other text. All shell -variables that they use for internal purposes have names starting with -@samp{ac_}. To ensure that your macros don't conflict with present or -future Autoconf macros, you should prefix your own macro names and any -shell variables they use with some other sequence. Possibilities -include your initials, or an abbreviation for the name of your -organization or software package. - -The @code{m4} builtin @code{dnl} prevents a newline from being inserted -in the output where the macro is defined; without it, the generated -@code{configure} script would begin with dozens of blank lines. -@code{dnl} is also used to introduce comments in @code{m4}; it causes -@code{m4} to discard the rest of the input line. - -You should quote the entire macro body with square brackets to avoid -macro expansion problems (@pxref{Quoting}). You can refer to any -arguments passed to the macro as @samp{$1}, @samp{$2}, etc. +literally be present in the macro definition to avoid macro expansion +problems (@pxref{Quoting}). You can refer to any arguments passed to +the macro as @samp{$1}, @samp{$2}, etc. + +To introduce comments in @code{m4}, use the @code{m4} builtin +@code{dnl}; it causes @code{m4} to discard the text through the next +newline. It is not needed between macro definitions in @file{acsite.m4} +and @file{aclocal.m4}, because all output is discarded until +@code{AC_INIT} is called. @xref{Definitions, , How to define new macros, m4.info, GNU m4}, for more complete information on writing @code{m4} macros. -@node Quoting, Dependencies Between Macros, Macro Format, Writing Macros +@node Macro Names, Quoting, Macro Definitions, Writing Macros +@section Macro Names + +All of the Autoconf macros have all-uppercase names starting with +@samp{AC_} to prevent them from accidentally conflicting with other +text. All shell variables that they use for internal purposes have +mostly-lowercase names starting with @samp{ac_}. To ensure that your +macros don't conflict with present or future Autoconf macros, you should +prefix your own macro names and any shell variables they use with some +other sequence. Possibilities include your initials, or an abbreviation +for the name of your organization or software package. + +Most of the Autoconf macros' names follow a structured naming convention +that indicates the kind of feature check by the name. The macro names +consist of several words, separated by underscores, going from most +general to most specific. The names of their cache variables use the +same convention (@pxref{Cache Variable Names}, for more information on them). + +The first word of the name after @samp{AC_} usually tells the category +of feature being tested. Here are the categories used in Autoconf for +specific test macros, the kind of macro that you are more likely to +write. They are also used for cache variables, in all-lowercase. Use +them where applicable; where they're not, invent your own categories. + +@table @code +@item C +C language builtin features. +@item DECL +Declarations of C variables in header files. +@item FUNC +Functions in libraries. +@item GROUP +UNIX group owners of files. +@item HEADER +Header files. +@item LIB +C libraries. +@item PATH +The full path names to files, including programs. +@item PROG +The base names of programs. +@item STRUCT +Definitions of C structures in header files. +@item SYS +Operating system features. +@item TYPE +C builtin or declared types. +@item VAR +C variables in libraries. +@end table + +After the category comes the name of the particular feature being +tested. Any further words in the macro name indicate particular aspects +of the feature. For example, @code{AC_FUNC_UTIME_NULL} checks the +behavior of the @code{utime} function when called with a @code{NULL} +pointer. + +A macro that is an internal subroutine of another macro should have a +name that starts with the name of that other macro, followed by one or +more words saying what the internal macro does. For example, +@code{AC_PATH_X} has internal macros @code{AC_PATH_X_XMKMF} and +@code{AC_PATH_X_DIRECT}. + +@node Quoting, Dependencies Between Macros, Macro Names, Writing Macros @section Quoting Macros that are called by other macros are evaluated by @code{m4} @@ -2171,25 +3465,28 @@ several times; each evaluation might require another layer of quotes to prevent unwanted expansions of macros or @code{m4} builtins, such as @samp{define} and @samp{$1}. Quotes are also required around macro arguments that contain commas, since commas separate the arguments from -each other. +each other. It's a good idea to quote any macro arguments that contain +newlines or calls to other macros, as well. -Autoconf (in @file{acgeneral.m4}) changes the @code{m4} quote characters +Autoconf changes the @code{m4} quote characters from the default @samp{`} and @samp{'} to @samp{[} and @samp{]}, because many of the macros use @samp{`} and @samp{'}, mismatched. However, in a -few places the macros need to use brackets. In those places, they use -the @code{m4} builtin command @code{changequote} to temporarily disable -quoting before the code that uses brackets, like this: - -@example -changequote(,)dnl -@end example - -@noindent -Then they turn quoting back on again with another call to -@code{changequote}: +few places the macros need to use brackets (usually in C program text or +regular expressions). In those places, they use the @code{m4} builtin +command @code{changequote} to temporarily change the quote characters to +@samp{<<} and @samp{>>}. (Sometimes, if they don't need to quote +anything, they disable quoting entirely instead by setting the quote +characters to empty strings.) Here is an example: @example -changequote([,])dnl +AC_TRY_LINK( +changequote(<<, >>)dnl +<<#include +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif>>, +changequote([, ])dnl +[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no) @end example When you create a @code{configure} script using newly written macros, @@ -2202,7 +3499,7 @@ this happens, the resulting @code{configure} script will contain unexpanded macros. The @code{autoconf} program checks for this problem by doing @samp{grep AC_ configure}. -@node Dependencies Between Macros, Checking for Files, Quoting, Writing Macros +@node Dependencies Between Macros, , Quoting, Writing Macros @section Dependencies Between Macros Some Autoconf macros depend on other macros having been called first in @@ -2213,594 +3510,640 @@ called in an order that might cause incorrect operation. @menu * Prerequisite Macros:: Ensuring required information. * Suggested Ordering:: Warning about possible ordering problems. +* Obsolete Macros:: Warning about old ways of doing things. @end menu @node Prerequisite Macros, Suggested Ordering, , Dependencies Between Macros @subsection Prerequisite Macros A macro that you write might need to use values that have previously -been computed by other macros. For example, if you write a new macro -that uses the C preprocessor, it depends on @code{AC_PROG_CPP} having -been called first to set the shell variable @code{CPP} -(@pxref{Alternative Programs}). +been computed by other macros. For example, @code{AC_DECL_YYTEXT} +examines the output of @code{flex} or @code{lex}, so it depends on +@code{AC_PROG_LEX} having been called first to set the shell variable +@code{LEX}. -Rather than forcing the user of the macros to keep track of all of the -dependencies between them, you can use the macros @code{AC_PROVIDE} and -@code{AC_REQUIRE} to do it automatically. @xref{Macro Ordering}, for more -information on their syntax. +Rather than forcing the user of the macros to keep track of the +dependencies between them, you can use the @code{AC_REQUIRE} macro to do +it automatically. @code{AC_REQUIRE} can ensure that a macro is only +called if it is needed, and only called once. -The new macro that runs the C preprocessor should contain, somewhere -before @code{CPP} is used, the statement +@defmac AC_REQUIRE (@var{macro-name}) +@maindex REQUIRE +If the @code{m4} macro @var{macro-name} has not already been called, +call it (without any arguments). Make sure to quote @var{macro-name} +with square brackets. @var{macro-name} must have been defined using +@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate +that it has been called. +@end defmac -@example -AC_REQUIRE([AC_PROG_CPP]) -@end example +An alternative to using @code{AC_DEFUN} is to use @code{define} and call +@code{AC_PROVIDE}. Because this technique does not prevent nested +messages, it is considered obsolete. -@noindent -and the macro @code{AC_PROG_CPP} should contain the statement (anywhere -in its body) +@defmac AC_PROVIDE (@var{this-macro-name}) +@maindex PROVIDE +Record the fact that @var{this-macro-name} has been called. +@var{this-macro-name} should be the name of the macro that is calling +@code{AC_PROVIDE}. An easy way to get it is from the @code{m4} builtin +variable @code{$0}, like this: @example AC_PROVIDE([$0]) @end example +@end defmac -@noindent -Then, when the new macro is run, it will invoke @code{AC_PROG_CPP} if -and only if @code{AC_PROG_CPP} has not already been run. - -@node Suggested Ordering, , Prerequisite Macros, Dependencies Between Macros +@node Suggested Ordering, Obsolete Macros, Prerequisite Macros, Dependencies Between Macros @subsection Suggested Ordering Some macros should be run before another macro if both are called, but -neither requires the other to be called. For example, a macro like -@code{AC_AIX} that changes the behavior of the C compiler (@pxref{UNIX -Variants}) should be called before any macros that run the C compiler. -Many of these dependencies are noted in the documentation. - -Autoconf provides a way to warn users when macros with this kind of -dependency appear out of order in a @file{configure.in} file. The -warning occurs when creating @file{configure} from @file{configure.in}, -not when running @file{configure}. It is not a fatal error; -@file{configure} is created as usual. - -The @code{AC_BEFORE} macro causes @code{m4} to print a warning message -on the standard error output when a macro is used before another macro -which might change its behavior. The macro which should come first -should contain a call to @code{AC_BEFORE} and the macro which should -come later should contain a call to @code{AC_PROVIDE}. - -For example, @code{AC_AIX} contains +neither @emph{requires} that the other be called. For example, a macro +that changes the behavior of the C compiler should be called before any +macros that run the C compiler. Many of these dependencies are noted in +the documentation. + +Autoconf provides the @code{AC_BEFORE} macro to warn users when macros +with this kind of dependency appear out of order in a +@file{configure.in} file. The warning occurs when creating +@code{configure} from @file{configure.in}, not when running +@code{configure}. +For example, @code{AC_PROG_CPP} checks whether the C compiler +can run the C preprocessor when given the @samp{-E} option. It should +therefore be called after any macros that change which C compiler is +being used, such as @code{AC_PROG_CC}. So @code{AC_PROG_CC} contains: @example -AC_BEFORE([$0], [AC_COMPILE_CHECK]) +AC_BEFORE([$0], [AC_PROG_CPP])dnl @end example @noindent -and @code{AC_COMPILE_CHECK} contains +This warns the user if a call to @code{AC_PROG_CPP} has already occurred +when @code{AC_PROG_CC} is called. -@example -AC_PROVIDE([$0]) -@end example +@defmac AC_BEFORE (@var{this-macro-name}, @var{called-macro-name}) +@maindex BEFORE +Make @code{m4} print a warning message on the standard error output if +@var{called-macro-name} has already been called. @var{this-macro-name} +should be the name of the macro that is calling @code{AC_BEFORE}. The +macro @var{called-macro-name} must have been defined using +@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate +that it has been called. +@end defmac -@noindent -As a result, if @code{AC_AIX} is called after @code{AC_COMPILE_CHECK}, -it will note that @code{AC_COMPILE_CHECK} has already been called and -print a warning message. - -@node Checking for Files, Checking for Symbols, Dependencies Between Macros, Writing Macros -@section Checking for Files - -If you need to check whether a file other than a C header file exists, -use @samp{test -f @var{filename}}. If you need to make multiple checks -using @code{test}, combine them with the shell operators @samp{&&} and -@samp{||} instead of using the @code{test} operators @samp{-a} and -@samp{-o}. On System V, the precedence of @samp{-a} and @samp{-o} is -wrong relative to the unary operators; consequently, POSIX does not -specify them, so using them is nonportable. If you combine @samp{&&} -and @samp{||} in the same statement, keep in mind that they have equal -precedence. - -Do not use @samp{test -x}, because 4.3BSD does not have it. Use -@samp{test -f} or @samp{test -r} instead. - -@node Checking for Symbols, Test Programs, Checking for Files, Writing Macros -@section Checking for Symbols - -If you need to check whether a symbol is defined in a C header file, you -can use @code{AC_HEADER_EGREP} if the symbol is not a C preprocessor -macro (@pxref{General Feature Tests}), or compile a small test program that includes -the file and references the symbol (@pxref{Test Programs}). Don't -directly @code{grep} for the symbol in the file, because on some systems -it might be defined in another header file that the file you are -checking @samp{#include}s. - -However, if you need to check for a particular UNIX variant which is -distinguished by having certain text in a certain file, then use -@code{grep} (or @code{egrep}). But don't use @samp{grep -s} to suppress -output, because @samp{grep -s} on System V does not suppress output, -only error messages. Instead, redirect the standard output and standard -error (in case the file doesn't exist) of @code{grep} to -@file{/dev/null}. Check the exit status of @code{grep} to determine -whether it found a match. - -To check whether the Autoconf macros have already defined a certain C -preprocessor symbol, you can use a @code{case} statement like this: +@node Obsolete Macros, , Suggested Ordering, Dependencies Between Macros +@subsection Obsolete Macros + +Configuration and portability technology has evolved over the years. +Often better ways of solving a particular problem are developed, or +ad-hoc approaches are systematized. This process has occurred in many +parts of Autoconf. One result is that some of the macros are now +considered @dfn{obsolete}; they still work, but are no longer considered +the best thing to do. Autoconf provides the @code{AC_OBSOLETE} macro to +warn users producing @code{configure} scripts when they use obsolete +macros, to encourage them to modernize. A sample call is: @example -case "$DEFS" in - *HAVE_FOO*) ;; - *) LIBOBJS="$LIBOBJS foo.o" ;; -esac +AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl @end example -@noindent -Make sure to enclose the variable name you are checking (usually -@code{DEFS}) in double quotes, because otherwise some old versions of -@code{bash} misinterpret the statement. - -@node Test Programs, Multiple Cases, Checking for Symbols, Writing Macros -@section Test Programs - -Autoconf checks for many features by compiling small test programs. To -find out whether a library function is available, Autoconf tries to -compile a small program that uses it. This is unlike Larry Wall's -Metaconfig, which uses @code{nm} or @code{ar} on the C library to try to -figure out which functions are available. Trying to link with the -function is usually a more reliable and flexible approach because it -avoids dealing with the variations in the options and output formats of -@code{nm} and @code{ar} and in the location of the standard libraries. -It also allows @code{configure} to check aspects of the function's -runtime behavior if needed. On the other hand, it is sometimes slower -than scanning the libraries. - -If you need to check for a condition other than whether some symbol -exists on the system or has a certain value, then you can't use -@code{AC_COMPILE_CHECK} (@pxref{General Feature Tests}). You have to write a -test program by hand. You can compile and run it using -@code{AC_TEST_PROGRAM} (@pxref{General Feature Tests}). - -Try to avoid writing test programs if possible, because using them -prevents people from configuring your package for cross-compiling. If -it's really best that you test for a run-time behavior, try to provide a -default ``worst case'' value to use when cross-compiling makes run-time -tests impossible. You do this by passing the optional last argument to -@code{AC_TEST_PROGRAM}. +@defmac AC_OBSOLETE (@var{this-macro-name} @r{[}, @var{suggestion}@r{]}) +@maindex OBSOLETE +Make @code{m4} print a message on the standard error output warning that +@var{this-macro-name} is obsolete, and giving the file and line number +where it was called. @var{this-macro-name} should be the name of the +macro that is calling @code{AC_OBSOLETE}. If @var{suggestion} is given, +it is printed at the end of the warning message; for example, it can be +a suggestion for what to use instead of @var{this-macro-name}. +@end defmac + +@node Manual Configuration, Site Configuration, Writing Macros, Top +@chapter Manual Configuration + +A few kinds of features can't be guessed automatically by running test +programs. For example, the details of the object file format, or +special options that need to be passed to the compiler or linker. It is +possible to check for such features using ad-hoc means, such as having +@code{configure} check the output of the @code{uname} program, or +looking for libraries that are unique to particular systems. However, +Autoconf provides a uniform method for handling unguessable features. @menu -* Guidelines:: General rules for writing test programs. -* Tricks:: Special ways to work around problems. +* Specifying Names:: Specifying the system type. +* Canonicalizing:: Getting the canonical system type. +* System Type Variables:: Variables containing the system type. +* Using System Type:: What to do with the system type. @end menu -@node Guidelines, Tricks, , Test Programs -@subsection Guidelines for Test Programs - -Test programs should return 0 if the test succeeds, nonzero otherwise, -so that success can be distinguished easily from a core dump or other -failure; segmentation violations and other failures produce a nonzero -exit status. Test programs should @code{exit}, not @code{return}, from -@code{main}, because on some systems the argument to @code{return} in -@code{main} is ignored. They should not write anything to the standard -output. +@node Specifying Names, Canonicalizing, , Manual Configuration +@section Specifying the System Type -Test programs can use @code{#if} or @code{#ifdef} to check the values of -preprocessor macros defined by tests that have already run. For -example, if you call @code{AC_STDC_HEADERS}, then later on in -@file{configure.in} you can have a test program that includes an ANSI C -header file conditionally: +Like other GNU @code{configure} scripts, Autoconf-generated +@code{configure} scripts can make decisions based on a canonical name +for the system type, which has the form: @example -@group -#if STDC_HEADERS -#include -#endif -@end group +@var{cpu}-@var{company}-@var{system} @end example -If a test program needs to use or create a data file, give it a name -that starts with @file{conftest}, such as @file{conftestdata}. The -@code{configure} script cleans up by running @samp{rm -rf conftest*} -after running test programs and if the script is interrupted. - -@node Tricks, , Guidelines, Test Programs -@subsection Tricks for Test Programs +@code{configure} can usually guess the canonical name for the type of +system it's running on. To do so it runs a script called +@code{config.guess}, which derives the name using the @code{uname} +command or symbols predefined by the C preprocessor. -If a test program calls a function with invalid parameters (just to see -whether it exists), organize the program to ensure that it never invokes -that function. You can do this by calling it in another function that is -never invoked. You can't do it by putting it after a call to -@code{exit}, because GCC version 2 knows that @code{exit} never returns -and optimizes out any code that follows it in the same block. +Alternately, the user can specify the system type with command line +arguments to @code{configure}. Doing so is necessary when +cross-compiling. In the most complex case of cross-compiling, three +system types are involved. The options to specify them are: -If you include any header files, make sure to call the functions -relevant to them with the correct number of arguments, even if they are -just 0, to avoid compilation errors due to prototypes. GCC version 2 -has internal prototypes for several functions that it automatically -inlines; for example, @code{memcpy}. To avoid errors when checking for -them, either pass them the correct number of arguments or redeclare them -with a different return type (such as @code{char}). +@table @code +@item --build=@var{build-type} +the type of system on which the package is being configured and +compiled (rarely needed); -@node Multiple Cases, , Test Programs, Writing Macros -@section Multiple Cases +@item --host=@var{host-type} +the type of system on which the package will run; -Some operations are accomplished in several possible ways, depending on -the UNIX variant. Checking for them essentially requires a ``case -statement''. Autoconf does not directly provide one; however, it is -easy to simulate by using a shell variable to keep track of whether a -way to perform the operation has been found yet. +@item --target=@var{target-type} +the type of system for which any compiler tools in the package will +produce code. +@end table -Here is an example excerpted from the @file{configure.in} for GNU -@code{find}. It uses the shell variable @code{fstype} to keep track of -whether the remaining cases need to be checked. There are several more -cases which are not shown here but follow the same pattern. +@noindent +If the user gives @code{configure} a non-option argument, it is used as +the default for the host, target, and build system types if the user +does not specify them explicitly with options. The target and build +types default to the host type if it is given and they are not. If you +are cross-compiling, you still have to specify the names of the +cross-tools you use, in particular the C compiler, on the +@code{configure} command line, e.g., @example -@group -echo checking how to get filesystem type -# SVR4. -AC_TEST_CPP([#include -#include ], AC_DEFINE(FSTYPE_STATVFS) fstype=1) -if test -z "$fstype"; then -# SVR3. -AC_TEST_CPP([#include -#include ], AC_DEFINE(FSTYPE_USG_STATFS) fstype=1) -fi -if test -z "$fstype"; then -# AIX. -AC_TEST_CPP([#include -#include ], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=1) -fi -@end group +CC=m68k-coff-gcc configure --target=m68k-coff @end example -@node Makefiles, Invoking configure, Writing Macros, Top -@chapter Makefiles - -Each subdirectory in a distribution should come with a file -@file{Makefile.in}, from which @code{configure} will produce a -@file{Makefile} in that directory. Most of the substitutions that -@code{configure} does are simple: for each configuration variable that -the package uses, it just replaces occurrences of -@samp{@@@var{variable}@@} with the value that @code{configure} has -determined for that variable. Any occurrences of -@samp{@@@var{variable}@@} for variables that @code{configure} does not -know about are passed through unchanged. - -There is no point in checking for the correct value to give a variable -that is never used. Every variable that the @code{configure} script -might set a value for should appear in a @samp{@@@var{variable}@@} reference -in at least one @file{Makefile.in}. If @code{AC_CONFIG_HEADER} is -called, @code{configure} replaces @samp{@@DEFS@@} with -@samp{-DHAVE_CONFIG_H}, since the contents of @code{DEFS} would be -redundant. - -@xref{Makefiles, , Makefile Conventions, standards.info, The GNU Coding -Standards}, for more information on what to put in Makefiles. -@xref{Sample Makefile.in}, for an example of a real @file{Makefile.in}. - -@menu -* Predefined Variables:: Heavily used @code{make} variables. -* Installation Prefixes:: A special variable substitution. -* VPATH Substitutions:: Compiling in a different directory. -* Automatic Remaking:: Makefile rules for configuring. -@end menu - -@node Predefined Variables, Installation Prefixes, , Makefiles -@section Predefined Variables - -Some @code{make} variables are predefined by the Autoconf macros. -@code{AC_SUBST} is called for them automatically (@pxref{Setting -Variables}), so in your @file{Makefile.in} files you can get their -values by enclosing their names in @samp{@@} characters. -@ifinfo -@xref{Makefiles}, for more information on @samp{@@} substitutions. -@end ifinfo -The variables that are defined by the general -purpose Autoconf macros are: - -@defvar exec_prefix -The installation prefix for architecture-specific files. -@end defvar +@code{configure} recognizes short aliases for many system types; for +example, @samp{decstation} can be given on the command line instead of +@samp{mips-dec-ultrix4.2}. @code{configure} runs a script called +@code{config.sub} to canonicalize system type aliases. + +@node Canonicalizing, System Type Variables, Specifying Names, Manual Configuration +@section Getting the Canonical System Type + +The following macros make the system type available to @code{configure} +scripts. They run the shell script @code{config.guess} to determine any +values for the host, target, and build types that they need and the user +did not specify on the command line. They run @code{config.sub} to +canonicalize any aliases the user gave. If you use these macros, you +must distribute those two shell scripts along with your source code. +@xref{Output}, for information about the @code{AC_CONFIG_AUX_DIR} macro +which you can use to control which directory @code{configure} looks for +those scripts in. If you do not use either of these macros, +@code{configure} ignores any @samp{--host}, @samp{--target}, and +@samp{--build} options given to it. + +@defmac AC_CANONICAL_SYSTEM +@maindex CANONICAL_SYSTEM +Determine the system type and set output variables to the names of the +canonical system types. @xref{System Type Variables}, for details about +the variables this macro sets. +@end defmac -@defvar prefix -The installation prefix for architecture-independent files. -@xref{Installation Prefixes}, for an alternate way to set this variable. -@end defvar +@defmac AC_CANONICAL_HOST +@maindex CANONICAL_HOST +Perform only the subset of @code{AC_CANONICAL_SYSTEM} relevant to the +host type. This is all that is needed for programs that are not part of +a compiler toolchain. +@end defmac -@defvar srcdir -The directory that contains the source code for that @file{Makefile}. -@xref{Installation Prefixes}, for an alternate way to set this variable. -@end defvar +@node System Type Variables, Using System Type, Canonicalizing, Manual Configuration +@section System Type Variables -@defvar top_srcdir -The top-level source code directory for the package. In the top-level -directory, this is the same as @code{srcdir}. -@end defvar +After calling @code{AC_CANONICAL_SYSTEM}, the following output variables +contain the system type information. After @code{AC_CANONICAL_HOST}, +only the @code{host} variables below are set. -@defvar DEFS -@samp{-D} options to pass to the C compiler. If @code{AC_CONFIG_HEADER} -is called, @code{configure} replaces @samp{@@DEFS@@} with -@samp{-DHAVE_CONFIG_H}, since the contents of @code{DEFS} would be -redundant. -@end defvar +@table @code +@ovindex build +@ovindex host +@ovindex target +@item @code{build}, @code{host}, @code{target} +the canonical system names; + +@item @code{build_alias}, @code{host_alias}, @code{target_alias} +@ovindex build_alias +@ovindex host_alias +@ovindex target_alias +the names the user specified, or the canonical names if +@code{config.guess} was used; + +@item @code{build_cpu}, @code{build_vendor}, @code{build_os} +@itemx @code{host_cpu}, @code{host_vendor}, @code{host_os} +@itemx @code{target_cpu}, @code{target_vendor}, @code{target_os} +@ovindex build_cpu +@ovindex host_cpu +@ovindex target_cpu +@ovindex build_vendor +@ovindex host_vendor +@ovindex target_vendor +@ovindex build_os +@ovindex host_os +@ovindex target_os +the individual parts of the canonical names (for convenience). +@end table -@defvar LIBS -@samp{-l} and @samp{-L} options to pass to the linker. -@end defvar +@node Using System Type, , System Type Variables, Manual Configuration +@section Using the System Type -@defvar LIBOBJS -Names of object files (ending in @file{.o}). Set by -@code{AC_REPLACE_FUNCS} (@pxref{General Feature Tests}). -@end defvar +How do you use a canonical system type? Usually, you use it in one or +more @code{case} statements in @file{configure.in} to select +system-specific C files. Then link those files, which have names based +on the system name, to generic names, such as @file{host.h} or +@file{target.c}. The @code{case} statement patterns can use shell +wildcards to group several cases together, like in this fragment: -@node Installation Prefixes, VPATH Substitutions, Predefined Variables, Makefiles -@section Installation Prefixes +@example +case "$target" in +i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;; +i960-*-bout) obj_format=bout ;; +esac +@end example -Autoconf-generated @code{configure} scripts support an alternate -method for substituting two particular variables, for compatibility with -Cygnus @code{configure}. This method is not recommended. +@defmac AC_LINK_FILES (@var{source}@dots{}, @var{dest}@dots{}) +@maindex LINK_FILES +Make @code{AC_OUTPUT} link each of the existing files @var{source} to +the corresponding link name @var{dest}. Makes a symbolic link if +possible, otherwise a hard link. The @var{dest} and @var{source} names +should be relative to the top level source or build directory. -If @code{configure} has figured out a value for the installation prefix, -either by the user supplying one on the command line (@pxref{Invoking -configure}) or with @code{AC_PREFIX} (@pxref{General Feature Tests}), then it -substitutes that value in @file{Makefile}s that it creates. Wherever a -@file{Makefile.in} contains lines like +For example, this call: @example -prefix = /usr/local -exec_prefix = $@{prefix@} +AC_LINK_FILES(config/$@{machine@}.h config/$@{obj_format@}.h, host.h object.h) @end example @noindent -@code{configure} substitutes the value it figured out. The substitution -only occurs if the word @samp{prefix} or @samp{exec_prefix} is not -preceded by any other characters on the line, and @code{configure} has -figured out a value for the prefix. - -There can be separate installation prefixes for architecture-specific -files (@code{exec_prefix}) and architecture-independent files -(@code{prefix}). @xref{Invoking configure}, for more information -on setting them. - -Autoconf @code{configure} scripts replace these two variables without -requiring them to be enclosed in @samp{@@} characters, and only if they -have been set, because the Cygnus @code{configure} does so. In -retrospect, being compatible in this way was a bad decision, because it -created an inconsistency in Autoconf without giving significant -benefits. This wart will be removed in a future release of Autoconf. - -@node VPATH Substitutions, Automatic Remaking, Installation Prefixes, Makefiles -@section @code{VPATH} Substitutions +creates in the current directory @file{host.h}, which is a link to +@file{@var{srcdir}/config/$@{machine@}.h}, and @file{object.h}, which is a link +to @file{@var{srcdir}/config/$@{obj_format@}.h}. +@end defmac -You might want to compile a software package in a different directory -from the one that contains the source code. Doing this allows you to -compile the package for several architectures simultaneously from the -same copy of the source code and keep multiple sets of object files on -disk. +@node Site Configuration, Invoking configure, Manual Configuration, Top +@chapter Site Configuration -To support doing this, @code{make} uses the @code{VPATH} variable to -find the files that are in the source directory. GNU @code{make} and -most other recent @code{make} programs can do this. Older @code{make} -programs do not support @code{VPATH}; when using them, the source code -must be in the same directory as the object files. +@code{configure} scripts support several kinds of local configuration +decisions. There are ways for users to specify where external software +packages are, include or exclude optional features, install programs +under modified names, and set default values for @code{configure} +options. + +@menu +* External Software:: Working with other optional software. +* Package Options:: Selecting optional features. +* Site Details:: Configuring site details. +* Transforming Names:: Changing program names when installing. +* Site Defaults:: Giving @code{configure} local defaults. +@end menu + +@node External Software, Package Options, , Site Configuration +@section Working With External Software -To support @code{VPATH}, each @file{Makefile.in} should contain two -lines that look like: +Some packages require, or can optionally use, other software packages +which are already installed. The user can give @code{configure} +command line options to specify which such external software to use. +The options have one of these forms: @example -srcdir = @@srcdir@@ -VPATH = @@srcdir@@ +--with-@var{package}@r{[}=@var{arg}@r{]} +--without-@var{package} @end example -Do not set @code{VPATH} to the value of another variable, for example -@samp{VPATH = $(srcdir)}, because some versions of @code{make} do not do -variable substitutions on the value of @code{VPATH}. +For example, @samp{--with-gnu-ld} means work with the GNU linker instead +of some other linker. @samp{--with-x11} means work with X11. -@code{configure} substitutes in the correct value for @code{srcdir} when -it produces @file{Makefile.in}. +The user can give an argument by following the package name with +@samp{=} and the argument. Giving an argument of @samp{no} is for +packages that are used by default; it says to @emph{not} use the +package. An argument that is neither @samp{yes} nor @samp{no} could +include a name or number of a version of the other package, to specify +more precisely which other package this program is supposed to work +with. If no argument is given, it defaults to @samp{yes}. +@samp{--without-@var{package}} is equivalent to +@samp{--with-@var{package}=no}. -Do not use the @code{make} variable @code{$<}, which expands to the -pathname of the file in the source directory (found with @code{VPATH}), -except in implicit rules. (An implicit rule is one such as @samp{.c.o}, -which tells how to create a @file{.o} file from a @file{.c} file.) Some -versions of @code{make} do not set @code{$<} in explicit rules; they -expand it to an empty value. +For each external software package that may be used, @file{configure.in} +should call @code{AC_ARG_WITH} to detect whether the @code{configure} +user asked to use it. Whether each package is used or not by +default, and which arguments are valid, is up to you. -Instead, @file{Makefile} command lines should always refer to source -files by prefixing them with @samp{$(srcdir)/}. For example: +@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@maindex ARG_WITH +If the user gave @code{configure} the option @samp{--with-@var{package}} +or @samp{--without-@var{package}}, run shell commands +@var{action-if-true}. Otherwise run shell commands +@var{action-if-false}. The name @var{package} indicates another +software package that this program should work with. It should consist +only of alphanumeric characters and dashes. +The option's argument is available to the shell commands +@var{action-if-true} in the shell variable @code{withval}. + +The argument @var{help-string} is a description of the option which +looks like this: @example -time.info: time.texinfo - $(MAKEINFO) $(srcdir)/time.texinfo + --with-readline support fancy command line editing @end example +@noindent +@var{help-string} may be more than one line long, if more detail is +needed. Just make sure the columns line up in @samp{configure --help}. +Avoid tabs in the help string. You'll need to enclose it in @samp{[} +and @samp{]} in order to produce the leading spaces. +@end defmac -@node Automatic Remaking, , VPATH Substitutions, Makefiles -@section Automatic Remaking +@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@maindex WITH +This is an obsolete version of @code{AC_ARG_WITH} that does not +support providing a help string. +@end defmac -You can put rules like the following in the top-level @file{Makefile.in} -for a package to automatically update the configuration information when -you change the configuration files. This example includes all of the -optional files, such as @file{aclocal.m4} and those related to -configuration header files. Omit from the @file{Makefile.in} rules any -of these files that your package does not use. +@node Package Options, Site Details, External Software, Site Configuration +@section Choosing Package Options -The @file{stamp-} files are necessary because the timestamps of -@file{config.h.in} and @file{config.h} will not be changed if remaking -them does not change their contents. This feature avoids unnecessary -recompilation. You should include the file @file{stamp-h.in} your -package's distribution, so @code{make} will consider @file{config.h.in} -up to date. +If a software package has optional compile-time features, the user can +give @code{configure} command line options to specify whether to +compile them. The options have one of these forms: @example -@group -configure: configure.in aclocal.m4 - cd $@{srcdir@} && autoconf +--enable-@var{feature}@r{[}=@var{arg}@r{]} +--disable-@var{feature} +@end example -# autoheader might not change config.h.in -config.h.in: stamp-h.in -stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top - cd $@{srcdir@} && autoheader - touch $@{srcdir@}/stamp-h.in +These options allow users to choose which optional features to build and +install. @samp{--enable-@var{feature}} options should never make a +feature behave differently or cause one feature to replace another. +They should only cause parts of the program to be built rather than left +out. -# config.status might not change config.h -config.h: stamp-h -stamp-h: config.h.in config.status - ./config.status - touch stamp-h +The user can give an argument by following the feature name with +@samp{=} and the argument. Giving an argument of @samp{no} requests +that the feature @emph{not} be made available. A feature with an +argument looks like @samp{--enable-debug=stabs}. If no argument is +given, it defaults to @samp{yes}. @samp{--disable-@var{feature}} is +equivalent to @samp{--enable-@var{feature}=no}. + +For each optional feature, @file{configure.in} should call +@code{AC_ARG_ENABLE} to detect whether the @code{configure} user asked +to include it. Whether each feature is included or not by default, and +which arguments are valid, is up to you. + +@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@maindex ARG_ENABLE +If the user gave @code{configure} the option +@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run +shell commands @var{action-if-true}. Otherwise run shell commands +@var{action-if-false}. The name @var{feature} indicates an optional +user-level facility. It should consist only of alphanumeric characters +and dashes. + +The option's argument is available to the shell commands +@var{action-if-true} in the shell variable @code{enableval}. +The @var{help-string} argument is like that of @code{AC_ARG_WITH} +(@pxref{External Software}). +@end defmac -Makefile: Makefile.in config.status - ./config.status +@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@maindex ENABLE +This is an obsolete version of @code{AC_ARG_ENABLE} that does not +support providing a help string. +@end defmac -config.status: configure - ./config.status --recheck -@end group -@end example +@node Site Details, Transforming Names, Package Options, Site Configuration +@section Configuring Site Details + +Some software packages require complex site-specific information. Some +examples are host names to use for certain services, company names, and +email addresses to contact. Since some configuration scripts generated +by Metaconfig ask for such information interactively, people sometimes +wonder how to get that information in Autoconf-generated configuration +scripts, which aren't interactive. + +Such site configuration information should be put in a file that is +edited @emph{only by users}, not by programs. The location of the file +can either be based on the @code{prefix} variable, or be a standard +location such as the user's home directory. It could even be specified +by an environment variable. The programs should examine that file at +run time, rather than at compile time. That approach is more convenient +for users and makes the configuration process simpler than getting the +information while configuring. @xref{Directory Variables, , Variables +for Installation Directories, standards, GNU Coding Standards}, for more +information on where to put data files. + +@node Transforming Names, Site Defaults, Site Details, Site Configuration +@section Transforming Program Names When Installing + +Autoconf supports changing the names of programs when installing them. +In order to use these transformations, @file{configure.in} must call the +macro @code{AC_ARG_PROGRAM}. + +@defmac AC_ARG_PROGRAM +@maindex ARG_PROGRAM +@ovindex program_transform_name +Place in output variable @code{program_transform_name} a sequence of +@code{sed} commands for changing the names of installed programs. + +If any of the options described below are given to @code{configure}, +program names are transformed accordingly. Otherwise, if +@code{AC_CANONICAL_SYSTEM} has been called and a @samp{--target} value +is given that differs from the host type (specified with @samp{--host} +or defaulted by @code{config.sub}), the target type followed by a dash +is used as a prefix. Otherwise, no program name transformation is done. +@end defmac -@xref{Invoking config.status}, for more information on handling -configuration-related dependencies. +@menu +* Transformation Options:: @code{configure} options to transforme names. +* Transformation Examples:: Sample uses of transforming names. +* Transformation Rules:: @file{Makefile} uses of transforming names. +@end menu -@node Invoking configure, Example, Makefiles, Top -@chapter Running @code{configure} Scripts +@node Transformation Options, Transformation Examples, , Transforming Names +@subsection Transformation Options -A software package that uses a @code{configure} script -should be distributed with a file @file{Makefile.in}, but no -@file{Makefile}; that way, the user has to properly configure the -package for the local system before compiling it. -Here is how to configure a package that uses a @code{configure} script. - -Normally, you just @code{cd} to the directory containing the package's -source code and type @samp{./configure}. If you're using @code{csh} on -an old version of System V, you might need to type @samp{sh configure} -instead to prevent @code{csh} from trying to execute @code{configure} -itself. - -Running @code{configure} takes awhile. While it is running, it -prints some messages that tell what it is doing. If you don't want to -see any messages, run @code{configure} with its standard output -redirected to @file{/dev/null}; for example, @samp{./configure >/dev/null}. - -To compile the package in a different directory from the one containing -the source code, you must use a version of @code{make} that supports the -@code{VPATH} variable, such as GNU @code{make}. @code{cd} to the -directory where you want the object files and executables to go and run -the @code{configure} script. @code{configure} automatically checks for -the source code in the directory that @code{configure} is in and in -@file{..}. If for some reason @code{configure} is not in the source -code directory that you are configuring, then it will report that it -can't find the source code. In that case, run @code{configure} with the -option @samp{--srcdir=@var{dir}}, where @var{dir} is the directory that -contains the source code. - -By default, @samp{make install} will install the package's files in -@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can specify an -installation prefix other than @file{/usr/local} by giving -@code{configure} the option @samp{--prefix=@var{path}}. Alternately, -you can do so by consistently giving a value for the @samp{prefix} -variable when you run @code{make}, e.g., -@example -make prefix=/usr/gnu -make prefix=/usr/gnu install -@end example - -You can specify separate installation prefixes for architecture-specific -files and architecture-independent files. If you give @code{configure} -the option @samp{--exec-prefix=@var{path}} or set the @code{make} -variable @samp{exec_prefix} to @var{path}, the package will use -@var{path} as the prefix for installing programs and libraries. Data -files and documentation will still use the regular prefix. Normally, -all files are installed using the same prefix. - -Some packages pay attention to @samp{--with-@var{package}} options to -@code{configure}, where @var{package} is something like @samp{gnu-as} or -@samp{x} (for the X Window System). They may also pay attention to -@samp{--enable-@var{feature}} options, where @var{feature} indicates an -optional part of the package. The README should mention any -@samp{--with-} and @samp{--enable-} options that the package recognizes. - -@code{configure} also recognizes the following options: +You can specify name transformations by giving @code{configure} these +command line options: @table @code -@item --help -Print a summary of the options to @code{configure}, and exit. +@item --program-prefix=@var{prefix} +prepend @var{prefix} to the names; -@itemx --quiet -@item --silent -Do not print messages saying which checks are being made. +@item --program-suffix=@var{suffix} +append @var{suffix} to the names; -@item --verbose -Print the results of the checks. +@item --program-transform-name=@var{expression} +perform @code{sed} substitution @var{expression} on the names. +@end table -@item --version -Print the version of Autoconf used to generate the @code{configure} -script, and exit. +@node Transformation Examples, Transformation Rules, Transformation Options, Transforming Names +@subsection Transformation Examples -@item --x-includes=@var{dir} -X include files are in @var{dir}. +These transformations are useful with programs that can be part of a +cross-compilation development environment. For example, a +cross-assembler running on a Sun 4 configured with +@samp{--target=i960-vxworks} is normally installed as +@file{i960-vxworks-as}, rather than @file{as}, which could be confused +with a native Sun 4 assembler. -@item --x-libraries=@var{dir} -X library files are in @var{dir}. -@end table +You can force a program name to begin with @file{g}, if you don't want +GNU programs installed on your system to shadow other programs with the +same name. For example, if you configure GNU @code{diff} with +@samp{--program-prefix=g}, then when you run @samp{make install} it is +installed as @file{/usr/local/bin/gdiff}. -@code{configure} also accepts and ignores some other options. +As a more sophistocated example, you could use +@example +--program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/' +@end example +@noindent +to prepend @samp{g} to most of the program names in a source tree, +excepting those like @code{gdb} that already have one and those like +@code{less} and @code{lesskey} that aren't GNU programs. (That is +assuming that you have a source tree containing those programs that is +set up to use this feature.) -@menu -* Overriding variables:: Workarounds for unusual systems. -* Invoking config.status:: Recreating a configuration. -@end menu +One way to install multiple versions of some programs simultaneously is +to append a version number to the name of one or both. For example, if +you want to keep Autoconf version 1 around for awhile, you can configure +Autoconf version 2 using @samp{--program-suffix=2} to install the +programs as @file{/usr/local/bin/autoconf2}, +@file{/usr/local/bin/autoheader2}, etc. -@node Overriding variables, Invoking config.status, , Invoking configure -@section Overriding variables +@node Transformation Rules, , Transformation Examples, Transforming Names +@subsection Transformation Rules -On systems that require unusual options for compilation or linking that -the package's @code{configure} script does not know about, you can give -@code{configure} initial values for variables by setting them in the -environment. In Bourne-compatible shells, you can do that on the -command line like this: +Here is how to use the variable @code{program_transform_name} in a +@file{Makefile.in}: @example -CC='gcc -traditional' LIBS=-lposix ./configure +transform=@@program_transform_name@@ +install: all + $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'` + +uninstall: + rm -f $(bindir)/`echo myprog|sed '$(transform)'` @end example @noindent -On systems that have the @code{env} program, you can do it like this: +If you have more than one program to install, you can do it in a loop: @example -env CC='gcc -traditional' LIBS=-lposix ./configure -@end example - -Here are the @code{make} variables that you might want to override with -environment variables when running @code{configure}. +PROGRAMS=cp ls rm +install: + for p in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + done -For these variables, any value given in the environment overrides the -value that @code{configure} would choose: +uninstall: + for p in $(PROGRAMS); do \ + rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ + done +@end example -@defvar CC -C compiler program. The default is @code{cc}. -@end defvar +Whether to do the transformations on documentation files (Texinfo or +@code{man}) is a tricky question; there seems to be no perfect answer, +due to the several reasons for name transforming. Documentation is not +usually particular to a specific architecture, and Texinfo files do not +conflict with system documentation. But they might conflict with +earlier versions of the same files, and @code{man} pages sometimes do +conflict with system documentation. As a compromise, it is probably +best to do name transformations on @code{man} pages but not on Texinfo +manuals. + +@node Site Defaults, , Transforming Names, Site Configuration +@section Setting Site Defaults + +Autoconf-generated @code{configure} scripts allow your site to provide +default values for some configuration values. You do this by creating +site- and system-wide initialization files. + +@evindex CONFIG_SITE +If the environment variable @code{CONFIG_SITE} is set, @code{configure} +uses its value as the name of a shell script to read. Otherwise, it +reads the shell script @file{@var{prefix}/share/config.site} if it exists, +then @file{@var{prefix}/etc/config.site} if it exists. Thus, +settings in machine-specific files override those in machine-independent +ones in case of conflict. + +Site files can be arbitrary shell scripts, but only certain kinds of +code are really appropriate to be in them. Because @code{configure} +reads any cache file after it has read any site files, a site file can +define a default cache file to be shared between all Autoconf-generated +@code{configure} scripts run on that system. If you set a default cache +file in a site file, it is a good idea to also set the output variable +@code{CC} in that site file, because the cache file is only valid for a +particular compiler, but many systems have several available. + +Site files are also good places to set default values for other output +variables, such as @code{CFLAGS}, if you need to give them non-default +values: anything you would normally do, repetitively, on the command +line. If you use non-default values for @var{prefix} or +@var{exec_prefix} (wherever you locate the site file), you can set them +in the site file if you specify it with the @code{CONFIG_SITE} +environment variable. + +You can set some cache values in the site file itself. Doing this is +useful if you are cross-compiling, so it is impossible to check features +that require running a test program. You could ``prime the cache'' by +setting those values correctly for that system in +@file{@var{prefix}/etc/config.site}. To find out the names of the cache +variables you need to set, look for shell variables with @samp{_cv_} in +their names in the affected @code{configure} scripts, or in the Autoconf +@code{m4} source code for those macros. + +The cache file is careful to not override any variables set in the site +files. Similarly, you should not override command-line options in the +site files. Your code should check that variables such as @code{prefix} +and @code{cache_file} have their default values (as set near the top of +@code{configure}) before changing them. + +Here is a sample file @file{/usr/share/local/gnu/share/config.site}. The +command @samp{configure --prefix=/usr/share/local/gnu} would read this +file (if @code{CONFIG_SITE} is not set to a different file). -@defvar INSTALL -Program to use to install files. The default is @code{install} if you -have it, @code{cp} otherwise. -@end defvar +@example +# config.site for configure +# +# Default --prefix and --exec-prefix. +test "$prefix" = NONE && prefix=/usr/share/local/gnu +test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu +# +# Give Autoconf 2.x generated configure scripts a shared default +# cache file for feature test results, architecture-specific. +if test "$cache_file" = ./config.cache; then + cache_file="$prefix/var/config.cache" + # A cache file is only valid for one C compiler. + CC=gcc +fi +@end example -For these variables, any value given in the environment is added to -the value that @code{configure} chooses: +@node Invoking configure, Invoking config.status, Site Configuration, Top +@chapter Running @code{configure} Scripts -@defvar DEFS -Configuration options, in the form @samp{-Dfoo -Dbar@dots{}}. Do not -use this variable in packages that create a configuration header file. -@end defvar +Below are instructions on how to configure a package that uses a +@code{configure} script, suitable for inclusion as an @file{INSTALL} +file in the package. -@defvar LIBS -Libraries to link with, in the form @samp{-lfoo -lbar@dots{}}. -@end defvar +@menu +* Basic Installation:: Instructions for typical cases. +* Compilers and Options:: Selecting compilers and optimization. +* Build Directory:: Configuring in a different directory. +* Installation Names:: Installing in different directories. +* Optional Features:: Selecting optional features. +* System Type:: Specifying the system type. +* Sharing Defaults:: Setting site-wide defaults for @code{configure}. +* Operation Controls:: Changing how @code{configure} runs. +@end menu -In the long term, most problems requiring manual intervention should be -fixed by updating either the Autoconf macros or the @file{configure.in} -file for that package. @xref{Making configure Scripts}, for a -discussion of that subject. +@include install.texi -@node Invoking config.status, , Overriding variables, Invoking configure -@section Recreating a Configuration +@node Invoking config.status, Questions, Invoking configure, Top +@chapter Recreating a Configuration The @code{configure} script creates a file named @file{config.status} which describes which configuration options were specified when the @@ -2811,11 +4154,13 @@ You can give @file{config.status} the @samp{--recheck} option to update itself. This option is useful if you change @code{configure}, so that the results of some tests might be different from the previous run. The @samp{--recheck} option re-runs @code{configure} with the same arguments -you used before, plus the @samp{--no-create} option, which prevents +you used before, plus the @samp{--no-create} option, which prevent @code{configure} from running @file{config.status} and creating -@file{Makefile} and other files. (This is so other @file{Makefile} -rules can run @file{config.status} when it changes; @pxref{Automatic -Remaking}, for an example). +@file{Makefile} and other files, and the @samp{--no-recursion} option, +which prevents @code{configure} from running other @code{configure} +scripts in subdirectories. (This is so other @file{Makefile} rules can +run @file{config.status} when it changes; @pxref{Automatic Remaking}, +for an example). @file{config.status} also accepts the options @samp{--help}, which prints a summary of the options to @file{config.status}, and @@ -2826,11 +4171,20 @@ the @code{configure} script that generated @file{config.status}. can alter its behavior: @defvar CONFIG_SHELL +@evindex CONFIG_SHELL The shell with which to run @code{configure} for the @samp{--recheck} -option. The default is @file{/bin/sh}. +option. It must be Bourne-compatible. The default is @file{/bin/sh}. +@end defvar + +@defvar CONFIG_STATUS +@evindex CONFIG_STATUS +The file name to use for the shell script that records the +configuration. The default is @file{./config.status}. This variable is +useful when one package uses parts of another and the @code{configure} +scripts shouldn't be merged because they are maintained separately. @end defvar -The following two variables provide one way for separately distributed +The following variables provide one way for separately distributed packages to share the values computed by @code{configure}. Doing so can be useful if some of the packages need a superset of the features that one of them, perhaps a common library, does. These variables allow a @@ -2838,11 +4192,13 @@ one of them, perhaps a common library, does. These variables allow a @file{configure.in} specifies, so it can be used for a different package. @defvar CONFIG_FILES +@evindex CONFIG_FILES The files in which to perform @samp{@@@var{variable}@@} substitutions. The default is the arguments given to @code{AC_OUTPUT} in @file{configure.in}. @end defvar @defvar CONFIG_HEADERS +@evindex CONFIG_HEADERS The files in which to substitute C @code{#define} statements. The default is the arguments given to @code{AC_CONFIG_HEADER}; if that macro was not called, @file{config.status} ignores this variable. @@ -2856,11 +4212,10 @@ can make each run only regenerate the files for that rule: @example @group -# config.status might not change config.h config.h: stamp-h stamp-h: config.h.in config.status CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status - touch stamp-h + echo > stamp-h Makefile: Makefile.in config.status CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status @@ -2871,189 +4226,855 @@ Makefile: Makefile.in config.status (If @file{configure.in} does not call @code{AC_CONFIG_HEADER}, there is no need to set @code{CONFIG_HEADERS} in the @code{make} rules.) -@node Example, Preprocessor Symbol Index, Invoking configure, Top -@chapter An Example +@node Questions, Upgrading, Invoking config.status, Top +@chapter Questions About Autoconf -Here are sample @file{configure.in} and @file{Makefile.in} files, to -give a real illustration of using Autoconf. They are from the GNU -@code{cpio} package, which also includes the @code{mt} and @code{rmt} -programs. This package does not use a configuration header file; it -passes @samp{-D} options to the C compiler on the command line. +Several questions about Autoconf come up occasionally. Here some of them +are addressed. @menu -* Sample configure.in:: An example of a @file{configure} template. -* Sample Makefile.in:: An example of a @file{Makefile} template. +* Distributing:: Distributing @code{configure} scripts. +* Why GNU m4:: Why not use the standard @code{m4}? +* Bootstrapping:: Autoconf and GNU @code{m4} require each other? +* Why Not Imake:: Why GNU uses @code{configure} instead of Imake. @end menu -@node Sample configure.in, Sample Makefile.in, , Example -@section Sample @file{configure.in} +@node Distributing, Why GNU m4, , Questions +@section Distributing @code{configure} Scripts -@noindent -Here is @file{configure.in} from GNU @code{cpio}. The @code{dnl} macro -after @code{AC_SUBST} is suppresses an extra (though harmless) newline -in the generated @code{configure} script (because the @code{AC_SUBST} -macro does not produce any output where it is called). +@display +What are the restrictions on distributing @code{configure} +scripts that Autoconf generates? How does that affect my +programs that use them? +@end display -@example -dnl Process this file with autoconf to produce a configure script. -AC_INIT(cpio.h) -PROGS="cpio" -AC_SUBST(PROGS)dnl -AC_PROG_CC -AC_PROG_CPP -AC_GCC_TRADITIONAL -AC_PROG_INSTALL -AC_AIX -AC_MINIX -AC_ISC_POSIX -AC_RETSIGTYPE -AC_MAJOR_HEADER -AC_REMOTE_TAPE -test -n "$have_mtio" && PROGS="$PROGS mt" -AC_RSH -AC_CONST -AC_UID_T -AC_STDC_HEADERS -AC_HAVE_HEADERS(string.h fcntl.h utime.h unistd.h sys/io/trioctl.h) -AC_REPLACE_FUNCS(fnmatch bcopy mkdir strdup) -AC_HAVE_FUNCS(strerror lchown) -AC_VPRINTF -AC_ALLOCA -AC_XENIX_DIR -AC_HAVE_LIBRARY(socket, [LIBS="$LIBS -lsocket"]) -AC_HAVE_LIBRARY(nsl, [LIBS="$LIBS -lnsl"]) -AC_OUTPUT(Makefile) -@end example - -@node Sample Makefile.in, , Sample configure.in, Example -@section Sample @file{Makefile.in} +There are no restrictions on how the configuration scripts that Autoconf +produces may be distributed or used. In Autoconf version 1, they were +covered by the GNU General Public License. We still encourage software +authors to distribute their work under terms like those of the GPL, but +doing so is not required to use Autoconf. -@noindent -Here is @file{Makefile.in} from GNU @code{cpio}, with some irrelevant -lines omitted, for brevity. +Of the other files that might be used with @code{configure}, +@file{config.h.in} is under whatever copyright you use for your +@file{configure.in}, since it is derived from that file and from the +public domain file @file{acconfig.h}. @file{config.sub} and +@file{config.guess} have an exception to the GPL when they are used with +an Autoconf-generated @code{configure} script, which permits you to +distribute them under the same terms as the rest of your package. +@file{install-sh} is from the X Consortium and is not copyrighted. + +@node Why GNU m4, Bootstrapping, Distributing, Questions +@section Why Require GNU @code{m4}? + +@display +Why does Autoconf require GNU @code{m4}? +@end display + +Many @code{m4} implementations have hard-coded limitations on the size +and number of macros, which Autoconf exceeds. They also lack several +builtin macros that it would be difficult to get along without in a +sophisticated application like Autoconf, including: @example -srcdir = @@srcdir@@ -VPATH = @@srcdir@@ +builtin +indir +patsubst +__file__ +__line__ +@end example + +Since only software maintainers need to use Autoconf, and since GNU +@code{m4} is simple to configure and install, it seems reasonable to +require GNU @code{m4} to be installed also. Many maintainers of GNU and +other free software already have most of the GNU utilities installed, +since they prefer them. + +@node Bootstrapping, Why Not Imake, Why GNU m4, Questions +@section How Can I Bootstrap? + +@display +If Autoconf requires GNU @code{m4} and GNU @code{m4} has an +Autoconf @code{configure} script, how do I bootstrap? It seems +like a chicken and egg problem! +@end display + +This is a misunderstanding. Although GNU @code{m4} does come with a +@code{configure} script produced by Autoconf, Autoconf is not required +in order to run the script and install GNU @code{m4}. Autoconf is only +required if you want to change the @code{m4} @code{configure} script, +which few people have to do (mainly its maintainer). -CC = @@CC@@ +@node Why Not Imake, , Bootstrapping, Questions +@section Why Not Imake? -INSTALL = @@INSTALL@@ -INSTALL_PROGRAM = @@INSTALL_PROGRAM@@ -INSTALL_DATA = @@INSTALL_DATA@@ +@display +Why not use Imake instead of @code{configure} scripts? +@end display + +Several people have written addressing this question, so I include +adaptations of their explanations here. + +The following answer is based on one written by Richard Pixley: + +Autoconf generated scripts frequently work on machines which it has +never been set up to handle before. That is, it does a good job of +inferring a configuration for a new system. Imake cannot do this. + +Imake uses a common database of host specific data. For X11, this makes +sense because the distribution is made as a collection of tools, by one +central authority who has control over the database. + +GNU tools are not released this way. Each GNU tool has a maintainer; +these maintainers are scattered across the world. Using a common +database would be a maintenance nightmare. Autoconf may appear to be +this kind of database, but in fact it is not. Instead of listing host +dependencies, it lists program requirements. + +Imake is special-purpose. It is directed at building the X11 +distribution. By comparison to the GNU tools, this is a simple problem. +If you view the GNU suite as a collection of native tools, then the +problems are similar. But the GNU tools are more powerful than that. +The development tools can be configured as cross tools in almost any +host+target permutation. All of these configurations can be installed +concurrently. They can even be configured to share host independent +files across hosts. Imake doesn't address these issues. + +Imake templates are a form of standardization. The GNU coding standards +address the same issues without necessarily imposing the same +restrictions. + +Here is some further explanation, written by Per Bothner: + +One of the advantages of Imake is that it easy to generate large +Makefiles using @code{cpp}'s @samp{#include} and macro mechanisms. +However, @code{cpp} is not programmable: it has limited conditional +facilities, and no looping. And @code{cpp} cannot inspect its +environment. + +All of these problems are solved by using @code{sh} instead of +@code{cpp}. The shell is fully programmable, has macro substitution, +can execute (or source) other shell scripts, and can inspect its +environment. + +Paul Eggert elaborates more: + +With Autoconf, installers need not assume that Imake itself is already +installed and working well. This may not seem like much of an advantage +to people who are accustomed to Imake. But on many hosts Imake is not +installed or the default installation is not working well, and requiring +Imake to install a package hinders the acceptance of that package on +those hosts. For example, the Imake template and configuration files +might not be installed properly on a host, or the Imake build procedure +might wrongly assume that all source files are in one big directory +tree, or the Imake configuration might assume one compiler whereas the +package or the installer needs to use another, or there might be a +version mismatch between the Imake expected by the package and the Imake +suported by the host. These problems are much rarer with Autoconf, +where each package comes with its own independent configuration +processor. + +Also, Imake often suffers from unexpected interactions between +@code{make} and the installer's C preprocessor. The fundamental problem +here is that the C preprocessor was designed to preprocess C programs, +not @file{Makefile}s. This is much less of a problem with Autoconf, +which uses the general-purpose preprocessor @code{m4}, and where the +package's author (rather than the installer) does the preprocessing in a +standard way. + +Finally, Mark Eichin notes: + +Imake isn't all that extensible, either. In order to add new features to +Imake, you need to provide you own project template, and duplicate most +of the features of the existing one. This means that for a sophisticated +project, using the vendor-provided Imake templates fails to provide any +leverage---since they don't cover anything that your own project needs +(unless it is an X11 program). + +On the other side, though: + +The one advantage that Imake has over @code{configure}: +@file{Imakefile}s tend to be much shorter (likewise, less redundant) +than @file{Makefile.in}s. There is a fix to this, however---at least +for the Kerberos V5 tree, we've modified things to call in common +@file{post.in} and @file{pre.in} @file{Makefile} fragments for the +entire tree. This means that a lot of common things don't have to be +duplicated, even though they normally are in @code{configure} setups. + +@node Upgrading, History, Questions, Top +@chapter Upgrading From Version 1 + +Autoconf version 2 is mostly backward compatible with version 1. +However, it introduces better ways to do some things, and doesn't +support some of the ugly things in version 1. So, depending on how +sophisticated your @file{configure.in} files are, you might have to do +some manual work in order to upgrade to version 2. This chapter points +out some problems to watch for when upgrading. Also, perhaps your +@code{configure} scripts could benefit from some of the new features in +version 2; the changes are summarized in the file @file{NEWS} in the +Autoconf distribution. + +First, make sure you have GNU @code{m4} version 1.1 or higher installed, +preferably 1.3 or higher. Versions before 1.1 have bugs that prevent +them from working with Autoconf version 2. Versions 1.3 and later are +much faster than earlier versions, because as of version 1.3, GNU +@code{m4} has a more efficient implementation of diversions and can +freeze its internal state in a file that it can read back quickly. + +@menu +* Changed File Names:: Files you might rename. +* Changed Makefiles:: New things to put in @file{Makefile.in}. +* Changed Macros:: Macro calls you might replace. +* Invoking autoupdate:: Replacing old macro names in @code{configure.in}. +* Changed Results:: Changes in how to check test results. +* Changed Macro Writing:: Better ways to write your own macros. +@end menu + +@node Changed File Names, Changed Makefiles, , Upgrading +@section Changed File Names + +If you have an @file{aclocal.m4} installed with Autoconf (as opposed to +in a particular package's source directory), you must rename it to +@file{acsite.m4}. @xref{Invoking autoconf}. -DEFS = @@DEFS@@ -LIBS = @@LIBS@@ -RTAPELIB = @@RTAPELIB@@ +If you distribute @file{install.sh} with your package, rename it to +@file{install-sh} so @code{make} builtin rules won't inadvertantly +create a file called @file{install} from it. @code{AC_PROG_INSTALL} +looks for the script under both names, but it is best to use the new name. -CFLAGS = -g -LDFLAGS = -g +If you were using @file{config.h.top} or @file{config.h.bot}, you still +can, but you will have less clutter if you merge them into +@file{acconfig.h}. @xref{Invoking autoheader}. +@node Changed Makefiles, Changed Macros, Changed File Names, Upgrading +@section Changed Makefiles + +Add @samp{@@CFLAGS@@}, @samp{@@CPPFLAGS@@}, and @samp{@@LDFLAGS@@} in +your @file{Makefile.in} files, so they can take advantage of the values +of those variables in the environment when @code{configure} is run. +Doing this isn't necessary, but it's a convenience for users. + +Also add @samp{@@configure_input@@} in a comment to each input file for +@code{AC_OUTPUT}, so that the output files will contain a comment saying +they were produced by @code{configure}. Automatically selecting the +right comment syntax for all the kinds of files that people call +@code{AC_OUTPUT} on became too much work. + +Add @file{config.log} and @file{config.cache} to the list of files you +remove in @code{distclean} targets. + +If you have the following in @file{Makefile.in}: + +@example prefix = /usr/local -exec_prefix = $(prefix) -binprefix = -manprefix = - -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib -mandir = $(prefix)/man/man1 -manext = 1 - -SHELL = /bin/sh - -SRCS = copyin.c copyout.c copypass.c defer.c dstring.c global.c \ -main.c tar.c util.c error.c getopt.c getopt1.c filemode.c version.c \ -rtapelib.c dirname.c idcache.c makepath.c xmalloc.c stripslash.c \ -userspec.c xstrdup.c bcopy.c fnmatch.c mkdir.c strdup.c -OBJS = copyin.o copyout.o copypass.o defer.o dstring.o global.o \ -main.o tar.o util.o error.o getopt.o getopt1.o filemode.o version.o \ -$(RTAPELIB) dirname.o idcache.o makepath.o xmalloc.o stripslash.o \ -userspec.o xstrdup.o @@LIBOBJS@@ @@ALLOCA@@ -# mt source files not shared with cpio. -MT_SRCS = mt.c argmatch.c -MT_OBJS = mt.o argmatch.o error.o getopt.o getopt1.o \ -xmalloc.o version.o $(RTAPELIB) @@ALLOCA@@ -HDRS = cpio.h cpiohdr.h tar.h tarhdr.h defer.h dstring.h extern.h filetypes.h \ -system.h fnmatch.h getopt.h rmt.h -DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in \ -README NEWS INSTALL cpio.1 mt.1 makefile.pc makefile.os2 cpio.def \ -configure configure.in mkinstalldirs $(MT_SRCS) rmt.c tcexparg.c alloca.c - -all: @@PROGS@@ - -.c.o: - $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $< - -install: installdirs all $(srcdir)/cpio.1 $(srcdir)/mt.1 - $(INSTALL_PROGRAM) cpio $(bindir)/$(binprefix)cpio - test ! -f mt || $(INSTALL_PROGRAM) mt $(bindir)/$(binprefix)mt - -test ! -f rmt || $(INSTALL_PROGRAM) rmt $(libdir)/rmt - $(INSTALL_DATA) $(srcdir)/cpio.1 $(mandir)/$(manprefix)cpio.$(manext) - test ! -f mt || \ - $(INSTALL_DATA) $(srcdir)/mt.1 $(mandir)/$(manprefix)mt.$(manext) - -installdirs: - $(srcdir)/mkinstalldirs $(bindir) $(libdir) $(mandir) +exec_prefix = $@{prefix@} +@end example -uninstall: - cd $(bindir); rm -f $(binprefix)cpio $(binprefix)mt - -rm -f $(libdir)/rmt - cd $(mandir); rm -f $(manprefix)cpio.$(manext) $(manprefix)mt.$(manext) +@noindent +you must change it to: -check: - @@echo No tests are supplied. +@example +prefix = @@prefix@@ +exec_prefix = @@exec_prefix@@ +@end example -cpio: $(OBJS) - $(CC) $(LDFLAGS) -o $@@ $(OBJS) $(LIBS) +@noindent +The old feature of replacing those variables without @samp{@@} +characters around them has been removed. + +@node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading +@section Changed Macros + +Many of the macros were renamed in Autoconf version 2. You can still +use the old names, but the new ones are clearer, and it's easier to find +the documentation for them. @xref{Old Macro Names}, for a table showing +the new names for the old macros. Use the @code{autoupdate} program to +convert your @file{configure.in} to using the new macro names. +@xref{Invoking autoupdate}. + +Some macros have been superseded by similar ones that do the job better, +but are not call-compatible. If you get warnings about calling obsolete +macros while running @code{autoconf}, you may safely ignore them, but your +@code{configure} script will generally work better if you follow the +advice it prints about what to replace the obsolete macros with. In +particular, the mechanism for reporting the results of tests has +changed. If you were using @code{echo} or @code{AC_VERBOSE}, your +@code{configure} script's output will look better if you switch to +@code{AC_MSG_CHECKING} and @code{AC_MSG_RESULT}. @xref{Printing +Messages}. Those macros work best in conjunction with cache variables. +@xref{Caching Results}. + +@node Invoking autoupdate, Changed Results, Changed Macros, Upgrading +@section Using @code{autoupdate} to Modernize @code{configure} + +The @code{autoupdate} program updates a @file{configure.in} file that +calls Autoconf macros by their old names to use the current macro names. +In version 2 of Autoconf, most of the macros were renamed to use a more +uniform and descriptive naming scheme. @xref{Macro Names}, for a +description of the new scheme. Although the old names still work +(@pxref{Old Macro Names}, for a list of the old macro names and the +corresponding new names), you can make your @file{configure.in} files +more readable and make it easier to use the current Autoconf +documentation if you update them to use the new macro names. + +@evindex SIMPLE_BACKUP_SUFFIX +If given no arguments, @code{autoupdate} updates @file{configure.in}, +backing up the original version with the suffix @file{~} (or the value +of the environment variable @code{SIMPLE_BACKUP_SUFFIX}, if that is +set). If you give @code{autoupdate} an argument, it reads that file +instead of @file{configure.in} and writes the updated file to the +standard output. -rmt: rmt.o - $(CC) $(LDFLAGS) -o $@@ rmt.o $(LIBS) +@noindent +@code{autoupdate} accepts the following options: -mt: $(MT_OBJS) - $(CC) $(LDFLAGS) -o $@@ $(MT_OBJS) $(LIBS) +@table @code +@item --help +@itemx -h +Print a summary of the command line options and exit. + +@item --macrodir=@var{dir} +@itemx -m @var{dir} +@evindex AC_MACRODIR +Look for the Autoconf macro files in directory @var{dir} instead of the +default installation directory. +You can also set the @code{AC_MACRODIR} +environment variable to a directory; this option overrides the +environment variable. -Makefile: Makefile.in config.status - $(SHELL) config.status -config.status: configure - $(SHELL) config.status --recheck -configure: configure.in - cd $(srcdir); autoconf +@item --version +Print the version number of @code{autoupdate} and exit. +@end table -TAGS: $(SRCS) - etags $(SRCS) +@node Changed Results, Changed Macro Writing, Invoking autoupdate, Upgrading +@section Changed Results -clean: - rm -f cpio rmt mt *.o core +If you were checking the results of previous tests by examining the +shell variable @code{DEFS}, you need to switch to checking the values of +the cache variables for those tests. @code{DEFS} no longer exists while +@code{configure} is running; it is only created when generating output +files. This difference from version 1 is because properly quoting the +contents of that variable turned out to be too cumbersome and +inefficient to do every time @code{AC_DEFINE} is called. @xref{Cache +Variable Names}. -mostlyclean: clean +For example, here is a @file{configure.in} fragment written for Autoconf +version 1: -distclean: clean - rm -f Makefile config.status +@example +AC_HAVE_FUNCS(syslog) +case "$DEFS" in +*-DHAVE_SYSLOG*) ;; +*) # syslog is not in the default libraries. See if it's in some other. + saved_LIBS="$LIBS" + for lib in bsd socket inet; do + AC_CHECKING(for syslog in -l$lib) + LIBS="$saved_LIBS -l$lib" + AC_HAVE_FUNCS(syslog) + case "$DEFS" in + *-DHAVE_SYSLOG*) break ;; + *) ;; + esac + LIBS="$saved_LIBS" + done ;; +esac +@end example -realclean: distclean - rm -f TAGS +Here is a way to write it for version 2: -dist: $(DISTFILES) - echo cpio-`sed -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname - rm -rf `cat .fname` - mkdir `cat .fname` - -ln $(DISTFILES) `cat .fname` - for file in $(DISTFILES); do \ - test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \ - done - tar chzf `cat .fname`.tar.gz `cat .fname` - rm -rf `cat .fname` .fname +@example +AC_CHECK_FUNCS(syslog) +if test $ac_cv_func_syslog = no; then + # syslog is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG) + LIBS="$LIBS $lib"; break]) + done +fi @end example -@node Preprocessor Symbol Index, Macro Index, Example, Top +If you were working around bugs in @code{AC_DEFINE_UNQUOTED} by adding +backslashes before quotes, you need to remove them. It now works +predictably, and does not treat quotes (except backquotes) specially. +@xref{Setting Output Variables}. + +All of the boolean shell variables set by Autoconf macros now use +@samp{yes} for the true value. Most of them use @samp{no} for false, +though for backward compatibility some use the empty string instead. If +you were relying on a shell variable being set to something like 1 or +@samp{t} for true, you need to change your tests. + +@node Changed Macro Writing, , Changed Results, Upgrading +@section Changed Macro Writing + +When defining your own macros, you should now use @code{AC_DEFUN} +instead of @code{define}. @code{AC_DEFUN} automatically calls +@code{AC_PROVIDE} and ensures that macros called via @code{AC_REQUIRE} +do not interrupt other macros, to prevent nested @samp{checking@dots{}} +messages on the screen. There's no actual harm in continuing to use the +older way, but it's less convenient and attractive. @xref{Macro +Definitions}. + +You probably looked at the macros that came with Autoconf as a guide for +how to do things. It would be a good idea to take a look at the new +versions of them, as the style is somewhat improved and they take +advantage of some new features. + +If you were doing tricky things with undocumented Autoconf internals +(macros, variables, diversions), check whether you need to change +anything to account for changes that have been made. Perhaps you can +even use an officially supported technique in version 2 instead of +kludging. Or perhaps not. + +To speed up your locally written feature tests, add caching to them. +See whether any of your tests are of general enough usefulness to +encapsulate into macros that you can share. + +@node History, Old Macro Names, Upgrading, Top +@chapter History of Autoconf + +You may be wondering, Why was Autoconf originally written? How did it +get into its present form? (Why does it look like gorilla spit?) If +you're not wondering, then this chapter contains no information useful +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. +@end menu + +@node Genesis, Exodus, , History +@section Genesis + +In June 1991 I was maintaining many of the GNU utilities for the Free +Software Foundation. As they were ported to more platforms and more +programs were added, the number of @samp{-D} options that users had to +select in the @file{Makefile} (around 20) became burdensome. Especially +for me---I had to test each new release on a bunch of different systems. +So I wrote a little shell script to guess some of the correct settings +for the fileutils package, and released it as part of fileutils 2.0. +That @code{configure} script worked well enough that the next month I +adapted it (by hand) to create similar @code{configure} scripts for +several other GNU utilities packages. Brian Berliner also adapted one +of my scripts for his CVS revision control system. + +Later that summer, I learned that Richard Stallman and Richard Pixley +were developing similar scripts to use in the GNU compiler tools; so I +adapted my @code{configure} scripts to support their evolving interface: +using the file name @file{Makefile.in} as the templates; adding +@samp{+srcdir}, the first option (of many); and creating +@file{config.status} files. + +@node Exodus, Leviticus, Genesis, History +@section Exodus + +As I got feedback from users, I incorporated many improvements, using +Emacs to search and replace, cut and paste, similar changes in each of +the scripts. As I adapted more GNU utilities packages to use +@code{configure} scripts, updating them all by hand became impractical. +Rich Murphey, the maintainer of the GNU graphics utilities, sent me mail +saying that the @code{configure} scripts were great, and asking if I had +a tool for generating them that I could send him. No, I thought, but +I should! So I started to work out how to generate them. And the +journey from the slavery of hand-written @code{configure} scripts to the +abundance and ease of Autoconf began. + +Cygnus @code{configure}, which was being developed at around that time, +is table driven; it is meant to deal mainly with a discrete number of +system types with a small number of mainly unguessable features (such as +details of the object file format). The automatic configuration system +that Brian Fox had developed for Bash takes a similar approach. For +general use, it seems to me a hopeless cause to try to maintain an +up-to-date database of which features each variant of each operating +system has. It's easier and more reliable to check for most features on +the fly---especially on hybrid systems that people have hacked on +locally or that have patches from vendors installed. + +I considered using an architecture similar to that of Cygnus +@code{configure}, where there is a single @code{configure} script that +reads pieces of @file{configure.in} when run. But I didn't want to have +to distribute all of the feature tests with every package, so I settled +on having a different @code{configure} made from each +@file{configure.in} by a preprocessor. That approach also offered more +control and flexibility. + +I looked briefly into using the Metaconfig package, by Larry Wall, +Harlan Stenn, and Raphael Manfredi, but I decided not to for several +reasons. The @code{Configure} scripts it produces are interactive, +which I find quite inconvenient; I didn't like the ways it checked for +some features (such as library functions); I didn't know that it was +still being maintained, and the @code{Configure} scripts I had +seen didn't work on many modern systems (such as System V R4 and NeXT); +it wasn't very flexible in what it could do in response to a feature's +presence or absence; I found it confusing to learn; and it was too big +and complex for my needs (I didn't realize then how much Autoconf would +eventually have to grow). + +I considered using Perl to generate my style of @code{configure} scripts, +but decided that @code{m4} was better suited to the job of simple +textual substitutions: it gets in the way less, because output is +implicit. Plus, everyone already has it. (Initially I didn't rely on +the GNU extensions to @code{m4}.) Also, some of my friends at the +University of Maryland had recently been putting @code{m4} front ends on +several programs, including @code{tvtwm}, and I was interested in trying +out a new language. + +@node Leviticus, Numbers, Exodus, History +@section Leviticus + +Since my @code{configure} scripts determine the system's capabilities +automatically, with no interactive user intervention, I decided to call +the program that generates them Autoconfig. But with a version number +tacked on, that name would be too long for old UNIX file systems, so +I shortened it to Autoconf. + +In the fall of 1991 I called together a group of fellow questers after +the Holy Grail of portability (er, that is, alpha testers) to give me +feedback as I encapsulated pieces of my handwritten scripts in @code{m4} +macros and continued to add features and improve the techniques used in +the checks. Prominent among the testers were +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard, who came up with the idea of making an @file{autoconf} shell +script to run @code{m4} and check for unresolved macro calls; Richard +Pixley, who suggested running the compiler instead of searching the file +system to find include files and symbols, for more accurate results; +Karl Berry, who got Autoconf to configure @TeX{} and added the +macro index to the documentation; and Ian Taylor, who added support for +creating a C header file as an alternative to putting @samp{-D} options +in a @file{Makefile}, so he could use Autoconf for his UUCP package. The +alpha testers cheerfully adjusted their files again and again as the +names and calling conventions of the Autoconf macros changed from +release to release. They all contributed many specific checks, great +ideas, and bug fixes. + +@node Numbers, Deuteronomy, Leviticus, History +@section Numbers + +In July 1992, after months of alpha testing, I released Autoconf 1.0, +and converted many GNU packages to use it. I was surprised by how +positive the reaction to it was. More people started using it than I +could keep track of, including people working on software that wasn't +part of the GNU Project (such as TCL, FSP, and Kerberos V5). +Autoconf continued to improve rapidly, as many people using the +@code{configure} scripts reported problems they encountered. + +Autoconf turned out to be a good torture test for @code{m4} +implementations. UNIX @code{m4} started to dump core because of the +length of the macros that Autoconf defined, and several bugs showed up +in GNU @code{m4} as well. Eventually, we realized that we needed to use +some features that only GNU @code{m4} has. 4.3BSD @code{m4}, in +particular, has an impoverished set of builtin macros; the System V +version is better, but still doesn't provide everything we need. + +More development occurred as people put Autoconf under more stresses +(and to uses I hadn't anticipated). Karl Berry added checks for X11. +david zuhn contributed C++ support. +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard made it diagnose invalid arguments. Jim Blandy bravely coerced +it into configuring GNU Emacs, laying the groundwork for several later +improvements. Roland McGrath got it to configure the GNU C Library, +wrote the @code{autoheader} script to automate the creation of C header +file templates, and added a @samp{--verbose} option to @code{configure}. +Noah Friedman added the @samp{--macrodir} option and @code{AC_MACRODIR} +environment variable. (He also coined the term @dfn{autoconfiscate} to +mean ``adapt a software package to use Autoconf''.) Roland and Noah +improved the quoting protection in @code{AC_DEFINE} and fixed many bugs, +especially when I got sick of dealing with portability problems from +February through June, 1993. + +@node Deuteronomy, , Numbers, History +@section Deuteronomy + +A long wish list for major features had accumulated, and the effect of +several years of patching by various people had left some residual +cruft. In April 1994, while working for Cygnus Support, I began a major +revision of Autoconf. I added most of the features of the Cygnus +@code{configure} that Autoconf had lacked, largely by adapting the +relevant parts of Cygnus @code{configure} with the help of david zuhn +and Ken Raeburn. These features include support for using +@file{config.sub}, @file{config.guess}, @samp{--host}, and +@samp{--target}; making links to files; and running @code{configure} +scripts in subdirectories. Adding these features enabled Ken to convert +GNU @code{as}, and Rob Savoye to convert DejaGNU, to using Autoconf. + +I added more features in response to other peoples' requests. Many +people had asked for @code{configure} scripts to share the results of +the checks between runs, because (particularly when configuring a large +source tree, like Cygnus does) they were frustratingly slow. Mike +Haertel suggested adding site-specific initialization scripts. People +distributing software that had to unpack on MS-DOS asked for a way to +override the @file{.in} extension on the file names, which produced file +names like @file{config.h.in} containing two dots. Jim Avera did an +extensive examination of the problems with quoting in @code{AC_DEFINE} +and @code{AC_SUBST}; his insights led to significant improvements. +Richard Stallman asked that compiler output be sent to @file{config.log} +instead of @file{/dev/null}, to help people debug the Emacs +@code{configure} script. + +I made some other changes because of my dissatisfaction with the quality +of the program. I made the messages showing results of the checks less +ambiguous, always printing a result. I regularized the names of the +macros and cleaned up coding style inconsistencies. I added some +auxiliary utilities that I had developed to help convert source code +packages to use Autoconf. With the help of +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard, I made the macros not interrupt each others' messages. +(That feature revealed some performance bottlenecks in GNU @code{m4}, +which he hastily corrected!) +I reorganized the documentation around problems people want to solve. +And I began a testsuite, because experience +had shown that Autoconf has a pronounced tendency to regress when we +change it. + +Again, several alpha testers gave invaluable feedback, especially +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard, Jim Meyering, Karl Berry, Rob Savoye, Ken Raeburn, and Mark Eichin. + +Finally, version 2.0 was ready. And there was much rejoicing. +(And I have free time again. I think. Yeah, right.) + +@node Old Macro Names, Environment Variable Index, History, Top +@chapter Old Macro Names + +In version 2 of Autoconf, most of the macros were renamed to use a more +uniform and descriptive naming scheme. Here are the old names of the +macros that were renamed, followed by the current names of those macros. +Although the old names are still accepted by the @code{autoconf} program +for backward compatibility, the old names are considered obsolete. +@xref{Macro Names}, for a description of the new naming scheme. + +@table @code +@item AC_ALLOCA +@maindex ALLOCA +@code{AC_FUNC_ALLOCA} +@item AC_ARG_ARRAY +@maindex ARG_ARRAY +removed because of limited usefulness +@item AC_CHAR_UNSIGNED +@maindex CHAR_UNSIGNED +@code{AC_C_CHAR_UNSIGNED} +@item AC_CONST +@maindex CONST +@code{AC_C_CONST} +@item AC_CROSS_CHECK +@maindex CROSS_CHECK +@code{AC_C_CROSS} +@item AC_ERROR +@maindex ERROR +@code{AC_MSG_ERROR} +@item AC_FIND_X +@maindex FIND_X +@code{AC_PATH_X} +@item AC_FIND_XTRA +@maindex FIND_XTRA +@code{AC_PATH_XTRA} +@item AC_FUNC_CHECK +@maindex FUNC_CHECK +@code{AC_CHECK_FUNC} +@item AC_GCC_TRADITIONAL +@maindex GCC_TRADITIONAL +@code{AC_PROG_GCC_TRADITIONAL} +@item AC_GETGROUPS_T +@maindex GETGROUPS_T +@code{AC_TYPE_GETGROUPS} +@item AC_GETLOADAVG +@maindex GETLOADAVG +@code{AC_FUNC_GETLOADAVG} +@item AC_HAVE_FUNCS +@maindex HAVE_FUNCS +@code{AC_CHECK_FUNCS} +@item AC_HAVE_HEADERS +@maindex HAVE_HEADERS +@code{AC_CHECK_HEADERS} +@item AC_HAVE_POUNDBANG +@maindex HAVE_POUNDBANG +@code{AC_SYS_INTERPRETER} (different calling convention) +@item AC_HEADER_CHECK +@maindex HEADER_CHECK +@code{AC_CHECK_HEADER} +@item AC_HEADER_EGREP +@maindex HEADER_EGREP +@code{AC_EGREP_HEADER} +@item AC_INLINE +@maindex INLINE +@code{AC_C_INLINE} +@item AC_LN_S +@maindex LN_S +@code{AC_PROG_LN_S} +@item AC_LONG_DOUBLE +@maindex LONG_DOUBLE +@code{AC_C_LONG_DOUBLE} +@item AC_LONG_FILE_NAMES +@maindex LONG_FILE_NAMES +@code{AC_SYS_LONG_FILE_NAMES} +@item AC_MAJOR_HEADER +@maindex MAJOR_HEADER +@code{AC_HEADER_MAJOR} +@item AC_MINUS_C_MINUS_O +@maindex MINUS_C_MINUS_O +@code{AC_PROG_CC_C_O} +@item AC_MMAP +@maindex MMAP +@code{AC_FUNC_MMAP} +@item AC_MODE_T +@maindex MODE_T +@code{AC_TYPE_MODE_T} +@item AC_OFF_T +@maindex OFF_T +@code{AC_TYPE_OFF_T} +@item AC_PID_T +@maindex PID_T +@code{AC_TYPE_PID_T} +@item AC_PREFIX +@maindex PREFIX +@code{AC_PREFIX_PROGRAM} +@item AC_PROGRAMS_CHECK +@maindex PROGRAMS_CHECK +@code{AC_CHECK_PROGS} +@item AC_PROGRAMS_PATH +@maindex PROGRAMS_PATH +@code{AC_PATH_PROGS} +@item AC_PROGRAM_CHECK +@maindex PROGRAM_CHECK +@code{AC_CHECK_PROG} +@item AC_PROGRAM_EGREP +@maindex PROGRAM_EGREP +@code{AC_EGREP_CPP} +@item AC_PROGRAM_PATH +@maindex PROGRAM_PATH +@code{AC_PATH_PROG} +@item AC_REMOTE_TAPE +@maindex REMOTE_TAPE +removed because of limited usefulness +@item AC_RESTARTABLE_SYSCALLS +@maindex RESTARTABLE_SYSCALLS +@code{AC_SYS_RESTARTABLE_SYSCALLS} +@item AC_RETSIGTYPE +@maindex RETSIGTYPE +@code{AC_TYPE_SIGNAL} +@item AC_RSH +@maindex RSH +removed because of limited usefulness +@item AC_SETVBUF_REVERSED +@maindex SETVBUF_REVERSED +@code{AC_FUNC_SETVBUF_REVERSED} +@item AC_SET_MAKE +@maindex SET_MAKE +@code{AC_PROG_MAKE_SET} +@item AC_SIZEOF_TYPE +@maindex SIZEOF_TYPE +@code{AC_CHECK_SIZEOF} +@item AC_SIZE_T +@maindex SIZE_T +@code{AC_TYPE_SIZE_T} +@item AC_STAT_MACROS_BROKEN +@maindex STAT_MACROS_BROKEN +@code{AC_HEADER_STAT} +@item AC_STDC_HEADERS +@maindex STDC_HEADERS +@code{AC_HEADER_STDC} +@item AC_STRCOLL +@maindex STRCOLL +@code{AC_FUNC_STRCOLL} +@item AC_ST_BLKSIZE +@maindex ST_BLKSIZE +@code{AC_STRUCT_ST_BLKSIZE} +@item AC_ST_BLOCKS +@maindex ST_BLOCKS +@code{AC_STRUCT_ST_BLOCKS} +@item AC_ST_RDEV +@maindex ST_RDEV +@code{AC_STRUCT_ST_RDEV} +@item AC_SYS_SIGLIST_DECLARED +@maindex SYS_SIGLIST_DECLARED +@code{AC_DECL_SYS_SIGLIST} +@item AC_TEST_CPP +@maindex TEST_CPP +@code{AC_TRY_CPP} +@item AC_TEST_PROGRAM +@maindex TEST_PROGRAM +@code{AC_TRY_RUN} +@item AC_TIMEZONE +@maindex TIMEZONE +@code{AC_STRUCT_TIMEZONE} +@item AC_TIME_WITH_SYS_TIME +@maindex TIME_WITH_SYS_TIME +@code{AC_HEADER_TIME} +@item AC_UID_T +@maindex UID_T +@code{AC_TYPE_UID_T} +@item AC_UTIME_NULL +@maindex UTIME_NULL +@code{AC_FUNC_UTIME_NULL} +@item AC_VFORK +@maindex VFORK +@code{AC_FUNC_VFORK} +@item AC_VPRINTF +@maindex VPRINTF +@code{AC_FUNC_VPRINTF} +@item AC_WAIT3 +@maindex WAIT3 +@code{AC_FUNC_WAIT3} +@item AC_WARN +@maindex WARN +@code{AC_MSG_WARN} +@item AC_WORDS_BIGENDIAN +@maindex WORDS_BIGENDIAN +@code{AC_C_BIGENDIAN} +@item AC_YYTEXT_POINTER +@maindex YYTEXT_POINTER +@code{AC_DECL_YYTEXT} +@end table + +@node Environment Variable Index, Output Variable Index, Old Macro Names, Top +@unnumbered Environment Variable Index + +This is an alphabetical list of the environment variables that Autoconf +checks. + +@printindex ev + +@node Output Variable Index, Preprocessor Symbol Index, Environment Variable Index, Top +@unnumbered Output Variable Index + +This is an alphabetical list of the variables that Autoconf can +substitute into files that it creates, typically one or more +@file{Makefile}s. @xref{Setting Output Variables}, for more information on how +this is done. + +@printindex ov + +@node Preprocessor Symbol Index, Macro Index, Output Variable Index, Top @unnumbered Preprocessor Symbol Index This is an alphabetical list of the C preprocessor symbols that the Autoconf macros define. To work with Autoconf, C source code needs to use these names in @code{#if} directives. -@printindex vr +@printindex cv @node Macro Index, , Preprocessor Symbol Index, Top @unnumbered Macro Index @@ -3065,7 +5086,3 @@ easier to use, the macros are listed without their preceding @samp{AC_}. @contents @bye - -@c Local variables: -@c compile-command: "makeinfo --no-split autoconf.texi" -@c End: diff --git a/src/util/autoconf/autoheader.m4 b/src/util/autoconf/autoheader.m4 new file mode 100644 index 000000000..62427d9e1 --- /dev/null +++ b/src/util/autoconf/autoheader.m4 @@ -0,0 +1,84 @@ +dnl Driver and redefinitions of some Autoconf macros for autoheader. +dnl This file is part of Autoconf. +dnl Copyright (C) 1994 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl +dnl Written by Roland McGrath. +dnl +include(acgeneral.m4)dnl +builtin(include, acspecific.m4)dnl +builtin(include, acoldnames.m4)dnl + +dnl These are alternate definitions of some macros, which produce +dnl strings in the output marked with "@@@" so we can easily extract +dnl the information we want. The `#' at the end of the first line of +dnl each definition seems to be necessary to prevent m4 from eating +dnl the newline, which makes the @@@ not always be at the beginning of +dnl a line. + +define([AC_CHECK_FUNCS], [# +@@@funcs="$funcs $1"@@@ +]) + +define([AC_CHECK_HEADERS], [# +@@@headers="$headers $1"@@@ +]) + +define([AC_CHECK_HEADERS_DIRENT], [# +@@@headers="$headers $1"@@@ +]) + +define([AC_CHECK_LIB], [# + ifelse([$3], , [ +@@@libs="$libs $1"@@@ +], [ +# If it was found, we do: +$3 +# If it was not found, we do: +$4 +]) +]) + +define([AC_HAVE_LIBRARY], [# +changequote(<<, >>)dnl +define(<>, dnl +patsubst(patsubst($1, <>, <<\1>>), <<-l>>, <<>>))dnl +changequote([, ])dnl + ifelse([$2], , [ +@@@libs="$libs AC_LIB_NAME"@@@ +], [ +# If it was found, we do: +$2 +# If it was not found, we do: +$3 +]) +]) + +define([AC_CHECK_SIZEOF], [# +@@@types="$types,$1"@@@ +]) + +define([AC_CONFIG_HEADER], [# +@@@config_h=$1@@@ +]) + +define([AC_DEFINE], [# +@@@syms="$syms $1"@@@ +]) + +define([AC_DEFINE_UNQUOTED], [# +@@@syms="$syms $1"@@@ +]) diff --git a/src/util/autoconf/autoheader.sh b/src/util/autoconf/autoheader.sh index ccba6beb1..354d4d09d 100644 --- a/src/util/autoconf/autoheader.sh +++ b/src/util/autoconf/autoheader.sh @@ -22,14 +22,16 @@ # With one arg, create a header file on standard output from # the given template file. -usage="Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir] - [-v] [--version] [template-file]" +usage="\ +Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir] + [-l dir] [--localdir=dir] [--version] [template-file]" # NLS nuisances. +# Only set `LANG' and `LC_ALL' to "C" if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ test -z "${M4}" && M4=@M4@ @@ -39,82 +41,58 @@ case "${M4}" in test -f "${M4}" || M4=m4 ;; esac -print_version="" +localdir=. +show_version=no + while test $# -gt 0 ; do - case "z${1}" in - z-h | z--help | z--h* ) + case "${1}" in + -h | --help | --h* ) echo "${usage}"; exit 0 ;; - z--macrodir=* | z--m*=* ) + --localdir=* | --l*=* ) + localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + -l | --localdir | --l*) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + localdir="${1}" + shift ;; + --macrodir=* | --m*=* ) AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" shift ;; - z-m | z--macrodir | z--m* ) + -m | --macrodir | --m* ) shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } AC_MACRODIR="${1}" shift ;; - z-v | z--version | z--v* ) - print_version="-DAC_PRINT_VERSION" - shift ;; - z-- ) # Stop option processing + --version | --v* ) + show_version=yes; shift ;; + -- ) # Stop option processing shift; break ;; - z- ) # Use stdin as input. + - ) # Use stdin as input. break ;; - z-* ) + -* ) echo "${usage}" 1>&2; exit 1 ;; * ) break ;; esac done +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + TEMPLATES="${AC_MACRODIR}/acconfig.h" -test -r acconfig.h && TEMPLATES="${TEMPLATES} acconfig.h" -MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" -test -r ${AC_MACRODIR}/aclocal.m4 \ - && MACROFILES="${MACROFILES} ${AC_MACRODIR}/aclocal.m4" -test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" -MACROFILES="${print_version} ${MACROFILES}" +test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h" case $# in - 0) if test -n "$print_version" - then infile=/dev/null - else infile=configure.in; fi ;; + 0) infile=configure.in ;; 1) infile=$1 ;; *) echo "$usage" >&2; exit 1 ;; esac -# These are the alternate definitions of the acgeneral.m4 macros we want to -# redefine. They produce strings in the output marked with "@@@" so we can -# easily extract the information we want. The `#' at the end of the first -# line of each definition seems to be necessary to prevent m4 from eating -# the newline, which makes the @@@ not always be at the beginning of a line. -frob='define([AC_DEFINE],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_SIZEOF_TYPE],[# -@@@types="$types,$1"@@@ -])dnl -define([AC_HAVE_FUNCS],[# -@@@funcs="$funcs $1"@@@ -])dnl -define([AC_HAVE_HEADERS],[# -@@@headers="$headers $1"@@@ -])dnl -define([AC_CONFIG_HEADER],[# -@@@config_h=$1@@@ -])dnl -define([AC_HAVE_LIBRARY], [# -changequote(/,/)dnl -define(/libname/, dnl -patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl -changequote([,])dnl -@@@libs="$libs libname"@@@ -# If it was found, we do: -$2 -# If it was not found, we do: -$3 -])dnl -' - config_h=config.h syms= types= @@ -122,12 +100,26 @@ funcs= headers= libs= -# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the +if test "$localdir" != .; then + use_localdir="-I$localdir -DAC_LOCALDIR=$localdir" +else + use_localdir= +fi + +# Use the frozen version of Autoconf if available. +r= f= +# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +case `$M4 --help < /dev/null 2>&1` in +*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;; +*traditional*) ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;; +esac + +# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`echo \"$frob\" \ - | $M4 $MACROFILES - $infile \ - | sed -n -e ' +eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile | + sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p /^@@@/{ @@ -137,10 +129,11 @@ eval "`echo \"$frob\" \ b again }'`" -test -n "$print_version" && exit 0 - # Make SYMS newline-separated rather than blank-separated, and remove dups. -syms="`for sym in $syms; do echo $sym; done | sort | uniq`" +# Start each symbol with a blank (to match the blank after "#undef") +# to reduce the possibility of mistakenly matching another symbol that +# is a substring of it. +syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`" if test $# -eq 0; then tmpout=autoh$$ @@ -148,13 +141,23 @@ if test $# -eq 0; then exec > $tmpout fi +# Support "outfile[:infile]", defaulting infile="outfile.in". +case "$config_h" in +*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'` + config_h=`echo "$config_h"|sed 's%:.*%%'` ;; +*) config_h_in="${config_h}.in" ;; +esac + # Don't write "do not edit" -- it will get copied into the # config.h, which it's ok to edit. -echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. */" +echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */" -test -f ${config_h}.top && cat ${config_h}.top +test -r ${config_h}.top && cat ${config_h}.top +test -r $localdir/acconfig.h && + grep @TOP@ $localdir/acconfig.h >/dev/null && + sed '/@TOP@/,$d' $localdir/acconfig.h -# This puts each paragraph on its own line, separated by @s. +# This puts each template paragraph on its own line, separated by @s. if test -n "$syms"; then # Make sure the boundary of template files is also the boundary # of the paragraph. Extra newlines don't hurt since they will @@ -186,46 +189,58 @@ echo "$types" | tr , \\012 | sort | uniq | while read ctype; do #undef SIZEOF_${sym}" done -for func in `for x in $funcs; do echo $x; done | sort | uniq`; do - sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " -/* Define if you have ${func}. */ +# /bin/sh on the Alpha gives `for' a random value if $funcs is empty. +if test -n "$funcs"; then + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do + sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " +/* Define if you have the ${func} function. */ #undef HAVE_${sym}" -done + done +fi -for header in `for x in $headers; do echo $x; done | sort | uniq`; do - sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$headers"; then + for header in `for x in $headers; do echo $x; done | sort | uniq`; do + sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the <${header}> header file. */ #undef HAVE_${sym}" -done + done +fi -for lib in `for x in $libs; do echo $x; done | sort | uniq`; do - sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$libs"; then + for lib in `for x in $libs; do echo $x; done | sort | uniq`; do + sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${lib} library (-l${lib}). */ #undef HAVE_LIB${sym}" -done + done +fi +test -r $localdir/acconfig.h && + grep @BOTTOM@ $localdir/acconfig.h >/dev/null && + sed '1,/@BOTTOM@/d' $localdir/acconfig.h test -f ${config_h}.bot && cat ${config_h}.bot status=0 -for sym in $syms; do - if fgrep $sym $TEMPLATES >/dev/null; then - : # All is well. - else - echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2 - status=1 - fi -done +if test -n "$syms"; then + for sym in $syms; do + if fgrep $sym $TEMPLATES >/dev/null; then + : # All is well. + else + echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2 + status=1 + fi + done +fi if test $# -eq 0; then if test $status -eq 0; then - if cmp -s $tmpout ${config_h}.in; then + if cmp -s $tmpout ${config_h_in}; then rm -f $tmpout else - mv -f $tmpout ${config_h}.in + mv -f $tmpout ${config_h_in} fi else rm -f $tmpout diff --git a/src/util/autoconf/autoreconf.sh b/src/util/autoconf/autoreconf.sh new file mode 100644 index 000000000..d6fd5caeb --- /dev/null +++ b/src/util/autoconf/autoreconf.sh @@ -0,0 +1,127 @@ +#!/bin/sh +# autoreconf - remake all Autoconf configure scripts in a directory tree +# Copyright (C) 1994 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +usage="\ +Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir] + [-l dir] [--localdir=dir] [--verbose] [--version]" + +localdir= +verbose=no +show_version=no + +test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ + +while test $# -gt 0; do + case "$1" in + -h | --help | --h*) + echo "$usage"; exit 0 ;; + --localdir=* | --l*=* ) + localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + -l | --localdir | --l*) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + localdir="${1}" + shift ;; + --macrodir=* | --m*=* ) + AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`" + shift ;; + -m | --macrodir | --m*) + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + AC_MACRODIR="$1" + shift ;; + --verbose | --verb*) + verbose=yes; shift ;; + --version | --vers*) + show_version=yes; shift ;; + --) # Stop option processing. + shift; break ;; + -*) echo "$usage" 1>&2; exit 1 ;; + *) break ;; + esac +done + +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +if test $# -ne 0; then + echo "$usage" 1>&2; exit 1 +fi + +top_autoconf=`echo $0|sed s%autoreconf%autoconf%` +top_autoheader=`echo $0|sed s%autoreconf%autoheader%` + +# The xargs grep filters out Cygnus configure.in files. +find . -name configure.in -print | +xargs grep -l AC_OUTPUT | +sed 's%/configure\.in$%%; s%^./%%' | +while read dir; do + ( + cd $dir || continue + + case "$dir" in + .) dots= ;; + *) # A "../" for each directory in /$dir. + dots=`echo /$dir|sed 's%/[^/]*%../%g'` ;; + esac + + case "$0" in + /*) autoconf=$top_autoconf; autoheader=$top_autoheader ;; + */*) autoconf=$dots$top_autoconf; autoheader=$dots$top_autoheader ;; + *) autoconf=$top_autoconf; autoheader=$top_autoheader ;; + esac + + case "$AC_MACRODIR" in + /*) macrodir_opt="--macrodir=$AC_MACRODIR" ;; + *) macrodir_opt="--macrodir=$dots$AC_MACRODIR" ;; + esac + + case "$localdir" in + "") localdir_opt= ;; + /*) localdir_opt="--localdir=$localdir" ;; + *) localdir_opt="--localdir=$dots$localdir" ;; + esac + + test $verbose = yes && echo running autoconf in $dir + $autoconf $macrodir_opt $localdir_opt + + if grep AC_CONFIG_HEADER configure.in >/dev/null; then + template=`sed -n '/AC_CONFIG_HEADER/{ +s%[^#]*AC_CONFIG_HEADER(\([^)]*\).*%\1% +t here +: here +s%.*:%% +t colon +s%$%.in% +: colon +p +q +}' configure.in` + if test ! -f $template || grep autoheader $template >/dev/null; then + test $verbose = yes && echo running autoheader in $dir + $autoheader $macrodir_opt $localdir_opt + fi + fi + ) +done + diff --git a/src/util/autoconf/autoscan.pl b/src/util/autoconf/autoscan.pl new file mode 100644 index 000000000..52827a7eb --- /dev/null +++ b/src/util/autoconf/autoscan.pl @@ -0,0 +1,393 @@ +#!@PERL@ +# autoscan - Create configure.scan (a preliminary configure.in) for a package. +# Copyright (C) 1994 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Written by David MacKenzie . + +require "find.pl"; + +$datadir = $ENV{"AC_MACRODIR"} || "@datadir@"; +$verbose = 0; +# Reference these variables to pacify perl -w. +undef %identifiers_macros; +undef %makevars_macros; +undef %programs_macros; + +&parse_args; +&init_tables; +&find('.'); +&scan_files; +&output; + +exit 0; + +# Process any command line arguments. +sub parse_args +{ + local ($usage) = + "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n"; + + foreach $_ (@ARGV) { + if (/^--m[a-z]*=(.*)/) { + $datadir = $1; + } elsif (/^--h/) { + print "$usage"; + exit 0; + } elsif (/^--verb/) { + $verbose = 1; + } elsif (/^--vers/) { + &version; + } elsif (/^[^-]/) { + die "$usage" if defined($srcdir); + # Top level directory of the package being autoscanned. + $srcdir = $_; + } else { + die "$usage"; + } + } + + $srcdir="." if !defined($srcdir); + + print "srcdir=$srcdir\n" if $verbose; + chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n"; + + open(CONF, ">configure.scan") || + die "$0: cannot create configure.scan: $!\n"; +} + +# Print the version number and exit. +sub version +{ + open(ACG, "<$datadir/acgeneral.m4") || + die "$0: cannot open $datadir/acgeneral.m4: $!\n"; + while () { + if (/define.AC_ACVERSION.\s*([0-9.]+)/) { + print "Autoconf version $1\n"; + exit 0; + } + } + die "Autoconf version unknown\n"; +} + +# Put values in the tables of what to do with each token. +sub init_tables +{ + local($kind, $word, $macro); + + # Initialize a table of C keywords (to ignore). + # Taken from K&R 1st edition p. 180. + # ANSI C, GNU C, and C++ keywords can introduce portability problems, + # so don't ignore them. + foreach $word ('int', 'char', 'float', 'double', 'struct', 'union', + 'long', 'short', 'unsigned', 'auto', 'extern', 'register', + 'typedef', 'static', 'goto', 'return', 'sizeof', 'break', + 'continue', 'if', 'else', 'for', 'do', 'while', 'switch', + 'case', 'default') { + $c_keywords{$word} = 0; + } + + # The data file format supports only one line of macros per function. + # If more than that is required for a common portability problem, + # a new Autoconf macro should probably be written for that case, + # instead of duplicating the code in lots of configure.in files. + + foreach $kind ('functions', 'headers', 'identifiers', 'programs', + 'makevars') { + open(TABLE, "<$datadir/ac$kind") || + die "$0: cannot open $datadir/ac$kind: $!\n"; + while () { + next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments. + ($word, $macro) = split; + eval "\$$kind" . "_macros{\$word} = \$macro"; + } + close(TABLE); + } +} + +# Collect names of various kinds of files in the package. +# Called by &find on each file. +sub wanted +{ + if (/^.*\.[chlymC]$/ || /^.*\.cc$/) { + $name =~ s?^\./??; push(@cfiles, $name); + } + elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) { + $name =~ s?^\./??; push(@makefiles, $name); + } + elsif (/^.*\.sh$/) { + $name =~ s?^\./??; push(@shfiles, $name); + } +} + +# Read through the files and collect lists of tokens in them +# that might create nonportabilities. +sub scan_files +{ + $initfile = $cfiles[0]; # Pick one at random. + + if ($verbose) { + print "cfiles:", join(" ", @cfiles), "\n"; + print "makefiles:", join(" ", @makefiles), "\n"; + print "shfiles:", join(" ", @shfiles), "\n"; + } + + foreach $file (@cfiles) { + &scan_c_file($file); + } + + foreach $file (@makefiles) { + &scan_makefile($file); + } + + foreach $file (@shfiles) { + &scan_sh_file($file); + } +} + +sub scan_c_file +{ + local($file) = @_; + local($in_comment) = 0; # Nonzero if in a multiline comment. + + open(CFILE, "<$file") || die "$0: cannot open $file: $!\n"; + while () { + # Strip out comments, approximately. + # Ending on this line. + if ($in_comment && m,\*/,) { + s,.*\*/,,; + $in_comment = 0; + } + # All on one line. + s,/\*.*\*/,,g; + # Starting on this line. + if (m,/\*,) { + $in_comment = 1; + } + # Continuing on this line. + next if $in_comment; + + # Preprocessor directives. + if (/^\s*#\s*include\s*<([^>]*)>/) { + $headers{$1}++; + } + # Ignore other preprocessor directives. + next if /^\s*#/; + + # Remove string and character constants. + s,\"[^\"]*\",,g; + s,\'[^\']*\',,g; + + # Tokens in the code. + # Maybe we should ignore function definitions (in column 0)? + while (s/\W([a-zA-Z_]\w*)\s*\(/ /) { + $functions{$1}++ if !defined($c_keywords{$1}); + } + while (s/\W([a-zA-Z_]\w*)\W/ /) { + $identifiers{$1}++ if !defined($c_keywords{$1}); + } + } + close(CFILE); + + if ($verbose) { + local($word); + + print "\n$file functions:\n"; + foreach $word (sort keys %functions) { + print "$word $functions{$word}\n"; + } + + print "\n$file identifiers:\n"; + foreach $word (sort keys %identifiers) { + print "$word $identifiers{$word}\n"; + } + + print "\n$file headers:\n"; + foreach $word (sort keys %headers) { + print "$word $headers{$word}\n"; + } + } +} + +sub scan_makefile +{ + local($file) = @_; + + open(MFILE, "<$file") || die "$0: cannot open $file: $!\n"; + while () { + # Strip out comments and variable references. + s/#.*//; + s/\$\([^\)]*\)//g; + s/\${[^\}]*}//g; + s/@[^@]*@//g; + + # Variable assignments. + while (s/\W([a-zA-Z_]\w*)\s*=/ /) { + $makevars{$1}++; + } + # Libraries. + while (s/\W-l([a-zA-Z_]\w*)\W/ /) { + $libraries{$1}++; + } + # Tokens in the code. + while (s/\W([a-zA-Z_]\w*)\W/ /) { + $programs{$1}++; + } + } + close(MFILE); + + if ($verbose) { + local($word); + + print "\n$file makevars:\n"; + foreach $word (sort keys %makevars) { + print "$word $makevars{$word}\n"; + } + + print "\n$file libraries:\n"; + foreach $word (sort keys %libraries) { + print "$word $libraries{$word}\n"; + } + + print "\n$file programs:\n"; + foreach $word (sort keys %programs) { + print "$word $programs{$word}\n"; + } + } +} + +sub scan_sh_file +{ + local($file) = @_; + + open(MFILE, "<$file") || die "$0: cannot open $file: $!\n"; + while () { + # Strip out comments and variable references. + s/#.*//; + s/\${[^\}]*}//g; + s/@[^@]*@//g; + + # Tokens in the code. + while (s/\W([a-zA-Z_]\w*)\W/ /) { + $programs{$1}++; + } + } + close(MFILE); + + if ($verbose) { + local($word); + + print "\n$file programs:\n"; + foreach $word (sort keys %programs) { + print "$word $programs{$word}\n"; + } + } +} + +# Print a configure.in. +sub output +{ + local (%unique_makefiles); + + print CONF "dnl Process this file with autoconf to produce a configure script.\n"; + print CONF "AC_INIT($initfile)\n"; + + &output_programs; + &output_headers; + &output_identifiers; + &output_functions; + + # Change DIR/Makefile.in to DIR/Makefile. + foreach $_ (@makefiles) { + s/\.in$//; + $unique_makefiles{$_}++; + } + print CONF "\nAC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n"; + + close CONF; +} + +# Print Autoconf macro $1 if it's not undef and hasn't been printed already. +sub print_unique +{ + local($macro) = @_; + + if (defined($macro) && !defined($printed{$macro})) { + print CONF "$macro\n"; + $printed{$macro} = 1; + } +} + +sub output_programs +{ + local ($word); + + print CONF "\ndnl Checks for programs.\n"; + foreach $word (sort keys %programs) { + &print_unique($programs_macros{$word}); + } + foreach $word (sort keys %makevars) { + &print_unique($makevars_macros{$word}); + } + print CONF "\ndnl Checks for libraries.\n"; + foreach $word (sort keys %libraries) { + print CONF "AC_HAVE_LIBRARY($word)\n"; + } +} + +sub output_headers +{ + local ($word); + + print CONF "\ndnl Checks for header files.\n"; + foreach $word (sort keys %headers) { + if (defined($headers_macros{$word}) && + $headers_macros{$word} eq 'AC_CHECK_HEADERS') { + push(@have_headers, $word); + } else { + &print_unique($headers_macros{$word}); + } + } + print CONF "AC_CHECK_HEADERS(" . join(' ', sort(@have_headers)) . ")\n" + if defined(@have_headers); +} + +sub output_identifiers +{ + local ($word); + + print CONF "\ndnl Checks for typedefs, structures, and compiler characteristics.\n"; + foreach $word (sort keys %identifiers) { + &print_unique($identifiers_macros{$word}); + } +} + +sub output_functions +{ + local ($word); + + print CONF "\ndnl Checks for library functions.\n"; + foreach $word (sort keys %functions) { + if (defined($functions_macros{$word}) && + $functions_macros{$word} eq 'AC_CHECK_FUNCS') { + push(@have_funcs, $word); + } else { + &print_unique($functions_macros{$word}); + } + } + print CONF "AC_CHECK_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n" + if defined(@have_funcs); +} diff --git a/src/util/autoconf/autoupdate.sh b/src/util/autoconf/autoupdate.sh new file mode 100644 index 000000000..8fd14429d --- /dev/null +++ b/src/util/autoconf/autoupdate.sh @@ -0,0 +1,112 @@ +#!/bin/sh +# autoupdate - modernize a configure.in +# Copyright (C) 1994 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# If given no args, update `configure.in'; +# With one arg, write on the standard output from the given template file. +# +# Written by David MacKenzie + +usage="\ +Usage: autoupdate [-h] [--help] [-m dir] [--macrodir=dir] + [--version] [template-file]" + +sedtmp=/tmp/acups.$$ +# For debugging. +#sedtmp=/tmp/acups +show_version=no +test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ + +while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) + echo "${usage}" 1>&2; exit 0 ;; + --macrodir=* | --m*=* ) + AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + -m | --macrodir | --m* ) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + AC_MACRODIR="${1}" + shift ;; + --version | --versio | --versi | --vers) + show_version=yes; shift ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "${usage}" 1>&2; exit 1 ;; + * ) + break ;; + esac +done + +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +: ${SIMPLE_BACKUP_SUFFIX='~'} + +tmpout=acupo.$$ +trap 'rm -f $sedtmp $tmpout; exit 1' 1 2 15 +case $# in + 0) infile=configure.in; out="> $tmpout" + # Make sure $infile can be read, and $tmpout has the same permissions. + cp $infile $tmpout || exit + + # Make sure $infile can be written. + if test ! -w $infile; then + rm -f $tmpout + echo "$0: $infile: cannot write" >&2 + exit 1 + fi + ;; + 1) infile="$1"; out= ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +# Turn the m4 macro file into a sed script. +# For each old macro name, make one substitution command to replace it +# at the end of a line, and one when followed by ( or whitespace. +# That is easier than splitting the macros up into those that take +# arguments and those that don't. +sed -n -e ' +/^AC_DEFUN(/ { + s//s%/ + s/, *\[indir(\[/$%/ + s/\].*/%/ + p + s/\$// + s/%/^/ + s/%/\\([( ]\\)^/ + s/%/\\1^/ + s/\^/%/g + p +}' ${AC_MACRODIR}/acoldnames.m4 > $sedtmp +eval sed -f $sedtmp $infile $out + +case $# in + 0) mv configure.in configure.in${SIMPLE_BACKUP_SUFFIX} && + mv $tmpout configure.in ;; +esac + +rm -f $sedtmp $tmpout +exit 0 diff --git a/src/util/autoconf/config.guess b/src/util/autoconf/config.guess new file mode 100644 index 000000000..aad7b0742 --- /dev/null +++ b/src/util/autoconf/config.guess @@ -0,0 +1,470 @@ +#!/bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:V*:*) + # After 1.2, OSF1 uses "V1.3" for uname -r. + echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'` + exit 0 ;; + alpha:OSF1:*:*) + # 1.2 uses "1.2" for uname -r. + echo alpha-dec-osf${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + Pyramid*:OSx*:*:*) + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + sun4*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + mips:*:5*:RISCos) + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX:*:*) + echo mips-sgi-irix${UNAME_RELEASE} + exit 0 ;; + i[34]86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then + IBM_REV=4.1 + elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then + IBM_REV=4.1.1 + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[3478]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;; + 9000/8?? ) HP_ARCH=hppa1.0 ;; + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?7:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:UNICOS:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:UNICOS:*:*) + echo ymp-cray-unicos + exit 0 ;; + CRAY-2:UNICOS:*:*) + echo cray2-cray-unicos + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + i[34]86:BSD/386:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/(.*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i[34]86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i[34]86:*:3.2:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL + elif test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M680[234]0:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0) + uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3 && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m680[234]0:LynxOS:2.2*:*) + echo m68k-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i[34]86:LynxOS:2.2*:*) + echo i386-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.2*:*) + echo sparc-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.2*:*) + echo rs6000-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >dummy.c </dev/null`; + printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-unknown-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 +rm -f dummy.c dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/src/util/autoconf/config.sub b/src/util/autoconf/config.sub new file mode 100644 index 000000000..5627f87ae --- /dev/null +++ b/src/util/autoconf/config.sub @@ -0,0 +1,787 @@ +#!/bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS (if any). +basic_machine=`echo $1 | sed 's/-[^-]*$//'` +if [ $basic_machine != $1 ] +then os=`echo $1 | sed 's/.*-/-/'` +else os=; fi + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) + os= + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + ;; + -lynx) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \ + | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ + | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \ + | powerpc | sparc64 | 1750a | dsp16xx | mips64 | mipsel \ + | mips64el | mips64orion | mips64orionel ) + basic_machine=$basic_machine-unknown + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \ + | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ + | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ + | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ + | sh-* | powerpc-* | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* ) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigados) + basic_machine=m68k-cbm + os=-amigados + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[345]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + os=-sysv32 + ;; + i[345]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + os=-sysv4 + ;; + i[345]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + os=-sysv + ;; + i[345]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + os=-solaris2 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + np1) + basic_machine=np1-gould + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium-*) + # We will change tis to say i586 once there has been + # time for various packages to start to recognize that. + basic_machine=i486-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + ps2) + basic_machine=i386-ibm + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + mips) + basic_machine=mips-mips + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative must end in a *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \ + | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ + | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -ptx* | -coff* | -winnt*) + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -ctix* | -uts*) + os=-sysv + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -xenix) + os=-xenix + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-ibm) + os=-aix + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigados + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-masscomp) + os=-rtu + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -lynxos*) + vendor=lynx + ;; + -aix*) + vendor=ibm + ;; + -hpux*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/src/util/autoconf/configure b/src/util/autoconf/configure index b22f8b8ab..c28263800 100644 --- a/src/util/autoconf/configure +++ b/src/util/autoconf/configure @@ -1,74 +1,72 @@ #!/bin/sh + # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 1.11 -# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. - -# This configure script is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This script is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# Save the original args to write them into config.status later. -# Do argument quoting in a sane fashion so things don't break while recursing. -configure_args= -for arg do - case $arg in - *\"*|*\\*|*\$*|*\`*) - arg=`echo $arg|sed -e 's/\\\\/\\\\\\\\/g;s/"/\\\\"/g;s/\\$/\\\\$/g;s/\`/\\\\\`/g'` - ;; - esac - configure_args="$configure_args \"$arg\"" -done -# configure_args="[$]*" +# Generated automatically using autoconf version 1.125 +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: -# Only options that might do something get documented. +# Omit some internal or obsolete options to make the list less imposing. ac_usage="Usage: configure [options] [host] Options: [defaults in brackets after descriptions] ---build=BUILD configure for building on BUILD [BUILD=HOST] ---disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ---enable-FEATURE[=ARG] include FEATURE [ARG=yes] ---exec-prefix=PREFIX install host dependent files in PREFIX [/usr/local] ---help print this message ---host=HOST configure for HOST [guessed] ---prefix=PREFIX install host independent files in PREFIX [/usr/local] ---quiet, --silent do not print \`checking for...' messages ---srcdir=DIR find the sources in DIR [configure dir or ..] ---target=TARGET configure for TARGET [TARGET=HOST] ---verbose print results of checks ---version print the version of autoconf that created configure ---with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ---without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ---x-includes=DIR X include files are in DIR ---x-libraries=DIR X library files are in DIR" +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=PREFIX install architecture-dependent files in PREFIX + [same as prefix] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +--enable and --with options recognized:$ac_help" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE -exec_prefix= +cache_file=./config.cache +exec_prefix=NONE host=NONE no_create= nonopt=NONE -norecursion= -prefix= -program_prefix= -program_suffix= -program_transform_name= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, silent= +site= srcdir= target=NONE verbose= -x_includes= -x_libraries= +x_includes=NONE +x_libraries=NONE + +# Initialize some other variables. +subdirs= ac_prev= for ac_option @@ -81,14 +79,13 @@ do continue fi - # Accept (but ignore some of) the important Cygnus configure - # options, so we can diagnose typos. - case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case "$ac_option" in -build | --build | --buil | --bui | --bu | --b) @@ -96,20 +93,27 @@ do -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) build="$ac_optarg" ;; + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that aren't valid shell variable names. + # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - echo "configure: $ac_feature: invalid feature name" >&2; exit 1 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that aren't valid shell variable names. + # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - echo "configure: $ac_feature: invalid feature name" >&2; exit 1 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in @@ -118,7 +122,6 @@ do esac eval "enable_${ac_feature}='$ac_optarg'" ;; - # For backward compatibility, recognize -exec-prefix and --exec_prefix. -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) @@ -129,7 +132,8 @@ do exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) - with_gas=yes ;; # Obsolete; use --with-gas. + # Obsolete; use --with-gas. + with_gas=yes ;; -help | --help | --hel | --he) cat << EOF @@ -143,15 +147,16 @@ EOF host="$ac_optarg" ;; -nfp | --nfp | --nf) - with_fp=no ;; # Obsolete; use --without-fp. + # Obsolete; use --without-fp. + with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; - -norecursion | --norecursion | --norecursio | --norecursi \ - | --norecurs | --norecur | --norecu | --norec | --nore | --nor) - norecursion=yes ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; @@ -193,6 +198,11 @@ EOF | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -207,14 +217,14 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 1.11" + echo "configure generated by autoconf version 1.125" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that aren't valid shell variable names. + # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - echo "configure: $ac_package: invalid package name" >&2; exit 1 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in @@ -225,14 +235,16 @@ EOF -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that aren't valid shell variable names. + # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - echo "configure: $ac_package: invalid package name" >&2; exit 1 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; - --x) with_x=yes ;; # Obsolete; use --with-x. + --x) + # Obsolete; use --with-x. + with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) @@ -248,15 +260,15 @@ EOF | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; - -*) echo "configure: $ac_option: invalid option; use --help to show usage" >&2; exit 1 + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" >&2 + echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then - echo "configure: can only configure for one host and one target at a time" >&2; exit 1 + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; @@ -265,32 +277,52 @@ EOF done if test -n "$ac_prev"; then - echo "configure: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" >&2; exit 1 + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 -trap 'rm -fr confdefs* $ac_clean_files' 0 - -# Save the original args if we used an alternate arg parser. -ac_configure_temp="${configure_args-$*}" -# Strip out --no-create and --norecursion so they don't pile up. -configure_args= -for ac_arg in $ac_configure_temp; do - eval ac_unquoted="$ac_arg" - case "$ac_unquoted" in + +# File descriptor usage: +# 0 unused; standard input +# 1 file creation +# 2 errors and warnings +# 3 unused; some systems may open it to /dev/tty +# 4 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 4>/dev/null +else + exec 4>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; - -norecursion | --norecursion | --norecursio | --norecursi \ - | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;; - *) configure_args="$configure_args $ac_arg" ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. +# Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = 'set'; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -304,7 +336,7 @@ ac_unique_file=acgeneral.m4 # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then `..'. + # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. @@ -312,68 +344,194 @@ if test -z "$srcdir"; then if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi +else + ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then - if test x$ac_srcdir_defaulted = xyes; then - echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1 + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else - echo "configure: can not find sources in ${srcdir}" >&2; exit 1 + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='${CPP}' -ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5' +ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5' + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. + echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," -for ac_prog in gnum4 gm4 m4 +for ac_prog in gm4 gnum4 m4 do -if test -z "$M4"; then - # Extract the first word of `$ac_prog', so it can be a program name with args. - set ac_dummy $ac_prog; ac_word=$2 - test -n "$silent" || echo "checking for $ac_word" +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&4 +if eval "test \"`echo '${'ac_cv_path_M4'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&4 +else + case "$M4" in + /*) + ac_cv_path_M4="$M4" # Let the user override the test with a path. + ;; + *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - M4="$ac_dir/$ac_word" + ac_cv_path_M4="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" + ;; +esac +fi +M4="$ac_cv_path_M4" +if test -n "$M4"; then + echo "$ac_t""$M4" 1>&4 +else + echo "$ac_t""no" 1>&4 fi - -test -n "$M4" && test -n "$verbose" && echo " setting M4 to $M4" test -n "$M4" && break done test -n "$M4" || M4="m4" -# Make sure to not get the incompatible SysV /etc/install and -# /usr/sbin/install, which might be in PATH before a BSD-like install, -# or the SunOS /usr/etc/install directory, or the AIX /bin/install, -# or the AFS install, which mishandles nonexistent args, or -# /usr/ucb/install on SVR4, which tries to use the nonexistent group -# `staff', or /sbin/install on IRIX which has incompatible command-line -# syntax. Sigh. -# -# On most BSDish systems install is in /usr/bin, not /usr/ucb -# anyway. -# This turns out not to be true, so the mere pathname isn't an indication -# of whether the program works. What we really need is a set of tests for -# the install program to see if it actually works in all the required ways. -# -# Avoid using ./install, which might have been erroneously created -# by make from ./install.sh. -if test -z "${INSTALL}"; then - test -n "$silent" || echo "checking for a BSD compatible install" + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&4 +if eval "test \"`echo '${'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&4 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&4 +else + echo "$ac_t""no" 1>&4 +fi + +if test "$PERL" != no; then + PROGS=autoscan +else + echo "configure: warning: autoscan will not be built since perl is not found" 1>&2 +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4 +if test -z "$INSTALL"; then +if eval "test \"`echo '${'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&4 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do case "$ac_dir" in - ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; + ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in installbsd scoinst install; do + for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then @@ -381,7 +539,7 @@ if test -z "${INSTALL}"; then # OSF/1 installbsd also uses dspmsg, but is usable. : else - INSTALL="$ac_dir/$ac_prog -c" + ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi @@ -390,61 +548,58 @@ if test -z "${INSTALL}"; then esac done IFS="$ac_save_ifs" -fi - -if test -z "$INSTALL"; then # As a last resort, use the slow shell script. - for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../.. ${srcdir}/../../util/autoconf; do - if test -f $ac_dir/install.sh; then - INSTALL="$ac_dir/install.sh -c"; break - fi - done + test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" fi -if test -z "$INSTALL"; then - echo "configure: can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../.. ${srcdir}/../../util/autoconf" >&2; exit 1 + INSTALL="$ac_cv_path_install" fi -test -n "$verbose" && echo " setting INSTALL to $INSTALL" +echo "$ac_t""$INSTALL" 1>&4 -# Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}. +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -n "$verbose" && echo " setting INSTALL_PROGRAM to $INSTALL_PROGRAM" test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -test -n "$verbose" && echo " setting INSTALL_DATA to $INSTALL_DATA" - -ac_top=../../ -case $ac_top in - /*) ;; # it's fine as is - *) ac_top=$srcdir/$ac_top ;; -esac - ac_tmpin="${ac_top}config/pre.in" - if test -r $ac_tmpin; then - ac_prepend=$ac_tmpin - else - ac_prepend= - fi - ac_tmpin="${ac_top}config/post.in" - if test -r $ac_tmpin; then - ac_postpend=$ac_tmpin - else - ac_postpend= - fi -# The preferred way to propogate these variables is regular @ substitutions. -if test -n "$prefix"; then - ac_prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" -else - prefix=/usr/local +# Work with the GNU or Cygnus source tree layout. +if test -f $srcdir/standards.texi; then + standards_info=standards.info standards_dvi=standards.dvi fi -if test -n "$exec_prefix"; then - ac_prsub="$ac_prsub -s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" + +trap '' 1 2 15 +if test -w $cache_file; then +echo "updating cache $cache_file" +cat > $cache_file <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# Ultrix sh set writes to stderr and can't be redirected directly. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \ + >> $cache_file else - exec_prefix='${prefix}' # Let make expand it. +echo "not updating unwritable cache $cache_file" fi +trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. @@ -452,36 +607,48 @@ if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi -# Quote sed substitution magic chars in DEFS. -cat >conftest.def < conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g EOF -ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g' -DEFS=`sed "$ac_escape_ampersand_and_backslash" config.status < $CONFIG_STATUS </dev/null | sed 1q`: # -# $0 $configure_args +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. -ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]" +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create - exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create ;; + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "config.status generated by autoconf version 1.11" + echo "$CONFIG_STATUS generated by autoconf version 1.125" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -489,44 +656,65 @@ do esac done -trap 'rm -f Makefile; exit 1' 1 2 15 -M4='$M4' -INSTALL='$INSTALL' -INSTALL_PROGRAM='$INSTALL_PROGRAM' -INSTALL_DATA='$INSTALL_DATA' -LIBS='$LIBS' -srcdir='$srcdir' -top_srcdir='$top_srcdir' -prefix='$prefix' -exec_prefix='$exec_prefix' -DEFS='$DEFS' -ac_prsub='$ac_prsub' -ac_vpsub='$ac_vpsub' -extrasub='$extrasub' -ac_prepend='$ac_prepend' -ac_postpend='$ac_postpend' +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -f Makefile testsuite/Makefile; exit 1' 1 2 15 + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@M4@%$M4%g +s%@PERL@%$PERL%g +s%@PROGS@%$PROGS%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@standards_info@%$standards_info%g +s%@standards_dvi@%$standards_dvi%g + +CEOF EOF -cat >> config.status <<\EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. -CONFIG_FILES=${CONFIG_FILES-"Makefile"} -for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/$ac_dir" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else - ac_dir_suffix= + ac_dir_suffix= ac_dots= fi - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` case "$ac_given_srcdir" in .) srcdir=. - if test -z "$ac_dir_suffix"; then top_srcdir=. + if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. @@ -534,34 +722,32 @@ for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac echo creating "$ac_file" rm -f "$ac_file" - comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure." + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in - *.c | *.h | *.C | *.cc | *.m ) echo "/* $comment_str */" > "$ac_file" ;; - * ) echo "# $comment_str" > "$ac_file" ;; + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; esac - sed -e " -$ac_prsub -$ac_vpsub -$extrasub -s%@M4@%$M4%g -s%@INSTALL@%$INSTALL%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LIBS@%$LIBS%g + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g -s%@prefix@%$prefix%g -s%@exec_prefix@%$exec_prefix%g -s%@DEFS@%$DEFS% -" $ac_prepend $ac_given_srcdir/${ac_file}.in $ac_postpend >> $ac_file +s%@INSTALL@%$INSTALL%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done +rm -f conftest.subs + exit 0 EOF -chmod +x config.status -# Some shells look in PATH for config.status without the "./". -test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS diff --git a/src/util/autoconf/configure.in b/src/util/autoconf/configure.in index 3b4ca4766..7fd871e02 100644 --- a/src/util/autoconf/configure.in +++ b/src/util/autoconf/configure.in @@ -1,5 +1,31 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(acgeneral.m4) -AC_PROGRAMS_PATH(M4, gnum4 gm4 m4, m4) + +AC_ARG_PROGRAM + +dnl We use a path for GNU m4 so even if users have another m4 first in +dnl their path, the installer can configure with a path that has GNU m4 +dnl first and get that path embedded in the installed autoconf and +dnl autoheader scripts. +AC_PATH_PROGS(M4, gm4 gnum4 m4, m4) + +dnl We use a path for perl so the #! line in autoscan will work. +AC_PATH_PROG(PERL, perl, no) +AC_SUBST(PERL)dnl +AC_SUBST(SCRIPTS)dnl +if test "$PERL" != no; then + SCRIPTS=autoscan +else + AC_MSG_WARN(autoscan will not be built since perl is not found) +fi + AC_PROG_INSTALL -AC_OUTPUT(Makefile) + +# Work with the GNU or Cygnus source tree layout. +if test -f $srcdir/standards.texi; then + standards_info=standards.info standards_dvi=standards.dvi +fi +AC_SUBST(standards_info)dnl +AC_SUBST(standards_dvi)dnl + +AC_OUTPUT(Makefile testsuite/Makefile) diff --git a/src/util/autoconf/ifnames.sh b/src/util/autoconf/ifnames.sh new file mode 100644 index 000000000..cd95da844 --- /dev/null +++ b/src/util/autoconf/ifnames.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# ifnames - print the identifiers used in C preprocessor conditionals +# Copyright (C) 1994 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Reads from stdin if no files are given. +# Writes to stdout. + +# Written by David MacKenzie + +usage="\ +Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]" +show_version=no + +test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ + +while test $# -gt 0; do + case "$1" in + -h | --help | --h* ) + echo "$usage"; exit 0 ;; + --macrodir=* | --m*=* ) + AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`" + shift ;; + -m | --macrodir | --m* ) + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + AC_MACRODIR="$1" + shift ;; + --version | --versio | --versi | --vers) + show_version=yes; shift ;; + --) # Stop option processing. + shift; break ;; + -*) echo "$usage" 1>&2; exit 1 ;; + *) break ;; + esac +done + +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +if test $# -eq 0; then + cat > stdin + set stdin + trap 'rm -f stdin' 0 + trap 'rm -f stdin; exit 1' 1 3 15 +fi + +for arg +do +# The first two substitutions remove comments. Not perfect, but close enough. +# The second is for comments that end on a later line. The others do: +# Enclose identifiers in @ and a space. +# Handle "#if 0" -- there are no @s to trigger removal. +# Remove non-identifiers. +# Remove any spaces at the end. +# Translate any other spaces to newlines. +sed -n ' +s%/\*[^/]*\*/%%g +s%/\*[^/]*%%g +/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p +/^[ ]*#[ ]*e*l*if[ ]/{ + s/// + s/@//g + s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g + s/$/@ / + s/@defined //g + s/[^@]*@\([^ ]* \)[^@]*/\1/g + s/ *$// + s/ /\ +/g + p +} +' $arg | sort -u | sed 's%$% '$arg'%' +done | awk ' +{ files[$1] = files[$1] " " $2 } +END { for (sym in files) print sym files[sym] }' | sort diff --git a/src/util/autoconf/install-sh b/src/util/autoconf/install-sh new file mode 100644 index 000000000..ab74c882e --- /dev/null +++ b/src/util/autoconf/install-sh @@ -0,0 +1,238 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/src/util/autoconf/install.texi b/src/util/autoconf/install.texi new file mode 100644 index 000000000..bff0738b8 --- /dev/null +++ b/src/util/autoconf/install.texi @@ -0,0 +1,193 @@ +@c This file is included by autoconf.texi and is used to produce +@c the INSTALL file. + +@node Basic Installation +@section Basic Installation + +These are generic installation instructions. + +The @code{configure} shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a @file{Makefile} in each directory of the +package. It may also create one or more @file{.h} files containing +system-dependent definitions. Finally, it creates a shell script +@file{config.status} that you can run in the future to recreate the +current configuration, a file @file{config.cache} that saves the results +of its tests to speed up reconfiguring, and a file @file{config.log} +containing compiler output (useful mainly for debugging +@code{configure}). + +If you need to do unusual things to compile the package, please try to +figure out how @code{configure} could check whether to do them, and mail +diffs or instructions to the address given in the @file{README} so they +can be considered for the next release. If at some point +@file{config.cache} contains results you don't want to keep, you may +remove or edit it. + +The file @file{configure.in} is used to create @file{configure} by a +program called @code{autoconf}. You only need @file{configure.in} if +you want to change it or regenerate @file{configure} using a newer +version of @code{autoconf}. + +@noindent +The simplest way to compile this package is: + +@enumerate +@item +@code{cd} to the directory containing the package's source code and type +@samp{./configure} to configure the package for your system. If you're +using @code{csh} on an old version of System V, you might need to type +@samp{sh ./configure} instead to prevent @code{csh} from trying to +execute @code{configure} itself. + +Running @code{configure} takes awhile. While running, it prints some +messages telling which features it is checking for. + +@item +Type @samp{make} to compile the package. + +@item +Optionally, type @samp{make check} to run any self-tests that come with +the package. + +@item +Type @samp{make install} to install the programs and any data files and +documentation. + +@item +You can remove the program binaries and object files from the source +directory by typing @samp{make clean}. To also remove the files that +@code{configure} created (so you can compile the package for a different +kind of computer), type @samp{make distclean}. +@end enumerate + +@node Compilers and Options +@section Compilers and Options + +Some systems require unusual options for compilation or linking that +the @code{configure} script does not know about. You can give +@code{configure} initial values for variables by setting them in the +environment. Using a Bourne-compatible shell, you can do that on the +command line like this: +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example + +@noindent +Or on systems that have the @code{env} program, you can do it like this: +@example +env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure +@end example + +@node Build Directory +@section Using a Different Build Directory + +You can compile the package in a different directory from the one +containing the source code. Doing so allows you to compile it on more +than one kind of computer at the same time. To do this, you must use a +version of @code{make} that supports the @code{VPATH} variable, such as +GNU @code{make}. @code{cd} to the directory where you want the object +files and executables to go and run the @code{configure} script. +@code{configure} automatically checks for the source code in the +directory that @code{configure} is in and in @file{..}. + +@node Installation Names +@section Installation Names + +By default, @samp{make install} will install the package's files in +@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can specify an +installation prefix other than @file{/usr/local} by giving +@code{configure} the option @samp{--prefix=@var{path}}. + +You can specify separate installation prefixes for architecture-specific +files and architecture-independent files. If you give @code{configure} +the option @samp{--exec-prefix=@var{path}}, the package will use +@var{path} as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + +If the package supports it, you can cause programs to be installed with +an extra prefix or suffix on their names by giving @code{configure} the +option @samp{--program-prefix=@var{PREFIX}} or +@samp{--program-suffix=@var{SUFFIX}}. + +@node Optional Features +@section Optional Features + +Some packages pay attention to @samp{--enable-@var{feature}} options to +@code{configure}, where @var{feature} indicates an optional part of the +package. They may also pay attention to @samp{--with-@var{package}} +options, where @var{package} is something like @samp{gnu-as} or @samp{x} +(for the X Window System). The @file{README} should mention any +@samp{--enable-} and @samp{--with-} options that the package recognizes. + +For packages that use the X Window System, @code{configure} can usually +find the X include and library files automatically, but if it doesn't, +you can use the @code{configure} options @samp{--x-includes=@var{dir}} +and @samp{--x-libraries=@var{dir}} to specify their locations. + +@node System Type +@section Specifying the System Type + +There may be some features @code{configure} can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually @code{configure} can figure that out, but if it +prints a message saying it can not guess the host type, give it the +@samp{--host=@var{type}} option. @var{type} can either be a short name +for the system type, such as @samp{sun4}, or a canonical name with three +fields: +@example +@var{cpu}-@var{company}-@var{system} +@end example +@noindent +See the file @file{config.sub} for the possible values of each field. +If @file{config.sub} isn't included in this package, then this package +doesn't need to know the host type. + +If you are building compiler tools for cross-compiling, you can also use +the @samp{--target=@var{type}} option to select the type of system +they will produce code for and the @samp{--build=@var{type}} option +to select the type of system on which you are compiling the package. + +@node Sharing Defaults +@section Sharing Defaults + +If you want to set default values for @code{configure} scripts to share, +you can create a site shell script called @file{config.site} that gives +default values for variables like @code{CC}, @code{cache_file}, and +@code{prefix}. @code{configure} looks for +@file{@var{prefix}/share/config.site} if it exists, then +@file{@var{prefix}/etc/config.site} if it exists. Or, you can set +the @code{CONFIG_SITE} environment variable to the location of the site +script. A warning: not all @code{configure} scripts look for a site script. + +@node Operation Controls +@section Operation Controls + +@code{configure} recognizes the following options to control how it +operates. + +@table @code +@item --cache-file=@var{file} +Save the results of the tests in @var{file} instead of +@file{config.cache}. Set @var{file} to @file{/dev/null} to disable +caching, for debugging @code{configure}. + +@item --help +Print a summary of the options to @code{configure}, and exit. + +@item --quiet +@itemx --silent +@itemx -q +Do not print messages saying which checks are being made. + +@item --srcdir=@var{dir} +Look for the package's source code in directory @var{dir}. Usually +@code{configure} can determine that directory automatically. + +@item --version +Print the version of Autoconf used to generate the @code{configure} +script, and exit. +@end table + +@noindent +@code{configure} also accepts some other, not widely useful, options. diff --git a/src/util/autoconf/make-stds.texi b/src/util/autoconf/make-stds.texi index 4b4ff7ef9..95a42ec78 100644 --- a/src/util/autoconf/make-stds.texi +++ b/src/util/autoconf/make-stds.texi @@ -32,6 +32,20 @@ to avoid trouble on systems where the @code{SHELL} variable might be inherited from the environment. (This is never a problem with GNU @code{make}.) +Different @code{make} programs have incompatible suffix lists and +implicit rules, and this sometimes creates confusion or misbehavior. So +it is a good idea to set the suffix list explicitly using only the +suffixes you need in the particular Makefile, like this: + +@example +.SUFFIXES: +.SUFFIXES: .c .o +@end example + +@noindent +The first line clears out the suffix list, the second introduces all +suffixes which may be subject to implicit rules in this Makefile. + Don't assume that @file{.} is in the path for command execution. When you need to run programs that are a part of your package during the make, please make sure that it uses @file{./} if the program is built as @@ -69,7 +83,7 @@ should instead be written as @smallexample foo.o : bar.c - $(CC) $(CFLAGS) $< -o $@@ + $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@@ @end smallexample @noindent @@ -80,7 +94,7 @@ way to make the rule work well. For example, the target above for @smallexample foo.1 : foo.man sedscript - sed -s $(srcdir)/sedscript $(srcdir)/foo.man > foo.1 + sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ @end smallexample @node Utilities in Makefiles @@ -112,9 +126,17 @@ ar bison cc flex install ld lex make makeinfo ranlib texi2dvi yacc @end example -When you use @code{ranlib}, you should test whether it exists, and run -it only if it exists, so that the distribution will work on systems that -don't have @code{ranlib}. +Use the following @code{make} variables: + +@example +$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) +$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) +@end example + +When you use @code{ranlib}, you should make sure nothing bad happens if +the system does not have @code{ranlib}. Arrange to ignore an error +from that command, and print a message before the command to tell the +user that failure of the @code{ranlib} command does not mean a problem. If you use symbolic links, you should implement a fallback for systems that don't have symbolic links. @@ -379,7 +401,11 @@ installed. Installation directories should always be named by variables, so it is easy to install in a nonstandard place. The standard names for these -variables are: +variables are as follows. + +These two variables set the root for the installation. All the other +installation directories should be subdirectories of one of these two, +and nothing should be directly installed into these two directories. @table @samp @item prefix @@ -395,32 +421,100 @@ be @code{$(prefix)}. Generally, @code{$(exec_prefix)} is used for directories that contain machine-specific files (such as executables and subroutine libraries), while @code{$(prefix)} is used directly for other directories. +@end table + +Executable programs are installed in one of the following directories. +@table @samp @item bindir The directory for installing executable programs that users can run. This should normally be @file{/usr/local/bin}, but write it as @file{$(exec_prefix)/bin}. -@item libdir -The directory for installing executable files to be run by the program -rather than by users. Object files and libraries of object code should -also go in this directory. The idea is that this directory is used for -files that pertain to a specific machine architecture, but need not be -in the path for commands. The value of @code{libdir} should normally be -@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. +@item sbindir +The directory for installing executable programs that can be run from +the shell, but are only generally useful to system administrators. This +should normally be @file{/usr/local/sbin}, but write it as +@file{$(exec_prefix)/sbin}. + +@item libexecdir +@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94 +The directory for installing executable programs to be run by other +programs rather than by users. This directory should normally be +@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}. +@end table -@item datadir -The directory for installing read-only data files which the programs -refer to while they run. This directory is used for files which are -independent of the type of machine being used. This should normally be -@file{/usr/local/lib}, but write it as @file{$(prefix)/lib}. +Data files used by the program during its execution are divided into +categories in two ways. + +@itemize @bullet +@item +Some files are normally modified by programs; others are never normally +modified (though users may edit some of these). + +@item +Some files are architecture-independent and can be shared by all +machines at a site; some are architecture-dependent and can be shared +only by machines of the same kind and operating system; others may never +be shared between two machines. +@end itemize + +This makes for six different possibilities. However, we want to +discourage the use of architecture-dependent files, aside from of object +files and libraries. It is much cleaner to make other data files +architecture-independent, and it is generally not hard. -@item statedir +Therefore, here are the variables makefiles should use to specify +directories: + +@table @samp +@item datadir +The directory for installing read-only architecture independent data +files. This should normally be @file{/usr/local/share}, but write it as +@file{$(prefix)/share}. As a special exception, see @file{$(infodir)} +and @file{$(includedir)} below. + +@item sysconfdir +The directory for installing read-only data files that pertain to a +single machine--that is to say, files for configuring a host. Mailer +and network configuration files, @file{/etc/passwd}, and so forth belong +here. All the files in this directory should be ordinary ASCII text +files. This directory should normally be @file{/usr/local/etc}, but +write it as @file{$(prefix)/etc}. + +@c rewritten to avoid overfull hbox --tower +Do not install executables +@c here +in this directory (they probably +belong in @file{$(libexecdir)} or @file{$(sbindir))}. Also do not +install files that are modified in the normal course of their use +(programs whose purpose is to change the configuration of the system +excluded). Those probably belong in @file{$(localstatedir)}. + +@item sharedstatedir +The directory for installing architecture-independent data files which +the programs modify while they run. This should normally be +@file{/usr/local/com}, but write it as @file{$(prefix)/com}. + +@item localstatedir The directory for installing data files which the programs modify while -they run. These files should be independent of the type of machine -being used, and it should be possible to share them among machines at a -network installation. This should normally be @file{/usr/local/lib}, -but write it as @file{$(prefix)/lib}. +they run, and that pertain to one specific machine. Users should never +need to modify files in this directory to configure the package's +operation; put such configuration information in separate files that go +in @file{datadir} or @file{$(sysconfdir)}. @file{$(localstatedir)} +should normally be @file{/usr/local/var}, but write it as +@file{$(prefix)/var}. + +@item libdir +The directory for object files and libraries of object code. Do not +install executables here, they probably belong in @file{$(libexecdir)} +instead. The value of @code{libdir} should normally be +@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. + +@item infodir +The directory for installing the Info files for this package. By +default, it should be @file{/usr/local/info}, but it should be written +as @file{$(prefix)/info}. @item includedir @c rewritten to avoid overfull hbox --roland @@ -454,7 +548,11 @@ package. To tell whether @file{foo.h} came from the Foo package, put a magic string in the file---part of a comment---and grep for that string. +@end table + +Unix-style man pages are installed in one of the following: +@table @samp @item mandir The directory for installing the man pages (if any) for this package. It should include the suffix for the proper section of the @@ -486,12 +584,11 @@ The file name extension for installed section 2 man pages. @item @dots{} Use these names instead of @samp{manext} if the package needs to install man pages in more than one section of the manual. +@end table -@item infodir -The directory for installing the Info files for this package. By -default, it should be @file{/usr/local/info}, but it should be written -as @file{$(prefix)/info}. +And finally, you should set the following variable: +@table @samp @item srcdir The directory for the sources being compiled. The value of this variable is normally inserted by the @code{configure} shell script. @@ -509,7 +606,7 @@ exec_prefix = $(prefix) # Where to put the executable for the command `gcc'. bindir = $(exec_prefix)/bin # Where to put the directories used by the compiler. -libdir = $(exec_prefix)/lib +libexecdir = $(exec_prefix)/libexec # Where to put the Info files. infodir = $(prefix)/info @end smallexample diff --git a/src/util/autoconf/standards.info b/src/util/autoconf/standards.info index 766c4459b..7f3dda81f 100644 --- a/src/util/autoconf/standards.info +++ b/src/util/autoconf/standards.info @@ -1,12 +1,12 @@ -This is Info file standards.info, produced by Makeinfo-1.55 from the -input file ./standards.texi. +This is Info file ../standards.info, produced by Makeinfo-1.55 from the +input file ../standards.texi. START-INFO-DIR-ENTRY * Standards: (standards). GNU coding standards. END-INFO-DIR-ENTRY GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software -Foundation +Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -23,2671 +23,38 @@ versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  -File: standards.info, Node: Top, Next: Reading Non-Free Code, Prev: (dir), Up: (dir) - -Version -******* - - Last updated 28 March 1994. - -* Menu: - -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions -* Change Logs:: Recording Changes -* Compatibility:: Compatibility with Other Implementations -* Makefile Conventions:: Makefile Conventions -* Configuration:: How Configuration Should Work -* Source Language:: Using Languages Other Than C -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* Using Extensions:: Using Non-standard Features -* System Functions:: Portability and "standard" library functions -* Semantics:: Program Behavior for All Programs -* Errors:: Formatting Error Messages -* Libraries:: Library Behavior -* Portability:: Portability As It Applies to GNU -* User Interfaces:: Standards for Command Line Interfaces -* Documentation:: Documenting Programs -* Releases:: Making Releases - - -File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Prev: Top, Up: Top - -Referring to Proprietary Programs -********************************* - - Don't in any circumstances refer to Unix source code for or during -your work on GNU! (Or to any other proprietary programs.) - - If you have a vague recollection of the internals of a Unix program, -this does not absolutely mean you can't write an imitation of it, but -do try to organize the imitation internally along different lines, -because this is likely to make the details of the Unix version -irrelevant and dissimilar to your results. - - For example, Unix utilities were generally optimized to minimize -memory use; if you go for speed instead, your program will be very -different. You could keep the entire input file in core and scan it -there instead of using stdio. Use a smarter algorithm discovered more -recently than the Unix program. Eliminate use of temporary files. Do -it in one pass instead of two (we did this in the assembler). - - Or, on the contrary, emphasize simplicity instead of speed. For some -applications, the speed of today's computers makes simpler algorithms -adequate. - - Or go for generality. For example, Unix programs often have static -tables or fixed-size strings, which make for arbitrary limits; use -dynamic allocation instead. Make sure your program handles NULs and -other funny characters in the input files. Add a programming language -for extensibility and write part of the program in that language. - - Or turn some parts of the program into independently usable -libraries. Or use a simple garbage collector instead of tracking -precisely when to free memory, or use a new GNU facility such as -obstacks. - - -File: standards.info, Node: Contributions, Next: Change Logs, Prev: Reading Non-Free Code, Up: Top - -Accepting Contributions -*********************** - - If someone else sends you a piece of code to add to the program you -are working on, we need legal papers to use it--the same sort of legal -papers we will need to get from you. *Each* significant contributor to -a program must sign some sort of legal papers in order for us to have -clear title to the program. The main author alone is not enough. - - So, before adding in any contributions from other people, tell us so -we can arrange to get the papers. Then wait until we tell you that we -have received the signed papers, before you actually use the -contribution. - - This applies both before you release the program and afterward. If -you receive diffs to fix a bug, and they make significant change, we -need legal papers for it. - - You don't need papers for changes of a few lines here or there, since -they are not significant for copyright purposes. Also, you don't need -papers if all you get from the suggestion is some ideas, not actual code -which you use. For example, if you write a different solution to the -problem, you don't need to get papers. - - I know this is frustrating; it's frustrating for us as well. But if -you don't wait, you are going out on a limb--for example, what if the -contributor's employer won't sign a disclaimer? You might have to take -that code out again! - - The very worst thing is if you forget to tell us about the other -contributor. We could be very embarrassed in court some day as a -result. - - -File: standards.info, Node: Change Logs, Next: Compatibility, Prev: Contributions, Up: Top - -Change Logs -*********** - - Keep a change log for each directory, describing the changes made to -source files in that directory. The purpose of this is so that people -investigating bugs in the future will know about the changes that might -have introduced the bug. Often a new bug can be found by looking at -what was recently changed. More importantly, change logs can help -eliminate conceptual inconsistencies between different parts of a -program; they can give you a history of how the conflicting concepts -arose. - - Use the Emacs command `M-x add-change' to start a new entry in the -change log. An entry should have an asterisk, the name of the changed -file, and then in parentheses the name of the changed functions, -variables or whatever, followed by a colon. Then describe the changes -you made to that function or variable. - - Separate unrelated entries with blank lines. When two entries -represent parts of the same change, so that they work together, then -don't put blank lines between them. Then you can omit the file name -and the asterisk when successive entries are in the same file. - - Here are some examples: - - * register.el (insert-register): Return nil. - (jump-to-register): Likewise. - - * sort.el (sort-subr): Return nil. - - * tex-mode.el (tex-bibtex-file, tex-file, tex-region): - Restart the tex shell if process is gone or stopped. - (tex-shell-running): New function. - - * expr.c (store_one_arg): Round size up for move_block_to_reg. - (expand_call): Round up when emitting USE insns. - * stmt.c (assign_parms): Round size up for move_block_from_reg. - - It's important to name the changed function or variable in full. -Don't abbreviate them; don't combine them. Subsequent maintainers will -often search for a function name to find all the change log entries that -pertain to it; if you abbreviate the name, they won't find it when they -search. For example, some people are tempted to abbreviate groups of -function names by writing `* register.el ({insert,jump-to}-register)'; -this is not a good idea, since searching for `jump-to-register' or -`insert-register' would not find the entry. - - There's no need to describe the full purpose of the changes or how -they work together. It is better to put such explanations in comments -in the code. That's why just "New function" is enough; there is a -comment with the function in the source to explain what it does. - - However, sometimes it is useful to write one line to describe the -overall purpose of a large batch of changes. - - You can think of the change log as a conceptual "undo list" which -explains how earlier versions were different from the current version. -People can see the current version; they don't need the change log to -tell them what is in it. What they want from a change log is a clear -explanation of how the earlier version differed. - - When you change the calling sequence of a function in a simple -fashion, and you change all the callers of the function, there is no -need to make individual entries for all the callers. Just write in the -entry for the function being called, "All callers changed." - - When you change just comments or doc strings, it is enough to write -an entry for the file, without mentioning the functions. Write just, -"Doc fix." There's no need to keep a change log for documentation -files. This is because documentation is not susceptible to bugs that -are hard to fix. Documentation does not consist of parts that must -interact in a precisely engineered fashion; to correct an error, you -need not know the history of the erroneous passage. - - -File: standards.info, Node: Compatibility, Next: Makefile Conventions, Prev: Change Logs, Up: Top - -Compatibility with Other Implementations -**************************************** - - With certain exceptions, utility programs and libraries for GNU -should be upward compatible with those in Berkeley Unix, and upward -compatible with ANSI C if ANSI C specifies their behavior, and upward -compatible with POSIX if POSIX specifies their behavior. - - When these standards conflict, it is useful to offer compatibility -modes for each of them. - - ANSI C and POSIX prohibit many kinds of extensions. Feel free to -make the extensions anyway, and include a `--ansi' or `--compatible' -option to turn them off. However, if the extension has a significant -chance of breaking any real programs or scripts, then it is not really -upward compatible. Try to redesign its interface. - - Many GNU programs suppress extensions that conflict with POSIX if the -environment variable `POSIXLY_CORRECT' is defined (even if it is -defined with a null value). Please make your program recognize this -variable if appropriate. - - When a feature is used only by users (not by programs or command -files), and it is done poorly in Unix, feel free to replace it -completely with something totally different and better. (For example, -vi is replaced with Emacs.) But it is nice to offer a compatible -feature as well. (There is a free vi clone, so we offer it.) - - Additional useful features not in Berkeley Unix are welcome. -Additional programs with no counterpart in Unix may be useful, but our -first priority is usually to duplicate what Unix already has. - - -File: standards.info, Node: Makefile Conventions, Next: Configuration, Prev: Compatibility, Up: Top - -Makefile Conventions -******************** - - This chapter describes conventions for writing the Makefiles for GNU -programs. - -* Menu: - -* Makefile Basics:: -* Utilities in Makefiles:: -* Standard Targets:: -* Command Variables:: -* Directory Variables:: - - -File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions - -General Conventions for Makefiles -================================= - - Every Makefile should contain this line: - - SHELL = /bin/sh - -to avoid trouble on systems where the `SHELL' variable might be -inherited from the environment. (This is never a problem with GNU -`make'.) - - Don't assume that `.' is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses `./' if the program is built as -part of the make or `$(srcdir)/' if the file is an unchanging part of -the source code. Without one of these prefixes, the current search -path is used. - - The distinction between `./' and `$(srcdir)/' is important when -using the `--srcdir' option to `configure'. A rule of the form: - - foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 - -will fail when the current directory is not the source directory, -because `foo.man' and `sedscript' are not in the current directory. - - When using GNU `make', relying on `VPATH' to find the source file -will work in the case where there is a single dependency file, since -the `make' automatic variable `$<' will represent the source file -wherever it is. (Many versions of `make' set `$<' only in implicit -rules.) A makefile target like - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o - -should instead be written as - - foo.o : bar.c - $(CC) $(CFLAGS) $< -o $@ - -in order to allow `VPATH' to work correctly. When the target has -multiple dependencies, using an explicit `$(srcdir)' is the easiest way -to make the rule work well. For example, the target above for `foo.1' -is best written as: - - foo.1 : foo.man sedscript - sed -s $(srcdir)/sedscript $(srcdir)/foo.man > foo.1 - - -File: standards.info, Node: Utilities in Makefiles, Next: Standard Targets, Prev: Makefile Basics, Up: Makefile Conventions - -Utilities in Makefiles -====================== - - Write the Makefile commands (and any shell scripts, such as -`configure') to run in `sh', not in `csh'. Don't use any special -features of `ksh' or `bash'. - - The `configure' script and the Makefile rules for building and -installation should not use any utilities directly except these: - - cat cmp cp echo egrep expr grep - ln mkdir mv pwd rm rmdir sed test touch - - Stick to the generally supported options for these programs. For -example, don't use `mkdir -p', convenient as it may be, because most -systems don't support it. - - The Makefile rules for building and installation can also use -compilers and related programs, but should do so via `make' variables -so that the user can substitute alternatives. Here are some of the -programs we mean: - - ar bison cc flex install ld lex - make makeinfo ranlib texi2dvi yacc - - When you use `ranlib', you should test whether it exists, and run it -only if it exists, so that the distribution will work on systems that -don't have `ranlib'. - - If you use symbolic links, you should implement a fallback for -systems that don't have symbolic links. - - It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities to -exist. - - -File: standards.info, Node: Standard Targets, Next: Command Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions - -Standard Targets for Users -========================== - - All GNU programs should have the following targets in their -Makefiles: - -`all' - Compile the entire program. This should be the default target. - This target need not rebuild any documentation files; Info files - should normally be included in the distribution, and DVI files - should be made only when explicitly asked for. - -`install' - Compile the program and copy the executables, libraries, and so on - to the file names where they should reside for actual use. If - there is a simple test to verify that a program is properly - installed, this target should run that test. - - The commands should create all the directories in which files are - to be installed, if they don't already exist. This includes the - directories specified as the values of the variables `prefix' and - `exec_prefix', as well as all subdirectories that are needed. One - way to do this is by means of an `installdirs' target as described - below. - - Use `-' before any command for installing a man page, so that - `make' will ignore any errors. This is in case there are systems - that don't have the Unix man page documentation system installed. - - The way to install Info files is to copy them into `$(infodir)' - with `$(INSTALL_DATA)' (*note Command Variables::.), and then run - the `install-info' program if it is present. `install-info' is a - script that edits the Info `dir' file to add or update the menu - entry for the given Info file; it will be part of the Texinfo - package. Here is a sample rule to install an Info file: - - $(infodir)/foo.info: foo.info - # There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $@; \ - # Run install-info only if it exists. - # Use `if' instead of just prepending `-' to the - # line so we notice real errors from install-info. - # We use `$(SHELL) -c' because some shells do not - # fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --infodir=$(infodir) $$d/foo.info; \ - else true; fi - -`uninstall' - Delete all the installed files that the `install' target would - create (but not the noninstalled files such as `make all' would - create). - -`clean' - Delete all files from the current directory that are normally - created by building the program. Don't delete the files that - record the configuration. Also preserve files that could be made - by building, but normally aren't because the distribution comes - with them. - - Delete `.dvi' files here if they are not part of the distribution. - -`distclean' - Delete all files from the current directory that are created by - configuring or building the program. If you have unpacked the - source and built the program without creating any other files, - `make distclean' should leave only the files that were in the - distribution. - -`mostlyclean' - Like `clean', but may refrain from deleting a few files that people - normally don't want to recompile. For example, the `mostlyclean' - target for GCC does not delete `libgcc.a', because recompiling it - is rarely necessary and takes a lot of time. - -`realclean' - Delete everything from the current directory that can be - reconstructed with this Makefile. This typically includes - everything deleted by `distclean', plus more: C source files - produced by Bison, tags tables, Info files, and so on. - - One exception, however: `make realclean' should not delete - `configure' even if `configure' can be remade using a rule in the - Makefile. More generally, `make realclean' should not delete - anything that needs to exist in order to run `configure' and then - begin to build the program. - -`TAGS' - Update a tags table for this program. - -`info' - Generate any Info files needed. The best way to write the rules - is as follows: - - info: foo.info - - foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi - - You must define the variable `MAKEINFO' in the Makefile. It should - run the `makeinfo' program, which is part of the Texinfo - distribution. - -`dvi' - Generate DVI files for all TeXinfo documentation. For example: - - dvi: foo.dvi - - foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi - - You must define the variable `TEXI2DVI' in the Makefile. It should - run the program `texi2dvi', which is part of the Texinfo - distribution. Alternatively, write just the dependencies, and - allow GNU Make to provide the command. - -`dist' - Create a distribution tar file for this program. The tar file - should be set up so that the file names in the tar file start with - a subdirectory name which is the name of the package it is a - distribution for. This name can include the version number. - - For example, the distribution tar file of GCC version 1.40 unpacks - into a subdirectory named `gcc-1.40'. - - The easiest way to do this is to create a subdirectory - appropriately named, use `ln' or `cp' to install the proper files - in it, and then `tar' that subdirectory. - - The `dist' target should explicitly depend on all non-source files - that are in the distribution, to make sure they are up to date in - the distribution. *Note Making Releases: (standards)Releases. - -`check' - Perform self-tests (if any). The user must build the program - before running the tests, but need not install the program; you - should write the self-tests so that they work when the program is - built but not installed. - - The following targets are suggested as conventional names, for -programs in which they are useful. - -`installcheck' - Perform installation tests (if any). The user must build and - install the program before running the tests. You should not - assume that `$(bindir)' is in the search path. - -`installdirs' - It's useful to add a target named `installdirs' to create the - directories where files are installed, and their parent - directories. There is a script called `mkinstalldirs' which is - convenient for this; find it in the Texinfo package.You can use a - rule like this: - - # Make sure all installation directories (e.g. $(bindir)) - # actually exist by making them if necessary. - installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) - - -File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Standard Targets, Up: Makefile Conventions - -Variables for Specifying Commands -================================= - - Makefiles should provide variables for overriding certain commands, -options, and so on. - - In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named `BISON' whose default -value is set with `BISON = bison', and refer to it with `$(BISON)' -whenever you need to use Bison. - - File management utilities such as `ln', `rm', `mv', and so on, need -not be referred to through variables in this way, since users don't -need to replace them with other programs. - - Each program-name variable should come with an options variable that -is used to supply options to the program. Append `FLAGS' to the -program-name variable name to get the options variable name--for -example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this -rule, but we keep it because it is standard.) Use `CPPFLAGS' in any -compilation command that runs the preprocessor, and use `LDFLAGS' in -any compilation command that does linking as well as in any direct use -of `ld'. - - If there are C compiler options that *must* be used for proper -compilation of certain files, do not include them in `CFLAGS'. Users -expect to be able to specify `CFLAGS' freely themselves. Instead, -arrange to pass the necessary options to the C compiler independently -of `CFLAGS', by writing them explicitly in the compilation commands or -by defining an implicit rule, like this: - - CFLAGS = -g - ALL_CFLAGS = -I. $(CFLAGS) - .c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< - - Do include the `-g' option in `CFLAGS', because that is not -*required* for proper compilation. You can consider it a default that -is only recommended. If the package is set up so that it is compiled -with GCC by default, then you might as well include `-O' in the default -value of `CFLAGS' as well. - - Put `CFLAGS' last in the compilation command, after other variables -containing compiler options, so the user can use `CFLAGS' to override -the others. - - Every Makefile should define the variable `INSTALL', which is the -basic command for installing a file into the system. - - Every Makefile should also define the variables `INSTALL_PROGRAM' -and `INSTALL_DATA'. (The default for each of these should be -`$(INSTALL)'.) Then it should use those variables as the commands for -actual installation, for executables and nonexecutables respectively. -Use these variables as follows: - - $(INSTALL_PROGRAM) foo $(bindir)/foo - $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a - -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - - -File: standards.info, Node: Directory Variables, Prev: Command Variables, Up: Makefile Conventions - -Variables for Installation Directories -====================================== - - Installation directories should always be named by variables, so it -is easy to install in a nonstandard place. The standard names for these -variables are: - -`prefix' - A prefix used in constructing the default values of the variables - listed below. The default value of `prefix' should be `/usr/local' - (at least for now). - -`exec_prefix' - A prefix used in constructing the default values of some of the - variables listed below. The default value of `exec_prefix' should - be `$(prefix)'. - - Generally, `$(exec_prefix)' is used for directories that contain - machine-specific files (such as executables and subroutine - libraries), while `$(prefix)' is used directly for other - directories. - -`bindir' - The directory for installing executable programs that users can - run. This should normally be `/usr/local/bin', but write it as - `$(exec_prefix)/bin'. - -`libdir' - The directory for installing executable files to be run by the - program rather than by users. Object files and libraries of - object code should also go in this directory. The idea is that - this directory is used for files that pertain to a specific - machine architecture, but need not be in the path for commands. - The value of `libdir' should normally be `/usr/local/lib', but - write it as `$(exec_prefix)/lib'. - -`datadir' - The directory for installing read-only data files which the - programs refer to while they run. This directory is used for - files which are independent of the type of machine being used. - This should normally be `/usr/local/lib', but write it as - `$(prefix)/lib'. - -`statedir' - The directory for installing data files which the programs modify - while they run. These files should be independent of the type of - machine being used, and it should be possible to share them among - machines at a network installation. This should normally be - `/usr/local/lib', but write it as `$(prefix)/lib'. - -`includedir' - The directory for installing header files to be included by user - programs with the C `#include' preprocessor directive. This - should normally be `/usr/local/include', but write it as - `$(prefix)/include'. - - Most compilers other than GCC do not look for header files in - `/usr/local/include'. So installing the header files this way is - only useful with GCC. Sometimes this is not a problem because some - libraries are only really intended to work with GCC. But some - libraries are intended to work with other compilers. They should - install their header files in two places, one specified by - `includedir' and one specified by `oldincludedir'. - -`oldincludedir' - The directory for installing `#include' header files for use with - compilers other than GCC. This should normally be `/usr/include'. - - The Makefile commands should check whether the value of - `oldincludedir' is empty. If it is, they should not try to use - it; they should cancel the second installation of the header files. - - A package should not replace an existing header in this directory - unless the header came from the same package. Thus, if your Foo - package provides a header file `foo.h', then it should install the - header file in the `oldincludedir' directory if either (1) there - is no `foo.h' there or (2) the `foo.h' that exists came from the - Foo package. - - To tell whether `foo.h' came from the Foo package, put a magic - string in the file--part of a comment--and grep for that string. - -`mandir' - The directory for installing the man pages (if any) for this - package. It should include the suffix for the proper section of - the manual--usually `1' for a utility. It will normally be - `/usr/local/man/man1', but you should write it as - `$(prefix)/man/man1'. - -`man1dir' - The directory for installing section 1 man pages. - -`man2dir' - The directory for installing section 2 man pages. - -`...' - Use these names instead of `mandir' if the package needs to - install man pages in more than one section of the manual. - - *Don't make the primary documentation for any GNU software be a - man page. Write a manual in Texinfo instead. Man pages are just - for the sake of people running GNU software on Unix, which is a - secondary application only.* - -`manext' - The file name extension for the installed man page. This should - contain a period followed by the appropriate digit; it should - normally be `.1'. - -`man1ext' - The file name extension for installed section 1 man pages. - -`man2ext' - The file name extension for installed section 2 man pages. - -`...' - Use these names instead of `manext' if the package needs to - install man pages in more than one section of the manual. - -`infodir' - The directory for installing the Info files for this package. By - default, it should be `/usr/local/info', but it should be written - as `$(prefix)/info'. - -`srcdir' - The directory for the sources being compiled. The value of this - variable is normally inserted by the `configure' shell script. - - For example: - - # Common prefix for installation directories. - # NOTE: This directory must exist when you start the install. - prefix = /usr/local - exec_prefix = $(prefix) - # Where to put the executable for the command `gcc'. - bindir = $(exec_prefix)/bin - # Where to put the directories used by the compiler. - libdir = $(exec_prefix)/lib - # Where to put the Info files. - infodir = $(prefix)/info - - If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the `install' rule to create these subdirectories. - - Do not expect the user to include the subdirectory name in the value -of any of the variables listed above. The idea of having a uniform set -of variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - - -File: standards.info, Node: Configuration, Next: Source Language, Prev: Makefile Conventions, Up: Top - -How Configuration Should Work -***************************** - - Each GNU distribution should come with a shell script named -`configure'. This script is given arguments which describe the kind of -machine and system you want to compile the program for. - - The `configure' script must record the configuration options so that -they affect compilation. - - One way to do this is to make a link from a standard name such as -`config.h' to the proper configuration file for the chosen system. If -you use this technique, the distribution should *not* contain a file -named `config.h'. This is so that people won't be able to build the -program without configuring it first. - - Another thing that `configure' can do is to edit the Makefile. If -you do this, the distribution should *not* contain a file named -`Makefile'. Instead, include a file `Makefile.in' which contains the -input used for editing. Once again, this is so that people won't be -able to build the program without configuring it first. - - If `configure' does write the `Makefile', then `Makefile' should -have a target named `Makefile' which causes `configure' to be rerun, -setting up the same configuration that was set up last time. The files -that `configure' reads should be listed as dependencies of `Makefile'. - - All the files which are output from the `configure' script should -have comments at the beginning explaining that they were generated -automatically using `configure'. This is so that users won't think of -trying to edit them by hand. - - The `configure' script should write a file named `config.status' -which describes which configuration options were specified when the -program was last configured. This file should be a shell script which, -if run, will recreate the same configuration. - - The `configure' script should accept an option of the form -`--srcdir=DIRNAME' to specify the directory where sources are found (if -it is not the current directory). This makes it possible to build the -program in a separate directory, so that the actual source directory is -not modified. - - If the user does not specify `--srcdir', then `configure' should -check both `.' and `..' to see if it can find the sources. If it finds -the sources in one of these places, it should use them from there. -Otherwise, it should report that it cannot find the sources, and should -exit with nonzero status. - - Usually the easy way to support `--srcdir' is by editing a -definition of `VPATH' into the Makefile. Some rules may need to refer -explicitly to the specified source directory. To make this possible, -`configure' can add to the Makefile a variable named `srcdir' whose -value is precisely the specified directory. - - The `configure' script should also take an argument which specifies -the type of system to build the program for. This argument should look -like this: - - CPU-COMPANY-SYSTEM - - For example, a Sun 3 might be `m68k-sun-sunos4.1'. - - The `configure' script needs to be able to decode all plausible -alternatives for how to describe a machine. Thus, `sun3-sunos4.1' -would be a valid alias. So would `sun3-bsd4.2', since SunOS is -basically BSD and no other BSD system is used on a Sun. For many -programs, `vax-dec-ultrix' would be an alias for `vax-dec-bsd', simply -because the differences between Ultrix and BSD are rarely noticeable, -but a few programs might need to distinguish them. - - There is a shell script called `config.sub' that you can use as a -subroutine to validate system types and canonicalize aliases. - - Other options are permitted to specify in more detail the software -or hardware present on the machine, and include or exclude optional -parts of the package: - -`--enable-FEATURE[=PARAMETER]' - Configure the package to build and install an optional user-level - facility called FEATURE. This allows users to choose which - optional features to include. Giving an optional PARAMETER of - `no' should omit FEATURE, if it is built by default. - - No `--enable' option should *ever* cause one feature to replace - another. No `--enable' option should ever substitute one useful - behavior for another useful behavior. The only proper use for - `--enable' is for questions of whether to build part of the program - or exclude it. - -`--with-PACKAGE' - The package PACKAGE will be installed, so configure this package - to work with PACKAGE. - - Possible values of PACKAGE include `x', `x-toolkit', `gnu-as' (or - `gas'), `gnu-ld', `gnu-libc', and `gdb'. - - Do not use a `--with' option to specify the file name to use to - find certain files. That is outside the scope of what `--with' - options are for. - -`--nfp' - The target machine has no floating point processor. - -`--gas' - The target machine assembler is GAS, the GNU assembler. This is - obsolete; users should use `--with-gnu-as' instead. - -`--x' - The target machine has the X Window System installed. This is - obsolete; users should use `--with-x' instead. - - All `configure' scripts should accept all of these "detail" options, -whether or not they make any difference to the particular package at -hand. In particular, they should accept any option that starts with -`--with-' or `--enable-'. This is so users will be able to configure -an entire GNU source tree at once with a single set of options. - - You will note that the categories `--with-' and `--enable-' are -narrow: they *do not* provide a place for any sort of option you might -think of. That is deliberate. We want to limit the possible -configuration options in GNU software. We do not want GNU programs to -have idiosyncratic configuration options. - - Packages that perform part of compilation may support -cross-compilation. In such a case, the host and target machines for -the program may be different. The `configure' script should normally -treat the specified type of system as both the host and the target, -thus producing a program which works for the same type of machine that -it runs on. - - The way to build a cross-compiler, cross-assembler, or what have -you, is to specify the option `--host=HOSTTYPE' when running -`configure'. This specifies the host system without changing the type -of target system. The syntax for HOSTTYPE is the same as described -above. - - Bootstrapping a cross-compiler requires compiling it on a machine -other than the host it will run on. Compilation packages accept a -configuration option `--build=HOSTTYPE' for specifying the -configuration on which you will compile them, in case that is different -from the host. - - Programs for which cross-operation is not meaningful need not accept -the `--host' option, because configuring an entire operating system for -cross-operation is not a meaningful thing. - - Some programs have ways of configuring themselves automatically. If -your program is set up to do this, your `configure' script can simply -ignore most of its arguments. - - -File: standards.info, Node: Source Language, Next: Formatting, Prev: Configuration, Up: Top - -Using Languages Other Than C -**************************** - - Using a language other than C is like using a non-standard feature: -it will cause trouble for users. Even if GCC supports the other -language, users may find it inconvenient to have to install the -compiler for that other language in order to build your program. So -please write in C. - - There are three exceptions for this rule: - - * It is okay to use a special language if the same program contains - an interpreter for that language. - - Thus, it is not a problem that GNU Emacs contains code written in - Emacs Lisp, because it comes with a Lisp interpreter. - - * It is okay to use another language in a tool specifically intended - for use with that language. - - This is okay because the only people who want to build the tool - will be those who have installed the other language anyway. - - * If an application is not of extremely widespread interest, then - perhaps it's not important if the application is inconvenient to - install. - - -File: standards.info, Node: Formatting, Next: Comments, Prev: Source Language, Up: Top - -Formatting Your Source Code -*************************** - - It is important to put the open-brace that starts the body of a C -function in column zero, and avoid putting any other open-brace or -open-parenthesis or open-bracket in column zero. Several tools look -for open-braces in column zero to find the beginnings of C functions. -These tools will not work on code not formatted that way. - - It is also important for function definitions to start the name of -the function in column zero. This helps people to search for function -definitions, and may also help certain tools recognize them. Thus, the -proper format is this: - - static char * - concat (s1, s2) /* Name starts in column zero here */ - char *s1, *s2; - { /* Open brace in column zero here */ - ... - } - -or, if you want to use ANSI C, format the definition like this: - - static char * - concat (char *s1, char *s2) - { - ... - } - - In ANSI C, if the arguments don't fit nicely on one line, split it -like this: - - int - lots_of_args (int an_integer, long a_long, short a_short, - double a_double, float a_float) - ... - - For the body of the function, we prefer code formatted like this: - - if (x < foo (y, z)) - haha = bar[4] + 5; - else - { - while (z) - { - haha += foo (z, z); - z--; - } - return ++x + bar (); - } - - We find it easier to read a program when it has spaces before the -open-parentheses and after the commas. Especially after the commas. - - When you split an expression into multiple lines, split it before an -operator, not after one. Here is the right way: - - if (foo_this_is_long && bar > win (x, y, z) - && remaining_condition) - - Try to avoid having two operators of different precedence at the same -level of indentation. For example, don't write this: - - mode = (inmode[j] == VOIDmode - || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) - ? outmode[j] : inmode[j]); - - Instead, use extra parentheses so that the indentation shows the -nesting: - - mode = ((inmode[j] == VOIDmode - || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) - ? outmode[j] : inmode[j]); - - Insert extra parentheses so that Emacs will indent the code properly. -For example, the following indentation looks nice if you do it by hand, -but Emacs would mess it up: - - v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; - - But adding a set of parentheses solves the problem: - - v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); - - Format do-while statements like this: - - do - { - a = foo (a); - } - while (a > 0); - - Please use formfeed characters (control-L) to divide the program into -pages at logical places (but not within a function). It does not matter -just how long the pages are, since they do not have to fit on a printed -page. The formfeeds should appear alone on lines by themselves. - - -File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Top - -Commenting Your Work -******************** - - Every program should start with a comment saying briefly what it is -for. Example: `fmt - filter for simple filling of text'. - - Please put a comment on each function saying what the function does, -what sorts of arguments it gets, and what the possible values of -arguments mean and are used for. It is not necessary to duplicate in -words the meaning of the C argument declarations, if a C type is being -used in its customary fashion. If there is anything nonstandard about -its use (such as an argument of type `char *' which is really the -address of the second character of a string, not the first), or any -possible values that would not work the way one would expect (such as, -that strings containing newlines are not guaranteed to work), be sure -to say so. - - Also explain the significance of the return value, if there is one. - - Please put two spaces after the end of a sentence in your comments, -so that the Emacs sentence commands will work. Also, please write -complete sentences and capitalize the first word. If a lower-case -identifer comes at the beginning of a sentence, don't capitalize it! -Changing the spelling makes it a different identifier. If you don't -like starting a sentence with a lower case letter, write the sentence -differently (e.g., "The identifier lower-case is ..."). - - The comment on a function is much clearer if you use the argument -names to speak about the argument values. The variable name itself -should be lower case, but write it in upper case when you are speaking -about the value rather than the variable itself. Thus, "the inode -number NODE_NUM" rather than "an inode". - - There is usually no purpose in restating the name of the function in -the comment before it, because the reader can see that for himself. -There might be an exception when the comment is so long that the -function itself would be off the bottom of the screen. - - There should be a comment on each static variable as well, like this: - - /* Nonzero means truncate lines in the display; - zero means continue them. */ - int truncate_lines; - - Every `#endif' should have a comment, except in the case of short -conditionals (just a few lines) that are not nested. The comment should -state the condition of the conditional that is ending, *including its -sense*. `#else' should have a comment describing the condition *and -sense* of the code that follows. For example: - - #ifdef foo - ... - #else /* not foo */ - ... - #endif /* not foo */ - -but, by contrast, write the comments this way for a `#ifndef': - - #ifndef foo - ... - #else /* foo */ - ... - #endif /* foo */ - - -File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Top - -Clean Use of C Constructs -************************* - - Please explicitly declare all arguments to functions. Don't omit -them just because they are `int's. - - Declarations of external functions and functions to appear later in -the source file should all go in one place near the beginning of the -file (somewhere before the first function definition in the file), or -else should go in a header file. Don't put `extern' declarations inside -functions. - - It used to be common practice to use the same local variables (with -names like `tem') over and over for different values within one -function. Instead of doing this, it is better declare a separate local -variable for each distinct purpose, and give it a name which is -meaningful. This not only makes programs easier to understand, it also -facilitates optimization by good compilers. You can also move the -declaration of each local variable into the smallest scope that includes -all its uses. This makes the program even cleaner. - - Don't use local variables or parameters that shadow global -identifiers. - - Don't declare multiple variables in one declaration that spans lines. -Start a new declaration on each line, instead. For example, instead of -this: - - int foo, - bar; - -write either this: - - int foo, bar; - -or this: - - int foo; - int bar; - -(If they are global variables, each should have a comment preceding it -anyway.) - - When you have an `if'-`else' statement nested in another `if' -statement, always put braces around the `if'-`else'. Thus, never write -like this: - - if (foo) - if (bar) - win (); - else - lose (); - -always like this: - - if (foo) - { - if (bar) - win (); - else - lose (); - } - - If you have an `if' statement nested inside of an `else' statement, -either write `else if' on one line, like this, - - if (foo) - ... - else if (bar) - ... - -with its `then'-part indented like the preceding `then'-part, or write -the nested `if' within braces like this: - - if (foo) - ... - else - { - if (bar) - ... - } - - Don't declare both a structure tag and variables or typedefs in the -same declaration. Instead, declare the structure tag separately and -then use it to declare the variables or typedefs. - - Try to avoid assignments inside `if'-conditions. For example, don't -write this: - - if ((foo = (char *) malloc (sizeof *foo)) == 0) - fatal ("virtual memory exhausted"); - -instead, write this: - - foo = (char *) malloc (sizeof *foo); - if (foo == 0) - fatal ("virtual memory exhausted"); - - Don't make the program ugly to placate `lint'. Please don't insert -any casts to `void'. Zero without a cast is perfectly fine as a null -pointer constant. - - -File: standards.info, Node: Names, Next: Using Extensions, Prev: Syntactic Conventions, Up: Top - -Naming Variables and Functions -****************************** - - Please use underscores to separate words in a name, so that the Emacs -word commands can be useful within them. Stick to lower case; reserve -upper case for macros and `enum' constants, and for name-prefixes that -follow a uniform convention. - - For example, you should use names like `ignore_space_change_flag'; -don't use names like `iCantReadThis'. - - Variables that indicate whether command-line options have been -specified should be named after the meaning of the option, not after -the option-letter. A comment should state both the exact meaning of -the option and its letter. For example, - - /* Ignore changes in horizontal whitespace (-b). */ - int ignore_space_change_flag; - - When you want to define names with constant integer values, use -`enum' rather than `#define'. GDB knows about enumeration constants. - - Use file names of 14 characters or less, to avoid creating gratuitous -problems on System V. You can use the program `doschk' to test for -this. `doschk' also tests for potential name conflicts if the files -were loaded onto an MS-DOS file system--something you may or may not -care about. - - -File: standards.info, Node: Using Extensions, Next: System Functions, Prev: Names, Up: Top - -Using Non-standard Features -*************************** - - Many GNU facilities that already exist support a number of convenient -extensions over the comparable Unix facilities. Whether to use these -extensions in implementing your program is a difficult question. - - On the one hand, using the extensions can make a cleaner program. -On the other hand, people will not be able to build the program unless -the other GNU tools are available. This might cause the program to -work on fewer kinds of machines. - - With some extensions, it might be easy to provide both alternatives. -For example, you can define functions with a "keyword" `INLINE' and -define that as a macro to expand into either `inline' or nothing, -depending on the compiler. - - In general, perhaps it is best not to use the extensions if you can -straightforwardly do without them, but to use the extensions if they -are a big improvement. - - An exception to this rule are the large, established programs (such -as Emacs) which run on a great variety of systems. Such programs would -be broken by use of GNU extensions. - - Another exception is for programs that are used as part of -compilation: anything that must be compiled with other compilers in -order to bootstrap the GNU compilation facilities. If these require -the GNU compiler, then no one can compile them without having them -installed already. That would be no good. - - Since most computer systems do not yet implement ANSI C, using the -ANSI C features is effectively using a GNU extension, so the same -considerations apply. (Except for ANSI features that we discourage, -such as trigraphs--don't ever use them.) - - -File: standards.info, Node: System Functions, Next: Semantics, Prev: Using Extensions, Up: Top - -Calling System Functions -************************ - - C implementations differ substantially. ANSI C reduces but does not -eliminate the incompatibilities; meanwhile, many users wish to compile -GNU software with pre-ANSI compilers. This chapter gives -recommendations for how to use the more or less standard C library -functions to avoid unnecessary loss of portability. - - * Don't use the value of `sprintf'. It returns the number of - characters written on some systems, but not on all systems. - - * Don't declare system functions explicitly. - - Almost any declaration for a system function is wrong on some - system. To minimize conflicts, leave it to the system header - files to declare system functions. If the headers don't declare a - function, let it remain undeclared. - - While it may seem unclean to use a function without declaring it, - in practice this works fine for most system library functions on - the systems where this really happens. The problem is only - theoretical. By contrast, actual declarations have frequently - caused actual conflicts. - - * If you must declare a system function, don't specify the argument - types. Use an old-style declaration, not an ANSI prototype. The - more you specify about the function, the more likely a conflict. - - * In particular, don't unconditionally declare `malloc' or `realloc'. - - Most GNU programs use those functions just once, in functions - conventionally named `xmalloc' and `xrealloc'. These functions - call `malloc' and `realloc', respectively, and check the results. - - Because `xmalloc' and `xrealloc' are defined in your program, you - can declare them in other files without any risk of type conflict. - - On most systems, `int' is the same length as a pointer; thus, the - calls to `malloc' and `realloc' work fine. For the few - exceptional systems (mostly 64-bit machines), you can use - *conditionalized* declarations of `malloc' and `realloc'--or put - these declarations in configuration files specific to those - systems. - - * The string functions require special treatment. Some Unix systems - have a header file `string.h'; other have `strings.h'. Neither - file name is portable. There are two things you can do: use - Autoconf to figure out which file to include, or don't include - either file. - - * If you don't include either strings file, you can't get - declarations for the string functions from the header file in the - usual way. - - That causes less of a problem than you might think. The newer ANSI - string functions are off-limits anyway because many systems still - don't support them. The string functions you can use are these: - - strcpy strncpy strcat strncat - strlen strcmp strncmp - strchr strrchr - - The copy and concatenate functions work fine without a declaration - as long as you don't use their values. Using their values without - a declaration fails on systems where the width of a pointer - differs from the width of `int', and perhaps in other cases. It - is trivial to avoid using their values, so do that. - - The compare functions and `strlen' work fine without a declaration - on most systems, possibly all the ones that GNU software runs on. - You may find it necessary to declare them *conditionally* on a few - systems. - - The search functions must be declared to return `char *'. Luckily, - there is no variation in the data type they return. But there is - variation in their names. Some systems give these functions the - names `index' and `rindex'; other systems use the names `strchr' - and `strrchr'. Some systems support both pairs of names, but - neither pair works on all systems. - - You should pick a single pair of names and use it throughout your - program. (Nowadays, it is better to choose `strchr' and - `strrchr'.) Declare both of those names as functions returning - `char *'. On systems which don't support those names, define them - as macros in terms of the other pair. For example, here is what - to put at the beginning of your file (or in a header) if you want - to use the names `strchr' and `strrchr' throughout: - - #ifndef HAVE_STRCHR - #define strchr index - #endif - #ifndef HAVE_STRRCHR - #define strrchr rindex - #endif - - char *strchr (); - char *strrchr (); - - Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros -defined in systems where the corresponding functions exist. One way to -get them properly defined is to use Autoconf. - - -File: standards.info, Node: Semantics, Next: Errors, Prev: System Functions, Up: Top - -Program Behavior for All Programs -********************************* - - Avoid arbitrary limits on the length or number of *any* data -structure, including filenames, lines, files, and symbols, by allocating -all data structures dynamically. In most Unix utilities, "long lines -are silently truncated". This is not acceptable in a GNU utility. - - Utilities reading files should not drop NUL characters, or any other -nonprinting characters *including those with codes above 0177*. The -only sensible exceptions would be utilities specifically intended for -interface to certain types of printers that can't handle those -characters. - - Check every system call for an error return, unless you know you -wish to ignore errors. Include the system error text (from `perror' or -equivalent) in *every* error message resulting from a failing system -call, as well as the name of the file if any and the name of the -utility. Just "cannot open foo.c" or "stat failed" is not sufficient. - - Check every call to `malloc' or `realloc' to see if it returned -zero. Check `realloc' even if you are making the block smaller; in a -system that rounds block sizes to a power of 2, `realloc' may get a -different block if you ask for less space. - - In Unix, `realloc' can destroy the storage block if it returns zero. -GNU `realloc' does not have this bug: if it fails, the original block -is unchanged. Feel free to assume the bug is fixed. If you wish to -run your program on Unix, and wish to avoid lossage in this case, you -can use the GNU `malloc'. - - You must expect `free' to alter the contents of the block that was -freed. Anything you want to fetch from the block, you must fetch before -calling `free'. - - Use `getopt_long' to decode arguments, unless the argument syntax -makes this unreasonable. - - When static storage is to be written in during program execution, use -explicit C code to initialize it. Reserve C initialized declarations -for data that will not be changed. - - Try to avoid low-level interfaces to obscure Unix data structures -(such as file directories, utmp, or the layout of kernel memory), since -these are less likely to work compatibly. If you need to find all the -files in a directory, use `readdir' or some other high-level interface. -These will be supported compatibly by GNU. - - By default, the GNU system will provide the signal handling -functions of BSD and of POSIX. So GNU software should be written to use -these. - - In error checks that detect "impossible" conditions, just abort. -There is usually no point in printing any message. These checks -indicate the existence of bugs. Whoever wants to fix the bugs will have -to read the source code and run a debugger. So explain the problem with -comments in the source. The relevant data will be in variables, which -are easy to examine with the debugger, so there is no point moving them -elsewhere. - - -File: standards.info, Node: Errors, Next: Libraries, Prev: Semantics, Up: Top - -Formatting Error Messages -************************* - - Error messages from compilers should look like this: - - SOURCE-FILE-NAME:LINENO: MESSAGE - - Error messages from other noninteractive programs should look like -this: - - PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE - -when there is an appropriate source file, or like this: - - PROGRAM: MESSAGE - -when there is no relevant source file. - - In an interactive program (one that is reading commands from a -terminal), it is better not to include the program name in an error -message. The place to indicate which program is running is in the -prompt or with the screen layout. (When the same program runs with -input from a source other than a terminal, it is not interactive and -would do best to print error messages using the noninteractive style.) - - The string MESSAGE should not begin with a capital letter when it -follows a program name and/or filename. Also, it should not end with a -period. - - Error messages from interactive programs, and other messages such as -usage messages, should start with a capital letter. But they should not -end with a period. - - -File: standards.info, Node: Libraries, Next: Portability, Prev: Errors, Up: Top - -Library Behavior -**************** - - Try to make library functions reentrant. If they need to do dynamic -storage allocation, at least try to avoid any nonreentrancy aside from -that of `malloc' itself. - - Here are certain name conventions for libraries, to avoid name -conflicts. - - Choose a name prefix for the library, more than two characters long. -All external function and variable names should start with this prefix. -In addition, there should only be one of these in any given library -member. This usually means putting each one in a separate source file. - - An exception can be made when two external symbols are always used -together, so that no reasonable program could use one without the -other; then they can both go in the same file. - - External symbols that are not documented entry points for the user -should have names beginning with `_'. They should also contain the -chosen name prefix for the library, to prevent collisions with other -libraries. These can go in the same files with user entry points if -you like. - - Static functions and variables can be used as you like and need not -fit any naming convention. - - -File: standards.info, Node: Portability, Next: User Interfaces, Prev: Libraries, Up: Top - -Portability As It Applies to GNU -******************************** - - Much of what is called "portability" in the Unix world refers to -porting to different Unix versions. This is a secondary consideration -for GNU software, because its primary purpose is to run on top of one -and only one kernel, the GNU kernel, compiled with one and only one C -compiler, the GNU C compiler. The amount and kinds of variation among -GNU systems on different cpu's will be like the variation among Berkeley -4.3 systems on different cpu's. - - All users today run GNU software on non-GNU systems. So supporting a -variety of non-GNU systems is desirable; simply not paramount. The -easiest way to achieve portability to a reasonable range of systems is -to use Autoconf. It's unlikely that your program needs to know more -information about the host machine than Autoconf can provide, simply -because most of the programs that need such knowledge have already been -written. - - It is difficult to be sure exactly what facilities the GNU kernel -will provide, since it isn't finished yet. Therefore, assume you can -use anything in 4.3; just avoid using the format of semi-internal data -bases (e.g., directories) when there is a higher-level alternative -(`readdir'). - - You can freely assume any reasonably standard facilities in the C -language, libraries or kernel, because we will find it necessary to -support these facilities in the full GNU system, whether or not we have -already done so. The fact that there may exist kernels or C compilers -that lack these facilities is irrelevant as long as the GNU kernel and -C compiler support them. - - It remains necessary to worry about differences among cpu types, such -as the difference in byte ordering and alignment restrictions. It's -unlikely that 16-bit machines will ever be supported by GNU, so there -is no point in spending any time to consider the possibility that an -int will be less than 32 bits. - - You can assume that all pointers have the same format, regardless of -the type they point to, and that this is really an integer. There are -some weird machines where this isn't true, but they aren't important; -don't waste time catering to them. Besides, eventually we will put -function prototypes into all GNU programs, and that will probably make -your program work even on weird machines. - - Since some important machines (including the 68000) are big-endian, -it is important not to assume that the address of an `int' object is -also the address of its least-significant byte. Thus, don't make the -following mistake: - - int c; - ... - while ((c = getchar()) != EOF) - write(file_descriptor, &c, 1); - - You can assume that it is reasonable to use a meg of memory. Don't -strain to reduce memory usage unless it can get to that level. If your -program creates complicated data structures, just make them in core and -give a fatal error if malloc returns zero. - - If a program works by lines and could be applied to arbitrary -user-supplied input files, it should keep only a line in memory, because -this is not very hard and users will want to be able to operate on input -files that are bigger than will fit in core all at once. - - -File: standards.info, Node: User Interfaces, Next: Documentation, Prev: Portability, Up: Top - -Standards for Command Line Interfaces -************************************* - - Please don't make the behavior of a utility depend on the name used -to invoke it. It is useful sometimes to make a link to a utility with -a different name, and that should not change what it does. - - Instead, use a run time option or a compilation switch or both to -select among the alternate behaviors. - - Likewise, please don't make the behavior of the program depend on the -type of output device it is used with. Device independence is an -important principle of the system's design; do not compromise it merely -to save someone from typing an option now and then. - - If you think one behavior is most useful when the output is to a -terminal, and another is most useful when the output is a file or a -pipe, then it is usually best to make the default behavior the one that -is useful with output to a terminal, and have an option for the other -behavior. - - Compatibility requires certain programs to depend on the type of -output device. It would be disastrous if `ls' or `sh' did not do so in -the way all users expect. In some of these cases, we supplement the -program with a preferred alternate version that does not depend on the -output device type. For example, we provide a `dir' program much like -`ls' except that its default output format is always multi-column -format. - - It is a good idea to follow the POSIX guidelines for the -command-line options of a program. The easiest way to do this is to use -`getopt' to parse them. Note that the GNU version of `getopt' will -normally permit options anywhere among the arguments unless the special -argument `--' is used. This is not what POSIX specifies; it is a GNU -extension. - - Please define long-named options that are equivalent to the -single-letter Unix-style options. We hope to make GNU more user -friendly this way. This is easy to do with the GNU function -`getopt_long'. - - One of the advantages of long-named options is that they can be -consistent from program to program. For example, users should be able -to expect the "verbose" option of any GNU program which has one, to be -spelled precisely `--verbose'. To achieve this uniformity, look at the -table of common long-option names when you choose the option names for -your program. The table appears below. - - If you use names not already in the table, please send -`gnu@prep.ai.mit.edu' a list of them, with their meanings, so we can -update the table. - - It is usually a good idea for file names given as ordinary arguments -to be input files only; any output files would be specified using -options (preferably `-o'). Even if you allow an output file name as an -ordinary argument for compatibility, try to provide a suitable option -as well. This will lead to more consistency among GNU utilities, so -that there are fewer idiosyncracies for users to remember. - - Programs should support an option `--version' which prints the -program's version number on standard output and exits successfully, and -an option `--help' which prints option usage information on standard -output and exits successfully. These options should inhibit the normal -function of the command; they should do nothing except print the -requested information. - -`auto-check' - `-a' in `recode'. - -`auto-reference' - `-A' in `ptx'. - -`after-date' - `-N' in `tar'. - -`all' - `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. - -`all-text' - `-a' in `diff'. - -`almost-all' - `-A' in `ls'. - -`append' - `-a' in `etags', `tee', `time'; `-r' in `tar'. - -`archive' - `-a' in `cp'. - -`arglength' - `-l' in `m4'. - -`ascii' - `-a' in `diff'. - -`assume-new' - `-W' in Make. - -`assume-old' - `-o' in Make. - -`backward-search' - `-B' in etags. - -`batch' - Used in GDB. - -`baud' - Used in GDB. - -`before' - `-b' in `tac'. - -`binary' - `-b' in `cpio' and `diff'. - -`block-size' - Used in `cpio' and `tar'. - -`blocks' - `-b' in `head' and `tail'. - -`break-file' - `-b' in `ptx'. - -`brief' - Used in various programs to make output shorter. - -`bytes' - `-c' in `head', `split', and `tail'. - -`c++' - `-C' in `etags'. - -`catenate' - `-A' in `tar'. - -`cd' - Used in various programs to specify the directory to use. - -`changes' - `-c' in `chgrp' and `chown'. - -`classify' - `-F' in `ls'. - -`colons' - `-c' in `recode'. - -`command' - `-c' in `su'; `-x' in GDB. - -`compare' - `-d' in `tar'. - -`compress' - `-Z' in `tar'. - -`concatenate' - `-A' in `tar'. - -`confirmation' - `-w' in `tar'. - -`context' - Used in `diff'. - -`copyright' - `-C' in `ptx' and `recode'. - -`core' - Used in GDB. - -`count' - `-q' in `who'. - -`count-links' - `-l' in `du'. - -`create' - Used in `tar' and `cpio'. - -`cxref' - `-x' in `etags'. - -`date' - `-d' in `touch'. - -`debug' - `-d' in Make and `m4'; `-t' in Bison. - -`define' - `-D' in `m4'. - -`defines' - `-d' in Bison and `etags'. - -`delete' - `-D' in `tar'. - -`dereference' - `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. - -`dereference-args' - `-D' in `du'. - -`diacritics' - `-d' in `recode'. - -`dictionary-order' - `-d' in `look'. - -`diff' - `-d' in `tar'. - -`digits' - `-n' in `csplit'. - -`directory' - Specify the directory to use, in various programs. In `ls', it - means to show directories themselves rather than their contents. - In `rm' and `ln', it means to not treat links to directories - specially. - -`discard-all' - `-x' in `strip'. - -`discard-locals' - `-X' in `strip'. - -`diversions' - `-N' in `m4'. - -`dry-run' - `-n' in Make. - -`ed' - `-e' in `diff'. - -`elide-empty-files' - `-z' in `csplit'. - -`entire-new-file' - `-N' in `diff'. - -`environment-overrides' - `-e' in Make. - -`eof' - `-e' in `xargs'. - -`epoch' - Used in GDB. - -`error-limit' - Used in Makeinfo. - -`error-output' - `-o' in `m4'. - -`escape' - `-b' in `ls'. - -`exclude-from' - `-X' in `tar'. - -`exec' - Used in GDB. - -`exit' - `-x' in `xargs'. - -`expand-tabs' - `-t' in `diff'. - -`expression' - `-e' in `sed'. - -`extern-only' - `-g' in `nm'. - -`extract' - `-i' in `cpio'; `-x' in `tar'. - -`faces' - `-f' in `finger'. - -`fast' - `-f' in `su'. - -`file' - `-f' in `info', Make, `mt', and `tar'; `-n' in `sed'; `-r' in - `touch'. - -`file-prefix' - `-b' in Bison. - -`file-type' - `-F' in `ls'. - -`files-from' - `-T' in `tar'. - -`fill-column' - Used in Makeinfo. - -`flag-truncation' - `-F' in `ptx'. - -`fixed-output-files' - `-y' in Bison. - -`follow' - `-f' in `tail'. - -`footnote-style' - Used in Makeinfo. - -`force' - `-f' in `cp', `ln', `mv', and `rm'. - -`format' - Used in `ls', `time', and `ptx'. - -`forward-search' - `-F' in `etags'. - -`fullname' - Used in GDB. - -`gap-size' - `-g' in `ptx'. - -`get' - `-x' in `tar'. - -`graphic' - `-i' in `ul'. - -`graphics' - `-g' in `recode'. - -`group' - `-g' in `install'. - -`gzip' - `-z' in `tar'. - -`hashsize' - `-H' in `m4'. - -`header' - `-h' in `objdump' and `recode' - -`heading' - `-H' in `who'. - -`help' - Used to ask for brief usage information. - -`hide-control-chars' - `-q' in `ls'. - -`idle' - `-u' in `who'. - -`ifdef' - `-D' in `diff'. - -`ignore' - `-I' in `ls'; `-x' in `recode'. - -`ignore-all-space' - `-w' in `diff'. - -`ignore-backups' - `-B' in `ls'. - -`ignore-blank-lines' - `-B' in `diff'. - -`ignore-case' - `-f' in `look' and `ptx'; `-i' in `diff'. - -`ignore-errors' - `-i' in Make. - -`ignore-file' - `-i' in `ptx'. - -`ignore-indentation' - `-S' in `etags'. - -`ignore-init-file' - `-f' in Oleo. - -`ignore-interrupts' - `-i' in `tee'. - -`ignore-matching-lines' - `-I' in `diff'. - -`ignore-space-change' - `-b' in `diff'. - -`ignore-zeros' - `-i' in `tar'. - -`include' - `-i' in `etags'; `-I' in `m4'. - -`include-dir' - `-I' in Make. - -`incremental' - `-G' in `tar'. - -`info' - `-i', `-l', and `-m' in Finger. - -`initial' - `-i' in `expand'. - -`initial-tab' - `-T' in `diff'. - -`inode' - `-i' in `ls'. - -`interactive' - `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; - `-w' in `tar'. - -`jobs' - `-j' in Make. - -`just-print' - `-n' in Make. - -`keep-going' - `-k' in Make. - -`keep-files' - `-k' in `csplit'. - -`kilobytes' - `-k' in `du' and `ls'. - -`line-bytes' - `-C' in `split'. - -`lines' - Used in `split', `head', and `tail'. - -`link' - `-l' in `cpio'. - -`list' - `-t' in `cpio'; `-l' in `recode'. - -`list' - `-t' in `tar'. - -`literal' - `-N' in `ls'. - -`load-average' - `-l' in Make. - -`login' - Used in `su'. - -`machine' - No listing of which programs already use this; someone should - check to see if any actually do and tell `gnu@prep.ai.mit.edu'. - -`macro-name' - `-M' in `ptx'. - -`mail' - `-m' in `hello' and `uname'. - -`make-directories' - `-d' in `cpio'. - -`makefile' - `-f' in Make. - -`mapped' - Used in GDB. - -`max-args' - `-n' in `xargs'. - -`max-chars' - `-n' in `xargs'. - -`max-lines' - `-l' in `xargs'. - -`max-load' - `-l' in Make. - -`max-procs' - `-P' in `xargs'. - -`mesg' - `-T' in `who'. - -`message' - `-T' in `who'. - -`minimal' - `-d' in `diff'. - -`mode' - `-m' in `install', `mkdir', and `mkfifo'. - -`modification-time' - `-m' in `tar'. - -`multi-volume' - `-M' in `tar'. - -`name-prefix' - `-a' in Bison. - -`new-file' - `-W' in Make. - -`no-builtin-rules' - `-r' in Make. - -`no-create' - `-c' in `touch'. - -`no-defines' - `-D' in `etags'. - -`no-dereference' - `-d' in `cp'. - -`no-keep-going' - `-S' in Make. - -`no-lines' - `-l' in Bison. - -`no-prof' - `-e' in `gprof'. - -`no-sort' - `-p' in `nm'. - -`no-split' - Used in Makeinfo. - -`no-static' - `-a' in `gprof'. - -`no-time' - `-E' in `gprof'. - -`no-validate' - Used in Makeinfo. - -`no-warn' - Used in various programs to inhibit warnings. - -`node' - `-n' in `info'. - -`nodename' - `-n' in `uname'. - -`nonmatching' - `-f' in `cpio'. - -`nstuff' - `-n' in `objdump'. - -`null' - `-0' in `xargs'. - -`number' - `-n' in `cat'. - -`number-nonblank' - `-b' in `cat'. - -`numeric-sort' - `-n' in `nm'. - -`numeric-uid-gid' - `-n' in `cpio' and `ls'. - -`nx' - Used in GDB. - -`old-archive' - `-o' in `tar'. - -`old-file' - `-o' in Make. - -`one-file-system' - `-l' in `tar', `cp', and `du'. - -`only-file' - `-o' in `ptx'. - -`only-prof' - `-f' in `gprof'. - -`only-time' - `-F' in `gprof'. - -`output' - In various programs, specify the output file name. - -`override' - `-o' in `rm'. - -`owner' - `-o' in `install'. - -`paginate' - `-l' in `diff'. - -`paragraph-indent' - Used in Makeinfo. - -`parents' - `-p' in `mkdir' and `rmdir'. - -`pass-all' - `-p' in `ul'. - -`pass-through' - `-p' in `cpio'. - -`port' - `-P' in `finger'. - -`portability' - `-c' in `cpio' and `tar'. - -`prefix-builtins' - `-P' in `m4'. - -`prefix' - `-f' in `csplit'. - -`preserve' - Used in `tar' and `cp'. - -`preserve-environment' - `-p' in `su'. - -`preserve-modification-time' - `-m' in `cpio'. - -`preserve-order' - `-s' in `tar'. - -`preserve-permissions' - `-p' in `tar'. - -`print' - `-l' in `diff'. - -`print-chars' - `-L' in `cmp'. - -`print-data-base' - `-p' in Make. - -`print-directory' - `-w' in Make. - -`print-file-name' - `-o' in `nm'. - -`print-symdefs' - `-s' in `nm'. - -`question' - `-q' in Make. - -`quiet' - Used in many programs to inhibit the usual output. *Note:* every - program accepting `--quiet' should accept `--silent' as a synonym. - -`quote-name' - `-Q' in `ls'. - -`rcs' - `-n' in `diff'. - -`read-full-blocks' - `-B' in `tar'. - -`readnow' - Used in GDB. - -`recon' - `-n' in Make. - -`record-number' - `-R' in `tar'. - -`recursive' - Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. - -`reference-limit' - Used in Makeinfo. - -`references' - `-r' in `ptx'. - -`regex' - `-r' in `tac'. - -`release' - `-r' in `uname'. - -`relocation' - `-r' in `objdump'. - -`rename' - `-r' in `cpio'. - -`replace' - `-i' in `xargs'. - -`report-identical-files' - `-s' in `diff'. - -`reset-access-time' - `-a' in `cpio'. - -`reverse' - `-r' in `ls' and `nm'. - -`reversed-ed' - `-f' in `diff'. - -`right-side-defs' - `-R' in `ptx'. - -`same-order' - `-s' in `tar'. - -`same-permissions' - `-p' in `tar'. - -`save' - `-g' in `stty'. - -`se' - Used in GDB. - -`sentence-regexp' - `-S' in `ptx'. - -`separate-dirs' - `-S' in `du'. - -`separator' - `-s' in `tac'. - -`sequence' - Used by `recode' to chose files or pipes for sequencing passes. - -`shell' - `-s' in `su'. - -`show-all' - `-A' in `cat'. - -`show-c-function' - `-p' in `diff'. - -`show-ends' - `-E' in `cat'. - -`show-function-line' - `-F' in `diff'. - -`show-tabs' - `-T' in `cat'. - -`silent' - Used in many programs to inhibit the usual output. *Note:* every - program accepting `--silent' should accept `--quiet' as a synonym. - -`size' - `-s' in `ls'. - -`sort' - Used in `ls'. - -`sparse' - `-S' in `tar'. - -`speed-large-files' - `-H' in `diff'. - -`squeeze-blank' - `-s' in `cat'. - -`starting-file' - Used in `tar' and `diff' to specify which file within a directory - to start processing with. - -`stop' - `-S' in Make. - -`strict' - `-s' in `recode'. - -`strip' - `-s' in `install'. - -`strip-all' - `-s' in `strip'. - -`strip-debug' - `-S' in `strip'. - -`suffix' - `-S' in `cp', `ln', `mv'. - -`suffix-format' - `-b' in `csplit'. - -`sum' - `-s' in `gprof'. - -`summarize' - `-s' in `du'. - -`symbolic' - `-s' in `ln'. - -`symbols' - Used in GDB and `objdump'. - -`synclines' - `-s' in `m4'. - -`sysname' - `-s' in `uname'. - -`tabs' - `-t' in `expand' and `unexpand'. - -`tabsize' - `-T' in `ls'. - -`terminal' - `-T' in `tput' and `ul'. - -`text' - `-a' in `diff'. - -`time' - Used in `ls' and `touch'. - -`to-stdout' - `-O' in `tar'. - -`total' - `-c' in `du'. - -`touch' - `-t' in Make, `ranlib', and `recode'. - -`trace' - `-t' in `m4'. - -`traditional' - `-t' in `hello'; `-G' in `m4' and `ptx'. - -`tty' - Used in GDB. - -`typedefs' - `-t' in `etags'. - -`typedefs-and-c++' - `-T' in `etags'. - -`typeset-mode' - `-t' in `ptx'. - -`uncompress' - `-z' in `tar'. - -`unconditional' - `-u' in `cpio'. - -`undefine' - `-U' in `m4'. - -`undefined-only' - `-u' in `nm'. - -`update' - `-u' in `cp', `etags', `mv', `tar'. - -`verbose' - Print more information about progress. Many programs support this. - -`verify' - `-W' in `tar'. - -`version' - Print the version number. - -`version-control' - `-V' in `cp', `ln', `mv'. - -`vgrind' - `-v' in `etags'. - -`volume' - `-V' in `tar'. - -`what-if' - `-W' in Make. - -`width' - `-w' in `ls' and `ptx'. - -`word-regexp' - `-W' in `ptx'. - -`writable' - `-T' in `who'. - -`zeros' - `-z' in `gprof'. - - -File: standards.info, Node: Documentation, Next: Releases, Prev: User Interfaces, Up: Top - -Documenting Programs -******************** - - Please use Texinfo for documenting GNU programs. See the Texinfo -manual, either the hardcopy or the version in the GNU Emacs Info -subsystem (`C-h i'). See existing GNU Texinfo files (e.g., those under -the `man/' directory in the GNU Emacs distribution) for examples. - - The title page of the manual should state the version of the program -which the manual applies to. The Top node of the manual should also -contain this information. If the manual is changing more frequently -than or independent of the program, also state a version number for the -manual in both of these places. - - The manual should document all command-line arguments and all -commands. It should give examples of their use. But don't organize -the manual as a list of features. Instead, organize it by the concepts -a user will have before reaching that point in the manual. Address the -goals that a user will have in mind, and explain how to accomplish -them. Don't use Unix man pages as a model for how to write GNU -documentation; they are a bad example to follow. - - The manual should have a node named `PROGRAM Invocation' or -`Invoking PROGRAM', where PROGRAM stands for the name of the program -being described, as you would type it in the shell to run the program. -This node (together with its subnodes, if any) should describe the -program's command line arguments and how to run it (the sort of -information people would look in a man page for). Start with an -`@example' containing a template for all the options and arguments that -the program uses. - - Alternatively, put a menu item in some menu whose item name fits one -of the above patterns. This identifies the node which that item points -to as the node for this purpose, regardless of the node's actual name. - - There will be automatic features for specifying a program name and -quickly reading just this part of its manual. - - If one manual describes several programs, it should have such a node -for each program described. - - In addition to its manual, the package should have a file named -`NEWS' which contains a list of user-visible changes worth mentioning. -In each new release, add items to the front of the file and identify -the version they pertain to. Don't discard old items; leave them in -the file after the newer items. This way, a user upgrading from any -previous version can see what is new. - - If the `NEWS' file gets very long, move some of the older items into -a file named `ONEWS' and put a note at the end referring the user to -that file. - - Please do not use the term "pathname" that is used in Unix -documentation; use "file name" (two words) instead. We use the term -"path" only for search paths, which are lists of file names. - - It is ok to supply a man page for the program as well as a Texinfo -manual if you wish to. But keep in mind that supporting a man page -requires continual effort, each time the program is changed. Any time -you spend on the man page is time taken away from more useful things you -could contribute. - - Thus, even if a user volunteers to donate a man page, you may find -this gift costly to accept. Unless you have time on your hands, it may -be better to refuse the man page unless the same volunteer agrees to -take full responsibility for maintaining it--so that you can wash your -hands of it entirely. If the volunteer ceases to do the job, then -don't feel obliged to pick it up yourself; it may be better to withdraw -the man page until another volunteer offers to carry on with it. - - Alternatively, if you expect the discrepancies to be small enough -that the man page remains useful, put a prominent note near the -beginning of the man page explaining that you don't maintain it and -that the Texinfo manual is more authoritative, and describing how to -access the Texinfo documentation. - - -File: standards.info, Node: Releases, Prev: Documentation, Up: Top - -Making Releases -*************** - - Package the distribution of Foo version 69.96 in a gzipped tar file -named `foo-69.96.tar.gz'. It should unpack into a subdirectory named -`foo-69.96'. - - Building and installing the program should never modify any of the -files contained in the distribution. This means that all the files -that form part of the program in any way must be classified into "source -files" and "non-source files". Source files are written by humans and -never changed automatically; non-source files are produced from source -files by programs under the control of the Makefile. - - Naturally, all the source files must be in the distribution. It is -okay to include non-source files in the distribution, provided they are -up-to-date and machine-independent, so that building the distribution -normally will never modify them. We commonly include non-source files -produced by Bison, Lex, TeX, and Makeinfo; this helps avoid unnecessary -dependencies between our distributions, so that users can install -whichever packages they want to install. - - Non-source files that might actually be modified by building and -installing the program should *never* be included in the distribution. -So if you do distribute non-source files, always make sure they are up -to date when you make a new distribution. - - Make sure that the directory into which the distribution unpacks (as -well as any subdirectories) are all world-writable (octal mode 777). -This is so that old versions of `tar' which preserve the ownership and -permissions of the files from the tar archive will be able to extract -all the files even if the user is unprivileged. - - Make sure that all the files in the distribution are world-readable. - - Make sure that no file name in the distribution is more than 14 -characters long. Likewise, no file created by building the program -should have a name longer than 14 characters. The reason for this is -that some systems adhere to a foolish interpretation of the POSIX -standard, and refuse to open a longer name, rather than truncating as -they did in the past. - - Don't include any symbolic links in the distribution itself. If the -tar file contains symbolic links, then people cannot even unpack it on -systems that don't support symbolic links. Also, don't use multiple -names for one file in different directories, because certain file -systems cannot handle this and that prevents unpacking the distribution. - - Try to make sure that all the file names will be unique on MS-DOG. A -name on MS-DOG consists of up to 8 characters, optionally followed by a -period and up to three characters. MS-DOG will truncate extra -characters both before and after the period. Thus, `foobarhacker.c' -and `foobarhacker.o' are not ambiguous; they are truncated to -`foobarha.c' and `foobarha.o', which are distinct. - - Include in your distribution a copy of the `texinfo.tex' you used to -test print any `*.texinfo' files. - - Likewise, if your program uses small GNU software packages like -regex, getopt, obstack, or termcap, include them in the distribution -file. Leaving them out would make the distribution file a little -smaller at the expense of possible inconvenience to a user who doesn't -know what other files to get. - - +Indirect: +standards.info-1: 960 +standards.info-2: 49450  Tag Table: -Node: Top950 -Node: Reading Non-Free Code2051 -Node: Contributions3777 -Node: Change Logs5375 -Node: Compatibility9091 -Node: Makefile Conventions10730 -Node: Makefile Basics11087 -Node: Utilities in Makefiles12978 -Node: Standard Targets14414 -Node: Command Variables21523 -Node: Directory Variables24353 -Node: Configuration30825 -Node: Source Language37849 -Node: Formatting38979 -Node: Comments42269 -Node: Syntactic Conventions45055 -Node: Names47947 -Node: Using Extensions49237 -Node: System Functions50978 -Node: Semantics55781 -Node: Errors58747 -Node: Libraries59950 -Node: Portability61174 -Node: User Interfaces64461 -Node: Documentation79291 -Node: Releases83225 +(Indirect) +Node: Top960 +Node: Preface2096 +Node: Reading Non-Free Code3138 +Node: Contributions4868 +Node: Change Logs6466 +Node: Compatibility10182 +Node: Makefile Conventions11821 +Node: Makefile Basics12178 +Node: Utilities in Makefiles14522 +Node: Standard Targets16219 +Node: Command Variables23328 +Node: Directory Variables26158 +Node: Configuration35220 +Node: Source Language42244 +Node: Formatting43374 +Node: Comments46664 +Node: Syntactic Conventions49450 +Node: Names52342 +Node: Using Extensions53632 +Node: System Functions55373 +Node: Semantics60176 +Node: Errors63464 +Node: Libraries64667 +Node: Portability65891 +Node: User Interfaces69178 +Node: Documentation85106 +Node: Releases89040  End Tag Table diff --git a/src/util/autoconf/standards.info-1 b/src/util/autoconf/standards.info-1 new file mode 100644 index 000000000..05178a025 --- /dev/null +++ b/src/util/autoconf/standards.info-1 @@ -0,0 +1,1188 @@ +This is Info file ../standards.info, produced by Makeinfo-1.55 from the +input file ../standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software +Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + + +File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) + +Version +******* + + Last updated 21 September 1994. + +* Menu: + +* Preface:: About the GNU Coding Standards +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions +* Change Logs:: Recording Changes +* Compatibility:: Compatibility with Other Implementations +* Makefile Conventions:: Makefile Conventions +* Configuration:: How Configuration Should Work +* Source Language:: Using Languages Other Than C +* Formatting:: Formatting Your Source Code +* Comments:: Commenting Your Work +* Syntactic Conventions:: Clean Use of C Constructs +* Names:: Naming Variables and Functions +* Using Extensions:: Using Non-standard Features +* System Functions:: Portability and "standard" library functions +* Semantics:: Program Behavior for All Programs +* Errors:: Formatting Error Messages +* Libraries:: Library Behavior +* Portability:: Portability As It Applies to GNU +* User Interfaces:: Standards for Command Line Interfaces +* Documentation:: Documenting Programs +* Releases:: Making Releases + + +File: standards.info, Node: Preface, Next: Reading Non-Free Code, Prev: Top, Up: Top + +About the GNU Coding Standards +****************************** + + The GNU Coding Standards were written by Richard Stallman and other +GNU Project volunteers. Their purpose is to make the GNU system clean, +consistent, and easy to install. This document can also be read as a +guide to write portable, robust and reliable programs. It focuses on +programs written in C, but many of the rules and principles are useful +even if you write in another programming language. The rules often +state reasons for writing in a certain way. + + Corrections or suggestions regarding this document should be sent to +`gnu@prep.ai.mit.edu'. If you make a suggestion, please include a +suggested new wording for it; our time is limited. We prefer a context +diff to the `standards.texi' or `make-stds.texi' files, but if you +don't have those files, please mail your suggestion anyway. + + This release of the GNU Coding Standards was last updated 21 +September 1994. + + +File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Prev: Preface, Up: Top + +Referring to Proprietary Programs +********************************* + + Don't in any circumstances refer to Unix source code for or during +your work on GNU! (Or to any other proprietary programs.) + + If you have a vague recollection of the internals of a Unix program, +this does not absolutely mean you can't write an imitation of it, but +do try to organize the imitation internally along different lines, +because this is likely to make the details of the Unix version +irrelevant and dissimilar to your results. + + For example, Unix utilities were generally optimized to minimize +memory use; if you go for speed instead, your program will be very +different. You could keep the entire input file in core and scan it +there instead of using stdio. Use a smarter algorithm discovered more +recently than the Unix program. Eliminate use of temporary files. Do +it in one pass instead of two (we did this in the assembler). + + Or, on the contrary, emphasize simplicity instead of speed. For some +applications, the speed of today's computers makes simpler algorithms +adequate. + + Or go for generality. For example, Unix programs often have static +tables or fixed-size strings, which make for arbitrary limits; use +dynamic allocation instead. Make sure your program handles NULs and +other funny characters in the input files. Add a programming language +for extensibility and write part of the program in that language. + + Or turn some parts of the program into independently usable +libraries. Or use a simple garbage collector instead of tracking +precisely when to free memory, or use a new GNU facility such as +obstacks. + + +File: standards.info, Node: Contributions, Next: Change Logs, Prev: Reading Non-Free Code, Up: Top + +Accepting Contributions +*********************** + + If someone else sends you a piece of code to add to the program you +are working on, we need legal papers to use it--the same sort of legal +papers we will need to get from you. *Each* significant contributor to +a program must sign some sort of legal papers in order for us to have +clear title to the program. The main author alone is not enough. + + So, before adding in any contributions from other people, tell us so +we can arrange to get the papers. Then wait until we tell you that we +have received the signed papers, before you actually use the +contribution. + + This applies both before you release the program and afterward. If +you receive diffs to fix a bug, and they make significant change, we +need legal papers for it. + + You don't need papers for changes of a few lines here or there, since +they are not significant for copyright purposes. Also, you don't need +papers if all you get from the suggestion is some ideas, not actual code +which you use. For example, if you write a different solution to the +problem, you don't need to get papers. + + I know this is frustrating; it's frustrating for us as well. But if +you don't wait, you are going out on a limb--for example, what if the +contributor's employer won't sign a disclaimer? You might have to take +that code out again! + + The very worst thing is if you forget to tell us about the other +contributor. We could be very embarrassed in court some day as a +result. + + +File: standards.info, Node: Change Logs, Next: Compatibility, Prev: Contributions, Up: Top + +Change Logs +*********** + + Keep a change log for each directory, describing the changes made to +source files in that directory. The purpose of this is so that people +investigating bugs in the future will know about the changes that might +have introduced the bug. Often a new bug can be found by looking at +what was recently changed. More importantly, change logs can help +eliminate conceptual inconsistencies between different parts of a +program; they can give you a history of how the conflicting concepts +arose. + + Use the Emacs command `M-x add-change' to start a new entry in the +change log. An entry should have an asterisk, the name of the changed +file, and then in parentheses the name of the changed functions, +variables or whatever, followed by a colon. Then describe the changes +you made to that function or variable. + + Separate unrelated entries with blank lines. When two entries +represent parts of the same change, so that they work together, then +don't put blank lines between them. Then you can omit the file name +and the asterisk when successive entries are in the same file. + + Here are some examples: + + * register.el (insert-register): Return nil. + (jump-to-register): Likewise. + + * sort.el (sort-subr): Return nil. + + * tex-mode.el (tex-bibtex-file, tex-file, tex-region): + Restart the tex shell if process is gone or stopped. + (tex-shell-running): New function. + + * expr.c (store_one_arg): Round size up for move_block_to_reg. + (expand_call): Round up when emitting USE insns. + * stmt.c (assign_parms): Round size up for move_block_from_reg. + + It's important to name the changed function or variable in full. +Don't abbreviate them; don't combine them. Subsequent maintainers will +often search for a function name to find all the change log entries that +pertain to it; if you abbreviate the name, they won't find it when they +search. For example, some people are tempted to abbreviate groups of +function names by writing `* register.el ({insert,jump-to}-register)'; +this is not a good idea, since searching for `jump-to-register' or +`insert-register' would not find the entry. + + There's no need to describe the full purpose of the changes or how +they work together. It is better to put such explanations in comments +in the code. That's why just "New function" is enough; there is a +comment with the function in the source to explain what it does. + + However, sometimes it is useful to write one line to describe the +overall purpose of a large batch of changes. + + You can think of the change log as a conceptual "undo list" which +explains how earlier versions were different from the current version. +People can see the current version; they don't need the change log to +tell them what is in it. What they want from a change log is a clear +explanation of how the earlier version differed. + + When you change the calling sequence of a function in a simple +fashion, and you change all the callers of the function, there is no +need to make individual entries for all the callers. Just write in the +entry for the function being called, "All callers changed." + + When you change just comments or doc strings, it is enough to write +an entry for the file, without mentioning the functions. Write just, +"Doc fix." There's no need to keep a change log for documentation +files. This is because documentation is not susceptible to bugs that +are hard to fix. Documentation does not consist of parts that must +interact in a precisely engineered fashion; to correct an error, you +need not know the history of the erroneous passage. + + +File: standards.info, Node: Compatibility, Next: Makefile Conventions, Prev: Change Logs, Up: Top + +Compatibility with Other Implementations +**************************************** + + With certain exceptions, utility programs and libraries for GNU +should be upward compatible with those in Berkeley Unix, and upward +compatible with ANSI C if ANSI C specifies their behavior, and upward +compatible with POSIX if POSIX specifies their behavior. + + When these standards conflict, it is useful to offer compatibility +modes for each of them. + + ANSI C and POSIX prohibit many kinds of extensions. Feel free to +make the extensions anyway, and include a `--ansi' or `--compatible' +option to turn them off. However, if the extension has a significant +chance of breaking any real programs or scripts, then it is not really +upward compatible. Try to redesign its interface. + + Many GNU programs suppress extensions that conflict with POSIX if the +environment variable `POSIXLY_CORRECT' is defined (even if it is +defined with a null value). Please make your program recognize this +variable if appropriate. + + When a feature is used only by users (not by programs or command +files), and it is done poorly in Unix, feel free to replace it +completely with something totally different and better. (For example, +vi is replaced with Emacs.) But it is nice to offer a compatible +feature as well. (There is a free vi clone, so we offer it.) + + Additional useful features not in Berkeley Unix are welcome. +Additional programs with no counterpart in Unix may be useful, but our +first priority is usually to duplicate what Unix already has. + + +File: standards.info, Node: Makefile Conventions, Next: Configuration, Prev: Compatibility, Up: Top + +Makefile Conventions +******************** + + This chapter describes conventions for writing the Makefiles for GNU +programs. + +* Menu: + +* Makefile Basics:: +* Utilities in Makefiles:: +* Standard Targets:: +* Command Variables:: +* Directory Variables:: + + +File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions + +General Conventions for Makefiles +================================= + + Every Makefile should contain this line: + + SHELL = /bin/sh + +to avoid trouble on systems where the `SHELL' variable might be +inherited from the environment. (This is never a problem with GNU +`make'.) + + Different `make' programs have incompatible suffix lists and +implicit rules, and this sometimes creates confusion or misbehavior. So +it is a good idea to set the suffix list explicitly using only the +suffixes you need in the particular Makefile, like this: + + .SUFFIXES: + .SUFFIXES: .c .o + +The first line clears out the suffix list, the second introduces all +suffixes which may be subject to implicit rules in this Makefile. + + Don't assume that `.' is in the path for command execution. When +you need to run programs that are a part of your package during the +make, please make sure that it uses `./' if the program is built as +part of the make or `$(srcdir)/' if the file is an unchanging part of +the source code. Without one of these prefixes, the current search +path is used. + + The distinction between `./' and `$(srcdir)/' is important when +using the `--srcdir' option to `configure'. A rule of the form: + + foo.1 : foo.man sedscript + sed -e sedscript foo.man > foo.1 + +will fail when the current directory is not the source directory, +because `foo.man' and `sedscript' are not in the current directory. + + When using GNU `make', relying on `VPATH' to find the source file +will work in the case where there is a single dependency file, since +the `make' automatic variable `$<' will represent the source file +wherever it is. (Many versions of `make' set `$<' only in implicit +rules.) A makefile target like + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o + +should instead be written as + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ + +in order to allow `VPATH' to work correctly. When the target has +multiple dependencies, using an explicit `$(srcdir)' is the easiest way +to make the rule work well. For example, the target above for `foo.1' +is best written as: + + foo.1 : foo.man sedscript + sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ + + +File: standards.info, Node: Utilities in Makefiles, Next: Standard Targets, Prev: Makefile Basics, Up: Makefile Conventions + +Utilities in Makefiles +====================== + + Write the Makefile commands (and any shell scripts, such as +`configure') to run in `sh', not in `csh'. Don't use any special +features of `ksh' or `bash'. + + The `configure' script and the Makefile rules for building and +installation should not use any utilities directly except these: + + cat cmp cp echo egrep expr grep + ln mkdir mv pwd rm rmdir sed test touch + + Stick to the generally supported options for these programs. For +example, don't use `mkdir -p', convenient as it may be, because most +systems don't support it. + + The Makefile rules for building and installation can also use +compilers and related programs, but should do so via `make' variables +so that the user can substitute alternatives. Here are some of the +programs we mean: + + ar bison cc flex install ld lex + make makeinfo ranlib texi2dvi yacc + + Use the following `make' variables: + + $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) + $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) + + When you use `ranlib', you should make sure nothing bad happens if +the system does not have `ranlib'. Arrange to ignore an error from +that command, and print a message before the command to tell the user +that failure of the `ranlib' command does not mean a problem. + + If you use symbolic links, you should implement a fallback for +systems that don't have symbolic links. + + It is ok to use other utilities in Makefile portions (or scripts) +intended only for particular systems where you know those utilities to +exist. + + +File: standards.info, Node: Standard Targets, Next: Command Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions + +Standard Targets for Users +========================== + + All GNU programs should have the following targets in their +Makefiles: + +`all' + Compile the entire program. This should be the default target. + This target need not rebuild any documentation files; Info files + should normally be included in the distribution, and DVI files + should be made only when explicitly asked for. + +`install' + Compile the program and copy the executables, libraries, and so on + to the file names where they should reside for actual use. If + there is a simple test to verify that a program is properly + installed, this target should run that test. + + The commands should create all the directories in which files are + to be installed, if they don't already exist. This includes the + directories specified as the values of the variables `prefix' and + `exec_prefix', as well as all subdirectories that are needed. One + way to do this is by means of an `installdirs' target as described + below. + + Use `-' before any command for installing a man page, so that + `make' will ignore any errors. This is in case there are systems + that don't have the Unix man page documentation system installed. + + The way to install Info files is to copy them into `$(infodir)' + with `$(INSTALL_DATA)' (*note Command Variables::.), and then run + the `install-info' program if it is present. `install-info' is a + script that edits the Info `dir' file to add or update the menu + entry for the given Info file; it will be part of the Texinfo + package. Here is a sample rule to install an Info file: + + $(infodir)/foo.info: foo.info + # There may be a newer info file in . than in srcdir. + -if test -f foo.info; then d=.; \ + else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/foo.info $@; \ + # Run install-info only if it exists. + # Use `if' instead of just prepending `-' to the + # line so we notice real errors from install-info. + # We use `$(SHELL) -c' because some shells do not + # fail gracefully when there is an unknown command. + if $(SHELL) -c 'install-info --version' \ + >/dev/null 2>&1; then \ + install-info --infodir=$(infodir) $$d/foo.info; \ + else true; fi + +`uninstall' + Delete all the installed files that the `install' target would + create (but not the noninstalled files such as `make all' would + create). + +`clean' + Delete all files from the current directory that are normally + created by building the program. Don't delete the files that + record the configuration. Also preserve files that could be made + by building, but normally aren't because the distribution comes + with them. + + Delete `.dvi' files here if they are not part of the distribution. + +`distclean' + Delete all files from the current directory that are created by + configuring or building the program. If you have unpacked the + source and built the program without creating any other files, + `make distclean' should leave only the files that were in the + distribution. + +`mostlyclean' + Like `clean', but may refrain from deleting a few files that people + normally don't want to recompile. For example, the `mostlyclean' + target for GCC does not delete `libgcc.a', because recompiling it + is rarely necessary and takes a lot of time. + +`realclean' + Delete everything from the current directory that can be + reconstructed with this Makefile. This typically includes + everything deleted by `distclean', plus more: C source files + produced by Bison, tags tables, Info files, and so on. + + One exception, however: `make realclean' should not delete + `configure' even if `configure' can be remade using a rule in the + Makefile. More generally, `make realclean' should not delete + anything that needs to exist in order to run `configure' and then + begin to build the program. + +`TAGS' + Update a tags table for this program. + +`info' + Generate any Info files needed. The best way to write the rules + is as follows: + + info: foo.info + + foo.info: foo.texi chap1.texi chap2.texi + $(MAKEINFO) $(srcdir)/foo.texi + + You must define the variable `MAKEINFO' in the Makefile. It should + run the `makeinfo' program, which is part of the Texinfo + distribution. + +`dvi' + Generate DVI files for all TeXinfo documentation. For example: + + dvi: foo.dvi + + foo.dvi: foo.texi chap1.texi chap2.texi + $(TEXI2DVI) $(srcdir)/foo.texi + + You must define the variable `TEXI2DVI' in the Makefile. It should + run the program `texi2dvi', which is part of the Texinfo + distribution. Alternatively, write just the dependencies, and + allow GNU Make to provide the command. + +`dist' + Create a distribution tar file for this program. The tar file + should be set up so that the file names in the tar file start with + a subdirectory name which is the name of the package it is a + distribution for. This name can include the version number. + + For example, the distribution tar file of GCC version 1.40 unpacks + into a subdirectory named `gcc-1.40'. + + The easiest way to do this is to create a subdirectory + appropriately named, use `ln' or `cp' to install the proper files + in it, and then `tar' that subdirectory. + + The `dist' target should explicitly depend on all non-source files + that are in the distribution, to make sure they are up to date in + the distribution. *Note Making Releases: (standards)Releases. + +`check' + Perform self-tests (if any). The user must build the program + before running the tests, but need not install the program; you + should write the self-tests so that they work when the program is + built but not installed. + + The following targets are suggested as conventional names, for +programs in which they are useful. + +`installcheck' + Perform installation tests (if any). The user must build and + install the program before running the tests. You should not + assume that `$(bindir)' is in the search path. + +`installdirs' + It's useful to add a target named `installdirs' to create the + directories where files are installed, and their parent + directories. There is a script called `mkinstalldirs' which is + convenient for this; find it in the Texinfo package.You can use a + rule like this: + + # Make sure all installation directories (e.g. $(bindir)) + # actually exist by making them if necessary. + installdirs: mkinstalldirs + $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ + $(libdir) $(infodir) \ + $(mandir) + + +File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Standard Targets, Up: Makefile Conventions + +Variables for Specifying Commands +================================= + + Makefiles should provide variables for overriding certain commands, +options, and so on. + + In particular, you should run most utility programs via variables. +Thus, if you use Bison, have a variable named `BISON' whose default +value is set with `BISON = bison', and refer to it with `$(BISON)' +whenever you need to use Bison. + + File management utilities such as `ln', `rm', `mv', and so on, need +not be referred to through variables in this way, since users don't +need to replace them with other programs. + + Each program-name variable should come with an options variable that +is used to supply options to the program. Append `FLAGS' to the +program-name variable name to get the options variable name--for +example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this +rule, but we keep it because it is standard.) Use `CPPFLAGS' in any +compilation command that runs the preprocessor, and use `LDFLAGS' in +any compilation command that does linking as well as in any direct use +of `ld'. + + If there are C compiler options that *must* be used for proper +compilation of certain files, do not include them in `CFLAGS'. Users +expect to be able to specify `CFLAGS' freely themselves. Instead, +arrange to pass the necessary options to the C compiler independently +of `CFLAGS', by writing them explicitly in the compilation commands or +by defining an implicit rule, like this: + + CFLAGS = -g + ALL_CFLAGS = -I. $(CFLAGS) + .c.o: + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< + + Do include the `-g' option in `CFLAGS', because that is not +*required* for proper compilation. You can consider it a default that +is only recommended. If the package is set up so that it is compiled +with GCC by default, then you might as well include `-O' in the default +value of `CFLAGS' as well. + + Put `CFLAGS' last in the compilation command, after other variables +containing compiler options, so the user can use `CFLAGS' to override +the others. + + Every Makefile should define the variable `INSTALL', which is the +basic command for installing a file into the system. + + Every Makefile should also define the variables `INSTALL_PROGRAM' +and `INSTALL_DATA'. (The default for each of these should be +`$(INSTALL)'.) Then it should use those variables as the commands for +actual installation, for executables and nonexecutables respectively. +Use these variables as follows: + + $(INSTALL_PROGRAM) foo $(bindir)/foo + $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a + +Always use a file name, not a directory name, as the second argument of +the installation commands. Use a separate command for each file to be +installed. + + +File: standards.info, Node: Directory Variables, Prev: Command Variables, Up: Makefile Conventions + +Variables for Installation Directories +====================================== + + Installation directories should always be named by variables, so it +is easy to install in a nonstandard place. The standard names for these +variables are as follows. + + These two variables set the root for the installation. All the other +installation directories should be subdirectories of one of these two, +and nothing should be directly installed into these two directories. + +`prefix' + A prefix used in constructing the default values of the variables + listed below. The default value of `prefix' should be `/usr/local' + (at least for now). + +`exec_prefix' + A prefix used in constructing the default values of some of the + variables listed below. The default value of `exec_prefix' should + be `$(prefix)'. + + Generally, `$(exec_prefix)' is used for directories that contain + machine-specific files (such as executables and subroutine + libraries), while `$(prefix)' is used directly for other + directories. + + Executable programs are installed in one of the following +directories. + +`bindir' + The directory for installing executable programs that users can + run. This should normally be `/usr/local/bin', but write it as + `$(exec_prefix)/bin'. + +`sbindir' + The directory for installing executable programs that can be run + from the shell, but are only generally useful to system + administrators. This should normally be `/usr/local/sbin', but + write it as `$(exec_prefix)/sbin'. + +`libexecdir' + The directory for installing executable programs to be run by other + programs rather than by users. This directory should normally be + `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. + + Data files used by the program during its execution are divided into +categories in two ways. + + * Some files are normally modified by programs; others are never + normally modified (though users may edit some of these). + + * Some files are architecture-independent and can be shared by all + machines at a site; some are architecture-dependent and can be + shared only by machines of the same kind and operating system; + others may never be shared between two machines. + + This makes for six different possibilities. However, we want to +discourage the use of architecture-dependent files, aside from of object +files and libraries. It is much cleaner to make other data files +architecture-independent, and it is generally not hard. + + Therefore, here are the variables makefiles should use to specify +directories: + +`datadir' + The directory for installing read-only architecture independent + data files. This should normally be `/usr/local/share', but write + it as `$(prefix)/share'. As a special exception, see `$(infodir)' + and `$(includedir)' below. + +`sysconfdir' + The directory for installing read-only data files that pertain to a + single machine-that is to say, files for configuring a host. + Mailer and network configuration files, `/etc/passwd', and so + forth belong here. All the files in this directory should be + ordinary ASCII text files. This directory should normally be + `/usr/local/etc', but write it as `$(prefix)/etc'. + + Do not install executables in this directory (they probably belong + in `$(libexecdir)' or `$(sbindir))'. Also do not install files + that are modified in the normal course of their use (programs + whose purpose is to change the configuration of the system + excluded). Those probably belong in `$(localstatedir)'. + +`sharedstatedir' + The directory for installing architecture-independent data files + which the programs modify while they run. This should normally be + `/usr/local/com', but write it as `$(prefix)/com'. + +`localstatedir' + The directory for installing data files which the programs modify + while they run, and that pertain to one specific machine. Users + should never need to modify files in this directory to configure + the package's operation; put such configuration information in + separate files that go in `datadir' or `$(sysconfdir)'. + `$(localstatedir)' should normally be `/usr/local/var', but write + it as `$(prefix)/var'. + +`libdir' + The directory for object files and libraries of object code. Do + not install executables here, they probably belong in + `$(libexecdir)' instead. The value of `libdir' should normally be + `/usr/local/lib', but write it as `$(exec_prefix)/lib'. + +`infodir' + The directory for installing the Info files for this package. By + default, it should be `/usr/local/info', but it should be written + as `$(prefix)/info'. + +`includedir' + The directory for installing header files to be included by user + programs with the C `#include' preprocessor directive. This + should normally be `/usr/local/include', but write it as + `$(prefix)/include'. + + Most compilers other than GCC do not look for header files in + `/usr/local/include'. So installing the header files this way is + only useful with GCC. Sometimes this is not a problem because some + libraries are only really intended to work with GCC. But some + libraries are intended to work with other compilers. They should + install their header files in two places, one specified by + `includedir' and one specified by `oldincludedir'. + +`oldincludedir' + The directory for installing `#include' header files for use with + compilers other than GCC. This should normally be `/usr/include'. + + The Makefile commands should check whether the value of + `oldincludedir' is empty. If it is, they should not try to use + it; they should cancel the second installation of the header files. + + A package should not replace an existing header in this directory + unless the header came from the same package. Thus, if your Foo + package provides a header file `foo.h', then it should install the + header file in the `oldincludedir' directory if either (1) there + is no `foo.h' there or (2) the `foo.h' that exists came from the + Foo package. + + To tell whether `foo.h' came from the Foo package, put a magic + string in the file--part of a comment--and grep for that string. + + Unix-style man pages are installed in one of the following: + +`mandir' + The directory for installing the man pages (if any) for this + package. It should include the suffix for the proper section of + the manual--usually `1' for a utility. It will normally be + `/usr/local/man/man1', but you should write it as + `$(prefix)/man/man1'. + +`man1dir' + The directory for installing section 1 man pages. + +`man2dir' + The directory for installing section 2 man pages. + +`...' + Use these names instead of `mandir' if the package needs to + install man pages in more than one section of the manual. + + *Don't make the primary documentation for any GNU software be a + man page. Write a manual in Texinfo instead. Man pages are just + for the sake of people running GNU software on Unix, which is a + secondary application only.* + +`manext' + The file name extension for the installed man page. This should + contain a period followed by the appropriate digit; it should + normally be `.1'. + +`man1ext' + The file name extension for installed section 1 man pages. + +`man2ext' + The file name extension for installed section 2 man pages. + +`...' + Use these names instead of `manext' if the package needs to + install man pages in more than one section of the manual. + + And finally, you should set the following variable: + +`srcdir' + The directory for the sources being compiled. The value of this + variable is normally inserted by the `configure' shell script. + + For example: + + # Common prefix for installation directories. + # NOTE: This directory must exist when you start the install. + prefix = /usr/local + exec_prefix = $(prefix) + # Where to put the executable for the command `gcc'. + bindir = $(exec_prefix)/bin + # Where to put the directories used by the compiler. + libexecdir = $(exec_prefix)/libexec + # Where to put the Info files. + infodir = $(prefix)/info + + If your program installs a large number of files into one of the +standard user-specified directories, it might be useful to group them +into a subdirectory particular to that program. If you do this, you +should write the `install' rule to create these subdirectories. + + Do not expect the user to include the subdirectory name in the value +of any of the variables listed above. The idea of having a uniform set +of variable names for installation directories is to enable the user to +specify the exact same values for several different GNU packages. In +order for this to be useful, all the packages must be designed so that +they will work sensibly when the user does so. + + +File: standards.info, Node: Configuration, Next: Source Language, Prev: Makefile Conventions, Up: Top + +How Configuration Should Work +***************************** + + Each GNU distribution should come with a shell script named +`configure'. This script is given arguments which describe the kind of +machine and system you want to compile the program for. + + The `configure' script must record the configuration options so that +they affect compilation. + + One way to do this is to make a link from a standard name such as +`config.h' to the proper configuration file for the chosen system. If +you use this technique, the distribution should *not* contain a file +named `config.h'. This is so that people won't be able to build the +program without configuring it first. + + Another thing that `configure' can do is to edit the Makefile. If +you do this, the distribution should *not* contain a file named +`Makefile'. Instead, include a file `Makefile.in' which contains the +input used for editing. Once again, this is so that people won't be +able to build the program without configuring it first. + + If `configure' does write the `Makefile', then `Makefile' should +have a target named `Makefile' which causes `configure' to be rerun, +setting up the same configuration that was set up last time. The files +that `configure' reads should be listed as dependencies of `Makefile'. + + All the files which are output from the `configure' script should +have comments at the beginning explaining that they were generated +automatically using `configure'. This is so that users won't think of +trying to edit them by hand. + + The `configure' script should write a file named `config.status' +which describes which configuration options were specified when the +program was last configured. This file should be a shell script which, +if run, will recreate the same configuration. + + The `configure' script should accept an option of the form +`--srcdir=DIRNAME' to specify the directory where sources are found (if +it is not the current directory). This makes it possible to build the +program in a separate directory, so that the actual source directory is +not modified. + + If the user does not specify `--srcdir', then `configure' should +check both `.' and `..' to see if it can find the sources. If it finds +the sources in one of these places, it should use them from there. +Otherwise, it should report that it cannot find the sources, and should +exit with nonzero status. + + Usually the easy way to support `--srcdir' is by editing a +definition of `VPATH' into the Makefile. Some rules may need to refer +explicitly to the specified source directory. To make this possible, +`configure' can add to the Makefile a variable named `srcdir' whose +value is precisely the specified directory. + + The `configure' script should also take an argument which specifies +the type of system to build the program for. This argument should look +like this: + + CPU-COMPANY-SYSTEM + + For example, a Sun 3 might be `m68k-sun-sunos4.1'. + + The `configure' script needs to be able to decode all plausible +alternatives for how to describe a machine. Thus, `sun3-sunos4.1' +would be a valid alias. So would `sun3-bsd4.2', since SunOS is +basically BSD and no other BSD system is used on a Sun. For many +programs, `vax-dec-ultrix' would be an alias for `vax-dec-bsd', simply +because the differences between Ultrix and BSD are rarely noticeable, +but a few programs might need to distinguish them. + + There is a shell script called `config.sub' that you can use as a +subroutine to validate system types and canonicalize aliases. + + Other options are permitted to specify in more detail the software +or hardware present on the machine, and include or exclude optional +parts of the package: + +`--enable-FEATURE[=PARAMETER]' + Configure the package to build and install an optional user-level + facility called FEATURE. This allows users to choose which + optional features to include. Giving an optional PARAMETER of + `no' should omit FEATURE, if it is built by default. + + No `--enable' option should *ever* cause one feature to replace + another. No `--enable' option should ever substitute one useful + behavior for another useful behavior. The only proper use for + `--enable' is for questions of whether to build part of the program + or exclude it. + +`--with-PACKAGE' + The package PACKAGE will be installed, so configure this package + to work with PACKAGE. + + Possible values of PACKAGE include `x', `x-toolkit', `gnu-as' (or + `gas'), `gnu-ld', `gnu-libc', and `gdb'. + + Do not use a `--with' option to specify the file name to use to + find certain files. That is outside the scope of what `--with' + options are for. + +`--nfp' + The target machine has no floating point processor. + +`--gas' + The target machine assembler is GAS, the GNU assembler. This is + obsolete; users should use `--with-gnu-as' instead. + +`--x' + The target machine has the X Window System installed. This is + obsolete; users should use `--with-x' instead. + + All `configure' scripts should accept all of these "detail" options, +whether or not they make any difference to the particular package at +hand. In particular, they should accept any option that starts with +`--with-' or `--enable-'. This is so users will be able to configure +an entire GNU source tree at once with a single set of options. + + You will note that the categories `--with-' and `--enable-' are +narrow: they *do not* provide a place for any sort of option you might +think of. That is deliberate. We want to limit the possible +configuration options in GNU software. We do not want GNU programs to +have idiosyncratic configuration options. + + Packages that perform part of compilation may support +cross-compilation. In such a case, the host and target machines for +the program may be different. The `configure' script should normally +treat the specified type of system as both the host and the target, +thus producing a program which works for the same type of machine that +it runs on. + + The way to build a cross-compiler, cross-assembler, or what have +you, is to specify the option `--host=HOSTTYPE' when running +`configure'. This specifies the host system without changing the type +of target system. The syntax for HOSTTYPE is the same as described +above. + + Bootstrapping a cross-compiler requires compiling it on a machine +other than the host it will run on. Compilation packages accept a +configuration option `--build=HOSTTYPE' for specifying the +configuration on which you will compile them, in case that is different +from the host. + + Programs for which cross-operation is not meaningful need not accept +the `--host' option, because configuring an entire operating system for +cross-operation is not a meaningful thing. + + Some programs have ways of configuring themselves automatically. If +your program is set up to do this, your `configure' script can simply +ignore most of its arguments. + + +File: standards.info, Node: Source Language, Next: Formatting, Prev: Configuration, Up: Top + +Using Languages Other Than C +**************************** + + Using a language other than C is like using a non-standard feature: +it will cause trouble for users. Even if GCC supports the other +language, users may find it inconvenient to have to install the +compiler for that other language in order to build your program. So +please write in C. + + There are three exceptions for this rule: + + * It is okay to use a special language if the same program contains + an interpreter for that language. + + Thus, it is not a problem that GNU Emacs contains code written in + Emacs Lisp, because it comes with a Lisp interpreter. + + * It is okay to use another language in a tool specifically intended + for use with that language. + + This is okay because the only people who want to build the tool + will be those who have installed the other language anyway. + + * If an application is not of extremely widespread interest, then + perhaps it's not important if the application is inconvenient to + install. + + +File: standards.info, Node: Formatting, Next: Comments, Prev: Source Language, Up: Top + +Formatting Your Source Code +*************************** + + It is important to put the open-brace that starts the body of a C +function in column zero, and avoid putting any other open-brace or +open-parenthesis or open-bracket in column zero. Several tools look +for open-braces in column zero to find the beginnings of C functions. +These tools will not work on code not formatted that way. + + It is also important for function definitions to start the name of +the function in column zero. This helps people to search for function +definitions, and may also help certain tools recognize them. Thus, the +proper format is this: + + static char * + concat (s1, s2) /* Name starts in column zero here */ + char *s1, *s2; + { /* Open brace in column zero here */ + ... + } + +or, if you want to use ANSI C, format the definition like this: + + static char * + concat (char *s1, char *s2) + { + ... + } + + In ANSI C, if the arguments don't fit nicely on one line, split it +like this: + + int + lots_of_args (int an_integer, long a_long, short a_short, + double a_double, float a_float) + ... + + For the body of the function, we prefer code formatted like this: + + if (x < foo (y, z)) + haha = bar[4] + 5; + else + { + while (z) + { + haha += foo (z, z); + z--; + } + return ++x + bar (); + } + + We find it easier to read a program when it has spaces before the +open-parentheses and after the commas. Especially after the commas. + + When you split an expression into multiple lines, split it before an +operator, not after one. Here is the right way: + + if (foo_this_is_long && bar > win (x, y, z) + && remaining_condition) + + Try to avoid having two operators of different precedence at the same +level of indentation. For example, don't write this: + + mode = (inmode[j] == VOIDmode + || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) + ? outmode[j] : inmode[j]); + + Instead, use extra parentheses so that the indentation shows the +nesting: + + mode = ((inmode[j] == VOIDmode + || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) + ? outmode[j] : inmode[j]); + + Insert extra parentheses so that Emacs will indent the code properly. +For example, the following indentation looks nice if you do it by hand, +but Emacs would mess it up: + + v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; + + But adding a set of parentheses solves the problem: + + v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); + + Format do-while statements like this: + + do + { + a = foo (a); + } + while (a > 0); + + Please use formfeed characters (control-L) to divide the program into +pages at logical places (but not within a function). It does not matter +just how long the pages are, since they do not have to fit on a printed +page. The formfeeds should appear alone on lines by themselves. + + +File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Top + +Commenting Your Work +******************** + + Every program should start with a comment saying briefly what it is +for. Example: `fmt - filter for simple filling of text'. + + Please put a comment on each function saying what the function does, +what sorts of arguments it gets, and what the possible values of +arguments mean and are used for. It is not necessary to duplicate in +words the meaning of the C argument declarations, if a C type is being +used in its customary fashion. If there is anything nonstandard about +its use (such as an argument of type `char *' which is really the +address of the second character of a string, not the first), or any +possible values that would not work the way one would expect (such as, +that strings containing newlines are not guaranteed to work), be sure +to say so. + + Also explain the significance of the return value, if there is one. + + Please put two spaces after the end of a sentence in your comments, +so that the Emacs sentence commands will work. Also, please write +complete sentences and capitalize the first word. If a lower-case +identifer comes at the beginning of a sentence, don't capitalize it! +Changing the spelling makes it a different identifier. If you don't +like starting a sentence with a lower case letter, write the sentence +differently (e.g., "The identifier lower-case is ..."). + + The comment on a function is much clearer if you use the argument +names to speak about the argument values. The variable name itself +should be lower case, but write it in upper case when you are speaking +about the value rather than the variable itself. Thus, "the inode +number NODE_NUM" rather than "an inode". + + There is usually no purpose in restating the name of the function in +the comment before it, because the reader can see that for himself. +There might be an exception when the comment is so long that the +function itself would be off the bottom of the screen. + + There should be a comment on each static variable as well, like this: + + /* Nonzero means truncate lines in the display; + zero means continue them. */ + int truncate_lines; + + Every `#endif' should have a comment, except in the case of short +conditionals (just a few lines) that are not nested. The comment should +state the condition of the conditional that is ending, *including its +sense*. `#else' should have a comment describing the condition *and +sense* of the code that follows. For example: + + #ifdef foo + ... + #else /* not foo */ + ... + #endif /* not foo */ + +but, by contrast, write the comments this way for a `#ifndef': + + #ifndef foo + ... + #else /* foo */ + ... + #endif /* foo */ + diff --git a/src/util/autoconf/standards.info-2 b/src/util/autoconf/standards.info-2 new file mode 100644 index 000000000..25570a041 --- /dev/null +++ b/src/util/autoconf/standards.info-2 @@ -0,0 +1,1691 @@ +This is Info file ../standards.info, produced by Makeinfo-1.55 from the +input file ../standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software +Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + + +File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Top + +Clean Use of C Constructs +************************* + + Please explicitly declare all arguments to functions. Don't omit +them just because they are `int's. + + Declarations of external functions and functions to appear later in +the source file should all go in one place near the beginning of the +file (somewhere before the first function definition in the file), or +else should go in a header file. Don't put `extern' declarations inside +functions. + + It used to be common practice to use the same local variables (with +names like `tem') over and over for different values within one +function. Instead of doing this, it is better declare a separate local +variable for each distinct purpose, and give it a name which is +meaningful. This not only makes programs easier to understand, it also +facilitates optimization by good compilers. You can also move the +declaration of each local variable into the smallest scope that includes +all its uses. This makes the program even cleaner. + + Don't use local variables or parameters that shadow global +identifiers. + + Don't declare multiple variables in one declaration that spans lines. +Start a new declaration on each line, instead. For example, instead of +this: + + int foo, + bar; + +write either this: + + int foo, bar; + +or this: + + int foo; + int bar; + +(If they are global variables, each should have a comment preceding it +anyway.) + + When you have an `if'-`else' statement nested in another `if' +statement, always put braces around the `if'-`else'. Thus, never write +like this: + + if (foo) + if (bar) + win (); + else + lose (); + +always like this: + + if (foo) + { + if (bar) + win (); + else + lose (); + } + + If you have an `if' statement nested inside of an `else' statement, +either write `else if' on one line, like this, + + if (foo) + ... + else if (bar) + ... + +with its `then'-part indented like the preceding `then'-part, or write +the nested `if' within braces like this: + + if (foo) + ... + else + { + if (bar) + ... + } + + Don't declare both a structure tag and variables or typedefs in the +same declaration. Instead, declare the structure tag separately and +then use it to declare the variables or typedefs. + + Try to avoid assignments inside `if'-conditions. For example, don't +write this: + + if ((foo = (char *) malloc (sizeof *foo)) == 0) + fatal ("virtual memory exhausted"); + +instead, write this: + + foo = (char *) malloc (sizeof *foo); + if (foo == 0) + fatal ("virtual memory exhausted"); + + Don't make the program ugly to placate `lint'. Please don't insert +any casts to `void'. Zero without a cast is perfectly fine as a null +pointer constant. + + +File: standards.info, Node: Names, Next: Using Extensions, Prev: Syntactic Conventions, Up: Top + +Naming Variables and Functions +****************************** + + Please use underscores to separate words in a name, so that the Emacs +word commands can be useful within them. Stick to lower case; reserve +upper case for macros and `enum' constants, and for name-prefixes that +follow a uniform convention. + + For example, you should use names like `ignore_space_change_flag'; +don't use names like `iCantReadThis'. + + Variables that indicate whether command-line options have been +specified should be named after the meaning of the option, not after +the option-letter. A comment should state both the exact meaning of +the option and its letter. For example, + + /* Ignore changes in horizontal whitespace (-b). */ + int ignore_space_change_flag; + + When you want to define names with constant integer values, use +`enum' rather than `#define'. GDB knows about enumeration constants. + + Use file names of 14 characters or less, to avoid creating gratuitous +problems on System V. You can use the program `doschk' to test for +this. `doschk' also tests for potential name conflicts if the files +were loaded onto an MS-DOS file system--something you may or may not +care about. + + +File: standards.info, Node: Using Extensions, Next: System Functions, Prev: Names, Up: Top + +Using Non-standard Features +*************************** + + Many GNU facilities that already exist support a number of convenient +extensions over the comparable Unix facilities. Whether to use these +extensions in implementing your program is a difficult question. + + On the one hand, using the extensions can make a cleaner program. +On the other hand, people will not be able to build the program unless +the other GNU tools are available. This might cause the program to +work on fewer kinds of machines. + + With some extensions, it might be easy to provide both alternatives. +For example, you can define functions with a "keyword" `INLINE' and +define that as a macro to expand into either `inline' or nothing, +depending on the compiler. + + In general, perhaps it is best not to use the extensions if you can +straightforwardly do without them, but to use the extensions if they +are a big improvement. + + An exception to this rule are the large, established programs (such +as Emacs) which run on a great variety of systems. Such programs would +be broken by use of GNU extensions. + + Another exception is for programs that are used as part of +compilation: anything that must be compiled with other compilers in +order to bootstrap the GNU compilation facilities. If these require +the GNU compiler, then no one can compile them without having them +installed already. That would be no good. + + Since most computer systems do not yet implement ANSI C, using the +ANSI C features is effectively using a GNU extension, so the same +considerations apply. (Except for ANSI features that we discourage, +such as trigraphs--don't ever use them.) + + +File: standards.info, Node: System Functions, Next: Semantics, Prev: Using Extensions, Up: Top + +Calling System Functions +************************ + + C implementations differ substantially. ANSI C reduces but does not +eliminate the incompatibilities; meanwhile, many users wish to compile +GNU software with pre-ANSI compilers. This chapter gives +recommendations for how to use the more or less standard C library +functions to avoid unnecessary loss of portability. + + * Don't use the value of `sprintf'. It returns the number of + characters written on some systems, but not on all systems. + + * Don't declare system functions explicitly. + + Almost any declaration for a system function is wrong on some + system. To minimize conflicts, leave it to the system header + files to declare system functions. If the headers don't declare a + function, let it remain undeclared. + + While it may seem unclean to use a function without declaring it, + in practice this works fine for most system library functions on + the systems where this really happens. The problem is only + theoretical. By contrast, actual declarations have frequently + caused actual conflicts. + + * If you must declare a system function, don't specify the argument + types. Use an old-style declaration, not an ANSI prototype. The + more you specify about the function, the more likely a conflict. + + * In particular, don't unconditionally declare `malloc' or `realloc'. + + Most GNU programs use those functions just once, in functions + conventionally named `xmalloc' and `xrealloc'. These functions + call `malloc' and `realloc', respectively, and check the results. + + Because `xmalloc' and `xrealloc' are defined in your program, you + can declare them in other files without any risk of type conflict. + + On most systems, `int' is the same length as a pointer; thus, the + calls to `malloc' and `realloc' work fine. For the few + exceptional systems (mostly 64-bit machines), you can use + *conditionalized* declarations of `malloc' and `realloc'--or put + these declarations in configuration files specific to those + systems. + + * The string functions require special treatment. Some Unix systems + have a header file `string.h'; other have `strings.h'. Neither + file name is portable. There are two things you can do: use + Autoconf to figure out which file to include, or don't include + either file. + + * If you don't include either strings file, you can't get + declarations for the string functions from the header file in the + usual way. + + That causes less of a problem than you might think. The newer ANSI + string functions are off-limits anyway because many systems still + don't support them. The string functions you can use are these: + + strcpy strncpy strcat strncat + strlen strcmp strncmp + strchr strrchr + + The copy and concatenate functions work fine without a declaration + as long as you don't use their values. Using their values without + a declaration fails on systems where the width of a pointer + differs from the width of `int', and perhaps in other cases. It + is trivial to avoid using their values, so do that. + + The compare functions and `strlen' work fine without a declaration + on most systems, possibly all the ones that GNU software runs on. + You may find it necessary to declare them *conditionally* on a few + systems. + + The search functions must be declared to return `char *'. Luckily, + there is no variation in the data type they return. But there is + variation in their names. Some systems give these functions the + names `index' and `rindex'; other systems use the names `strchr' + and `strrchr'. Some systems support both pairs of names, but + neither pair works on all systems. + + You should pick a single pair of names and use it throughout your + program. (Nowadays, it is better to choose `strchr' and + `strrchr'.) Declare both of those names as functions returning + `char *'. On systems which don't support those names, define them + as macros in terms of the other pair. For example, here is what + to put at the beginning of your file (or in a header) if you want + to use the names `strchr' and `strrchr' throughout: + + #ifndef HAVE_STRCHR + #define strchr index + #endif + #ifndef HAVE_STRRCHR + #define strrchr rindex + #endif + + char *strchr (); + char *strrchr (); + + Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros +defined in systems where the corresponding functions exist. One way to +get them properly defined is to use Autoconf. + + +File: standards.info, Node: Semantics, Next: Errors, Prev: System Functions, Up: Top + +Program Behavior for All Programs +********************************* + + Avoid arbitrary limits on the length or number of *any* data +structure, including filenames, lines, files, and symbols, by allocating +all data structures dynamically. In most Unix utilities, "long lines +are silently truncated". This is not acceptable in a GNU utility. + + Utilities reading files should not drop NUL characters, or any other +nonprinting characters *including those with codes above 0177*. The +only sensible exceptions would be utilities specifically intended for +interface to certain types of printers that can't handle those +characters. + + Check every system call for an error return, unless you know you +wish to ignore errors. Include the system error text (from `perror' or +equivalent) in *every* error message resulting from a failing system +call, as well as the name of the file if any and the name of the +utility. Just "cannot open foo.c" or "stat failed" is not sufficient. + + Check every call to `malloc' or `realloc' to see if it returned +zero. Check `realloc' even if you are making the block smaller; in a +system that rounds block sizes to a power of 2, `realloc' may get a +different block if you ask for less space. + + In Unix, `realloc' can destroy the storage block if it returns zero. +GNU `realloc' does not have this bug: if it fails, the original block +is unchanged. Feel free to assume the bug is fixed. If you wish to +run your program on Unix, and wish to avoid lossage in this case, you +can use the GNU `malloc'. + + You must expect `free' to alter the contents of the block that was +freed. Anything you want to fetch from the block, you must fetch before +calling `free'. + + If `malloc' fails in a noninteractive program, make that a fatal +error. In an interactive program (one that reads commands from the +user), it is better to abort the command and return to the command +reader loop. This allows the user to kill other processes to free up +virtual memory, and then try the command again. + + Use `getopt_long' to decode arguments, unless the argument syntax +makes this unreasonable. + + When static storage is to be written in during program execution, use +explicit C code to initialize it. Reserve C initialized declarations +for data that will not be changed. + + Try to avoid low-level interfaces to obscure Unix data structures +(such as file directories, utmp, or the layout of kernel memory), since +these are less likely to work compatibly. If you need to find all the +files in a directory, use `readdir' or some other high-level interface. +These will be supported compatibly by GNU. + + By default, the GNU system will provide the signal handling +functions of BSD and of POSIX. So GNU software should be written to use +these. + + In error checks that detect "impossible" conditions, just abort. +There is usually no point in printing any message. These checks +indicate the existence of bugs. Whoever wants to fix the bugs will have +to read the source code and run a debugger. So explain the problem with +comments in the source. The relevant data will be in variables, which +are easy to examine with the debugger, so there is no point moving them +elsewhere. + + +File: standards.info, Node: Errors, Next: Libraries, Prev: Semantics, Up: Top + +Formatting Error Messages +************************* + + Error messages from compilers should look like this: + + SOURCE-FILE-NAME:LINENO: MESSAGE + + Error messages from other noninteractive programs should look like +this: + + PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE + +when there is an appropriate source file, or like this: + + PROGRAM: MESSAGE + +when there is no relevant source file. + + In an interactive program (one that is reading commands from a +terminal), it is better not to include the program name in an error +message. The place to indicate which program is running is in the +prompt or with the screen layout. (When the same program runs with +input from a source other than a terminal, it is not interactive and +would do best to print error messages using the noninteractive style.) + + The string MESSAGE should not begin with a capital letter when it +follows a program name and/or filename. Also, it should not end with a +period. + + Error messages from interactive programs, and other messages such as +usage messages, should start with a capital letter. But they should not +end with a period. + + +File: standards.info, Node: Libraries, Next: Portability, Prev: Errors, Up: Top + +Library Behavior +**************** + + Try to make library functions reentrant. If they need to do dynamic +storage allocation, at least try to avoid any nonreentrancy aside from +that of `malloc' itself. + + Here are certain name conventions for libraries, to avoid name +conflicts. + + Choose a name prefix for the library, more than two characters long. +All external function and variable names should start with this prefix. +In addition, there should only be one of these in any given library +member. This usually means putting each one in a separate source file. + + An exception can be made when two external symbols are always used +together, so that no reasonable program could use one without the +other; then they can both go in the same file. + + External symbols that are not documented entry points for the user +should have names beginning with `_'. They should also contain the +chosen name prefix for the library, to prevent collisions with other +libraries. These can go in the same files with user entry points if +you like. + + Static functions and variables can be used as you like and need not +fit any naming convention. + + +File: standards.info, Node: Portability, Next: User Interfaces, Prev: Libraries, Up: Top + +Portability As It Applies to GNU +******************************** + + Much of what is called "portability" in the Unix world refers to +porting to different Unix versions. This is a secondary consideration +for GNU software, because its primary purpose is to run on top of one +and only one kernel, the GNU kernel, compiled with one and only one C +compiler, the GNU C compiler. The amount and kinds of variation among +GNU systems on different cpu's will be like the variation among Berkeley +4.3 systems on different cpu's. + + All users today run GNU software on non-GNU systems. So supporting a +variety of non-GNU systems is desirable; simply not paramount. The +easiest way to achieve portability to a reasonable range of systems is +to use Autoconf. It's unlikely that your program needs to know more +information about the host machine than Autoconf can provide, simply +because most of the programs that need such knowledge have already been +written. + + It is difficult to be sure exactly what facilities the GNU kernel +will provide, since it isn't finished yet. Therefore, assume you can +use anything in 4.3; just avoid using the format of semi-internal data +bases (e.g., directories) when there is a higher-level alternative +(`readdir'). + + You can freely assume any reasonably standard facilities in the C +language, libraries or kernel, because we will find it necessary to +support these facilities in the full GNU system, whether or not we have +already done so. The fact that there may exist kernels or C compilers +that lack these facilities is irrelevant as long as the GNU kernel and +C compiler support them. + + It remains necessary to worry about differences among cpu types, such +as the difference in byte ordering and alignment restrictions. It's +unlikely that 16-bit machines will ever be supported by GNU, so there +is no point in spending any time to consider the possibility that an +int will be less than 32 bits. + + You can assume that all pointers have the same format, regardless of +the type they point to, and that this is really an integer. There are +some weird machines where this isn't true, but they aren't important; +don't waste time catering to them. Besides, eventually we will put +function prototypes into all GNU programs, and that will probably make +your program work even on weird machines. + + Since some important machines (including the 68000) are big-endian, +it is important not to assume that the address of an `int' object is +also the address of its least-significant byte. Thus, don't make the +following mistake: + + int c; + ... + while ((c = getchar()) != EOF) + write(file_descriptor, &c, 1); + + You can assume that it is reasonable to use a meg of memory. Don't +strain to reduce memory usage unless it can get to that level. If your +program creates complicated data structures, just make them in core and +give a fatal error if malloc returns zero. + + If a program works by lines and could be applied to arbitrary +user-supplied input files, it should keep only a line in memory, because +this is not very hard and users will want to be able to operate on input +files that are bigger than will fit in core all at once. + + +File: standards.info, Node: User Interfaces, Next: Documentation, Prev: Portability, Up: Top + +Standards for Command Line Interfaces +************************************* + + Please don't make the behavior of a utility depend on the name used +to invoke it. It is useful sometimes to make a link to a utility with +a different name, and that should not change what it does. + + Instead, use a run time option or a compilation switch or both to +select among the alternate behaviors. + + Likewise, please don't make the behavior of the program depend on the +type of output device it is used with. Device independence is an +important principle of the system's design; do not compromise it merely +to save someone from typing an option now and then. + + If you think one behavior is most useful when the output is to a +terminal, and another is most useful when the output is a file or a +pipe, then it is usually best to make the default behavior the one that +is useful with output to a terminal, and have an option for the other +behavior. + + Compatibility requires certain programs to depend on the type of +output device. It would be disastrous if `ls' or `sh' did not do so in +the way all users expect. In some of these cases, we supplement the +program with a preferred alternate version that does not depend on the +output device type. For example, we provide a `dir' program much like +`ls' except that its default output format is always multi-column +format. + + It is a good idea to follow the POSIX guidelines for the +command-line options of a program. The easiest way to do this is to use +`getopt' to parse them. Note that the GNU version of `getopt' will +normally permit options anywhere among the arguments unless the special +argument `--' is used. This is not what POSIX specifies; it is a GNU +extension. + + Please define long-named options that are equivalent to the +single-letter Unix-style options. We hope to make GNU more user +friendly this way. This is easy to do with the GNU function +`getopt_long'. + + One of the advantages of long-named options is that they can be +consistent from program to program. For example, users should be able +to expect the "verbose" option of any GNU program which has one, to be +spelled precisely `--verbose'. To achieve this uniformity, look at the +table of common long-option names when you choose the option names for +your program. The table appears below. + + If you use names not already in the table, please send +`gnu@prep.ai.mit.edu' a list of them, with their meanings, so we can +update the table. + + It is usually a good idea for file names given as ordinary arguments +to be input files only; any output files would be specified using +options (preferably `-o'). Even if you allow an output file name as an +ordinary argument for compatibility, try to provide a suitable option +as well. This will lead to more consistency among GNU utilities, so +that there are fewer idiosyncracies for users to remember. + + Programs should support an option `--version' which prints the +program's version number on standard output and exits successfully, and +an option `--help' which prints option usage information on standard +output and exits successfully. These options should inhibit the normal +function of the command; they should do nothing except print the +requested information. + +`auto-check' + `-a' in `recode'. + +`auto-reference' + `-A' in `ptx'. + +`after-date' + `-N' in `tar'. + +`all' + `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. + +`all-text' + `-a' in `diff'. + +`almost-all' + `-A' in `ls'. + +`append' + `-a' in `etags', `tee', `time'; `-r' in `tar'. + +`archive' + `-a' in `cp'. + +`archive-name' + `-n' in `shar'. + +`arglength' + `-l' in `m4'. + +`ascii' + `-a' in `diff'. + +`assume-new' + `-W' in Make. + +`assume-old' + `-o' in Make. + +`backward-search' + `-B' in etags. + +`basename' + `-f' in `shar'. + +`batch' + Used in GDB. + +`baud' + Used in GDB. + +`before' + `-b' in `tac'. + +`binary' + `-b' in `cpio' and `diff'. + +`bits-per-code' + `-b' in `shar'. + +`block-size' + Used in `cpio' and `tar'. + +`blocks' + `-b' in `head' and `tail'. + +`break-file' + `-b' in `ptx'. + +`brief' + Used in various programs to make output shorter. + +`bytes' + `-c' in `head', `split', and `tail'. + +`c++' + `-C' in `etags'. + +`catenate' + `-A' in `tar'. + +`cd' + Used in various programs to specify the directory to use. + +`changes' + `-c' in `chgrp' and `chown'. + +`classify' + `-F' in `ls'. + +`colons' + `-c' in `recode'. + +`command' + `-c' in `su'; `-x' in GDB. + +`compare' + `-d' in `tar'. + +`compress' + `-Z' in `tar' and `shar'. + +`concatenate' + `-A' in `tar'. + +`confirmation' + `-w' in `tar'. + +`context' + Used in `diff'. + +`copyright' + `-C' in `ptx' and `recode'. + +`core' + Used in GDB. + +`count' + `-q' in `who'. + +`count-links' + `-l' in `du'. + +`create' + Used in `tar' and `cpio'. + +`cut-mark' + `-c' in `shar'. + +`cxref' + `-x' in `etags'. + +`date' + `-d' in `touch'. + +`debug' + `-d' in Make and `m4'; `-t' in Bison. + +`define' + `-D' in `m4'. + +`defines' + `-d' in Bison and `etags'. + +`delete' + `-D' in `tar'. + +`dereference' + `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. + +`dereference-args' + `-D' in `du'. + +`diacritics' + `-d' in `recode'. + +`dictionary-order' + `-d' in `look'. + +`diff' + `-d' in `tar'. + +`digits' + `-n' in `csplit'. + +`directory' + Specify the directory to use, in various programs. In `ls', it + means to show directories themselves rather than their contents. + In `rm' and `ln', it means to not treat links to directories + specially. + +`discard-all' + `-x' in `strip'. + +`discard-locals' + `-X' in `strip'. + +`diversions' + `-N' in `m4'. + +`dry-run' + `-n' in Make. + +`ed' + `-e' in `diff'. + +`elide-empty-files' + `-z' in `csplit'. + +`entire-new-file' + `-N' in `diff'. + +`environment-overrides' + `-e' in Make. + +`eof' + `-e' in `xargs'. + +`epoch' + Used in GDB. + +`error-limit' + Used in Makeinfo. + +`error-output' + `-o' in `m4'. + +`escape' + `-b' in `ls'. + +`exclude-from' + `-X' in `tar'. + +`exec' + Used in GDB. + +`exit' + `-x' in `xargs'. + +`exit-0' + `-e' in `unshar'. + +`expand-tabs' + `-t' in `diff'. + +`expression' + `-e' in `sed'. + +`extern-only' + `-g' in `nm'. + +`extract' + `-i' in `cpio'; `-x' in `tar'. + +`faces' + `-f' in `finger'. + +`fast' + `-f' in `su'. + +`fatal-warnings' + `-E' in `m4'. + +`file' + `-f' in `info', Make, `mt', and `tar'; `-n' in `sed'; `-r' in + `touch'. + +`file-prefix' + `-b' in Bison. + +`file-type' + `-F' in `ls'. + +`files-from' + `-T' in `tar'. + +`fill-column' + Used in Makeinfo. + +`flag-truncation' + `-F' in `ptx'. + +`fixed-output-files' + `-y' in Bison. + +`follow' + `-f' in `tail'. + +`footnote-style' + Used in Makeinfo. + +`force' + `-f' in `cp', `ln', `mv', and `rm'. + +`force-prefix' + `-F' in `shar'. + +`format' + Used in `ls', `time', and `ptx'. + +`forward-search' + `-F' in `etags'. + +`fullname' + Used in GDB. + +`gap-size' + `-g' in `ptx'. + +`get' + `-x' in `tar'. + +`graphic' + `-i' in `ul'. + +`graphics' + `-g' in `recode'. + +`group' + `-g' in `install'. + +`gzip' + `-z' in `tar' and `shar'. + +`hashsize' + `-H' in `m4'. + +`header' + `-h' in `objdump' and `recode' + +`heading' + `-H' in `who'. + +`help' + Used to ask for brief usage information. + +`here-delimiter' + `-d' in `shar'. + +`hide-control-chars' + `-q' in `ls'. + +`idle' + `-u' in `who'. + +`ifdef' + `-D' in `diff'. + +`ignore' + `-I' in `ls'; `-x' in `recode'. + +`ignore-all-space' + `-w' in `diff'. + +`ignore-backups' + `-B' in `ls'. + +`ignore-blank-lines' + `-B' in `diff'. + +`ignore-case' + `-f' in `look' and `ptx'; `-i' in `diff'. + +`ignore-errors' + `-i' in Make. + +`ignore-file' + `-i' in `ptx'. + +`ignore-indentation' + `-S' in `etags'. + +`ignore-init-file' + `-f' in Oleo. + +`ignore-interrupts' + `-i' in `tee'. + +`ignore-matching-lines' + `-I' in `diff'. + +`ignore-space-change' + `-b' in `diff'. + +`ignore-zeros' + `-i' in `tar'. + +`include' + `-i' in `etags'; `-I' in `m4'. + +`include-dir' + `-I' in Make. + +`incremental' + `-G' in `tar'. + +`info' + `-i', `-l', and `-m' in Finger. + +`initial' + `-i' in `expand'. + +`initial-tab' + `-T' in `diff'. + +`inode' + `-i' in `ls'. + +`interactive' + `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; + `-w' in `tar'. + +`intermix-type' + `-p' in `shar'. + +`jobs' + `-j' in Make. + +`just-print' + `-n' in Make. + +`keep-going' + `-k' in Make. + +`keep-files' + `-k' in `csplit'. + +`kilobytes' + `-k' in `du' and `ls'. + +`level-for-gzip' + `-g' in `shar'. + +`line-bytes' + `-C' in `split'. + +`lines' + Used in `split', `head', and `tail'. + +`link' + `-l' in `cpio'. + +`list' + `-t' in `cpio'; `-l' in `recode'. + +`list' + `-t' in `tar'. + +`literal' + `-N' in `ls'. + +`load-average' + `-l' in Make. + +`login' + Used in `su'. + +`machine' + No listing of which programs already use this; someone should + check to see if any actually do and tell `gnu@prep.ai.mit.edu'. + +`macro-name' + `-M' in `ptx'. + +`mail' + `-m' in `hello' and `uname'. + +`make-directories' + `-d' in `cpio'. + +`makefile' + `-f' in Make. + +`mapped' + Used in GDB. + +`max-args' + `-n' in `xargs'. + +`max-chars' + `-n' in `xargs'. + +`max-lines' + `-l' in `xargs'. + +`max-load' + `-l' in Make. + +`max-procs' + `-P' in `xargs'. + +`mesg' + `-T' in `who'. + +`message' + `-T' in `who'. + +`minimal' + `-d' in `diff'. + +`mixed-uuencode' + `-M' in `shar'. + +`mode' + `-m' in `install', `mkdir', and `mkfifo'. + +`modification-time' + `-m' in `tar'. + +`multi-volume' + `-M' in `tar'. + +`name-prefix' + `-a' in Bison. + +`nesting-limit' + `-L' in `m4'. + +`net-headers' + `-a' in `shar'. + +`new-file' + `-W' in Make. + +`no-builtin-rules' + `-r' in Make. + +`no-character-count' + `-w' in `shar'. + +`no-check-existing' + `-x' in `shar'. + +`no-create' + `-c' in `touch'. + +`no-defines' + `-D' in `etags'. + +`no-dereference' + `-d' in `cp'. + +`no-keep-going' + `-S' in Make. + +`no-lines' + `-l' in Bison. + +`no-piping' + `-P' in `shar'. + +`no-prof' + `-e' in `gprof'. + +`no-sort' + `-p' in `nm'. + +`no-split' + Used in Makeinfo. + +`no-static' + `-a' in `gprof'. + +`no-time' + `-E' in `gprof'. + +`no-timestamp' + `-m' in `shar'. + +`no-validate' + Used in Makeinfo. + +`no-verbose' + `-v' in `shar'. + +`no-warn' + Used in various programs to inhibit warnings. + +`node' + `-n' in `info'. + +`nodename' + `-n' in `uname'. + +`nonmatching' + `-f' in `cpio'. + +`nstuff' + `-n' in `objdump'. + +`null' + `-0' in `xargs'. + +`number' + `-n' in `cat'. + +`number-nonblank' + `-b' in `cat'. + +`numeric-sort' + `-n' in `nm'. + +`numeric-uid-gid' + `-n' in `cpio' and `ls'. + +`nx' + Used in GDB. + +`old-archive' + `-o' in `tar'. + +`old-file' + `-o' in Make. + +`one-file-system' + `-l' in `tar', `cp', and `du'. + +`only-file' + `-o' in `ptx'. + +`only-prof' + `-f' in `gprof'. + +`only-time' + `-F' in `gprof'. + +`output' + In various programs, specify the output file name. + +`output-prefix' + `-o' in `shar'. + +`override' + `-o' in `rm'. + +`overwrite' + `-c' in `unshar'. + +`owner' + `-o' in `install'. + +`paginate' + `-l' in `diff'. + +`paragraph-indent' + Used in Makeinfo. + +`parents' + `-p' in `mkdir' and `rmdir'. + +`pass-all' + `-p' in `ul'. + +`pass-through' + `-p' in `cpio'. + +`port' + `-P' in `finger'. + +`portability' + `-c' in `cpio' and `tar'. + +`prefix-builtins' + `-P' in `m4'. + +`prefix' + `-f' in `csplit'. + +`preserve' + Used in `tar' and `cp'. + +`preserve-environment' + `-p' in `su'. + +`preserve-modification-time' + `-m' in `cpio'. + +`preserve-order' + `-s' in `tar'. + +`preserve-permissions' + `-p' in `tar'. + +`print' + `-l' in `diff'. + +`print-chars' + `-L' in `cmp'. + +`print-data-base' + `-p' in Make. + +`print-directory' + `-w' in Make. + +`print-file-name' + `-o' in `nm'. + +`print-symdefs' + `-s' in `nm'. + +`query-user' + `-X' in `shar'. + +`question' + `-q' in Make. + +`quiet' + Used in many programs to inhibit the usual output. *Note:* every + program accepting `--quiet' should accept `--silent' as a synonym. + +`quote-name' + `-Q' in `ls'. + +`rcs' + `-n' in `diff'. + +`read-full-blocks' + `-B' in `tar'. + +`readnow' + Used in GDB. + +`recon' + `-n' in Make. + +`record-number' + `-R' in `tar'. + +`recursive' + Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. + +`reference-limit' + Used in Makeinfo. + +`references' + `-r' in `ptx'. + +`regex' + `-r' in `tac'. + +`release' + `-r' in `uname'. + +`relocation' + `-r' in `objdump'. + +`rename' + `-r' in `cpio'. + +`replace' + `-i' in `xargs'. + +`report-identical-files' + `-s' in `diff'. + +`reset-access-time' + `-a' in `cpio'. + +`reverse' + `-r' in `ls' and `nm'. + +`reversed-ed' + `-f' in `diff'. + +`right-side-defs' + `-R' in `ptx'. + +`same-order' + `-s' in `tar'. + +`same-permissions' + `-p' in `tar'. + +`save' + `-g' in `stty'. + +`se' + Used in GDB. + +`sentence-regexp' + `-S' in `ptx'. + +`separate-dirs' + `-S' in `du'. + +`separator' + `-s' in `tac'. + +`sequence' + Used by `recode' to chose files or pipes for sequencing passes. + +`shell' + `-s' in `su'. + +`show-all' + `-A' in `cat'. + +`show-c-function' + `-p' in `diff'. + +`show-ends' + `-E' in `cat'. + +`show-function-line' + `-F' in `diff'. + +`show-tabs' + `-T' in `cat'. + +`silent' + Used in many programs to inhibit the usual output. *Note:* every + program accepting `--silent' should accept `--quiet' as a synonym. + +`size' + `-s' in `ls'. + +`sort' + Used in `ls'. + +`sparse' + `-S' in `tar'. + +`speed-large-files' + `-H' in `diff'. + +`split-at' + `-E' in `unshar'. + +`split-size-limit' + `-L' in `shar'. + +`squeeze-blank' + `-s' in `cat'. + +`starting-file' + Used in `tar' and `diff' to specify which file within a directory + to start processing with. + +`stdin-file-list' + `-S' in `shar'. + +`stop' + `-S' in Make. + +`strict' + `-s' in `recode'. + +`strip' + `-s' in `install'. + +`strip-all' + `-s' in `strip'. + +`strip-debug' + `-S' in `strip'. + +`submitter' + `-s' in `shar'. + +`suffix' + `-S' in `cp', `ln', `mv'. + +`suffix-format' + `-b' in `csplit'. + +`sum' + `-s' in `gprof'. + +`summarize' + `-s' in `du'. + +`symbolic' + `-s' in `ln'. + +`symbols' + Used in GDB and `objdump'. + +`synclines' + `-s' in `m4'. + +`sysname' + `-s' in `uname'. + +`tabs' + `-t' in `expand' and `unexpand'. + +`tabsize' + `-T' in `ls'. + +`terminal' + `-T' in `tput' and `ul'. + +`text' + `-a' in `diff'. + +`text-files' + `-T' in `shar'. + +`time' + Used in `ls' and `touch'. + +`to-stdout' + `-O' in `tar'. + +`total' + `-c' in `du'. + +`touch' + `-t' in Make, `ranlib', and `recode'. + +`trace' + `-t' in `m4'. + +`traditional' + `-t' in `hello'; `-G' in `m4' and `ptx'. + +`tty' + Used in GDB. + +`typedefs' + `-t' in `etags'. + +`typedefs-and-c++' + `-T' in `etags'. + +`typeset-mode' + `-t' in `ptx'. + +`uncompress' + `-z' in `tar'. + +`unconditional' + `-u' in `cpio'. + +`undefine' + `-U' in `m4'. + +`undefined-only' + `-u' in `nm'. + +`update' + `-u' in `cp', `etags', `mv', `tar'. + +`uuencode' + `-B' in `shar'. + +`vanilla-operation' + `-V' in `shar'. + +`verbose' + Print more information about progress. Many programs support this. + +`verify' + `-W' in `tar'. + +`version' + Print the version number. + +`version-control' + `-V' in `cp', `ln', `mv'. + +`vgrind' + `-v' in `etags'. + +`volume' + `-V' in `tar'. + +`what-if' + `-W' in Make. + +`whole-size-limit' + `-l' in `shar'. + +`width' + `-w' in `ls' and `ptx'. + +`word-regexp' + `-W' in `ptx'. + +`writable' + `-T' in `who'. + +`zeros' + `-z' in `gprof'. + + +File: standards.info, Node: Documentation, Next: Releases, Prev: User Interfaces, Up: Top + +Documenting Programs +******************** + + Please use Texinfo for documenting GNU programs. See the Texinfo +manual, either the hardcopy or the version in the GNU Emacs Info +subsystem (`C-h i'). See existing GNU Texinfo files (e.g., those under +the `man/' directory in the GNU Emacs distribution) for examples. + + The title page of the manual should state the version of the program +which the manual applies to. The Top node of the manual should also +contain this information. If the manual is changing more frequently +than or independent of the program, also state a version number for the +manual in both of these places. + + The manual should document all command-line arguments and all +commands. It should give examples of their use. But don't organize +the manual as a list of features. Instead, organize it by the concepts +a user will have before reaching that point in the manual. Address the +goals that a user will have in mind, and explain how to accomplish +them. Don't use Unix man pages as a model for how to write GNU +documentation; they are a bad example to follow. + + The manual should have a node named `PROGRAM Invocation' or +`Invoking PROGRAM', where PROGRAM stands for the name of the program +being described, as you would type it in the shell to run the program. +This node (together with its subnodes, if any) should describe the +program's command line arguments and how to run it (the sort of +information people would look in a man page for). Start with an +`@example' containing a template for all the options and arguments that +the program uses. + + Alternatively, put a menu item in some menu whose item name fits one +of the above patterns. This identifies the node which that item points +to as the node for this purpose, regardless of the node's actual name. + + There will be automatic features for specifying a program name and +quickly reading just this part of its manual. + + If one manual describes several programs, it should have such a node +for each program described. + + In addition to its manual, the package should have a file named +`NEWS' which contains a list of user-visible changes worth mentioning. +In each new release, add items to the front of the file and identify +the version they pertain to. Don't discard old items; leave them in +the file after the newer items. This way, a user upgrading from any +previous version can see what is new. + + If the `NEWS' file gets very long, move some of the older items into +a file named `ONEWS' and put a note at the end referring the user to +that file. + + Please do not use the term "pathname" that is used in Unix +documentation; use "file name" (two words) instead. We use the term +"path" only for search paths, which are lists of file names. + + It is ok to supply a man page for the program as well as a Texinfo +manual if you wish to. But keep in mind that supporting a man page +requires continual effort, each time the program is changed. Any time +you spend on the man page is time taken away from more useful things you +could contribute. + + Thus, even if a user volunteers to donate a man page, you may find +this gift costly to accept. Unless you have time on your hands, it may +be better to refuse the man page unless the same volunteer agrees to +take full responsibility for maintaining it--so that you can wash your +hands of it entirely. If the volunteer ceases to do the job, then +don't feel obliged to pick it up yourself; it may be better to withdraw +the man page until another volunteer offers to carry on with it. + + Alternatively, if you expect the discrepancies to be small enough +that the man page remains useful, put a prominent note near the +beginning of the man page explaining that you don't maintain it and +that the Texinfo manual is more authoritative, and describing how to +access the Texinfo documentation. + + +File: standards.info, Node: Releases, Prev: Documentation, Up: Top + +Making Releases +*************** + + Package the distribution of Foo version 69.96 in a gzipped tar file +named `foo-69.96.tar.gz'. It should unpack into a subdirectory named +`foo-69.96'. + + Building and installing the program should never modify any of the +files contained in the distribution. This means that all the files +that form part of the program in any way must be classified into "source +files" and "non-source files". Source files are written by humans and +never changed automatically; non-source files are produced from source +files by programs under the control of the Makefile. + + Naturally, all the source files must be in the distribution. It is +okay to include non-source files in the distribution, provided they are +up-to-date and machine-independent, so that building the distribution +normally will never modify them. We commonly include non-source files +produced by Bison, Lex, TeX, and Makeinfo; this helps avoid unnecessary +dependencies between our distributions, so that users can install +whichever packages they want to install. + + Non-source files that might actually be modified by building and +installing the program should *never* be included in the distribution. +So if you do distribute non-source files, always make sure they are up +to date when you make a new distribution. + + Make sure that the directory into which the distribution unpacks (as +well as any subdirectories) are all world-writable (octal mode 777). +This is so that old versions of `tar' which preserve the ownership and +permissions of the files from the tar archive will be able to extract +all the files even if the user is unprivileged. + + Make sure that all the files in the distribution are world-readable. + + Make sure that no file name in the distribution is more than 14 +characters long. Likewise, no file created by building the program +should have a name longer than 14 characters. The reason for this is +that some systems adhere to a foolish interpretation of the POSIX +standard, and refuse to open a longer name, rather than truncating as +they did in the past. + + Don't include any symbolic links in the distribution itself. If the +tar file contains symbolic links, then people cannot even unpack it on +systems that don't support symbolic links. Also, don't use multiple +names for one file in different directories, because certain file +systems cannot handle this and that prevents unpacking the distribution. + + Try to make sure that all the file names will be unique on MS-DOG. A +name on MS-DOG consists of up to 8 characters, optionally followed by a +period and up to three characters. MS-DOG will truncate extra +characters both before and after the period. Thus, `foobarhacker.c' +and `foobarhacker.o' are not ambiguous; they are truncated to +`foobarha.c' and `foobarha.o', which are distinct. + + Include in your distribution a copy of the `texinfo.tex' you used to +test print any `*.texinfo' files. + + Likewise, if your program uses small GNU software packages like +regex, getopt, obstack, or termcap, include them in the distribution +file. Leaving them out would make the distribution file a little +smaller at the expense of possible inconvenience to a user who doesn't +know what other files to get. + + diff --git a/src/util/autoconf/standards.texi b/src/util/autoconf/standards.texi index 13908d65f..e50b367f1 100644 --- a/src/util/autoconf/standards.texi +++ b/src/util/autoconf/standards.texi @@ -3,7 +3,7 @@ @setfilename standards.info @settitle GNU Coding Standards @c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES! -@set lastupdate 28 March 1994 +@set lastupdate 21 September 1994 @c %**end of header @ifinfo @@ -18,7 +18,7 @@ END-INFO-DIR-ENTRY @ifinfo GNU Coding Standards -Copyright (C) 1992, 1993, 1994 Free Software Foundation +Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -49,7 +49,7 @@ by the Free Software Foundation. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, 1993 Free Software Foundation +Copyright @copyright{} 1992, 1993 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -63,17 +63,18 @@ notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved -by Free Software Foundation. +by the Free Software Foundation. @end titlepage @ifinfo -@node Top, Reading Non-Free Code, (dir), (dir) +@node Top, Preface, (dir), (dir) @top Version Last updated @value{lastupdate}. @end ifinfo @menu +* Preface:: About the GNU Coding Standards * Reading Non-Free Code:: Referring to Proprietary Programs * Contributions:: Accepting Contributions * Change Logs:: Recording Changes @@ -96,6 +97,26 @@ Last updated @value{lastupdate}. * Releases:: Making Releases @end menu +@node Preface +@chapter About the GNU Coding Standards + +The GNU Coding Standards were written by Richard Stallman and other GNU +Project volunteers. Their purpose is to make the GNU system clean, +consistent, and easy to install. This document can also be read as a +guide to write portable, robust and reliable programs. It focuses on +programs written in C, but many of the rules and principles are useful +even if you write in another programming language. The rules often +state reasons for writing in a certain way. + +Corrections or suggestions regarding this document should be sent to +@code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a +suggested new wording for it; our time is limited. We prefer a context +diff to the @file{standards.texi} or @file{make-stds.texi} files, but if +you don't have those files, please mail your suggestion anyway. + +This release of the GNU Coding Standards was last updated +@value{lastupdate}. + @node Reading Non-Free Code @chapter Referring to Proprietary Programs @@ -1008,6 +1029,12 @@ You must expect @code{free} to alter the contents of the block that was freed. Anything you want to fetch from the block, you must fetch before calling @code{free}. +If @code{malloc} fails in a noninteractive program, make that a fatal +error. In an interactive program (one that reads commands from the +user), it is better to abort the command and return to the command +reader loop. This allows the user to kill other processes to free up +virtual memory, and then try the command again. + Use @code{getopt_long} to decode arguments, unless the argument syntax makes this unreasonable. @@ -1274,6 +1301,9 @@ and @code{unexpand}. @item archive @samp{-a} in @code{cp}. +@item archive-name +@samp{-n} in @code{shar}. + @item arglength @samp{-l} in @code{m4}. @@ -1289,6 +1319,9 @@ and @code{unexpand}. @item backward-search @samp{-B} in etags. +@item basename +@samp{-f} in @code{shar}. + @item batch Used in GDB. @@ -1301,6 +1334,9 @@ Used in GDB. @item binary @samp{-b} in @code{cpio} and @code{diff}. +@item bits-per-code +@samp{-b} in @code{shar}. + @item block-size Used in @code{cpio} and @code{tar}. @@ -1316,7 +1352,7 @@ Used in various programs to make output shorter. @item bytes @samp{-c} in @code{head}, @code{split}, and @code{tail}. -@item c++ +@item c@t{++} @samp{-C} in @code{etags}. @item catenate @@ -1342,7 +1378,7 @@ Used in various programs to specify the directory to use. @samp{-d} in @code{tar}. @item compress -@samp{-Z} in @code{tar}. +@samp{-Z} in @code{tar} and @code{shar}. @item concatenate @samp{-A} in @code{tar}. @@ -1368,6 +1404,9 @@ Used in GDB. @item create Used in @code{tar} and @code{cpio}. +@item cut-mark +@samp{-c} in @code{shar}. + @item cxref @samp{-x} in @code{etags}. @@ -1460,6 +1499,9 @@ Used in GDB. @item exit @samp{-x} in @code{xargs}. +@item exit-0 +@samp{-e} in @code{unshar}. + @item expand-tabs @samp{-t} in @code{diff}. @@ -1479,6 +1521,9 @@ Used in GDB. @item fast @samp{-f} in @code{su}. +@item fatal-warnings +@samp{-E} in @code{m4}. + @item file @samp{-f} in @code{info}, Make, @code{mt}, and @code{tar}; @samp{-n} in @code{sed}; @@ -1511,6 +1556,9 @@ Used in Makeinfo. @item force @samp{-f} in @code{cp}, @code{ln}, @code{mv}, and @code{rm}. +@item force-prefix +@samp{-F} in @code{shar}. + @item format Used in @code{ls}, @code{time}, and @code{ptx}. @@ -1536,7 +1584,7 @@ Used in GDB. @samp{-g} in @code{install}. @item gzip -@samp{-z} in @code{tar}. +@samp{-z} in @code{tar} and @code{shar}. @item hashsize @samp{-H} in @code{m4}. @@ -1550,6 +1598,9 @@ Used in GDB. @item help Used to ask for brief usage information. +@item here-delimiter +@samp{-d} in @code{shar}. + @item hide-control-chars @samp{-q} in @code{ls}. @@ -1628,6 +1679,9 @@ Used to ask for brief usage information. @samp{-p} in @code{xargs}; @samp{-w} in @code{tar}. +@item intermix-type +@samp{-p} in @code{shar}. + @item jobs @samp{-j} in Make. @@ -1643,6 +1697,9 @@ Used to ask for brief usage information. @item kilobytes @samp{-k} in @code{du} and @code{ls}. +@item level-for-gzip +@samp{-g} in @code{shar}. + @item line-bytes @samp{-C} in @code{split}. @@ -1712,6 +1769,9 @@ Used in GDB. @item minimal @samp{-d} in @code{diff}. +@item mixed-uuencode +@samp{-M} in @code{shar}. + @item mode @samp{-m} in @code{install}, @code{mkdir}, and @code{mkfifo}. @@ -1724,12 +1784,24 @@ Used in GDB. @item name-prefix @samp{-a} in Bison. +@item nesting-limit +@samp{-L} in @code{m4}. + +@item net-headers +@samp{-a} in @code{shar}. + @item new-file @samp{-W} in Make. @item no-builtin-rules @samp{-r} in Make. +@item no-character-count +@samp{-w} in @code{shar}. + +@item no-check-existing +@samp{-x} in @code{shar}. + @item no-create @samp{-c} in @code{touch}. @@ -1745,6 +1817,9 @@ Used in GDB. @item no-lines @samp{-l} in Bison. +@item no-piping +@samp{-P} in @code{shar}. + @item no-prof @samp{-e} in @code{gprof}. @@ -1760,9 +1835,15 @@ Used in Makeinfo. @item no-time @samp{-E} in @code{gprof}. +@item no-timestamp +@samp{-m} in @code{shar}. + @item no-validate Used in Makeinfo. +@item no-verbose +@samp{-v} in @code{shar}. + @item no-warn Used in various programs to inhibit warnings. @@ -1817,9 +1898,15 @@ Used in GDB. @item output In various programs, specify the output file name. +@item output-prefix +@samp{-o} in @code{shar}. + @item override @samp{-o} in @code{rm}. +@item overwrite +@samp{-c} in @code{unshar}. + @item owner @samp{-o} in @code{install}. @@ -1883,6 +1970,9 @@ Used in @code{tar} and @code{cp}. @item print-symdefs @samp{-s} in @code{nm}. +@item query-user +@samp{-X} in @code{shar}. + @item question @samp{-q} in Make. @@ -2008,6 +2098,12 @@ Used in @code{ls}. @item speed-large-files @samp{-H} in @code{diff}. +@item split-at +@samp{-E} in @code{unshar}. + +@item split-size-limit +@samp{-L} in @code{shar}. + @item squeeze-blank @samp{-s} in @code{cat}. @@ -2015,6 +2111,9 @@ Used in @code{ls}. Used in @code{tar} and @code{diff} to specify which file within a directory to start processing with. +@item stdin-file-list +@samp{-S} in @code{shar}. + @item stop @samp{-S} in Make. @@ -2030,6 +2129,9 @@ a directory to start processing with. @item strip-debug @samp{-S} in @code{strip}. +@item submitter +@samp{-s} in @code{shar}. + @item suffix @samp{-S} in @code{cp}, @code{ln}, @code{mv}. @@ -2066,6 +2168,9 @@ Used in GDB and @code{objdump}. @item text @samp{-a} in @code{diff}. +@item text-files +@samp{-T} in @code{shar}. + @item time Used in @code{ls} and @code{touch}. @@ -2112,6 +2217,12 @@ Used in GDB. @item update @samp{-u} in @code{cp}, @samp{etags}, @samp{mv}, @samp{tar}. +@item uuencode +@samp{-B} in @code{shar}. + +@item vanilla-operation +@samp{-V} in @code{shar}. + @item verbose Print more information about progress. Many programs support this. @@ -2133,6 +2244,9 @@ Print the version number. @item what-if @samp{-W} in Make. +@item whole-size-limit +@samp{-l} in @code{shar}. + @item width @samp{-w} in @code{ls} and @code{ptx}. diff --git a/src/util/autoconf/texinfo.tex b/src/util/autoconf/texinfo.tex index 65f5d06cc..00eb0a5fe 100644 --- a/src/util/autoconf/texinfo.tex +++ b/src/util/autoconf/texinfo.tex @@ -47,7 +47,14 @@ \let\ptexl=\l \let\ptexL=\L -\def\tie{\penalty 10000\ } % Save plain tex definition of ~. +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + \gdef\tie{\leavevmode\penalty\@M\ } +} \let\~ = \tie % And make it available as @~. \message{Basics,} @@ -352,6 +359,15 @@ % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } +% @enddots{} is an end-of-sentence ellipsis. +\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} + +% @! is an end-of-sentence bang. +\gdef\!{!\spacefactor=3000 } + +% @? is an end-of-sentence query. +\gdef\?{?\spacefactor=3000 } + % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. @@ -609,9 +625,11 @@ where each line of input produces a line of output.} % \def\ignore{\doignore{ignore}} -% Also ignore @ifinfo, @menu, and @direntry text. +% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. % \def\ifinfo{\doignore{ifinfo}} +\def\ifhtml{\doignore{ifhtml}} +\def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} @@ -838,15 +856,15 @@ where each line of input produces a line of output.} \def\donoderef{\ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}\fi -\let\lastnode=\relax} +\global\let\lastnode=\relax} \def\unnumbnoderef{\ifx\lastnode\relax\else \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\let\lastnode=\relax} +\global\let\lastnode=\relax} \def\appendixnoderef{\ifx\lastnode\relax\else \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\let\lastnode=\relax} +\global\let\lastnode=\relax} \let\refill=\relax @@ -1657,6 +1675,159 @@ July\or August\or September\or October\or November\or December\fi \vadjust{\penalty 1200}}% \flushcr} +% @multitable macros +% Amy Hendrickson, 8/18/94 +% +% @multitable ... @endmultitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @percentofhsize .2 .3 .5 +% @item ... +% +% Numbers following @percentofhsize are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their +% own lines, but it will not hurt if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @endmultitable + +% Default dimensions may be reset by user. +% @intableparskip will set vertical space between paragraphs in table. +% @intableparindent will set paragraph indent in table. +% @spacebetweencols will set horizontal space to be left between columns. +% @spacebetweenlines will set vertical space to be left between lines. + +%%%% +% Dimensions + +\newdimen\intableparskip +\newdimen\intableparindent +\newdimen\spacebetweencols +\newdimen\spacebetweenlines +\intableparskip=0pt +\intableparindent=6pt +\spacebetweencols=12pt +\spacebetweenlines=12pt + +%%%% +% Macros used to set up halign preamble: +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\percentofhsize\relax +\def\xpercentofhsize{\percentofhsize} +\newif\ifsetpercent + +\newcount\colcount +\def\setuptable#1{\def\firstarg{#1}% +\ifx\firstarg\xendsetuptable\let\go\relax% +\else + \ifx\firstarg\xpercentofhsize\global\setpercenttrue% + \else + \ifsetpercent + \if#1.\else% + \global\advance\colcount by1 % + \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% + \fi + \else + \global\advance\colcount by1 + \setbox0=\hbox{#1}% + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi% + \fi% + \let\go\setuptable% +\fi\go} +%%%% +% multitable syntax +\def\tab{&} + +%%%% +% @multitable ... @endmultitable definitions: + +\def\multitable#1\item{\bgroup +\let\item\cr +\tolerance=9500 +\hbadness=9500 +\parskip=\intableparskip +\parindent=\intableparindent +\overfullrule=0pt +\global\colcount=0\relax% +\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% + % To parse everything between @multitable and @item : +\def\one{#1}\expandafter\setuptable\one\endsetuptable + % Need to reset this to 0 after \setuptable. +\global\colcount=0\relax% + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. +\halign\bgroup&\global\advance\colcount by 1\relax% +\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname + % In order to keep entries from bumping into each other + % we will add a \leftskip of \spacebetweencols to all columns after + % the first one. + % If a template has been used, we will add \spacebetweencols + % to the width of each template entry. + % If user has set preamble in terms of percent of \hsize + % we will use that dimension as the width of the column, and + % the \leftskip will keep entries from bumping into each other. + % Table will start at left margin and final column will justify at + % right margin. +\ifnum\colcount=1 +\else + \ifsetpercent + \else + % If user has set preamble in terms of percent of \hsize + % we will advance \hsize by \spacebetweencols + \advance\hsize by \spacebetweencols + \fi + % In either case we will make \leftskip=\spacebetweencols: +\leftskip=\spacebetweencols +\fi +\noindent##}\cr% + % \everycr will reset column counter, \colcount, at the end of + % each line. Every column entry will cause \colcount to advance by one. + % The table preamble + % looks at the current \colcount to find the correct column width. +\global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines +\filbreak%% keeps underfull box messages off when table breaks over pages. +\global\colcount=0\relax}}} + \message{indexing,} % Index generation facilities @@ -2674,6 +2845,7 @@ July\or August\or September\or October\or November\or December\fi \unnumbchapmacro{#1}\def\thischapter{}% \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. } @@ -3095,23 +3267,26 @@ July\or August\or September\or October\or November\or December\fi \advance\leftskip by 0pt plus 1fill \gobble} -% @quotation does normal linebreaking and narrows the margins. +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. % \def\quotation{% -\begingroup\inENV %This group ends at the end of the @quotation body -{\parskip=0pt % because we will skip by \parskip too, later -\aboveenvbreak}% -\singlespace -\parindent=0pt -\let\Equotation = \nonfillfinish -% @cartouche defines \nonarrowing to inhibit narrowing -% at next level down. -\ifx\nonarrowing\relax -\advance \leftskip by \lispnarrowing -\advance \rightskip by \lispnarrowing -\exdentamount=\lispnarrowing -\let\nonarrowing=\relax -\fi} + \begingroup\inENV %This group ends at the end of the @quotation body + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \singlespace + \parindent=0pt + % We have retained a nonzero parskip for the environment, since we're + % doing normal filling. So to avoid extra space below the environment... + \def\Equotation{\parskip = 0pt \nonfillfinish}% + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \let\nonarrowing = \relax + \fi +} \message{defuns,} % Define formatter for defuns @@ -3388,7 +3563,7 @@ July\or August\or September\or October\or November\or December\fi % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\code{#1} #2}{Function}% +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } @@ -3397,6 +3572,10 @@ July\or August\or September\or October\or November\or December\fi \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} +% \defheaderxcond#1\relax$$$ +% puts #1 in @code, followed by a space, but does nothing if #1 is null. +\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} + % #1 is the classification. #2 is the data type. #3 is the name and args. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} % #1 is the classification, #2 the data type, #3 the name, #4 the args. @@ -3405,7 +3584,7 @@ July\or August\or September\or October\or November\or December\fi \begingroup \normalparens % notably, turn off `&' magic, which prevents % at least some C++ text from working -\defname {\code{#2} #3}{#1}% +\defname {\defheaderxcond#2\relax$$$#3}{#1}% \deftypefunargs {#4}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } @@ -3533,7 +3712,7 @@ July\or August\or September\or October\or November\or December\fi % #1 is the data type. #2 is the name. \def\deftypevarheader #1#2{% \doind {vr}{\code{#2}}% Make entry in variables index -\begingroup\defname {\code{#1} #2}{Variable}% +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} @@ -3543,7 +3722,7 @@ July\or August\or September\or October\or November\or December\fi \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% -\begingroup\defname {\code{#2} #3}{#1} +\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} @@ -3607,44 +3786,53 @@ July\or August\or September\or October\or November\or December\fi \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} -\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup% -\def\printedmanual{\ignorespaces #5}% -\def\printednodename{\ignorespaces #3}% -\def\correctnodename{{\normalturnoffactive\printednodename}}% -\setbox1=\hbox{\printedmanual}% -\setbox0=\hbox{\printednodename}% -\ifdim \wd0=0pt% -% No printed node name was explicitly given. -\ifx SETxref-automatic-section-title % -% This line should make the actual chapter or section title appear inside -% the square brackets. Use the real section title if we have it. -\ifdim \wd1>0pt% -% It is in another manual, so we don't have it. -\def\printednodename{\ignorespaces #1} \else% -% We know the real title if we have the xref values. -\ifhavexrefs \def\printednodename{\refx{#1-title}}% -% Otherwise just copy the Info node name. -\else \def\printednodename{\ignorespaces #1} \fi% -\fi\def\printednodename{#1-title}% -\else% This line just uses the node name. -\def\printednodename{\ignorespaces #1}% -\fi% ends \ifx SETxref-automatic-section-title -\fi% ends \ifdim \wd0 -% -% -% If we use \unhbox0 and \unhbox1 to print the node names, TeX does -% not insert empty discretionaries after hyphens, which means that it -% will not find a line break at a hyphen in a node names. Since some -% manuals are best written with fairly long node names, containing -% hyphens, this is a loss. Therefore, we simply give the text of -% the node name again, so it is as if TeX is seeing it for the first -% time. -\ifdim \wd1>0pt -\putwordsection{} ``\correctnodename'' in \cite{\printedmanual}% -\else% -\turnoffactive% -\refx{#1-snt}{} [\correctnodename], \putwordpage\tie\refx{#1-pg}{}% -\fi +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \def\printedmanual{\ignorespaces #5}% + \def\printednodename{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual}% + \setbox0=\hbox{\printednodename}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \ifx\SETxref-automatic-section-title\relax % + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1>0pt% + % It is in another manual, so we don't have it. + \def\printednodename{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printednodename{\refx{#1-title}}% + \else + % Otherwise just copy the Info node name. + \def\printednodename{\ignorespaces #1}% + \fi% + \fi + \def\printednodename{#1-title}% + \else + % Use the node name inside the square brackets. + \def\printednodename{\ignorespaces #1}% + \fi + \fi + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \refx{#1-snt}{}}% + \space [\printednodename],\space + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi \endgroup} % \dosetq is the interface for calls from other macros @@ -3772,6 +3960,15 @@ July\or August\or September\or October\or November\or December\fi \catcode `\&=\other % `\+ does not work, so use 43. \catcode 43=\other +% Make the characters 128-255 be printing characters +{% + \count 1=128 + \def\loop{% + \catcode\count 1=\other + \advance\count 1 by 1 + \ifnum \count 1<256 \loop \fi + }% +}% % the aux file uses ' as the escape. % Turn off \ as an escape so we do not lose on % entries which were dumped with control sequences in their names. @@ -3998,6 +4195,28 @@ July\or August\or September\or October\or November\or December\fi \global\pageheight=\vsize } +% Allow control of the text dimensions. Parameters in order: textheight; +% textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; +% header is additional; added length extends the bottom of the page. + +\def\changepagesizes#1#2#3#4#5 +{\global\vsize= #1 + \advance\vsize by \topskip + \global\voffset= #3 + \global\hsize= #2 + \global\outerhsize=\hsize + \global\advance\outerhsize by 0.5in + \global\outervsize=\vsize + \global\advance\outervsize by 0.6in + \global\pagewidth=\hsize + \global\pageheight=\vsize + \global\normaloffset= #4 + \global\bindingoffset= #5} + +% This layout is compatible with Latex on A4 paper. + +\def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} + % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other