#!/bin/sh

# $Id: getXITEDirs,v 1.4 1997/09/04 09:57:52 svein Exp $

# Determine the XITE directory parameters.

xite_bin_dest_def=$XITE_HOME/bin/$XITE_HOSTTYPE
xite_lib_dest_def=$XITE_HOME/lib/$XITE_HOSTTYPE
xite_inc_dest_def=$XITE_HOME/include
xite_man_dest_def=$XITE_HOME/man
xite_doc_dest_def=$XITE_HOME/doc

XITE_BIN_DEST=\
`$getDir "$XITE_BIN_DEST" "$xite_bin_dest_def" 'Directory for XITE executables' "$TMP_INSTALL" "stderr" 2 755`

XITE_LIB_DEST=\
`$getDir "$XITE_LIB_DEST" "$xite_lib_dest_def" 'Directory for XITE library' "$TMP_INSTALL" "stderr" 2 755`

XITE_INC_DEST=\
`$getDir "$XITE_INC_DEST" "$xite_inc_dest_def" 'Directory for XITE include files' "$TMP_INSTALL" "stderr" 2 755`

XITE_MAN_DEST=\
`$getDir "$XITE_MAN_DEST" "$xite_man_dest_def" 'Directory for XITE man pages' "$TMP_INSTALL" "stderr" 2 755`

XITE_DOC_DEST=\
`$getDir "$XITE_DOC_DEST" "$xite_doc_dest_def" 'Directory for XITE html files and PostScript manuals' "$TMP_INSTALL" "stderr" 2 755`

$checkdir 755 $XITE_DOC_DEST/ReferenceManual > /dev/null 2>&1
status_doc=$?

$checkdir 755 $XITE_MAN_DEST/cat1 $XITE_MAN_DEST/cat3 $XITE_MAN_DEST/cat5 \
	$XITE_MAN_DEST/man1 $XITE_MAN_DEST/man3 $XITE_MAN_DEST/man5 \
	> /dev/null 2>&1
status_man=$?

if test "$status_doc" -ne 0 -o "$status_man" -ne 0
then
	$saveParameters

	echo "ERROR:" 1>&2
	echo "Creation of subdirectories for $XITE_MAN_DEST or" 1>&2
	echo "$XITE_DOC_DEST failed." 1>&2
	echo "You must have write permission in the directory." 1>&2
	echo "Installation/build interrupted." 1>&2
	echo "" 1>&2
	$paramMessage 1>&2

	echo "exit 1"
	exit 1
fi

echo "XITE_BIN_DEST=$XITE_BIN_DEST; XITE_LIB_DEST=$XITE_LIB_DEST"
echo "XITE_INC_DEST=$XITE_INC_DEST; XITE_MAN_DEST=$XITE_MAN_DEST"
echo "XITE_DOC_DEST=$XITE_DOC_DEST"
echo "export XITE_BIN_DEST XITE_LIB_DEST XITE_INC_DEST XITE_MAN_DEST"
echo "export XITE_DOC_DEST"
