105 lines
2.3 KiB
Bash
105 lines
2.3 KiB
Bash
#! /bin/sh
|
|
|
|
# This script starts a new shell and sets all enviroment variables, which
|
|
# are necessary for building the examples of the Office Development Kit.
|
|
# The Script was developed for the operating systems Solaris and Linux.
|
|
# Before the script could be executed the following variables have to be
|
|
# adjusted:
|
|
|
|
# Installation directory of the Software Development Kit.
|
|
# Example: SDK_HOME=/work/odk641
|
|
SDK_HOME=
|
|
|
|
# Office installation directory.
|
|
# Example: OFFICE_HOME=/opt/staroffice6.0
|
|
OFFICE_HOME=
|
|
|
|
# Directory of the make command.
|
|
# Example: SDK_MAKE=/usr/bin
|
|
SDK_MAKE=
|
|
|
|
# Directory of the C++ tools.
|
|
# Example: SDK_CPP_HOME=/usr/bin
|
|
SDK_CPP_HOME=
|
|
|
|
# Java installation directory.
|
|
# Example: SDK_JAVA_HOME=/usr/local/j2sdk1.4.0
|
|
SDK_JAVA_HOME=
|
|
|
|
# ANT installation directory.
|
|
# Example: SDK_ANT=/windows/daten/moving/jakarta-ant-1.4
|
|
# SDK_ANT=
|
|
|
|
|
|
# Check installation path for the StarOffice Development Kit.
|
|
if [ -z "$SDK_HOME" ]
|
|
then
|
|
echo Error: Please insert a correct value for the variable SDK_HOME.
|
|
exit 0
|
|
fi
|
|
|
|
# Check installation path for the office.
|
|
if [ -z "$OFFICE_HOME" ]
|
|
then
|
|
echo Error: Please insert a correct value for the variable OFFICE_HOME.
|
|
exit 0
|
|
fi
|
|
|
|
# Get the operating system.
|
|
sd_platform=`uname -s`
|
|
|
|
# Set the directory name.
|
|
case $sd_platform in
|
|
SunOS)
|
|
directoryname=solsparc
|
|
;;
|
|
|
|
Linux)
|
|
directoryname=linux
|
|
;;
|
|
esac
|
|
|
|
# Set library path.
|
|
LD_LIBRARY_PATH=$SDK_HOME/$directoryname/lib:$OFFICE_HOME/program:$LD_LIBRARY_PATH
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
# Set office program path.
|
|
OFFICE_PROGRAM_PATH=$OFFICE_HOME/program
|
|
|
|
export OFFICE_PROGRAM_PATH
|
|
|
|
|
|
# Add directory of the SDK tools to the path.
|
|
PATH=$SDK_HOME/$directoryname/bin:$OFFICE_PROGRAM_PATH:$PATH
|
|
|
|
# Add directory of the command make to the path, if necessary.
|
|
if [ -n "$SDK_MAKE" ]
|
|
then
|
|
PATH=$SDK_MAKE:$PATH
|
|
fi
|
|
|
|
# Add directory of the C++ tools to the path, if necessary.
|
|
if [ -n "$SDK_CPP_HOME" ]
|
|
then
|
|
PATH=$SDK_CPP_HOME:$PATH
|
|
fi
|
|
|
|
# Add directory of the Java tools to the path, if necessary.
|
|
if [ -n "$SDK_JAVA_HOME" ]
|
|
then
|
|
PATH=$SDK_JAVA_HOME/bin:$PATH
|
|
fi
|
|
|
|
# Add directory of the ANT tools to the path, if necessary.
|
|
if [ -n "$SDK_ANT" ]
|
|
then
|
|
PATH=$SDK_ANT/bin:PATH
|
|
fi
|
|
|
|
export PATH
|
|
|
|
# Starting a new shell with all necessary environment variables.
|
|
echo starting shell
|
|
"$SHELL" "$@"
|
|
echo shell terminated
|