summaryrefslogtreecommitdiffstats
path: root/games/opendune/opendune.SlackBuild
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2017-05-31 14:06:28 -0400
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2017-06-03 08:00:22 +0700
commit8421bc370053d833d438772a2d1ae31d7f2b9bbd (patch)
treec043786044564fa70e000463b9a5a1a327abd965 /games/opendune/opendune.SlackBuild
parentf8f09fcf2da08a9f802ad2238ad442374935eb9d (diff)
downloadslackbuilds-8421bc370053d833d438772a2d1ae31d7f2b9bbd.tar.gz
slackbuilds-8421bc370053d833d438772a2d1ae31d7f2b9bbd.tar.xz
games/opendune: Fix x86 build.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'games/opendune/opendune.SlackBuild')
-rw-r--r--games/opendune/opendune.SlackBuild24
1 files changed, 23 insertions, 1 deletions
diff --git a/games/opendune/opendune.SlackBuild b/games/opendune/opendune.SlackBuild
index 5273778340..6f11010a48 100644
--- a/games/opendune/opendune.SlackBuild
+++ b/games/opendune/opendune.SlackBuild
@@ -6,11 +6,12 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20170531 bkw: BUILD=2, fix build on x86
# 20170302 bkw: use long-format github URL
PRGNAM=opendune
VERSION=${VERSION:-0.8}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -28,9 +29,11 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ MMX=${MMX:-maybe}
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ MMX=${MMX:-maybe}
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
@@ -57,6 +60,25 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# 20170531 bkw: upstream uses #if defined(__i386__) to test for MMX,
+# which is wrong (should be checking __MMX__ instead). This only affects
+# x86 builds (not x86_64), and only if SDL 1 is used.
+patch -p1 < $CWD/mmx_bodge.diff
+
+if [ "$MMX" = "maybe" ]; then
+ if grep -q '\<mmx\>' /proc/cpuinfo; then
+ MMX="yes"
+ else
+ MMX="no"
+ fi
+ echo "=== autodected MMX: $MMX"
+fi
+
+if [ "$MMX" = "yes" ]; then
+ SLKCFLAGS="$SLKCFLAGS -mmmx"
+ echo "=== added -mmmx to SLKCFLAGS"
+fi
+
# Fix compile issue with /usr/include/alsa/pcm.h (uses inline)
sed -i 's,-ansi,,' config.lib