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

📄 m4sh.m4

📁 autoconf 2.59版,可用于redhat系统.用于编译原码,编写makefile文件.
💻 M4
📖 第 1 页 / 共 3 页
字号:
# This file is part of Autoconf.                          -*- Autoconf -*-# M4 sugar for common shell constructs.# Requires GNU M4 and M4sugar.# Copyright (C) 2000, 2001, 2002, 2003 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 Akim Demaille, Pavel Roskin, Alexandre Oliva, Lars J. Aas# and many other people.# We heavily use m4's diversions both for the initializations and for# required macros, because in both cases we have to issue soon in# output something which is discovered late.### KILL is only used to suppress output.## - BINSH#   AC_REQUIRE'd #! /bin/sh line# - HEADER-REVISION#   RCS keywords etc.# - HEADER-COMMENT#   Purpose of the script etc.# - HEADER-COPYRIGHT#   Copyright notice(s)# - M4SH-INIT#   M4sh's initializations## - BODY#   The body of the script.# _m4_divert(DIVERSION-NAME)# --------------------------# Convert a diversion name into its number.  Otherwise, return# DIVERSION-NAME which is supposed to be an actual diversion number.# Of course it would be nicer to use m4_case here, instead of zillions# of little macros, but it then takes twice longer to run `autoconf'!m4_define([_m4_divert(BINSH)],             0)m4_define([_m4_divert(HEADER-REVISION)],   1)m4_define([_m4_divert(HEADER-COMMENT)],    2)m4_define([_m4_divert(HEADER-COPYRIGHT)],  3)m4_define([_m4_divert(M4SH-INIT)],         4)m4_define([_m4_divert(BODY)],           1000)# Aaarg.  Yet it starts with compatibility issues...  Libtool wants to# use NOTICE to insert its own LIBTOOL-INIT stuff.  People should ask# before diving into our internals :(m4_copy([_m4_divert(M4SH-INIT)], [_m4_divert(NOTICE)])## ------------------------- #### 1. Sanitizing the shell.  #### ------------------------- ### AS_REQUIRE(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK])# -----------------------------------------------------------# BODY-TO-EXPAND is some initialization which must be expanded in the# M4SH-INIT section when expanded (required or not).  This is very# different from m4_require.  For instance:##      m4_defun([_FOO_PREPARE], [foo=foo])#      m4_defun([FOO],#      [m4_require([_FOO_PREPARE])dnl#      echo $foo])##      m4_defun([_BAR_PREPARE], [bar=bar])#      m4_defun([BAR],#      [AS_REQUIRE([_BAR_PREPARE])dnl#      echo $bar])##      AS_INIT#      foo1=`FOO`#      foo2=`FOO`#      bar1=`BAR`#      bar2=`BAR`## gives##      #! /bin/sh#      bar=bar##      foo1=`foo=foo#      echo $foo`#      foo2=`echo $foo`#      bar1=`echo $bar`#      bar2=`echo $bar`#m4_define([AS_REQUIRE],[m4_provide_if([$1], [],	       [m4_divert_text([M4SH-INIT], [m4_default([$2], [$1])])])])# AS_SHELL_SANITIZE# -----------------# Try to be as Bourne and/or POSIX as possible.m4_defun([AS_SHELL_SANITIZE],[## --------------------- #### M4sh Initialization.  #### --------------------- ### Be Bourne compatibleif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then  emulate sh  NULLCMD=:  [#] Zsh 3.x and 4.x performs word splitting on ${1+"$[@]"}, which  # is contrary to our usage.  Disable this feature.  alias -g '${1+"$[@]"}'='"$[@]"'elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then  set -o posixfiDUALCASE=1; export DUALCASE # for MKS sh_AS_UNSET_PREPARE# Work around bugs in pre-3.0 UWIN ksh.$as_unset ENV MAIL MAILPATHPS1='$ 'PS2='> 'PS4='+ '# NLS nuisances.for as_var in \  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \  LC_TELEPHONE LC_TIMEdo  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then    eval $as_var=C; export $as_var  else    $as_unset $as_var  fidone# Required to use basename._AS_EXPR_PREPARE_AS_BASENAME_PREPARE# Name of the executable.as_me=`AS_BASENAME("$[0]")`])# _AS_PREPARE# -----------# This macro has a very special status.  Normal use of M4sh relies# heavily on AS_REQUIRE, so that needed initializations (such as# _AS_TEST_PREPARE) are performed on need, not on demand.  But# Autoconf is the first client of M4sh, and for two reasons: configure# and config.status.  Relying on AS_REQUIRE is of course fine for# configure, but fails for config.status (which is created by# configure).  So we need a means to force the inclusion of the# various _AS_PREPARE_* on top of config.status.  That's basically why# there are so many _AS_PREPARE_* below, and that's also why it is# important not to forget some: config.status needs them.m4_defun([_AS_PREPARE],[# PATH needs CR, and LINENO needs CR and PATH._AS_CR_PREPARE_AS_PATH_SEPARATOR_PREPARE_AS_LINENO_PREPARE_AS_ECHO_N_PREPARE_AS_EXPR_PREPARE_AS_LN_S_PREPARE_AS_MKDIR_P_PREPARE_AS_TEST_PREPARE_AS_TR_CPP_PREPARE_AS_TR_SH_PREPARE# IFS# We need space, tab and new line, in precisely that order.as_nl=''IFS=" 	$as_nl"# CDPATH.$as_unset CDPATH])# AS_PREPARE# ----------# Output all the M4sh possible initialization into the initialization# diversion.m4_defun([AS_PREPARE],[m4_divert_text([M4SH-INIT], [_AS_PREPARE])])## ----------------------------- #### 2. Wrappers around builtins.  #### ----------------------------- ### This section is lexicographically sorted.# AS_EXIT([EXIT-CODE = 1])# ------------------------# Exit and set exit code to EXIT-CODE in the way that it's seen# within "trap 0".## We cannot simply use "exit N" because some shells (zsh and Solaris sh)# will not set $? to N while running the code set by "trap 0"# So we set $? by executing "exit N" in the subshell and then exit.# Other shells don't use `$?' as default for `exit', hence just repeating# the exit value can only help improving portability.m4_define([AS_EXIT],[{ (exit m4_default([$1], 1)); exit m4_default([$1], 1); }])# AS_IF(TEST, [IF-TRUE], [IF-FALSE])# ----------------------------------# Expand into# | if TEST; then# |   IF-TRUE# | else# |   IF-FALSE# | fi# with simplifications is IF-TRUE and/or IF-FALSE is empty.## FIXME: Be n-ary, just as m4_if.m4_define([AS_IF],[m4_ifval([$2$3],[if $1; then  m4_ifval([$2], [$2], :)m4_ifvaln([$3],[else  $3])dnlfi])dnl])# AS_IF# _AS_UNSET_PREPARE# -----------------# AS_UNSET depends upon $as_unset: compute it.# Use MAIL to trigger a bug in Bash 2.01;# the "|| exit" suppresses the resulting "Segmentation fault" message.# Avoid 'if ((', as that triggers a bug in pdksh 5.2.14.m4_defun([_AS_UNSET_PREPARE],[# Support unset when possible.if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then  as_unset=unsetelse  as_unset=falsefi])# AS_UNSET(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])# --------------------------------------------------# Try to unset the env VAR, otherwise set it to# VALUE-IF-UNSET-NOT-SUPPORTED.  `as_unset' must have been computed.m4_defun([AS_UNSET],[AS_REQUIRE([_AS_UNSET_PREPARE])dnl$as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])## ------------------------------------------ #### 3. Error and warnings at the shell level.  #### ------------------------------------------ ### If AS_MESSAGE_LOG_FD is defined, shell messages are duplicated there# too.# AS_ESCAPE(STRING, [CHARS = $"'\])# ---------------------------------# Escape the CHARS in STRING.m4_define([AS_ESCAPE],[m4_bpatsubst([$1],	     m4_ifval([$2], [[\([$2]\)]], [[\([\"$`]\)]]),	     [\\\1])])# _AS_QUOTE_IFELSE(STRING, IF-MODERN-QUOTATION, IF-OLD-QUOTATION)# ---------------------------------------------------------------# Compatibility glue between the old AS_MSG suite which did not# quote anything, and the modern suite which quotes the quotes.# If STRING contains `\\' or `\$', it's modern.# If STRING contains `\"' or `\`', it's old.# Otherwise it's modern.# We use two quotes in the pattern to keep highlighting tools at peace.m4_define([_AS_QUOTE_IFELSE],[m4_bmatch([$1],	  [\\[\\$]], [$2],	  [\\[`""]], [$3],	  [$2])])# _AS_ECHO_UNQUOTED(STRING, [FD = AS_MESSAGE_FD])# -----------------------------------------------# Perform shell expansions on STRING and echo the string to FD.m4_define([_AS_ECHO_UNQUOTED],[echo "$1" >&m4_default([$2], [AS_MESSAGE_FD])])# _AS_QUOTE(STRING, [CHARS = `"])# -------------------------------# If there are quoted (via backslash) backquotes do nothing, else# backslash all the quotes.m4_define([_AS_QUOTE],[_AS_QUOTE_IFELSE([$1],		  [AS_ESCAPE([$1], m4_default([$2], [`""]))],		  [m4_warn([obsolete],	   [back quotes and double quotes must not be escaped in: $1])dnl$1])])# _AS_ECHO(STRING, [FD = AS_MESSAGE_FD])# --------------------------------------# Protect STRING from backquote expansion, echo the result to FD.m4_define([_AS_ECHO],[_AS_ECHO_UNQUOTED([_AS_QUOTE([$1])], [$2])])# _AS_ECHO_N_PREPARE# ------------------# Check whether to use -n, \c, or newline-tab to separate# checking messages from result messages.# Don't try to cache, since the results of this macro are needed to# display the checking message.  In addition, caching something used once# has little interest.# Idea borrowed from dist 3.0.  Use `*c*,', not `*c,' because if `\c'# failed there is also a new-line to match.m4_defun([_AS_ECHO_N_PREPARE],[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in  *c*,-n*) ECHO_N= ECHO_C='' ECHO_T='	' ;;

⌨️ 快捷键说明

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