about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArkaitz Jimenez <arkaitzj@gmail.com>2012-10-17 00:12:07 +0200
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-17 13:42:47 -0700
commitcf8bded7aae0673f9275de7948508da3c2b58650 (patch)
treeb1d8f4eee751bafd3590d6222568e794d540ec31
parent33adb7a82464a75d3bb33ce6112e01041b66bbd2 (diff)
Enable configure to detect 32 bit systems on 64 bit kernels
These systems run 32 bit binaries so arch needs to be forced
to 32 bits.
-rwxr-xr-xconfigure10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure b/configure
index e67ea3af5f3..40c6acead0e 100755
--- a/configure
+++ b/configure
@@ -257,6 +257,16 @@ case $CFG_CPUTYPE in
         err "unknown CPU type: $CFG_CPUTYPE"
 esac
 
+# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
+if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
+then
+    file -L "$SHELL" | grep -q "x86[_-]64"
+    if [ $? != 0 ]; then
+        CFG_CPUTYPE=i686
+    fi
+fi
+
+
 DEFAULT_HOST_TRIPLE="${CFG_CPUTYPE}-${CFG_OSTYPE}"
 
 CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"