home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / autoconf-2.10-bin.lha / info / autoconf.info (.txt) next >
GNU Info File  |  1996-10-12  |  233KB  |  4,382 lines

  1. This is Info file autoconf.info, produced by Makeinfo-1.64 from the
  2. input file /ade-src/fsf/autoconf/autoconf.texi.
  3. START-INFO-DIR-ENTRY
  4. * Autoconf: (autoconf).         Create source code configuration scripts.
  5. END-INFO-DIR-ENTRY
  6.    Autoconf: Creating Automatic Configuration Scripts, by David
  7. MacKenzie.
  8.    This file documents the GNU Autoconf package for creating scripts to
  9. configure source code packages using templates and an `m4' macro
  10. package.
  11.    Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation,
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided that
  17. the entire resulting derived work is distributed under the terms of a
  18. permission notice identical to this one.
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that this permission notice may be stated in a
  22. translation approved by the Foundation.
  23. File: autoconf.info,  Node: Top,  Next: Introduction,  Up: (dir)
  24.    This file documents the GNU Autoconf package for creating scripts to
  25. configure source code packages using templates and an `m4' macro
  26. package.  This is edition 2.8, for Autoconf version 2.8.
  27. * Menu:
  28. * Introduction::                Autoconf's purpose, strengths, and weaknesses.
  29. * Making configure Scripts::    How to organize and produce Autoconf scripts.
  30. * Setup::                       Initialization and output.
  31. * Existing Tests::              Macros that check for particular features.
  32. * Writing Tests::               How to write new feature checks.
  33. * Results::                     What to do with results from feature checks.
  34. * Writing Macros::              Adding new macros to Autoconf.
  35. * Manual Configuration::        Selecting features that can't be guessed.
  36. * Site Configuration::          Local defaults for `configure'.
  37. * Invoking configure::          How to use the Autoconf output.
  38. * Invoking config.status::      Recreating a configuration.
  39. * Questions::                   Questions about Autoconf, with answers.
  40. * Upgrading::                   Tips for upgrading from version 1.
  41. * History::                     History of Autoconf.
  42. * Old Macro Names::        Backward compatibility macros.
  43. * Environment Variable Index::  Index of environment variables used.
  44. * Output Variable Index::       Index of variables set in output files.
  45. * Preprocessor Symbol Index::   Index of C preprocessor symbols defined.
  46. * Macro Index::                 Index of Autoconf macros.
  47.  -- The Detailed Node Listing --
  48. Making `configure' Scripts
  49. * Writing configure.in::    What to put in an Autoconf input file.
  50. * Invoking autoscan::           Semi-automatic `configure.in' writing.
  51. * Invoking ifnames::            Listing the conditionals in source code.
  52. * Invoking autoconf::        How to create configuration scripts.
  53. * Invoking autoreconf::         Remaking multiple `configure' scripts.
  54. Initialization and Output Files
  55. * Input::                       Where Autoconf should find files.
  56. * Output::            Creating output files.
  57. * Makefile Substitutions::      Using output variables in `Makefile's.
  58. * Configuration Headers::       Creating a configuration header file.
  59. * Subdirectories::              Configuring independent packages together.
  60. * Default Prefix::              Changing the default installation prefix.
  61. * Versions::                    Version numbers in `configure'.
  62. Substitutions in Makefiles
  63. * Preset Output Variables::    Output variables that are always set.
  64. * Build Directories::       Supporting multiple concurrent compiles.
  65. * Automatic Remaking::        Makefile rules for configuring.
  66. Configuration Header Files
  67. * Header Templates::            Input for the configuration headers.
  68. * Invoking autoheader::        How to create configuration templates.
  69. Existing Tests
  70. * Alternative Programs::    Selecting between alternative programs.
  71. * Libraries::                   Library archives that might be missing.
  72. * Library Functions::        C library functions that might be missing.
  73. * Header Files::        Header files that might be missing.
  74. * Structures::            Structures or members that might be missing.
  75. * Typedefs::            `typedef's that might be missing.
  76. * Compiler Characteristics::    C compiler or machine architecture features.
  77. * System Services::        Operating system services.
  78. * UNIX Variants::        Special kludges for specific UNIX variants.
  79. Alternative Programs
  80. * Particular Programs::         Special handling to find certain programs.
  81. * Generic Programs::            How to find other programs.
  82. Library Functions
  83. * Particular Functions::        Special handling to find certain functions.
  84. * Generic Functions::           How to find other functions.
  85. Header Files
  86. * Particular Headers::          Special handling to find certain headers.
  87. * Generic Headers::             How to find other headers.
  88. Typedefs
  89. * Particular Typedefs::         Special handling to find certain types.
  90. * Generic Typedefs::            How to find other types.
  91. Writing Tests
  92. * Examining Declarations::    Detecting header files and declarations.
  93. * Examining Syntax::            Detecting language syntax features.
  94. * Examining Libraries::         Detecting functions and global variables.
  95. * Run Time::                Testing for run-time features.
  96. * Portable Shell::              Shell script portability pitfalls.
  97. * Testing Values and Files::    Checking strings and files.
  98. * Multiple Cases::        Tests for several possible values.
  99. * Language Choice::             Selecting which language to use for testing.
  100. Checking Run Time Behavior
  101. * Test Programs::               Running test programs.
  102. * Guidelines::            General rules for writing test programs.
  103. * Test Functions::        Avoiding pitfalls in test programs.
  104. Results of Tests
  105. * Defining Symbols::            Defining C preprocessor symbols.
  106. * Setting Output Variables::    Replacing variables in output files.
  107. * Caching Results::             Speeding up subsequent `configure' runs.
  108. * Printing Messages::           Notifying users of progress or problems.
  109. Caching Results
  110. * Cache Variable Names::        Shell variables used in caches.
  111. * Cache Files::                Files `configure' uses for caching.
  112. Writing Macros
  113. * Macro Definitions::        Basic format of an Autoconf macro.
  114. * Macro Names::                 What to call your new macros.
  115. * Quoting::            Protecting macros from unwanted expansion.
  116. * Dependencies Between Macros::    What to do when macros depend on other macros.
  117. Dependencies Between Macros
  118. * Prerequisite Macros::        Ensuring required information.
  119. * Suggested Ordering::        Warning about possible ordering problems.
  120. * Obsolete Macros::             Warning about old ways of doing things.
  121. Manual Configuration
  122. * Specifying Names::            Specifying the system type.
  123. * Canonicalizing::              Getting the canonical system type.
  124. * System Type Variables::       Variables containing the system type.
  125. * Using System Type::           What to do with the system type.
  126. Site Configuration
  127. * External Software::           Working with other optional software.
  128. * Package Options::             Selecting optional features.
  129. * Site Details::                Configuring site details.
  130. * Transforming Names::          Changing program names when installing.
  131. * Site Defaults::               Giving `configure' local defaults.
  132. Transforming Program Names When Installing
  133. * Transformation Options::      `configure' options to transform names.
  134. * Transformation Examples::     Sample uses of transforming names.
  135. * Transformation Rules::        `Makefile' uses of transforming names.
  136. Running `configure' Scripts
  137. * Basic Installation::          Instructions for typical cases.
  138. * Compilers and Options::       Selecting compilers and optimization.
  139. * Multiple Architectures::      Compiling for multiple architectures at once.
  140. * Installation Names::          Installing in different directories.
  141. * Optional Features::           Selecting optional features.
  142. * System Type::                 Specifying the system type.
  143. * Sharing Defaults::            Setting site-wide defaults for `configure'.
  144. * Operation Controls::          Changing how `configure' runs.
  145. Questions About Autoconf
  146. * Distributing::                Distributing `configure' scripts.
  147. * Why GNU m4::                  Why not use the standard `m4'?
  148. * Bootstrapping::               Autoconf and GNU `m4' require each other?
  149. * Why Not Imake::               Why GNU uses `configure' instead of Imake.
  150. Upgrading From Version 1
  151. * Changed File Names::          Files you might rename.
  152. * Changed Makefiles::           New things to put in `Makefile.in'.
  153. * Changed Macros::              Macro calls you might replace.
  154. * Invoking autoupdate::         Replacing old macro names in `configure.in'.
  155. * Changed Results::             Changes in how to check test results.
  156. * Changed Macro Writing::       Better ways to write your own macros.
  157. History of Autoconf
  158. * Genesis::            Prehistory and naming of `configure'.
  159. * Exodus::            The plagues of `m4' and Perl.
  160. * Leviticus::            The priestly code of portability arrives.
  161. * Numbers::            Growth and contributors.
  162. * Deuteronomy::            Approaching the promises of easy configuration.
  163. File: autoconf.info,  Node: Introduction,  Next: Making configure Scripts,  Prev: Top,  Up: Top
  164. Introduction
  165. ************
  166.      A physicist, an engineer, and a computer scientist were
  167.      discussing the nature of God.  Surely a Physicist, said the
  168.      physicist, because early in the Creation, God made Light; and you
  169.      know, Maxwell's equations, the dual nature of electro-magnetic
  170.      waves, the relativist consequences... An Engineer!, said the
  171.      engineer, because before making Light, God split the Chaos into
  172.      Land and Water; it takes a hell of an engineer to handle that big
  173.      amount of mud, and orderly separation of solids from
  174.      liquids... The computer scientist shouted: And the Chaos,
  175.      where do you think it was coming from, hmm?
  176.      
  177.      ---Anonymous
  178.    Autoconf is a tool for producing shell scripts that automatically
  179. configure software source code packages to adapt to many kinds of
  180. UNIX-like systems.  The configuration scripts produced by Autoconf are
  181. independent of Autoconf when they are run, so their users do not need to
  182. have Autoconf.
  183.    The configuration scripts produced by Autoconf require no manual user
  184. intervention when run; they do not normally even need an argument
  185. specifying the system type.  Instead, they test for the presence of each
  186. feature that the software package they are for might need individually.
  187. (Before each check, they print a one-line message stating what they are
  188. checking for, so the user doesn't get too bored while waiting for the
  189. script to finish.)  As a result, they deal well with systems that are
  190. hybrids or customized from the more common UNIX variants.  There is no
  191. need to maintain files that list the features supported by each release
  192. of each variant of UNIX.
  193.    For each software package that Autoconf is used with, it creates a
  194. configuration script from a template file that lists the system
  195. features that the package needs or can use.  After the shell code to
  196. recognize and respond to a system feature has been written, Autoconf
  197. allows it to be shared by many software packages that can use (or need)
  198. that feature.  If it later turns out that the shell code needs
  199. adjustment for some reason, it needs to be changed in only one place;
  200. all of the configuration scripts can be regenerated automatically to
  201. take advantage of the updated code.
  202.    The Metaconfig package is similar in purpose to Autoconf, but the
  203. scripts it produces require manual user intervention, which is quite
  204. inconvenient when configuring large source trees.  Unlike Metaconfig
  205. scripts, Autoconf scripts can support cross-compiling, if some care is
  206. taken in writing them.
  207.    There are several jobs related to making portable software packages
  208. that Autoconf currently does not do.  Among these are automatically
  209. creating `Makefile' files with all of the standard targets, and
  210. supplying replacements for standard library functions and header files
  211. on systems that lack them.  Work is in progress to add those features in
  212. the future.
  213.    Autoconf imposes some restrictions on the names of macros used with
  214. `#ifdef' in C programs (*note Preprocessor Symbol Index::.).
  215.    Autoconf requires GNU `m4' in order to generate the scripts.  It
  216. uses features that some UNIX versions of `m4' do not have.  It also
  217. overflows internal limits of some versions of `m4', including GNU `m4'
  218. 1.0.  You must use version 1.1 or later of GNU `m4'.  Using version 1.3
  219. or later will be much faster than 1.1 or 1.2.
  220.    *Note Upgrading::, for information about upgrading from version 1.
  221. *Note History::, for the story of Autoconf's development.  *Note
  222. Questions::, for answers to some common questions about Autoconf.
  223.    Mail suggestions and bug reports for Autoconf to
  224. `bug-gnu-utils@prep.ai.mit.edu'.  Please include the Autoconf version
  225. number, which you can get by running `autoconf --version'.
  226. File: autoconf.info,  Node: Making configure Scripts,  Next: Setup,  Prev: Introduction,  Up: Top
  227. Making `configure' Scripts
  228. **************************
  229.    The configuration scripts that Autoconf produces are by convention
  230. called `configure'.  When run, `configure' creates several files,
  231. replacing configuration parameters in them with appropriate values.
  232. The files that `configure' creates are:
  233.    * one or more `Makefile' files, one in each subdirectory of the
  234.      package (*note Makefile Substitutions::.);
  235.    * optionally, a C header file, the name of which is configurable,
  236.      containing `#define' directives (*note Configuration Headers::.);
  237.    * a shell script called `config.status' that, when run, will recreate
  238.      the files listed above (*note Invoking config.status::.);
  239.    * a shell script called `config.cache' that saves the results of
  240.      running many of the tests (*note Cache Files::.);
  241.    * a file called `config.log' containing any messages produced by
  242.      compilers, to help debugging if `configure' makes a mistake.
  243.    To create a `configure' script with Autoconf, you need to write an
  244. Autoconf input file `configure.in' and run `autoconf' on it.  If you
  245. write your own feature tests to supplement those that come with
  246. Autoconf, you might also write files called `aclocal.m4' and
  247. `acsite.m4'.  If you use a C header file to contain `#define'
  248. directives, you might also write `acconfig.h', and you will distribute
  249. the Autoconf-generated file `config.h.in' with the package.
  250.    Here is a diagram showing how the files that can be used in
  251. configuration are produced.  Programs that are executed are suffixed by
  252. `*'.  Optional files are enclosed in square brackets (`[]').
  253. `autoconf' and `autoheader' also read the installed Autoconf macro
  254. files (by reading `autoconf.m4').
  255. Files used in preparing a software package for distribution:
  256.      your source files --> [autoscan*] --> [configure.scan] --> configure.in
  257.      
  258.      configure.in --.   .------> autoconf* -----> configure
  259.                     +---+
  260.      [aclocal.m4] --+   `---.
  261.      [acsite.m4] ---'       |
  262.                             +--> [autoheader*] -> [config.h.in]
  263.      [acconfig.h] ----.     |
  264.                       +-----'
  265.      [config.h.top] --+
  266.      [config.h.bot] --'
  267.      
  268.      Makefile.in -------------------------------> Makefile.in
  269. Files used in configuring a software package:
  270.                             .-------------> config.cache
  271.      configure* ------------+-------------> config.log
  272.                             |
  273.      [config.h.in] -.       v            .-> [config.h] -.
  274.                     +--> config.status* -+               +--> make*
  275.      Makefile.in ---'                    `-> Makefile ---'
  276. * Menu:
  277. * Writing configure.in::    What to put in an Autoconf input file.
  278. * Invoking autoscan::           Semi-automatic `configure.in' writing.
  279. * Invoking ifnames::            Listing the conditionals in source code.
  280. * Invoking autoconf::        How to create configuration scripts.
  281. * Invoking autoreconf::         Remaking multiple `configure' scripts.
  282. File: autoconf.info,  Node: Writing configure.in,  Next: Invoking autoscan,  Up: Making configure Scripts
  283. Writing `configure.in'
  284. ======================
  285.    To produce a `configure' script for a software package, create a
  286. file called `configure.in' that contains invocations of the Autoconf
  287. macros that test the system features your package needs or can use.
  288. Autoconf macros already exist to check for many features; see *Note
  289. Existing Tests::, for their descriptions.  For most other features, you
  290. can use Autoconf template macros to produce custom checks; see *Note
  291. Writing Tests::, for information about them.  For especially tricky or
  292. specialized features, `configure.in' might need to contain some
  293. hand-crafted shell commands.  The `autoscan' program can give you a
  294. good start in writing `configure.in' (*note Invoking autoscan::., for
  295. more information).
  296.    The order in which `configure.in' calls the Autoconf macros is not
  297. important, with a few exceptions.  Every `configure.in' must contain a
  298. call to `AC_INIT' before the checks, and a call to `AC_OUTPUT' at the
  299. end (*note Output::.).  Additionally, some macros rely on other macros
  300. having been called first, because they check previously set values of
  301. some variables to decide what to do.  These macros are noted in the
  302. individual descriptions (*note Existing Tests::.), and they also warn
  303. you when creating `configure' if they are called out of order.
  304.    To encourage consistency, here is a suggested order for calling the
  305. Autoconf macros.  Generally speaking, the things near the end of this
  306. list could depend on things earlier in it.  For example, library
  307. functions could be affected by typedefs and libraries.
  308.      `AC_INIT(FILE)'
  309.      checks for programs
  310.      checks for libraries
  311.      checks for header files
  312.      checks for typedefs
  313.      checks for structures
  314.      checks for compiler characteristics
  315.      checks for library functions
  316.      checks for system services
  317.      `AC_OUTPUT([FILE...])'
  318.    It is best to put each macro call on its own line in `configure.in'.
  319. Most of the macros don't add extra newlines; they rely on the newline
  320. after the macro call to terminate the commands.  This approach makes
  321. the generated `configure' script a little easier to read by not
  322. inserting lots of blank lines.  It is generally safe to set shell
  323. variables on the same line as a macro call, because the shell allows
  324. assignments without intervening newlines.
  325.    When calling macros that take arguments, there must not be any blank
  326. space between the macro name and the open parenthesis.  Arguments can be
  327. more than one line long if they are enclosed within the `m4' quote
  328. characters `[' and `]'.  If you have a long line such as a list of file
  329. names, you can generally use a backslash at the end of a line to
  330. continue it logically on the next line (this is implemented by the
  331. shell, not by anything special that Autoconf does).
  332.    Some macros handle two cases: what to do if the given condition is
  333. met, and what to do if the condition is not met.  In some places you
  334. might want to do something if a condition is true but do nothing if it's
  335. false, or vice versa.  To omit the true case, pass an empty value for
  336. the ACTION-IF-FOUND argument to the macro.  To omit the false case,
  337. omit the ACTION-IF-NOT-FOUND argument to the macro, including the comma
  338. before it.
  339.    You can include comments in `configure.in' files by starting them
  340. with the `m4' builtin macro `dnl', which discards text up through the
  341. next newline.  These comments do not appear in the generated
  342. `configure' scripts.  For example, it is helpful to begin
  343. `configure.in' files with a line like this:
  344.      dnl Process this file with autoconf to produce a configure script.
  345. File: autoconf.info,  Node: Invoking autoscan,  Next: Invoking ifnames,  Prev: Writing configure.in,  Up: Making configure Scripts
  346. Using `autoscan' to Create `configure.in'
  347. =========================================
  348.    The `autoscan' program can help you create a `configure.in' file for
  349. a software package.  `autoscan' examines source files in the directory
  350. tree rooted at a directory given as a command line argument, or the
  351. current directory if none is given.  It searches the source files for
  352. common portability problems and creates a file `configure.scan' which
  353. is a preliminary `configure.in' for that package.
  354.    You should manually examine `configure.scan' before renaming it to
  355. `configure.in'; it will probably need some adjustments.  Occasionally
  356. `autoscan' outputs a macro in the wrong order relative to another
  357. macro, so that `autoconf' produces a warning; you need to move such
  358. macros manually.  Also, if you want the package to use a configuration
  359. header file, you must add a call to `AC_CONFIG_HEADER' (*note
  360. Configuration Headers::.).  You might also have to change or add some
  361. `#if' directives to your program in order to make it work with Autoconf
  362. (*note Invoking ifnames::., for information about a program that can
  363. help with that job).
  364.    `autoscan' uses several data files, which are installed along with
  365. the distributed Autoconf macro files, to determine which macros to
  366. output when it finds particular symbols in a package's source files.
  367. These files all have the same format.  Each line consists of a symbol,
  368. whitespace, and the Autoconf macro to output if that symbol is
  369. encountered.  Lines starting with `#' are comments.
  370.    `autoscan' is only installed if you already have Perl installed.
  371. `autoscan' accepts the following options:
  372. `--help'
  373.      Print a summary of the command line options and exit.
  374. `--macrodir=DIR'
  375.      Look for the data files in directory DIR instead of the default
  376.      installation directory.  You can also set the `AC_MACRODIR'
  377.      environment variable to a directory; this option overrides the
  378.      environment variable.
  379. `--verbose'
  380.      Print the names of the files it examines and the potentially
  381.      interesting symbols it finds in them.  This output can be
  382.      voluminous.
  383. `--version'
  384.      Print the version number of Autoconf and exit.
  385. File: autoconf.info,  Node: Invoking ifnames,  Next: Invoking autoconf,  Prev: Invoking autoscan,  Up: Making configure Scripts
  386. Using `ifnames' to List Conditionals
  387. ====================================
  388.    `ifnames' can help when writing a `configure.in' for a software
  389. package.  It prints the identifiers that the package already uses in C
  390. preprocessor conditionals.  If a package has already been set up to
  391. have some portability, this program can help you figure out what its
  392. `configure' needs to check for.  It may help fill in some gaps in a
  393. `configure.in' generated by `autoscan' (*note Invoking autoscan::.).
  394.    `ifnames' scans all of the C source files named on the command line
  395. (or the standard input, if none are given) and writes to the standard
  396. output a sorted list of all the identifiers that appear in those files
  397. in `#if', `#elif', `#ifdef', or `#ifndef' directives.  It prints each
  398. identifier on a line, followed by a space-separated list of the files
  399. in which that identifier occurs.
  400. `ifnames' accepts the following options:
  401. `--help'
  402.      Print a summary of the command line options and exit.
  403. `--macrodir=DIR'
  404. `-m DIR'
  405.      Look for the Autoconf macro files in directory DIR instead of the
  406.      default installation directory.  Only used to get the version
  407.      number.  You can also set the `AC_MACRODIR' environment variable
  408.      to a directory; this option overrides the environment variable.
  409. `--version'
  410.      Print the version number of Autoconf and exit.
  411. File: autoconf.info,  Node: Invoking autoconf,  Next: Invoking autoreconf,  Prev: Invoking ifnames,  Up: Making configure Scripts
  412. Using `autoconf' to Create `configure'
  413. ======================================
  414.    To create `configure' from `configure.in', run the `autoconf'
  415. program with no arguments.  `autoconf' processes `configure.in' with
  416. the `m4' macro processor, using the Autoconf macros.  If you give
  417. `autoconf' an argument, it reads that file instead of `configure.in'
  418. and writes the configuration script to the standard output instead of
  419. to `configure'.  If you give `autoconf' the argument `-', it reads the
  420. standard input instead of `configure.in' and writes the configuration
  421. script on the standard output.
  422.    The Autoconf macros are defined in several files.  Some of the files
  423. are distributed with Autoconf; `autoconf' reads them first.  Then it
  424. looks for the optional file `acsite.m4' in the directory that contains
  425. the distributed Autoconf macro files, and for the optional file
  426. `aclocal.m4' in the current directory.  Those files can contain your
  427. site's or the package's own Autoconf macro definitions (*note Writing
  428. Macros::., for more information).  If a macro is defined in more than
  429. one of the files that `autoconf' reads, the last definition it reads
  430. overrides the earlier ones.
  431.    `autoconf' accepts the following options:
  432. `--help'
  433.      Print a summary of the command line options and exit.
  434. `--localdir=DIR'
  435. `-l DIR'
  436.      Look for the package file `aclocal.m4' in directory DIR instead of
  437.      in the current directory.
  438. `--macrodir=DIR'
  439. `-m DIR'
  440.      Look for the installed macro files in directory DIR.  You can also
  441.      set the `AC_MACRODIR' environment variable to a directory; this
  442.      option overrides the environment variable.
  443. `--version'
  444.      Print the version number of Autoconf and exit.
  445. File: autoconf.info,  Node: Invoking autoreconf,  Prev: Invoking autoconf,  Up: Making configure Scripts
  446. Using `autoreconf' to Update `configure' Scripts
  447. ================================================
  448.    If you have a lot of Autoconf-generated `configure' scripts, the
  449. `autoreconf' program can save you some work.  It runs `autoconf' (and
  450. `autoheader', where appropriate) repeatedly to remake the Autoconf
  451. `configure' scripts and configuration header templates in the directory
  452. tree rooted at the current directory.  By default, it only remakes
  453. those files that are older than their `configure.in' or (if present)
  454. `aclocal.m4'.  Since `autoheader' does not change the timestamp of its
  455. output file if the file wouldn't be changing, this is not necessarily
  456. the minimum amount of work.  If you install a new version of Autoconf,
  457. you can make `autoreconf' remake *all* of the files by giving it the
  458. `--force' option.
  459.    If you give `autoreconf' the `--macrodir=DIR' or `--localdir=DIR'
  460. options, it passes them down to `autoconf' and `autoheader' (with
  461. relative paths adjusted properly).
  462.    *Note Automatic Remaking::, for `Makefile' rules to automatically
  463. remake `configure' scripts when their source files change.  That method
  464. handles the timestamps of configuration header templates properly, but
  465. does not pass `--macrodir=DIR' or `--localdir=DIR'.
  466. `autoreconf' accepts the following options:
  467. `--help'
  468.      Print a summary of the command line options and exit.
  469. `--force'
  470.      Remake even `configure' scripts and configuration headers that are
  471.      newer than their input files (`configure.in' and, if present,
  472.      `aclocal.m4').
  473. `--localdir=DIR'
  474. `-l DIR'
  475.      Look for the package files `aclocal.m4' and `acconfig.h' (but not
  476.      `FILE.top' and `FILE.bot') in directory DIR instead of in the
  477.      directory containing each `configure.in'.
  478. `--macrodir=DIR'
  479. `-m DIR'
  480.      Look for the Autoconf macro files in directory DIR instead of the
  481.      default installation directory.  You can also set the `AC_MACRODIR'
  482.      environment variable to a directory; this option overrides the
  483.      environment variable.
  484. `--verbose'
  485.      Print the name of each directory where `autoreconf' runs
  486.      `autoconf' (and `autoheader', if appropriate).
  487. `--version'
  488.      Print the version number of Autoconf and exit.
  489. File: autoconf.info,  Node: Setup,  Next: Existing Tests,  Prev: Making configure Scripts,  Up: Top
  490. Initialization and Output Files
  491. *******************************
  492.    Autoconf-generated `configure' scripts need some information about
  493. how to initialize, such as how to find the package's source files; and
  494. about the output files to produce.  The following sections describe
  495. initialization and creating output files.
  496. * Menu:
  497. * Input::                       Where Autoconf should find files.
  498. * Output::            Creating output files.
  499. * Makefile Substitutions::      Using output variables in `Makefile's.
  500. * Configuration Headers::       Creating a configuration header file.
  501. * Subdirectories::              Configuring independent packages together.
  502. * Default Prefix::              Changing the default installation prefix.
  503. * Versions::                    Version numbers in `configure'.
  504. File: autoconf.info,  Node: Input,  Next: Output,  Up: Setup
  505. Finding `configure' Input
  506. =========================
  507.    Every `configure' script must call `AC_INIT' before doing anything
  508. else.  The only other required macro is `AC_OUTPUT' (*note Output::.).
  509.  - Macro: AC_INIT (UNIQUE-FILE-IN-SOURCE-DIR)
  510.      Process any command-line arguments and find the source code
  511.      directory.  UNIQUE-FILE-IN-SOURCE-DIR is some file that is in the
  512.      package's source directory; `configure' checks for this file's
  513.      existence to make sure that the directory that it is told contains
  514.      the source code in fact does.  Occasionally people accidentally
  515.      specify the wrong directory with `--srcdir'; this is a safety
  516.      check.  *Note Invoking configure::, for more information.
  517.    Packages that do manual configuration or use the `install' program
  518. might need to tell `configure' where to find some other shell scripts
  519. by calling `AC_CONFIG_AUX_DIR', though the default places it looks are
  520. correct for most cases.
  521.  - Macro: AC_CONFIG_AUX_DIR(DIR)
  522.      Use the `install-sh', `config.sub', `config.guess', and Cygnus
  523.      `configure' scripts that are in directory DIR.  These are
  524.      auxiliary files used in configuration.  DIR can be either absolute
  525.      or relative to `SRCDIR'.  The default is `SRCDIR' or `SRCDIR/..' or
  526.      `SRCDIR/../..', whichever is the first that contains `install-sh'.
  527.      The other files are not checked for, so that using
  528.      `AC_PROG_INSTALL' does not automatically require distributing the
  529.      other auxiliary files.  It checks for `install.sh' also, but that
  530.      name is obsolete because some `make' programs have a rule that
  531.      creates `install' from it if there is no `Makefile'.
  532. File: autoconf.info,  Node: Output,  Next: Makefile Substitutions,  Prev: Input,  Up: Setup
  533. Creating Output Files
  534. =====================
  535.    Every Autoconf-generated `configure' script must finish by calling
  536. `AC_OUTPUT'.  It is the macro that creates the `Makefile's and optional
  537. other files resulting from configuration.  The only other required
  538. macro is `AC_INIT' (*note Input::.).
  539.  - Macro: AC_OUTPUT ([FILE...] [,EXTRA-CMDS] [,INIT-CMDS])
  540.      Create output files.  The FILE... argument is a
  541.      whitespace-separated list of output files; it may be empty.  This
  542.      macro creates each file `FILE' by copying an input file (by default
  543.      named `FILE.in'), substituting the output variable values.  *Note
  544.      Makefile Substitutions::, for more information on using output
  545.      variables.  *Note Setting Output Variables::, for more information
  546.      on creating them.  This macro creates the directory that the file
  547.      is in if it doesn't exist (but not the parents of that directory).
  548.      Usually, `Makefile's are created this way, but other files, such
  549.      as `.gdbinit', can be specified as well.
  550.      If `AC_CONFIG_HEADER', `AC_LINK_FILES', or `AC_CONFIG_SUBDIRS' has
  551.      been called, this macro also creates the files named as their
  552.      arguments.
  553.      A typical call to `AC_OUTPUT' looks like this:
  554.           AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)
  555.      You can override an input file name by appending it to FILE,
  556.      separated by a colon.  For example,
  557.           AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
  558.      If you pass EXTRA-CMDS, those commands will be inserted into
  559.      `config.status' to be run after all its other processing.  If
  560.      INIT-CMDS are given, they are inserted just before EXTRA-CMDS,
  561.      with shell variable, command, and backslash substitutions
  562.      performed on them in `configure'.  You can use INIT-CMDS to pass
  563.      variables from `configure' to the EXTRA-CMDS.
  564.    If you run `make' on subdirectories, you should run it using the
  565. `make' variable `MAKE'.  Most versions of `make' set `MAKE' to the name
  566. of the `make' program plus any options it was given.  (But many do not
  567. include in it the values of any variables set on the command line, so
  568. those are not passed on automatically.) Some old versions of `make' do
  569. not set this variable.  The following macro allows you to use it even
  570. with those versions.
  571.  - Macro: AC_PROG_MAKE_SET
  572.      If `make' predefines the variable `MAKE', define output variable
  573.      `SET_MAKE' to be empty.  Otherwise, define `SET_MAKE' to contain
  574.      `MAKE=make'.  Calls `AC_SUBST' for `SET_MAKE'.
  575.    To use this macro, place a line like this in each `Makefile.in' that
  576. runs `MAKE' on other directories:
  577.      @SET_MAKE@
  578. File: autoconf.info,  Node: Makefile Substitutions,  Next: Configuration Headers,  Prev: Output,  Up: Setup
  579. Substitutions in Makefiles
  580. ==========================
  581.    Each subdirectory in a distribution that contains something to be
  582. compiled or installed should come with a file `Makefile.in', from which
  583. `configure' will create a `Makefile' in that directory.  To create a
  584. `Makefile', `configure' performs a simple variable substitution,
  585. replacing occurrences of `@VARIABLE@' in `Makefile.in' with the value
  586. that `configure' has determined for that variable.  Variables that are
  587. substituted into output files in this way are called "output
  588. variables".  They are ordinary shell variables that are set in
  589. `configure'.  To make `configure' substitute a particular variable into
  590. the output files, the macro `AC_SUBST' must be called with that
  591. variable name as an argument.  Any occurrences of `@VARIABLE@' for
  592. other variables are left unchanged.  *Note Setting Output Variables::,
  593. for more information on creating output variables with `AC_SUBST'.
  594.    A software package that uses a `configure' script should be
  595. distributed with a file `Makefile.in', but no `Makefile'; that way, the
  596. user has to properly configure the package for the local system before
  597. compiling it.
  598.    *Note Makefile Conventions: (standards)Makefile Conventions, for
  599. more information on what to put in `Makefile's.
  600. * Menu:
  601. * Preset Output Variables::    Output variables that are always set.
  602. * Build Directories::       Supporting multiple concurrent compiles.
  603. * Automatic Remaking::        Makefile rules for configuring.
  604. File: autoconf.info,  Node: Preset Output Variables,  Next: Build Directories,  Up: Makefile Substitutions
  605. Preset Output Variables
  606. -----------------------
  607.    Some output variables are preset by the Autoconf macros.  Some of the
  608. Autoconf macros set additional output variables, which are mentioned in
  609. the descriptions for those macros.  *Note Output Variable Index::, for a
  610. complete list of output variables.  Here is what each of the preset ones
  611. contains.  *Note Variables for Installation Directories:
  612. (standards)Directory Variables, for more information about the
  613. variables with names that end in `dir'.
  614.  - Variable: bindir
  615.      The directory for installing executables that users run.
  616.  - Variable: configure_input
  617.      A comment saying that the file was generated automatically by
  618.      `configure' and giving the name of the input file.  `AC_OUTPUT'
  619.      adds a comment line containing this variable to the top of every
  620.      `Makefile' it creates.  For other files, you should reference this
  621.      variable in a comment at the top of each input file.  For example,
  622.      an input shell script should begin like this:
  623.           #! /bin/sh
  624.           # @configure_input@
  625.      The presence of that line also reminds people editing the file
  626.      that it needs to be processed by `configure' in order to be used.
  627.  - Variable: datadir
  628.      The directory for installing read-only architecture-independent
  629.      data.
  630.  - Variable: exec_prefix
  631.      The installation prefix for architecture-dependent files.
  632.  - Variable: includedir
  633.      The directory for installing C header files.
  634.  - Variable: infodir
  635.      The directory for installing documentation in Info format.
  636.  - Variable: libdir
  637.      The directory for installing object code libraries.
  638.  - Variable: libexecdir
  639.      The directory for installing executables that other programs run.
  640.  - Variable: localstatedir
  641.      The directory for installing modifiable single-machine data.
  642.  - Variable: mandir
  643.      The top-level directory for installing documentation in man format.
  644.  - Variable: oldincludedir
  645.      The directory for installing C header files for non-gcc compilers.
  646.  - Variable: prefix
  647.      The installation prefix for architecture-independent files.
  648.  - Variable: sbindir
  649.      The directory for installing executables that system
  650.      administrators run.
  651.  - Variable: sharedstatedir
  652.      The directory for installing modifiable architecture-independent
  653.      data.
  654.  - Variable: srcdir
  655.      The directory that contains the source code for that `Makefile'.
  656.  - Variable: sysconfdir
  657.      The directory for installing read-only single-machine data.
  658.  - Variable: top_srcdir
  659.      The top-level source code directory for the package.  In the
  660.      top-level directory, this is the same as `srcdir'.
  661.  - Variable: CFLAGS
  662.      Debugging and optimization options for the C compiler.  If it is
  663.      not set in the environment when `configure' runs, the default
  664.      value is set when you call `AC_PROG_CC' (or empty if you don't).
  665.      `configure' uses this variable when compiling programs to test for
  666.      C features.
  667.  - Variable: CPPFLAGS
  668.      Header file search directory (`-IDIR') and any other miscellaneous
  669.      options for the C preprocessor and compiler.  If it is not set in
  670.      the environment when `configure' runs, the default value is empty.
  671.      `configure' uses this variable when compiling or preprocessing
  672.      programs to test for C features.
  673.  - Variable: CXXFLAGS
  674.      Debugging and optimization options for the C++ compiler.  If it is
  675.      not set in the environment when `configure' runs, the default
  676.      value is set when you call `AC_PROG_CXX' (or empty if you don't).
  677.      `configure' uses this variable when compiling programs to test for
  678.      C++ features.
  679.  - Variable: DEFS
  680.      `-D' options to pass to the C compiler.  If `AC_CONFIG_HEADER' is
  681.      called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H'
  682.      instead (*note Configuration Headers::.).  This variable is not
  683.      defined while `configure' is performing its tests, only when
  684.      creating the output files.  *Note Setting Output Variables::, for
  685.      how to check the results of previous tests.
  686.  - Variable: LDFLAGS
  687.      Stripping (`-s') and any other miscellaneous options for the
  688.      linker.  If it is not set in the environment when `configure' runs,
  689.      the default value is empty.  `configure' uses this variable when
  690.      linking programs to test for C features.
  691.  - Variable: LIBS
  692.      `-l' and `-L' options to pass to the linker.
  693. File: autoconf.info,  Node: Build Directories,  Next: Automatic Remaking,  Prev: Preset Output Variables,  Up: Makefile Substitutions
  694. Build Directories
  695. -----------------
  696.    You can support compiling a software package for several
  697. architectures simultaneously from the same copy of the source code.
  698. The object files for each architecture are kept in their own directory.
  699.    To support doing this, `make' uses the `VPATH' variable to find the
  700. files that are in the source directory.  GNU `make' and most other
  701. recent `make' programs can do this.  Older `make' programs do not
  702. support `VPATH'; when using them, the source code must be in the same
  703. directory as the object files.
  704.    To support `VPATH', each `Makefile.in' should contain two lines that
  705. look like:
  706.      srcdir = @srcdir@
  707.      VPATH = @srcdir@
  708.    Do not set `VPATH' to the value of another variable, for example
  709. `VPATH = $(srcdir)', because some versions of `make' do not do variable
  710. substitutions on the value of `VPATH'.
  711.    `configure' substitutes in the correct value for `srcdir' when it
  712. produces `Makefile'.
  713.    Do not use the `make' variable `$<', which expands to the pathname
  714. of the file in the source directory (found with `VPATH'), except in
  715. implicit rules.  (An implicit rule is one such as `.c.o', which tells
  716. how to create a `.o' file from a `.c' file.)  Some versions of `make'
  717. do not set `$<' in explicit rules; they expand it to an empty value.
  718.    Instead, `Makefile' command lines should always refer to source
  719. files by prefixing them with `$(srcdir)/'.  For example:
  720.      time.info: time.texinfo
  721.              $(MAKEINFO) $(srcdir)/time.texinfo
  722. File: autoconf.info,  Node: Automatic Remaking,  Prev: Build Directories,  Up: Makefile Substitutions
  723. Automatic Remaking
  724. ------------------
  725.    You can put rules like the following in the top-level `Makefile.in'
  726. for a package to automatically update the configuration information when
  727. you change the configuration files.  This example includes all of the
  728. optional files, such as `aclocal.m4' and those related to configuration
  729. header files.  Omit from the `Makefile.in' rules any of these files
  730. that your package does not use.
  731.    The `${srcdir}/' prefix is included because of limitations in the
  732. `VPATH' mechanism.
  733.    The `stamp-' files are necessary because the timestamps of
  734. `config.h.in' and `config.h' will not be changed if remaking them does
  735. not change their contents.  This feature avoids unnecessary
  736. recompilation.  You should include the file `stamp-h.in' your package's
  737. distribution, so `make' will consider `config.h.in' up to date.  On
  738. some old BSD systems, `touch' or any command that results in an empty
  739. file does not update the timestamps, so use a command like `echo' as a
  740. workaround.
  741.      ${srcdir}/configure: configure.in aclocal.m4
  742.              cd ${srcdir} && autoconf
  743.      
  744.      # autoheader might not change config.h.in, so touch a stamp file.
  745.      ${srcdir}/config.h.in: stamp-h.in
  746.      ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
  747.          config.h.top config.h.bot
  748.              cd ${srcdir} && autoheader
  749.              echo timestamp > ${srcdir}/stamp-h.in
  750.      
  751.      config.h: stamp-h
  752.      stamp-h: config.h.in config.status
  753.              ./config.status
  754.      
  755.      Makefile: Makefile.in config.status
  756.              ./config.status
  757.      
  758.      config.status: configure
  759.              ./config.status --recheck
  760.    In addition, you should pass `echo timestamp > stamp-h' in the
  761. EXTRA-CMDS argument to `AC_OUTPUT', so `config.status' will ensure that
  762. `config.h' is considered up to date.  *Note Output::, for more
  763. information about `AC_OUTPUT'.
  764.    *Note Invoking config.status::, for more examples of handling
  765. configuration-related dependencies.
  766. File: autoconf.info,  Node: Configuration Headers,  Next: Subdirectories,  Prev: Makefile Substitutions,  Up: Setup
  767. Configuration Header Files
  768. ==========================
  769.    When a package tests more than a few C preprocessor symbols, the
  770. command lines to pass `-D' options to the compiler can get quite long.
  771. This causes two problems.  One is that the `make' output is hard to
  772. visually scan for errors.  More seriously, the command lines can exceed
  773. the length limits of some operating systems.  As an alternative to
  774. passing `-D' options to the compiler, `configure' scripts can create a
  775. C header file containing `#define' directives.  The `AC_CONFIG_HEADER'
  776. macro selects this kind of output.  It should be called right after
  777. `AC_INIT'.
  778.    The package should `#include' the configuration header file before
  779. any other header files, to prevent inconsistencies in declarations (for
  780. example, if it redefines `const').  Use `#include <config.h>' instead
  781. of `#include "config.h"', and pass the C compiler a `-I.' option (or
  782. `-I..'; whichever directory contains `config.h').  That way, even if
  783. the source directory is configured itself (perhaps to make a
  784. distribution), other build directories can also be configured without
  785. finding the `config.h' from the source directory.
  786.  - Macro: AC_CONFIG_HEADER (HEADER-TO-CREATE ...)
  787.      Make `AC_OUTPUT' create the file(s) in the whitespace-separated
  788.      list HEADER-TO-CREATE containing C preprocessor `#define'
  789.      statements, and replace `@DEFS@' in generated files with
  790.      `-DHAVE_CONFIG_H' instead of the value of `DEFS'.  The usual name
  791.      for HEADER-TO-CREATE is `config.h'.
  792.      If HEADER-TO-CREATE already exists and its contents are identical
  793.      to what `AC_OUTPUT' would put in it, it is left alone.  Doing this
  794.      allows some changes in configuration without needlessly causing
  795.      object files that depend on the header file to be recompiled.
  796.      Usually the input file is named `HEADER-TO-CREATE.in'; however,
  797.      you can override the input file name by appending it to
  798.      HEADER-TO-CREATE, separated by a colon.  For example,
  799.           AC_CONFIG_HEADER(defines.h:defines.hin)
  800.      Doing this allows you to keep your filenames acceptable to MS-DOS.
  801. * Menu:
  802. * Header Templates::            Input for the configuration headers.
  803. * Invoking autoheader::        How to create configuration templates.
  804. File: autoconf.info,  Node: Header Templates,  Next: Invoking autoheader,  Up: Configuration Headers
  805. Configuration Header Templates
  806. ------------------------------
  807.    Your distribution should contain a template file that looks as you
  808. want the final header file to look, including comments, with default
  809. values in the `#define' statements.  For example, suppose your
  810. `configure.in' makes these calls:
  811.      AC_CONFIG_HEADER(conf.h)
  812.      AC_CHECK_HEADERS(unistd.h)
  813. Then you could have code like the following in `conf.h.in'.  On systems
  814. that have `unistd.h', `configure' will change the 0 to a 1.  On other
  815. systems, it will leave the line unchanged.
  816.      /* Define as 1 if you have unistd.h.  */
  817.      #define HAVE_UNISTD_H 0
  818.    Alternately, if your code tests for configuration options using
  819. `#ifdef' instead of `#if', a default value can be to `#undef' the
  820. variable instead of to define it to a value.  On systems that have
  821. `unistd.h', `configure' will change the second line to read `#define
  822. HAVE_UNISTD_H 1'.  On other systems, it will comment that line out (in
  823. case the system predefines that symbol).
  824.      /* Define if you have unistd.h.  */
  825.      #undef HAVE_UNISTD_H
  826. File: autoconf.info,  Node: Invoking autoheader,  Prev: Header Templates,  Up: Configuration Headers
  827. Using `autoheader' to Create `config.h.in'
  828. ------------------------------------------
  829.    The `autoheader' program can create a template file of C `#define'
  830. statements for `configure' to use.  If `configure.in' invokes
  831. `AC_CONFIG_HEADER(FILE)', `autoheader' creates `FILE.in'; if multiple
  832. file arguments are given, the first one is used.  Otherwise,
  833. `autoheader' creates `config.h.in'.
  834.    If you give `autoheader' an argument, it uses that file instead of
  835. `configure.in' and writes the header file to the standard output
  836. instead of to `config.h.in'.  If you give `autoheader' an argument of
  837. `-', it reads the standard input instead of `configure.in' and writes
  838. the header file to the standard output.
  839.    `autoheader' scans `configure.in' and figures out which C
  840. preprocessor symbols it might define.  It copies comments and `#define'
  841. and `#undef' statements from a file called `acconfig.h', which comes
  842. with and is installed with Autoconf.  It also uses a file called
  843. `acconfig.h' in the current directory, if present.  If you `AC_DEFINE'
  844. any additional symbols, you must create that file with entries for
  845. them.  For symbols defined by `AC_CHECK_HEADERS', `AC_CHECK_FUNCS',
  846. `AC_CHECK_SIZEOF', or `AC_CHECK_LIB', `autoheader' generates comments
  847. and `#undef' statements itself rather than copying them from a file,
  848. since the possible symbols are effectively limitless.
  849.    The file that `autoheader' creates contains mainly `#define' and
  850. `#undef' statements and their accompanying comments.  If `./acconfig.h'
  851. contains the string `@TOP@', `autoheader' copies the lines before the
  852. line containing `@TOP@' into the top of the file that it generates.
  853. Similarly, if `./acconfig.h' contains the string `@BOTTOM@',
  854. `autoheader' copies the lines after that line to the end of the file it
  855. generates.  Either or both of those strings may be omitted.
  856.    An alternate way to produce the same effect is to create the files
  857. `FILE.top' (typically `config.h.top') and/or `FILE.bot' in the current
  858. directory.  If they exist, `autoheader' copies them to the beginning
  859. and end, respectively, of its output.  Their use is discouraged because
  860. they have file names that contain two periods, and so can not be stored
  861. on MS-DOS; also, they are two more files to clutter up the directory.
  862. But if you use the `--localdir=DIR' option to use an `acconfig.h' in
  863. another directory, they give you a way to put custom boilerplate in each
  864. individual `config.h.in'.
  865.    `autoheader' accepts the following options:
  866. `--help'
  867.      Print a summary of the command line options and exit.
  868. `--localdir=DIR'
  869. `-l DIR'
  870.      Look for the package files `aclocal.m4' and `acconfig.h' (but not
  871.      `FILE.top' and `FILE.bot') in directory DIR instead of in the
  872.      current directory.
  873. `--macrodir=DIR'
  874. `-m DIR'
  875.      Look for the installed macro files and `acconfig.h' in directory
  876.      DIR.  You can also set the `AC_MACRODIR' environment variable to a
  877.      directory; this option overrides the environment variable.
  878. `--version'
  879.      Print the version number of Autoconf and exit.
  880. File: autoconf.info,  Node: Subdirectories,  Next: Default Prefix,  Prev: Configuration Headers,  Up: Setup
  881. Configuring Other Packages in Subdirectories
  882. ============================================
  883.    In most situations, calling `AC_OUTPUT' is sufficient to produce
  884. `Makefile's in subdirectories.  However, `configure' scripts that
  885. control more than one independent package can use `AC_CONFIG_SUBDIRS'
  886. to run `configure' scripts for other packages in subdirectories.
  887.  - Macro: AC_CONFIG_SUBDIRS (DIR ...)
  888.      Make `AC_OUTPUT' run `configure' in each subdirectory DIR in the
  889.      given whitespace-separated list.  If a given DIR is not found, no
  890.      error is reported, so a `configure' script can configure whichever
  891.      parts of a large source tree are present.  If a given DIR contains
  892.      `configure.in' but no `configure', the Cygnus `configure' script
  893.      found by `AC_CONFIG_AUXDIR' is used.  The subdirectory `configure'
  894.      scripts are given the same command line options that were given to
  895.      this `configure' script, with minor changes if needed (e.g., to
  896.      adjust a relative path for the cache file or source directory).
  897.      This macro also sets the output variable `subdirs' to the list of
  898.      directories `DIR ...'.  `Makefile' rules can use this variable to
  899.      determine which subdirectories to recurse into.
  900. File: autoconf.info,  Node: Default Prefix,  Next: Versions,  Prev: Subdirectories,  Up: Setup
  901. Default Prefix
  902. ==============
  903.    By default, `configure' sets the prefix for files it installs to
  904. `/usr/local'.  The user of `configure' can select a different prefix
  905. using the `--prefix' and `--exec-prefix' options.  There are two ways
  906. to change the default: when creating `configure', and when running it.
  907.    Some software packages might want to install in a directory besides
  908. `/usr/local' by default.  To accomplish that, use the
  909. `AC_PREFIX_DEFAULT' macro.
  910.  - Macro: AC_PREFIX_DEFAULT (PREFIX)
  911.      Set the default installation prefix to PREFIX instead of
  912.      `/usr/local'.
  913.    It may be convenient for users to have `configure' guess the
  914. installation prefix from the location of a related program that they
  915. have already installed.  If you wish to do that, you can call
  916. `AC_PREFIX_PROGRAM'.
  917.  - Macro: AC_PREFIX_PROGRAM (PROGRAM)
  918.      If the user did not specify an installation prefix (using the
  919.      `--prefix' option), guess a value for it by looking for PROGRAM in
  920.      `PATH', the way the shell does.  If PROGRAM is found, set the
  921.      prefix to the parent of the directory containing PROGRAM;
  922.      otherwise leave the prefix specified in `Makefile.in' unchanged.
  923.      For example, if PROGRAM is `gcc' and the `PATH' contains
  924.      `/usr/local/gnu/bin/gcc', set the prefix to `/usr/local/gnu'.
  925. File: autoconf.info,  Node: Versions,  Prev: Default Prefix,  Up: Setup
  926. Version Numbers in `configure'
  927. ==============================
  928.    The following macros manage version numbers for `configure' scripts.
  929. Using them is optional.
  930.  - Macro: AC_PREREQ (VERSION)
  931.      Ensure that a recent enough version of Autoconf is being used.  If
  932.      the version of Autoconf being used to create `configure' is earlier
  933.      than VERSION, print an error message on the standard error output
  934.      and do not create `configure'.  For example:
  935.           AC_PREREQ(1.8)
  936.      This macro is useful if your `configure.in' relies on non-obvious
  937.      behavior that changed between Autoconf releases.  If it merely
  938.      needs recently added macros, then `AC_PREREQ' is less useful,
  939.      because the `autoconf' program already tells the user which macros
  940.      are not found.  The same thing happens if `configure.in' is
  941.      processed by a version of Autoconf older than when `AC_PREREQ' was
  942.      added.
  943.  - Macro: AC_REVISION (REVISION-INFO)
  944.      Copy revision stamp REVISION-INFO into the `configure' script,
  945.      with any dollar signs or double-quotes removed.  This macro lets
  946.      you put a revision stamp from `configure.in' into `configure'
  947.      without RCS or CVS changing it when you check in `configure'.  That
  948.      way, you can determine easily which revision of `configure.in' a
  949.      particular `configure' corresponds to.
  950.      It is a good idea to call this macro before `AC_INIT' so that the
  951.      revision number is near the top of both `configure.in' and
  952.      `configure'.  To support doing that, the `AC_REVISION' output
  953.      begins with `#! /bin/sh', like the normal start of a `configure'
  954.      script does.
  955.      For example, this line in `configure.in':
  956.           AC_REVISION($Revision: 1.30 $)dnl
  957.      produces this in `configure':
  958.           #! /bin/sh
  959.           # From configure.in Revision: 1.30
  960. File: autoconf.info,  Node: Existing Tests,  Next: Writing Tests,  Prev: Setup,  Up: Top
  961. Existing Tests
  962. **************
  963.    These macros test for particular system features that packages might
  964. need or want to use.  If you need to test for a kind of feature that
  965. none of these macros check for, you can probably do it by calling
  966. primitive test macros with appropriate arguments (*note Writing
  967. Tests::.).
  968.    These tests print messages telling the user which feature they're
  969. checking for, and what they find.  They cache their results for future
  970. `configure' runs (*note Caching Results::.).
  971.    Some of these macros set output variables.  *Note Makefile
  972. Substitutions::, for how to get their values.  The phrase "define NAME"
  973. is used below as a shorthand to mean "define C preprocessor symbol NAME
  974. to the value 1".  *Note Defining Symbols::, for how to get those symbol
  975. definitions into your program.
  976. * Menu:
  977. * Alternative Programs::    Selecting between alternative programs.
  978. * Libraries::                   Library archives that might be missing.
  979. * Library Functions::        C library functions that might be missing.
  980. * Header Files::        Header files that might be missing.
  981. * Structures::            Structures or members that might be missing.
  982. * Typedefs::            `typedef's that might be missing.
  983. * Compiler Characteristics::    C compiler or machine architecture features.
  984. * System Services::        Operating system services.
  985. * UNIX Variants::        Special kludges for specific UNIX variants.
  986. File: autoconf.info,  Node: Alternative Programs,  Next: Libraries,  Up: Existing Tests
  987. Alternative Programs
  988. ====================
  989.    These macros check for the presence or behavior of particular
  990. programs.  They are used to choose between several alternative programs
  991. and to decide what to do once one has been chosen.  If there is no
  992. macro specifically defined to check for a program you need, and you
  993. don't need to check for any special properties of it, then you can use
  994. one of the general program check macros.
  995. * Menu:
  996. * Particular Programs::         Special handling to find certain programs.
  997. * Generic Programs::            How to find other programs.
  998. File: autoconf.info,  Node: Particular Programs,  Next: Generic Programs,  Up: Alternative Programs
  999. Particular Program Checks
  1000. -------------------------
  1001.    These macros check for particular programs--whether they exist, and
  1002. in some cases whether they support certain features.
  1003.  - Macro: AC_DECL_YYTEXT
  1004.      Define `YYTEXT_POINTER' if `yytext' is a `char *' instead of a
  1005.      `char []'.  Also set output variable `LEX_OUTPUT_ROOT' to the base
  1006.      of the file name that the lexer generates; usually `lex.yy', but
  1007.      sometimes something else.  These results vary according to whether
  1008.      `lex' or `flex' is being used.
  1009.  - Macro: AC_PROG_AWK
  1010.      Check for `mawk', `gawk', `nawk', and `awk', in that order, and
  1011.      set output variable `AWK' to the first one that it finds.  It
  1012.      tries `mawk' first because that is reported to be the fastest
  1013.      implementation.
  1014.  - Macro: AC_PROG_CC
  1015.      Determine a C compiler to use.  If `CC' is not already set in the
  1016.      environment, check for `gcc', and use `cc' if it's not found.  Set
  1017.      output variable `CC' to the name of the compiler found.
  1018.      If using the GNU C compiler, set shell variable `GCC' to `yes',
  1019.      empty otherwise.  If output variable `CFLAGS' was not already set,
  1020.      set it to `-g -O' for the GNU C compiler (`-O' on systems where
  1021.      GCC does not accept `-g'), or `-g' for other compilers.
  1022.  - Macro: AC_PROG_CC_C_O
  1023.      If the C compiler does not accept the `-c' and `-o' options
  1024.      simultaneously, define `NO_MINUS_C_MINUS_O'.
  1025.  - Macro: AC_PROG_CPP
  1026.      Set output variable `CPP' to a command that runs the C
  1027.      preprocessor.  If `$CC -E' doesn't work, it uses `/lib/cpp'.  It
  1028.      is only portable to run `CPP' on files with a `.c' extension.
  1029.      If the current language is C (*note Language Choice::.), many of
  1030.      the specific test macros use the value of `CPP' indirectly by
  1031.      calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or
  1032.      `AC_EGREP_CPP'.
  1033.  - Macro: AC_PROG_CXX
  1034.      Determine a C++ compiler to use.  Check if the environment variable
  1035.      `CXX' or `CCC' (in that order) is set; if so, set output variable
  1036.      `CXX' to its value.  Otherwise search for a C++ compiler under
  1037.      likely names (`c++', `g++', `gcc', `CC', and `cxx').  If none of
  1038.      those checks succeed, as a last resort set `CXX' to `gcc'.
  1039.      If using the GNU C++ compiler, set shell variable `GXX' to `yes',
  1040.      empty otherwise.  If output variable `CXXFLAGS' was not already
  1041.      set, set it to `-g -O' for the GNU C++ compiler (`-O' on systems
  1042.      where G++ does not accept `-g'), or `-g' for other compilers.
  1043.  - Macro: AC_PROG_CXXCPP
  1044.      Set output variable `CXXCPP' to a command that runs the C++
  1045.      preprocessor.  If `$CXX -E' doesn't work, it uses `/lib/cpp'.  It
  1046.      is only portable to run `CXXCPP' on files with a `.c', `.C', or
  1047.      `.cc' extension.
  1048.      If the current language is C++ (*note Language Choice::.), many of
  1049.      the specific test macros use the value of `CXXCPP' indirectly by
  1050.      calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or
  1051.      `AC_EGREP_CPP'.
  1052.  - Macro: AC_PROG_GCC_TRADITIONAL
  1053.      Add `-traditional' to output variable `CC' if using the GNU C
  1054.      compiler and `ioctl' does not work properly without
  1055.      `-traditional'.  That usually happens when the fixed header files
  1056.      have not been installed on an old system.  Since recent versions
  1057.      of the GNU C compiler fix the header files automatically when
  1058.      installed, this is becoming a less prevalent problem.
  1059.  - Macro: AC_PROG_INSTALL
  1060.      Set output variable `INSTALL' to the path of a BSD compatible
  1061.      `install' program, if one is found in the current `PATH'.
  1062.      Otherwise, set `INSTALL' to `DIR/install-sh -c', checking the
  1063.      directories specified to `AC_CONFIG_AUX_DIR' (or its default
  1064.      directories) to determine DIR (*note Output::.).  Also set the
  1065.      variable `INSTALL_PROGRAM' to `${INSTALL}' and `INSTALL_DATA' to
  1066.      `${INSTALL} -m 644'.
  1067.      This macro screens out various instances of `install' known to not
  1068.      work.  It prefers to find a C program rather than a shell script,
  1069.      for speed.  Instead of `install-sh', it can also use `install.sh',
  1070.      but that name is obsolete because some `make' programs have a rule
  1071.      that creates `install' from it if there is no `Makefile'.
  1072.      A copy of `install-sh' which you may use comes with Autoconf.  If
  1073.      you use `AC_PROG_INSTALL', you must include either `install-sh' or
  1074.      `install.sh' in your distribution, or `configure' will produce an
  1075.      error message saying it can't find them--even if the system you're
  1076.      on has a good `install' program.  This check is a safety measure
  1077.      to prevent you from accidentally leaving that file out, which
  1078.      would prevent your package from installing on systems that don't
  1079.      have a BSD-compatible `install' program.
  1080.      If you need to use your own installation program because it has
  1081.      features not found in standard `install' programs, there is no
  1082.      reason to use `AC_PROG_INSTALL'; just put the pathname of your
  1083.      program into your `Makefile.in' files.
  1084.  - Macro: AC_PROG_LEX
  1085.      If `flex' is found, set output variable `LEX' to `flex' and
  1086.      `LEXLIB' to `-lfl', if that library is in a standard place.
  1087.      Otherwise set `LEX' to `lex' and `LEXLIB' to `-ll'.
  1088.  - Macro: AC_PROG_LN_S
  1089.      If `ln -s' works on the current filesystem (the operating system
  1090.      and filesystem support symbolic links), set output variable `LN_S'
  1091.      to `ln -s', otherwise set it to `ln'.
  1092.  - Macro: AC_PROG_RANLIB
  1093.      Set output variable `RANLIB' to `ranlib' if `ranlib' is found,
  1094.      otherwise to `:' (do nothing).
  1095.  - Macro: AC_PROG_YACC
  1096.      If `bison' is found, set output variable `YACC' to `bison -y'.
  1097.      Otherwise, if `byacc' is found, set `YACC' to `byacc'.  Otherwise
  1098.      set `YACC' to `yacc'.
  1099. File: autoconf.info,  Node: Generic Programs,  Prev: Particular Programs,  Up: Alternative Programs
  1100. Generic Program Checks
  1101. ----------------------
  1102.    These macros are used to find programs not covered by the particular
  1103. test macros.  If you need to check the behavior of a program as well as
  1104. find out whether it is present, you have to write your own test for it
  1105. (*note Writing Tests::.).  By default, these macros use the environment
  1106. variable `PATH'.  If you need to check for a program that might not be
  1107. in the user's `PATH', you can pass a modified path to use instead, like
  1108. this:
  1109.      AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd,
  1110.        $PATH:/usr/libexec:/usr/sbin:/usr/etc:etc)
  1111.  - Macro: AC_CHECK_PROG (VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND [,
  1112.           VALUE-IF-NOT-FOUND [, PATH, [ REJECT ]]])
  1113.      Check whether program PROG-TO-CHECK-FOR exists in `PATH'.  If it
  1114.      is found, set VARIABLE to VALUE-IF-FOUND, otherwise to
  1115.      VALUE-IF-NOT-FOUND, if given.  Always pass over REJECT (an
  1116.      absolute file name) even if it is the first found in the search
  1117.      path; in that case, set VARIABLE using the absolute file name of
  1118.      the PROG-TO-CHECK-FOR found that is not REJECT.  If VARIABLE was
  1119.      already set, do nothing.  Calls `AC_SUBST' for VARIABLE.
  1120.  - Macro: AC_CHECK_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [,
  1121.           VALUE-IF-NOT-FOUND [, PATH]])
  1122.      Check for each program in the whitespace-separated list
  1123.      PROGS-TO-CHECK-FOR exists in `PATH'.  If it is found, set VARIABLE
  1124.      to the name of that program.  Otherwise, continue checking the
  1125.      next program in the list.  If none of the programs in the list are
  1126.      found, set VARIABLE to VALUE-IF-NOT-FOUND; if VALUE-IF-NOT-FOUND
  1127.      is not specified, the value of VARIABLE is not changed.  Calls
  1128.      `AC_SUBST' for VARIABLE.
  1129.  - Macro: AC_CHECK_TOOL (VARIABLE, PROG-TO-CHECK-FOR [,
  1130.           VALUE-IF-NOT-FOUND [, PATH]])
  1131.      Like `AC_CHECK_PROG', but first looks for PROG-TO-CHECK-FOR with a
  1132.      prefix of the host type as determined by `AC_CANONICAL_HOST',
  1133.      followed by a dash (*note Canonicalizing::.).  For example, if the
  1134.      user runs `configure --host=i386-gnu', then this call:
  1135.           AC_CHECK_TOOL(RANLIB, ranlib, :)
  1136.      sets `RANLIB' to `i386-gnu-ranlib' if that program exists in
  1137.      `PATH', or to `ranlib' if that program exists in `PATH', or to `:'
  1138.      if neither program exists.
  1139.  - Macro: AC_PATH_PROG (VARIABLE, PROG-TO-CHECK-FOR [,
  1140.           VALUE-IF-NOT-FOUND [, PATH]])
  1141.      Like `AC_CHECK_PROG', but set VARIABLE to the entire path of
  1142.      PROG-TO-CHECK-FOR if found.
  1143.  - Macro: AC_PATH_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [,
  1144.           VALUE-IF-NOT-FOUND [, PATH]])
  1145.      Like `AC_CHECK_PROGS', but if any of PROGS-TO-CHECK-FOR are found,
  1146.      set VARIABLE to the entire path of the program found.
  1147. File: autoconf.info,  Node: Libraries,  Next: Library Functions,  Prev: Alternative Programs,  Up: Existing Tests
  1148. Library Files
  1149. =============
  1150.    The following macros check for the presence of certain C library
  1151. archive files.
  1152.  - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
  1153.           ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
  1154.      Try to ensure that C function FUNCTION is available by checking
  1155.      whether a test C program can be linked with the library LIBRARY to
  1156.      get the function.  LIBRARY is the base name of the library; e.g.,
  1157.      to check for `-lmp', use `mp' as the LIBRARY argument.
  1158.      ACTION-IF-FOUND is a list of shell commands to run if the link
  1159.      with the library succeeds; ACTION-IF-NOT-FOUND is a list of shell
  1160.      commands to run if the link fails.  If ACTION-IF-FOUND and
  1161.      ACTION-IF-NOT-FOUND are not specified, the default action is to
  1162.      add `-lLIBRARY' to `LIBS' and define `HAVE_LIBLIBRARY' (in all
  1163.      capitals).
  1164.      If linking with LIBRARY results in unresolved symbols, which would
  1165.      be resolved by linking with additional libraries, give those
  1166.      libraries as the OTHER-LIBRARIES argument, separated by spaces:
  1167.      `-lXt -lX11'.  Otherwise this macro will fail to detect that
  1168.      LIBRARY is present, because linking the test program will always
  1169.      fail with unresolved symbols.
  1170.  - Macro: AC_HAVE_LIBRARY (LIBRARY, [, ACTION-IF-FOUND [,
  1171.           ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
  1172.      This macro is equivalent to calling `AC_CHECK_LIB' with a FUNCTION
  1173.      argument of `main'.  In addition, LIBRARY can be written as any of
  1174.      `foo', `-lfoo', or `libfoo.a'.  In all of those cases, the
  1175.      compiler is passed `-lfoo'.  However, LIBRARY can not be a shell
  1176.      variable; it must be a literal name.  This macro is considered
  1177.      obsolete.
  1178. File: autoconf.info,  Node: Library Functions,  Next: Header Files,  Prev: Libraries,  Up: Existing Tests
  1179. Library Functions
  1180. =================
  1181.    The following macros check for particular C library functions.  If
  1182. there is no macro specifically defined to check for a function you need,
  1183. and you don't need to check for any special properties of it, then you
  1184. can use one of the general function check macros.
  1185. * Menu:
  1186. * Particular Functions::        Special handling to find certain functions.
  1187. * Generic Functions::           How to find other functions.
  1188. File: autoconf.info,  Node: Particular Functions,  Next: Generic Functions,  Up: Library Functions
  1189. Particular Function Checks
  1190. --------------------------
  1191.    These macros check for particular C functions--whether they exist,
  1192. and in some cases how they respond when given certain arguments.
  1193.  - Macro: AC_FUNC_ALLOCA
  1194.      Check how to get `alloca'.  Tries to get a builtin version by
  1195.      checking for `alloca.h' or the predefined C preprocessor macros
  1196.      `__GNUC__' and `_AIX'.  If this macro finds `alloca.h', it defines
  1197.      `HAVE_ALLOCA_H'.
  1198.      If those attempts fail, it looks for the function in the standard C
  1199.      library.  If any of those methods succeed, it defines
  1200.      `HAVE_ALLOCA'.  Otherwise, it sets the output variable `ALLOCA' to
  1201.      `alloca.o' and defines `C_ALLOCA' (so programs can periodically
  1202.      call `alloca(0)' to garbage collect).  This variable is separate
  1203.      from `LIBOBJS' so multiple programs can share the value of
  1204.      `ALLOCA' without needing to create an actual library, in case only
  1205.      some of them use the code in `LIBOBJS'.
  1206.      This macro does not try to get `alloca' from the System V R3
  1207.      `libPW' or the System V R4 `libucb' because those libraries
  1208.      contain some incompatible functions that cause trouble.  Some
  1209.      versions do not even contain `alloca' or contain a buggy version.
  1210.      If you still want to use their `alloca', use `ar' to extract
  1211.      `alloca.o' from them instead of compiling `alloca.c'.
  1212.      Source files that use `alloca' should start with a piece of code
  1213.      like the following, to declare it properly.  In some versions of
  1214.      AIX, the declaration of `alloca' must precede everything else
  1215.      except for comments and preprocessor directives.  The `#pragma'
  1216.      directive is indented so that pre-ANSI C compilers will ignore it,
  1217.      rather than choke on it.
  1218.           /* AIX requires this to be the first thing in the file.  */
  1219.           #ifdef __GNUC__
  1220.           # define alloca __builtin_alloca
  1221.           #else
  1222.           # if HAVE_ALLOCA_H
  1223.           #  include <alloca.h>
  1224.           # else
  1225.           #  ifdef _AIX
  1226.            #pragma alloca
  1227.           #  else
  1228.           #   ifndef alloca /* predefined by HP cc +Olibcalls */
  1229.           char *alloca ();
  1230.           #   endif
  1231.           #  endif
  1232.           # endif
  1233.           #endif
  1234.  - Macro: AC_FUNC_CLOSEDIR_VOID
  1235.      If the `closedir' function does not return a meaningful value,
  1236.      define `CLOSEDIR_VOID'.  Otherwise, callers ought to check its
  1237.      return value for an error indicator.
  1238.  - Macro: AC_FUNC_GETLOADAVG
  1239.      Check how to get the system load averages.  If the system has the
  1240.      `getloadavg' function, this macro defines `HAVE_GETLOADAVG', and
  1241.      adds to `LIBS' any libraries needed to get that function.
  1242.      Otherwise, it adds `getloadavg.o' to the output variable
  1243.      `LIBOBJS', and possibly defines several other C preprocessor
  1244.      macros and output variables:
  1245.        1. It defines `SVR4', `DGUX', `UMAX', or `UMAX4_3' if on those
  1246.           systems.
  1247.        2. If it finds `nlist.h', it defines `NLIST_STRUCT'.
  1248.        3. If `struct nlist' has an `n_un' member, it defines
  1249.           `NLIST_NAME_UNION'.
  1250.        4. If compiling `getloadavg.c' defines `LDAV_PRIVILEGED',
  1251.           programs need to be installed specially on this system for
  1252.           `getloadavg' to work, and this macro defines
  1253.           `GETLOADAVG_PRIVILEGED'.
  1254.        5. This macro sets the output variable `NEED_SETGID'.  The value
  1255.           is `true' if special installation is required, `false' if not.
  1256.           If `NEED_SETGID' is `true', this macro sets `KMEM_GROUP' to
  1257.           the name of the group that should own the installed program.
  1258.  - Macro: AC_FUNC_GETMNTENT
  1259.      Check for `getmntent' in the `sun', `seq', and `gen' libraries,
  1260.      for Irix 4, PTX, and Unixware, respectively.  Then, if `getmntent'
  1261.      is available, define `HAVE_GETMNTENT'.
  1262.  - Macro: AC_FUNC_GETPGRP
  1263.      If `getpgrp' takes no argument (the POSIX.1 version), define
  1264.      `GETPGRP_VOID'.  Otherwise, it is the BSD version, which takes a
  1265.      process ID as an argument.  This macro does not check whether
  1266.      `getpgrp' exists at all; if you need to work in that situation,
  1267.      first call `AC_CHECK_FUNC' for `getpgrp'.
  1268.  - Macro: AC_FUNC_MEMCMP
  1269.      If the `memcmp' function is not available, or does not work on
  1270.      8-bit data (like the one on SunOS 4.1.3), add `memcmp.o' to output
  1271.      variable `LIBOBJS'.
  1272.  - Macro: AC_FUNC_MMAP
  1273.      If the `mmap' function exists and works correctly on memory mapped
  1274.      files, define `HAVE_MMAP'.
  1275.  - Macro: AC_FUNC_SETVBUF_REVERSED
  1276.      If `setvbuf' takes the buffering type as its second argument and
  1277.      the buffer pointer as the third, instead of the other way around,
  1278.      define `SETVBUF_REVERSED'.  This is the case on System V before
  1279.      release 3.
  1280.  - Macro: AC_FUNC_STRCOLL
  1281.      If the `strcoll' function exists and works correctly, define
  1282.      `HAVE_STRCOLL'.  This does a bit more than
  1283.      `AC_CHECK_FUNCS(strcoll)', because some systems have incorrect
  1284.      definitions of `strcoll', which should not be used.
  1285.  - Macro: AC_FUNC_STRFTIME
  1286.      Check for `strftime' in the `intl' library, for SCO UNIX.  Then,
  1287.      if `strftime' is available, define `HAVE_STRFTIME'.
  1288.  - Macro: AC_FUNC_UTIME_NULL
  1289.      If `utime(FILE, NULL)' sets FILE's timestamp to the present,
  1290.      define `HAVE_UTIME_NULL'.
  1291.  - Macro: AC_FUNC_VFORK
  1292.      If `vfork.h' is found, define `HAVE_VFORK_H'.  If a working
  1293.      `vfork' is not found, define `vfork' to be `fork'.  This macro
  1294.      checks for several known errors in implementations of `vfork' and
  1295.      considers the system to not have a working `vfork' if it detects
  1296.      any of them.  It is not considered to be an implementation error
  1297.      if a child's invocation of `signal' modifies the parent's signal
  1298.      handler, since child processes rarely change their signal handlers.
  1299.  - Macro: AC_FUNC_VPRINTF
  1300.      If `vprintf' is found, define `HAVE_VPRINTF'.  Otherwise, if
  1301.      `_doprnt' is found, define `HAVE_DOPRNT'.  (If `vprintf' is
  1302.      available, you may assume that `vfprintf' and `vsprintf' are also
  1303.      available.)
  1304.  - Macro: AC_FUNC_WAIT3
  1305.      If `wait3' is found and fills in the contents of its third argument
  1306.      (a `struct rusage *'), which HP-UX does not do, define
  1307.      `HAVE_WAIT3'.
  1308. File: autoconf.info,  Node: Generic Functions,  Prev: Particular Functions,  Up: Library Functions
  1309. Generic Function Checks
  1310. -----------------------
  1311.    These macros are used to find functions not covered by the particular
  1312. test macros.  If the functions might be in libraries other than the
  1313. default C library, first call `AC_CHECK_LIB' for those libraries.  If
  1314. you need to check the behavior of a function as well as find out
  1315. whether it is present, you have to write your own test for it (*note
  1316. Writing Tests::.).
  1317.  - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [,
  1318.           ACTION-IF-NOT-FOUND]])
  1319.      If C function FUNCTION is available, run shell commands
  1320.      ACTION-IF-FOUND, otherwise ACTION-IF-NOT-FOUND.  If you just want
  1321.      to define a symbol if the function is available, consider using
  1322.      `AC_CHECK_FUNCS' instead.  This macro checks for functions with C
  1323.      linkage even when `AC_LANG_CPLUSPLUS' has been called, since C++ is
  1324.      more standardized than C is.  (*note Language Choice::., for more
  1325.      information about selecting the language for checks.)
  1326.  - Macro: AC_CHECK_FUNCS (FUNCTION... [, ACTION-IF-FOUND [,
  1327.           ACTION-IF-NOT-FOUND]])
  1328.      For each given FUNCTION in the whitespace-separated argument list
  1329.      that is available, define `HAVE_FUNCTION' (in all capitals).  If
  1330.      ACTION-IF-FOUND is given, it is additional shell code to execute
  1331.      when one of the functions is found.  You can give it a value of
  1332.      `break' to break out of the loop on the first match.  If
  1333.      ACTION-IF-NOT-FOUND is given, it is executed when one of the
  1334.      functions is not found.
  1335.  - Macro: AC_REPLACE_FUNCS (FUNCTION-NAME...)
  1336.      For each given FUNCTION-NAME in the whitespace-separated argument
  1337.      list that is not in the C library, add `FUNCTION-NAME.o' to the
  1338.      value of the output variable `LIBOBJS'.
  1339. File: autoconf.info,  Node: Header Files,  Next: Structures,  Prev: Library Functions,  Up: Existing Tests
  1340. Header Files
  1341. ============
  1342.    The following macros check for the presence of certain C header
  1343. files.  If there is no macro specifically defined to check for a header
  1344. file you need, and you don't need to check for any special properties of
  1345. it, then you can use one of the general header file check macros.
  1346. * Menu:
  1347. * Particular Headers::          Special handling to find certain headers.
  1348. * Generic Headers::             How to find other headers.
  1349. File: autoconf.info,  Node: Particular Headers,  Next: Generic Headers,  Up: Header Files
  1350. Particular Header Checks
  1351. ------------------------
  1352.    These macros check for particular system header files--whether they
  1353. exist, and in some cases whether they declare certain symbols.
  1354.  - Macro: AC_DECL_SYS_SIGLIST
  1355.      Define `SYS_SIGLIST_DECLARED' if the variable `sys_siglist' is
  1356.      declared in a system header file, either `signal.h' or `unistd.h'.
  1357.  - Macro: AC_DIR_HEADER
  1358.      Like calling `AC_HEADER_DIRENT' and `AC_FUNC_CLOSEDIR_VOID', but
  1359.      defines a different set of C preprocessor macros to indicate which
  1360.      header file is found.  This macro and the names it defines are
  1361.      considered obsolete.  The names it defines are:
  1362.     `dirent.h'
  1363.           `DIRENT'
  1364.     `sys/ndir.h'
  1365.           `SYSNDIR'
  1366.     `sys/dir.h'
  1367.           `SYSDIR'
  1368.     `ndir.h'
  1369.           `NDIR'
  1370.      In addition, if the `closedir' function does not return a
  1371.      meaningful value, define `VOID_CLOSEDIR'.
  1372.  - Macro: AC_HEADER_DIRENT
  1373.      Check for the following header files, and for the first one that is
  1374.      found and defines `DIR', define the listed C preprocessor macro:
  1375.     `dirent.h'
  1376.           `HAVE_DIRENT_H'
  1377.     `sys/ndir.h'
  1378.           `HAVE_SYS_NDIR_H'
  1379.     `sys/dir.h'
  1380.           `HAVE_SYS_DIR_H'
  1381.     `ndir.h'
  1382.           `HAVE_NDIR_H'
  1383.      The directory library declarations in the source code should look
  1384.      something like the following:
  1385.           #if HAVE_DIRENT_H
  1386.           # include <dirent.h>
  1387.           # define NAMLEN(dirent) strlen((dirent)->d_name)
  1388.           #else
  1389.           # define dirent direct
  1390.           # define NAMLEN(dirent) (dirent)->d_namlen
  1391.           # if HAVE_SYS_NDIR_H
  1392.           #  include <sys/ndir.h>
  1393.           # endif
  1394.           # if HAVE_SYS_DIR_H
  1395.           #  include <sys/dir.h>
  1396.           # endif
  1397.           # if HAVE_NDIR_H
  1398.           #  include <ndir.h>
  1399.           # endif
  1400.           #endif
  1401.      Using the above declarations, the program would declare variables
  1402.      to be type `struct dirent', not `struct direct', and would access
  1403.      the length of a directory entry name by passing a pointer to a
  1404.      `struct dirent' to the `NAMLEN' macro.
  1405.      This macro also checks for the SCO Xenix `dir' and `x' libraries.
  1406.  - Macro: AC_HEADER_MAJOR
  1407.      If `sys/types.h' does not define `major', `minor', and `makedev',
  1408.      but `sys/mkdev.h' does, define `MAJOR_IN_MKDEV'; otherwise, if
  1409.      `sys/sysmacros.h' does, define `MAJOR_IN_SYSMACROS'.
  1410.  - Macro: AC_HEADER_STDC
  1411.      Define `STDC_HEADERS' if the system has ANSI C header files.
  1412.      Specifically, this macro checks for `stdlib.h', `stdarg.h',
  1413.      `string.h', and `float.h'; if the system has those, it probably
  1414.      has the rest of the ANSI C header files.  This macro also checks
  1415.      whether `string.h' declares `memchr' (and thus presumably the
  1416.      other `mem' functions), whether `stdlib.h' declare `free' (and
  1417.      thus presumably `malloc' and other related functions), and whether
  1418.      the `ctype.h' macros work on characters with the high bit set, as
  1419.      ANSI C requires.
  1420.      Use `STDC_HEADERS' instead of `__STDC__' to determine whether the
  1421.      system has ANSI-compliant header files (and probably C library
  1422.      functions) because many systems that have GCC do not have ANSI C
  1423.      header files.
  1424.      On systems without ANSI C headers, there is so much variation that
  1425.      it is probably easier to declare the functions you use than to
  1426.      figure out exactly what the system header files declare.  Some
  1427.      systems contain a mix of functions ANSI and BSD; some are mostly
  1428.      ANSI but lack `memmove'; some define the BSD functions as macros in
  1429.      `string.h' or `strings.h'; some have only the BSD functions but
  1430.      `string.h'; some declare the memory functions in `memory.h', some
  1431.      in `string.h'; etc.  It is probably sufficient to check for one
  1432.      string function and one memory function; if the library has the
  1433.      ANSI versions of those then it probably has most of the others.
  1434.      If you put the following in `configure.in':
  1435.           AC_HEADER_STDC
  1436.           AC_CHECK_FUNCS(strchr memcpy)
  1437.      then, in your code, you can put declarations like this:
  1438.           #if STDC_HEADERS
  1439.           # include <string.h>
  1440.           #else
  1441.           # ifndef HAVE_STRCHR
  1442.           #  define strchr index
  1443.           #  define strrchr rindex
  1444.           # endif
  1445.           char *strchr (), *strrchr ();
  1446.           # ifndef HAVE_MEMCPY
  1447.           #  define memcpy(d, s, n) bcopy ((s), (d), (n))
  1448.           #  define memmove(d, s, n) bcopy ((s), (d), (n))
  1449.           # endif
  1450.           #endif
  1451.      If you use a function like `memchr', `memset', `strtok', or
  1452.      `strspn', which have no BSD equivalent, then macros won't suffice;
  1453.      you must provide an implementation of each function.  An easy way
  1454.      to incorporate your implementations only when needed (since the
  1455.      ones in system C libraries may be hand optimized) is to, taking
  1456.      `memchr' for example, put it in `memchr.c' and use
  1457.      `AC_REPLACE_FUNCS(memchr)'.
  1458.  - Macro: AC_HEADER_SYS_WAIT
  1459.      If `sys/wait.h' exists and is compatible with POSIX.1, define
  1460.      `HAVE_SYS_WAIT_H'.  Incompatibility can occur if `sys/wait.h' does
  1461.      not exist, or if it uses the old BSD `union wait' instead of `int'
  1462.      to store a status value.  If `sys/wait.h' is not POSIX.1
  1463.      compatible, then instead of including it, define the POSIX.1
  1464.      macros with their usual interpretations.  Here is an example:
  1465.           #include <sys/types.h>
  1466.           #if HAVE_SYS_WAIT_H
  1467.           # include <sys/wait.h>
  1468.           #endif
  1469.           #ifndef WEXITSTATUS
  1470.           # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  1471.           #endif
  1472.           #ifndef WIFEXITED
  1473.           # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  1474.           #endif
  1475.  - Macro: AC_MEMORY_H
  1476.      Define `NEED_MEMORY_H' if `memcpy', `memcmp', etc. are not
  1477.      declared in `string.h' and `memory.h' exists.  This macro is
  1478.      obsolete; instead, use `AC_CHECK_HEADERS(memory.h)'.  See the
  1479.      example for `AC_HEADER_STDC'.
  1480.  - Macro: AC_UNISTD_H
  1481.      Define `HAVE_UNISTD_H' if the system has `unistd.h'.  This macro
  1482.      is obsolete; instead, use `AC_CHECK_HEADERS(unistd.h)'.
  1483.      The way to check if the system supports POSIX.1 is:
  1484.           #if HAVE_UNISTD_H
  1485.           # include <sys/types.h>
  1486.           # include <unistd.h>
  1487.           #endif
  1488.           
  1489.           #ifdef _POSIX_VERSION
  1490.           /* Code for POSIX.1 systems.  */
  1491.           #endif
  1492.      `_POSIX_VERSION' is defined when `unistd.h' is included on POSIX.1
  1493.      systems.  If there is no `unistd.h', it is definitely not a
  1494.      POSIX.1 system.  However, some non-POSIX.1 systems do have
  1495.      `unistd.h'.
  1496.  - Macro: AC_USG
  1497.      Define `USG' if the system does not have `strings.h', `rindex',
  1498.      `bzero', etc.  This implies that it has `string.h', `strrchr',
  1499.      `memset', etc.
  1500.      The symbol `USG' is obsolete.  Instead of this macro, see the
  1501.      example for `AC_HEADER_STDC'.
  1502. File: autoconf.info,  Node: Generic Headers,  Prev: Particular Headers,  Up: Header Files
  1503. Generic Header Checks
  1504. ---------------------
  1505.    These macros are used to find system header files not covered by the
  1506. particular test macros.  If you need to check the contents of a header
  1507. as well as find out whether it is present, you have to write your own
  1508. test for it (*note Writing Tests::.).
  1509.  - Macro: AC_CHECK_HEADER (HEADER-FILE, [ACTION-IF-FOUND [,
  1510.           ACTION-IF-NOT-FOUND]])
  1511.      If the system header file HEADER-FILE exists, execute shell
  1512.      commands ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND.
  1513.      If you just want to define a symbol if the header file is
  1514.      available, consider using `AC_CHECK_HEADERS' instead.
  1515.  - Macro: AC_CHECK_HEADERS (HEADER-FILE... [, ACTION-IF-FOUND [,
  1516.           ACTION-IF-NOT-FOUND]])
  1517.      For each given system header file HEADER-FILE in the
  1518.      whitespace-separated argument list that exists, define
  1519.      `HAVE_HEADER-FILE' (in all capitals).  If ACTION-IF-FOUND is
  1520.      given, it is additional shell code to execute when one of the
  1521.      header files is found.  You can give it a value of `break' to
  1522.      break out of the loop on the first match.  If ACTION-IF-NOT-FOUND
  1523.      is given, it is executed when one of the header files is not found.
  1524. File: autoconf.info,  Node: Structures,  Next: Typedefs,  Prev: Header Files,  Up: Existing Tests
  1525. Structures
  1526. ==========
  1527.    The following macros check for certain structures or structure
  1528. members.  To check structures not listed here, use `AC_EGREP_CPP'
  1529. (*note Examining Declarations::.) or `AC_TRY_COMPILE' (*note Examining
  1530. Syntax::.).
  1531.  - Macro: AC_HEADER_STAT
  1532.      If the macros `S_ISDIR', `S_ISREG' et al. defined in `sys/stat.h'
  1533.      do not work properly (returning false positives), define
  1534.      `STAT_MACROS_BROKEN'.  This is the case on Tektronix UTekV, Amdahl
  1535.      UTS and Motorola System V/88.
  1536.  - Macro: AC_HEADER_TIME
  1537.      If a program may include both `time.h' and `sys/time.h', define
  1538.      `TIME_WITH_SYS_TIME'.  On some older systems, `sys/time.h'
  1539.      includes `time.h', but `time.h' is not protected against multiple
  1540.      inclusion, so programs should not explicitly include both files.
  1541.      This macro is useful in programs that use, for example, `struct
  1542.      timeval' or `struct timezone' as well as `struct tm'.  It is best
  1543.      used in conjunction with `HAVE_SYS_TIME_H', which can be checked
  1544.      for using `AC_CHECK_HEADERS(sys/time.h)'.
  1545.           #if TIME_WITH_SYS_TIME
  1546.           # include <sys/time.h>
  1547.           # include <time.h>
  1548.           #else
  1549.           # if HAVE_SYS_TIME_H
  1550.           #  include <sys/time.h>
  1551.           # else
  1552.           #  include <time.h>
  1553.           # endif
  1554.           #endif
  1555.  - Macro: AC_STRUCT_ST_BLKSIZE
  1556.      If `struct stat' contains an `st_blksize' member, define
  1557.      `HAVE_ST_BLKSIZE'.
  1558.  - Macro: AC_STRUCT_ST_BLOCKS
  1559.      If `struct stat' contains an `st_blocks' member, define
  1560.      `HAVE_ST_BLOCKS'.  Otherwise, add `fileblocks.o' to the output
  1561.      variable `LIBOBJS'.
  1562.  - Macro: AC_STRUCT_ST_RDEV
  1563.      If `struct stat' contains an `st_rdev' member, define
  1564.      `HAVE_ST_RDEV'.
  1565.  - Macro: AC_STRUCT_TM
  1566.      If `time.h' does not define `struct tm', define `TM_IN_SYS_TIME',
  1567.      which means that including `sys/time.h' had better define `struct
  1568.      tm'.
  1569.  - Macro: AC_STRUCT_TIMEZONE
  1570.      Figure out how to get the current timezone.  If `struct tm' has a
  1571.      `tm_zone' member, define `HAVE_TM_ZONE'.  Otherwise, if the
  1572.      external array `tzname' is found, define `HAVE_TZNAME'.
  1573. File: autoconf.info,  Node: Typedefs,  Next: Compiler Characteristics,  Prev: Structures,  Up: Existing Tests
  1574. Typedefs
  1575. ========
  1576.    The following macros check for C typedefs.  If there is no macro
  1577. specifically defined to check for a typedef you need, and you don't need
  1578. to check for any special properties of it, then you can use a general
  1579. typedef check macro.
  1580. * Menu:
  1581. * Particular Typedefs::         Special handling to find certain types.
  1582. * Generic Typedefs::            How to find other types.
  1583. File: autoconf.info,  Node: Particular Typedefs,  Next: Generic Typedefs,  Up: Typedefs
  1584. Particular Typedef Checks
  1585. -------------------------
  1586.    These macros check for particular C typedefs in `sys/types.h' and
  1587. `stdlib.h' (if it exists).
  1588.  - Macro: AC_TYPE_GETGROUPS
  1589.      Define `GETGROUPS_T' to be whichever of `gid_t' or `int' is the
  1590.      base type of the array argument to `getgroups'.
  1591.  - Macro: AC_TYPE_MODE_T
  1592.      If `mode_t' is not defined, define `mode_t' to be `int'.
  1593.  - Macro: AC_TYPE_OFF_T
  1594.      If `off_t' is not defined, define `off_t' to be `long'.
  1595.  - Macro: AC_TYPE_PID_T
  1596.      If `pid_t' is not defined, define `pid_t' to be `int'.
  1597.  - Macro: AC_TYPE_SIGNAL
  1598.      If `signal.h' declares `signal' as returning a pointer to a
  1599.      function returning `void', define `RETSIGTYPE' to be `void';
  1600.      otherwise, define it to be `int'.
  1601.      Define signal handlers as returning type `RETSIGTYPE':
  1602.           RETSIGTYPE
  1603.           hup_handler ()
  1604.           {
  1605.           ...
  1606.           }
  1607.  - Macro: AC_TYPE_SIZE_T
  1608.      If `size_t' is not defined, define `size_t' to be `unsigned'.
  1609.  - Macro: AC_TYPE_UID_T
  1610.      If `uid_t' is not defined, define `uid_t' to be `int' and `gid_t'
  1611.      to be `int'.
  1612. File: autoconf.info,  Node: Generic Typedefs,  Prev: Particular Typedefs,  Up: Typedefs
  1613. Generic Typedef Checks
  1614. ----------------------
  1615.    This macro is used to check for typedefs not covered by the
  1616. particular test macros.
  1617.  - Macro: AC_CHECK_TYPE (TYPE, DEFAULT)
  1618.      If the type TYPE is not defined in `sys/types.h' or `stdlib.h' (if
  1619.      it exists), define it to be the C (or C++) builtin type DEFAULT;
  1620.      e.g., `short' or `unsigned'.
  1621. File: autoconf.info,  Node: Compiler Characteristics,  Next: System Services,  Prev: Typedefs,  Up: Existing Tests
  1622. Compiler Characteristics
  1623. ========================
  1624.    The following macros check for C compiler or machine architecture
  1625. features.  To check for characteristics not listed here, use
  1626. `AC_TRY_COMPILE' (*note Examining Syntax::.) or `AC_TRY_RUN' (*note Run
  1627. Time::.)
  1628.  - Macro: AC_C_BIGENDIAN
  1629.      If words are stored with the most significant byte first (like
  1630.      Motorola and SPARC, but not Intel and VAX, CPUs), define
  1631.      `WORDS_BIGENDIAN'.
  1632.  - Macro: AC_C_CONST
  1633.      If the C compiler does not fully support the keyword `const',
  1634.      define `const' to be empty.  Some C compilers that do not define
  1635.      `__STDC__' do support `const'; some compilers that define
  1636.      `__STDC__' do not completely support `const'.  Programs can simply
  1637.      use `const' as if every C compiler supported it; for those that
  1638.      don't, the `Makefile' or configuration header file will define it
  1639.      as empty.
  1640.  - Macro: AC_C_INLINE
  1641.      If the C compiler supports the keyword `inline', do nothing.
  1642.      Otherwise define `inline' to `__inline__' or `__inline' if it
  1643.      accepts one of those, otherwise define `inline' to be empty.
  1644.  - Macro: AC_C_CHAR_UNSIGNED
  1645.      If the C type `char' is unsigned, define `__CHAR_UNSIGNED__',
  1646.      unless the C compiler predefines it.
  1647.  - Macro: AC_C_LONG_DOUBLE
  1648.      If the C compiler supports the `long double' type, define
  1649.      `HAVE_LONG_DOUBLE'.  Some C compilers that do not define
  1650.      `__STDC__' do support the `long double' type; some compilers that
  1651.      define `__STDC__' do not support `long double'.
  1652.  - Macro: AC_CHECK_SIZEOF (TYPE [, CROSS-SIZE])
  1653.      Define `SIZEOF_UCTYPE' to be the size in bytes of the C (or C++)
  1654.      builtin type TYPE, e.g. `int' or `char *'.  If `type' is unknown
  1655.      to the compiler, it gets a size of 0.  UCTYPE is TYPE, with
  1656.      lowercase converted to uppercase, spaces changed to underscores,
  1657.      and asterisks changed to `P'.  If cross-compiling, the value
  1658.      CROSS-SIZE is used if given, otherwise `configure' exits with an
  1659.      error message.
  1660.      For example, the call
  1661.           AC_CHECK_SIZEOF(int *)
  1662.      defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems.
  1663.  - Macro: AC_INT_16_BITS
  1664.      If the C type `int' is 16 bits wide, define `INT_16_BITS'.  This
  1665.      macro is obsolete; it is more general to use
  1666.      `AC_CHECK_SIZEOF(int)' instead.
  1667.  - Macro: AC_LONG_64_BITS
  1668.      If the C type `long int' is 64 bits wide, define `LONG_64_BITS'.
  1669.      This macro is obsolete; it is more general to use
  1670.      `AC_CHECK_SIZEOF(long)' instead.
  1671. File: autoconf.info,  Node: System Services,  Next: UNIX Variants,  Prev: Compiler Characteristics,  Up: Existing Tests
  1672. System Services
  1673. ===============
  1674.    The following macros check for operating system services or
  1675. capabilities.
  1676.  - Macro: AC_SYS_INTERPRETER
  1677.      Check whether the system supports starting scripts with a line of
  1678.      the form `#! /bin/csh' to select the interpreter to use for the
  1679.      script.  After running this macro, shell code in `configure.in'
  1680.      can check the variable `ac_cv_sys_interpreter'; it will be set to
  1681.      `yes' if the system supports `#!', `no' if not.
  1682.  - Macro: AC_PATH_X
  1683.      Try to locate the X Window System include files and libraries.  If
  1684.      the user gave the command line options `--x-includes=DIR' and
  1685.      `--x-libraries=DIR', use those directories.  If either or both
  1686.      were not given, get the missing values by running `xmkmf' on a
  1687.      trivial `Imakefile' and examining the `Makefile' that it produces.
  1688.      If that fails (such as if `xmkmf' is not present), look for them
  1689.      in several directories where they often reside.  If either method
  1690.      is successful, set the shell variables `x_includes' and
  1691.      `x_libraries' to their locations, unless they are in directories
  1692.      the compiler searches by default.
  1693.      If both methods fail, or the user gave the command line option
  1694.      `--without-x', set the shell variable `no_x' to `yes'; otherwise
  1695.      set it to the empty string.
  1696.  - Macro: AC_PATH_XTRA
  1697.      An enhanced version of `AC_PATH_X'.  It adds the C compiler flags
  1698.      that X needs to output variable `X_CFLAGS', and the X linker flags
  1699.      to `X_LIBS'.  If X is not available, adds `-DX_DISPLAY_MISSING' to
  1700.      `X_CFLAGS'.
  1701.      This macro also checks for special libraries that some systems
  1702.      need in order to compile X programs.  It adds any that the system
  1703.      needs to output variable `X_EXTRA_LIBS'.  And it checks for
  1704.      special X11R6 libraries that need to be linked with before
  1705.      `-lX11', and adds any found to the output variable `X_PRE_LIBS'.
  1706.  - Macro: AC_SYS_LONG_FILE_NAMES
  1707.      If the system supports file names longer than 14 characters, define
  1708.      `HAVE_LONG_FILE_NAMES'.
  1709.  - Macro: AC_SYS_RESTARTABLE_SYSCALLS
  1710.      If the system automatically restarts a system call that is
  1711.      interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
  1712. File: autoconf.info,  Node: UNIX Variants,  Prev: System Services,  Up: Existing Tests
  1713. UNIX Variants
  1714. =============
  1715.    The following macros check for certain operating systems that need
  1716. special treatment for some programs, due to exceptional oddities in
  1717. their header files or libraries.  These macros are warts; they will be
  1718. replaced by a more systematic approach, based on the functions they make
  1719. available or the environments they provide.
  1720.  - Macro: AC_AIX
  1721.      If on AIX, define `_ALL_SOURCE'.  Allows the use of some BSD
  1722.      functions.  Should be called before any macros that run the C
  1723.      compiler.
  1724.  - Macro: AC_DYNIX_SEQ
  1725.      If on Dynix/PTX (Sequent UNIX), add `-lseq' to output variable
  1726.      `LIBS'.  This macro is obsolete; instead, use `AC_FUNC_GETMNTENT'.
  1727.  - Macro: AC_IRIX_SUN
  1728.      If on IRIX (Silicon Graphics UNIX), add `-lsun' to output variable
  1729.      `LIBS'.  This macro is obsolete.  If you were using it to get
  1730.      `getmntent', use `AC_FUNC_GETMNTENT' instead.  If you used it for
  1731.      the NIS versions of the password and group functions, use
  1732.      `AC_CHECK_LIB(sun, getpwnam)'.
  1733.  - Macro: AC_ISC_POSIX
  1734.      If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add
  1735.      `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers)
  1736.      to output variable `CC'.  This allows the use of POSIX facilities.
  1737.      Must be called after `AC_PROG_CC' and before any other macros
  1738.      that run the C compiler.
  1739.  - Macro: AC_MINIX
  1740.      If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define
  1741.      `_POSIX_1_SOURCE' to be 2.  This allows the use of POSIX
  1742.      facilities.  Should be called before any macros that run the C
  1743.      compiler.
  1744.  - Macro: AC_SCO_INTL
  1745.      If on SCO UNIX, add `-lintl' to output variable `LIBS'.  This
  1746.      macro is obsolete; instead, use `AC_FUNC_STRFTIME'.
  1747.  - Macro: AC_XENIX_DIR
  1748.      If on Xenix, add `-lx' to output variable `LIBS'.  Also, if
  1749.      `dirent.h' is being used, add `-ldir' to `LIBS'.  This macro is
  1750.      obsolete; use `AC_HEADER_DIRENT' instead.
  1751. File: autoconf.info,  Node: Writing Tests,  Next: Results,  Prev: Existing Tests,  Up: Top
  1752. Writing Tests
  1753. *************
  1754.    If the existing feature tests don't do something you need, you have
  1755. to write new ones.  These macros are the building blocks.  They provide
  1756. ways for other macros to check whether various kinds of features are
  1757. available and report the results.
  1758.    This chapter contains some suggestions and some of the reasons why
  1759. the existing tests are written the way they are.  You can also learn a
  1760. lot about how to write Autoconf tests by looking at the existing ones.
  1761. If something goes wrong in one or more of the Autoconf tests, this
  1762. information can help you understand the assumptions behind them, which
  1763. might help you figure out how to best solve the problem.
  1764.    These macros check the output of the C compiler system.  They do not
  1765. cache the results of their tests for future use (*note Caching
  1766. Results::.), because they don't know enough about the information they
  1767. are checking for to generate a cache variable name.  They also do not
  1768. print any messages, for the same reason.  The checks for particular
  1769. kinds of C features call these macros and do cache their results and
  1770. print messages about what they're checking for.
  1771.    When you write a feature test that could be applicable to more than
  1772. one software package, the best thing to do is encapsulate it in a new
  1773. macro.  *Note Writing Macros::, for how to do that.
  1774. * Menu:
  1775. * Examining Declarations::    Detecting header files and declarations.
  1776. * Examining Syntax::            Detecting language syntax features.
  1777. * Examining Libraries::         Detecting functions and global variables.
  1778. * Run Time::                Testing for run-time features.
  1779. * Portable Shell::              Shell script portability pitfalls.
  1780. * Testing Values and Files::    Checking strings and files.
  1781. * Multiple Cases::        Tests for several possible values.
  1782. * Language Choice::             Selecting which language to use for testing.
  1783. File: autoconf.info,  Node: Examining Declarations,  Next: Examining Syntax,  Up: Writing Tests
  1784. Examining Declarations
  1785. ======================
  1786.    The macro `AC_TRY_CPP' is used to check whether particular header
  1787. files exist.  You can check for one at a time, or more than one if you
  1788. need several header files to all exist for some purpose.
  1789.  - Macro: AC_TRY_CPP (INCLUDES, [ACTION-IF-TRUE [, ACTION-IF-FALSE]])
  1790.      INCLUDES is C or C++ `#include' statements and declarations, on
  1791.      which shell variable, backquote, and backslash substitutions are
  1792.      performed.  (Actually, it can be any C program, but other
  1793.      statements are probably not useful.)  If the preprocessor produces
  1794.      no error messages while processing it, run shell commands
  1795.      ACTION-IF-TRUE.  Otherwise run shell commands ACTION-IF-FALSE.
  1796.      This macro uses `CPPFLAGS', but not `CFLAGS', because `-g', `-O',
  1797.      etc. are not valid options to many C preprocessors.
  1798.    Here is how to find out whether a header file contains a particular
  1799. declaration, such as a typedef, a structure, a structure member, or a
  1800. function.  Use `AC_EGREP_HEADER' instead of running `grep' directly on
  1801. the header file; on some systems the symbol might be defined in another
  1802. header file that the file you are checking `#include's.
  1803.  - Macro: AC_EGREP_HEADER (PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
  1804.           ACTION-IF-NOT-FOUND])
  1805.      If the output of running the preprocessor on the system header file
  1806.      HEADER-FILE matches the `egrep' regular expression PATTERN,
  1807.      execute shell commands ACTION-IF-FOUND, otherwise execute
  1808.      ACTION-IF-NOT-FOUND.
  1809.    To check for C preprocessor symbols, either defined by header files
  1810. or predefined by the C preprocessor, use `AC_EGREP_CPP'.  Here is an
  1811. example of the latter:
  1812.      AC_EGREP_CPP(yes,
  1813.      [#ifdef _AIX
  1814.        yes
  1815.      #endif
  1816.      ], is_aix=yes, is_aix=no)
  1817.  - Macro: AC_EGREP_CPP (PATTERN, PROGRAM, [ACTION-IF-FOUND [,
  1818.           ACTION-IF-NOT-FOUND]])
  1819.      PROGRAM is the text of a C or C++ program, on which shell
  1820.      variable, backquote, and backslash substitutions are performed.
  1821.      If the output of running the preprocessor on PROGRAM matches the
  1822.      `egrep' regular expression PATTERN, execute shell commands
  1823.      ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND.
  1824.      This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
  1825.      which language is current, *note Language Choice::.), if it hasn't
  1826.      been called already.
  1827. File: autoconf.info,  Node: Examining Syntax,  Next: Examining Libraries,  Prev: Examining Declarations,  Up: Writing Tests
  1828. Examining Syntax
  1829. ================
  1830.    To check for a syntax feature of the C or C++ compiler, such as
  1831. whether it recognizes a certain keyword, use `AC_TRY_COMPILE' to try to
  1832. compile a small program that uses that feature.  You can also use it to
  1833. check for structures and structure members that are not present on all
  1834. systems.
  1835.  - Macro: AC_TRY_COMPILE (INCLUDES, FUNCTION-BODY, [ACTION-IF-FOUND [,
  1836.           ACTION-IF-NOT-FOUND]])
  1837.      Create a test C program to see whether a function whose body
  1838.      consists of FUNCTION-BODY can be compiled; INCLUDES is any
  1839.      `#include' statements needed by the code in FUNCTION-BODY.  If the
  1840.      file compiles successfully, run shell commands ACTION-IF-FOUND,
  1841.      otherwise run ACTION-IF-NOT-FOUND.  This macro uses `CFLAGS' or
  1842.      `CXXFLAGS', and `CPPFLAGS', when compiling.  It does not try to
  1843.      link; use `AC_TRY_LINK' if you need to do that (*note Examining
  1844.      Libraries::.).
  1845. File: autoconf.info,  Node: Examining Libraries,  Next: Run Time,  Prev: Examining Syntax,  Up: Writing Tests
  1846. Examining Libraries
  1847. ===================
  1848.    To check for a library, a function, or a global variable, Autoconf
  1849. `configure' scripts try to compile and link a small program that uses
  1850. it.  This is unlike Metaconfig, which by default uses `nm' or `ar' on
  1851. the C library to try to figure out which functions are available.
  1852. Trying to link with the function is usually a more reliable approach
  1853. because it avoids dealing with the variations in the options and output
  1854. formats of `nm' and `ar' and in the location of the standard libraries.
  1855. It also allows configuring for cross-compilation or checking a
  1856. function's runtime behavior if needed.  On the other hand, it can be
  1857. slower than scanning the libraries once.
  1858.    A few systems have linkers that do not return a failure exit status
  1859. when there are unresolved functions in the link.  This bug makes the
  1860. configuration scripts produced by Autoconf unusable on those systems.
  1861. However, some of them can be given options that make the exit status
  1862. correct.  This is a problem that Autoconf does not currently handle
  1863. automatically.  If users encounter this problem, they might be able to
  1864. solve it by setting `LDFLAGS' in the environment to pass whatever
  1865. options the linker needs (for example, `-Wl,-dn' on MIPS RISC/OS).
  1866.    `AC_TRY_LINK' is used to compile test programs to test for functions
  1867. and global variables.  It is also used (by `AC_CHECK_LIB') to check for
  1868. libraries, by adding the library being checked for to `LIBS'
  1869. temporarily and trying to link a small program.
  1870.  - Macro: AC_TRY_LINK (INCLUDES, FUNCTION-BODY, [ACTION-IF-FOUND [,
  1871.           ACTION-IF-NOT-FOUND]])
  1872.      Create a test C program to see whether a function whose body
  1873.      consists of FUNCTION-BODY can be compiled and linked; INCLUDES is
  1874.      any `#include' statements needed by the code in FUNCTION-BODY.  If
  1875.      the file compiles and links successfully, run shell commands
  1876.      ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND.  This macro
  1877.      uses `CFLAGS' or `CXXFLAGS', `CPPFLAGS', `LDFLAGS', and `LIBS'
  1878.      when compiling.
  1879.  - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY,
  1880.           ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1881.      This is an obsolete version of `AC_TRY_LINK', with the addition
  1882.      that it prints `checking for ECHO-TEXT' to the standard output
  1883.      first, if ECHO-TEXT is non-empty.  Use `AC_MSG_CHECKING' and
  1884.      `AC_MSG_RESULT' instead to print messages (*note Printing
  1885.      Messages::.).
  1886. File: autoconf.info,  Node: Run Time,  Next: Portable Shell,  Prev: Examining Libraries,  Up: Writing Tests
  1887. Checking Run Time Behavior
  1888. ==========================
  1889.    Sometimes you need to find out how a system performs at run time,
  1890. such as whether a given function has a certain capability or bug.  If
  1891. you can, make such checks when your program runs instead of when it is
  1892. configured.  You can check for things like the machine's endianness when
  1893. your program initializes itself.
  1894.    If you really need to test for a run-time behavior while configuring,
  1895. you can write a test program to determine the result, and compile and
  1896. run it using `AC_TRY_RUN'.  Avoid running test programs if possible,
  1897. because using them prevents people from configuring your package for
  1898. cross-compiling.
  1899. * Menu:
  1900. * Test Programs::               Running test programs.
  1901. * Guidelines::            General rules for writing test programs.
  1902. * Test Functions::        Avoiding pitfalls in test programs.
  1903. File: autoconf.info,  Node: Test Programs,  Next: Guidelines,  Up: Run Time
  1904. Running Test Programs
  1905. ---------------------
  1906.    Use the following macro if you need to test run-time behavior of the
  1907. system while configuring.
  1908.  - Macro: AC_TRY_RUN (PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE [,
  1909.           ACTION-IF-CROSS-COMPILING]]])
  1910.      PROGRAM is the text of a C program, on which shell variable and
  1911.      backquote substitutions are performed.  If it compiles and links
  1912.      successfully and returns an exit status of 0 when executed, run
  1913.      shell commands ACTION-IF-TRUE.  Otherwise run shell commands
  1914.      ACTION-IF-FALSE; the exit status of the program is available in
  1915.      the shell variable `$?'.  This macro uses `CFLAGS' or `CXXFLAGS',
  1916.      `CPPFLAGS', `LDFLAGS', and `LIBS' when compiling.
  1917.      If the C compiler being used does not produce executables that run
  1918.      on the system where `configure' is being run, then the test
  1919.      program is not run.  If the optional shell commands
  1920.      ACTION-IF-CROSS-COMPILING are given, they are run instead and this
  1921.      macro calls `AC_C_CROSS' if it has not already been called.
  1922.      Otherwise, `configure' prints an error message and exits.
  1923.    Try to provide a pessimistic default value to use when
  1924. cross-compiling makes run-time tests impossible.  You do this by
  1925. passing the optional last argument to `AC_TRY_RUN'.  `autoconf' prints
  1926. a warning message when creating `configure' each time it encounters a
  1927. call to `AC_TRY_RUN' with no ACTION-IF-CROSS-COMPILING argument given.
  1928. You may ignore the warning, though users will not be able to configure
  1929. your package for cross-compiling.  A few of the macros distributed with
  1930. Autoconf produce this warning message.
  1931.    To configure for cross-compiling you can also choose a value for
  1932. those parameters based on the canonical system name (*note Manual
  1933. Configuration::.).  Alternatively, set up a test results cache file with
  1934. the correct values for the target system (*note Caching Results::.).
  1935.    To provide a default for calls of `AC_TRY_RUN' that are embedded in
  1936. other macros, including a few of the ones that come with Autoconf, you
  1937. can call `AC_C_CROSS' before running them.  Then, if the shell variable
  1938. `cross_compiling' is set to `yes', use an alternate method to get the
  1939. results instead of calling the macros.
  1940.  - Macro: AC_C_CROSS
  1941.      If the C compiler being used does not produce executables that can
  1942.      run on the system where `configure' is being run, set the shell
  1943.      variable `cross_compiling' to `yes', otherwise `no'.
  1944. File: autoconf.info,  Node: Guidelines,  Next: Test Functions,  Prev: Test Programs,  Up: Run Time
  1945. Guidelines for Test Programs
  1946. ----------------------------
  1947.    Test programs should not write anything to the standard output.  They
  1948. should return 0 if the test succeeds, nonzero otherwise, so that success
  1949. can be distinguished easily from a core dump or other failure;
  1950. segmentation violations and other failures produce a nonzero exit
  1951. status.  Test programs should `exit', not `return', from `main',
  1952. because on some systems (old Suns, at least) the argument to `return'
  1953. in `main' is ignored.
  1954.    Test programs can use `#if' or `#ifdef' to check the values of
  1955. preprocessor macros defined by tests that have already run.  For
  1956. example, if you call `AC_HEADER_STDC', then later on in `configure.in'
  1957. you can have a test program that includes an ANSI C header file
  1958. conditionally:
  1959.      #if STDC_HEADERS
  1960.      # include <stdlib.h>
  1961.      #endif
  1962.    If a test program needs to use or create a data file, give it a name
  1963. that starts with `conftest', such as `conftestdata'.  The `configure'
  1964. script cleans up by running `rm -rf conftest*' after running test
  1965. programs and if the script is interrupted.
  1966. File: autoconf.info,  Node: Test Functions,  Prev: Guidelines,  Up: Run Time
  1967. Test Functions
  1968. --------------
  1969.    Function declarations in test programs should have a prototype
  1970. conditionalized for C++.  In practice, though, test programs rarely need
  1971. functions that take arguments.
  1972.      #ifdef __cplusplus
  1973.      foo(int i)
  1974.      #else
  1975.      foo(i) int i;
  1976.      #endif
  1977.    Functions that test programs declare should also be conditionalized
  1978. for C++, which requires `extern "C"' prototypes.  Make sure to not
  1979. include any header files containing clashing prototypes.
  1980.      #ifdef __cplusplus
  1981.      extern "C" void *malloc(size_t);
  1982.      #else
  1983.      char *malloc();
  1984.      #endif
  1985.    If a test program calls a function with invalid parameters (just to
  1986. see whether it exists), organize the program to ensure that it never
  1987. invokes that function.  You can do this by calling it in another
  1988. function that is never invoked.  You can't do it by putting it after a
  1989. call to `exit', because GCC version 2 knows that `exit' never returns
  1990. and optimizes out any code that follows it in the same block.
  1991.    If you include any header files, make sure to call the functions
  1992. relevant to them with the correct number of arguments, even if they are
  1993. just 0, to avoid compilation errors due to prototypes.  GCC version 2
  1994. has internal prototypes for several functions that it automatically
  1995. inlines; for example, `memcpy'.  To avoid errors when checking for
  1996. them, either pass them the correct number of arguments or redeclare them
  1997. with a different return type (such as `char').
  1998. File: autoconf.info,  Node: Portable Shell,  Next: Testing Values and Files,  Prev: Run Time,  Up: Writing Tests
  1999. Portable Shell Programming
  2000. ==========================
  2001.    When writing your own checks, there are some shell script programming
  2002. techniques you should avoid in order to make your code portable.  The
  2003. Bourne shell and upward-compatible shells like Bash and the Korn shell
  2004. have evolved over the years, but to prevent trouble, do not take
  2005. advantage of features that were added after UNIX version 7, circa 1977.
  2006. You should not use shell functions, aliases, negated character classes,
  2007. or other features that are not found in all Bourne-compatible shells;
  2008. restrict yourself to the lowest common denominator.  Even `unset' is
  2009. not supported by all shells!  Also, include a space after the
  2010. exclamation point in interpreter specifications, like this:
  2011.      #! /usr/bin/perl
  2012.    If you omit the space before the path, then 4.2BSD based systems
  2013. (such as Sequent DYNIX) will ignore the line, because they interpret
  2014. `#! /' as a 4-byte magic number.
  2015.    The set of external programs you should run in a `configure' script
  2016. is fairly small.  *Note Utilities in Makefiles: (standards)Utilities in
  2017. Makefiles, for the list.  This restriction allows users to start out
  2018. with a fairly small set of programs and build the rest, avoiding too
  2019. many interdependencies between packages.
  2020.    Some of these external utilities have a portable subset of features,
  2021. as well; for example, don't rely on `ln' having a `-f' option or `cat'
  2022. having any options.  `sed' scripts should not contain comments or use
  2023. branch labels longer than 8 characters.  Don't use `grep -s' to
  2024. suppress output, because `grep -s' on System V does not suppress
  2025. output, only error messages.  Instead, redirect the standard output and
  2026. standard error (in case the file doesn't exist) of `grep' to
  2027. `/dev/null'.  Check the exit status of `grep' to determine whether it
  2028. found a match.
  2029. File: autoconf.info,  Node: Testing Values and Files,  Next: Multiple Cases,  Prev: Portable Shell,  Up: Writing Tests
  2030. Testing Values and Files
  2031. ========================
  2032.    `configure' scripts need to test properties of many files and
  2033. strings.  Here are some portability problems to watch out for when doing
  2034. those tests.
  2035.    The `test' program is the way to perform many file and string tests.
  2036. It is often invoked by the alternate name `[', but using that name in
  2037. Autoconf code is asking for trouble since it is an `m4' quote character.
  2038.    If you need to make multiple checks using `test', combine them with
  2039. the shell operators `&&' and `||' instead of using the `test' operators
  2040. `-a' and `-o'.  On System V, the precedence of `-a' and `-o' is wrong
  2041. relative to the unary operators; consequently, POSIX does not specify
  2042. them, so using them is nonportable.  If you combine `&&' and `||' in
  2043. the same statement, keep in mind that they have equal precedence.
  2044.    To enable `configure' scripts to support cross-compilation, they
  2045. shouldn't do anything that tests features of the host system instead of
  2046. the target system.  But occasionally you may find it necessary to check
  2047. whether some arbitrary file exists.  To do so, use `test -f' or `test
  2048. -r'.  Do not use `test -x', because 4.3BSD does not have it.
  2049.    Another nonportable shell programming construction is
  2050.      VAR=${VAR:-VALUE}
  2051. The intent is to set VAR to VALUE only if it is not already set, but if
  2052. VAR has any value, even the empty string, to leave it alone.  Old BSD
  2053. shells, including the Ultrix `sh', don't accept the colon, and complain
  2054. and die.  A portable equivalent is
  2055.      : ${VAR=VALUE}
  2056. File: autoconf.info,  Node: Multiple Cases,  Next: Language Choice,  Prev: Testing Values and Files,  Up: Writing Tests
  2057. Multiple Cases
  2058. ==============
  2059.    Some operations are accomplished in several possible ways, depending
  2060. on the UNIX variant.  Checking for them essentially requires a "case
  2061. statement".  Autoconf does not directly provide one; however, it is
  2062. easy to simulate by using a shell variable to keep track of whether a
  2063. way to perform the operation has been found yet.
  2064.    Here is an example that uses the shell variable `fstype' to keep
  2065. track of whether the remaining cases need to be checked.
  2066.      AC_MSG_CHECKING(how to get filesystem type)
  2067.      fstype=no
  2068.      # The order of these tests is important.
  2069.      AC_TRY_CPP([#include <sys/statvfs.h>
  2070.      #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
  2071.      if test $fstype = no; then
  2072.      AC_TRY_CPP([#include <sys/statfs.h>
  2073.      #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
  2074.      fi
  2075.      if test $fstype = no; then
  2076.      AC_TRY_CPP([#include <sys/statfs.h>
  2077.      #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
  2078.      fi
  2079.      # (more cases omitted here)
  2080.      AC_MSG_RESULT($fstype)
  2081. File: autoconf.info,  Node: Language Choice,  Prev: Multiple Cases,  Up: Writing Tests
  2082. Language Choice
  2083. ===============
  2084.    Packages that use both C and C++ need to test features of both
  2085. compilers.  Autoconf-generated `configure' scripts check for C features
  2086. by default.  The following macros determine which language's compiler
  2087. is used in tests that follow in `configure.in'.
  2088.  - Macro: AC_LANG_C
  2089.      Do compilation tests using `CC' and `CPP' and use extension `.c'
  2090.      for test programs.
  2091.  - Macro: AC_LANG_CPLUSPLUS
  2092.      Do compilation tests using `CXX' and `CXXCPP' and use extension
  2093.      `.C' for test programs.
  2094.  - Macro: AC_LANG_SAVE
  2095.      Remember the current language (as set by `AC_LANG_C' or
  2096.      `AC_LANG_CPLUSPLUS') on a stack.  Does not change which language is
  2097.      current.  Use this macro and `AC_LANG_RESTORE' in macros that need
  2098.      to temporarily switch to a particular language.
  2099.  - Macro: AC_LANG_RESTORE
  2100.      Select the language that is saved on the top of the stack, as set
  2101.      by `AC_LANG_SAVE', and remove it from the stack.  This macro is
  2102.      equivalent to either `AC_LANG_C' or `AC_LANG_CPLUSPLUS', whichever
  2103.      had been run most recently when `AC_LANG_SAVE' was last called.
  2104.      Do not call this macro more times than `AC_LANG_SAVE'.
  2105.  - Macro: AC_REQUIRE_CPP
  2106.      Ensure that whichever preprocessor would currently be used for
  2107.      tests has been found.  Calls `AC_REQUIRE' (*note Prerequisite
  2108.      Macros::.) with an argument of either `AC_PROG_CPP' or
  2109.      `AC_PROG_CXXCPP', depending on which language is current.
  2110. File: autoconf.info,  Node: Results,  Next: Writing Macros,  Prev: Writing Tests,  Up: Top
  2111. Results of Tests
  2112. ****************
  2113.    Once `configure' has determined whether a feature exists, what can
  2114. it do to record that information?  There are four sorts of things it can
  2115. do: define a C preprocessor symbol, set a variable in the output files,
  2116. save the result in a cache file for future `configure' runs, and print
  2117. a message letting the user know the result of the test.
  2118. * Menu:
  2119. * Defining Symbols::            Defining C preprocessor symbols.
  2120. * Setting Output Variables::    Replacing variables in output files.
  2121. * Caching Results::             Speeding up subsequent `configure' runs.
  2122. * Printing Messages::           Notifying users of progress or problems.
  2123. File: autoconf.info,  Node: Defining Symbols,  Next: Setting Output Variables,  Up: Results
  2124. Defining C Preprocessor Symbols
  2125. ===============================
  2126.    A common action to take in response to a feature test is to define a
  2127. C preprocessor symbol indicating the results of the test.  That is done
  2128. by calling `AC_DEFINE' or `AC_DEFINE_UNQUOTED'.
  2129.    By default, `AC_OUTPUT' places the symbols defined by these macros
  2130. into the output variable `DEFS', which contains an option
  2131. `-DSYMBOL=VALUE' for each symbol defined.  Unlike in Autoconf version
  2132. 1, there is no variable `DEFS' defined while `configure' is running.
  2133. To check whether Autoconf macros have already defined a certain C
  2134. preprocessor symbol, test the value of the appropriate cache variable,
  2135. as in this example:
  2136.      AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
  2137.      if test "$ac_cv_func_vprintf" != yes; then
  2138.      AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
  2139.      fi
  2140.    If `AC_CONFIG_HEADER' has been called, then instead of creating
  2141. `DEFS', `AC_OUTPUT' creates a header file by substituting the correct
  2142. values into `#define' statements in a template file.  *Note
  2143. Configuration Headers::, for more information about this kind of output.
  2144.  - Macro: AC_DEFINE (VARIABLE [, VALUE])
  2145.      Define C preprocessor variable VARIABLE.  If VALUE is given, set
  2146.      VARIABLE to that value (verbatim), otherwise set it to 1.  VALUE
  2147.      should not contain literal newlines, and if you are not using
  2148.      `AC_CONFIG_HEADER' it should not contain any `#' characters, as
  2149.      `make' tends to eat them.  To use a shell variable (which you need
  2150.      to do in order to define a value containing the `m4' quote
  2151.      characters `[' or `]'), use `AC_DEFINE_UNQUOTED' instead.  The
  2152.      following example defines the C preprocessor variable `EQUATION'
  2153.      to be the string constant `"$a > $b"':
  2154.           AC_DEFINE(EQUATION, "$a > $b")
  2155.  - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE])
  2156.      Like `AC_DEFINE', but three shell expansions are
  2157.      performed--once--on VARIABLE and VALUE: variable expansion (`$'),
  2158.      command substitution (``'), and backslash escaping (`\').  Single
  2159.      and double quote characters in the value have no special meaning.
  2160.      Use this macro instead of `AC_DEFINE' when VARIABLE or VALUE is a
  2161.      shell variable.  Examples:
  2162.           AC_DEFINE_UNQUOTED(config_machfile, "${machfile}")
  2163.           AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
  2164.           AC_DEFINE_UNQUOTED(${ac_tr_hdr})
  2165.    Due to the syntactical bizarreness of the Bourne shell, do not use
  2166. semicolons to separate `AC_DEFINE' or `AC_DEFINE_UNQUOTED' calls from
  2167. other macro calls or shell code; that can cause syntax errors in the
  2168. resulting `configure' script.  Use either spaces or newlines.  That is,
  2169. do this:
  2170.      AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf")
  2171. or this:
  2172.      AC_CHECK_HEADER(elf.h,
  2173.        AC_DEFINE(SVR4)
  2174.        LIBS="$LIBS -lelf")
  2175. instead of this:
  2176.      AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
  2177. File: autoconf.info,  Node: Setting Output Variables,  Next: Caching Results,  Prev: Defining Symbols,  Up: Results
  2178. Setting Output Variables
  2179. ========================
  2180.    One way to record the results of tests is to set "output variables",
  2181. which are shell variables whose values are substituted into files that
  2182. `configure' outputs.  The two macros below create new output variables.
  2183. *Note Preset Output Variables::, for a list of output variables that
  2184. are always available.
  2185.  - Macro: AC_SUBST (VARIABLE)
  2186.      Create an output variable from a shell variable.  Make `AC_OUTPUT'
  2187.      substitute the variable VARIABLE into output files (typically one
  2188.      or more `Makefile's).  This means that `AC_OUTPUT' will replace
  2189.      instances of `@VARIABLE@' in input files with the value that the
  2190.      shell variable VARIABLE has when `AC_OUTPUT' is called.  The value
  2191.      of VARIABLE should not contain literal newlines.
  2192.  - Macro: AC_SUBST_FILE (VARIABLE)
  2193.      Another way to create an output variable from a shell variable.
  2194.      Make `AC_OUTPUT' insert (without substitutions) the contents of
  2195.      the file named by shell variable VARIABLE into output files.  This
  2196.      means that `AC_OUTPUT' will replace instances of `@VARIABLE@' in
  2197.      output files (such as `Makefile.in') with the contents of the file
  2198.      that the shell variable VARIABLE names when `AC_OUTPUT' is called.
  2199.      Set the variable to `/dev/null' for cases that do not have a file
  2200.      to insert.
  2201.      This macro is useful for inserting `Makefile' fragments containing
  2202.      special dependencies or other `make' directives for particular host
  2203.      or target types into `Makefile's.  For example, `configure.in'
  2204.      could contain:
  2205.           AC_SUBST_FILE(host_frag)dnl
  2206.           host_frag=$srcdir/conf/sun4.mh
  2207.      and then a `Makefile.in' could contain:
  2208.           @host_frag@
  2209. File: autoconf.info,  Node: Caching Results,  Next: Printing Messages,  Prev: Setting Output Variables,  Up: Results
  2210. Caching Results
  2211. ===============
  2212.    To avoid checking for the same features repeatedly in various
  2213. `configure' scripts (or repeated runs of one script), `configure' saves
  2214. the results of many of its checks in a "cache file".  If, when a
  2215. `configure' script runs, it finds a cache file, it reads from it the
  2216. results from previous runs and avoids rerunning those checks.  As a
  2217. result, `configure' can run much faster than if it had to perform all
  2218. of the checks every time.
  2219.  - Macro: AC_CACHE_VAL (CACHE-ID, COMMANDS-TO-SET-IT)
  2220.      Ensure that the results of the check identified by CACHE-ID are
  2221.      available.  If the results of the check were in the cache file
  2222.      that was read, and `configure' was not given the `--quiet' or
  2223.      `--silent' option, print a message saying that the result was
  2224.      cached; otherwise, run the shell commands COMMANDS-TO-SET-IT.
  2225.      Those commands should have no side effects except for setting the
  2226.      variable CACHE-ID.  In particular, they should not call
  2227.      `AC_DEFINE'; the code that follows the call to `AC_CACHE_VAL'
  2228.      should do that, based on the cached value.  Also, they should not
  2229.      print any messages, for example with `AC_MSG_CHECKING'; do that
  2230.      before calling `AC_CACHE_VAL', so the messages are printed
  2231.      regardless of whether the results of the check are retrieved from
  2232.      the cache or determined by running the shell commands.  If the
  2233.      shell commands are run to determine the value, the value will be
  2234.      saved in the cache file just before `configure' creates its output
  2235.      files.  *Note Cache Variable Names::, for how to choose the name
  2236.      of the CACHE-ID variable.
  2237.  - Macro: AC_CACHE_CHECK (MESSAGE, CACHE-ID, COMMANDS)
  2238.      A wrapper for `AC_CACHE_VAL' that takes care of printing the
  2239.      messages.  This macro provides a convenient shorthand for the most
  2240.      common way to use these macros.  It calls `AC_MSG_CHECKING' for
  2241.      MESSAGE, then `AC_CACHE_VAL' with the CACHE-ID and COMMANDS
  2242.      arguments, and `AC_MSG_RESULT' with CACHE-ID.
  2243. * Menu:
  2244. * Cache Variable Names::        Shell variables used in caches.
  2245. * Cache Files::                Files `configure' uses for caching.
  2246. File: autoconf.info,  Node: Cache Variable Names,  Next: Cache Files,  Up: Caching Results
  2247. Cache Variable Names
  2248. --------------------
  2249.    The names of cache variables should have the following format:
  2250.      PACKAGE-PREFIX_cv_VALUE-TYPE_SPECIFIC-VALUE[_ADDITIONAL-OPTIONS]
  2251. for example, `ac_cv_header_stat_broken' or
  2252. `ac_cv_prog_gcc_traditional'.  The parts of the variable name are:
  2253. PACKAGE-PREFIX
  2254.      An abbreviation for your package or organization; the same prefix
  2255.      you begin local Autoconf macros with, except lowercase by
  2256.      convention.  For cache values used by the distributed Autoconf
  2257.      macros, this value is `ac'.
  2258. `_cv_'
  2259.      Indicates that this shell variable is a cache value.
  2260. VALUE-TYPE
  2261.      A convention for classifying cache values, to produce a rational
  2262.      naming system.  The values used in Autoconf are listed in *Note
  2263.      Macro Names::.
  2264. SPECIFIC-VALUE
  2265.      Which member of the class of cache values this test applies to.
  2266.      For example, which function (`alloca'), program (`gcc'), or output
  2267.      variable (`INSTALL').
  2268. ADDITIONAL-OPTIONS
  2269.      Any particular behavior of the specific member that this test
  2270.      applies to.  For example, `broken' or `set'.  This part of the
  2271.      name may be omitted if it does not apply.
  2272.    Like their names, the values that may be assigned to cache variables
  2273. have a few restrictions.  The values may not contain single quotes or
  2274. curly braces.  Usually, their values will be boolean (`yes' or `no') or
  2275. the names of files or functions; so this is not an important
  2276. restriction.
  2277. File: autoconf.info,  Node: Cache Files,  Prev: Cache Variable Names,  Up: Caching Results
  2278. Cache Files
  2279. -----------
  2280.    A cache file is a shell script that caches the results of configure
  2281. tests run on one system so they can be shared between configure scripts
  2282. and configure runs.  It is not useful on other systems.  If its contents
  2283. are invalid for some reason, the user may delete or edit it.
  2284.    By default, configure uses `./config.cache' as the cache file,
  2285. creating it if it does not exist already.  `configure' accepts the
  2286. `--cache-file=FILE' option to use a different cache file; that is what
  2287. `configure' does when it calls `configure' scripts in subdirectories,
  2288. so they share the cache.  *Note Subdirectories::, for information on
  2289. configuring subdirectories with the `AC_CONFIG_SUBDIRS' macro.
  2290.    Giving `--cache-file=/dev/null' disables caching, for debugging
  2291. `configure'.  `config.status' only pays attention to the cache file if
  2292. it is given the `--recheck' option, which makes it rerun `configure'.
  2293. If you are anticipating a long debugging period, you can also disable
  2294. cache loading and saving for a `configure' script by redefining the
  2295. cache macros at the start of `configure.in':
  2296.      define([AC_CACHE_LOAD], )dnl
  2297.      define([AC_CACHE_SAVE], )dnl
  2298.      AC_INIT(whatever)
  2299.       ... rest of configure.in ...
  2300.    It is wrong to try to distribute cache files for particular system
  2301. types.  There is too much room for error in doing that, and too much
  2302. administrative overhead in maintaining them.  For any features that
  2303. can't be guessed automatically, use the standard method of the canonical
  2304. system type and linking files (*note Manual Configuration::.).
  2305.    The cache file on a particular system will gradually accumulate
  2306. whenever someone runs a `configure' script; it will be initially
  2307. nonexistent.  Running `configure' merges the new cache results with the
  2308. existing cache file.  The site initialization script can specify a
  2309. site-wide cache file to use instead of the default, to make it work
  2310. transparently, as long as the same C compiler is used every time (*note
  2311. Site Defaults::.).
  2312. File: autoconf.info,  Node: Printing Messages,  Prev: Caching Results,  Up: Results
  2313. Printing Messages
  2314. =================
  2315.    `configure' scripts need to give users running them several kinds of
  2316. information.  The following macros print messages in ways appropriate
  2317. for each kind.  The arguments to all of them get enclosed in shell
  2318. double quotes, so the shell performs variable and backquote substitution
  2319. on them.
  2320.    These macros are all wrappers around the `echo' shell command.
  2321. `configure' scripts should rarely need to run `echo' directly to print
  2322. messages for the user.  Using these macros makes it easy to change how
  2323. and when each kind of message is printed; such changes need only be
  2324. made to the macro definitions, and all of the callers change
  2325. automatically.
  2326.  - Macro: AC_MSG_CHECKING (FEATURE-DESCRIPTION)
  2327.      Notify the user that `configure' is checking for a particular
  2328.      feature.  This macro prints a message that starts with `checking '
  2329.      and ends with `...' and no newline.  It must be followed by a call
  2330.      to `AC_MSG_RESULT' to print the result of the check and the
  2331.      newline.  The FEATURE-DESCRIPTION should be something like
  2332.      `whether the Fortran compiler accepts C++ comments' or `for c89'.
  2333.      This macro prints nothing if `configure' is run with the `--quiet'
  2334.      or `--silent' option.
  2335.  - Macro: AC_MSG_RESULT (RESULT-DESCRIPTION)
  2336.      Notify the user of the results of a check.  RESULT-DESCRIPTION is
  2337.      almost always the value of the cache variable for the check,
  2338.      typically `yes', `no', or a file name.  This macro should follow a
  2339.      call to `AC_MSG_CHECKING', and the RESULT-DESCRIPTION should be
  2340.      the completion of the message printed by the call to
  2341.      `AC_MSG_CHECKING'.
  2342.      This macro prints nothing if `configure' is run with the `--quiet'
  2343.      or `--silent' option.
  2344.  - Macro: AC_MSG_ERROR (ERROR-DESCRIPTION)
  2345.      Notify the user of an error that prevents `configure' from
  2346.      completing.  This macro prints an error message on the standard
  2347.      error output and exits `configure' with a nonzero status.
  2348.      ERROR-DESCRIPTION should be something like `invalid value $HOME
  2349.      for \$HOME'.
  2350.  - Macro: AC_MSG_WARN (PROBLEM-DESCRIPTION)
  2351.      Notify the `configure' user of a possible problem.  This macro
  2352.      prints the message on the standard error output; `configure'
  2353.      continues running afterward, so macros that call `AC_MSG_WARN'
  2354.      should provide a default (back-up) behavior for the situations
  2355.      they warn about.  PROBLEM-DESCRIPTION should be something like `ln
  2356.      -s seems to make hard links'.
  2357.    The following two macros are an obsolete alternative to
  2358. `AC_MSG_CHECKING' and `AC_MSG_RESULT'.
  2359.  - Macro: AC_CHECKING (FEATURE-DESCRIPTION)
  2360.      This macro is similar to `AC_MSG_CHECKING', except that it prints a
  2361.      newline after the FEATURE-DESCRIPTION.  It is useful mainly to
  2362.      print a general description of the overall purpose of a group of
  2363.      feature checks, e.g.,
  2364.           AC_CHECKING(if stack overflow is detectable)
  2365.  - Macro: AC_VERBOSE (RESULT-DESCRIPTION)
  2366.      This macro is similar to `AC_MSG_RESULT', except that it is meant
  2367.      to follow a call to `AC_CHECKING' instead of `AC_MSG_CHECKING'; it
  2368.      starts the message it prints with a tab.  It is considered
  2369.      obsolete.
  2370. File: autoconf.info,  Node: Writing Macros,  Next: Manual Configuration,  Prev: Results,  Up: Top
  2371. Writing Macros
  2372. **************
  2373.    When you write a feature test that could be applicable to more than
  2374. one software package, the best thing to do is encapsulate it in a new
  2375. macro.  Here are some instructions and guidelines for writing Autoconf
  2376. macros.
  2377. * Menu:
  2378. * Macro Definitions::        Basic format of an Autoconf macro.
  2379. * Macro Names::                 What to call your new macros.
  2380. * Quoting::            Protecting macros from unwanted expansion.
  2381. * Dependencies Between Macros::    What to do when macros depend on other macros.
  2382. File: autoconf.info,  Node: Macro Definitions,  Next: Macro Names,  Up: Writing Macros
  2383. Macro Definitions
  2384. =================
  2385.    Autoconf macros are defined using the `AC_DEFUN' macro, which is
  2386. similar to the `m4' builtin `define' macro.  In addition to defining a
  2387. macro, `AC_DEFUN' adds to it some code which is used to constrain the
  2388. order in which macros are called (*note Prerequisite Macros::.).
  2389.    An Autoconf macro definition looks like this:
  2390.      AC_DEFUN(MACRO-NAME, [MACRO-BODY])
  2391. The square brackets here do not indicate optional text: they should
  2392. literally be present in the macro definition to avoid macro expansion
  2393. problems (*note Quoting::.).  You can refer to any arguments passed to
  2394. the macro as `$1', `$2', etc.
  2395.    To introduce comments in `m4', use the `m4' builtin `dnl'; it causes
  2396. `m4' to discard the text through the next newline.  It is not needed
  2397. between macro definitions in `acsite.m4' and `aclocal.m4', because all
  2398. output is discarded until `AC_INIT' is called.
  2399.    *Note How to define new macros: (m4.info)Definitions, for more
  2400. complete information on writing `m4' macros.
  2401. File: autoconf.info,  Node: Macro Names,  Next: Quoting,  Prev: Macro Definitions,  Up: Writing Macros
  2402. Macro Names
  2403. ===========
  2404.    All of the Autoconf macros have all-uppercase names starting with
  2405. `AC_' to prevent them from accidentally conflicting with other text.
  2406. All shell variables that they use for internal purposes have
  2407. mostly-lowercase names starting with `ac_'.  To ensure that your macros
  2408. don't conflict with present or future Autoconf macros, you should
  2409. prefix your own macro names and any shell variables they use with some
  2410. other sequence.  Possibilities include your initials, or an abbreviation
  2411. for the name of your organization or software package.
  2412.    Most of the Autoconf macros' names follow a structured naming
  2413. convention that indicates the kind of feature check by the name.  The
  2414. macro names consist of several words, separated by underscores, going
  2415. from most general to most specific.   The names of their cache
  2416. variables use the same convention (*note Cache Variable Names::., for
  2417. more information on them).
  2418.    The first word of the name after `AC_' usually tells the category of
  2419. feature being tested.  Here are the categories used in Autoconf for
  2420. specific test macros, the kind of macro that you are more likely to
  2421. write.  They are also used for cache variables, in all-lowercase.  Use
  2422. them where applicable; where they're not, invent your own categories.
  2423.      C language builtin features.
  2424. `DECL'
  2425.      Declarations of C variables in header files.
  2426. `FUNC'
  2427.      Functions in libraries.
  2428. `GROUP'
  2429.      UNIX group owners of files.
  2430. `HEADER'
  2431.      Header files.
  2432. `LIB'
  2433.      C libraries.
  2434. `PATH'
  2435.      The full path names to files, including programs.
  2436. `PROG'
  2437.      The base names of programs.
  2438. `STRUCT'
  2439.      Definitions of C structures in header files.
  2440. `SYS'
  2441.      Operating system features.
  2442. `TYPE'
  2443.      C builtin or declared types.
  2444. `VAR'
  2445.      C variables in libraries.
  2446.    After the category comes the name of the particular feature being
  2447. tested.  Any further words in the macro name indicate particular aspects
  2448. of the feature.  For example, `AC_FUNC_UTIME_NULL' checks the behavior
  2449. of the `utime' function when called with a `NULL' pointer.
  2450.    A macro that is an internal subroutine of another macro should have a
  2451. name that starts with the name of that other macro, followed by one or
  2452. more words saying what the internal macro does.  For example,
  2453. `AC_PATH_X' has internal macros `AC_PATH_X_XMKMF' and
  2454. `AC_PATH_X_DIRECT'.
  2455. File: autoconf.info,  Node: Quoting,  Next: Dependencies Between Macros,  Prev: Macro Names,  Up: Writing Macros
  2456. Quoting
  2457. =======
  2458.    Macros that are called by other macros are evaluated by `m4' several
  2459. times; each evaluation might require another layer of quotes to prevent
  2460. unwanted expansions of macros or `m4' builtins, such as `define' and
  2461. `$1'.  Quotes are also required around macro arguments that contain
  2462. commas, since commas separate the arguments from each other.  It's a
  2463. good idea to quote any macro arguments that contain newlines or calls
  2464. to other macros, as well.
  2465.    Autoconf changes the `m4' quote characters from the default ``' and
  2466. `'' to `[' and `]', because many of the macros use ``' and `'',
  2467. mismatched.  However, in a few places the macros need to use brackets
  2468. (usually in C program text or regular expressions).  In those places,
  2469. they use the `m4' builtin command `changequote' to temporarily change
  2470. the quote characters to `<<' and `>>'.  (Sometimes, if they don't need
  2471. to quote anything, they disable quoting entirely instead by setting the
  2472. quote characters to empty strings.)  Here is an example:
  2473.      AC_TRY_LINK(
  2474.      changequote(<<, >>)dnl
  2475.      <<#include <time.h>
  2476.      #ifndef tzname /* For SGI.  */
  2477.      extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
  2478.      #endif>>,
  2479.      changequote([, ])dnl
  2480.      [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)
  2481.    When you create a `configure' script using newly written macros,
  2482. examine it carefully to check whether you need to add more quotes in
  2483. your macros.  If one or more words have disappeared in the `m4' output,
  2484. you need more quotes.  When in doubt, quote.
  2485.    However, it's also possible to put on too many layers of quotes.  If
  2486. this happens, the resulting `configure' script will contain unexpanded
  2487. macros.  The `autoconf' program checks for this problem by doing `grep
  2488. AC_ configure'.
  2489. File: autoconf.info,  Node: Dependencies Between Macros,  Prev: Quoting,  Up: Writing Macros
  2490. Dependencies Between Macros
  2491. ===========================
  2492.    Some Autoconf macros depend on other macros having been called first
  2493. in order to work correctly.  Autoconf provides a way to ensure that
  2494. certain macros are called if needed and a way to warn the user if
  2495. macros are called in an order that might cause incorrect operation.
  2496. * Menu:
  2497. * Prerequisite Macros::        Ensuring required information.
  2498. * Suggested Ordering::        Warning about possible ordering problems.
  2499. * Obsolete Macros::             Warning about old ways of doing things.
  2500. File: autoconf.info,  Node: Prerequisite Macros,  Next: Suggested Ordering,  Up: Dependencies Between Macros
  2501. Prerequisite Macros
  2502. -------------------
  2503.    A macro that you write might need to use values that have previously
  2504. been computed by other macros.  For example, `AC_DECL_YYTEXT' examines
  2505. the output of `flex' or `lex', so it depends on `AC_PROG_LEX' having
  2506. been called first to set the shell variable `LEX'.
  2507.    Rather than forcing the user of the macros to keep track of the
  2508. dependencies between them, you can use the `AC_REQUIRE' macro to do it
  2509. automatically.  `AC_REQUIRE' can ensure that a macro is only called if
  2510. it is needed, and only called once.
  2511.  - Macro: AC_REQUIRE (MACRO-NAME)
  2512.      If the `m4' macro MACRO-NAME has not already been called, call it
  2513.      (without any arguments).  Make sure to quote MACRO-NAME with
  2514.      square brackets.  MACRO-NAME must have been defined using
  2515.      `AC_DEFUN' or else contain a call to `AC_PROVIDE' to indicate that
  2516.      it has been called.
  2517.    An alternative to using `AC_DEFUN' is to use `define' and call
  2518. `AC_PROVIDE'.  Because this technique does not prevent nested messages,
  2519. it is considered obsolete.
  2520.  - Macro: AC_PROVIDE (THIS-MACRO-NAME)
  2521.      Record the fact that THIS-MACRO-NAME has been called.
  2522.      THIS-MACRO-NAME should be the name of the macro that is calling
  2523.      `AC_PROVIDE'.  An easy way to get it is from the `m4' builtin
  2524.      variable `$0', like this:
  2525.           AC_PROVIDE([$0])
  2526. File: autoconf.info,  Node: Suggested Ordering,  Next: Obsolete Macros,  Prev: Prerequisite Macros,  Up: Dependencies Between Macros
  2527. Suggested Ordering
  2528. ------------------
  2529.    Some macros should be run before another macro if both are called,
  2530. but neither *requires* that the other be called.  For example, a macro
  2531. that changes the behavior of the C compiler should be called before any
  2532. macros that run the C compiler.  Many of these dependencies are noted in
  2533. the documentation.
  2534.    Autoconf provides the `AC_BEFORE' macro to warn users when macros
  2535. with this kind of dependency appear out of order in a `configure.in'
  2536. file.  The warning occurs when creating `configure' from
  2537. `configure.in', not when running `configure'.  For example,
  2538. `AC_PROG_CPP' checks whether the C compiler can run the C preprocessor
  2539. when given the `-E' option.  It should therefore be called after any
  2540. macros that change which C compiler is being used, such as
  2541. `AC_PROG_CC'.  So `AC_PROG_CC' contains:
  2542.      AC_BEFORE([$0], [AC_PROG_CPP])dnl
  2543. This warns the user if a call to `AC_PROG_CPP' has already occurred
  2544. when `AC_PROG_CC' is called.
  2545.  - Macro: AC_BEFORE (THIS-MACRO-NAME, CALLED-MACRO-NAME)
  2546.      Make `m4' print a warning message on the standard error output if
  2547.      CALLED-MACRO-NAME has already been called.  THIS-MACRO-NAME should
  2548.      be the name of the macro that is calling `AC_BEFORE'.  The macro
  2549.      CALLED-MACRO-NAME must have been defined using `AC_DEFUN' or else
  2550.      contain a call to `AC_PROVIDE' to indicate that it has been called.
  2551. File: autoconf.info,  Node: Obsolete Macros,  Prev: Suggested Ordering,  Up: Dependencies Between Macros
  2552. Obsolete Macros
  2553. ---------------
  2554.    Configuration and portability technology has evolved over the years.
  2555. Often better ways of solving a particular problem are developed, or
  2556. ad-hoc approaches are systematized.  This process has occurred in many
  2557. parts of Autoconf.  One result is that some of the macros are now
  2558. considered "obsolete"; they still work, but are no longer considered
  2559. the best thing to do.  Autoconf provides the `AC_OBSOLETE' macro to
  2560. warn users producing `configure' scripts when they use obsolete macros,
  2561. to encourage them to modernize.  A sample call is:
  2562.      AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl
  2563.  - Macro: AC_OBSOLETE (THIS-MACRO-NAME [, SUGGESTION])
  2564.      Make `m4' print a message on the standard error output warning that
  2565.      THIS-MACRO-NAME is obsolete, and giving the file and line number
  2566.      where it was called.  THIS-MACRO-NAME should be the name of the
  2567.      macro that is calling `AC_OBSOLETE'.  If SUGGESTION is given, it
  2568.      is printed at the end of the warning message; for example, it can
  2569.      be a suggestion for what to use instead of THIS-MACRO-NAME.
  2570. File: autoconf.info,  Node: Manual Configuration,  Next: Site Configuration,  Prev: Writing Macros,  Up: Top
  2571. Manual Configuration
  2572. ********************
  2573.    A few kinds of features can't be guessed automatically by running
  2574. test programs.  For example, the details of the object file format, or
  2575. special options that need to be passed to the compiler or linker.  You
  2576. can check for such features using ad-hoc means, such as having
  2577. `configure' check the output of the `uname' program, or looking for
  2578. libraries that are unique to particular systems.  However, Autoconf
  2579. provides a uniform method for handling unguessable features.
  2580. * Menu:
  2581. * Specifying Names::            Specifying the system type.
  2582. * Canonicalizing::              Getting the canonical system type.
  2583. * System Type Variables::       Variables containing the system type.
  2584. * Using System Type::           What to do with the system type.
  2585. File: autoconf.info,  Node: Specifying Names,  Next: Canonicalizing,  Up: Manual Configuration
  2586. Specifying the System Type
  2587. ==========================
  2588.    Like other GNU `configure' scripts, Autoconf-generated `configure'
  2589. scripts can make decisions based on a canonical name for the system
  2590. type, which has the form:
  2591.      CPU-COMPANY-SYSTEM
  2592.    `configure' can usually guess the canonical name for the type of
  2593. system it's running on.  To do so it runs a script called
  2594. `config.guess', which derives the name using the `uname' command or
  2595. symbols predefined by the C preprocessor.
  2596.    Alternately, the user can specify the system type with command line
  2597. arguments to `configure'.  Doing so is necessary when cross-compiling.
  2598. In the most complex case of cross-compiling, three system types are
  2599. involved.  The options to specify them are:
  2600. `--build=BUILD-TYPE'
  2601.      the type of system on which the package is being configured and
  2602.      compiled (rarely needed);
  2603. `--host=HOST-TYPE'
  2604.      the type of system on which the package will run;
  2605. `--target=TARGET-TYPE'
  2606.      the type of system for which any compiler tools in the package will
  2607.      produce code.
  2608. If the user gives `configure' a non-option argument, it is used as the
  2609. default for the host, target, and build system types if the user does
  2610. not specify them explicitly with options.  The target and build types
  2611. default to the host type if it is given and they are not.  If you are
  2612. cross-compiling, you still have to specify the names of the cross-tools
  2613. you use, in particular the C compiler, on the `configure' command line,
  2614. e.g.,
  2615.      CC=m68k-coff-gcc configure --target=m68k-coff
  2616.    `configure' recognizes short aliases for many system types; for
  2617. example, `decstation' can be given on the command line instead of
  2618. `mips-dec-ultrix4.2'.  `configure' runs a script called `config.sub' to
  2619. canonicalize system type aliases.
  2620. File: autoconf.info,  Node: Canonicalizing,  Next: System Type Variables,  Prev: Specifying Names,  Up: Manual Configuration
  2621. Getting the Canonical System Type
  2622. =================================
  2623.    The following macros make the system type available to `configure'
  2624. scripts.  They run the shell script `config.guess' to determine any
  2625. values for the host, target, and build types that they need and the user
  2626. did not specify on the command line.  They run `config.sub' to
  2627. canonicalize any aliases the user gave.  If you use these macros, you
  2628. must distribute those two shell scripts along with your source code.
  2629. *Note Output::, for information about the `AC_CONFIG_AUX_DIR' macro
  2630. which you can use to control which directory `configure' looks for
  2631. those scripts in.  If you do not use either of these macros,
  2632. `configure' ignores any `--host', `--target', and `--build' options
  2633. given to it.
  2634.  - Macro: AC_CANONICAL_SYSTEM
  2635.      Determine the system type and set output variables to the names of
  2636.      the canonical system types.  *Note System Type Variables::, for
  2637.      details about the variables this macro sets.
  2638.  - Macro: AC_CANONICAL_HOST
  2639.      Perform only the subset of `AC_CANONICAL_SYSTEM' relevant to the
  2640.      host type.  This is all that is needed for programs that are not
  2641.      part of a compiler toolchain.
  2642. File: autoconf.info,  Node: System Type Variables,  Next: Using System Type,  Prev: Canonicalizing,  Up: Manual Configuration
  2643. System Type Variables
  2644. =====================
  2645.    After calling `AC_CANONICAL_SYSTEM', the following output variables
  2646. contain the system type information.  After `AC_CANONICAL_HOST', only
  2647. the `host' variables below are set.
  2648. ``build', `host', `target''
  2649.      the canonical system names;
  2650. ``build_alias', `host_alias', `target_alias''
  2651.      the names the user specified, or the canonical names if
  2652.      `config.guess' was used;
  2653. ``build_cpu', `build_vendor', `build_os''
  2654. ``host_cpu', `host_vendor', `host_os''
  2655. ``target_cpu', `target_vendor', `target_os''
  2656.      the individual parts of the canonical names (for convenience).
  2657. File: autoconf.info,  Node: Using System Type,  Prev: System Type Variables,  Up: Manual Configuration
  2658. Using the System Type
  2659. =====================
  2660.    How do you use a canonical system type?  Usually, you use it in one
  2661. or more `case' statements in `configure.in' to select system-specific C
  2662. files.  Then link those files, which have names based on the system
  2663. name, to generic names, such as `host.h' or `target.c'.  The `case'
  2664. statement patterns can use shell wildcards to group several cases
  2665. together, like in this fragment:
  2666.      case "$target" in
  2667.      i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;;
  2668.      i960-*-bout) obj_format=bout ;;
  2669.      esac
  2670.  - Macro: AC_LINK_FILES (SOURCE..., DEST...)
  2671.      Make `AC_OUTPUT' link each of the existing files SOURCE to the
  2672.      corresponding link name DEST.  Makes a symbolic link if possible,
  2673.      otherwise a hard link.  The DEST and SOURCE names should be
  2674.      relative to the top level source or build directory.
  2675.      For example, this call:
  2676.           AC_LINK_FILES(config/${machine}.h config/${obj_format}.h, host.h object.h)
  2677.      creates in the current directory `host.h', which is a link to
  2678.      `SRCDIR/config/${machine}.h', and `object.h', which is a link to
  2679.      `SRCDIR/config/${obj_format}.h'.
  2680.    You can also use the host system type to find cross-compilation
  2681. tools.  *Note Generic Programs::, for information about the
  2682. `AC_CHECK_TOOL' macro which does that.
  2683. File: autoconf.info,  Node: Site Configuration,  Next: Invoking configure,  Prev: Manual Configuration,  Up: Top
  2684. Site Configuration
  2685. ******************
  2686.    `configure' scripts support several kinds of local configuration
  2687. decisions.  There are ways for users to specify where external software
  2688. packages are, include or exclude optional features, install programs
  2689. under modified names, and set default values for `configure' options.
  2690. * Menu:
  2691. * External Software::           Working with other optional software.
  2692. * Package Options::             Selecting optional features.
  2693. * Site Details::                Configuring site details.
  2694. * Transforming Names::          Changing program names when installing.
  2695. * Site Defaults::               Giving `configure' local defaults.
  2696. File: autoconf.info,  Node: External Software,  Next: Package Options,  Up: Site Configuration
  2697. Working With External Software
  2698. ==============================
  2699.    Some packages require, or can optionally use, other software packages
  2700. which are already installed.  The user can give `configure' command
  2701. line options to specify which such external software to use.  The
  2702. options have one of these forms:
  2703.      --with-PACKAGE[=ARG]
  2704.      --without-PACKAGE
  2705.    For example, `--with-gnu-ld' means work with the GNU linker instead
  2706. of some other linker.  `--with-x' means work with The X Window System.
  2707.    The user can give an argument by following the package name with `='
  2708. and the argument.  Giving an argument of `no' is for packages that are
  2709. used by default; it says to *not* use the package.  An argument that is
  2710. neither `yes' nor `no' could include a name or number of a version of
  2711. the other package, to specify more precisely which other package this
  2712. program is supposed to work with.  If no argument is given, it defaults
  2713. to `yes'.  `--without-PACKAGE' is equivalent to `--with-PACKAGE=no'.
  2714.    For each external software package that may be used, `configure.in'
  2715. should call `AC_ARG_WITH' to detect whether the `configure' user asked
  2716. to use it.  Whether each package is used or not by default, and which
  2717. arguments are valid, is up to you.
  2718.  - Macro: AC_ARG_WITH (PACKAGE, HELP-STRING [, ACTION-IF-GIVEN [,
  2719.           ACTION-IF-NOT-GIVEN]])
  2720.      If the user gave `configure' the option `--with-PACKAGE' or
  2721.      `--without-PACKAGE', run shell commands ACTION-IF-GIVEN.  If
  2722.      neither option was given, run shell commands ACTION-IF-NOT-GIVEN.
  2723.      The name PACKAGE indicates another software package that this
  2724.      program should work with.  It should consist only of alphanumeric
  2725.      characters and dashes.
  2726.      The option's argument is available to the shell commands
  2727.      ACTION-IF-GIVEN in the shell variable `withval', which is actually
  2728.      just the value of the shell variable `with_PACKAGE', with any `-'
  2729.      characters changed into `_'.  You may use that variable instead,
  2730.      if you wish.
  2731.      The argument HELP-STRING is a description of the option which
  2732.      looks like this:
  2733.             --with-readline         support fancy command line editing
  2734.      HELP-STRING may be more than one line long, if more detail is
  2735.      needed.  Just make sure the columns line up in `configure --help'.
  2736.      Avoid tabs in the help string.  You'll need to enclose it in `['
  2737.      and `]' in order to produce the leading spaces.
  2738.  - Macro: AC_WITH (PACKAGE, ACTION-IF-GIVEN [, ACTION-IF-NOT-GIVEN])
  2739.      This is an obsolete version of `AC_ARG_WITH' that does not support
  2740.      providing a help string.
  2741. File: autoconf.info,  Node: Package Options,  Next: Site Details,  Prev: External Software,  Up: Site Configuration
  2742. Choosing Package Options
  2743. ========================
  2744.    If a software package has optional compile-time features, the user
  2745. can give `configure' command line options to specify whether to compile
  2746. them.  The options have one of these forms:
  2747.      --enable-FEATURE[=ARG]
  2748.      --disable-FEATURE
  2749.    These options allow users to choose which optional features to build
  2750. and install.  `--enable-FEATURE' options should never make a feature
  2751. behave differently or cause one feature to replace another.  They
  2752. should only cause parts of the program to be built rather than left out.
  2753.    The user can give an argument by following the feature name with `='
  2754. and the argument.  Giving an argument of `no' requests that the feature
  2755. *not* be made available.  A feature with an argument looks like
  2756. `--enable-debug=stabs'.  If no argument is given, it defaults to `yes'.
  2757. `--disable-FEATURE' is equivalent to `--enable-FEATURE=no'.
  2758.    For each optional feature, `configure.in' should call
  2759. `AC_ARG_ENABLE' to detect whether the `configure' user asked to include
  2760. it.  Whether each feature is included or not by default, and which
  2761. arguments are valid, is up to you.
  2762.  - Macro: AC_ARG_ENABLE (FEATURE, HELP-STRING [, ACTION-IF-GIVEN [,
  2763.           ACTION-IF-NOT-GIVEN]])
  2764.      If the user gave `configure' the option `--enable-FEATURE' or
  2765.      `--disable-FEATURE', run shell commands ACTION-IF-GIVEN.  If
  2766.      neither option was given, run shell commands ACTION-IF-NOT-GIVEN.
  2767.      The name FEATURE indicates an optional user-level facility.  It
  2768.      should consist only of alphanumeric characters and dashes.
  2769.      The option's argument is available to the shell commands
  2770.      ACTION-IF-GIVEN in the shell variable `enableval', which is
  2771.      actually just the value of the shell variable `enable_PACKAGE',
  2772.      with any `-' characters changed into `_'.  You may use that
  2773.      variable instead, if you wish.  The HELP-STRING argument is like
  2774.      that of `AC_ARG_WITH' (*note External Software::.).
  2775.  - Macro: AC_ENABLE (FEATURE, ACTION-IF-GIVEN [, ACTION-IF-NOT-GIVEN])
  2776.      This is an obsolete version of `AC_ARG_ENABLE' that does not
  2777.      support providing a help string.
  2778. File: autoconf.info,  Node: Site Details,  Next: Transforming Names,  Prev: Package Options,  Up: Site Configuration
  2779. Configuring Site Details
  2780. ========================
  2781.    Some software packages require complex site-specific information.
  2782. Some examples are host names to use for certain services, company
  2783. names, and email addresses to contact.  Since some configuration
  2784. scripts generated by Metaconfig ask for such information interactively,
  2785. people sometimes wonder how to get that information in
  2786. Autoconf-generated configuration scripts, which aren't interactive.
  2787.    Such site configuration information should be put in a file that is
  2788. edited *only by users*, not by programs.  The location of the file can
  2789. either be based on the `prefix' variable, or be a standard location
  2790. such as the user's home directory.  It could even be specified by an
  2791. environment variable.  The programs should examine that file at run
  2792. time, rather than at compile time.  Run time configuration is more
  2793. convenient for users and makes the configuration process simpler than
  2794. getting the information while configuring.  *Note Variables for
  2795. Installation Directories: (standards)Directory Variables, for more
  2796. information on where to put data files.
  2797. File: autoconf.info,  Node: Transforming Names,  Next: Site Defaults,  Prev: Site Details,  Up: Site Configuration
  2798. Transforming Program Names When Installing
  2799. ==========================================
  2800.    Autoconf supports changing the names of programs when installing
  2801. them.  In order to use these transformations, `configure.in' must call
  2802. the macro `AC_ARG_PROGRAM'.
  2803.  - Macro: AC_ARG_PROGRAM
  2804.      Place in output variable `program_transform_name' a sequence of
  2805.      `sed' commands for changing the names of installed programs.
  2806.      If any of the options described below are given to `configure',
  2807.      program names are transformed accordingly.  Otherwise, if
  2808.      `AC_CANONICAL_SYSTEM' has been called and a `--target' value is
  2809.      given that differs from the host type (specified with `--host' or
  2810.      defaulted by `config.sub'), the target type followed by a dash is
  2811.      used as a prefix.  Otherwise, no program name transformation is
  2812.      done.
  2813. * Menu:
  2814. * Transformation Options::      `configure' options to transform names.
  2815. * Transformation Examples::     Sample uses of transforming names.
  2816. * Transformation Rules::        `Makefile' uses of transforming names.
  2817. File: autoconf.info,  Node: Transformation Options,  Next: Transformation Examples,  Up: Transforming Names
  2818. Transformation Options
  2819. ----------------------
  2820.    You can specify name transformations by giving `configure' these
  2821. command line options:
  2822. `--program-prefix=PREFIX'
  2823.      prepend PREFIX to the names;
  2824. `--program-suffix=SUFFIX'
  2825.      append SUFFIX to the names;
  2826. `--program-transform-name=EXPRESSION'
  2827.      perform `sed' substitution EXPRESSION on the names.
  2828. File: autoconf.info,  Node: Transformation Examples,  Next: Transformation Rules,  Prev: Transformation Options,  Up: Transforming Names
  2829. Transformation Examples
  2830. -----------------------
  2831.    These transformations are useful with programs that can be part of a
  2832. cross-compilation development environment.  For example, a
  2833. cross-assembler running on a Sun 4 configured with
  2834. `--target=i960-vxworks' is normally installed as `i960-vxworks-as',
  2835. rather than `as', which could be confused with a native Sun 4 assembler.
  2836.    You can force a program name to begin with `g', if you don't want
  2837. GNU programs installed on your system to shadow other programs with the
  2838. same name.  For example, if you configure GNU `diff' with
  2839. `--program-prefix=g', then when you run `make install' it is installed
  2840. as `/usr/local/bin/gdiff'.
  2841.    As a more sophisticated example, you could use
  2842.      --program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/'
  2843. to prepend `g' to most of the program names in a source tree, excepting
  2844. those like `gdb' that already have one and those like `less' and
  2845. `lesskey' that aren't GNU programs.  (That is assuming that you have a
  2846. source tree containing those programs that is set up to use this
  2847. feature.)
  2848.    One way to install multiple versions of some programs simultaneously
  2849. is to append a version number to the name of one or both.  For example,
  2850. if you want to keep Autoconf version 1 around for awhile, you can
  2851. configure Autoconf version 2 using `--program-suffix=2' to install the
  2852. programs as `/usr/local/bin/autoconf2', `/usr/local/bin/autoheader2',
  2853. File: autoconf.info,  Node: Transformation Rules,  Prev: Transformation Examples,  Up: Transforming Names
  2854. Transformation Rules
  2855. --------------------
  2856.    Here is how to use the variable `program_transform_name' in a
  2857. `Makefile.in':
  2858.      transform=@program_transform_name@
  2859.      install: all
  2860.              $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'`
  2861.      
  2862.      uninstall:
  2863.              rm -f $(bindir)/`echo myprog|sed '$(transform)'`
  2864. If you have more than one program to install, you can do it in a loop:
  2865.      PROGRAMS=cp ls rm
  2866.      install:
  2867.              for p in $(PROGRAMS); do \
  2868.                $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
  2869.              done
  2870.      
  2871.      uninstall:
  2872.              for p in $(PROGRAMS); do \
  2873.                rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
  2874.              done
  2875.    Whether to do the transformations on documentation files (Texinfo or
  2876. `man') is a tricky question; there seems to be no perfect answer, due
  2877. to the several reasons for name transforming.  Documentation is not
  2878. usually particular to a specific architecture, and Texinfo files do not
  2879. conflict with system documentation.  But they might conflict with
  2880. earlier versions of the same files, and `man' pages sometimes do
  2881. conflict with system documentation.  As a compromise, it is probably
  2882. best to do name transformations on `man' pages but not on Texinfo
  2883. manuals.
  2884. File: autoconf.info,  Node: Site Defaults,  Prev: Transforming Names,  Up: Site Configuration
  2885. Setting Site Defaults
  2886. =====================
  2887.    Autoconf-generated `configure' scripts allow your site to provide
  2888. default values for some configuration values.  You do this by creating
  2889. site- and system-wide initialization files.
  2890.    If the environment variable `CONFIG_SITE' is set, `configure' uses
  2891. its value as the name of a shell script to read.  Otherwise, it reads
  2892. the shell script `PREFIX/share/config.site' if it exists, then
  2893. `PREFIX/etc/config.site' if it exists.  Thus, settings in
  2894. machine-specific files override those in machine-independent ones in
  2895. case of conflict.
  2896.    Site files can be arbitrary shell scripts, but only certain kinds of
  2897. code are really appropriate to be in them.  Because `configure' reads
  2898. any cache file after it has read any site files, a site file can define
  2899. a default cache file to be shared between all Autoconf-generated
  2900. `configure' scripts run on that system.  If you set a default cache
  2901. file in a site file, it is a good idea to also set the output variable
  2902. `CC' in that site file, because the cache file is only valid for a
  2903. particular compiler, but many systems have several available.
  2904.    You can examine or override the value set by a command line option to
  2905. `configure' in a site file; options set shell variables that have the
  2906. same names as the options, with any dashes turned into underscores.
  2907. The exceptions are that `--without-' and `--disable-' options are like
  2908. giving the corresponding `--with-' or `--enable-' option and the value
  2909. `no'.  Thus, `--cache-file=localcache' sets the variable `cache_file'
  2910. to the value `localcache'; `--enable-warnings=no' or
  2911. `--disable-warnings' sets the variable `enable_warnings' to the value
  2912. `no'; `--prefix=/usr' sets the variable `prefix' to the value `/usr';
  2913.    Site files are also good places to set default values for other
  2914. output variables, such as `CFLAGS', if you need to give them non-default
  2915. values: anything you would normally do, repetitively, on the command
  2916. line.  If you use non-default values for PREFIX or EXEC_PREFIX
  2917. (wherever you locate the site file), you can set them in the site file
  2918. if you specify it with the `CONFIG_SITE' environment variable.
  2919.    You can set some cache values in the site file itself.  Doing this is
  2920. useful if you are cross-compiling, so it is impossible to check features
  2921. that require running a test program.  You could "prime the cache" by
  2922. setting those values correctly for that system in
  2923. `PREFIX/etc/config.site'.  To find out the names of the cache variables
  2924. you need to set, look for shell variables with `_cv_' in their names in
  2925. the affected `configure' scripts, or in the Autoconf `m4' source code
  2926. for those macros.
  2927.    The cache file is careful to not override any variables set in the
  2928. site files.  Similarly, you should not override command-line options in
  2929. the site files.  Your code should check that variables such as `prefix'
  2930. and `cache_file' have their default values (as set near the top of
  2931. `configure') before changing them.
  2932.    Here is a sample file `/usr/share/local/gnu/share/config.site'.  The
  2933. command `configure --prefix=/usr/share/local/gnu' would read this file
  2934. (if `CONFIG_SITE' is not set to a different file).
  2935.      # config.site for configure
  2936.      #
  2937.      # Default --prefix and --exec-prefix.
  2938.      test "$prefix" = NONE && prefix=/usr/share/local/gnu
  2939.      test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu
  2940.      #
  2941.      # Give Autoconf 2.x generated configure scripts a shared default
  2942.      # cache file for feature test results, architecture-specific.
  2943.      if test "$cache_file" = ./config.cache; then
  2944.        cache_file="$prefix/var/config.cache"
  2945.        # A cache file is only valid for one C compiler.
  2946.        CC=gcc
  2947.      fi
  2948. File: autoconf.info,  Node: Invoking configure,  Next: Invoking config.status,  Prev: Site Configuration,  Up: Top
  2949. Running `configure' Scripts
  2950. ***************************
  2951.    Below are instructions on how to configure a package that uses a
  2952. `configure' script, suitable for inclusion as an `INSTALL' file in the
  2953. package.  A plain-text version of `INSTALL' which you may use comes
  2954. with Autoconf.
  2955. * Menu:
  2956. * Basic Installation::          Instructions for typical cases.
  2957. * Compilers and Options::       Selecting compilers and optimization.
  2958. * Multiple Architectures::      Compiling for multiple architectures at once.
  2959. * Installation Names::          Installing in different directories.
  2960. * Optional Features::           Selecting optional features.
  2961. * System Type::                 Specifying the system type.
  2962. * Sharing Defaults::            Setting site-wide defaults for `configure'.
  2963. * Operation Controls::          Changing how `configure' runs.
  2964. File: autoconf.info,  Node: Basic Installation,  Next: Compilers and Options,  Up: Invoking configure
  2965. Basic Installation
  2966. ==================
  2967.    These are generic installation instructions.
  2968.    The `configure' shell script attempts to guess correct values for
  2969. various system-dependent variables used during compilation.  It uses
  2970. those values to create a `Makefile' in each directory of the package.
  2971. It may also create one or more `.h' files containing system-dependent
  2972. definitions.  Finally, it creates a shell script `config.status' that
  2973. you can run in the future to recreate the current configuration, a file
  2974. `config.cache' that saves the results of its tests to speed up
  2975. reconfiguring, and a file `config.log' containing compiler output
  2976. (useful mainly for debugging `configure').
  2977.    If you need to do unusual things to compile the package, please try
  2978. to figure out how `configure' could check whether to do them, and mail
  2979. diffs or instructions to the address given in the `README' so they can
  2980. be considered for the next release.  If at some point `config.cache'
  2981. contains results you don't want to keep, you may remove or edit it.
  2982.    The file `configure.in' is used to create `configure' by a program
  2983. called `autoconf'.  You only need `configure.in' if you want to change
  2984. it or regenerate `configure' using a newer version of `autoconf'.
  2985. The simplest way to compile this package is:
  2986.   1. `cd' to the directory containing the package's source code and type
  2987.      `./configure' to configure the package for your system.  If you're
  2988.      using `csh' on an old version of System V, you might need to type
  2989.      `sh ./configure' instead to prevent `csh' from trying to execute
  2990.      `configure' itself.
  2991.      Running `configure' takes awhile.  While running, it prints some
  2992.      messages telling which features it is checking for.
  2993.   2. Type `make' to compile the package.
  2994.   3. Optionally, type `make check' to run any self-tests that come with
  2995.      the package.
  2996.   4. Type `make install' to install the programs and any data files and
  2997.      documentation.
  2998.   5. You can remove the program binaries and object files from the
  2999.      source code directory by typing `make clean'.  To also remove the
  3000.      files that `configure' created (so you can compile the package for
  3001.      a different kind of computer), type `make distclean'.  There is
  3002.      also a `make maintainer-clean' target, but that is intended mainly
  3003.      for the package's developers.  If you use it, you may have to get
  3004.      all sorts of other programs in order to regenerate files that came
  3005.      with the distribution.
  3006. File: autoconf.info,  Node: Compilers and Options,  Next: Multiple Architectures,  Prev: Basic Installation,  Up: Invoking configure
  3007. Compilers and Options
  3008. =====================
  3009.    Some systems require unusual options for compilation or linking that
  3010. the `configure' script does not know about.  You can give `configure'
  3011. initial values for variables by setting them in the environment.  Using
  3012. a Bourne-compatible shell, you can do that on the command line like
  3013. this:
  3014.      CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
  3015. Or on systems that have the `env' program, you can do it like this:
  3016.      env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
  3017. File: autoconf.info,  Node: Multiple Architectures,  Next: Installation Names,  Prev: Compilers and Options,  Up: Invoking configure
  3018. Compiling For Multiple Architectures
  3019. ====================================
  3020.    You can compile the package for more than one kind of computer at the
  3021. same time, by placing the object files for each architecture in their
  3022. own directory.  To do this, you must use a version of `make' that
  3023. supports the `VPATH' variable, such as GNU `make'.  `cd' to the
  3024. directory where you want the object files and executables to go and run
  3025. the `configure' script.  `configure' automatically checks for the
  3026. source code in the directory that `configure' is in and in `..'.
  3027.    If you have to use a `make' that does not supports the `VPATH'
  3028. variable, you have to compile the package for one architecture at a time
  3029. in the source code directory.  After you have installed the package for
  3030. one architecture, use `make distclean' before reconfiguring for another
  3031. architecture.
  3032. File: autoconf.info,  Node: Installation Names,  Next: Optional Features,  Prev: Multiple Architectures,  Up: Invoking configure
  3033. Installation Names
  3034. ==================
  3035.    By default, `make install' will install the package's files in
  3036. `/usr/local/bin', `/usr/local/man', etc.  You can specify an
  3037. installation prefix other than `/usr/local' by giving `configure' the
  3038. option `--prefix=PATH'.
  3039.    You can specify separate installation prefixes for
  3040. architecture-specific files and architecture-independent files.  If you
  3041. give `configure' the option `--exec-prefix=PATH', the package will use
  3042. PATH as the prefix for installing programs and libraries.
  3043. Documentation and other data files will still use the regular prefix.
  3044.    In addition, if you use an unusual directory layout you can give
  3045. options like `--bindir=PATH' to specify different values for particular
  3046. kinds of files.  Run `configure --help' for a list of the directories
  3047. you can set and what kinds of files go in them.
  3048.    If the package supports it, you can cause programs to be installed
  3049. with an extra prefix or suffix on their names by giving `configure' the
  3050. option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
  3051. File: autoconf.info,  Node: Optional Features,  Next: System Type,  Prev: Installation Names,  Up: Invoking configure
  3052. Optional Features
  3053. =================
  3054.    Some packages pay attention to `--enable-FEATURE' options to
  3055. `configure', where FEATURE indicates an optional part of the package.
  3056. They may also pay attention to `--with-PACKAGE' options, where PACKAGE
  3057. is something like `gnu-as' or `x' (for the X Window System).  The
  3058. `README' should mention any `--enable-' and `--with-' options that the
  3059. package recognizes.
  3060.    For packages that use the X Window System, `configure' can usually
  3061. find the X include and library files automatically, but if it doesn't,
  3062. you can use the `configure' options `--x-includes=DIR' and
  3063. `--x-libraries=DIR' to specify their locations.
  3064. File: autoconf.info,  Node: System Type,  Next: Sharing Defaults,  Prev: Optional Features,  Up: Invoking configure
  3065. Specifying the System Type
  3066. ==========================
  3067.    There may be some features `configure' can not figure out
  3068. automatically, but needs to determine by the type of host the package
  3069. will run on.  Usually `configure' can figure that out, but if it prints
  3070. a message saying it can not guess the host type, give it the
  3071. `--host=TYPE' option.  TYPE can either be a short name for the system
  3072. type, such as `sun4', or a canonical name with three fields:
  3073.      CPU-COMPANY-SYSTEM
  3074. See the file `config.sub' for the possible values of each field.  If
  3075. `config.sub' isn't included in this package, then this package doesn't
  3076. need to know the host type.
  3077.    If you are building compiler tools for cross-compiling, you can also
  3078. use the `--target=TYPE' option to select the type of system they will
  3079. produce code for and the `--build=TYPE' option to select the type of
  3080. system on which you are compiling the package.
  3081. File: autoconf.info,  Node: Sharing Defaults,  Next: Operation Controls,  Prev: System Type,  Up: Invoking configure
  3082. Sharing Defaults
  3083. ================
  3084.    If you want to set default values for `configure' scripts to share,
  3085. you can create a site shell script called `config.site' that gives
  3086. default values for variables like `CC', `cache_file', and `prefix'.
  3087. `configure' looks for `PREFIX/share/config.site' if it exists, then
  3088. `PREFIX/etc/config.site' if it exists.  Or, you can set the
  3089. `CONFIG_SITE' environment variable to the location of the site script.
  3090. A warning: not all `configure' scripts look for a site script.
  3091. File: autoconf.info,  Node: Operation Controls,  Prev: Sharing Defaults,  Up: Invoking configure
  3092. Operation Controls
  3093. ==================
  3094.    `configure' recognizes the following options to control how it
  3095. operates.
  3096. `--cache-file=FILE'
  3097.      Use and save the results of the tests in FILE instead of
  3098.      `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
  3099.      debugging `configure'.
  3100. `--help'
  3101.      Print a summary of the options to `configure', and exit.
  3102. `--quiet'
  3103. `--silent'
  3104.      Do not print messages saying which checks are being made.
  3105. `--srcdir=DIR'
  3106.      Look for the package's source code in directory DIR.  Usually
  3107.      `configure' can determine that directory automatically.
  3108. `--version'
  3109.      Print the version of Autoconf used to generate the `configure'
  3110.      script, and exit.
  3111. `configure' also accepts some other, not widely useful, options.
  3112. File: autoconf.info,  Node: Invoking config.status,  Next: Questions,  Prev: Invoking configure,  Up: Top
  3113. Recreating a Configuration
  3114. **************************
  3115.    The `configure' script creates a file named `config.status' which
  3116. describes which configuration options were specified when the package
  3117. was last configured.  This file is a shell script which, if run, will
  3118. recreate the same configuration.
  3119.    You can give `config.status' the `--recheck' option to update
  3120. itself.  This option is useful if you change `configure', so that the
  3121. results of some tests might be different from the previous run.  The
  3122. `--recheck' option re-runs `configure' with the same arguments you used
  3123. before, plus the `--no-create' option, which prevent `configure' from
  3124. running `config.status' and creating `Makefile' and other files, and
  3125. the `--no-recursion' option, which prevents `configure' from running
  3126. other `configure' scripts in subdirectories.  (This is so other
  3127. `Makefile' rules can run `config.status' when it changes; *note
  3128. Automatic Remaking::., for an example).
  3129.    `config.status' also accepts the options `--help', which prints a
  3130. summary of the options to `config.status', and `--version', which
  3131. prints the version of Autoconf used to create the `configure' script
  3132. that generated `config.status'.
  3133.    `config.status' checks several optional environment variables that
  3134. can alter its behavior:
  3135.  - Variable: CONFIG_SHELL
  3136.      The shell with which to run `configure' for the `--recheck'
  3137.      option.  It must be Bourne-compatible.  The default is `/bin/sh'.
  3138.  - Variable: CONFIG_STATUS
  3139.      The file name to use for the shell script that records the
  3140.      configuration.  The default is `./config.status'.  This variable is
  3141.      useful when one package uses parts of another and the `configure'
  3142.      scripts shouldn't be merged because they are maintained separately.
  3143.    The following variables provide one way for separately distributed
  3144. packages to share the values computed by `configure'.  Doing so can be
  3145. useful if some of the packages need a superset of the features that one
  3146. of them, perhaps a common library, does.  These variables allow a
  3147. `config.status' file to create files other than the ones that its
  3148. `configure.in' specifies, so it can be used for a different package.
  3149.  - Variable: CONFIG_FILES
  3150.      The files in which to perform `@VARIABLE@' substitutions.  The
  3151.      default is the arguments given to `AC_OUTPUT' in `configure.in'.
  3152.  - Variable: CONFIG_HEADERS
  3153.      The files in which to substitute C `#define' statements.  The
  3154.      default is the arguments given to `AC_CONFIG_HEADER'; if that
  3155.      macro was not called, `config.status' ignores this variable.
  3156.    These variables also allow you to write `Makefile' rules that
  3157. regenerate only some of the files.  For example, in the dependencies
  3158. given above (*note Automatic Remaking::.), `config.status' is run twice
  3159. when `configure.in' has changed.  If that bothers you, you can make
  3160. each run only regenerate the files for that rule:
  3161.      config.h: stamp-h
  3162.      stamp-h: config.h.in config.status
  3163.              CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
  3164.              echo > stamp-h
  3165.      
  3166.      Makefile: Makefile.in config.status
  3167.              CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
  3168. (If `configure.in' does not call `AC_CONFIG_HEADER', there is no need
  3169. to set `CONFIG_HEADERS' in the `make' rules.)
  3170. File: autoconf.info,  Node: Questions,  Next: Upgrading,  Prev: Invoking config.status,  Up: Top
  3171. Questions About Autoconf
  3172. ************************
  3173.    Several questions about Autoconf come up occasionally.  Here some of
  3174. them are addressed.
  3175. * Menu:
  3176. * Distributing::                Distributing `configure' scripts.
  3177. * Why GNU m4::                  Why not use the standard `m4'?
  3178. * Bootstrapping::               Autoconf and GNU `m4' require each other?
  3179. * Why Not Imake::               Why GNU uses `configure' instead of Imake.
  3180. File: autoconf.info,  Node: Distributing,  Next: Why GNU m4,  Up: Questions
  3181. Distributing `configure' Scripts
  3182. ================================
  3183.      What are the restrictions on distributing `configure'
  3184.      scripts that Autoconf generates?  How does that affect my
  3185.      programs that use them?
  3186.    There are no restrictions on how the configuration scripts that
  3187. Autoconf produces may be distributed or used.  In Autoconf version 1,
  3188. they were covered by the GNU General Public License.  We still
  3189. encourage software authors to distribute their work under terms like
  3190. those of the GPL, but doing so is not required to use Autoconf.
  3191.    Of the other files that might be used with `configure',
  3192. `config.h.in' is under whatever copyright you use for your
  3193. `configure.in', since it is derived from that file and from the public
  3194. domain file `acconfig.h'.  `config.sub' and `config.guess' have an
  3195. exception to the GPL when they are used with an Autoconf-generated
  3196. `configure' script, which permits you to distribute them under the same
  3197. terms as the rest of your package.  `install-sh' is from the X
  3198. Consortium and is not copyrighted.
  3199. File: autoconf.info,  Node: Why GNU m4,  Next: Bootstrapping,  Prev: Distributing,  Up: Questions
  3200. Why Require GNU `m4'?
  3201. =====================
  3202.      Why does Autoconf require GNU `m4'?
  3203.    Many `m4' implementations have hard-coded limitations on the size
  3204. and number of macros, which Autoconf exceeds.  They also lack several
  3205. builtin macros that it would be difficult to get along without in a
  3206. sophisticated application like Autoconf, including:
  3207.      builtin
  3208.      indir
  3209.      patsubst
  3210.      __file__
  3211.      __line__
  3212.    Since only software maintainers need to use Autoconf, and since GNU
  3213. `m4' is simple to configure and install, it seems reasonable to require
  3214. GNU `m4' to be installed also.  Many maintainers of GNU and other free
  3215. software already have most of the GNU utilities installed, since they
  3216. prefer them.
  3217. File: autoconf.info,  Node: Bootstrapping,  Next: Why Not Imake,  Prev: Why GNU m4,  Up: Questions
  3218. How Can I Bootstrap?
  3219. ====================
  3220.      If Autoconf requires GNU `m4' and GNU `m4' has an
  3221.      Autoconf `configure' script, how do I bootstrap?  It seems
  3222.      like a chicken and egg problem!
  3223.    This is a misunderstanding.  Although GNU `m4' does come with a
  3224. `configure' script produced by Autoconf, Autoconf is not required in
  3225. order to run the script and install GNU `m4'.  Autoconf is only
  3226. required if you want to change the `m4' `configure' script, which few
  3227. people have to do (mainly its maintainer).
  3228. File: autoconf.info,  Node: Why Not Imake,  Prev: Bootstrapping,  Up: Questions
  3229. Why Not Imake?
  3230. ==============
  3231.      Why not use Imake instead of `configure' scripts?
  3232.    Several people have written addressing this question, so I include
  3233. adaptations of their explanations here.
  3234.    The following answer is based on one written by Richard Pixley:
  3235.    Autoconf generated scripts frequently work on machines which it has
  3236. never been set up to handle before.  That is, it does a good job of
  3237. inferring a configuration for a new system.  Imake cannot do this.
  3238.    Imake uses a common database of host specific data.  For X11, this
  3239. makes sense because the distribution is made as a collection of tools,
  3240. by one central authority who has control over the database.
  3241.    GNU tools are not released this way.  Each GNU tool has a maintainer;
  3242. these maintainers are scattered across the world.  Using a common
  3243. database would be a maintenance nightmare.  Autoconf may appear to be
  3244. this kind of database, but in fact it is not.  Instead of listing host
  3245. dependencies, it lists program requirements.
  3246.    If you view the GNU suite as a collection of native tools, then the
  3247. problems are similar.  But the GNU development tools can be configured
  3248. as cross tools in almost any host+target permutation.  All of these
  3249. configurations can be installed concurrently.  They can even be
  3250. configured to share host independent files across hosts.  Imake doesn't
  3251. address these issues.
  3252.    Imake templates are a form of standardization.  The GNU coding
  3253. standards address the same issues without necessarily imposing the same
  3254. restrictions.
  3255.    Here is some further explanation, written by Per Bothner:
  3256.    One of the advantages of Imake is that it easy to generate large
  3257. Makefiles using `cpp''s `#include' and macro mechanisms.  However,
  3258. `cpp' is not programmable: it has limited conditional facilities, and
  3259. no looping.  And `cpp' cannot inspect its environment.
  3260.    All of these problems are solved by using `sh' instead of `cpp'.
  3261. The shell is fully programmable, has macro substitution, can execute
  3262. (or source) other shell scripts, and can inspect its environment.
  3263.    Paul Eggert elaborates more:
  3264.    With Autoconf, installers need not assume that Imake itself is
  3265. already installed and working well.  This may not seem like much of an
  3266. advantage to people who are accustomed to Imake.  But on many hosts
  3267. Imake is not installed or the default installation is not working well,
  3268. and requiring Imake to install a package hinders the acceptance of that
  3269. package on those hosts.  For example, the Imake template and
  3270. configuration files might not be installed properly on a host, or the
  3271. Imake build procedure might wrongly assume that all source files are in
  3272. one big directory tree, or the Imake configuration might assume one
  3273. compiler whereas the package or the installer needs to use another, or
  3274. there might be a version mismatch between the Imake expected by the
  3275. package and the Imake supported by the host.  These problems are much
  3276. rarer with Autoconf, where each package comes with its own independent
  3277. configuration processor.
  3278.    Also, Imake often suffers from unexpected interactions between
  3279. `make' and the installer's C preprocessor.  The fundamental problem
  3280. here is that the C preprocessor was designed to preprocess C programs,
  3281. not `Makefile's.  This is much less of a problem with Autoconf, which
  3282. uses the general-purpose preprocessor `m4', and where the package's
  3283. author (rather than the installer) does the preprocessing in a standard
  3284.    Finally, Mark Eichin notes:
  3285.    Imake isn't all that extensible, either.  In order to add new
  3286. features to Imake, you need to provide your own project template, and
  3287. duplicate most of the features of the existing one.  This means that
  3288. for a sophisticated project, using the vendor-provided Imake templates
  3289. fails to provide any leverage--since they don't cover anything that
  3290. your own project needs (unless it is an X11 program).
  3291.    On the other side, though:
  3292.    The one advantage that Imake has over `configure': `Imakefile's tend
  3293. to be much shorter (likewise, less redundant) than `Makefile.in's.
  3294. There is a fix to this, however--at least for the Kerberos V5 tree,
  3295. we've modified things to call in common `post.in' and `pre.in'
  3296. `Makefile' fragments for the entire tree.  This means that a lot of
  3297. common things don't have to be duplicated, even though they normally
  3298. are in `configure' setups.
  3299. File: autoconf.info,  Node: Upgrading,  Next: History,  Prev: Questions,  Up: Top
  3300. Upgrading From Version 1
  3301. ************************
  3302.    Autoconf version 2 is mostly backward compatible with version 1.
  3303. However, it introduces better ways to do some things, and doesn't
  3304. support some of the ugly things in version 1.  So, depending on how
  3305. sophisticated your `configure.in' files are, you might have to do some
  3306. manual work in order to upgrade to version 2.  This chapter points out
  3307. some problems to watch for when upgrading.  Also, perhaps your
  3308. `configure' scripts could benefit from some of the new features in
  3309. version 2; the changes are summarized in the file `NEWS' in the
  3310. Autoconf distribution.
  3311.    First, make sure you have GNU `m4' version 1.1 or higher installed,
  3312. preferably 1.3 or higher.  Versions before 1.1 have bugs that prevent
  3313. them from working with Autoconf version 2.  Versions 1.3 and later are
  3314. much faster than earlier versions, because as of version 1.3, GNU `m4'
  3315. has a more efficient implementation of diversions and can freeze its
  3316. internal state in a file that it can read back quickly.
  3317. * Menu:
  3318. * Changed File Names::          Files you might rename.
  3319. * Changed Makefiles::           New things to put in `Makefile.in'.
  3320. * Changed Macros::              Macro calls you might replace.
  3321. * Invoking autoupdate::         Replacing old macro names in `configure.in'.
  3322. * Changed Results::             Changes in how to check test results.
  3323. * Changed Macro Writing::       Better ways to write your own macros.
  3324. File: autoconf.info,  Node: Changed File Names,  Next: Changed Makefiles,  Up: Upgrading
  3325. Changed File Names
  3326. ==================
  3327.    If you have an `aclocal.m4' installed with Autoconf (as opposed to
  3328. in a particular package's source directory), you must rename it to
  3329. `acsite.m4'.  *Note Invoking autoconf::.
  3330.    If you distribute `install.sh' with your package, rename it to
  3331. `install-sh' so `make' builtin rules won't inadvertently create a file
  3332. called `install' from it.  `AC_PROG_INSTALL' looks for the script under
  3333. both names, but it is best to use the new name.
  3334.    If you were using `config.h.top' or `config.h.bot', you still can,
  3335. but you will have less clutter if you merge them into `acconfig.h'.
  3336. *Note Invoking autoheader::.
  3337. File: autoconf.info,  Node: Changed Makefiles,  Next: Changed Macros,  Prev: Changed File Names,  Up: Upgrading
  3338. Changed Makefiles
  3339. =================
  3340.    Add `@CFLAGS@', `@CPPFLAGS@', and `@LDFLAGS@' in your `Makefile.in'
  3341. files, so they can take advantage of the values of those variables in
  3342. the environment when `configure' is run.  Doing this isn't necessary,
  3343. but it's a convenience for users.
  3344.    Also add `@configure_input@' in a comment to each non-`Makefile'
  3345. input file for `AC_OUTPUT', so that the output files will contain a
  3346. comment saying they were produced by `configure'.  Automatically
  3347. selecting the right comment syntax for all the kinds of files that
  3348. people call `AC_OUTPUT' on became too much work.
  3349.    Add `config.log' and `config.cache' to the list of files you remove
  3350. in `distclean' targets.
  3351.    If you have the following in `Makefile.in':
  3352.      prefix = /usr/local
  3353.      exec_prefix = ${prefix}
  3354. you must change it to:
  3355.      prefix = @prefix@
  3356.      exec_prefix = @exec_prefix@
  3357. The old behavior of replacing those variables without `@' characters
  3358. around them has been removed.
  3359. File: autoconf.info,  Node: Changed Macros,  Next: Invoking autoupdate,  Prev: Changed Makefiles,  Up: Upgrading
  3360. Changed Macros
  3361. ==============
  3362.    Many of the macros were renamed in Autoconf version 2.  You can still
  3363. use the old names, but the new ones are clearer, and it's easier to find
  3364. the documentation for them.  *Note Old Macro Names::, for a table
  3365. showing the new names for the old macros.  Use the `autoupdate' program
  3366. to convert your `configure.in' to using the new macro names.  *Note
  3367. Invoking autoupdate::.
  3368.    Some macros have been superseded by similar ones that do the job
  3369. better, but are not call-compatible.  If you get warnings about calling
  3370. obsolete macros while running `autoconf', you may safely ignore them,
  3371. but your `configure' script will generally work better if you follow
  3372. the advice it prints about what to replace the obsolete macros with.  In
  3373. particular, the mechanism for reporting the results of tests has
  3374. changed.  If you were using `echo' or `AC_VERBOSE' (perhaps via
  3375. `AC_COMPILE_CHECK'), your `configure' script's output will look better
  3376. if you switch to `AC_MSG_CHECKING' and `AC_MSG_RESULT'.  *Note Printing
  3377. Messages::.  Those macros work best in conjunction with cache
  3378. variables.  *Note Caching Results::.
  3379. File: autoconf.info,  Node: Invoking autoupdate,  Next: Changed Results,  Prev: Changed Macros,  Up: Upgrading
  3380. Using `autoupdate' to Modernize `configure'
  3381. ===========================================
  3382.    The `autoupdate' program updates a `configure.in' file that calls
  3383. Autoconf macros by their old names to use the current macro names.  In
  3384. version 2 of Autoconf, most of the macros were renamed to use a more
  3385. uniform and descriptive naming scheme.  *Note Macro Names::, for a
  3386. description of the new scheme.  Although the old names still work
  3387. (*note Old Macro Names::., for a list of the old macro names and the
  3388. corresponding new names), you can make your `configure.in' files more
  3389. readable and make it easier to use the current Autoconf documentation
  3390. if you update them to use the new macro names.
  3391.    If given no arguments, `autoupdate' updates `configure.in', backing
  3392. up the original version with the suffix `~' (or the value of the
  3393. environment variable `SIMPLE_BACKUP_SUFFIX', if that is set).  If you
  3394. give `autoupdate' an argument, it reads that file instead of
  3395. `configure.in' and writes the updated file to the standard output.
  3396. `autoupdate' accepts the following options:
  3397. `--help'
  3398.      Print a summary of the command line options and exit.
  3399. `--macrodir=DIR'
  3400. `-m DIR'
  3401.      Look for the Autoconf macro files in directory DIR instead of the
  3402.      default installation directory.  You can also set the `AC_MACRODIR'
  3403.      environment variable to a directory; this option overrides the
  3404.      environment variable.
  3405. `--version'
  3406.      Print the version number of `autoupdate' and exit.
  3407. File: autoconf.info,  Node: Changed Results,  Next: Changed Macro Writing,  Prev: Invoking autoupdate,  Up: Upgrading
  3408. Changed Results
  3409. ===============
  3410.    If you were checking the results of previous tests by examining the
  3411. shell variable `DEFS', you need to switch to checking the values of the
  3412. cache variables for those tests.  `DEFS' no longer exists while
  3413. `configure' is running; it is only created when generating output
  3414. files.  This difference from version 1 is because properly quoting the
  3415. contents of that variable turned out to be too cumbersome and
  3416. inefficient to do every time `AC_DEFINE' is called.  *Note Cache
  3417. Variable Names::.
  3418.    For example, here is a `configure.in' fragment written for Autoconf
  3419. version 1:
  3420.      AC_HAVE_FUNCS(syslog)
  3421.      case "$DEFS" in
  3422.      *-DHAVE_SYSLOG*) ;;
  3423.      *) # syslog is not in the default libraries.  See if it's in some other.
  3424.        saved_LIBS="$LIBS"
  3425.        for lib in bsd socket inet; do
  3426.          AC_CHECKING(for syslog in -l$lib)
  3427.          LIBS="$saved_LIBS -l$lib"
  3428.          AC_HAVE_FUNCS(syslog)
  3429.          case "$DEFS" in
  3430.          *-DHAVE_SYSLOG*) break ;;
  3431.          *) ;;
  3432.          esac
  3433.          LIBS="$saved_LIBS"
  3434.        done ;;
  3435.      esac
  3436.    Here is a way to write it for version 2:
  3437.      AC_CHECK_FUNCS(syslog)
  3438.      if test $ac_cv_func_syslog = no; then
  3439.        # syslog is not in the default libraries.  See if it's in some other.
  3440.        for lib in bsd socket inet; do
  3441.          AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG)
  3442.            LIBS="$LIBS $lib"; break])
  3443.        done
  3444.      fi
  3445.    If you were working around bugs in `AC_DEFINE_UNQUOTED' by adding
  3446. backslashes before quotes, you need to remove them.  It now works
  3447. predictably, and does not treat quotes (except backquotes) specially.
  3448. *Note Setting Output Variables::.
  3449.    All of the boolean shell variables set by Autoconf macros now use
  3450. `yes' for the true value.  Most of them use `no' for false, though for
  3451. backward compatibility some use the empty string instead.  If you were
  3452. relying on a shell variable being set to something like 1 or `t' for
  3453. true, you need to change your tests.
  3454. File: autoconf.info,  Node: Changed Macro Writing,  Prev: Changed Results,  Up: Upgrading
  3455. Changed Macro Writing
  3456. =====================
  3457.    When defining your own macros, you should now use `AC_DEFUN' instead
  3458. of `define'.  `AC_DEFUN' automatically calls `AC_PROVIDE' and ensures
  3459. that macros called via `AC_REQUIRE' do not interrupt other macros, to
  3460. prevent nested `checking...' messages on the screen.  There's no actual
  3461. harm in continuing to use the older way, but it's less convenient and
  3462. attractive.  *Note Macro Definitions::.
  3463.    You probably looked at the macros that came with Autoconf as a guide
  3464. for how to do things.  It would be a good idea to take a look at the new
  3465. versions of them, as the style is somewhat improved and they take
  3466. advantage of some new features.
  3467.    If you were doing tricky things with undocumented Autoconf internals
  3468. (macros, variables, diversions), check whether you need to change
  3469. anything to account for changes that have been made.  Perhaps you can
  3470. even use an officially supported technique in version 2 instead of
  3471. kludging.  Or perhaps not.
  3472.    To speed up your locally written feature tests, add caching to them.
  3473. See whether any of your tests are of general enough usefulness to
  3474. encapsulate into macros that you can share.
  3475. File: autoconf.info,  Node: History,  Next: Old Macro Names,  Prev: Upgrading,  Up: Top
  3476. History of Autoconf
  3477. *******************
  3478.    You may be wondering, Why was Autoconf originally written?  How did
  3479. it get into its present form?  (Why does it look like gorilla spit?)  If
  3480. you're not wondering, then this chapter contains no information useful
  3481. to you, and you might as well skip it.  If you *are* wondering, then
  3482. let there be light...
  3483. * Menu:
  3484. * Genesis::            Prehistory and naming of `configure'.
  3485. * Exodus::            The plagues of `m4' and Perl.
  3486. * Leviticus::            The priestly code of portability arrives.
  3487. * Numbers::            Growth and contributors.
  3488. * Deuteronomy::            Approaching the promises of easy configuration.
  3489. File: autoconf.info,  Node: Genesis,  Next: Exodus,  Up: History
  3490. Genesis
  3491. =======
  3492.    In June 1991 I was maintaining many of the GNU utilities for the Free
  3493. Software Foundation.  As they were ported to more platforms and more
  3494. programs were added, the number of `-D' options that users had to
  3495. select in the `Makefile' (around 20) became burdensome.  Especially for
  3496. me--I had to test each new release on a bunch of different systems.  So
  3497. I wrote a little shell script to guess some of the correct settings for
  3498. the fileutils package, and released it as part of fileutils 2.0.  That
  3499. `configure' script worked well enough that the next month I adapted it
  3500. (by hand) to create similar `configure' scripts for several other GNU
  3501. utilities packages.  Brian Berliner also adapted one of my scripts for
  3502. his CVS revision control system.
  3503.    Later that summer, I learned that Richard Stallman and Richard Pixley
  3504. were developing similar scripts to use in the GNU compiler tools; so I
  3505. adapted my `configure' scripts to support their evolving interface:
  3506. using the file name `Makefile.in' as the templates; adding `+srcdir',
  3507. the first option (of many); and creating `config.status' files.
  3508. File: autoconf.info,  Node: Exodus,  Next: Leviticus,  Prev: Genesis,  Up: History
  3509. Exodus
  3510. ======
  3511.    As I got feedback from users, I incorporated many improvements, using
  3512. Emacs to search and replace, cut and paste, similar changes in each of
  3513. the scripts.  As I adapted more GNU utilities packages to use
  3514. `configure' scripts, updating them all by hand became impractical.
  3515. Rich Murphey, the maintainer of the GNU graphics utilities, sent me mail
  3516. saying that the `configure' scripts were great, and asking if I had a
  3517. tool for generating them that I could send him.  No, I thought, but I
  3518. should!  So I started to work out how to generate them.  And the
  3519. journey from the slavery of hand-written `configure' scripts to the
  3520. abundance and ease of Autoconf began.
  3521.    Cygnus `configure', which was being developed at around that time,
  3522. is table driven; it is meant to deal mainly with a discrete number of
  3523. system types with a small number of mainly unguessable features (such as
  3524. details of the object file format).  The automatic configuration system
  3525. that Brian Fox had developed for Bash takes a similar approach.  For
  3526. general use, it seems to me a hopeless cause to try to maintain an
  3527. up-to-date database of which features each variant of each operating
  3528. system has.  It's easier and more reliable to check for most features on
  3529. the fly--especially on hybrid systems that people have hacked on
  3530. locally or that have patches from vendors installed.
  3531.    I considered using an architecture similar to that of Cygnus
  3532. `configure', where there is a single `configure' script that reads
  3533. pieces of `configure.in' when run.  But I didn't want to have to
  3534. distribute all of the feature tests with every package, so I settled on
  3535. having a different `configure' made from each `configure.in' by a
  3536. preprocessor.  That approach also offered more control and flexibility.
  3537.    I looked briefly into using the Metaconfig package, by Larry Wall,
  3538. Harlan Stenn, and Raphael Manfredi, but I decided not to for several
  3539. reasons.  The `Configure' scripts it produces are interactive, which I
  3540. find quite inconvenient; I didn't like the ways it checked for some
  3541. features (such as library functions); I didn't know that it was still
  3542. being maintained, and the `Configure' scripts I had seen didn't work on
  3543. many modern systems (such as System V R4 and NeXT); it wasn't very
  3544. flexible in what it could do in response to a feature's presence or
  3545. absence; I found it confusing to learn; and it was too big and complex
  3546. for my needs (I didn't realize then how much Autoconf would eventually
  3547. have to grow).
  3548.    I considered using Perl to generate my style of `configure' scripts,
  3549. but decided that `m4' was better suited to the job of simple textual
  3550. substitutions: it gets in the way less, because output is implicit.
  3551. Plus, everyone already has it.  (Initially I didn't rely on the GNU
  3552. extensions to `m4'.)  Also, some of my friends at the University of
  3553. Maryland had recently been putting `m4' front ends on several programs,
  3554. including `tvtwm', and I was interested in trying out a new language.
  3555. File: autoconf.info,  Node: Leviticus,  Next: Numbers,  Prev: Exodus,  Up: History
  3556. Leviticus
  3557. =========
  3558.    Since my `configure' scripts determine the system's capabilities
  3559. automatically, with no interactive user intervention, I decided to call
  3560. the program that generates them Autoconfig.  But with a version number
  3561. tacked on, that name would be too long for old UNIX file systems, so I
  3562. shortened it to Autoconf.
  3563.    In the fall of 1991 I called together a group of fellow questers
  3564. after the Holy Grail of portability (er, that is, alpha testers) to
  3565. give me feedback as I encapsulated pieces of my handwritten scripts in
  3566. `m4' macros and continued to add features and improve the techniques
  3567. used in the checks.  Prominent among the testers were Franc,ois Pinard,
  3568. who came up with the idea of making an `autoconf' shell script to run
  3569. `m4' and check for unresolved macro calls; Richard Pixley, who
  3570. suggested running the compiler instead of searching the file system to
  3571. find include files and symbols, for more accurate results; Karl Berry,
  3572. who got Autoconf to configure TeX and added the macro index to the
  3573. documentation; and Ian Taylor, who added support for creating a C
  3574. header file as an alternative to putting `-D' options in a `Makefile',
  3575. so he could use Autoconf for his UUCP package.  The alpha testers
  3576. cheerfully adjusted their files again and again as the names and
  3577. calling conventions of the Autoconf macros changed from release to
  3578. release.  They all contributed many specific checks, great ideas, and
  3579. bug fixes.
  3580. File: autoconf.info,  Node: Numbers,  Next: Deuteronomy,  Prev: Leviticus,  Up: History
  3581. Numbers
  3582. =======
  3583.    In July 1992, after months of alpha testing, I released Autoconf 1.0,
  3584. and converted many GNU packages to use it.  I was surprised by how
  3585. positive the reaction to it was.  More people started using it than I
  3586. could keep track of, including people working on software that wasn't
  3587. part of the GNU Project (such as TCL, FSP, and Kerberos V5).  Autoconf
  3588. continued to improve rapidly, as many people using the `configure'
  3589. scripts reported problems they encountered.
  3590.    Autoconf turned out to be a good torture test for `m4'
  3591. implementations.  UNIX `m4' started to dump core because of the length
  3592. of the macros that Autoconf defined, and several bugs showed up in GNU
  3593. `m4' as well.  Eventually, we realized that we needed to use some
  3594. features that only GNU `m4' has.  4.3BSD `m4', in particular, has an
  3595. impoverished set of builtin macros; the System V version is better, but
  3596. still doesn't provide everything we need.
  3597.    More development occurred as people put Autoconf under more stresses
  3598. (and to uses I hadn't anticipated).  Karl Berry added checks for X11.
  3599. david zuhn contributed C++ support.  Franc,ois Pinard made it diagnose
  3600. invalid arguments.  Jim Blandy bravely coerced it into configuring GNU
  3601. Emacs, laying the groundwork for several later improvements.  Roland
  3602. McGrath got it to configure the GNU C Library, wrote the `autoheader'
  3603. script to automate the creation of C header file templates, and added a
  3604. `--verbose' option to `configure'.  Noah Friedman added the
  3605. `--macrodir' option and `AC_MACRODIR' environment variable.  (He also
  3606. coined the term "autoconfiscate" to mean "adapt a software package to
  3607. use Autoconf".)  Roland and Noah improved the quoting protection in
  3608. `AC_DEFINE' and fixed many bugs, especially when I got sick of dealing
  3609. with portability problems from February through June, 1993.
  3610. File: autoconf.info,  Node: Deuteronomy,  Prev: Numbers,  Up: History
  3611. Deuteronomy
  3612. ===========
  3613.    A long wish list for major features had accumulated, and the effect
  3614. of several years of patching by various people had left some residual
  3615. cruft.  In April 1994, while working for Cygnus Support, I began a major
  3616. revision of Autoconf.  I added most of the features of the Cygnus
  3617. `configure' that Autoconf had lacked, largely by adapting the relevant
  3618. parts of Cygnus `configure' with the help of david zuhn and Ken
  3619. Raeburn.  These features include support for using `config.sub',
  3620. `config.guess', `--host', and `--target'; making links to files; and
  3621. running `configure' scripts in subdirectories.  Adding these features
  3622. enabled Ken to convert GNU `as', and Rob Savoye to convert DejaGNU, to
  3623. using Autoconf.
  3624.    I added more features in response to other peoples' requests.  Many
  3625. people had asked for `configure' scripts to share the results of the
  3626. checks between runs, because (particularly when configuring a large
  3627. source tree, like Cygnus does) they were frustratingly slow.  Mike
  3628. Haertel suggested adding site-specific initialization scripts.  People
  3629. distributing software that had to unpack on MS-DOS asked for a way to
  3630. override the `.in' extension on the file names, which produced file
  3631. names like `config.h.in' containing two dots.  Jim Avera did an
  3632. extensive examination of the problems with quoting in `AC_DEFINE' and
  3633. `AC_SUBST'; his insights led to significant improvements.  Richard
  3634. Stallman asked that compiler output be sent to `config.log' instead of
  3635. `/dev/null', to help people debug the Emacs `configure' script.
  3636.    I made some other changes because of my dissatisfaction with the
  3637. quality of the program.  I made the messages showing results of the
  3638. checks less ambiguous, always printing a result.  I regularized the
  3639. names of the macros and cleaned up coding style inconsistencies.  I
  3640. added some auxiliary utilities that I had developed to help convert
  3641. source code packages to use Autoconf.  With the help of Franc,ois
  3642. Pinard, I made the macros not interrupt each others' messages.  (That
  3643. feature revealed some performance bottlenecks in GNU `m4', which he
  3644. hastily corrected!) I reorganized the documentation around problems
  3645. people want to solve.  And I began a testsuite, because experience had
  3646. shown that Autoconf has a pronounced tendency to regress when we change
  3647.    Again, several alpha testers gave invaluable feedback, especially
  3648. Franc,ois Pinard, Jim Meyering, Karl Berry, Rob Savoye, Ken Raeburn,
  3649. and Mark Eichin.
  3650.    Finally, version 2.0 was ready.  And there was much rejoicing.  (And
  3651. I have free time again.  I think.  Yeah, right.)
  3652. File: autoconf.info,  Node: Old Macro Names,  Next: Environment Variable Index,  Prev: History,  Up: Top
  3653. Old Macro Names
  3654. ***************
  3655.    In version 2 of Autoconf, most of the macros were renamed to use a
  3656. more uniform and descriptive naming scheme.  Here are the old names of
  3657. the macros that were renamed, followed by the current names of those
  3658. macros.  Although the old names are still accepted by the `autoconf'
  3659. program for backward compatibility, the old names are considered
  3660. obsolete.  *Note Macro Names::, for a description of the new naming
  3661. scheme.
  3662. `AC_ALLOCA'
  3663.      `AC_FUNC_ALLOCA'
  3664. `AC_ARG_ARRAY'
  3665.      removed because of limited usefulness
  3666. `AC_CHAR_UNSIGNED'
  3667.      `AC_C_CHAR_UNSIGNED'
  3668. `AC_CONST'
  3669.      `AC_C_CONST'
  3670. `AC_CROSS_CHECK'
  3671.      `AC_C_CROSS'
  3672. `AC_ERROR'
  3673.      `AC_MSG_ERROR'
  3674. `AC_FIND_X'
  3675.      `AC_PATH_X'
  3676. `AC_FIND_XTRA'
  3677.      `AC_PATH_XTRA'
  3678. `AC_FUNC_CHECK'
  3679.      `AC_CHECK_FUNC'
  3680. `AC_GCC_TRADITIONAL'
  3681.      `AC_PROG_GCC_TRADITIONAL'
  3682. `AC_GETGROUPS_T'
  3683.      `AC_TYPE_GETGROUPS'
  3684. `AC_GETLOADAVG'
  3685.      `AC_FUNC_GETLOADAVG'
  3686. `AC_HAVE_FUNCS'
  3687.      `AC_CHECK_FUNCS'
  3688. `AC_HAVE_HEADERS'
  3689.      `AC_CHECK_HEADERS'
  3690. `AC_HAVE_POUNDBANG'
  3691.      `AC_SYS_INTERPRETER' (different calling convention)
  3692. `AC_HEADER_CHECK'
  3693.      `AC_CHECK_HEADER'
  3694. `AC_HEADER_EGREP'
  3695.      `AC_EGREP_HEADER'
  3696. `AC_INLINE'
  3697.      `AC_C_INLINE'
  3698. `AC_LN_S'
  3699.      `AC_PROG_LN_S'
  3700. `AC_LONG_DOUBLE'
  3701.      `AC_C_LONG_DOUBLE'
  3702. `AC_LONG_FILE_NAMES'
  3703.      `AC_SYS_LONG_FILE_NAMES'
  3704. `AC_MAJOR_HEADER'
  3705.      `AC_HEADER_MAJOR'
  3706. `AC_MINUS_C_MINUS_O'
  3707.      `AC_PROG_CC_C_O'
  3708. `AC_MMAP'
  3709.      `AC_FUNC_MMAP'
  3710. `AC_MODE_T'
  3711.      `AC_TYPE_MODE_T'
  3712. `AC_OFF_T'
  3713.      `AC_TYPE_OFF_T'
  3714. `AC_PID_T'
  3715.      `AC_TYPE_PID_T'
  3716. `AC_PREFIX'
  3717.      `AC_PREFIX_PROGRAM'
  3718. `AC_PROGRAMS_CHECK'
  3719.      `AC_CHECK_PROGS'
  3720. `AC_PROGRAMS_PATH'
  3721.      `AC_PATH_PROGS'
  3722. `AC_PROGRAM_CHECK'
  3723.      `AC_CHECK_PROG'
  3724. `AC_PROGRAM_EGREP'
  3725.      `AC_EGREP_CPP'
  3726. `AC_PROGRAM_PATH'
  3727.      `AC_PATH_PROG'
  3728. `AC_REMOTE_TAPE'
  3729.      removed because of limited usefulness
  3730. `AC_RESTARTABLE_SYSCALLS'
  3731.      `AC_SYS_RESTARTABLE_SYSCALLS'
  3732. `AC_RETSIGTYPE'
  3733.      `AC_TYPE_SIGNAL'
  3734. `AC_RSH'
  3735.      removed because of limited usefulness
  3736. `AC_SETVBUF_REVERSED'
  3737.      `AC_FUNC_SETVBUF_REVERSED'
  3738. `AC_SET_MAKE'
  3739.      `AC_PROG_MAKE_SET'
  3740. `AC_SIZEOF_TYPE'
  3741.      `AC_CHECK_SIZEOF'
  3742. `AC_SIZE_T'
  3743.      `AC_TYPE_SIZE_T'
  3744. `AC_STAT_MACROS_BROKEN'
  3745.      `AC_HEADER_STAT'
  3746. `AC_STDC_HEADERS'
  3747.      `AC_HEADER_STDC'
  3748. `AC_STRCOLL'
  3749.      `AC_FUNC_STRCOLL'
  3750. `AC_ST_BLKSIZE'
  3751.      `AC_STRUCT_ST_BLKSIZE'
  3752. `AC_ST_BLOCKS'
  3753.      `AC_STRUCT_ST_BLOCKS'
  3754. `AC_ST_RDEV'
  3755.      `AC_STRUCT_ST_RDEV'
  3756. `AC_SYS_SIGLIST_DECLARED'
  3757.      `AC_DECL_SYS_SIGLIST'
  3758. `AC_TEST_CPP'
  3759.      `AC_TRY_CPP'
  3760. `AC_TEST_PROGRAM'
  3761.      `AC_TRY_RUN'
  3762. `AC_TIMEZONE'
  3763.      `AC_STRUCT_TIMEZONE'
  3764. `AC_TIME_WITH_SYS_TIME'
  3765.      `AC_HEADER_TIME'
  3766. `AC_UID_T'
  3767.      `AC_TYPE_UID_T'
  3768. `AC_UTIME_NULL'
  3769.      `AC_FUNC_UTIME_NULL'
  3770. `AC_VFORK'
  3771.      `AC_FUNC_VFORK'
  3772. `AC_VPRINTF'
  3773.      `AC_FUNC_VPRINTF'
  3774. `AC_WAIT3'
  3775.      `AC_FUNC_WAIT3'
  3776. `AC_WARN'
  3777.      `AC_MSG_WARN'
  3778. `AC_WORDS_BIGENDIAN'
  3779.      `AC_C_BIGENDIAN'
  3780. `AC_YYTEXT_POINTER'
  3781.      `AC_DECL_YYTEXT'
  3782. File: autoconf.info,  Node: Environment Variable Index,  Next: Output Variable Index,  Prev: Old Macro Names,  Up: Top
  3783. Environment Variable Index
  3784. **************************
  3785.    This is an alphabetical list of the environment variables that
  3786. Autoconf checks.
  3787. * Menu:
  3788. * AC_MACRODIR <1>:                      Invoking autoupdate.
  3789. * AC_MACRODIR <2>:                      Invoking autoscan.
  3790. * AC_MACRODIR <3>:                      Invoking autoreconf.
  3791. * AC_MACRODIR <4>:                      Invoking ifnames.
  3792. * AC_MACRODIR <5>:                      Invoking autoheader.
  3793. * AC_MACRODIR:                          Invoking autoconf.
  3794. * CONFIG_FILES:                         Invoking config.status.
  3795. * CONFIG_HEADERS:                       Invoking config.status.
  3796. * CONFIG_SHELL:                         Invoking config.status.
  3797. * CONFIG_SITE:                          Site Defaults.
  3798. * CONFIG_STATUS:                        Invoking config.status.
  3799. * SIMPLE_BACKUP_SUFFIX:                 Invoking autoupdate.
  3800. File: autoconf.info,  Node: Output Variable Index,  Next: Preprocessor Symbol Index,  Prev: Environment Variable Index,  Up: Top
  3801. Output Variable Index
  3802. *********************
  3803.    This is an alphabetical list of the variables that Autoconf can
  3804. substitute into files that it creates, typically one or more
  3805. `Makefile's.  *Note Setting Output Variables::, for more information on
  3806. how this is done.
  3807. * Menu:
  3808. * ALLOCA:                               Particular Functions.
  3809. * AWK:                                  Particular Programs.
  3810. * bindir:                               Preset Output Variables.
  3811. * build:                                System Type Variables.
  3812. * build_alias:                          System Type Variables.
  3813. * build_cpu:                            System Type Variables.
  3814. * build_os:                             System Type Variables.
  3815. * build_vendor:                         System Type Variables.
  3816. * CC <1>:                               Particular Programs.
  3817. * CC <2>:                               UNIX Variants.
  3818. * CC:                                   Particular Programs.
  3819. * CFLAGS <1>:                           Particular Programs.
  3820. * CFLAGS:                               Preset Output Variables.
  3821. * configure_input:                      Preset Output Variables.
  3822. * CPP:                                  Particular Programs.
  3823. * CPPFLAGS:                             Preset Output Variables.
  3824. * CXX:                                  Particular Programs.
  3825. * CXXCPP:                               Particular Programs.
  3826. * CXXFLAGS <1>:                         Preset Output Variables.
  3827. * CXXFLAGS:                             Particular Programs.
  3828. * datadir:                              Preset Output Variables.
  3829. * DEFS:                                 Preset Output Variables.
  3830. * exec_prefix:                          Preset Output Variables.
  3831. * host:                                 System Type Variables.
  3832. * host_alias:                           System Type Variables.
  3833. * host_cpu:                             System Type Variables.
  3834. * host_os:                              System Type Variables.
  3835. * host_vendor:                          System Type Variables.
  3836. * includedir:                           Preset Output Variables.
  3837. * infodir:                              Preset Output Variables.
  3838. * INSTALL:                              Particular Programs.
  3839. * INSTALL_DATA:                         Particular Programs.
  3840. * INSTALL_PROGRAM:                      Particular Programs.
  3841. * KMEM_GROUP:                           Particular Functions.
  3842. * LDFLAGS:                              Preset Output Variables.
  3843. * LEX:                                  Particular Programs.
  3844. * LEX_OUTPUT_ROOT:                      Particular Programs.
  3845. * LEXLIB:                               Particular Programs.
  3846. * libdir:                               Preset Output Variables.
  3847. * libexecdir:                           Preset Output Variables.
  3848. * LIBOBJS <1>:                          Particular Functions.
  3849. * LIBOBJS <2>:                          Generic Functions.
  3850. * LIBOBJS:                              Structures.
  3851. * LIBS <1>:                             Preset Output Variables.
  3852. * LIBS:                                 UNIX Variants.
  3853. * LN_S:                                 Particular Programs.
  3854. * localstatedir:                        Preset Output Variables.
  3855. * mandir:                               Preset Output Variables.
  3856. * NEED_SETGID:                          Particular Functions.
  3857. * oldincludedir:                        Preset Output Variables.
  3858. * prefix:                               Preset Output Variables.
  3859. * program_transform_name:               Transforming Names.
  3860. * RANLIB:                               Particular Programs.
  3861. * sbindir:                              Preset Output Variables.
  3862. * SET_MAKE:                             Output.
  3863. * sharedstatedir:                       Preset Output Variables.
  3864. * srcdir:                               Preset Output Variables.
  3865. * subdirs:                              Subdirectories.
  3866. * sysconfdir:                           Preset Output Variables.
  3867. * target:                               System Type Variables.
  3868. * target_alias:                         System Type Variables.
  3869. * target_cpu:                           System Type Variables.
  3870. * target_os:                            System Type Variables.
  3871. * target_vendor:                        System Type Variables.
  3872. * top_srcdir:                           Preset Output Variables.
  3873. * X_CFLAGS:                             System Services.
  3874. * X_EXTRA_LIBS:                         System Services.
  3875. * X_LIBS:                               System Services.
  3876. * X_PRE_LIBS:                           System Services.
  3877. * YACC:                                 Particular Programs.
  3878. File: autoconf.info,  Node: Preprocessor Symbol Index,  Next: Macro Index,  Prev: Output Variable Index,  Up: Top
  3879. Preprocessor Symbol Index
  3880. *************************
  3881.    This is an alphabetical list of the C preprocessor symbols that the
  3882. Autoconf macros define.  To work with Autoconf, C source code needs to
  3883. use these names in `#if' directives.
  3884. * Menu:
  3885. * __CHAR_UNSIGNED__:                    Compiler Characteristics.
  3886. * _ALL_SOURCE:                          UNIX Variants.
  3887. * _MINIX:                               UNIX Variants.
  3888. * _POSIX_1_SOURCE:                      UNIX Variants.
  3889. * _POSIX_SOURCE:                        UNIX Variants.
  3890. * _POSIX_VERSION:                       Particular Headers.
  3891. * C_ALLOCA:                             Particular Functions.
  3892. * CLOSEDIR_VOID:                        Particular Functions.
  3893. * const:                                Compiler Characteristics.
  3894. * DGUX:                                 Particular Functions.
  3895. * DIRENT:                               Particular Headers.
  3896. * GETGROUPS_T:                          Particular Typedefs.
  3897. * GETLODAVG_PRIVILEGED:                 Particular Functions.
  3898. * GETPGRP_VOID:                         Particular Functions.
  3899. * gid_t:                                Particular Typedefs.
  3900. * HAVE_FUNCTION:                        Generic Functions.
  3901. * HAVE_HEADER:                          Generic Headers.
  3902. * HAVE_ALLOCA_H:                        Particular Functions.
  3903. * HAVE_CONFIG_H:                        Configuration Headers.
  3904. * HAVE_DIRENT_H:                        Particular Headers.
  3905. * HAVE_DOPRNT:                          Particular Functions.
  3906. * HAVE_GETMNTENT:                       Particular Functions.
  3907. * HAVE_LONG_DOUBLE:                     Compiler Characteristics.
  3908. * HAVE_LONG_FILE_NAMES:                 System Services.
  3909. * HAVE_MMAP:                            Particular Functions.
  3910. * HAVE_NDIR_H:                          Particular Headers.
  3911. * HAVE_RESTARTABLE_SYSCALLS:            System Services.
  3912. * HAVE_ST_BLKSIZE:                      Structures.
  3913. * HAVE_ST_BLOCKS:                       Structures.
  3914. * HAVE_ST_RDEV:                         Structures.
  3915. * HAVE_STRCOLL:                         Particular Functions.
  3916. * HAVE_STRFTIME:                        Particular Functions.
  3917. * HAVE_SYS_DIR_H:                       Particular Headers.
  3918. * HAVE_SYS_NDIR_H:                      Particular Headers.
  3919. * HAVE_SYS_WAIT_H:                      Particular Headers.
  3920. * HAVE_TM_ZONE:                         Structures.
  3921. * HAVE_TZNAME:                          Structures.
  3922. * HAVE_UNISTD_H:                        Particular Headers.
  3923. * HAVE_UTIME_NULL:                      Particular Functions.
  3924. * HAVE_VFORK_H:                         Particular Functions.
  3925. * HAVE_VPRINTF:                         Particular Functions.
  3926. * HAVE_WAIT3:                           Particular Functions.
  3927. * inline:                               Compiler Characteristics.
  3928. * INT_16_BITS:                          Compiler Characteristics.
  3929. * LONG_64_BITS:                         Compiler Characteristics.
  3930. * MAJOR_IN_MKDEV:                       Particular Headers.
  3931. * MAJOR_IN_SYSMACROS:                   Particular Headers.
  3932. * mode_t:                               Particular Typedefs.
  3933. * NDIR:                                 Particular Headers.
  3934. * NEED_MEMORY_H:                        Particular Headers.
  3935. * NEED_SETGID:                          Particular Functions.
  3936. * NLIST_NAME_UNION:                     Particular Functions.
  3937. * NLIST_STRUCT:                         Particular Functions.
  3938. * NO_MINUS_C_MINUS_O:                   Particular Programs.
  3939. * off_t:                                Particular Typedefs.
  3940. * pid_t:                                Particular Typedefs.
  3941. * RETSIGTYPE:                           Particular Typedefs.
  3942. * SETVBUF_REVERSED:                     Particular Functions.
  3943. * size_t:                               Particular Typedefs.
  3944. * STDC_HEADERS:                         Particular Headers.
  3945. * SVR4:                                 Particular Functions.
  3946. * SYS_SIGLIST_DECLARED:                 Particular Headers.
  3947. * SYSDIR:                               Particular Headers.
  3948. * SYSNDIR:                              Particular Headers.
  3949. * TIME_WITH_SYS_TIME:                   Structures.
  3950. * TM_IN_SYS_TIME:                       Structures.
  3951. * uid_t:                                Particular Typedefs.
  3952. * UMAX:                                 Particular Functions.
  3953. * UMAX4_3:                              Particular Functions.
  3954. * USG:                                  Particular Headers.
  3955. * vfork:                                Particular Functions.
  3956. * VOID_CLOSEDIR:                        Particular Headers.
  3957. * WORDS_BIGENDIAN:                      Compiler Characteristics.
  3958. * YYTEXT_POINTER:                       Particular Programs.
  3959. File: autoconf.info,  Node: Macro Index,  Prev: Preprocessor Symbol Index,  Up: Top
  3960. Macro Index
  3961. ***********
  3962.    This is an alphabetical list of the Autoconf macros.  To make the
  3963. list easier to use, the macros are listed without their preceding `AC_'.
  3964. * Menu:
  3965. * AIX:                                  UNIX Variants.
  3966. * ALLOCA:                               Old Macro Names.
  3967. * ARG_ARRAY:                            Old Macro Names.
  3968. * ARG_ENABLE:                           Package Options.
  3969. * ARG_PROGRAM:                          Transforming Names.
  3970. * ARG_WITH:                             External Software.
  3971. * BEFORE:                               Suggested Ordering.
  3972. * C_BIGENDIAN:                          Compiler Characteristics.
  3973. * C_CHAR_UNSIGNED:                      Compiler Characteristics.
  3974. * C_CONST:                              Compiler Characteristics.
  3975. * C_CROSS:                              Test Programs.
  3976. * C_INLINE:                             Compiler Characteristics.
  3977. * C_LONG_DOUBLE:                        Compiler Characteristics.
  3978. * CACHE_CHECK:                          Caching Results.
  3979. * CACHE_VAL:                            Caching Results.
  3980. * CANONICAL_HOST:                       Canonicalizing.
  3981. * CANONICAL_SYSTEM:                     Canonicalizing.
  3982. * CHAR_UNSIGNED:                        Old Macro Names.
  3983. * CHECK_FUNC:                           Generic Functions.
  3984. * CHECK_FUNCS:                          Generic Functions.
  3985. * CHECK_HEADER:                         Generic Headers.
  3986. * CHECK_HEADERS:                        Generic Headers.
  3987. * CHECK_LIB:                            Libraries.
  3988. * CHECK_PROG:                           Generic Programs.
  3989. * CHECK_PROGS:                          Generic Programs.
  3990. * CHECK_SIZEOF:                         Compiler Characteristics.
  3991. * CHECK_TOOL:                           Generic Programs.
  3992. * CHECK_TYPE:                           Generic Typedefs.
  3993. * CHECKING:                             Printing Messages.
  3994. * COMPILE_CHECK:                        Examining Libraries.
  3995. * CONFIG_AUX_DIR:                       Input.
  3996. * CONFIG_HEADER:                        Configuration Headers.
  3997. * CONFIG_SUBDIRS:                       Subdirectories.
  3998. * CONST:                                Old Macro Names.
  3999. * CROSS_CHECK:                          Old Macro Names.
  4000. * DECL_SYS_SIGLIST:                     Particular Headers.
  4001. * DECL_YYTEXT:                          Particular Programs.
  4002. * DEFINE:                               Defining Symbols.
  4003. * DEFINE_UNQUOTED:                      Defining Symbols.
  4004. * DEFUN:                                Macro Definitions.
  4005. * DIR_HEADER:                           Particular Headers.
  4006. * DYNIX_SEQ:                            UNIX Variants.
  4007. * EGREP_CPP:                            Examining Declarations.
  4008. * EGREP_HEADER:                         Examining Declarations.
  4009. * ENABLE:                               Package Options.
  4010. * ERROR:                                Old Macro Names.
  4011. * FIND_X:                               Old Macro Names.
  4012. * FIND_XTRA:                            Old Macro Names.
  4013. * FUNC_ALLOCA:                          Particular Functions.
  4014. * FUNC_CHECK:                           Old Macro Names.
  4015. * FUNC_CLOSEDIR_VOID:                   Particular Functions.
  4016. * FUNC_GETLOADAVG:                      Particular Functions.
  4017. * FUNC_GETMNTENT:                       Particular Functions.
  4018. * FUNC_GETPGRP:                         Particular Functions.
  4019. * FUNC_MEMCMP:                          Particular Functions.
  4020. * FUNC_MMAP:                            Particular Functions.
  4021. * FUNC_SETVBUF_REVERSED:                Particular Functions.
  4022. * FUNC_STRCOLL:                         Particular Functions.
  4023. * FUNC_STRFTIME:                        Particular Functions.
  4024. * FUNC_UTIME_NULL:                      Particular Functions.
  4025. * FUNC_VFORK:                           Particular Functions.
  4026. * FUNC_VPRINTF:                         Particular Functions.
  4027. * FUNC_WAIT3:                           Particular Functions.
  4028. * GCC_TRADITIONAL:                      Old Macro Names.
  4029. * GETGROUPS_T:                          Old Macro Names.
  4030. * GETLOADAVG:                           Old Macro Names.
  4031. * HAVE_FUNCS:                           Old Macro Names.
  4032. * HAVE_HEADERS:                         Old Macro Names.
  4033. * HAVE_LIBRARY:                         Libraries.
  4034. * HAVE_POUNDBANG:                       Old Macro Names.
  4035. * HEADER_CHECK:                         Old Macro Names.
  4036. * HEADER_DIRENT:                        Particular Headers.
  4037. * HEADER_EGREP:                         Old Macro Names.
  4038. * HEADER_MAJOR:                         Particular Headers.
  4039. * HEADER_STAT:                          Structures.
  4040. * HEADER_STDC:                          Particular Headers.
  4041. * HEADER_SYS_WAIT:                      Particular Headers.
  4042. * HEADER_TIME:                          Structures.
  4043. * INIT:                                 Input.
  4044. * INLINE:                               Old Macro Names.
  4045. * INT_16_BITS:                          Compiler Characteristics.
  4046. * IRIX_SUN:                             UNIX Variants.
  4047. * ISC_POSIX:                            UNIX Variants.
  4048. * LANG_C:                               Language Choice.
  4049. * LANG_CPLUSPLUS:                       Language Choice.
  4050. * LANG_RESTORE:                         Language Choice.
  4051. * LANG_SAVE:                            Language Choice.
  4052. * LINK_FILES:                           Using System Type.
  4053. * LN_S:                                 Old Macro Names.
  4054. * LONG_64_BITS:                         Compiler Characteristics.
  4055. * LONG_DOUBLE:                          Old Macro Names.
  4056. * LONG_FILE_NAMES:                      Old Macro Names.
  4057. * MAJOR_HEADER:                         Old Macro Names.
  4058. * MEMORY_H:                             Particular Headers.
  4059. * MINIX:                                UNIX Variants.
  4060. * MINUS_C_MINUS_O:                      Old Macro Names.
  4061. * MMAP:                                 Old Macro Names.
  4062. * MODE_T:                               Old Macro Names.
  4063. * MSG_CHECKING:                         Printing Messages.
  4064. * MSG_ERROR:                            Printing Messages.
  4065. * MSG_RESULT:                           Printing Messages.
  4066. * MSG_WARN:                             Printing Messages.
  4067. * OBSOLETE:                             Obsolete Macros.
  4068. * OFF_T:                                Old Macro Names.
  4069. * OUTPUT:                               Output.
  4070. * PATH_PROG:                            Generic Programs.
  4071. * PATH_PROGS:                           Generic Programs.
  4072. * PATH_X:                               System Services.
  4073. * PATH_XTRA:                            System Services.
  4074. * PID_T:                                Old Macro Names.
  4075. * PREFIX:                               Old Macro Names.
  4076. * PREFIX_PROGRAM:                       Default Prefix.
  4077. * PREREQ:                               Versions.
  4078. * PROG_AWK:                             Particular Programs.
  4079. * PROG_CC:                              Particular Programs.
  4080. * PROG_CC_C_O:                          Particular Programs.
  4081. * PROG_CPP:                             Particular Programs.
  4082. * PROG_CXX:                             Particular Programs.
  4083. * PROG_CXXCPP:                          Particular Programs.
  4084. * PROG_GCC_TRADITIONAL:                 Particular Programs.
  4085. * PROG_INSTALL:                         Particular Programs.
  4086. * PROG_LEX:                             Particular Programs.
  4087. * PROG_LN_S:                            Particular Programs.
  4088. * PROG_MAKE_SET:                        Output.
  4089. * PROG_RANLIB:                          Particular Programs.
  4090. * PROG_YACC:                            Particular Programs.
  4091. * PROGRAM_CHECK:                        Old Macro Names.
  4092. * PROGRAM_EGREP:                        Old Macro Names.
  4093. * PROGRAM_PATH:                         Old Macro Names.
  4094. * PROGRAMS_CHECK:                       Old Macro Names.
  4095. * PROGRAMS_PATH:                        Old Macro Names.
  4096. * PROVIDE:                              Prerequisite Macros.
  4097. * REMOTE_TAPE:                          Old Macro Names.
  4098. * REPLACE_FUNCS:                        Generic Functions.
  4099. * REQUIRE:                              Prerequisite Macros.
  4100. * REQUIRE_CPP:                          Language Choice.
  4101. * RESTARTABLE_SYSCALLS:                 Old Macro Names.
  4102. * RETSIGTYPE:                           Old Macro Names.
  4103. * REVISION:                             Versions.
  4104. * RSH:                                  Old Macro Names.
  4105. * SCO_INTL:                             UNIX Variants.
  4106. * SET_MAKE:                             Old Macro Names.
  4107. * SETVBUF_REVERSED:                     Old Macro Names.
  4108. * SIZE_T:                               Old Macro Names.
  4109. * SIZEOF_TYPE:                          Old Macro Names.
  4110. * ST_BLKSIZE:                           Old Macro Names.
  4111. * ST_BLOCKS:                            Old Macro Names.
  4112. * ST_RDEV:                              Old Macro Names.
  4113. * STAT_MACROS_BROKEN <1>:               Structures.
  4114. * STAT_MACROS_BROKEN:                   Old Macro Names.
  4115. * STDC_HEADERS:                         Old Macro Names.
  4116. * STRCOLL:                              Old Macro Names.
  4117. * STRUCT_ST_BLKSIZE:                    Structures.
  4118. * STRUCT_ST_BLOCKS:                     Structures.
  4119. * STRUCT_ST_RDEV:                       Structures.
  4120. * STRUCT_TIMEZONE:                      Structures.
  4121. * STRUCT_TM:                            Structures.
  4122. * SUBST:                                Setting Output Variables.
  4123. * SUBST_FILE:                           Setting Output Variables.
  4124. * SYS_INTERPRETER:                      System Services.
  4125. * SYS_LONG_FILE_NAMES:                  System Services.
  4126. * SYS_RESTARTABLE_SYSCALLS:             System Services.
  4127. * SYS_SIGLIST_DECLARED:                 Old Macro Names.
  4128. * TEST_CPP:                             Old Macro Names.
  4129. * TEST_PROGRAM:                         Old Macro Names.
  4130. * TIME_WITH_SYS_TIME:                   Old Macro Names.
  4131. * TIMEZONE:                             Old Macro Names.
  4132. * TRY_COMPILE:                          Examining Syntax.
  4133. * TRY_CPP:                              Examining Declarations.
  4134. * TRY_LINK:                             Examining Libraries.
  4135. * TRY_RUN:                              Test Programs.
  4136. * TYPE_GETGROUPS:                       Particular Typedefs.
  4137. * TYPE_MODE_T:                          Particular Typedefs.
  4138. * TYPE_OFF_T:                           Particular Typedefs.
  4139. * TYPE_PID_T:                           Particular Typedefs.
  4140. * TYPE_SIGNAL:                          Particular Typedefs.
  4141. * TYPE_SIZE_T:                          Particular Typedefs.
  4142. * TYPE_UID_T:                           Particular Typedefs.
  4143. * UID_T:                                Old Macro Names.
  4144. * UNISTD_H:                             Particular Headers.
  4145. * USG:                                  Particular Headers.
  4146. * UTIME_NULL:                           Old Macro Names.
  4147. * VERBOSE:                              Printing Messages.
  4148. * VFORK:                                Old Macro Names.
  4149. * VPRINTF:                              Old Macro Names.
  4150. * WAIT3:                                Old Macro Names.
  4151. * WARN:                                 Old Macro Names.
  4152. * WITH:                                 External Software.
  4153. * WORDS_BIGENDIAN:                      Old Macro Names.
  4154. * XENIX_DIR:                            UNIX Variants.
  4155. * YYTEXT_POINTER:                       Old Macro Names.
  4156. Tag Table:
  4157. Node: Top
  4158. Node: Introduction
  4159. Node: Making configure Scripts
  4160. 13172
  4161. Node: Writing configure.in
  4162. 16237
  4163. Node: Invoking autoscan
  4164. 19937
  4165. Node: Invoking ifnames
  4166. 22242
  4167. Node: Invoking autoconf
  4168. 23732
  4169. Node: Invoking autoreconf
  4170. 25570
  4171. Node: Setup
  4172. 27890
  4173. Node: Input
  4174. 28776
  4175. Node: Output
  4176. 30499
  4177. Node: Makefile Substitutions
  4178. 33249
  4179. Node: Preset Output Variables
  4180. 34833
  4181. Node: Build Directories
  4182. 39335
  4183. Node: Automatic Remaking
  4184. 40968
  4185. Node: Configuration Headers
  4186. 43054
  4187. Node: Header Templates
  4188. 45421
  4189. Node: Invoking autoheader
  4190. 46600
  4191. Node: Subdirectories
  4192. 49748
  4193. Node: Default Prefix
  4194. 51091
  4195. Node: Versions
  4196. 52495
  4197. Node: Existing Tests
  4198. 54399
  4199. Node: Alternative Programs
  4200. 55864
  4201. Node: Particular Programs
  4202. 56528
  4203. Node: Generic Programs
  4204. 62378
  4205. Node: Libraries
  4206. 65204
  4207. Node: Library Functions
  4208. 67033
  4209. Node: Particular Functions
  4210. 67591
  4211. Node: Generic Functions
  4212. 73894
  4213. Node: Header Files
  4214. 75737
  4215. Node: Particular Headers
  4216. 76296
  4217. Node: Generic Headers
  4218. 83267
  4219. Node: Structures
  4220. 84569
  4221. Node: Typedefs
  4222. 86806
  4223. Node: Particular Typedefs
  4224. 87310
  4225. Node: Generic Typedefs
  4226. 88510
  4227. Node: Compiler Characteristics
  4228. 88953
  4229. Node: System Services
  4230. 91578
  4231. Node: UNIX Variants
  4232. 93927
  4233. Node: Writing Tests
  4234. 95946
  4235. Node: Examining Declarations
  4236. 97912
  4237. Node: Examining Syntax
  4238. 100382
  4239. Node: Examining Libraries
  4240. 101439
  4241. Node: Run Time
  4242. 103998
  4243. Node: Test Programs
  4244. 104959
  4245. Node: Guidelines
  4246. 107496
  4247. Node: Test Functions
  4248. 108685
  4249. Node: Portable Shell
  4250. 110228
  4251. Node: Testing Values and Files
  4252. 112160
  4253. Node: Multiple Cases
  4254. 113815
  4255. Node: Language Choice
  4256. 115013
  4257. Node: Results
  4258. 116571
  4259. Node: Defining Symbols
  4260. 117330
  4261. Node: Setting Output Variables
  4262. 120339
  4263. Node: Caching Results
  4264. 122185
  4265. Node: Cache Variable Names
  4266. 124466
  4267. Node: Cache Files
  4268. 126015
  4269. Node: Printing Messages
  4270. 128113
  4271. Node: Writing Macros
  4272. 131400
  4273. Node: Macro Definitions
  4274. 132019
  4275. Node: Macro Names
  4276. 133124
  4277. Node: Quoting
  4278. 135575
  4279. Node: Dependencies Between Macros
  4280. 137477
  4281. Node: Prerequisite Macros
  4282. 138109
  4283. Node: Suggested Ordering
  4284. 139564
  4285. Node: Obsolete Macros
  4286. 141094
  4287. Node: Manual Configuration
  4288. 142318
  4289. Node: Specifying Names
  4290. 143217
  4291. Node: Canonicalizing
  4292. 145089
  4293. Node: System Type Variables
  4294. 146403
  4295. Node: Using System Type
  4296. 147150
  4297. Node: Site Configuration
  4298. 148597
  4299. Node: External Software
  4300. 149370
  4301. Node: Package Options
  4302. 152068
  4303. Node: Site Details
  4304. 154335
  4305. Node: Transforming Names
  4306. 155558
  4307. Node: Transformation Options
  4308. 156736
  4309. Node: Transformation Examples
  4310. 157202
  4311. Node: Transformation Rules
  4312. 158770
  4313. Node: Site Defaults
  4314. 160179
  4315. Node: Invoking configure
  4316. 163963
  4317. Node: Basic Installation
  4318. 164912
  4319. Node: Compilers and Options
  4320. 167492
  4321. Node: Multiple Architectures
  4322. 168141
  4323. Node: Installation Names
  4324. 169127
  4325. Node: Optional Features
  4326. 170311
  4327. Node: System Type
  4328. 171081
  4329. Node: Sharing Defaults
  4330. 172103
  4331. Node: Operation Controls
  4332. 172727
  4333. Node: Invoking config.status
  4334. 173602
  4335. Node: Questions
  4336. 176990
  4337. Node: Distributing
  4338. 177522
  4339. Node: Why GNU m4
  4340. 178648
  4341. Node: Bootstrapping
  4342. 179461
  4343. Node: Why Not Imake
  4344. 180077
  4345. Node: Upgrading
  4346. 184486
  4347. Node: Changed File Names
  4348. 186007
  4349. Node: Changed Makefiles
  4350. 186743
  4351. Node: Changed Macros
  4352. 187839
  4353. Node: Invoking autoupdate
  4354. 189086
  4355. Node: Changed Results
  4356. 190677
  4357. Node: Changed Macro Writing
  4358. 192779
  4359. Node: History
  4360. 194042
  4361. Node: Genesis
  4362. 194749
  4363. Node: Exodus
  4364. 195922
  4365. Node: Leviticus
  4366. 198971
  4367. Node: Numbers
  4368. 200494
  4369. Node: Deuteronomy
  4370. 202410
  4371. Node: Old Macro Names
  4372. 205074
  4373. Node: Environment Variable Index
  4374. 208123
  4375. Node: Output Variable Index
  4376. 209125
  4377. Node: Preprocessor Symbol Index
  4378. 213869
  4379. Node: Macro Index
  4380. 218684
  4381. End Tag Table
  4382.