📄 general.m4
字号:
# This file is part of Autoconf. -*- Autoconf -*-# Parameterized macros.# 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.## ---------------- #### 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. #### ----------------------------- ### AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION)# ------------------------------------------AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]])AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnlAC_DIAGNOSE([obsolete], [The macro `AC_FOREACH' is obsolete.You should run autoupdate.])])## ----------------------------------- #### Helping macros to display strings. #### ----------------------------------- ### AU::AC_HELP_STRING(LHS, RHS, [COLUMN])# --------------------------------------AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])## ---------------------------------------------- #### 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 view, 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])# ------------------------------------------------------# Emit TEXT, a copyright notice, in the top of `configure' and in# --version output. Macros in TEXT are evaluated once.m4_define([AC_COPYRIGHT],[AS_COPYRIGHT([$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.m4_define([_AC_INIT_COPYRIGHT],[AC_COPYRIGHT([Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.This configure script is free software; the Free Software Foundationgives unlimited permission to copy, distribute and modify it.], [VERSION_FSF])dnl])# File Descriptors# ----------------# Set up the file descriptors used by `configure'.# File descriptor usage:# 0 standard input (/dev/null)# 1 file creation# 2 errors and warnings# AS_MESSAGE_LOG_FD compiler messages saved in config.log# AS_MESSAGE_FD checking for... messages and results# AS_ORIGINAL_STDIN_FD original standard input (still open)## stdin is /dev/null because checks that run programs may# inadvertently run interactive ones, which would stop configuration# until someone typed an EOF.m4_define([AS_MESSAGE_FD], 6)m4_define([AS_ORIGINAL_STDIN_FD], 7)# That's how they used to be named.AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD])AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])# _AC_INIT_DEFAULTS# -----------------# Values which defaults can be set from `configure.ac'.# `/bin/machine' is used in `glibcbug'. The others are used in config.*m4_define([_AC_INIT_DEFAULTS],[m4_divert_push([DEFAULTS])dnlexec AS_ORIGINAL_STDIN_FD<&0 </dev/null AS_MESSAGE_FD>&1# Name of the host.# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,# so uname gets run too.ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`## Initializations.#ac_default_prefix=/usr/localac_clean_files=ac_config_libobj_dir=.LIB@&t@OBJS=cross_compiling=nosubdirs=MFLAGS=MAKEFLAGS=AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])dnlAC_SUBST([PATH_SEPARATOR])dnl# Identity of this package.AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnlAC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -