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.
This commit is contained in:
Arkaitz Jimenez 2012-10-17 00:12:07 +02:00 committed by Tim Chevalier
parent 33adb7a824
commit cf8bded7aa
1 changed files with 10 additions and 0 deletions

10
configure vendored
View File

@ -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)/"