summaryrefslogtreecommitdiff
path: root/source/ap/libx86/libx86.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/libx86/libx86.SlackBuild')
-rwxr-xr-xsource/ap/libx86/libx86.SlackBuild16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/ap/libx86/libx86.SlackBuild b/source/ap/libx86/libx86.SlackBuild
index 02c54a09..bd075348 100755
--- a/source/ap/libx86/libx86.SlackBuild
+++ b/source/ap/libx86/libx86.SlackBuild
@@ -3,7 +3,7 @@
# Slackware build script for libx86
# Copyright 2008 Robby Workman, Northport, Alabama, USA
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,9 +24,18 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
VERSION=${VERSION:-1.1}
-ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1}
+# 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-libx86
@@ -40,6 +49,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
rm -rf $PKG