#!/bin/sh

top=$(pwd)

export CC=gcc
export CXX=g++


if [ "$PLMACH" = "macosx" ] ; then
   export CFLAGS="-DDarwin"
fi

echo "  (Using toplevel directory $top ....)"

# Global options.
gopts="--prefix=$top --exec-prefix=$top --disable-shared"

./configure $gopts  			       | tee _spool 2>&1
make clean 				       | tee -a _spool 2>&1
make 					       | tee -a _spool 2>&1

cp   libcfitsio.a ../voclient/lib
mv   libcfitsio.a ../../lib
cp   fitsio*.h longnam.h ../../include

make clean
echo "done"
