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

📄 general.m4

📁 LINUX下的源码工具,可自己分析,或者直接装在系统上作为应用
💻 M4
📖 第 1 页 / 共 5 页
字号:
# This file is part of Autoconf.                       -*- Autoconf -*-# Parameterized macros.# 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.## ---------------- #### The diversions.  #### ---------------- ### We heavily use m4's diversions both for the initializations and for# required macros (see AC_REQUIRE), because in both cases we have to# issue high in `configure' something which is discovered late.## KILL is only used to suppress output.## The layers of `configure'.  We let m4 undivert them by itself, when# it reaches the end of `configure.ac'.## - BINSH#   #! /bin/sh# - HEADER-REVISION#   Sent by AC_REVISION# - HEADER-COMMENT#   Purpose of the script.# - HEADER-COPYRIGHT#   Copyright notice(s)# - M4SH-INIT#   Initialization of bottom layers.## - DEFAULTS#   early initializations (defaults)# - PARSE_ARGS#   initialization code, option handling loop.## - HELP_BEGIN#   Handling `configure --help'.# - HELP_CANON#   Help msg for AC_CANONICAL_*# - HELP_ENABLE#   Help msg from AC_ARG_ENABLE.# - HELP_WITH#   Help msg from AC_ARG_WITH.# - HELP_VAR#   Help msg from AC_ARG_VAR.# - HELP_VAR_END#   A small paragraph on the use of the variables.# - HELP_END#   Tail of the handling of --help.## - VERSION_BEGIN#   Head of the handling of --version.# - VERSION_FSF#   FSF copyright notice for --version.# - VERSION_USER#   User copyright notice for --version.# - VERSION_END#   Tail of the handling of --version.## - INIT_PREPARE#   Tail of initialization code.## - BODY#   the tests and output code## _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'!## From M4sugar:#    -1. KILL# 10000. GROW## From M4sh:#    0. BINSH#    1. HEADER-REVISION#    2. HEADER-COMMENT#    3. HEADER-COPYRIGHT#    4. M4SH-INIT# 1000. BODYm4_define([_m4_divert(DEFAULTS)],        10)m4_define([_m4_divert(PARSE_ARGS)],      20)m4_define([_m4_divert(HELP_BEGIN)],     100)m4_define([_m4_divert(HELP_CANON)],     101)m4_define([_m4_divert(HELP_ENABLE)],    102)m4_define([_m4_divert(HELP_WITH)],      103)m4_define([_m4_divert(HELP_VAR)],       104)m4_define([_m4_divert(HELP_VAR_END)],   105)m4_define([_m4_divert(HELP_END)],       106)m4_define([_m4_divert(VERSION_BEGIN)],  200)m4_define([_m4_divert(VERSION_FSF)],    201)m4_define([_m4_divert(VERSION_USER)],   202)m4_define([_m4_divert(VERSION_END)],    203)m4_define([_m4_divert(INIT_PREPARE)],   300)# AC_DIVERT_PUSH(DIVERSION-NAME)# AC_DIVERT_POP# ------------------------------m4_copy([m4_divert_push],[AC_DIVERT_PUSH])m4_copy([m4_divert_pop], [AC_DIVERT_POP])## ------------------------------------ #### Defining/requiring Autoconf macros.  #### ------------------------------------ ### AC_DEFUN(NAME, EXPANSION)# AC_DEFUN_ONCE(NAME, EXPANSION)# AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)# AC_REQUIRE(STRING)# AC_PROVIDE(MACRO-NAME)# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)# -----------------------------------------------------------m4_copy([m4_defun],       [AC_DEFUN])m4_copy([m4_defun_once],  [AC_DEFUN_ONCE])m4_copy([m4_before],      [AC_BEFORE])m4_copy([m4_require],     [AC_REQUIRE])m4_copy([m4_provide],     [AC_PROVIDE])m4_copy([m4_provide_if],  [AC_PROVIDE_IFELSE])# AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION])# ------------------------------------------m4_define([AC_OBSOLETE],[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])## ----------------------------- #### Implementing Autoconf loops.  #### ----------------------------- ### AC_FOREACH(VARIABLE, LIST, EXPRESSION)# --------------------------------------## Compute EXPRESSION assigning to VARIABLE each value of the LIST.# LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2# ... item_n ': white spaces are separators, and leading and trailing# spaces are meaningless.## This macro is robust to active symbols:#    AC_FOREACH([Var], [ active#    b	act\#    ive  ], [-Var-])end#    => -active--b--active-endm4_define([AC_FOREACH],[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])## ----------------------------------- #### Helping macros to display strings.  #### ----------------------------------- ### AC_HELP_STRING(LHS, RHS, [COLUMN])# ----------------------------------## Format an Autoconf macro's help string so that it looks pretty when# the user executes "configure --help".  This macro takes three# arguments, a "left hand side" (LHS), a "right hand side" (RHS), and# the COLUMN which is a string of white spaces which leads to the# the RHS column (default: 26 white spaces).## The resulting string is suitable for use in other macros that require# a help string (e.g. AC_ARG_WITH).## Here is the sample string from the Autoconf manual (Node: External# Software) which shows the proper spacing for help strings.##    --with-readline         support fancy command line editing#  ^ ^                       ^#  | |                       |#  | column 2                column 26#  |#  column 0## A help string is made up of a "left hand side" (LHS) and a "right# hand side" (RHS).  In the example above, the LHS is# "--with-readline", while the RHS is "support fancy command line# editing".## If the LHS extends past column 24, then the LHS is terminated with a# newline so that the RHS is on a line of its own beginning in column# 26.## Therefore, if the LHS were instead "--with-readline-blah-blah-blah",# then the AC_HELP_STRING macro would expand into:###    --with-readline-blah-blah-blah#  ^ ^                       support fancy command line editing#  | |                       ^#  | column 2                |#  column 0                  column 26#m4_define([AC_HELP_STRING],[m4_pushdef([AC_Prefix], m4_default([$3], [                          ]))dnlm4_pushdef([AC_Prefix_Format],           [  %-]m4_eval(m4_len(AC_Prefix) - 3)[s ])dnl [  %-23s ]m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnlm4_popdef([AC_Prefix_Format])dnlm4_popdef([AC_Prefix])dnl])## ---------------------------------------------- #### Information on the package being Autoconf'ed.  #### ---------------------------------------------- ### It is suggested that the macros in this section appear before# AC_INIT in `configure.ac'.  Nevertheless, this is just stylistic,# and from the implementation point of, AC_INIT *must* be expanded# beforehand: it puts data in diversions which must appear before the# data provided by the macros of this section.# The solution is to require AC_INIT in each of these macros.  AC_INIT# has the needed magic so that it can't be expanded twice.# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME])# --------------------------------------------------------------m4_define([_AC_INIT_PACKAGE],[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])AS_LITERAL_IF([$2], [],  [m4_warn([syntax], [AC_INIT: not a literal: $2])])AS_LITERAL_IF([$3], [],  [m4_warn([syntax], [AC_INIT: not a literal: $3])])m4_ifndef([AC_PACKAGE_NAME],          [m4_define([AC_PACKAGE_NAME],     [$1])])m4_ifndef([AC_PACKAGE_TARNAME],          [m4_define([AC_PACKAGE_TARNAME],                     m4_default([$4],                                [m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]],                                                                     [GNU ])),                                 [[^_abcdefghijklmnopqrstuvwxyz0123456789]],                                 [-])]))])m4_ifndef([AC_PACKAGE_VERSION],          [m4_define([AC_PACKAGE_VERSION],   [$2])])m4_ifndef([AC_PACKAGE_STRING],          [m4_define([AC_PACKAGE_STRING],    [$1 $2])])m4_ifndef([AC_PACKAGE_BUGREPORT],          [m4_define([AC_PACKAGE_BUGREPORT], [$3])])])# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])# ------------------------------------------------------# Append Copyright information in the top of `configure'.  TEXT is# evaluated once, hence TEXT can use macros.  Note that we do not# prepend `# ' but `@%:@ ', since m4 does not evaluate the comments.# Had we used `# ', the Copyright sent in the beginning of `configure'# would have not been evaluated.  Another solution, a bit fragile,# would have be to use m4_quote to force an evaluation:##     m4_bpatsubst(m4_quote($1), [^], [# ])m4_define([AC_COPYRIGHT],[m4_divert_text([HEADER-COPYRIGHT],[m4_bpatsubst([$1], [^], [@%:@ ])])dnlm4_divert_text(m4_default([$2], [VERSION_USER]),[$1])dnl])# AC_COPYRIGHT# AC_REVISION(REVISION-INFO)# --------------------------# The second quote in the translit is just to cope with font-lock-mode# which sees the opening of a string.m4_define([AC_REVISION],[m4_divert_text([HEADER-REVISION],                [@%:@ From __file__ m4_translit([$1], [$""]).])dnl])## ---------------------------------------- #### Requirements over the Autoconf version.  #### ---------------------------------------- ### AU::AC_PREREQ(VERSION)# ----------------------# Update this `AC_PREREQ' statement to require the current version of# Autoconf.  But fail if ever this autoupdate is too old.## Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before# calling `AU_DEFUN', i.e., it is hard coded.  Otherwise it would be# quite complex for autoupdate to import the value of# `m4_PACKAGE_VERSION'.  We could `AU_DEFUN' `m4_PACKAGE_VERSION', but# this would replace all its occurrences with the current version of# Autoconf, which is certainly not what the user intended.AU_DEFUN([AC_PREREQ],[m4_version_prereq([$1])[]dnl[AC_PREREQ(]]m4_defn([m4_PACKAGE_VERSION])[[)]])# AC_PREREQ(VERSION)# ------------------# Complain and exit if the Autoconf version is less than VERSION.m4_copy([m4_version_prereq], [AC_PREREQ])## ---------------- #### Initialization.  #### ---------------- ### All the following macros are used by AC_INIT.  Ideally, they should# be presented in the order in which they are output.  Please, help us# sorting it, or at least, don't augment the entropy.# _AC_INIT_NOTICE# ---------------m4_define([_AC_INIT_NOTICE],[m4_divert_text([HEADER-COMMENT],[@%:@ Guess values for system-dependent variables and create Makefiles.@%:@ Generated by m4_PACKAGE_STRING[]dnlm4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])m4_ifset([AC_PACKAGE_BUGREPORT],         [m4_divert_text([HEADER-COMMENT],                         [@%:@@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])])# _AC_INIT_COPYRIGHT# ------------------# We dump to VERSION_FSF to make sure we are inserted before the# user copyrights, and after the setup of the --version handling.

⌨️ 快捷键说明

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