#!/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=cc
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 +u1 -D_BSD=44 -DHPUX -Aa -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE +w1 $DHU_INCLUDES -c watchdog.c

$CC -L$II_SYSTEM/ingres/lib -L$DHU_LIB_DIR -o watchdog.ing64 watchdog.o    \
	-lWD -lDBA -lingres -Wl,-a,shared -ldhconv -lc -lm

mv watchdog.ing64 $DESTINATION

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