⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autoconf.texi

📁 autoconf是一个产生可以自动配置源代码包
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@section Using @command{autoconf} to Create @command{configure}@cindex @command{autoconf}To create @command{configure} from @file{configure.ac}, run the@command{autoconf} program with no arguments.  @command{autoconf} processes@file{configure.ac} with the M4 macro processor, using theAutoconf macros.  If you give @command{autoconf} an argument, it reads thatfile instead of @file{configure.ac} and writes the configuration scriptto the standard output instead of to @command{configure}.  If you give@command{autoconf} the argument @option{-}, it reads from the standardinput instead of @file{configure.ac} and writes the configuration scriptto the standard output.The Autoconf macros are defined in several files.  Some of the files aredistributed with Autoconf; @command{autoconf} reads them first.  Then itlooks for the optional file @file{acsite.m4} in the directory thatcontains the distributed Autoconf macro files, and for the optional file@file{aclocal.m4} in the current directory.  Those files can containyour site's or the package's own Autoconf macro definitions(@pxref{Writing Autoconf Macros}, for more information).  If a macro isdefined in more than one of the files that @command{autoconf} reads, thelast definition it reads overrides the earlier ones.@command{autoconf} accepts the following options:@table @option@item --help@itemx -hPrint a summary of the command line options and exit.@item --version@itemx -VPrint the version number of Autoconf and exit.@item --verbose@itemx -vReport processing steps.@item --debug@itemx -dDon't remove the temporary files.@item --force@itemx -fRemake @file{configure} even if newer than its input files.@item --include=@var{dir}@itemx -I @var{dir}Append @var{dir} to the include path.  Multiple invocations accumulate.@item --prepend-include=@var{dir}@item -B @var{dir}Prepend @var{dir} to the include path.  Multiple invocations accumulate.@item --output=@var{file}@itemx -o @var{file}Save output (script or trace) to @var{file}.  The file @option{-} standsfor the standard output.@item --warnings=@var{category}@itemx -W @var{category}@evindex WARNINGSReport the warnings related to @var{category} (which can actually be acomma separated list).  @xref{Reporting Messages}, macro@code{AC_DIAGNOSE}, for a comprehensive list of categories.  Specialvalues include:@table @samp@item allreport all the warnings@item nonereport none@item errortreats warnings as errors@item no-@var{category}disable warnings falling into @var{category}@end tableWarnings about @samp{syntax} are enabled by default, and the environmentvariable @env{WARNINGS}, a comma separated list of categories, ishonored as well.  Passing @option{-W @var{category}} actually behaves as ifyou had passed @option{--warnings=syntax,$WARNINGS,@var{category}}.  Ifyou want to disable the defaults and @env{WARNINGS}, but (for example)enable the warnings about obsolete constructs, you would use @option{-Wnone,obsolete}.@cindex Back trace@cindex Macro invocation stackBecause @command{autoconf} uses @command{autom4te} behind the scenes, itdisplays a back trace for errors, but not for warnings; if you wantthem, just pass @option{-W error}.  @xref{autom4te Invocation}, for someexamples.@item --trace=@var{macro}[:@var{format}]@itemx -t @var{macro}[:@var{format}]Do not create the @command{configure} script, but list the calls to@var{macro} according to the @var{format}.  Multiple @option{--trace}arguments can be used to list several macros.  Multiple @option{--trace}arguments for a single macro are not cumulative; instead, you shouldjust make @var{format} as long as needed.The @var{format} is a regular string, with newlines if desired, andseveral special escape codes.  It defaults to @samp{$f:$l:$n:$%}; see@ref{autom4te Invocation}, for details on the @var{format}.@item --initialization@itemx -iBy default, @option{--trace} does not trace the initialization of theAutoconf macros (typically the @code{AC_DEFUN} definitions).  Thisresults in a noticeable speedup, but can be disabled by this option.@end tableIt is often necessary to check the content of a @file{configure.ac}file, but parsing it yourself is extremely fragile and error-prone.  Itis suggested that you rely upon @option{--trace} to scan@file{configure.ac}.  For instance, to find the list of variables thatare substituted, use:@example@group$ @kbd{autoconf -t AC_SUBST}configure.ac:2:AC_SUBST:ECHO_Cconfigure.ac:2:AC_SUBST:ECHO_Nconfigure.ac:2:AC_SUBST:ECHO_T@i{More traces deleted}@end group@end example@noindentThe example below highlights the difference between @samp{$@@},@samp{$*}, and @samp{$%}.@example@group$ @kbd{cat configure.ac}AC_DEFINE(This, is, [an[example]])$ @kbd{autoconf -t 'AC_DEFINE:@@: $@@}*: $*%: $%'@@: [This],[is],[an[example]]*: This,is,an[example]%: This:is:an [example]@end group@end example@noindentThe @var{format} gives you a lot of freedom:@example@group$ @kbd{autoconf -t 'AC_SUBST:$$ac_subst@{"$1"@} = "$f:$l";'}$ac_subst@{"ECHO_C"@} = "configure.ac:2";$ac_subst@{"ECHO_N"@} = "configure.ac:2";$ac_subst@{"ECHO_T"@} = "configure.ac:2";@i{More traces deleted}@end group@end example@noindentA long @var{separator} can be used to improve the readability of complexstructures, and to ease their parsing (for instance when no singlecharacter is suitable as a separator):@example@group$ @kbd{autoconf -t 'AM_MISSING_PROG:$@{|:::::|@}*'}ACLOCAL|:::::|aclocal|:::::|$missing_dirAUTOCONF|:::::|autoconf|:::::|$missing_dirAUTOMAKE|:::::|automake|:::::|$missing_dir@i{More traces deleted}@end group@end example@node autoreconf Invocation@section Using @command{autoreconf} to Update @command{configure} Scripts@cindex @command{autoreconf}Installing the various components of the @acronym{GNU} Build System can betedious: running @command{autopoint} for Gettext, @command{automake} for@file{Makefile.in} etc.@: in each directory.  It may be needed eitherbecause some tools such as @command{automake} have been updated on yoursystem, or because some of the sources such as @file{configure.ac} havebeen updated, or finally, simply in order to install the @acronym{GNU} BuildSystem in a fresh tree.@command{autoreconf} runs @command{autoconf}, @command{autoheader},@command{aclocal}, @command{automake}, @command{libtoolize}, and@command{autopoint} (when appropriate) repeatedly to update the@acronym{GNU} Build System in the specified directories and theirsubdirectories (@pxref{Subdirectories}).  By default, it only remakesthose files that are older than their sources.If you install a new version of some tool, you can make@command{autoreconf} remake @emph{all} of the files by giving it the@option{--force} option.@xref{Automatic Remaking}, for Make rules to automaticallyremake @command{configure} scripts when their source files change.  Thatmethod handles the timestamps of configuration header templatesproperly, but does not pass @option{--autoconf-dir=@var{dir}} or@option{--localdir=@var{dir}}.@cindex Gettext@cindex @command{autopoint}Gettext supplies the @command{autopoint} command to add translationinfrastructure to a source package.  If you use @command{autopoint},your @file{configure.ac} should invoke both @code{AM_GNU_GETTEXT} and@code{AM_GNU_GETTEXT_VERSION(@var{gettext-version})}.  @xref{autopointInvocation, , Invoking the @code{autopoint} Program, gettext,@acronym{GNU} @code{gettext} utilities}, for further details.@noindent@command{autoreconf} accepts the following options:@table @option@item --help@itemx -hPrint a summary of the command line options and exit.@item --version@itemx -VPrint the version number of Autoconf and exit.@item --verbosePrint the name of each directory @command{autoreconf} examines and thecommands it runs.  If given two or more times, pass @option{--verbose}to subordinate tools that support it.@item --debug@itemx -dDon't remove the temporary files.@item --force@itemx -fRemake even @file{configure} scripts and configuration headers that arenewer than their input files (@file{configure.ac} and, if present,@file{aclocal.m4}).@item --install@itemx -iInstall the missing auxiliary files in the package.  By default, filesare copied; this can be changed with @option{--symlink}.If deemed appropriate, this option triggers calls to@samp{automake --add-missing},@samp{libtoolize}, @samp{autopoint}, etc.@item --no-recursiveDo not rebuild files in subdirectories to configure (see @ref{Subdirectories},macro @code{AC_CONFIG_SUBDIRS}).@item --symlink@itemx -sWhen used with @option{--install}, install symbolic links to the missingauxiliary files instead of copying them.@item --make@itemx -mWhen the directories were configured, update the configuration byrunning @samp{./config.status --recheck && ./config.status}, and thenrun @samp{make}.@item --include=@var{dir}@itemx -I @var{dir}Append @var{dir} to the include path.  Multiple invocations accumulate.Passed on to @command{autoconf} and @command{autoheader} internally.@item --prepend-include=@var{dir}@item -B @var{dir}Prepend @var{dir} to the include path.  Multiple invocations accumulate.Passed on to @command{autoconf} and @command{autoheader} internally.@item --warnings=@var{category}@itemx -W @var{category}@evindex WARNINGSReport the warnings related to @var{category} (which can actually be acomma separated list).@table @samp@item crossrelated to cross compilation issues.@item obsoletereport the uses of obsolete constructs.@item portabilityportability issues@item syntaxdubious syntactic constructs.@item allreport all the warnings@item nonereport none@item errortreats warnings as errors@item no-@var{category}disable warnings falling into @var{category}@end tableWarnings about @samp{syntax} are enabled by default, and the environmentvariable @env{WARNINGS}, a comma separated list of categories, ishonored as well.  Passing @option{-W @var{category}} actually behaves as ifyou had passed @option{--warnings=syntax,$WARNINGS,@var{category}}.  Ifyou want to disable the defaults and @env{WARNINGS}, but (for example)enable the warnings about obsolete constructs, you would use @option{-Wnone,obsolete}.@end tableIf you want @command{autoreconf} to pass flags that are not listed hereon to @command{aclocal}, set @code{ACLOCAL_AMFLAGS} in your @file{Makefile.am}.@c ========================================= Initialization and Output Files.@node Setup@chapter Initialization and Output FilesAutoconf-generated @command{configure} scripts need some information abouthow to initialize, such as how to find the package's source files andabout the output files to produce.  The following sections describe theinitialization and the creation of output files.@menu

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -