update dev300-m57
[ooovba.git] / odk / setsdkenv_unix
blob31e0200eb1b7a71223baa614ff8c2fda26ef0076
1 #! /bin/sh
3 OSTYPE=`uname -s`
4 HOSTNAME=`hostname`
5 CURRENTDIR=`/bin/pwd`
6 SDKTMPDIR=`dirname $0`
7 OO_SDK_HOME=`(cd $SDKTMPDIR && pwd && cd $CURRENTDIR) | head -n 1`
8 OOVERSION=`cat $OO_SDK_HOME/settings/dk.mk | tail -2 | head -n 1 | cut -d"=" -f2 | cut -d"." -f1,2`
9 if [ "$OSTYPE" = "Darwin" ]
10 then
11 OO_SDK_NAME=`basename $OO_SDK_HOME`
12 else
13 OO_SDK_NAME=openoffice.org${OOVERSION}_sdk
16 export OO_SDK_HOME
18 if [ "$1" = "--force-configure" ]
19 then
20 if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh ]
21 then
22 rm $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
23 fi
24 if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.csh ]
25 then
26 rm $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.csh
28 shift
29 elif [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ -n "$1" ]
30 then
31 echo
32 echo " using: setsdkenv_unix [options]"
33 echo ""
34 echo " options:"
35 echo " --force-configure : force a new configuration of your SDK environment."
36 echo " Alternatively can you edit your SDK environment scripts directly:"
37 echo " $HOME/$OO_SDK_NAME/setsdkenv_unix.sh"
38 echo " $HOME/$OO_SDK_NAME/setsdkenv_unix.csh"
39 echo " -h, --help : print this help and exit"
40 echo
41 exit 1
44 # source the prepared environment and start a new shell
45 if [ -r $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh ]
46 then
47 . $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
48 else
49 echo
50 echo " ************************************************************************"
51 echo " *"
52 echo " * You have to configure your SDK environment first before you can"
53 echo " * can use it! The configuration has to be done only once."
54 echo " *"
55 echo " ************************************************************************"
56 echo
58 perl $OO_SDK_HOME/configure.pl $HOSTNAME $OO_SDK_HOME $OO_SDK_NAME
60 . $HOME/$OO_SDK_NAME/$HOSTNAME/setsdkenv_unix.sh
63 "$SHELL" "$@"
64 echo Shell terminated.
66 TERMHEAD=$HOSTNAME
67 echo "\e]2;$TERMHEAD\a"