merge the formfield patch from ooo-build
[ooovba.git] / desktop / scripts / soffice.sh
blobbbe1f69e55e45adbc54b48d30ac2cf6a9c02b98f
1 #!/bin/sh
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2008 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # $RCSfile: soffice.sh,v $
12 # $Revision: 1.34 $
14 # This file is part of OpenOffice.org.
16 # OpenOffice.org is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU Lesser General Public License version 3
18 # only, as published by the Free Software Foundation.
20 # OpenOffice.org is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU Lesser General Public License version 3 for more details
24 # (a copy is included in the LICENSE file that accompanied this code).
26 # You should have received a copy of the GNU Lesser General Public License
27 # version 3 along with OpenOffice.org. If not, see
28 # <http://www.openoffice.org/license.html>
29 # for a copy of the LGPLv3 License.
31 #*************************************************************************
34 # STAR_PROFILE_LOCKING_DISABLED=1
35 # export STAR_PROFILE_LOCKING_DISABLED
38 # file locking now enabled by default
39 SAL_ENABLE_FILE_LOCKING=1
40 export SAL_ENABLE_FILE_LOCKING
42 # Uncomment the line below if you suspect that OpenGL is not
43 # working on your system.
44 # SAL_NOOPENGL=true; export SAL_NOOPENGL
46 # the following test is needed on Linux PPC with IBM j2sdk142
47 if [ "`uname -s`" = "Linux" -a "`uname -m`" = "ppc" ] ; then
48 JITC_PROCESSOR_TYPE=6
49 export JITC_PROCESSOR_TYPE
52 # resolve installation directory
53 sd_cwd="`pwd`"
54 if [ -h "$0" ] ; then
55 sd_basename=`basename "$0"`
56 sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
57 cd "`dirname "$0"`"
58 cd "`dirname "$sd_script"`"
59 else
60 cd "`dirname "$0"`"
62 sd_prog=`pwd`
63 cd "$sd_cwd"
65 sd_binary=`basename "$0"`.bin
67 #collect all bootstrap variables specified on the command line
68 #so that they can be passed as arguments to javaldx later on
69 for arg in $@
71 case "$arg" in
72 -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
73 esac
74 done
76 # pagein
77 sd_pagein_args=@pagein-common
78 for sd_arg in "$@"; do
79 case ${sd_arg} in
80 -calc)
81 sd_pagein_args="${sd_pagein_args} @pagein-calc"
82 break;
84 -draw)
85 sd_pagein_args="${sd_pagein_args} @pagein-draw"
86 break;
88 -impress)
89 sd_pagein_args="${sd_pagein_args} @pagein-impress"
90 break;
92 -writer)
93 sd_pagein_args="${sd_pagein_args} @pagein-writer"
94 break;
96 esac
97 done
98 "$sd_prog/../basis-link/program/pagein" -L"$sd_prog/../basis-link/program" \
99 ${sd_pagein_args}
101 # extend the ld_library_path for java: javaldx checks the sofficerc for us
102 if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
103 my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
104 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
105 if [ -n "$my_path" ] ; then
106 LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
107 export LD_LIBRARY_PATH
111 unset XENVIRONMENT
113 # uncomment line below to disable anti aliasing of fonts
114 # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
116 # uncomment line below if you encounter problems starting soffice on your system
117 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
119 # read database entries for Adabas D
120 if [ -f /etc/adabasrc ]; then
121 . /etc/adabasrc
124 # Set PATH so that crash_report is found:
125 PATH=$sd_prog${PATH+:$PATH}
126 export PATH
128 PYTHONPATH=$sd_prog/../basis-link/program${PYTHONPATH+:$PYTHONPATH}
129 export PYTHONPATH
131 # test for availability of the fast external splash
132 for arg in $@; do
133 if [ "$arg" = "-nologo" -o "$arg" = "-no-oosplash" ]; then
134 no_oosplash=y
136 done
137 if [ "$sd_binary" = "soffice.bin" -a -x "$sd_prog/oosplash.bin" ] && [ "$no_oosplash" != "y" ] ; then
138 sd_binary="oosplash.bin"
141 # execute soffice binary
142 "$sd_prog/$sd_binary" "$@" &
143 trap 'kill -9 $!' TERM
144 wait $!
146 while [ $? -eq 79 ]
148 "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
149 wait $!
150 done
152 exit