📄 general.m4
字号:
AC_SUBST([DEFS])dnlAC_SUBST([ECHO_C])dnlAC_SUBST([ECHO_N])dnlAC_SUBST([ECHO_T])dnlAC_SUBST([LIBS])dnlm4_divert_pop([INIT_PREPARE])dnl])# _AC_INIT_PREPARE# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])# ----------------------------------------# This macro is used only for Autoupdate.AU_DEFUN([AC_INIT],[m4_ifval([$2], [[AC_INIT($@)]], [m4_ifval([$1],[[AC_INIT]AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl])# AC_INIT([PACKAGE, VERSION, [BUG-REPORT])# ----------------------------------------# Include the user macro files, prepare the diversions, and output the# preamble of the `configure' script.# Note that the order is important: first initialize, then set the# AC_CONFIG_SRCDIR.m4_define([AC_INIT],[# Forbidden tokens and exceptions.m4_pattern_forbid([^_?A[CHUM]_])m4_pattern_forbid([_AC_])m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])# Actually reserved by M4sh.m4_pattern_allow([^AS_FLAGS$])AS_INITAS_PREPAREm4_ifval([$2], [_AC_INIT_PACKAGE($@)])_AC_INIT_DEFAULTS_AC_INIT_PARSE_ARGS_AC_INIT_SRCDIR_AC_INIT_HELP_AC_INIT_VERSION_AC_INIT_CONFIG_LOG_AC_INIT_PREPARE_AC_INIT_NOTICE_AC_INIT_COPYRIGHTm4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl])## ----------------------------- #### Selecting optional features. #### ----------------------------- ### AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])# ------------------------------------------------------------------------AC_DEFUN([AC_ARG_ENABLE],[m4_divert_once([HELP_ENABLE], [[Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnlm4_divert_once([HELP_ENABLE], [$2])dnl# Check whether --enable-$1 or --disable-$1 was given.if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then enableval="[$enable_]m4_bpatsubst([$1], -, _)" $3m4_ifvaln([$4], [else $4])dnlfi; dnl])# AC_ARG_ENABLEAU_DEFUN([AC_ENABLE],[AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])])## ------------------------------ #### Working with optional software #### ------------------------------ ### AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])# --------------------------------------------------------------------AC_DEFUN([AC_ARG_WITH],[m4_divert_once([HELP_WITH], [[Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])m4_divert_once([HELP_WITH], [$2])dnl# Check whether --with-$1 or --without-$1 was given.if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then withval="[$with_]m4_bpatsubst([$1], -, _)" $3m4_ifvaln([$4], [else $4])dnlfi; dnl])# AC_ARG_WITHAU_DEFUN([AC_WITH],[AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])])## ----------------------------------------- #### Remembering variables for reconfiguring. #### ----------------------------------------- ### _AC_ARG_VAR_PRECIOUS(VARNAME)# -----------------------------# Declare VARNAME is precious.## We try to diagnose when precious variables have changed. To do this,# make two early snapshots (after the option processing to take# explicit variables into account) of those variables: one (ac_env_)# which represents the current run, and a second (ac_cv_env_) which,# at the first run, will be saved in the cache. As an exception to# the cache mechanism, its loading will override these variables (non# `ac_cv_env_' cache value are only set when unset).## In subsequent runs, after having loaded the cache, compare# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE.m4_define([_AC_ARG_VAR_PRECIOUS],[AC_SUBST([$1])dnlm4_divert_once([PARSE_ARGS],[ac_env_$1_set=${$1+set}ac_env_$1_value=$$1ac_cv_env_$1_set=${$1+set}ac_cv_env_$1_value=$$1])dnl])# _AC_ARG_VAR_VALIDATE# --------------------# The precious variables are saved twice at the beginning of# configure. E.g., PRECIOUS is saved as `ac_env_PRECIOUS_SET' and# `ac_env_PRECIOUS_VALUE' on the one hand and `ac_cv_env_PRECIOUS_SET'# and `ac_cv_env_PRECIOUS_VALUE' on the other hand.## Now the cache has just been loaded, so `ac_cv_env_' represents the# content of the cached values, while `ac_env_' represents that of the# current values.## So we check that `ac_env_' and `ac_cv_env_' are consistent. If# they aren't, die.m4_define([_AC_ARG_VAR_VALIDATE],[# Check that the precious variables saved in the cache have kept the same# value.ac_cache_corrupted=falsefor ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([[a-zA-Z_0-9]]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2) ac_cache_corrupted=: ;; ,set) AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2) ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2) AS_MESSAGE([ former value: $ac_old_val], 2) AS_MESSAGE([ current value: $ac_new_val], 2) ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val indnl If you change this globbing pattern, test it on an old shell --dnl it's sensitive. Putting any kind of quote in it causes syntax errors.[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)] ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fidoneif $ac_cache_corrupted; then AS_MESSAGE([error: changes in the environment can compromise the build], 2) AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])fi])# _AC_ARG_VAR_VALIDATE# AC_ARG_VAR(VARNAME, DOCUMENTATION)# ----------------------------------# Register VARNAME as a precious variable, and document it in# `configure --help' (but only once).AC_DEFUN([AC_ARG_VAR],[m4_divert_once([HELP_VAR], [[Some influential environment variables:]])dnlm4_divert_once([HELP_VAR_END], [[Use these variables to override the choices made by `configure' or to helpit to find libraries and programs with nonstandard names/locations.]])dnlm4_expand_once([m4_divert_once([HELP_VAR], [AS_HELP_STRING([$1], [$2], [ ])])], [$0($1)])dnl_AC_ARG_VAR_PRECIOUS([$1])dnl])# AC_ARG_VAR## ---------------------------- #### Transforming program names. #### ---------------------------- ### AC_ARG_PROGRAM# --------------# This macro is expanded only once, to avoid that `foo' ends up being# installed as `ggfoo'.AC_DEFUN_ONCE([AC_ARG_PROGRAM],[dnl Document the options.m4_divert_push([HELP_BEGIN])dnlProgram names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program namesm4_divert_pop([HELP_BEGIN])dnltest "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name"# Use a double $ so make ignores it.test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name"# Double any \ or $. echo might interpret backslashes.# By default was `s,x,x', remove it if useless.cat <<\_ACEOF >conftest.sed[s/[\\$]/&&/g;s/;s,x,x,$//]_ACEOFprogram_transform_name=`echo $program_transform_name | sed -f conftest.sed`rm conftest.sed])# AC_ARG_PROGRAM## ------------------------- #### Finding auxiliary files. #### ------------------------- ### AC_CONFIG_AUX_DIR(DIR)# ----------------------# Find install-sh, config.sub, config.guess, and Cygnus configure# in directory DIR. These are auxiliary files used in configuration.# DIR can be either absolute or relative to $srcdir.AC_DEFUN([AC_CONFIG_AUX_DIR],[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])# AC_CONFIG_AUX_DIR_DEFAULT# -------------------------# The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.# There's no need to call this macro explicitly; just AC_REQUIRE it.AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])# AC_CONFIG_AUX_DIRS(DIR ...)# ---------------------------# Internal subroutine.# Search for the configuration auxiliary files in directory list $1.# We look only for install-sh, so users of AC_PROG_INSTALL# do not automatically need to distribute the other auxiliary files.AC_DEFUN([AC_CONFIG_AUX_DIRS],[ac_aux_dir=for ac_dir in $1; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fidoneif test -z "$ac_aux_dir"; then AC_MSG_ERROR([cannot find install-sh or install.sh in $1])fiac_config_guess="$SHELL $ac_aux_dir/config.guess"ac_config_sub="$SHELL $ac_aux_dir/config.sub"ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl])# AC_CONFIG_AUX_DIRS## ------------------------ #### Finding aclocal macros. #### ------------------------ ### AC_CONFIG_MACRO_DIR(DIR)# ------------------------# Declare directory containing additional macros for aclocal.# DIR can be either absolute or relative to $srcdir.AC_DEFUN([AC_CONFIG_MACRO_DIR],[case $1 in [[\\/]]* | ?:[[\\/]]* ) ac_macro_dir=$1 ;; *) ac_macro_dir=$srcdir/$1 ;;esacif test -d "$ac_macro_dir"; then :else AC_MSG_ERROR([cannot find macro directory `$1'])fi])# AC_CONFIG_MACRO_DIR## ----------------------------------- #### Getting the canonical system type. #### ----------------------------------- ### The inputs are:# configure --host=HOST --target=TARGET --build=BUILD## The rules are:# 1. Build defaults to the current platform, as determined by config.guess.# 2. Host defaults to build.# 3. Target defaults to host.# _AC_CANONICAL_SPLIT(THING)# --------------------------# Generate the variables THING, THING_{alias cpu vendor os}.m4_define([_AC_CANONICAL_SPLIT],[AC_SUBST([$1], [$ac_cv_$1])dnldnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnlAC_SUBST([$1_cpu], [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])dnlAC_SUBST([$1_vendor], [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])dnlAC_SUBST([$1_os], [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])dnl])# _AC_CANONICAL_SPLIT# AC_CANONICAL_BUILD# ------------------AC_DEFUN_ONCE([AC_CANONICAL_BUILD],[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnlm4_divert_text([HELP_CANON],[[System types: --build=BUILD configure for building on BUILD [guessed]]])dnl# Make sure we can run config.sub.$ac_config_sub sun4 >/dev/null 2>&1 || AC_MSG_ERROR([cannot run $ac_config_sub])AC_CACHE_CHECK([build system type], [ac_cv_build],[ac_cv_build_alias=$build_aliastest -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess`test -z "$ac_cv_build_alias" && AC_MSG_ERROR([cannot guess build type; you must specify one])ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || AC_MSG_ERROR([$ac_config_sub $ac_cv_build_alias failed])])_AC_CANONICAL_SPLIT(build)])# AC_CANONICAL_BUILD# AC_CANONICAL_HOST# -----------------AC_DEFUN_ONCE([AC_CANONICAL_HOST],[AC_REQUIRE([AC_CANONICAL_BUILD])dnlm4_divert_text([HELP_CANON],[[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnlAC_CACHE_CHECK([host system type], [ac_cv_host],[ac_cv_host_alias=$host_aliastest -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_aliasac_cv_host=`$ac_config_sub $ac_cv_host_alias` || AC_MSG_ERROR([$ac_config_sub $ac_cv_host_alias failed])])_AC_CANONICAL_SPLIT([host])])# AC_CANONICAL_HOST# AC_CANONICAL_TARGET# -------------------AC_DEFUN_ONCE([AC_CANONICAL_TARGET],[AC_REQUIRE([AC_CANONICAL_HOST])dnlAC_BEFORE([$0], [AC_ARG_PROGRAM])dnlm4_divert_text([HELP_CANON],[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -