Branch libreoffice-5-0-4
[LibreOffice.git] / bin / run
blob7823861d4a3b89431dd0abb88330824f51f1dd86
1 #!/bin/sh
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # simple wrapper script to run non-installed executables from workdir
12 if uname | grep -i CYGWIN >/dev/null; then
14 dir=$(realpath "$(pwd)")
16 while test ! -d "${dir}/instdir/program" ; do
17 if test "${dir}" = "/"; then
18 echo "error: cannot find \"program\" dir from \"$(pwd)\""
19 exit 1
21 dir=$(realpath "${dir}/..")
22 done
24 exedir=$(cygpath -m "${dir}"/workdir/LinkTarget/Executable)
25 export URE_BOOTSTRAP=file:///$(cygpath -m "${dir}")/instdir/program/fundamental.ini
26 export PATH=${PATH:+$PATH:}"${dir}"/instdir/program
28 echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
29 echo "setting search path to: ${PATH}"
30 echo "execing: ${exedir}/$1"
32 exec ${LO_TRACE} "${exedir}/$@"
34 elif [ $(uname) = Darwin ]; then
36 dir=$(pwd)
38 # Get PRODUCTNAME from config_host.mk, LibreOffice or LibreOfficeDev
39 eval `grep 'export PRODUCTNAME=' config_host.mk`
41 if [ ! -d "${dir}/instdir/$PRODUCTNAME.app" ]; then
42 echo "error: cannot find \"instdir/$PRODUCTNAME.app\" dir in \"$(pwd)\""
43 exit 1
46 exedir="${dir}"/workdir/LinkTarget/Executable
47 export URE_BOOTSTRAP=file://"${dir}"/instdir/$PRODUCTNAME.app/Contents/Resources/fundamentalrc
48 export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+$DYLD_LIBRARY_PATH:}"${dir}"/instdir/$PRODUCTNAME.app/Contents/Frameworks
50 echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
51 echo "setting search path to: ${DYLD_LIBRARY_PATH}"
52 echo "execing: ${exedir}/$1"
54 exec ${LO_TRACE} "${exedir}/$@"
56 else
58 dir=$(readlink -f "$(pwd)")
60 while test ! -d "${dir}/instdir/program" ; do
61 if test "${dir}" = "/"; then
62 echo "error: cannot find \"program\" dir from \"$(pwd)\""
63 exit 1
65 dir=$(readlink -f "${dir}/..")
66 done
68 exedir="${dir}"/workdir/LinkTarget/Executable
69 export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
70 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir/program
72 echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
73 echo "setting search path to: ${LD_LIBRARY_PATH}"
74 echo "execing: ${exedir}/$1"
76 exec ${LO_TRACE} "${exedir}/$@"
80 # vi:set shiftwidth=4 expandtab: