#!/bin/bash

VER=$PKG_VERSION
INC=$PREFIX/include

if [ `uname` == Linux ]; then
    export CFLAGS="$CFLAGS"
    export LDFLAGS="$LDFLAGS"
fi

cd unix
./configure --prefix=$PREFIX --includedir=$INC
make
make install

cp ./*.h $INC
cp ../generic/*.h $INC
mkdir $INC/compat
cp ../compat/unistd.h $INC/compat
cd $PREFIX
rm -rf man share

if [ `uname` == Linux ]; then
    pushd $PREFIX/lib
    ln -s libtcl8.?.so libtcl.so
    popd
fi
