diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-11 13:14:23 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-11 13:14:23 +0000 |
commit | 91b64b26d34eb2611aec80311ca9884afb638dab (patch) | |
tree | 47192429ab504699327c4fec9c751ee30987d624 /odk/setsdkenv_unix.sh.in | |
parent | INTEGRATION: CWS jsc21 (1.10.132); FILE MERGED (diff) | |
download | core-91b64b26d34eb2611aec80311ca9884afb638dab.tar.gz core-91b64b26d34eb2611aec80311ca9884afb638dab.zip |
INTEGRATION: CWS jsc21 (1.10.2); FILE MERGED
2008/05/23 11:38:04 jsc 1.10.2.3: #i88797# adapted for mac
2008/05/22 07:07:55 jsc 1.10.2.2: #i88797# adapted to new structure
2008/04/30 11:34:24 jsc 1.10.2.1: #86121# update for 3 layer office
Diffstat (limited to 'odk/setsdkenv_unix.sh.in')
-rw-r--r-- | odk/setsdkenv_unix.sh.in | 139 |
1 files changed, 71 insertions, 68 deletions
diff --git a/odk/setsdkenv_unix.sh.in b/odk/setsdkenv_unix.sh.in index b3c00221cdf7..44fb741eca1b 100644 --- a/odk/setsdkenv_unix.sh.in +++ b/odk/setsdkenv_unix.sh.in @@ -2,30 +2,20 @@ # 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. -sdkscript=`echo $0 | grep setsdkenv_unix | true` -if [ "$sdkscript" = "" ] -then -sdkscript=`history 1 | sed "s/.*\. //"` -fi -if [ "$sdkscript" = "" ] -then -# total falback; needed when history does not work -sdkscript=@OO_SDK_HOME@/setsdkenv_unix -fi -sdkdir=`dirname $sdkscript` +# The Script was developed for the operating systems Solaris, Linux and MacOS. # The SDK name OO_SDK_NAME=@OO_SDK_NAME@ export OO_SDK_NAME # Installation directory of the Software Development Kit. -# Example: OO_SDK_HOME=/work/StarOffice_SDK +# Example: OO_SDK_HOME=/opt/openoffice.org/basis3.0/sdk OO_SDK_HOME=@OO_SDK_HOME@ # Office installation directory. -# Example: OFFICE_HOME=/opt/staroffice +# Example: OFFICE_HOME=/opt/openoffice.org3 OFFICE_HOME=@OFFICE_HOME@ +OFFICE_BASE_HOME=@OFFICE_BASE_HOME@ # URE installation directory. # Example: OO_SDK_URE_HOME=/opt/openoffice.org/ure @@ -48,7 +38,7 @@ OO_SDK_CPP_HOME=@OO_SDK_CPP_HOME@ OO_SDK_CC_55_OR_HIGHER=@OO_SDK_CC_55_OR_HIGHER@ # Directory of the Java SDK. -# Example: OO_SDK_JAVA_HOME=/usr/local/j2sdk1.4.1_01 +# Example: OO_SDK_JAVA_HOME=/usr/jdk/jdk1.6.0_10 OO_SDK_JAVA_HOME=@OO_SDK_JAVA_HOME@ # Special output directory @@ -60,8 +50,8 @@ OO_SDK_OUTPUT_DIR=@OO_SDK_OUTPUT_DIR@ SDK_AUTO_DEPLOYMENT=@SDK_AUTO_DEPLOYMENT@ export SDK_AUTO_DEPLOYMENT -# Check installation path for the StarOffice Development Kit. -if [ -z "$OO_SDK_HOME" ] +# Check installation path for the OpenOffice Development Kit. +if [ -z "${OO_SDK_HOME}" ] then echo Error: Please insert a correct value for the variable OO_SDK_HOME. exit 0 @@ -77,13 +67,34 @@ then exit 0 fi +# Get the operating system. +sdk_platform=`${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4` + +# Set the directory name. +programdir=program +javadir=bin +case ${sdk_platform} in + darwin*) + programdir="Contents/MacOS" + javacdir=Commands + ;; +esac + # Set office program path (only set when using an Office). if [ "${OFFICE_HOME}" ] then - OFFICE_PROGRAM_PATH=${OFFICE_HOME}/program + OFFICE_PROGRAM_PATH=${OFFICE_HOME}/${programdir} export OFFICE_PROGRAM_PATH fi +# Set office program path (only set when using an Office). +if [ "${OFFICE_BASE_HOME}" ] +then + OFFICE_BASE_PROGRAM_PATH=${OFFICE_BASE_HOME}/program + export OFFICE_BASE_PROGRAM_PATH +fi + + # Set UNO path, necessary to ensure that the cpp examples using the # new UNO bootstrap mechanism use the configured office installation (only set # when using an Office). @@ -100,29 +111,26 @@ then OO_SDK_URE_JAVA_DIR=${OO_SDK_URE_HOME}/share/java else OO_SDK_URE_BIN_DIR=${OFFICE_PROGRAM_PATH} - OO_SDK_URE_LIB_DIR=${OFFICE_PROGRAM_PATH} - OO_SDK_URE_JAVA_DIR=${OFFICE_PROGRAM_PATH}/classes + OO_SDK_URE_LIB_DIR=${OFFICE_BASE_PROGRAM_PATH} + OO_SDK_URE_JAVA_DIR=${OFFICE_BASE_PROGRAM_PATH}/classes fi export OO_SDK_URE_BIN_DIR export OO_SDK_URE_LIB_DIR export OO_SDK_URE_JAVA_DIR -OO_EXAMPLE_OUT=$OO_SDK_HOME +OO_SDK_OUT=$OO_SDK_HOME # Prepare appropriate output directory. -if [ -n "$OO_SDK_OUTPUT_DIR" ] +if [ -n "${OO_SDK_OUTPUT_DIR}" ] then - OO_EXAMPLE_OUT=$OO_SDK_OUTPUT_DIR/$OO_SDK_NAME - export OO_SDK_OUTPUT_DIR + OO_SDK_OUT=${OO_SDK_OUTPUT_DIR}/$OO_SDK_NAME + export OO_SDK_OUT fi -# Get the operating system. -sd_platform=`$sdkdir/config.guess | cut -d"-" -f3,4` - # Set the directory name. -case $sd_platform in +case ${sdk_platform} in solaris*) - sd_proctype=`$sdkdir/config.guess | cut -d"-" -f1` - if [ "$sd_proctype" = "sparc" ] + sdk_proctype=`${OO_SDK_HOME}/config.guess | cut -d"-" -f1` + if [ "${sdk_proctype}" = "sparc" ] then directoryname=solsparc platform='Solaris Sparc' @@ -135,14 +143,14 @@ case $sd_platform in soext=so exampleout=SOLARISexample.out stldebug=_debug - LD_LIBRARY_PATH=$OO_SDK_HOME/$directoryname/lib:$OO_EXAMPLE_OUT/$exampleout/lib:${OO_SDK_URE_LIB_DIR}:.:$LD_LIBRARY_PATH + LD_LIBRARY_PATH=${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH ;; darwin*) if [ -n "$OO_SDK_CPP_HOME" ] then - SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | $OO_SDK_CPP_HOME/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` + SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` export SDK_GXX_INCLUDE_PATH fi @@ -153,14 +161,14 @@ case $sd_platform in exampleout=MACOSXexample.out platform=MacOSX stldebug=_stldebug - DYLD_LIBRARY_PATH=$OO_SDK_HOME/$directoryname/lib:$OO_EXAMPLE_OUT/$exampleout/lib:${OO_SDK_URE_LIB_DIR}:.:$DYLD_LIBRARY_PATH + DYLD_LIBRARY_PATH=${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${DYLD_LIBRARY_PATH} export DYLD_LIBRARY_PATH ;; linux-gnu) if [ -n "$OO_SDK_CPP_HOME" ] then - SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | $OO_SDK_CPP_HOME/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` + SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` export SDK_GXX_INCLUDE_PATH fi @@ -171,14 +179,14 @@ case $sd_platform in exampleout=LINUXexample.out platform=Linux stldebug=_stldebug - LD_LIBRARY_PATH=$OO_SDK_HOME/$directoryname/lib:$OO_EXAMPLE_OUT/$exampleout/lib:${OO_SDK_URE_LIB_DIR}:.:$LD_LIBRARY_PATH + LD_LIBRARY_PATH=${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH ;; freebsd*) if [ -n "$OO_SDK_CPP_HOME" ] then - SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | $OO_SDK_CPP_HOME/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` + SDK_GXX_INCLUDE_PATH=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` export SDK_GXX_INCLUDE_PATH fi @@ -189,7 +197,7 @@ case $sd_platform in exampleout=FREEBSDexample.out platform=FreeBSD stldebug=_stldebug - LD_LIBRARY_PATH=$OO_SDK_HOME/$directoryname/lib:$OO_EXAMPLE_OUT/$exampleout/lib:${OO_SDK_URE_LIB_DIR}:.:$LD_LIBRARY_PATH + LD_LIBRARY_PATH=${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH if [ -e "/sbin/sysctl" ] @@ -218,54 +226,48 @@ case $sd_platform in esac # Add directory of the SDK tools to the path. -PATH=$OO_SDK_HOME/$directoryname/bin:$OO_EXAMPLE_OUT/$exampleout/bin:${OO_SDK_URE_BIN_DIR}:.:$PATH +PATH=${OO_SDK_HOME}/bin:${OO_SDK_OUT}/${exampleout}/bin:${OO_SDK_URE_BIN_DIR}:${OFFICE_PROGRAM_PATH}:.:${PATH} # Set the classpath -CLASSPATH=${OO_SDK_URE_JAVA_DIR}/juh.jar:${OO_SDK_URE_JAVA_DIR}/jurt.jar:${OO_SDK_URE_JAVA_DIR}/ridl.jar:${OO_SDK_URE_JAVA_DIR}/unoloader.jar${OFFICE_PROGRAM_PATH+:${OFFICE_PROGRAM_PATH}/classes/unoil.jar}${CLASSPATH+:${CLASSPATH}} +CLASSPATH=${OO_SDK_URE_JAVA_DIR}/juh.jar:${OO_SDK_URE_JAVA_DIR}/jurt.jar:${OO_SDK_URE_JAVA_DIR}/ridl.jar:${OO_SDK_URE_JAVA_DIR}/unoloader.jar:${OFFICE_BASE_PROGRAM_PATH}/classes/unoil.jar:${CLASSPATH} export CLASSPATH # Add directory of the command make to the path, if necessary. -if [ -n "$OO_SDK_MAKE_HOME" ] +if [ -n "${OO_SDK_MAKE_HOME}" ] then - PATH=$OO_SDK_MAKE_HOME:$PATH + PATH=${OO_SDK_MAKE_HOME}:${PATH} export OO_SDK_MAKE_HOME fi # Add directory of the zip tool to the path, if necessary. -if [ -n "$OO_SDK_ZIP_HOME" ] +if [ -n "${OO_SDK_ZIP_HOME}" ] then - PATH=$OO_SDK_ZIP_HOME:$PATH + PATH=${OO_SDK_ZIP_HOME}:${PATH} export OO_SDK_ZIP_HOME fi # Add directory of the C++ tools to the path, if necessary. -if [ -n "$OO_SDK_CPP_HOME" ] +if [ -n "${OO_SDK_CPP_HOME}" ] then - PATH=$OO_SDK_CPP_HOME:$PATH + PATH=${OO_SDK_CPP_HOME}:${PATH} export OO_SDK_CPP_HOME - if [ -n "$OO_SDK_CC_55_OR_HIGHER" ] + if [ -n "${OO_SDK_CC_55_OR_HIGHER}" ] then export OO_SDK_CC_55_OR_HIGHER fi fi # Add directory of the Java tools to the path, if necessary. -if [ -n "$OO_SDK_JAVA_HOME" ] +if [ -n "${OO_SDK_JAVA_HOME}" ] then - PATH=$OO_SDK_JAVA_HOME/bin:$PATH -# JAVA_HOME=$OO_SDK_JAVA_HOME + PATH=${OO_SDK_JAVA_HOME}/${javadir}:${PATH} +# JAVA_HOME=${OO_SDK_JAVA_HOME} # export JAVA_HOME export OO_SDK_JAVA_HOME export PATH -# UNO_JAVA_JFW_JREHOME=`sp2bv $OO_SDK_JAVA_HOME` -# UNO_JAVA_JFW_ENV_CLASSPATH=true -# UNO_JAVA_JFW_VENDOR_SETTINGS=`sp2bv $OFFICE_HOME/share/config/javavendors.xml` -# export UNO_JAVA_JFW_JREHOME -# export UNO_JAVA_JFW_ENV_CLASSPATH -# export UNO_JAVA_JFW_VENDOR_SETTINGS fi export PATH @@ -277,33 +279,33 @@ then fi # For URE, prepare symbolic links for libraries: -rm -f "${OO_SDK_HOME}/${directoryname}/lib/libuno_cppu.${soext}" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_sal.${soext}" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" +rm -f "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.${soext}" \ + "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" \ + "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}" \ + "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" -if [ -w "${OO_SDK_HOME}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" ] +if [ -L "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" ] then - rm -rf "${OO_SDK_HOME}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" + rm -rf "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" fi if [ "${OO_SDK_URE_HOME}" ] then - mkdir -p "${OO_SDK_HOME}/${directoryname}/lib" + mkdir -p "${OO_SDK_OUT}/${directoryname}/lib" ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppu.${soext}.3" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_cppu.${soext}" + "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.${soext}" ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppuhelper${comid}.${soext}.3" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" + "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" ln -s "${OO_SDK_URE_LIB_DIR}/libuno_sal.${soext}.3" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_sal.${soext}" + "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}" ln -s "${OO_SDK_URE_LIB_DIR}/libuno_salhelper${comid}.${soext}.3" \ - "${OO_SDK_HOME}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" + "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" if [ -r "${OO_SDK_URE_LIB_DIR}/libstlport_${pltfrm}${STLDEBUG}.${soext}" ] then ln -s "${OO_SDK_URE_LIB_DIR}/libstlport_${pltfrm}${STLDEBUG}.${soext}" \ - "${OO_SDK_HOME}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" + "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" fi fi @@ -316,12 +318,13 @@ echo " * SDK environment is prepared for ${platform}" echo " *" echo " * SDK = $OO_SDK_HOME" echo " * Office = $OFFICE_HOME" +echo " * Office Base = $OFFICE_BASE_HOME" echo " * URE = $OO_SDK_URE_HOME" echo " * Make = $OO_SDK_MAKE_HOME" echo " * Zip = $OO_SDK_ZIP_HOME" echo " * C++ Compiler = $OO_SDK_CPP_HOME" echo " * Java = $OO_SDK_JAVA_HOME" -echo " * Special Output directory = $OO_SDK_OUTPUT_DIR" +echo " * SDK Output directory = $OO_SDK_OUT" echo " * Auto deployment = $SDK_AUTO_DEPLOYMENT" echo " *" echo " ************************************************************************" |