5 # First argument is the directory where we'll execute configure
6 # We assume the directory name is descriptive and use it in messages
7 # and temporary file names.
12 # Check if a cache is being used
13 if test -f "$D.config.cache"; then
21 # The rest of the arguments is the command to execute.
23 # We capture the output to a log (to make the output more quiet), and only
24 # print it if something goes wrong (in which case we print config.log as well,
25 # which can be quite useful when looking at configure problems on bots where
26 # there's much information in that file).
28 # If a cache was used and configure failed, we remove the cache and then try
31 if ! "$@" > ".stamp-configure-$D.log" 2>&1; then
33 if [[ x
"$HAS_CACHE" == "x1" ]]; then
34 echo "Configuring $D failed, but a cache was used. Will try to configure without the cache."
35 rm "../$D.config.cache"
36 if ! "$@" > ".stamp-configure-$D.log" 2>&1; then
37 echo "Configuring $D failed without cache as well."
43 if [[ x
"$FAILED" == "x1" ]]; then
44 echo "Configuring $D failed:"
45 sed "s/^/ /" < ".stamp-configure-$D.log"
47 # Only show config.log if building on CI (jenkins/wrench)
49 if test -n "$JENKINS_HOME"; then
51 elif test -n "$BUILD_REVISION"; then
54 if [[ x
$SHOW_CONFIG_LOG == x1
]]; then
56 echo " *** config.log *** "
58 sed "s/^/ /" < config.log
67 echo "Configured $D in $((DIFF/60))m $((DIFF%60))s"