From: Tom Yu Date: Fri, 23 Jul 1999 02:30:33 +0000 (+0000) Subject: resolve conflicts from autoconf-2.13 import X-Git-Tag: krb5-1.1-beta1~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f455652ae5673bdd4beb55c9615483216e72d716;p=krb5.git resolve conflicts from autoconf-2.13 import git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11577 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/autoconf/ChangeLog b/src/util/autoconf/ChangeLog index 9a7a41a2a..1ef762c64 100644 --- a/src/util/autoconf/ChangeLog +++ b/src/util/autoconf/ChangeLog @@ -1,15 +1,389 @@ -Thu Jun 19 22:30:06 1997 Tom Yu +1999-01-05 Ben Elliston + + * Version 2.13. + +1999-01-04 Ben Elliston + + * autoconf.texi (AC_CHECK_FILE): Document. + (AC_CHECK_FILES): Likewise. + (AC_SEARCH_LIBS): Likewise. + (AC_FUNC_SELECT_ARGTYPES): Use Jeff Garzik's version. + (AC_C_STRINGIZE): Likewise. + (AC_CYGWIN): Document. + (AC_EXEEXT): Likewise. + (AC_OBJEXT): Likewise. + (AC_MINGW32): Likewise. + (AC_TRY_LINK_FUNC): Likewise. + (AC_VALIDATE_CACHED_SYSTEM_TUPLE): Likewise. + +1999-01-01 Ben Elliston + + * NEWS: Update. + + * acspecific.m4 (AC_PROG_CXX_WORKS): Specify an explicit return + type for `main' to keep modern C++ compilers happy. + +1998-12-28 Jeff Garzik + + * autoconf.texi: + (AC_SEARCH_LIBS, AC_CHECK_FILE, AC_CHECK_FILES, + AC_TRY_LINK_FUNC): Document. + (AC_CHECK_LIB): Indicate the absence of + action-if-not-found will not kill default action. + (AC_SYS_INTERPRETER): Alphabetize with rest of section, + s/ac_cv_sys_interpreter/interpval/ + + * acgeneral.m4: + (AC_TRY_LINK_FUNC): Fix arg transposition. + (AC_SEARCH_LIBS): Require autoconf 2.13, add other-libs arg. + (AC_CHECK_FILES): Add underscore to HAVE_file define. + + * acspecific.m4: + (AC_SYS_INTERPRETER): New shell var 'interpval' stores + internal var ac_cv_sys_interpreter. + +1998-12-27 Ben Elliston + + * autoconf.texi (AC_PROG_INSTALL): Update. + (AC_FUNC_ALLOCA): Correct code fragment. + (AC_FUNC_SELECT_ARGTYPES): Document. + (AC_C_STRINGIZE): Likewise. + (AC_VALIDATE_CACHED_SYSTEM_TUPLE): Likewise. + + * acspecific.m4 (AC_CYGWIN): Rename from `AC_CYGWIN32'. + (AC_CYGWIN32): Warn about deprecated usage. Forward to AC_CYGWIN. + + * config.sub: Drop `32' from `Cygwin32'. + + * config.guess: Likewise. + + * NEWS: Update. + + * configure: Rebuild. + +1998-12-26 Ben Elliston + + * autoreconf.sh (stamp): Add missing quote. + + * mkinstalldirs: Write output which is not diagnostic to standard + output and not standard error. Suggested by Steve Robbins + . + +1998-12-11 Matthew D. Langston + + * acconfig.h, acgeneral.m4, acspecific.m4, autoconf.texi: Change + all of the Fortran 77 code to use the new `F77' prefix instead of + the older `FC' prefix. + +1998-12-11 Ben Elliston + + * acgeneral.m4 (AC_ACVERSION): Bump to 2.13. + + * autoconf.texi (EDITION): Likewise. + (VERSION): Likewise. + +1998-10-30 Jeff Garzik + + * autoconf.texi: Document AC_CACHE_LOAD and AC_CACHE_SAVE. Explain + how AC_CACHE_SAVE can be used as a means of syncing the cache to + disk prior to doing something potentially fatal in configure. + +1998-10-29 Alexandre Oliva + + * autoreconf.sh: Support several automake command line options, + and run aclocal and automake when needed. Also, create stamp files + just like automake's Makefiles would do for config headers. + Additional contributions from Tom Tromey . + +1998-10-24 Matthew D. Langston + + * acgeneral.m4 (AC_LANG_FORTRAN77): Remove [] (i.e. the m4 quotes) + since it was confusing the testsuite. Also make `f77' the default + for FC, otherwise the testsuite fails. + + * autoconf.texi (Fortran 77 Compiler Characteristics): Added new + node documenting the new AC_F77_LIBRARY_LDFLAGS macro. + + * acspecific.m4 (AC_F77_LIBRARY_LDFLAGS): New macro to determine + the linker flags (e.g. `-L' and `-l') for the Fortran 77 intrinsic + and run-time libraries. + +1998-10-24 Ben Elliston + + * acspecific.m4 (AC_FUNC_SELECT_ARGTYPES): New macro. Detects the + types of formal arguments to select(). Contributed by Lars Hecking + . + + * acconfig.h (SELECT_TYPE_ARG1): Add. + (SELECT_TYPE_ARG234): Likewise. + (SELECT_TYPE_ARG5): Likewise. + + * config.guess: Hide warnings emitted by the HP linker when + generating a PA 2.0 object file. Contributed by Marcus Thiessel + . + +1998-10-20 Ben Elliston + + * acgeneral.m4 (AC_LANG_RESTORE): Fix a typo spotted by Noah + Elliott . + +1998-10-09 Tom Tromey + + * Makefile.in (autoconf.m4f): New target. + (autoheader.m4f): Likewise. + +1998-10-08 Ben Elliston + + * acgeneral.m4 (AC_TRY_LINK_FUNC): Fix macro ordering. + +Sun Oct 4 21:57:20 1998 Tom Tromey + + * autoconf.texi (Defining Symbols): Documented third argument to + AC_DEFINE. + * autoheader.m4 (AC_DEFINE_UNQUOTED): Generate `verbatim' + assignment if third argument given. + (AC_DEFINE): Likewise. + * acgeneral.m4 (AC_DEFINE): Handle case where $# is 3. + (AC_DEFINE_UNQUOTED): Likewise. + * autoheader.sh: Echo $verbatim if not empty. + +1998-10-03 Ben Elliston + + * acconfig.h (FC_NO_MINUS_C_MINUS_O): Add to complete the Fortran + 77 support. + + * README: Update bug reporting address. Include maintainer info. + +1998-10-02 Ben Elliston + + * acgeneral.m4 (AC_VALIDATE_CACHED_SYSTEM_TUPLE): New macro. This + macro can be used to ensure that a configure script will not run + on a second system without removing the cache and re-running + configure. Contributed by Alexandre Oliva . + +1998-09-29 Ben Elliston + + * acgeneral.m4 (AC_SEARCH_LIBS): New macro. Searches a series of + libraries for a given function. Contributed by Jim Blandy + . + (AC_TRY_LINK_FUNC): New macro. Again, from Jim. + +1998-09-28 Ben Elliston + + * config.guess: Detect multiprocessor DC/OSx running on Pyramid + MIServer machines. Contributed by Graham K. Jenkins + . + + * acgeneral.m4 (AC_CHECK_PROG): Fix a bug if the supplied path + contains colons. This was observed with some versions of NetBSD + `sh' and some versions of `bash'. + (AC_PATH_PROG): Likewise. Contributed by Tom Yu . + +1998-09-27 Ben Elliston + + * Makefile.in (all): Generate frozen .m4 files at build time. + (install): Do not freeze .m4 files. Install pre-frozen .m4f files + using $(INSTALL_DATA). + (.m4.m4f): Freeze files if m4 supports stored internal state. + Contributed by Karl Heuer . + + * install-sh: Import latest version from the FSF. + + * mkinstalldirs: Likewise. + + * config.guess: Apply the sysconf(2) test to HP 9000/600-series, + 9000/802, 9000/804 and 9000/892 machines. Contributed by Pavel + Roskin . + Detect UnixWare 7. Contributed by Paul Gampe . + + * acspecific.m4 (AC_PROG_INSTALL): Substitute `INSTALL_SCRIPT'. + Contributed by Franc,ois Pinard . + (AC_C_STRINGIZE): New macro to test the availability of the + stringizing operator in the C preprocessor. Contributed by Arnold + Robbins on behalf of the GNU AWK project. + + * acconfig.h (HAVE_STRINGIZE): Add for the AC_C_STRINGIZE macro. + + * testsuite/Makefile.in (check): If DejaGNU is not installed, + print a warning and skip the `dejacheck' target (which will fail). + (site.exp): Use tests to guard commands from generating error + messages if `site.exp' or `site.bak' do not exist. Contributed by + Karl Heuer . + (dejacheck): Remove unused target. + +1998-09-26 Ben Elliston + + * texinfo.tex: Import latest version from the FSF. + + * config.guess: Treat all SPARC variant processors running BSD/OS + as just `sparc' for compatibility reasons. Contributed by Chris + Torek . + + * acgeneral.m4 (AC_CHECK_FILE): New macro. Checks for the + existence of a file in the file system (native only). + Contributed by Ken Raeburn . + (AC_CHECK_FILES): Likewise. + +1998-09-15 Didier Verna + + * acspecific.m4 (AC_PATH_XTRA): use X_EXTRA_LIBS add-on libraries + in the test for libICE. It is needed at least under Solaris. + +1998-09-15 Ben Elliston + + * config.guess: Handle strange processor ID assignments on AIX + machines. Contributed by Didier Desseaux . + +Sat Sep 12 16:25:00 1998 Aaron Crane + + * acgeneral.m4 (AC_CHECK_TYPE): Changed the egrep regex to avoid + incorrectly assuming that if foobar_t is defined, then so is + bar_t. + +Tue Sep 8 14:06:04 1998 Matthew D. Langston + + * acgeneral.m4: Make the following macros Fortran 77 aware + (i.e. conditionalize whether to `#include "confdefs.h"', etc.): + (AC_TRY_COMPILE) + (AC_TRY_LINK) + (AC_CHECK_LIB) + + * acgeneral.m4 (AC_LANG_FORTRAN77): Rename `AC_LANG_FORTRAN' to + `AC_LANG_FORTRAN77'. Change the Fortran 77 language macro from + `FORTRAN' to `FORTRAN77'. + (AC_LANG_RESTORE): Change the Fortran 77 language macro from + `FORTRAN' to `FORTRAN77' + + * autoconf.texi: Updated Fortran 77 documentation, particularly + for `AC_TRY_COMPILE', `AC_TRY_LINK' and `AC_CHECK_LIB'. + +Thu Sep 3 09:34:39 1998 Matthew D. Langston + + * autoconf.texi: Added Fortran 77 documentation. + + * acspecific.m4 (AC_PROG_FC): New macro. Determine a Fortran + compiler to use. + (AC_PROG_FC_WORKS): New macro. + (AC_PROG_FC_GNU): New macro. + (AC_PROG_FC_G): New macro. + (AC_PROG_FC_C_O): New macro. + + * acgeneral.m4: Add FFLAGS (Fortran 77 flags). + (AC_LANG_FORTRAN): New macro. + (AC_LANG_RESTORE): Make Fortran 77 aware. + (AC_TRY_COMPILER): Make Fortran 77 aware (i.e. conditionalize + whether to `#include "confdefs.h"'). + +Thu Jun 18 12:13:27 1998 Ian Lance Taylor + + * acspecific.m4 (AC_EXEEXT): Correct setting of ac_exeext when + there is no extension. + +Mon Jun 1 12:30:39 1998 Ian Lance Taylor + + * acgeneral.m4 (AC_CHECK_PROG): Set IFS to just ":" when searching + through PATH. + (AC_PATH_PROG): Likewise. + * acspecific.m4 (AC_PROG_INSTALL): Likewise. + (AC_PROG_CC): On cygwin32, if neither gcc nor cc + are found, look for cl. + (AC_PROG_CXX): Look for cl after all other choices. + * configure: Rebuild. + +Thu May 28 18:37:36 1998 Ian Lance Taylor + + * acgeneral.m4 (AC_ACVERSION): Bump to 2.12.2. + + Add support for Visual C++: + * acgeneral.m4 (ac_exeext, ac_objext): New variables. + (ac_link): Use ac_exeext. + (AC_TRY_COMPILER, AC_TRY_LINK, AC_TRY_RUN_NATIVE): Likewise. + (AC_TRY_CPP): Remove lines from stderr which contain only the name + of the file. + (AC_REPLACE_FUNCS): Use ac_objext. + * acspecific.m4 (AC_PROG_CC): Check whether compiler supports -g + even if it is not gcc. + (AC_PROG_CXX): Likewise. + (AC_PROG_CPP): Try running the compiler with the -nologo option. + (AC_FUNC_ALLOCA): Check for _MSC_VER. Use ac_objext. + (AC_FUNC_MEMCMP): Use ac_objext. + (AC_STRUCT_ST_BLOCKS): Likewise. + (AC_OBJEXT): New macro. + (AC_CYGWIN32, AC_MINGW32, AC_EXEEXT): New macros. + * configure: Rebuild. + + * Makefile.in (editsh): Substitute for SHELL. + (Makefile, config.status): Use $(SHELL) when running + config.status. + * autoconf.sh: Change initial /bin/sh to @SHELL@. + * autoheader.sh: Likewise. + * autoreconf.sh: Likewise. + * autoupdate.sh: Likewise. + * ifnames.sh: Likewise. + +Thu Apr 30 16:29:00 1998 Syd Polk + + * acspecific.m4 (SETPGRP_VOID): The test for setpgrp needs + to have unistd.h included or the DEC compiler does not + flag the error that triggers setting the variable. + +Tue Nov 18 14:21:38 1997 Eric Mumpower + + * autoreconf.sh: Do the right thing when AC_CONFIG_HEADER is + given more than one filename. As noted in the "Invoking + autoheader" node of the info files, autoheader will use the first + file argument given to AC_CONFIG_HEADER. Prior to this patch, + autoreconf would end up executing incorrect shell code (e.g. + "test ! -f 1.h 2.h.in") in such cases. + Patch submitted in parallel to bug-gnu-utils@prep.ai.mit.edu. + +Fri Oct 3 18:10:39 1997 Ian Lance Taylor + + * acgeneral.m4 (AC_CACHE_SAVE): Add a grep when checking whether + set quotes correctly, to avoid a cache overflow on HP-UX 9. + * configure: Rebuild. + +Wed Sep 11 15:35:19 1997 Chris Provenzano + + * acgeneral.m4 : Always set SHELL and substitute SHELL. + When looking for a path for an executable allow the + user to override with an DOS path. + * configure : New configure generated by autoconf. + +Thu Sep 4 22:30:40 1997 Jeffrey A Law (law@cygnus.com) + + * acspecific (AC_PROC_INSTALL): Don't use installbsd on OSF.. + +Wed Sep 3 23:00:44 1997 Chris Provenzano + + * configure : New configure generated by autoconf. + * Makefile.in : Set SHELL=@SHELL@. configure now substiutes + ${CONFIG_SHELL-/bin/sh} in for @SHELL@ at configure time. + +Mon Aug 11 01:40:37 1997 Jason Molenda + + * acspecific (AC_FUNC_VFORK): If cross-compiling, set + $ac_cv_func_vfork_works to $ac_cv_func_vfork (assume vfork works + if present). + +Tue Aug 5 23:00:05 1997 Ian Lance Taylor + + * acgeneral.m4 (AC_VERSION): Set to 2.12.1. + (AC_CANONICAL_HOST): Use CONFIG_SHELL to run $ac_config_sub and + $ac_config_guess. + (AC_CANONICAL_TARGET, AC_CANONICAL_BUILD): Likewise. + +Tue Dec 10 19:38:59 1996 David J MacKenzie - * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Fix bug in previous - patch; add double quotes to protect things. + * acgeneral.m4 (AC_CACHE_SAVE): Use grep to prevent overflowing + HP-UX 9.05 /bin/sh buffer in case statement. From Eric Backus + . -Wed Jun 18 16:13:11 1997 Tom Yu +Mon Dec 9 23:39:17 1996 David J MacKenzie - * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Assign the path to - ac_dummy and then expand it, rather than simply tacking on - $ac_dummy to the path. This works around POSIX.2 word splitting - semantics, in which even things like a:b:c:$PATH don't get - word-split as you might expect on a pre-POSIX shell. + * acspecific.m4 (AC_FUNC_GETLOADAVG): Add a semicolon between + shell variable assignments; the evaluation order varies between + implementations. Tue Nov 26 13:00:28 1996 David J MacKenzie diff --git a/src/util/autoconf/Makefile.in b/src/util/autoconf/Makefile.in index 14004d1e2..a6c94d45c 100644 --- a/src/util/autoconf/Makefile.in +++ b/src/util/autoconf/Makefile.in @@ -1,5 +1,5 @@ # Makefile for Autoconf. -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1998 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 @@ -32,6 +32,10 @@ PERL = @PERL@ # Programs that are ALWAYS installed (and are created in the build dir). ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames + +# M4 input that is frozen. +M4FROZEN = autoconf.m4f autoheader.m4f + # All programs, including those only installed if you have perl. SCRIPTS = $(ASCRIPTS) @SCRIPTS@ @@ -52,7 +56,7 @@ infodir = @infodir@ #### End of system configuration section. #### -SHELL = /bin/sh +SHELL = @SHELL@ SUBDIRS = testsuite @@ -74,13 +78,14 @@ DISTFILES = AUTHORS COPYING ChangeLog ChangeLog.1 INSTALL \ standards.texi make-stds.texi standards.info* editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e \ - 's,@''M4''@,$(M4),g' -e 's,@''AWK''@,$(AWK),g' + 's,@''M4''@,$(M4),g' -e 's,@''AWK''@,$(AWK),g' \ + -e 's,@''SHELL''@,$(SHELL),g' editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g' -all: ${SCRIPTS} info +all: ${SCRIPTS} ${M4FROZEN} info .SUFFIXES: -.SUFFIXES: .sh .pl +.SUFFIXES: .sh .pl .m4 .m4f .sh: rm -f $@ $@.tmp @@ -90,6 +95,17 @@ all: ${SCRIPTS} info rm -f $@ $@.tmp $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@ +.m4.m4f: + @case `$(M4) --help &1` in \ + *reload-state*) echo freezing $*.m4; \ + $(M4) -F $*.m4f -I${srcdir} ${srcdir}/$*.m4 ;; \ + *traditional*) ;; \ + *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ + esac + +autoconf.m4f: autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 +autoheader.m4f: autoheader.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 + info: autoconf.info @standards_info@ INSTALL # Use --no-split to avoid creating filenames > 14 chars. @@ -124,18 +140,14 @@ installdirs: $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir) install: all $(M4FILES) acconfig.h installdirs install-info - @case `$(M4) --help < /dev/null 2>&1` in \ - *reload-state*) echo installing frozen m4 files; \ - $(M4) -F $(acdatadir)/autoconf.m4f -I${srcdir} ${srcdir}/autoconf.m4 ; \ - $(M4) -F $(acdatadir)/autoheader.m4f -I${srcdir} ${srcdir}/autoheader.m4 ;; \ - *traditional*) ;; \ - *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ - esac for p in $(ASCRIPTS); do \ $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ done + for i in $(M4FROZEN); do \ + $(INSTALL_DATA) $$i $(acdatadir)/$$i; \ + done for i in $(M4FILES) acconfig.h; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \ + $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \ done -if test -f autoscan; then \ $(INSTALL_PROGRAM) autoscan $(bindir)/`echo autoscan|sed '$(transform)'`; \ @@ -172,9 +184,9 @@ ${srcdir}/configure: configure.in $(M4FILES) $(M4) autoconf.m4 configure.in > configure.tmp && \ chmod +x configure.tmp && mv configure.tmp configure Makefile: Makefile.in config.status - ./config.status + $(SHELL) ./config.status config.status: configure - ./config.status --recheck + $(SHELL) ./config.status --recheck maintainer-clean:: @echo "This command is intended for maintainers to use;" diff --git a/src/util/autoconf/NEWS b/src/util/autoconf/NEWS index dc8e6e1e7..be2243317 100644 --- a/src/util/autoconf/NEWS +++ b/src/util/autoconf/NEWS @@ -1,3 +1,34 @@ +Major changes in release 2.13: + +* Support for building on Win32 systems where the only available C or + C++ compiler is the Microsoft Visual C++ command line compiler + (`cl'). Additional support for building on Win32 systems which are + using the Cygwin or Mingw32 environments. +* Support for alternative object file and executable file extensions. + On Win32, for example, these are .obj and .exe. These are discovered + using AC_OBJEXT and AC_EXEEXT, which substitute @OBJEXT@ and + @EXEEXT@ in the output, respectively. +* New macros: AC_CACHE_LOAD, AC_CACHE_SAVE, AC_FUNC_SELECT_ARGTYPES, + AC_VALIDATE_CACHED_SYSTEM_TUPLE, AC_SEARCH_LIBS, AC_TRY_LINK_FUNC, + AC_C_STRINGIZE, AC_CHECK_FILE(S), AC_PROG_F77 (and friends). +* AC_DEFINE now has an optional third argument for a description to be + placed in the config header input file (e.g. config.h.in). +* The C++ code fragment compiled for the C++ compiler test had to be + improved to include an explicit return type for main(). This was + causing failures on systems using recent versions of the EGCS C++ + compiler. +* Fixed an important bug in AC_CHECK_TYPE that would cause a configure + script to report that `sometype_t' was present when only `type_t' + was defined. +* Merge of the FSF version of config.guess and config.sub to modernise + these scripts. Add support for a few new hosts in config.guess. + Incorporate latest versions of install-sh, mkinstalldirs and + texinfo.tex from the FSF. +* autoreconf is capable of running automake if necessary (and + applicable). +* Support for Fortran 77. See the Texinfo documentation for details. +* Bug fixes and workarounds for quirky bugs in vendor utilities. + Major changes in release 2.12: * AC_OUTPUT and AC_CONFIG_HEADER can create output files by diff --git a/src/util/autoconf/README b/src/util/autoconf/README index 959b195e0..674adcb21 100644 --- a/src/util/autoconf/README +++ b/src/util/autoconf/README @@ -33,6 +33,7 @@ packages' configuration headers or Makefile.in files. You can use the program `autoheader' to automatically create a configuration header from a `configure.in', based on the information in `acconfig.h'. -Mail suggestions and bug reports for Autoconf to -bug-gnu-utils@prep.ai.mit.edu. Please include the Autoconf version -number, which you can get by running "autoconf --version". +Mail suggestions and bug reports for Autoconf to autoconf@gnu.org. +Please include the Autoconf version number, which you can get by running +"autoconf --version". The current autoconf maintainer is Ben Elliston +. diff --git a/src/util/autoconf/acconfig.h b/src/util/autoconf/acconfig.h index 5bf096c52..ea6988fd3 100644 --- a/src/util/autoconf/acconfig.h +++ b/src/util/autoconf/acconfig.h @@ -104,6 +104,9 @@ /* Define if you have the strftime function. */ #undef HAVE_STRFTIME +/* Define if you have the ANSI # stringizing operator in cpp. */ +#undef HAVE_STRINGIZE + /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H @@ -166,6 +169,9 @@ /* Define if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O +/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */ +#undef F77_NO_MINUS_C_MINUS_O + /* Define to `long' if doesn't define. */ #undef off_t @@ -182,6 +188,15 @@ /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE +/* Define to the type of arg1 for select(). */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for select(). */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg5 for select(). */ +#undef SELECT_TYPE_ARG5 + /* Define if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID diff --git a/src/util/autoconf/acgeneral.m4 b/src/util/autoconf/acgeneral.m4 index 5a1dfdacd..ae971de13 100644 --- a/src/util/autoconf/acgeneral.m4 +++ b/src/util/autoconf/acgeneral.m4 @@ -1,7 +1,7 @@ dnl Parameterized macros. dnl Requires GNU m4. dnl This file is part of Autoconf. -dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ dnl divert(-1)dnl Throw away output until AC_INIT is called. changequote([, ]) -define(AC_ACVERSION, 2.12) +define(AC_ACVERSION, 2.13) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -208,6 +208,7 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -687,11 +688,19 @@ dnl Let the site file select an alternate cache file if it wants to. AC_SITE_LOAD AC_CACHE_LOAD AC_LANG_C +dnl By default always use an empty string as the executable +dnl extension. Only change it if the script calls AC_EXEEXT. +ac_exeext= +dnl By default assume that objects files use an extension of .o. Only +dnl change it if the script calls AC_OBJEXT. +ac_objext=o AC_PROG_ECHO_N dnl Substitute for predefined variables. +AC_SUBST(SHELL)dnl AC_SUBST(CFLAGS)dnl AC_SUBST(CPPFLAGS)dnl AC_SUBST(CXXFLAGS)dnl +AC_SUBST(FFLAGS)dnl AC_SUBST(DEFS)dnl AC_SUBST(LDFLAGS)dnl AC_SUBST(LIBS)dnl @@ -909,7 +918,7 @@ AC_DEFUN(AC_CANONICAL_HOST, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else AC_MSG_ERROR(can not run $ac_config_sub) fi @@ -921,7 +930,7 @@ case "$host_alias" in NONE) case $nonopt in NONE) - if host_alias=`$ac_config_guess`; then : + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else AC_MSG_ERROR(can not guess host type; you must specify one) fi ;; *) host_alias=$nonopt ;; @@ -930,7 +939,7 @@ esac dnl Set the other host vars. changequote(<<, >>)dnl -host=`$ac_config_sub $host_alias` +host=`${CONFIG_SHELL-/bin/sh} $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/'` @@ -960,7 +969,7 @@ esac dnl Set the other target vars. changequote(<<, >>)dnl -target=`$ac_config_sub $target_alias` +target=`${CONFIG_SHELL-/bin/sh} $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/'` @@ -990,7 +999,7 @@ esac dnl Set the other build vars. changequote(<<, >>)dnl -build=`$ac_config_sub $build_alias` +build=`${CONFIG_SHELL-/bin/sh} $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/'` @@ -1004,6 +1013,31 @@ AC_SUBST(build_os)dnl ]) +dnl AC_VALIDATE_CACHED_SYSTEM_TUPLE[(cmd)] +dnl if the cache file is inconsistent with the current host, +dnl target and build system types, execute CMD or print a default +dnl error message. +AC_DEFUN(AC_VALIDATE_CACHED_SYSTEM_TUPLE, [ + AC_REQUIRE([AC_CANONICAL_SYSTEM]) + AC_MSG_CHECKING([cached system tuple]) + if { test x"${ac_cv_host_system_type+set}" = x"set" && + test x"$ac_cv_host_system_type" != x"$host"; } || + { test x"${ac_cv_build_system_type+set}" = x"set" && + test x"$ac_cv_build_system_type" != x"$build"; } || + { test x"${ac_cv_target_system_type+set}" = x"set" && + test x"$ac_cv_target_system_type" != x"$target"; }; then + AC_MSG_RESULT([different]) + ifelse($#, 1, [$1], + [AC_MSG_ERROR([remove config.cache and re-run configure])]) + else + AC_MSG_RESULT(ok) + fi + ac_cv_host_system_type="$host" + ac_cv_build_system_type="$build" + ac_cv_target_system_type="$target" +]) + + dnl ### Caching test results @@ -1063,7 +1097,7 @@ dnl Allow a site initialization script to override cache values. # and sets the high bit in the cache file unless we assign to the vars. changequote(, )dnl (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -1118,14 +1152,14 @@ dnl Set VARIABLE to VALUE, verbatim, or 1. dnl AC_DEFINE(VARIABLE [, VALUE]) define(AC_DEFINE, [cat >> confdefs.h <<\EOF -[#define] $1 ifelse($#, 2, [$2], 1) +[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) EOF ]) dnl Similar, but perform shell substitutions $ ` \ once on VALUE. define(AC_DEFINE_UNQUOTED, [cat >> confdefs.h < conftest.$ac_ext < conftest.$ac_ext << EOF +ifelse(AC_LANG, [FORTRAN77], , +[ [#]line __oline__ "configure" #include "confdefs.h" +]) [$1] EOF -if AC_TRY_EVAL(ac_link) && test -s conftest; then +if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then [$2]=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1472,6 +1527,54 @@ rm -fr conftest*]) dnl ### Checking for libraries +dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) +dnl Try to link a program that calls FUNC, handling GCC builtins. If +dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute +dnl ACTION-IF-NOT-FOUND. + +AC_DEFUN(AC_TRY_LINK_FUNC, +AC_TRY_LINK(dnl +ifelse([$1], [main], , dnl Avoid conflicting decl of main. +[/* Override any gcc2 internal prototype to avoid an error. */ +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" +#endif +])dnl +[/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $1(); +]), +[$1()], +[$2], +[$3])) + + +dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND +dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) +dnl Search for a library defining FUNC, if it's not already available. + +AC_DEFUN(AC_SEARCH_LIBS, +[AC_PREREQ([2.13]) +AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1], +[ac_func_search_save_LIBS="$LIBS" +ac_cv_search_$1="no" +AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"]) +test "$ac_cv_search_$1" = "no" && for i in $2; do +LIBS="-l$i $5 $ac_func_search_save_LIBS" +AC_TRY_LINK_FUNC([$1], +[ac_cv_search_$1="-l$i" +break]) +done +LIBS="$ac_func_search_save_LIBS"]) +if test "$ac_cv_search_$1" != "no"; then + test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS" + $3 +else : + $4 +fi]) + + + dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN(AC_CHECK_LIB, @@ -1485,6 +1588,7 @@ AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" AC_TRY_LINK(dnl +ifelse(AC_LANG, [FORTRAN77], , ifelse([$2], [main], , dnl Avoid conflicting decl of main. [/* Override any gcc2 internal prototype to avoid an error. */ ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus @@ -1494,7 +1598,7 @@ extern "C" [/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $2(); -]), +])), [$2()], eval "ac_cv_lib_$ac_lib_var=yes", eval "ac_cv_lib_$ac_lib_var=no") @@ -1565,7 +1669,7 @@ dnl that breaks under sh -x, which writes compile commands starting dnl with ` +' to stderr in eval and subshells. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" AC_TRY_EVAL(ac_try) -ac_err=`grep -v '^ *+' conftest.out` +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then ifelse([$2], , :, [rm -rf conftest* $2]) @@ -1620,7 +1724,11 @@ dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) AC_DEFUN(AC_TRY_COMPILE, [cat > conftest.$ac_ext < conftest.$ac_ext </dev/null +if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then dnl Don't remove the temporary files here, so they can be examined. ifelse([$2], , :, [$2]) @@ -1757,6 +1871,48 @@ done ]) +dnl ### Checking for the existence of files + +dnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_FILE, +[AC_REQUIRE([AC_PROG_CC]) +dnl Do the transliteration at runtime so arg 1 can be a shell variable. +ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_file_$ac_safe, +[if test "$cross_compiling" = yes; then + errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling +)dnl + AC_MSG_ERROR(Cannot check for file existence when cross compiling) +else + if test -r $1; then + eval "ac_cv_file_$ac_safe=yes" + else + eval "ac_cv_file_$ac_safe=no" + fi +fi])dnl +if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) +ifelse([$3], , , [$3]) +fi +]) + +dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_FILES, +[for ac_file in $1 +do +AC_CHECK_FILE($ac_file, +[changequote(, )dnl + ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl +done +]) + + dnl ### Checking for library functions @@ -1813,7 +1969,7 @@ done dnl AC_REPLACE_FUNCS(FUNCTION...) AC_DEFUN(AC_REPLACE_FUNCS, -[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) +[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"]) AC_SUBST(LIBOBJS)dnl ]) @@ -1856,7 +2012,7 @@ AC_MSG_CHECKING(for $1) AC_CACHE_VAL(ac_cv_type_$1, [AC_EGREP_CPP(dnl changequote(<<,>>)dnl -<<$1[^a-zA-Z_0-9]>>dnl +<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl changequote([,]), [#include #if STDC_HEADERS #include diff --git a/src/util/autoconf/acspecific.m4 b/src/util/autoconf/acspecific.m4 index 622d10786..5c6f1c9e5 100644 --- a/src/util/autoconf/acspecific.m4 +++ b/src/util/autoconf/acspecific.m4 @@ -1,6 +1,6 @@ dnl Macros that test for specific features. dnl This file is part of Autoconf. -dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -75,6 +75,12 @@ AC_DEFUN(AC_PROG_CC, AC_CHECK_PROG(CC, gcc, gcc) if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + AC_CHECK_PROG(CC, cl, cl) ;; + esac + fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) fi @@ -83,52 +89,112 @@ AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes +else + GCC= +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 +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 + if test "$GCC" = yes; then CFLAGS="-g -O2" else - CFLAGS="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi ]) AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl -AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc) AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then GXX=yes +else + GXX= +fi + 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 +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 + if test "$GXX" = yes; then CXXFLAGS="-g -O2" else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +]) + +dnl Determine a Fortran 77 compiler to use. If `F77' is not already set +dnl in the environment, check for `g77', `f77' and `f2c', in that order. +dnl Set the output variable `F77' to the name of the compiler found. +dnl +dnl If using `g77' (the GNU Fortran 77 compiler), then `AC_PROG_F77' +dnl will set the shell variable `G77' to `yes', and empty otherwise. If +dnl the output variable `FFLAGS' was not already set in the environment, +dnl then set it to `-g -02' for `g77' (or `-O2' where `g77' does not +dnl accept `-g'). Otherwise, set `FFLAGS' to `-g' for all other Fortran +dnl 77 compilers. +dnl +dnl AC_PROG_F77() +AC_DEFUN(AC_PROG_F77, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +if test -z "$F77"; then + AC_CHECK_PROGS(F77, g77 f77 f2c) + test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran 77 compiler found in \$PATH]) +fi + +AC_PROG_F77_WORKS +AC_PROG_F77_GNU + +if test $ac_cv_prog_g77 = yes; then + G77=yes +dnl Check whether -g works, even if FFLAGS is set, in case the package +dnl plays around with FFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_FFLAGS="${FFLAGS+set}" + ac_save_FFLAGS="$FFLAGS" + FFLAGS= + AC_PROG_F77_G + if test "$ac_test_FFLAGS" = set; then + FFLAGS="$ac_save_FFLAGS" + elif test $ac_cv_prog_f77_g = yes; then + FFLAGS="-g -O2" + else + FFLAGS="-O2" fi else - GXX= - test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" + G77= + test "${FFLAGS+set}" = set || FFLAGS="-g" fi ]) @@ -151,7 +217,7 @@ 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_TRY_COMPILER([int 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 @@ -162,6 +228,30 @@ AC_MSG_RESULT($ac_cv_prog_cxx_cross) cross_compiling=$ac_cv_prog_cxx_cross ]) +dnl Test whether the Fortran 77 compiler can compile and link a trivial +dnl Fortran program. Also, test whether the Fortran 77 compiler is a +dnl cross-compiler (which may realistically be the case if the Fortran +dnl compiler is `g77'). +dnl +dnl AC_PROG_F77_WORKS() +AC_DEFUN(AC_PROG_F77_WORKS, +[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works]) +AC_LANG_SAVE +AC_LANG_FORTRAN77 +AC_TRY_COMPILER(dnl +[ program conftest + end +], ac_cv_prog_f77_works, ac_cv_prog_f77_cross) +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_f77_works) +if test $ac_cv_prog_f77_works = no; then + AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.]) +fi +AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_f77_cross) +cross_compiling=$ac_cv_prog_f77_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. @@ -190,6 +280,24 @@ else ac_cv_prog_gxx=no fi])]) +dnl Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77 +dnl Compiler). This test depends on whether the Fortran 77 compiler can +dnl do CPP pre-processing. +dnl +dnl AC_PROG_F77_GNU() +AC_DEFUN(AC_PROG_F77_GNU, +[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, +[cat > conftest.fpp </dev/null 2>&1; then + ac_cv_prog_g77=yes +else + ac_cv_prog_g77=no +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 @@ -212,6 +320,24 @@ fi rm -f conftest* ])]) +dnl Test whether the Fortran 77 compiler can accept the `-g' option to +dnl enable debugging. +dnl +dnl AC_PROG_F77_G() +AC_DEFUN(AC_PROG_F77_G, +[AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g, +[cat > conftest.f << EOF + program conftest + end +EOF +if test -z "`$F77 -g -c conftest.f 2>&1`"; then + ac_cv_prog_f77_g=yes +else + ac_cv_prog_f77_g=no +fi +rm -f conftest* +])]) + AC_DEFUN(AC_PROG_GCC_TRADITIONAL, [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl @@ -282,6 +408,45 @@ else fi ]) +dnl Test if the Fortran 77 compiler accepts the options `-c' and `-o' +dnl simultaneously, and define `F77_NO_MINUS_C_MINUS_O' if it does not. +dnl +dnl The usefulness of this macro is questionable, as I can't really see +dnl why anyone would use it. The only reason I include it is for +dnl completeness, since a similar test exists for the C compiler. +dnl +dnl AC_PROG_F77_C_O +AC_DEFUN(AC_PROG_F77_C_O, +[AC_BEFORE([$0], [AC_PROG_F77])dnl +AC_MSG_CHECKING(whether $F77 understand -c and -o together) +set dummy $F77; ac_f77="`echo [$]2 | +changequote(, )dnl +sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" +changequote([, ])dnl +AC_CACHE_VAL(ac_cv_prog_f77_${ac_f77}_c_o, +[cat > conftest.f << EOF + program conftest + end +EOF +# We do the `AC_TRY_EVAL' test twice because some compilers refuse to +# overwrite an existing `.o' file with `-o', although they will create +# one. +ac_try='$F77 $FFLAGS -c conftest.f -o conftest.o 1>&AC_FD_CC' +if AC_TRY_EVAL(ac_try) && test -f conftest.o && AC_TRY_EVAL(ac_try); then + eval ac_cv_prog_f77_${ac_f77}_c_o=yes +else + eval ac_cv_prog_f77_${ac_f77}_c_o=no +fi +rm -f conftest* +])dnl +if eval "test \"`echo '$ac_cv_prog_f77_'${ac_f77}_c_o`\" = yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_DEFINE(F77_NO_MINUS_C_MINUS_O) +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}) @@ -340,7 +505,10 @@ dnl with a fresh cross-compiler works. Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" AC_TRY_CPP([#include -Syntax Error], , CPP=/lib/cpp)) +Syntax Error], , + CPP="${CC-cc} -nologo -E" + AC_TRY_CPP([#include +Syntax Error], , CPP=/lib/cpp))) ac_cv_prog_CPP="$CPP"])dnl CPP="$ac_cv_prog_CPP" else @@ -430,25 +598,27 @@ AC_DEFUN(AC_PROG_INSTALL, # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. AC_MSG_CHECKING(for a BSD compatible install) if test -z "$INSTALL"; then AC_CACHE_VAL(ac_cv_path_install, -[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" +[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -480,6 +650,9 @@ AC_MSG_RESULT($INSTALL) test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' AC_SUBST(INSTALL_PROGRAM)dnl +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +AC_SUBST(INSTALL_SCRIPT)dnl + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA)dnl ]) @@ -1047,6 +1220,10 @@ fi AC_DEFUN(AC_FUNC_SETPGRP, [AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void, AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +#include +#endif + /* * If this system has a BSD-style setpgrp, which takes arguments, exit * successfully. @@ -1169,7 +1346,8 @@ main() { ); } }], -ac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork))]) +ac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork) +ac_cv_func_vfork_works=$ac_cv_func_vfork)]) if test $ac_cv_func_vfork_works = no; then AC_DEFINE(vfork, fork) fi @@ -1227,14 +1405,19 @@ AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, #ifdef __GNUC__ # define alloca __builtin_alloca #else -# if HAVE_ALLOCA_H -# include +# ifdef _MSC_VER +# include +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if HAVE_ALLOCA_H +# include # else -# ifndef alloca /* predefined by HP cc +Olibcalls */ +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); +# endif # endif # endif # endif @@ -1250,7 +1433,7 @@ if test $ac_cv_func_alloca_works = no; then # 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. - ALLOCA=alloca.o + ALLOCA=alloca.${ac_objext} AC_DEFINE(C_ALLOCA) AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray, @@ -1306,7 +1489,7 @@ 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_getloadavg_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_getloadavg_LIBS") fi @@ -1471,10 +1654,50 @@ main() } ], 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" +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" AC_SUBST(LIBOBJS)dnl ]) +AC_DEFUN(AC_FUNC_SELECT_ARGTYPES, +[AC_MSG_CHECKING([types of arguments for select()]) + AC_CACHE_VAL(ac_cv_func_select_arg234,dnl + [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl + [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl + [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do + for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do + AC_TRY_COMPILE(dnl +[#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl + [ac_not_found=no ; break 3],ac_not_found=yes) + done + done + done + ])dnl AC_CACHE_VAL + ])dnl AC_CACHE_VAL + ])dnl AC_CACHE_VAL + if test "$ac_not_found" = yes; then + ac_cv_func_select_arg1=int + ac_cv_func_select_arg234='int *' + ac_cv_func_select_arg5='struct timeval *' + fi + AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5]) + AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1) + AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234)) + AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5)) +]) + dnl ### Checks for structure members @@ -1535,7 +1758,7 @@ ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)]) if test $ac_cv_struct_st_blocks = yes; then AC_DEFINE(HAVE_ST_BLOCKS) else - LIBOBJS="$LIBOBJS fileblocks.o" + LIBOBJS="$LIBOBJS fileblocks.${ac_objext}" fi AC_SUBST(LIBOBJS)dnl ]) @@ -1728,10 +1951,261 @@ if test $ac_cv_c_const = no; then fi ]) +AC_DEFUN(AC_C_STRINGIZE, [ +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for preprocessor stringizing operator]) +AC_CACHE_VAL(ac_cv_c_stringize, +AC_EGREP_CPP([#teststring],[ +#define x(y) #y + +char *s = x(teststring); +], ac_cv_c_stringize=no, ac_cv_c_stringize=yes)) +if test "${ac_cv_c_stringize}" = yes +then + AC_DEFINE(HAVE_STRINGIZE) +fi +AC_MSG_RESULT([${ac_cv_c_stringize}]) +])dnl + define(AC_ARG_ARRAY, [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments )m4exit(4)]) +dnl Check the object extension used by the compiler: typically .o or +dnl .obj. If this is called, some other behaviour will change, +dnl determined by ac_objext. +AC_DEFUN(AC_OBJEXT, +[AC_MSG_CHECKING([for object suffix]) +AC_CACHE_VAL(ac_cv_objext, +[rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if AC_TRY_EVAL(ac_compile); then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + AC_MSG_ERROR([installation or configuration problem; compiler does not work]) +fi +rm -f conftest*]) +AC_MSG_RESULT($ac_cv_objext) +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext +AC_SUBST(OBJEXT)]) + +dnl Determine the linker flags (e.g. `-L' and `-l') for the Fortran 77 +dnl intrinsic and run-time libraries that are required to successfully +dnl link a Fortran 77 program or shared library. The output variable +dnl FLIBS is set to these flags. +dnl +dnl This macro is intended to be used in those situations when it is +dnl necessary to mix, e.g. C++ and Fortran 77, source code into a single +dnl program or shared library. +dnl +dnl For example, if object files from a C++ and Fortran 77 compiler must +dnl be linked together, then the C++ compiler/linker must be used for +dnl linking (since special C++-ish things need to happen at link time +dnl like calling global constructors, instantiating templates, enabling +dnl exception support, etc.). +dnl +dnl However, the Fortran 77 intrinsic and run-time libraries must be +dnl linked in as well, but the C++ compiler/linker doesn't know how to +dnl add these Fortran 77 libraries. Hence, the macro +dnl `AC_F77_LIBRARY_LDFLAGS' was created to determine these Fortran 77 +dnl libraries. +dnl +dnl This macro was packaged in its current form by Matthew D. Langston +dnl . However, nearly all of this macro +dnl came from the `OCTAVE_FLIBS' macro in `octave-2.0.13/aclocal.m4', +dnl and full credit should go to John W. Eaton for writing this +dnl extremely useful macro. Thank you John. +dnl +dnl AC_F77_LIBRARY_LDFLAGS() +AC_DEFUN(AC_F77_LIBRARY_LDFLAGS, +[AC_MSG_CHECKING([for Fortran 77 libraries]) +AC_REQUIRE([AC_PROG_F77]) +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_VAL(ac_cv_flibs, +[changequote(, )dnl +dnl Write a minimal program and compile it with -v. I don't know what +dnl to do if your compiler doesn't have -v... +echo " END" > conftest.f +foutput=`${F77} -v -o conftest conftest.f 2>&1` +dnl +dnl The easiest thing to do for xlf output is to replace all the commas +dnl with spaces. Try to only do that if the output is really from xlf, +dnl since doing that causes problems on other systems. +dnl +xlf_p=`echo $foutput | grep xlfentry` +if test -n "$xlf_p"; then + foutput=`echo $foutput | sed 's/,/ /g'` +fi +dnl +ld_run_path=`echo $foutput | \ + sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` +dnl +dnl We are only supposed to find this on Solaris systems... +dnl Uh, the run path should be absolute, shouldn't it? +dnl +case "$ld_run_path" in + /*) + if test "$ac_cv_prog_gcc" = yes; then + ld_run_path="-Xlinker -R -Xlinker $ld_run_path" + else + ld_run_path="-R $ld_run_path" + fi + ;; + *) + ld_run_path= + ;; +esac +dnl +flibs= +lflags= +dnl +dnl If want_arg is set, we know we want the arg to be added to the list, +dnl so we don't have to examine it. +dnl +want_arg= +dnl +for arg in $foutput; do + old_want_arg=$want_arg + want_arg= +dnl +dnl None of the options that take arguments expect the argument to +dnl start with a -, so pretend we didn't see anything special. +dnl + if test -n "$old_want_arg"; then + case "$arg" in + -*) + old_want_arg= + ;; + esac + fi + case "$old_want_arg" in + '') + case $arg in + /*.a) + exists=false + for f in $lflags; do + if test x$arg = x$f; then + exists=true + fi + done + if $exists; then + arg= + else + lflags="$lflags $arg" + fi + ;; + -bI:*) + exists=false + for f in $lflags; do + if test x$arg = x$f; then + exists=true + fi + done + if $exists; then + arg= + else + if test "$ac_cv_prog_gcc" = yes; then + lflags="$lflags -Xlinker $arg" + else + lflags="$lflags $arg" + fi + fi + ;; + -lang* | -lcrt0.o | -lc | -lgcc) + arg= + ;; + -[lLR]) + want_arg=$arg + arg= + ;; + -[lLR]*) + exists=false + for f in $lflags; do + if test x$arg = x$f; then + exists=true + fi + done + if $exists; then + arg= + else + case "$arg" in + -lkernel32) + case "$canonical_host_type" in + *-*-cygwin*) + arg= + ;; + *) + lflags="$lflags $arg" + ;; + esac + ;; + -lm) + ;; + *) + lflags="$lflags $arg" + ;; + esac + fi + ;; + -u) + want_arg=$arg + arg= + ;; + -Y) + want_arg=$arg + arg= + ;; + *) + arg= + ;; + esac + ;; + -[lLR]) + arg="$old_want_arg $arg" + ;; + -u) + arg="-u $arg" + ;; + -Y) +dnl +dnl Should probably try to ensure unique directory options here too. +dnl This probably only applies to Solaris systems, and then will only +dnl work with gcc... +dnl + arg=`echo $arg | sed -e 's%^P,%%'` + SAVE_IFS=$IFS + IFS=: + list= + for elt in $arg; do + list="$list -L$elt" + done + IFS=$SAVE_IFS + arg="$list" + ;; + esac +dnl + if test -n "$arg"; then + flibs="$flibs $arg" + fi +done +if test -n "$ld_run_path"; then + flibs_result="$ld_run_path $flibs" +else + flibs_result="$flibs" +fi +changequote([, ])dnl +ac_cv_flibs="$flibs_result"]) +FLIBS="$ac_cv_flibs" +AC_SUBST(FLIBS)dnl +AC_MSG_RESULT($FLIBS) +]) + dnl ### Checks for operating system services @@ -1751,6 +2225,7 @@ else ac_cv_sys_interpreter=no fi rm -f conftest]) +interpval="$ac_cv_sys_interpreter" ]) define(AC_HAVE_POUNDBANG, @@ -2127,7 +2602,7 @@ dnl FIXME banish uname from this macro! # 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"]) + [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS) LDFLAGS="$ac_save_LDFLAGS" fi @@ -2137,6 +2612,70 @@ AC_SUBST(X_LIBS)dnl AC_SUBST(X_EXTRA_LIBS)dnl ]) +dnl The old Cygwin32 macro is deprecated. +AC_DEFUN(AC_CYGWIN32, +[AC_OBSOLETE([$0], [; instead use AC_CYGWIN])dnl +AC_CYGWIN]) + +dnl Check for Cygwin. This is a way to set the right value for +dnl EXEEXT. +AC_DEFUN(AC_CYGWIN, +[AC_CACHE_CHECK(for Cygwin environment, ac_cv_cygwin, +[AC_TRY_COMPILE(,[ +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__;], +ac_cv_cygwin=yes, ac_cv_cygwin=no) +rm -f conftest*]) +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes]) + +dnl Check for mingw32. This is another way to set the right value for +dnl EXEEXT. +AC_DEFUN(AC_MINGW32, +[AC_CACHE_CHECK(for mingw32 environment, ac_cv_mingw32, +[AC_TRY_COMPILE(,[return __MINGW32__;], +ac_cv_mingw32=yes, ac_cv_mingw32=no) +rm -f conftest*]) +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes]) + +dnl Check for the extension used for executables. This knows that we +dnl add .exe for Cygwin or mingw32. Otherwise, it compiles a test +dnl executable. If this is called, the executable extensions will be +dnl automatically used by link commands run by the configure script. +AC_DEFUN(AC_EXEEXT, +[AC_REQUIRE([AC_CYGWIN]) +AC_REQUIRE([AC_MINGW32]) +AC_MSG_CHECKING([for executable suffix]) +AC_CACHE_VAL(ac_cv_exeext, +[if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if AC_TRY_EVAL(ac_link); then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + AC_MSG_ERROR([installation or configuration problem: compiler cannot create executables.]) + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi]) +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +AC_MSG_RESULT(${ac_cv_exeext}) +dnl Setting ac_exeext will implicitly change the ac_link command. +ac_exeext=$EXEEXT +AC_SUBST(EXEEXT)]) + dnl ### Checks for UNIX variants dnl These are kludges which should be replaced by a single POSIX check. diff --git a/src/util/autoconf/autoconf.info b/src/util/autoconf/autoconf.info index 433c6ca77..bd1806ebe 100644 --- a/src/util/autoconf/autoconf.info +++ b/src/util/autoconf/autoconf.info @@ -1,5 +1,5 @@ -This is Info file autoconf.info, produced by Makeinfo-1.64 from the -input file ./autoconf.texi. +This is Info file autoconf.info, produced by Makeinfo version 1.67 from +the input file /home/bje/autoconf-2.13/autoconf.texi. START-INFO-DIR-ENTRY * Autoconf: (autoconf). Create source code configuration scripts. @@ -12,8 +12,8 @@ MacKenzie. configure source code packages using templates and an `m4' macro package. - Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, -Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998 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 @@ -30,11 +30,11 @@ 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) +File: autoconf.info, Node: Top, Next: Introduction, Prev: (dir), 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.12, for Autoconf version 2.12. +package. This is edition 2.13, for Autoconf version 2.13. * Menu: @@ -97,7 +97,8 @@ Existing Tests * 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. +* C Compiler Characteristics:: +* Fortran 77 Compiler Characteristics:: * System Services:: Operating system services. * UNIX Variants:: Special kludges for specific UNIX variants. @@ -155,7 +156,7 @@ 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:: What to do when macros depend on other macros. Dependencies Between Macros @@ -367,7 +368,7 @@ Files used in configuring a software package: * Invoking autoreconf:: Remaking multiple `configure' scripts.  -File: autoconf.info, Node: Writing configure.in, Next: Invoking autoscan, Up: Making configure Scripts +File: autoconf.info, Node: Writing configure.in, Next: Invoking autoscan, Prev: Making configure Scripts, Up: Making configure Scripts Writing `configure.in' ====================== @@ -663,7 +664,7 @@ initialization and creating output files. * Versions:: Version numbers in `configure'.  -File: autoconf.info, Node: Input, Next: Output, Up: Setup +File: autoconf.info, Node: Input, Next: Output, Prev: Setup, Up: Setup Finding `configure' Input ========================= @@ -807,7 +808,7 @@ more information on what to put in `Makefile's. * Automatic Remaking:: Makefile rules for configuring.  -File: autoconf.info, Node: Preset Output Variables, Next: Build Directories, Up: Makefile Substitutions +File: autoconf.info, Node: Preset Output Variables, Next: Build Directories, Prev: Makefile Substitutions, Up: Makefile Substitutions Preset Output Variables ----------------------- @@ -907,6 +908,13 @@ variables with names that end in `dir'. `configure' uses this variable when compiling programs to test for C++ features. + - Variable: FFLAGS + Debugging and optimization options for the Fortran 77 compiler. + If it is not set in the environment when `configure' runs, the + default value is set when you call `AC_PROG_F77' (or empty if you + don't). `configure' uses this variable when compiling programs to + test for Fortran 77 features. + - Variable: DEFS `-D' options to pass to the C compiler. If `AC_CONFIG_HEADER' is called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H' @@ -1070,7 +1078,7 @@ finding the `config.h' from the source directory. * Invoking autoheader:: How to create configuration templates.  -File: autoconf.info, Node: Header Templates, Next: Invoking autoheader, Up: Configuration Headers +File: autoconf.info, Node: Header Templates, Next: Invoking autoheader, Prev: Configuration Headers, Up: Configuration Headers Configuration Header Templates ------------------------------ @@ -1307,12 +1315,13 @@ definitions into your program. * 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. +* C Compiler Characteristics:: +* Fortran 77 Compiler Characteristics:: * System Services:: Operating system services. * UNIX Variants:: Special kludges for specific UNIX variants.  -File: autoconf.info, Node: Alternative Programs, Next: Libraries, Up: Existing Tests +File: autoconf.info, Node: Alternative Programs, Next: Libraries, Prev: Existing Tests, Up: Existing Tests Alternative Programs ==================== @@ -1330,7 +1339,7 @@ one of the general program check macros. * Generic Programs:: How to find other programs.  -File: autoconf.info, Node: Particular Programs, Next: Generic Programs, Up: Alternative Programs +File: autoconf.info, Node: Particular Programs, Next: Generic Programs, Prev: Alternative Programs, Up: Alternative Programs Particular Program Checks ------------------------- @@ -1414,6 +1423,23 @@ in some cases whether they support certain features. calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or `AC_EGREP_CPP'. + - Macro: AC_PROG_F77 + Determine a Fortran 77 compiler to use. If `F77' is not already + set in the environment, check for `g77', `f77' and `f2c', in that + order. Set the output variable `F77' to the name of the compiler + found. + + If using `g77' (the GNU Fortran 77 compiler), then `AC_PROG_F77' + will set the shell variable `G77' to `yes', and empty otherwise. + If the output variable `FFLAGS' was not already set in the + environment, then set it to `-g -02' for `g77' (or `-O2' where + `g77' does not accept `-g'). Otherwise, set `FFLAGS' to `-g' for + all other Fortran 77 compilers. + + - Macro: AC_PROG_F77_C_O + Test if the Fortran 77 compiler accepts the options `-c' and `-o' + simultaneously, and define `F77_NO_MINUS_C_MINUS_O' if it does not. + - Macro: AC_PROG_GCC_TRADITIONAL Add `-traditional' to output variable `CC' if using the GNU C compiler and `ioctl' does not work properly without @@ -1428,8 +1454,8 @@ in some cases whether they support certain features. 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'. + variables `INSTALL_PROGRAM' and `INSTALL_SCRIPT' 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, @@ -1486,8 +1512,8 @@ in some cases whether they support certain features.  File: autoconf.info, Node: Generic Programs, Prev: Particular Programs, Up: Alternative Programs -Generic Program Checks ----------------------- +Generic Program and File 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 @@ -1500,6 +1526,17 @@ this: AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd, $PATH:/usr/libexec:/usr/sbin:/usr/etc:etc) + - Macro: AC_CHECK_FILE (FILE [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + Check whether file FILE exists on the native system. If it is + found, execute ACTION-IF-FOUND, otherwise do ACTION-IF-NOT-FOUND, + if given. + + - Macro: AC_CHECK_FILES (FILES[, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + Executes `AC_CHECK_FILE' once for each file listed in FILES. + Additionally, defines `HAVEFILE' for each file found, set to 1. + - Macro: AC_CHECK_PROG (VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND [, PATH, [ REJECT ]]]) Check whether program PROG-TO-CHECK-FOR exists in `PATH'. If it @@ -1548,22 +1585,23 @@ File: autoconf.info, Node: Libraries, Next: Library Functions, Prev: Alternat Library Files ============= - The following macros check for the presence of certain C library -archive files. + The following macros check for the presence of certain C, C++ or +Fortran 77 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. + Depending on the current language(*note Language Choice::.), try to + ensure that the C, C++ or Fortran 77 function FUNCTION is + available by checking whether a test 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). + commands to run if the link fails. If ACTION-IF-FOUND is not + specified, the default action will 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 @@ -1581,6 +1619,29 @@ archive files. variable; it must be a literal name. This macro is considered obsolete. + - Macro: AC_SEARCH_LIBS (FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + Search for a library defining FUNCTION, if it's not already + available. This equates to calling `AC_TRY_LINK_FUNC' first with + no libraries, then for each library listed in SEARCH-LIBS. + + If the function is found, run ACTION-IF-FOUND, otherwise run + ACTION-IF-NOT-FOUND. + + 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 + FUNCTION is present, because linking the test program will always + fail with unresolved symbols. + + - Macro: AC_SEARCH_LIBS (FUNCTION, SEARCH-LIBS[, ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + This macro is equivalent to calling `AC_TRY_LINK_FUNC' once for + each library listed in SEARCH-LIBS. Add `-lLIBRARY' to `LIBS' for + the first library found to contain FUNCTION, and execute + ACTION-IF-FOUND. Otherwise execute ACTION-IF-NOT-FOUND. +  File: autoconf.info, Node: Library Functions, Next: Header Files, Prev: Libraries, Up: Existing Tests @@ -1598,7 +1659,7 @@ can use one of the general function check macros. * Generic Functions:: How to find other functions.  -File: autoconf.info, Node: Particular Functions, Next: Generic Functions, Up: Library Functions +File: autoconf.info, Node: Particular Functions, Next: Generic Functions, Prev: Library Functions, Up: Library Functions Particular Function Checks -------------------------- @@ -1636,9 +1697,7 @@ and in some cases how they respond when given certain arguments. rather than choke on it. /* AIX requires this to be the first thing in the file. */ - #ifdef __GNUC__ - # define alloca __builtin_alloca - #else + #ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else @@ -1710,6 +1769,14 @@ and in some cases how they respond when given certain arguments. `HAVE_MMAP'. Only checks private fixed mapping of already-mapped memory. + - Macro: AC_FUNC_SELECT_ARGTYPES + Determines the correct type to be passed to each of the `select' + function's arguments, and defines those types in + `SELECT_TYPE_ARG1', `SELECT_TYPE_ARG234', and `SELECT_TYPE_ARG5' + respectively. `SELECT_TYPE_ARG1' defaults to `int', + `SELECT_TYPE_ARG234' defaults to `int *', and `SELECT_TYPE_ARG5' + defaults to `struct timeval *'. + - 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 @@ -1816,7 +1883,7 @@ it, then you can use one of the general header file check macros. * Generic Headers:: How to find other headers.  -File: autoconf.info, Node: Particular Headers, Next: Generic Headers, Up: Header Files +File: autoconf.info, Node: Particular Headers, Next: Generic Headers, Prev: Header Files, Up: Header Files Particular Header Checks ------------------------ @@ -2095,7 +2162,7 @@ Syntax::.). external array `tzname' is found, define `HAVE_TZNAME'.  -File: autoconf.info, Node: Typedefs, Next: Compiler Characteristics, Prev: Structures, Up: Existing Tests +File: autoconf.info, Node: Typedefs, Next: C Compiler Characteristics, Prev: Structures, Up: Existing Tests Typedefs ======== @@ -2111,7 +2178,7 @@ typedef check macro. * Generic Typedefs:: How to find other types.  -File: autoconf.info, Node: Particular Typedefs, Next: Generic Typedefs, Up: Typedefs +File: autoconf.info, Node: Particular Typedefs, Next: Generic Typedefs, Prev: Typedefs, Up: Typedefs Particular Typedef Checks ------------------------- @@ -2167,10 +2234,10 @@ particular test macros. type DEFAULT; e.g., `short' or `unsigned'.  -File: autoconf.info, Node: Compiler Characteristics, Next: System Services, Prev: Typedefs, Up: Existing Tests +File: autoconf.info, Node: C Compiler Characteristics, Next: Fortran 77 Compiler Characteristics, Prev: Typedefs, Up: Existing Tests -Compiler Characteristics -======================== +C Compiler Characteristics +========================== The following macros check for C compiler or machine architecture features. To check for characteristics not listed here, use @@ -2206,6 +2273,13 @@ Time::.) `__STDC__' do support the `long double' type; some compilers that define `__STDC__' do not support `long double'. + - Macro: AC_C_STRINGIZE + If the C preprocessor supports the stringizing operator, define + `HAVE_STRINGIZE'. The stringizing operator is `#' and is found in + macros such as this: + + #define x(y) #y + - Macro: AC_CHECK_SIZEOF (TYPE [, CROSS-SIZE]) 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 @@ -2231,7 +2305,42 @@ Time::.) `AC_CHECK_SIZEOF(long)' instead.  -File: autoconf.info, Node: System Services, Next: UNIX Variants, Prev: Compiler Characteristics, Up: Existing Tests +File: autoconf.info, Node: Fortran 77 Compiler Characteristics, Next: System Services, Prev: C Compiler Characteristics, Up: Existing Tests + +Fortran 77 Compiler Characteristics +=================================== + + The following macros check for Fortran 77 compiler characteristics. +To check for characteristics not listed here, use `AC_TRY_COMPILE' +(*note Examining Syntax::.) or `AC_TRY_RUN' (*note Run Time::.), making +sure to first set the current lanuage to Fortran 77 `AC_LANG_FORTRAN77' +(*note Language Choice::.). + + - Macro: AC_F77_LIBRARY_LDFLAGS + Determine the linker flags (e.g. `-L' and `-l') for the "Fortran + 77 intrinsic and run-time libraries" that are required to + successfully link a Fortran 77 program or shared library. The + output variable `FLIBS' is set to these flags. + + This macro is intended to be used in those situations when it is + necessary to mix, e.g. C++ and Fortran 77 source code into a single + program or shared library (*note Mixing Fortran 77 With C and C++: + (automake)Mixing Fortran 77 With C and C++.). + + For example, if object files from a C++ and Fortran 77 compiler + must be linked together, then the C++ compiler/linker must be used + for linking (since special C++-ish things need to happen at link + time like calling global constructors, instantiating templates, + enabling exception support, etc.). + + However, the Fortran 77 intrinsic and run-time libraries must be + linked in as well, but the C++ compiler/linker doesn't know by + default how to add these Fortran 77 libraries. Hence, the macro + `AC_F77_LIBRARY_LDFLAGS' was created to determine these Fortran 77 + libraries. + + +File: autoconf.info, Node: System Services, Next: UNIX Variants, Prev: Fortran 77 Compiler Characteristics, Up: Existing Tests System Services =============== @@ -2239,12 +2348,25 @@ 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_CYGWIN + Checks for the Cygwin environment. If present, sets shell variable + `CYGWIN' to `yes'. If not present, sets `CYGWIN' to the empty + string. + + - Macro: AC_EXEEXT + Defines substitute variable `EXEEXT' based on the output of the + compiler, after .c, .o, and .obj files have been excluded. + Typically set to empty string if Unix, `.exe' or `.EXE' if Win32. + + - Macro: AC_OBJEXT + Defines substitute variable `OBJEXT' based on the output of the + compiler, after .c files have been excluded. Typically set to + `.o' if Unix, `.obj' if Win32. + + - Macro: AC_MINGW32 + Checks for the MingW32 compiler environment. If present, sets + shell variable `MINGW32' to `yes'. If not present, sets `MINGW32' + to the empty string. - Macro: AC_PATH_X Try to locate the X Window System include files and libraries. If @@ -2275,6 +2397,13 @@ capabilities. `-lX11', and adds any found to the output variable `X_PRE_LIBS'. + - 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 shell variable `interpval'; it will be set to `yes' + if the system supports `#!', `no' if not. + - Macro: AC_SYS_LONG_FILE_NAMES If the system supports file names longer than 14 characters, define `HAVE_LONG_FILE_NAMES'. @@ -2375,7 +2504,7 @@ macro. *Note Writing Macros::, for how to do that. * Language Choice:: Selecting which language to use for testing.  -File: autoconf.info, Node: Examining Declarations, Next: Examining Syntax, Up: Writing Tests +File: autoconf.info, Node: Examining Declarations, Next: Examining Syntax, Prev: Writing Tests, Up: Writing Tests Examining Declarations ====================== @@ -2436,22 +2565,31 @@ File: autoconf.info, Node: Examining Syntax, Next: Examining Libraries, Prev: 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. + To check for a syntax feature of the C, C++ or Fortran 77 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::.). + Create a C, C++ or Fortran 77 test program (depending on which + language is current, *note Language Choice::.), to see whether a + function whose body consists of FUNCTION-BODY can be compiled. + + For C and C++, INCLUDES is any `#include' statements needed by the + code in FUNCTION-BODY (INCLUDES will be ignored if the currently + selected language is Fortran 77). This macro also uses `CFLAGS' + or `CXXFLAGS' if either C or C++ is the currently selected + language, as well as `CPPFLAGS', when compiling. If Fortran 77 is + the currently selected language then `FFLAGS' will be used when + compiling. + + If the file compiles successfully, run shell commands + ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. + + This macro does not try to link; use `AC_TRY_LINK' if you need to + do that (*note Examining Libraries::.).  File: autoconf.info, Node: Examining Libraries, Next: Run Time, Prev: Examining Syntax, Up: Writing Tests @@ -2480,19 +2618,43 @@ 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. +and global variables. It is also used by `AC_CHECK_LIB' to check for +libraries (*note 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. + Depending on the current language (*note Language Choice::.), + create a test program to see whether a function whose body + consists of FUNCTION-BODY can be compiled and linked. + + For C and C++, INCLUDES is any `#include' statements needed by the + code in FUNCTION-BODY (INCLUDES will be ignored if the currently + selected language is Fortran 77). This macro also uses `CFLAGS' + or `CXXFLAGS' if either C or C++ is the currently selected + language, as well as `CPPFLAGS', when compiling. If Fortran 77 is + the currently selected language then `FFLAGS' will be used when + compiling. However, both `LDFLAGS' and `LIBS' will be used during + linking in all cases. + + If the file compiles and links successfully, run shell commands + ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. + + - Macro: AC_TRY_LINK_FUNC (FUNCTION, [ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + Depending on the current language (*note Language Choice::.), + create a test program to see whether a program whose body consists + of a prototype of and a call to FUNCTION can be compiled and + linked. + + If the file compiles and links successfully, run shell commands + ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. + + - Macro: AC_TRY_LINK_FUNC (FUNCTION, [ACTION-IF-FOUND [, + ACTION-IF-NOT-FOUND]]) + Attempt to compile and link a small program that links with + FUNCTION. If the file compiles and links successfully, run shell + commands ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) @@ -2527,7 +2689,7 @@ cross-compiling. * Test Functions:: Avoiding pitfalls in test programs.  -File: autoconf.info, Node: Test Programs, Next: Guidelines, Up: Run Time +File: autoconf.info, Node: Test Programs, Next: Guidelines, Prev: Run Time, Up: Run Time Running Test Programs --------------------- @@ -2771,17 +2933,24 @@ is used in tests that follow in `configure.in'. to the value computed by `AC_PROG_CXX' if it has been run, empty otherwise. + - Macro: AC_LANG_FORTRAN77 + Do compilation tests using `F77' and use extension `.f' for test + programs. Set the shell variable `cross_compiling' to the value + computed by `AC_PROG_F77' if it has been run, empty otherwise. + - 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. + Remember the current language (as set by `AC_LANG_C', + `AC_LANG_CPLUSPLUS' or `AC_LANG_FORTRAN77') 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. + equivalent to either `AC_LANG_C', `AC_LANG_CPLUSPLUS' or + `AC_LANG_FORTRAN77', whichever had been run most recently when + `AC_LANG_SAVE' was last called. Do not call this macro more times than `AC_LANG_SAVE'. @@ -2811,7 +2980,7 @@ a message letting the user know the result of the test. * Printing Messages:: Notifying users of progress or problems.  -File: autoconf.info, Node: Defining Symbols, Next: Setting Output Variables, Up: Results +File: autoconf.info, Node: Defining Symbols, Next: Setting Output Variables, Prev: Results, Up: Results Defining C Preprocessor Symbols =============================== @@ -2838,20 +3007,24 @@ as in this example: values into `#define' statements in a template file. *Note Configuration Headers::, for more information about this kind of output. - - Macro: AC_DEFINE (VARIABLE [, VALUE]) + - Macro: AC_DEFINE (VARIABLE [, VALUE [, DESCRIPTION]]) 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"': + characters `[' or `]'), use `AC_DEFINE_UNQUOTED' instead. + DESCRIPTION is only useful if you are using `AC_CONFIG_HEADER'. + In this case, DESCRIPTION is put into the generated `config.h.in' + as the comment before the macro define; the macro need not be + mentioned in `acconfig.h'. 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]) + - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE [, DESCRIPTION]]) Like `AC_DEFINE', but three shell expansions are performed--once--on VARIABLE and VALUE: variable expansion (`$'), command substitution (``'), and backslash escaping (`\'). Single @@ -2963,13 +3136,23 @@ of the checks every time. MESSAGE, then `AC_CACHE_VAL' with the CACHE-ID and COMMANDS arguments, and `AC_MSG_RESULT' with CACHE-ID. + - Macro: AC_CACHE_LOAD + Loads values from existing cache file, or creates a new cache file + if a cache file is not found. Called automatically from `AC_INIT'. + + - Macro: AC_CACHE_SAVE + Flushes all cached values to the cache file. Called automatically + from `AC_OUTPUT', but it can be quite useful to call + `AC_CACHE_SAVE' at key points in configure.in. Doing so + checkpoints the cache in case of an early configure script abort. + * 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 +File: autoconf.info, Node: Cache Variable Names, Next: Cache Files, Prev: Caching Results, Up: Caching Results Cache Variable Names -------------------- @@ -3053,6 +3236,29 @@ 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::.). + If your configure script, or a macro called from configure.in, +happens to abort the configure process, it may be useful to checkpoint +the cache a few times at key points. Doing so will reduce the amount +of time it takes to re-run the configure script with (hopefully) the +error that caused the previous abort corrected. + + ... AC_INIT, etc. ... + dnl checks for programs + AC_PROG_CC + AC_PROG_GCC_TRADITIONAL + ... more program checks ... + AC_CACHE_SAVE + + dnl checks for libraries + AC_CHECK_LIB(nsl, gethostbyname) + AC_CHECK_LIB(socket, connect) + ... more lib checks ... + AC_CACHE_SAVE + + dnl Might abort... + AM_PATH_GTK(1.0.2, , exit 1) + AM_PATH_GTKMM(0.9.5, , exit 1) +  File: autoconf.info, Node: Printing Messages, Prev: Caching Results, Up: Results @@ -3145,10 +3351,10 @@ 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:: What to do when macros depend on other macros.  -File: autoconf.info, Node: Macro Definitions, Next: Macro Names, Up: Writing Macros +File: autoconf.info, Node: Macro Definitions, Next: Macro Names, Prev: Writing Macros, Up: Writing Macros Macro Definitions ================= @@ -3310,7 +3516,7 @@ macros are called in an order that might cause incorrect operation. * Obsolete Macros:: Warning about old ways of doing things.  -File: autoconf.info, Node: Prerequisite Macros, Next: Suggested Ordering, Up: Dependencies Between Macros +File: autoconf.info, Node: Prerequisite Macros, Next: Suggested Ordering, Prev: Dependencies Between Macros, Up: Dependencies Between Macros Prerequisite Macros ------------------- @@ -3424,7 +3630,7 @@ provides a uniform method for handling unguessable features. * Using System Type:: What to do with the system type.  -File: autoconf.info, Node: Specifying Names, Next: Canonicalizing, Up: Manual Configuration +File: autoconf.info, Node: Specifying Names, Next: Canonicalizing, Prev: Manual Configuration, Up: Manual Configuration Specifying the System Type ========================== @@ -3499,6 +3705,11 @@ given to it. host type. This is all that is needed for programs that are not part of a compiler toolchain. + - Macro: AC_VALIDATE_CACHED_SYSTEM_TUPLE (CMD) + If the cache file is inconsistent with the current host, target + and build system types, execute CMD or print a default error + message. +  File: autoconf.info, Node: System Type Variables, Next: Using System Type, Prev: Canonicalizing, Up: Manual Configuration @@ -3578,7 +3789,7 @@ under modified names, and set default values for `configure' options. * Site Defaults:: Giving `configure' local defaults.  -File: autoconf.info, Node: External Software, Next: Package Options, Up: Site Configuration +File: autoconf.info, Node: External Software, Next: Package Options, Prev: Site Configuration, Up: Site Configuration Working With External Software ============================== @@ -3754,7 +3965,7 @@ the macro `AC_ARG_PROGRAM'. * Transformation Rules:: `Makefile' uses of transforming names.  -File: autoconf.info, Node: Transformation Options, Next: Transformation Examples, Up: Transforming Names +File: autoconf.info, Node: Transformation Options, Next: Transformation Examples, Prev: Transforming Names, Up: Transforming Names Transformation Options ---------------------- @@ -4242,7 +4453,7 @@ them are addressed. * Why Not Imake:: Why GNU uses `configure' instead of Imake.  -File: autoconf.info, Node: Distributing, Next: Why GNU m4, Up: Questions +File: autoconf.info, Node: Distributing, Next: Why GNU m4, Prev: Questions, Up: Questions Distributing `configure' Scripts ================================ @@ -4433,7 +4644,7 @@ internal state in a file that it can read back quickly. * Changed Macro Writing:: Better ways to write your own macros.  -File: autoconf.info, Node: Changed File Names, Next: Changed Makefiles, Up: Upgrading +File: autoconf.info, Node: Changed File Names, Next: Changed Makefiles, Prev: Upgrading, Up: Upgrading Changed File Names ================== @@ -4653,7 +4864,7 @@ let there be light... * Deuteronomy:: Approaching the promises of easy configuration.  -File: autoconf.info, Node: Genesis, Next: Exodus, Up: History +File: autoconf.info, Node: Genesis, Next: Exodus, Prev: History, Up: History Genesis ======= @@ -5053,18 +5264,18 @@ Autoconf checks. * Menu: -* AC_MACRODIR <1>: Invoking autoupdate. -* AC_MACRODIR <2>: Invoking autoheader. -* AC_MACRODIR <3>: Invoking autoreconf. -* AC_MACRODIR <4>: Invoking autoconf. -* AC_MACRODIR <5>: 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. +* AC_MACRODIR <1>: Invoking autoupdate. +* AC_MACRODIR <2>: Invoking autoheader. +* AC_MACRODIR <3>: Invoking autoreconf. +* AC_MACRODIR <4>: Invoking autoconf. +* AC_MACRODIR <5>: 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 @@ -5079,75 +5290,82 @@ how this is done. * Menu: -* ALLOCA: Particular Functions. -* AWK: Particular Programs. -* bindir: Preset Output Variables. -* 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 <1>: UNIX Variants. -* CC: Particular Programs. -* CFLAGS <1>: 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 <1>: Particular Programs. -* CXXFLAGS: Preset Output Variables. -* datadir: 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. -* includedir: Preset Output Variables. -* infodir: Preset Output Variables. -* INSTALL: Particular Programs. -* INSTALL_DATA: Particular Programs. -* INSTALL_PROGRAM: Particular Programs. -* KMEM_GROUP: Particular Functions. -* LDFLAGS: Preset Output Variables. -* LEX: Particular Programs. -* LEX_OUTPUT_ROOT: Particular Programs. -* LEXLIB: Particular Programs. -* libdir: Preset Output Variables. -* libexecdir: Preset Output Variables. -* LIBOBJS <1>: Structures. -* LIBOBJS <2>: Generic Functions. -* LIBOBJS: Particular Functions. -* LIBS <1>: UNIX Variants. -* LIBS: Preset Output Variables. -* LN_S: Particular Programs. -* localstatedir: Preset Output Variables. -* mandir: Preset Output Variables. -* NEED_SETGID: Particular Functions. -* oldincludedir: Preset Output Variables. -* prefix: Preset Output Variables. -* program_transform_name: Transforming Names. -* RANLIB: Particular Programs. -* sbindir: Preset Output Variables. -* SET_MAKE: Output. -* sharedstatedir: Preset Output Variables. -* srcdir: Preset Output Variables. -* subdirs: Subdirectories. -* sysconfdir: Preset Output Variables. -* 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. +* ALLOCA: Particular Functions. +* AWK: Particular Programs. +* bindir: Preset Output Variables. +* 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 <1>: UNIX Variants. +* CC: Particular Programs. +* CFLAGS <1>: 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 <1>: Particular Programs. +* CXXFLAGS: Preset Output Variables. +* datadir: Preset Output Variables. +* DEFS: Preset Output Variables. +* exec_prefix: Preset Output Variables. +* EXEEXT: System Services. +* F77: Particular Programs. +* FFLAGS <1>: Particular Programs. +* FFLAGS: Preset Output Variables. +* FLIBS: Fortran 77 Compiler Characteristics. +* host: System Type Variables. +* host_alias: System Type Variables. +* host_cpu: System Type Variables. +* host_os: System Type Variables. +* host_vendor: System Type Variables. +* includedir: Preset Output Variables. +* infodir: Preset Output Variables. +* INSTALL: Particular Programs. +* INSTALL_DATA: Particular Programs. +* INSTALL_PROGRAM: Particular Programs. +* INSTALL_SCRIPT: Particular Programs. +* KMEM_GROUP: Particular Functions. +* LDFLAGS: Preset Output Variables. +* LEX: Particular Programs. +* LEX_OUTPUT_ROOT: Particular Programs. +* LEXLIB: Particular Programs. +* libdir: Preset Output Variables. +* libexecdir: Preset Output Variables. +* LIBOBJS <1>: Structures. +* LIBOBJS <2>: Generic Functions. +* LIBOBJS: Particular Functions. +* LIBS <1>: UNIX Variants. +* LIBS: Preset Output Variables. +* LN_S: Particular Programs. +* localstatedir: Preset Output Variables. +* mandir: Preset Output Variables. +* NEED_SETGID: Particular Functions. +* OBJEXT: System Services. +* oldincludedir: Preset Output Variables. +* prefix: Preset Output Variables. +* program_transform_name: Transforming Names. +* RANLIB: Particular Programs. +* sbindir: Preset Output Variables. +* SET_MAKE: Output. +* sharedstatedir: Preset Output Variables. +* srcdir: Preset Output Variables. +* subdirs: Subdirectories. +* sysconfdir: Preset Output Variables. +* 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 @@ -5161,81 +5379,86 @@ use these names in `#if' directives. * Menu: -* __CHAR_UNSIGNED__: Compiler Characteristics. -* _ALL_SOURCE: UNIX Variants. -* _MINIX: UNIX Variants. -* _POSIX_1_SOURCE: UNIX Variants. -* _POSIX_SOURCE: UNIX Variants. -* _POSIX_VERSION: Particular Headers. -* C_ALLOCA: Particular Functions. -* CLOSEDIR_VOID: Particular Functions. -* const: Compiler Characteristics. -* 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_ST_BLKSIZE: Structures. -* HAVE_ST_BLOCKS: Structures. -* HAVE_ST_RDEV: Structures. -* HAVE_STRCOLL: Particular Functions. -* HAVE_STRFTIME: Particular Functions. -* 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. -* SETPGRP_VOID: Particular Functions. -* SETVBUF_REVERSED: Particular Functions. -* size_t: Particular Typedefs. -* STDC_HEADERS: Particular Headers. -* SVR4: Particular Functions. -* SYS_SIGLIST_DECLARED: Particular Headers. -* SYSDIR: Particular Headers. -* SYSNDIR: 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. +* __CHAR_UNSIGNED__: C Compiler Characteristics. +* _ALL_SOURCE: UNIX Variants. +* _MINIX: UNIX Variants. +* _POSIX_1_SOURCE: UNIX Variants. +* _POSIX_SOURCE: UNIX Variants. +* _POSIX_VERSION: Particular Headers. +* C_ALLOCA: Particular Functions. +* CLOSEDIR_VOID: Particular Functions. +* const: C Compiler Characteristics. +* DGUX: Particular Functions. +* DIRENT: Particular Headers. +* F77_NO_MINUS_C_MINUS_O: Particular Programs. +* GETGROUPS_T: Particular Typedefs. +* GETLODAVG_PRIVILEGED: Particular Functions. +* GETPGRP_VOID: Particular Functions. +* gid_t: Particular Typedefs. +* HAVE_ALLOCA_H: Particular Functions. +* HAVE_CONFIG_H: Configuration Headers. +* HAVE_DIRENT_H: Particular Headers. +* HAVE_DOPRNT: Particular Functions. +* HAVE_FUNCTION: Generic Functions. +* HAVE_GETMNTENT: Particular Functions. +* HAVE_HEADER: Generic Headers. +* HAVE_LONG_DOUBLE: C Compiler Characteristics. +* HAVE_LONG_FILE_NAMES: System Services. +* HAVE_MMAP: Particular Functions. +* HAVE_NDIR_H: Particular Headers. +* HAVE_RESTARTABLE_SYSCALLS: System Services. +* HAVE_ST_BLKSIZE: Structures. +* HAVE_ST_BLOCKS: Structures. +* HAVE_ST_RDEV: Structures. +* HAVE_STRCOLL: Particular Functions. +* HAVE_STRFTIME: Particular Functions. +* HAVE_STRINGIZE: C Compiler Characteristics. +* 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: C Compiler Characteristics. +* INT_16_BITS: C Compiler Characteristics. +* LONG_64_BITS: C 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. +* SELECT_TYPE_ARG1: Particular Functions. +* SELECT_TYPE_ARG234: Particular Functions. +* SELECT_TYPE_ARG5: Particular Functions. +* SETPGRP_VOID: Particular Functions. +* SETVBUF_REVERSED: Particular Functions. +* size_t: Particular Typedefs. +* STDC_HEADERS: Particular Headers. +* SVR4: Particular Functions. +* SYS_SIGLIST_DECLARED: Particular Headers. +* SYSDIR: Particular Headers. +* SYSNDIR: 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: C Compiler Characteristics. +* YYTEXT_POINTER: Particular Programs.  File: autoconf.info, Node: Macro Index, Prev: Preprocessor Symbol Index, Up: Top @@ -5248,315 +5471,333 @@ 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. -* 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. -* CACHE_CHECK: Caching Results. -* CACHE_VAL: Caching Results. -* CANONICAL_HOST: Canonicalizing. -* CANONICAL_SYSTEM: Canonicalizing. -* CHAR_UNSIGNED: Old Macro Names. -* 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. -* CHECKING: Printing Messages. -* COMPILE_CHECK: Examining Libraries. -* CONFIG_AUX_DIR: Input. -* CONFIG_HEADER: Configuration Headers. -* CONFIG_SUBDIRS: Subdirectories. -* CONST: Old Macro Names. -* CROSS_CHECK: Old Macro Names. -* 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_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. -* 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. -* 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. -* PROGRAM_CHECK: Old Macro Names. -* PROGRAM_EGREP: Old Macro Names. -* PROGRAM_PATH: Old Macro Names. -* PROGRAMS_CHECK: Old Macro Names. -* PROGRAMS_PATH: Old Macro Names. -* 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. -* SET_MAKE: Old Macro Names. -* SETVBUF_REVERSED: Old Macro Names. -* SIZE_T: Old Macro Names. -* SIZEOF_TYPE: Old Macro Names. -* ST_BLKSIZE: Old Macro Names. -* ST_BLOCKS: Old Macro Names. -* ST_RDEV: Old Macro Names. -* STAT_MACROS_BROKEN <1>: 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. -* 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. -* TIME_WITH_SYS_TIME: Old Macro Names. -* TIMEZONE: 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. +* 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. +* C_BIGENDIAN: C Compiler Characteristics. +* C_CHAR_UNSIGNED: C Compiler Characteristics. +* C_CONST: C Compiler Characteristics. +* C_CROSS: Test Programs. +* C_INLINE: C Compiler Characteristics. +* C_LONG_DOUBLE: C Compiler Characteristics. +* C_STRINGIZE: C Compiler Characteristics. +* CACHE_CHECK: Caching Results. +* CACHE_LOAD: Caching Results. +* CACHE_SAVE: Caching Results. +* CACHE_VAL: Caching Results. +* CANONICAL_HOST: Canonicalizing. +* CANONICAL_SYSTEM: Canonicalizing. +* CHAR_UNSIGNED: Old Macro Names. +* CHECK_FILE: Generic Programs. +* CHECK_FILES: Generic Programs. +* 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: C Compiler Characteristics. +* CHECK_TOOL: Generic Programs. +* CHECK_TYPE: Generic Typedefs. +* CHECKING: Printing Messages. +* COMPILE_CHECK: Examining Libraries. +* CONFIG_AUX_DIR: Input. +* CONFIG_HEADER: Configuration Headers. +* CONFIG_SUBDIRS: Subdirectories. +* CONST: Old Macro Names. +* CROSS_CHECK: Old Macro Names. +* CYGWIN: System Services. +* 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. +* EXEEXT: System Services. +* F77_LIBRARY_LDFLAGS: Fortran 77 Compiler Characteristics. +* 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_FNMATCH: Particular Functions. +* FUNC_GETLOADAVG: Particular Functions. +* FUNC_GETMNTENT: Particular Functions. +* FUNC_GETPGRP: Particular Functions. +* FUNC_MEMCMP: Particular Functions. +* FUNC_MMAP: Particular Functions. +* FUNC_SELECT_ARGTYPES: Particular Functions. +* FUNC_SETPGRP: 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: C Compiler Characteristics. +* IRIX_SUN: UNIX Variants. +* ISC_POSIX: UNIX Variants. +* LANG_C: Language Choice. +* LANG_CPLUSPLUS: Language Choice. +* LANG_FORTRAN77: Language Choice. +* LANG_RESTORE: Language Choice. +* LANG_SAVE: Language Choice. +* LINK_FILES: Using System Type. +* LN_S: Old Macro Names. +* LONG_64_BITS: C Compiler Characteristics. +* LONG_DOUBLE: Old Macro Names. +* LONG_FILE_NAMES: Old Macro Names. +* MAJOR_HEADER: Old Macro Names. +* MEMORY_H: Particular Headers. +* MINGW32: System Services. +* 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. +* OBJEXT: System Services. +* 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. +* 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_F77_C_O: Particular Programs. +* PROG_FORTRAN: 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. +* PROGRAM_CHECK: Old Macro Names. +* PROGRAM_EGREP: Old Macro Names. +* PROGRAM_PATH: Old Macro Names. +* PROGRAMS_CHECK: Old Macro Names. +* PROGRAMS_PATH: Old Macro Names. +* 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. +* SEARCH_LIBS: Libraries. +* SET_MAKE: Old Macro Names. +* SETVBUF_REVERSED: Old Macro Names. +* SIZE_T: Old Macro Names. +* SIZEOF_TYPE: Old Macro Names. +* ST_BLKSIZE: Old Macro Names. +* ST_BLOCKS: Old Macro Names. +* ST_RDEV: Old Macro Names. +* STAT_MACROS_BROKEN <1>: 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. +* 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. +* TIME_WITH_SYS_TIME: Old Macro Names. +* TIMEZONE: Old Macro Names. +* TRY_COMPILE: Examining Syntax. +* TRY_CPP: Examining Declarations. +* TRY_LINK: Examining Libraries. +* TRY_LINK_FUNC: 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. +* VALIDATE_CACHED_SYSTEM_TUPLE: Canonicalizing. +* 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.  Tag Table: -Node: Top1173 -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 Index219573 -Node: Macro Index224450 +Node: Top1209 +Node: Introduction9711 +Node: Making configure Scripts13551 +Node: Writing configure.in16632 +Node: Invoking autoscan20365 +Node: Invoking ifnames22670 +Node: Invoking autoconf24160 +Node: Invoking autoreconf25998 +Node: Setup28834 +Node: Input29739 +Node: Output31476 +Node: Makefile Substitutions35113 +Node: Preset Output Variables36716 +Node: Build Directories41585 +Node: Automatic Remaking43218 +Node: Configuration Headers45304 +Node: Header Templates47818 +Node: Invoking autoheader49027 +Node: Subdirectories52175 +Node: Default Prefix53570 +Node: Versions54974 +Node: Existing Tests56878 +Node: Alternative Programs58426 +Node: Particular Programs59113 +Node: Generic Programs67165 +Node: Libraries70471 +Node: Library Functions73545 +Node: Particular Functions74103 +Node: Generic Functions81297 +Node: Header Files83401 +Node: Particular Headers83960 +Node: Generic Headers90952 +Node: Structures92254 +Node: Typedefs94491 +Node: Particular Typedefs94997 +Node: Generic Typedefs96214 +Node: C Compiler Characteristics96671 +Node: Fortran 77 Compiler Characteristics99542 +Node: System Services101245 +Node: UNIX Variants104381 +Node: Writing Tests106400 +Node: Examining Declarations108393 +Node: Examining Syntax110885 +Node: Examining Libraries112330 +Node: Run Time116040 +Node: Test Programs117028 +Node: Guidelines119356 +Node: Test Functions120545 +Node: Portable Shell122088 +Node: Testing Values and Files124020 +Node: Multiple Cases125675 +Node: Language Choice126873 +Node: Results128975 +Node: Defining Symbols129737 +Node: Setting Output Variables133033 +Node: Caching Results134879 +Node: Cache Variable Names137625 +Node: Cache Files139109 +Node: Printing Messages141946 +Node: Writing Macros145394 +Node: Macro Definitions146041 +Node: Macro Names147169 +Node: Quoting149620 +Node: Dependencies Between Macros151522 +Node: Prerequisite Macros152169 +Node: Suggested Ordering153660 +Node: Obsolete Macros155190 +Node: Manual Configuration156414 +Node: Specifying Names157313 +Node: Canonicalizing159214 +Node: System Type Variables160726 +Node: Using System Type161473 +Node: Site Configuration162967 +Node: External Software163740 +Node: Package Options166943 +Node: Site Details169690 +Node: Transforming Names170913 +Node: Transformation Options172091 +Node: Transformation Examples172584 +Node: Transformation Rules174152 +Node: Site Defaults175561 +Node: Invoking configure179467 +Node: Basic Installation180416 +Node: Compilers and Options182996 +Node: Multiple Architectures183645 +Node: Installation Names184631 +Node: Optional Features185815 +Node: System Type186585 +Node: Sharing Defaults187607 +Node: Operation Controls188231 +Node: Invoking config.status189217 +Node: Questions192605 +Node: Distributing193137 +Node: Why GNU m4194281 +Node: Bootstrapping195094 +Node: Why Not Imake195710 +Node: Upgrading200119 +Node: Changed File Names201640 +Node: Changed Makefiles202394 +Node: Changed Macros203490 +Node: Invoking autoupdate204737 +Node: Changed Results206328 +Node: Changed Macro Writing208430 +Node: History209693 +Node: Genesis210485 +Node: Exodus211674 +Node: Leviticus214723 +Node: Numbers216246 +Node: Deuteronomy218162 +Node: Old Macro Names220826 +Node: Environment Variable Index223875 +Node: Output Variable Index224889 +Node: Preprocessor Symbol Index230087 +Node: Macro Index235373  End Tag Table diff --git a/src/util/autoconf/autoconf.sh b/src/util/autoconf/autoconf.sh index 4e667b93c..e6b0819fa 100644 --- a/src/util/autoconf/autoconf.sh +++ b/src/util/autoconf/autoconf.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! @SHELL@ # autoconf -- create `configure' using m4 macros # Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc. diff --git a/src/util/autoconf/autoconf.texi b/src/util/autoconf/autoconf.texi index d0ba46df5..22a2ccd50 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.12 -@set VERSION 2.12 -@set UPDATED November 1996 +@set EDITION 2.13 +@set VERSION 2.13 +@set UPDATED December 1998 @iftex @finalout @@ -27,7 +27,7 @@ This file documents the GNU Autoconf package for creating scripts to configure source code packages using templates and an @code{m4} macro package. -Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -56,12 +56,12 @@ by the Foundation. @subtitle Creating Automatic Configuration Scripts @subtitle Edition @value{EDITION}, for Autoconf version @value{VERSION} @subtitle @value{UPDATED} -@author by David MacKenzie +@author by David MacKenzie and Ben Elliston @c I think I've rewritten all of Noah and Roland's contributions by now. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 93, 94, 95, 96, 98 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -87,7 +87,7 @@ by the Foundation. @c Define a macro index that @@defmac doesn't write to. @defcodeindex ma -@node Top, Introduction, , (dir) +@node Top, Introduction, (dir), (dir) @comment node-name, next, previous, up @ifinfo @@ -120,6 +120,7 @@ package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}. * Preprocessor Symbol Index:: Index of C preprocessor symbols defined. * Macro Index:: Index of Autoconf macros. +@detailmenu --- The Detailed Node Listing --- Making @code{configure} Scripts @@ -159,7 +160,8 @@ Existing Tests * 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. +* C Compiler Characteristics:: +* Fortran 77 Compiler Characteristics:: * System Services:: Operating system services. * UNIX Variants:: Special kludges for specific UNIX variants. @@ -217,7 +219,7 @@ 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:: What to do when macros depend on other macros. Dependencies Between Macros @@ -280,6 +282,8 @@ History of Autoconf * Leviticus:: The priestly code of portability arrives. * Numbers:: Growth and contributors. * Deuteronomy:: Approaching the promises of easy configuration. + +@end detailmenu @end menu @node Introduction, Making configure Scripts, Top, Top @@ -444,7 +448,7 @@ Makefile.in ---' `-> Makefile ---' * Invoking autoreconf:: Remaking multiple @code{configure} scripts. @end menu -@node Writing configure.in, Invoking autoscan, , Making configure Scripts +@node Writing configure.in, Invoking autoscan, Making configure Scripts, Making configure Scripts @section Writing @file{configure.in} To produce a @code{configure} script for a software package, create a @@ -660,7 +664,7 @@ option overrides the environment variable. Print the version number of Autoconf and exit. @end table -@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts +@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts @section Using @code{autoreconf} to Update @code{configure} Scripts If you have a lot of Autoconf-generated @code{configure} scripts, the @@ -752,7 +756,7 @@ initialization and creating output files. * Versions:: Version numbers in @code{configure}. @end menu -@node Input, Output, , Setup +@node Input, Output, Setup, Setup @section Finding @code{configure} Input Every @code{configure} script must call @code{AC_INIT} before doing @@ -910,7 +914,7 @@ GNU Coding Standards}, for more information on what to put in * Automatic Remaking:: Makefile rules for configuring. @end menu -@node Preset Output Variables, Build Directories, , Makefile Substitutions +@node Preset Output Variables, Build Directories, Makefile Substitutions, Makefile Substitutions @subsection Preset Output Variables Some output variables are preset by the Autoconf macros. Some of the @@ -1048,6 +1052,15 @@ set when you call @code{AC_PROG_CXX} (or empty if you don't). C++ features. @end defvar +@defvar FFLAGS +@ovindex FFLAGS +Debugging and optimization options for the Fortran 77 compiler. If it +is not set in the environment when @code{configure} runs, the default +value is set when you call @code{AC_PROG_F77} (or empty if you don't). +@code{configure} uses this variable when compiling programs to test for +Fortran 77 features. +@end defvar + @defvar DEFS @ovindex DEFS @samp{-D} options to pass to the C compiler. If @code{AC_CONFIG_HEADER} @@ -1114,7 +1127,7 @@ time.info: time.texinfo $(MAKEINFO) $(srcdir)/time.texinfo @end example -@node Automatic Remaking, , Build Directories, Makefile Substitutions +@node Automatic Remaking, , Build Directories, Makefile Substitutions @subsection Automatic Remaking You can put rules like the following in the top-level @file{Makefile.in} @@ -1224,7 +1237,7 @@ to prepend and/or append boilerplate to the file. * Invoking autoheader:: How to create configuration templates. @end menu -@node Header Templates, Invoking autoheader, , Configuration Headers +@node Header Templates, Invoking autoheader, Configuration Headers, Configuration Headers @subsection Configuration Header Templates Your distribution should contain a template file that looks as you want @@ -1264,7 +1277,7 @@ symbol). @end group @end example -@node Invoking autoheader, , Header Templates, Configuration Headers +@node Invoking autoheader, , Header Templates, Configuration Headers @subsection Using @code{autoheader} to Create @file{config.h.in} The @code{autoheader} program can create a template file of C @@ -1400,7 +1413,7 @@ is found, set the prefix to the parent of the directory containing set the prefix to @file{/usr/local/gnu}. @end defmac -@node Versions, , Default Prefix, Setup +@node Versions, , Default Prefix, Setup @section Version Numbers in @code{configure} The following macros manage version numbers for @code{configure} @@ -1481,12 +1494,13 @@ Symbols}, for how to get those symbol definitions into your program. * 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. +* C Compiler Characteristics:: +* Fortran 77 Compiler Characteristics:: * System Services:: Operating system services. * UNIX Variants:: Special kludges for specific UNIX variants. @end menu -@node Alternative Programs, Libraries, , Existing Tests +@node Alternative Programs, Libraries, Existing Tests, Existing Tests @section Alternative Programs These macros check for the presence or behavior of particular programs. @@ -1501,7 +1515,7 @@ it, then you can use one of the general program check macros. * Generic Programs:: How to find other programs. @end menu -@node Particular Programs, Generic Programs, , Alternative Programs +@node Particular Programs, Generic Programs, Alternative Programs, Alternative Programs @subsection Particular Program Checks These macros check for particular programs---whether they exist, and @@ -1609,6 +1623,32 @@ calling @code{AC_TRY_CPP}, @code{AC_CHECK_HEADER}, @code{AC_EGREP_HEADER}, or @code{AC_EGREP_CPP}. @end defmac +@defmac AC_PROG_F77 +@maindex PROG_FORTRAN +@ovindex F77 +@ovindex FFLAGS +Determine a Fortran 77 compiler to use. If @code{F77} is not already +set in the environment, check for @code{g77}, @code{f77} and @code{f2c}, +in that order. Set the output variable @code{F77} to the name of the +compiler found. + +If using @code{g77} (the GNU Fortran 77 compiler), then +@code{AC_PROG_F77} will set the shell variable @code{G77} to @samp{yes}, +and empty otherwise. If the output variable @code{FFLAGS} was not +already set in the environment, then set it to @samp{-g -02} for +@code{g77} (or @samp{-O2} where @code{g77} does not accept @samp{-g}). +Otherwise, set @code{FFLAGS} to @samp{-g} for all other Fortran 77 +compilers. +@end defmac + +@defmac AC_PROG_F77_C_O +@maindex PROG_F77_C_O +@cvindex F77_NO_MINUS_C_MINUS_O +Test if the Fortran 77 compiler accepts the options @samp{-c} and +@samp{-o} simultaneously, and define @code{F77_NO_MINUS_C_MINUS_O} if it +does not. +@end defmac + @defmac AC_PROG_GCC_TRADITIONAL @maindex PROG_GCC_TRADITIONAL @ovindex CC @@ -1625,13 +1665,14 @@ is becoming a less prevalent problem. @ovindex INSTALL @ovindex INSTALL_PROGRAM @ovindex INSTALL_DATA +@ovindex INSTALL_SCRIPT Set output variable @code{INSTALL} to the path of a BSD compatible @code{install} program, if one is found in the current @code{PATH}. Otherwise, set @code{INSTALL} to @samp{@var{dir}/install-sh -c}, checking the directories specified to @code{AC_CONFIG_AUX_DIR} (or its default directories) to determine @var{dir} (@pxref{Output}). Also set -the variable @code{INSTALL_PROGRAM} to @samp{$@{INSTALL@}} and -@code{INSTALL_DATA} to @samp{$@{INSTALL@} -m 644}. +the variables @code{INSTALL_PROGRAM} and @code{INSTALL_SCRIPT} to +@samp{$@{INSTALL@}} and @code{INSTALL_DATA} to @samp{$@{INSTALL@} -m 644}. This macro screens out various instances of @code{install} known to not work. It prefers to find a C program rather than a shell script, for @@ -1704,8 +1745,8 @@ If @code{bison} is found, set output variable @code{YACC} to to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}. @end defmac -@node Generic Programs, , Particular Programs, Alternative Programs -@subsection Generic Program Checks +@node Generic Programs, , Particular Programs, Alternative Programs +@subsection Generic Program and File 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 @@ -1720,6 +1761,19 @@ AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd, $PATH:/usr/libexec:/usr/sbin:/usr/etc:etc) @end example +@defmac AC_CHECK_FILE (@var{file} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex CHECK_FILE +Check whether file @var{file} exists on the native system. +If it is found, execute @var{action-if-found}, otherwise do +@var{action-if-not-found}, if given. +@end defmac + +@defmac AC_CHECK_FILES (@var{files}@r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex CHECK_FILES +Executes @code{AC_CHECK_FILE} once for each file listed in @var{files}. +Additionally, defines @samp{HAVE@var{file}} for each file found, set to 1. +@end defmac + @defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found} @r{[}, @var{path}, @r{[} @var{reject} @r{]]]}) @maindex CHECK_PROG Check whether program @var{prog-to-check-for} exists in @code{PATH}. If @@ -1774,22 +1828,23 @@ found. @node Libraries, Library Functions, Alternative Programs, Existing Tests @section Library Files -The following macros check for the presence of certain C library archive -files. +The following macros check for the presence of certain C, C++ or Fortran +77 library archive files. @defmac AC_CHECK_LIB (@var{library}, @var{function} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]}) @maindex CHECK_LIB -Try to ensure that C function @var{function} is available by checking -whether a test C program can be linked with the library @var{library} to -get the function. @var{library} is the base name of the library; e.g., -to check for @samp{-lmp}, use @samp{mp} as the @var{library} argument. +Depending on the current language(@pxref{Language Choice}), try to +ensure that the C, C++ or Fortran 77 function @var{function} is +available by checking whether a test program can be linked with the +library @var{library} to get the function. @var{library} is the base +name of the library; e.g., to check for @samp{-lmp}, use @samp{mp} as +the @var{library} argument. @var{action-if-found} is a list of shell commands to run if the link -with the library succeeds; @var{action-if-not-found} is a list of shell -commands to run if the link fails. If @var{action-if-found} and -@var{action-if-not-found} are not specified, the default action is to -add @samp{-l@var{library}} to @code{LIBS} and define -@samp{HAVE_LIB@var{library}} (in all capitals). +with the library succeeds; @var{action-if-not-found} is a list of +shell commands to run if the link fails. If @var{action-if-found} is +not specified, the default action will add @samp{-l@var{library}} to +@code{LIBS} and define @samp{HAVE_LIB@var{library}} (in all capitals). If linking with @var{library} results in unresolved symbols, which would be resolved by linking with additional libraries, give those libraries @@ -1809,6 +1864,32 @@ all of those cases, the compiler is passed @samp{-lfoo}. However, This macro is considered obsolete. @end defmac +@defmac AC_SEARCH_LIBS (@var{function}, @var{search-libs} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]}) +@maindex SEARCH_LIBS +Search for a library defining @var{function}, if it's not already +available. This equates to calling @code{AC_TRY_LINK_FUNC} first +with no libraries, then for each library listed in @var{search-libs}. + +If the function is found, run @var{action-if-found}, otherwise run +@var{action-if-not-found}. + +If linking with @var{library} results in unresolved symbols, which would +be resolved by linking with additional libraries, give those libraries +as the @var{other-libraries} argument, separated by spaces: @samp{-lXt +-lX11}. Otherwise this macro will fail to detect that @var{function} is +present, because linking the test program will always fail with +unresolved symbols. +@end defmac + +@defmac AC_SEARCH_LIBS (@var{function}, @var{search-libs}@r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex SEARCH_LIBS +This macro is equivalent to calling @code{AC_TRY_LINK_FUNC} once for each +library listed in @var{search-libs}. Add @samp{-l@var{library}} to +@code{LIBS} for the first library found to contain @var{function}, and +execute @var{action-if-found}. Otherwise execute +@var{action-if-not-found}. +@end defmac + @node Library Functions, Header Files, Libraries, Existing Tests @section Library Functions @@ -1822,7 +1903,7 @@ it, then you can use one of the general function check macros. * Generic Functions:: How to find other functions. @end menu -@node Particular Functions, Generic Functions, , Library Functions +@node Particular Functions, Generic Functions, Library Functions, Library Functions @subsection Particular Function Checks These macros check for particular C functions---whether they exist, and @@ -1864,9 +1945,7 @@ rather than choke on it. @example @group /* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else +#ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else @@ -1979,6 +2058,19 @@ If the @code{mmap} function exists and works correctly, define memory. @end defmac +@defmac AC_FUNC_SELECT_ARGTYPES +@maindex FUNC_SELECT_ARGTYPES +@cvindex SELECT_TYPE_ARG1 +@cvindex SELECT_TYPE_ARG234 +@cvindex SELECT_TYPE_ARG5 +Determines the correct type to be passed to each of the +@code{select} function's arguments, and defines those types +in @code{SELECT_TYPE_ARG1}, @code{SELECT_TYPE_ARG234}, and +@code{SELECT_TYPE_ARG5} respectively. @code{SELECT_TYPE_ARG1} defaults +to @samp{int}, @code{SELECT_TYPE_ARG234} defaults to @samp{int *}, +and @code{SELECT_TYPE_ARG5} defaults to @samp{struct timeval *}. +@end defmac + @defmac AC_FUNC_SETPGRP @maindex FUNC_SETPGRP @cvindex SETPGRP_VOID @@ -2051,7 +2143,7 @@ If @code{wait3} is found and fills in the contents of its third argument @code{HAVE_WAIT3}. @end defmac -@node Generic Functions, , Particular Functions, Library Functions +@node Generic Functions, , Particular Functions, Library Functions @subsection Generic Function Checks These macros are used to find functions not covered by the particular @@ -2109,7 +2201,7 @@ it, then you can use one of the general header file check macros. * Generic Headers:: How to find other headers. @end menu -@node Particular Headers, Generic Headers, , Header Files +@node Particular Headers, Generic Headers, Header Files, Header Files @subsection Particular Header Checks These macros check for particular system header files---whether they @@ -2353,7 +2445,7 @@ The symbol @code{USG} is obsolete. Instead of this macro, see the example for @code{AC_HEADER_STDC}. @end defmac -@node Generic Headers, , Particular Headers, Header Files +@node Generic Headers, , Particular Headers, Header Files @subsection Generic Header Checks These macros are used to find system header files not covered by the @@ -2467,7 +2559,7 @@ Figure out how to get the current timezone. If @code{struct tm} has a external array @code{tzname} is found, define @code{HAVE_TZNAME}. @end defmac -@node Typedefs, Compiler Characteristics, Structures, Existing Tests +@node Typedefs, C Compiler Characteristics, Structures, Existing Tests @section Typedefs The following macros check for C typedefs. If there is no macro @@ -2480,7 +2572,7 @@ typedef check macro. * Generic Typedefs:: How to find other types. @end menu -@node Particular Typedefs, Generic Typedefs, , Typedefs +@node Particular Typedefs, Generic Typedefs, Typedefs, Typedefs @subsection Particular Typedef Checks These macros check for particular C typedefs in @file{sys/types.h} and @@ -2546,7 +2638,7 @@ If @code{uid_t} is not defined, define @code{uid_t} to be @code{int} and @code{gid_t} to be @code{int}. @end defmac -@node Generic Typedefs, , Particular Typedefs, Typedefs +@node Generic Typedefs, , Particular Typedefs, Typedefs @subsection Generic Typedef Checks This macro is used to check for typedefs not covered by the particular @@ -2560,8 +2652,8 @@ C (or C++) builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}. @end defmac -@node Compiler Characteristics, System Services, Typedefs, Existing Tests -@section Compiler Characteristics +@node C Compiler Characteristics, Fortran 77 Compiler Characteristics, Typedefs, Existing Tests +@section C Compiler Characteristics The following macros check for C compiler or machine architecture features. To check for characteristics not listed here, use @@ -2611,6 +2703,18 @@ If the C compiler supports the @code{long double} type, define that define @code{__STDC__} do not support @code{long double}. @end defmac +@defmac AC_C_STRINGIZE +@maindex C_STRINGIZE +@cvindex HAVE_STRINGIZE +If the C preprocessor supports the stringizing operator, define +@code{HAVE_STRINGIZE}. The stringizing operator is @samp{#} and is +found in macros such as this: + +@example +#define x(y) #y +@end example +@end defmac + @defmac AC_CHECK_SIZEOF (@var{type} @r{[}, @var{cross-size}@r{]}) @maindex CHECK_SIZEOF Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or @@ -2645,18 +2749,76 @@ If the C type @code{long int} is 64 bits wide, define @samp{AC_CHECK_SIZEOF(long)} instead. @end defmac -@node System Services, UNIX Variants, Compiler Characteristics, Existing Tests + +@node Fortran 77 Compiler Characteristics, System Services, C Compiler Characteristics, Existing Tests +@section Fortran 77 Compiler Characteristics + +The following macros check for Fortran 77 compiler characteristics. To +check for characteristics not listed here, use @code{AC_TRY_COMPILE} +(@pxref{Examining Syntax}) or @code{AC_TRY_RUN} (@pxref{Run Time}), +making sure to first set the current lanuage to Fortran 77 +@code{AC_LANG_FORTRAN77} (@pxref{Language Choice}). + +@defmac AC_F77_LIBRARY_LDFLAGS +@maindex F77_LIBRARY_LDFLAGS +@ovindex FLIBS +Determine the linker flags (e.g. @samp{-L} and @samp{-l}) for the +@dfn{Fortran 77 intrinsic and run-time libraries} that are required to +successfully link a Fortran 77 program or shared library. The output +variable @code{FLIBS} is set to these flags. + +This macro is intended to be used in those situations when it is +necessary to mix, e.g. C++ and Fortran 77 source code into a single +program or shared library (@pxref{Mixing Fortran 77 With C and C++, , , +automake, GNU Automake}). + +For example, if object files from a C++ and Fortran 77 compiler must be +linked together, then the C++ compiler/linker must be used for linking +(since special C++-ish things need to happen at link time like calling +global constructors, instantiating templates, enabling exception +support, etc.). + +However, the Fortran 77 intrinsic and run-time libraries must be linked +in as well, but the C++ compiler/linker doesn't know by default how to +add these Fortran 77 libraries. Hence, the macro +@code{AC_F77_LIBRARY_LDFLAGS} was created to determine these Fortran 77 +libraries. +@end defmac + + +@node System Services, UNIX Variants, Fortran 77 Compiler Characteristics, Existing Tests @section System Services The following macros check for operating system services or capabilities. -@defmac AC_SYS_INTERPRETER -@maindex SYS_INTERPRETER -Check whether the system supports starting scripts with a line of the -form @samp{#! /bin/csh} to select the interpreter to use for the script. -After running this macro, shell code in @code{configure.in} can check -the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes} -if the system supports @samp{#!}, @samp{no} if not. +@defmac AC_CYGWIN +@maindex CYGWIN +Checks for the Cygwin environment. If present, sets shell variable +@code{CYGWIN} to @samp{yes}. If not present, sets @code{CYGWIN} +to the empty string. +@end defmac + +@defmac AC_EXEEXT +@maindex EXEEXT +@ovindex EXEEXT +Defines substitute variable @code{EXEEXT} based on the output of the +compiler, after .c, .o, and .obj files have been excluded. Typically +set to empty string if Unix, @samp{.exe} or @samp{.EXE} if Win32. +@end defmac + +@defmac AC_OBJEXT +@maindex OBJEXT +@ovindex OBJEXT +Defines substitute variable @code{OBJEXT} based on the output of the +compiler, after .c files have been excluded. Typically +set to @samp{.o} if Unix, @samp{.obj} if Win32. +@end defmac + +@defmac AC_MINGW32 +@maindex MINGW32 +Checks for the MingW32 compiler environment. If present, sets shell +variable @code{MINGW32} to @samp{yes}. If not present, sets +@code{MINGW32} to the empty string. @end defmac @defmac AC_PATH_X @@ -2697,7 +2859,16 @@ found to the output variable @code{X_PRE_LIBS}. @c This is an incomplete kludge. Make a real way to do it. @c If you need to check for other X functions or libraries yourself, then @c after calling this macro, add the contents of @code{X_EXTRA_LIBS} to -@c @code{LIBS} temporarily, like this: +@c @code{LIBS} temporarily, like this: (FIXME - add example) +@end defmac + +@defmac AC_SYS_INTERPRETER +@maindex SYS_INTERPRETER +Check whether the system supports starting scripts with a line of the +form @samp{#! /bin/csh} to select the interpreter to use for the script. +After running this macro, shell code in @code{configure.in} can check +the shell variable @code{interpval}; it will be set to @samp{yes} +if the system supports @samp{#!}, @samp{no} if not. @end defmac @defmac AC_SYS_LONG_FILE_NAMES @@ -2714,7 +2885,7 @@ If the system automatically restarts a system call that is interrupted by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. @end defmac -@node UNIX Variants, , System Services, Existing Tests +@node UNIX Variants, , System Services, Existing Tests @section UNIX Variants The following macros check for certain operating systems that need @@ -2820,7 +2991,7 @@ software package, the best thing to do is encapsulate it in a new macro. * Language Choice:: Selecting which language to use for testing. @end menu -@node Examining Declarations, Examining Syntax, , Writing Tests +@node Examining Declarations, Examining Syntax, Writing Tests, Writing Tests @section Examining Declarations The macro @code{AC_TRY_CPP} is used to check whether particular header @@ -2883,22 +3054,31 @@ been called already. @node Examining Syntax, Examining Libraries, Examining Declarations, Writing Tests @section Examining Syntax -To check for a syntax feature of the C or C++ compiler, such as whether -it recognizes a certain keyword, use @code{AC_TRY_COMPILE} to try to -compile a small program that uses that feature. You can also use it to -check for structures and structure members that are not present on all -systems. +To check for a syntax feature of the C, C++ or Fortran 77 compiler, such +as whether it recognizes a certain keyword, use @code{AC_TRY_COMPILE} to +try to compile a small program that uses that feature. You can also use +it to check for structures and structure members that are not present on +all systems. @defmac AC_TRY_COMPILE (@var{includes}, @var{function-body}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) @maindex TRY_COMPILE -Create a test C program to see whether a function whose body consists of -@var{function-body} can be compiled; @var{includes} is any -@code{#include} statements needed by the code in @var{function-body}. +Create a C, C++ or Fortran 77 test program (depending on which language +is current, @pxref{Language Choice}), to see whether a function whose +body consists of @var{function-body} can be compiled. + +For C and C++, @var{includes} is any @code{#include} statements needed +by the code in @var{function-body} (@var{includes} will be ignored if +the currently selected language is Fortran 77). This macro also uses +@code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the currently +selected language, as well as @code{CPPFLAGS}, when compiling. If +Fortran 77 is the currently selected language then @code{FFLAGS} will be +used when compiling. + If the file compiles successfully, run shell commands -@var{action-if-found}, otherwise run @var{action-if-not-found}. This -macro uses @code{CFLAGS} or @code{CXXFLAGS}, and @code{CPPFLAGS}, when -compiling. It does not try to link; use @code{AC_TRY_LINK} if you need -to do that (@pxref{Examining Libraries}). +@var{action-if-found}, otherwise run @var{action-if-not-found}. + +This macro does not try to link; use @code{AC_TRY_LINK} if you need to +do that (@pxref{Examining Libraries}). @end defmac @node Examining Libraries, Run Time, Examining Syntax, Writing Tests @@ -2925,28 +3105,55 @@ solve it by setting @code{LDFLAGS} in the environment to pass whatever options the linker needs (for example, @samp{-Wl,-dn} on MIPS RISC/OS). @code{AC_TRY_LINK} is used to compile test programs to test for -functions and global variables. It is also used (by -@code{AC_CHECK_LIB}) to check for libraries, by adding the library being +functions and global variables. It is also used by @code{AC_CHECK_LIB} +to check for libraries (@pxref{Libraries}), by adding the library being checked for to @code{LIBS} temporarily and trying to link a small program. @defmac AC_TRY_LINK (@var{includes}, @var{function-body}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) @maindex TRY_LINK -Create a test C program to see whether a function whose body consists of -@var{function-body} can be compiled and linked; @var{includes} is any -@code{#include} statements needed by the code in @var{function-body}. +Depending on the current language (@pxref{Language Choice}), create a +test program to see whether a function whose body consists of +@var{function-body} can be compiled and linked. + +For C and C++, @var{includes} is any @code{#include} statements needed +by the code in @var{function-body} (@var{includes} will be ignored if +the currently selected language is Fortran 77). This macro also uses +@code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the currently +selected language, as well as @code{CPPFLAGS}, when compiling. If +Fortran 77 is the currently selected language then @code{FFLAGS} will be +used when compiling. However, both @code{LDFLAGS} and @code{LIBS} will +be used during linking in all cases. + +If the file compiles and links successfully, run shell commands +@var{action-if-found}, otherwise run @var{action-if-not-found}. +@end defmac + +@defmac AC_TRY_LINK_FUNC (@var{function}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex TRY_LINK_FUNC +Depending on the current language (@pxref{Language Choice}), create a +test program to see whether a program whose body consists of +a prototype of and a call to @var{function} can be compiled and linked. + If the file compiles and links successfully, run shell commands -@var{action-if-found}, otherwise run @var{action-if-not-found}. This -macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS}, -@code{LDFLAGS}, and @code{LIBS} when compiling. +@var{action-if-found}, otherwise run @var{action-if-not-found}. +@end defmac + +@defmac AC_TRY_LINK_FUNC (@var{function}, @r{[}@var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]}) +@maindex TRY_LINK_FUNC +Attempt to compile and link a small program that links with +@var{function}. If the file compiles and links successfully, +run shell commands @var{action-if-found}, otherwise run +@var{action-if-not-found}. @end defmac @defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) @maindex COMPILE_CHECK -This is an obsolete version of @code{AC_TRY_LINK}, with the addition that it -prints @samp{checking for @var{echo-text}} to the standard output first, -if @var{echo-text} is non-empty. Use @code{AC_MSG_CHECKING} and -@code{AC_MSG_RESULT} instead to print messages (@pxref{Printing Messages}). +This is an obsolete version of @code{AC_TRY_LINK}, with the addition +that it prints @samp{checking for @var{echo-text}} to the standard +output first, if @var{echo-text} is non-empty. Use +@code{AC_MSG_CHECKING} and @code{AC_MSG_RESULT} instead to print +messages (@pxref{Printing Messages}). @end defmac @node Run Time, Portable Shell, Examining Libraries, Writing Tests @@ -2970,7 +3177,7 @@ package for cross-compiling. * Test Functions:: Avoiding pitfalls in test programs. @end menu -@node Test Programs, Guidelines, , Run Time +@node Test Programs, Guidelines, Run Time, Run Time @subsection Running Test Programs Use the following macro if you need to test run-time behavior of the @@ -3049,7 +3256,7 @@ that starts with @file{conftest}, such as @file{conftestdata}. The @code{configure} script cleans up by running @samp{rm -rf conftest*} after running test programs and if the script is interrupted. -@node Test Functions, , Guidelines, Run Time +@node Test Functions, , Guidelines, Run Time @subsection Test Functions Function declarations in test programs should have a prototype @@ -3200,7 +3407,7 @@ AC_MSG_RESULT($fstype) @end group @end example -@node Language Choice, , Multiple Cases, Writing Tests +@node Language Choice, , Multiple Cases, Writing Tests @section Language Choice Packages that use both C and C++ need to test features of both @@ -3224,21 +3431,30 @@ extension @file{.C} for test programs. Set the shell variable it has been run, empty otherwise. @end defmac +@defmac AC_LANG_FORTRAN77 +@maindex LANG_FORTRAN77 +Do compilation tests using @code{F77} and use extension @file{.f} for +test programs. Set the shell variable @code{cross_compiling} to the +value computed by @code{AC_PROG_F77} if it has been run, empty +otherwise. +@end defmac + @defmac AC_LANG_SAVE @maindex LANG_SAVE -Remember the current language (as set by @code{AC_LANG_C} or -@code{AC_LANG_CPLUSPLUS}) on a stack. Does not change which language is -current. Use this macro and @code{AC_LANG_RESTORE} in macros that need -to temporarily switch to a particular language. +Remember the current language (as set by @code{AC_LANG_C}, +@code{AC_LANG_CPLUSPLUS} or @code{AC_LANG_FORTRAN77}) on a stack. Does +not change which language is current. Use this macro and +@code{AC_LANG_RESTORE} in macros that need to temporarily switch to a +particular language. @end defmac @defmac AC_LANG_RESTORE @maindex LANG_RESTORE Select the language that is saved on the top of the stack, as set by @code{AC_LANG_SAVE}, and remove it from the stack. This macro is -equivalent to either @code{AC_LANG_C} or @code{AC_LANG_CPLUSPLUS}, -whichever had been run most recently when @code{AC_LANG_SAVE} was last -called. +equivalent to either @code{AC_LANG_C}, @code{AC_LANG_CPLUSPLUS} or +@code{AC_LANG_FORTRAN77}, whichever had been run most recently when +@code{AC_LANG_SAVE} was last called. Do not call this macro more times than @code{AC_LANG_SAVE}. @end defmac @@ -3267,7 +3483,7 @@ print a message letting the user know the result of the test. * Printing Messages:: Notifying users of progress or problems. @end menu -@node Defining Symbols, Setting Output Variables, , Results +@node Defining Symbols, Setting Output Variables, Results, Results @section Defining C Preprocessor Symbols A common action to take in response to a feature test is to define a C @@ -3295,7 +3511,7 @@ correct values into @code{#define} statements in a template file. @xref{Configuration Headers}, for more information about this kind of output. -@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]}) +@defmac AC_DEFINE (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]}) @maindex DEFINE Define C preprocessor variable @var{variable}. If @var{value} is given, set @var{variable} to that value (verbatim), otherwise set it to 1. @@ -3304,16 +3520,19 @@ using @code{AC_CONFIG_HEADER} it should not contain any @samp{#} characters, as @code{make} tends to eat them. To use a shell variable (which you need to do in order to define a value containing the @code{m4} quote characters @samp{[} or @samp{]}), use -@code{AC_DEFINE_UNQUOTED} instead. The following example defines the C -preprocessor variable @code{EQUATION} to be the string constant -@samp{"$a > $b"}: +@code{AC_DEFINE_UNQUOTED} instead. @var{description} is only useful if +you are using @code{AC_CONFIG_HEADER}. In this case, @var{description} +is put into the generated @file{config.h.in} as the comment before the +macro define; the macro need not be mentioned in @file{acconfig.h}. The +following example defines the C preprocessor variable @code{EQUATION} to +be the string constant @samp{"$a > $b"}: @example AC_DEFINE(EQUATION, "$a > $b") @end example @end defmac -@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]}) +@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]}) @maindex DEFINE_UNQUOTED Like @code{AC_DEFINE}, but three shell expansions are performed---once---on @var{variable} and @var{value}: variable expansion @@ -3444,12 +3663,26 @@ common way to use these macros. It calls @code{AC_MSG_CHECKING} for @var{commands} arguments, and @code{AC_MSG_RESULT} with @var{cache-id}. @end defmac +@defmac AC_CACHE_LOAD +@maindex CACHE_LOAD +Loads values from existing cache file, or creates a new cache file if +a cache file is not found. Called automatically from @code{AC_INIT}. +@end defmac + +@defmac AC_CACHE_SAVE +@maindex CACHE_SAVE +Flushes all cached values to the cache file. Called automatically +from @code{AC_OUTPUT}, but it can be quite useful to call +@code{AC_CACHE_SAVE} at key points in configure.in. Doing so +checkpoints the cache in case of an early configure script abort. +@end defmac + @menu * Cache Variable Names:: Shell variables used in caches. * Cache Files:: Files @code{configure} uses for caching. @end menu -@node Cache Variable Names, Cache Files, , Caching Results +@node Cache Variable Names, Cache Files, Caching Results, Caching Results @subsection Cache Variable Names The names of cache variables should have the following format: @@ -3491,7 +3724,7 @@ 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 +@node Cache Files, , Cache Variable Names, Caching Results @subsection Cache Files A cache file is a shell script that caches the results of configure @@ -3535,7 +3768,32 @@ site-wide cache file to use instead of the default, to make it work transparently, as long as the same C compiler is used every time (@pxref{Site Defaults}). -@node Printing Messages, , Caching Results, Results +If your configure script, or a macro called from configure.in, happens to +abort the configure process, it may be useful to checkpoint the cache a +few times at key points. Doing so will reduce the amount of time it +takes to re-run the configure script with (hopefully) the error that +caused the previous abort corrected. + +@example +@r{ ... AC_INIT, etc. ...} +dnl checks for programs +AC_PROG_CC +AC_PROG_GCC_TRADITIONAL +@r{ ... more program checks ...} +AC_CACHE_SAVE + +dnl checks for libraries +AC_CHECK_LIB(nsl, gethostbyname) +AC_CHECK_LIB(socket, connect) +@r{ ... more lib checks ...} +AC_CACHE_SAVE + +dnl Might abort... +AM_PATH_GTK(1.0.2, , exit 1) +AM_PATH_GTKMM(0.9.5, , exit 1) +@end example + +@node Printing Messages, , Caching Results, Results @section Printing Messages @code{configure} scripts need to give users running them several kinds @@ -3636,10 +3894,10 @@ Here are some instructions and guidelines for writing Autoconf 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:: What to do when macros depend on other macros. @end menu -@node Macro Definitions, Macro Names, , Writing Macros +@node Macro Definitions, Macro Names, Writing Macros, Writing Macros @section Macro Definitions @maindex DEFUN @@ -3775,7 +4033,7 @@ this happens, the resulting @code{configure} script will contain unexpanded macros. The @code{autoconf} program checks for this problem by doing @samp{grep AC_ configure}. -@node Dependencies Between Macros, , Quoting, Writing Macros +@node Dependencies Between Macros, , Quoting, Writing Macros @section Dependencies Between Macros Some Autoconf macros depend on other macros having been called first in @@ -3789,7 +4047,7 @@ called in an order that might cause incorrect operation. * Obsolete Macros:: Warning about old ways of doing things. @end menu -@node Prerequisite Macros, Suggested Ordering, , Dependencies Between Macros +@node Prerequisite Macros, Suggested Ordering, Dependencies Between Macros, Dependencies Between Macros @subsection Prerequisite Macros A macro that you write might need to use values that have previously @@ -3865,7 +4123,7 @@ macro @var{called-macro-name} must have been defined using that it has been called. @end defmac -@node Obsolete Macros, , Suggested Ordering, Dependencies Between Macros +@node Obsolete Macros, , Suggested Ordering, Dependencies Between Macros @subsection Obsolete Macros Configuration and portability technology has evolved over the years. @@ -3909,7 +4167,7 @@ Autoconf provides a uniform method for handling unguessable features. * Using System Type:: What to do with the system type. @end menu -@node Specifying Names, Canonicalizing, , Manual Configuration +@node Specifying Names, Canonicalizing, Manual Configuration, Manual Configuration @section Specifying the System Type Like other GNU @code{configure} scripts, Autoconf-generated @@ -3990,6 +4248,13 @@ host type. This is all that is needed for programs that are not part of a compiler toolchain. @end defmac +@defmac AC_VALIDATE_CACHED_SYSTEM_TUPLE (@var{cmd}) +@maindex VALIDATE_CACHED_SYSTEM_TUPLE +If the cache file is inconsistent with the current host, +target and build system types, execute @var{cmd} or print a default +error message. +@end defmac + @node System Type Variables, Using System Type, Canonicalizing, Manual Configuration @section System Type Variables @@ -4026,7 +4291,7 @@ the names the user specified, or the canonical names if the individual parts of the canonical names (for convenience). @end table -@node Using System Type, , System Type Variables, Manual Configuration +@node Using System Type, , System Type Variables, Manual Configuration @section Using the System Type How do you use a canonical system type? Usually, you use it in one or @@ -4084,7 +4349,7 @@ options. * Site Defaults:: Giving @code{configure} local defaults. @end menu -@node External Software, Package Options, , Site Configuration +@node External Software, Package Options, Site Configuration, Site Configuration @section Working With External Software Some packages require, or can optionally use, other software packages @@ -4268,7 +4533,7 @@ is used as a prefix. Otherwise, no program name transformation is done. * Transformation Rules:: @file{Makefile} uses of transforming names. @end menu -@node Transformation Options, Transformation Examples, , Transforming Names +@node Transformation Options, Transformation Examples, Transforming Names, Transforming Names @subsection Transformation Options You can specify name transformations by giving @code{configure} these @@ -4319,7 +4584,7 @@ Autoconf version 2 using @samp{--program-suffix=2} to install the programs as @file{/usr/local/bin/autoconf2}, @file{/usr/local/bin/autoheader2}, etc. -@node Transformation Rules, , Transformation Examples, Transforming Names +@node Transformation Rules, , Transformation Examples, Transforming Names @subsection Transformation Rules Here is how to use the variable @code{program_transform_name} in a @@ -4360,7 +4625,7 @@ conflict with system documentation. As a compromise, it is probably best to do name transformations on @code{man} pages but not on Texinfo manuals. -@node Site Defaults, , Transforming Names, Site Configuration +@node Site Defaults, , Transforming Names, Site Configuration @section Setting Site Defaults Autoconf-generated @code{configure} scripts allow your site to provide @@ -4558,7 +4823,7 @@ are addressed. * Why Not Imake:: Why GNU uses @code{configure} instead of Imake. @end menu -@node Distributing, Why GNU m4, , Questions +@node Distributing, Why GNU m4, Questions, Questions @section Distributing @code{configure} Scripts @display @@ -4623,7 +4888,7 @@ in order to run the script and install GNU @code{m4}. Autoconf is only required if you want to change the @code{m4} @code{configure} script, which few people have to do (mainly its maintainer). -@node Why Not Imake, , Bootstrapping, Questions +@node Why Not Imake, , Bootstrapping, Questions @section Why Not Imake? @display @@ -4746,7 +5011,7 @@ freeze its internal state in a file that it can read back quickly. * Changed Macro Writing:: Better ways to write your own macros. @end menu -@node Changed File Names, Changed Makefiles, , Upgrading +@node Changed File Names, Changed Makefiles, Upgrading, Upgrading @section Changed File Names If you have an @file{aclocal.m4} installed with Autoconf (as opposed to @@ -4921,7 +5186,7 @@ though for backward compatibility some use the empty string instead. If you were relying on a shell variable being set to something like 1 or @samp{t} for true, you need to change your tests. -@node Changed Macro Writing, , Changed Results, Upgrading +@node Changed Macro Writing, , Changed Results, Upgrading @section Changed Macro Writing When defining your own macros, you should now use @code{AC_DEFUN} @@ -4964,7 +5229,7 @@ then let there be light@dots{} * Deuteronomy:: Approaching the promises of easy configuration. @end menu -@node Genesis, Exodus, , History +@node Genesis, Exodus, History, History @section Genesis In June 1991 I was maintaining many of the GNU utilities for the Free @@ -5113,7 +5378,7 @@ improved the quoting protection in @code{AC_DEFINE} and fixed many bugs, especially when I got sick of dealing with portability problems from February through June, 1993. -@node Deuteronomy, , Numbers, History +@node Deuteronomy, , Numbers, History @section Deuteronomy A long wish list for major features had accumulated, and the effect of @@ -5394,7 +5659,7 @@ use these names in @code{#if} directives. @printindex cv -@node Macro Index, , Preprocessor Symbol Index, Top +@node Macro Index, , Preprocessor Symbol Index, Top @unnumbered Macro Index This is an alphabetical list of the Autoconf macros. To make the list diff --git a/src/util/autoconf/autoheader.m4 b/src/util/autoconf/autoheader.m4 index 41fe94e05..cb411b0fb 100644 --- a/src/util/autoconf/autoheader.m4 +++ b/src/util/autoconf/autoheader.m4 @@ -90,9 +90,21 @@ define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl ]) define([AC_DEFINE], [# +ifelse([$3],,[# @@@syms="$syms $1"@@@ -]) +], [# +@@@verbatim="$verbatim +/* $3 */ +#undef $1 +"@@@ +])]) define([AC_DEFINE_UNQUOTED], [# +ifelse([$3],,[# @@@syms="$syms $1"@@@ -]) +], [# +@@@verbatim="$verbatim +/* $3 */ +#undef $1 +"@@@ +])]) diff --git a/src/util/autoconf/autoheader.sh b/src/util/autoconf/autoheader.sh index 92f9d63c8..196c16df6 100644 --- a/src/util/autoconf/autoheader.sh +++ b/src/util/autoconf/autoheader.sh @@ -1,6 +1,6 @@ -#! /bin/sh +#! @SHELL@ # autoheader -- create `config.h.in' from `configure.in' -# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1996, 1998 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 @@ -241,6 +241,10 @@ if test -n "$libs"; then done fi +if test -n "$verbatim"; then + echo "$verbatim" +fi + # Handle the case where @BOTTOM@ is the first line of acconfig.h. test -r $localdir/acconfig.h && grep @BOTTOM@ $localdir/acconfig.h >/dev/null && diff --git a/src/util/autoconf/autoreconf.sh b/src/util/autoconf/autoreconf.sh index a91d26c7c..99770bbf2 100644 --- a/src/util/autoconf/autoreconf.sh +++ b/src/util/autoconf/autoreconf.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! @SHELL@ # autoreconf - remake all Autoconf configure scripts in a directory tree # Copyright (C) 1994 Free Software Foundation, Inc. @@ -19,12 +19,15 @@ usage="\ Usage: autoreconf [-f] [-h] [--help] [-m dir] [--macrodir=dir] - [-l dir] [--localdir=dir] [--force] [--verbose] [--version]" + [-l dir] [--localdir=dir] [--force] [--verbose] [--version] + [--cygnus] [--foreign] [--gnits] [--gnu] [-i] [--include-deps]" localdir= verbose=no show_version=no force=no +automake_mode=--gnu +automake_deps= test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ @@ -54,6 +57,10 @@ while test $# -gt 0; do force=yes; shift ;; --version | --vers*) show_version=yes; shift ;; + --cygnus | --foreign | --gnits | --gnu) + automake_mode=$1; shift ;; + --include-deps | -i) + automake_deps=$1; shift ;; --) # Stop option processing. shift; break ;; -*) echo "$usage" 1>&2; exit 1 ;; @@ -111,6 +118,45 @@ while read dir; do aclocal=$dots$localdir/aclocal.m4 ;; esac + # Regenerate aclocal.m4 if necessary. FIXME: if aclocal searches + # nonstandard directories, we need to deal with that here. The + # easiest way is to move this info into configure.in. + run_aclocal=no + if test -f "$aclocal" && + grep 'generated automatically by aclocal' $aclocal > /dev/null + then + run_aclocal=yes + else + if test -f `echo $aclocal | sed 's,/*[^/]*$,,;s,^$,.,'`/acinclude.m4 + then + run_aclocal=yes + fi + fi + if test $run_aclocal = yes + then + if test $force = no && + ls -lt configure.in $aclocal \ + `echo $aclocal | sed 's,/*[^/]*$,,;s,^$,.,'`/acinclude.m4 | + sed 1q | + grep 'aclocal\.m4$' > /dev/null + then + : + else + test $verbose = yes && echo running aclocal in $dir, creating $aclocal + aclocal --output=$aclocal -I `echo $aclocal | sed 's,/*[^/]*$,,;s,^$,.,'` + fi + fi + + # Re-run automake if required. Assumes that there is a Makefile.am + # in the topmost directory. + if test -f Makefile.am + then + amforce= + test $force = no && amforce=--no-force + test $verbose = yes && echo running automake`test x"$amforce" = x || echo " ($amforce)"` in $dir + automake $amforce $automake_mode $automake_deps + fi + test ! -f $aclocal && aclocal= if test $force = no && test -f configure && @@ -123,30 +169,36 @@ while read dir; do $autoconf $macrodir_opt $localdir_opt fi - if grep AC_CONFIG_HEADER configure.in >/dev/null; then - template=`sed -n '/AC_CONFIG_HEADER/{ -s%[^#]*AC_CONFIG_HEADER(\([^)]*\).*%\1% -t here -: here -s%.*:%% -t colon -s%$%.in% -: colon -p -q -}' configure.in` - if test ! -f $template || grep autoheader $template >/dev/null; then + if grep 'A[CM]_CONFIG_HEADER' configure.in >/dev/null; then + templates=`sed -n '/A[CM]_CONFIG_HEADER/ { + s%[^#]*A[CM]_CONFIG_HEADER[ ]*(\([^)]*\).*%\1% + p + q + }' configure.in` + tcount=`set -- $templates; echo $#` + template=`set -- $templates; echo $1 | sed ' + s/.*:// + t colon + s/$/.in/ + : colon + s/:.*// + '` + stamp=`echo $template | sed 's,/*[^/]*$,,;s,^$,.,'`/stamp-h`test "$tcount" -gt 1 && echo "$tcount"`.in + if test ! -f "$template" || grep autoheader "$template" >/dev/null; then if test $force = no && test -f $template && - ls -lt $template configure.in $aclocal | sed 1q | - grep "$template$" > /dev/null + ls -lt $template configure.in $aclocal $stamp 2>/dev/null \ + `echo $localdir_opt | sed -e 's/--localdir=//' \ + -e '/./ s%$%/%'`acconfig.h | + sed 1q | egrep "$template$|$stamp$" > /dev/null then : else test $verbose = yes && echo running autoheader in $dir - $autoheader $macrodir_opt $localdir_opt + $autoheader $macrodir_opt $localdir_opt && + { test $verbose != yes || echo touching $stamp; } && + touch $stamp fi fi fi ) done - diff --git a/src/util/autoconf/autoupdate.sh b/src/util/autoconf/autoupdate.sh index 3c10b88eb..c92e0237a 100644 --- a/src/util/autoconf/autoupdate.sh +++ b/src/util/autoconf/autoupdate.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! @SHELL@ # autoupdate - modernize a configure.in # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/src/util/autoconf/config.guess b/src/util/autoconf/config.guess index e9e44559f..2960d6e0d 100644 --- a/src/util/autoconf/config.guess +++ b/src/util/autoconf/config.guess @@ -1,6 +1,6 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -52,11 +52,53 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` + cat <dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 @@ -68,12 +110,39 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) - echo m68k-cbm-openbsd${UNAME_RELEASE} - exit 0 ;; + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-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 @@ -84,6 +153,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -108,6 +180,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; @@ -115,23 +199,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) - echo m68k-atari-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) - echo m68k-sun-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) - echo m68k-apple-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; @@ -141,6 +234,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >dummy.c int main (argc, argv) int argc; char **argv; { @@ -234,7 +330,8 @@ EOF fi exit 0 ;; *:AIX:*:4) - if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -267,12 +364,44 @@ EOF hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; - 9000/[3478]??:HP-UX:*:*) + 9000/[34678]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` + rm -f dummy.c dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -375,8 +504,11 @@ EOF hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; - hp3[0-9][05]:OpenBSD:*:*) - echo m68k-hp-openbsd${UNAME_RELEASE} + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | *:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -391,52 +523,146 @@ EOF echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) - echo i386-pc-cygwin32 + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin32 + echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + # 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.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-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - 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-gnu ; exit 0 - elif test "${UNAME_MACHINE}" = "sparc" ; then - echo sparc-unknown-linux-gnu ; exit 0 + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy else - # 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}-pc-linux-gnuoldld" && exit 0 + # 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. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac # Determine whether the default compiler is a.out or elf cat >dummy.c < main(argc, argv) -int argc; -char *argv[]; + int argc; + char *argv[]; { #ifdef __ELF__ - printf ("%s-pc-linux-gnu\n", argv[1]); +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif #else - printf ("%s-pc-linux-gnuaout\n", argv[1]); + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } @@ -449,6 +675,14 @@ EOF i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} @@ -470,6 +704,18 @@ EOF echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; @@ -529,6 +775,10 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -541,17 +791,25 @@ EOF mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) 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 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/src/util/autoconf/config.sub b/src/util/autoconf/config.sub index 043252494..00bea6e6a 100644 --- a/src/util/autoconf/config.sub +++ b/src/util/autoconf/config.sub @@ -1,6 +1,6 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1991, 92-97, 1998 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. @@ -149,19 +149,20 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \ - | arme[lb] | pyramid \ - | 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 | sparclet | sparclite | sparc64) + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) 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) + i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -170,14 +171,18 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - 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-* \ - | 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-* | f301-*) + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -204,9 +209,9 @@ case $basic_machine in amiga | amiga-*) basic_machine=m68k-cbm ;; - amigados) + amigaos | amigados) basic_machine=m68k-cbm - os=-amigados + os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm @@ -345,19 +350,19 @@ case $basic_machine in os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[3456]86v32) + i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[3456]86v4*) + i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[3456]86v) + i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[3456]86sol2) + i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -389,6 +394,14 @@ case $basic_machine in miniframe) basic_machine=m68000-convergent ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -456,25 +469,23 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5) - basic_machine=i586-intel + pentium | p5 | k5 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc ;; - pentiumpro | p6) - basic_machine=i686-intel + pentiumii | pentium2) + basic_machine=i786-pc ;; - pentium-* | p5-*) + pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-*) + pentiumpro-* | p6-* | k6-* | 6x86-*) 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 - ;; - nexen) - # We don't have specific support for Nexgen yet, so just call it a Pentium - basic_machine=i586-nexgen + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -558,6 +569,12 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -577,7 +594,7 @@ case $basic_machine in basic_machine=vax-dec os=-vms ;; - vpp*|vx|vx-*) + vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) @@ -607,7 +624,11 @@ case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) - basic_machine=mips-mips + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi ;; romp) basic_machine=romp-ibm @@ -668,9 +689,12 @@ case $os in -solaris) os=-solaris2 ;; - -unixware* | svr4*) + -svr4*) os=-sysv4 ;; + -unixware*) + os=-sysv4.2uw + ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; @@ -681,15 +705,16 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ + | -amigaos* | -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* | -ieee* | -go32* | -aux* \ - | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -linux-gnu* | -uxpv*) + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) @@ -802,6 +827,9 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + *-be) + os=-beos + ;; *-ibm) os=-aix ;; @@ -815,7 +843,7 @@ case $basic_machine in os=-sysv ;; *-cbm) - os=-amigados + os=-amigaos ;; *-dg) os=-dgux diff --git a/src/util/autoconf/ifnames.sh b/src/util/autoconf/ifnames.sh index 0923deef7..cb0158bac 100644 --- a/src/util/autoconf/ifnames.sh +++ b/src/util/autoconf/ifnames.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! @SHELL@ # ifnames - print the identifiers used in C preprocessor conditionals # Copyright (C) 1994, 1995 Free Software Foundation, Inc. diff --git a/src/util/autoconf/install-sh b/src/util/autoconf/install-sh index ebc66913e..e9de23842 100644 --- a/src/util/autoconf/install-sh +++ b/src/util/autoconf/install-sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). @@ -118,6 +118,7 @@ if [ x"$dir_arg" != x ]; then if [ -d $dst ]; then instcmd=: + chmodcmd="" else instcmd=mkdir fi diff --git a/src/util/autoconf/make-stds.texi b/src/util/autoconf/make-stds.texi index e7c9cf982..41fb2123f 100644 --- a/src/util/autoconf/make-stds.texi +++ b/src/util/autoconf/make-stds.texi @@ -209,11 +209,12 @@ 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 @samp{FLAGS} to the program-name variable name to get the options variable name---for -example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to -this rule, but we keep it because it is standard.) Use @code{CPPFLAGS} -in any compilation command that runs the preprocessor, and use -@code{LDFLAGS} in any compilation command that does linking as well as -in any direct use of @code{ld}. +example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C +compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are +exceptions to this rule, but we keep them because they are standard.) +Use @code{CPPFLAGS} in any compilation command that runs the +preprocessor, and use @code{LDFLAGS} in any compilation command that +does linking as well as in any direct use of @code{ld}. If there are C compiler options that @emph{must} be used for proper compilation of certain files, do not include them in @code{CFLAGS}. @@ -239,6 +240,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables containing compiler options, so the user can use @code{CFLAGS} to override the others. +@code{CFLAGS} should be used in every invocation of the C compiler, +both those which do compilation and those which do linking. + Every Makefile should define the variable @code{INSTALL}, which is the basic command for installing a file into the system. @@ -355,14 +359,11 @@ files. This directory should normally be @file{/usr/local/etc}, but write it as @file{$(prefix)/etc}. (If you are using Autoconf, write it as @samp{@@sysconfdir@@}.) -@c rewritten to avoid overfull hbox --tower -Do not install executables -@c here -in this directory (they probably -belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not -install files that are modified in the normal course of their use -(programs whose purpose is to change the configuration of the system -excluded). Those probably belong in @file{$(localstatedir)}. +Do not install executables here in this directory (they probably belong +in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install +files that are modified in the normal course of their use (programs +whose purpose is to change the configuration of the system excluded). +Those probably belong in @file{$(localstatedir)}. @item sharedstatedir The directory for installing architecture-independent data files which @@ -415,7 +416,7 @@ should normally be @file{/usr/local/include}, but write it as @file{$(prefix)/include}. (If you are using Autoconf, write it as @samp{@@includedir@@}.) -Most compilers other than GCC do not look for header files in +Most compilers other than GCC do not look for header files in directory @file{/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 diff --git a/src/util/autoconf/mkinstalldirs b/src/util/autoconf/mkinstalldirs index d0fd194fd..6b3b5fc5d 100644 --- a/src/util/autoconf/mkinstalldirs +++ b/src/util/autoconf/mkinstalldirs @@ -22,7 +22,7 @@ do esac if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 + echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? diff --git a/src/util/autoconf/standards.info b/src/util/autoconf/standards.info index b021a4c99..1b111f95d 100644 --- a/src/util/autoconf/standards.info +++ b/src/util/autoconf/standards.info @@ -1,12 +1,12 @@ -This is Info file standards.info, produced by Makeinfo-1.64 from the -input file ./standards.texi. +This is Info file standards.info, produced by Makeinfo version 1.67 +from the input file /home/bje/autoconf-2.13/standards.texi. START-INFO-DIR-ENTRY * Standards: (standards). GNU coding standards. END-INFO-DIR-ENTRY - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996 Free -Software Foundation, Inc. + GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996, +1997, 1998 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 @@ -28,16 +28,16 @@ File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) Version ******* - Last updated 9 September 1996. + Last updated August 26, 1998. * Menu: -* Preface:: About the GNU Coding Standards +* Preface:: About the GNU Coding Standards * Intellectual Property:: Keeping Free Software Free * Design Advice:: General Program Design * Program Behavior:: Program Behavior for All Programs * Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs +* Documentation:: Documenting Programs * Managing Releases:: The Release Process  @@ -54,14 +54,14 @@ 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. + Corrections or suggestions for this document should be sent to +. 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 9 -September 1996. + This release of the GNU Coding Standards was last updated August 26, +1998.  File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top @@ -74,8 +74,8 @@ unencumbered. * Menu: -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions  File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Intellectual Property @@ -126,14 +126,18 @@ 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 + So, before adding in any contributions from other people, please 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 changes, we -need legal papers for it. +need legal papers for that change. + + This also applies to comments and documentation files. For copyright +law, comments and code are just text. Copyright applies to all kinds of +text, so we need legal papers for all kinds. 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 @@ -150,6 +154,10 @@ that code out again! contributor. We could be very embarrassed in court some day as a result. + We have more detailed advice for maintainers of programs; if you have +reached the stage of actually maintaining a program for GNU (whether +released or not), please ask us for a copy. +  File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Intellectual Property, Up: Top @@ -161,10 +169,10 @@ when designing your program. * Menu: -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features +* Compatibility:: Compatibility with other implementations +* Using Extensions:: Using non-standard features * ANSI C:: Using ANSI C features -* Source Language:: Using languages other than C +* Source Language:: Using languages other than C  File: standards.info, Node: Compatibility, Next: Using Extensions, Up: Design Advice @@ -198,8 +206,6 @@ completely with something totally different and better. (For example, 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: Using Extensions, Next: ANSI C, Prev: Compatibility, Up: Design Advice @@ -284,13 +290,16 @@ 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. +compiler for that other language in order to build your program. For +example, if you write your program in C++, people will have to install +the C++ compiler in order to compile your program. Thus, it is better +if you write in C. - There are three exceptions for this rule: + But there are three situations when there is no disadvantage in using +some other language: - * It is okay to use a special language if the same program contains - an interpreter for that language. + * It is okay to use another language if your program contains an + interpreter for that language. For example, if your program links with GUILE, it is ok to write part of the program in Scheme or another language supported by @@ -302,10 +311,14 @@ please write in C. 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 + * If an application is of interest to a narrow community, then perhaps it's not important if the application is inconvenient to install. + C has one other advantage over C++ and other compiled languages: more +people know C, so more people will find it easy to read and modify the +program if it is written in C. +  File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top @@ -318,10 +331,10 @@ how libraries should behave. * Menu: -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards for command line interfaces +* Semantics:: Writing robust programs +* 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 @@ -383,9 +396,16 @@ 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. + The preferred signal handling facilities are the BSD variant of +`signal', and the POSIX `sigaction' function; the alternative USG +`signal' interface is an inferior design. + + Nowadays, using the POSIX signal functions may be the easiest way to +make a program portable. If you use `signal', then on GNU/Linux +systems running GNU libc version 1, you should include `bsd/signal.h' +instead of `signal.h', so as to get BSD behavior. It is up to you +whether to support systems where `signal' has only the USG behavior, or +give up on them. In error checks that detect "impossible" conditions, just abort. There is usually no point in printing any message. These checks @@ -488,7 +508,9 @@ 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. +to save someone from typing an option now and then. (Variation in error +message syntax when using a terminal is ok, because that is a side issue +that people do not depend on.) 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 @@ -566,10 +588,10 @@ among GNU utilities, and fewer idiosyncracies for users to remember. 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. + Please do not mention all of 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 @@ -588,10 +610,12 @@ among GNU utilities, and fewer idiosyncracies for users to remember. GNU Emacs 19.34.5 Copyright (C) 1996 Free Software Foundation, Inc. - GNU Emacs comes with NO WARRANTY, to the extent permitted by law. + 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. + 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 @@ -624,8 +648,8 @@ 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 `gnu@prep.ai.mit.edu' a list of them, with their meanings, -so we can update the table. +please send a list of them, with their meanings, so we +can update the table. `after-date' `-N' in `tar'. @@ -675,6 +699,9 @@ so we can update the table. `avoid-wraps' `-n' in `wdiff'. +`background' + For server programs, run in the background. + `backward-search' `-B' in `ctags'. @@ -925,6 +952,10 @@ so we can update the table. `force-prefix' `-F' in `shar'. +`foreground' + For server programs, run in the foreground; in other words, don't + do anything special to run the server in the background. + `format' Used in `ls', `time', and `ptx'. @@ -1097,7 +1128,7 @@ so we can update the table. `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'. + check to see if any actually do, and tell . `macro-name' `-M' in `ptx'. @@ -1485,6 +1516,12 @@ so we can update the table. `size' `-s' in `ls'. +`socket' + Specify a file descriptor for a network server to use for its + socket, instead of opening and binding a new socket. This + provides a way to run, in a nonpriveledged process, a server that + normally needs a reserved port number. + `sort' Used in `ls'. @@ -1703,14 +1740,15 @@ writing GNU software. * Menu: -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* System Portability:: Portability between different operating systems +* Formatting:: Formatting Your Source Code +* Comments:: Commenting Your Work +* Syntactic Conventions:: Clean Use of C Constructs +* Names:: Naming Variables and Functions +* 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 +* Mmap:: How you can safely use `mmap'.  File: standards.info, Node: Formatting, Next: Comments, Up: Writing C @@ -1823,6 +1861,13 @@ 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 write the comments in a GNU program in English, because +English is the one language that nearly all programmers in all +countries can read. If you do not write English well, please write +comments in English as well as you can, then ask other people to help +rewrite them. If you can't write comments in English, please find +someone to work with you and translate your comments into English. + 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 @@ -1872,6 +1917,9 @@ sense* of the code that follows. For example: #else /* not foo */ ... #endif /* not foo */ + #ifdef foo + ... + #endif /* foo */ but, by contrast, write the comments this way for a `#ifndef': @@ -1880,6 +1928,9 @@ but, by contrast, write the comments this way for a `#ifndef': #else /* foo */ ... #endif /* foo */ + #ifndef foo + ... + #endif /* not foo */  File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C @@ -1992,6 +2043,15 @@ File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Naming Variables and Functions ============================== + The names of global variables and functions in a program serve as +comments of a sort. So don't choose terse names--instead, look for +names that give useful information about the meaning of the variable or +function. In a GNU program, names should be English, like other +comments. + + Local variable names can be shorter, because they are used only +within one context, where (presumably) comments explain their purpose. + 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 @@ -2125,6 +2185,10 @@ 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. + * `main' should be declared to return type `int'. It should + terminate either by calling `exit' or by returning the integer + status code; make sure it cannot ever return an undefined value. + * Don't declare system functions explicitly. Almost any declaration for a system function is wrong on some @@ -2219,7 +2283,7 @@ 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 +File: standards.info, Node: Internationalization, Next: Mmap, Prev: System Functions, Up: Writing C Internationalization ==================== @@ -2279,7 +2343,7 @@ independently: : gettext ("%d file processed")), nfiles); -This can any method of forming the plural of the word for "file", and +This can be any method of forming the plural of the word for "file", and also handles languages that require agreement in the word for "processed". @@ -2298,6 +2362,25 @@ calls does the job straightfowardly if the code starts out like this: ? "# Implicit rule search has been done.\n", : "# Implicit rule search has not been done.\n"); + +File: standards.info, Node: Mmap, Prev: Internationalization, Up: Writing C + +Mmap +==== + + Don't assume that `mmap' either works on all files or fails for all +files. It may work on some files and fail on others. + + The proper way to use `mmap' is to try it on the specific file for +which you want to use it--and if `mmap' doesn't work, fall back on +doing the job in another way using `read' and `write'. + + The reason this precaution is needed is that the GNU kernel (the +HURD) provides a user-extensible file system, in which there can be many +different kinds of "ordinary files." Many of them support `mmap', but +some do not. It is important to make programs handle all these kinds +of files. +  File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top @@ -2309,7 +2392,7 @@ Documenting Programs * GNU Manuals:: Writing proper manuals. * Manual Structure Details:: Specific structure conventions. * NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes +* Change Logs:: Recording Changes * Man Pages:: Man pages are secondary. * Reading other Manuals:: How far you can go in learning from other manuals. @@ -2325,11 +2408,39 @@ manual in the Texinfo formatting language. See the Texinfo manual, either the hardcopy, or the on-line version available through `info' or 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. + Programmers often find it most natural to structure the documentation +following the structure of the implementation, which they know. But +this structure is not necessarily good for explaining how to use the +program; it may be irrelevant and confusing for a user. + + At every level, from the sentences in a paragraph to the grouping of +topics into separate manuals, the right way to structure documentation +is according to the concepts and questions that a user will have in mind +when reading it. Sometimes this structure of ideas matches the +structure of the implementation of the software being documented--but +often they are different. Often the most important part of learning to +write good documentation is learning to notice when you are structuring +the documentation like the implementation, and think about better +alternatives. + + For example, each program in the GNU system probably ought to be +documented in one manual; but this does not mean each program should +have its own manual. That would be following the structure of the +implementation, rather than the structure that helps the user +understand. + + Instead, each manual should cover a coherent *topic*. For example, +instead of a manual for `diff' and a manual for `diff3', we have one +manual for "comparison of files" which covers both of those programs, +as well as `cmp'. By documenting these programs together, we can make +the whole subject clearer. + + The manual which discusses a program 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 +questions that a user will ask when thinking about the job that the +program does. 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, @@ -2350,14 +2461,17 @@ 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. +documentation; most of them are terse, badly structured, and give +inadequate explanation of the underlying concepts. (There are, of +course exceptions.) Also Unix man pages use a particular format which +is different from what we use in GNU manuals. 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 +computer program. Please use "invalid" for this, and reserve the term "illegal" for violations of law.  @@ -2366,20 +2480,18 @@ File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: Manual Structure Details ======================== - The title page of the manual should state the version of the program -to which the manual applies. 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. + The title page of the manual should state the version of the +programs or packages documented in the manual. 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. + + Each program documented in the manual should should have a node named +`PROGRAM Invocation' or `Invoking 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 @@ -2636,9 +2748,9 @@ GNU software. * Menu: -* Configuration:: How Configuration Should Work +* Configuration:: How Configuration Should Work * Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases +* Releases:: Making Releases  File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases @@ -2736,8 +2848,8 @@ parts of the 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'. + Possible values of PACKAGE include `gnu-as' (or `gas'), `gnu-ld', + `gnu-libc', `gdb', `x', and `x-toolkit'. 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' @@ -2968,8 +3080,9 @@ 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 +example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler, +`YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule, +but we keep them because they are 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'. @@ -2996,6 +3109,9 @@ value of `CFLAGS' as well. containing compiler options, so the user can use `CFLAGS' to override the others. + `CFLAGS' should be used in every invocation of the C compiler, both +those which do compilation and those which do linking. + Every Makefile should define the variable `INSTALL', which is the basic command for installing a file into the system. @@ -3103,9 +3219,9 @@ directories: `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are using Autoconf, write it as `@sysconfdir@'.) - 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 + Do not install executables here 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)'. @@ -3158,12 +3274,12 @@ directories: `@includedir@'.) 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'. + directory `/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 @@ -3605,9 +3721,9 @@ File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managin 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'. + Package the distribution of `Foo version 69.96' up in a gzipped tar +file with the name `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 @@ -3669,52 +3785,53 @@ know what other files to get.  Tag Table: -Node: Top968 -Node: Preface1482 -Node: Intellectual Property2525 -Node: Reading Non-Free Code2881 -Node: Contributions4613 -Node: Design Advice6211 -Node: Compatibility6694 -Node: Using Extensions8338 -Node: ANSI C9840 -Node: Source Language11076 -Node: Program Behavior12210 -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 +Node: Top1010 +Node: Preface1554 +Node: Intellectual Property2582 +Node: Reading Non-Free Code2957 +Node: Contributions4689 +Node: Design Advice6683 +Node: Compatibility7200 +Node: Using Extensions8711 +Node: ANSI C10213 +Node: Source Language11449 +Node: Program Behavior12942 +Node: Semantics13651 +Node: Libraries17801 +Node: Errors19036 +Node: User Interfaces20259 +Node: Option Table27131 +Node: Memory Usage41686 +Node: Writing C42680 +Node: Formatting43519 +Node: Comments46791 +Node: Syntactic Conventions50089 +Node: Names53027 +Node: System Portability54763 +Node: CPU Portability56539 +Node: System Functions58700 +Node: Internationalization63804 +Node: Mmap66952 +Node: Documentation67657 +Node: GNU Manuals68215 +Node: Manual Structure Details72102 +Node: NEWS File73432 +Node: Change Logs74113 +Node: Change Log Concepts74830 +Node: Style of Change Logs76598 +Node: Simple Changes78152 +Node: Conditional Changes79343 +Node: Man Pages80720 +Node: Reading other Manuals82339 +Node: Managing Releases83123 +Node: Configuration83859 +Node: Makefile Conventions90799 +Node: Makefile Basics91479 +Node: Utilities in Makefiles94648 +Node: Command Variables96784 +Node: Directory Variables99812 +Node: Standard Targets110394 +Node: Install Command Categories120895 +Node: Releases125468  End Tag Table diff --git a/src/util/autoconf/standards.texi b/src/util/autoconf/standards.texi index fe8ebb766..6cb685de3 100644 --- a/src/util/autoconf/standards.texi +++ b/src/util/autoconf/standards.texi @@ -2,8 +2,8 @@ @c %**start of header @setfilename standards.info @settitle GNU Coding Standards -@c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES! -@set lastupdate 9 September 1996 +@c This date is automagically updated when you save this file: +@set lastupdate August 26, 1998 @c %**end of header @ifinfo @@ -28,7 +28,7 @@ END-INFO-DIR-ENTRY @ifinfo GNU Coding Standards -Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -59,7 +59,7 @@ by the Free Software Foundation. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -84,12 +84,12 @@ Last updated @value{lastupdate}. @end ifinfo @menu -* Preface:: About the GNU Coding Standards +* Preface:: About the GNU Coding Standards * Intellectual Property:: Keeping Free Software Free * Design Advice:: General Program Design * Program Behavior:: Program Behavior for All Programs * Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs +* Documentation:: Documenting Programs * Managing Releases:: The Release Process @end menu @@ -104,8 +104,8 @@ programs written in C, but many of the rules and principles are useful even if you write in another programming language. The rules often state reasons for writing in a certain way. -Corrections or suggestions regarding this document should be sent to -@code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a +Corrections or suggestions for this document should be sent to +@email{gnu@@gnu.org}. If you make a suggestion, please include a suggested new wording for it; our time is limited. We prefer a context diff to the @file{standards.texi} or @file{make-stds.texi} files, but if you don't have those files, please mail your suggestion anyway. @@ -120,8 +120,8 @@ This @value{CHAPTER} discusses how you can make sure that GNU software remains unencumbered. @menu -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions @end menu @node Reading Non-Free Code @@ -168,14 +168,18 @@ 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 +So, before adding in any contributions from other people, please 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 changes, we -need legal papers for it. +need legal papers for that change. + +This also applies to comments and documentation files. For copyright +law, comments and code are just text. Copyright applies to all kinds of +text, so we need legal papers for all kinds. 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 @@ -192,6 +196,10 @@ 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. +We have more detailed advice for maintainers of programs; if you have +reached the stage of actually maintaining a program for GNU (whether +released or not), please ask us for a copy. + @node Design Advice @chapter General Program Design @@ -199,10 +207,10 @@ This @value{CHAPTER} discusses some of the issues you should take into account when designing your program. @menu -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features +* Compatibility:: Compatibility with other implementations +* Using Extensions:: Using non-standard features * ANSI C:: Using ANSI C features -* Source Language:: Using languages other than C +* Source Language:: Using languages other than C @end menu @node Compatibility @@ -211,20 +219,20 @@ account when designing your program. With occasional exceptions, utility programs and libraries for GNU should be upward compatible with those in Berkeley Unix, and upward compatible with @sc{ansi} C if @sc{ansi} C specifies their behavior, and -upward compatible with @sc{POSIX} if @sc{POSIX} specifies their +upward compatible with @sc{posix} if @sc{posix} specifies their behavior. When these standards conflict, it is useful to offer compatibility modes for each of them. -@sc{ansi} C and @sc{POSIX} prohibit many kinds of extensions. Feel free +@sc{ansi} C and @sc{posix} prohibit many kinds of extensions. Feel free to make the extensions anyway, and include a @samp{--ansi}, @samp{--posix}, or @samp{--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 +Many GNU programs suppress extensions that conflict with @sc{posix} if the environment variable @code{POSIXLY_CORRECT} is defined (even if it is defined with a null value). Please make your program recognize this variable if appropriate. @@ -236,9 +244,6 @@ completely with something totally different and better. (For example, feature as well. (There is a free @code{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. @node Using Extensions @section Using Non-standard Features @@ -323,13 +328,16 @@ write in @sc{ansi} 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. +other language in order to build your program. For example, if you +write your program in C++, people will have to install the C++ compiler +in order to compile your program. Thus, it is better if you write in C. -There are three exceptions for this rule: +But there are three situations when there is no disadvantage in using +some other language: @itemize @bullet @item -It is okay to use a special language if the same program contains an +It is okay to use another language if your program contains an interpreter for that language. For example, if your program links with GUILE, it is ok to write part of @@ -343,10 +351,14 @@ This is okay because the only people who want to build the tool will be those who have installed the other language anyway. @item -If an application is not of extremely widespread interest, then perhaps +If an application is of interest to a narrow community, then perhaps it's not important if the application is inconvenient to install. @end itemize +C has one other advantage over C++ and other compiled languages: more +people know C, so more people will find it easy to read and modify the +program if it is written in C. + @node Program Behavior @chapter Program Behavior for All Programs @@ -355,10 +367,10 @@ describes general standards for error messages, the command line interface, and how libraries should behave. @menu -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards for command line interfaces +* Semantics:: Writing robust programs +* 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 @@ -418,9 +430,16 @@ are less likely to work compatibly. If you need to find all the files in a directory, use @code{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 -@sc{BSD} and of @sc{POSIX}. So GNU software should be written to use -these. +The preferred signal handling facilities are the BSD variant of +@code{signal}, and the @sc{posix} @code{sigaction} function; the +alternative USG @code{signal} interface is an inferior design. + +Nowadays, using the @sc{posix} signal functions may be the easiest way +to make a program portable. If you use @code{signal}, then on GNU/Linux +systems running GNU libc version 1, you should include +@file{bsd/signal.h} instead of @file{signal.h}, so as to get BSD +behavior. It is up to you whether to support systems where +@code{signal} has only the USG behavior, or give up on them. In error checks that detect ``impossible'' conditions, just abort. There is usually no point in printing any message. These checks @@ -521,8 +540,10 @@ 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. +important principle of the system's design; do not compromise it merely +to save someone from typing an option now and then. (Variation in error +message syntax when using a terminal is ok, because that is a side issue +that people do not depend on.) 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 @@ -538,11 +559,11 @@ output device type. For example, we provide a @code{dir} program much like @code{ls} except that its default output format is always multi-column format. -It is a good idea to follow the @sc{POSIX} guidelines for the +It is a good idea to follow the @sc{posix} guidelines for the command-line options of a program. The easiest way to do this is to use @code{getopt} to parse them. Note that the GNU version of @code{getopt} will normally permit options anywhere among the arguments unless the -special argument @samp{--} is used. This is not what @sc{POSIX} +special argument @samp{--} is used. This is not what @sc{posix} specifies; it is a GNU extension. Please define long-named options that are equivalent to the @@ -606,10 +627,10 @@ 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. +Please do not mention all of 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 @@ -628,10 +649,12 @@ 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. +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. +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 @@ -664,7 +687,7 @@ Report bugs to @var{mailing-address}. 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 +please send @email{gnu@@gnu.org} 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 @@ -724,6 +747,9 @@ and @code{unexpand}. @item avoid-wraps @samp{-n} in @code{wdiff}. +@item background +For server programs, run in the background. + @item backward-search @samp{-B} in @code{ctags}. @@ -980,6 +1006,11 @@ Used in @code{makeinfo}. @item force-prefix @samp{-F} in @code{shar}. +@item foreground +For server programs, run in the foreground; +in other words, don't do anything special to run the server +in the background. + @item format Used in @code{ls}, @code{time}, and @code{ptx}. @@ -1159,7 +1190,7 @@ Used in @code{su}. @item machine No listing of which programs already use this; someone should check to -see if any actually do and tell @code{gnu@@prep.ai.mit.edu}. +see if any actually do, and tell @email{gnu@@gnu.org}. @item macro-name @samp{-M} in @code{ptx}. @@ -1550,6 +1581,12 @@ Used in many programs to inhibit the usual output. @item size @samp{-s} in @code{ls}. +@item socket +Specify a file descriptor for a network server to use for its socket, +instead of opening and binding a new socket. This provides a way to +run, in a nonpriveledged process, a server that normally needs a +reserved port number. + @item sort Used in @code{ls}. @@ -1764,14 +1801,15 @@ This @value{CHAPTER} provides advice on how best to use the C language when writing GNU software. @menu -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* System Portability:: Portability between different operating systems +* Formatting:: Formatting Your Source Code +* Comments:: Commenting Your Work +* Syntactic Conventions:: Clean Use of C Constructs +* Names:: Naming Variables and Functions +* 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 +* Mmap:: How you can safely use @code{mmap}. @end menu @node Formatting @@ -1900,6 +1938,13 @@ page. The formfeeds should appear alone on lines by themselves. Every program should start with a comment saying briefly what it is for. Example: @samp{fmt - filter for simple filling of text}. +Please write the comments in a GNU program in English, because English +is the one language that nearly all programmers in all countries can +read. If you do not write English well, please write comments in +English as well as you can, then ask other people to help rewrite them. +If you can't write comments in English, please find someone to work with +you and translate your comments into English. + 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 @@ -1954,6 +1999,11 @@ its sense}. @samp{#else} should have a comment describing the condition @dots{} #endif /* not foo */ @end group +@group +#ifdef foo + @dots{} +#endif /* foo */ +@end group @end example @noindent @@ -1967,9 +2017,13 @@ but, by contrast, write the comments this way for a @samp{#ifndef}: @dots{} #endif /* foo */ @end group +@group +#ifndef foo + @dots{} +#endif /* not foo */ +@end group @end example - @node Syntactic Conventions @section Clean Use of C Constructs @@ -2100,6 +2154,15 @@ pointer constant, except when calling a varargs function. @node Names @section Naming Variables and Functions +The names of global variables and functions in a program serve as +comments of a sort. So don't choose terse names---instead, look for +names that give useful information about the meaning of the variable or +function. In a GNU program, names should be English, like other +comments. + +Local variable names can be shorter, because they are used only within +one context, where (presumably) comments explain their purpose. + 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 @code{enum} constants, and for name-prefixes @@ -2125,10 +2188,10 @@ When you want to define names with constant integer values, use constants. Use file names of 14 characters or less, to avoid creating gratuitous -problems on older System V systems. You can use the program @code{doschk} to test for -this. @code{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. +problems on older System V systems. You can use the program +@code{doschk} to test for this. @code{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. @node System Portability @section Portability between System Types @@ -2236,6 +2299,11 @@ functions to avoid unnecessary loss of portability. Don't use the value of @code{sprintf}. It returns the number of characters written on some systems, but not on all systems. +@item +@code{main} should be declared to return type @code{int}. It should +terminate either by calling @code{exit} or by returning the integer +status code; make sure it cannot ever return an undefined value. + @item Don't declare system functions explicitly. @@ -2411,7 +2479,7 @@ printf ((nfiles != 1 ? gettext ("%d files processed") @end example @noindent -This can any method of forming the plural of the word for ``file'', and +This can be any method of forming the plural of the word for ``file'', and also handles languages that require agreement in the word for ``processed''. @@ -2436,6 +2504,22 @@ printf (f->tried_implicit : "# Implicit rule search has not been done.\n"); @end example +@node Mmap +@section Mmap + +Don't assume that @code{mmap} either works on all files or fails +for all files. It may work on some files and fail on others. + +The proper way to use @code{mmap} is to try it on the specific file for +which you want to use it---and if @code{mmap} doesn't work, fall back on +doing the job in another way using @code{read} and @code{write}. + +The reason this precaution is needed is that the GNU kernel (the HURD) +provides a user-extensible file system, in which there can be many +different kinds of ``ordinary files.'' Many of them support +@code{mmap}, but some do not. It is important to make programs handle +all these kinds of files. + @node Documentation @chapter Documenting Programs @@ -2443,7 +2527,7 @@ printf (f->tried_implicit * GNU Manuals:: Writing proper manuals. * Manual Structure Details:: Specific structure conventions. * NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes +* Change Logs:: Recording Changes * Man Pages:: Man pages are secondary. * Reading other Manuals:: How far you can go in learning from other manuals. @@ -2457,11 +2541,39 @@ manual in the Texinfo formatting language. See the Texinfo manual, either the hardcopy, or the on-line version available through @code{info} or the Emacs Info subsystem (@kbd{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. +Programmers often find it most natural to structure the documentation +following the structure of the implementation, which they know. But +this structure is not necessarily good for explaining how to use the +program; it may be irrelevant and confusing for a user. + +At every level, from the sentences in a paragraph to the grouping of +topics into separate manuals, the right way to structure documentation +is according to the concepts and questions that a user will have in mind +when reading it. Sometimes this structure of ideas matches the +structure of the implementation of the software being documented---but +often they are different. Often the most important part of learning to +write good documentation is learning to notice when you are structuring +the documentation like the implementation, and think about better +alternatives. + +For example, each program in the GNU system probably ought to be +documented in one manual; but this does not mean each program should +have its own manual. That would be following the structure of the +implementation, rather than the structure that helps the user +understand. + +Instead, each manual should cover a coherent @emph{topic}. For example, +instead of a manual for @code{diff} and a manual for @code{diff3}, we +have one manual for ``comparison of files'' which covers both of those +programs, as well as @code{cmp}. By documenting these programs +together, we can make the whole subject clearer. + +The manual which discusses a program 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 +questions that a user will ask when thinking about the job that the +program does. 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, @@ -2482,33 +2594,35 @@ 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. +most of them are terse, badly structured, and give inadequate +explanation of the underlying concepts. (There are, of course +exceptions.) Also Unix man pages use a particular format which is +different from what we use in GNU manuals. 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 +computer program. Please use ``invalid'' for this, and reserve the term ``illegal'' for violations of law. @node Manual Structure Details @section Manual Structure Details -The title page of the manual should state the version of the program -to which the manual applies. 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 @samp{@var{program} Invocation} or -@samp{Invoking @var{program}}, where @var{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 -@samp{@@example} containing a template for all the options and arguments -that the program uses. +The title page of the manual should state the version of the programs or +packages documented in the manual. 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. + +Each program documented in the manual should should have a node named +@samp{@var{program} Invocation} or @samp{Invoking @var{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 @samp{@@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 @@ -2546,10 +2660,10 @@ 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:: +* Change Log Concepts:: +* Style of Change Logs:: +* Simple Changes:: +* Conditional Changes:: @end menu @node Change Log Concepts @@ -2749,9 +2863,9 @@ makes it easy to include your package into the larger framework of all GNU software. @menu -* Configuration:: How Configuration Should Work +* Configuration:: How Configuration Should Work * Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases +* Releases:: Making Releases @end menu @node Configuration @@ -2856,9 +2970,12 @@ to work with @var{package}. @c Giving an optional @var{parameter} of @c @samp{no} should omit @var{package}, if it is used by default. -Possible values of @var{package} include @samp{x}, @samp{x-toolkit}, -@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, and -@samp{gdb}. +Possible values of @var{package} include +@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, +@samp{gdb}, +@samp{x}, +and +@samp{x-toolkit}. Do not use a @samp{--with} option to specify the file name to use to find certain files. That is outside the scope of what @samp{--with} @@ -2925,9 +3042,9 @@ ignore most of its arguments. @node Releases @section Making Releases -Package the distribution of Foo version 69.96 in a gzipped tar file -named @file{foo-69.96.tar.gz}. It should unpack into a subdirectory -named @file{foo-69.96}. +Package the distribution of @code{Foo version 69.96} up in a gzipped tar +file with the name @file{foo-69.96.tar.gz}. It should unpack into a +subdirectory named @file{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 @@ -2960,7 +3077,7 @@ 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 +that some systems adhere to a foolish interpretation of the @sc{posix} standard, and refuse to open a longer name, rather than truncating as they did in the past. @@ -2991,3 +3108,9 @@ other files to get. @contents @bye +Local variables: +update-date-leading-regexp: "@c This date is automagically updated when you save this file:\n@set lastupdate " +update-date-trailing-regexp: "" +eval: (load "/gd/gnuorg/update-date.el") +eval: (add-hook 'write-file-hooks 'update-date) +End: diff --git a/src/util/autoconf/testsuite/Makefile.in b/src/util/autoconf/testsuite/Makefile.in index 7c9586013..c3c4cd40b 100644 --- a/src/util/autoconf/testsuite/Makefile.in +++ b/src/util/autoconf/testsuite/Makefile.in @@ -40,22 +40,19 @@ all: info: dvi: -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 +check: site.exp all + @if ($(RUNTEST) --version) >/dev/null 2>&1; then \ + echo $(RUNTEST); \ $(RUNTEST) $(RUNTESTFLAGS) --tool autoconf AUTOCONF=${AUTOCONF} \ - AUTOCONFFLAGS="${AUTOCONFFLAGS}" --srcdir $(srcdir) + AUTOCONFFLAGS="${AUTOCONFFLAGS}" --srcdir $(srcdir); \ + else echo $(RUNTEST) not found, check skipped; fi installcheck: site.exp: Makefile @echo "Making a new site.exp file..." - -@rm -f site.bak - -@mv site.exp site.bak + @test ! -f site.bak || rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak @echo "## these variables are automatically generated by make ##" > site.exp @echo "# Do not edit here. If you wish to override these values" >> site.exp @echo "# add them to the last section" >> site.exp @@ -63,7 +60,7 @@ site.exp: Makefile @echo "set srcdir ${srcdir}" >> site.exp @echo "set objdir `pwd`" >> site.exp @echo "## All variables above are generated by configure. Do Not Edit ##" >> site.exp - -@sed '1,/^## All variables above are.*##/ d' site.bak >> site.exp + @test ! -f site.bak || sed '1,/^## All variables above are.*##/ d' site.bak >> site.exp install: diff --git a/src/util/autoconf/texinfo.tex b/src/util/autoconf/texinfo.tex index 4db7c68d4..2cc8256c0 100644 --- a/src/util/autoconf/texinfo.tex +++ b/src/util/autoconf/texinfo.tex @@ -1,32 +1,54 @@ -%% TeX macros to handle Texinfo files. -%% $Id$ - -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, -% 94, 95, 1996 Free Software Foundation, Inc. - -%This texinfo.tex file is free software; you can redistribute it and/or -%modify it under the terms of the GNU General Public License as -%published by the Free Software Foundation; either version 2, or (at -%your option) any later version. - -%This texinfo.tex file is distributed in the hope that it will be -%useful, but WITHOUT ANY WARRANTY; without even the implied warranty -%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%General Public License for more details. - -%You should have received a copy of the GNU General Public License -%along with this texinfo.tex file; see the file COPYING. If not, write -%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -%Boston, MA 02111-1307, USA. - - -%In other words, you are welcome to use, share and improve this program. -%You are forbidden to forbid anyone else to use, share and improve -%what you give them. Help stamp out software-hoarding! - - -% Send bug reports to bug-texinfo@prep.ai.mit.edu. -% Please include a *precise* test case in each bug report. +% texinfo.tex -- TeX macros to handle Texinfo files. +% $Id$ +% +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 +% Free Software Foundation, Inc. +% +% This texinfo.tex file is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation; either version 2, or (at +% your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +% Boston, MA 02111-1307, USA. +% +% In other words, you are welcome to use, share and improve this program. +% You are forbidden to forbid anyone else to use, share and improve +% what you give them. Help stamp out software-hoarding! +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% ftp://ftp.gnu.org/pub/gnu/texinfo.tex +% /home/gd/gnu/doc/texinfo.tex on the GNU machines. +% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% ftp://tug.org/tex/texinfo.tex +% ftp://ctan.org/macros/texinfo/texinfo.tex +% (and all CTAN mirrors, finger ctan@ctan.org for a list). +% The texinfo.tex in the texinfo distribution itself could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. +% Please include a precise test case in each bug report, +% including a complete document with which we can reproduce the problem. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For simple +% manuals, however, you can get away with: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever, to process the dvi file. +% The extra runs of TeX get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. % Make it possible to create a .fmt file just by loading this file: @@ -54,26 +76,17 @@ \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end -\let\ptexequiv = \equiv +\let\ptexequiv=\equiv +\let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t -\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 -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} -\let\~ = \tie % And make it available as @~. +% We never want plain's outer \+ definition in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax \message{Basics,} @@ -83,18 +96,20 @@ % starts a new line in the output. \newlinechar = `^^J -% Set up fixed words for English. -\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% -\def\putwordInfo{Info}% -\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% -\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% -\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% -\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% -\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% -\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% -\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% -\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% -\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi +\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi % Ignore a token. % @@ -103,10 +118,11 @@ \hyphenation{ap-pen-dix} \hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} +\hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset -\newdimen \normaloffset +\newdimen \bindingoffset +\newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file @@ -114,39 +130,48 @@ % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% +\else +\def\loggingall{\tracingcommands3 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \tracingscantokens1 \tracingassigns1 \tracingifs1 + \tracinggroups1 \tracingnesting2 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\fi -%---------------------Begin change----------------------- -% -%%%% For @cropmarks command. -% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue % -\newdimen\cornerlong \newdimen\cornerthick -\newdimen \topandbottommargin -\newdimen \outerhsize \newdimen \outervsize -\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks -\outerhsize=7in -%\outervsize=9.5in -% Alternative @smallbook page size is 9.25in -\outervsize=9.25in -\topandbottommargin=.75in +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 % -%---------------------End change----------------------- +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} -\newbox\headlinebox \newbox\footlinebox +\newbox\headlinebox +\newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% - \hoffset=\normaloffset + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % @@ -165,53 +190,52 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % \unvbox\headlinebox \pagebody{#1}% - \unvbox\footlinebox - }% - }% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingxxx.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 2\baselineskip + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \turnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } -%%%% For @cropmarks command %%%% - -% Here is a modification of the main output routine for Near East Publications -% This provides right-angle cropmarks at all four corners. -% The contents of the page are centerlined into the cropmarks, -% and any desired binding offset is added as an \hskip on either -% site of the centerlined box. (P. A. MacKay, 12 November, 1986) -% -\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 - \vbox{\line{\ewtop\hfill\ewtop}} - \nointerlineskip - \line{\vbox{\moveleft\cornerthick\nstop} - \hfill - \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 - \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} -% -% Do @cropmarks to get crop marks -\def\cropmarks{\let\onepageout=\croppageout } - \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} @@ -225,7 +249,6 @@ \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } -% % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) @@ -320,11 +343,11 @@ %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% -\ifENV\errmessage{Still within an environment. Type Return to continue.} +\ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Type to continue.} +\newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} @@ -383,7 +406,7 @@ % @@ prints an @ % Kludge this until the fonts are right (grr). -\def\@{{\tt \char '100}} +\def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. @@ -393,8 +416,8 @@ %\def\'{{'}} % Used to generate quoted braces. -\def\mylbrace {{\tt \char '173}} -\def\myrbrace {{\tt \char '175}} +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup @@ -431,6 +454,18 @@ \fi\fi } +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } @@ -440,14 +475,11 @@ % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } -% @enddots{} is an end-of-sentence ellipsis. -\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} - % @! is an end-of-sentence bang. -\gdef\!{!\spacefactor=3000 } +\def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. -\gdef\?{?\spacefactor=3000 } +\def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would @@ -531,7 +563,7 @@ where each line of input produces a line of output.} %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} @@ -572,12 +604,34 @@ where each line of input produces a line of output.} \let\br = \par -% @dots{} output some dots +% @dots{} output an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \leavevmode + \hbox to 2em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% + \spacefactor=3000 +} -\def\dots{$\ldots$} % @page forces the start of a new page - +% \def\page{\par\vfill\supereject} % @exdent text.... @@ -644,10 +698,10 @@ where each line of input produces a line of output.} % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% -\parsearg \commentxxx} - -\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment @@ -735,20 +789,15 @@ where each line of input produces a line of output.} % \def\ignore{\doignore{ignore}} -% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. +% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. % \def\ifinfo{\doignore{ifinfo}} \def\ifhtml{\doignore{ifhtml}} +\def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \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. \let\dircategory = \comment @@ -760,11 +809,27 @@ where each line of input produces a line of output.} \ignoresections % % Define a command to swallow text until we reach `@end #1'. - \long\def\doignoretext##1\end #1{\enddoignore}% + % This @ is a catcode 12 token (that is the normal catcode of @ in + % this texinfo.tex file). We change the catcode of @ below to match. + \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % + % Ignore braces, too, so mismatched braces don't cause trouble. + \catcode`\{ = 9 + \catcode`\} = 9 + % + % We must not have @c interpreted as a control sequence. + \catcode`\@ = 12 + % + % Make the letter c a comment character so that the rest of the line + % will be ignored. This way, the document can have (for example) + % @c @end ifinfo + % and the @end ifinfo will be properly ignored. + % (We've just changed @ to catcode 12.) + \catcode`\c = 14 + % % And now expand that command. \doignoretext } @@ -856,7 +921,10 @@ where each line of input produces a line of output.} \pretolerance = 10000 % % Do not execute instructions in @tex - \def\tex{\doignore{tex}} + \def\tex{\doignore{tex}}% + % Do not execute macro definitions. + % `c' is a comment character, so the word `macro' will get cut off. + \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. @@ -891,16 +959,35 @@ where each line of input produces a line of output.} % @value{foo} gets the text saved in variable foo. % -\def\value{\begingroup - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \valuexxx} -\def\valuexxx#1{% +{ + \catcode`\_ = \active + % + % We might end up with active _ or - characters in the argument if + % we're called from @code, as @code{@value{foo-bar_}}. So \let any + % such active characters to their normal equivalents. + \gdef\value{\begingroup + \catcode`\-=12 \catcode`\_=12 + \indexbreaks \let_\normalunderscore + \valuexxx} +} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we \let\value to this in \indexdummies). Ones +% whose names contain - or _ still won't work, but we can't do anything +% about that. The command has to be fully expandable, since the result +% winds up in the index file. This means that if the variable's value +% contains other Texinfo commands, it's almost certain it will fail +% (although perhaps we could fix that with sufficient work to do a +% one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}}% + {[No value for ``#1'']v}% \else \csname SET#1\endcsname \fi -\endgroup} +} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. @@ -932,11 +1019,16 @@ where each line of input produces a line of output.} \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} -% @iftex always succeeds; we read the text following, through @end -% iftex). But `@end iftex' should be valid only after an @iftex. +% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text +% following, through the first @end iftex (etc.). Make `@end iftex' +% (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} +\def\ifnothtml{\conditionalsucceed{ifnothtml}} +\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} \defineunmatchedend{iftex} +\defineunmatchedend{ifnothtml} +\defineunmatchedend{ifnotinfo} % We can't just want to start a group at @iftex (for example) and end it % at @end iftex, since then @set commands inside the conditional have no @@ -982,63 +1074,57 @@ where each line of input produces a line of output.} \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -\def\donoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\setref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\unnumbnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\appendixnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\global\let\lastnode=\relax} - % @refill is a no-op. \let\refill=\relax +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% - \readauxfile - \opencontents + \iflinks + \readauxfile + \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + % Just to be on the safe side, close the input stream before the \input. + \openin 1 texinfo.cnf + \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi + \closein1 + \temp + % \comment % Ignore the actual filename. } +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} -% \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{% -%\let\parsearg=\relax -%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% -%\expandafter\xdef\macrotemp{\parsearg\macrotempx}% -%\expandafter\gdef\macrotempx#1{#2}% -%\endgroup} - -%\def\butfirst#1{} - \message{fonts,} - % Font-change commands. -% Texinfo supports the sans serif font style, which plain TeX does not. +% Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} @@ -1047,8 +1133,9 @@ where each line of input produces a line of output.} % We don't need math for this one. \def\ttsl{\tenttsl} -%% Try out Computer Modern fonts at \magstephalf -\let\mainmagstep=\magstephalf +% Use Computer Modern fonts at \magstephalf (11pt). +\newcount\mainmagstep +\mainmagstep=\magstephalf % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). @@ -1109,24 +1196,38 @@ where each line of input produces a line of output.} % Do not make many font distinctions in general in the index, since they % aren't very useful. \setfont\ninett\ttshape{9}{1000} +\setfont\ninettsl\ttslshape{10}{900} \setfont\indrm\rmshape{9}{1000} -\setfont\indit\slshape{9}{1000} -\let\indsl=\indit +\setfont\indit\itshape{9}{1000} +\setfont\indsl\slshape{9}{1000} \let\indtt=\ninett -\let\indttsl=\ninett +\let\indttsl=\ninettsl \let\indsf=\indrm \let\indbf=\indrm \setfont\indsc\scshape{10}{900} \font\indi=cmmi9 \font\indsy=cmsy9 +% Fonts for title page: +\setfont\titlerm\rmbshape{12}{\magstep3} +\setfont\titleit\itbshape{10}{\magstep4} +\setfont\titlesl\slbshape{10}{\magstep4} +\setfont\titlett\ttbshape{12}{\magstep3} +\setfont\titlettsl\ttslshape{10}{\magstep4} +\setfont\titlesf\sfbshape{17}{\magstep1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} + % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} \setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chapttsl\ttslshape{10}{\magstep3} -\setfont\chapsf\sfbshape{12}{\magstep2} +\setfont\chapsf\sfbshape{17}{1000} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3} \font\chapi=cmmi12 scaled \magstep2 @@ -1163,19 +1264,15 @@ where each line of input produces a line of output.} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} \setfont\ssectt\ttbshape{12}{\magstephalf} -\setfont\ssecttsl\ttslshape{10}{\magstep1} +\setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf -\font\ssecsy=cmsy10 scaled \magstep1 +\font\ssecsy=cmsy10 scaled 1315 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. -% Fonts for title page: -\setfont\titlerm\rmbshape{12}{\magstep3} -\let\authorrm = \secrm - % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts, we @@ -1200,6 +1297,13 @@ where each line of input produces a line of output.} \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \resetmathfonts} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc @@ -1226,6 +1330,10 @@ where each line of input produces a line of output.} % \textfonts +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 @@ -1240,13 +1348,14 @@ where each line of input produces a line of output.} % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic -\let\var=\smartitalic -\let\dfn=\smartitalic +\let\var=\smartslanted +\let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartitalic +\let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b @@ -1263,22 +1372,22 @@ where each line of input produces a line of output.} \null } \let\ttfont=\t -\def\samp #1{`\tclose{#1}'\null} +\def\samp#1{`\tclose{#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{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt - \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% - \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} + \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} +% @file, @option are the same as @samp. \let\file=\samp -\let\url=\samp % perhaps include a hypertex \special eventually -\def\email#1{$\langle${\tt #1}$\rangle$} +\let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1313,48 +1422,91 @@ where each line of input produces a line of output.} % 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 -% _ 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 -} + \catcode`\-=\active + \catcode`\_=\active + % + \global\def\code{\begingroup + \catcode`\-=\active \let-\codedash + \catcode`\_=\active \let_\codeunder + \codex + } + % + % If we end up with any active - characters when handling the index, + % just treat them as a normal -. + \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} -\def\codeunder{\normalunderscore\discretionary{}{}{}} +\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} \def\codex #1{\tclose{#1}\endgroup} %\let\exp=\tclose %Was temporary % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. -% + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\def\kbdinputstyle{\parsearg\kbdinputstylexxx} +\def\kbdinputstylexxx#1{% + \def\arg{#1}% + \ifx\arg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\arg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\arg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is kbdinputdistinct. (Too much of a hassle to call the macro, +% the catcodes are wrong for parsearg to work.) +\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} + \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\ttsl\look}}\fi -\else{\tclose{\ttsl\look}}\fi} +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @url, @env, @command quotes seem unnecessary, so use \code. +\let\url=\code +\let\env=\code +\let\command=\code + +% @uref (abbreviation for `urlref') takes an optional second argument +% specifying the text to display. First (mandatory) arg is the url. +% Perhaps eventually put in a hypertex \special here. +% +\def\uref#1{\urefxxx #1,,\finish} +\def\urefxxx#1,#2,#3\finish{% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \unhbox0\ (\code{#1})% + \else + \code{#1}% + \fi +} + +% rms does not like the angle brackets --karl, 17may97. +% So now @email is just like @uref. +%\def\email#1{\angleleft{\tt #1}\angleright} +\let\email=\uref % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. -% +% \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of -% @dmn{}pt. +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} @@ -1365,11 +1517,14 @@ where each line of input produces a line of output.} % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} +% Explicit font changes: @r, @sc, undocumented @ii. \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 +% @acronym downcases the argument and prints in smallcaps. +\def\acronym#1{{\smallcaps \lowercase{#1}}} + % @pounds{} is a sterling sign. \def\pounds{{\it\$}} @@ -1380,20 +1535,23 @@ where each line of input produces a line of output.} \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. -\def\titlefont#1{{\titlerm #1}} - \newif\ifseenauthor \newif\iffinishedtitlepage +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @contentsaftertitlepage or @shortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm -% I deinstalled the following change because \cmr12 is undefined. -% This change was not in the ChangeLog anyway. --rms. -% \let\subtitlerm=\cmr12 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% @@ -1403,7 +1561,7 @@ 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}} + \def\titlezzz##1{\leftline{\titlefonts\rm ##1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% @@ -1442,6 +1600,21 @@ where each line of input produces a line of output.} % after the title page, which we certainly don't want. \oldpage \endgroup + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi + % \HEADINGSon } @@ -1455,10 +1628,10 @@ where each line of input produces a line of output.} \let\thispage=\folio -\newtoks \evenheadline % Token sequence for heading line of even pages -\newtoks \oddheadline % Token sequence for heading line of odd pages -\newtoks \evenfootline % Token sequence for footing line of even pages -\newtoks \oddfootline % Token sequence for footing line of odd pages +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline @@ -1492,10 +1665,7 @@ where each line of input produces a line of output.} \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} -\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} +\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% @@ -1503,12 +1673,15 @@ where each line of input produces a line of output.} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -\baselineskip + \global\advance\vsize by -\baselineskip +} -\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} -\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} +\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} % }% unbind the catcode of @. @@ -1597,18 +1770,6 @@ July\or August\or September\or October\or November\or December\fi \message{tables,} - -% @tabs -- simple alignment - -% These don't work. For one thing, \+ is defined as outer. -% So these macros cannot even be defined. - -%\def\tabs{\parsearg\tabszzz} -%\def\tabszzz #1{\settabs\+#1\cr} -%\def\tabline{\parsearg\tablinezzz} -%\def\tablinezzz #1{\+#1\cr} -%\def\&{&} - % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text @@ -1652,11 +1813,6 @@ July\or August\or September\or October\or November\or December\fi \itemindex{#1}% \nobreak % This prevents a break before @itemx. % - % Be sure we are not still in the middle of a paragraph. - %{\parskip = 0in - %\par - %}% - % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next @@ -1685,13 +1841,17 @@ July\or August\or September\or October\or November\or December\fi \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. Since that - % text will be indented by \tableindent, we make the item text be in - % a zero-width box. + % following text (if any) will end up on the same line. \noindent - \rlap{\hskip -\tableindent\box0}\ignorespaces% - \endgroup% - \itemxneedsnegativevskiptrue% + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue \fi } @@ -1702,9 +1862,10 @@ July\or August\or September\or October\or November\or December\fi \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} -%% Contains a kludge to get @end[description] to work +% Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} +% @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% @@ -1764,7 +1925,7 @@ July\or August\or September\or October\or November\or December\fi \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% - \begingroup % ended by the @end itemsize + \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } @@ -1892,7 +2053,7 @@ July\or August\or September\or October\or November\or December\fi \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{\in hmode at itemizeitem}\fi +\ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% @@ -1910,7 +2071,7 @@ July\or August\or September\or October\or November\or December\fi % To make preamble: % -% Either define widths of columns in terms of percent of \hsize: +% Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % @@ -1928,13 +2089,13 @@ July\or August\or September\or October\or November\or December\fi % the preamble, break the line within one argument and it % will parse correctly, i.e., % -% @multitable {Column 1 template} {Column 2 template} {Column 3 +% @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: -% @multitable {Column 1 template} {Column 2 template} +% @multitable {Column 1 template} {Column 2 template} % {Column 3 template} -% Each new table line starts with @item, each subsequent new column +% Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. @@ -1946,15 +2107,15 @@ July\or August\or September\or October\or November\or December\fi % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. -% +% % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable @@ -1966,10 +2127,7 @@ July\or August\or September\or October\or November\or December\fi % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. - -%%%% -% Dimensions - +% \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace @@ -1979,15 +2137,15 @@ July\or August\or September\or October\or November\or December\fi \multitablecolspace=12pt \multitablelinespace=0pt -%%%% % Macros used to set up halign preamble: +% \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -%% 2/1/96, to allow fractions to be given with more than one digit. +% 2/1/96, to allow fractions to be given with more than one digit. \def\pickupwholefraction#1 {\global\advance\colcount by1 % \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% \setuptable} @@ -2013,80 +2171,84 @@ July\or August\or September\or October\or November\or December\fi \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% \fi\go} -%%%% % multitable syntax \def\tab{&\hskip1sp\relax} % 2/2/96 % tiny skip here makes sure this column space is % maintained, even if it is never used. - -%%%% % @multitable ... @end multitable definitions: \def\multitable{\parsearg\dotable} - \def\dotable#1{\bgroup -\let\item\cr -\tolerance=9500 -\hbadness=9500 -\setmultitablespacing -\parskip=\multitableparskip -\parindent=\multitableparindent -\overfullrule=0pt -\global\colcount=0\relax% -\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : -\setuptable#1 \endsetuptable - % Need to reset this to 0 after \setuptable. -\global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. -\halign\bgroup&\global\advance\colcount by 1\relax% -\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. - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - % we will use that dimension as the width of the column, and - % the \leftskip will keep entries from bumping into each other. - % Table will start at left margin and final column will justify at - % right margin. -\ifnum\colcount=1 -\else - \ifsetpercent + \vskip\parskip + \let\item\crcr + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% + % + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % \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. + \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}}% + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup&\global\advance\colcount by 1\relax + \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. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip \else - % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace - \advance\hsize by \multitablecolspace + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace \fi - % In either case we will make \leftskip=\multitablecolspace: -\leftskip=\multitablecolspace -\fi - % 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{% -% \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}} + % 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 highlighting sequences respectively marking + % characters. + \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. @@ -2097,7 +2259,7 @@ July\or August\or September\or October\or November\or December\fi %% 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. +%% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 @@ -2129,12 +2291,14 @@ width0pt\relax} \fi % 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 -\noexpand\doindex {#1}} +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} @@ -2143,31 +2307,37 @@ width0pt\relax} \fi % Define @defcodeindex, like @defindex except put all entries in @code. -\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 -\noexpand\docodeindex {#1}} +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}} } \def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -\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 -\noexpand\doindex {#2}}% +% The \closeout helps reduce unnecessary open files; the limit on the +% Acorn RISC OS is a mere 16 files. +\def\synindex#1 #2 {% + \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname + \expandafter\closeout\csname#1indfile\endcsname + \expandafter\let\csname#1indfile\endcsname=\synindexfoo + \expandafter\xdef\csname#1index\endcsname{% define \xxxindex + \noexpand\doindex{#2}}% } % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -\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 -\noexpand\docodeindex {#2}}% +\def\syncodeindex#1 #2 {% + \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname + \expandafter\closeout\csname#1indfile\endcsname + \expandafter\let\csname#1indfile\endcsname=\synindexfoo + \expandafter\xdef\csname#1index\endcsname{% define \xxxindex + \noexpand\docodeindex{#2}}% } % Define \doindex, the driver for all \fooindex macros. @@ -2188,6 +2358,7 @@ width0pt\relax} \fi \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\indexdummies{% +\def\ { }% % Take care of the plain tex accent commands. \def\"{\realbackslash "}% \def\`{\realbackslash `}% @@ -2229,10 +2400,15 @@ width0pt\relax} \fi \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% -%\def\char{\realbackslash char}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% -\def\copyright{\realbackslash copyright }% +\def\result{\realbackslash result}% +\def\equiv{\realbackslash equiv}% +\def\expansion{\realbackslash expansion}% +\def\print{\realbackslash print}% +\def\error{\realbackslash error}% +\def\point{\realbackslash point}% +\def\copyright{\realbackslash copyright}% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% \def\dotless##1{\realbackslash dotless {##1}}% @@ -2242,6 +2418,7 @@ width0pt\relax} \fi \def\r##1{\realbackslash r {##1}}% \def\i##1{\realbackslash i {##1}}% \def\b##1{\realbackslash b {##1}}% +\def\sc##1{\realbackslash sc {##1}}% \def\cite##1{\realbackslash cite {##1}}% \def\key##1{\realbackslash key {##1}}% \def\file##1{\realbackslash file {##1}}% @@ -2249,6 +2426,12 @@ width0pt\relax} \fi \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% +% +% Handle some cases of @value -- where the variable name does not +% contain - or _, and the value does not contain any +% (non-fully-expandable) commands. +\let\value = \expandablevalue +% \unsepspaces } @@ -2321,14 +2504,24 @@ width0pt\relax} \fi % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other -@gdef@realbackslash{\}} + @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% For \ifx comparisons. +\def\emptymacro{\empty} + +% Most index entries go through here, but \dosubind is the general case. +% +\def\doind#1#2{\dosubind{#1}{#2}\empty} -\let\SETmarginindex=\relax %initialize! -% workhorse for all \fooindexes -% #1 is name of index, #2 is stuff to put there -\def\doind #1#2{% +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% \empty if called from \doind, as we usually are. The main exception +% is with defuns, which call us directly. +% +\def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% @@ -2339,13 +2532,22 @@ width0pt\relax} \fi \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% - \let\folio=0% We will expand all macros now EXCEPT \folio. + \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. % + \def\thirdarg{#3}% + % + % If third arg is present, precede it with space in sort key. + \ifx\thirdarg\emptymacro + \let\subentry = \empty + \else + \def\subentry{ #3}% + \fi + % % First process the index-string with all font commands turned off % to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2}}% + {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now produce the complete index entry, with both the sort key and the % original text, including any font commands. @@ -2354,33 +2556,47 @@ width0pt\relax} \fi \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% - \temp + % + % If third (subentry) arg is present, add it to the index string. + \ifx\thirdarg\emptymacro \else + \toks0 = {#3}% + \edef\temp{\temp{\the\toks0}}% + \fi + % + % If a skip is the last thing on the list now, preserve it + % by backing up by \lastskip, doing the \write, then inserting + % the skip again. Otherwise, the whatsit generated by the + % \write will make \lastskip zero. The result is that sequences + % like this: + % @end defun + % @tindex whatever + % @defun ... + % will have extra space inserted, because the \medbreak in the + % start of the @defun won't see the skip inserted by the @end of + % the previous defun. + % + % But don't do any of this if we're not in vertical mode. We + % don't want to do a \vskip and prematurely end a paragraph. + % + % Avoid page breaks due to these extra skips, too. + % + \iflinks + \ifvmode + \skip0 = \lastskip + \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi + \fi + % + \temp % do the write + % + % + \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi + \fi }% }% \penalty\count255 }% } -\def\dosubind #1#2#3{% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% -\def\rawbackslashxx{\indexbackslash}% -% -% 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 #3}% -}% -% 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}{#3}}}% -\temp }% -}\penalty\count10}} - % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or @@ -2413,29 +2629,23 @@ width0pt\relax} \fi % Define the macros used in formatting output of the sorted index material. -% This is what you call to cause a particular index to get printed. -% Write -% @unnumbered Function Index -% @printindex fn - +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% \def\printindex{\parsearg\doprintindex} - \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % \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. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, @@ -2452,31 +2662,52 @@ width0pt\relax} \fi \ifeof 1 (Index is empty) \else + % 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. + \def\indexbackslash{\rawbackslashxx}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns \input \jobname.#1s + \enddoublecolumns \fi \fi \closein 1 - \enddoublecolumns \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -% Same as \bigskipamount except no shrink. -% \balancecolumns gets confused if there is any shrink. -\newskip\initialskipamount \initialskipamount 12pt plus4pt - -\def\initial #1{% -{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt -\ifdim\lastskip<\initialskipamount -\removelastskip \penalty-200 \vskip \initialskipamount\fi -\line{\secbf#1\hfill}\kern 2pt\penalty10000}} +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \penalty -300 + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + \vskip .33\baselineskip plus .1\baselineskip + % + % Do our best not to break after the initial. + \nobreak +}} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % -\def\entry #1#2{\begingroup +\def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. @@ -2499,12 +2730,15 @@ width0pt\relax} \fi % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. - \hangindent=2em + \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % + % A bit of stretch before each entry for the benefit of balancing columns. + \vskip 0pt plus1pt + % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent @@ -2558,24 +2792,39 @@ width0pt\relax} \fi \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. - \output = {\global\setbox\partialpage - =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% + \output = {\global\setbox\partialpage = \vbox{% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case, we must prevent the second \partialpage from + % simply overwriting the first, causing us to lose the page. + % This will preserve it until a real output routine can ship it + % out. Generally, \partialpage will be empty when this runs and + % this will be a no-op. + \unvbox\partialpage + % + % Unvbox the main output page. + \unvbox255 + \kern-\topskip \kern\baselineskip + }}% \eject % - % Now switch to the double-column output routine. - \output={\doublecolumnout}% + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the - % execution time, so we may as well do it once. + % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant - % below is chosen so that the gutter has the same value (well, +- < - % 1pt) as it did when we hard-coded it. + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) @@ -2588,109 +2837,104 @@ width0pt\relax} \fi % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) + \advance\vsize by -\ht\partialpage \vsize = 2\vsize } + +% The double-column output routine for all double-column pages except +% the last. +% \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. + \dimen@ = \vsize + \divide\dimen@ by 2 + % + % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar - \unvbox255 \penalty\outputpenalty + \unvbox255 + \penalty\outputpenalty } \def\pagesofar{% - % The contents of the output page -- any previous material, - % followed by the two boxes we just split. + % Re-output the contents of the output page -- any previous material, + % followed by the two boxes we just split, in box0 and box2. + \advance\vsize by \ht\partialpage \unvbox\partialpage + % \hsize = \doublecolumnhsize - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% } \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 + \output = {% + % Split the last of the double-column material. Leave on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize. + \pagegoal = \vsize + }% + \eject + \endgroup % started in \begindoublecolumns } \def\balancecolumns{% - % Called on the last page of the double column material. - \setbox0=\vbox{\unvbox255}% + % Called at the end of the double column material. + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \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}% + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% + % \pagesofar } -\catcode `\@=\other +\catcode`\@ = \other \message{sectioning,} % Define chapters, sections, etc. -\newcount \chapno -\newcount \secno \secno=0 -\newcount \subsecno \subsecno=0 -\newcount \subsubsecno \subsubsecno=0 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... -\newcount \appendixno \appendixno = `\@ +\newcount\appendixno \appendixno = `\@ \def\appendixletter{\char\the\appendixno} -\newwrite \contentsfile -% This is called from \setfilename. -\def\opencontents{\openout \contentsfile = \jobname.toc} - % Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise - -\def\thischapter{} \def\thissection{} -\def\seccheck#1{\if \pageno<0 % -\errmessage{@#1 not allowed after generating table of contents}\fi -% -} - -\def\chapternofonts{% -\let\rawbackslash=\relax% -\let\frenchspacing=\relax% -\def\result{\realbackslash result} -\def\equiv{\realbackslash equiv} -\def\expansion{\realbackslash expansion} -\def\print{\realbackslash print} -\def\TeX{\realbackslash TeX} -\def\dots{\realbackslash dots} -\def\copyright{\realbackslash copyright} -\def\tt{\realbackslash tt} -\def\bf{\realbackslash bf } -\def\w{\realbackslash w} -\def\less{\realbackslash less} -\def\gtr{\realbackslash gtr} -\def\hat{\realbackslash hat} -\def\char{\realbackslash char} -\def\tclose##1{\realbackslash tclose {##1}} -\def\code##1{\realbackslash code {##1}} -\def\samp##1{\realbackslash samp {##1}} -\def\r##1{\realbackslash r {##1}} -\def\b##1{\realbackslash b {##1}} -\def\key##1{\realbackslash key {##1}} -\def\file##1{\realbackslash file {##1}} -\def\kbd##1{\realbackslash kbd {##1}} -% These are redefined because @smartitalic wouldn't work inside xdef. -\def\i##1{\realbackslash i {##1}} -\def\cite##1{\realbackslash cite {##1}} -\def\var##1{\realbackslash var {##1}} -\def\emph##1{\realbackslash emph {##1}} -\def\dfn##1{\realbackslash dfn {##1}} -} +% page headings and footings can use it. @section does likewise. +\def\thischapter{} +\def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count @@ -2762,57 +3006,59 @@ width0pt\relax} \fi \fi } - +% @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{\seccheck{chapter}% +\def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% +\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\the\chapno}}}% +\temp +\donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec -}} +} \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{\seccheck{appendix}% +\def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 \message{Appendix \appendixletter}% +\global\advance \appendixno by 1 +\message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry - {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\putwordAppendix{} \appendixletter}}}% +\temp +\appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \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}}} +% @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} + \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{\seccheck{unnumbered}% +\def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the @@ -2824,146 +3070,139 @@ width0pt\relax} \fi % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, -% simply yielding the contents of the . +% simply yielding the contents of . (We also do this for +% the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% +\temp +\unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec -}} +} +% Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{\seccheck{section}% +\def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\the\chapno}{\the\secno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{\seccheck{appendixsection}% +\def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\appendixletter}{\the\secno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% +\def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} +% Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{\seccheck{subsection}% +\def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% +\def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% +\def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} +% Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% +\def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry % - {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% +\def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry{#1}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% +\def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. @@ -2992,8 +3231,7 @@ width0pt\relax} \fi % Define @majorheading, @heading and @subheading -% NOTE on use of \vbox for chapter headings, section headings, and -% such: +% 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 @@ -3040,12 +3278,12 @@ width0pt\relax} \fi \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} -\def\CHAPPAGoff{ +\def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} -\def\CHAPPAGon{ +\def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager @@ -3099,7 +3337,7 @@ width0pt\relax} \fi \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % + \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts @@ -3110,7 +3348,7 @@ width0pt\relax} \fi \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ @@ -3139,7 +3377,7 @@ width0pt\relax} \fi % 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{% @@ -3163,42 +3401,73 @@ width0pt\relax} \fi } -\message{toc printing,} -% Finish up the main text and prepare to read what we've written -% to \contentsfile. +\message{toc,} +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. We supply {\folio} at the end of the +% argument, which will end up as the last argument to the \...entry macro. +% +% We open the .toc file here instead of at @setfilename or any other +% given time so that @contents can be put in the document anywhere. +% +\newif\iftocfileopened +\def\writetocentry#1{% + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + \iflinks \write\tocfile{#1{\folio}}\fi +} \newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Finish up the main text and prepare to read what we've written +% to \tocfile. +% \def\startcontents#1{% % 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. - \fi + \immediate\closeout\tocfile + % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% + \savepageno = \pageno \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 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. -\outer\def\contents{% +\def\contents{% \startcontents{\putwordTableofContents}% - \input \jobname.toc + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject \endgroup - \vfill \eject + \lastnegativepageno = \pageno + \pageno = \savepageno } % And just the chapters. -\outer\def\summarycontents{% +\def\summarycontents{% \startcontents{\putwordShortContents}% % \let\chapentry = \shortchapentry @@ -3215,9 +3484,15 @@ width0pt\relax} \fi \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject \endgroup - \vfill \eject + \lastnegativepageno = \pageno + \pageno = \savepageno } \let\shortcontents = \summarycontents @@ -3308,11 +3583,12 @@ width0pt\relax} \fi % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -% -% \turnoffactive is for the sake of @" used for umlauts. \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - \entry{\turnoffactive #1}{\turnoffactive #2}% + % Do not use \turnoffactive in these arguments. Since the toc is + % typeset in cmr, so characters such as _ would come out wrong; we + % have to do the usual translation tricks. + \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. @@ -3378,31 +3654,36 @@ width0pt\relax} \fi % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup -\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 -\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 -\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie -\catcode `\%=14 -\catcode 43=12 % plus -\catcode`\"=12 -\catcode`\==12 -\catcode`\|=12 -\catcode`\<=12 -\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 -% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\%=14 + \catcode 43=12 % plus + \catcode`\"=12 + \catcode`\==12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\*=\ptexstar + \let\t=\ptext + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @endlisp. @@ -3447,8 +3728,8 @@ width0pt\relax} \fi % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \cartouche: draw rectangle w/rounded corners around argument +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner @@ -3475,9 +3756,9 @@ width0pt\relax} \fi \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either + \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from -% each corner char +% each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment @@ -3531,48 +3812,52 @@ width0pt\relax} \fi \fi } -% To ending an @example-like environment, we first end the paragraph -% (via \afterenvbreak's vertical glue), and then the group. That way we -% keep the zero \parskip that the environments set -- \parskip glue -% will be inserted at the beginning of the next paragraph in the -% document, after the environment. +% Define the \E... control sequence only if we are inside the particular +% environment, so the error checking in \end will work. +% +% To end an @example-like environment, we first end the paragraph (via +% \afterenvbreak's vertical glue), and then the group. That way we keep +% the zero \parskip that the environments set -- \parskip glue will be +% inserted at the beginning of the next paragraph in the document, after +% the environment. % -\def\nonfillfinish{\afterenvbreak\endgroup}% +\def\nonfillfinish{\afterenvbreak\endgroup} -% This macro is +% @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt - \rawbackslash % have \ input char produce \ char from current font - \gobble + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return } -% Define the \E... control sequence only if we are inside the -% environment, so the error checking in \end will work. -% -% We must call \lisp last in the definition, since it reads the -% return following the @example (or whatever) command. -% +% @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} -\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} -% @smallexample and @smalllisp. This is not used unless the @smallbook -% command is given. Originally contributed by Pavel@xerox. +% @small... is usually equivalent to the non-small (@smallbook +% redefines). We must call \example (or whatever) last in the +% definition, since it reads the return following the @example (or +% whatever) command. +% +% This actually allows (for example) @end display inside an +% @smalldisplay. Too bad, but makeinfo will catch the error anyway. % +\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} +\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} +\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. +% Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup - \nonfillstart - \let\Esmalllisp = \nonfillfinish - \let\Esmallexample = \nonfillfinish - % - % Smaller fonts for small examples. - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - \gobble + \def\Esmalllisp{\nonfillfinish\endgroup}% + \def\Esmallexample{\nonfillfinish\endgroup}% + \indexfonts + \lisp } -% This is @display; same as @lisp except use roman font. +% @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart @@ -3580,7 +3865,15 @@ width0pt\relax} \fi \gobble } -% This is @format; same as @display except don't narrow margins. +% @smalldisplay (when @smallbook): @display plus smaller fonts. +% +\def\smalldisplayx{\begingroup + \def\Esmalldisplay{\nonfillfinish\endgroup}% + \indexfonts \rm + \display +} + +% @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t @@ -3589,20 +3882,27 @@ width0pt\relax} \fi \gobble } -% @flushleft (same as @format) and @flushright. +% @smallformat (when @smallbook): @format plus smaller fonts. % -\def\flushleft{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushleft = \nonfillfinish - \gobble +\def\smallformatx{\begingroup + \def\Esmallformat{\nonfillfinish\endgroup}% + \indexfonts \rm + \format } + +% @flushleft (same as @format). +% +\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} + +% @flushright. +% \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill - \gobble} + \gobble +} % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. @@ -3625,6 +3925,7 @@ width0pt\relax} \fi \fi } + \message{defuns,} % Define formatter for defuns % First, allow user to change definition object font (\df) internally @@ -3661,16 +3962,17 @@ width0pt\relax} \fi % Definitions of (, ) and & used in args for functions. % This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % -\global\advance\parencount by 1 } +\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested + \global\advance\parencount by 1 +} % % This is the definition of ( when already inside a level of parens. \gdef\opnested{\char`\(\global\advance\parencount by 1 } % \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. -% also in that case restore the outer-level definition of (. -\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi -\global\advance \parencount by -1 } + % also in that case restore the outer-level definition of (. + \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi + \global\advance \parencount by -1 } % If we encounter &foo, then turn on ()-hacking afterwards \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } % @@ -3678,8 +3980,11 @@ width0pt\relax} \fi } % End of definition inside \activeparens %% These parens (in \boldbrax) actually are a little bolder than the %% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} -\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} +\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } +\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } +\def\ampnr{\&} +\def\lbrb{{\bf\char`\[}} +\def\rbrb{{\bf\char`\]}} % First, defname, which formats the header line itself. % #1 should be the function name. @@ -3690,20 +3995,18 @@ width0pt\relax} \fi % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent -\dimen3=\rightskip -\advance\dimen3 by -\defbodyindent -\noindent % +\noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 % +\parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. -\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 -\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% +\advance \hsize by -\dimen2 +\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent @@ -3724,23 +4027,46 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} -\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by the space, is the class name. +% +\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} +% @deftypemethod has an extra argument that nothing else does. Sigh. +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by the space, is the class name. +% #5 is the method's return type. +% +\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} + \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies @@ -3749,7 +4075,7 @@ width0pt\relax} \fi \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} @@ -3764,7 +4090,7 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % @@ -3772,7 +4098,7 @@ width0pt\relax} \fi % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. -% +% \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % @@ -3781,7 +4107,7 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in - \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent + \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } @@ -3807,13 +4133,13 @@ width0pt\relax} \fi % Fine, but then we have to eventually remove the \empty *and* the % braces (if any). That's what this does. -% +% \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{% #1{\removeemptybraces#2\relax}{#3}% }% @@ -3826,7 +4152,7 @@ width0pt\relax} \fi \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} @@ -3856,10 +4182,10 @@ width0pt\relax} \fi \hyphenchar\tensl=0 #1% \hyphenchar\tensl=45 -\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% +\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +\endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% @@ -3870,7 +4196,7 @@ width0pt\relax} \fi \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +\endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. @@ -3957,29 +4283,47 @@ width0pt\relax} \fi \def\defmacx #1 {\errmessage{@defmacx in invalid context}} \def\defspecx #1 {\errmessage{@defspecx in invalid context}} \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} +\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} +\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}} % @defmethod, and so on -% @defop {Funny Method} foo-class frobnicate argument +% @defop CATEGORY CLASS OPERATION ARG... \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} \def\defopheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index +\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype{} on #1}% \defunargs {#3}\endgroup % } -% @defmethod == @defop Method +% @deftypemethod CLASS RETURN-TYPE METHOD ARG... +% +\def\deftypemethod{% + \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% +% #1 is the class name, #2 the data type, #3 the method name, #4 the args. +\def\deftypemethodheader#1#2#3#4{% + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup +} +% @defmethod == @defop Method +% \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} - -\def\defmethodheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% entry in function index -\begingroup\defname {#2}{Method on #1}% -\defunargs {#3}\endgroup % +% +% #1 is the class name, #2 the method name, #3 the args. +\def\defmethodheader#1#2#3{% + \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{#2}{\putwordMethodon\ \code{#1}}% + \defunargs{#3}% + \endgroup } % @defcv {Class Option} foo-class foo-flag @@ -4018,7 +4362,7 @@ width0pt\relax} \fi % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000} +\endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count @@ -4055,7 +4399,7 @@ width0pt\relax} \fi \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} @@ -4066,7 +4410,7 @@ width0pt\relax} \fi \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % This definition is run if you use @defvarx @@ -4096,40 +4440,310 @@ width0pt\relax} \fi \def\deftpx #1 {\errmessage{@deftpx in invalid context}} -\message{cross reference,} -% Define cross-reference macros -\newwrite \auxfile +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scanmacro#1{% + \begingroup \newlinechar`\^^M + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{#1}% + \immediate\closeout\macscribble + \let\xeatspaces\eatspaces + \input \jobname.tmp + \endgroup +} +\else +\def\scanmacro#1{% +\begingroup \newlinechar`\^^M +\let\xeatspaces\eatspaces\scantokens{#1}\endgroup} +\fi -\newif\ifhavexrefs % True if xref values are known. +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% Utility routines. +% Thisdoes \let #1 = #2, except with \csnames. +\def\cslet#1#2{% +\expandafter\expandafter +\expandafter\let +\expandafter\expandafter +\csname#1\endcsname +\csname#2\endcsname} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=12\catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\macrobodyctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\@=12 + \catcode`\^^M=12 + \usembodybackslash} + +\def\macroargctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\@=12 + \catcode`\\=12} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \expandafter\ifx \csname macsave.\the\macname\endcsname \relax + \cslet{macsave.\the\macname}{\the\macname}% + \else + \message{Warning: redefining \the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\def\unmacro{\parsearg\unmacroxxx} +\def\unmacroxxx#1{% + \expandafter\ifx \csname macsave.\the\macname\endcsname \relax + \errmessage{Macro \the\macname\ not defined.}% + \else + \cslet{#1}{macsave.#1}% + \expandafter\let \csname macsave.\the\macname\endcsname \undefined + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname} + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname} + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \next} + + +\message{cross references,} +\newwrite\auxfile + +\newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. -% @inforef is simple. +% @inforef is relatively 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. +% @node's job is to define \lastnode. +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax + +% The sectioning commands (@chapter, etc.) call these. +\def\donoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Ysectionnumberandtype}% + \global\let\lastnode=\relax + \fi +} +\def\unnumbnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% + \global\let\lastnode=\relax + \fi +} +\def\appendixnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Yappendixletterandtype}% + \global\let\lastnode=\relax + \fi +} + -\def\setref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ysectionnumberandtype}} +% @anchor{NAME} -- define xref target at arbitrary point. +% +\def\anchor#1{\setref{#1}{Ynothing}} -\def\unnumbsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ynothing}} -\def\appendixsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Yappendixletterandtype}} +% \setref{NAME}{SNT} defines a cross-reference point NAME, namely +% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have +% to set \indexdummies so commands such as @code in a section title +% aren't expanded. It would be nicer not to expand the titles in the +% first place, but there's so many layers that that is hard to do. +% +\def\setref#1#2{{% + \indexdummies + \dosetq{#1-title}{Ytitle}% + \dosetq{#1-pg}{Ypagenumber}% + \dosetq{#1-snt}{#2} +}} -% \xref, \pxref, and \ref generate cross-references to specified points. -% For \xrefX, #1 is the node name, #2 the name of the Info -% cross-reference, #3 the printed node name, #4 the name of the Info -% file, #5 the name of the printed manual. All but the node name can be -% omitted. +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} @@ -4147,7 +4761,7 @@ width0pt\relax} \fi \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. - \ifdim \wd1>0pt% + \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else @@ -4176,19 +4790,32 @@ width0pt\relax} \fi % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. - {\turnoffactive \refx{#1-snt}{}}% - \space [\printednodename],\space + {\normalturnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % [mynode], + [\printednodename],\space + % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endgroup} % \dosetq is the interface for calls from other macros -% Use \turnoffactive so that punctuation chars such as underscore -% work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive -\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% -\next}} +% Use \normalturnoffactive so that punctuation chars such as underscore +% and backslash work in node names. (\turnoffactive doesn't do \.) +\def\dosetq#1#2{% + {\let\folio=0 + \normalturnoffactive + \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% + \iflinks + \next + \fi + }% +} % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} @@ -4239,13 +4866,15 @@ width0pt\relax} \fi \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. - $\langle$un\-de\-fined$\rangle$% - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi \fi \fi \else @@ -4256,37 +4885,38 @@ width0pt\relax} \fi } % 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{\begingroup + % Reenable \ as an escape while reading the second argument. + \catcode`\\ = 0 + \afterassignment\endgroup + \expandafter\gdef\csname X#1\endcsname +} % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup \catcode`\^^@=\other - \catcode`\=\other - \catcode`\=\other + \catcode`\^^A=\other + \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other - \catcode`\ =\other + \catcode`\^^K=\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`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other @@ -4302,11 +4932,11 @@ width0pt\relax} \fi % 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 @@ -4318,8 +4948,7 @@ width0pt\relax} \fi \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other - % `\+ does not work, so use 43. - \catcode43=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 @@ -4364,7 +4993,7 @@ width0pt\relax} \fi % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } -% @footnotestyle is meaningful for info output only.. +% @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment \let\ptexfootnote=\footnote @@ -4389,7 +5018,7 @@ width0pt\relax} \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. @@ -4479,36 +5108,73 @@ width0pt\relax} \fi % \def\finalout{\overfullrule=0pt} - -% End of control word definitions. - -\message{and turning on texinfo input format.} - -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + \closein 1 + % Do not bother showing banner with post-v2.7 epsf.tex (available in + % doc/epsf.tex until it shows up on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +% +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://ftp.tug.org/tex/epsf.tex.} +% +% Only complain once about lack of epsf.tex. +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,\finish + \fi } +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is just the usual extra ignored arg for parsing this stuff. +\def\imagexxx#1,#2,#3,#4\finish{% + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + % If the image is by itself, center it. + \ifvmode + \nobreak\medskip + \nobreak + \centerline{\epsfbox{#1.eps}}% + \bigbreak + \else + \epsfbox{#1.eps}% + \fi +} + -% Set some numeric style parameters, for 8.5 x 11 format. +\message{paper sizes,} +% And other related parameters. -\hsize = 6in -\hoffset = .25in \newdimen\defaultparindent \defaultparindent = 15pt -\parindent = \defaultparindent -\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 +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 @@ -4517,101 +5183,126 @@ width0pt\relax} \fi % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on -% \hsize. This makes it come to about 9pt for the 8.5x11 format. +% \hsize. This makes it come to about 9pt for the 8.5x11 format. We +% call this whenever the paper size is set. % -\ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% -\else - \emergencystretch = \hsize - \divide\emergencystretch by 45 -\fi +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = \hsize + \divide\emergencystretch by 45 + \fi +} -% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) -\def\smallbook{ - \global\chapheadingskip = 15pt plus 4pt minus 2pt - \global\secheadingskip = 12pt plus 3pt minus 2pt - \global\subsecheadingskip = 9pt plus 2pt minus 2pt +% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; +% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can +% set \parskip and call \setleading for \baselineskip. +% +\def\internalpagesizes#1#2#3#4#5#6{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 0.6in + \pageheight = \vsize % - \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 + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize % - \global\pagewidth=\hsize - \global\pageheight=\vsize + \normaloffset = #4\relax + \bindingoffset = #5\relax % - \global\let\smalllisp=\smalllispx - \global\let\smallexample=\smalllispx - \global\def\Esmallexample{\Esmalllisp} + \parindent = \defaultparindent + \setemergencystretch } +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% +}} + +% Use @smallbook to reset parameters for 7x9.5 (or so) format. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \setleading{12pt}% + % + \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \deftypemargin = 0pt + \defbodyindent = .5cm + % + \let\smalldisplay = \smalldisplayx + \let\smallexample = \smalllispx + \let\smallformat = \smallformatx + \let\smalllisp = \smalllispx +}} + % Use @afourpaper to print on European A4 paper. -\def\afourpaper{ -\global\tolerance=700 -\global\hfuzz=1pt -\setleading{12pt} -\global\parskip 15pt plus 1pt - -\global\vsize= 53\baselineskip -\advance\vsize by \topskip -%\global\hsize= 5.85in % A4 wide 10pt -\global\hsize= 6.5in -\global\outerhsize=\hsize -\global\advance\outerhsize by 0.5in -\global\outervsize=\vsize -\global\advance\outervsize by 0.6in - -\global\pagewidth=\hsize -\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; -% header is additional; added length extends the bottom of the page. - -\def\changepagesizes#1#2#3#4#5#6{ - \global\vsize= #1 - \global\topskip= #6 - \advance\vsize by \topskip - \global\voffset= #3 - \global\hsize= #2 - \global\outerhsize=\hsize - \global\advance\outerhsize by 0.5in - \global\outervsize=\vsize - \global\advance\outervsize by 0.6in - \global\pagewidth=\hsize - \global\pageheight=\vsize - \global\normaloffset= #4 - \global\bindingoffset= #5} +\def\afourpaper{{\globaldefs = 1 + \setleading{12pt}% + \parskip = 3pt plus 2pt minus 1pt + % + \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % + \tolerance = 700 + \hfuzz = 1pt +}} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. -\def\afourlatex - {\global\tolerance=700 - \global\hfuzz=1pt - \setleading{12pt} - \global\parskip 15pt plus 1pt - \advance\baselineskip by 1.6pt - \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} - } +\def\afourlatex{{\globaldefs = 1 + \setleading{13.6pt}% + % + \afourpaper + \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + % + \globaldefs = 0 +}} % Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{\afourpaper -\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} +\def\afourwide{% + \afourpaper + \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% + % + \globaldefs = 0 +} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\def\pagesizes{\parsearg\pagesizesxxx} +\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% +}} + +% Set default to letter. +% +\letterpaper + +\message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other @@ -4648,10 +5339,10 @@ width0pt\relax} \fi % use math or other variants that look better in normal text. \catcode`\"=\active -\def\activedoublequote{{\tt \char '042}} +\def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active -\def~{{\tt \char '176}} +\def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} @@ -4662,7 +5353,7 @@ width0pt\relax} \fi \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active -\def|{{\tt \char '174}} +\def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} @@ -4749,8 +5440,8 @@ width0pt\relax} \fi @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active} -%% These look ok in all fonts, so just make them not special. The @rm below -%% makes sure that the current font starts out as the newly loaded cmr10 +% These look ok in all fonts, so just make them not special. The @rm below +% makes sure that the current font starts out as the newly loaded cmr10 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other @textfonts