#!/bin/csh

# test to see if xwais can be made on this system

# check for /usr/include/X11

set X11_INCLUDES=/usr/include/X11
set LIB_DIRS=(/usr/lib /usr/local/lib)
set X11_LIBRARIES=(libX11.a libXt.a libXaw.a)

if (! -d $X11_INCLUDES ) then
  echo "X include files not in" $X11_INCLUDES ", can't make xwais"
  exit 1
endif

foreach l ($LIB_DIRS)
 foreach f ($X11_LIBRARIES)
  if ( -f ${l}/${f} ) goto cont
 end
end

echo "Can't find X libraries, can't make xwais."
exit 1

cont:

echo "Making xwais..."

if { sun } then
  make -e -k CC=$CC "CFLAGS=$CFLAGS" TOP=$TOP
else
  make -k CC=$CC "CFLAGS=$CFLAGS" TOP=$TOP 
endif
