\chapentry{Introduction}{1}{1} \chapentry{The \acronym {GNU} Build System}{2}{3} \secentry{Automake}{2}{1}{3} \secentry{Libtool}{2}{2}{4} \secentry{Pointers}{2}{3}{4} \chapentry{Making \command {configure} Scripts}{3}{7} \secentry{Writing \file {configure.ac}}{3}{1}{8} \subsecentry{A Shell Script Compiler}{3}{1}{1}{8} \subsecentry{The Autoconf Language}{3}{1}{2}{9} \subsecentry{Standard \file {configure.ac} Layout}{3}{1}{3}{10} \secentry{Using \command {autoscan} to Create \file {configure.ac}}{3}{2}{11} \secentry{Using \command {ifnames} to List Conditionals}{3}{3}{12} \secentry{Using \command {autoconf} to Create \command {configure}}{3}{4}{12} \secentry{Using \command {autoreconf} to Update \command {configure} Scripts}{3}{5}{14} \chapentry{Initialization and Output Files}{4}{17} \secentry{Initializing \command {configure}}{4}{1}{17} \secentry{Notices in \command {configure}}{4}{2}{17} \secentry{Finding \command {configure} Input}{4}{3}{18} \secentry{Outputting Files}{4}{4}{19} \secentry{Performing Configuration Actions}{4}{5}{19} \secentry{Creating Configuration Files}{4}{6}{21} \secentry{Substitutions in Makefiles}{4}{7}{22} \subsecentry{Preset Output Variables}{4}{7}{1}{22} \subsecentry{Installation Directory Variables}{4}{7}{2}{24} \subsecentry{Build Directories}{4}{7}{3}{27} \subsecentry{Automatic Remaking}{4}{7}{4}{28} \secentry{Configuration Header Files}{4}{8}{28} \subsecentry{Configuration Header Templates}{4}{8}{1}{29} \subsecentry{Using \command {autoheader} to Create \file {config.h.in}}{4}{8}{2}{30} \subsecentry{Autoheader Macros}{4}{8}{3}{31} \secentry{Running Arbitrary Configuration Commands}{4}{9}{32} \secentry{Creating Configuration Links}{4}{10}{33} \secentry{Configuring Other Packages in Subdirectories}{4}{11}{33} \secentry{Default Prefix}{4}{12}{34} \chapentry{Existing Tests}{5}{35} \secentry{Common Behavior}{5}{1}{35} \subsecentry{Standard Symbols}{5}{1}{1}{35} \subsecentry{Default Includes}{5}{1}{2}{35} \secentry{Alternative Programs}{5}{2}{37} \subsecentry{Particular Program Checks}{5}{2}{1}{37} \subsecentry{Generic Program and File Checks}{5}{2}{2}{39} \secentry{Files}{5}{3}{40} \secentry{Library Files}{5}{4}{40} \secentry{Library Functions}{5}{5}{41} \subsecentry{Portability of C Functions}{5}{5}{1}{41} \subsecentry{Particular Function Checks}{5}{5}{2}{42} \subsecentry{Generic Function Checks}{5}{5}{3}{48} \secentry{Header Files}{5}{6}{50} \subsecentry{Portability of Headers}{5}{6}{1}{50} \subsecentry{Particular Header Checks}{5}{6}{2}{50} \subsecentry{Generic Header Checks}{5}{6}{3}{54} \secentry{Declarations}{5}{7}{55} \subsecentry{Particular Declaration Checks}{5}{7}{1}{55} \subsecentry{Generic Declaration Checks}{5}{7}{2}{55} \secentry{Structures}{5}{8}{56} \subsecentry{Particular Structure Checks}{5}{8}{1}{56} \subsecentry{Generic Structure Checks}{5}{8}{2}{57} \secentry{Types}{5}{9}{57} \subsecentry{Particular Type Checks}{5}{9}{1}{58} \subsecentry{Generic Type Checks}{5}{9}{2}{58} \secentry{Compilers and Preprocessors}{5}{10}{59} \subsecentry{Specific Compiler Characteristics}{5}{10}{1}{59} \subsecentry{Generic Compiler Characteristics}{5}{10}{2}{60} \subsecentry{C Compiler Characteristics}{5}{10}{3}{60} \subsecentry{C++ Compiler Characteristics}{5}{10}{4}{64} \subsecentry{Fortran 77 Compiler Characteristics}{5}{10}{5}{64} \secentry{System Services}{5}{11}{67} \secentry{UNIX Variants}{5}{12}{68} \chapentry{Writing Tests}{6}{71} \secentry{Language Choice}{6}{1}{71} \secentry{Writing Test Programs}{6}{2}{72} \subsecentry{Guidelines for Test Programs}{6}{2}{1}{72} \subsecentry{Test Functions}{6}{2}{2}{73} \subsecentry{Generating Sources}{6}{2}{3}{73} \secentry{Running the Preprocessor}{6}{3}{75} \secentry{Running the Compiler}{6}{4}{77} \secentry{Running the Linker}{6}{5}{77} \secentry{Checking Run Time Behavior}{6}{6}{78} \secentry{Systemology}{6}{7}{79} \secentry{Multiple Cases}{6}{8}{79} \chapentry{Results of Tests}{7}{81} \secentry{Defining C Preprocessor Symbols}{7}{1}{81} \secentry{Setting Output Variables}{7}{2}{82} \secentry{Caching Results}{7}{3}{84} \subsecentry{Cache Variable Names}{7}{3}{1}{85} \subsecentry{Cache Files}{7}{3}{2}{86} \subsecentry{Cache Checkpointing}{7}{3}{3}{86} \secentry{Printing Messages}{7}{4}{87} \chapentry{Programming in M4}{8}{89} \secentry{M4 Quotation}{8}{1}{89} \subsecentry{Active Characters}{8}{1}{1}{89} \subsecentry{One Macro Call}{8}{1}{2}{90} \subsecentry{Quotation and Nested Macros}{8}{1}{3}{91} \subsecentry{\code {changequote} is Evil}{8}{1}{4}{92} \subsecentry{Quadrigraphs}{8}{1}{5}{93} \subsecentry{Quotation Rule Of Thumb}{8}{1}{6}{94} \secentry{Using \command {autom4te}}{8}{2}{95} \subsecentry{Invoking \command {autom4te}}{8}{2}{1}{95} \subsecentry{Customizing \command {autom4te}}{8}{2}{2}{99} \secentry{Programming in M4sugar}{8}{3}{100} \subsecentry{Redefined M4 Macros}{8}{3}{1}{100} \subsecentry{Evaluation Macros}{8}{3}{2}{101} \subsecentry{Forbidden Patterns}{8}{3}{3}{102} \secentry{Programming in M4sh}{8}{4}{102} \chapentry{Writing Autoconf Macros}{9}{105} \secentry{Macro Definitions}{9}{1}{105} \secentry{Macro Names}{9}{2}{105} \secentry{Reporting Messages}{9}{3}{106} \secentry{Dependencies Between Macros}{9}{4}{107} \subsecentry{Prerequisite Macros}{9}{4}{1}{107} \subsecentry{Suggested Ordering}{9}{4}{2}{108} \secentry{Obsoleting Macros}{9}{5}{109} \secentry{Coding Style}{9}{6}{109} \chapentry{Portable Shell Programming}{10}{113} \secentry{Shellology}{10}{1}{113} \secentry{Here-Documents}{10}{2}{115} \secentry{File Descriptors}{10}{3}{116} \secentry{File System Conventions}{10}{4}{117} \secentry{Shell Substitutions}{10}{5}{118} \secentry{Assignments}{10}{6}{121} \secentry{Special Shell Variables}{10}{7}{122} \secentry{Limitations of Shell Builtins}{10}{8}{126} \secentry{Limitations of Usual Tools}{10}{9}{132} \secentry{Limitations of Make}{10}{10}{139} \chapentry{Manual Configuration}{11}{149} \secentry{Specifying the System Type}{11}{1}{149} \secentry{Getting the Canonical System Type}{11}{2}{150} \secentry{Using the System Type}{11}{3}{150} \chapentry{Site Configuration}{12}{153} \secentry{Working With External Software}{12}{1}{153} \secentry{Choosing Package Options}{12}{2}{154} \secentry{Making Your Help Strings Look Pretty}{12}{3}{155} \secentry{Configuring Site Details}{12}{4}{156} \secentry{Transforming Program Names When Installing}{12}{5}{156} \subsecentry{Transformation Options}{12}{5}{1}{156} \subsecentry{Transformation Examples}{12}{5}{2}{156} \subsecentry{Transformation Rules}{12}{5}{3}{157} \secentry{Setting Site Defaults}{12}{6}{158} \chapentry{Running \command {configure} Scripts}{13}{161} \secentry{Basic Installation}{13}{1}{161} \secentry{Compilers and Options}{13}{2}{162} \secentry{Compiling For Multiple Architectures}{13}{3}{162} \secentry{Installation Names}{13}{4}{162} \secentry{Optional Features}{13}{5}{162} \secentry{Specifying the System Type}{13}{6}{163} \secentry{Sharing Defaults}{13}{7}{163} \secentry{Defining Variables}{13}{8}{163} \secentry{\command {configure} Invocation}{13}{9}{164} \chapentry{Recreating a Configuration}{14}{165} \chapentry{Obsolete Constructs}{15}{167} \secentry{Obsolete \file {config.status} Invocation}{15}{1}{167} \secentry{\file {acconfig.h}}{15}{2}{168} \secentry{Using \command {autoupdate} to Modernize \file {configure.ac}}{15}{3}{168} \secentry{Obsolete Macros}{15}{4}{169} \secentry{Upgrading From Version 1}{15}{5}{180} \subsecentry{Changed File Names}{15}{5}{1}{180} \subsecentry{Changed Makefiles}{15}{5}{2}{180} \subsecentry{Changed Macros}{15}{5}{3}{181} \subsecentry{Changed Results}{15}{5}{4}{181} \subsecentry{Changed Macro Writing}{15}{5}{5}{182} \secentry{Upgrading From Version 2.13}{15}{6}{182} \subsecentry{Changed Quotation}{15}{6}{1}{183} \subsecentry{New Macros}{15}{6}{2}{184} \subsecentry{Hosts and Cross-Compilation}{15}{6}{3}{184} \subsecentry{\code {AC_LIBOBJ} vs.\spacefactor =1000 \code {LIBOBJS}}{15}{6}{4}{186} \subsecentry{\code {AC_FOO_IFELSE} vs.\spacefactor =1000 \code {AC_TRY_FOO}}{15}{6}{5}{187} \chapentry{Generating Test Suites with Autotest}{16}{189} \secentry{Using an Autotest Test Suite}{16}{1}{189} \subsecentry{\command {testsuite} Scripts}{16}{1}{1}{189} \subsecentry{Autotest Logs}{16}{1}{2}{191} \secentry{Writing \file {testsuite.at}}{16}{2}{191} \secentry{Running \command {testsuite} Scripts}{16}{3}{193} \secentry{Making \command {testsuite} Scripts}{16}{4}{194} \chapentry{Frequent Autoconf Questions, with answers}{17}{197} \secentry{Distributing \command {configure} Scripts}{17}{1}{197} \secentry{Why Require \acronym {GNU} M4?}{17}{2}{197} \secentry{How Can I Bootstrap?}{17}{3}{197} \secentry{Why Not Imake?}{17}{4}{198} \secentry{How Do I \code {#define} Installation Directories?}{17}{5}{199} \secentry{What is \file {autom4te.cache}?}{17}{6}{200} \chapentry{History of Autoconf}{18}{201} \secentry{Genesis}{18}{1}{201} \secentry{Exodus}{18}{2}{201} \secentry{Leviticus}{18}{3}{202} \secentry{Numbers}{18}{4}{202} \secentry{Deuteronomy}{18}{5}{203} \appendixentry{Copying This Manual}{A}{205} \secentry{GNU Free Documentation License}{A}{1}{205} \subsecentry{ADDENDUM: How to use this License for your documents}{A}{1}{1}{211} \appendixentry{Indices}{B}{213} \secentry{Environment Variable Index}{B}{1}{213} \secentry{Output Variable Index}{B}{2}{213} \secentry{Preprocessor Symbol Index}{B}{3}{215} \secentry{Autoconf Macro Index}{B}{4}{217} \secentry{M4 Macro Index}{B}{5}{220} \secentry{Autotest Macro Index}{B}{6}{220} \secentry{Program and Function Index}{B}{7}{221} \secentry{Concept Index}{B}{8}{222} .