?? status.m4
字號:
# This file is part of Autoconf. -*- Autoconf -*-# Parameterizing and creating config.status.# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA# 02110-1301, USA.# As a special exception, the Free Software Foundation gives unlimited# permission to copy, distribute and modify the configure scripts that# are the output of Autoconf. You need not follow the terms of the GNU# General Public License when using or distributing such scripts, even# though portions of the text of Autoconf appear in them. The GNU# General Public License (GPL) does govern all other use of the material# that constitutes the Autoconf program.## Certain portions of the Autoconf source text are designed to be copied# (in certain cases, depending on the input) into the output of# Autoconf. We call these the "data" portions. The rest of the Autoconf# source text consists of comments plus executable code that decides which# of the data portions to output in any given case. We call these# comments and executable code the "non-data" portions. Autoconf never# copies any of the non-data portions into its output.## This special exception to the GPL applies to versions of Autoconf# released by the Free Software Foundation. When you make and# distribute a modified version of Autoconf, you may extend this special# exception to the GPL to apply to your modified version as well, *unless*# your modified version has the potential to copy into its output some# of the text that was the non-data portion of the version that you started# with. (In other words, unless your change moves or copies text from# the non-data portions to the data portions.) If your modification has# such potential, you must delete any notice of this special exception# to the GPL from your modified version.## Written by David MacKenzie, with help from# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,# Roland McGrath, Noah Friedman, david d zuhn, and many others.# This file handles about all the preparation aspects for# `config.status': registering the configuration files, the headers,# the links, and the commands `config.status' will run. There is a# little mixture though of things actually handled by `configure',# such as running the `configure' in the sub directories. Minor# detail.## There are two kinds of commands:## COMMANDS:## They are output into `config.status' via a quoted here doc. These# commands are always associated to a tag which the user can use to# tell `config.status' what are the commands she wants to run.## INIT-CMDS:## They are output via an *unquoted* here-doc. As a consequence $var# will be output as the value of VAR. This is typically used by# `configure' to give `config.status' some variables it needs to run# the COMMANDS. At the difference of COMMANDS, the INIT-CMDS are# always run.### Honorable members of this family are AC_CONFIG_FILES,# AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys# are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with# arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS# and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and# AC_CONFIG_COMMANDS_POST.## ------------------ #### Auxiliary macros. #### ------------------ ### _AC_SRCDIRS(BUILD-DIR-NAME)# ---------------------------# Inputs:# - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'# - `$srcdir' is `top-build -> top-src'## Outputs:# - `ac_builddir' is `.', for symmetry only.# - `ac_top_builddir_sub' is `build -> top_build'.# This is used for @top_builddir@.# - `ac_top_build_prefix' is `build -> top_build'.# If not empty, has a trailing slash.# - `ac_srcdir' is `build -> src'.# - `ac_top_srcdir' is `build -> top-src'.# and `ac_abs_builddir' etc., the absolute directory names.m4_define([_AC_SRCDIRS],[ac_builddir=.case $1 in.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;*) ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;;esacac_abs_top_builddir=$ac_pwdac_abs_builddir=$ac_pwd$ac_dir_suffix# for backward compatibility:ac_top_builddir=$ac_top_build_prefixcase $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [[\\/]]* | ?:[[\\/]]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;;esacac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix])# _AC_SRCDIRS## ---------------------- #### Registering the tags. #### ---------------------- ### _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])# -----------------------------------------## Register INIT-COMMANDS as command pasted *unquoted* in# `config.status'. This is typically used to pass variables from# `configure' to `config.status'. Note that $[1] is not over quoted as# was the case in AC_OUTPUT_COMMANDS.m4_define([_AC_CONFIG_COMMANDS_INIT],[m4_ifval([$1], [m4_append([_AC_OUTPUT_COMMANDS_INIT], [$1])])])# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])# -----------------------------------------------------# This macro does nothing, it's a hook to be read with `autoconf --trace'.## It announces DEST depends upon the SOURCE1 etc.m4_define([AC_FILE_DEPENDENCY_TRACE], [])# _AC_FILE_DEPENDENCY_TRACE_COLON(DEST:SOURCE1[:SOURCE2...])# ----------------------------------------------------------# Declare that DEST depends upon SOURCE1 etc.#m4_define([_AC_FILE_DEPENDENCY_TRACE_COLON],[AC_FILE_DEPENDENCY_TRACE(m4_bpatsubst([$1], [:], [,]))dnl])# _AC_CONFIG_DEPENDENCY(MODE, DEST[:SOURCE1...])# ---------------------------------------------# MODE is `FILES', `HEADERS', or `LINKS'.## Be sure that a missing dependency is expressed as a dependency upon# `DEST.in' (except with config links).#m4_define([_AC_CONFIG_DEPENDENCY],[_AC_FILE_DEPENDENCY_TRACE_COLON([$2]_AC_CONFIG_DEPENDENCY_DEFAULT($@))dnl])# _AC_CONFIG_DEPENDENCY_DEFAULT(MODE, DEST[:SOURCE1...])# ------------------------------------------------------# Expand to `:DEST.in' if appropriate, or to empty string otherwise.## More detailed edscription:# If the tag contains `:', expand to nothing.# Otherwise, for a config file or header, add `:DEST.in'.# For config link, DEST.in is not appropriate:# - if the tag is literal, complain.# - otherwise, just expand to nothing and proceed with fingers crossed.# (We get to this case from the obsolete AC_LINK_FILES, for example.)#m4_define([_AC_CONFIG_DEPENDENCY_DEFAULT],[m4_bmatch([$2], [:], [], [m4_if([$1], [LINKS], [AS_LITERAL_IF([$2], [AC_FATAL([Invalid AC_CONFIG_LINKS tag: `$2'])])], [:$2.in])])dnl])# _AC_CONFIG_UNIQUE(MODE, DEST)# -----------------------------# MODE is `FILES', `HEADERS', `LINKS', `COMMANDS', or `SUBDIRS'.## Verify that there is no double definition of an output file.#m4_define([_AC_CONFIG_UNIQUE],[m4_ifdef([_AC_SEEN_TAG($2)], [AC_FATAL([`$2' is already registered with AC_CONFIG_]m4_defn([_AC_SEEN_TAG($2)]).)], [m4_define([_AC_SEEN_TAG($2)], [$1])])dnl])# _AC_CONFIG_FOOS(MODE, TAGS..., [COMMANDS], [INIT-CMDS])# -------------------------------------------------------# MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.## Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,# run COMMANDS afterwards. (This is done in _AC_CONFIG_REGISTER_DEST.)## For COMMANDS, do not m4_normalize TAGS before adding it to ac_config_commands.# This historical difference allows macro calls in TAGS.#m4_define([_AC_CONFIG_FOOS],[m4_foreach_w([AC_File], [$2], [_AC_CONFIG_REGISTER([$1], m4_defn([AC_File]), [$3])])dnlm4_define([_AC_SEEN_CONFIG(ANY)])dnlm4_define([_AC_SEEN_CONFIG($1)])dnl_AC_CONFIG_COMMANDS_INIT([$4])dnlac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) dnlm4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"])# _AC_CONFIG_REGISTER(MODE, TAG, [COMMANDS])# ------------------------------------------# MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.#m4_define([_AC_CONFIG_REGISTER],[m4_if([$1], [COMMANDS], [], [_AC_CONFIG_DEPENDENCY([$1], [$2])])dnl_AC_CONFIG_REGISTER_DEST([$1], [$2], m4_bpatsubst([[$2]], [:.*\(.\)$], [\1]), [$3])dnl])# _AC_CONFIG_REGISTER_DEST(MODE, TAG, DEST, [COMMANDS])# -----------------------------------------------------# MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.# TAG is in the form DEST[:SOURCE...].# Thus parameter $3 is the first part of $2.## With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status# to guess the links to establish (`./config.status .').## Save the name of the first config header to AH_HEADER.#m4_define([_AC_CONFIG_REGISTER_DEST],[_AC_CONFIG_UNIQUE([$1], [$3])dnlm4_if([$1 $3], [LINKS .], [AC_FATAL([invalid destination of a config link: `.'])])dnlm4_if([$1], [HEADERS], [m4_define_default([AH_HEADER], [$3])])dnldnldnl Recognize TAG as an argument to config.status:dnlm4_append([_AC_LIST_TAGS],[ "$3") CONFIG_$1="$CONFIG_$1 $2" ;;])dnldnldnl Register the associated commands, if any:dnlm4_ifval([$4],[m4_append([_AC_LIST_TAG_COMMANDS],[ "$3":]m4_bpatsubst([$1], [^\(.\).*$], [\1])[) $4 ;;])])dnl])# _AC_CONFIG_REGISTER_DEST## --------------------- #### Configuration files. #### --------------------- ### AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])# -------------------------------------------------# Specify output files, i.e., files that are configured with AC_SUBST.#AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)])# _AC_SED_CMD_LIMIT# -----------------# Evaluate to an m4 number equal to the maximum number of commands to put# in any single sed program, not counting ":" commands.## Some seds have small command number limits, like on Digital OSF/1 and HP-UX.m4_define([_AC_SED_CMD_LIMIT],dnl One cannot portably go further than 99 commands because of HP-UX.[99])# _AC_OUTPUT_FILES_PREPARE# ------------------------# Create the sed scripts needed for CONFIG_FILES.# Support multiline substitutions and make sure that the substitutions are# not evaluated recursively.# The intention is to have readable config.status and configure, even# though this m4 code might be scaring.## This code was written by Dan Manthey.## This macro is expanded inside a here document. If the here document is# closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".#m4_define([_AC_OUTPUT_FILES_PREPARE],[## Set up the sed scripts for CONFIG_FILES section.#dnl ... and define _AC_SED_CMDS, the pipeline which executes them.m4_define([_AC_SED_CMDS], [])dnl# No need to generate the scripts if there are no CONFIG_FILES.# This happens for instance when ./config.status config.hif test -n "$CONFIG_FILES"; then_ACEOFm4_pushdef([_AC_SED_FRAG_NUM], 0)dnl Fragment number.m4_pushdef([_AC_SED_CMD_NUM], 2)dnl Num of commands in current frag so far.m4_pushdef([_AC_SED_DELIM_NUM], 0)dnl Expected number of delimiters in file.m4_pushdef([_AC_SED_FRAG], [])dnl The constant part of the current fragment.dnlm4_ifdef([_AC_SUBST_FILES],[# Create sed commands to just substitute file output variables.m4_foreach_w([_AC_Var], m4_defn([_AC_SUBST_FILES]),[dnl End fragments at beginning of loop so that last fragment is not ended.m4_if(m4_eval(_AC_SED_CMD_NUM + 3 > _AC_SED_CMD_LIMIT), 1,[dnl Fragment is full and not the last one, so no need for the final un-escape.dnl Increment fragment number.m4_define([_AC_SED_FRAG_NUM], m4_incr(_AC_SED_FRAG_NUM))dnldnl Record that this fragment will need to be used.m4_define([_AC_SED_CMDS], m4_defn([_AC_SED_CMDS])[| sed -f "$tmp/subs-]_AC_SED_FRAG_NUM[.sed" ])dnl[cat >>$CONFIG_STATUS <<_ACEOFcat >"\$tmp/subs-]_AC_SED_FRAG_NUM[.sed" <<\CEOF/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]m4_defn([_AC_SED_FRAG])dnl[CEOF_ACEOF]m4_define([_AC_SED_CMD_NUM], 2)m4_define([_AC_SED_FRAG])dnl])dnl Last fragment ended.m4_define([_AC_SED_CMD_NUM], m4_eval(_AC_SED_CMD_NUM + 3))dnlm4_define([_AC_SED_FRAG],m4_defn([_AC_SED_FRAG])dnl[/^[ ]*@]_AC_Var[@[ ]*$/{r $]_AC_Var[d}])dnl])dnl# Remaining file output variables are in a fragment that also has non-file# output varibles.])dnlm4_define([_AC_SED_FRAG], []m4_defn([_AC_SED_FRAG]))dnlm4_foreach_w([_AC_Var],m4_ifdef([_AC_SUBST_VARS], [m4_defn([_AC_SUBST_VARS]) ])[@END@],
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -