@@ -1292,14 +1292,39 @@ configure_nut() {
12921292 " ${CONFIG_OPTS[@]} " \
12931293 && echo " $0 : configure phase complete (0)" >&2 \
12941294 && {
1295- if [ x" ${DO_USE_AUTOCONF_CACHE} " = xyes ] && [ x" ${DO_USE_AUTOCONF_CACHE_DEBUG} " = xyes ] && [ -n " ${CI_CACHE_NUT_HASHDIR_CFG_OPT} " ] && [ -s " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache" ] ; then
1296- if [ x = x" ` cat \" ${CI_CACHE_NUT_HASHDIR_CFG} /config.log\" \" ${CI_CACHE_NUT_HASHDIR_CFG} /config.h\" ` " ] ; then
1297- # Stash a copy to track evolution:
1298- cp -pf " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache" " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache.orig"
1299- # Populate on first run (may cost 1-2Mb):
1300- cp -pf config.log " ${CI_CACHE_NUT_HASHDIR_CFG} /"
1301- cp -pf include/config.h " ${CI_CACHE_NUT_HASHDIR_CFG} /"
1302- fi
1295+ if [ x" ${DO_USE_AUTOCONF_CACHE} " = xyes ] \
1296+ && [ -n " ${CI_CACHE_NUT_HASHDIR_CFG_OPT} " ] \
1297+ && [ -s " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache" ] \
1298+ ; then
1299+ case x" ${DO_USE_AUTOCONF_CACHE_DEBUG} " in
1300+ xyes|xfirst)
1301+ if [ x = x" ` cat \" ${CI_CACHE_NUT_HASHDIR_CFG} /config.log\" \" ${CI_CACHE_NUT_HASHDIR_CFG} /config.h\" ` " ] ; then
1302+ # Stash a copy to track evolution:
1303+ cp -pf " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache" " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache.orig"
1304+ # Populate on first run (may cost 1-2Mb):
1305+ cp -pf config.log " ${CI_CACHE_NUT_HASHDIR_CFG} /"
1306+ cp -pf include/config.h " ${CI_CACHE_NUT_HASHDIR_CFG} /"
1307+ fi
1308+
1309+ # Make sure all args are declared outside cached logic:
1310+ $CONFIGURE_SCRIPT --help > " ${CI_CACHE_NUT_HASHDIR_CFG} /config.help" 2>&1
1311+ ;;
1312+ xeach)
1313+ TS=" ` date ' +%s' ` " && [ -n " $TS " ] && [ " $TS " -gt 0 ] \
1314+ || { TS=" ` date | tr -d ' :' | tr -d ' ' ` " && [ -n " $TS " ] ; } \
1315+ || TS=$$
1316+
1317+ for F in \
1318+ " ${CI_CACHE_NUT_HASHDIR_CFG} /config.cache" \
1319+ config.log include/config.h \
1320+ ; do
1321+ cp -pf " $F " " ${CI_CACHE_NUT_HASHDIR_CFG} /` basename \" $F \" ` .$TS "
1322+ done
1323+
1324+ # Make sure all args are declared outside cached logic:
1325+ $CONFIGURE_SCRIPT --help > " ${CI_CACHE_NUT_HASHDIR_CFG} /config.help.$TS " 2>&1
1326+ ;;
1327+ esac
13031328 fi
13041329 } && return 0 \
13051330 || { RES_CFG=$?
@@ -2087,6 +2112,22 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-al
20872112 CONFIG_OPTS+=(" CC=${CC} " )
20882113 CONFIG_OPTS+=(" CXX=${CXX} " )
20892114 CONFIG_OPTS+=(" CPP=${CPP} " )
2115+
2116+ # Do not let autoconf-cached re-runs (re-running the configure script
2117+ # due to a `make` with changed *.m4, *.am or configure.ac sources)
2118+ # complain that CCACHE_* vars were not previously set. This hassle
2119+ # comes with use of AC_ARG_VAR to mark "precious" arguments:
2120+ CONFIG_OPTS+=(" CCACHE_NAMESPACE=${CCACHE_NAMESPACE} " )
2121+ CONFIG_OPTS+=(" CCACHE_BASEDIR=${CCACHE_BASEDIR} " )
2122+ CONFIG_OPTS+=(" CCACHE_DIR=${CCACHE_DIR} " )
2123+ CONFIG_OPTS+=(" CCACHE_PATH=${CCACHE_PATH} " )
2124+ else
2125+ # Still have them declared; the configure script will probably parse
2126+ # them as empty/undefined and re-evaluate if situation warrants that:
2127+ CONFIG_OPTS+=(" CCACHE_NAMESPACE=" )
2128+ CONFIG_OPTS+=(" CCACHE_BASEDIR=" )
2129+ CONFIG_OPTS+=(" CCACHE_DIR=" )
2130+ CONFIG_OPTS+=(" CCACHE_PATH=" )
20902131 fi
20912132
20922133 # Build and check this project; note that zprojects always have an autogen.sh
@@ -3111,6 +3152,22 @@ bindings)
31113152 CONFIG_OPTS+=(" CC=${CC} " )
31123153 CONFIG_OPTS+=(" CXX=${CXX} " )
31133154 CONFIG_OPTS+=(" CPP=${CPP} " )
3155+
3156+ # Do not let autoconf-cached re-runs (re-running the configure script
3157+ # due to a `make` with changed *.m4, *.am or configure.ac sources)
3158+ # complain that CCACHE_* vars were not previously set. This hassle
3159+ # comes with use of AC_ARG_VAR to mark "precious" arguments:
3160+ CONFIG_OPTS+=(" CCACHE_NAMESPACE=${CCACHE_NAMESPACE} " )
3161+ CONFIG_OPTS+=(" CCACHE_BASEDIR=${CCACHE_BASEDIR} " )
3162+ CONFIG_OPTS+=(" CCACHE_DIR=${CCACHE_DIR} " )
3163+ CONFIG_OPTS+=(" CCACHE_PATH=${CCACHE_PATH} " )
3164+ else
3165+ # Still have them declared; the configure script will probably parse
3166+ # them as empty/undefined and re-evaluate if situation warrants that:
3167+ CONFIG_OPTS+=(" CCACHE_NAMESPACE=" )
3168+ CONFIG_OPTS+=(" CCACHE_BASEDIR=" )
3169+ CONFIG_OPTS+=(" CCACHE_DIR=" )
3170+ CONFIG_OPTS+=(" CCACHE_PATH=" )
31143171 fi
31153172
31163173 # If detect_platform_PKG_CONFIG_PATH_and_FLAGS() customized anything here,
0 commit comments