#!/bin/sh
CWD=`pwd` 
cd /tmp
tar xzvf $CWD/gmp-3.1.1.tar.gz
cd gmp-3.1.1

# Due to crazy MMX checking and a broken configure script, this patch is
# only way to make this package generic so it will also run on a 386 or 486.

zcat $CWD/gmp-3.1.1.i386.diff.gz | patch -p1 --verbose --backup --suffix=.orig

# GMP is not a GNOME thing, so even though now only GNOME libs and apps are
# linking to it (that's why it's in the GTK Slackware series) I'm going to
# place this in /usr.  A rare exception to the --prefix=/opt/gnome.

CFLAGS=-O2 ./configure --prefix=/usr \
                       --with-gnu-ld \
                       i386-slackware-linux-gnu
make
make install
mkdir -p /usr/doc/gmp-3.1.1
cp -a AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README /usr/doc/gmp-3.1.1
chown -R root.root /usr/doc/gmp-3.1.1
chmod 644 /usr/doc/gmp-3.1.1/*
