mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-22 13:50:47 +00:00
* rootinstall.sh: New file. * rootuninstall.sh: New file. * openapp.in: Add help text. * debugapp.in: Add help text. * configure.in: Add opentool.in. * configure: Regenerate. * GNUmakefile.in: Install/uninstall new files. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@3750 72102866-910b-0410-8b05-ffd578937521
177 lines
5.7 KiB
Bash
Executable file
177 lines
5.7 KiB
Bash
Executable file
#! /bin/sh
|
|
#
|
|
# 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
|
|
# is not specified. The arguments passed after the application name are passed
|
|
# unmodified to the application.
|
|
|
|
if [ -z "$1" ]; then
|
|
echo usage: `basename $0` [--library-combo=...] application [arguments...]
|
|
echo `basename $0` --help for help
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$EXEEXT" ]; then
|
|
EXEEXT=@EXEEXT@
|
|
fi
|
|
if [ -z "$LIBRARY_COMBO" ]; then
|
|
LIBRARY_COMBO=@ac_cv_library_combo@
|
|
fi
|
|
|
|
# trap the --library-combo parameter
|
|
case $1 in
|
|
--help)
|
|
echo usage: `basename $0` [--library-combo=...] application [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 application is the complete or relative name of the application
|
|
echo program with the .app extension, like Edit.app.
|
|
echo
|
|
echo [arguments...] are the arguments to the application.
|
|
exit 0
|
|
;;
|
|
--library-combo=*)
|
|
LIBRARY_COMBO=`echo $1 | sed 's/--library-combo=//'`
|
|
if [ -z "$2" ]; then
|
|
echo usage: `basename $0` [--library-combo=...] application [arguments...]
|
|
echo `basename $0` --help for help
|
|
exit 1
|
|
fi
|
|
app=$2; shift; shift
|
|
;;
|
|
*)
|
|
app=$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 application name
|
|
app=`echo $app | sed 's%/*$%%'`
|
|
|
|
if [ -z "$EXEEXT" ]; then
|
|
app=$app$EXEEXT
|
|
fi
|
|
|
|
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
|
|
SPATH=.:$GNUSTEP_USER_ROOT/Apps:$GNUSTEP_LOCAL_ROOT/Apps:$GNUSTEP_SYSTEM_ROOT/Apps:$PATH
|
|
IFS=:
|
|
for dir in $SPATH; do
|
|
if [ -d $dir/$app ]; then
|
|
full_appname=`(cd $dir/$app; pwd)`
|
|
break;
|
|
fi
|
|
done;;
|
|
esac
|
|
|
|
if [ -z "$full_appname" ]; then
|
|
echo "Can't find the required application: $app!"
|
|
exit 1
|
|
fi
|
|
|
|
#
|
|
# Determine the host information
|
|
#
|
|
if [ -z "$GNUSTEP_HOST" ]; then
|
|
GNUSTEP_HOST=`$GNUSTEP_SYSTEM_ROOT/Makefiles/config.guess`
|
|
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_appname/library_paths.openapp" ]; then
|
|
additional_library_paths="`cat $full_appname/library_paths.openapp`"
|
|
fi
|
|
else
|
|
if [ -f "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp" ]; then
|
|
additional_library_paths="`cat $full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp`"
|
|
fi
|
|
fi
|
|
|
|
# get base app name
|
|
appname=`echo $app | sed 's/\.[a-z]*$//'`
|
|
appname=`basename $appname`
|
|
|
|
# Load up LD_LIBRARY_PATH
|
|
# this needs to be PATH on NT
|
|
. $GNUSTEP_SYSTEM_ROOT/Makefiles/ld_lib_path.sh
|
|
|
|
if [ "$LIBRARY_COMBO" = nx-nx-nx-nil -a $GNUSTEP_HOST_OS = nextstep4 ]; then
|
|
if [ ! -f $full_appname/$appname ]; then
|
|
echo "$full_appname application does not have a binary for this kind of machine and operating system."
|
|
exit 1
|
|
fi
|
|
|
|
IFS=" "
|
|
$full_appname/$appname $@
|
|
|
|
else
|
|
# Determine if the application has a binary for this operating system
|
|
if [ ! -d $full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS ]; then
|
|
echo "$full_appname application does not have a binary for this kind of machine and operating system."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d $full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO ]; then
|
|
echo "$full_appname application does not have a binary for this combination of libraries: $LIBRARY_COMBO."
|
|
exit 1
|
|
fi
|
|
|
|
IFS=" "
|
|
$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/$appname $@
|
|
|
|
fi
|