summaryrefslogtreecommitdiff
path: root/source/ap/mc/mc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/mc/mc.SlackBuild')
-rwxr-xr-xsource/ap/mc/mc.SlackBuild21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/ap/mc/mc.SlackBuild b/source/ap/mc/mc.SlackBuild
index 8beae8b4..d4f00205 100755
--- a/source/ap/mc/mc.SlackBuild
+++ b/source/ap/mc/mc.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# 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
@@ -21,10 +21,19 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=20090714_git
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo mc-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
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
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i486" ]; then
@@ -33,6 +42,8 @@ elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
fi
CWD=$(pwd)
@@ -52,7 +63,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-./autogen.sh
+if [ ! -x ./configure ]; then
+ ./autogen.sh
+fi
CFLAGS="$SLKCFLAGS" \
./configure \