diff --git a/src/build/compile.sh b/src/build/compile.sh index b6c14f33f..39c8ef9bd 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -21,18 +21,18 @@ type libtool >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \" type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; } type wget >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\""; read -p "Press [Enter] to continue..."; exit 1; } -export CC="gcc -mx32" +export CC="gcc" COMPILE_FOR_ANDROID=no RANLIB=ranlib if [ "$1" == "rpi" ]; then [ -z "$march" ] && march=armv6zk; [ -z "$mtune" ] && mtune=arm1176jzf-s; - [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -mfloat-abi=hard -mfpu=vfp"; echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float" elif [ "$1" == "mac" ]; then [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -fomit-frame-pointer"; echo "[INFO] Compiling for Intel MacOS" elif [ "$1" == "crosscompile" ]; then if [ "$2" == "android" ] || [ "$2" == "android-armv6" ]; then @@ -42,7 +42,7 @@ elif [ "$1" == "crosscompile" ]; then TOOLCHAIN_PREFIX="arm-none-linux-gnueabi" export CC="$TOOLCHAIN_PREFIX-gcc" CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX" - [ -z "$CFLAGS" ] && CFLAGS="-uclibc"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -uclibc"; echo "[INFO] Cross-compiling for Android ARMv6" elif [ "$2" == "android-armv7" ]; then COMPILE_FOR_ANDROID=yes @@ -51,21 +51,21 @@ elif [ "$1" == "crosscompile" ]; then TOOLCHAIN_PREFIX="arm-none-linux-gnueabi" export CC="$TOOLCHAIN_PREFIX-gcc" CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX" - [ -z "$CFLAGS" ] && CFLAGS="-uclibc"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -uclibc"; echo "[INFO] Cross-compiling for Android ARMv7" elif [ "$2" == "rpi" ]; then TOOLCHAIN_PREFIX="arm-linux-gnueabihf" [ -z "$march" ] && march=armv6zk; [ -z "$mtune" ] && mtune=arm1176jzf-s; - [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -mfloat-abi=hard -mfpu=vfp"; export CC="$TOOLCHAIN_PREFIX-gcc" CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX" - [ -z "$CFLAGS" ] && CFLAGS="-uclibc"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -uclibc"; echo "[INFO] Cross-compiling for Raspberry Pi ARMv6zk hard float" elif [ "$2" == "mac" ]; then [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer"; + [ -z "$CFLAGS" ] && CFLAGS="-mx32 -fomit-frame-pointer"; TOOLCHAIN_PREFIX="i686-apple-darwin10" export CC="$TOOLCHAIN_PREFIX-gcc" CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX" @@ -85,7 +85,7 @@ type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\ [ -z "$THREADS" ] && THREADS=1; [ -z "$march" ] && march=native; [ -z "$mtune" ] && mtune=native; -[ -z "$CFLAGS" ] && CFLAGS=""; +[ -z "$CFLAGS" ] && CFLAGS="-mx32"; [ -z "$CONFIGURE_FLAGS" ] && CONFIGURE_FLAGS=""; $CC -O3 -march=$march -mtune=$mtune -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1