-
-# define_program_variable ($VAR, $WHATDIR, $SUBDIR, $PROGRAM, $OVERRIDE)
-# ----------------------------------------------------------------------
-# Define a variable that represents a program to run. If in Cygnus
-# mode, the program is searched for in the build (or source) tree.
-# Otherwise no searching is done at all. Arguments are:
-# * VAR Name of variable to define
-# * WHATDIR Either `src' or `build', depending on where program should
-# be found. (runtest is in srcdir!)
-# * SUBDIR Subdir of top-level dir
-# * PROGRAM Name of program
-# * OVERRIDE If specified, the name of the program to use when not in
-# Cygnus mode. Defaults to PROGRAM.
-sub define_program_variable
-{
- my ($var, $whatdir, $subdir, $program, $override) = @_;
-
- if (! $override)
- {
- $override = $program;
- }
-
- if ($cygnus_mode)
- {
- my $full = ('$(top_' . $whatdir . 'dir)/../'
- . $subdir . '/' . $program);
- &define_variable ($var, ('`if test -f ' . $full
- . '; then echo ' . $full . '; else echo '
- . $program . '; fi`'));
- }
- else
- {
- &define_variable ($var, $override);
- }
-}
-
-