#!/bin/sh

# $Id: getPNMDirs,v 1.2 1996/03/15 11:00:37 svein Exp $

# Determine the pnm directory parameters

if test -z "$PNM_INC_DIR" -o -z "$PNM_LIB_DIR"
then

cat <<EOF 1>&2

This software provides converters between the XITE image file
format and the pnm file formats (including pbm, pgm and ppm), supplied by
the free software packages pbmplus and netpbm.

If the pbm, pgm, ppm and pnm libraries are already installed on your
platform, you may want these converters installed also.

EOF
	echo "If you want the pnm converters, you will need to specify where" 1>&2
	echo "the libraries and include files are located." 1>&2
	$echoNl "Would you like to install the converters between pnm and " 1>&2
	$echoNl "XITE? ([y]/n) " 1>&2

	read pnm_install

	if test -z "$pnm_install" -o "$pnm_install" = "yes" \
		-o "$pnm_install" = "y"
	then
		pnm_install="y"
	else
		pnm_install="n"
	fi

	if test "$pnm_install" = "y"
	then
		pnm_inc_def=/usr/local/include
		pnm_lib_def=/usr/local/lib
	fi
elif test "$PNM_INC_DIR" = "-" -o "$PNM_LIB_DIR" = "-"
then
	pnm_install="n"
	pnm_inc_def=""
	pnm_lib_def=""
else
	pnm_install="y"
	pnm_inc_def=""
	pnm_lib_def=""
fi

if test "$pnm_install" = "y"
then
	PNM_INC_DIR=`$getDir "$PNM_INC_DIR" "$pnm_inc_def" 'pnm include directory' "$TMP_INSTALL" "stderr" 1`

	PNM_LIB_DIR=`$getDir "$PNM_LIB_DIR" "$pnm_lib_def" 'pnm library directory' "$TMP_INSTALL" "stderr" 1`
else
	PNM_INC_DIR="-"

	PNM_LIB_DIR="-"

	exceptionDirs="$exceptionDirs pnm"
fi

echo "PNM_INC_DIR=$PNM_INC_DIR; PNM_LIB_DIR=$PNM_LIB_DIR"
echo "pnm_install=$pnm_install; exceptionDirs='$exceptionDirs'"
echo "export PNM_INC_DIR PNM_LIB_DIR pnm_install exceptionDirs"
