:
# Copyright (c) 2004 Ingres Corporation
#
# This script creates the iisysdep.sh file, which contains system- or
# architecture-dependent definitions which are used by all of the
# install scripts.  All install scripts which have even the least 
# potential for having system dependencies -- which is to say, probably
# all of them period -- should include iisysdep.sh, just in case.  Any
# system-dependent code in such files should be if'd or case'd on some-
# thing defined in iisysdep.sh.
#
# History:
#	02-apr-93 (dwilson)
#		Created
#	13-dec-95 (morayf)
#		Added SNI RMx00 (rmx_us5) like Pyramid (pym_us5).
#	10-may-1999 (walro03)
#	    Remove obsolete version string dr6_uvl, dra_us5, odt_us5.
#       03-jul-99 (podni01)
#               Added support for ReliantUNIX V 5.44 - rux_us5 (same as rmx_u
##      01-Aug-2004 (hanch04)
##          First line of a shell script needs to be a ":" and
##          then the copyright should be next.
##	4-Oct-2004 (drivi01)
##		Due to merge of jam build with windows, some directories
##		needed to be updated to reflect most recent map.
#-------------------------------------------------------------------------

. $ING_SRC/bin/readvers
vers=$config

PATH=$II_SYSTEM/ingres/utility:$II_SYSTEM/ingres/bin:/bin:/usr/bin:/usr/ucb:/etc

[ -n "$ING_VERS" ] && noise="/$ING_VERS/src"
sysdep=$ING_SRC/admin/install$noise/shell_unix/iiw4sysdep.sh

date=`date`

#
#  VERSION.ING is generated by MINGH in admin/install/specials
#

< $II_SYSTEM/ingres/utility/VERSION.ING ||
{
	echo "run ming in admin/install/specials and try again." >&2
	exit 1
}

isys=`cat $II_SYSTEM/ingres/utility/VERSION.ING`
isys=`cat $II_SYSTEM/ingres/w4ingver.rel`

#-------------------------------------------------------------------------
#  Create sysdep file and set stdout to it...

exec > $sysdep
#trap 'rm -f $sysdep' 0


#-------------------------------------------------------------------------

cat << []
:
# INGRES 6.1+ $sysdep created on $date
# Configuration: $vers   
# Release ID   : $isys
[]


#-------------------------------------------------------------------------

echo ""
echo "#  Set the current version:"

echo VERS=$vers

echo export VERS



#-------------------------------------------------------------------------
case $vers in
m88_us5)
        # this is the first w4gl release on m88.
        oldext=' ' ext=so.2.0;;
dg8_us5)
        oldext=so ext=so.1.0;;
ris_us5|rs4_us5|su4_u42|pym_us5|rmx_us5|rux_us5|ris_u64)
        oldext=so.1.0 ext=so.2.0;;
hp8_us5|hp3_us5)
        oldext=sl ext=sl;;
nc4_us5)
        # This is the first w4gl release on ncr.
        oldext=' ' ext=so;;
esac

echo ""
echo "# Set the library extensions from the previous and the current"
echo "# releases."

echo II_EXT=$ext
echo II_OLD_EXT=$oldext

echo export II_EXT
echo export II_OLD_EXT

#-------------------------------------------------------------------------

echo ""
echo "#  Set library name and path variable name:"
case $vers in
ris_us5|rs4_us5|ris_u64)
        echo II_HAS_DL=1
	echo II_LD_VAR=LIBPATH
	echo II_LIBNAME=libuser3gl
	;;
ds3_ulx|sqs_ptx|sco_us5)
        echo II_HAS_DL=0
	echo II_LD_VAR=
	echo II_LIBNAME=
	;;
m88_us5|dg8_us5|dr6_us5|pym_us5|rmx_us5|rux_us5)
        echo II_HAS_DL=1
	echo II_LD_VAR=LD_LIBRARY_PATH
	echo II_LIBNAME=libuser3gl
	;;
hp8_us5|hp3_us5|su4_u42|nc4_us5)
        echo II_HAS_DL=1
	echo II_LD_VAR=
	echo II_LIBNAME=libuser3gl
	;;
*)
	echo II_BAD="This platform has not defined how to manage 3gl libraries"
	;;
esac


echo export II_HAS_DL
echo export II_LD_VAR
echo export II_LIBNAME



#-------------------------------------------------------------------------

echo ""
echo "## End of $sysdep "

chmod 770 $sysdep
#trap '' 0
