--- php.SlackBuild.s390x	2009-07-01 10:15:33.000000000 -0400
+++ php.SlackBuild.s390x	2009-07-07 22:39:23.000000000 -0400
@@ -21,8 +21,8 @@
   SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "s390" ]; then
-  SLKCFLAGS="-O2"
+elif [ "$ARCH" = "s390x" ]; then
+  SLKCFLAGS="-O1"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2"
 fi
@@ -32,7 +32,7 @@
 if [ -r $IMAPLIBDIR/lib/c-client.a ]; then
   echo "Using IMAP library:"
   ls -l $IMAPLIBDIR/lib/c-client.a
-  sleep 5
+  sleep 1
 else
   ( cd $CWD/../pine ; ./pine.SlackBuild )
   ( cd $TMP/pine${PINE}/imap/c-client
@@ -45,10 +45,12 @@
 fi
 
 php_configure() {
-EXTENSION_DIR=/usr/lib/php/extensions \
+EXTENSION_DIR=/usr/lib64/php/extensions \
 CFLAGS="$SLKCFLAGS" \
 ./configure --prefix=/usr \
   $* \
+  --libdir=/usr/lib64 \
+  --with-libdir=lib64 \
   --sysconfdir=/etc \
   --with-config-file-path=/etc/apache \
   --enable-safe-mode \
@@ -67,12 +69,10 @@
   --enable-dbase \
   --enable-ftp \
   --with-iconv \
-  --with-exif \
   --enable-exif \
   --with-gd \
   --enable-gd-native-ttf \
   --with-jpeg-dir=/usr \
-  --with-png \
   --with-ttf \
   --with-freetype-dir=/usr \
   --with-gmp \
@@ -86,24 +86,18 @@
   --with-sqlite=shared \
   --with-pdo-sqlite=shared \
   --with-gettext=shared,/usr \
-  --with-expat-dir=/usr \
-  --with-xml \
   --with-xsl=/usr \
   --enable-wddx \
   --with-mm=/usr \
-  --enable-trans-sid \
   --enable-shmop \
   --enable-sockets \
   --with-regex=php \
   --enable-sysvsem \
   --enable-sysvshm \
-  --enable-yp \
-  --enable-memory-limit \
   --with-tsrm-pthreads \
   --enable-shared \
   --disable-debug \
   --with-zlib=/usr \
-  --with-dom \
   --with-curl \
   --enable-soap
   # --with-mod_charset    # only for Russian patched Apache
@@ -133,7 +127,7 @@
 fi
 
 if [ "$ARCH" = "s390" ]; then
-  zcat $CWD/php.configure.s390.diff.gz | patch -p1 || exit
+  echo #zcat $CWD/php.configure.s390.diff.gz | patch -p1 || exit
 fi
 
 # Fixup perms/owners:
@@ -159,10 +153,14 @@
 zcat $CWD/php.ini.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
 
 # Make the Apache module version of PHP:
+( cd /usr/local/lib/c-client
+  ln -sf lib lib64
+)
 php_configure \
   --disable-static \
   --with-apxs=/usr/sbin/apxs \
   --enable-discard-path
+
 make -j3 || exit 1
 make install INSTALL_ROOT=$PKG || exit 1
 make distclean || exit 1
@@ -178,10 +176,15 @@
   --enable-fastcgi \
   --enable-pcntl \
   --enable-sigchild
+
 make -j3 || exit 1
 make install-cli INSTALL_ROOT=$PKG || exit 1
 chmod 755 $PKG/usr/bin/php
 
+( cd /usr/local/lib/c-client
+  rm -vf lib64
+)
+
 # Install the CGI/FastCGI interpreter:
 cat sapi/cgi/php-cgi > $PKG/usr/bin/php-cgi
 chmod 755 $PKG/usr/bin/php-cgi
