Turned CPU detection into a function

This commit is contained in:
T. Joseph Carter 2015-02-02 07:13:01 -08:00
parent 2c6e9e1a31
commit 52756be36a
1 changed files with 29 additions and 24 deletions

View File

@ -2,30 +2,35 @@
# vi: ts=3 sw=3 et # vi: ts=3 sw=3 et
# Architecture Assignment # Architecture Assignment
[ -z "${ARCH}" ] && ARCH="`uname -m`" config_cpu() {
case "${ARCH}" in [ -n "${2}" ] && ARCH=${1}
x86_64) [ -z "${ARCH}" ] && ARCH="`uname -m`"
X86=true case "${ARCH}" in
X86_64=true x86_64)
;; X86=true
i386|i686) X86_64=true
X86=true ;;
;; i386|i686)
armv*) X86=true
ARM=true ;;
export FORMAT_COMPILER_TARGET=armv armv*)
export RARCHCFLAGS="${RARCHCFLAGS} -marm" ARM=true
case "${ARCH}" in export FORMAT_COMPILER_TARGET=armv
armv5tel) ARMV5=true ;; export RARCHCFLAGS="${RARCHCFLAGS} -marm"
armv6l) ARMV6=true ;; case "${ARCH}" in
armv7l) ARMV7=true ;; armv5tel) ARMV5=true ;;
esac armv6l) ARMV6=true ;;
;; armv7l) ARMV7=true ;;
esac esac
if [ -n "${PROCESSOR_ARCHITEW6432}" -a "${PROCESSOR_ARCHITEW6432}" = "AMD64" ]; then ;;
ARCH=x86_64 esac
X86=true && X86_64=true if [ -n "${PROCESSOR_ARCHITEW6432}" -a "${PROCESSOR_ARCHITEW6432}" = "AMD64" ]; then
fi ARCH=x86_64
X86=true && X86_64=true
fi
}
config_cpu
if [ -z "$JOBS" ]; then if [ -z "$JOBS" ]; then
if command -v nproc >/dev/null; then if command -v nproc >/dev/null; then