merge the formfield patch from ooo-build
[ooovba.git] / svx / source / gengal / gengal.sh
blobe619ba559ae7de4a045ca8d9ae1ee736493d4043
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: gengal.sh,v $
12 # $Revision: 1.5.288.2 $
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 #*************************************************************************
33 # enable file locking
34 SAL_ENABLE_FILE_LOCKING=1
35 export SAL_ENABLE_FILE_LOCKING
37 # resolve installation directory
38 sd_cwd="`pwd`"
39 if [ -h "$0" ] ; then
40 sd_basename=`basename "$0"`
41 sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
42 cd "`dirname "$0"`"
43 cd "`dirname "$sd_script"`"
44 else
45 cd "`dirname "$0"`"
48 sd_prog="`pwd`"
50 cd ..
51 sd_binary=`basename "$0"`".bin"
52 sd_inst="`pwd`"
54 # change back directory
55 cd "$sd_cwd"
57 # check if all required patches are installed
58 if [ -x "$sd_prog/sopatchlevel.sh" ]; then
59 "$sd_prog/sopatchlevel.sh"
60 if [ $? -eq 1 ]; then
61 exit 0
65 # set search path for shared libraries
66 sd_platform=`uname -s`
67 case $sd_platform in
68 AIX)
69 LIBPATH=${sd_prog}${LIBPATH+:${LIBPATH}}
70 export LIBPATH
73 Darwin)
74 DYLD_LIBRARY_PATH=${sd_prog}${DYLD_LIBRARY_PATH+:${DYLD_LIBRARY_PATH}}
75 export DYLD_LIBRARY_PATH
78 HP-UX)
79 SHLIB_PATH=${sd_prog}:/usr/openwin/lib${SHLIB_PATH+:${SHLIB_PATH}}
80 export SHLIB_PATH
83 IRIX*)
84 LD_LIBRARYN32_PATH=${sd_prog}${LD_LIBRARYN32_PATH+:${LD_LIBRARYN32_PATH}}
85 export LD_LIBRARYN32_PATH
89 LD_LIBRARY_PATH=${sd_prog}${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
90 export LD_LIBRARY_PATH
92 esac
94 # misc. environment variables
95 unset XENVIRONMENT
97 # set path so that other apps can be started just by name
98 PATH="$sd_prog":$PATH
99 export PATH
101 OOO_INSTALL_PREFIX=${OOO_INSTALL_PREFIX-$sd_prog/../..}
102 if ! test -e $OOO_INSTALL_PREFIX/basis-link; then
103 # Hack for vanilla OOo binaries' split install layout
104 OOO_INSTALL_PREFIX=$OOO_INSTALL_PREFIX/../openoffice.org3
107 export OOO_INSTALL_PREFIX
109 # execute binary
110 exec "$sd_prog/$sd_binary" "$@"