#!/bin/bash

cd source
chmod +x configure install-sh

EXTRA_OPTS=""
if [ "$(uname)" == "Darwin" ];
then
    EXTRA_OPTS="--enable-rpath"
fi

./configure --prefix="$PREFIX" \
            --disable-samples \
            --disable-extras \
            --disable-layout \
            --disable-tests \
            --enable-static \
	    "${EXTRA_OPTS}"

make -j$CPU_COUNT
make check
make install

rm -rf $PREFIX/sbin

rm ${PREFIX}/lib/libicutest.a
rm ${PREFIX}/lib/libicuuc.a
rm ${PREFIX}/lib/libicuio.a
rm ${PREFIX}/lib/libicui18n.a
rm ${PREFIX}/lib/libicudata.a
rm ${PREFIX}/lib/libicutu.a


