
dir=${dir:-../..}

# Get the canonical directory name
case "$dir" in 
	/*)   
		;; 
	*)	
		dir=`cd "$dir" && pwd || echo "$dir"`
		;;
esac
# echo "Directory under test is $dir"

get=${get:-${dir}/get}
admin=${admin:-${dir}/admin}
cdc=${cdc:-${dir}/cdc}
prs=${prs:-${dir}/prs}
prt=${prt:-${dir}/prt}
delta=${delta:-${dir}/delta}
sact=${sact:-${dir}/sact}
sccsdiff=${sccsdiff:-${dir}/sccsdiff}
unget=${unget:-${dir}/unget}
what=${what:-${dir}/what}
val=${val:-${dir}/val}
rmdel=${rmdel:-${dir}/rmdel}


DIFF=${DIFF:-diff}

for f in ${get} ${admin} ${csc} ${prs} ${prt} \
	${delta} ${sact} ${sccsdiff} ${unget} ${what} ${rmdel}
do
	case $f in 
		/*)
			test -x "$f" || echo "WARNING: cannot execute $f" >&2
			;;
		*)
			;;
	esac
done

# Find the sccs driver program.   Note that we use ${sccs} here;
# ${sccs} was set, above.

# We need to run the candidate 
# to find out if it accepts the --prefix option.

if test x"${sccs}" = x
then
    if test -f "${dir}/sccs"
    then
	sccsprog="${dir}/sccs"
    elif test -f "${dir}/bsd/sccs"
    then
	sccsprog="${dir}/bsd/sccs"
    else
	case "${dir}" in 
	    /*)    sccsprog="${dir}/bsd/sccs"
		    ;;
	    ../..) sccsprog="${dir}/bsd/sccs"
		    ;;
	    *) sccsprog="sccs"
		    ;;
	esac
    fi

    # Find out if it takes the --prefix option.  If so,
    # use it.
    if ${sccsprog} --cssc >/dev/null 2>&1
    then
	sccsargs="--prefix=${dir}/"
    else
	sccsargs=""
    fi

    sccs="${sccsprog} ${sccsargs}"
fi
