summaryrefslogtreecommitdiff
path: root/libraries/opencv/opencv.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/opencv/opencv.SlackBuild')
-rw-r--r--libraries/opencv/opencv.SlackBuild18
1 files changed, 17 insertions, 1 deletions
diff --git a/libraries/opencv/opencv.SlackBuild b/libraries/opencv/opencv.SlackBuild
index 3cb0e52b94..11d977e9af 100644
--- a/libraries/opencv/opencv.SlackBuild
+++ b/libraries/opencv/opencv.SlackBuild
@@ -24,10 +24,19 @@
PRGNAM=opencv
VERSION=1.1pre1
-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) 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/SBo}
PKG=$TMP/package-$PRGNAM
@@ -42,6 +51,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
rm -rf $PKG
@@ -54,6 +66,10 @@ cd $PRGNAM-$VERSION || exit 1
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
+# Patch to build with libpng14 and gcc4.4.
+patch -p1 < $CWD/opencv-gcc4.4.patch
+patch -p1 < $CWD/opencv-libpng14.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \