From: Tom Yu Date: Tue, 24 Dec 1996 21:16:42 +0000 (+0000) Subject: update to autoconf-2.12 X-Git-Tag: krb5-1.1-beta1~1393 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a3a8da660398f5794a87baf9d4b3dde0936ed939;p=krb5.git update to autoconf-2.12 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9689 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/autoconf/COPYING b/src/util/autoconf/COPYING index a43ea2126..a3f6b12ee 100644 --- a/src/util/autoconf/COPYING +++ b/src/util/autoconf/COPYING @@ -2,7 +2,8 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found. 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. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Also add information on how to contact you by electronic and paper mail. diff --git a/src/util/autoconf/ChangeLog b/src/util/autoconf/ChangeLog index e317fe91e..8415c4863 100644 --- a/src/util/autoconf/ChangeLog +++ b/src/util/autoconf/ChangeLog @@ -1,26 +1,296 @@ -Tue Jul 9 18:24:12 1996 Marc Horowitz +Tue Nov 26 13:00:28 1996 David J MacKenzie - * autoheader.sh (TEMPLATES): add ./acconfig.h to the list of - header templates used. This is necessary when a subpackage is - being autoreconf'd. + * Version 2.12. - * acgeneral.m4 (AC_CACHE_CHECK): added, from autoconf 2.7. db2 - needs it. +Wed Nov 20 13:00:21 1996 David J MacKenzie -Wed Jun 12 18:17:17 1996 Tom Yu + * Test release 2.11.2. - * autoconf.texi (Output): document changes to AC_OUTPUT + * acgeneral.m4 (AC_OUTPUT): Remove a now-wrong test for whether to + make an unquoted here document. + (AC_CACHE_SAVE): Double-up backslashes in double quotes. + From Paul Eggert. + + * Test release 2.11.1. + + * acgeneral.m4 (AC_TRY_COMPILE, AC_TRY_LINK): Make the final + newline consistent with the other AC_TRY_* macros: no final dnl + is needed to avoid extraneous blank lines. + (AC_CHECK_LIB, AC_HAVE_LIBRARY, AC_COMPILE_CHECK): Remove + extraneous dnl's. + (AC_DIVERSION_CMDS, AC_DIVERSION_ICMDS): New macros. + (AC_OUTPUT_COMMANDS, AC_OUTPUT): Use them instead of appending to + list macros. + + * acgeneral.m4 (AC_CACHE_SAVE): Handle cache variable values + correctly even if they contain single quote, or are quoted by + the shell. From Paul Eggert . + (AC_INIT_PREPARE): Set LC_MESSAGES to C if set. + From Hans Olsson . + Set LC_CTYPE to C if set. + From tom@vlsivie.tuwien.ac.AT (Thomas Winder). + * autoconf.sh, autoheader.sh: Likewise set LC_MESSAGES and LC_CTYPE. + +Tue Nov 19 10:29:06 1996 David J MacKenzie + + * testsuite/autoconf.g/sizeof.exp: Use the v2 macro name. + + * acgeneral.m4 (AC_OUTPUT_FILES, AC_OUTPUT_HEADER): Support + creating output files from multiple pieces, concatenated. + Suggested by "Theodore Ts'o" . + (AC_LINK_FILES): If called more than once, concatenate the + arguments. From Roland McGrath. + (AC_CONFIG_SUBDIRS): Likewise. + (AC_OUTPUT_COMMANDS): New macro. Suggested by + Tom Tromey . + (AC_OUTPUT): Use the lists it sets. + + * acgeneral.m4 (AC_TRY_RUN_NATIVE): Fail if linking fails, like + AC_TRY_LINK. + (AC_TRY_RUN): Don't require AC_C_CROSS. + (AC_TRY_COMPILER): New macro. + (AC_LANG_C, AC_LANG_CPLUSPLUS): Set cross_compiling. + * acspecific.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): Use + AC_TRY_COMPILER instead of AC_TRY_LINK. + (AC_PROG_CC_GNU, AC_PROG_CC_G): Split out of AC_PROG_CC. + (AC_PROG_CXX_GNU, AC_PROG_CXX_G): Split out of AC_PROG_CXX. + For the *_G macros, make the cache variable names non-GNU-specific. + (AC_C_CROSS): Mark obsolete, and otherwise a no-op. + + * AUTHORS: New file. + * Makefile.in (DISTFILES): Add it. + + * acspecific.m4 (AC_FUNC_MMAP): Update the getpagesize + declarations from getpagesize.h. Check for unistd.h. + + * acgeneral.m4 (AC_OUTPUT_FILES): Run the eval in a subshell. + + * acfunctions: Map fnmatch, strftime, getpgrp, setpgrp to their + own macros. + + * acgeneral.m4 (AC_OUTPUT_HEADER): Check that $CONFIG_HEADERS is + unset, not that it's empty. + +Mon Nov 18 10:24:50 1996 David J MacKenzie + + * Version 2.11. + +Sun Nov 17 20:12:05 1996 David J MacKenzie + + * acspecific.m4 (AC_FUNC_STRCOLL): Make the checking message more + accurate. + +Thu Nov 14 11:15:27 1996 David J MacKenzie + + * acheaders: Add entry for malloc.h. Make the strings.h entry + suggest AC_CHECK_HEADERS instead of AC_HEADER_STDC. + + * acgeneral.m4 (AC_INIT_PARSE_ARGS): Move initialization of + ac_max_here_lines here from AC_OUTPUT_HEADER. + + * autoheader.sh: Take the multiple-include protection back out. + It's not needed for a file that just #defines stuff, and, as Ken + Raeburn pointed out in Apr 1994: + Since you don't make it optional, and you don't give the writer of + configure.in much control over the name of the symbol, it also would + prevent one "config.h" file in a subdirectory from including + "../config.h" as a way to avoid duplicating some common tests. + + * acspecific.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): Don't try + running a program, just try linking. + (AC_C_CROSS): Make the wording clearer. + +Wed Nov 13 10:07:14 1996 David J MacKenzie + + * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): Check whether the + compiler works before checking whether it's a GNU compiler. + (AC_FUNC_VFORK): Call _exit after perror. + (AC_PATH_XTRA): Go back to using -R, as setting an env var as part + of CC doesn't get eval'd correctly to actually work. + Directly test whether a space is needed after -R. + Don't add "-L" to LDFLAGS if $x_libraries is empty. + (AC_FUNC_STRFTIME): Check for it in -lintl only if it's not in the + normal libraries. + + * Test release 2.10.3. + + * testsuite/Makefile.in (dejacheck): New target, suggested by Tom + Tromey . + (check): Depend on dejacheck. + +Tue Nov 12 00:06:14 1996 David J MacKenzie + + * acgeneral.m4 (AC_OUTPUT_FILES): Split the list of sed commands in + conftest.subs into multiple files named conftest.s[1-9][0-9]*. + Create a pipeline of sed commands that use these files, then delete + the temporary files. From John W. Eaton . + + * acspecific.m4 (AC_AIX, AC_MINIX): Remove warnings about AC_TRY_LINK. + These macros don't change the linkage options. + + * Test release 2.10.2. + + * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX) [GCC]: Use -O2 instead + of -O. Suggested by fnf@ninemoons.com (Fred Fish). + + * acgeneral.m4 (AC_OUTPUT_HEADER): Support passing + AC_CONFIG_HEADER a value containing shell variables. Suggested by + Markku Savela and Julian Onions + . + * acgeneral.m4 (AC_TRY_RUN_NATIVE, AC_TRY_LINK, AC_TRY_COMPILE, + AC_TRY_CPP): Show the test program in config.log if the test fails. + From Karl Berry . + + * testsuite/config/unix.exp: Run the configure script as "./script" + in case the user doesn't have "." in their PATH. + +Mon Nov 11 18:02:58 1996 David J MacKenzie + + * acgeneral.m4 (AC_TRY_COMPILE, AC_TRY_LINK): Deal with smart + compilers that know that an unused function doesn't have to be + linked in: call the function directly from main(). + (Removing a legacy from when they tried to run the code, I think-djm.) + From fnf@ninemoons.com (Fred Fish). + + * acspecific.m4 (AC_FUNC_GETLOADAVG): Rename ac_save_LIBS to avoid + a clash with AC_CHECK_LIB. + From Jim Meyering . + (AC_FUNC_FNMATCH, AC_FUNC_MMAP, AC_FUNC_VFORK, AC_FUNC_WAIT3, + AC_FUNC_STRCOLL, AC_FUNC_MEMCMP): Rename cache variables to avoid + wrong results if someone calls AC_CHECK_FUNC for these functions. + + * autoheader.sh: Don't cmp with config.h.in if it doesn't exist yet. + Don't frob lines 1-@TOP@ or @BOTTOM@-end of acconfig.h's. + Accept TAB as well as SPC after #undef in acconfig.h's. + +Sat Nov 9 01:54:04 1996 David J MacKenzie + + * Test release 2.10.1. + + * acspecific.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): New macros + adapted from Bruno Haible . + (AC_PROG_CC, AC_PROG_CXX): Use them. + * acgeneral.m4 (AC_TRY_RUN_NATIVE): Split out of AC_TRY_RUN. + (AC_TRY_LINK): Check that the executable exists after linking. + (AC_EGREP_CPP): Disable m4 quote chars around egrep, so [] in regexps + isn't eaten. + + * autoheader.sh: Add multiple-inclusion protection for config.h. + + * acgeneral.m4 (AC_PREFIX_PROGRAM): Pretty up the output. + (AC_CHECK_LIB): Include the function being tested in the message. + (AC_CHECK_PROG, AC_PATH_PROG): Add a dummy variable to force word + splitting on the path. + + * acspecific.m4 (AC_FUNC_MMAP): Remove check and uses of valloc. + It turns out it's a separate issue, for GNU grep. + Replace the test program with a new version from Mike Haertel. + + * acgeneral.m4 (AC_CACHE_SAVE): Accept the HP-UX sh 'set' output + format. From Marcus Daniels . + + * acgeneral.m4 (AC_MSG_CHECKING, AC_CHECKING): Write a message to + config.log also. From "T.E.Dickey" . + (AC_CHECK_LIB, AC_CHECK_HEADER, AC_CHECK_HEADERS): Replace use of + tr with sed, to avoid a bug in the AIX 4.1.3.0 tr reported by + Alain KNAFF . He says that version of + tr interprets \055 as a range specifier, like an unquoted -. + * acspecific.m4 (AC_PROG_MAKE_SET, AC_CHECK_HEADER_DIRENT, + AC_CHECK_HEADERS_DIRENT): Ditto. + + * acspecific.m4 (AC_FUNC_SETPGRP): New macro. + * acconfig.h (SETPGRP_VOID): New entry. + From "T.E.Dickey" . + + * acspecific.m4 (AC_PATH_X_DIRECT): Try /lib/usr/lib/X11 for A/UX. + From Guillermo Gomez . + (AC_PATH_XTRA): Replace -R with adding LD_RUN_PATH to CC in the + Solaris kludge. Suggested by Paul Eggert . + Define X_DISPLAY_MISSING with AC_DEFINE, and + if not using X, clear out the X variables. + Check system-dependent libs before system-independent ones. + Check for more system-dependent libs. + From Karl Berry. + Use AC_CHECK_FUNC in the system-dependent libs tests. + From Larry Schwimmer . + Wart removal: Don't require AC_ISC_POSIX. + (AC_ISC_POSIX): Require AC_PROG_CC, since it uses $GCC. + From gvran@uddeborg.pp.se. + Don't blather about being called before AC_TRY_LINK, + which is now called in AC_PROG_CC. Don't encourage using this macro. + * acconfig.h (X_DISPLAY_MISSING): Add entry. + +Fri Nov 8 16:02:08 1996 David J MacKenzie + + * acspecific.m4 (AC_PATH_X_DIRECT): Search for /usr/X11 before + /usr/X11Rn, etc. From bostic@bsdi.com (Keith Bostic). + + * acgeneral.m4 (AC_CHECK_TYPE) [STDC_HEADERS]: Check in stddef.h, too. + From "Glenn P. Davis" . + Don't require the second char after the type name to be a space. + (AC_TRY_RUN): Remove the test files before executing the "failure" + case code. + + * acspecific.m4 (AC_PROG_CXX): Check for cc++ for NexT. + From Carl Edman . + (AC_PROG_CC, AC_PROG_CXX): Check whether -g works even if + C[XX]FLAGS is set. From T.E.Dickey + (AC_FUNC_FNMATCH): New macro. + * acconfig.h (HAVE_FNMATCH): New entry. + + * acgeneral.m4 (AC_REPLACE_FUNCS): Call AC_CHECK_FUNCS to do the work. + +Tue Oct 29 13:03:44 1996 Doug Evans + + * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Fix thinko in computation of + ac_sub_srcdir in relative but not "." case. + +Thu Oct 10 22:29:37 1996 David J MacKenzie + + * acgeneral.m4 (AC_CANONICAL_HOST, AC_CANONICAL_TARGET, + AC_CANONICAL_BUILD): Allow the os part of the string returned by + config.sub to contain dashes, as in "linux-gnu". + +Fri Jul 19 16:59:00 1996 Roland McGrath + + * acgeneral.m4 (AC_CHECK_TYPE): Add dnl so regexp doesn't have a + leading newline. + +Wed Jun 12 13:56:57 1996 David J MacKenzie -Tue Jun 11 23:41:10 1996 Tom Yu + * acgeneral.m4 (AC_CHECK_TYPE): Remove extra ')'. - * acgeneral.m4 (AC_OUTPUT_FILES): allow for multiple files in - AC_OUTPUT; this is done via - AC_OUTPUT(outfile[:infile1[+infile2[+infile3...]]]). The - source files are concatenated and substituted over. + * Many files: Update the FSF street address. + +Sun Jun 9 17:54:23 1996 Roland McGrath + + * acgeneral.m4 (AC_CHECK_LIB): Add missing \ in last change. + +Fri Jun 7 11:54:58 1996 Roland McGrath + + * acgeneral.m4 (AC_CHECK_LIB): Identifierize lib name in $ac_tr_lib. + +Mon May 27 13:49:02 1996 Roland McGrath + + * acspecific.m4 (AC_SYS_LONG_FILE_NAMES): If $TMPDIR names an + existing, writable directory, then test it instead of /tmp, /var/tmp, + and /usr/tmp for long file name support. + + * acgeneral.m4 (AC_PREREQ): Prepend "FATAL ERROR: " to msg. + +Sun May 26 19:07:15 1996 Roland McGrath + + * acspecific.m4 (AC_PROG_MAKE_SET): Sanitize $MAKE for use as + identifier. + + * acgeneral.m4 (AC_CHECK_TYPE): Tighten regexp so ulong doesn't match + ulong_t. + + * autoheader.sh: Put $syms in a temporary file and use fgrep -f. Tue May 7 13:20:33 1996 Roland McGrath - * acgeneral.m4: Verion 2.10 released. + * acgeneral.m4: Version 2.10 released. Tue Mar 26 13:03:12 1996 Roland McGrath @@ -1484,8 +1754,6 @@ Tue May 24 18:49:35 1994 David J. Mackenzie (djm@rtl.cygnus.com) (AC_CACHE_WRITE): Set the cache values only if not already set. (AC_PARSEARGS, AC_OUTPUT): Allow giving an empty prefix or exec_prefix. - AC_CONFIG_AUXDIR*. - * acgeneral.m4, acspecific.m4: Rename AC_CONFIG_AUX* to AC_CONFIG_AUXDIR*. diff --git a/src/util/autoconf/INSTALL b/src/util/autoconf/INSTALL index a2c8722cc..50dbe439d 100644 --- a/src/util/autoconf/INSTALL +++ b/src/util/autoconf/INSTALL @@ -167,7 +167,9 @@ operates. `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually diff --git a/src/util/autoconf/Makefile.in b/src/util/autoconf/Makefile.in index 29a69b6c2..14004d1e2 100644 --- a/src/util/autoconf/Makefile.in +++ b/src/util/autoconf/Makefile.in @@ -13,7 +13,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. #### Start of system configuration section. #### @@ -60,7 +61,7 @@ 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 \ +DISTFILES = AUTHORS COPYING ChangeLog ChangeLog.1 INSTALL \ Makefile.in NEWS README TODO $(M4FILES) \ acconfig.h acfunctions acheaders acidentifiers \ acmakevars acprograms autoconf.info* \ diff --git a/src/util/autoconf/NEWS b/src/util/autoconf/NEWS index aa01cad1f..dc8e6e1e7 100644 --- a/src/util/autoconf/NEWS +++ b/src/util/autoconf/NEWS @@ -1,3 +1,27 @@ +Major changes in release 2.12: + +* AC_OUTPUT and AC_CONFIG_HEADER can create output files by + concatenating multiple input files separated by colons, like so: + AC_CONFIG_HEADER(config.h:conf.pre:config.h.in:conf.post) + AC_OUTPUT(Makefile:Makefile.in:Makefile.rules) + The arguments may be shell variables, to compute the lists on the fly. +* AC_LINK_FILES and AC_CONFIG_SUBDIRS may be called multiple times. +* New macro AC_OUTPUT_COMMANDS adds more commands to run in config.status. +* Bug fixes. + +Major changes in release 2.11: + +* AC_PROG_CC and AC_PROG_CXX check whether the compiler works. + They also default CFLAGS/CXXFLAGS to "-g -O2" for gcc, instead of "-g -O". +* AC_REPLACE_FUNCS defines HAVE_foo if the system has the function `foo'. +* AC_CONFIG_HEADER expands shell variables in its argument. +* New macros: AC_FUNC_FNMATCH, AC_FUNC_SETPGRP. +* The "checking..." messages and the source code for test programs that + fail are saved in config.log. +* Another workaround has been added for seds with small command length limits. +* config.sub and config.guess recognize more system types. +* Bug fixes. + Major changes in release 2.10: * Bug fixes. diff --git a/src/util/autoconf/TODO b/src/util/autoconf/TODO index 819a50336..c6b7ac847 100644 --- a/src/util/autoconf/TODO +++ b/src/util/autoconf/TODO @@ -38,7 +38,7 @@ these suggestions... their presence here doesn't imply my endorsement. ------------------------------------------------------------------------------ -* Doc: Add concept index. +* Doc: Add a concept index. ------------------------------------------------------------------------------ @@ -52,17 +52,10 @@ these suggestions... their presence here doesn't imply my endorsement. 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.) +* Allow [ and ] in AC_DEFINE args. ------------------------------------------------------------------------------ @@ -77,9 +70,6 @@ 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. @@ -94,7 +84,7 @@ in a dnl comment. (Seems to be hard.) * Look at user contributed macros: prototypes IEEE double precision math - shared libraries + more ------------------------------------------------------------------------------ @@ -108,23 +98,12 @@ In config.status comment, put the host/target/build types, if used. ------------------------------------------------------------------------------ -Support a way of including makefile fragments that then have @var@ -substitutions done on them. - ------------------------------------------------------------------------------- - Have AC_CANONICAL_* cache the host/build/target types. They have to be overridden by the command line arguments, just as for X includes and libraries. Should they be cached all in one variable, or three? In that case, what if only one or two of the cache variables are set? ------------------------------------------------------------------------------- - -Look at contributions: - ac_include (Karl Berry) - aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman) - ------------------------------------------------------------------------------ The argument HELP-STRING is a description of the option which @@ -145,15 +124,6 @@ From: roland@gnu.ai.mit.edu (Roland McGrath) ------------------------------------------------------------------------------ -autoconf-2.1 AC_EGREP_HEADER does not work if [square brackets] -are used in the egrep pattern. This makes egrep fairly useless to -find, for example, a space or tab followed by something. - -Putting changequotes around the PATTERN parameter makes no difference. --Jim Avera (jima@netcom.com) - ------------------------------------------------------------------------------- - AC_MSG_CHECKING([checking for ANSI #stringize]) AC_REVISION([ #(@) revision 2.1 ]) @@ -179,6 +149,16 @@ is conftest.c -> -> -> #undef $ac_func From: kwzh@gnu.ai.mit.edu (Karl Heuer) +The test for the isascii function was failing because that function is +also a macro. He proposed that the test file look like this: + +/* Remove any macro definition. */ +#undef isascii +/* Override any gcc2 internal prototype to avoid an error. */ +char isascii(); isascii(); + +Andreas Schwab + ------------------------------------------------------------------------------ put all the config.* stuff somewhere like config/? @@ -307,18 +287,7 @@ From Paul Eggert. ------------------------------------------------------------------------------ -Make easy macros for checking for X functions and libraries. - ------------------------------------------------------------------------------- - -Testing for ANSI header files (AC_HEADER_STDC) fails under linux when -using the latest libraries (libc-4.6.30, at least libc-4.6.27 works -ok) when LC_CTYPE is set to ISO-8859-1. The islower/toupper test -reports errors. -Anyway, adding a line like -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -to the configure script can solve the problem. -From: tom@vlsivie.tuwien.ac.AT (Thomas Winder) +Make easy macros for checking for X functions and libraries, such as Motif. ------------------------------------------------------------------------------ @@ -328,3 +297,284 @@ From: tom@vlsivie.tuwien.ac.AT (Thomas Winder) and so does AC_CONFIG_HEADER when autoconf is run. ------------------------------------------------------------------------------ + +Autoheader in autoconf-2.4 doesn't produce entries for: + + AC_CHECK_TYPE(ssize_t, int) + +and it seems like it could easily do so. + +In general, it seems to me like autoconf isn't set up to +let me periodically run autoheader, and then include my +"local" tests -- autoheader gets most stuff right, I'd like +to rerun it periodically without losing my local changes +to config.h.in. + +One of the things that I need is to know is the type to use +for a fixed size on disk, e.g., what is the system's name +for an unsigned-32-bit integer? + +I can use: + + AC_CHECK_SIZEOF(unsigned int) + +and, in fact, that's what I do. But I still have to build +sets of #if tests to get from there to the name of the type. + +From: bostic@bsdi.com (Keith Bostic) + +------------------------------------------------------------------------------ + +There are basically three ways to lock files + lockf, fnctl, flock +I'd be interested in adding a macro to pick the "right one" if you're +interested. + +From: Rich Salz + +------------------------------------------------------------------------------ + +It is IMHO a bug that `config.status' cannot handle multiple +simultaneous invocations. It should include the process id (`$$' in sh) +as part of the name of any temporary files it creates. + +From: fjh@kryten.cs.mu.oz.au (Fergus Henderson) + +------------------------------------------------------------------------------ + +Timezone calculations checks. + +------------------------------------------------------------------------------ + +Support different default filesystem layouts, e.g. SVR4, Linux. +Of course, this can be done locally with config.site. + +------------------------------------------------------------------------------ + +Mention automake, libtool, etc. in the autoconf manual. + +------------------------------------------------------------------------------ + +I wonder if it is possible to get the path for X11's app-defaults +directory by autoconf. Moreover, I'd like to have a general way of +accessing imake variables by autoconf, something like + +AC_DEFINE(WINE_APP_DEFAULTS, AC_IMAKE_VAR(XAPPLOADDIR)) + +Slaven Rezic + +------------------------------------------------------------------------------ + +Question: at least one common UNIX variant has a "cc" that is old K&R +and "c89" for ANSI C. Is there any reason why AC_PROG_CC couldn't +check for c89 before cc if it can't find gcc? + +hpa@yggdrasil.com (H. Peter Anvin) + +------------------------------------------------------------------------------ + +Cache consistency checking: ignore cache if environment +(CC or PATH) differs. +From Mike Haertel + +So we need a general mechanism for storing variables' values in the cache, +and checking if they are the same after reading the cache. Then we can add +to the list of variables as we come across the need. So far we want +LD_LIBRARY_PATH and the internal variables for some of (all?) the args. +From: roland@gnu.ai.mit.edu (Roland McGrath) + +Hmm. That list might include LD_LIBRARY_PATH, LD_RUN_PATH (for solaris), +and PATH. I can't think of any others so far. +From: friedman@splode.com (Noah Friedman) + +------------------------------------------------------------------------------ + +So how about an option to configure --reset-cache, that says to ignore all +existing cached values for tests that configure runs, and then update the +cache normally. This should be utterly trivial to do in AC_CACHE_VAL; +check the flag variable and always compute the value if it's set. + +------------------------------------------------------------------------------ + +A number of people have tried to fix configuration problems by editing +acconfig.h. (Despite comments at the top of the file.) I think they're +confused because anything.h looks like a regular source file name. +Maybe acconfig.h could be called acconfig.extra or something? + +From: kb@cs.umb.edu (K. Berry) + +------------------------------------------------------------------------------ + +Every user running +X11 usually has a directory like *X11* in his PATH variable. By replacing +bin by include, you can find good places to look for the include files +or libraries. + +From: rcb5@win.tue.nl (Richard Verhoeven) + +------------------------------------------------------------------------------ + +When using CONFIG_FILES= and CONFIG_HEADERS= for controlling +partial configuration, any AC_LINK_FILES is repeated in each case +(that is, usually, once for config.h and once per subdirectory). +This is not elegant. + +Maybe Autoconf could use some kind of CONFIG_LINKS=, +having all such AC_LINK(ed)_FILES by default, but usable by each +Makefile.in in rules for updating the particular links they need. + +From: pinard@iro.umontreal.ca + +------------------------------------------------------------------------------ + +Perhaps autoconf could have a single @magic@ frob that gets replaced with +assignments for all the *dir variables? There is quite a plethora for each +Makefile.in to have foodir = @foodir@. + +From: Roland McGrath + +------------------------------------------------------------------------------ + +In most cases, when autoscan suggests something, using the search +or index command into the Info reader for autoconf manual quickly +explains me what the test is about. However, for header files +and functions, the search might fail, because the test is not of +the specific kind. The Autoconf manual should reflect somewhere +all header files or functions (non-specific features, generally) +triggering autoscan to generate tests, and tell in a few words +what is the problem, and the suggested approach for a solution; +that is, how one should use the result of testing the feature. + +From: pinard@iro.umontreal.ca + +------------------------------------------------------------------------------ + +It would be nice if the configure script would handle an option such as +--x-libraries="/usr/openwin/lib /usr/dt/lib". + +Rick Boykin + +Under Solaris 2.4, the regular X includes and libs and the Motif +includes and libs are in different places. The Emacs configure script +actually allows dir1:dir2:dir3 -- + + if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then + LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` + LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` + fi + if test "${x_includes}" != NONE && test -n "${x_includes}"; then + C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` + fi + +------------------------------------------------------------------------------ + + What messages should be produced by default, if any? + +Probably only the few most important ones, like which configuration +name was used, whether X or Xt are in use, etc. The specific +decisions, and progress messages, should be recorded on the terminal +only if --verbose is used. + + --silent just supresses the "checking for...result" + messages, not the "creating FOO" messages. + +I think the default should be to suppress both. +From: Richard Stallman + +There is no distinction now between +important decisions (we have X) vs minor decisions (we have lstat). +However, there are probably only a few things you deem important enough to +announce and only those few things will need to be changed. +Perhaps config.status could be written with comments saying what was +decided. +From: Roland McGrath + +------------------------------------------------------------------------------ + +Use automake to generate autoconf's Makefile.in's? + +------------------------------------------------------------------------------ + +about the idea of using small configure.in/aclocal.m4 snippets: +this is the one idea in metaconfig (the autoconf-like program used by +Perl) that I like. metaconfig looks for a "U" directory, and includes +each ".U" file into the generated Configure script (according to +various complicated rules). +From: Tom Tromey + +------------------------------------------------------------------------------ + +I'd much prefer to see the absolute paths substituted for all the +standard "dir" variables. It would be nice to have variables in +configure that held the absolute paths. And it is nice to be able to +substitute them into other files without relying on the destination +file supporting ${...} syntax. (It works in Perl, sh, and make -- +but not guile) + +From: Tom Tromey + +------------------------------------------------------------------------------ + +Another thing I wish for is a macro which figures out which libraries are +needed for BSD-sytle sockets. AC_PATH_X already detects this +correctly...so it's just a matter of seperating out the socket-related code. +From: "Joel N. Weber II" + +------------------------------------------------------------------------------ + +Merge the two lex macros, AC_PROG_LEX and AC_DECL_YYTEXT? + +------------------------------------------------------------------------------ + +in order to use the AC_CANONICAL_SYSTEM macro, I have to +have install-sh somewhere nearby --- why is this? I have no real +reason to distribute install-sh, other than that its absence breaks +this code. + +Shouldn't the above loop be looking for config.sub and config.guess? +From: jimb@totoro.bio.indiana.edu (Jim Blandy) + +adding AC_CANONICAL_HOST to my configure.in script caused +all sorts of odd/unexplained errors. Obviously, I had to go +get copies of config.guess, config.sub and install-sh from the +autoconf distribution, but the error messages and autoconf docs +didn't explain that very well. +From: bostic@bsdi.com (Keith Bostic) + +------------------------------------------------------------------------------ + +Perhaps also have AC_TRY_COMPILER try to link an invalid program, and +die if the compiler seemed to succeed--in which case it's not usable +with autoconf scripts. + +------------------------------------------------------------------------------ + +there is absolutely no guarantee that 'a' to 'z' are +contiguous, and the ISLOWER macro is not guaranteed to correctly +reproduce the result of islower. In all variants of ASCII however, it +will work correctly in the C locale. + +There is also no guarantee that toupper(i) - i is the same constant if +non-zero. TOUPPER, hence, is not correct either. But, in all variants +of ASCII in the C locale, it works. + +Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov> + +------------------------------------------------------------------------------ + +autoreconf doesn't support having (in the same tree) both directories +that are parts of a larger package (sharing aclocal.m4 and acconfig.h), +and directories that are independent packages (each with their own ac*). +It assumes that they are all part of the same package, if you use --localdir, +or that each directory is a separate package, if you don't use it. + +autoreconf should automatically figure out which ac* files to use--the +closest ones up the tree from each directory, probably, unless +overridden by --localdir. + +Also, autoreconf recurses on all subdirectories containing a +configure.in, not just those given by an AC_CONFIG_SUBDIRS directive. +This may not be a problem in practice. + +------------------------------------------------------------------------------ + diff --git a/src/util/autoconf/acconfig.h b/src/util/autoconf/acconfig.h index abbb64245..5bf096c52 100644 --- a/src/util/autoconf/acconfig.h +++ b/src/util/autoconf/acconfig.h @@ -67,6 +67,9 @@ /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT +/* Define if your system has a working fnmatch function. */ +#undef HAVE_FNMATCH + /* Define if your system has its own `getloadavg' function. */ #undef HAVE_GETLOADAVG @@ -179,6 +182,9 @@ /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE +/* Define if the `setpgrp' function takes no argument. */ +#undef SETPGRP_VOID + /* Define if the setvbuf function takes the buffering type as its second argument and the buffer pointer as the third, as on System V before release 3. */ @@ -243,6 +249,9 @@ byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + /* Define if lex declares yytext as a char * by default, not a char[]. */ #undef YYTEXT_POINTER diff --git a/src/util/autoconf/acfunctions b/src/util/autoconf/acfunctions index 5947ba69a..3c04834bf 100644 --- a/src/util/autoconf/acfunctions +++ b/src/util/autoconf/acfunctions @@ -14,12 +14,16 @@ memset AC_HEADER_STDC index AC_HEADER_STDC rindex AC_HEADER_STDC getgroups AC_TYPE_GETGROUPS +getpgrp AC_FUNC_GETPGRP +setpgrp AC_FUNC_SETPGRP signal AC_TYPE_SIGNAL alloca AC_FUNC_ALLOCA +fnmatch AC_FUNC_FNMATCH getloadavg AC_FUNC_GETLOADAVG mmap AC_FUNC_MMAP setvbuf AC_FUNC_SETVBUF_REVERSED strcoll AC_FUNC_STRCOLL +strftime AC_FUNC_STRFTIME utime AC_FUNC_UTIME_NULL vfork AC_FUNC_VFORK vprintf AC_FUNC_VPRINTF @@ -28,7 +32,6 @@ 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 @@ -49,7 +52,6 @@ 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 diff --git a/src/util/autoconf/acgeneral.m4 b/src/util/autoconf/acgeneral.m4 index 4e3d2a870..fee0215d9 100644 --- a/src/util/autoconf/acgeneral.m4 +++ b/src/util/autoconf/acgeneral.m4 @@ -15,7 +15,8 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. dnl dnl As a special exception, the Free Software Foundation gives unlimited dnl permission to copy, distribute and modify the configure scripts that @@ -51,7 +52,7 @@ dnl divert(-1)dnl Throw away output until AC_INIT is called. changequote([, ]) -define(AC_ACVERSION, 2.10) +define(AC_ACVERSION, 2.12) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -71,17 +72,20 @@ 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 except that we explicitly undivert AC_DIVERSION_SED, AC_DIVERSION_CMDS, +dnl and AC_DIVERSION_ICMDS. dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line define(AC_DIVERSION_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 +define(AC_DIVERSION_NORMAL_4, 3)dnl AC_REQUIRE'd code, 4 level deep +define(AC_DIVERSION_NORMAL_3, 4)dnl AC_REQUIRE'd code, 3 level deep +define(AC_DIVERSION_NORMAL_2, 5)dnl AC_REQUIRE'd code, 2 level deep +define(AC_DIVERSION_NORMAL_1, 6)dnl AC_REQUIRE'd code, 1 level deep +define(AC_DIVERSION_NORMAL, 7)dnl the tests and output code +define(AC_DIVERSION_SED, 8)dnl variable substitutions in config.status +define(AC_DIVERSION_CMDS, 9)dnl extra shell commands in config.status +define(AC_DIVERSION_ICMDS, 10)dnl extra initialization in config.status dnl Change the diversion stream to STREAM, while stacking old values. dnl AC_DIVERT_PUSH(STREAM) @@ -184,6 +188,10 @@ verbose= x_includes=NONE x_libraries=NONE dnl Installation directory options. +dnl These are left unexpanded so users can "make install exec_prefix=/foo" +dnl and all the variables that are supposed to be based on exec_prefix +dnl by default will actually change. +dnl Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -200,6 +208,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -626,11 +636,14 @@ changequote([, ])dnl 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 +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. 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 "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -804,7 +817,8 @@ dnl PRINTABLE2) define(AC_PREREQ_COMPARE, [ifelse(builtin([eval], [$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1, -[errprint(Autoconf version $7 or higher is required for this script +[errprint(dnl +FATAL ERROR: Autoconf version $7 or higher is required for this script )m4exit(3)])]) dnl Complain and exit if the Autoconf version is less than VERSION. @@ -915,10 +929,12 @@ NONE) esac dnl Set the other host vars. +changequote(<<, >>)dnl 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/'` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +changequote([, ])dnl AC_MSG_RESULT($host) AC_SUBST(host)dnl AC_SUBST(host_alias)dnl @@ -943,10 +959,12 @@ NONE) esac dnl Set the other target vars. +changequote(<<, >>)dnl 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/'` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +changequote([, ])dnl AC_MSG_RESULT($target) AC_SUBST(target)dnl AC_SUBST(target_alias)dnl @@ -971,10 +989,12 @@ NONE) esac dnl Set the other build vars. +changequote(<<, >>)dnl 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/'` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +changequote([, ])dnl AC_MSG_RESULT($build) AC_SUBST(build)dnl AC_SUBST(build_alias)dnl @@ -1035,13 +1055,27 @@ define(AC_CACHE_SAVE, # --recheck option to rerun configure. # EOF -changequote(, )dnl dnl Allow a site initialization script to override cache values. +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. +changequote(, )dnl (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache changequote([, ])dnl if cmp -s $cache_file confcache; then : @@ -1126,11 +1160,13 @@ dnl ### Printing messages dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION) define(AC_MSG_CHECKING, -[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG]) +[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG +echo "configure:__oline__: checking $1" >&AC_FD_CC]) dnl AC_CHECKING(FEATURE-DESCRIPTION) define(AC_CHECKING, -[echo "checking $1" 1>&AC_FD_MSG]) +[echo "checking $1" 1>&AC_FD_MSG +echo "configure:__oline__: checking $1" >&AC_FD_CC]) dnl AC_MSG_RESULT(RESULT-DESCRIPTION) define(AC_MSG_RESULT, @@ -1161,6 +1197,7 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' +cross_compiling=$ac_cv_prog_cc_cross ]) dnl AC_LANG_CPLUSPLUS() @@ -1171,6 +1208,7 @@ ac_ext=C ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' +cross_compiling=$ac_cv_prog_cxx_cross ]) dnl Push the current language on a stack. @@ -1241,7 +1279,10 @@ else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ifelse([$6], , , [ ac_prog_rejected=no ])dnl - for ac_dir in ifelse([$5], , $PATH, [$5]); do +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl bash word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + for ac_dir in ifelse([$5], , $PATH, [$5$ac_dummy]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ifelse([$6], , , dnl @@ -1302,7 +1343,10 @@ AC_CACHE_VAL(ac_cv_path_$1, ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$4], , $PATH, [$4]); do +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl bash word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + for ac_dir in ifelse([$4], , $PATH, [$4$ac_dummy]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_$1="$ac_dir/$ac_word" @@ -1385,7 +1429,8 @@ AC_DEFUN(AC_PREFIX_PROGRAM, changequote(<<, >>)dnl define(<>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl -AC_MSG_CHECKING([for prefix by ]) +dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. +echo $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG AC_PATH_PROG(AC_VAR_NAME, $1) changequote(<<, >>)dnl if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then @@ -1396,6 +1441,31 @@ fi undefine([AC_VAR_NAME])dnl ]) +dnl Sets WORKING_VAR to yes if the current compiler works, else no; +dnl sets CROSS-VAR to yes if it produces non-native executables, else no. +dnl Before calling this, call AC_LANG_* to set the right language. +dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR) +AC_DEFUN(AC_TRY_COMPILER, +[cat > conftest.$ac_ext </dev/null; then + [$3]=no + else + [$3]=yes + fi +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + [$2]=no +fi +rm -fr conftest*]) + dnl ### Checking for libraries @@ -1403,12 +1473,12 @@ 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_MSG_CHECKING([for $2 in -l$1]) dnl Use a cache variable name containing both the library and function name, dnl because the test really is for library $1 defining function $2, not dnl just for library $1. Separate tests with the same $1 and different $2s dnl may have different results. -ac_lib_var=`echo $1['_']$2 | tr './+\055' '__p_'` +ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" @@ -1425,14 +1495,15 @@ char $2(); ]), [$2()], eval "ac_cv_lib_$ac_lib_var=yes", - eval "ac_cv_lib_$ac_lib_var=no")dnl + eval "ac_cv_lib_$ac_lib_var=no") LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl - ac_tr_lib=HAVE_LIB`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-l$1 $LIBS" @@ -1457,7 +1528,7 @@ AC_MSG_CHECKING([for -l[]AC_LIB_NAME]) AC_CACHE_VAL(AC_CV_NAME, [ac_save_LIBS="$LIBS" LIBS="-l[]AC_LIB_NAME[] $4 $LIBS" -AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)dnl +AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no) LIBS="$ac_save_LIBS" ])dnl AC_MSG_RESULT($AC_CV_NAME) @@ -1498,6 +1569,8 @@ if test -z "$ac_err"; then $2]) else echo "$ac_err" >&AC_FD_CC + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC ifelse([$3], , , [ rm -rf conftest* $3 ])dnl @@ -1523,7 +1596,10 @@ EOF dnl eval is necessary to expand ac_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | +dnl Prevent m4 from eating character classes: +changequote(, )dnl egrep "$1" >/dev/null 2>&1; then +changequote([, ])dnl ifelse([$3], , :, [rm -rf conftest* $3]) ifelse([$4], , , [else @@ -1547,21 +1623,21 @@ dnl [#]line __oline__ "[$]0" [#]line __oline__ "configure" #include "confdefs.h" [$1] -int main() { return 0; } -int t() { +int main() { [$2] ; return 0; } EOF if AC_TRY_EVAL(ac_compile); then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi -rm -f conftest*] -) +rm -f conftest*]) dnl ### Examining libraries @@ -1573,7 +1649,7 @@ AC_DEFUN(AC_COMPILE_CHECK, [AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl ifelse([$1], , , [AC_CHECKING([for $1]) ])dnl -AC_TRY_LINK([$2], [$3], [$4], [$5])dnl +AC_TRY_LINK([$2], [$3], [$4], [$5]) ]) dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY, @@ -1585,21 +1661,21 @@ dnl [#]line __oline__ "[$]0" [#]line __oline__ "configure" #include "confdefs.h" [$1] -int main() { return 0; } -int t() { +int main() { [$2] ; return 0; } EOF -if AC_TRY_EVAL(ac_link); then +if AC_TRY_EVAL(ac_link) && test -s conftest; then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi -rm -f conftest*] -) +rm -f conftest*]) dnl ### Checking for run-time features @@ -1608,15 +1684,21 @@ dnl ### Checking for run-time features dnl AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE dnl [, ACTION-IF-CROSS-COMPILING]]]) AC_DEFUN(AC_TRY_RUN, -[AC_REQUIRE([AC_C_CROSS])dnl -if test "$cross_compiling" = yes; then +[if test "$cross_compiling" = yes; then ifelse([$4], , [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling )dnl AC_MSG_ERROR(can not run test program while cross compiling)], [$4]) else -cat > conftest.$ac_ext < conftest.$ac_ext </dev/null; then +if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>/dev/null +then +dnl Don't remove the temporary files here, so they can be examined. ifelse([$2], , :, [$2]) -ifelse([$3], , , [else +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$3], , , [ rm -fr conftest* $3 ])dnl fi -fi rm -fr conftest*]) @@ -1642,7 +1727,7 @@ 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_safe=`echo "$1" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(ac_cv_header_$ac_safe, [AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes", @@ -1663,7 +1748,7 @@ AC_DEFUN(AC_CHECK_HEADERS, do AC_CHECK_HEADER($ac_hdr, [changequote(, )dnl - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl done @@ -1701,7 +1786,7 @@ choke me #else $1(); #endif -], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl +], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")]) if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) @@ -1724,12 +1809,9 @@ changequote([, ])dnl done ]) -dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) +dnl AC_REPLACE_FUNCS(FUNCTION...) AC_DEFUN(AC_REPLACE_FUNCS, -[for ac_func in $1 -do -AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) -done +[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) AC_SUBST(LIBOBJS)dnl ]) @@ -1770,9 +1852,13 @@ 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 +[AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<<$1[^a-zA-Z_0-9]>>dnl +changequote([,]), [#include #if STDC_HEADERS #include +#include #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then @@ -1792,18 +1878,32 @@ 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 +define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl +define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])]) + +dnl Add additional commands for AC_OUTPUT to put into config.status. +dnl Use diversions instead of macros so we can be robust in the +dnl presence of commas in $1 and/or $2. +dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS) +AC_DEFUN(AC_OUTPUT_COMMANDS, +[AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl +[$1] +AC_DIVERT_POP()dnl +AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)dnl +[$2] +AC_DIVERT_POP()]) dnl AC_CONFIG_SUBDIRS(DIR ...) AC_DEFUN(AC_CONFIG_SUBDIRS, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -define([AC_LIST_SUBDIRS], [$1])dnl +define([AC_LIST_SUBDIRS], ifdef([AC_LIST_SUBDIRS], [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 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 @@ -1879,12 +1979,13 @@ cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF]) +cat >> $CONFIG_STATUS <<\EOF +undivert(AC_DIVERSION_CMDS)dnl $2 exit 0 EOF @@ -1895,6 +1996,7 @@ dnl config.status should not do recursion. ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl ])dnl +dnl Set the DEFS variable to the -D options determined earlier. dnl This is a subroutine of AC_OUTPUT. dnl It is called inside configure, outside of config.status. dnl AC_OUTPUT_MAKE_DEFS() @@ -1916,8 +2018,10 @@ DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs ]) +dnl Do the variable substitutions to create the Makefiles or whatever. dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted -dnl here document whose contents are going into config.status. +dnl here document whose contents are going into config.status, but +dnl upon returning, the here document is being quoted. dnl AC_OUTPUT_FILES(FILE...) define(AC_OUTPUT_FILES, [# Protect against being on the right side of a sed subst in config.status. @@ -1934,25 +2038,59 @@ dnl Insert the sed substitutions of variables. undivert(AC_DIVERSION_SED) CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +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". +changequote(, )dnl + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) 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. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. -changequote(, )dnl ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` changequote([, ])dnl if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then @@ -1985,33 +2123,25 @@ changequote([, ])dnl *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac ])dnl + echo creating "$ac_file" rm -f "$ac_file" - # allow for outfile[:infile1[+infile2[+infile3...]]] syntax - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}+" - ac_files_in= - for ac_file_name in $ac_file_in - do - ac_files_in="$ac_files_in $ac_given_srcdir/$ac_file_name" - done - IFS="$ac_save_ifs" - configure_input=`echo $ac_files_in | sed 's%/./%/%g -s% *./%%g -s% *%+%g -s%^%Generated automatically from % -s%$% by configure.%'` + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` 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 -" -f conftest.subs $ac_files_in > $ac_file +dnl The parens around the eval prevent an "illegal io" in Ultrix sh. +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file dnl This would break Makefile dependencies. dnl if cmp -s $ac_file conftest.out 2>/dev/null; then dnl echo "$ac_file is unchanged" @@ -2021,9 +2151,10 @@ dnl rm -f $ac_file dnl mv conftest.out $ac_file dnl fi fi; done -rm -f conftest.subs +rm -f conftest.s* ]) +dnl Create the config.h files from the config.h.in files. dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted dnl here document whose contents are going into config.status. dnl AC_OUTPUT_HEADER(HEADER-FILE...) @@ -2049,19 +2180,29 @@ ac_eC=' ' ac_eD='%g' changequote([, ])dnl -CONFIG_HEADERS=${CONFIG_HEADERS-"$1"} +if test "${CONFIG_HEADERS+set}" != set; then +EOF +dnl Support passing AC_CONFIG_HEADER a value containing shell variables. +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". +changequote(, )dnl + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac +changequote([, ])dnl echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in EOF @@ -2095,8 +2236,6 @@ 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_here_lines=12 rm -f conftest.tail while : @@ -2253,13 +2392,18 @@ if test "$no_recursion" != yes; then ac_popdir=`pwd` cd $ac_config_dir +changequote(, )dnl + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +changequote([, ])dnl + 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 ;; + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; esac # Check for guested configure; otherwise get Cygnus style configure. @@ -2276,10 +2420,6 @@ if test "$no_recursion" != yes; then 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 -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` -changequote([, ])dnl case "$cache_file" in /*) ac_sub_cache_file=$cache_file ;; *) # Relative path. diff --git a/src/util/autoconf/acheaders b/src/util/autoconf/acheaders index 0363a38a1..fce653dca 100644 --- a/src/util/autoconf/acheaders +++ b/src/util/autoconf/acheaders @@ -5,7 +5,6 @@ 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 @@ -16,8 +15,10 @@ X11/Xlib.h AC_PATH_X # Others. fcntl.h AC_CHECK_HEADERS limits.h AC_CHECK_HEADERS +malloc.h AC_CHECK_HEADERS paths.h AC_CHECK_HEADERS sgtty.h AC_CHECK_HEADERS +strings.h AC_CHECK_HEADERS sys/file.h AC_CHECK_HEADERS sys/ioctl.h AC_CHECK_HEADERS sys/time.h AC_CHECK_HEADERS diff --git a/src/util/autoconf/acoldnames.m4 b/src/util/autoconf/acoldnames.m4 index 39e20b733..d31cdd754 100644 --- a/src/util/autoconf/acoldnames.m4 +++ b/src/util/autoconf/acoldnames.m4 @@ -14,7 +14,8 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. dnl dnl General macros. dnl diff --git a/src/util/autoconf/acspecific.m4 b/src/util/autoconf/acspecific.m4 index 0182dfd17..622d10786 100644 --- a/src/util/autoconf/acspecific.m4 +++ b/src/util/autoconf/acspecific.m4 @@ -14,7 +14,8 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. dnl dnl As a special exception, the Free Software Foundation gives unlimited dnl permission to copy, distribute and modify the configure scripts that @@ -77,35 +78,24 @@ if test -z "$CC"; then test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) fi -AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, -[dnl The semicolon is to pacify NeXT's syntax-checking cpp. -cat > conftest.c </dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi]) +AC_PROG_CC_WORKS +AC_PROG_CC_GNU + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g, -[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* -]) - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" fi else GCC= @@ -115,9 +105,79 @@ fi AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl -AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) + +AC_PROG_CXX_WORKS +AC_PROG_CXX_GNU + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +dnl Check whether -g works, even if CXXFLAGS is set, in case the package +dnl plays around with CXXFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + AC_PROG_CXX_G + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" + elif test $ac_cv_prog_cxx_g = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-O2" + fi +else + GXX= + test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" +fi +]) + +AC_DEFUN(AC_PROG_CC_WORKS, +[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_cc_works) +if test $ac_cv_prog_cc_works = no; then + AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) +fi +AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_cc_cross) +cross_compiling=$ac_cv_prog_cc_cross +]) -AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, +AC_DEFUN(AC_PROG_CXX_WORKS, +[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross) +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_cxx_works) +if test $ac_cv_prog_cxx_works = no; then + AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.]) +fi +AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_cxx_cross) +cross_compiling=$ac_cv_prog_cxx_cross +]) + +AC_DEFUN(AC_PROG_CC_GNU, +[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, +[dnl The semicolon is to pacify NeXT's syntax-checking cpp. +cat > conftest.c </dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi])]) + +AC_DEFUN(AC_PROG_CXX_GNU, +[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat > conftest.C </dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -fi]) -if test $ac_cv_prog_gxx = yes; then - GXX=yes - if test "${CXXFLAGS+set}" != set; then - AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g, -[echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then - ac_cv_prog_gxx_g=yes +fi])]) + +AC_DEFUN(AC_PROG_CC_G, +[AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, +[echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes else - ac_cv_prog_gxx_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* -]) -dnl - if test $ac_cv_prog_gxx_g = yes; then - CXXFLAGS="-g -O" - else - CXXFLAGS="-O" - fi - fi +])]) + +AC_DEFUN(AC_PROG_CXX_G, +[AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, +[echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes else - GXX= - test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" + ac_cv_prog_cxx_g=no fi -]) +rm -f conftest* +])]) AC_DEFUN(AC_PROG_GCC_TRADITIONAL, [AC_REQUIRE([AC_PROG_CC])dnl @@ -227,7 +285,7 @@ fi dnl Define SET_MAKE to set ${MAKE} if make doesn't. AC_DEFUN(AC_PROG_MAKE_SET, [AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE}) -set dummy ${MAKE-make}; ac_make=[$]2 +set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'` AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set, [cat > conftestmake <<\EOF all: @@ -355,7 +413,8 @@ 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"]) +rm -f "${LEX_OUTPUT_ROOT}.c" +]) dnl if test $ac_cv_prog_lex_yytext_pointer = yes; then AC_DEFINE(YYTEXT_POINTER) @@ -377,7 +436,7 @@ AC_DEFUN(AC_PROG_INSTALL, 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}:" +[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -400,7 +459,7 @@ AC_CACHE_VAL(ac_cv_path_install, ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" ])dnl if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" @@ -543,7 +602,7 @@ 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_safe=`echo "$1" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $1 that defines DIR]) AC_CACHE_VAL(ac_cv_header_dirent_$ac_safe, [AC_TRY_COMPILE([#include @@ -566,7 +625,7 @@ define(AC_CHECK_HEADERS_DIRENT, do AC_CHECK_HEADER_DIRENT($ac_hdr, [changequote(, )dnl - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl done]) @@ -764,76 +823,162 @@ if test $ac_cv_func_closedir_void = yes; then fi ]) +AC_DEFUN(AC_FUNC_FNMATCH, +[AC_CACHE_CHECK(for working fnmatch, ac_cv_func_fnmatch_works, +# Some versions of Solaris or SCO have a broken fnmatch function. +# So we run a test program. If we are cross-compiling, take no chance. +# Thanks to John Oleynick and Franc,ois Pinard for this test. +[AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }], +ac_cv_func_fnmatch_works=yes, ac_cv_func_fnmatch_works=no, +ac_cv_func_fnmatch_works=no)]) +if test $ac_cv_func_fnmatch_works = yes; then + AC_DEFINE(HAVE_FNMATCH) +fi +]) + AC_DEFUN(AC_FUNC_MMAP, -[AC_CHECK_FUNCS(valloc getpagesize) -AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap, +[AC_CHECK_HEADERS(unistd.h) +AC_CHECK_FUNCS(getpagesize) +AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped, [AC_TRY_RUN([ -/* Thanks to Mike Haertel and Jim Avera for this test. */ +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the filesystem buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propogated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ #include #include #include +/* This mess was copied from the GNU getpagesize.h. */ #ifndef 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 +# ifdef HAVE_UNISTD_H +# include # endif -#endif -#ifndef HAVE_VALLOC -# define valloc malloc -#endif +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# 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 */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ #ifdef __cplusplus -extern "C" { void *valloc(unsigned), *malloc(unsigned); } +extern "C" { void *malloc(unsigned); } #else -char *valloc(), *malloc(); +char *malloc(); #endif int main() { - char *buf1, *buf2, *buf3; - int i = getpagesize(), j; - int i2 = i * 2; - int fd; - - 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); - write(fd, buf1, i2); - mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0); - for (j = 0; j < i; ++j) - if (*(buf1 + j) != *(buf2 + j)) - 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, jima@netcom.com) */ - lseek(fd, (long)0, 0); - read(fd, buf3, i2); - for (j = 0; j < i2; ++j) - if (*(buf1 + j) != *(buf3 + j)) - exit(1); - exit(0); + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 0600); + if (fd < 0) + exit(1); + if (write(fd, data, pagesize) != pagesize) + exit(1); + close(fd); + + /* + * Next, try to mmap the file at a fixed address which + * already has something else allocated at it. If we can, + * also make sure that we see the same garbage. + */ + fd = open("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = malloc(2 * pagesize); + if (!data2) + exit(1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit(1); + + /* + * Finally, make sure that changes to the mapped area + * do not percolate back to the file as seen by read(). + * (This is a bug on some variants of i386 svr4.0.) + */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = malloc(pagesize); + if (!data3) + exit(1); + if (read(fd, data3, pagesize) != pagesize) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit(1); + close(fd); + unlink("conftestmmap"); + exit(0); } -], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)]) -if test $ac_cv_func_mmap = yes; then +], ac_cv_func_mmap_fixed_mapped=yes, ac_cv_func_mmap_fixed_mapped=no, +ac_cv_func_mmap_fixed_mapped=no)]) +if test $ac_cv_func_mmap_fixed_mapped = yes; then AC_DEFINE(HAVE_MMAP) fi ]) @@ -899,6 +1044,28 @@ if test $ac_cv_func_getpgrp_void = yes; then fi ]) +AC_DEFUN(AC_FUNC_SETPGRP, +[AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void, +AC_TRY_RUN([ +/* + * If this system has a BSD-style setpgrp, which takes arguments, exit + * successfully. + */ +main() +{ + if (setpgrp(1,1) == -1) + exit(0); + else + exit(1); +} +], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes, + AC_MSG_ERROR(cannot check setpgrp if cross compiling)) +) +if test $ac_cv_func_setpgrp_void = yes; then + AC_DEFINE(SETPGRP_VOID) +fi +]) + AC_DEFUN(AC_FUNC_VPRINTF, [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) if test "$ac_cv_func_vprintf" != yes; then @@ -909,7 +1076,7 @@ fi AC_DEFUN(AC_FUNC_VFORK, [AC_REQUIRE([AC_TYPE_PID_T])dnl AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) -AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork, +AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works, [AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */ #include #include @@ -936,8 +1103,10 @@ sparc_address_test (arg) int arg; static pid_t child; if (!child) { child = vfork (); - if (child < 0) + if (child < 0) { perror ("vfork"); + _exit(2); + } if (!child) { arg = getpid(); write(-1, "", 0); @@ -1000,14 +1169,14 @@ main() { ); } }], -ac_cv_func_vfork=yes, ac_cv_func_vfork=no, AC_CHECK_FUNC(vfork))]) -if test $ac_cv_func_vfork = no; then +ac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork))]) +if test $ac_cv_func_vfork_works = no; then AC_DEFINE(vfork, fork) fi ]) AC_DEFUN(AC_FUNC_WAIT3, -[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3, +[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage, [AC_TRY_RUN([#include #include #include @@ -1035,8 +1204,9 @@ main() { exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } -}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)]) -if test $ac_cv_func_wait3 = yes; then +}], ac_cv_func_wait3_rusage=yes, ac_cv_func_wait3_rusage=no, +ac_cv_func_wait3_rusage=no)]) +if test $ac_cv_func_wait3_rusage = yes; then AC_DEFINE(HAVE_WAIT3) fi ]) @@ -1052,7 +1222,7 @@ if test $ac_cv_header_alloca_h = yes; then AC_DEFINE(HAVE_ALLOCA_H) fi -AC_CACHE_CHECK([for alloca], ac_cv_func_alloca, +AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, [AC_TRY_LINK([ #ifdef __GNUC__ # define alloca __builtin_alloca @@ -1070,12 +1240,12 @@ char *alloca (); # endif #endif ], [char *p = (char *) alloca(1);], - ac_cv_func_alloca=yes, ac_cv_func_alloca=no)]) -if test $ac_cv_func_alloca = yes; then + ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)]) +if test $ac_cv_func_alloca_works = yes; then AC_DEFINE(HAVE_ALLOCA) fi -if test $ac_cv_func_alloca = no; then +if test $ac_cv_func_alloca_works = 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, @@ -1136,9 +1306,9 @@ AC_CHECK_LIB(util, getloadavg, 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. - ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" + ac_getloadavg_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" AC_CHECK_LIB(getloadavg, getloadavg, - LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS") + LIBS="-lgetloadavg $LIBS", LIBS="$ac_getloadavg_LIBS") fi # Make sure it is really in the library, if we think we found it. @@ -1243,15 +1413,16 @@ fi ]) AC_DEFUN(AC_FUNC_STRCOLL, -[AC_CACHE_CHECK(for strcoll, ac_cv_func_strcoll, +[AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works, [AC_TRY_RUN([#include main () { exit (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || strcoll ("123", "456") >= 0); -}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)]) -if test $ac_cv_func_strcoll = yes; then +}], ac_cv_func_strcoll_works=yes, ac_cv_func_strcoll_works=no, +ac_cv_func_strcoll_works=no)]) +if test $ac_cv_func_strcoll_works = yes; then AC_DEFINE(HAVE_STRCOLL) fi ]) @@ -1284,20 +1455,23 @@ AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS", AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])]) AC_DEFUN(AC_FUNC_STRFTIME, +[AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)], [# strftime is in -lintl on SCO UNIX. -AC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS") -AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)])]) +AC_CHECK_LIB(intl, strftime, +[AC_DEFINE(HAVE_STRFTIME) +LIBS="-lintl $LIBS"])])]) AC_DEFUN(AC_FUNC_MEMCMP, -[AC_CACHE_CHECK(for 8-bit clean memcmp, ac_cv_func_memcmp, +[AC_CACHE_CHECK(for 8-bit clean memcmp, ac_cv_func_memcmp_clean, [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)]) -test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o" +], ac_cv_func_memcmp_clean=yes, ac_cv_func_memcmp_clean=no, +ac_cv_func_memcmp_clean=no)]) +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" AC_SUBST(LIBOBJS)dnl ]) @@ -1391,12 +1565,7 @@ dnl ### Checks for compiler characteristics AC_DEFUN(AC_C_CROSS, -[# If we cannot run a trivial program, we must be cross compiling. -AC_CACHE_CHECK(whether cross-compiling, ac_cv_c_cross, -[AC_TRY_RUN([main(){return(0);}], - ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)]) -cross_compiling=$ac_cv_c_cross -]) +[AC_OBSOLETE([$0], [; it has been merged into AC_PROG_CC])]) AC_DEFUN(AC_C_CHAR_UNSIGNED, [AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned, @@ -1593,13 +1762,20 @@ AC_DEFUN(AC_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 -# /var/tmp likewise -# /usr/tmp likewise # $prefix/lib where we will be installing things # $exec_prefix/lib likewise # eval it to expand exec_prefix. -for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do +# $TMPDIR if set, where it might want to write temporary files +# if $TMPDIR is not set: +# /tmp where it might want to write temporary files +# /var/tmp likewise +# /usr/tmp likewise +if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then + ac_tmpdirs="$TMPDIR" +else + ac_tmpdirs='/tmp /var/tmp /usr/tmp' +fi +for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. (echo 1 > $ac_dir/conftest9012345) 2>/dev/null @@ -1710,7 +1886,9 @@ EOF ac_im_usrlibdir=$ac_im_libdir; break fi done - # Screen out bogus values from the imake configuration. + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. case "$ac_im_incroot" in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; @@ -1737,28 +1915,28 @@ AC_TRY_CPP([#include <$x_direct_test_include>], [# We can compile using X headers with no special include directory. ac_x_includes=], [# Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in \ + /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ + /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ + /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ + /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ - /usr/X11/include \ - /usr/include/X11 \ - /usr/local/X11/include \ - /usr/local/include/X11 \ - \ /usr/X386/include \ /usr/x386/include \ /usr/XFree86/include/X11 \ @@ -1797,28 +1975,28 @@ AC_TRY_LINK(, [${x_direct_test_function}()], ac_x_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ + /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ /usr/lib/X11R4 \ \ + /usr/local/X11/lib \ /usr/local/X11R6/lib \ /usr/local/X11R5/lib \ /usr/local/X11R4/lib \ \ + /usr/local/lib/X11 \ /usr/local/lib/X11R6 \ /usr/local/lib/X11R5 \ /usr/local/lib/X11R4 \ \ - /usr/X11/lib \ - /usr/lib/X11 \ - /usr/local/X11/lib \ - /usr/local/lib/X11 \ - \ /usr/X386/lib \ /usr/x386/lib \ /usr/XFree86/lib/X11 \ @@ -1829,12 +2007,13 @@ for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/athena/lib \ /usr/local/x11r5/lib \ /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do -dnl XXX Shouldn't this really use AC_TRY_LINK to be portable & robust?? +dnl Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then ac_x_libraries=$ac_dir @@ -1847,42 +2026,47 @@ fi # $ac_x_libraries = NO dnl Find additional X libraries, magic flags, etc. AC_DEFUN(AC_PATH_XTRA, -[AC_REQUIRE([AC_ISC_POSIX])dnl -AC_REQUIRE([AC_PATH_X])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" + AC_DEFINE(X_DISPLAY_MISSING) + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= 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" - fi +dnl FIXME banish uname from this macro! + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) + AC_MSG_CHECKING(whether -R must be followed by a space) + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + AC_TRY_LINK(, , ac_R_nospace=yes, ac_R_nospace=no) + if test $ac_R_nospace = yes; then + AC_MSG_RESULT(no) + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + AC_TRY_LINK(, , ac_R_space=yes, ac_R_space=no) + if test $ac_R_space = yes; then + AC_MSG_RESULT(yes) + X_LIBS="$X_LIBS -R $x_libraries" + else + AC_MSG_RESULT(neither works) + fi + fi + LIBS="$ac_xsave_LIBS" + esac fi - # Check for libraries that X11R6 Xt/Xaw programs need. - - 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, IceConnectionNumber, - [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"]) - LDFLAGS="$ac_save_LDFLAGS" - # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" @@ -1893,22 +2077,59 @@ else AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) if test $ac_cv_lib_dnet_dnet_ntoa = no; then AC_CHECK_LIB(dnet_stub, dnet_ntoa, - [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + [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"]) + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + AC_CHECK_FUNC(gethostbyname) + if test $ac_cv_func_gethostbyname = no; then + AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + 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_CHECK_LIB(socket, socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"]) + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat) + if test $ac_cv_func_shmat = no; then + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc") fi fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && 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, IceConnectionNumber, + [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"]) + LDFLAGS="$ac_save_LDFLAGS" + fi AC_SUBST(X_CFLAGS)dnl AC_SUBST(X_PRE_LIBS)dnl @@ -1924,7 +2145,6 @@ dnl They aren't cached, to discourage their use. 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, @@ -1936,7 +2156,6 @@ AC_EGREP_CPP(yes, 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 @@ -1947,8 +2166,8 @@ fi ]) AC_DEFUN(AC_ISC_POSIX, -[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl -AC_BEFORE([$0], [AC_TRY_LINK])dnl +[AC_REQUIRE([AC_PROG_CC])dnl +AC_BEFORE([$0], [AC_TRY_COMPILE])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl AC_MSG_CHECKING(for POSIXized ISC) if test -d /etc/conf/kconfig.d && diff --git a/src/util/autoconf/autoconf.info b/src/util/autoconf/autoconf.info index 472783f0b..1d35d50cb 100644 --- a/src/util/autoconf/autoconf.info +++ b/src/util/autoconf/autoconf.info @@ -34,7 +34,7 @@ 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 2.8, for Autoconf version 2.8. +package. This is edition 2.12, for Autoconf version 2.12. * Menu: @@ -52,7 +52,7 @@ package. This is edition 2.8, for Autoconf version 2.8. * Questions:: Questions about Autoconf, with answers. * Upgrading:: Tips for upgrading from version 1. * History:: History of Autoconf. -* Old Macro Names:: Backward compatibility macros. +* Old Macro Names:: Backward compatibility macros. * Environment Variable Index:: Index of environment variables used. * Output Variable Index:: Index of variables set in output files. * Preprocessor Symbol Index:: Index of C preprocessor symbols defined. @@ -62,16 +62,16 @@ package. This is edition 2.8, for Autoconf version 2.8. Making `configure' Scripts -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic `configure.in' writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple `configure' scripts. Initialization and Output Files * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in `Makefile's. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -80,26 +80,26 @@ Initialization and Output Files Substitutions in Makefiles -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. Configuration Header Files * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. Existing Tests -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: `typedef's that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: `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 @@ -123,44 +123,44 @@ Typedefs Writing Tests -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. Checking Run Time Behavior * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. Results of Tests * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent `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. +* Cache Files:: Files `configure' uses for caching. Writing Macros -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. Dependencies Between Macros -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. Manual Configuration @@ -213,11 +213,11 @@ Upgrading From Version 1 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. +* 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 @@ -360,10 +360,10 @@ Files used in configuring a software package: * Menu: -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic `configure.in' writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple `configure' scripts.  @@ -595,6 +595,14 @@ you can make `autoreconf' remake *all* of the files by giving it the options, it passes them down to `autoconf' and `autoheader' (with relative paths adjusted properly). + `autoreconf' does not support having, in the same directory tree, +both directories that are parts of a larger package (sharing +`aclocal.m4' and `acconfig.h'), and directories that are independent +packages (each with their own `aclocal.m4' and `acconfig.h'). It +assumes that they are all part of the same package, if you use +`--localdir', or that each directory is a separate package, if you +don't use it. This restriction may be removed in the future. + *Note Automatic Remaking::, for `Makefile' rules to automatically remake `configure' scripts when their source files change. That method handles the timestamps of configuration header templates properly, but @@ -614,7 +622,8 @@ does not pass `--macrodir=DIR' or `--localdir=DIR'. `--localdir=DIR' `-l DIR' - Look for the package files `aclocal.m4' and `acconfig.h' (but not + Have `autoconf' and `autoheader' look for the package files + `aclocal.m4' and (`autoheader' only) `acconfig.h' (but not `FILE.top' and `FILE.bot') in directory DIR instead of in the directory containing each `configure.in'. @@ -646,7 +655,7 @@ initialization and creating output files. * Menu: * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in `Makefile's. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -699,17 +708,18 @@ Creating Output Files 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. + - Macro: AC_OUTPUT ([FILE... [, EXTRA-CMDS [, INIT-CMDS]]]) + Create output files. Call this macro once, at the end of + `configure.in'. 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 @@ -718,20 +728,31 @@ macro is `AC_INIT' (*note Input::.). 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, + You can override an input file name by appending to FILE a + colon-separated list of input files. Examples: AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) - - You can also generate an output file from multiple input files by - separating the input files by a plus sign. For example, - AC_OUTPUT(Makefile:templates/pre.in+Makefile.in+templates/post.in) + AC_OUTPUT(Makefile:templates/vars.mk:Makefile.in:templates/rules.mk) + Doing this allows you to keep your file names acceptable to + MS-DOS, or to prepend and/or append boilerplate to the file. 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. + variables from `configure' to the EXTRA-CMDS. If + `AC_OUTPUT_COMMANDS' has been called, the commands given to it are + run just before the commands passed to this macro. + + - Macro: AC_OUTPUT_COMMANDS (EXTRA-CMDS [, INIT-CMDS]) + Specify additional shell commands to run at the end of + `config.status', and shell commands to initialize any variables + from `configure'. This macro may be called multiple times. Here + is an unrealistic example: + + fubar=27 + AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.], fubar=$fubar) + AC_OUTPUT_COMMANDS([echo this is another, extra, bit], [echo init bit]) If you run `make' on subdirectories, you should run it using the `make' variable `MAKE'. Most versions of `make' set `MAKE' to the name @@ -781,9 +802,9 @@ more information on what to put in `Makefile's. * Menu: -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring.  File: autoconf.info, Node: Preset Output Variables, Next: Build Directories, Up: Makefile Substitutions @@ -1035,16 +1056,18 @@ finding the `config.h' from the source directory. 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, + you can override the input file name by appending to + HEADER-TO-CREATE, a colon-separated list of input files. Examples: AC_CONFIG_HEADER(defines.h:defines.hin) + AC_CONFIG_HEADER(defines.h:defs.pre:defines.h.in:defs.post) - Doing this allows you to keep your filenames acceptable to MS-DOS. + Doing this allows you to keep your file names acceptable to + MS-DOS, or to prepend and/or append boilerplate to the file. * Menu: * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates.  File: autoconf.info, Node: Header Templates, Next: Invoking autoheader, Up: Configuration Headers @@ -1162,13 +1185,16 @@ to run `configure' scripts for other packages in subdirectories. 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. + 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. This macro may be called multiple + times.  File: autoconf.info, Node: Default Prefix, Next: Versions, Prev: Subdirectories, Up: Setup @@ -1275,15 +1301,15 @@ definitions into your program. * Menu: -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: `typedef's that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: `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 @@ -1327,14 +1353,22 @@ in some cases whether they support certain features. - 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. + environment, check for `gcc', and use `cc' if that'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 + set it to `-g -O2' for the GNU C compiler (`-O2' on systems where GCC does not accept `-g'), or `-g' for other compilers. + 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'. In other + words, this tests whether the build system type is different from + the host system type (the target system type is irrelevant to this + test). *Note Manual Configuration::, for more on support for + cross compiling. + - 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'. @@ -1353,14 +1387,22 @@ in some cases whether they support certain features. 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'. + likely names (`c++', `g++', `gcc', `CC', `cxx', and `cc++'). 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 + set, set it to `-g -O2' for the GNU C++ compiler (`-O2' on systems where G++ does not accept `-g'), or `-g' for other compilers. + 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'. In other + words, this tests whether the build system type is different from + the host system type (the target system type is irrelevant to this + test). *Note Manual Configuration::, for more on support for + cross compiling. + - 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 @@ -1419,6 +1461,19 @@ in some cases whether they support certain features. and filesystem support symbolic links), set output variable `LN_S' to `ln -s', otherwise set it to `ln'. + If the link is put in a directory other than the current + directory, its meaning depends on whether `ln' or `ln -s' is used. + To safely create links using `$(LN_S)', either find out which + form is used and adjust the arguments, or always invoke `ln' in + the directory where the link is to be created. + + In other words, it does not work to do + $(LN_S) foo /x/bar + + Instead, do + + (cd /x && $(LN_S) foo bar) + - Macro: AC_PROG_RANLIB Set output variable `RANLIB' to `ranlib' if `ranlib' is found, otherwise to `:' (do nothing). @@ -1602,6 +1657,10 @@ and in some cases how they respond when given certain arguments. define `CLOSEDIR_VOID'. Otherwise, callers ought to check its return value for an error indicator. + - Macro: AC_FUNC_FNMATCH + If the `fnmatch' function is available and works (unlike the one on + SunOS 5.4), define `HAVE_FNMATCH'. + - 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 @@ -1647,8 +1706,16 @@ and in some cases how they respond when given certain arguments. variable `LIBOBJS'. - Macro: AC_FUNC_MMAP - If the `mmap' function exists and works correctly on memory mapped - files, define `HAVE_MMAP'. + If the `mmap' function exists and works correctly, define + `HAVE_MMAP'. Only checks private fixed mapping of already-mapped + memory. + + - Macro: AC_FUNC_SETPGRP + If `setpgrp' takes no argument (the POSIX.1 version), define + `SETPGRP_VOID'. Otherwise, it is the BSD version, which takes two + process ID as arguments. This macro does not check whether + `setpgrp' exists at all; if you need to work in that situation, + first call `AC_CHECK_FUNC' for `setpgrp'. - Macro: AC_FUNC_SETVBUF_REVERSED If `setvbuf' takes the buffering type as its second argument and @@ -1723,10 +1790,14 @@ Writing Tests::.). 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'. + - Macro: AC_REPLACE_FUNCS (FUNCTION...) + Like calling `AC_CHECK_FUNCS' using an ACTION-IF-NOT-FOUND that + adds `FUNCTION.o' to the value of the output variable `LIBOBJS'. + You can declare a function for which your replacement version is + used by enclosing the prototype in `#ifndef HAVE_FUNCTION'. If + the system has the function, it probably declares it in a header + file you should be including, so you shouldn't redeclare it, lest + your declaration conflict.  File: autoconf.info, Node: Header Files, Next: Structures, Prev: Library Functions, Up: Existing Tests @@ -2091,9 +2162,9 @@ Generic Typedef Checks particular test macros. - Macro: AC_CHECK_TYPE (TYPE, DEFAULT) - If the type TYPE is not defined in `sys/types.h' or `stdlib.h' (if - it exists), define it to be the C (or C++) builtin type DEFAULT; - e.g., `short' or `unsigned'. + If the type TYPE is not defined in `sys/types.h', or `stdlib.h' or + `stddef.h' if they exist, 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 @@ -2294,13 +2365,13 @@ macro. *Note Writing Macros::, for how to do that. * Menu: -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing.  @@ -2452,8 +2523,8 @@ cross-compiling. * Menu: * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs.  File: autoconf.info, Node: Test Programs, Next: Guidelines, Up: Run Time @@ -2477,8 +2548,7 @@ system while configuring. 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. + ACTION-IF-CROSS-COMPILING are given, they are run instead. Otherwise, `configure' prints an error message and exits. Try to provide a pessimistic default value to use when @@ -2497,14 +2567,12 @@ 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 +can call `AC_PROG_CC' 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'. + This macro is obsolete; it does nothing.  File: autoconf.info, Node: Guidelines, Next: Test Functions, Prev: Test Programs, Up: Run Time @@ -2693,11 +2761,15 @@ 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. + for test programs. Set the shell variable `cross_compiling' to + the value computed by `AC_PROG_CC' if it has been run, empty + otherwise. - Macro: AC_LANG_CPLUSPLUS Do compilation tests using `CXX' and `CXXCPP' and use extension - `.C' for test programs. + `.C' for test programs. Set the shell variable `cross_compiling' + to the value computed by `AC_PROG_CXX' if it has been run, empty + otherwise. - Macro: AC_LANG_SAVE Remember the current language (as set by `AC_LANG_C' or @@ -2734,7 +2806,7 @@ a message letting the user know the result of the test. * Menu: * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent `configure' runs. * Printing Messages:: Notifying users of progress or problems. @@ -2894,7 +2966,7 @@ of the checks every time. * Menu: * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files `configure' uses for caching. +* Cache Files:: Files `configure' uses for caching.  File: autoconf.info, Node: Cache Variable Names, Next: Cache Files, Up: Caching Results @@ -2933,11 +3005,9 @@ ADDITIONAL-OPTIONS 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. + The values assigned to cache variables may not contain newlines. +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 @@ -2993,7 +3063,10 @@ Printing Messages 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. +on them. You can print a message containing a comma by quoting the +message with the `m4' quote characters: + + AC_MSG_RESULT([never mind, I found the BASIC compiler]) These macros are all wrappers around the `echo' shell command. `configure' scripts should rarely need to run `echo' directly to print @@ -3069,10 +3142,10 @@ macros. * Menu: -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros.  File: autoconf.info, Node: Macro Definitions, Next: Macro Names, Up: Writing Macros @@ -3232,8 +3305,8 @@ macros are called in an order that might cause incorrect operation. * Menu: -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things.  @@ -3470,7 +3543,8 @@ together, like in this fragment: 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. + relative to the top level source or build directory. This macro + may be called multiple times. For example, this call: @@ -3528,6 +3602,15 @@ 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'. + `configure' scripts do not complain about `--with-PACKAGE' options +that they do not support. This behavior permits configuring a source +tree containing multiple packages with a top-level `configure' script +when the packages support different options, without spurious error +messages about options that some of the packages support. An +unfortunate side effect is that option spelling errors are not +diagnosed. No better approach to this problem has been suggested so +far. + 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 @@ -3585,6 +3668,15 @@ and the argument. Giving an argument of `no' requests that the feature `--enable-debug=stabs'. If no argument is given, it defaults to `yes'. `--disable-FEATURE' is equivalent to `--enable-FEATURE=no'. + `configure' scripts do not complain about `--enable-FEATURE' options +that they do not support. This behavior permits configuring a source +tree containing multiple packages with a top-level `configure' script +when the packages support different options, without spurious error +messages about options that some of the packages support. An +unfortunate side effect is that option spelling errors are not +diagnosed. No better approach to this problem has been suggested so +far. + 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 @@ -3600,7 +3692,7 @@ arguments are valid, is up to you. The option's argument is available to the shell commands ACTION-IF-GIVEN in the shell variable `enableval', which is - actually just the value of the shell variable `enable_PACKAGE', + actually just the value of the shell variable `enable_FEATURE', with any `-' characters changed into `_'. You may use that variable instead, if you wish. The HELP-STRING argument is like that of `AC_ARG_WITH' (*note External Software::.). @@ -3817,9 +3909,11 @@ command `configure --prefix=/usr/share/local/gnu' would read this file # config.site for configure # - # Default --prefix and --exec-prefix. + # Change some defaults. test "$prefix" = NONE && prefix=/usr/share/local/gnu test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu + test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var + test "$localstatedir" = '${prefix}/var' && localstatedir=/var # # Give Autoconf 2.x generated configure scripts a shared default # cache file for feature test results, architecture-specific. @@ -4044,7 +4138,9 @@ operates. `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually @@ -4550,11 +4646,11 @@ 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. +* 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 @@ -4958,11 +5054,11 @@ Autoconf checks. * Menu: * AC_MACRODIR: Invoking autoupdate. -* AC_MACRODIR: Invoking autoheader. +* AC_MACRODIR: Invoking autoscan. * AC_MACRODIR: Invoking autoreconf. -* AC_MACRODIR: Invoking autoconf. * AC_MACRODIR: Invoking ifnames. -* AC_MACRODIR: Invoking autoscan. +* AC_MACRODIR: Invoking autoheader. +* AC_MACRODIR: Invoking autoconf. * CONFIG_FILES: Invoking config.status. * CONFIG_HEADERS: Invoking config.status. * CONFIG_SHELL: Invoking config.status. @@ -4991,8 +5087,8 @@ how this is done. * build_cpu: System Type Variables. * build_os: System Type Variables. * build_vendor: System Type Variables. -* CC: UNIX Variants. * CC: Particular Programs. +* CC: UNIX Variants. * CC: Particular Programs. * CFLAGS: Preset Output Variables. * CFLAGS: Particular Programs. @@ -5025,11 +5121,12 @@ how this is done. * libexecdir: Preset Output Variables. * LIBOBJS: Particular Functions. * LIBOBJS: Particular Functions. +* LIBOBJS: Particular Functions. * LIBOBJS: Generic Functions. * LIBOBJS: Structures. -* LIBS: Preset Output Variables. * LIBS: UNIX Variants. * LIBS: UNIX Variants. +* LIBS: Preset Output Variables. * LN_S: Particular Programs. * localstatedir: Preset Output Variables. * mandir: Preset Output Variables. @@ -5119,6 +5216,7 @@ use these names in `#if' directives. * off_t: Particular Typedefs. * pid_t: Particular Typedefs. * RETSIGTYPE: Particular Typedefs. +* SETPGRP_VOID: Particular Functions. * SETVBUF_REVERSED: Particular Functions. * size_t: Particular Typedefs. * STDC_HEADERS: Particular Headers. @@ -5206,11 +5304,13 @@ list easier to use, the macros are listed without their preceding `AC_'. * FUNC_ALLOCA: Particular Functions. * FUNC_CHECK: Old Macro Names. * FUNC_CLOSEDIR_VOID: Particular Functions. +* FUNC_FNMATCH: Particular Functions. * FUNC_GETLOADAVG: Particular Functions. * FUNC_GETMNTENT: Particular Functions. * FUNC_GETPGRP: Particular Functions. * FUNC_MEMCMP: Particular Functions. * FUNC_MMAP: Particular Functions. +* FUNC_SETPGRP: Particular Functions. * FUNC_SETVBUF_REVERSED: Particular Functions. * FUNC_STRCOLL: Particular Functions. * FUNC_STRFTIME: Particular Functions. @@ -5351,117 +5451,117 @@ list easier to use, the macros are listed without their preceding `AC_'.  Tag Table: Node: Top1173 -Node: Introduction9312 -Node: Making configure Scripts13152 -Node: Writing configure.in16217 -Node: Invoking autoscan19917 -Node: Invoking ifnames22222 -Node: Invoking autoconf23712 -Node: Invoking autoreconf25550 -Node: Setup27870 -Node: Input28756 -Node: Output30479 -Node: Makefile Substitutions33440 -Node: Preset Output Variables35024 -Node: Build Directories39526 -Node: Automatic Remaking41159 -Node: Configuration Headers43245 -Node: Header Templates45612 -Node: Invoking autoheader46791 -Node: Subdirectories49939 -Node: Default Prefix51282 -Node: Versions52686 -Node: Existing Tests54590 -Node: Alternative Programs56055 -Node: Particular Programs56719 -Node: Generic Programs62569 -Node: Libraries65395 -Node: Library Functions67224 -Node: Particular Functions67782 -Node: Generic Functions74085 -Node: Header Files75928 -Node: Particular Headers76487 -Node: Generic Headers83458 -Node: Structures84760 -Node: Typedefs86997 -Node: Particular Typedefs87501 -Node: Generic Typedefs88701 -Node: Compiler Characteristics89144 -Node: System Services91769 -Node: UNIX Variants94118 -Node: Writing Tests96137 -Node: Examining Declarations98103 -Node: Examining Syntax100573 -Node: Examining Libraries101630 -Node: Run Time104189 -Node: Test Programs105150 -Node: Guidelines107687 -Node: Test Functions108876 -Node: Portable Shell110419 -Node: Testing Values and Files112351 -Node: Multiple Cases114006 -Node: Language Choice115204 -Node: Results116762 -Node: Defining Symbols117521 -Node: Setting Output Variables120530 -Node: Caching Results122376 -Node: Cache Variable Names124657 -Node: Cache Files126206 -Node: Printing Messages128304 -Node: Writing Macros131591 -Node: Macro Definitions132210 -Node: Macro Names133315 -Node: Quoting135766 -Node: Dependencies Between Macros137668 -Node: Prerequisite Macros138300 -Node: Suggested Ordering139755 -Node: Obsolete Macros141285 -Node: Manual Configuration142509 -Node: Specifying Names143408 -Node: Canonicalizing145280 -Node: System Type Variables146594 -Node: Using System Type147341 -Node: Site Configuration148788 -Node: External Software149561 -Node: Package Options152259 -Node: Site Details154526 -Node: Transforming Names155749 -Node: Transformation Options156927 -Node: Transformation Examples157393 -Node: Transformation Rules158961 -Node: Site Defaults160370 -Node: Invoking configure164154 -Node: Basic Installation165103 -Node: Compilers and Options167683 -Node: Multiple Architectures168332 -Node: Installation Names169318 -Node: Optional Features170502 -Node: System Type171272 -Node: Sharing Defaults172294 -Node: Operation Controls172918 -Node: Invoking config.status173793 -Node: Questions177181 -Node: Distributing177713 -Node: Why GNU m4178839 -Node: Bootstrapping179652 -Node: Why Not Imake180268 -Node: Upgrading184677 -Node: Changed File Names186198 -Node: Changed Makefiles186934 -Node: Changed Macros188030 -Node: Invoking autoupdate189277 -Node: Changed Results190868 -Node: Changed Macro Writing192970 -Node: History194233 -Node: Genesis194940 -Node: Exodus196113 -Node: Leviticus199162 -Node: Numbers200685 -Node: Deuteronomy202601 -Node: Old Macro Names205265 -Node: Environment Variable Index208314 -Node: Output Variable Index209316 -Node: Preprocessor Symbol Index214177 -Node: Macro Index219047 +Node: Introduction9666 +Node: Making configure Scripts13506 +Node: Writing configure.in16587 +Node: Invoking autoscan20287 +Node: Invoking ifnames22592 +Node: Invoking autoconf24082 +Node: Invoking autoreconf25920 +Node: Setup28756 +Node: Input29661 +Node: Output31384 +Node: Makefile Substitutions35021 +Node: Preset Output Variables36624 +Node: Build Directories41126 +Node: Automatic Remaking42759 +Node: Configuration Headers44845 +Node: Header Templates47359 +Node: Invoking autoheader48538 +Node: Subdirectories51686 +Node: Default Prefix53081 +Node: Versions54485 +Node: Existing Tests56389 +Node: Alternative Programs57943 +Node: Particular Programs58607 +Node: Generic Programs65809 +Node: Libraries68635 +Node: Library Functions70464 +Node: Particular Functions71022 +Node: Generic Functions77854 +Node: Header Files79958 +Node: Particular Headers80517 +Node: Generic Headers87488 +Node: Structures88790 +Node: Typedefs91027 +Node: Particular Typedefs91531 +Node: Generic Typedefs92731 +Node: Compiler Characteristics93188 +Node: System Services95813 +Node: UNIX Variants98162 +Node: Writing Tests100181 +Node: Examining Declarations102174 +Node: Examining Syntax104644 +Node: Examining Libraries105701 +Node: Run Time108260 +Node: Test Programs109248 +Node: Guidelines111559 +Node: Test Functions112748 +Node: Portable Shell114291 +Node: Testing Values and Files116223 +Node: Multiple Cases117878 +Node: Language Choice119076 +Node: Results120889 +Node: Defining Symbols121651 +Node: Setting Output Variables124660 +Node: Caching Results126506 +Node: Cache Variable Names128794 +Node: Cache Files130254 +Node: Printing Messages132352 +Node: Writing Macros135800 +Node: Macro Definitions136446 +Node: Macro Names137551 +Node: Quoting140002 +Node: Dependencies Between Macros141904 +Node: Prerequisite Macros142551 +Node: Suggested Ordering144006 +Node: Obsolete Macros145536 +Node: Manual Configuration146760 +Node: Specifying Names147659 +Node: Canonicalizing149531 +Node: System Type Variables150845 +Node: Using System Type151592 +Node: Site Configuration153086 +Node: External Software153859 +Node: Package Options157035 +Node: Site Details159782 +Node: Transforming Names161005 +Node: Transformation Options162183 +Node: Transformation Examples162649 +Node: Transformation Rules164217 +Node: Site Defaults165626 +Node: Invoking configure169532 +Node: Basic Installation170481 +Node: Compilers and Options173061 +Node: Multiple Architectures173710 +Node: Installation Names174696 +Node: Optional Features175880 +Node: System Type176650 +Node: Sharing Defaults177672 +Node: Operation Controls178296 +Node: Invoking config.status179282 +Node: Questions182670 +Node: Distributing183202 +Node: Why GNU m4184328 +Node: Bootstrapping185141 +Node: Why Not Imake185757 +Node: Upgrading190166 +Node: Changed File Names191687 +Node: Changed Makefiles192423 +Node: Changed Macros193519 +Node: Invoking autoupdate194766 +Node: Changed Results196357 +Node: Changed Macro Writing198459 +Node: History199722 +Node: Genesis200514 +Node: Exodus201687 +Node: Leviticus204736 +Node: Numbers206259 +Node: Deuteronomy208175 +Node: Old Macro Names210839 +Node: Environment Variable Index213888 +Node: Output Variable Index214890 +Node: Preprocessor Symbol Index219813 +Node: Macro Index224745  End Tag Table diff --git a/src/util/autoconf/autoconf.info-1 b/src/util/autoconf/autoconf.info-1 deleted file mode 100644 index e35ad85c5..000000000 --- a/src/util/autoconf/autoconf.info-1 +++ /dev/null @@ -1,1158 +0,0 @@ -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 - - Autoconf: Creating Automatic Configuration Scripts, by David -MacKenzie. - - 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 2.3, for Autoconf version 2.3. - -* 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:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. - -Configuration Header Files - -* Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. - -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 transform 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. -* Multiple Architectures:: Compiling for multiple architectures at once. -* 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...])' - - It is best to put each macro call on its own line in `configure.in'. -Most of the macros don't add extra newlines; they rely on the newline -after the macro call to terminate the commands. This approach makes -the generated `configure' script a little easier to read by not -inserting lots of blank lines. It is generally safe to set shell -variables on the same line as a macro call, because the shell allows -assignments without intervening newlines. - - 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, the -`autoreconf' program can save you some work. It runs `autoconf' (and -`autoheader', where appropriate) repeatedly to remake the Autoconf -`configure' scripts and configuration header templates in the directory -tree rooted at the current directory. By default, it only remakes -those files that are older than their `configure.in' or (if present) -`aclocal.m4'. Since `autoheader' does not change the timestamp of its -output file if the file wouldn't be changing, this is not necessarily -the minimum amount of work. If you install a new version of Autoconf, -you can make `autoreconf' remake *all* of the files by giving it the -`--force' option. - - If you give `autoreconf' the `--macrodir=DIR' or `--localdir=DIR' -options, it passes them down to `autoconf' and `autoheader' (with -relative paths adjusted properly). - - *Note Automatic Remaking::, for `Makefile' rules to automatically -remake `configure' scripts when their source files change. That method -handles the timestamps of configuration header templates properly, but -does not pass `--macrodir=DIR' or `--localdir=DIR'. - -`autoreconf' accepts the following options: - -`--help' -`-h' - Print a summary of the command line options and exit. - -`--force' -`-f' - Remake even `configure' scripts and configuration headers that are - newer than their input files (`configure.in' and, if present, - `aclocal.m4'). - -`--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. Occasionally people accidentally - specify the wrong directory with `--srcdir'; this is a safety - check. *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:: Supporting multiple concurrent compiles. -* 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 can support compiling a software package for several -architectures simultaneously from the same copy of the source code. -The object files for each architecture are kept in their own directory. - - 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'. - - 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 `${srcdir}/' prefix is included because of limitations in the -`VPATH' mechanism. - - 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 `echo' as a -workaround. - - ${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 - ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \ - config.h.top config.h.bot - cd ${srcdir} && autoheader - echo timestamp > ${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 `echo timestamp > 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 deleted file mode 100644 index 6333f5521..000000000 --- a/src/util/autoconf/autoconf.info-2 +++ /dev/null @@ -1,1202 +0,0 @@ -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 - - Autoconf: Creating Automatic Configuration Scripts, by David -MacKenzie. - - 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'. - - A copy of `install-sh' which you may use comes with Autoconf. If - you use `AC_PROG_INSTALL', you must include either `install-sh' or - `install.sh' in your distribution, or `configure' will produce an - error message saying it can't find them--even if the system you're - on has a good `install' program. This check is a safety measure - to prevent you from accidentally leaving that file out, which - would prevent your package from installing on systems that don't - have a BSD-compatible `install' program. - - 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::.). If you need to check for a program that -might not be in the user's `PATH', you can temporarily add to it: - - ac_save_path="$PATH" - PATH=/usr/libexec:/usr/sbin:/usr/etc:/etc - AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd) - PATH="$ac_save_path" - - - 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_CHECK_TOOL (VARIABLE, PROG-TO-CHECK-FOR [, - VALUE-IF-NOT-FOUND]) - Like `AC_CHECK_PROG', but first looks for PROG-TO-CHECK-FOR with a - prefix of the host type as determined by `AC_CANONICAL_HOST', - followed by a dash (*note Canonicalizing::.). For example, if the - user runs `configure --host=i386-gnu', then this call: - AC_CHECK_TOOL(RANLIB, ranlib, :) - - sets `RANLIB' to `i386-gnu-ranlib' if that program exists in - `PATH', or to `ranlib' if that program exists in `PATH', or to `:' - if neither program exists. - - - 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: - `-lXt -lX11'. 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 `getmntent' in the `sun' and `seq' libraries, for Irix 4 - and PTX, respectively. Then, if `getmntent' is available, define - `HAVE_GETMNTENT'. - - - Macro: AC_FUNC_GETPGRP - If `getpgrp' takes no argument (the POSIX.1 version), define - `GETPGRP_VOID'. Otherwise, it is the BSD version, which takes a - process ID as an argument. This macro does not check whether - `getpgrp' exists at all; if you need to work in that situation, - first call `AC_CHECK_FUNC' for `getpgrp'. - - - 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. It is not considered to be an implementation error - if a child's invocation of `signal' modifies the parent's signal - handler, since child processes rarely change their signal handlers. - - - 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 in `sys/types.h' and -`stdlib.h' (if it exists). - - - 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, define `mode_t' to be `int'. - - - Macro: AC_TYPE_OFF_T - If `off_t' is not defined, define `off_t' to be `long'. - - - Macro: AC_TYPE_PID_T - If `pid_t' is not defined, 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, define `size_t' to be `unsigned'. - - - Macro: AC_TYPE_UID_T - If `uid_t' is not defined, 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 - it exists), 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 supports the keyword `inline', do nothing. - Otherwise define `inline' to `__inline__' or `__inline' if it - accepts one of those, otherwise define `inline' to be empty. - - - 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'. It adds 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, adds `-DX_DISPLAY_MISSING' to - `X_CFLAGS'. - - This macro also checks for special libraries that some systems - need in order to compile X programs. It adds any that the system - needs to output variable `X_EXTRA_LIBS'. And it checks for - special X11R6 libraries that need to be linked with before - `-lX11', and adds 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. - - 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. *Note Writing Macros::, for how to do that. - -* 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::.). - diff --git a/src/util/autoconf/autoconf.info-3 b/src/util/autoconf/autoconf.info-3 deleted file mode 100644 index 3e388c389..000000000 --- a/src/util/autoconf/autoconf.info-3 +++ /dev/null @@ -1,1192 +0,0 @@ -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 - - Autoconf: Creating Automatic Configuration Scripts, by David -MacKenzie. - - 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: 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. If users encounter this problem, they might be able to -solve it by setting `LDFLAGS' in the environment to pass whatever -options the linker needs (for example, `-Wl,-dn' on MIPS RISC/OS). - - `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. Use `AC_MSG_CHECKING' and - `AC_MSG_RESULT' instead to print messages (*note Printing - Messages::.). - - -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. - - -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! Also, include a space after the -exclamation point in interpreter specifications, like this: - #! /usr/bin/perl - If you omit the space before the path, then 4.2BSD based systems -(such as Sequent DYNIX) will ignore the line, because they interpret -`#! /' as a 4-byte magic number. - - 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' insert (without substitutions) the contents of - the file named by shell variable VARIABLE into output files. This - means that `AC_OUTPUT' will replace instances of `@VARIABLE@' in - output files (such as `Makefile.in') 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 that 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 output 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 output; `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. You -can 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'. - - You can also use the host system type to find cross-compilation -tools. *Note Generic Programs::, for information about the -`AC_CHECK_TOOL' macro which does that. - - -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-GIVEN [, - ACTION-IF-NOT-GIVEN]]) - If the user gave `configure' the option `--with-PACKAGE' or - `--without-PACKAGE', run shell commands ACTION-IF-GIVEN. If - neither option was given, run shell commands ACTION-IF-NOT-GIVEN. - 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-GIVEN in the shell variable `withval', which is actually - just the value of the shell variable `with_PACKAGE'; you may use - that variable instead, if you wish. - - 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-GIVEN [, ACTION-IF-NOT-GIVEN]) - This is an obsolete version of `AC_ARG_WITH' that does not support - providing a help string. - diff --git a/src/util/autoconf/autoconf.info-4 b/src/util/autoconf/autoconf.info-4 deleted file mode 100644 index 7a5a6ca0b..000000000 --- a/src/util/autoconf/autoconf.info-4 +++ /dev/null @@ -1,1129 +0,0 @@ -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 - - Autoconf: Creating Automatic Configuration Scripts, by David -MacKenzie. - - 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: 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-GIVEN [, - ACTION-IF-NOT-GIVEN]]) - If the user gave `configure' the option `--enable-FEATURE' or - `--disable-FEATURE', run shell commands ACTION-IF-GIVEN. If - neither option was given, run shell commands ACTION-IF-NOT-GIVEN. - 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-GIVEN in the shell variable `enableval', which is - actually just the value of the shell variable `enable_PACKAGE'; - you may use that variable instead, if you wish. The HELP-STRING - argument is like that of `AC_ARG_WITH' (*note External - Software::.). - - - Macro: AC_ENABLE (FEATURE, ACTION-IF-GIVEN [, ACTION-IF-NOT-GIVEN]) - 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. Run time configuration 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. - - -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 transform 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 sophisticated 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, -if you want to keep Autoconf version 1 around for awhile, you can -configure Autoconf version 2 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)'` - - uninstall: - rm -f $(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 - - uninstall: - for p in $(PROGRAMS); do \ - rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ - done - - Whether to do the transformations on documentation files (Texinfo or -`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 `man' pages sometimes do -conflict with system documentation. As a compromise, it is probably -best to do name transformations on `man' pages but not on Texinfo -manuals. - - -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. - - You can examine or override the value set by a command line option to -`configure' in a site file; options set shell variables that have the -same names as the options, with any dashes turned into underscores. -The exceptions are that `--without-' and `--disable-' options are like -giving the corresponding `--with-' or `--enable-' option and the value -`no'. Thus, `--cache-file=localcache' sets the variable `cache_file' -to the value `localcache'; `--enable-warnings=no' or -`--disable-warnings' sets the variable `enable_warnings' to the value -`no'; `--prefix=/usr' sets the variable `prefix' to the value `/usr'; -etc. - - 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 to a different file). - - # 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. A plain-text version of `INSTALL' which you may use comes -with Autoconf. - -* Menu: - -* Basic Installation:: Instructions for typical cases. -* Compilers and Options:: Selecting compilers and optimization. -* Multiple Architectures:: Compiling for multiple architectures at once. -* 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 code 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'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - -File: autoconf.info, Node: Compilers and Options, Next: Multiple Architectures, 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: Multiple Architectures, Next: Installation Names, Prev: Compilers and Options, Up: Invoking configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. 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 `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - - -File: autoconf.info, Node: Installation Names, Next: Optional Features, Prev: Multiple Architectures, 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' - Use and 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. - - If you view the GNU suite as a collection of native tools, then the -problems are similar. But the GNU 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 supported 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 your 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 inadvertently 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 non-`Makefile' -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 behavior 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' (perhaps via -`AC_COMPILE_CHECK'), 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. - diff --git a/src/util/autoconf/autoconf.info-5 b/src/util/autoconf/autoconf.info-5 deleted file mode 100644 index 87df15046..000000000 --- a/src/util/autoconf/autoconf.info-5 +++ /dev/null @@ -1,700 +0,0 @@ -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 - - Autoconf: Creating Automatic Configuration Scripts, by David -MacKenzie. - - 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: 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, 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.) - - -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 autoheader. -* AC_MACRODIR: Invoking autoreconf. -* AC_MACRODIR: Invoking autoconf. -* AC_MACRODIR: Invoking ifnames. -* AC_MACRODIR: Invoking autoscan. -* 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: UNIX Variants. -* CC: Particular Programs. -* CC: Particular Programs. -* CFLAGS: Particular Programs. -* CFLAGS: Preset Output Variables. -* configure_input: Preset Output Variables. -* CPP: Particular Programs. -* CPPFLAGS: Preset Output Variables. -* CXX: Particular Programs. -* CXXCPP: Particular Programs. -* CXXFLAGS: Particular Programs. -* CXXFLAGS: Preset Output Variables. -* 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: Structures. -* LIBOBJS: Generic Functions. -* LIBOBJS: Particular Functions. -* LIBOBJS: Particular Functions. -* 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. -* GETPGRP_VOID: 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_TOOL: Generic Programs. -* 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_GETPGRP: 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: Old Macro Names. -* STAT_MACROS_BROKEN: Structures. -* 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 index 2b1743559..dde59ab38 100644 --- a/src/util/autoconf/autoconf.m4 +++ b/src/util/autoconf/autoconf.m4 @@ -15,7 +15,8 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. dnl dnl Written by David MacKenzie. dnl diff --git a/src/util/autoconf/autoconf.sh b/src/util/autoconf/autoconf.sh index 41a182cb7..4e667b93c 100644 --- a/src/util/autoconf/autoconf.sh +++ b/src/util/autoconf/autoconf.sh @@ -14,7 +14,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # If given no args, create `configure' from template file `configure.in'. # With one arg, create a configure script on standard output from @@ -25,11 +26,14 @@ 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 +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. 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 "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi : ${AC_MACRODIR=@datadir@} : ${M4=@M4@} @@ -121,7 +125,7 @@ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for -# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do # alternation. pattern="AC_" diff --git a/src/util/autoconf/autoconf.texi b/src/util/autoconf/autoconf.texi index 0c9a2265a..d0ba46df5 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 2.8 -@set VERSION 2.8 -@set UPDATED January 1996 +@set EDITION 2.12 +@set VERSION 2.12 +@set UPDATED November 1996 @iftex @finalout @@ -61,7 +61,7 @@ by the Foundation. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, '93, '94, '95, '96 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 93, 94, 95, 96 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -114,7 +114,7 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. * Questions:: Questions about Autoconf, with answers. * Upgrading:: Tips for upgrading from version 1. * History:: History of Autoconf. -* Old Macro Names:: Backward compatibility macros. +* Old Macro Names:: Backward compatibility macros. * Environment Variable Index:: Index of environment variables used. * Output Variable Index:: Index of variables set in output files. * Preprocessor Symbol Index:: Index of C preprocessor symbols defined. @@ -124,16 +124,16 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. Making @code{configure} Scripts -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. Initialization and Output Files * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -142,26 +142,26 @@ Initialization and Output Files Substitutions in Makefiles -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. Configuration Header Files * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. Existing Tests -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. Alternative Programs @@ -185,44 +185,44 @@ Typedefs Writing Tests -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. Checking Run Time Behavior * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. Results of Tests * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. Caching Results * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. Writing Macros -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. Dependencies Between Macros -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. Manual Configuration @@ -275,11 +275,11 @@ Upgrading From Version 1 History of Autoconf -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Introduction, Making configure Scripts, Top, Top @@ -437,10 +437,10 @@ Makefile.in ---' `-> Makefile ---' @end example @menu -* Writing configure.in:: What to put in an Autoconf input file. +* Writing configure.in:: What to put in an Autoconf input file. * Invoking autoscan:: Semi-automatic @file{configure.in} writing. * Invoking ifnames:: Listing the conditionals in source code. -* Invoking autoconf:: How to create configuration scripts. +* Invoking autoconf:: How to create configuration scripts. * Invoking autoreconf:: Remaking multiple @code{configure} scripts. @end menu @@ -681,6 +681,15 @@ If you give @code{autoreconf} the @samp{--macrodir=@var{dir}} or @code{autoconf} and @code{autoheader} (with relative paths adjusted properly). +@code{autoreconf} does not support having, in the same directory tree, +both directories that are parts of a larger package (sharing +@file{aclocal.m4} and @file{acconfig.h}), and directories that are +independent packages (each with their own @file{aclocal.m4} and +@file{acconfig.h}). It assumes that they are all part of the same +package, if you use @samp{--localdir}, or that each directory is a +separate package, if you don't use it. This restriction may be removed +in the future. + @xref{Automatic Remaking}, for @file{Makefile} rules to automatically remake @code{configure} scripts when their source files change. That method handles the timestamps of configuration header templates @@ -703,7 +712,8 @@ newer than their input files (@file{configure.in} and, if present, @item --localdir=@var{dir} @itemx -l @var{dir} -Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but +Have @code{autoconf} and @code{autoheader} look for the package files +@file{aclocal.m4} and (@code{autoheader} only) @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}. @@ -734,7 +744,7 @@ initialization and creating output files. @menu * Input:: Where Autoconf should find files. -* Output:: Creating output files. +* Output:: Creating output files. * Makefile Substitutions:: Using output variables in @file{Makefile}s. * Configuration Headers:: Creating a configuration header file. * Subdirectories:: Configuring independent packages together. @@ -788,9 +798,10 @@ Every Autoconf-generated @code{configure} script must finish by calling optional other files resulting from configuration. The only other required macro is @code{AC_INIT} (@pxref{Input}). -@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]}) +@defmac AC_OUTPUT (@r{[}@var{file}@dots{} @r{[}, @var{extra-cmds} @r{[}, @var{init-cmds}@r{]]]}) @maindex OUTPUT -Create output files. The @var{file}@dots{} argument is a +Create output files. Call this macro once, at the end of @file{configure.in}. +The @var{file}@dots{} argument is a whitespace-separated list of output files; it may be empty. This macro creates each file @file{@var{file}} by copying an input file (by default named @file{@var{file}.in}), substituting the output variable values. @@ -811,17 +822,14 @@ A typical call to @code{AC_OUTPUT} looks like this: 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, +You can override an input file name by appending to @var{file} a +colon-separated list of input files. Examples: @example AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) +AC_OUTPUT(Makefile:templates/vars.mk:Makefile.in:templates/rules.mk) @end example - -You can also generate an output file from multiple input files by -separating the input files by a plus sign. For example, -@example -AC_OUTPUT(Makefile:templates/pre.in+Makefile.in+templates/post.in) -@end example +Doing this allows you to keep your file names acceptable to MS-DOS, or +to prepend and/or append boilerplate to the file. If you pass @var{extra-cmds}, those commands will be inserted into @file{config.status} to be run after all its other processing. If @@ -829,7 +837,21 @@ If you pass @var{extra-cmds}, those commands will be inserted into @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}. +@var{extra-cmds}. If @code{AC_OUTPUT_COMMANDS} has been called, the +commands given to it are run just before the commands passed to this macro. +@end defmac + +@defmac AC_OUTPUT_COMMANDS (@var{extra-cmds} @r{[}, @var{init-cmds}@r{]}) +Specify additional shell commands to run at the end of +@file{config.status}, and shell commands to initialize any variables +from @code{configure}. This macro may be called multiple times. +Here is an unrealistic example: + +@example +fubar=27 +AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.], fubar=$fubar) +AC_OUTPUT_COMMANDS([echo this is another, extra, bit], [echo init bit]) +@end example @end defmac If you run @code{make} on subdirectories, you should run it using the @@ -883,9 +905,9 @@ GNU Coding Standards}, for more information on what to put in @file{Makefile}s. @menu -* Preset Output Variables:: Output variables that are always set. -* Build Directories:: Supporting multiple concurrent compiles. -* Automatic Remaking:: Makefile rules for configuring. +* Preset Output Variables:: Output variables that are always set. +* Build Directories:: Supporting multiple concurrent compiles. +* Automatic Remaking:: Makefile rules for configuring. @end menu @node Preset Output Variables, Build Directories, , Makefile Substitutions @@ -1185,18 +1207,21 @@ 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, +however, you can override the input file name by appending to +@var{header-to-create}, a colon-separated list of input files. +Examples: @example AC_CONFIG_HEADER(defines.h:defines.hin) +AC_CONFIG_HEADER(defines.h:defs.pre:defines.h.in:defs.post) @end example @noindent -Doing this allows you to keep your filenames acceptable to MS-DOS. +Doing this allows you to keep your file names acceptable to MS-DOS, or +to prepend and/or append boilerplate to the file. @end defmac @menu * Header Templates:: Input for the configuration headers. -* Invoking autoheader:: How to create configuration templates. +* Invoking autoheader:: How to create configuration templates. @end menu @node Header Templates, Invoking autoheader, , Configuration Headers @@ -1329,13 +1354,16 @@ 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 +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. +which subdirectories to recurse into. This macro may be called multiple +times. @end defmac @node Default Prefix, Versions, Subdirectories, Setup @@ -1447,15 +1475,15 @@ preprocessor symbol @var{name} to the value 1''. @xref{Defining Symbols}, for how to get those symbol definitions into your program. @menu -* Alternative Programs:: Selecting between alternative programs. +* Alternative Programs:: Selecting between alternative programs. * Libraries:: Library archives that might be missing. -* Library Functions:: C library functions that might be missing. -* Header Files:: Header files that might be missing. -* Structures:: Structures or members that might be missing. -* Typedefs:: @code{typedef}s that might be missing. -* Compiler Characteristics:: C compiler or machine architecture features. -* System Services:: Operating system services. -* UNIX Variants:: Special kludges for specific UNIX variants. +* Library Functions:: C library functions that might be missing. +* Header Files:: Header files that might be missing. +* Structures:: Structures or members that might be missing. +* Typedefs:: @code{typedef}s that might be missing. +* Compiler Characteristics:: C compiler or machine architecture features. +* System Services:: Operating system services. +* UNIX Variants:: Special kludges for specific UNIX variants. @end menu @node Alternative Programs, Libraries, , Existing Tests @@ -1504,14 +1532,21 @@ fastest implementation. @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. +environment, check for @code{gcc}, and use @code{cc} if that'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} +not already set, set it to @samp{-g -O2} for the GNU C compiler +(@samp{-O2} on systems where GCC does not accept @samp{-g}), or @samp{-g} for other compilers. + +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}. +In other words, this tests whether the build system type is different +from the host system type (the target system type is irrelevant to this +test). @xref{Manual Configuration}, for more on support for cross compiling. @end defmac @defmac AC_PROG_CC_C_O @@ -1542,15 +1577,22 @@ specific test macros use the value of @code{CPP} indirectly by calling Determine a C++ compiler to use. Check if the environment variable @code{CXX} or @code{CCC} (in that order) is set; if so, set output variable @code{CXX} to its value. Otherwise search for a C++ compiler -under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and -@code{cxx}). If none of those checks succeed, as a last resort set -@code{CXX} to @code{gcc}. +under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, +@code{cxx}, and @code{cc++}). If none of those checks succeed, as a +last resort set @code{CXX} to @code{gcc}. If using the GNU C++ compiler, set shell variable @code{GXX} to @samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was -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} +not already set, set it to @samp{-g -O2} for the GNU C++ compiler +(@samp{-O2} on systems where G++ does not accept @samp{-g}), or @samp{-g} for other compilers. + +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}. +In other words, this tests whether the build system type is different +from the host system type (the target system type is irrelevant to this +test). @xref{Manual Configuration}, for more on support for cross compiling. @end defmac @defmac AC_PROG_CXXCPP @@ -1628,6 +1670,23 @@ standard place. Otherwise set @code{LEX} to @samp{lex} and 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}. + +If the link is put in a directory other than the current directory, its +meaning depends on whether @samp{ln} or @samp{ln -s} is used. To safely +create links using @samp{$(LN_S)}, either find out which form is used +and adjust the arguments, or always invoke @code{ln} in the directory +where the link is to be created. + +In other words, it does not work to do +@example +$(LN_S) foo /x/bar +@end example + +Instead, do + +@example +(cd /x && $(LN_S) foo bar) +@end example @end defmac @defmac AC_PROG_RANLIB @@ -1832,6 +1891,13 @@ define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its return value for an error indicator. @end defmac +@defmac AC_FUNC_FNMATCH +@maindex FUNC_FNMATCH +@ovindex LIBOBJS +If the @code{fnmatch} function is available and works (unlike the one on +SunOS 5.4), define @code{HAVE_FNMATCH}. +@end defmac + @defmac AC_FUNC_GETLOADAVG @maindex FUNC_GETLOADAVG @cvindex SVR4 @@ -1908,8 +1974,19 @@ variable @code{LIBOBJS}. @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}. +If the @code{mmap} function exists and works correctly, define +@code{HAVE_MMAP}. Only checks private fixed mapping of already-mapped +memory. +@end defmac + +@defmac AC_FUNC_SETPGRP +@maindex FUNC_SETPGRP +@cvindex SETPGRP_VOID +If @code{setpgrp} takes no argument (the POSIX.1 version), define +@code{SETPGRP_VOID}. Otherwise, it is the BSD version, which takes two +process ID as arguments. This macro does not check whether +@code{setpgrp} exists at all; if you need to work in that situation, +first call @code{AC_CHECK_FUNC} for @code{setpgrp}. @end defmac @defmac AC_FUNC_SETVBUF_REVERSED @@ -2007,12 +2084,16 @@ when one of the functions is found. You can give it a value of functions is not found. @end defmac -@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{}) +@defmac AC_REPLACE_FUNCS (@var{function}@dots{}) @maindex REPLACE_FUNCS @ovindex LIBOBJS -For each given @var{function-name} in the whitespace-separated argument -list that is not in the C library, add @samp{@var{function-name}.o} to -the value of the output variable @code{LIBOBJS}. +Like calling @code{AC_CHECK_FUNCS} using an @var{action-if-not-found} +that adds @samp{@var{function}.o} to the value of the output variable +@code{LIBOBJS}. You can declare a function for which your replacement +version is used by enclosing the prototype in @samp{#ifndef +HAVE_@var{function}}. If the system has the function, it probably +declares it in a header file you should be including, so you shouldn't +redeclare it, lest your declaration conflict. @end defmac @node Header Files, Structures, Library Functions, Existing Tests @@ -2473,9 +2554,10 @@ test macros. @defmac AC_CHECK_TYPE (@var{type}, @var{default}) @maindex CHECK_TYPE -If the type @var{type} is not defined in @file{sys/types.h} or -@file{stdlib.h} (if it exists), define it to be the C (or C++) -builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}. +If the type @var{type} is not defined in @file{sys/types.h}, or +@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the +C (or C++) builtin type @var{default}; e.g., @samp{short} or +@samp{unsigned}. @end defmac @node Compiler Characteristics, System Services, Typedefs, Existing Tests @@ -2728,13 +2810,13 @@ software package, the best thing to do is encapsulate it in a new macro. @xref{Writing Macros}, for how to do that. @menu -* Examining Declarations:: Detecting header files and declarations. +* Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. * Examining Libraries:: Detecting functions and global variables. -* Run Time:: Testing for run-time features. +* Run Time:: Testing for run-time features. * Portable Shell:: Shell script portability pitfalls. * Testing Values and Files:: Checking strings and files. -* Multiple Cases:: Tests for several possible values. +* Multiple Cases:: Tests for several possible values. * Language Choice:: Selecting which language to use for testing. @end menu @@ -2884,8 +2966,8 @@ package for cross-compiling. @menu * Test Programs:: Running test programs. -* Guidelines:: General rules for writing test programs. -* Test Functions:: Avoiding pitfalls in test programs. +* Guidelines:: General rules for writing test programs. +* Test Functions:: Avoiding pitfalls in test programs. @end menu @node Test Programs, Guidelines, , Run Time @@ -2908,8 +2990,7 @@ 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 +are given, they are run instead. Otherwise, @code{configure} prints an error message and exits. @end defmac @@ -2929,15 +3010,13 @@ 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 +can call @code{AC_PROG_CC} 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}. +This macro is obsolete; it does nothing. @end defmac @node Guidelines, Test Functions, Test Programs, Run Time @@ -3132,13 +3211,17 @@ 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. +@file{.c} for test programs. Set the shell variable +@code{cross_compiling} to the value computed by @code{AC_PROG_CC} if it +has been run, empty otherwise. @end defmac @defmac AC_LANG_CPLUSPLUS @maindex LANG_CPLUSPLUS Do compilation tests using @code{CXX} and @code{CXXCPP} and use -extension @file{.C} for test programs. +extension @file{.C} for test programs. Set the shell variable +@code{cross_compiling} to the value computed by @code{AC_PROG_CXX} if +it has been run, empty otherwise. @end defmac @defmac AC_LANG_SAVE @@ -3179,7 +3262,7 @@ print a message letting the user know the result of the test. @menu * Defining Symbols:: Defining C preprocessor symbols. -* Setting Output Variables:: Replacing variables in output files. +* Setting Output Variables:: Replacing variables in output files. * Caching Results:: Speeding up subsequent @code{configure} runs. * Printing Messages:: Notifying users of progress or problems. @end menu @@ -3363,7 +3446,7 @@ common way to use these macros. It calls @code{AC_MSG_CHECKING} for @menu * Cache Variable Names:: Shell variables used in caches. -* Cache Files:: Files @code{configure} uses for caching. +* Cache Files:: Files @code{configure} uses for caching. @end menu @node Cache Variable Names, Cache Files, , Caching Results @@ -3404,11 +3487,9 @@ 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. +The values assigned to cache variables may not contain newlines. +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 @@ -3461,7 +3542,12 @@ transparently, as long as the same C compiler is used every time 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. +on them. You can print a message containing a comma by quoting the +message with the @code{m4} quote characters: + +@example +AC_MSG_RESULT([never mind, I found the BASIC compiler]) +@end example These macros are all wrappers around the @code{echo} shell command. @code{configure} scripts should rarely need to run @code{echo} directly @@ -3547,10 +3633,10 @@ software package, the best thing to do is encapsulate it in a new macro. Here are some instructions and guidelines for writing Autoconf macros. @menu -* Macro Definitions:: Basic format of an Autoconf macro. +* Macro Definitions:: Basic format of an Autoconf macro. * Macro Names:: What to call your new macros. -* Quoting:: Protecting macros from unwanted expansion. -* Dependencies Between Macros:: What to do when macros depend on other macros. +* Quoting:: Protecting macros from unwanted expansion. +* Dependencies Between Macros:: What to do when macros depend on other macros. @end menu @node Macro Definitions, Macro Names, , Writing Macros @@ -3698,8 +3784,8 @@ macros are called if needed and a way to warn the user if macros are called in an order that might cause incorrect operation. @menu -* Prerequisite Macros:: Ensuring required information. -* Suggested Ordering:: Warning about possible ordering problems. +* Prerequisite Macros:: Ensuring required information. +* Suggested Ordering:: Warning about possible ordering problems. * Obsolete Macros:: Warning about old ways of doing things. @end menu @@ -3963,6 +4049,7 @@ 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. +This macro may be called multiple times. For example, this call: @@ -4023,6 +4110,15 @@ with. If no argument is given, it defaults to @samp{yes}. @samp{--without-@var{package}} is equivalent to @samp{--with-@var{package}=no}. +@code{configure} scripts do not complain about +@samp{--with-@var{package}} options that they do not support. +This behavior permits configuring a source tree containing multiple +packages with a top-level @code{configure} script when the packages +support different options, without spurious error messages about options +that some of the packages support. +An unfortunate side effect is that option spelling errors are not diagnosed. +No better approach to this problem has been suggested so far. + 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 @@ -4086,6 +4182,15 @@ 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}. +@code{configure} scripts do not complain about +@samp{--enable-@var{feature}} options that they do not support. +This behavior permits configuring a source tree containing multiple +packages with a top-level @code{configure} script when the packages +support different options, without spurious error messages about options +that some of the packages support. +An unfortunate side effect is that option spelling errors are not diagnosed. +No better approach to this problem has been suggested so far. + 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 @@ -4103,7 +4208,7 @@ alphanumeric characters and dashes. The option's argument is available to the shell commands @var{action-if-given} in the shell variable @code{enableval}, which is actually just the value of the shell variable -@code{enable_@var{package}}, with any @samp{-} characters changed into +@code{enable_@var{feature}}, with any @samp{-} characters changed into @samp{_}. You may use that variable instead, if you wish. The @var{help-string} argument is like that of @code{AC_ARG_WITH} (@pxref{External Software}). @@ -4320,9 +4425,11 @@ file (if @code{CONFIG_SITE} is not set to a different file). @example # config.site for configure # -# Default --prefix and --exec-prefix. +# Change some defaults. test "$prefix" = NONE && prefix=/usr/share/local/gnu test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu +test "$sharedstatedir" = '$@{prefix@}/com' && sharedstatedir=/var +test "$localstatedir" = '$@{prefix@}/var' && localstatedir=/var # # Give Autoconf 2.x generated configure scripts a shared default # cache file for feature test results, architecture-specific. @@ -4850,11 +4957,11 @@ to you, and you might as well skip it. If you @emph{are} wondering, then let there be light@dots{} @menu -* Genesis:: Prehistory and naming of @code{configure}. -* Exodus:: The plagues of @code{m4} and Perl. -* Leviticus:: The priestly code of portability arrives. -* Numbers:: Growth and contributors. -* Deuteronomy:: Approaching the promises of easy configuration. +* Genesis:: Prehistory and naming of @code{configure}. +* Exodus:: The plagues of @code{m4} and Perl. +* Leviticus:: The priestly code of portability arrives. +* Numbers:: Growth and contributors. +* Deuteronomy:: Approaching the promises of easy configuration. @end menu @node Genesis, Exodus, , History diff --git a/src/util/autoconf/autoheader.m4 b/src/util/autoconf/autoheader.m4 index eac62579b..41fe94e05 100644 --- a/src/util/autoconf/autoheader.m4 +++ b/src/util/autoconf/autoheader.m4 @@ -14,7 +14,8 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. dnl dnl Written by Roland McGrath. dnl diff --git a/src/util/autoconf/autoheader.sh b/src/util/autoconf/autoheader.sh index a9aa44693..92f9d63c8 100644 --- a/src/util/autoconf/autoheader.sh +++ b/src/util/autoconf/autoheader.sh @@ -1,6 +1,6 @@ #! /bin/sh # autoheader -- create `config.h.in' from `configure.in' -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1996 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 @@ -14,7 +14,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # Written by Roland McGrath. @@ -23,15 +24,18 @@ # the given template file. usage="\ -Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir] - [-l dir] [--localdir=dir] [--version] [template-file]" +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 +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. 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 "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ test -z "${M4}" && M4=@M4@ @@ -45,7 +49,7 @@ localdir=. show_version=no while test $# -gt 0 ; do - case "${1}" in + case "${1}" in -h | --help | --h* ) echo "${usage}"; exit 0 ;; --localdir=* | --l*=* ) @@ -59,7 +63,7 @@ while test $# -gt 0 ; do --macrodir=* | --m*=* ) AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" shift ;; - -m | --macrodir | --m* ) + -m | --macrodir | --m* ) shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } AC_MACRODIR="${1}" @@ -85,7 +89,6 @@ if test $show_version = yes; then fi TEMPLATES="${AC_MACRODIR}/acconfig.h" -test -r ./acconfig.h && TEMPLATES="${TEMPLATES} ./acconfig.h" test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h" case $# in @@ -151,7 +154,9 @@ 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. */" +cat </dev/null && sedscript="1,/@TOP@/d;" + grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;" + # This substitution makes "#undefFOO" in acconfig.h work. + sed -n -e "$sedscript s/ / /g; p" $t + echo; echo + done | + # The sed script is suboptimal because it has to take care of + # some broken seds (e.g. AIX) that remove '\n' from the + # pattern/hold space if the line is empty. (junio@twinsun.com). + sed -n -e ' /^[ ]*$/{ x s/\n/@/g @@ -176,9 +190,18 @@ if test -n "$syms"; then x } H' | sed -e 's/@@*/@/g' | - # Select each paragraph that refers to a symbol we picked out above. - fgrep "$syms" | - tr @ \\012 + # Select each paragraph that refers to a symbol we picked out above. + # Some fgrep's have limits on the number of lines that can be in the + # pattern on the command line, so use a temporary file containing the + # pattern. + (fgrep_tmp=${TMPDIR-/tmp}/autoh$$ + trap "rm -f $fgrep_tmp; exit 1" 1 2 15 + cat > $fgrep_tmp <&2; exit 1 fi +# The paths to the autoconf and autoheader scripts, at the top of the tree. top_autoconf=`echo $0|sed s%autoreconf%autoconf%` top_autoheader=`echo $0|sed s%autoreconf%autoheader%` +# Make a list of directories to process. # The xargs grep filters out Cygnus configure.in files. find . -name configure.in -print | xargs grep -l AC_OUTPUT | diff --git a/src/util/autoconf/autoscan.pl b/src/util/autoconf/autoscan.pl index 7b272ed46..32852360f 100644 --- a/src/util/autoconf/autoscan.pl +++ b/src/util/autoconf/autoscan.pl @@ -14,7 +14,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # Written by David MacKenzie . diff --git a/src/util/autoconf/autoupdate.sh b/src/util/autoconf/autoupdate.sh index 522d3a598..3c10b88eb 100644 --- a/src/util/autoconf/autoupdate.sh +++ b/src/util/autoconf/autoupdate.sh @@ -14,7 +14,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # If given no args, update `configure.in'; # With one arg, write on the standard output from the given template file. diff --git a/src/util/autoconf/config.guess b/src/util/autoconf/config.guess index d8c24708a..e9e44559f 100644 --- a/src/util/autoconf/config.guess +++ b/src/util/autoconf/config.guess @@ -67,21 +67,28 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-cbm-openbsd${UNAME_RELEASE} + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - Pyramid*:OSx*:*:*) + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; - sun4*:SunOS:5.*:*) + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) - echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -101,25 +108,60 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-atari-openbsd${UNAME_RELEASE} + exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-sun-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-apple-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; - mips:*:4*:UMIPS) - echo mips-mips-riscos4sysv - exit 0 ;; - mips:*:5*:RISCos) + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >dummy.c + int main (argc, argv) int argc; char **argv; { + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + ${CC-cc} dummy.c -o dummy \ + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -137,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} @@ -163,10 +205,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i[34]86:AIX:*:*) + i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) @@ -211,7 +253,7 @@ EOF echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -229,7 +271,7 @@ EOF case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;; + 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; 9000/8?? ) HP_ARCH=hppa1.0 ;; esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` @@ -277,6 +319,13 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; @@ -304,17 +353,33 @@ EOF CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; - CRAY*C90:*:*:*) - echo c90-cray-unicos${UNAME_RELEASE} + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; - i[34]86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + hp3[0-9][05]:OpenBSD:*:*) + echo m68k-hp-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` @@ -322,8 +387,11 @@ EOF *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; i*:CYGWIN*:*) - echo i386-unknown-cygwin32 + echo i386-pc-cygwin32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 @@ -338,23 +406,27 @@ EOF # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` - if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then - echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then - echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 + if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then + echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then + echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then + echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then - echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 + echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then + echo "powerpc-unknown-linux-gnu" ; exit 0 elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux ; exit 0 + echo alpha-unknown-linux-gnu ; exit 0 + elif test "${UNAME_MACHINE}" = "sparc" ; then + echo sparc-unknown-linux-gnu ; exit 0 else - # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us - # useful --help. Gcc wants to distinguish between linuxoldld and linuxaout. + # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us + # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. test ! -d /usr/lib/ldscripts/. \ - && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0 + && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 # Determine whether the default compiler is a.out or elf cat >dummy.c </dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; - i[34]86:*:3.2:*) + i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /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 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-unknown-sysv32 + echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; Intel:Mach:3*:*) - echo i386-unknown-mach3 + echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 @@ -415,28 +487,36 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; - M680[234]0:*:R3V[567]*:*) + M68*:*: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.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - uname -p 2>/dev/null | grep 86 >/dev/null \ + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m680[234]0:LynxOS:2.[23]*:*) - echo m68k-lynx-lynxos${UNAME_RELEASE} + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i[34]86:LynxOS:2.[23]*:*) - echo i386-lynx-lynxos${UNAME_RELEASE} + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - TSUNAMI:LynxOS:2.[23]*:*) - echo sparc-lynx-lynxos${UNAME_RELEASE} + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.[23]*:*) - echo rs6000-lynx-lynxos${UNAME_RELEASE} + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 @@ -449,16 +529,29 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:*) + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -502,7 +595,7 @@ main () #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif @@ -519,7 +612,7 @@ main () #endif #if defined (__386BSD__) - printf ("i386-unknown-bsd\n"); exit (0); + printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) diff --git a/src/util/autoconf/config.sub b/src/util/autoconf/config.sub index e67a800b5..043252494 100644 --- a/src/util/autoconf/config.sub +++ b/src/util/autoconf/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 1996 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. +# 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 @@ -41,6 +41,8 @@ # 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 +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] @@ -62,11 +64,21 @@ case $1 in ;; 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 +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also @@ -81,38 +93,43 @@ case $os in -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 ) + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) os= basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; + -sco5) + os=sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos @@ -123,35 +140,44 @@ case $os in -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; + -psos*) + os=-psos + ;; 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 \ + tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \ | arme[lb] | pyramid \ - | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ - | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \ - | powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \ + | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ + | alpha | we32k | ns16k | clipper | i370 | sh \ + | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ | pdp11 | mips64el | mips64orion | mips64orionel \ - | sparc) + | sparc | sparclet | sparclite | sparc64) basic_machine=$basic_machine-unknown ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[3456]86) + basic_machine=$basic_machine-pc + ;; # 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-* \ + vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \ | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ - | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-*) + | mips64el-* | mips64orion-* | mips64orionel-* | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -190,6 +216,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-sysv ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; balance) basic_machine=ns32k-sequent os=-dynix @@ -222,6 +252,10 @@ case $basic_machine in basic_machine=cray2-cray os=-unicos ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; crds | unos) basic_machine=m68k-crds ;; @@ -303,25 +337,28 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; + hppa-next) + os=-nextstep3 + ;; 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/'` + i[3456]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[345]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[3456]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[345]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[3456]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[345]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[3456]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; iris | iris4d) @@ -419,14 +456,18 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | p6) - # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium + pentium | p5) basic_machine=i586-intel ;; - pentium-* | p5-* | p6-*) - # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium + pentiumpro | p6) + basic_machine=i686-intel + ;; + pentium-* | p5-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentiumpro-* | p6-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; k5) # We don't have specific support for AMD's K5 yet, so just call it a Pentium basic_machine=i586-amd @@ -536,6 +577,9 @@ case $basic_machine in basic_machine=vax-dec os=-vms ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -615,6 +659,8 @@ esac if [ x"$os" != x"" ] then case $os in + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -626,24 +672,29 @@ case $os in os=-sysv4 ;; -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux|'` + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # 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]* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -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* \ + | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* ) + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -linux-gnu* | -uxpv*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; @@ -668,6 +719,9 @@ case $os in -ctix* | -uts*) os=-sysv ;; + -ns2 ) + os=-nextstep2 + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -775,6 +829,9 @@ case $basic_machine in m88k-omron*) os=-luna ;; + *-next ) + os=-nextstep + ;; *-sequent) os=-ptx ;; @@ -808,6 +865,9 @@ case $basic_machine in *-masscomp) os=-rtu ;; + f301-fujitsu) + os=-uxpv + ;; *) os=-none ;; @@ -826,9 +886,6 @@ case $basic_machine in -sunos*) vendor=sun ;; - -lynxos*) - vendor=lynx - ;; -aix*) vendor=ibm ;; @@ -856,9 +913,12 @@ case $basic_machine in -ptx*) vendor=sequent ;; - -vxworks*) + -vxsim* | -vxworks*) vendor=wrs ;; + -aux*) + vendor=apple + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/src/util/autoconf/configure b/src/util/autoconf/configure index d5f3ea864..9f04e77a3 100644 --- a/src/util/autoconf/configure +++ b/src/util/autoconf/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.10 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -49,6 +49,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -330,7 +332,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.10" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -432,11 +434,14 @@ do 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 +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. 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 "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -498,6 +503,7 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -538,6 +544,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:548: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_M4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -574,6 +581,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:585: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -605,6 +613,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:617: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -669,11 +678,12 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:682: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -696,7 +706,7 @@ else ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -740,11 +750,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -811,7 +835,7 @@ do 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 2.10" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -863,20 +887,56 @@ s%@standards_dvi@%$standards_dvi%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +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". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) 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. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -904,36 +964,31 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" - # allow for outfile[:infile1[+infile2[+infile3...]]] syntax - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}+" - ac_files_in= - for ac_file_name in $ac_file_in - do - ac_files_in="$ac_files_in $ac_given_srcdir/$ac_file_name" - done - IFS="$ac_save_ifs" - configure_input=`echo $ac_files_in | sed 's%/./%/%g -s% *./%%g -s% *%+%g -s%^%Generated automatically from % -s%$% by configure.%'` + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_files_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF diff --git a/src/util/autoconf/ifnames.sh b/src/util/autoconf/ifnames.sh index 24abfad5a..0923deef7 100644 --- a/src/util/autoconf/ifnames.sh +++ b/src/util/autoconf/ifnames.sh @@ -14,7 +14,8 @@ # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # Reads from stdin if no files are given. # Writes to stdout. diff --git a/src/util/autoconf/install-sh b/src/util/autoconf/install-sh index 58719246f..ebc66913e 100644 --- a/src/util/autoconf/install-sh +++ b/src/util/autoconf/install-sh @@ -1,15 +1,27 @@ #! /bin/sh # # install - install a program, script, or datafile -# This comes from X11R5. +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. # # 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. -# +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. # set DOITPROG to echo to test this script diff --git a/src/util/autoconf/install.texi b/src/util/autoconf/install.texi index 67c284b06..f26dfcd41 100644 --- a/src/util/autoconf/install.texi +++ b/src/util/autoconf/install.texi @@ -193,6 +193,8 @@ Print a summary of the options to @code{configure}, and exit. @itemx --silent @itemx -q Do not print messages saying which checks are being made. +To suppress all normal output, redirect it to @file{/dev/null} +(any error messages will still be shown). @item --srcdir=@var{dir} Look for the package's source code in directory @var{dir}. Usually diff --git a/src/util/autoconf/make-stds.texi b/src/util/autoconf/make-stds.texi index 24ffd557e..e7c9cf982 100644 --- a/src/util/autoconf/make-stds.texi +++ b/src/util/autoconf/make-stds.texi @@ -28,6 +28,8 @@ describes conventions for writing the Makefiles for GNU programs. * Command Variables:: Variables for Specifying Commands * Directory Variables:: Variables for Installation Directories * Standard Targets:: Standard Targets for Users +* Install Command Categories:: Three categories of commands in the `install' + rule: normal, pre-install and post-install. @end menu @node Makefile Basics @@ -65,9 +67,10 @@ part of the make or @file{$(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 @file{./} and @file{$(srcdir)/} is important -when using the @samp{--srcdir} option to @file{configure}. A rule of -the form: +The distinction between @file{./} (the @dfn{build directory}) and +@file{$(srcdir)/} (the @dfn{source directory}) is important because +users can build in a separate directory using the @samp{--srcdir} option +to @file{configure}. A rule of the form: @smallexample foo.1 : foo.man sedscript @@ -75,9 +78,8 @@ foo.1 : foo.man sedscript @end smallexample @noindent -will fail when the current directory is not the source directory, -because @file{foo.man} and @file{sedscript} are not in the current -directory. +will fail when the build directory is not the source directory, because +@file{foo.man} and @file{sedscript} are in the the source directory. When using GNU @code{make}, relying on @samp{VPATH} to find the source file will work in the case where there is a single dependency file, @@ -109,6 +111,18 @@ foo.1 : foo.man sedscript sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ @end smallexample +GNU distributions usually contain some files which are not source +files---for example, Info files, and the output from Autoconf, Automake, +Bison or Flex. Since these files normally appear in the source +directory, they should always appear in the source directory, not in the +build directory. So Makefile rules to update them should put the +updated files in the source directory. + +However, if a file does not appear in the distribution, then the +Makefile should not put it in the source directory, because building a +program in ordinary circumstances should not modify the source directory +in any way. + Try to make the build and installation targets, at least (and all their subtargets) work correctly with a parallel @code{make}. @@ -122,11 +136,17 @@ special features of @code{ksh} or @code{bash}. The @code{configure} script and the Makefile rules for building and installation should not use any utilities directly except these: +@c dd find +@c gunzip gzip md5sum +@c mkfifo mknod tee uname + @example -cat cmp cp echo egrep expr false grep -ln mkdir mv pwd rm rmdir sed test touch true +cat cmp cp diff echo egrep expr false grep install-info +ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true @end example +The compression program @code{gzip} can be used in the @code{dist} rule. + Stick to the generally supported options for these programs. For example, don't use @samp{mkdir -p}, convenient as it may be, because most systems don't support it. @@ -140,26 +160,33 @@ user can substitute alternatives. Here are some of the programs we mean: @example -ar bison cc flex install ld lex +ar bison cc flex install ld ldconfig lex make makeinfo ranlib texi2dvi yacc @end example -Use the following @code{make} variables: +Use the following @code{make} variables to run those programs: @example -$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) +$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(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. -(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.) +When you use @code{ranlib} or @code{ldconfig}, you should make sure +nothing bad happens if the system does not have the program in question. +Arrange to ignore an error from that command, and print a message before +the command to tell the user that failure of this command does not mean +a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with +this.) If you use symbolic links, you should implement a fallback for systems that don't have symbolic links. +Additional utilities that can be used via Make variables are: + +@example +chgrp chmod chown mknod +@end example + It is ok to use other utilities in Makefile portions (or scripts) intended only for particular systems where you know those utilities exist. @@ -366,6 +393,20 @@ default, it should be @file{/usr/local/info}, but it should be written as @file{$(prefix)/info}. (If you are using Autoconf, write it as @samp{@@infodir@@}.) +@item lispdir +The directory for installing any Emacs Lisp files in this package. By +default, it should be @file{/usr/local/share/emacs/site-lisp}, but it +should be written as @file{$(prefix)/share/emacs/site-lisp}. + +If you are using Autoconf, write the default as @samp{@@lispdir@@}. +In order to make @samp{@@lispdir@@} work, you need the following lines +in your @file{configure.in} file: + +@example +lispdir='$@{datadir@}/emacs/site-lisp' +AC_SUBST(lispdir) +@end example + @item includedir @c rewritten to avoid overfull hbox --roland The directory for installing header files to be included by user @@ -527,6 +568,7 @@ Here is a sample rule to install an Info file: @comment Please do not reformat it without talking to roland@gnu.ai.mit.edu. @smallexample $(infodir)/foo.info: foo.info + $(POST_INSTALL) # There may be a newer info file in . than in srcdir. -if test -f foo.info; then d=.; \ else d=$(srcdir); fi; \ @@ -543,17 +585,24 @@ $(infodir)/foo.info: foo.info else true; fi @end smallexample +When writing the @code{install} target, you must classify all the +commands into three categories: normal ones, @dfn{pre-installation} +commands and @dfn{post-installation} commands. @xref{Install Command +Categories}. + @item uninstall -Delete all the installed files that the @samp{install} target would -create (but not the noninstalled files such as @samp{make all} would -create). +Delete all the installed files---the copies that the @samp{install} +target creates. This rule should not modify the directories where compilation is done, only the directories where files are installed. +The uninstallation commands are divided into three categories, just like +the installation commands. @xref{Install Command Categories}. + @item install-strip Like @code{install}, but strip the executable files while installing -them. The definition of this target can be very simple: +them. In many cases, the definition of this target can be very simple: @smallexample install-strip: @@ -638,6 +687,12 @@ You must define the variable @code{MAKEINFO} in the Makefile. It should run the @code{makeinfo} program, which is part of the Texinfo distribution. +Normally a GNU distribution comes with Info files, and that means the +Info files are present in the source directory. Therefore, the Make +rule for an info file should update it in the source directory. When +users build the package, ordinarily Make will not update the Info files +because they will already be up to date. + @item dvi Generate DVI files for all Texinfo documentation. For example: @@ -720,3 +775,119 @@ installdirs: mkinstalldirs This rule should not modify the directories where compilation is done. It should do nothing but create installation directories. @end table + +@node Install Command Categories +@section Install Command Categories + +@cindex pre-installation commands +@cindex post-installation commands +When writing the @code{install} target, you must classify all the +commands into three categories: normal ones, @dfn{pre-installation} +commands and @dfn{post-installation} commands. + +Normal commands move files into their proper places, and set their +modes. They may not alter any files except the ones that come entirely +from the package they belong to. + +Pre-installation and post-installation commands may alter other files; +in particular, they can edit global configuration files or data bases. + +Pre-installation commands are typically executed before the normal +commands, and post-installation commands are typically run after the +normal commands. + +The most common use for a post-installation command is to run +@code{install-info}. This cannot be done with a normal command, since +it alters a file (the Info directory) which does not come entirely and +solely from the package being installed. It is a post-installation +command because it needs to be done after the normal command which +installs the package's Info files. + +Most programs don't need any pre-installation commands, but we have the +feature just in case it is needed. + +To classify the commands in the @code{install} rule into these three +categories, insert @dfn{category lines} among them. A category line +specifies the category for the commands that follow. + +A category line consists of a tab and a reference to a special Make +variable, plus an optional comment at the end. There are three +variables you can use, one for each category; the variable name +specifies the category. Category lines are no-ops in ordinary execution +because these three Make variables are normally undefined (and you +@emph{should not} define them in the makefile). + +Here are the three possible category lines, each with a comment that +explains what it means: + +@smallexample + $(PRE_INSTALL) # @r{Pre-install commands follow.} + $(POST_INSTALL) # @r{Post-install commands follow.} + $(NORMAL_INSTALL) # @r{Normal commands follow.} +@end smallexample + +If you don't use a category line at the beginning of the @code{install} +rule, all the commands are classified as normal until the first category +line. If you don't use any category lines, all the commands are +classified as normal. + +These are the category lines for @code{uninstall}: + +@smallexample + $(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.} + $(POST_UNINSTALL) # @r{Post-uninstall commands follow.} + $(NORMAL_UNINSTALL) # @r{Normal commands follow.} +@end smallexample + +Typically, a pre-uninstall command would be used for deleting entries +from the Info directory. + +If the @code{install} or @code{uninstall} target has any dependencies +which act as subroutines of installation, then you should start +@emph{each} dependency's commands with a category line, and start the +main target's commands with a category line also. This way, you can +ensure that each command is placed in the right category regardless of +which of the dependencies actually run. + +Pre-installation and post-installation commands should not run any +programs except for these: + +@example +[ basename bash cat chgrp chmod chown cmp cp dd diff echo +egrep expand expr false fgrep find getopt grep gunzip gzip +hostname install install-info kill ldconfig ln ls md5sum +mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee +test touch true uname xargs yes +@end example + +@cindex binary packages +The reason for distinguishing the commands in this way is for the sake +of making binary packages. Typically a binary package contains all the +executables and other files that need to be installed, and has its own +method of installing them---so it does not need to run the normal +installation commands. But installing the binary package does need to +execute the pre-installation and post-installation commands. + +Programs to build binary packages work by extracting the +pre-installation and post-installation commands. Here is one way of +extracting the pre-installation commands: + +@smallexample +make -n install -o all \ + PRE_INSTALL=pre-install \ + POST_INSTALL=post-install \ + NORMAL_INSTALL=normal-install \ + | gawk -f pre-install.awk +@end smallexample + +@noindent +where the file @file{pre-install.awk} could contain this: + +@smallexample +$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@} +on @{print $0@} +$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@} +@end smallexample + +The resulting file of pre-installation commands is executed as a shell +script as part of installing the binary package. diff --git a/src/util/autoconf/standards.info b/src/util/autoconf/standards.info index a51f1e2d1..60180a022 100644 --- a/src/util/autoconf/standards.info +++ b/src/util/autoconf/standards.info @@ -28,7 +28,7 @@ File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) Version ******* - Last updated 27 February 1996. + Last updated 9 September 1996. * Menu: @@ -60,8 +60,8 @@ 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 27 -February 1996. + This release of the GNU Coding Standards was last updated 9 +September 1996.  File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top @@ -322,6 +322,7 @@ how libraries should behave. * Libraries:: Library behavior * Errors:: Formatting error messages * User Interfaces:: Standards for command line interfaces +* Option Table:: Table of long options. * Memory Usage:: When and how to care about memory needs  @@ -472,7 +473,7 @@ usage messages, should start with a capital letter. But they should not end with a period.  -File: standards.info, Node: User Interfaces, Next: Memory Usage, Prev: Errors, Up: Program Behavior +File: standards.info, Node: User Interfaces, Next: Option Table, Prev: Errors, Up: Program Behavior Standards for Command Line Interfaces ===================================== @@ -520,27 +521,111 @@ 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. +your program (*note Option 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. +options (preferably `-o' or `--output'). Even if you allow an output +file name as an ordinary argument for compatibility, try to provide an +option as another way to specify it. This will lead to more consistency +among GNU utilities, and fewer idiosyncracies for users to remember. + + All programs should support two standard options: `--version' and +`--help'. + +`--version' + This option should direct the program to information about its + name, version, origin and legal status, all on standard output, + and then exit successfully. Other options and arguments should be + ignored once this is seen, and the program should not perform its + normal function. + + The first line is meant to be easy for a program to parse; the + version number proper starts after the last space. In addition, + it contains the canonical name for this program, in this format: + + GNU Emacs 19.30 + + The program's name should be a constant string; *don't* compute it + from `argv[0]'. The idea is to state the standard or canonical + name for the program, not its file name. There are other ways to + find out the precise file name where a command is found in `PATH'. + + If the program is a subsidiary part of a larger package, mention + the package name in parentheses, like this: + + emacsserver (GNU Emacs) 19.30 + + If the package has a version number which is different from this + program's version number, you can mention the package version + number just before the close-parenthesis. + + If you *need* to mention the version numbers of libraries which + are distributed separately from the package which contains this + program, you can do so by printing an additional line of version + info for each library you want to mention. Use the same format + for these lines as for the first line. + + Please don't mention all the libraries that the program uses "just + for completeness"--that would produce a lot of unhelpful clutter. + Please mention library version numbers only if you find in + practice that they are very important to you in debugging. + + The following line, after the version number line or lines, should + be a copyright notice. If more than one copyright notice is + called for, put each on a separate line. + + Next should follow a brief statement that the program is free + software, and that users are free to copy and change it on certain + conditions. If the program is covered by the GNU GPL, say so + here. Also mention that there is no warranty, to the extent + permitted by law. + + It is ok to finish the output with a list of the major authors of + the program, as a way of giving credit. + + Here's an example of output that follows these rules: + + GNU Emacs 19.34.5 + Copyright (C) 1996 Free Software Foundation, Inc. + GNU Emacs comes with NO WARRANTY, to the extent permitted by law. + You may redistribute copies of GNU Emacs + under the terms of the GNU General Public License. + For more information about these matters, see the files named COPYING. + + You should adapt this to your program, of course, filling in the + proper year, copyright holder, name of program, and the references + to distribution terms, and changing the rest of the wording as + necessary. + + This copyright notice only needs to mention the most recent year in + which changes were made--there's no need to list the years for + previous versions' changes. You don't have to mention the name of + the program in these notices, if that is inconvenient, since it + appeared in the first line. + +`--help' + This option should output brief documentation for how to invoke the + program, on standard output, then exit successfully. Other + options and arguments should be ignored once this is seen, and the + program should not perform its normal function. + + Near the end of the `--help' option's output there should be a line + that says where to mail bug reports. It should have this format: + + Report bugs to MAILING-ADDRESS. + + +File: standards.info, Node: Option Table, Next: Memory Usage, Prev: User Interfaces, Up: Program Behavior - 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. +Table of Long Options +===================== - Here is the table of long options used by GNU programs. + Here is a table of long options used by GNU programs. It is surely +incomplete, but we aim to list all the options that a new program might +want to be compatible with. 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. `after-date' `-N' in `tar'. @@ -1137,6 +1222,9 @@ requested information. `no-validate' Used in `makeinfo'. +`no-wait' + Used in `emacsclient'. + `no-warn' Used in various programs to inhibit warnings. @@ -1583,7 +1671,7 @@ requested information. `-z' in `gprof'.  -File: standards.info, Node: Memory Usage, Prev: User Interfaces, Up: Program Behavior +File: standards.info, Node: Memory Usage, Prev: Option Table, Up: Program Behavior Memory Usage ============ @@ -1622,6 +1710,7 @@ writing GNU software. * System Portability:: Portability between different operating systems * CPU Portability:: Supporting the range of CPU types * System Functions:: Portability and "standard" library functions +* Internationalization:: Techniques for internationalization  File: standards.info, Node: Formatting, Next: Comments, Up: Writing C @@ -1895,7 +1984,7 @@ instead, write this: 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. +pointer constant, except when calling a varargs function.  File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C @@ -1991,11 +2080,11 @@ Thus, don't make the following mistake: write(file_descriptor, &c, 1); When calling functions, you need not worry about the difference -between pointers of various types, or between pointers an integers. On -most machines, there's no difference anyway. As for the few machines -where there is a difference, all of them support ANSI C, so you can use -prototypes (conditionalized to be active only in ANSI C) to make the -code work on those systems. +between pointers of various types, or between pointers and integers. +On most machines, there's no difference anyway. As for the few +machines where there is a difference, all of them support ANSI C, so +you can use prototypes (conditionalized to be active only in ANSI C) to +make the code work on those systems. In certain cases, it is ok to pass integer and pointer arguments indiscriminately to the same function, and use no prototype on any @@ -2011,7 +2100,8 @@ that pass their arguments along to `printf' and friends: } In practice, this works on all machines, and it is much simpler than any -"correct" alternative. +"correct" alternative. Be sure *not* to use a prototype for such +functions. However, avoid casting pointers to integers unless you really need to. These assumptions really reduce portability, and in most programs @@ -2021,7 +2111,7 @@ information as well as an address in one word--it is ok to do so, but you'll have to make explicit provisions to handle different word sizes.  -File: standards.info, Node: System Functions, Prev: CPU Portability, Up: Writing C +File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C Calling System Functions ======================== @@ -2128,6 +2218,86 @@ functions to avoid unnecessary loss of portability. defined in systems where the corresponding functions exist. One way to get them properly defined is to use Autoconf. + +File: standards.info, Node: Internationalization, Prev: System Functions, Up: Writing C + +Internationalization +==================== + + GNU has a library called GNU gettext that makes it easy to translate +the messages in a program into various languages. You should use this +library in every program. Use English for the messages as they appear +in the program, and let gettext provide the way to translate them into +other languages. + + Using GNU gettext involves putting a call to the `gettext' macro +around each string that might need translation--like this: + + printf (gettext ("Processing file `%s'...")); + +This permits GNU gettext to replace the string `"Processing file +`%s'..."' with a translated version. + + Once a program uses gettext, please make a point of writing calls to +`gettext' when you add new strings that call for translation. + + Using GNU gettext in a package involves specifying a "text domain +name" for the package. The text domain name is used to separate the +translations for this package from the translations for other packages. +Normally, the text domain name should be the same as the name of the +package--for example, `fileutils' for the GNU file utilities. + + To enable gettext to work well, avoid writing code that makes +assumptions about the structure of words or sentences. When you want +the precise text of a sentence to vary depending on the data, use two or +more alternative string constants each containing a complete sentences, +rather than inserting conditionalized words or phrases into a single +sentence framework. + + Here is an example of what not to do: + + printf ("%d file%s processed", nfiles, + nfiles != 1 ? "s" : ""); + +The problem with that example is that it assumes that plurals are made +by adding `s'. If you apply gettext to the format string, like this, + + printf (gettext ("%d file%s processed"), nfiles, + nfiles != 1 ? "s" : ""); + +the message can use different words, but it will still be forced to use +`s' for the plural. Here is a better way: + + printf ((nfiles != 1 ? "%d files processed" + : "%d file processed"), + nfiles); + +This way, you can apply gettext to each of the two strings +independently: + + printf ((nfiles != 1 ? gettext ("%d files processed") + : gettext ("%d file processed")), + nfiles); + +This can any method of forming the plural of the word for "file", and +also handles languages that require agreement in the word for +"processed". + + A similar problem appears at the level of sentence structure with +this code: + + printf ("# Implicit rule search has%s been done.\n", + f->tried_implicit ? "" : " not"); + +Adding `gettext' calls to this code cannot give correct results for all +languages, because negation in some languages requires adding words at +more than one place in the sentence. By contrast, adding `gettext' +calls does the job straightfowardly if the code starts out like this: + + printf (f->tried_implicit + ? "# Implicit rule search has been done.\n", + : "# Implicit rule search has not been done.\n"); +  File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top @@ -2186,6 +2356,10 @@ documentation; they are a bad example to follow. documentation; use "file name" (two words) instead. We use the term "path" only for search paths, which are lists of file names. + Please do not use the term "illegal" to refer to erroneous input to a +computer program. Use "invalid" instead, and reserve the term +"illegal" for violations of law. +  File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation @@ -2240,27 +2414,65 @@ File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, U 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. + Keep a change log to describe all the changes made to program source +files. 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 you eliminate conceptual +inconsistencies between different parts of a program, by giving you a +history of how the conflicting concepts arose and who they came from. + +* Menu: + +* Change Log Concepts:: +* Style of Change Logs:: +* Simple Changes:: +* Conditional Changes:: + + +File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs + +Change Log Concepts +------------------- + + 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. + + The change log file is normally called `ChangeLog' and covers an +entire directory. Each directory can have its own change log, or a +directory can use the change log of its parent directory-it's up to you. + + Another alternative is to record change log information with a +version control system such as RCS or CVS. This can be converted +automatically to a `ChangeLog' file. + + There's no need to describe the full purpose of the changes or how +they work together. If you think that a change calls for explanation, +you're probably right. Please do explain it--but please put the +explanation in comments in the code, where people will see it whenever +they see the code. For example, "New function" is enough for the +change log when you add a function, because there should be a comment +before the function definition to explain what it does. + + However, sometimes it is useful to write one line to describe the +overall purpose of a batch of changes. - Use the Emacs command `M-x add-change-log-entry' 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. + The easiest way to add an entry to `ChangeLog' is with the Emacs +command `M-x add-change-log-entry'. 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. + +File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs + +Style of Change Logs +-------------------- - Here are some examples: + Here are some examples of change log entries: * register.el (insert-register): Return nil. (jump-to-register): Likewise. @@ -2277,40 +2489,84 @@ and the asterisk when successive entries are in the same file. It's important to name the changed function or variable in full. Don't abbreviate function or variable names, and 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. +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. - 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. + 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 that entry. - However, sometimes it is useful to write one line to describe the -overall purpose of a large batch of changes. + Separate unrelated change log 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. - 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. + +File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs + +Simple Changes +-------------- + + Certain simple kinds of changes don't need much detail in the change +log. 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." +need to make individual entries for all the callers that you changed. +Just write in the entry for the function being called, "All callers +changed." + + * keyboard.c (Fcommand_execute): New arg SPECIAL. + 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. +an entry for the file, without mentioning the functions. Just "Doc +fixes" is enough for the change log. + + There's no need to make change log entries 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; it is enough to compare what the +documentation says with the way the program actually works. + + +File: standards.info, Node: Conditional Changes, Prev: Simple Changes, Up: Change Logs + +Conditional Changes +------------------- + + C programs often contain compile-time `#if' conditionals. Many +changes are conditional; sometimes you add a new definition which is +entirely contained in a conditional. It is very useful to indicate in +the change log the conditions for which the change applies. + + Our convention for indicating conditional changes is to use square +brackets around the name of the condition. + + Here is a simple example, describing a change which is conditional +but does not have a function or entity name associated with it: + + * xterm.c [SOLARIS2]: Include string.h. + + Here is an entry describing a new definition which is entirely +conditional. This new definition for the macro `FRAME_WINDOW_P' is +used only when `HAVE_X_WINDOWS' is defined: + + * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. + + Here is an entry for a change within the function `init_display', +whose definition as a whole is unconditional, but the changes themselves +are contained in a `#ifdef HAVE_LIBNCURSES' conditional: + + * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. + + Here is an entry for a change that takes affect only when a certain +macro is *not* defined: + + (gethostname) [!HAVE_SOCKETS]: Replace with winsock version.  File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation @@ -2553,6 +2809,8 @@ programs. * Command Variables:: Variables for Specifying Commands * Directory Variables:: Variables for Installation Directories * Standard Targets:: Standard Targets for Users +* Install Command Categories:: Three categories of commands in the `install' + rule: normal, pre-install and post-install.  File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions @@ -2586,14 +2844,16 @@ 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: + The distinction between `./' (the "build directory") and +`$(srcdir)/' (the "source directory") is important because users can +build in a separate directory 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. +will fail when the build directory is not the source directory, because +`foo.man' and `sedscript' are in the the source 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 @@ -2617,6 +2877,18 @@ is best written as: foo.1 : foo.man sedscript sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ + GNU distributions usually contain some files which are not source +files--for example, Info files, and the output from Autoconf, Automake, +Bison or Flex. Since these files normally appear in the source +directory, they should always appear in the source directory, not in the +build directory. So Makefile rules to update them should put the +updated files in the source directory. + + However, if a file does not appear in the distribution, then the +Makefile should not put it in the source directory, because building a +program in ordinary circumstances should not modify the source directory +in any way. + Try to make the build and installation targets, at least (and all their subtargets) work correctly with a parallel `make'. @@ -2633,8 +2905,10 @@ 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 false grep - ln mkdir mv pwd rm rmdir sed test touch true + cat cmp cp diff echo egrep expr false grep install-info + ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true + + The compression program `gzip' can be used in the `dist' rule. Stick to the generally supported options for these programs. For example, don't use `mkdir -p', convenient as it may be, because most @@ -2648,23 +2922,27 @@ 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 + ar bison cc flex install ld ldconfig lex make makeinfo ranlib texi2dvi yacc - Use the following `make' variables: + Use the following `make' variables to run those programs: - $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) + $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(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. (The -Autoconf `AC_PROG_RANLIB' macro can help with this.) + When you use `ranlib' or `ldconfig', you should make sure nothing +bad happens if the system does not have the program in question. +Arrange to ignore an error from that command, and print a message before +the command to tell the user that failure of this command does not mean +a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) If you use symbolic links, you should implement a fallback for systems that don't have symbolic links. + Additional utilities that can be used via Make variables are: + + chgrp chmod chown mknod + It is ok to use other utilities in Makefile portions (or scripts) intended only for particular systems where you know those utilities exist. @@ -2860,6 +3138,18 @@ directories: as `$(prefix)/info'. (If you are using Autoconf, write it as `@infodir@'.) +`lispdir' + The directory for installing any Emacs Lisp files in this package. + By default, it should be `/usr/local/share/emacs/site-lisp', but + it should be written as `$(prefix)/share/emacs/site-lisp'. + + If you are using Autoconf, write the default as `@lispdir@'. In + order to make `@lispdir@' work, you need the following lines in + your `configure.in' file: + + lispdir='${datadir}/emacs/site-lisp' + AC_SUBST(lispdir) + `includedir' The directory for installing header files to be included by user programs with the C `#include' preprocessor directive. This @@ -2964,7 +3254,7 @@ 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: Standard Targets, Prev: Directory Variables, Up: Makefile Conventions +File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions Standard Targets for Users -------------------------- @@ -3016,6 +3306,7 @@ Makefiles: Here is a sample rule to install an Info file: $(infodir)/foo.info: foo.info + $(POST_INSTALL) # There may be a newer info file in . than in srcdir. -if test -f foo.info; then d=.; \ else d=$(srcdir); fi; \ @@ -3031,17 +3322,26 @@ Makefiles: $(infodir)/foo.info; \ else true; fi + When writing the `install' target, you must classify all the + commands into three categories: normal ones, "pre-installation" + commands and "post-installation" commands. *Note Install Command + Categories::. + `uninstall' - Delete all the installed files that the `install' target would - create (but not the noninstalled files such as `make all' would - create). + Delete all the installed files--the copies that the `install' + target creates. This rule should not modify the directories where compilation is done, only the directories where files are installed. + The uninstallation commands are divided into three categories, + just like the installation commands. *Note Install Command + Categories::. + `install-strip' Like `install', but strip the executable files while installing - them. The definition of this target can be very simple: + them. In many cases, the definition of this target can be very + simple: install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ @@ -3118,6 +3418,12 @@ Makefiles: run the `makeinfo' program, which is part of the Texinfo distribution. + Normally a GNU distribution comes with Info files, and that means + the Info files are present in the source directory. Therefore, + the Make rule for an info file should update it in the source + directory. When users build the package, ordinarily Make will not + update the Info files because they will already be up to date. + `dvi' Generate DVI files for all Texinfo documentation. For example: @@ -3187,6 +3493,112 @@ programs in which they are useful. (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is not distributed with Texinfo. + +File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions + +Install Command Categories +-------------------------- + + When writing the `install' target, you must classify all the +commands into three categories: normal ones, "pre-installation" +commands and "post-installation" commands. + + Normal commands move files into their proper places, and set their +modes. They may not alter any files except the ones that come entirely +from the package they belong to. + + Pre-installation and post-installation commands may alter other +files; in particular, they can edit global configuration files or data +bases. + + Pre-installation commands are typically executed before the normal +commands, and post-installation commands are typically run after the +normal commands. + + The most common use for a post-installation command is to run +`install-info'. This cannot be done with a normal command, since it +alters a file (the Info directory) which does not come entirely and +solely from the package being installed. It is a post-installation +command because it needs to be done after the normal command which +installs the package's Info files. + + Most programs don't need any pre-installation commands, but we have +the feature just in case it is needed. + + To classify the commands in the `install' rule into these three +categories, insert "category lines" among them. A category line +specifies the category for the commands that follow. + + A category line consists of a tab and a reference to a special Make +variable, plus an optional comment at the end. There are three +variables you can use, one for each category; the variable name +specifies the category. Category lines are no-ops in ordinary execution +because these three Make variables are normally undefined (and you +*should not* define them in the makefile). + + Here are the three possible category lines, each with a comment that +explains what it means: + + $(PRE_INSTALL) # Pre-install commands follow. + $(POST_INSTALL) # Post-install commands follow. + $(NORMAL_INSTALL) # Normal commands follow. + + If you don't use a category line at the beginning of the `install' +rule, all the commands are classified as normal until the first category +line. If you don't use any category lines, all the commands are +classified as normal. + + These are the category lines for `uninstall': + + $(PRE_UNINSTALL) # Pre-uninstall commands follow. + $(POST_UNINSTALL) # Post-uninstall commands follow. + $(NORMAL_UNINSTALL) # Normal commands follow. + + Typically, a pre-uninstall command would be used for deleting entries +from the Info directory. + + If the `install' or `uninstall' target has any dependencies which +act as subroutines of installation, then you should start *each* +dependency's commands with a category line, and start the main target's +commands with a category line also. This way, you can ensure that each +command is placed in the right category regardless of which of the +dependencies actually run. + + Pre-installation and post-installation commands should not run any +programs except for these: + + [ basename bash cat chgrp chmod chown cmp cp dd diff echo + egrep expand expr false fgrep find getopt grep gunzip gzip + hostname install install-info kill ldconfig ln ls md5sum + mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee + test touch true uname xargs yes + + The reason for distinguishing the commands in this way is for the +sake of making binary packages. Typically a binary package contains +all the executables and other files that need to be installed, and has +its own method of installing them--so it does not need to run the normal +installation commands. But installing the binary package does need to +execute the pre-installation and post-installation commands. + + Programs to build binary packages work by extracting the +pre-installation and post-installation commands. Here is one way of +extracting the pre-installation commands: + + make -n install -o all \ + PRE_INSTALL=pre-install \ + POST_INSTALL=post-install \ + NORMAL_INSTALL=normal-install \ + | gawk -f pre-install.awk + +where the file `pre-install.awk' could contain this: + + $0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0} + on {print $0} + $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} + + The resulting file of pre-installation commands is executed as a +shell script as part of installing the binary package. +  File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases @@ -3268,34 +3680,41 @@ Node: Using Extensions8338 Node: ANSI C9840 Node: Source Language11076 Node: Program Behavior12210 -Node: Semantics12802 -Node: Libraries16556 -Node: Errors17791 -Node: User Interfaces19014 -Node: Memory Usage36015 -Node: Writing C37012 -Node: Formatting37654 -Node: Comments40926 -Node: Syntactic Conventions43719 -Node: Names46617 -Node: System Portability47929 -Node: CPU Portability49705 -Node: System Functions51812 -Node: Documentation56684 -Node: GNU Manuals57228 -Node: Manual Structure Details59270 -Node: NEWS File60675 -Node: Change Logs61356 -Node: Man Pages65109 -Node: Reading other Manuals66728 -Node: Managing Releases67512 -Node: Configuration68218 -Node: Makefile Conventions75158 -Node: Makefile Basics75682 -Node: Utilities in Makefiles78153 -Node: Command Variables80027 -Node: Directory Variables82863 -Node: Standard Targets92968 -Node: Releases102716 +Node: Semantics12857 +Node: Libraries16611 +Node: Errors17846 +Node: User Interfaces19069 +Node: Option Table25791 +Node: Memory Usage39895 +Node: Writing C40889 +Node: Formatting41599 +Node: Comments44871 +Node: Syntactic Conventions47664 +Node: Names50602 +Node: System Portability51914 +Node: CPU Portability53690 +Node: System Functions55851 +Node: Internationalization60752 +Node: Documentation63884 +Node: GNU Manuals64428 +Node: Manual Structure Details66640 +Node: NEWS File68045 +Node: Change Logs68726 +Node: Change Log Concepts69443 +Node: Style of Change Logs71211 +Node: Simple Changes72765 +Node: Conditional Changes73956 +Node: Man Pages75333 +Node: Reading other Manuals76952 +Node: Managing Releases77736 +Node: Configuration78442 +Node: Makefile Conventions85382 +Node: Makefile Basics86062 +Node: Utilities in Makefiles89231 +Node: Command Variables91367 +Node: Directory Variables94203 +Node: Standard Targets104772 +Node: Install Command Categories115273 +Node: Releases119846  End Tag Table diff --git a/src/util/autoconf/standards.info-1 b/src/util/autoconf/standards.info-1 deleted file mode 100644 index 2430ade4a..000000000 --- a/src/util/autoconf/standards.info-1 +++ /dev/null @@ -1,1150 +0,0 @@ -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 16 May 1995. - -* 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, Functions and Files -* 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 16 May -1995. - - -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-log-entry' 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. - - If possible, write the `install' target rule so that it does not - modify anything in the directory where the program was built, - provided `make all' has just been done. This is convenient for - building the program under one user name and installing it under - another. - - 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). - - This rule should not modify the directories where compilation is - done, only the directories where files are installed. - -`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. - -`maintainer-clean' - Delete almost 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. - - The reason we say "almost everything" is that `make - maintainer-clean' should not delete `configure' even if - `configure' can be remade using a rule in the Makefile. More - generally, `make maintainer-clean' should not delete anything that - needs to exist in order to run `configure' and then begin to build - the program. This is the only exception; `maintainer-clean' should - delete everything else that can be rebuilt. - - The `maintainer-clean' is intended to be used by a maintainer of - the package, not by ordinary users. You may need special tools to - reconstruct some of the files that `make maintainer-clean' deletes. - Since these files are normally included in the distribution, we - don't take care to make them easy to reconstruct. If you find you - need to unpack the full distribution again, don't blame us. - - To help make users aware of this, the commands for - `maintainer-clean' should start with these two: - - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -`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) - - This rule should not modify the directories where compilation is - done. It should do nothing but create installation directories. - - -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 described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and -other modern operating systems. - - 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' - When building the complete GNU system, the prefix will be empty and - `/usr' will be a symbolic link to `/'. - -`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. 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. - diff --git a/src/util/autoconf/standards.info-2 b/src/util/autoconf/standards.info-2 deleted file mode 100644 index f80c78e86..000000000 --- a/src/util/autoconf/standards.info-2 +++ /dev/null @@ -1,1845 +0,0 @@ -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: 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 -identifier 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, Functions, and Files -************************************** - - 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. - - In general, use `-' to separate words in file names, not `_'. Make -all letters in file names be lower case, except when following specific -conventions that call for upper case in certain kinds of names. -Conventional occasions for using upper case letters in file names -include `Makefile', `ChangeLog', `COPYING' and `README'. It is common -to name other `README'-like documentation files in all upper case just -like `README'. - - -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 file names, 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. - - Do not use a count of errors as the exit status for a program. -*That does not work*, because exit status values are limited to 8 bits -(0 through 255). A single run of the program might have 256 errors; if -you try to return 256 as the exit status, the parent process will see 0 -as the status, and it will appear that the program succeeded. - - -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 file name. 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. - -`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'. - -`assign' - `-v' in Gawk. - -`assume-new' - `-W' in Make. - -`assume-old' - `-o' in Make. - -`auto-check' - `-a' in `recode'. - -`auto-pager' - `-a' in `wdiff'. - -`auto-reference' - `-A' in `ptx'. - -`avoid-wraps' - `-n' in `wdiff'. - -`backward-search' - `-B' in `ctags'. - -`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'. - -`compat' - Used in gawk (no corresponding single-letter option). - -`compress' - `-Z' in `tar' and `shar'. - -`concatenate' - `-A' in `tar'. - -`confirmation' - `-w' in `tar'. - -`context' - Used in `diff'. - -`copyleft' - Used in gawk (no corresponding single-letter option). - -`copyright' - `-C' in `ptx', `recode', and `wdiff'. Also used in gawk (no - corresponding single-letter option). - -`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 `ctags'. - -`date' - `-d' in `touch'. - -`debug' - `-d' in Make and `m4'; `-t' in Bison. - -`define' - `-D' in `m4'. - -`defines' - `-d' in Bison and `ctags'. - -`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'. - -`dry-run' - `-n' in Make. - -`ed' - `-e' in `diff'. - -`elide-empty-files' - `-z' in `csplit'. - -`end-delete' - `-x' in `wdiff'. - -`end-insert' - `-z' in `wdiff'. - -`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'. - -`field-separator' - p`-F' in Gawk. - -`file' - `-f' in Gawk, `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'. - -`freeze-state' - `-F' in `m4'. - -`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' and `wdiff'. - -`ignore-errors' - `-i' in Make. - -`ignore-file' - `-i' in `ptx'. - -`ignore-indentation' - `-I' 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'. - -`language' - `-l' in `etags'. - -`less-mode' - `-l' in `wdiff'. - -`level-for-gzip' - `-g' in `shar'. - -`line-bytes' - `-C' in `split'. - -`lines' - Used in `split', `head', and `tail'. - -`link' - `-l' in `cpio'. - -`lint' - Used in gawk (no corresponding single-letter option). - -`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-common' - `-3' in `wdiff'. - -`no-create' - `-c' in `touch'. - -`no-defines' - `-D' in `etags'. - -`no-deleted' - `-1' in `wdiff'. - -`no-dereference' - `-d' in `cp'. - -`no-inserted' - `-2' in `wdiff'. - -`no-keep-going' - `-S' in Make. - -`no-lines' - `-l' in Bison. - -`no-piping' - `-P' in `shar'. - -`no-prof' - `-e' in `gprof'. - -`no-regex' - `-R' in `etags'. - -`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-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'. - -`posix' - Used in gawk (no corresponding single-letter option). - -`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'. - -`printer' - `-p' in `wdiff'. - -`prompt' - `-p' in `ed'. - -`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. - -`quiet-unshar' - `-Q' in `shar' - -`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' and `etags'. - -`release' - `-r' in `uname'. - -`reload-state' - `-R' in `m4'. - -`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'. - -`source' - Used in gawk (no corresponding single-letter option). - -`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'. - -`start-delete' - `-w' in `wdiff'. - -`start-insert' - `-y' in `wdiff'. - -`starting-file' - Used in `tar' and `diff' to specify which file within a directory - to start processing with. - -`statistics' - `-s' in `wdiff'. - -`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'. `-t' in `wdiff'. - -`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 `ed', `m4', and `ptx'. - -`tty' - Used in GDB. - -`typedefs' - `-t' in `ctags'. - -`typedefs-and-c++' - `-T' in `ctags'. - -`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', `ctags', `mv', `tar'. - -`usage' - Used in gawk (no corresponding single-letter option). - -`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 `ctags'. - -`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 -******************** - -* Menu: - -* GNU Manuals:: Writing proper manuals. -* Manual Structure Details:: Specific structure conventions. -* NEWS File:: NEWS files supplement manuals. -* Man Pages:: Man pages are secondary. -* Reading other Manuals:: How far you can go in learning - from other manuals. - - -File: standards.info, Node: GNU Manuals, Next: Manual Structure Details, Up: Documentation - -GNU Manuals -=========== - - The preferred way to document part of the GNU system is to write a -manual in the Texinfo formatting language. See the Texinfo manual, -either the hardcopy or the version in the Emacs Info subsystem (`C-h -i'). - - The manual should document all of the program's command-line options -and all of its commands. It should give examples of their use. But -don't organize the manual as a list of features. Instead, organize it -logically, by subtopics. Address the goals that a user will have in -mind, and explain how to accomplish them. - - In general, a GNU manual should serve both as tutorial and reference. -It should be set up for convenient access to each topic through Info, -and for reading straight through (appendixes aside). A GNU manual -should give a good introduction to a beginner reading through from the -start, and should also provide all the details that hackers want. - - That is not as hard as it sounds at first. Arrange each chapter as a -logical breakdown of its topic, but order the sections, and write their -text, so that reading the chapter straight through makes sense. Do -likewise when structuring the book into chapters, and when structuring a -section into paragraphs. The watchword is, *at each point, address the -most fundamental and important issue raised by the preceding text.* - - If necessary, add extra chapters at the beginning of the manual which -are purely tutorial and cover the basics of the subject. These provide -the framework for a beginner to understand the rest of the manual. The -Bison manual provides a good example of how to do this. - - Don't use Unix man pages as a model for how to write GNU -documentation; they are a bad example to follow. - - 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. - - -File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation - -Manual Structure Details -======================== - - 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 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. - - -File: standards.info, Node: NEWS File, Next: Man Pages, Prev: Manual Structure Details, Up: Documentation - -The NEWS File -============= - - 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. - - -File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: NEWS File, Up: Documentation - -Man Pages -========= - - 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: Reading other Manuals, Prev: Man Pages, Up: Documentation - -Reading other Manuals -===================== - - There may be non-free books or documentation files that describe the -program you are documenting. - - It is ok to use these documents for reference, just as the author of -a new algebra textbook can read other books on algebra. A large portion -of any non-fiction book consists of facts, in this case facts about how -a certain program works, and these facts are necessarily the same for -everyone who writes about the subject. But be careful not to copy your -outline structure, wording, tables or examples from preexisting non-free -documentation. Copying from free documentation may be ok; please check -with the FSF about the individual case. - diff --git a/src/util/autoconf/standards.info-3 b/src/util/autoconf/standards.info-3 deleted file mode 100644 index f674266a2..000000000 --- a/src/util/autoconf/standards.info-3 +++ /dev/null @@ -1,92 +0,0 @@ -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: 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 7bbe70f14..fe8ebb766 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 27 February 1996 +@set lastupdate 9 September 1996 @c %**end of header @ifinfo @@ -359,6 +359,7 @@ and how libraries should behave. * Libraries:: Library behavior * Errors:: Formatting error messages * User Interfaces:: Standards for command line interfaces +* Option Table:: Table of long options. * Memory Usage:: When and how to care about memory needs @end menu @@ -554,26 +555,117 @@ 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 @samp{--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 -@samp{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 @samp{-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 @samp{--version} which prints the -program's version number on standard output and exits successfully, and -an option @samp{--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. +for your program (@pxref{Option 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 @samp{-o} or @samp{--output}). Even if you allow an output +file name as an ordinary argument for compatibility, try to provide an +option as another way to specify it. This will lead to more consistency +among GNU utilities, and fewer idiosyncracies for users to remember. + +All programs should support two standard options: @samp{--version} +and @samp{--help}. + +@table @code +@item --version +This option should direct the program to information about its name, +version, origin and legal status, all on standard output, and then exit +successfully. Other options and arguments should be ignored once this +is seen, and the program should not perform its normal function. + +The first line is meant to be easy for a program to parse; the version +number proper starts after the last space. In addition, it contains +the canonical name for this program, in this format: + +@example +GNU Emacs 19.30 +@end example + +@noindent +The program's name should be a constant string; @emph{don't} compute it +from @code{argv[0]}. The idea is to state the standard or canonical +name for the program, not its file name. There are other ways to find +out the precise file name where a command is found in @code{PATH}. + +If the program is a subsidiary part of a larger package, mention the +package name in parentheses, like this: + +@example +emacsserver (GNU Emacs) 19.30 +@end example + +@noindent +If the package has a version number which is different from this +program's version number, you can mention the package version number +just before the close-parenthesis. + +If you @strong{need} to mention the version numbers of libraries which +are distributed separately from the package which contains this program, +you can do so by printing an additional line of version info for each +library you want to mention. Use the same format for these lines as for +the first line. + +Please don't mention all the libraries that the program uses ``just for +completeness''---that would produce a lot of unhelpful clutter. Please +mention library version numbers only if you find in practice that they +are very important to you in debugging. + +The following line, after the version number line or lines, should be a +copyright notice. If more than one copyright notice is called for, put +each on a separate line. + +Next should follow a brief statement that the program is free software, +and that users are free to copy and change it on certain conditions. If +the program is covered by the GNU GPL, say so here. Also mention that +there is no warranty, to the extent permitted by law. + +It is ok to finish the output with a list of the major authors of the +program, as a way of giving credit. + +Here's an example of output that follows these rules: + +@smallexample +GNU Emacs 19.34.5 +Copyright (C) 1996 Free Software Foundation, Inc. +GNU Emacs comes with NO WARRANTY, to the extent permitted by law. +You may redistribute copies of GNU Emacs +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING. +@end smallexample + +You should adapt this to your program, of course, filling in the proper +year, copyright holder, name of program, and the references to +distribution terms, and changing the rest of the wording as necessary. + +This copyright notice only needs to mention the most recent year in +which changes were made---there's no need to list the years for previous +versions' changes. You don't have to mention the name of the program in +these notices, if that is inconvenient, since it appeared in the first +line. + +@item --help +This option should output brief documentation for how to invoke the +program, on standard output, then exit successfully. Other options and +arguments should be ignored once this is seen, and the program should +not perform its normal function. + +Near the end of the @samp{--help} option's output there should be a line +that says where to mail bug reports. It should have this format: + +@example +Report bugs to @var{mailing-address}. +@end example +@end table + +@node Option Table +@section Table of Long Options + +Here is a table of long options used by GNU programs. It is surely +incomplete, but we aim to list all the options that a new program might +want to be compatible with. If you use names not already in the table, +please send @samp{gnu@@prep.ai.mit.edu} a list of them, with their +meanings, so we can update the table. @c Please leave newlines between items in this table; it's much easier @c to update when it isn't completely squashed together and unreadable. @@ -581,10 +673,7 @@ the requested information. @c a semicolon between the lists of the programs that use them, not a @c period. --friedman -Here is the table of long options used by GNU programs. - @table @samp - @item after-date @samp{-N} in @code{tar}. @@ -1195,6 +1284,9 @@ Used in @code{makeinfo}. @item no-validate Used in @code{makeinfo}. +@item no-wait +Used in @code{emacsclient}. + @item no-warn Used in various programs to inhibit warnings. @@ -1679,6 +1771,7 @@ when writing GNU software. * System Portability:: Portability between different operating systems * CPU Portability:: Supporting the range of CPU types * System Functions:: Portability and ``standard'' library functions +* Internationalization:: Techniques for internationalization @end menu @node Formatting @@ -2002,7 +2095,7 @@ if (foo == 0) Don't make the program ugly to placate @code{lint}. Please don't insert any casts to @code{void}. Zero without a cast is perfectly fine as a null -pointer constant. +pointer constant, except when calling a varargs function. @node Names @section Naming Variables and Functions @@ -2096,7 +2189,7 @@ while ((c = getchar()) != EOF) @end example When calling functions, you need not worry about the difference between -pointers of various types, or between pointers an integers. On most +pointers of various types, or between pointers and integers. On most machines, there's no difference anyway. As for the few machines where there is a difference, all of them support @sc{ansi} C, so you can use prototypes (conditionalized to be active only in @sc{ansi} C) to make @@ -2119,7 +2212,8 @@ error (s, a1, a2, a3) @noindent In practice, this works on all machines, and it is much simpler than any -``correct'' alternative. +``correct'' alternative. Be sure @emph{not} to use a prototype +for such functions. However, avoid casting pointers to integers unless you really need to. These assumptions really reduce portability, and in most programs they @@ -2244,6 +2338,104 @@ Here we assume that @code{HAVE_STRCHR} and @code{HAVE_STRRCHR} are macros defined in systems where the corresponding functions exist. One way to get them properly defined is to use Autoconf. +@node Internationalization +@section Internationalization + +GNU has a library called GNU gettext that makes it easy to translate the +messages in a program into various languages. You should use this +library in every program. Use English for the messages as they appear +in the program, and let gettext provide the way to translate them into +other languages. + +Using GNU gettext involves putting a call to the @code{gettext} macro +around each string that might need translation---like this: + +@example +printf (gettext ("Processing file `%s'...")); +@end example + +@noindent +This permits GNU gettext to replace the string @code{"Processing file +`%s'..."} with a translated version. + +Once a program uses gettext, please make a point of writing calls to +@code{gettext} when you add new strings that call for translation. + +Using GNU gettext in a package involves specifying a @dfn{text domain +name} for the package. The text domain name is used to separate the +translations for this package from the translations for other packages. +Normally, the text domain name should be the same as the name of the +package---for example, @samp{fileutils} for the GNU file utilities. + +To enable gettext to work well, avoid writing code that makes +assumptions about the structure of words or sentences. When you want +the precise text of a sentence to vary depending on the data, use two or +more alternative string constants each containing a complete sentences, +rather than inserting conditionalized words or phrases into a single +sentence framework. + +Here is an example of what not to do: + +@example +printf ("%d file%s processed", nfiles, + nfiles != 1 ? "s" : ""); +@end example + +@noindent +The problem with that example is that it assumes that plurals are made +by adding `s'. If you apply gettext to the format string, like this, + +@example +printf (gettext ("%d file%s processed"), nfiles, + nfiles != 1 ? "s" : ""); +@end example + +@noindent +the message can use different words, but it will still be forced to use +`s' for the plural. Here is a better way: + +@example +printf ((nfiles != 1 ? "%d files processed" + : "%d file processed"), + nfiles); +@end example + +@noindent +This way, you can apply gettext to each of the two strings +independently: + +@example +printf ((nfiles != 1 ? gettext ("%d files processed") + : gettext ("%d file processed")), + nfiles); +@end example + +@noindent +This can any method of forming the plural of the word for ``file'', and +also handles languages that require agreement in the word for +``processed''. + +A similar problem appears at the level of sentence structure with this +code: + +@example +printf ("# Implicit rule search has%s been done.\n", + f->tried_implicit ? "" : " not"); +@end example + +@noindent +Adding @code{gettext} calls to this code cannot give correct results for +all languages, because negation in some languages requires adding words +at more than one place in the sentence. By contrast, adding +@code{gettext} calls does the job straightfowardly if the code starts +out like this: + +@example +printf (f->tried_implicit + ? "# Implicit rule search has been done.\n", + : "# Implicit rule search has not been done.\n"); +@end example + @node Documentation @chapter Documenting Programs @@ -2296,6 +2488,10 @@ 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. +Please do not use the term ``illegal'' to refer to erroneous input to a +computer program. Use ``invalid'' instead, and reserve the term +``illegal'' for violations of law. + @node Manual Structure Details @section Manual Structure Details @@ -2341,28 +2537,60 @@ user to that file. @node Change Logs @section 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 @kbd{M-x add-change-log-entry} 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: +Keep a change log to describe all the changes made to program source +files. 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 you eliminate conceptual +inconsistencies between different parts of a program, by giving you a +history of how the conflicting concepts arose and who they came from. + +@menu +* Change Log Concepts:: +* Style of Change Logs:: +* Simple Changes:: +* Conditional Changes:: +@end menu + +@node Change Log Concepts +@subsection Change Log Concepts + +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. + +The change log file is normally called @file{ChangeLog} and covers an +entire directory. Each directory can have its own change log, or a +directory can use the change log of its parent directory--it's up to +you. + +Another alternative is to record change log information with a version +control system such as RCS or CVS. This can be converted automatically +to a @file{ChangeLog} file. + +There's no need to describe the full purpose of the changes or how they +work together. If you think that a change calls for explanation, you're +probably right. Please do explain it---but please put the explanation +in comments in the code, where people will see it whenever they see the +code. For example, ``New function'' is enough for the change log when +you add a function, because there should be a comment before the +function definition to explain what it does. + +However, sometimes it is useful to write one line to describe the +overall purpose of a batch of changes. + +The easiest way to add an entry to @file{ChangeLog} is with the Emacs +command @kbd{M-x add-change-log-entry}. 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. + +@node Style of Change Logs +@subsection Style of Change Logs + +Here are some examples of change log entries: @example * register.el (insert-register): Return nil. @@ -2381,41 +2609,87 @@ Restart the tex shell if process is gone or stopped. It's important to name the changed function or variable in full. Don't abbreviate function or variable names, and 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 @samp{* register.el -(@{insert,jump-to@}-register)}; this is not a good idea, since searching -for @code{jump-to-register} or @code{insert-register} would not find the -entry. +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. -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. +For example, some people are tempted to abbreviate groups of function +names by writing @samp{* register.el (@{insert,jump-to@}-register)}; +this is not a good idea, since searching for @code{jump-to-register} or +@code{insert-register} would not find that entry. -However, sometimes it is useful to write one line to describe the -overall purpose of a large batch of changes. +Separate unrelated change log 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. -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. +@node Simple Changes +@subsection Simple Changes + +Certain simple kinds of changes don't need much detail in the change +log. -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 +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 that you changed. Just write in the entry for the function being called, ``All callers changed.'' +@example +* keyboard.c (Fcommand_execute): New arg SPECIAL. +All callers changed. +@end example + 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. +entry for the file, without mentioning the functions. Just ``Doc +fixes'' is enough for the change log. + +There's no need to make change log entries 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; it is enough to compare what the +documentation says with the way the program actually works. + +@node Conditional Changes +@subsection Conditional Changes + +C programs often contain compile-time @code{#if} conditionals. Many +changes are conditional; sometimes you add a new definition which is +entirely contained in a conditional. It is very useful to indicate in +the change log the conditions for which the change applies. + +Our convention for indicating conditional changes is to use square +brackets around the name of the condition. + +Here is a simple example, describing a change which is conditional but +does not have a function or entity name associated with it: + +@example +* xterm.c [SOLARIS2]: Include string.h. +@end example + +Here is an entry describing a new definition which is entirely +conditional. This new definition for the macro @code{FRAME_WINDOW_P} is +used only when @code{HAVE_X_WINDOWS} is defined: + +@example +* frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. +@end example + +Here is an entry for a change within the function @code{init_display}, +whose definition as a whole is unconditional, but the changes themselves +are contained in a @samp{#ifdef HAVE_LIBNCURSES} conditional: + +@example +* dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. +@end example + +Here is an entry for a change that takes affect only when +a certain macro is @emph{not} defined: + +@example +(gethostname) [!HAVE_SOCKETS]: Replace with winsock version. +@end example @node Man Pages @section Man Pages diff --git a/src/util/autoconf/testsuite/Makefile.in b/src/util/autoconf/testsuite/Makefile.in index feab545c4..7c9586013 100644 --- a/src/util/autoconf/testsuite/Makefile.in +++ b/src/util/autoconf/testsuite/Makefile.in @@ -40,8 +40,13 @@ all: info: dvi: -check: site.exp all - @echo This only works if you have the DejaGNU runtest program installed... +dejacheck: + @if $(SHELL) -c 'runtest --version' > /dev/null 2>&1; then :; else \ + echo ERROR: the autoconf tests require the DejaGNU runtest program; \ + exit 1; \ + fi + +check: dejacheck site.exp all $(RUNTEST) $(RUNTESTFLAGS) --tool autoconf AUTOCONF=${AUTOCONF} \ AUTOCONFFLAGS="${AUTOCONFFLAGS}" --srcdir $(srcdir) diff --git a/src/util/autoconf/testsuite/config/unix.exp b/src/util/autoconf/testsuite/config/unix.exp index cf4f08afd..8d19d740d 100644 --- a/src/util/autoconf/testsuite/config/unix.exp +++ b/src/util/autoconf/testsuite/config/unix.exp @@ -88,8 +88,20 @@ proc autoconf_load { args } { return 0 } + # Check whether m4 processing left any icky residue. + # The autoconf script does this already, pretty much. + # catch "exec sed -n -e /dnl/p -e /AC_/p $args" exec_output + # if $verbose>1 then { + # send_user "Checked $args for unexpanded m4 macros\n" + # } + # if ![string match "" $exec_output] then { + # fail "$args, unexpanded m4 macros" + # send_log "$exec_output\n" + # return 0 + # } + # Capture only stderr in exec_output, not "creating Makefile" etc. - catch "exec $args --cache=/dev/null >/dev/null" exec_output + catch "exec ./$args --cache=/dev/null >/dev/null" exec_output if $verbose>1 then { send_user "Executed $args --cache=/dev/null\n" } diff --git a/src/util/autoconf/texinfo.tex b/src/util/autoconf/texinfo.tex index 7489021c5..4db7c68d4 100644 --- a/src/util/autoconf/texinfo.tex +++ b/src/util/autoconf/texinfo.tex @@ -1,4 +1,5 @@ -%% TeX macros to handle texinfo files +%% TeX macros to handle Texinfo files. +%% $Id$ % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, % 94, 95, 1996 Free Software Foundation, Inc. @@ -46,20 +47,20 @@ % Save some parts of plain tex whose names we will redefine. -\let\ptextilde=\~ -\let\ptexlbrace=\{ -\let\ptexrbrace=\} -\let\ptexdots=\dots -\let\ptexdot=\. -\let\ptexstar=\* -\let\ptexend=\end -\let\ptexbullet=\bullet \let\ptexb=\b +\let\ptexbullet=\bullet \let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv = \equiv \let\ptexi=\i +\let\ptexlbrace=\{ +\let\ptexrbrace=\} +\let\ptexstar=\* \let\ptext=\t -\let\ptexl=\l -\let\ptexL=\L +\let\ptextilde=\~ % 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 @@ -74,6 +75,7 @@ } \let\~ = \tie % And make it available as @~. + \message{Basics,} \chardef\other=12 @@ -103,10 +105,9 @@ \hyphenation{eshell} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset \bindingoffset=0pt -\newdimen \normaloffset \normaloffset=\hoffset +\newdimen \bindingoffset +\newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight -\pagewidth=\hsize \pageheight=\vsize % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, @@ -127,7 +128,7 @@ \newdimen\cornerlong \newdimen\cornerthick \newdimen \topandbottommargin \newdimen \outerhsize \newdimen \outervsize -\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks +\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks \outerhsize=7in %\outervsize=9.5in % Alternative @smallbook page size is 9.25in @@ -136,16 +137,42 @@ % %---------------------End change----------------------- +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox \newbox\footlinebox + % \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions itself, but you have to call it yourself. -\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} -\def\onepageout#1{\hoffset=\normaloffset -\ifodd\pageno \advance\hoffset by \bindingoffset -\else \advance\hoffset by -\bindingoffset\fi -{\escapechar=`\\\relax % makes sure backslash is used in output files. -\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% -{\let\hsize=\pagewidth \makefootline}}}% -\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \hoffset=\normaloffset + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \escapechar = `\\ % use backslash in output files. + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + \shipout\vbox{% + \unvbox\headlinebox + \pagebody{#1}% + \unvbox\footlinebox + }% + }% + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} %%%% For @cropmarks command %%%% @@ -157,8 +184,8 @@ % \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up {\escapechar=`\\\relax % makes sure backslash is used in output files. - \shipout - \vbox to \outervsize{\hsize=\outerhsize + \shipout + \vbox to \outervsize{\hsize=\outerhsize \vbox{\line{\ewtop\hfill\ewtop}} \nointerlineskip \line{\vbox{\moveleft\cornerthick\nstop} @@ -166,19 +193,19 @@ \vbox{\moveright\cornerthick\nstop}} \vskip \topandbottommargin \centerline{\ifodd\pageno\hskip\bindingoffset\fi - \vbox{ - {\let\hsize=\pagewidth \makeheadline} - \pagebody{#1} - {\let\hsize=\pagewidth \makefootline}} - \ifodd\pageno\else\hskip\bindingoffset\fi} - \vskip \topandbottommargin plus1fill minus1fill + \vbox{ + {\let\hsize=\pagewidth \makeheadline} + \pagebody{#1} + {\let\hsize=\pagewidth \makefootline}} + \ifodd\pageno\else\hskip\bindingoffset\fi} + \vskip \topandbottommargin plus1fill minus1fill \boxmaxdepth\cornerthick \line{\vbox{\moveleft\cornerthick\nsbot} \hfill \vbox{\moveright\cornerthick\nsbot}} \nointerlineskip \vbox{\line{\ewbot\hfill\ewbot}} - }} + }} \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} % @@ -366,11 +393,43 @@ %\def\'{{'}} % Used to generate quoted braces. - \def\mylbrace {{\tt \char '173}} \def\myrbrace {{\tt \char '175}} \let\{=\mylbrace \let\}=\myrbrace +\begingroup + % Definitions to produce actual \{ & \} command in an index. + \catcode`\{ = 12 \catcode`\} = 12 + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\@ = 0 \catcode`\\ = 12 + @gdef@lbracecmd[\{]% + @gdef@rbracecmd[\}]% +@endgroup + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown +% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } @@ -579,7 +638,7 @@ where each line of input produces a line of output.} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} -\def\spxxx #1{\par \vskip #1\baselineskip} +\def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -592,6 +651,9 @@ where each line of input produces a line of output.} \let\c=\comment +% @paragraphindent is defined for the Info formatting commands only. +\let\paragraphindent=\comment + % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% @@ -626,6 +688,7 @@ where each line of input produces a line of output.} % incorrectly. % \def\ignoremorecommands{% + \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax @@ -666,7 +729,6 @@ where each line of input produces a line of output.} \let\set = \relax \let\clear = \relax \let\item = \relax - \let\message = \relax } % Ignore @ignore ... @end ignore. @@ -681,10 +743,15 @@ where each line of input produces a line of output.} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} +% Also ignore @macro ... @end macro. The user must run texi2dvi, +% which runs makeinfo to do macro expansion. Ignore @unmacro, too. +\def\macro{\doignore{macro}} +\let\unmacro = \comment + + % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. - -\def\dircategory{\comment} +\let\dircategory = \comment % Ignore text until a line `@end #1'. % @@ -717,6 +784,7 @@ where each line of input produces a line of output.} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} @@ -800,7 +868,9 @@ where each line of input produces a line of output.} % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % -\def\set{\begingroup\catcode` =10 \parsearg\setxxx} +\def\set{\begingroup\catcode` =10 + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% @@ -821,10 +891,16 @@ where each line of input produces a line of output.} % @value{foo} gets the text saved in variable foo. % -\def\value#1{\expandafter - \ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}} - \else \csname SET#1\endcsname \fi} +\def\value{\begingroup + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \valuexxx} +\def\valuexxx#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {\{No value for ``#1''\}}% + \else + \csname SET#1\endcsname + \fi +\endgroup} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. @@ -924,6 +1000,7 @@ where each line of input produces a line of output.} \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi \global\let\lastnode=\relax} +% @refill is a no-op. \let\refill=\relax % @setfilename is done at the beginning of every texinfo file. @@ -938,16 +1015,13 @@ where each line of input produces a line of output.} \comment % Ignore the actual filename. } +% @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} - -\def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} -\def\macroxxx#1#2 \end macro{% -\expandafter\gdef\macrotemp#1{#2}% -\endgroup} +% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} +% \def\macroxxx#1#2 \end macro{% +% \expandafter\gdef\macrotemp#1{#2}% +% \endgroup} %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} %\def\linemacroxxx#1#2 \end linemacro{% @@ -959,6 +1033,7 @@ where each line of input produces a line of output.} %\def\butfirst#1{} + \message{fonts,} % Font-change commands. @@ -988,7 +1063,7 @@ where each line of input produces a line of output.} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} -\def\rmbshape{bx} %where the normal face is bold +\def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} @@ -1028,7 +1103,7 @@ where each line of input produces a line of output.} \setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} -% Fonts for indices and small examples. +% Fonts for indices and small examples (9pt). % We actually use the slanted font rather than the italic, % because texinfo normally uses the slanted fonts for that. % Do not make many font distinctions in general in the index, since they @@ -1045,7 +1120,7 @@ where each line of input produces a line of output.} \font\indi=cmmi9 \font\indsy=cmsy9 -% Fonts for headings +% Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} @@ -1057,6 +1132,7 @@ where each line of input produces a line of output.} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 +% Section fonts (14.4pt). \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} @@ -1074,14 +1150,15 @@ where each line of input produces a line of output.} % \setfont\ssectt\ttshape{10}{\magstep1} % \setfont\ssecsf\sfshape{10}{\magstep1} -%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than -%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. +%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. +%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than +%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. %\setfont\ssectt\ttshape{10}{1315} %\setfont\ssecsf\sfshape{10}{1315} %\let\ssecbf=\ssecrm +% Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} @@ -1127,22 +1204,23 @@ where each line of input produces a line of output.} \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl - \resetmathfonts} + \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl - \resetmathfonts} + \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl - \resetmathfonts} + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\indexfonts{% \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl - \resetmathfonts} + \resetmathfonts \setleading{12pt}} % Set up the default fonts, so we can use them for creating boxes. % @@ -1186,11 +1264,21 @@ where each line of input produces a line of output.} } \let\ttfont=\t \def\samp #1{`\tclose{#1}'\null} -\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\setfont\smallrm\rmshape{8}{1000} +\font\smallsy=cmsy9 +\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% + \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} \let\file=\samp \let\url=\samp % perhaps include a hypertex \special eventually +\def\email#1{$\langle${\tt #1}$\rangle$} % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1222,21 +1310,26 @@ where each line of input produces a line of output.} % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate an a dash. +% and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active +\catcode`\|=\active \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} % The following is used by \doprintindex to insure that long function names % wrap around. It is necessary for - and _ to be active before the index is % read from the file, as \entry parses the arguments long before \code is % ever called. -- mycroft -\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} +% _ is always active; and it shouldn't be \let = to an _ that is a +% subscript character anyway. Then, @cindex @samp{_} (for example) +% fails. --karl +\global\def\indexbreaks{% + \catcode`\-=\active \let-\realdash +} } \def\realdash{-} -\def\realunder{_} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\normalunderscore\discretionary{}{}{}} \def\codex #1{\tclose{#1}\endgroup} @@ -1267,12 +1360,19 @@ where each line of input produces a line of output.} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} -\def\l#1{{\li #1}\null} % +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} -\def\r#1{{\rm #1}} % roman font +\def\r#1{{\rm #1}} % roman font % Use of \lowercase was suggested. -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @pounds{} is a sterling sign. +\def\pounds{{\it\$}} + \message{page headings,} @@ -1287,7 +1387,7 @@ where each line of input produces a line of output.} \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} + \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm @@ -1304,9 +1404,9 @@ where each line of input produces a line of output.} % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefont{##1}} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % @@ -1324,7 +1424,7 @@ where each line of input produces a line of output.} \let\oldpage = \page \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi \oldpage \let\page = \oldpage @@ -1412,14 +1512,15 @@ where each line of input produces a line of output.} % }% unbind the catcode of @. -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. -% By default, they are off. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} @@ -1433,22 +1534,24 @@ where each line of input produces a line of output.} % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ -%\pagealignmacro \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage } +\let\contentsalignmacro = \chappager + % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ -%\pagealignmacro \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -1459,6 +1562,7 @@ where each line of input produces a line of output.} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} @@ -1467,6 +1571,7 @@ where each line of input produces a line of output.} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings @@ -1490,6 +1595,7 @@ July\or August\or September\or October\or November\or December\fi \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} + \message{tables,} % @tabs -- simple alignment @@ -1812,6 +1918,7 @@ July\or August\or September\or October\or November\or December\fi % 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 ... @@ -1832,7 +1939,7 @@ July\or August\or September\or October\or November\or December\fi % 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 +% @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: @@ -1856,8 +1963,9 @@ July\or August\or September\or October\or November\or December\fi % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. -% @multitablelinespace is space to leave between table items; -% 0 means it depends on current normal line spacing. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. %%%% % Dimensions @@ -1897,7 +2005,8 @@ July\or August\or September\or October\or November\or December\fi % We don't need this so we don't use it. \else \global\advance\colcount by1 - \setbox0=\hbox{#1}% + \setbox0=\hbox{#1 }% Add a normal word space as a separator; + % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi% \fi% @@ -1936,7 +2045,7 @@ July\or August\or September\or October\or November\or December\fi % \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 +\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. @@ -1958,26 +2067,41 @@ July\or August\or September\or October\or November\or December\fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi -\noindent##%\par -%\vskip\multitablelinespace -}\cr% + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighing sequences respectively marking + % characters. + \noindent\ignorespaces##\unskip\multistrut}\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\multitablelinespace -\filbreak%% keeps underfull box messages off when table breaks over pages. -\global\colcount=0\relax}}} +\global\everycr{\noalign{% +% \filbreak%% keeps underfull box messages off when table breaks over pages. +% Maybe so, but it also creates really weird page breaks when the table +% breaks over pages Wouldn't \vfil be better? Wait until the problem +% manifests itself, so it can be fixed for real --karl. +\global\colcount=0\relax}} +} \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt -\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip -\global\advance\multitablelinespace by-\ht0\fi +%% strut to put in table in case some entry doesn't have descenders, +%% to keep lines equally spaced +\let\multistrut = \strut %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. +\else +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \fi \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller @@ -1988,6 +2112,8 @@ July\or August\or September\or October\or November\or December\fi \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} + + \message{indexing,} % Index generation facilities @@ -2000,14 +2126,14 @@ July\or August\or September\or October\or November\or December\fi % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. +% the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. \def\newindex #1{ \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\doindex {#1}} } @@ -2019,8 +2145,8 @@ July\or August\or September\or October\or November\or December\fi \def\newcodeindex #1{ \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\docodeindex {#1}} } @@ -2031,7 +2157,7 @@ July\or August\or September\or October\or November\or December\fi \def\synindex #1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\doindex {#2}}% } @@ -2040,7 +2166,7 @@ July\or August\or September\or October\or November\or December\fi \def\syncodeindex #1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\docodeindex {#2}}% } @@ -2088,24 +2214,31 @@ July\or August\or September\or October\or November\or December\fi \def\L{\realbackslash L}% \def\ss{\realbackslash ss}% % Take care of texinfo commands likely to appear in an index entry. +% (Must be a way to avoid doing expansion at all, and thus not have to +% laboriously list every single command here.) +\def\@{@}% will be @@ when we switch to @ as escape char. +%\let\{ = \lbracecmd +%\let\} = \rbracecmd \def\_{{\realbackslash _}}% \def\w{\realbackslash w }% \def\bf{\realbackslash bf }% -\def\rm{\realbackslash rm }% +%\def\rm{\realbackslash rm }% \def\sl{\realbackslash sl }% \def\sf{\realbackslash sf}% \def\tt{\realbackslash tt}% \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% -\def\char{\realbackslash char}% +%\def\char{\realbackslash char}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\copyright{\realbackslash copyright }% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% +\def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% -\def\t##1{\realbackslash r {##1}}% +\def\,##1{\realbackslash ,{##1}}% +\def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% \def\i##1{\realbackslash i {##1}}% \def\b##1{\realbackslash b {##1}}% @@ -2133,6 +2266,7 @@ July\or August\or September\or October\or November\or December\fi \def\indexnofonts{% % Just ignore accents. +\let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont @@ -2145,6 +2279,7 @@ July\or August\or September\or October\or November\or December\fi \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont +\let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\oe{oe}% \def\ae{ae}% @@ -2178,6 +2313,7 @@ July\or August\or September\or October\or November\or December\fi \let\var=\indexdummyfont \let\TeX=\indexdummytex \let\dots=\indexdummydots +\def\@{@}% } % To define \realbackslash, we must make \ not be an escape. @@ -2193,29 +2329,37 @@ July\or August\or September\or October\or November\or December\fi % workhorse for all \fooindexes % #1 is name of index, #2 is stuff to put there \def\doind #1#2{% -% Put the index entry in the margin if desired. -\ifx\SETmarginindex\relax\else% -\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% -\fi% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% Expand all macros now EXCEPT \folio -\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now -% so it will be output as is; and it will print as backslash in the indx. -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}}}% -\temp }% -}\penalty\count10}} + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \fi + {% + \count255=\lastpenalty + {% + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + {% + \let\folio=0% We will expand all macros now EXCEPT \folio. + \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % First process the index-string with all font commands turned off + % to get the string to sort by. + {\indexnofonts \xdef\indexsorttmp{#2}}% + % + % Now produce the complete index entry, with both the sort key and the + % original text, including any font commands. + \toks0 = {#2}% + \edef\temp{% + \write\csname#1indfile\endcsname{% + \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% + }% + \temp + }% + }% + \penalty\count255 + }% +} \def\dosubind #1#2#3{% {\count10=\lastpenalty % @@ -2276,26 +2420,19 @@ July\or August\or September\or October\or November\or December\fi \def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{% - \tex - \dobreak \chapheadingskip {10000} - \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - \catcode`\$=\other - \catcode`\~=\other - \indexbreaks +\def\doprintindex#1{\begingroup + \dobreak \chapheadingskip{10000}% % - % The following don't help, since the chars were translated - % when the raw index was written, and their fonts were discarded - % due to \indexnofonts. - %\catcode`\"=\active - %\catcode`\^=\active - %\catcode`\_=\active - %\catcode`\|=\active - %\catcode`\<=\active - %\catcode`\>=\active - % % - \def\indexbackslash{\rawbackslashxx} - \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt + \indexfonts \rm + \tolerance = 9500 + \indexbreaks + \def\indexbackslash{\rawbackslashxx}% + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \catcode`\\ = 0 + \catcode`\@ = 11 + \escapechar = `\\ \begindoublecolumns % % See if the index file exists and is nonempty. @@ -2306,7 +2443,7 @@ July\or August\or September\or October\or November\or December\fi % index. The easiest way to prevent this problem is to make sure % there is some text. (Index is nonexistent) - \else + \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so @@ -2320,8 +2457,7 @@ July\or August\or September\or October\or November\or December\fi \fi \closein 1 \enddoublecolumns - \Etex -} +\endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. @@ -2412,15 +2548,15 @@ July\or August\or September\or October\or November\or December\fi \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par }} -%% Define two-column mode, which is used in indexes. -%% Adapted from the TeXbook, page 416. -\catcode `\@=11 +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 \newbox\partialpage - \newdimen\doublecolumnhsize -\def\begindoublecolumns{\begingroup +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {\global\setbox\partialpage =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% @@ -2453,51 +2589,51 @@ July\or August\or September\or October\or November\or December\fi % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize - \doublecolumnpagegoal } - -\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} - -\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth - \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage - \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} - \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} - \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage + % box0 will be the left-hand column, box1 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 \penalty\outputpenalty } -\def\doublecolumnpagegoal{% - \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ +\def\pagesofar{% + % The contents of the output page -- any previous material, + % followed by the two boxes we just split. + \unvbox\partialpage + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } -\def\pagesofar{\unvbox\partialpage % - \hsize=\doublecolumnhsize % have to restore this since output routine - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} -\def\doublecolumnout{% - \setbox5=\copy255 - {\vbadness=10000 \doublecolumnsplit} - \ifvbox255 - \setbox0=\vtop to\dimen@{\unvbox0} - \setbox2=\vtop to\dimen@{\unvbox2} - \onepageout\pagesofar \unvbox255 \penalty\outputpenalty - \else - \setbox0=\vbox{\unvbox5} - \ifvbox0 - \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth - {\vbadness=10000 - \loop \global\setbox5=\copy0 - \setbox1=\vsplit5 to\dimen@ - \setbox3=\vsplit5 to\dimen@ - \ifvbox5 \global\advance\dimen@ by1pt \repeat - \setbox0=\vbox to\dimen@{\unvbox1} - \setbox2=\vbox to\dimen@{\unvbox3} - \global\setbox\partialpage=\vbox{\pagesofar} - \doublecolumnpagegoal - } - \fi - \fi +\def\enddoublecolumns{% + \output={\balancecolumns}\eject % split what we have + \endgroup + % Back to normal single-column typesetting, but take account of the + % fact that we just accumulated some stuff on the output page. + \pagegoal=\vsize +} +\def\balancecolumns{% + % Called on the last page of the double column material. + \setbox0=\vbox{\unvbox255}% + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {\vbadness=10000 \loop \global\setbox3=\copy0 + \global\setbox1=\vsplit3 to\dimen@ + \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + \pagesofar } - \catcode `\@=\other + + \message{sectioning,} % Define chapters, sections, etc. @@ -2669,6 +2805,10 @@ July\or August\or September\or October\or November\or December\fi \global\let\subsubsection = \appendixsubsubsec }} +% @centerchap is like @unnumbered, but the heading is centered. +\outer\def\centerchap{\parsearg\centerchapyyy} +\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} + \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz @@ -2771,7 +2911,7 @@ July\or August\or September\or October\or November\or December\fi \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% +\plainsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% \escapechar=`\\% @@ -2816,7 +2956,7 @@ July\or August\or September\or October\or November\or December\fi \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% +\plainsubsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% \escapechar=`\\% @@ -2854,10 +2994,10 @@ July\or August\or September\or October\or November\or December\fi % NOTE on use of \vbox for chapter headings, section headings, and % such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. @@ -2875,11 +3015,10 @@ July\or August\or September\or October\or November\or December\fi \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} -\def\heading{\parsearg\secheadingi} - -\def\subheading{\parsearg\subsecheadingi} - -\def\subsubheading{\parsearg\subsubsecheadingi} +% @heading, @subheading, @subsubheading. +\def\heading{\parsearg\plainsecheading} +\def\subheading{\parsearg\plainsubsecheading} +\def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -2893,7 +3032,7 @@ July\or August\or September\or October\or November\or December\fi %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) -\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt +\newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} @@ -2902,15 +3041,18 @@ July\or August\or September\or October\or November\or December\fi \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{ +\global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{ +\global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ +\global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} @@ -2919,25 +3061,39 @@ July\or August\or September\or October\or November\or December\fi \def\CHAPFplain{ \global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain} +\global\let\unnumbchapmacro=\unnchfplain +\global\let\centerchapmacro=\centerchfplain} -\def\chfplain #1#2{% +% Plain chapter opening. +% #1 is the text, #2 the chapter number or empty if unnumbered. +\def\chfplain#1#2{% \pchapsepmacro {% - \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #2\enspace #1}% + \chapfonts \rm + \def\chapnum{#2}% + \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 \centerparametersmaybe + \unhbox0 #1\par}% }% - \bigskip - \penalty5000 + \nobreak\bigskip % no page break after a chapter title + \nobreak } -\def\unnchfplain #1{% -\pchapsepmacro % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} +% Plain opening for unnumbered. +\def\unnchfplain#1{\chfplain{#1}{}} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerchfplain#1{{% + \def\centerparametersmaybe{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt + }% + \chfplain{#1}{}% +}} + \CHAPFplain % The default \def\unnchfopen #1{% @@ -2951,73 +3107,81 @@ July\or August\or September\or October\or November\or December\fi \par\penalty 5000 % } +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % +} + \def\CHAPFopen{ \global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen} +\global\let\unnumbchapmacro=\unnchfopen +\global\let\centerchapmacro=\centerchfopen} + -% Parameter controlling skip before section headings. +% Section titles. +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} +\def\plainsecheading#1{\sectionheading{sec}{}{#1}} -\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt +% Subsection titles. +\newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} +\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} +\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} -\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +% Subsubsection titles. +\let\subsubsecheadingskip = \subsecheadingskip +\let\subsubsecheadingbreak = \subsecheadingbreak +\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} +\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} -% @paragraphindent is defined for the Info formatting commands only. -\let\paragraphindent=\comment -% Section fonts are the base font at magstep2, which produces -% a size a bit more than 14 points in the default situation. - -\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} -\def\plainsecheading #1{\secheadingi {#1}} -\def\secheadingi #1{{\advance \secheadingskip by \parskip % -\secheadingbreak}% -{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - -% Subsection fonts are the base font at magstep1, -% which produces a size of 12 points. - -\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} -\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - -\def\subsubsecfonts{\subsecfonts} % Maybe this should change: - % Perhaps make sssec fonts scaled - % magstep half -\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} -\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} +% Print any size section title. +% +% #1 is the section type (sec/subsec/subsubsec), #2 is the section +% number (maybe empty), #3 the text. +\def\sectionheading#1#2#3{% + {% + \expandafter\advance\csname #1headingskip\endcsname by \parskip + \csname #1headingbreak\endcsname + }% + {% + % Switch to the right set of fonts. + \csname #1fonts\endcsname \rm + % + % Only insert the separating space if we have a section number. + \def\secnum{#2}% + \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 % zero if no section number + \unhbox0 #3}% + }% + \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak +} \message{toc printing,} - % Finish up the main text and prepare to read what we've written % to \contentsfile. \newskip\contentsrightmargin \contentsrightmargin=1in \def\startcontents#1{% - \pagealignmacro + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro \immediate\closeout \contentsfile \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. + \pageno = -1 % Request roman numbered pages. \fi % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% - \begingroup % Set up to handle contents files properly. + \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. @@ -3043,6 +3207,7 @@ July\or August\or September\or October\or November\or December\fi \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \rm + \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2{} @@ -3086,7 +3251,7 @@ July\or August\or September\or October\or November\or December\fi % This space should be plenty, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % (This space doesn't include the extra space that gets added after - % the label; that gets put in in \shortchapentry above.) + % the label; that gets put in by \shortchapentry above.) \advance\dimen0 by 1.1em \hbox to \dimen0{#1\hfil}% } @@ -3107,22 +3272,21 @@ July\or August\or September\or October\or November\or December\fi \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % -% If the toc has to be broken over pages, we would want to be at chapters +% If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% - \penalty-300 \vskip\baselineskip + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno{#2}}% \endgroup - \nobreak\vskip .25\baselineskip + \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup @@ -3147,7 +3311,7 @@ July\or August\or September\or October\or November\or December\fi % % \turnoffactive is for the sake of @" used for umlauts. \def\tocentry#1#2{\begingroup - \hyphenpenalty = 10000 + \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks \entry{\turnoffactive #1}{\turnoffactive #2}% \endgroup} @@ -3172,8 +3336,6 @@ July\or August\or September\or October\or November\or December\fi \newbox\pushcharbox \newbox\bullbox \newbox\equivbox \newbox\errorbox -\let\ptexequiv = \equiv - %{\tentt %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} @@ -3184,12 +3346,11 @@ July\or August\or September\or October\or November\or December\fi % depth .1ex\hfil} %} +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. \def\point{$\star$} - \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % Adapted from the TeXbook's \boxit. @@ -3221,7 +3382,7 @@ July\or August\or September\or October\or November\or December\fi \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 -\catcode 43=12 +\catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 @@ -3229,16 +3390,18 @@ July\or August\or September\or October\or November\or December\fi \catcode`\>=12 \escapechar=`\\ % +\let\,=\ptexcomma \let\~=\ptextilde \let\{=\ptexlbrace \let\}=\ptexrbrace \let\.=\ptexdot \let\*=\ptexstar \let\dots=\ptexdots +\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} +\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} \def\@{@}% \let\bullet=\ptexbullet -\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl -\let\L=\ptexL +\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext % \let\Etex=\endgroup} @@ -3297,50 +3460,50 @@ July\or August\or September\or October\or November\or December\fi \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt %we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18pt % allow for 3pt kerns on either +% side, and for 6pt waste from +% each corner char + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \hsize=\cartinner + \kern3pt + \begingroup + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup + \endgroup + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup \endgroup }} @@ -3403,8 +3566,7 @@ July\or August\or September\or October\or November\or December\fi \let\Esmalllisp = \nonfillfinish \let\Esmallexample = \nonfillfinish % - % Smaller interline space and fonts for small examples. - \setleading{10pt}% + % Smaller fonts for small examples. \indexfonts \tt \rawbackslash % make \ output the \ character from the current font (tt) \gobble @@ -3644,17 +3806,16 @@ July\or August\or September\or October\or November\or December\fi } % Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does, putting the result in \tptemp. +% braces (if any). That's what this does. % -\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% +\def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. % \def\parsetpheaderline#1#2#3{% - \removeemptybraces#2\relax - #1{\tptemp}{#3}% + #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % @@ -3888,19 +4049,21 @@ July\or August\or September\or October\or November\or December\fi \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} -% #1 is the data type. #2 is the name. +% #1 is the data type. #2 is the name, perhaps followed by text that +% is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% -\doind {vr}{\code{#2}}% Make entry in variables index +\dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} +\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} -\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% +\def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 @@ -3932,6 +4095,7 @@ July\or August\or September\or October\or November\or December\fi \def\deftpx #1 {\errmessage{@deftpx in invalid context}} + \message{cross reference,} % Define cross-reference macros \newwrite \auxfile @@ -3939,6 +4103,11 @@ July\or August\or September\or October\or November\or December\fi \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. +% @inforef is simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + % \setref{foo} defines a cross-reference point named foo. \def\setref#1{% @@ -4017,7 +4186,7 @@ July\or August\or September\or October\or November\or December\fi % Use \turnoffactive so that punctuation chars such as underscore % work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% +\def\dosetq #1#2{{\let\folio=0 \turnoffactive \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% \next}} @@ -4086,84 +4255,101 @@ July\or August\or September\or October\or November\or December\fi #2% Output the suffix in any case. } -% Read the last existing aux file, if any. No error if none exists. - % This is the macro invoked by entries in the aux file. -\def\xrdef #1#2{ -{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} +\def\xrdef #1#2{{% + \catcode`\'=\other + \expandafter\gdef\csname X#1\endcsname{#2}% +}} -\def\readauxfile{% -\begingroup -\catcode `\^^@=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\^^C=\other -\catcode `\^^D=\other -\catcode `\^^E=\other -\catcode `\^^F=\other -\catcode `\^^G=\other -\catcode `\^^H=\other -\catcode `\ =\other -\catcode `\^^L=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode 26=\other -\catcode `\^^[=\other -\catcode `\^^\=\other -\catcode `\^^]=\other -\catcode `\^^^=\other -\catcode `\^^_=\other -\catcode `\@=\other -\catcode `\^=\other -\catcode `\~=\other -\catcode `\[=\other -\catcode `\]=\other -\catcode`\"=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode `\$=\other -\catcode `\#=\other -\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 +% Read the last existing aux file, if any. No error if none exists. +\def\readauxfile{\begingroup + \catcode`\^^@=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\ =\other + \catcode`\^^L=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode26=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + \catcode`\@=\other + \catcode`\^=\other + % It was suggested to define this as 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + % `\+ does not work, so use 43. + \catcode43=\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. -% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ -% Reference to such entries still does not work the way one would wish, -% but at least they do not bomb out when the aux file is read in. -\catcode `\{=1 \catcode `\}=2 -\catcode `\%=\other -\catcode `\'=0 -\catcode`\^=7 % to make ^^e4 etc usable in xref tags -\catcode `\\=\other -\openin 1 \jobname.aux -\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue -\global\warnedobstrue -\fi -% Open the new aux file. Tex will close it automatically at exit. -\openout \auxfile=\jobname.aux + % The aux file uses ' as the escape (for now). + % Turn off \ as an escape so we do not lose on + % entries which were dumped with control sequences in their names. + % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ + % Reference to such entries still does not work the way one would wish, + % but at least they do not bomb out when the aux file is read in. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\%=\other + \catcode`\'=0 + \catcode`\\=\other + % + \openin 1 \jobname.aux + \ifeof 1 \else + \closein 1 + \input \jobname.aux + \global\havexrefstrue + \global\warnedobstrue + \fi + % Open the new aux file. TeX will close it automatically at exit. + \openout\auxfile=\jobname.aux \endgroup} @@ -4174,7 +4360,8 @@ July\or August\or September\or October\or November\or December\fi % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is -% removed. +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only.. @@ -4202,8 +4389,12 @@ July\or August\or September\or October\or November\or December\fi % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset and anything else that uses +% \parseargline fail inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. % -\long\gdef\footnotezzz#1{\insert\footins{% +\long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. @@ -4225,8 +4416,13 @@ July\or August\or September\or October\or November\or December\fi % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut - #1\strut}% + \futurelet\next\fo@t } +\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} +\def\f@@t{\bgroup\aftergroup\@foot\let\next} +\def\f@t#1{#1\@foot} +\def\@foot{\strut\egroup} }%end \catcode `\@=11 @@ -4299,13 +4495,18 @@ July\or August\or September\or October\or November\or December\fi % Set some numeric style parameters, for 8.5 x 11 format. -%\hsize = 6.5in +\hsize = 6in +\hoffset = .25in \newdimen\defaultparindent \defaultparindent = 15pt \parindent = \defaultparindent -\parskip 18pt plus 1pt -\setleading{15pt} +\parskip 3pt plus 2pt minus 1pt +\setleading{13.2pt} \advance\topskip by 1.2cm +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + % Prevent underfull vbox error messages. \vbadness=10000 @@ -4328,30 +4529,28 @@ July\or August\or September\or October\or November\or December\fi % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) \def\smallbook{ - -% These values for secheadingskip and subsecheadingskip are -% experiments. RJC 7 Aug 1992 -\global\secheadingskip = 17pt plus 6pt minus 3pt -\global\subsecheadingskip = 14pt plus 6pt minus 3pt - -\global\lispnarrowing = 0.3in -\setleading{12pt} -\advance\topskip by -1cm -\global\parskip 3pt plus 1pt -\global\hsize = 5in -\global\vsize=7.5in -\global\tolerance=700 -\global\hfuzz=1pt -\global\contentsrightmargin=0pt -\global\deftypemargin=0pt -\global\defbodyindent=.5cm - -\global\pagewidth=\hsize -\global\pageheight=\vsize - -\global\let\smalllisp=\smalllispx -\global\let\smallexample=\smalllispx -\global\def\Esmallexample{\Esmalllisp} + \global\chapheadingskip = 15pt plus 4pt minus 2pt + \global\secheadingskip = 12pt plus 3pt minus 2pt + \global\subsecheadingskip = 9pt plus 2pt minus 2pt + % + \global\lispnarrowing = 0.3in + \setleading{12pt} + \advance\topskip by -1cm + \global\parskip 2pt plus 1pt + \global\hsize = 5in + \global\vsize=7.5in + \global\tolerance=700 + \global\hfuzz=1pt + \global\contentsrightmargin=0pt + \global\deftypemargin=0pt + \global\defbodyindent=.5cm + % + \global\pagewidth=\hsize + \global\pageheight=\vsize + % + \global\let\smalllisp=\smalllispx + \global\let\smallexample=\smalllispx + \global\def\Esmallexample{\Esmalllisp} } % Use @afourpaper to print on European A4 paper. @@ -4374,6 +4573,11 @@ July\or August\or September\or October\or November\or December\fi \global\pageheight=\vsize } +\bindingoffset=0pt +\normaloffset=\hoffset +\pagewidth=\hsize +\pageheight=\vsize + % Allow control of the text dimensions. Parameters in order: textheight; % textwidth; voffset; hoffset; binding offset; topskip. % All require a dimension; @@ -4450,7 +4654,6 @@ July\or August\or September\or October\or November\or December\fi \def~{{\tt \char '176}} \chardef\hat=`\^ \catcode`\^=\active -\def\auxhat{\def^{'hat}} \def^{{\tt \hat}} \catcode`\_=\active