📄 aclocal_cache.m4
字号:
dnldnl/*Ddnl AC_CACHE_LOAD - Replacement for autoconf cache load dnldnl Notes:dnl Caching in autoconf is broken (through version 2.13). The problem is dnl that the cache is readdnl without any check for whether it makes any sense to read it.dnl A common problem is a build on a shared file system; connecting to dnl a different computer and then building within the same directory willdnl lead to at best error messages from configure and at worse a build thatdnl is wrong but fails only at run time (e.g., wrong datatype sizes used).dnl Later versions of autoconf do include some checks for changes in thednl environment that impact the choices, but still misses problems withdnl multiple different systems.dnl dnl This fixes that by requiring the user to explicitly enable caching dnl before the cache file will be loaded.dnldnl To use this version of 'AC_CACHE_LOAD', you need to includednl 'aclocal_cache.m4' in your 'aclocal.m4' file. The sowing 'aclocal.m4'dnl file includes this file.dnldnl If no --enable-cache or --disable-cache option is selected, thednl command causes configure to keep track of the system being configureddnl in a config.system file; if the current system matches the value storeddnl in that file (or there is neither a config.cache nor config.system file),dnl configure will enable caching. In order to ensure that the configurednl tests make sense, the values of CC, F77, F90, and CXX are also included dnl in the config.system file.dnldnl Bugs:dnl This does not work with the Cygnus configure because the enable argumentsdnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid dnl changing the value of enable_cache, and use real_enable_cache, duplicatingdnl the "notgiven" value.dnldnl See Also:dnl PAC_ARG_CACHINGdnlD*/define([AC_CACHE_LOAD],[if test "X$cache_system" = "X" ; then # A default file name, just in case cache_system="config.system" if test "$cache_file" != "/dev/null" ; then # Get the directory for the cache file, if any changequote(,) cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1/config.system%'` changequote([,]) test "x$cache_system" = "x$cache_file" && cache_system="config.system"# else# We must *not* set enable_cache to no because we need to know if# enable_cache was not set. # enable_cache=no fifidnldnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed untildnl after the AC_CACHE_LOAD is executed (!). Thus, the value of dnl enable_cache if neither --enable-cache or --disable-cache is selecteddnl is null. Just in case autoconf ever fixes this, we test both cases.if test -z "$real_enable_cache" ; then real_enable_cache=$enable_cache if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fifiif test "X$real_enable_cache" = "Xnotgiven" ; then # check for valid cache file if test -z "$cache_system" ; then cache_system="config.system" ; fi if uname -srm >/dev/null 2>&1 ; then dnl cleanargs=`echo "$*" | tr '"' ' '` cleanargs=`echo "$CC $F77 $CXX $F90" | tr '"' ' '` testval="`uname -srm` $cleanargs" if test -f "$cache_system" -a -n "$testval" ; then if test "$testval" = "`cat $cache_system`" ; then real_enable_cache="yes" fi elif test ! -f "$cache_system" -a -n "$testval" ; then echo "$testval" > $cache_system # remove the cache file because it may not correspond to our # system rm -f $cache_file real_enable_cache="yes" fi fifiif test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then real_enable_cache=nofiif test "X$real_enable_cache" = "Xyes" ; then if test -r "$cache_file" ; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file rm -f $cache_system cleanargs=`echo "$CC $F77 $CXX" | tr '"' ' '` testval="`uname -srm` $cleanargs" echo "$testval" > $cache_system fielse cache_file="/dev/null"fi])dnldnl/*D dnl PAC_ARG_CACHING - Enable caching of results from a configure executiondnldnl Synopsis:dnl PAC_ARG_CACHINGdnldnl Output Effects:dnl Adds '--enable-cache' and '--disable-cache' to the command line argumentsdnl accepted by 'configure'. dnldnl See Also:dnl AC_CACHE_LOADdnl D*/dnl Add this call to the other ARG_ENABLE calls. Note that the valuesdnl set here are redundant; the LOAD_CACHE call relies on the way autoconfdnl initially processes ARG_ENABLE commands.AC_DEFUN(PAC_ARG_CACHING,[AC_ARG_ENABLE(cache,[--enable-cache - Turn on configure caching],enable_cache="$enableval",enable_cache="notgiven")])dnl/*Ddnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectorydnl configures.dnl dnl Synopsis:dnl PAC_SUBDIR_CACHEdnldnl Output Effects:dnl dnl Create a cache file before ac_output so that subdir configures don'tdnl make mistakes. dnl We can't use OUTPUT_COMMANDS to remove the cache file, because thosednl commands are executed *before* the subdir configures.dnldnl D*/AC_DEFUN(PAC_SUBDIR_CACHE,[if test "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then cache_file=$$conf.cache touch $cache_file dnl dnl For Autoconf 2.52+, we should ensure that the environment is set dnl for the cache. ac_cv_env_CC_set=set ac_cv_env_CC_value=$CC ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value=$CFLAGS ac_cv_env_CPP_set=set ac_cv_env_CPP_value=$CPP ac_cv_env_CPPFLAGS_set=set ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value=$LDFLAGS dnl other parameters are dnl build_alias, host_alias, target_alias AC_CACHE_SAVE ac_configure_args="$ac_configure_args -enable-cache"fidnl Unconditionally export these values. Subdir configures break otherwiseexport CCexport CFLAGSexport LDFLAGSexport CPPFLAGSexport CPP])AC_DEFUN(PAC_SUBDIR_CACHE_CLEANUP,[if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then rm -f $cache_filefi])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -