core/buildscripts: Added proper uname based BITS detection.

Added automatic detection for the BITS variable.
This commit is contained in:
dev
2016-05-05 22:32:20 +00:00
parent 4fd0261efa
commit c2f35c0d29
3 changed files with 37 additions and 3 deletions

View File

@ -5,7 +5,17 @@
[ -z "$CC" ] && CC="gcc"
if [ -z $BITS ]; then
BITS=64
if [[ $(uname -a) =~ "x86_64" ]]; then
BITS=64
elif [[ $(uname -a) =~ "i386" ]]; then
BITS=32
elif [[ $(uname -a) =~ "i686" ]]; then
BITS=32
else
echo "Unable to detect default setting for BITS variable"
exit
fi
printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2
fi

View File

@ -86,10 +86,22 @@ fi
if [ -z $BITS ]; then
BITS=32
UNAME="$(uname -a)"
if test "${UNAME#*x86_64}" != "x86_&4"; then
BITS=64
elif test "${UNAME#*i386}" != "i386"; then
BITS=32
elif test "${UNAME#*i686}" != "i686"; then
BITS=32
else
echo "Unable to detect default setting for BITS variable"
exit
fi
printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2
fi
if [ -z $CC ]; then
export CC="gcc"
printf "\aCC variable not set, defaulting to $CC\n\a" >&2

View File

@ -24,10 +24,22 @@ esac
if [ -z $BITS ]; then
BITS=64
UNAME="$(uname -a)"
if test "${UNAME#*x86_64}" != "x86_&4"; then
BITS=64
elif test "${UNAME#*i386}" != "i386"; then
BITS=32
elif test "${UNAME#*i686}" != "i686"; then
BITS=32
else
echo "Unable to detect default setting for BITS variable"
exit
fi
printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2
fi
if [ -z $CC ]; then
export CC="gcc"
printf "\aCC variable not set, defaulting to $CC\n\a" >&2