From cf8bded7aae0673f9275de7948508da3c2b58650 Mon Sep 17 00:00:00 2001 From: Arkaitz Jimenez Date: Wed, 17 Oct 2012 00:12:07 +0200 Subject: [PATCH] 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. --- configure | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index e67ea3af5f382..40c6acead0efa 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)/"