?? 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# 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., 59 Temple Place - Suite 330, Boston, MA# 02111-1307, 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.### Some uniformity exists around here, please respect it!## A macro named AC_CONFIG_FOOS has three args: the `TAG...' (or# `FILE...' when it applies), the `COMMANDS' and the `INIT-CMDS'. It# first checks that TAG was not registered elsewhere thanks to# AC_CONFIG_UNIQUE. Then it registers `TAG...' in AC_LIST_FOOS, and for# each `TAG', a special line in AC_LIST_FOOS_COMMANDS which is used in# `config.status' like this:## case $ac_tag in# AC_LIST_FOOS_COMMANDS# esac## Finally, the `INIT-CMDS' are dumped into a special diversion, via# `_AC_CONFIG_COMMANDS_INIT'. While `COMMANDS' are output once per TAG,# `INIT-CMDS' are dumped only once per call to AC_CONFIG_FOOS.## It also leave the TAG in the shell variable ac_config_foo which contains# those which will actually be executed. In other words:## if false; then# AC_CONFIG_FOOS(bar, [touch bar])# fi## will not create bar.## AC_CONFIG_FOOS can be called several times (with different TAGs of# course).## Because these macros should not output anything, there should be `dnl'# everywhere. A pain my friend, a pain. So instead in each macro we# divert(-1) and restore the diversion at the end.### 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_SRCPATHS(BUILD-DIR-NAME)# ----------------------------# Inputs:# - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'# - `$srcdir' is `top-build -> top-src'## Ouputs:# - `ac_builddir' is `.', for symmetry only.# - `ac_top_builddir' 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 paths.m4_define([_AC_SRCPATHS],[ac_builddir=.if test $1 != .; then ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,../,g'`else ac_dir_suffix= ac_top_builddir=ficase $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [[\\/]]* | ?:[[\\/]]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;;esac# Don't blindly perform a `cd $1/$ac_foo && pwd` since $ac_foo can be# absolute.ac_abs_builddir=`cd $1 && cd $ac_builddir && pwd`ac_abs_top_builddir=`cd $1 && cd ${ac_top_builddir}. && pwd`ac_abs_srcdir=`cd $1 && cd $ac_srcdir && pwd`ac_abs_top_srcdir=`cd $1 && cd $ac_top_srcdir && pwd`])# _AC_SRCPATHS## ------------------------------------- #### Ensuring the uniqueness of the tags. #### ------------------------------------- ### AC_CONFIG_IF_MEMBER(DEST, LIST-NAME, ACTION-IF-TRUE, ACTION-IF-FALSE)# ----------------------------------------------------------------# If DEST is member of LIST-NAME, expand to ACTION-IF-TRUE, else# ACTION-IF-FALSE.## LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated# with spaces.## FIXME: This macro is badly designed, but I'm not guilty: m4 is. There# is just no way to simply compare two strings in m4, but to use pattern# matching. The big problem is then that the active characters should# be quoted. Currently `+*.' are quoted.m4_define([AC_CONFIG_IF_MEMBER],[m4_bmatch(m4_defn([$2]), [\(^\| \)]m4_re_escape([$1])[\([: ]\|$\)], [$3], [$4])])# 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_CONFIG_DEPENDENCY(DEST, [SOURCE1], [SOURCE2...])# ----------------------------------------------------# Be sure that a missing dependency is expressed as a dependency upon# `DEST.in'.m4_define([_AC_CONFIG_DEPENDENCY],[m4_ifval([$2], [AC_FILE_DEPENDENCY_TRACE($@)], [AC_FILE_DEPENDENCY_TRACE([$1], [$1.in])])])# _AC_CONFIG_DEPENDENCIES(DEST[:SOURCE1[:SOURCE2...]]...)# -------------------------------------------------------# Declare the DESTs depend upon their SOURCE1 etc.m4_define([_AC_CONFIG_DEPENDENCIES],[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])dnl])# _AC_CONFIG_UNIQUE(DEST[:SOURCE]...)# -----------------------------------## Verify that there is no double definition of an output file# (precisely, guarantees there is no common elements between# CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS).## Note that this macro does not check if the list $[1] itself# contains doubles.m4_define([_AC_CONFIG_UNIQUE],[AC_FOREACH([AC_File], [$1],[m4_pushdef([AC_Dest], m4_bpatsubst(AC_File, [:.*]))dnl AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADERS.])])dnl AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])])dnl AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS], [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])])dnl AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])dnl AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES.])])dnlm4_popdef([AC_Dest])])dnl])## ------------------------ #### Configuration commands. #### ------------------------ ### _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])])])# Initialize.m4_define([_AC_OUTPUT_COMMANDS_INIT])# _AC_CONFIG_COMMAND(NAME, [COMMANDS])# ------------------------------------# See below.m4_define([_AC_CONFIG_COMMAND],[_AC_CONFIG_UNIQUE([$1])dnlm4_append([AC_LIST_COMMANDS], [ $1])dnlm4_ifval([$2],[m4_append([AC_LIST_COMMANDS_COMMANDS],[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;])])dnl])# AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])# ---------------------------------------------------## Specify additional commands to be run by config.status. This# commands must be associated with a NAME, which should be thought# as the name of a file the COMMANDS create.AC_DEFUN([AC_CONFIG_COMMANDS],[AC_FOREACH([AC_Name], [$1], [_AC_CONFIG_COMMAND(m4_defn([AC_Name]), [$2])])dnl_AC_CONFIG_COMMANDS_INIT([$3])dnlac_config_commands="$ac_config_commands $1"])# Initialize the lists.m4_define([AC_LIST_COMMANDS])m4_define([AC_LIST_COMMANDS_COMMANDS])# AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)# -----------------------------------------## Add additional commands for AC_OUTPUT to put into config.status.## This macro is an obsolete version of AC_CONFIG_COMMANDS. The only# difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is# to give a unique key. The scheme we have chosen is `default-1',# `default-2' etc. for each call.## Unfortunately this scheme is fragile: bad things might happen# if you update an included file and configure.ac: you might have# clashes :( On the other hand, I'd like to avoid weird keys (e.g.,# depending upon __file__ or the pid).AU_DEFUN([AC_OUTPUT_COMMANDS],[m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnldnl Double quoted since that was the case in the original macro.AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl])# Initialize.AU_DEFUN([_AC_OUTPUT_COMMANDS_CNT], 0)# AC_CONFIG_COMMANDS_PRE(CMDS)# ----------------------------# Commands to run right before config.status is created. Accumulates.AC_DEFUN([AC_CONFIG_COMMANDS_PRE],[m4_append([AC_OUTPUT_COMMANDS_PRE], [$1])])# AC_OUTPUT_COMMANDS_PRE# ----------------------# A *variable* in which we append all the actions that must be# performed before *creating* config.status. For a start, clean# up all the LIBOBJ mess.m4_define([AC_OUTPUT_COMMANDS_PRE],[_AC_LIBOBJS_NORMALIZE()])# AC_CONFIG_COMMANDS_POST(CMDS)# -----------------------------# Commands to run after config.status was created. Accumulates.AC_DEFUN([AC_CONFIG_COMMANDS_POST],[m4_append([AC_OUTPUT_COMMANDS_POST], [$1])])# Initialize.m4_define([AC_OUTPUT_COMMANDS_POST])# _AC_OUTPUT_COMMANDS# -------------------# This is a subroutine of AC_OUTPUT, in charge of issuing the code# related to AC_CONFIG_COMMANDS.## It has to send itself into $CONFIG_STATUS (eg, via here documents).# Upon exit, no here document shall be opened.m4_define([_AC_OUTPUT_COMMANDS],[cat >>$CONFIG_STATUS <<\_ACEOF## CONFIG_COMMANDS section.#for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'` ac_dir=`AS_DIRNAME(["$ac_dest"])` _AC_SRCPATHS(["$ac_dir"]) AC_MSG_NOTICE([executing $ac_dest commands])dnl Some shells don't like empty case/esacm4_ifset([AC_LIST_COMMANDS_COMMANDS],[ case $ac_dest inAC_LIST_COMMANDS_COMMANDS()dnl esac])dnldone_ACEOF])# _AC_OUTPUT_COMMANDS## ----------------------- #### Configuration headers. #### ----------------------- ### _AC_CONFIG_HEADER(HEADER, [COMMANDS])# -------------------------------------# See below.m4_define([_AC_CONFIG_HEADER],[_AC_CONFIG_UNIQUE([$1])dnlm4_append([AC_LIST_HEADERS], [ $1])dnl_AC_CONFIG_DEPENDENCIES([$1])dnldnl Register the commandsm4_ifval([$2],[m4_append([AC_LIST_HEADERS_COMMANDS],[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;])])dnl
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -