2005-01-31 08:54:34 -06:00
|
|
|
|
#! /bin/sh
|
|
|
|
|
|
2008-07-11 08:13:51 -05:00
|
|
|
|
OSTYPE=`uname -s`
|
|
|
|
|
HOSTNAME=`hostname`
|
2005-11-09 02:28:58 -06:00
|
|
|
|
CURRENTDIR=`/bin/pwd`
|
2006-07-13 06:02:41 -05:00
|
|
|
|
SDKTMPDIR=`dirname $0`
|
2008-07-11 08:13:51 -05:00
|
|
|
|
OO_SDK_HOME=`(cd $SDKTMPDIR && pwd && cd $CURRENTDIR) | head -n 1`
|
2009-08-06 02:01:05 -05:00
|
|
|
|
OOVERSION=`cat $OO_SDK_HOME/settings/dk.mk | tail -2 | head -n 1 | cut -d"=" -f2 | cut -d"." -f1,2`
|
2008-07-11 08:13:51 -05:00
|
|
|
|
if [ "$OSTYPE" = "Darwin" ]
|
|
|
|
|
then
|
|
|
|
|
OO_SDK_NAME=`basename $OO_SDK_HOME`
|
|
|
|
|
else
|
2010-11-05 09:11:47 -05:00
|
|
|
|
OO_SDK_NAME=libreoffice${OOVERSION}_sdk
|
2008-07-11 08:13:51 -05:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
export OO_SDK_HOME
|
2005-11-09 02:28:58 -06:00
|
|
|
|
|
|
|
|
|
if [ "$1" = "--force-configure" ]
|
|
|
|
|
then
|
2008-07-11 08:13:51 -05:00
|
|
|
|
if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh ]
|
2005-11-09 02:28:58 -06:00
|
|
|
|
then
|
2008-07-11 08:13:51 -05:00
|
|
|
|
rm $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
|
2005-11-09 02:28:58 -06:00
|
|
|
|
fi
|
2008-07-11 08:13:51 -05:00
|
|
|
|
if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.csh ]
|
2005-11-09 02:28:58 -06:00
|
|
|
|
then
|
2008-07-11 08:13:51 -05:00
|
|
|
|
rm $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.csh
|
2005-12-28 11:05:23 -06:00
|
|
|
|
fi
|
|
|
|
|
shift
|
2005-11-09 02:28:58 -06:00
|
|
|
|
elif [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ -n "$1" ]
|
|
|
|
|
then
|
|
|
|
|
echo
|
|
|
|
|
echo " using: setsdkenv_unix [options]"
|
|
|
|
|
echo ""
|
|
|
|
|
echo " options:"
|
|
|
|
|
echo " --force-configure : force a new configuration of your SDK environment."
|
|
|
|
|
echo " Alternatively can you edit your SDK environment scripts directly:"
|
|
|
|
|
echo " $HOME/$OO_SDK_NAME/setsdkenv_unix.sh"
|
|
|
|
|
echo " $HOME/$OO_SDK_NAME/setsdkenv_unix.csh"
|
|
|
|
|
echo " -h, --help : print this help and exit"
|
|
|
|
|
echo
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2005-01-31 08:54:34 -06:00
|
|
|
|
|
|
|
|
|
# source the prepared environment and start a new shell
|
2008-07-11 08:13:51 -05:00
|
|
|
|
if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh ]
|
2005-01-31 08:54:34 -06:00
|
|
|
|
then
|
2008-07-11 08:13:51 -05:00
|
|
|
|
. $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
|
2005-01-31 08:54:34 -06:00
|
|
|
|
else
|
|
|
|
|
echo
|
2005-11-09 02:28:58 -06:00
|
|
|
|
echo " ************************************************************************"
|
2005-01-31 08:54:34 -06:00
|
|
|
|
echo " *"
|
2005-11-09 02:28:58 -06:00
|
|
|
|
echo " * You have to configure your SDK environment first before you can"
|
|
|
|
|
echo " * can use it! The configuration has to be done only once."
|
2005-01-31 08:54:34 -06:00
|
|
|
|
echo " *"
|
2005-11-09 02:28:58 -06:00
|
|
|
|
echo " ************************************************************************"
|
2005-01-31 08:54:34 -06:00
|
|
|
|
echo
|
2009-08-06 02:01:05 -05:00
|
|
|
|
|
2008-07-11 08:13:51 -05:00
|
|
|
|
perl $OO_SDK_HOME/configure.pl $HOSTNAME $OO_SDK_HOME $OO_SDK_NAME
|
2005-11-09 02:28:58 -06:00
|
|
|
|
|
2008-07-11 08:13:51 -05:00
|
|
|
|
. $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
|
2005-01-31 08:54:34 -06:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
"$SHELL" "$@"
|
|
|
|
|
echo Shell terminated.
|
|
|
|
|
|
2008-07-11 08:13:51 -05:00
|
|
|
|
TERMHEAD=$HOSTNAME
|
2005-01-31 08:54:34 -06:00
|
|
|
|
echo "]2;$TERMHEAD"
|