2000-06-13 15:14:23 +00:00
|
|
|
#!/bin/sh
|
1997-10-13 23:30:17 +00:00
|
|
|
#
|
2002-05-02 15:07:49 +00:00
|
|
|
# @configure_input@
|
|
|
|
#
|
1997-10-13 23:30:17 +00:00
|
|
|
# Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Ovidiu Predescu <ovidiu@net-community.com>
|
|
|
|
# Date: October 1997
|
|
|
|
#
|
|
|
|
# This file is part of the GNUstep Makefile Package.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public
|
|
|
|
# License along with this library; see the file COPYING.LIB.
|
|
|
|
# If not, write to the Free Software Foundation,
|
|
|
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
# Try to execute the application passed as argument. The application is
|
|
|
|
# searched through the GNUstep directories if a complete or relative path name
|
1997-10-14 18:46:16 +00:00
|
|
|
# is not specified. The arguments passed after the application name are passed
|
|
|
|
# unmodified to the application.
|
1997-10-13 23:30:17 +00:00
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
2001-04-13 19:49:16 +00:00
|
|
|
echo usage: `basename $0` application [--library-combo=...] [arguments...]
|
1999-02-18 06:22:33 +00:00
|
|
|
echo `basename $0` --help for help
|
1997-10-13 23:30:17 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2000-12-06 06:48:04 +00:00
|
|
|
if [ -z "$GNUSTEP_FLATTENED" ]; then
|
|
|
|
GNUSTEP_FLATTENED=@GNUSTEP_FLATTENED@
|
|
|
|
fi
|
1997-10-13 23:30:17 +00:00
|
|
|
|
1999-02-18 06:22:33 +00:00
|
|
|
# trap the --library-combo parameter
|
1997-10-14 18:46:16 +00:00
|
|
|
case $1 in
|
1999-02-18 06:22:33 +00:00
|
|
|
--help)
|
2001-04-13 19:49:16 +00:00
|
|
|
echo usage: `basename $0` application [--library-combo=...] [arguments...]
|
1999-02-18 06:22:33 +00:00
|
|
|
echo
|
|
|
|
echo application is the complete or relative name of the application
|
2001-04-13 19:49:16 +00:00
|
|
|
echo program with the .app extension, like Ink.app.
|
1999-02-18 06:22:33 +00:00
|
|
|
echo
|
2001-04-13 19:49:16 +00:00
|
|
|
echo [arguments...] are the arguments to the application.
|
1999-02-18 06:22:33 +00:00
|
|
|
exit 0
|
|
|
|
;;
|
1997-10-14 18:46:16 +00:00
|
|
|
*)
|
|
|
|
app=$1; shift;;
|
|
|
|
esac
|
1997-10-13 23:30:17 +00:00
|
|
|
|
1997-10-15 22:45:58 +00:00
|
|
|
# Remove leading slashes at the end of the application name
|
|
|
|
app=`echo $app | sed 's%/*$%%'`
|
|
|
|
|
1997-10-13 23:30:17 +00:00
|
|
|
case $app in
|
|
|
|
/*) # An absolute path.
|
|
|
|
full_appname=$app;;
|
|
|
|
*/*) # A relative path
|
|
|
|
full_appname=`(cd $app; pwd)`;;
|
|
|
|
*) # A path that should be searched into the GNUstep paths
|
2002-06-19 03:46:08 +00:00
|
|
|
if [ -n $GNUSTEP_PATHLIST ]; then
|
|
|
|
SPATH=$GNUSTEP_PATHLIST
|
1999-06-02 03:16:12 +00:00
|
|
|
else
|
|
|
|
SPATH=$PATH
|
|
|
|
fi
|
|
|
|
SPATH=.:$SPATH
|
1997-10-13 23:30:17 +00:00
|
|
|
IFS=:
|
|
|
|
for dir in $SPATH; do
|
2002-02-28 11:08:53 +00:00
|
|
|
if [ -d $dir/Applications/$app ]; then
|
|
|
|
full_appname=`(cd $dir/Applications/$app; pwd)`
|
1997-10-13 23:30:17 +00:00
|
|
|
break;
|
|
|
|
fi
|
1999-06-11 21:10:35 +00:00
|
|
|
if [ -d $dir/$app ]; then
|
|
|
|
full_appname=`(cd $dir/$app; pwd)`
|
|
|
|
break;
|
|
|
|
fi
|
1997-10-13 23:30:17 +00:00
|
|
|
done;;
|
|
|
|
esac
|
|
|
|
|
1997-10-14 22:54:35 +00:00
|
|
|
if [ -z "$full_appname" ]; then
|
|
|
|
echo "Can't find the required application: $app!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
1999-02-18 06:22:33 +00:00
|
|
|
# get base app name
|
1997-10-13 23:30:17 +00:00
|
|
|
appname=`echo $app | sed 's/\.[a-z]*$//'`
|
1998-12-14 11:20:31 +00:00
|
|
|
appname=`basename $appname`
|
1999-02-18 06:22:33 +00:00
|
|
|
|
2002-03-26 17:36:31 +00:00
|
|
|
if [ -n "$GNUSTEP_FLATTENED" ]; then
|
|
|
|
|
|
|
|
if [ -z "$EXEEXT" ]; then
|
|
|
|
EXEEXT=@EXEEXT@
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$EXEEXT" ]; then
|
|
|
|
appname="$appname$EXEEXT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -f "$full_appname/$appname" ]; then
|
|
|
|
echo "Could not find $full_appname/$appname executable/script"
|
2001-04-13 19:49:16 +00:00
|
|
|
exit 1
|
1997-10-13 23:30:17 +00:00
|
|
|
fi
|
2000-12-06 06:48:04 +00:00
|
|
|
|
2001-04-13 19:49:16 +00:00
|
|
|
IFS=" "
|
2002-03-26 17:36:31 +00:00
|
|
|
exec "$full_appname/$appname" "$@"
|
2001-05-08 22:14:15 +00:00
|
|
|
|