📄 general.m4
字号:
break fidoneif test -z "$ac_aux_dir"; then AC_MSG_ERROR([cannot find install-sh or install.sh in $1])fi# These three variables are undocumented and unsupported,# and are intended to be withdrawn in a future Autoconf release.# They can cause serious problems if a builder's source tree is in a directory# whose full name contains unusual characters.ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.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 ;;esactest -d "$ac_macro_dir" || AC_MSG_ERROR([cannot find macro directory `$1'])])# AC_CONFIG_MACRO_DIR## --------------------- #### Requiring aux files. #### --------------------- ### AC_REQUIRE_AUX_FILE(FILE)# -------------------------# This macro does nothing, it's a hook to be read with `autoconf --trace'.# It announces FILE is required in the auxdir.m4_define([AC_REQUIRE_AUX_FILE],[AS_LITERAL_IF([$1], [], [AC_FATAL([$0: requires a literal argument])])])## ----------------------------------- #### 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],[case $ac_cv_$1 in*-*-*) ;;*) AC_MSG_ERROR([invalid value of canonical $1]);;esacAC_SUBST([$1], [$ac_cv_$1])dnlac_save_IFS=$IFS; IFS='-'set x $ac_cv_$1shiftAC_SUBST([$1_cpu], [$[1]])dnlAC_SUBST([$1_vendor], [$[2]])dnlshift; shift[# Remember, the first character of IFS is used to create $]*,# except with old shells:$1_os=$[*]IFS=$ac_save_IFScase $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esacAC_SUBST([$1_os])dnl])# _AC_CANONICAL_SPLIT# AC_CANONICAL_BUILD# ------------------AC_DEFUN([AC_CANONICAL_BUILD],[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnlAC_REQUIRE_AUX_FILE([config.sub])dnlAC_REQUIRE_AUX_FILE([config.guess])dnlm4_divert_once([HELP_CANON],[[System types: --build=BUILD configure for building on BUILD [guessed]]])dnl# Make sure we can run config.sub.$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub])AC_CACHE_CHECK([build system type], [ac_cv_build],[ac_build_alias=$build_aliastest "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`test "x$ac_build_alias" = x && AC_MSG_ERROR([cannot guess build type; you must specify one])ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])])_AC_CANONICAL_SPLIT(build)])# AC_CANONICAL_BUILD# AC_CANONICAL_HOST# -----------------AC_DEFUN([AC_CANONICAL_HOST],[AC_REQUIRE([AC_CANONICAL_BUILD])dnlm4_divert_once([HELP_CANON],[[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnlAC_CACHE_CHECK([host system type], [ac_cv_host],[if test "x$host_alias" = x; then ac_cv_host=$ac_cv_buildelse ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])fi])_AC_CANONICAL_SPLIT([host])])# AC_CANONICAL_HOST# AC_CANONICAL_TARGET# -------------------AC_DEFUN([AC_CANONICAL_TARGET],[AC_REQUIRE([AC_CANONICAL_HOST])dnlAC_BEFORE([$0], [AC_ARG_PROGRAM])dnlm4_divert_once([HELP_CANON],[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnlAC_CACHE_CHECK([target system type], [ac_cv_target],[if test "x$target_alias" = x; then ac_cv_target=$ac_cv_hostelse ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])fi])_AC_CANONICAL_SPLIT([target])# The aliases save the names the user supplied, while $host etc.# will get canonicalized.test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}-[]dnl])# AC_CANONICAL_TARGETAU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])# AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])# ------------------------------------------# If the cache file is inconsistent with the current host,# target and build system types, execute CMD or print a default# error message. Now handled via _AC_ARG_VAR_PRECIOUS.AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])## ---------------------- #### Caching test results. #### ---------------------- ### AC_SITE_LOAD# ------------# Look for site or system specific initialization scripts.m4_define([AC_SITE_LOAD],[# Prefer explicitly selected file to automatically selected ones.if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE"elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site"else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site"fishiftfor ac_site_filedo if test -r "$ac_site_file"; then AC_MSG_NOTICE([loading site script $ac_site_file]) sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD . "$ac_site_file" fidone])# AC_CACHE_LOAD# -------------m4_define([AC_CACHE_LOAD],[if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then AC_MSG_NOTICE([loading cache $cache_file]) case $cache_file in [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";; *) . "./$cache_file";; esac fielse AC_MSG_NOTICE([creating cache $cache_file]) >$cache_filefi])# AC_CACHE_LOAD# _AC_CACHE_DUMP# --------------# Dump the cache to stdout. It can be in a pipe (this is a requirement).m4_define([_AC_CACHE_DUMP],[# The following way of writing the cache mishandles newlines in values,# but we know of no workaround that is simple, portable, and efficient.# So, we kill variables containing newlines.# Ultrix sh set writes to stderr and can't be redirected directly,# and sets the high bit in the cache file unless we assign to the vars.( for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) AC_MSG_WARN([Cache variable $ac_var contains a newline.]) ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ ["s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"] ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"] ;; esac | sort)dnl])# _AC_CACHE_DUMP# AC_CACHE_SAVE# -------------# Save the cache.# Allow a site initialization script to override cache values.m4_define([AC_CACHE_SAVE],[cat >confcache <<\_ACEOF# This file is a shell script that caches the results of configure# tests run on this system so they can be shared between configure# scripts and configure runs, see configure's option --config-cache.# It is not useful on other systems. If it contains results you don't# want to keep, you may remove or edit it.## config.status only pays attention to the cache file if you give it# the --recheck option to rerun configure.## `ac_cv_env_foo' variables (set or unset) will be overridden when# loading this file, other *unset* `ac_cv_foo' will be assigned the# following values._ACEOF_AC_CACHE_DUMP() | sed [' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end'] >>confcacheif diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && AC_MSG_NOTICE([updating cache $cache_file]) cat confcache >$cache_file else AC_MSG_NOTICE([not updating unwritable cache $cache_file]) fifirm -f confcache[]dnl])# AC_CACHE_SAVE# AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)# ------------------------------------------# The name of shell var CACHE-ID must contain `_cv_' in order to get saved.# Should be dnl'ed. Try to catch common mistakes.m4_defun([AC_CACHE_VAL],[m4_bmatch([$2], [AC_DEFINE], [AC_DIAGNOSE([syntax],[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl[where no actions should be taken])])dnlAS_VAR_SET_IF([$1], [_AS_ECHO_N([(cached) ])], [$2])])# AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)# -------------------------------------------# Do not call this macro with a dnl right behind.m4_defun([AC_CACHE_CHECK],[AC_MSG_CHECKING([$1])AC_CACHE_VAL([$2], [$3])dnlAS_LITERAL_IF([$2], [AC_MSG_RESULT([$$2])], [ac_res=AS_VAR_GET([$2]) AC_MSG_RESULT([$ac_res])])dnl])## ---------------------- #### Defining CPP symbols. #### ---------------------- ### AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)# -------------------------------------------# Used by --trace to collect the list of AC_DEFINEd macros.m4_define([AC_DEFINE_TRACE_LITERAL],[m4_pattern_allow([^$1$])])# AC_DEFINE_TRACE(CPP-SYMBOL)# ---------------------------# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters# out non literal symbols.m4_define([AC_DEFINE_TRACE],[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])])# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])# -------------------------------------------# Set VARIABLE to VALUE, verbatim, or 1. Remember the value# and if VARIABLE is affected the same VALUE, do nothing, else# die. The third argument is used by autoheader.m4_define([AC_DEFINE], [_AC_DEFINE_Q([\], $@)])# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])# ----------------------------------------------------# Similar, but perform shell substitutions $ ` \ once on VALUE.m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([], $@)])# _AC_DEFINE_Q(QUOTE, VARIABLE, [VALUE], [DESCRIPTION])# -----------------------------------------------------m4_define([_AC_DEFINE_Q],[AC_DEFINE_TRACE([$2])dnlm4_ifval([$4], [AH_TEMPLATE(m4_bpatsubst([[$2]], [(.*)]), [$4])])dnlcat >>confdefs.h <<$1_ACEOF[@%:@define] $2 m4_if($#, 2, 1, [$3])_ACEOF])## -------------------------- #### Setting output variables. #### -------------------------- ### AC_SUBST_TRACE(VARIABLE)# ------------------------# This macro is used with --trace to collect the list of substituted variables.m4_define([AC_SUBST_TRACE])# AC_SUBST(VARIABLE, [VALUE])# ---------------------------# Create an output variable from
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -