#!/bin/sh

#
# COPYRIGHT:    Licensed material - Property of IBM
#               5765-530
#               (C) Copyright IBM Corp. 1996  All Rights Reserved.
#

# build_ing_wdog
#
# This shell script builds the Ingres watchdog and 
# installs it in the proper directory.

CC="/opt/SUNWspro/bin/cc -misalign"
DHU_INCLUDES="-I../include"
DHU_LIB_DIR=../../../lib
DESTINATION=../..

if [ X$II_SYSTEM = X ]; then
  echo II_SYSTEM must be set
  exit
fi

$II_SYSTEM/ingres/bin/esqlc -fwatchdog.c ../src/watchdog.sc
$CC  -D_BSD=44 -DSUNOS $DHU_INCLUDES -c watchdog.c

$CC -L$II_SYSTEM/ingres/lib -L$DHU_LIB_DIR -o watchdog.ing64 watchdog.o    \
	-lWD -lDBA -lm -lsocket -l nsl -lc -lw -lingres

mv watchdog.ing64 $DESTINATION

if [ -f $DESTINATION/watchdog.ing64 ]
then
	echo "Build complete. Watchdog file is ready."
else
	echo "Build failed."
fi
