aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/physfs/physfs.SlackBuild21
1 files changed, 19 insertions, 2 deletions
diff --git a/libraries/physfs/physfs.SlackBuild b/libraries/physfs/physfs.SlackBuild
index 8fa100fdbcd77..52e6dce031705 100644
--- a/libraries/physfs/physfs.SlackBuild
+++ b/libraries/physfs/physfs.SlackBuild
@@ -24,10 +24,19 @@
PRGNAM=physfs
VERSION=2.0.0
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-2}
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,7 +51,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
-fi
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -55,11 +66,17 @@ chmod -R a-s,u+w,go+r-w .
# LIB_SUFFIX is ignored work around it.
sed -i -e "s|DESTINATION lib|DESTINATION lib${LIBDIRSUFFIX}|g" \
+ -e "s:-Werror::" \
CMakeLists.txt
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DPHYSFS_ARCHIVE_7Z=OFF \
+ -DPHYSFS_BUILD_SHARED=ON \
+ -DPHYSFS_BUILD_TEST=OFF \
+ -DPHYSFS_BUILD_WX_TEST=OFF \
+ -DPHYSFS_INTERNAL_ZLIB=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX:STRING=${LIBDIRSUFFIX} || exit 1