#!/bin/bash

if [ `uname -m` == ppc64le ]; then
    B="--build=ppc64le-linux"
fi

if [ `uname` == Linux ]; then
    export CFLAGS="$CFLAGS -fPIE"
    export CPPFLAGS="$CFLAGS"
    export CXXFLAGS="$CFLAGS"
    export LDFLAGS="$LDFLAGS -pie"
fi

./configure $B --enable-threadsafe \
    --enable-tempstore \
    --enable-shared=yes \
    --disable-tcl \
    --disable-readline \
    --prefix=$PREFIX
make
make install

rm -rf $PREFIX/share
