home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / autoconf-2.2-src.lha / autoconf-2.2 / autoconf.info < prev    next >
Encoding:
GNU Info File  |  1995-03-10  |  223.7 KB  |  5,363 lines

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