#!/bin/sh

# make static lib and interp 
./configure
make clean
make

# the above make makes wish against shared libtcl ( since thats whats in
# the tcl dir 
# redo it specifying the static lib explicitly 
# this buildline is probably not portable off SCO
cc -belf  -Wl,-Bexport tkAppInit.o ./libtk4.1.a ../../tcl7.5/unix/libtcl7.5.a \
  -lsocket -lX11  -lm -lc -o wish


# rename static interp so doesn't get crunched
mv wish wishs

# cleanup
rm *.o ../generic/*.o lib*.so

# make shared lib and interp 
./configure --enable-shared
make

# make install dir
if [ ! -d ../dist ]; then
    mkdir ../dist
fi

if [ ! -d ../dist/usr ] ; then
    mkdir ../dist/usr
fi

if [ ! -d ../dist/usr/local ]; then
    mkdir ../dist/usr/local
fi

# install shared stuff 
make install

# install static stuff 
echo ./install-sh -c   wishs ../dist/usr/local/bin/wish4.1s
./install-sh -c        wishs ../dist/usr/local/bin/wish4.1s
echo ./install-sh -c -m 644 libtk4.1.a ../dist/usr/local/lib
./install-sh -c -m 644 libtk4.1.a ../dist/usr/local/lib


