From 164b90eedbd38f235811cd0990e532fec5da38b9 Mon Sep 17 00:00:00 2001
From: Robby Workman <rworkman@slackbuilds.org>
Date: Tue, 18 May 2010 10:52:20 -0500
Subject: office/abiword: Miscellaneous script cleanup.

---
 office/abiword/abiword.SlackBuild | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

(limited to 'office/abiword/abiword.SlackBuild')

diff --git a/office/abiword/abiword.SlackBuild b/office/abiword/abiword.SlackBuild
index 26dc192118..029db3c3a4 100644
--- a/office/abiword/abiword.SlackBuild
+++ b/office/abiword/abiword.SlackBuild
@@ -29,10 +29,19 @@
 PRGNAM=abiword
 VERSION=2.8.4
 DOCSVER=$VERSION	# version of abiword-docs
-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
@@ -41,18 +50,17 @@ OUTPUT=${OUTPUT:-/tmp}
 if [ "$ARCH" = "i486" ]; then
   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
   LIBDIRSUFFIX=""
-elif [ "$ARCH" = "s390" ]; then
-  SLKCFLAGS="-O2"
+elif [ "$ARCH" = "i686" ]; then
+  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
   LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2 -fPIC"
   LIBDIRSUFFIX="64"
+else
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
 fi
 
-# If libgsf is built with gio enabled, then use it (for later in -current)
-# Otherwise, 13.0 does not have gio-enabled libgsf
-[ ! -f "/usr/include/libgsf-1/gsf/gsf-input-gio.h" ] && USE_GIO="no"
-
 set -e
 
 rm -rf $PKG
@@ -91,7 +99,6 @@ CXXFLAGS="$SLKCFLAGS" \
   --enable-clipart \
   --enable-templates \
   --enable-plugins \
-  --with-gio=${USE_GIO:-no} \
   --build=$ARCH-slackware-linux
 
 make
-- 
cgit v1.2.3