]> git.lizzy.rs Git - rust.git/commitdiff
Enable configure to detect 32 bit systems on 64 bit kernels
authorArkaitz Jimenez <arkaitzj@gmail.com>
Tue, 16 Oct 2012 22:12:07 +0000 (00:12 +0200)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Wed, 17 Oct 2012 20:42:47 +0000 (13:42 -0700)
These systems run 32 bit binaries so arch needs to be forced
to 32 bits.

configure

index e67ea3af5f382a80ef7305e93aa50a9f566bfc0f..40c6acead0efa3d937f3987c39015d58b3f6d2e4 100755 (executable)
--- 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)/"