2003-03-25 06:52:54 -06:00
|
|
|
#!/bin/sh
|
|
|
|
#*************************************************************************
|
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2010-02-12 08:01:35 -06:00
|
|
|
# Copyright 2000, 2010 Oracle and/or its affiliates.
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# This file is part of OpenOffice.org.
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
# only, as published by the Free Software Foundation.
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License version 3 for more details
|
|
|
|
# (a copy is included in the LICENSE file that accompanied this code).
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
2008-04-10 21:34:25 -05:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# version 3 along with OpenOffice.org. If not, see
|
|
|
|
# <http://www.openoffice.org/license.html>
|
|
|
|
# for a copy of the LGPLv3 License.
|
2003-03-25 06:52:54 -06:00
|
|
|
#
|
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
#
|
|
|
|
# STAR_PROFILE_LOCKING_DISABLED=1
|
|
|
|
# export STAR_PROFILE_LOCKING_DISABLED
|
|
|
|
#
|
|
|
|
|
2004-06-11 11:46:12 -05:00
|
|
|
# file locking now enabled by default
|
|
|
|
SAL_ENABLE_FILE_LOCKING=1
|
|
|
|
export SAL_ENABLE_FILE_LOCKING
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2007-03-07 06:14:15 -06:00
|
|
|
# Uncomment the line below if you suspect that OpenGL is not
|
2006-02-09 10:07:48 -06:00
|
|
|
# working on your system.
|
2007-03-07 06:14:15 -06:00
|
|
|
# SAL_NOOPENGL=true; export SAL_NOOPENGL
|
2006-02-09 10:07:48 -06:00
|
|
|
|
2009-11-13 07:45:27 -06:00
|
|
|
# The following is needed on Linux PPC with IBM j2sdk142:
|
|
|
|
#@# export JITC_PROCESSOR_TYPE=6
|
2005-05-11 05:32:48 -05:00
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
# resolve installation directory
|
|
|
|
sd_cwd="`pwd`"
|
|
|
|
if [ -h "$0" ] ; then
|
|
|
|
sd_basename=`basename "$0"`
|
|
|
|
sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
|
|
|
|
cd "`dirname "$0"`"
|
|
|
|
cd "`dirname "$sd_script"`"
|
|
|
|
else
|
|
|
|
cd "`dirname "$0"`"
|
|
|
|
fi
|
2008-03-18 07:44:45 -05:00
|
|
|
sd_prog=`pwd`
|
2003-03-25 06:52:54 -06:00
|
|
|
cd "$sd_cwd"
|
|
|
|
|
2010-09-15 04:31:55 -05:00
|
|
|
# linked build needs additional settings
|
|
|
|
if [ -e ooenv ] ; then
|
2010-10-13 03:50:33 -05:00
|
|
|
. ./ooenv
|
2010-09-15 04:31:55 -05:00
|
|
|
fi
|
|
|
|
|
2010-10-15 04:22:59 -05:00
|
|
|
sd_binary=`basename "$0" | sed 's/libreoffice/soffice/g'`.bin
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2010-11-16 02:34:30 -06:00
|
|
|
# this is a temporary hack until we can live with the default search paths
|
|
|
|
case "`uname -s`" in
|
|
|
|
OpenBSD)
|
|
|
|
sd_prog1="$sd_prog/../basis-link/program"
|
|
|
|
sd_prog2="$sd_prog/../basis-link/ure-link/lib"
|
|
|
|
LD_LIBRARY_PATH=$sd_prog1:$sd_prog2${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
|
|
|
|
JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
if [ -n "${JAVA_HOME}" ]; then
|
|
|
|
export JAVA_HOME
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2010-11-15 09:00:48 -06:00
|
|
|
# this is a temporary hack until we can live with the default search paths
|
|
|
|
case "`uname -s`" in
|
|
|
|
OpenBSD)
|
|
|
|
sd_prog1="$sd_prog/../basis-link/program"
|
|
|
|
sd_prog2="$sd_prog/../basis-link/ure-link/lib"
|
|
|
|
LD_LIBRARY_PATH=$sd_prog1:$sd_prog2${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
|
|
|
|
JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
if [ -n "${JAVA_HOME}" ]; then
|
|
|
|
export JAVA_HOME
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2005-11-11 05:28:45 -06:00
|
|
|
#collect all bootstrap variables specified on the command line
|
|
|
|
#so that they can be passed as arguments to javaldx later on
|
|
|
|
for arg in $@
|
|
|
|
do
|
|
|
|
case "$arg" in
|
|
|
|
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2010-10-12 09:32:09 -05:00
|
|
|
# test for availability of the fast external splash
|
|
|
|
for arg in $@; do
|
|
|
|
if [ "$arg" = "-nologo" -o "$arg" = "-no-oosplash" ]; then
|
|
|
|
no_oosplash=y
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Setup our app as oosplash, but try to avoid executing pagein,
|
|
|
|
# and other expensive environment setup pieces wherever possible
|
|
|
|
# for a second started office
|
|
|
|
if [ "$sd_binary" = "soffice.bin" -a -x "$sd_prog/oosplash.bin" ] && [ "$no_oosplash" != "y" ] ; then
|
|
|
|
sd_binary="oosplash.bin"
|
|
|
|
|
2010-11-08 09:17:47 -06:00
|
|
|
# try to connect to a running instance early
|
|
|
|
if "$sd_prog/$sd_binary" -qsend-and-report "$@" ; then
|
2010-10-12 09:32:09 -05:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-04-27 06:24:10 -05:00
|
|
|
# pagein
|
|
|
|
sd_pagein_args=@pagein-common
|
|
|
|
for sd_arg in "$@"; do
|
|
|
|
case ${sd_arg} in
|
|
|
|
-calc)
|
|
|
|
sd_pagein_args="${sd_pagein_args} @pagein-calc"
|
|
|
|
break;
|
|
|
|
;;
|
|
|
|
-draw)
|
|
|
|
sd_pagein_args="${sd_pagein_args} @pagein-draw"
|
|
|
|
break;
|
|
|
|
;;
|
|
|
|
-impress)
|
|
|
|
sd_pagein_args="${sd_pagein_args} @pagein-impress"
|
|
|
|
break;
|
|
|
|
;;
|
|
|
|
-writer)
|
|
|
|
sd_pagein_args="${sd_pagein_args} @pagein-writer"
|
|
|
|
break;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
"$sd_prog/../basis-link/program/pagein" -L"$sd_prog/../basis-link/program" \
|
|
|
|
${sd_pagein_args}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
# extend the ld_library_path for java: javaldx checks the sofficerc for us
|
2008-03-18 07:44:45 -05:00
|
|
|
if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
|
|
|
|
my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
|
2008-06-09 06:57:10 -05:00
|
|
|
"-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
|
2008-03-18 07:44:45 -05:00
|
|
|
if [ -n "$my_path" ] ; then
|
2010-10-13 07:17:31 -05:00
|
|
|
sd_platform=`uname -s`
|
|
|
|
case $sd_platform in
|
|
|
|
AIX)
|
|
|
|
LIBPATH=$my_path${LIBPATH:+:$LIBPATH}
|
|
|
|
export LIBPATH
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
;;
|
|
|
|
esac
|
2008-03-18 07:44:45 -05:00
|
|
|
fi
|
2003-03-25 06:52:54 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
unset XENVIRONMENT
|
|
|
|
|
|
|
|
# uncomment line below to disable anti aliasing of fonts
|
2003-06-04 04:42:53 -05:00
|
|
|
# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2008-08-18 07:06:38 -05:00
|
|
|
# uncomment line below if you encounter problems starting soffice on your system
|
|
|
|
# SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
|
|
|
|
|
2008-02-26 09:03:10 -06:00
|
|
|
# read database entries for Adabas D
|
|
|
|
if [ -f /etc/adabasrc ]; then
|
|
|
|
. /etc/adabasrc
|
|
|
|
fi
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
# execute soffice binary
|
2006-05-08 09:35:41 -05:00
|
|
|
"$sd_prog/$sd_binary" "$@" &
|
|
|
|
trap 'kill -9 $!' TERM
|
|
|
|
wait $!
|
2009-11-12 09:59:54 -06:00
|
|
|
sd_ret=$?
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2010-05-10 10:35:24 -05:00
|
|
|
while [ $sd_ret -eq 79 -o $sd_ret -eq 81 ]
|
2004-11-26 07:48:50 -06:00
|
|
|
do
|
2010-05-10 10:35:24 -05:00
|
|
|
if [ $sd_ret -eq 79 ]; then
|
|
|
|
"$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
|
2010-05-10 10:55:28 -05:00
|
|
|
elif [ $sd_ret -eq 81 ]; then
|
2010-05-10 10:35:24 -05:00
|
|
|
"$sd_prog/$sd_binary" "$@" &
|
|
|
|
fi
|
|
|
|
|
2006-05-08 09:35:41 -05:00
|
|
|
wait $!
|
2009-11-12 09:59:54 -06:00
|
|
|
sd_ret=$?
|
2004-11-26 07:48:50 -06:00
|
|
|
done
|
|
|
|
|
2009-11-12 09:59:54 -06:00
|
|
|
exit $sd_ret
|