home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / openoffice / program / soffice < prev    next >
Encoding:
Text File  |  2006-08-01  |  6.7 KB  |  245 lines

  1. #!/bin/sh
  2. #*************************************************************************
  3. #
  4. #   OpenOffice.org - a multi-platform office productivity suite
  5. #
  6. #   $RCSfile: soffice.sh,v $
  7. #
  8. #   $Revision: 1.24 $
  9. #
  10. #   last change: $Author: hr $ $Date: 2006/05/08 15:35:41 $
  11. #
  12. #   The Contents of this file are made available subject to
  13. #   the terms of GNU Lesser General Public License Version 2.1.
  14. #
  15. #
  16. #     GNU Lesser General Public License Version 2.1
  17. #     =============================================
  18. #     Copyright 2005 by Sun Microsystems, Inc.
  19. #     901 San Antonio Road, Palo Alto, CA 94303, USA
  20. #
  21. #     This library is free software; you can redistribute it and/or
  22. #     modify it under the terms of the GNU Lesser General Public
  23. #     License version 2.1, as published by the Free Software Foundation.
  24. #
  25. #     This library is distributed in the hope that it will be useful,
  26. #     but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  28. #     Lesser General Public License for more details.
  29. #
  30. #     You should have received a copy of the GNU Lesser General Public
  31. #     License along with this library; if not, write to the Free Software
  32. #     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33. #     MA  02111-1307  USA
  34. #
  35. #*************************************************************************
  36.  
  37. #
  38. # STAR_PROFILE_LOCKING_DISABLED=1
  39. # export STAR_PROFILE_LOCKING_DISABLED
  40. #
  41.  
  42. # file locking now enabled by default
  43. SAL_ENABLE_FILE_LOCKING=1
  44. export SAL_ENABLE_FILE_LOCKING
  45.  
  46. # Uncomment the below line if you suspect that OpenGL is not
  47. # working on your system.
  48. # export SAL_NOOPENGL=true; 
  49.  
  50. sd_platform=`uname -s`
  51.  
  52. # the following test is needed on Linux PPC with IBM j2sdk142
  53. if [ $sd_platform = "Linux" -a "`uname -m`" = "ppc" ] ; then
  54.     JITC_PROCESSOR_TYPE=6
  55.     export JITC_PROCESSOR_TYPE
  56. fi
  57.  
  58. # set -x
  59.  
  60. # resolve installation directory
  61. sd_cwd="`pwd`"
  62. if [ -h "$0" ] ; then
  63.     sd_basename=`basename "$0"`
  64.      sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` 
  65.     cd "`dirname "$0"`"
  66.     cd "`dirname "$sd_script"`"
  67. else
  68.     cd "`dirname "$0"`"
  69. fi
  70.  
  71. sd_prog="`pwd`"
  72.  
  73. cd ..
  74. sd_binary=`basename "$0"`".bin"
  75. sd_inst="`pwd`"
  76.  
  77. # change back directory
  78. cd "$sd_cwd"
  79.  
  80. # check if all required patches are installed
  81. if [ -x "$sd_prog/sopatchlevel.sh" ]; then
  82.     "$sd_prog/sopatchlevel.sh"
  83.     if [ $? -eq 1 ]; then
  84.         exit 0
  85.     fi
  86. fi
  87.  
  88. # set search path for shared libraries
  89. add_moz_lib=
  90. for moz_lib_path in $MOZILLA_LIBRARY_PATH /usr/lib /usr/lib/mozilla /usr/lib/mozilla-firefox /usr/lib/mozilla-thunderbird /opt/mozilla/lib /opt/MozillaFirefox/lib /opt/MozillaThunderbird/lib; do
  91.     test -f $moz_lib_path/libnss3.so && add_moz_lib=":$moz_lib_path" && break;
  92. done
  93. case $sd_platform in
  94.   AIX)
  95.     # this is a temporary hack until we can live with the default search paths
  96.     if [ $LIBPATH ]; then
  97.       SYSTEM_LIBPATH=$LIBPATH
  98.       export SYSTEM_LIBPATH
  99.       LIBPATH="$sd_prog$add_moz_lib":$LIBPATH
  100.     else
  101.       LIBPATH="$sd_prog$add_moz_lib"
  102.     fi
  103.     export LIBPATH
  104.     ;;
  105.  
  106.   Darwin)
  107.     # this is a temporary hack until we can live with the default search paths
  108.     if [ $DYLD_LIBRARY_PATH ]; then 
  109.       SYSTEM_DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
  110.       export SYSTEM_DYLD_LIBRARY_PATH
  111.       DYLD_LIBRARY_PATH="$sd_prog$add_moz_lib":$DYLD_LIBRARY_PATH
  112.     else
  113.       DYLD_LIBRARY_PATH="$sd_prog$add_moz_lib"
  114.     fi
  115.     export DYLD_LIBRARY_PATH
  116.     ;;
  117.  
  118.   HP-UX)
  119.     # this is a temporary hack until we can live with the default search paths
  120.     if [ $SHLIB_PATH ]; then
  121.       SYSTEM_SHLIB_PATH=$SHLIB_PATH
  122.       export SYSTEM_SHLIB_PATH
  123.       SHLIB_PATH="$sd_prog$add_moz_lib":/usr/openwin/lib:$SHLIB_PATH
  124.     else
  125.       SHLIB_PATH="$sd_prog$add_moz_lib":/usr/openwin/lib
  126.     fi
  127.     export SHLIB_PATH
  128.     ;;
  129.  
  130.   IRIX*)
  131.     # this is a temporary hack until we can live with the default search paths
  132.     if [ $LD_LIBRARYN32_PATH ]; then
  133.        SYSTEM_LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH
  134.        export SYSTEM_LD_LIBRARYN32_PATH
  135.        LD_LIBRARYN32_PATH=:"$sd_prog$add_moz_lib":$LD_LIBRARYN32_PATH
  136.     else
  137.        LD_LIBRARYN32_PATH=:"$sd_prog$add_moz_lib"
  138.     fi
  139.     export LD_LIBRARYN32_PATH
  140.     ;;
  141.  
  142.   *)
  143.     # this is a temporary hack until we can live with the default search paths
  144.     if [ $LD_LIBRARY_PATH ]; then
  145.       SYSTEM_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
  146.       export SYSTEM_LD_LIBRARY_PATH
  147.       LD_LIBRARY_PATH="$sd_prog$add_moz_lib":$LD_LIBRARY_PATH
  148.     else
  149.       LD_LIBRARY_PATH="$sd_prog$add_moz_lib"
  150.     fi
  151.     export LD_LIBRARY_PATH
  152.     ;;
  153. esac
  154.  
  155. #collect all bootstrap variables specified on the command line
  156. #so that they can be passed as arguments to javaldx later on
  157. for arg in $@
  158. do
  159.   case "$arg" in
  160.        -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
  161.   esac
  162. done
  163.  
  164. # extend the ld_library_path for java: javaldx checks the sofficerc for us
  165. if [ -x "$sd_prog/javaldx" ] ; then
  166.     java_ld_library_path=`"$sd_prog/javaldx" $BOOTSTRAPVARS`
  167.     if [ "$java_ld_library_path" != "" ] ; then
  168.         case $sd_platform in
  169.             AIX)
  170.                 LIBPATH=${java_ld_library_path}:${LIBPATH}
  171.                 ;;
  172.             Darwin)
  173.                 DYLD_LIBRARY_PATH=${java_ld_library_path}:${DYLD_LIBRARY_PATH}
  174.                 ;;
  175.             HP-UX)
  176.                 SHLIB_PATH=${java_ld_library_path}:${SHLIB_PATH}
  177.                 ;;
  178.             IRIX*)
  179.                 LD_LIBRARYN32_PATH=${java_ld_library_path}:${LD_LIBRARYN32_PATH}
  180.                 ;;
  181.             *)
  182.                 LD_LIBRARY_PATH=${java_ld_library_path}:${LD_LIBRARY_PATH}
  183.                 ;;
  184.         esac
  185.     fi
  186. fi
  187.  
  188. # misc. environment variables
  189. OPENOFFICE_MOZILLA_FIVE_HOME="$sd_inst/program"
  190. export OPENOFFICE_MOZILLA_FIVE_HOME
  191.  
  192. unset XENVIRONMENT
  193.  
  194. # uncomment line below to disable anti aliasing of fonts
  195. # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
  196.  
  197. # pagein
  198. for sd_arg in ${1+"$@"} ; do
  199.     case ${sd_arg} in
  200.     -calc)
  201.         sd_pagein_args="${sd_pagein_args:+${sd_pagein_args} }@pagein-calc"
  202.         break;
  203.         ;;
  204.     -draw)
  205.         sd_pagein_args="${sd_pagein_args:+${sd_pagein_args} }@pagein-draw"
  206.         break;
  207.         ;;
  208.     -impress)
  209.         sd_pagein_args="${sd_pagein_args:+${sd_pagein_args} }@pagein-impress"
  210.         break;
  211.         ;;
  212.     -writer)
  213.         sd_pagein_args="${sd_pagein_args:+${sd_pagein_args} }@pagein-writer"
  214.         break;
  215.         ;;
  216.     *)
  217.         ;;
  218.     esac
  219. done
  220.  
  221. sd_pagein_args="${sd_pagein_args:+${sd_pagein_args} }@pagein-common"
  222. "${sd_prog}"/pagein -L"${sd_prog}" ${sd_pagein_args}
  223.  
  224. # set path so that other apps can be started from soffice just by name
  225. if [ $PATH ]; then
  226.   PATH="$sd_prog":$PATH
  227. else
  228.   PATH="$sd_prog"
  229. fi
  230. export PATH
  231.  
  232.  
  233. # execute soffice binary
  234. "$sd_prog/$sd_binary" "$@" &
  235. trap 'kill -9 $!' TERM
  236. wait $!
  237.  
  238. while [ $? -eq 79 ]
  239. do
  240.     "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
  241.     wait $!
  242. done
  243.  
  244. exit
  245.