home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / autoconf-1.4 / autoconf.info < prev    next >
Encoding:
GNU Info File  |  1993-05-15  |  89.8 KB  |  2,190 lines

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