home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / autoconf-1.11-src.lha / GNU / src / amiga / autoconf-1.11 / autoconf.info (.txt) < prev    next >
GNU Info File  |  1994-06-12  |  125KB  |  2,385 lines

  1. This is Info file /gnu/src/amiga/autoconf-1.11/autoconf.info, produced
  2. by Makeinfo-1.55 from the input file
  3. /gnu/src/amiga/autoconf-1.11/autoconf.texi.
  4. START-INFO-DIR-ENTRY
  5. * autoconf: (autoconf).    The Autoconf configuration system.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the GNU Autoconf package for creating scripts to
  8. configure source code packages using templates and an `m4' macro
  9. package.
  10.    Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided that
  16. the entire resulting derived work is distributed under the terms of a
  17. permission notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that this permission notice may be stated in a
  21. translation approved by the Foundation.
  22. File: autoconf.info,  Node: Top,  Next: Introduction,  Up: (dir)
  23.    This file documents the GNU Autoconf package for creating scripts to
  24. configure source code packages using templates and an `m4' macro
  25. package.  This is edition 1.11, for Autoconf version 1.11.
  26. * Menu:
  27. * Introduction::        Autoconf's purpose, strengths, and weaknesses.
  28. * Distributing::        Legal restrictions on Autoconf output.
  29. * Making configure Scripts::    How to organize and produce Autoconf scripts.
  30. * Specific Tests::        Macros that check for particular features.
  31. * General Purpose Macros::    Macros that check for kinds of features.
  32. * Writing Macros::        How to add your own macros to Autoconf.
  33. * Makefiles::            Information Autoconf uses in `Makefile's.
  34. * Invoking configure::      How to use the Autoconf output.
  35. * Example::            Sample Autoconf input files.
  36. * Preprocessor Symbol Index::    Index of C preprocessor symbols defined.
  37. * Macro Index::            Index of Autoconf macros.
  38.  -- The Detailed Node Listing --
  39. Making `configure' Scripts
  40. * Writing configure.in::    What to put in an Autoconf input file.
  41. * Invoking autoconf::        How to create configuration scripts.
  42. * Invoking autoheader::        How to create configuration header files.
  43. Specific Tests
  44. * Alternative Programs::    Selecting between alternative programs.
  45. * Header Files::        Header files that might be missing.
  46. * Typedefs::            `typedef's that might be missing.
  47. * Library Functions::        C library functions that might be missing.
  48. * Structures::            Structures or members that might be missing.
  49. * Compiler Characteristics::    C compiler or machine architecture features.
  50. * System Services::        Operating system services.
  51. * UNIX Variants::        Special cases for specific UNIX variants.
  52. General Purpose Macros
  53. * Setup::            Controlling Autoconf operation.
  54. * General Feature Tests::    Checking for kinds of features.
  55. * Command Line::                Checking command line arguments.
  56. * Setting Variables::        Setting shell and `make' variables.
  57. * Printing Messages::           Notifying users of progress or problems.
  58. * Language Choice::             Selecting which language to use for testing.
  59. * Macro Ordering::        Enforcing ordering constraints.
  60. Writing Macros
  61. * Macro Format::        Basic format of an Autoconf macro.
  62. * Quoting::            Protecting macros from unwanted expansion.
  63. * Dependencies Between Macros::    What to do when macros depend on other macros.
  64. * Checking for Files::        Finding whether a file exists.
  65. * Checking for Symbols::    Finding whether a symbol is defined.
  66. * Test Programs::        Writing programs to test for features.
  67. * Multiple Cases::        Tests for several possible values.
  68. Dependencies Between Macros
  69. * Prerequisite Macros::        Ensuring required information.
  70. * Suggested Ordering::        Warning about possible ordering problems.
  71. Test Programs
  72. * Guidelines::            General rules for writing test programs.
  73. * Tricks::            Special ways to work around problems.
  74. Makefiles
  75. * Predefined Variables::    Heavily used `make' variables.
  76. * Installation Prefixes::    A special variable substitution.
  77. * VPATH Substitutions::        Compiling in a different directory.
  78. * Automatic Remaking::        Makefile rules for configuring.
  79. Running `configure' Scripts
  80. * Overriding variables::        Workarounds for unusual systems.
  81. * Invoking config.status::      Recreating a configuration.
  82. An Example
  83. * Sample configure.in::        An example of a `configure' template.
  84. * Sample Makefile.in::        An example of a `Makefile' template.
  85. File: autoconf.info,  Node: Introduction,  Next: Distributing,  Prev: Top,  Up: Top
  86. Introduction
  87. ************
  88.    Autoconf is a tool for producing shell scripts that automatically
  89. configure software source code packages to adapt to many kinds of
  90. UNIX-like systems.  The configuration scripts produced by Autoconf are
  91. independent of Autoconf when they are run, so their users do not need to
  92. have Autoconf.
  93.    The configuration scripts produced by Autoconf normally require no
  94. manual user intervention when run; they do not even take an argument
  95. specifying the system type.  Instead, they test for the presence of each
  96. feature that the software package they are for might need individually.
  97. (Before each check, they print a one-line message stating what they are
  98. checking for, so the user doesn't get too bored while waiting for the
  99. script to finish.)  As a result, they deal well with systems that are
  100. hybrids or customized from the more common UNIX variants.  There is no
  101. need to maintain files that list the features supported by each release
  102. of each variant of UNIX.
  103.    For each software package that Autoconf is used with, it creates a
  104. configuration script from a template file that lists the operating
  105. system features that the package can use.  After the shell code to
  106. recognize and respond to an operating system feature has been written,
  107. Autoconf allows it to be shared by many software packages that can use
  108. (or need) that feature.  If it later turns out that the shell code
  109. needs adjustment for some reason, it needs to be changed in only one
  110. place; all of the the configuration scripts can be regenerated
  111. automatically to take advantage of the updated code.
  112.    Larry Wall's Metaconfig package is similar in purpose to Autoconf,
  113. but is more general.  The scripts it produces require manual user
  114. intervention, which is quite inconvenient when configuring large source
  115. trees.
  116.    Unlike Metaconfig scripts, Autoconf scripts can support
  117. cross-compiling, if some care is taken in writing them.  They should
  118. avoid executing test programs, since test programs compiled with a
  119. cross-compiler can not be executed on the host system.  Also, they
  120. shouldn't do anything that tests features of the host system instead of
  121. the target system.
  122.    Autoconf imposes some restrictions on the names of macros used with
  123. `#ifdef' in C programs (*note Preprocessor Symbol Index::.).
  124.    Autoconf requires GNU `m4' in order to generate the scripts.  It
  125. uses features that some UNIX versions of `m4' do not have.  It also
  126. overflows internal limits of some versions of `m4', including GNU `m4'
  127. 1.0; so use a later version of GNU `m4'.
  128.    Autoconf does not work well with GNU C library releases before 1.06.
  129. The GNU C library contains stubs (which always return an error) for
  130. functions that are not available instead of omitting them from the
  131. library.  As a result, Autoconf scripts are fooled into thinking that
  132. those functions are available.  This problem does not exist with
  133. releases 1.06 and later of the GNU C library, which define C
  134. preprocessor macros that the Autoconf macros `AC_FUNC_CHECK' and
  135. `AC_REPLACE_FUNCS' test, indicating that certain functions are stubs
  136. (*note General Feature Tests::., for more information on checking for
  137. functions).
  138.    Autoconf was written by David MacKenzie, with help from Franc,ois
  139. Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, Roland McGrath,
  140. Noah Friedman, and david d zuhn.  It was inspired by Brian Fox's
  141. automatic configuration system for Bash, by Larry Wall's Metaconfig, and
  142. by Richard Stallman, Richard Pixley, and John Gilmore's configuration
  143. tools for the GNU compiler and object file utilities.
  144.    Mail suggestions and bug reports for Autoconf to
  145. `bug-gnu-utils@prep.ai.mit.edu'.  Please include the Autoconf version
  146. number, which you can get by running `autoconf --version'.
  147. File: autoconf.info,  Node: Distributing,  Next: Making configure Scripts,  Prev: Introduction,  Up: Top
  148. Distributing Autoconf Output
  149. ****************************
  150.    The configuration scripts that Autoconf produces are covered by the
  151. GNU General Public License.  This is because they consist almost
  152. entirely of parts of Autoconf itself, rearranged somewhat, and Autoconf
  153. is distributed under the terms of the GPL.  As applied to Autoconf, the
  154. GPL just means that you need to distribute `configure.in', and
  155. `aclocal.m4', `acconfig.h', and `CONFIG.h.top' and `CONFIG.h.bot' if
  156. you use them, along with `configure'.
  157.    Programs that use Autoconf scripts to configure themselves do not
  158. automatically come under the GPL.  Distributing an Autoconf
  159. configuration script as part of a program is considered to be *mere
  160. aggregation* of that work with the Autoconf script.  Such programs are
  161. not derivative works based on Autoconf; only their configuration scripts
  162. are.  We still encourage software authors to distribute their work under
  163. terms like those of the GPL, but doing so is not required to use
  164. Autoconf.
  165. File: autoconf.info,  Node: Making configure Scripts,  Next: Specific Tests,  Prev: Distributing,  Up: Top
  166. Making `configure' Scripts
  167. **************************
  168.    The configuration scripts that Autoconf produces are by convention
  169. called `configure'.  When run, `configure' creates several files,
  170. replacing configuration parameters in them with values appropriate for
  171. the system being configured.  The files that `configure' creates are:
  172.    * one or more `Makefile' files (one in each subdirectory of the
  173.      package), from template `Makefile.in' files (*note Makefiles::.);
  174.    * optionally, a C header file, the name of which is configurable,
  175.      containing `#define' statements (*note Setup::.);
  176.    * a shell script called `config.status' that, when run, will recreate
  177.      the files listed above (*note Invoking config.status::.).
  178.    To create a `configure' script with Autoconf, you need to write an
  179. Autoconf input file (`configure.in') and run Autoconf on it to produce
  180. the script.  If you write your own feature tests to supplement those
  181. that come with Autoconf, you might also write a file called
  182. `aclocal.m4'.  If you use a C header file to contain `#define'
  183. directives, you might also write `config.h.top', `config.h.bot', and
  184. `acconfig.h', and you will distribute the Autoconf-generated file
  185. `config.h.in' with the package.
  186.    Here is a diagram showing how the files that can be used in
  187. configuration are produced.  Programs that are executed are suffixed by
  188. `*'.  Optional files are enclosed in square brackets (`[]').
  189. `autoconf' and `autoheader' also read the installed files
  190. `acgeneral.m4' and `acspecific.m4', and also an installed `aclocal.m4'
  191. if it exists.
  192. Files used in preparing a software package for distribution:
  193.      configure.in --.   .------> autoconf* -----> configure
  194.                     +---+
  195.      [aclocal.m4] --'   `---.
  196.                             +--> [autoheader*] -> [config.h.in]
  197.      [acconfig.h] ----.     |
  198.                       +-----'
  199.      [config.h.top] --+
  200.      [config.h.bot] --'
  201.      
  202.      Makefile.in -------------------------------> Makefile.in
  203. Files used in configuring a software package:
  204.      configure* ------------.
  205.                             |
  206.      [config.h.in] -.       v            .-> [config.h] -.
  207.                     +--> config.status* -+               +--> make*
  208.      Makefile.in ---'                    `-> Makefile ---'
  209. * Menu:
  210. * Writing configure.in::    What to put in an Autoconf input file.
  211. * Invoking autoconf::        How to create configuration scripts.
  212. * Invoking autoheader::        How to create configuration header files.
  213. File: autoconf.info,  Node: Writing configure.in,  Next: Invoking autoconf,  Up: Making configure Scripts
  214. Writing `configure.in'
  215. ======================
  216.    To produce a `configure' script for a software package, create a
  217. file called `configure.in' that contains invocations of the Autoconf
  218. macros that test the system features your package needs or can use.
  219. Autoconf macros already exist to check for many features; see *Note
  220. Specific Tests::, for their descriptions.  For most other features, you
  221. can use Autoconf template macros to produce custom checks; see *Note
  222. General Feature Tests::, for information about them.  For especially
  223. tricky or specialized features, `configure.in' might need to contain
  224. some hand-crafted shell commands.  *Note Writing Macros::, for
  225. guidelines on writing tests from scratch.
  226.    Every `configure.in' must begin with a call to `AC_INIT' and end
  227. with a call to `AC_OUTPUT' (*note Setup::.).  Other than that, the
  228. order in which `configure.in' calls the Autoconf macros is generally
  229. not important, except that some macros rely on other macros having been
  230. called first, because they check previously set values of some
  231. variables to decide what to do.  These macros are noted in the
  232. individual descriptions (*note Specific Tests::.).
  233.    To encourage consistency, here is a suggested order for calling the
  234. Autoconf macros.  A few macros need to be called in a different order
  235. from the one given here; they are noted in their individual descriptions
  236. (*note Specific Tests::.).  Note that there must not be any space
  237. between the macro name and the open parentheses.
  238.      `AC_INIT(FILE)'
  239.      checks for alternative programs
  240.      checks for UNIX variants that set C preprocessor variables
  241.      checks for header files
  242.      checks for typedefs
  243.      checks for library functions
  244.      checks for structures
  245.      checks for compiler characteristics
  246.      checks for system services
  247.      other checks for UNIX variants
  248.      `AC_OUTPUT([FILE...])'
  249.    You can include comments in `configure.in' files by starting them
  250. with the `m4' predefined macro `dnl', which discards text up through
  251. the next newline.  These comments do not appear in the generated
  252. `configure' scripts.  For example, it is helpful to begin
  253. `configure.in' files with a line like this:
  254.      dnl Process this file with autoconf to produce a configure script.
  255.    *Note Sample configure.in::, for an example of a real `configure.in'
  256. script.
  257. File: autoconf.info,  Node: Invoking autoconf,  Next: Invoking autoheader,  Prev: Writing configure.in,  Up: Making configure Scripts
  258. Invoking `autoconf'
  259. ===================
  260.    To create `configure' from `configure.in', run the `autoconf'
  261. program with no arguments.  `autoconf' processes `configure.in' with
  262. the `m4' macro processor, using the Autoconf macros.  If you give
  263. `autoconf' an argument, it reads that file instead of `configure.in'
  264. and writes the configuration script to the standard output instead of
  265. to `configure'.  If you give `autoconf' the argument `-', it reads the
  266. standard input instead of `configure.in' and writes the configuration
  267. script on the standard output.
  268.    The Autoconf macros are defined in two or more files.  Two of the
  269. files are distributed with Autoconf: `autoconf' first reads
  270. `acgeneral.m4' (*note General Purpose Macros::.), then `acspecific.m4'
  271. (*note Specific Tests::.).  After reading them, `autoconf' looks for an
  272. optional file called `aclocal.m4', first in the directory that contains
  273. other installed Autoconf macro files, and then in the current
  274. directory.  If both files exist, it uses both of them.  Those files can
  275. contain your site's own locally written Autoconf macro definitions
  276. (*note Writing Macros::., for more information).  If a macro is defined
  277. in more than one of the files that `autoconf' reads, the last
  278. definition it reads overrides the earlier ones.
  279.    You can override the directory where `autoconf' looks for the
  280. installed macro files by setting the `AC_MACRODIR' environment variable
  281. to a different directory.  You can also give `autoconf' the
  282. `--macrodir' option, which overrides `AC_MACRODIR'.
  283.    `autoconf' also accepts the options `--version', which prints the
  284. Autoconf version number and exits, and `--help', which prints a summary
  285. of the command-line options and exits.
  286. File: autoconf.info,  Node: Invoking autoheader,  Prev: Invoking autoconf,  Up: Making configure Scripts
  287. Invoking `autoheader'
  288. =====================
  289.    You can use the `autoheader' program to create a template file of C
  290. `#define' statements for `configure' to use.  By default, the file that
  291. `autoheader' creates is called `config.h.in'; if `configure.in' invokes
  292. `AC_CONFIG_HEADER(FILE)', `autoheader' creates `FILE.in'.
  293.    `autoheader' scans `configure.in' and figures out which C
  294. preprocessor symbols it might define.  It copies comments and `#define'
  295. and `#undef' statements from a file called `acconfig.h', which comes
  296. with and is installed with Autoconf.  It also uses a file called
  297. `acconfig.h' in the current directory, if present; you must create that
  298. file to contain entries for any additional symbols that you
  299. `AC_DEFINE'.  For symbols defined by `AC_HAVE_HEADERS',
  300. `AC_HAVE_FUNCS', `AC_SIZEOF_TYPE', or `AC_HAVE_LIBRARY', `autoheader'
  301. generates comments and `#undef' statements itself rather than copying
  302. them from a file, since the possible symbols are effectively limitless.
  303.    The file that `autoheader' creates usually contains only `#define'
  304. and `#undef' statements and their accompanying comments.  However, if a
  305. file called `FILE.top' (typically `config.h.top') exists in the current
  306. directory, `autoheader' copies that file to the beginning of its output.
  307.    If you give `autoheader' an argument, it uses that file instead of
  308. `configure.in' and writes the header file to the standard output
  309. instead of to `config.h.in'.  If you give `autoheader' an argument of
  310. `-', it reads the standard input instead of `configure.in' and writes
  311. the header file to the standard output.
  312.    You can override the directory where `autoheader' looks for the
  313. installed macro and `acconfig.h' files by setting the `AC_MACRODIR'
  314. environment variable to a different directory.  You can also give
  315. `autoheader' the `--macrodir' option, which overrides `AC_MACRODIR'.
  316.    `autoheader' also accepts the options `--version', which prints the
  317. Autoconf version number and exits, and `--help', which prints a summary
  318. of the command-line options and exits.
  319. File: autoconf.info,  Node: Specific Tests,  Next: General Purpose Macros,  Prev: Making configure Scripts,  Up: Top
  320. Specific Tests
  321. **************
  322.    These macros test for particular operating system features that
  323. packages might need or want to use.  If you need to test for a feature
  324. that none of these macros check for, you can probably do it by calling
  325. one of the general purpose test macros with appropriate arguments
  326. (*note General Feature Tests::.).
  327.    All of these macros that set `make' variables call `AC_SUBST' on
  328. those variables (*note Setting Variables::., for details about
  329. `AC_SUBST').  The phrase "define NAME" is used below as a shorthand to
  330. mean either add `-DNAME=1' to the `make' variable `DEFS', or put
  331. `#define NAME 1' in the configuration header file, depending on whether
  332. `AC_CONFIG_HEADER' has been called.  *Note Setting Variables::, for
  333. more information.
  334.    Within each section below, the macros are listed in alphabetical
  335. order.  The macros are generally named for the `make' variables or C
  336. preprocessor macros that they define; those names are based largely on
  337. what existing GNU programs use.  These macros are defined in the file
  338. `acspecific.m4'.
  339. * Menu:
  340. * Alternative Programs::    Selecting between alternative programs.
  341. * Header Files::        Header files that might be missing.
  342. * Typedefs::            `typedef's that might be missing.
  343. * Library Functions::        C library functions that might be missing.
  344. * Structures::            Structures or members that might be missing.
  345. * Compiler Characteristics::    C compiler or machine architecture features.
  346. * System Services::        Operating system services.
  347. * UNIX Variants::        Special cases for specific UNIX variants.
  348. File: autoconf.info,  Node: Alternative Programs,  Next: Header Files,  Up: Specific Tests
  349. Alternative Programs
  350. ====================
  351.    The following macros check for the presence or behavior of particular
  352. programs:
  353.  - Macro: AC_GCC_TRADITIONAL
  354.      Add `-traditional' to `make' variable `CC' if using the GNU C
  355.      compiler and `ioctl' does not work properly without
  356.      `-traditional'.  This macro calls `AC_PROG_CC' and `AC_PROG_CPP'
  357.      if they haven't been called already.
  358.  - Macro: AC_LN_S
  359.      If `ln -s' works on the current filesystem (the O.S. and filesystem
  360.      support symbolic links), set shell and `make' variable `LN_S' to
  361.      `ln -s', otherwise set it to `ln'.
  362.  - Macro: AC_MINUS_C_MINUS_O
  363.      If the C compiler does not accept the `-c' and `-o' options
  364.      simultaneously, define `NO_MINUS_C_MINUS_O'.
  365.  - Macro: AC_PROG_AWK
  366.      Check for `mawk', `gawk', `nawk', and `awk', in that order, and
  367.      set `make' variable `AWK' to the first one that it finds.
  368.  - Macro: AC_PROG_CC
  369.      If `gcc' is found, set `make' variable `CC' to `gcc', and set
  370.      shell variable `GCC' to 1 for use by macros such as
  371.      `AC_GCC_TRADITIONAL'.
  372.  - Macro: AC_PROG_CPP
  373.      Set shell and `make' variable `CPP' to a command that runs the C
  374.      preprocessor.  If `$CC -E' doesn't work, it uses `/lib/cpp'.  It
  375.      is only portable to run `CPP' on files with a `.c' extension.
  376.      If the current language is C (*note Language Choice::.), many of
  377.      the specific test macros use the value of `CPP' indirectly by
  378.      calling `AC_TEST_CPP', `AC_HEADER_CHECK', `AC_HEADER_EGREP', or
  379.      `AC_PROGRAM_EGREP'.  Those macros call this macro first if it
  380.      hasn't been called already.  It calls `AC_PROG_CC' if it hasn't
  381.      been called already.
  382.  - Macro: AC_PROG_CXX
  383.      Determine a C++ compiler to use.  Check if the environment variable
  384.      CXX or CCC (in that order) is set; if so, set `make' variable
  385.      `CXX' to its value.  Otherwise search for a C++ compiler under
  386.      likely names (`c++', `g++', `gcc', and `CC').  If none of those
  387.      checks succeed, as a last resort set `CXX' to `gcc'.
  388.  - Macro: AC_PROG_CXXCPP
  389.      Set shell and `make' variable `CXXCPP' to a command that runs the
  390.      C++ preprocessor.  If `$CXX -E' doesn't work, it uses `/lib/cpp'.
  391.      It is only portable to run `CXXCPP' on files with a `.C' or `.cc'
  392.      extension.
  393.      If the current language is C++ (*note Language Choice::.), many of
  394.      the specific test macros use the value of `CXXCPP' indirectly by
  395.      calling `AC_TEST_CPP', `AC_HEADER_CHECK', `AC_HEADER_EGREP', or
  396.      `AC_PROGRAM_EGREP'.  Those macros call this macro first if it
  397.      hasn't been called already.  This macro calls `AC_PROG_CXX' if it
  398.      hasn't been called already.
  399.  - Macro: AC_PROG_INSTALL
  400.      Set `make' variable `INSTALL' to `install -c' if `install' is
  401.      found and is compatible with the BSD and GNU versions.  Otherwise,
  402.      set `INSTALL' to `DIR/install.sh -c', where it checks for
  403.      `install.sh' in the directories `$srcdir', `$srcdir/..', and
  404.      `$srcdir/../..' to determine DIR.
  405.      This macro screens out the false matches `/etc/install',
  406.      `/usr/sbin/install', and other instances of `install' known not to
  407.      work.  It also sets the variable `INSTALL_PROGRAM' to `${INSTALL}'
  408.      and `INSTALL_DATA' to `${INSTALL} -m 644'.
  409.      If you need to use your own `install.sh' because it has features
  410.      not found in standard `install' programs, there is no reason to use
  411.      `AC_PROG_INSTALL'; just put the pathname of your script into your
  412.      `Makefile.in' files.
  413.  - Macro: AC_PROG_LEX
  414.      If `flex' is found, set `make' variable `LEX' to `flex' and
  415.      `LEXLIB' to `-lfl', if that library is in a standard place.
  416.      Otherwise set `LEX' to `lex' and `LEXLIB' to `-ll'.
  417.  - Macro: AC_PROG_RANLIB
  418.      Set `make' variable `RANLIB' to `ranlib' if `ranlib' is found,
  419.      otherwise to `:' (do nothing).
  420.  - Macro: AC_PROG_YACC
  421.      If `bison' is found, set `make' variable `YACC' to `bison -y'.
  422.      Otherwise, if `byacc' is found, set `YACC' to `byacc'.  Otherwise
  423.      set `YACC' to `yacc'.
  424.  - Macro: AC_RSH
  425.      If a remote shell is available, put `rtapelib.o' in `make'
  426.      variable `RTAPELIB'.  Otherwise, also do so if `netdb.h' exists
  427.      (implying the `rexec' function), and in addition define
  428.      `HAVE_NETDB_H'.  If neither a remote shell nor `rexec' is
  429.      available, define `NO_REMOTE'.
  430.  - Macro: AC_SET_MAKE
  431.      If `make' predefines the variable `MAKE', define `make' variable
  432.      `SET_MAKE' to be empty.  Otherwise, define `SET_MAKE' to contain
  433.      `MAKE=make'.  Calls `AC_SUBST' for `SET_MAKE'.
  434.      In recent versions of `make', the variable `MAKE' contains the
  435.      name of the `make' program plus options it was given.  It is used
  436.      when running `make' recursively in subdirectories.  But some old
  437.      versions of `make' don't set the `MAKE' variable.  This macro
  438.      allows use of `MAKE' on all systems.
  439.      If you use this macro, simply place a line like this in your
  440.      `Makefile.in' file(s):
  441.           @SET_MAKE@
  442.  - Macro: AC_YYTEXT_POINTER
  443.      Define `YYTEXT_POINTER' if `yytext' is a `char *' instead of a
  444.      `char []'.  This depends on whether `lex' or `flex' is being used.
  445.      This macro calls `AC_PROG_CPP' (or `AC_PROG_CXXCPP' if C++ is the
  446.      current language, *note Language Choice::.) and `AC_PROG_LEX' if
  447.      they haven't been called already.
  448.      This macro replaces `AC_DECLARE_YYTEXT', which didn't work.
  449. File: autoconf.info,  Node: Header Files,  Next: Typedefs,  Prev: Alternative Programs,  Up: Specific Tests
  450. Header Files
  451. ============
  452.    The following macros check for the presence of certain C header
  453. files:
  454.  - Macro: AC_DIR_HEADER
  455.      If the system has `dirent.h', define `DIRENT'; otherwise, if it
  456.      has `sys/ndir.h', define `SYSNDIR'; otherwise, if it has
  457.      `sys/dir.h', define `SYSDIR'; otherwise, if it has `ndir.h',
  458.      define `NDIR'.  Also, if the directory library header file
  459.      contains a declaration of the `closedir' function with a `void'
  460.      return type, define `VOID_CLOSEDIR'.
  461.      The directory library declarations in the source code should look
  462.      something like the following, which assumes that you have also
  463.      called `AC_HAVE_HEADERS(unistd.h)':
  464.           #ifdef HAVE_UNISTD_H
  465.           #include <sys/types.h>
  466.           #include <unistd.h>
  467.           #endif
  468.           
  469.           /* unistd.h defines _POSIX_VERSION on POSIX.1 systems.  */
  470.           #if defined(DIRENT) || defined(_POSIX_VERSION)
  471.           #include <dirent.h>
  472.           #define NLENGTH(dirent) (strlen((dirent)->d_name))
  473.           #else /* not (DIRENT or _POSIX_VERSION) */
  474.           #define dirent direct
  475.           #define NLENGTH(dirent) ((dirent)->d_namlen)
  476.           #ifdef SYSNDIR
  477.           #include <sys/ndir.h>
  478.           #endif /* SYSNDIR */
  479.           #ifdef SYSDIR
  480.           #include <sys/dir.h>
  481.           #endif /* SYSDIR */
  482.           #ifdef NDIR
  483.           #include <ndir.h>
  484.           #endif /* NDIR */
  485.           #endif /* not (DIRENT or _POSIX_VERSION) */
  486.      Using the above declarations, the program would declare variables
  487.      to be type `struct dirent', not `struct direct', and would access
  488.      the length of a directory entry name by passing a pointer to a
  489.      `struct dirent' to the `NLENGTH' macro.
  490.  - Macro: AC_MAJOR_HEADER
  491.      If `sys/types.h' does not define `major', `minor', and `makedev',
  492.      but `sys/mkdev.h' does, define `MAJOR_IN_MKDEV'; otherwise, if
  493.      `sys/sysmacros.h' does, define `MAJOR_IN_SYSMACROS'.
  494.  - Macro: AC_MEMORY_H
  495.      Define `NEED_MEMORY_H' if `memcpy', `memcmp', etc. are not
  496.      declared in `string.h' and `memory.h' exists.  This macro is
  497.      obsolete; instead, use `AC_HAVE_HEADERS(memory.h)'.  See the
  498.      example for `AC_STDC_HEADERS'.
  499.  - Macro: AC_STDC_HEADERS
  500.      Define `STDC_HEADERS' if the system has ANSI C header files.
  501.      Specifically, this macro checks for `stdlib.h', `stdarg.h',
  502.      `string.h', and `float.h'; if the system has those, it probably
  503.      has the rest of the ANSI C header files.  This macro also checks
  504.      whether `string.h' declares `memchr' (and thus presumably the
  505.      other `mem' functions), whether `stdlib.h' declare `free' (and
  506.      thus presumably `malloc' and other related functions), and whether
  507.      the `ctype.h' macros work on characters with the high bit set, as
  508.      ANSI C requires.
  509.      Use `STDC_HEADERS' instead of `__STDC__' to determine whether the
  510.      system has ANSI-compliant header files (and probably C library
  511.      functions) because many systems that have GCC do not have ANSI C
  512.      header files.
  513.      To check whether to use the System V/ANSI C string functions and
  514.      header file, you can put the following in `configure.in':
  515.           AC_STDC_HEADERS
  516.           AC_HAVE_HEADERS(string.h memory.h)
  517.      Then, in the code, use a test like this:
  518.           #if STDC_HEADERS || HAVE_STRING_H
  519.           #include <string.h>
  520.           /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
  521.           #if !STDC_HEADERS && HAVE_MEMORY_H
  522.           #include <memory.h>
  523.           #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
  524.           #define index strchr
  525.           #define rindex strrchr
  526.           #define bcopy(s, d, n) memcpy ((d), (s), (n))
  527.           #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
  528.           #define bzero(s, n) memset ((s), 0, (n))
  529.           #else /* not STDC_HEADERS and not HAVE_STRING_H */
  530.           #include <strings.h>
  531.           /* memory.h and strings.h conflict on some systems.  */
  532.           #endif /* not STDC_HEADERS and not HAVE_STRING_H */
  533.      This example asssumes that your code uses the BSD style functions.
  534.      If you use the System V/ANSI C style functions, you will need to
  535.      replace the macro definitions with ones that go in the other
  536.      direction.
  537.      This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
  538.      which language is current, *note Language Choice::.), if it hasn't
  539.      been called already.
  540.  - Macro: AC_UNISTD_H
  541.      Define `HAVE_UNISTD_H' if the system has `unistd.h'.  This macro
  542.      is obsolete; instead, use `AC_HAVE_HEADERS(unistd.h)'.
  543.      The way to check if the system supports POSIX.1 is:
  544.           #if HAVE_UNISTD_H
  545.           #include <sys/types.h>
  546.           #include <unistd.h>
  547.           #endif
  548.           
  549.           #ifdef _POSIX_VERSION
  550.           /* Code for POSIX.1 systems.  */
  551.           #endif
  552.      `_POSIX_VERSION' is defined when `unistd.h' is included on POSIX.1
  553.      systems.  If there is no `unistd.h', it is definitely not a
  554.      POSIX.1 system.  However, some non-POSIX.1 systems do have
  555.      `unistd.h'.
  556.  - Macro: AC_USG
  557.      Define `USG' if the system does not have `strings.h', `rindex',
  558.      `bzero', etc.  This implies that it has `string.h', `strrchr',
  559.      `memset', etc.
  560.      The symbol `USG' is obsolete.  Instead of this macro, use
  561.      `AC_HAVE_HEADERS(string.h)' and use `HAVE_STRING_H' in your code.
  562.      See the example for `AC_STDC_HEADERS'.
  563.  - Macro: AC_SYS_SIGLIST_DECLARED
  564.      Define `SYS_SIGLIST_DECLARED' if the variable `sys_siglist' is
  565.      declared in a system header file, either `signal.h' or `unistd.h'.
  566. File: autoconf.info,  Node: Typedefs,  Next: Library Functions,  Prev: Header Files,  Up: Specific Tests
  567. Typedefs
  568. ========
  569.    The following macros check for predefined C types:
  570.  - Macro: AC_GETGROUPS_T
  571.      Define `GETGROUPS_T' to be whichever of `gid_t' or `int' is the
  572.      base type of the array argument to `getgroups'.
  573.  - Macro: AC_MODE_T
  574.      If `mode_t' is not defined in `sys/types.h', define `mode_t' to be
  575.      `int'.
  576.  - Macro: AC_OFF_T
  577.      If `off_t' is not defined in `sys/types.h', define `off_t' to be
  578.      `long'.
  579.  - Macro: AC_PID_T
  580.      If `pid_t' is not defined in `sys/types.h', define `pid_t' to be
  581.      `int'.
  582.  - Macro: AC_RETSIGTYPE
  583.      If `signal.h' declares `signal' as returning a pointer to a
  584.      function returning `void', define `RETSIGTYPE' to be `void';
  585.      otherwise, define it to be `int'.
  586.      Define signal handlers as returning type `RETSIGTYPE':
  587.           RETSIGTYPE
  588.           hup_handler ()
  589.           {
  590.           ...
  591.           }
  592.  - Macro: AC_SIZE_T
  593.      If `size_t' is not defined in `sys/types.h', define `size_t' to be
  594.      `unsigned'.
  595.  - Macro: AC_UID_T
  596.      If `uid_t' is not defined in `sys/types.h', define `uid_t' to be
  597.      `int' and `gid_t' to be `int'.
  598. File: autoconf.info,  Node: Library Functions,  Next: Structures,  Prev: Typedefs,  Up: Specific Tests
  599. Library Functions
  600. =================
  601.    The following macros check for particular C library functions:
  602.  - Macro: AC_ALLOCA
  603.      Check how to get `alloca'.  Tries to get a builtin version by
  604.      checking for `alloca.h' or the predefined C preprocessor macros
  605.      `__GNUC__' and `_AIX'.  If that fails, it looks for a function in
  606.      the standard C library.  If that fails, it sets the `make'
  607.      variable `ALLOCA' to `alloca.o' and defines `C_ALLOCA' (so
  608.      programs can periodically call `alloca(0)' to garbage collect).
  609.      This variable is separate from `LIBOBJS' so multiple programs can
  610.      share the value of `ALLOCA' without needing to create an actual
  611.      library, in case only some of them use the code in `LIBOBJS'.
  612.      If this macro finds `alloca.h', it defines `HAVE_ALLOCA_H'.
  613.      This macro does not try to get `alloca' from the SVR3 `libPW' or
  614.      the SVR4 `libucb' because those libraries contain some
  615.      incompatible functions that cause trouble.  Some versions do not
  616.      even contain `alloca' or contain a buggy version.  If you still
  617.      want to use their `alloca', use `ar' to extract `alloca.o' from
  618.      them instead of compiling `alloca.c'.
  619.      Source files that use `alloca' should start with a piece of code
  620.      like the following, to declare it properly.  Note that in some
  621.      versions of AIX, the declaration of `alloca' must precede
  622.      everything else except for comments and preprocessor directives.
  623.      The `#pragma' directive is indented so that pre-ANSI C compilers
  624.      will ignore it, rather than choke on it.
  625.           /* AIX requires this to be the first thing in the file.  */
  626.           #ifdef __GNUC__
  627.           #define alloca __builtin_alloca
  628.           #else /* not __GNUC__ */
  629.           #if HAVE_ALLOCA_H
  630.           #include <alloca.h>
  631.           #else /* not HAVE_ALLOCA_H */
  632.           #ifdef _AIX
  633.            #pragma alloca
  634.           #else /* not _AIX */
  635.           char *alloca ();
  636.           #endif /* not _AIX */
  637.           #endif /* not HAVE_ALLOCA_H */
  638.           #endif /* not __GNUC__ */
  639.  - Macro: AC_GETLOADAVG
  640.      Check how to get the system load averages.  If the system has the
  641.      `getloadavg' function, this macro defines `HAVE_GETLOADAVG', and
  642.      adds to `LIBS' any libraries needed to get that function.
  643.      Otherwise, it adds `getloadavg.o' to the `make' variable
  644.      `LIBOBJS', and possibly defines several other C preprocessor
  645.      macros and `make' variables:
  646.        1. It defines `SVR4', `DGUX', `UMAX', or `UMAX4_3' if on those
  647.           systems.
  648.        2. If it finds `nlist.h', it defines `NLIST_STRUCT'.
  649.        3. If `struct nlist' has an `n_un' member, it defines
  650.           `NLIST_NAME_UNION'.
  651.        4. If compiling `getloadavg.c' defines `LDAV_PRIVILEGED',
  652.           programs need to be installed specially on this system for
  653.           `getloadavg' to work, and this macro defines
  654.           `GETLOADAVG_PRIVILEGED'.
  655.        5. This macro always defines `NEED_SETGID', for `make'.  The
  656.           value is `true' if special installation is required, `false'
  657.           if not.  If `NEED_SETGID' is `true', it sets `KMEM_GROUP' to
  658.           the name of the group that should own the installed program.
  659.  - Macro: AC_MMAP
  660.      If the `mmap' function exists and works correctly, define
  661.      `HAVE_MMAP'.
  662.  - Macro: AC_SETVBUF_REVERSED
  663.      If `setvbuf' takes the buffering type as its second argument and
  664.      the buffer pointer as the third, instead of the other way around,
  665.      define `SETVBUF_REVERSED'.  This is the case on System V before
  666.      release 3.
  667.  - Macro: AC_STRCOLL
  668.      If the `strcoll' function exists and works correctly, define
  669.      `HAVE_STRCOLL'.  This does a bit more than
  670.      `AC_HAVE_FUNCS(strcoll)', because some systems have incorrect
  671.      definitions of `strcoll', which should not be used.
  672.  - Macro: AC_UTIME_NULL
  673.      If `utime(FILE, NULL)' sets FILE's timestamp to the present,
  674.      define `HAVE_UTIME_NULL'.
  675.  - Macro: AC_VFORK
  676.      If `vfork.h' is found, define `HAVE_VFORK_H'.  If a working
  677.      `vfork' is not found, define `vfork' to be `fork'.  This macro
  678.      checks for several known errors in implementations of `vfork' and
  679.      considers the system to not have a working `vfork' if it detects
  680.      any of them.
  681.  - Macro: AC_VPRINTF
  682.      If `vprintf' is found, define `HAVE_VPRINTF'.  Otherwise, if
  683.      `_doprnt' is found, define `HAVE_DOPRNT'.  (If `vprintf' is
  684.      available, you may assume that `vfprintf' and `vsprintf' are also
  685.      available.)
  686.  - Macro: AC_WAIT3
  687.      If `wait3' is found and fills in the contents of its third argument
  688.      (a `struct rusage *'), which HP-UX does not do, define
  689.      `HAVE_WAIT3'.
  690. File: autoconf.info,  Node: Structures,  Next: Compiler Characteristics,  Prev: Library Functions,  Up: Specific Tests
  691. Structures
  692. ==========
  693.    The following macros check for certain structures or structure
  694. members:
  695.  - Macro: AC_STAT_MACROS_BROKEN
  696.      If the macros `S_ISDIR', `S_ISREG' et al. defined in `sys/stat.h'
  697.      do not work properly (returning false positives), define
  698.      `STAT_MACROS_BROKEN'.  This is the case on Tektronix UTekV, Amdahl
  699.      UTS and Motorola System V/88.
  700.  - Macro: AC_ST_BLKSIZE
  701.      If `struct stat' contains an `st_blksize' member, define
  702.      `HAVE_ST_BLKSIZE'.
  703.  - Macro: AC_ST_BLOCKS
  704.      If `struct stat' contains an `st_blocks' member, define
  705.      `HAVE_ST_BLOCKS'.  Otherwise, add `fileblocks.o' to the `make'
  706.      variable `LIBOBJS'.
  707.  - Macro: AC_ST_RDEV
  708.      If `struct stat' contains an `st_rdev' member, define
  709.      `HAVE_ST_RDEV'.
  710.  - Macro: AC_TIME_WITH_SYS_TIME
  711.      If a program may include both `time.h' and `sys/time.h', define
  712.      `TIME_WITH_SYS_TIME'.  On some older systems, `sys/time.h'
  713.      includes `time.h', but `time.h' is not protected against multiple
  714.      inclusion, so programs should not explicitly include both files.
  715.      This macro is useful in programs that use, for example, `struct
  716.      timeval' or `struct timezone' as well as `struct tm'.  It is best
  717.      used in conjunction with `HAVE_SYS_TIME_H'.
  718.           #ifdef TIME_WITH_SYS_TIME
  719.           #include <sys/time.h>
  720.           #include <time.h>
  721.           #else
  722.           #ifdef HAVE_SYS_TIME_H
  723.           #include <sys/time.h>
  724.           #else
  725.           #include <time.h>
  726.           #endif
  727.           #endif
  728.  - Macro: AC_STRUCT_TM
  729.      If `time.h' does not define `struct tm', define `TM_IN_SYS_TIME',
  730.      which means that including `sys/time.h' defines `struct tm'.
  731.  - Macro: AC_TIMEZONE
  732.      Figure out how to get the current timezone.  If `struct tm' has a
  733.      `tm_zone' member, define `HAVE_TM_ZONE'.  Otherwise, if the
  734.      external array `tzname' is found, define `HAVE_TZNAME'.  This
  735.      macro calls `AC_STRUCT_TM' if it hasn't been called already.
  736. File: autoconf.info,  Node: Compiler Characteristics,  Next: System Services,  Prev: Structures,  Up: Specific Tests
  737. Compiler Characteristics
  738. ========================
  739.    The following macros check for C compiler or machine architecture
  740. features:
  741.  - Macro: AC_ARG_ARRAY
  742.      If the address of an argument to a C function can not be used like
  743.      the start of an array, define `NO_ARG_ARRAY'.  This ability allows
  744.      a sequence of arguments with the same type to be accessed as if
  745.      they were an array of values.
  746.  - Macro: AC_CROSS_CHECK
  747.      If the C compiler being used does not produce executables that can
  748.      run on the system where `configure' is being run, set the shell
  749.      variable `cross_compiling' to 1.  This information can be used by
  750.      `AC_TEST_PROGRAM' to determine whether to take a default action
  751.      instead of trying to run a test program (*note General Feature
  752.      Tests::.).
  753.  - Macro: AC_CHAR_UNSIGNED
  754.      If the C type `char' is unsigned, define `__CHAR_UNSIGNED__',
  755.      unless the C compiler predefines it.
  756.  - Macro: AC_CONST
  757.      If the C compiler does not fully support the keyword `const',
  758.      define `const' to be empty.  Some C compilers that do not define
  759.      `__STDC__' do support `const'; some compilers that define
  760.      `__STDC__' do not completely support `const'.  Programs can simply
  761.      use `const' as if every C compiler supported it; for those that
  762.      don't, the `Makefile' or configuration header file will define it
  763.      as empty.  (If using a configuration header file, the program
  764.      should include it before any other header files, to prevent
  765.      inconsistencies in declarations.)
  766.  - Macro: AC_INLINE
  767.      If the C compiler is a version of GCC that supports the keyword
  768.      `__inline' but not `inline' (such as some NeXT versions), define
  769.      `inline' to be `__inline'.  This macro calls `AC_PROG_CC' if it
  770.      hasn't been called already.
  771.  - Macro: AC_INT_16_BITS
  772.      If the C type `int' is 16 bits wide, define `INT_16_BITS'.  This
  773.      macro is obsolete; it is more general to use `AC_SIZEOF_TYPE(int)'
  774.      instead (*note General Feature Tests::.).
  775.  - Macro: AC_LONG_64_BITS
  776.      If the C type `long int' is 64 bits wide, define `LONG_64_BITS'.
  777.      This macro is obsolete; it is more general to use
  778.      `AC_SIZEOF_TYPE(long)' instead (*note General Feature Tests::.).
  779.  - Macro: AC_LONG_DOUBLE
  780.      If the C compiler supports the `long double' type, define
  781.      `HAVE_LONG_DOUBLE'.  Some C compilers that do not define
  782.      `__STDC__' do support the `long double' type; some compilers that
  783.      define `__STDC__' do not support `long double'.
  784.  - Macro: AC_WORDS_BIGENDIAN
  785.      If words are stored with the most significant byte first (like
  786.      Motorola and SPARC, but not Intel and VAX, CPUs), define
  787.      `WORDS_BIGENDIAN'.
  788. File: autoconf.info,  Node: System Services,  Next: UNIX Variants,  Prev: Compiler Characteristics,  Up: Specific Tests
  789. System Services
  790. ===============
  791.    The following macros check for operating system services:
  792.  - Macro: AC_FIND_X
  793.      Try to locate the X Window System include files and libraries.  Try
  794.      first by running `xmkmf' on a trivial `Imakefile' and examining
  795.      the `Makefile' that it produces.  If that fails (such as if
  796.      `xmkmf' is not present), look for them in several directories
  797.      where they often reside.  If either method is successful, set the
  798.      shell variables `x_includes' and `x_libraries' to their locations,
  799.      unless they are in directories the compiler searches by default.
  800.      If both methods fail, or the user gave the command line option
  801.      `--without-x', set the shell variable `no_x' to `true'; otherwise
  802.      set it to the empty string.
  803.      The command line options `--x-includes=DIR' and
  804.      `--x-libraries=DIR' override the values chosen by this macro.
  805.  - Macro: AC_FIND_XTRA
  806.      An enhanced version of `AC_FIND_X'.  Put the C compiler flags that
  807.      X needs into `make' variable `X_CFLAGS', and the X linker flags
  808.      into `X_LIBS'.  If X is not available, put `-DX_DISPLAY_MISSING'
  809.      into `X_CFLAGS'.
  810.      Also check for special libraries that some systems need in order to
  811.      compile X programs.  Add any that the system needs to `make'
  812.      variable `X_EXTRA_LIBS'.  This macro calls `AC_FIND_X' and
  813.      `AC_ISC_POSIX' (*note UNIX Variants::.) if they have not already
  814.      been called.  Because of the macro dependencies, if you call this
  815.      macro, you should let it call `AC_FIND_X' rather than doing that
  816.      yourself.
  817.  - Macro: AC_HAVE_POUNDBANG (ACTION-IF-SUPPORTED [,
  818.           ACTION-IF-NOT-SUPPORTED])
  819.      Check whether the system supports starting shell scripts with a
  820.      line of the form `#!/bin/csh' to select the shell to use.  If `#!'
  821.      works, execute shell commands ACTION-IF-SUPPORTED; if not, execute
  822.      ACTION-IF-NOT-SUPPORTED.
  823.  - Macro: AC_LONG_FILE_NAMES
  824.      If the system supports file names longer than 14 characters, define
  825.      `HAVE_LONG_FILE_NAMES'.
  826.  - Macro: AC_REMOTE_TAPE
  827.      If BSD tape drive ioctls are available, define `HAVE_SYS_MTIO_H',
  828.      and if sockets are available add `rmt' to `make' variable `PROGS'.
  829.  - Macro: AC_RESTARTABLE_SYSCALLS
  830.      If the system automatically restarts a system call that is
  831.      interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
  832. File: autoconf.info,  Node: UNIX Variants,  Prev: System Services,  Up: Specific Tests
  833. UNIX Variants
  834. =============
  835.    The following macros check for certain operating systems that need
  836. special treatment for some programs, due to exceptional oddities in
  837. their header files or libraries:
  838.  - Macro: AC_AIX
  839.      If on AIX, define `_ALL_SOURCE'.  Allows the use of some BSD
  840.      functions.  Should be called before any macros that run the C
  841.      compiler.
  842.  - Macro: AC_DYNIX_SEQ
  843.      If on DYNIX/ptx (Sequent UNIX), add `-lseq' to `make' variable
  844.      `LIBS'.  Allows use of some BSD system calls and `getmntent'.
  845.  - Macro: AC_IRIX_SUN
  846.      If on IRIX (Silicon Graphics UNIX), add `-lsun' to `make' variable
  847.      `LIBS'.  Needed to get `getmntent'.  At sites using Yellow
  848.      Pages/NIS, it is also needed to get properly working `gethostby*',
  849.      `getpw*', `getgr*', `getnetby*', and so on.
  850.  - Macro: AC_ISC_POSIX
  851.      If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add
  852.      `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers)
  853.      to `make' variable `CC'.  This allows the use of POSIX facilities.
  854.      Must be called after `AC_PROG_CC' and before any other macros
  855.      that run the C compiler.
  856.  - Macro: AC_MINIX
  857.      If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define
  858.      `_POSIX_1_SOURCE' to be 2.  This allows the use of POSIX
  859.      facilities.  Should be called before any macros that run the C
  860.      compiler.
  861.  - Macro: AC_SCO_INTL
  862.      If on SCO UNIX, add `-lintl' to `make' variable `LIBS'.  Used to
  863.      get `strftime'.  It must be called before checking for `strftime'.
  864.  - Macro: AC_XENIX_DIR
  865.      If on Xenix, define `VOID_CLOSEDIR' and add `-lx' to `make'
  866.      variable `LIBS'.  Also, if `sys/ndir.h' is not being used, add
  867.      `-ldir' to `LIBS'.  Needed when using the directory reading
  868.      functions.  This macro must be called after `AC_DIR_HEADER'.
  869. File: autoconf.info,  Node: General Purpose Macros,  Next: Writing Macros,  Prev: Specific Tests,  Up: Top
  870. General Purpose Macros
  871. **********************
  872.    These macros provide ways for other macros to control the kind of
  873. output that Autoconf produces or to check whether various kinds of
  874. features are available.  They all take arguments.  When calling these
  875. macros, there must not be any blank space between the macro name and
  876. the open parentheses.
  877.    Arguments to these macros can be more than one line long if they are
  878. enclosed within the `m4' quote characters `[' and `]'.
  879.    Within each section below, the macros are listed in alphabetical
  880. order.  These macros are defined in the file `acgeneral.m4'.
  881. * Menu:
  882. * Setup::            Controlling Autoconf operation.
  883. * General Feature Tests::    Checking for kinds of features.
  884. * Command Line::                Checking command line arguments.
  885. * Setting Variables::        Setting shell and `make' variables.
  886. * Printing Messages::           Notifying users of progress or problems.
  887. * Language Choice::             Selecting which language to use for testing.
  888. * Macro Ordering::        Enforcing ordering constraints.
  889. File: autoconf.info,  Node: Setup,  Next: General Feature Tests,  Up: General Purpose Macros
  890. Controlling Autoconf Setup
  891. ==========================
  892.    The following macros control the kind of output that Autoconf
  893. produces.
  894.  - Macro: AC_CONFIG_HEADER (HEADER-TO-CREATE ...)
  895.      Make `AC_OUTPUT' create the file(s) in the whitespace-separated
  896.      list HEADER-TO-CREATE containing C preprocessor `#define'
  897.      statements and replace `@DEFS@' in generated files with
  898.      `-DHAVE_CONFIG_H' instead of the value of `DEFS'.  This macro
  899.      should be called right after `AC_INIT'.  The usual name for
  900.      HEADER-TO-CREATE is `config.h'.
  901.      If HEADER-TO-CREATE already exists and its contents are identical
  902.      to what `AC_OUTPUT' would put in it, it is left alone.  Doing this
  903.      allows some changes in configuration without needlessly causing
  904.      object files that depend on the header file to be recompiled.
  905.      Your distribution should contain a file `HEADER-TO-CREATE.in' that
  906.      looks as you want the final header file to look, including
  907.      comments, with default values in the `#define' statements.  A
  908.      default value can be to `#undef' the variable instead of to define
  909.      it to a value, if your code tests for configuration options using
  910.      `#ifdef' instead of `#if'.
  911.      You can use the program `autoheader' to create
  912.      `HEADER-TO-CREATE.in' (*note Invoking autoheader::.).
  913.  - Macro: AC_INIT (UNIQUE-FILE-IN-SOURCE-DIR)
  914.      Process the command-line arguments and find the source code
  915.      directory.  UNIQUE-FILE-IN-SOURCE-DIR is some file that is in the
  916.      package's source directory; `configure' checks for this file's
  917.      existence to make sure that the directory that it is told contains
  918.      the source code in fact does (*note Invoking configure::., for
  919.      more information).
  920.  - Macro: AC_OUTPUT ([FILE...] [,EXTRA-CMDS])
  921.      Create output files (typically one or more `Makefile's) and
  922.      `config.status'.  If `AC_CONFIG_HEADER' has been called, also
  923.      create the header file that was named as its argument.  The
  924.      argument is a whitespace-separated list of files to create; if it
  925.      is omitted, no files are created.  `AC_OUTPUT' creates each file
  926.      `FILE' in the list by copying `FILE.in', substituting the variable
  927.      values that have been selected by calling `AC_SUBST'.  It creates
  928.      the directory that each file is in if it doesn't exist (but not the
  929.      parents of that directory).  A plausible value for the argument to
  930.      `AC_OUTPUT' is `Makefile src/Makefile man/Makefile X/Imakefile'.
  931.      If you pass EXTRA-CMDS, those commands will be inserted into
  932.      `config.status' to be run after all its other processing.
  933.  - Macro: AC_PREPARE (UNIQUE-FILE-IN-SOURCE-DIR)
  934.      Find the source code directory and set up shell variables
  935.      necessary for other Autoconf macros to work.
  936.      uNIQUE-FILE-IN-SOURCE-DIR is some file that is in the package's
  937.      source directory; `configure' checks for this file's existence to
  938.      make sure that the directory that it is told contains the source
  939.      code in fact does (*note Invoking configure::., for more
  940.      information).  `AC_PREPARE' is the last thing done by `AC_INIT'.
  941.      Use `AC_PREPARE' instead of `AC_INIT' if you want to do argument
  942.      parsing yourself; never use both.
  943.  - Macro: AC_PREREQ (VERSION)
  944.      Ensure that a recent enough version of Autoconf is being used.  If
  945.      the version of Autoconf being used to create `configure' is earlier
  946.      than VERSION (e.g., `1.8'), print an error message on the standard
  947.      error output and do not create `configure'.
  948.      This macro is useful if your `configure.in' relies on non-obvious
  949.      behavior that changed between Autoconf releases.  If it merely
  950.      needs recently added macros, then `AC_PREREQ' is less useful,
  951.      because the `autoconf' program already tells the user which macros
  952.      are not found.  The same thing happens if `configure.in' is
  953.      processed by a version of Autoconf older than when `AC_PREREQ' was
  954.      added.
  955.  - Macro: AC_REVISION (REVISION-INFO)
  956.      Copy revision stamp REVISION-INFO into the `configure' script,
  957.      with any dollar signs or double-quotes removed.  This macro lets
  958.      you put a revision stamp from `configure.in' into `configure'
  959.      without RCS or CVS changing it when you check in `configure'.  That
  960.      way, you can determine easily which revision of `configure.in' a
  961.      particular `configure' corresponds to.
  962.      It is a good idea to call this macro before `AC_INIT' so that the
  963.      revision number is near the top of both `configure.in' and
  964.      `configure'.  To support doing that, the `AC_REVISION' output
  965.      begins with `#!/bin/sh', like the normal start of a `configure'
  966.      script does.
  967.      For example, this line in `configure.in':
  968.           AC_REVISION($Revision: 1.30 $)dnl
  969.      produces this in `configure':
  970.           #!/bin/sh
  971.           # From configure.in Revision: 1.30
  972. File: autoconf.info,  Node: General Feature Tests,  Next: Command Line,  Prev: Setup,  Up: General Purpose Macros
  973. Checking for Kinds of Features
  974. ==============================
  975.    These macros are templates that, when called with actual parameters,
  976. check for various kinds of features.  Many of these macros handle two
  977. cases: what to do if the given condition is met, and what to do if the
  978. condition is not met.  In some places you you might want to do something
  979. if a condition is true but do nothing if it's false, or vice versa.  To
  980. omit the true case, pass an empty value for the ACTION-IF-FOUND
  981. argument to the macro.  To omit the false case, omit the
  982. ACTION-IF-NOT-FOUND argument to the macro, including the comma before
  983.    One shell programming construction that you should not use in the
  984. action arguments to these macros is `VAR=${VAR:-VALUE}'.  Old BSD
  985. shells, including the Ultrix `sh', don't understand the colon, and
  986. complain and die.  If you omit the colon, it works fine:
  987. `VAR=${VAR-VALUE}'.  Using the form without the colon has one small
  988. disadvantage.  Users can not select a default value by giving a
  989. variable an empty value, e.g., `CC= configure'.  Instead, they must
  990. unset the variable, e.g., `unset CC; configure'.
  991.    *Note Writing Macros::, for more information on how best to use these
  992. macros.
  993.  - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY,
  994.           ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  995.      Print `checking for ECHO-TEXT' to the standard output (using
  996.      `AC_CHECKING', *note Printing Messages::.).  Create a test C
  997.      program to see whether a function whose body consists of
  998.      FUNCTION-BODY can be compiled and linked; INCLUDES is any
  999.      `#include' statements needed by the code in FUNCTION-BODY.  If the
  1000.      file compiles and links successfully, run shell commands
  1001.      ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND.
  1002.  - Macro: AC_FUNC_CHECK (FUNCTION, ACTION-IF-FOUND [,
  1003.           ACTION-IF-NOT-FOUND])
  1004.      If FUNCTION is available, run shell commands ACTION-IF-FOUND,
  1005.      otherwise ACTION-IF-NOT-FOUND.  If the functions might be in
  1006.      libraries other than the default C library, first call
  1007.      `AC_HAVE_LIBRARY' for those libraries.  If you just want to define
  1008.      a symbol if the function is available, consider using
  1009.      `AC_HAVE_FUNCS' instead.
  1010.  - Macro: AC_HAVE_FUNCS (FUNCTION...)
  1011.      For each given FUNCTION in the whitespace-separated argument list
  1012.      that is available, define `HAVE_FUNCTION' (in all caps).  *Note
  1013.      Specific Tests::, for a precise definition of "define" as it is
  1014.      used here.  If the functions might be in libraries other than the
  1015.      default C library, first call `AC_HAVE_LIBRARY' for those
  1016.      libraries.
  1017.  - Macro: AC_HAVE_HEADERS (HEADER-FILE...)
  1018.      For each given HEADER-FILE in the whitespace-separated argument
  1019.      list that exists, define `HAVE_HEADER-FILE' (in all caps).  *Note
  1020.      Specific Tests::, for a precise definition of "define" as it is
  1021.      used here.
  1022.  - Macro: AC_HAVE_LIBRARY (LIBRARY [, ACTION-IF-FOUND [,
  1023.           ACTION-IF-NOT-FOUND]])
  1024.      Create a test C program to see whether that program can be linked
  1025.      with the specified library.  ACTION-IF-FOUND is a list of shell
  1026.      commands to run if the link succeeds (which means that the library
  1027.      is present); ACTION-IF-NOT-FOUND is a list of shell commands to run
  1028.      if the link fails.  If ACTION-IF-FOUND and ACTION-IF-NOT-FOUND are
  1029.      not specified, the default action is to add `-lfoo' to `LIBS' and
  1030.      define `HAVE_LIBfoo' for library `foo'.  LIBRARY can be written as
  1031.      any of `foo', `-lfoo', or `libfoo.a'.  In all of those cases, the
  1032.      compiler is passed `-lfoo'.
  1033.  - Macro: AC_HEADER_CHECK (HEADER-FILE, ACTION-IF-FOUND [,
  1034.           ACTION-IF-NOT-FOUND])
  1035.      If HEADER-FILE exists, execute shell commands ACTION-IF-FOUND,
  1036.      otherwise execute ACTION-IF-NOT-FOUND.  If you just want to define
  1037.      a symbol if the header file is available, consider using
  1038.      `AC_HAVE_HEADERS' instead.
  1039.  - Macro: AC_HEADER_EGREP (PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
  1040.           ACTION-IF-NOT-FOUND])
  1041.      If the output of running the preprocessor on HEADER-FILE contains
  1042.      the `egrep' regular expression PATTERN, execute shell commands
  1043.      ACTION-IF-FOUND, otherwise execute
  1044.      This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
  1045.      which language is current, *note Language Choice::.), if it hasn't
  1046.      been called already.  ACTION-IF-NOT-FOUND.
  1047.      You can not check whether preprocessor symbols are defined this
  1048.      way, because they get expanded before `egrep' sees them.  But you
  1049.      can almost always detect them by simply using `#ifdef' directives
  1050.      in your programs.
  1051.  - Macro: AC_PROGRAM_CHECK (VARIABLE, PROG-TO-CHECK-FOR,
  1052.           VALUE-IF-FOUND, VALUE-IF-NOT-FOUND)
  1053.      Check whether program PROG-TO-CHECK-FOR exists in `PATH'.  If it
  1054.      is found, set VARIABLE to VALUE-IF-FOUND, otherwise to
  1055.      VALUE-IF-NOT-FOUND.  If VARIABLE was already set, do nothing.
  1056.      Calls `AC_SUBST' for VARIABLE.
  1057.  - Macro: AC_PROGRAM_EGREP (PATTERN, PROGRAM, ACTION-IF-FOUND [,
  1058.           ACTION-IF-NOT-FOUND])
  1059.      PROGRAM is the text of a C or C++ program, on which shell variable
  1060.      and backquote substitutions are performed.  If the output of
  1061.      running the preprocessor on PROGRAM contains the `egrep' regular
  1062.      expression PATTERN, execute shell commands ACTION-IF-FOUND,
  1063.      otherwise execute ACTION-IF-NOT-FOUND.  (It is an unfortunate
  1064.      oversight that we use the word `PROGRAM' in Autoconf macro names to
  1065.      sometimes mean C or C++ source code and sometimes mean a UNIX
  1066.      command.)
  1067.      This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
  1068.      which language is current, *note Language Choice::.), if it hasn't
  1069.      been called already.
  1070.  - Macro: AC_PROGRAM_PATH (VARIABLE, PROG-TO-CHECK-FOR,
  1071.           VALUE-IF-NOT-FOUND)
  1072.      Similar to `AC_PROGRAM_CHECK', but set VARIABLE to the entire path
  1073.      of PROG-TO-CHECK-FOR if found.  Otherwise, set VARIABLE to the
  1074.      value VALUE-IF-NOT-FOUND and perform no path checking.  If
  1075.      VARIABLE was already set, do nothing.  Calls `AC_SUBST' for
  1076.      VARIABLE.
  1077.  - Macro: AC_PROGRAMS_CHECK (VARIABLE, PROGS-TO-CHECK-FOR [,
  1078.           VALUE-IF-NOT-FOUND])
  1079.      Check for each program in the whitespace-separated list
  1080.      PROGS-TO-CHECK-FOR exists in `PATH'.  If it is found, set VARIABLE
  1081.      to the name of that program.  Otherwise, continue checking the
  1082.      next program in the list.  If none of the programs in the list are
  1083.      found, set VARIABLE to VALUE-IF-NOT-FOUND; if VALUE-IF-NOT-FOUND
  1084.      is not specified, the value of VARIABLE will not be changed.
  1085.      Calls `AC_SUBST' for VARIABLE.
  1086.  - Macro: AC_PROGRAMS_PATH (VARIABLE, PROGS-TO-CHECK-FOR [,
  1087.           VALUE-IF-NOT-FOUND])
  1088.      Like `AC_PROGRAMS_CHECK', but if any of PROGS-TO-CHECK-FOR are
  1089.      found, set VARIABLE to the entire pathname of the program found.
  1090.  - Macro: AC_REPLACE_FUNCS (FUNCTION-NAME...)
  1091.      For each given FUNCTION-NAME in the whitespace-separated argument
  1092.      list that is not in the C library, add `FUNCTION-NAME.o' to the
  1093.      value of the `make' variable `LIBOBJS'.  If the functions might be
  1094.      in libraries other than the default C library, first call
  1095.      `AC_HAVE_LIBRARY' for those libraries.
  1096.  - Macro: AC_SIZEOF_TYPE (TYPE)
  1097.      Define `SIZEOF_UCTYPE' to be the size in bytes of the C (or C++)
  1098.      builtin type TYPE, e.g. `int' or `char *'.  If `type' is unknown
  1099.      to the compiler, gets a size of 0.  UCTYPE is TYPE, with lowercase
  1100.      converted to uppercase, spaces changed to underscores, and
  1101.      asterisks changed to `P'.  For example, the call
  1102.           AC_SIZEOF_TYPE(int *)
  1103.      defines `SIZEOF_INT_P' to be 64 on DEC Alpha AXP systems.
  1104.  - Macro: AC_TEST_PROGRAM (PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
  1105.           [, ACTION-IF-CROSS-COMPILING]])
  1106.      PROGRAM is the text of a C program, on which shell variable and
  1107.      backquote substitutions are performed.  If it compiles and links
  1108.      successfully and returns an exit status of 0 when executed, run
  1109.      shell commands ACTION-IF-TRUE.  Otherwise run shell commands
  1110.      ACTION-IF-FALSE.
  1111.      If the optional argument ACTION-IF-CROSS-COMPILING is given and
  1112.      the C compiler being used does not produce executables that run on
  1113.      the system where `configure' is being run, then the test program
  1114.      is not run.  Instead, the shell commands ACTION-IF-CROSS-COMPILING
  1115.      are run.  If that argument is given, this macro calls
  1116.      `AC_CROSS_CHECK' if it has not already been called (*note Compiler
  1117.      Characteristics::.).
  1118.  - Macro: AC_TEST_CPP (INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  1119.      INCLUDES is C or C++ `#include' statements and declarations, on
  1120.      which shell variable and backquote substitutions are performed.
  1121.      (Actually, it can be any C program, but other statements are
  1122.      probably not useful.)  If the preprocessor produces no error
  1123.      messages while processing it, run shell commands ACTION-IF-TRUE.
  1124.      Otherwise run shell commands ACTION-IF-FALSE.
  1125.      This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
  1126.      which language is current, *note Language Choice::.), if it hasn't
  1127.      been called already.
  1128. File: autoconf.info,  Node: Command Line,  Next: Setting Variables,  Prev: General Feature Tests,  Up: General Purpose Macros
  1129. Checking Command Line Arguments
  1130. ===============================
  1131.    These macros check whether the user gave `configure' various command
  1132. line arguments.  Like the general feature tests (*note General Feature
  1133. Tests::.),  they may take an argument to use if the argument was given
  1134. and one for if it was not given.
  1135.  - Macro: AC_ENABLE (FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  1136.      If the user gave `configure' the option `--enable-FEATURE' or
  1137.      `--disable-FEATURE', run shell commands ACTION-IF-TRUE.  Otherwise
  1138.      run shell commands ACTION-IF-FALSE.  The name FEATURE should
  1139.      consist only of alphanumeric characters and dashes.
  1140.      The FEATURE indicates an optional user-level facility.  This
  1141.      option allows users to choose which optional features to build and
  1142.      install.  `--enable-FEATURE' options should never make a feature
  1143.      behave differently or cause one feature to replace another.  They
  1144.      should only cause parts of the program to be built rather than left
  1145.      out.
  1146.      The user can give an argument by following the feature name with
  1147.      `=' and the argument.  Giving an argument of `no' indicates that
  1148.      the feature is *not* available.  A feature with an argument looks
  1149.      like `--enable-debug=stabs'.
  1150.      The argument is available to the shell commands ACTION-IF-TRUE in
  1151.      the shell variable `enableval'.  If no argument was given to
  1152.      `--enable-FEATURE', `enableval' is `yes'.  `--disable-FEATURE' is
  1153.      equivalent to `--enable-FEATURE=no'.  At present, arguments
  1154.      containing blanks are not handled correctly; if you need an
  1155.      argument to contain a list, require the items to be separated by
  1156.      commas instead.  (This restriction might disappear in the future.)
  1157.  - Macro: AC_PREFIX (PROGRAM)
  1158.      If the user did not specify an installation prefix (using the
  1159.      `--prefix' option), guess a value for it by looking for PROGRAM in
  1160.      `PATH', the way the shell does.  If PROGRAM is found, set the
  1161.      prefix to the parent of the directory containing PROGRAM;
  1162.      otherwise leave the prefix specified in `Makefile.in' unchanged.
  1163.      For example, if PROGRAM is `gcc' and the `PATH' contains
  1164.      `/usr/local/gnu/bin/gcc', set the prefix to `/usr/local/gnu'.
  1165.  - Macro: AC_WITH (PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  1166.      If the user gave `configure' the option `--with-PACKAGE' or
  1167.      `--without-PACKAGE', run shell commands ACTION-IF-TRUE.  Otherwise
  1168.      run shell commands ACTION-IF-FALSE.  The name PACKAGE should
  1169.      consist only of alphanumeric characters and dashes.
  1170.      The PACKAGE indicates another software package that this program
  1171.      should work with.  For example, `--with-gnu-ld' means work with the
  1172.      GNU linker instead of some other linker.  `--with-x11' means work
  1173.      with X11.
  1174.      The user can give an argument by following the package name with
  1175.      `=' and the argument.  Giving an argument of `no' is for packages
  1176.      that would be used by default; it says to *not* use the package.
  1177.      An argument that is neither `yes' nor `no' could include a name or
  1178.      number of a version of the other package, to specify more
  1179.      precisely which other package this program is supposed to work
  1180.      with.
  1181.      The argument is available to the shell commands ACTION-IF-TRUE in
  1182.      the shell variable `withval'.  If no argument was given to
  1183.      `--with-PACKAGE', `withval' is `yes'.  `--without-PACKAGE' is
  1184.      equivalent to `--with-PACKAGE=no'.  At present, arguments
  1185.      containing blanks are not handled correctly; if you need an
  1186.      argument to contain a list, require the items to be separated by
  1187.      commas instead.  (This restriction might disappear in the future.)
  1188. File: autoconf.info,  Node: Setting Variables,  Next: Printing Messages,  Prev: Command Line,  Up: General Purpose Macros
  1189. Setting Variables
  1190. =================
  1191.    These macros help other macros to define shell and `make' variables.
  1192.  - Macro: AC_DEFINE (VARIABLE [, VALUE])
  1193.      Define C preprocessor variable VARIABLE.  If VALUE is given, set
  1194.      VARIABLE to that value, otherwise set it to 1.  To use a shell
  1195.      variable as the value, use `AC_DEFINE_UNQUOTED' instead and precede
  1196.      double quotes in the value with backslashes.
  1197.      This macro adds to the shell variable `DEFS'.  `AC_OUTPUT' later
  1198.      substitutes the values in `DEFS' into the file(s) that it
  1199.      generates (typically `Makefile').  Alternately, if
  1200.      `AC_CONFIG_HEADER' has been called, `AC_OUTPUT' creates a header
  1201.      file by substituting the correct values into `#define' statements
  1202.      in a template file.
  1203.      For example, suppose your `configure.in' calls
  1204.      `AC_CONFIG_HEADER(conf.h)' and `AC_HAVE_HEADERS(unistd.h)'.  You
  1205.      could have code like this in `conf.h.in':
  1206.           /* Define as 1 if you have unistd.h.  */
  1207.           #define HAVE_UNISTD_H 0
  1208.      On systems that have `unistd.h', `configure' will change the 0 to
  1209.      a 1.  On other systems, it will leave the line unchanged.
  1210.      Alternately, if you prefer to use `#ifdef', your `conf.h.in' could
  1211.      have code like this:
  1212.           /* Define if you have unistd.h.  */
  1213.           #undef HAVE_UNISTD_H
  1214.      On systems that have `unistd.h', `configure' will change the
  1215.      second line to read `#define HAVE_UNISTD_H 1'.  On other systems,
  1216.      it will comment that line out (in case the system predefines that
  1217.      symbol).
  1218.      Due to the syntactical bizarreness of the Bourne shell, do not use
  1219.      semicolons to separate `AC_DEFINE' calls from other macro calls or
  1220.      shell code; that can cause syntax errors in the resulting
  1221.      `configure' script.  Use either spaces or newlines.  That is, do
  1222.      this:
  1223.           AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf")
  1224.      or this:
  1225.           AC_HEADER_CHECK(elf.h,
  1226.             AC_DEFINE(SVR4)
  1227.             LIBS="$LIBS -lelf")
  1228.      instead of this:
  1229.           AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
  1230.  - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE])
  1231.      Like `AC_DEFINE', but it does nothing to quote VALUE from various
  1232.      shell and `sed' expansions it will undergo.  VALUE will be used in
  1233.      many different contexts requiring different quoting, and it is up
  1234.      to you to make sure it works right.  Use this macro instead of
  1235.      `AC_DEFINE' when VALUE contains a shell variable.  For example:
  1236.           AC_DEFINE_UNQUOTED(config_machfile,  ${machfile})
  1237.  - Macro: AC_SUBST (VARIABLE)
  1238.      Substitute the variable VARIABLE when creating the output files
  1239.      (typically one or more `Makefile's).  This means replace instances
  1240.      of `@VARIABLE@', e.g. in `Makefile.in', with the current value of
  1241.      the shell variable VARIABLE.  If this macro were not called, the
  1242.      value of VARIABLE would not be set in the output files, even
  1243.      though `configure' had figured out a value for it.
  1244.      You can set or add to the value of VARIABLE in the usual shell
  1245.      way.  For example, to add `-ltermcap' to the value of the variable
  1246.      `LIBS':
  1247.           LIBS="$LIBS -ltermcap"
  1248. File: autoconf.info,  Node: Printing Messages,  Next: Language Choice,  Prev: Setting Variables,  Up: General Purpose Macros
  1249. Printing Messages
  1250. =================
  1251.    `configure' scripts need to give users running them several kinds of
  1252. information.  The following macros print messages in ways appropriate
  1253. for different kinds of information.  The arguments to all of them get
  1254. enclosed in shell double quotes, so the shell performs variable and
  1255. backquote substitution on them.
  1256.    These macros are all wrappers around the `echo' shell command.
  1257. Other macros should rarely need to run `echo' directly to print
  1258. messages for the `configure' user.  Using these macros makes it easy to
  1259. change how and when each kind of message is printed; such changes need
  1260. only be made to the macro definitions, and all of the callers change
  1261. automatically.
  1262.  - Macro: AC_CHECKING (FEATURE-DESCRIPTION)
  1263.      Notify the user that `configure' is checking for a particular
  1264.      feature.  This macro prints a message that starts with `checking '.
  1265.      It prints nothing if `configure' is run with the `--silent' or
  1266.      `--quiet' option.  The FEATURE-DESCRIPTION should be something
  1267.      like `whether the Fortran compiler accepts C++ comments' or `for
  1268.      c89'.
  1269.  - Macro: AC_ERROR (ERROR-DESCRIPTION)
  1270.      Notify the user of an error that prevents `configure' from
  1271.      completing.  This macro prints an error message on the standard
  1272.      error stream and exits `configure' with a nonzero status.
  1273.      eRROR-DESCRIPTION should be something like `invalid value $HOME
  1274.      for \$HOME'.
  1275.  - Macro: AC_VERBOSE (RESULT-DESCRIPTION)
  1276.      Notify the user of the results of a check.  This information is
  1277.      only printed if `configure' is run with the `--verbose' option.
  1278.      rESULT-DESCRIPTION should be something like `setting ADA to $ADA'.
  1279.  - Macro: AC_WARN (PROBLEM-DESCRIPTION)
  1280.      Notify the `configure' user of a possible problem.  This macro
  1281.      prints the message on the standard error stream; `configure'
  1282.      continues running afterward, so macros that call `AC_WARN' should
  1283.      provide a default (back-up) behavior for the situations they warn
  1284.      about.  PROBLEM-DESCRIPTION should be something like `ln -s seems
  1285.      to make hard links'.
  1286. File: autoconf.info,  Node: Language Choice,  Next: Macro Ordering,  Prev: Printing Messages,  Up: General Purpose Macros
  1287. Language Choice
  1288. ===============
  1289.    Packages that use both C and C++ need to test features of both
  1290. compilers.  Autoconf-generated `configure' scripts check for C features
  1291. by default.  The following macros determine which language's compiler
  1292. is used in tests that follow in `configure.in'.
  1293.  - Macro: AC_LANG_C
  1294.      Do compilation tests using `CC' and `CPP' and use extension `.c'
  1295.      for test programs.
  1296.      This is the initial state.
  1297.  - Macro: AC_LANG_CPLUSPLUS
  1298.      Do compilation tests using `CXX' and `CXXCPP' and use extension
  1299.      `.C' for test programs.
  1300.  - Macro: AC_LANG_RESTORE
  1301.      Select the language that is saved on the top of the stack, as set
  1302.      by `AC_LANG_SAVE', and remove it from the stack.  This macro is
  1303.      equivalent to either `AC_LANG_C' or `AC_LANG_CPLUSPLUS', whichever
  1304.      had been run most recently when `AC_LANG_SAVE' was last called.
  1305.      Do not call this macro more times than `AC_LANG_SAVE'.
  1306.  - Macro: AC_LANG_SAVE
  1307.      Remember the current language (as set by `AC_LANG_C' or
  1308.      `AC_LANG_CPLUSPLUS') on a stack.  Does not change which language is
  1309.      current.  Use this macro and `AC_LANG_RESTORE' in macros that need
  1310.      to temporarily switch to a particular language.
  1311.  - Macro: AC_REQUIRE_CPP
  1312.      Ensure that whichever preprocessor would currently be used for
  1313.      tests has been found.  Calls `AC_REQUIRE' (*note Macro
  1314.      Ordering::.) with an argument of either `AC_PROG_CPP' or
  1315.      `AC_PROG_CXXCPP', depending on which language is current.
  1316. File: autoconf.info,  Node: Macro Ordering,  Prev: Language Choice,  Up: General Purpose Macros
  1317. Macro Ordering
  1318. ==============
  1319.    These macros provide ways for other macros to make sure that they are
  1320. called in the correct order.
  1321.  - Macro: AC_BEFORE (THIS-MACRO-NAME, CALLED-MACRO-NAME)
  1322.      Make `m4' print a warning message on the standard error output if
  1323.      CALLED-MACRO-NAME has already been called.  THIS-MACRO-NAME should
  1324.      be the name of the macro that is calling `AC_BEFORE'.  The macro
  1325.      CALLED-MACRO-NAME must contain a call to `AC_PROVIDE' to indicate
  1326.      that it has been called.
  1327.      This macro should be used when one macro makes changes that might
  1328.      affect another macro, so that the other macro should probably not
  1329.      be called first.  For example, `AC_PROG_CPP' checks whether the C
  1330.      compiler can run the C preprocessor when given the `-E' option.
  1331.      It should therefore be called after any macros that change which C
  1332.      compiler is being used, such as `AC_PROG_CC'.  So `AC_PROG_CC'
  1333.      contains:
  1334.           AC_BEFORE([$0], [AC_PROG_CPP])
  1335.      This warns the user if a call to `AC_PROG_CPP' has already occurred
  1336.      when `AC_PROG_CC' is called.
  1337.  - Macro: AC_OBSOLETE (THIS-MACRO-NAME [, SUGGESTION])
  1338.      Make `m4' print a message on the standard error output warning that
  1339.      THIS-MACRO-NAME is obsolete, and giving the file and line number
  1340.      where it was called.  THIS-MACRO-NAME should be the name of the
  1341.      macro that is calling `AC_BEFORE'.  If SUGGESTION is given, it is
  1342.      printed at the end of the warning message; for example, it can be
  1343.      a suggestion for what to use instead of THIS-MACRO-NAME.
  1344.      A sample call is:
  1345.           AC_OBSOLETE([$0], [; use AC_HAVE_HEADERS(unistd.h) instead])
  1346.  - Macro: AC_PROVIDE (MACRO-NAME)
  1347.      Set a flag recording that MACRO-NAME has been called.  The
  1348.      argument should be the name of the macro that is calling
  1349.      `AC_PROVIDE'.  An easy way to get it is from the `m4' builtin
  1350.      variable `$0', like this:
  1351.           AC_PROVIDE([$0])
  1352.  - Macro: AC_REQUIRE (MACRO-NAME)
  1353.      If the `m4' macro MACRO-NAME has not already been called, call it
  1354.      (without any arguments).  Make sure to quote MACRO-NAME with
  1355.      square brackets.  The body of MACRO-NAME must contain a call to
  1356.      `AC_PROVIDE' to indicate that it has been called.
  1357.      Macros that need some other macro to be called before they are
  1358.      called can use `AC_REQUIRE' to ensure that it has been, in case
  1359.      the person who made `configure.in' forgot or didn't know to do it.
  1360.      `AC_REQUIRE' and `AC_PROVIDE' together can ensure that a macro is
  1361.      only called if it is needed, and only called once.  *Note
  1362.      Dependencies Between Macros::, for more information.
  1363. File: autoconf.info,  Node: Writing Macros,  Next: Makefiles,  Prev: General Purpose Macros,  Up: Top
  1364. Writing Macros
  1365. **************
  1366.    If your package needs to test for some feature that none of the
  1367. macros supplied with Autoconf handles, you'll need to write one or more
  1368. new Autoconf macros.  Here are some suggestions and some of the
  1369. rationale behind why the existing macros are written the way they are.
  1370. You can also learn a lot about how to write Autoconf macros by looking
  1371. at the existing ones.  If something goes wrong in one or more of the
  1372. Autoconf tests, this information can help you understand why they work
  1373. the way they do and the assumptions behind them, which might help you
  1374. figure out how to best solve the problem.
  1375.    If you add macros that you think would be useful to other people, or
  1376. find problems with the distributed macros, please send electronic mail
  1377. to `bug-gnu-utils@prep.ai.mit.edu', so we can consider them for future
  1378. releases of Autoconf.  Please include the Autoconf version number,
  1379. which you can get by running `autoconf --version'.
  1380. * Menu:
  1381. * Macro Format::        Basic format of an Autoconf macro.
  1382. * Quoting::            Protecting macros from unwanted expansion.
  1383. * Dependencies Between Macros::    What to do when macros depend on other macros.
  1384. * Checking for Files::        Finding whether a file exists.
  1385. * Checking for Symbols::    Finding whether a symbol is defined.
  1386. * Test Programs::        Writing programs to test for features.
  1387. * Multiple Cases::        Tests for several possible values.
  1388. File: autoconf.info,  Node: Macro Format,  Next: Quoting,  Up: Writing Macros
  1389. Macro Format
  1390. ============
  1391.    Autoconf macros are defined as arguments to the `m4' builtin command
  1392. `define'.  Their overall structure looks like this:
  1393.      define(MACRO-NAME, [MACRO-BODY])dnl
  1394. The square brackets here do not indicate optional text: they should
  1395. literally be present in the macro definition.
  1396.    All of the Autoconf macros have names starting with `AC_' to prevent
  1397. them from accidentally conflicting with other text.  All shell
  1398. variables that they use for internal purposes have names starting with
  1399. `ac_'.  To ensure that your macros don't conflict with present or
  1400. future Autoconf macros, you should prefix your own macro names and any
  1401. shell variables they use with some other sequence.  Possibilities
  1402. include your initials, or an abbreviation for the name of your
  1403. organization or software package.
  1404.    The `m4' builtin `dnl' prevents a newline from being inserted in the
  1405. output where the macro is defined; without it, the generated
  1406. `configure' script would begin with dozens of blank lines.  `dnl' is
  1407. also used to introduce comments in `m4'; it causes `m4' to discard the
  1408. rest of the input line.
  1409.    You should quote the entire macro body with square brackets to avoid
  1410. macro expansion problems (*note Quoting::.).  You can refer to any
  1411. arguments passed to the macro as `$1', `$2', etc.
  1412.    *Note How to define new macros: (m4.info)Definitions, for more
  1413. complete information on writing `m4' macros.
  1414. File: autoconf.info,  Node: Quoting,  Next: Dependencies Between Macros,  Prev: Macro Format,  Up: Writing Macros
  1415. Quoting
  1416. =======
  1417.    Macros that are called by other macros are evaluated by `m4' several
  1418. times; each evaluation might require another layer of quotes to prevent
  1419. unwanted expansions of macros or `m4' builtins, such as `define' and
  1420. `$1'.  Quotes are also required around macro arguments that contain
  1421. commas, since commas separate the arguments from each other.
  1422.    Autoconf (in `acgeneral.m4') changes the `m4' quote characters from
  1423. the default ``' and `'' to `[' and `]', because many of the macros use
  1424. ``' and `'', mismatched.  However, in a few places the macros need to
  1425. use brackets.  In those places, they use the `m4' builtin command
  1426. `changequote' to temporarily disable quoting before the code that uses
  1427. brackets, like this:
  1428.      changequote(,)dnl
  1429. Then they turn quoting back on again with another call to `changequote':
  1430.      changequote([,])dnl
  1431.    When you create a `configure' script using newly written macros,
  1432. examine it carefully to check whether you need to add more quotes in
  1433. your macros.  If one or more words have disappeared in the `m4' output,
  1434. you need more quotes.  When in doubt, quote.
  1435.    However, it's also possible to put on too many layers of quotes.  If
  1436. this happens, the resulting `configure' script will contain unexpanded
  1437. macros.  The `autoconf' program checks for this problem by doing `grep
  1438. AC_ configure'.
  1439. File: autoconf.info,  Node: Dependencies Between Macros,  Next: Checking for Files,  Prev: Quoting,  Up: Writing Macros
  1440. Dependencies Between Macros
  1441. ===========================
  1442.    Some Autoconf macros depend on other macros having been called first
  1443. in order to work correctly.  Autoconf provides a way to ensure that
  1444. certain macros are called if needed and a way to warn the user if
  1445. macros are called in an order that might cause incorrect operation.
  1446. * Menu:
  1447. * Prerequisite Macros::        Ensuring required information.
  1448. * Suggested Ordering::        Warning about possible ordering problems.
  1449. File: autoconf.info,  Node: Prerequisite Macros,  Next: Suggested Ordering,  Up: Dependencies Between Macros
  1450. Prerequisite Macros
  1451. -------------------
  1452.    A macro that you write might need to use values that have previously
  1453. been computed by other macros.  For example, if you write a new macro
  1454. that uses the C preprocessor, it depends on `AC_PROG_CPP' having been
  1455. called first to set the shell variable `CPP' (*note Alternative
  1456. Programs::.).
  1457.    Rather than forcing the user of the macros to keep track of all of
  1458. the dependencies between them, you can use the macros `AC_PROVIDE' and
  1459. `AC_REQUIRE' to do it automatically.  *Note Macro Ordering::, for more
  1460. information on their syntax.
  1461.    The new macro that runs the C preprocessor should contain, somewhere
  1462. before `CPP' is used, the statement
  1463.      AC_REQUIRE([AC_PROG_CPP])
  1464. and the macro `AC_PROG_CPP' should contain the statement (anywhere in
  1465. its body)
  1466.      AC_PROVIDE([$0])
  1467. Then, when the new macro is run, it will invoke `AC_PROG_CPP' if and
  1468. only if `AC_PROG_CPP' has not already been run.
  1469. File: autoconf.info,  Node: Suggested Ordering,  Prev: Prerequisite Macros,  Up: Dependencies Between Macros
  1470. Suggested Ordering
  1471. ------------------
  1472.    Some macros should be run before another macro if both are called,
  1473. but neither requires the other to be called.  For example, a macro like
  1474. `AC_AIX' that changes the behavior of the C compiler (*note UNIX
  1475. Variants::.) should be called before any macros that run the C compiler.
  1476. Many of these dependencies are noted in the documentation.
  1477.    Autoconf provides a way to warn users when macros with this kind of
  1478. dependency appear out of order in a `configure.in' file.  The warning
  1479. occurs when creating `configure' from `configure.in', not when running
  1480. `configure'.  It is not a fatal error; `configure' is created as usual.
  1481.    The `AC_BEFORE' macro causes `m4' to print a warning message on the
  1482. standard error output when a macro is used before another macro which
  1483. might change its behavior.  The macro which should come first should
  1484. contain a call to `AC_BEFORE' and the macro which should come later
  1485. should contain a call to `AC_PROVIDE'.
  1486.    For example, `AC_AIX' contains
  1487.      AC_BEFORE([$0], [AC_COMPILE_CHECK])
  1488. and `AC_COMPILE_CHECK' contains
  1489.      AC_PROVIDE([$0])
  1490. As a result, if `AC_AIX' is called after `AC_COMPILE_CHECK', it will
  1491. note that `AC_COMPILE_CHECK' has already been called and print a
  1492. warning message.
  1493. File: autoconf.info,  Node: Checking for Files,  Next: Checking for Symbols,  Prev: Dependencies Between Macros,  Up: Writing Macros
  1494. Checking for Files
  1495. ==================
  1496.    If you need to check whether a file other than a C header file
  1497. exists, use `test -f FILENAME'.  If you need to make multiple checks
  1498. using `test', combine them with the shell operators `&&' and `||'
  1499. instead of using the `test' operators `-a' and `-o'.  On System V, the
  1500. precedence of `-a' and `-o' is wrong relative to the unary operators;
  1501. consequently, POSIX does not specify them, so using them is
  1502. nonportable.  If you combine `&&' and `||' in the same statement, keep
  1503. in mind that they have equal precedence.
  1504.    Do not use `test -x', because 4.3BSD does not have it.  Use `test
  1505. -f' or `test -r' instead.
  1506. File: autoconf.info,  Node: Checking for Symbols,  Next: Test Programs,  Prev: Checking for Files,  Up: Writing Macros
  1507. Checking for Symbols
  1508. ====================
  1509.    If you need to check whether a symbol is defined in a C header file,
  1510. you can use `AC_HEADER_EGREP' if the symbol is not a C preprocessor
  1511. macro (*note General Feature Tests::.), or compile a small test program
  1512. that includes the file and references the symbol (*note Test
  1513. Programs::.).  Don't directly `grep' for the symbol in the file,
  1514. because on some systems it might be defined in another header file that
  1515. the file you are checking `#include's.
  1516.    However, if you need to check for a particular UNIX variant which is
  1517. distinguished by having certain text in a certain file, then use `grep'
  1518. (or `egrep').  But don't use `grep -s' to suppress output, because
  1519. `grep -s' on System V does not suppress output, only error messages.
  1520. Instead, redirect the standard output and standard error (in case the
  1521. file doesn't exist) of `grep' to `/dev/null'.  Check the exit status of
  1522. `grep' to determine whether it found a match.
  1523.    To check whether the Autoconf macros have already defined a certain C
  1524. preprocessor symbol, you can use a `case' statement like this:
  1525.      case "$DEFS" in
  1526.        *HAVE_FOO*) ;;
  1527.        *) LIBOBJS="$LIBOBJS foo.o" ;;
  1528.      esac
  1529. Make sure to enclose the variable name you are checking (usually
  1530. `DEFS') in double quotes, because otherwise some old versions of `bash'
  1531. misinterpret the statement.
  1532. File: autoconf.info,  Node: Test Programs,  Next: Multiple Cases,  Prev: Checking for Symbols,  Up: Writing Macros
  1533. Test Programs
  1534. =============
  1535.    Autoconf checks for many features by compiling small test programs.
  1536. To find out whether a library function is available, Autoconf tries to
  1537. compile a small program that uses it.  This is unlike Larry Wall's
  1538. Metaconfig, which uses `nm' or `ar' on the C library to try to figure
  1539. out which functions are available.  Trying to link with the function is
  1540. usually a more reliable and flexible approach because it avoids dealing
  1541. with the variations in the options and output formats of `nm' and `ar'
  1542. and in the location of the standard libraries.  It also allows
  1543. `configure' to check aspects of the function's runtime behavior if
  1544. needed.  On the other hand, it is sometimes slower than scanning the
  1545. libraries.
  1546.    If you need to check for a condition other than whether some symbol
  1547. exists on the system or has a certain value, then you can't use
  1548. `AC_COMPILE_CHECK' (*note General Feature Tests::.).  You have to write
  1549. a test program by hand.  You can compile and run it using
  1550. `AC_TEST_PROGRAM' (*note General Feature Tests::.).
  1551.    Try to avoid writing test programs if possible, because using them
  1552. prevents people from configuring your package for cross-compiling.  If
  1553. it's really best that you test for a run-time behavior, try to provide a
  1554. default "worst case" value to use when cross-compiling makes run-time
  1555. tests impossible.  You do this by passing the optional last argument to
  1556. `AC_TEST_PROGRAM'.
  1557. * Menu:
  1558. * Guidelines::            General rules for writing test programs.
  1559. * Tricks::            Special ways to work around problems.
  1560. File: autoconf.info,  Node: Guidelines,  Next: Tricks,  Up: Test Programs
  1561. Guidelines for Test Programs
  1562. ----------------------------
  1563.    Test programs should return 0 if the test succeeds, nonzero
  1564. otherwise, so that success can be distinguished easily from a core dump
  1565. or other failure; segmentation violations and other failures produce a
  1566. nonzero exit status.  Test programs should `exit', not `return', from
  1567. `main', because on some systems the argument to `return' in `main' is
  1568. ignored.  They should not write anything to the standard output.
  1569.    Test programs can use `#if' or `#ifdef' to check the values of
  1570. preprocessor macros defined by tests that have already run.  For
  1571. example, if you call `AC_STDC_HEADERS', then later on in `configure.in'
  1572. you can have a test program that includes an ANSI C header file
  1573. conditionally:
  1574.      #if STDC_HEADERS
  1575.      #include <stdlib.h>
  1576.      #endif
  1577.    If a test program needs to use or create a data file, give it a name
  1578. that starts with `conftest', such as `conftestdata'.  The `configure'
  1579. script cleans up by running `rm -rf conftest*' after running test
  1580. programs and if the script is interrupted.
  1581. File: autoconf.info,  Node: Tricks,  Prev: Guidelines,  Up: Test Programs
  1582. Tricks for Test Programs
  1583. ------------------------
  1584.    If a test program calls a function with invalid parameters (just to
  1585. see whether it exists), organize the program to ensure that it never
  1586. invokes that function.  You can do this by calling it in another
  1587. function that is never invoked.  You can't do it by putting it after a
  1588. call to `exit', because GCC version 2 knows that `exit' never returns
  1589. and optimizes out any code that follows it in the same block.
  1590.    If you include any header files, make sure to call the functions
  1591. relevant to them with the correct number of arguments, even if they are
  1592. just 0, to avoid compilation errors due to prototypes.  GCC version 2
  1593. has internal prototypes for several functions that it automatically
  1594. inlines; for example, `memcpy'.  To avoid errors when checking for
  1595. them, either pass them the correct number of arguments or redeclare them
  1596. with a different return type (such as `char').
  1597. File: autoconf.info,  Node: Multiple Cases,  Prev: Test Programs,  Up: Writing Macros
  1598. Multiple Cases
  1599. ==============
  1600.    Some operations are accomplished in several possible ways, depending
  1601. on the UNIX variant.  Checking for them essentially requires a "case
  1602. statement".  Autoconf does not directly provide one; however, it is
  1603. easy to simulate by using a shell variable to keep track of whether a
  1604. way to perform the operation has been found yet.
  1605.    Here is an example excerpted from the `configure.in' for GNU `find'.
  1606. It uses the shell variable `fstype' to keep track of whether the
  1607. remaining cases need to be checked.  There are several more cases which
  1608. are not shown here but follow the same pattern.
  1609.      echo checking how to get filesystem type
  1610.      # SVR4.
  1611.      AC_TEST_CPP([#include <sys/statvfs.h>
  1612.      #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=1)
  1613.      if test -z "$fstype"; then
  1614.      # SVR3.
  1615.      AC_TEST_CPP([#include <sys/statfs.h>
  1616.      #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=1)
  1617.      fi
  1618.      if test -z "$fstype"; then
  1619.      # AIX.
  1620.      AC_TEST_CPP([#include <sys/statfs.h>
  1621.      #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=1)
  1622.      fi
  1623. File: autoconf.info,  Node: Makefiles,  Next: Invoking configure,  Prev: Writing Macros,  Up: Top
  1624. Makefiles
  1625. *********
  1626.    Each subdirectory in a distribution should come with a file
  1627. `Makefile.in', from which `configure' will produce a `Makefile' in that
  1628. directory.  Most of the substitutions that `configure' does are simple:
  1629. for each configuration variable that the package uses, it just replaces
  1630. occurrences of `@VARIABLE@' with the value that `configure' has
  1631. determined for that variable.  Any occurrences of `@VARIABLE@' for
  1632. variables that `configure' does not know about are passed through
  1633. unchanged.
  1634.    There is no point in checking for the correct value to give a
  1635. variable that is never used.  Every variable that the `configure' script
  1636. might set a value for should appear in a `@VARIABLE@' reference in at
  1637. least one `Makefile.in'.  If `AC_CONFIG_HEADER' is called, `configure'
  1638. replaces `@DEFS@' with `-DHAVE_CONFIG_H', since the contents of `DEFS'
  1639. would be redundant.
  1640.    *Note Makefile Conventions: (standards.info)Makefiles, for more
  1641. information on what to put in Makefiles.  *Note Sample Makefile.in::,
  1642. for an example of a real `Makefile.in'.
  1643. * Menu:
  1644. * Predefined Variables::    Heavily used `make' variables.
  1645. * Installation Prefixes::    A special variable substitution.
  1646. * VPATH Substitutions::        Compiling in a different directory.
  1647. * Automatic Remaking::        Makefile rules for configuring.
  1648. File: autoconf.info,  Node: Predefined Variables,  Next: Installation Prefixes,  Up: Makefiles
  1649. Predefined Variables
  1650. ====================
  1651.    Some `make' variables are predefined by the Autoconf macros.
  1652. `AC_SUBST' is called for them automatically (*note Setting
  1653. Variables::.), so in your `Makefile.in' files you can get their values
  1654. by enclosing their names in `@' characters.  *Note Makefiles::, for
  1655. more information on `@' substitutions.  The variables that are defined
  1656. by the general purpose Autoconf macros are:
  1657.  - Variable: exec_prefix
  1658.      The installation prefix for architecture-specific files.
  1659.  - Variable: prefix
  1660.      The installation prefix for architecture-independent files.  *Note
  1661.      Installation Prefixes::, for an alternate way to set this variable.
  1662.  - Variable: srcdir
  1663.      The directory that contains the source code for that `Makefile'.
  1664.      *Note Installation Prefixes::, for an alternate way to set this
  1665.      variable.
  1666.  - Variable: top_srcdir
  1667.      The top-level source code directory for the package.  In the
  1668.      top-level directory, this is the same as `srcdir'.
  1669.  - Variable: DEFS
  1670.      `-D' options to pass to the C compiler.  If `AC_CONFIG_HEADER' is
  1671.      called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H',
  1672.      since the contents of `DEFS' would be redundant.
  1673.  - Variable: LIBS
  1674.      `-l' and `-L' options to pass to the linker.
  1675.  - Variable: LIBOBJS
  1676.      Names of object files (ending in `.o').  Set by `AC_REPLACE_FUNCS'
  1677.      (*note General Feature Tests::.).
  1678. File: autoconf.info,  Node: Installation Prefixes,  Next: VPATH Substitutions,  Prev: Predefined Variables,  Up: Makefiles
  1679. Installation Prefixes
  1680. =====================
  1681.    Autoconf-generated `configure' scripts support an alternate method
  1682. for substituting two particular variables, for compatibility with
  1683. Cygnus `configure'.  This method is not recommended.
  1684.    If `configure' has figured out a value for the installation prefix,
  1685. either by the user supplying one on the command line (*note Invoking
  1686. configure::.) or with `AC_PREFIX' (*note General Feature Tests::.),
  1687. then it substitutes that value in `Makefile's that it creates.
  1688. Wherever a `Makefile.in' contains lines like
  1689.      prefix = /usr/local
  1690.      exec_prefix = ${prefix}
  1691. `configure' substitutes the value it figured out.  The substitution
  1692. only occurs if the word `prefix' or `exec_prefix' is not preceded by
  1693. any other characters on the line, and `configure' has figured out a
  1694. value for the prefix.
  1695.    There can be separate installation prefixes for architecture-specific
  1696. files (`exec_prefix') and architecture-independent files (`prefix').
  1697. *Note Invoking configure::, for more information on setting them.
  1698.    Autoconf `configure' scripts replace these two variables without
  1699. requiring them to be enclosed in `@' characters, and only if they have
  1700. been set, because the Cygnus `configure' does so.  In retrospect, being
  1701. compatible in this way was a bad decision, because it created an
  1702. inconsistency in Autoconf without giving significant benefits.  This
  1703. wart will be removed in a future release of Autoconf.
  1704. File: autoconf.info,  Node: VPATH Substitutions,  Next: Automatic Remaking,  Prev: Installation Prefixes,  Up: Makefiles
  1705. `VPATH' Substitutions
  1706. =====================
  1707.    You might want to compile a software package in a different directory
  1708. from the one that contains the source code.  Doing this allows you to
  1709. compile the package for several architectures simultaneously from the
  1710. same copy of the source code and keep multiple sets of object files on
  1711. disk.
  1712.    To support doing this, `make' uses the `VPATH' variable to find the
  1713. files that are in the source directory.  GNU `make' and most other
  1714. recent `make' programs can do this.  Older `make' programs do not
  1715. support `VPATH'; when using them, the source code must be in the same
  1716. directory as the object files.
  1717.    To support `VPATH', each `Makefile.in' should contain two lines that
  1718. look like:
  1719.      srcdir = @srcdir@
  1720.      VPATH = @srcdir@
  1721.    Do not set `VPATH' to the value of another variable, for example
  1722. `VPATH = $(srcdir)', because some versions of `make' do not do variable
  1723. substitutions on the value of `VPATH'.
  1724.    `configure' substitutes in the correct value for `srcdir' when it
  1725. produces `Makefile.in'.
  1726.    Do not use the `make' variable `$<', which expands to the pathname
  1727. of the file in the source directory (found with `VPATH'), except in
  1728. implicit rules.  (An implicit rule is one such as `.c.o', which tells
  1729. how to create a `.o' file from a `.c' file.)  Some versions of `make'
  1730. do not set `$<' in explicit rules; they expand it to an empty value.
  1731.    Instead, `Makefile' command lines should always refer to source
  1732. files by prefixing them with `$(srcdir)/'.  For example:
  1733.      time.info: time.texinfo
  1734.              $(MAKEINFO) $(srcdir)/time.texinfo
  1735. File: autoconf.info,  Node: Automatic Remaking,  Prev: VPATH Substitutions,  Up: Makefiles
  1736. Automatic Remaking
  1737. ==================
  1738.    You can put rules like the following in the top-level `Makefile.in'
  1739. for a package to automatically update the configuration information when
  1740. you change the configuration files.  This example includes all of the
  1741. optional files, such as `aclocal.m4' and those related to configuration
  1742. header files.  Omit from the `Makefile.in' rules any of these files
  1743. that your package does not use.
  1744.    The `stamp-' files are necessary because the timestamps of
  1745. `config.h.in' and `config.h' will not be changed if remaking them does
  1746. not change their contents.  This feature avoids unnecessary
  1747. recompilation.  You should include the file `stamp-h.in' your package's
  1748. distribution, so `make' will consider `config.h.in' up to date.
  1749.      configure: configure.in aclocal.m4
  1750.              cd ${srcdir} && autoconf
  1751.      
  1752.      # autoheader might not change config.h.in
  1753.      config.h.in: stamp-h.in
  1754.      stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top
  1755.              cd ${srcdir} && autoheader
  1756.              touch ${srcdir}/stamp-h.in
  1757.      
  1758.      # config.status might not change config.h
  1759.      config.h: stamp-h
  1760.      stamp-h: config.h.in config.status
  1761.              ./config.status
  1762.              touch stamp-h
  1763.      
  1764.      Makefile: Makefile.in config.status
  1765.              ./config.status
  1766.      
  1767.      config.status: configure
  1768.              ./config.status --recheck
  1769.    *Note Invoking config.status::, for more information on handling
  1770. configuration-related dependencies.
  1771. File: autoconf.info,  Node: Invoking configure,  Next: Example,  Prev: Makefiles,  Up: Top
  1772. Running `configure' Scripts
  1773. ***************************
  1774.    A software package that uses a `configure' script should be
  1775. distributed with a file `Makefile.in', but no `Makefile'; that way, the
  1776. user has to properly configure the package for the local system before
  1777. compiling it.  Here is how to configure a package that uses a
  1778. `configure' script.
  1779.    Normally, you just `cd' to the directory containing the package's
  1780. source code and type `./configure'.  If you're using `csh' on an old
  1781. version of System V, you might need to type `sh configure' instead to
  1782. prevent `csh' from trying to execute `configure' itself.
  1783.    Running `configure' takes awhile.  While it is running, it prints
  1784. some messages that tell what it is doing.  If you don't want to see any
  1785. messages, run `configure' with its standard output redirected to
  1786. `/dev/null'; for example, `./configure >/dev/null'.
  1787.    To compile the package in a different directory from the one
  1788. containing the source code, you must use a version of `make' that
  1789. supports the `VPATH' variable, such as GNU `make'.  `cd' to the
  1790. directory where you want the object files and executables to go and run
  1791. the `configure' script.  `configure' automatically checks for the
  1792. source code in the directory that `configure' is in and in `..'.  If
  1793. for some reason `configure' is not in the source code directory that
  1794. you are configuring, then it will report that it can't find the source
  1795. code.  In that case, run `configure' with the option `--srcdir=DIR',
  1796. where DIR is the directory that contains the source code.
  1797.    By default, `make install' will install the package's files in
  1798. `/usr/local/bin', `/usr/local/man', etc.  You can specify an
  1799. installation prefix other than `/usr/local' by giving `configure' the
  1800. option `--prefix=PATH'.  Alternately, you can do so by consistently
  1801. giving a value for the `prefix' variable when you run `make', e.g.,
  1802.      make prefix=/usr/gnu
  1803.      make prefix=/usr/gnu install
  1804.    You can specify separate installation prefixes for
  1805. architecture-specific files and architecture-independent files.  If you
  1806. give `configure' the option `--exec-prefix=PATH' or set the `make'
  1807. variable `exec_prefix' to PATH, the package will use PATH as the prefix
  1808. for installing programs and libraries.  Data files and documentation
  1809. will still use the regular prefix.  Normally, all files are installed
  1810. using the same prefix.
  1811.    Some packages pay attention to `--with-PACKAGE' options to
  1812. `configure', where PACKAGE is something like `gnu-as' or `x' (for the X
  1813. Window System).  They may also pay attention to `--enable-FEATURE'
  1814. options, where FEATURE indicates an optional part of the package.  The
  1815. README should mention any `--with-' and `--enable-' options that the
  1816. package recognizes.
  1817.    `configure' also recognizes the following options:
  1818. `--help'
  1819.      Print a summary of the options to `configure', and exit.
  1820. `--quiet'
  1821. `--silent'
  1822.      Do not print messages saying which checks are being made.
  1823. `--verbose'
  1824.      Print the results of the checks.
  1825. `--version'
  1826.      Print the version of Autoconf used to generate the `configure'
  1827.      script, and exit.
  1828. `--x-includes=DIR'
  1829.      X include files are in DIR.
  1830. `--x-libraries=DIR'
  1831.      X library files are in DIR.
  1832.    `configure' also accepts and ignores some other options.
  1833. * Menu:
  1834. * Overriding variables::        Workarounds for unusual systems.
  1835. * Invoking config.status::      Recreating a configuration.
  1836. File: autoconf.info,  Node: Overriding variables,  Next: Invoking config.status,  Up: Invoking configure
  1837. Overriding variables
  1838. ====================
  1839.    On systems that require unusual options for compilation or linking
  1840. that the package's `configure' script does not know about, you can give
  1841. `configure' initial values for variables by setting them in the
  1842. environment.  In Bourne-compatible shells, you can do that on the
  1843. command line like this:
  1844.      CC='gcc -traditional' LIBS=-lposix ./configure
  1845. On systems that have the `env' program, you can do it like this:
  1846.      env CC='gcc -traditional' LIBS=-lposix ./configure
  1847.    Here are the `make' variables that you might want to override with
  1848. environment variables when running `configure'.
  1849.    For these variables, any value given in the environment overrides the
  1850. value that `configure' would choose:
  1851.  - Variable: CC
  1852.      C compiler program.  The default is `cc'.
  1853.  - Variable: INSTALL
  1854.      Program to use to install files.  The default is `install' if you
  1855.      have it, `cp' otherwise.
  1856.    For these variables, any value given in the environment is added to
  1857. the value that `configure' chooses:
  1858.  - Variable: DEFS
  1859.      Configuration options, in the form `-Dfoo -Dbar...'.  Do not use
  1860.      this variable in packages that create a configuration header file.
  1861.  - Variable: LIBS
  1862.      Libraries to link with, in the form `-lfoo -lbar...'.
  1863.    In the long term, most problems requiring manual intervention should
  1864. be fixed by updating either the Autoconf macros or the `configure.in'
  1865. file for that package.  *Note Making configure Scripts::, for a
  1866. discussion of that subject.
  1867. File: autoconf.info,  Node: Invoking config.status,  Prev: Overriding variables,  Up: Invoking configure
  1868. Recreating a Configuration
  1869. ==========================
  1870.    The `configure' script creates a file named `config.status' which
  1871. describes which configuration options were specified when the package
  1872. was last configured.  This file is a shell script which, if run, will
  1873. recreate the same configuration.
  1874.    You can give `config.status' the `--recheck' option to update
  1875. itself.  This option is useful if you change `configure', so that the
  1876. results of some tests might be different from the previous run.  The
  1877. `--recheck' option re-runs `configure' with the same arguments you used
  1878. before, plus the `--no-create' option, which prevents `configure' from
  1879. running `config.status' and creating `Makefile' and other files.  (This
  1880. is so other `Makefile' rules can run `config.status' when it changes;
  1881. *note Automatic Remaking::., for an example).
  1882.    `config.status' also accepts the options `--help', which prints a
  1883. summary of the options to `config.status', and `--version', which
  1884. prints the version of Autoconf used to create the `configure' script
  1885. that generated `config.status'.
  1886.    `config.status' checks several optional environment variables that
  1887. can alter its behavior:
  1888.  - Variable: CONFIG_SHELL
  1889.      The shell with which to run `configure' for the `--recheck'
  1890.      option.  The default is `/bin/sh'.
  1891.    The following two variables provide one way for separately
  1892. distributed packages to share the values computed by `configure'.
  1893. Doing so can be useful if some of the packages need a superset of the
  1894. features that one of them, perhaps a common library, does.  These
  1895. variables allow a `config.status' file to create files other than the
  1896. ones that its `configure.in' specifies, so it can be used for a
  1897. different package.
  1898.  - Variable: CONFIG_FILES
  1899.      The files in which to perform `@VARIABLE@' substitutions.  The
  1900.      default is the arguments given to `AC_OUTPUT' in `configure.in'.
  1901.  - Variable: CONFIG_HEADERS
  1902.      The files in which to substitute C `#define' statements.  The
  1903.      default is the arguments given to `AC_CONFIG_HEADER'; if that
  1904.      macro was not called, `config.status' ignores this variable.
  1905.    These variables also allow you to write `Makefile' rules that
  1906. regenerate only some of the files.  For example, in the dependencies
  1907. given above (*note Automatic Remaking::.), `config.status' is run twice
  1908. when `configure.in' has changed.  If that bothers you, you can make
  1909. each run only regenerate the files for that rule:
  1910.      # config.status might not change config.h
  1911.      config.h: stamp-h
  1912.      stamp-h: config.h.in config.status
  1913.              CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
  1914.              touch stamp-h
  1915.      
  1916.      Makefile: Makefile.in config.status
  1917.              CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
  1918. (If `configure.in' does not call `AC_CONFIG_HEADER', there is no need
  1919. to set `CONFIG_HEADERS' in the `make' rules.)
  1920. File: autoconf.info,  Node: Example,  Next: Preprocessor Symbol Index,  Prev: Invoking configure,  Up: Top
  1921. An Example
  1922. **********
  1923.    Here are sample `configure.in' and `Makefile.in' files, to give a
  1924. real illustration of using Autoconf.  They are from the GNU `cpio'
  1925. package, which also includes the `mt' and `rmt' programs.  This package
  1926. does not use a configuration header file; it passes `-D' options to the
  1927. C compiler on the command line.
  1928. * Menu:
  1929. * Sample configure.in::        An example of a `configure' template.
  1930. * Sample Makefile.in::        An example of a `Makefile' template.
  1931. File: autoconf.info,  Node: Sample configure.in,  Next: Sample Makefile.in,  Up: Example
  1932. Sample `configure.in'
  1933. =====================
  1934. Here is `configure.in' from GNU `cpio'.  The `dnl' macro after
  1935. `AC_SUBST' is suppresses an extra (though harmless) newline in the
  1936. generated `configure' script (because the `AC_SUBST' macro does not
  1937. produce any output where it is called).
  1938.      dnl Process this file with autoconf to produce a configure script.
  1939.      AC_INIT(cpio.h)
  1940.      PROGS="cpio"
  1941.      AC_SUBST(PROGS)dnl
  1942.      AC_PROG_CC
  1943.      AC_PROG_CPP
  1944.      AC_GCC_TRADITIONAL
  1945.      AC_PROG_INSTALL
  1946.      AC_AIX
  1947.      AC_MINIX
  1948.      AC_ISC_POSIX
  1949.      AC_RETSIGTYPE
  1950.      AC_MAJOR_HEADER
  1951.      AC_REMOTE_TAPE
  1952.      test -n "$have_mtio" && PROGS="$PROGS mt"
  1953.      AC_RSH
  1954.      AC_CONST
  1955.      AC_UID_T
  1956.      AC_STDC_HEADERS
  1957.      AC_HAVE_HEADERS(string.h fcntl.h utime.h unistd.h sys/io/trioctl.h)
  1958.      AC_REPLACE_FUNCS(fnmatch bcopy mkdir strdup)
  1959.      AC_HAVE_FUNCS(strerror lchown)
  1960.      AC_VPRINTF
  1961.      AC_ALLOCA
  1962.      AC_XENIX_DIR
  1963.      AC_HAVE_LIBRARY(socket, [LIBS="$LIBS -lsocket"])
  1964.      AC_HAVE_LIBRARY(nsl, [LIBS="$LIBS -lnsl"])
  1965.      AC_OUTPUT(Makefile)
  1966. File: autoconf.info,  Node: Sample Makefile.in,  Prev: Sample configure.in,  Up: Example
  1967. Sample `Makefile.in'
  1968. ====================
  1969. Here is `Makefile.in' from GNU `cpio', with some irrelevant lines
  1970. omitted, for brevity.
  1971.      srcdir = @srcdir@
  1972.      VPATH = @srcdir@
  1973.      
  1974.      CC = @CC@
  1975.      
  1976.      INSTALL = @INSTALL@
  1977.      INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1978.      INSTALL_DATA = @INSTALL_DATA@
  1979.      
  1980.      DEFS = @DEFS@
  1981.      LIBS = @LIBS@
  1982.      RTAPELIB = @RTAPELIB@
  1983.      
  1984.      CFLAGS = -g
  1985.      LDFLAGS = -g
  1986.      
  1987.      prefix = /usr/local
  1988.      exec_prefix = $(prefix)
  1989.      binprefix =
  1990.      manprefix =
  1991.      
  1992.      bindir = $(exec_prefix)/bin
  1993.      libdir = $(exec_prefix)/lib
  1994.      mandir = $(prefix)/man/man1
  1995.      manext = 1
  1996.      
  1997.      SHELL = /bin/sh
  1998.      
  1999.      SRCS = copyin.c copyout.c copypass.c defer.c dstring.c global.c \
  2000.      main.c tar.c util.c error.c getopt.c getopt1.c filemode.c version.c \
  2001.      rtapelib.c dirname.c idcache.c makepath.c xmalloc.c stripslash.c \
  2002.      userspec.c xstrdup.c bcopy.c fnmatch.c mkdir.c strdup.c
  2003.      OBJS = copyin.o copyout.o copypass.o defer.o dstring.o global.o \
  2004.      main.o tar.o util.o error.o getopt.o getopt1.o filemode.o version.o \
  2005.      $(RTAPELIB) dirname.o idcache.o makepath.o xmalloc.o stripslash.o \
  2006.      userspec.o xstrdup.o @LIBOBJS@ @ALLOCA@
  2007.      # mt source files not shared with cpio.
  2008.      MT_SRCS = mt.c argmatch.c
  2009.      MT_OBJS = mt.o argmatch.o error.o getopt.o getopt1.o \
  2010.      xmalloc.o version.o $(RTAPELIB) @ALLOCA@
  2011.      HDRS = cpio.h cpiohdr.h tar.h tarhdr.h defer.h dstring.h extern.h filetypes.h \
  2012.      system.h fnmatch.h getopt.h rmt.h
  2013.      DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in \
  2014.      README NEWS INSTALL cpio.1 mt.1 makefile.pc makefile.os2 cpio.def \
  2015.      configure configure.in mkinstalldirs $(MT_SRCS) rmt.c tcexparg.c alloca.c
  2016.      
  2017.      all: @PROGS@
  2018.      
  2019.      .c.o:
  2020.              $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<
  2021.      
  2022.      install: installdirs all $(srcdir)/cpio.1 $(srcdir)/mt.1
  2023.              $(INSTALL_PROGRAM) cpio $(bindir)/$(binprefix)cpio
  2024.              test ! -f mt || $(INSTALL_PROGRAM) mt $(bindir)/$(binprefix)mt
  2025.              -test ! -f rmt || $(INSTALL_PROGRAM) rmt $(libdir)/rmt
  2026.              $(INSTALL_DATA) $(srcdir)/cpio.1 $(mandir)/$(manprefix)cpio.$(manext)
  2027.              test ! -f mt || \
  2028.              $(INSTALL_DATA) $(srcdir)/mt.1 $(mandir)/$(manprefix)mt.$(manext)
  2029.      
  2030.      installdirs:
  2031.              $(srcdir)/mkinstalldirs $(bindir) $(libdir) $(mandir)
  2032.      
  2033.      uninstall:
  2034.              cd $(bindir); rm -f $(binprefix)cpio $(binprefix)mt
  2035.              -rm -f $(libdir)/rmt
  2036.              cd $(mandir); rm -f $(manprefix)cpio.$(manext) $(manprefix)mt.$(manext)
  2037.      
  2038.      check:
  2039.              @echo No tests are supplied.
  2040.      
  2041.      cpio: $(OBJS)
  2042.              $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  2043.      
  2044.      rmt: rmt.o
  2045.              $(CC) $(LDFLAGS) -o $@ rmt.o $(LIBS)
  2046.      
  2047.      mt: $(MT_OBJS)
  2048.              $(CC) $(LDFLAGS) -o $@ $(MT_OBJS) $(LIBS)
  2049.      
  2050.      Makefile: Makefile.in config.status
  2051.              $(SHELL) config.status
  2052.      config.status: configure
  2053.              $(SHELL) config.status --recheck
  2054.      configure: configure.in
  2055.              cd $(srcdir); autoconf
  2056.      
  2057.      TAGS: $(SRCS)
  2058.              etags $(SRCS)
  2059.      
  2060.      clean:
  2061.              rm -f cpio rmt mt *.o core
  2062.      
  2063.      mostlyclean: clean
  2064.      
  2065.      distclean: clean
  2066.              rm -f Makefile config.status
  2067.      
  2068.      realclean: distclean
  2069.              rm -f TAGS
  2070.      
  2071.      dist: $(DISTFILES)
  2072.              echo cpio-`sed -e '/version_string/!d' \
  2073.              -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
  2074.              rm -rf `cat .fname`
  2075.              mkdir `cat .fname`
  2076.              -ln $(DISTFILES) `cat .fname`
  2077.              for file in $(DISTFILES); do \
  2078.                test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
  2079.              done
  2080.              tar chzf `cat .fname`.tar.gz `cat .fname`
  2081.              rm -rf `cat .fname` .fname
  2082. File: autoconf.info,  Node: Preprocessor Symbol Index,  Next: Macro Index,  Prev: Example,  Up: Top
  2083. Preprocessor Symbol Index
  2084. *************************
  2085.    This is an alphabetical list of the C preprocessor symbols that the
  2086. Autoconf macros define.  To work with Autoconf, C source code needs to
  2087. use these names in `#if' directives.
  2088. * Menu:
  2089. * CC:                                   Overriding variables.
  2090. * CONFIG_FILES:                         Invoking config.status.
  2091. * CONFIG_HEADERS:                       Invoking config.status.
  2092. * CONFIG_SHELL:                         Invoking config.status.
  2093. * const:                                Compiler Characteristics.
  2094. * C_ALLOCA:                             Library Functions.
  2095. * DEFS:                                 Predefined Variables.
  2096. * DEFS:                                 Overriding variables.
  2097. * DGUX:                                 Library Functions.
  2098. * DIRENT:                               Header Files.
  2099. * exec_prefix:                          Predefined Variables.
  2100. * GETGROUPS_T:                          Typedefs.
  2101. * GETLODAVG_PRIVILEGED:                 Library Functions.
  2102. * gid_t:                                Typedefs.
  2103. * HAVE_FUNCTION:                        General Feature Tests.
  2104. * HAVE_HEADER:                          General Feature Tests.
  2105. * HAVE_ALLOCA_H:                        Library Functions.
  2106. * HAVE_CONFIG_H:                        Setup.
  2107. * HAVE_DOPRNT:                          Library Functions.
  2108. * HAVE_LONG_DOUBLE:                     Compiler Characteristics.
  2109. * HAVE_LONG_FILE_NAMES:                 System Services.
  2110. * HAVE_MMAP:                            Library Functions.
  2111. * HAVE_NETDB_H:                         Alternative Programs.
  2112. * HAVE_RESTARTABLE_SYSCALLS:            System Services.
  2113. * HAVE_STRCOLL:                         Library Functions.
  2114. * HAVE_ST_BLKSIZE:                      Structures.
  2115. * HAVE_ST_BLOCKS:                       Structures.
  2116. * HAVE_ST_RDEV:                         Structures.
  2117. * HAVE_SYS_MTIO_H:                      System Services.
  2118. * HAVE_TM_ZONE:                         Structures.
  2119. * HAVE_TZNAME:                          Structures.
  2120. * HAVE_UNISTD_H:                        Header Files.
  2121. * HAVE_UTIME_NULL:                      Library Functions.
  2122. * HAVE_VFORK_H:                         Library Functions.
  2123. * HAVE_VPRINTF:                         Library Functions.
  2124. * HAVE_WAIT3:                           Library Functions.
  2125. * inline:                               Compiler Characteristics.
  2126. * INSTALL:                              Overriding variables.
  2127. * INT_16_BITS:                          Compiler Characteristics.
  2128. * LIBOBJS:                              Predefined Variables.
  2129. * LIBS:                                 Overriding variables.
  2130. * LIBS:                                 Predefined Variables.
  2131. * LONG_64_BITS:                         Compiler Characteristics.
  2132. * MAJOR_IN_MKDEV:                       Header Files.
  2133. * MAJOR_IN_SYSMACROS:                   Header Files.
  2134. * mode_t:                               Typedefs.
  2135. * NDIR:                                 Header Files.
  2136. * NEED_MEMORY_H:                        Header Files.
  2137. * NEED_SETGID:                          Library Functions.
  2138. * NLIST_NAME_UNION:                     Library Functions.
  2139. * NLIST_STRUCT:                         Library Functions.
  2140. * NO_ARG_ARRAY:                         Compiler Characteristics.
  2141. * NO_MINUS_C_MINUS_O:                   Alternative Programs.
  2142. * NO_REMOTE:                            Alternative Programs.
  2143. * off_t:                                Typedefs.
  2144. * pid_t:                                Typedefs.
  2145. * prefix:                               Predefined Variables.
  2146. * RETSIGTYPE:                           Typedefs.
  2147. * SETVBUF_REVERSED:                     Library Functions.
  2148. * size_t:                               Typedefs.
  2149. * srcdir:                               Predefined Variables.
  2150. * STDC_HEADERS:                         Header Files.
  2151. * SVR4:                                 Library Functions.
  2152. * SYSDIR:                               Header Files.
  2153. * SYSNDIR:                              Header Files.
  2154. * SYS_SIGLIST_DECLARED:                 Header Files.
  2155. * TIME_WITH_SYS_TIME:                   Structures.
  2156. * TM_IN_SYS_TIME:                       Structures.
  2157. * top_srcdir:                           Predefined Variables.
  2158. * uid_t:                                Typedefs.
  2159. * UMAX:                                 Library Functions.
  2160. * UMAX4_3:                              Library Functions.
  2161. * USG:                                  Header Files.
  2162. * vfork:                                Library Functions.
  2163. * VOID_CLOSEDIR:                        UNIX Variants.
  2164. * VOID_CLOSEDIR:                        Header Files.
  2165. * WORDS_BIGENDIAN:                      Compiler Characteristics.
  2166. * YYTEXT_POINTER:                       Alternative Programs.
  2167. * _ALL_SOURCE:                          UNIX Variants.
  2168. * _MINIX:                               UNIX Variants.
  2169. * _POSIX_1_SOURCE:                      UNIX Variants.
  2170. * _POSIX_SOURCE:                        UNIX Variants.
  2171. * _POSIX_SOURCE:                        UNIX Variants.
  2172. * _POSIX_VERSION:                       Header Files.
  2173. * __CHAR_UNSIGNED__:                    Compiler Characteristics.
  2174. File: autoconf.info,  Node: Macro Index,  Prev: Preprocessor Symbol Index,  Up: Top
  2175. Macro Index
  2176. ***********
  2177.    This is an alphabetical list of the Autoconf macros.  To make the
  2178. list easier to use, the macros are listed without their preceding `AC_'.
  2179. * Menu:
  2180. * AIX:                                  UNIX Variants.
  2181. * ALLOCA:                               Library Functions.
  2182. * ARG_ARRAY:                            Compiler Characteristics.
  2183. * BEFORE:                               Macro Ordering.
  2184. * CHAR_UNSIGNED:                        Compiler Characteristics.
  2185. * CHECKING:                             Printing Messages.
  2186. * COMPILE_CHECK:                        General Feature Tests.
  2187. * CONFIG_HEADER:                        Setup.
  2188. * CONST:                                Compiler Characteristics.
  2189. * CROSS_CHECK:                          Compiler Characteristics.
  2190. * DEFINE:                               Setting Variables.
  2191. * DEFINE_UNQUOTED:                      Setting Variables.
  2192. * DIR_HEADER:                           Header Files.
  2193. * DYNIX_SEQ:                            UNIX Variants.
  2194. * ENABLE:                               Command Line.
  2195. * ERROR:                                Printing Messages.
  2196. * FIND_X:                               System Services.
  2197. * FIND_XTRA:                            System Services.
  2198. * FUNC_CHECK:                           General Feature Tests.
  2199. * GCC_TRADITIONAL:                      Alternative Programs.
  2200. * GETGROUPS_T:                          Typedefs.
  2201. * GETLOADAVG:                           Library Functions.
  2202. * HAVE_FUNCS:                           General Feature Tests.
  2203. * HAVE_HEADERS:                         General Feature Tests.
  2204. * HAVE_LIBRARY:                         General Feature Tests.
  2205. * HAVE_LONG_DOUBLE:                     Compiler Characteristics.
  2206. * HAVE_POUNDBANG:                       System Services.
  2207. * HEADER_CHECK:                         General Feature Tests.
  2208. * HEADER_EGREP:                         General Feature Tests.
  2209. * INIT:                                 Setup.
  2210. * INLINE:                               Compiler Characteristics.
  2211. * INT_16_BITS:                          Compiler Characteristics.
  2212. * IRIX_SUN:                             UNIX Variants.
  2213. * ISC_POSIX:                            UNIX Variants.
  2214. * LANG_C:                               Language Choice.
  2215. * LANG_CPLUSPLUS:                       Language Choice.
  2216. * LANG_RESTORE:                         Language Choice.
  2217. * LANG_SAVE:                            Language Choice.
  2218. * LN_S:                                 Alternative Programs.
  2219. * LONG_64_BITS:                         Compiler Characteristics.
  2220. * LONG_FILE_NAMES:                      System Services.
  2221. * MAJOR_HEADER:                         Header Files.
  2222. * MEMORY_H:                             Header Files.
  2223. * MINIX:                                UNIX Variants.
  2224. * MINUS_C_MINUS_O:                      Alternative Programs.
  2225. * MMAP:                                 Library Functions.
  2226. * MODE_T:                               Typedefs.
  2227. * OBSOLETE:                             Macro Ordering.
  2228. * OFF_T:                                Typedefs.
  2229. * OUTPUT:                               Setup.
  2230. * PID_T:                                Typedefs.
  2231. * PREFIX:                               Command Line.
  2232. * PREPARE:                              Setup.
  2233. * PREREQ:                               Setup.
  2234. * PROGRAMS_CHECK:                       General Feature Tests.
  2235. * PROGRAMS_PATH:                        General Feature Tests.
  2236. * PROGRAM_CHECK:                        General Feature Tests.
  2237. * PROGRAM_EGREP:                        General Feature Tests.
  2238. * PROGRAM_PATH:                         General Feature Tests.
  2239. * PROG_AWK:                             Alternative Programs.
  2240. * PROG_CC:                              Alternative Programs.
  2241. * PROG_CPP:                             Alternative Programs.
  2242. * PROG_CXX:                             Alternative Programs.
  2243. * PROG_CXXCPP:                          Alternative Programs.
  2244. * PROG_INSTALL:                         Alternative Programs.
  2245. * PROG_LEX:                             Alternative Programs.
  2246. * PROG_RANLIB:                          Alternative Programs.
  2247. * PROG_YACC:                            Alternative Programs.
  2248. * PROVIDE:                              Macro Ordering.
  2249. * REMOTE_TAPE:                          System Services.
  2250. * REPLACE_FUNCS:                        General Feature Tests.
  2251. * REQUIRE:                              Macro Ordering.
  2252. * REQUIRE_CPP:                          Language Choice.
  2253. * RESTARTABLE_SYSCALLS:                 System Services.
  2254. * RETSIGTYPE:                           Typedefs.
  2255. * REVISION:                             Setup.
  2256. * RSH:                                  Alternative Programs.
  2257. * SCO_INTL:                             UNIX Variants.
  2258. * SETVBUF_REVERSED:                     Library Functions.
  2259. * SET_MAKE:                             Alternative Programs.
  2260. * SIZEOF_TYPE:                          General Feature Tests.
  2261. * SIZE_T:                               Typedefs.
  2262. * STAT_MACROS_BROKEN:                   Structures.
  2263. * STAT_MACROS_BROKEN:                   Structures.
  2264. * STDC_HEADERS:                         Header Files.
  2265. * STRCOLL:                              Library Functions.
  2266. * STRUCT_TM:                            Structures.
  2267. * ST_BLKSIZE:                           Structures.
  2268. * ST_BLOCKS:                            Structures.
  2269. * ST_RDEV:                              Structures.
  2270. * SUBST:                                Setting Variables.
  2271. * SYS_SIGLIST_DECLARED:                 Header Files.
  2272. * TEST_CPP:                             General Feature Tests.
  2273. * TEST_PROGRAM:                         General Feature Tests.
  2274. * TIMEZONE:                             Structures.
  2275. * TIME_WITH_SYS_TIME:                   Structures.
  2276. * UID_T:                                Typedefs.
  2277. * UNISTD_H:                             Header Files.
  2278. * USG:                                  Header Files.
  2279. * UTIME_NULL:                           Library Functions.
  2280. * VERBOSE:                              Printing Messages.
  2281. * VFORK:                                Library Functions.
  2282. * VPRINTF:                              Library Functions.
  2283. * WAIT3:                                Library Functions.
  2284. * WARN:                                 Printing Messages.
  2285. * WITH:                                 Command Line.
  2286. * WORDS_BIGENDIAN:                      Compiler Characteristics.
  2287. * XENIX_DIR:                            UNIX Variants.
  2288. * YYTEXT_POINTER:                       Alternative Programs.
  2289. Tag Table:
  2290. Node: Top
  2291. Node: Introduction
  2292. Node: Distributing
  2293. Node: Making configure Scripts
  2294. Node: Writing configure.in
  2295. 12048
  2296. Node: Invoking autoconf
  2297. 14481
  2298. Node: Invoking autoheader
  2299. 16330
  2300. Node: Specific Tests
  2301. 18483
  2302. Node: Alternative Programs
  2303. 20155
  2304. Node: Header Files
  2305. 25649
  2306. Node: Typedefs
  2307. 31334
  2308. Node: Library Functions
  2309. 32551
  2310. Node: Structures
  2311. 37322
  2312. Node: Compiler Characteristics
  2313. 39412
  2314. Node: System Services
  2315. 42224
  2316. Node: UNIX Variants
  2317. 44729
  2318. Node: General Purpose Macros
  2319. 46637
  2320. Node: Setup
  2321. 47788
  2322. Node: General Feature Tests
  2323. 52742
  2324. Node: Command Line
  2325. 62009
  2326. Node: Setting Variables
  2327. 65823
  2328. Node: Printing Messages
  2329. 69155
  2330. Node: Language Choice
  2331. 71383
  2332. Node: Macro Ordering
  2333. 73004
  2334. Node: Writing Macros
  2335. 75750
  2336. Node: Macro Format
  2337. 77246
  2338. Node: Quoting
  2339. 78743
  2340. Node: Dependencies Between Macros
  2341. 80201
  2342. Node: Prerequisite Macros
  2343. 80788
  2344. Node: Suggested Ordering
  2345. 81837
  2346. Node: Checking for Files
  2347. 83216
  2348. Node: Checking for Symbols
  2349. 84002
  2350. Node: Test Programs
  2351. 85481
  2352. Node: Guidelines
  2353. 87146
  2354. Node: Tricks
  2355. 88289
  2356. Node: Multiple Cases
  2357. 89292
  2358. Node: Makefiles
  2359. 90496
  2360. Node: Predefined Variables
  2361. 91897
  2362. Node: Installation Prefixes
  2363. 93405
  2364. Node: VPATH Substitutions
  2365. 94975
  2366. Node: Automatic Remaking
  2367. 96696
  2368. Node: Invoking configure
  2369. 98280
  2370. Node: Overriding variables
  2371. 101768
  2372. Node: Invoking config.status
  2373. 103391
  2374. Node: Example
  2375. 106370
  2376. Node: Sample configure.in
  2377. 106950
  2378. Node: Sample Makefile.in
  2379. 108087
  2380. Node: Preprocessor Symbol Index
  2381. 112072
  2382. Node: Macro Index
  2383. 117329
  2384. End Tag Table
  2385.