./config: detect x32-only environment.
authorAndy Polyakov <appro@openssl.org>
Thu, 23 Jun 2016 13:52:02 +0000 (15:52 +0200)
committerAndy Polyakov <appro@openssl.org>
Fri, 24 Jun 2016 20:07:33 +0000 (22:07 +0200)
RT#4583

Reviewed-by: Rich Salz <rsalz@openssl.org>
config

diff --git a/config b/config
index 2e02ae3..1fef03e 100755 (executable)
--- a/config
+++ b/config
@@ -640,7 +640,12 @@ case "$GUESSOS" in
        #fi
        OUT="linux64-s390x"
        ;;
-  x86_64-*-linux?) OUT="linux-x86_64" ;;
+  x86_64-*-linux?)
+       if $CC -dM -E -x c /dev/null 2>&1 | grep -q ILP32 > /dev/null; then
+           OUT="linux-x32"
+       else
+           OUT="linux-x86_64"
+       fi ;;
   *86-*-linux2) OUT="linux-elf"
        if [ "$GCCVER" -gt 28 ]; then
           if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then