?RCS: $Id: scriptdir.U,v 3.1 1999/07/09 18:20:13 doughera Exp doughera $
?RCS:
?RCS: Copyright (c) 1991-1993, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 3.0.
?RCS:
?RCS: $Log: scriptdir.U,v $
?RCS: Revision 3.1  1999/07/09 18:20:13  doughera
?RCS: Updated for installprefix
?RCS:
?RCS: Revision 3.0.1.3  1995/09/25  09:17:15  ram
?RCS: patch59: unit is now forced to the top of Configure, if possible
?RCS:
?RCS: Revision 3.0.1.2  1995/01/30  14:46:13  ram
?RCS: patch49: can now handle installation prefix changes (from WED)
?RCS:
?RCS: Revision 3.0.1.1  1994/08/29  16:32:04  ram
?RCS: patch32: now uses installation prefix
?RCS:
?RCS: Revision 3.0  1993/08/18  12:09:45  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:scriptdir scriptdirexp installscript: cat test Getfile Loc \
	Oldconfig +bin Prefixit Setprefixvar prefixexp Prefixup
?MAKE:	-pick add $@ %<
?Y:TOP
?D:scriptdir=''
?S:scriptdir:
?S:	This variable holds the name of the directory in which the user wants
?S:	to put publicly scripts for the package in question.  It is either
?S:	the same directory as for binaries, or a special one that can be
?S:	mounted across different architectures, like /usr/share. Programs
?S:	must be prepared to deal with ~name expansion.
?S:.
?D:scriptdirexp=''
?S:scriptdirexp:
?S:	This variable is the same as scriptdir, but is filename expanded
?S:	at configuration time, for programs not wanting to bother with it.
?S:.
?S:installscript:
?S:	This variable is usually the same as scriptdirexp, unless you are on
?S:	a system running AFS, in which case they may differ slightly. You
?S:	should always use this variable within your makefiles for portability.
?S:.
?C:SCRIPTDIR:
?C:	This symbol holds the name of the directory in which the user wants
?C:	to put publicly executable scripts for the package in question.  It
?C:	is often a directory that is mounted across diverse architectures.
?C:	Programs must be prepared to deal with ~name expansion.
?C:.
?C:SCRIPTDIR_EXP:
?C:	This is the same as SCRIPTDIR, but is filename expanded at
?C:	configuration time, for use in programs not prepared to do
?C:	~name substitutions at run-time.
?C:.
?H:#define SCRIPTDIR "$scriptdir"	/**/
?H:#define SCRIPTDIR_EXP "$scriptdirexp"	/**/
?H:.
?T:installscriptdir
?LINT:change prefixvar
?LINT:set scriptdir
?LINT:set scriptdirexp
: determine where public executable scripts go
set scriptdir scriptdir
eval $prefixit
case "$scriptdir" in
'')
	dflt="$bin"
	: guess some guesses
	$test -d /usr/share/scripts && dflt=/usr/share/scripts
	$test -d /usr/share/bin     && dflt=/usr/share/bin
	$test -d /usr/local/script  && dflt=/usr/local/script
	$test -d /usr/local/scripts && dflt=/usr/local/scripts
	$test -d $prefixexp/script  && dflt=$prefixexp/script
	set dflt
	eval $prefixup
	;;
*)  dflt="$scriptdir"
	;;
esac
$cat <<EOM

Some installations have a separate directory just for executable scripts so
that they can mount it across multiple architectures but keep the scripts in
one spot.  You might, for example, have a subdirectory of /usr/share for this.
Or you might just lump your scripts in with all your other executables.

EOM
fn=d~
rp='Where do you keep publicly executable scripts?'
. ./getfile
if $test "X$ansexp" != "X$scriptdirexp"; then
	installscript=''
fi
installscriptdir=''
prefixvar=scriptdir
. ./setprefixvar
: A little fix up for an irregularly named variable.
installscript="$installscriptdir"

