config: ensure the perl Configure run is the last statement
authorRichard Levitte <levitte@openssl.org>
Mon, 27 Jan 2020 07:42:20 +0000 (08:42 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 2 Feb 2020 10:57:01 +0000 (11:57 +0100)
Running any statement after Configure means we lose its exit code

Fixes #10951

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/10953)

(cherry picked from commit 4bf3e989fef9268507ba02744e7f71ee5637681c)

config

diff --git a/config b/config
index c1a94d4e42fae8f330ed40be5221f77ff9204618..deb7b8f0b0603821dabdd40011b1b1710d651830 100755 (executable)
--- a/config
+++ b/config
@@ -908,8 +908,12 @@ fi
 
 OUT="$OUT"
 
-$PERL $THERE/Configure LIST | grep "$OUT" > /dev/null
-if [ $? = "0" ]; then
+if [ "$OUT" = "darwin64-x86_64-cc" ]; then
+    echo "WARNING! If you wish to build 32-bit libraries, then you have to"
+    echo "         invoke 'KERNEL_BITS=32 $THERE/config $options'."
+fi
+
+if $PERL $THERE/Configure LIST | grep "$OUT" > /dev/null; then
   if [ "$VERBOSE" = "true" ]; then
     echo /usr/bin/env \
         __CNF_CPPDEFINES="'$__CNF_CPPDEFINES'" \
@@ -939,8 +943,5 @@ else
   exit 1
 fi
 
-if [ "$OUT" = "darwin64-x86_64-cc" ]; then
-    echo "WARNING! If you wish to build 32-bit libraries, then you have to"
-    echo "         invoke 'KERNEL_BITS=32 $THERE/config $options'."
-fi
+# Do not add anothing from here on, so we don't lose the Configure exit code
 )