Did the same thing I did to openapp...again, it Works Here(tm) for GNUstep
tools as well as non-GNUstep tools.
--
| Jeff Teunissen - Pres., Dusk To Dawn Computing - deek at dusknet.dhs.org
| Disclaimer: I am my employer, so anything I say goes for me too. :)
| Core developer, The QuakeForge Project http://www.quakeforge.net/
| Specializing in Debian GNU/Linux http://dusknet.dhs.org/~deek/
Index: make/opentool.in
===================================================================
RCS file: /gnustep/gnustep/core/make/opentool.in,v
retrieving revision 1.4
diff -u -r1.4 opentool.in
--- opentool.in 1999/12/03 04:33:31 1.4
+++ opentool.in 2000/08/10 18:52:56
@@ -24,7 +24,7 @@
# unmodified to the tool.
if [ -z "$1" ]; then
- echo usage: `basename $0` [--library-combo=...] tool [arguments...]
+ echo usage: `basename $0` tool [arguments...]
echo `basename $0` --help for help
exit 1
fi
@@ -33,52 +33,20 @@
EXEEXT=@EXEEXT@
fi
-# traps the parameters
case $1 in
--help)
- echo usage: `basename $0` [--library-combo=...] tool [arguments...]
+ echo usage: `basename $0` tool [arguments...]
echo
- echo [--library-combo=...] specifies a GNUstep backend to use.
- echo It overrides the default LIBRARY_COMBO environment variable.
- echo --library-combo=gnu-xdps for GNUstep XDPS Backend
- echo --library-combo=gnu-xraw for GNUstep XRaw Backend
- echo --library-combo=fd-xraw for GNUstep XRaw Backend with libFoundation
- echo --library-combo=fd-xdps for GNUstep XDPS Backend with libFoundation
- echo --library-combo=nx for NeXT OPENSTEP
- echo
echo tool is the complete or relative name of the tool executable
echo without any extension, like dread.
echo
echo [arguments...] are the arguments to the tool.
exit 0
;;
- --library-combo=*)
- LIBRARY_COMBO=`echo $1 | sed 's/--library-combo=//'`
- if [ -z "$2" ]; then
- echo usage: `basename $0` [--library-combo=...] tool [arguments...]
- echo `basename $0` --help for help
- exit 1
- fi
- tool=$2; shift; shift
- ;;
*)
tool=$1; shift;;
esac
-# TODO: these defaults need to be output to the user
-if [ "$LIBRARY_COMBO" = nx ]; then
- LIBRARY_COMBO=nx-nx-nx-nil
-elif [ "$LIBRARY_COMBO" = gnu-xdps ]; then
- LIBRARY_COMBO=gnu-gnu-gnu-xdps
-elif [ "$LIBRARY_COMBO" = gnu-xraw ]; then
- LIBRARY_COMBO=gnu-gnu-gnu-xraw
-elif [ "$LIBRARY_COMBO" = fd-xraw ]; then
- LIBRARY_COMBO=gnu-fd-gnu-xraw
-elif [ "$LIBRARY_COMBO" = fd-xdps ]; then
- LIBRARY_COMBO=gnu-fd-gnu-xdps
-fi
-export LIBRARY_COMBO
-
# Remove leading slashes at the end of the tool name
tool=`echo $tool | sed 's%/*$%%'`
@@ -86,71 +54,26 @@
tool=$tool$EXEEXT
fi
-#
-# Determine the host information
-#
-if [ -z "$GNUSTEP_HOST" ]; then
- GNUSTEP_HOST=`(cd /tmp; $GNUSTEP_SYSTEM_ROOT/Makefiles/config.guess)`
- GNUSTEP_HOST=`(cd /tmp; $GNUSTEP_SYSTEM_ROOT/Makefiles/config.sub $GNUSTEP_HOST)`
- export GNUSTEP_HOST
-fi
-if [ -z "$GNUSTEP_HOST_CPU" ]; then
- GNUSTEP_HOST_CPU=`$GNUSTEP_SYSTEM_ROOT/Makefiles/cpu.sh $GNUSTEP_HOST`
- GNUSTEP_HOST_CPU=`$GNUSTEP_SYSTEM_ROOT/Makefiles/clean_cpu.sh $GNUSTEP_HOST_CPU`
- export GNUSTEP_HOST_CPU
-fi
-if [ -z "$GNUSTEP_HOST_VENDOR" ]; then
- GNUSTEP_HOST_VENDOR=`$GNUSTEP_SYSTEM_ROOT/Makefiles/vendor.sh $GNUSTEP_HOST`
- GNUSTEP_HOST_VENDOR=`$GNUSTEP_SYSTEM_ROOT/Makefiles/clean_vendor.sh
$GNUSTEP_HOST_VENDOR`
- export GNUSTEP_HOST_VENDOR
-fi
-if [ -z "$GNUSTEP_HOST_OS" ]; then
- GNUSTEP_HOST_OS=`$GNUSTEP_SYSTEM_ROOT/Makefiles/os.sh $GNUSTEP_HOST`
- GNUSTEP_HOST_OS=`$GNUSTEP_SYSTEM_ROOT/Makefiles/clean_os.sh $GNUSTEP_HOST_OS`
- export GNUSTEP_HOST_OS
-fi
-
-if [ "$LIBRARY_COMBO" = nx-nx-nx-nil -a $GNUSTEP_HOST_OS = nextstep4 ]; then
- if [ -f "$full_toolname/library_paths.openapp" ]; then
- additional_library_paths="`cat $full_toolname/library_paths.openapp`"
- fi
-else
- if [ -f
"$full_toolname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp"
]; then
- additional_library_paths="`cat
$full_toolname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp`"
- fi
-fi
-
case $tool in
/*) # An absolute path.
- full_toolname=$tool;;
+ full_toolname=$tool;;
*/*) # A relative path
full_toolname=`(cd $tool; pwd)`;;
*) # A path that should be searched into GNUstep tool paths
- GNUSTEP_HOST_DIR=$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS
-
- # search for a local one
- for file in */$GNUSTEP_HOST_DIR/$LIBRARY_COMBO/$tool; do
- if [ -x $file ]; then
- full_toolname=$file;
- break;
- fi
- done
-
- # search in the user/local/system
- SPATH=$SPATH:$GNUSTEP_USER_ROOT/Tools/$GNUSTEP_HOST_DIR
- SPATH=$SPATH:$GNUSTEP_USER_ROOT/Tools/$GNUSTEP_HOST_DIR/$LIBRARY_COMBO
- SPATH=$SPATH:$GNUSTEP_LOCAL_ROOT/Tools/$GNUSTEP_HOST_DIR
- SPATH=$SPATH:$GNUSTEP_LOCAL_ROOT/Tools/$GNUSTEP_HOST_DIR/$LIBRARY_COMBO
- SPATH=$SPATH:$GNUSTEP_SYSTEM_ROOT/Tools/$GNUSTEP_HOST_DIR
- SPATH=$SPATH:$GNUSTEP_SYSTEM_ROOT/Tools/$GNUSTEP_HOST_DIR/$LIBRARY_COMBO
- SPATH=$SPATH:$PATH
- IFS=:
- for dir in $SPATH; do
- if [ -x $dir/$tool ]; then
- full_toolname=$dir/$tool;
- break;
- fi
- done;;
+ if [ -n $GNUSTEP_PATHPREFIX_LIST ]; then
+ SPATH=$GNUSTEP_PATHPREFIX_LIST
+ else
+ SPATH=$PATH
+ fi
+ SPATH=.:$SPATH
+ IFS=:
+ for dir in $SPATH; do
+ if [ -x $dir/Tools/$tool ]; then
+ full_toolname=$dir/Tools/$tool
+ break;
+ fi
+ done
+ ;;
esac
if [ -z "$full_toolname" ]; then
@@ -158,9 +81,5 @@
exit 1
fi
-# Load up LD_LIBRARY_PATH
-# this needs to be PATH on NT
-. $GNUSTEP_SYSTEM_ROOT/Makefiles/ld_lib_path.sh
-
IFS=" "
-$full_toolname $@
+exec $full_toolname $@