#!/bin/sh -ex

source universal.setup

APP=expat
VERS=1.95.8
BDIR=`/bin/pwd -P`
PREFIX=$BDIR/inst
LD_LIBRARY_PATH=
LD_RUN_PATH=
CPPFLAGS="-I$PREFIX/include"
CC=gcc
CFLAGS="$CFLAGS -g -O1"
LDFLAGS="$LDFLAGS -L$PREFIX/lib"
EDITOR="vi"
export LD_LIBRARY_PATH LD_RUN_PATH CC CFLAGS CPPFLAGS LDFLAGS EDITOR

# Create install dir if it doesn't exist
if [ ! -d $PREFIX ]; then
    mkdir -p $PREFIX/include $PREFIX/lib
fi

/bin/rm -rf $APP-$VERS
gzip -dc $APP-$VERS.tar.gz | tar xvf -
cd $APP-$VERS
./configure --prefix=$PREFIX --disable-libtool-lock \
        --enable-shared --disable-static --disable-dependency-tracking
cp -p -f $FIXED_LIBTOOL libtool
make all install
/bin/rm -rf $PREFIX/man $PREFIX/share
cd $BDIR
