diff options
-rw-r--r-- | system/cabextract/cabextract.SlackBuild | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/system/cabextract/cabextract.SlackBuild b/system/cabextract/cabextract.SlackBuild index aa985f5c1f..18dbfb039a 100644 --- a/system/cabextract/cabextract.SlackBuild +++ b/system/cabextract/cabextract.SlackBuild @@ -24,28 +24,37 @@ PRGNAM=cabextract VERSION=1.2 -ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -case "$ARCH" in - i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" - ;; - i686) SLKCFLAGS="-O2 -march=i686 -mtune=i686" - ;; - s390) SLKCFLAGS="-O2" - ;; - powerpc) SLKCFLAGS="-O2" - ;; - x86_64) SLKCFLAGS="-O2 -fPIC" - SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" - ;; -esac +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi set -e |