aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAndrew Clemons <andrew.clemons@gmail.com>2022-02-19 14:36:25 +1300
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-02-19 12:10:43 +0700
commitc42f84773bd9c694887323cff18a195628d6fa04 (patch)
tree2c2cde546afa829704b056b739d802cba4d68c48 /system
parentbe0a380ee29ee7070254f92fe09b092fc5195ad6 (diff)
system/cnijfilter2: Respect ARCH if already set.
If ARCH was already set, we skipped the code to set the BITS prefix, breaking the build. Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/cnijfilter2/cnijfilter2.SlackBuild46
1 files changed, 30 insertions, 16 deletions
diff --git a/system/cnijfilter2/cnijfilter2.SlackBuild b/system/cnijfilter2/cnijfilter2.SlackBuild
index 6b29cf1e8c1d..afbb4ed782ae 100644
--- a/system/cnijfilter2/cnijfilter2.SlackBuild
+++ b/system/cnijfilter2/cnijfilter2.SlackBuild
@@ -33,23 +33,12 @@ PKGTYPE=${PKGTYPE:-tgz}
SRCNAM=$PRGNAM-source
SRCVERSION=6.20-1
-MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i586
- export SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- export LIBDIRSUFFIX=""
- BITS="i686";;
- x86_64) export ARCH=x86_64
- export SLKCFLAGS="-O2 -fPIC"
- export LIBDIRSUFFIX="64"
- BITS="x86_64" ;;
- aarch64) export ARCH=aarch64
- export SLKCFLAGS="-O2 -fPIC"
- export LIBDIRSUFFIX="64"
- BITS="aarch64" ;;
- *) echo "Package for $MARCH architecture is not available."
- exit 1 ;;
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ aarch64) ARCH=aarch64 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
esac
fi
@@ -65,6 +54,31 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+ BITS="i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+ BITS="i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ BITS="x86_64"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ BITS="aarch64"
+else
+ echo "Package for $ARCH architecture is not available."
+ exit 1
+fi
+
+export ARCH
+export SLKCFLAGS
+export LIBDIRSUFFIX
+
set -e
rm -rf $PKG