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>
This commit is contained in:
Andrew Clemons 2022-02-19 14:36:25 +13:00 committed by Willy Sudiarto Raharjo
parent be0a380ee2
commit c42f84773b
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
1 changed files with 30 additions and 16 deletions

View File

@ -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