Skip to content

Commit 7c8b06b

Browse files
committed
scripts/Windows/build-mingw-nut.sh: CI_CACHE_NUT_HASHDIR_CFG and configure_nut(): stash a copy of first-run config.log and config.h as examples of resulting configuration [#3108]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 3377bc2 commit 7c8b06b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

scripts/Windows/build-mingw-nut.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ configure_nut() {
149149
mkdir -p "${CI_CACHE_NUT_HASHDIR_CFG}"
150150
echo "=== Populating new CI_CACHE_NUT_HASHDIR_CFG='${CI_CACHE_NUT_HASHDIR_CFG}'" >&2
151151
echo "$* CC='$CC' CXX='$CXX' CPP='$CPP'" > "${CI_CACHE_NUT_HASHDIR_CFG}/ci_cfg.txt"
152+
# To be filled after the configuration succeeds:
153+
touch "${CI_CACHE_NUT_HASHDIR_CFG}/config.log"
154+
touch "${CI_CACHE_NUT_HASHDIR_CFG}/config.h"
152155
else
153156
echo "=== Found existing CI_CACHE_NUT_HASHDIR_CFG='${CI_CACHE_NUT_HASHDIR_CFG}'" >&2
154157
fi
@@ -157,9 +160,21 @@ configure_nut() {
157160
fi
158161
fi
159162

163+
CFG_RES=0
160164
$CONFIGURE_SCRIPT \
161165
$USE_AUTOCONF_CACHE_FLAG \
162-
"$@"
166+
"$@" \
167+
|| CFG_RES=$?
168+
169+
if [ x"${DO_USE_AUTOCONF_CACHE}" = xyes ] && [ -n "${USE_AUTOCONF_CACHE_FLAG}" ] && [ -s "${CI_CACHE_NUT_HASHDIR_CFG}/config.cache" ] ; then
170+
if [ x = x"`cat \"${CI_CACHE_NUT_HASHDIR_CFG}/config.log\" \"${CI_CACHE_NUT_HASHDIR_CFG}/config.h\"`" ] ; then
171+
# Populate on first run:
172+
cp -pf config.log "${CI_CACHE_NUT_HASHDIR_CFG}/"
173+
cp -pf include/config.h "${CI_CACHE_NUT_HASHDIR_CFG}/"
174+
fi
175+
fi
176+
177+
return $CFG_RES
163178
}
164179

165180
do_build_mingw_nut() {

0 commit comments

Comments
 (0)