summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini <matteo.bernardini@sns.it>2010-05-29 10:12:46 +0200
committer Robby Workman <rworkman@slackbuilds.org>2010-06-01 00:39:12 -0500
commitde5a80a765e619d03c521f87e3efb689bb270d03 (patch)
treee04b4505fda6722c722edd18d36ef43e4ceccee7
parent94e75f8453bdf8de449a4fde599ac8cb306117fb (diff)
downloadslackbuilds-de5a80a765e619d03c521f87e3efb689bb270d03.tar.gz
slackbuilds-de5a80a765e619d03c521f87e3efb689bb270d03.tar.xz
system/cabextract: miscellaneous cleanups
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
-rw-r--r--system/cabextract/cabextract.SlackBuild37
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