📄 autoconf.texi
字号:
Common Behavior* Standard Symbols:: Symbols defined by the macros* Default Includes:: Includes used by the generic macrosAlternative Programs* Particular Programs:: Special handling to find certain programs* Generic Programs:: How to find other programsLibrary Functions* Function Portability:: Pitfalls with usual functions* Particular Functions:: Special handling to find certain functions* Generic Functions:: How to find other functionsHeader Files* Header Portability:: Collected knowledge on common headers* Particular Headers:: Special handling to find certain headers* Generic Headers:: How to find other headersDeclarations* Particular Declarations:: Macros to check for certain declarations* Generic Declarations:: How to find other declarationsStructures* Particular Structures:: Macros to check for certain structure members* Generic Structures:: How to find other structure membersTypes* Particular Types:: Special handling to find certain types* Generic Types:: How to find other typesCompilers and Preprocessors* Specific Compiler Characteristics:: Some portability issues* Generic Compiler Characteristics:: Language independent tests and features* C Compiler:: Checking its characteristics* C++ Compiler:: Likewise* Fortran Compiler:: LikewiseWriting Tests* Language Choice:: Selecting which language to use for testing* Writing Test Programs:: Forging source files for compilers* Running the Preprocessor:: Detecting preprocessor symbols* Running the Compiler:: Detecting language or header features* Running the Linker:: Detecting library features* Run Time:: Testing for run-time features* Systemology:: A zoology of operating systems* Multiple Cases:: Tests for several possible valuesWriting Test Programs* Guidelines:: General rules for writing test programs* Test Functions:: Avoiding pitfalls in test programs* Generating Sources:: Source program boilerplateResults of Tests* Defining Symbols:: Defining C preprocessor symbols* Setting Output Variables:: Replacing variables in output files* Caching Results:: Speeding up subsequent @command{configure} runs* Printing Messages:: Notifying @command{configure} usersCaching Results* Cache Variable Names:: Shell variables used in caches* Cache Files:: Files @command{configure} uses for caching* Cache Checkpointing:: Loading and saving the cache fileProgramming in M4* M4 Quotation:: Protecting macros from unwanted expansion* Using autom4te:: The Autoconf executables backbone* Programming in M4sugar:: Convenient pure M4 macros* Programming in M4sh:: Common shell ConstructsM4 Quotation* Active Characters:: Characters that change the behavior of M4* One Macro Call:: Quotation and one macro call* Quotation and Nested Macros:: Macros calling macros* Changequote is Evil:: Worse than INTERCAL: M4 + changequote* Quadrigraphs:: Another way to escape special characters* Quotation Rule Of Thumb:: One parenthesis, one quoteUsing @command{autom4te}* autom4te Invocation:: A @acronym{GNU} M4 wrapper* Customizing autom4te:: Customizing the Autoconf packageProgramming in M4sugar* Redefined M4 Macros:: M4 builtins changed in M4sugar* Evaluation Macros:: More quotation and evaluation control* Forbidden Patterns:: Catching unexpanded macrosWriting Autoconf Macros* Macro Definitions:: Basic format of an Autoconf macro* Macro Names:: What to call your new macros* Reporting Messages:: Notifying @command{autoconf} users* Dependencies Between Macros:: What to do when macros depend on other macros* Obsoleting Macros:: Warning about old ways of doing things* Coding Style:: Writing Autoconf macros @`a la AutoconfDependencies Between Macros* Prerequisite Macros:: Ensuring required information* Suggested Ordering:: Warning about possible ordering problemsPortable Shell Programming* Shellology:: A zoology of shells* Here-Documents:: Quirks and tricks* File Descriptors:: FDs and redirections* File System Conventions:: File- and pathnames* Shell Substitutions:: Variable and command expansions* Assignments:: Varying side effects of assignments* Parentheses:: Parentheses in shell scripts* Special Shell Variables:: Variables you should not change* Limitations of Builtins:: Portable use of not so portable /bin/sh* Limitations of Usual Tools:: Portable use of portable tools* Limitations of Make:: Portable MakefilesManual Configuration* Specifying Names:: Specifying the system type* Canonicalizing:: Getting the canonical system type* Using System Type:: What to do with the system typeSite Configuration* External Software:: Working with other optional software* Package Options:: Selecting optional features* Pretty Help Strings:: Formatting help string* Site Details:: Configuring site details* Transforming Names:: Changing program names when installing* Site Defaults:: Giving @command{configure} local defaultsTransforming Program Names When Installing* Transformation Options:: @command{configure} options to transform names* Transformation Examples:: Sample uses of transforming names* Transformation Rules:: @file{Makefile} uses of transforming namesRunning @command{configure} Scripts* Basic Installation:: Instructions for typical cases* Compilers and Options:: Selecting compilers and optimization* Multiple Architectures:: Compiling for multiple architectures at once* Installation Names:: Installing in different directories* Optional Features:: Selecting optional features* System Type:: Specifying the system type* Sharing Defaults:: Setting site-wide defaults for @command{configure}* Defining Variables:: Specifying the compiler etc.* configure Invocation:: Changing how @command{configure} runsObsolete Constructs* Obsolete config.status Use:: Different calling convention* acconfig.h:: Additional entries in @file{config.h.in}* autoupdate Invocation:: Automatic update of @file{configure.ac}* Obsolete Macros:: Backward compatibility macros* Autoconf 1:: Tips for upgrading your files* Autoconf 2.13:: Some fresher tipsUpgrading From Version 1* Changed File Names:: Files you might rename* Changed Makefiles:: New things to put in @file{Makefile.in}* Changed Macros:: Macro calls you might replace* Changed Results:: Changes in how to check test results* Changed Macro Writing:: Better ways to write your own macrosUpgrading From Version 2.13* Changed Quotation:: Broken code which used to work* New Macros:: Interaction with foreign macros* Hosts and Cross-Compilation:: Bugward compatibility kludges* AC_LIBOBJ vs LIBOBJS:: LIBOBJS is a forbidden token* AC_FOO_IFELSE vs AC_TRY_FOO:: A more generic scheme for testing sourcesGenerating Test Suites with Autotest* Using an Autotest Test Suite:: Autotest and the user* Writing testsuite.at:: Autotest macros* testsuite Invocation:: Running @command{testsuite} scripts* Making testsuite Scripts:: Using autom4te to create @command{testsuite}Using an Autotest Test Suite* testsuite Scripts:: The concepts of Autotest* Autotest Logs:: Their contentsFrequent Autoconf Questions, with answers* Distributing:: Distributing @command{configure} scripts* Why GNU m4:: Why not use the standard M4?* Bootstrapping:: Autoconf and @acronym{GNU} M4 require each other?* Why Not Imake:: Why @acronym{GNU} uses @command{configure} instead of Imake* Defining Directories:: Passing @code{datadir} to program* autom4te.cache:: What is it? Can I remove it?* Present But Cannot Be Compiled:: Compiler and Preprocessor DisagreeHistory of Autoconf* Genesis:: Prehistory and naming of @command{configure}* Exodus:: The plagues of M4 and Perl* Leviticus:: The priestly code of portability arrives* Numbers:: Growth and contributors* Deuteronomy:: Approaching the promises of easy configurationCopying This Manual* GNU Free Documentation License:: License for copying this manualIndices* Environment Variable Index:: Index of environment variables used* Output Variable Index:: Index of variables set in output files* Preprocessor Symbol Index:: Index of C preprocessor symbols defined* Autoconf Macro Index:: Index of Autoconf macros* M4 Macro Index:: Index of M4, M4sugar, and M4sh macros* Autotest Macro Index:: Index of Autotest macros* Program & Function Index:: Index of those with portability problems* Concept Index:: General index@end detailmenu@end menu@c ============================================================= Introduction.@node Introduction@chapter Introduction@flushrightA physicist, an engineer, and a computer scientist were discussing thenature of God. ``Surely a Physicist,'' said the physicist, ``becauseearly in the Creation, God made Light; and you know, Maxwell'sequations, the dual nature of electromagnetic waves, the relativisticconsequences@dots{}'' ``An Engineer!,'' said the engineer, ``becausebefore making Light, God split the Chaos into Land and Water; it takes ahell of an engineer to handle that big amount of mud, and orderlyseparation of solids from liquids@dots{}'' The computer scientistshouted: ``And the Chaos, where do you think it was coming from, hmm?''---Anonymous@end flushright@c (via Franc,ois Pinard)Autoconf is a tool for producing shell scripts that automaticallyconfigure software source code packages to adapt to many kinds of@sc{unix}-like systems. The configuration scripts produced by Autoconfare independent of Autoconf when they are run, so their users do notneed to have Autoconf.The configuration scripts produced by Autoconf require no manual userintervention when run; they do not normally even need an argumentspecifying the system type. Instead, they individually test for thepresence of each feature that the software package they are for might need.(Before each check, they print a one-line message stating what they arechecking for, so the user doesn't get too bored while waiting for thescript to finish.) As a result, they deal well with systems that arehybrids or customized from the more common @sc{unix} variants. There isno need to maintain files that list the features supported by eachrelease of each variant of @sc{unix}.For each software package that Autoconf is used with, it creates aconfiguration script from a template file that lists the system featuresthat the package needs or can use. After the shell code to recognizeand respond to a system feature has been written, Autoconf allows it tobe shared by many software packages that can use (or need) that feature.If it later turns out that the shell code needs adjustment for somereason, it needs to be changed in only one place; all of theconfiguration scripts can be regenerated automatically to take advantageof the updated code.The Metaconfig package is similar in purpose to Autoconf, but thescripts it produces require manual user intervention, which is quiteinconvenient when configuring large source trees. Unlike Metaconfigscripts, Autoconf scripts can support cross-compiling, if some care istaken in writing them.Autoconf does not solve all problems related to making portablesoftware packages---for a more complete solution, it should be used inconcert with other @acronym{GNU} build tools like Automake andLibtool. These other tools take on jobs like the creation of aportable, recursive @file{Makefile} with all of the standard targets,linking of shared libraries, and so on. @xref{The GNU Build System},for more information.Autoconf imposes some restrictions on the names of macros used with@code{#if} in C programs (@pxref{Preprocessor Symbol Index}).Autoconf requires @acronym{GNU} M4 in order to generate the scripts. It usesfeatures that some @sc{unix} versions of M4, including @acronym{GNU} M4 1.3,do not have. You must use version 1.4 or later of @acronym{GNU} M4.@xref{Autoconf 1}, for information about upgrading from version 1.@xref{History}, for the story of Autoconf's development. @xref{FAQ},for answers to some common questions about Autoconf.See the @href{http://www.gnu.org/software/autoconf/autoconf.html,Autoconf web page} for up-to-date information, details on the mailinglists, pointers to a list of known bugs, etc.Mail suggestions to @email{autoconf@@gnu.org, the Autoconf mailinglist}.Bug reports should be preferably submitted to the@href{http://bugs.gnu.org/cgi-bin/gnatsweb.pl?database=autoconf,Autoconf Gnats database}, or sent to @email{bug-autoconf@@gnu.org, theAutoconf Bugs mailing list}. If possible, first check that your bug isnot already solved in current development versions, and that it has notbeen reported yet. Be sure to include all the needed information and ashort @file{configure.ac} that demonstrates the problem.Autoconf's development tree is accessible via @acronym{CVS}; see the Autoconfweb page for details. There is also a@href{http://subversions.gnu.org/cgi-bin/cvsweb/autoconf/, @acronym{CVS}webinterface to the Autoconf development tree}. Patches relative to thecurrent @acronym{CVS} version can be sent for review to the@email{autoconf-patches@@gnu.org, Autoconf Patches mailing list}.Because of its mission, Autoconf includes only a set of often-usedmacros that have already demonstrated their usefulness. Nevertheless,if you wish to share your macros, or find existing ones, see the@href{http://www.gnu.org/software/ac-archive/, Autoconf MacroArchive}, which is kindly run by @email{simons@@computer.org,Peter Simons}.@c ================================================= The GNU Build System@node The GNU Build System@chapter The @acronym{GNU} Build System
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -