summaryrefslogtreecommitdiff
path: root/source/ap/bc/bc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/bc/bc.SlackBuild')
-rwxr-xr-xsource/ap/bc/bc.SlackBuild15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/ap/bc/bc.SlackBuild b/source/ap/bc/bc.SlackBuild
index a8ebb8eb..d467d987 100755
--- a/source/ap/bc/bc.SlackBuild
+++ b/source/ap/bc/bc.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2006, 2007, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,9 +22,18 @@
PKGNAM=bc
VERSION=${VERSION:-1.06.95}
-ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-2}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-${PKGNAM}
@@ -37,6 +46,8 @@ elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
fi
cd $TMP