From: Richard Levitte <levitte@openssl.org>
Date: Tue, 15 Nov 2016 08:56:20 +0000 (+0100)
Subject: On x86 machines where the compiler supports -m32, use 'linux-x86'
X-Git-Tag: OpenSSL_1_1_1-pre1~3034
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=27a451e3739d8331b9c180b0373b88ab6c382409;p=oweals%2Fopenssl.git

On x86 machines where the compiler supports -m32, use 'linux-x86'

The rationale is that the linux-x86 is the most likely config target
to evolve and should therefore be chosen when possible, while
linux-elf is mostly reserved for older Linux machines.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1924)
---

diff --git a/config b/config
index b8a787cc53..4e7fd10430 100755
--- a/config
+++ b/config
@@ -640,7 +640,14 @@ case "$GUESSOS" in
 	else
 	    OUT="linux-x86_64"
 	fi ;;
-  *86-*-linux2) OUT="linux-elf" ;;
+  *86-*-linux2)
+        # On machines where the compiler understands -m32, prefer a
+        # config target that uses it
+        if $CC -m32 -E -x c /dev/null > /dev/null 2>&1; then
+            OUT="linux-x86"
+        else
+            OUT="linux-elf"
+        fi ;;
   *86-*-linux1) OUT="linux-aout" ;;
   *-*-linux?) OUT="linux-generic32" ;;
   sun4[uv]*-*-solaris2)