?? status.m4
字號:
[m4_append([AC_LIST_HEADERS_COMMANDS],[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;])])dnl])# AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])# ------------------------------------------------------# Specify that the HEADERS are to be created by instantiation of the# AC_DEFINEs. Associate the COMMANDS to the HEADERS. This macro# accumulates if called several times.## The commands are stored in a growing string AC_LIST_HEADERS_COMMANDS# which should be used like this:## case $ac_file in# AC_LIST_HEADERS_COMMANDS# esacAC_DEFUN([AC_CONFIG_HEADERS],[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_HEADER(m4_defn([AC_File]), [$2])])dnl_AC_CONFIG_COMMANDS_INIT([$3])dnlac_config_headers="$ac_config_headers m4_normalize([$1])"])# Initialize to empty. It is much easier and uniform to have a config# list expand to empty when undefined, instead of special casing when# not defined (since in this case, AC_CONFIG_FOO expands to AC_CONFIG_FOO).m4_define([AC_LIST_HEADERS])m4_define([AC_LIST_HEADERS_COMMANDS])# AC_CONFIG_HEADER(HEADER-TO-CREATE ...)# --------------------------------------# FIXME: Make it obsolete?AC_DEFUN([AC_CONFIG_HEADER],[AC_CONFIG_HEADERS([$1])])# _AC_OUTPUT_HEADERS# ------------------## Output the code which instantiates the `config.h' files from their# `config.h.in'.## This is a subroutine of _AC_OUTPUT_CONFIG_STATUS. It has to send# itself into $CONFIG_STATUS (eg, via here documents). Upon exit, no# here document shall be opened.### The code produced used to be extremely costly: there are was a# single sed script (n lines) handling both `#define' templates,# `#undef' templates with trailing space, and `#undef' templates# without trailing spaces. The full script was run on each of the m# lines of `config.h.in', i.e., about n x m.## Now there are two scripts: `conftest.defines' for the `#define'# templates, and `conftest.undef' for the `#undef' templates.## Optimization 1. It is incredibly costly to run two `#undef'# scripts, so just remove trailing spaces first. Removes about a# third of the cost.## Optimization 2. Since `#define' are rare and obsoleted,# `conftest.defines' is built and run only if grep says there are# `#define'. Improves by at least a factor 2, since in addition we# avoid the cost of *producing* the sed script.## Optimization 3. In each script, first check that the current input# line is a template. This avoids running the full sed script on# empty lines and comments (divides the cost by about 3 since each# template chunk is typically a comment, a template, an empty line).## Optimization 4. Once a substitution performed, since there can be# only one per line, immediately restart the script on the next input# line (using the `t' sed instruction). Divides by about 2.# *Note:* In the case of the AC_SUBST sed script (_AC_OUTPUT_FILES)# this optimization cannot be applied as is, because there can be# several substitutions per line.### The result is about, hm, ... times blah... plus.... Ahem. The# result is about much faster.m4_define([_AC_OUTPUT_HEADERS],[cat >>$CONFIG_STATUS <<\_ACEOF## CONFIG_HEADER section.## These sed commands are passed to sed as "A NAME B NAME C VALUE D", where# NAME is the cpp macro being defined and VALUE is the value it is being given.## ac_d sets the value in "#define NAME VALUE" lines.dnl Double quote for the `[ ]' and `define'.[ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'ac_dB='[ ].*$,\1#\2'ac_dC=' 'ac_dD=',;t'# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'ac_uB='$,\1#\2define\3'ac_uC=' 'ac_uD=',;t']for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && AC_MSG_NOTICE([creating $ac_file]) # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [[\\/$]]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || AC_MSG_ERROR([cannot find input file: $f]) # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree AC_MSG_ERROR([cannot find input file: $f]) fi;; esac done` || AS_EXIT([1]) # Remove the trailing spaces. sed 's/[[ ]]*$//' $ac_file_inputs >$tmp/in_ACEOF# Transform confdefs.h into two sed scripts, `conftest.defines' and# `conftest.undefs', that substitutes the proper values into# config.h.in to produce config.h. The first handles `#define'# templates, and the second `#undef' templates.# And first: Protect against being on the right side of a sed subst in# config.status. Protect against being in an unquoted here document# in config.status.rm -f conftest.defines conftest.undefs# Using a here document instead of a string reduces the quoting nightmare.# Putting comments in sed scripts is not portable.## `end' is used to avoid that the second main sed command (meant for# 0-ary CPP macros) applies to n-ary macro definitions.# See the Autoconf documentation for `clear'.cat >confdef2sed.sed <<\_ACEOFdnl Double quote for `[ ]' and `define'.[s/[\\&,]/\\&/gs,[\\$`],\\&,gt clear: clears,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gpt ends,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp: end]_ACEOF# If some macros were called several times there might be several times# the same #defines, which is useless. Nevertheless, we may not want to# sort them, since we want the *last* AC-DEFINE to be honored.uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.definessed 's/ac_d/ac_u/g' conftest.defines >conftest.undefsrm -f confdef2sed.sed# This sed command replaces #undef with comments. This is necessary, for# example, in the case of _POSIX_SOURCE, which is predefined and required# on some systems where configure will not decide to define it.cat >>conftest.undefs <<\_ACEOF[s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,]_ACEOF# Break up conftest.defines because some shells have a limit on the size# of here documents, and old seds have small limits too (100 cmds).echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUSecho ' if grep ["^[ ]*#[ ]*define"] $tmp/in >/dev/null; then' >>$CONFIG_STATUSecho ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUSecho ' :' >>$CONFIG_STATUSrm -f conftest.tailwhile grep . conftest.defines >/dev/nulldo # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo ['/^[ ]*#[ ]*define/!b'] >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.definesdonerm -f conftest.definesecho ' fi # grep' >>$CONFIG_STATUSecho >>$CONFIG_STATUS# Break up conftest.undefs because some shells have a limit on the size# of here documents, and old seds have small limits too (100 cmds).echo ' # Handle all the #undef templates' >>$CONFIG_STATUSrm -f conftest.tailwhile grep . conftest.undefs >/dev/nulldo # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo ['/^[ ]*#[ ]*undef/!b'] >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefsdonerm -f conftest.undefsdnl Now back to your regularly scheduled config.status.cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then AC_MSG_NOTICE([$ac_file is unchanged]) else ac_dir=`AS_DIRNAME(["$ac_file"])` AS_MKDIR_P(["$ac_dir"]) rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fidnl If running for Automake, be ready to perform additionaldnl commands to set up the timestamp files.m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK], [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])])dnlm4_ifset([AC_LIST_HEADERS_COMMANDS],[ # Run the commands associated with the file. case $ac_file inAC_LIST_HEADERS_COMMANDS()dnl esac])dnldone_ACEOF])# _AC_OUTPUT_HEADERS## --------------------- #### Configuration links. #### --------------------- ### _AC_CONFIG_LINK(DEST:SOURCE, [COMMANDS])# ----------------------------------------# See below.m4_define([_AC_CONFIG_LINK],[_AC_CONFIG_UNIQUE([$1])dnlm4_append([AC_LIST_LINKS], [ $1])dnl_AC_CONFIG_DEPENDENCIES([$1])dnlm4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])dnldnl Register the commandsm4_ifval([$2],[m4_append([AC_LIST_LINKS_COMMANDS],[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;])])dnl])# AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])# --------------------------------------------------------# Specify that config.status should establish a (symbolic if possible)# link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.# Reject DEST=., because it is makes it hard for ./config.status# to guess the links to establish (`./config.status .').AC_DEFUN([AC_CONFIG_LINKS],[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_LINK(m4_defn([AC_File]), [$2])])dnl_AC_CONFIG_COMMANDS_INIT([$3])dnlac_config_links="$ac_config_links m4_normalize([$1])"])# Initialize the list.m4_define([AC_LIST_LINKS])m4_define([AC_LIST_LINKS_COMMANDS])# AC_LINK_FILES(SOURCE..., DEST...)# ---------------------------------# Link each of the existing files SOURCE... to the corresponding# link name in DEST...## Unfortunately we can't provide a very good autoupdate service here,# since in `AC_LINK_FILES($from, $to)' it is possible that `$from'# and `$to' are actually lists. It would then be completely wrong to# replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the# case of literal values though, but because I don't think there is any# interest in creating config links with literal values, no special# mechanism is implemented to handle them.## _AC_LINK_CNT is used to be robust to multiple calls.AU_DEFUN([AC_LINK_FILES],[m4_if($#, 2, , [m4_fatal([$0: incorrect number of arguments])])dnlm4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnlac_sources="$1"ac_dests="$2"while test -n "$ac_sources"; do set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*] set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*] [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"doneAC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl],[ It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant update, you should probably tune the result yourself.])# AC_LINK_FILES# Initialize.AU_DEFUN([_AC_LINK_FILES_CNT], 0)# _AC_OUTPUT_LINKS# ----------------# This is a subroutine of AC_OUTPUT.## It has to send itself into $CONFIG_STATUS (eg, via here documents).# Upon exit, no here document shall be opened.m4_define([_AC_OUTPUT_LINKS],[cat >>$CONFIG_STATUS <<\_ACEOF## CONFIG_LINKS section.#dnl Here we use : instead of .. because if AC_LINK_FILES was useddnl with empty parameters (as in gettext.m4), then we obtain herednl `:', which we want to skip. So let's keep a single exception: `:'.for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'` AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_dest]) if test ! -r $srcdir/$ac_source; then AC_MSG_ERROR([$srcdir/$ac_source: file not found]) fi rm -f $ac_dest # Make relative symlinks. ac_dest_dir=`AS_DIRNAME(["$ac_dest"])` AS_MKDIR_P(["$ac_dest_dir"]) _AC_SRCPATHS(["$ac_dest_dir"]) case $srcdir in [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;; *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac # Try a symlink, then a hard link, then a copy. ln -s $ac_rel_source $ac_dest 2>/dev/null || ln $srcdir/$ac_source $ac_dest 2>/dev/null || cp -p $srcdir/$ac_source $ac_dest || AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest])m4_ifset([AC_LIST_LINKS_COMMANDS],[ # Run the commands associated with the file.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -