Skip to contentSkip to conversation

configure: don't modify .status on error

PATCH In review Michael S. Tsirkin 2 participants 2 messages Mar 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: don't modify .status on error

./configure --help
make

will try to re-run configure with --help which isn't what was intended.

The reason is that config.status was written even on configure error.
Defer writing config.status until configure has completed successfully.

---
 configure | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
configure +14 -13
index 8689435..3ae57d7 100755
@@ -31,19 +31,6 @@ printf " '%s'" "$0" "$@" >> config.log
 echo >> config.log
 echo "#" >> config.log
 
-# Save the configure command line for later reuse.
-cat <<EOD >config.status
-#!/bin/sh
-# Generated by configure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-EOD
-printf "exec" >>config.status
-printf " '%s'" "$0" "$@" >>config.status
-echo >>config.status
-chmod +x config.status
-
 error_exit() {
     echo
     echo "ERROR: $1"
@@ -5136,3 +5123,17 @@ done
 if test "$docs" = "yes" ; then
   mkdir -p QMP
 fi
+
+# Save the configure command line for later reuse.
+cat <<EOD >config.status
+#!/bin/sh
+# Generated by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+EOD
+printf "exec" >>config.status
+printf " '%s'" "$0" "$@" >>config.status
+echo >>config.status
+chmod +x config.status
+
Signature · 1 line
MST
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Michael S. Tsirkin

./configure --help
make

will try to re-run configure with --help which isn't what was intended.

Quoted 6 lines

The reason is that config.status was written even on configure error.
Defer writing config.status until configure has completed successfully.

I think the only reason we were doing this early is that this info used to be in config.log, in which case it has to go at the start...

-- PMM