#/bin/csh -f
if ($1 =~ "CPQ") then
	echo ""
	echo "Building FPTHRD package for Compaq Tru64"
	echo ""
   set sys = "cpq"

else if ($1 =~ "SUN") then
	echo ""
	echo "Building FPTHRD package for SUN Solaris"
	echo ""
   set sys = "sun"

else if ($1 =~ "IBM") then
	echo ""
	echo "Building FPTHRD package for IBM AIX"
	echo ""
   set sys = "power3"

else if  ($1 =~ "SGI") then
	echo ""
	echo "Building FPTHRD package for SGI IRIX"
	echo ""
   set sys = "origin"

else if  ($1 =~ "SGI64") then
	echo ""
	echo "Building FPTHRD package for SGI IRIX with 64-bit addressing"
	echo ""

else
   echo ""
   echo "usage: build <SYSTEM>"
   echo ""
   echo "     where <SYSTEM> is one of the following: "
   echo ""
   echo "        CPQ     -- Compaq Tru64"
   echo "        SUN     -- SUN Solais"
   echo "        IBM     -- IBM AIX Power 3"
   echo "        SGI     -- SGI Origin running IRIX"
   echo "        SGI64   -- SGI Origin running IRIX with 64-bit addressing"
   echo ""
   exit 1
endif


rm -f constants.inc fpthrd_config
if  ($1 =~ "SGI64") then
  cc -64 config.c -o fpthrd_config
else
  cc config.c -o fpthrd_config
endif
fpthrd_config $1
rm -f fpthrd_config

echo ""
echo "Using make to build FPTHRD library in ../lib"
echo ""
if  ($1 =~ "SGI64") then
  make -f Makefile.origin clean
  make -f Makefile.origin BITS=-64
else
  make -f Makefile.$sys clean
  make -f Makefile.$sys
endif

