summaryrefslogtreecommitdiff
path: root/academic/qtoctave/qtoctave.SlackBuild
diff options
context:
space:
mode:
authordsomero <xgizzmo@gmail.com>2010-05-23 20:48:39 -0400
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-23 23:30:51 -0500
commit7321fbe203bff44d3a24706e25c3269f6a2c857c (patch)
treebf1d872482ff97c783d41405973c43791d60d922 /academic/qtoctave/qtoctave.SlackBuild
parent2d344bfb2f03d961804dcdf1c288b53742b8ba24 (diff)
downloadslackbuilds-7321fbe203bff44d3a24706e25c3269f6a2c857c.tar.gz
academic/qtoctave: Miscellaneous cleanups and patch.
Cleaned up build and added a patch for gcc4.4.
Diffstat (limited to 'academic/qtoctave/qtoctave.SlackBuild')
-rw-r--r--academic/qtoctave/qtoctave.SlackBuild24
1 files changed, 20 insertions, 4 deletions
diff --git a/academic/qtoctave/qtoctave.SlackBuild b/academic/qtoctave/qtoctave.SlackBuild
index f88c5236f8..fd5aa04ef1 100644
--- a/academic/qtoctave/qtoctave.SlackBuild
+++ b/academic/qtoctave/qtoctave.SlackBuild
@@ -7,26 +7,39 @@
PRGNAM=qtoctave
VERSION=${VERSION:-0.8.1}
-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
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686 -DNDEBUG"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686 -DNDEBUG"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC -DNDEBUG"
+ SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+
set -e # Exit on most errors
rm -rf $PKG
@@ -42,6 +55,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Fix building with gcc4.4
+patch -p2 < $CWD/qtoctave-0.8.1-gcc4.4.patch
+
cmake \
-DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \