#!/sbin/sh

########
# Product:  GraphicsPEX5DK
# Fileset:  PEX5-EXAMPLES
# configure
#
# $Source: /hmstmp/update.22059/./release/SD/GraphicsPEX5v2/PEX5-EXAMPLES/configure,v $
# $Revision: 550.2 $
# $Date: 96/07/16 12:22:21 $
#
########
#
# (c) Copyright Hewlett-Packard Company 1994
#
########

	set -a       					# export all vars
	exitval=0					# anticipate success

	UTILS="/usr/lbin/sw/control_utils"
	if [[ ! -f $UTILS ]]
	then
		echo "ERROR:    Cannot find UTILS"
		exit 1
	fi
	. $UTILS

################################################################################
#set -x # For debugging purposes.  _Never_ ship uncommented!!


	##
	##  Set up local environment variables
	##

	SW_INSTALL_DIR="/"

	##
	## Test to see if either SW_ROOT_DIRECTORY or SW_LOCATION is
	## set to something other than /.  If so, set up SW_INSTALL_DIR
	## so it will not have spurious /'s in the path name.
	##
	
	if [ $SW_ROOT_DIRECTORY != / -o $SW_LOCATION != / ]
	then
		if [ $SW_ROOT_DIRECTORY != / ]
		then
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}${SW_LOCATION}"
			else
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}"
			fi
		else
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_LOCATION}"
			fi
		fi
	fi

	PEX_DIR="$SW_LOCATION"
	VAR_DIR="/var/opt/PEX5"

	##
	## Create the directory used for the libpexut.a utility library
	##
	if [ ! -d $VAR_DIR ]
	then
		mkdir     $VAR_DIR > /dev/null 2>&1
		chmod 777 $VAR_DIR > /dev/null 2>&1
		chgrp bin $VAR_DIR > /dev/null 2>&1
		chown bin $VAR_DIR > /dev/null 2>&1
	fi

	exit $exitval
################################################################################
