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)\""
21 dir
=$
(realpath
"${dir}/..")
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
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)\""
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 elif [ $
(uname
) = Haiku
]; then
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)\""
65 dir
=$
(readlink
-f "${dir}/..")
68 exedir
="${dir}"/workdir
/LinkTarget
/Executable
69 export URE_BOOTSTRAP
=file://"${dir}"/instdir
/program
/fundamentalrc
70 export LIBRARY_PATH
=${LIBRARY_PATH:+$LIBRARY_PATH:}"${dir}"/instdir
/program
72 # echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
73 # echo "setting search path to: ${LIBRARY_PATH}"
74 # echo "execing: ${exedir}/$1"
76 exec ${LO_TRACE} "${exedir}/$@"
80 dir
=$
(readlink
-f "$(pwd)")
82 while test ! -d "${dir}/instdir/program" ; do
83 if test "${dir}" = "/"; then
84 echo "error: cannot find \"program\" dir from \"$(pwd)\""
87 dir
=$
(readlink
-f "${dir}/..")
90 exedir
="${dir}"/workdir
/LinkTarget
/Executable
91 export URE_BOOTSTRAP
=file://"${dir}"/instdir
/program
/fundamentalrc
92 export LD_LIBRARY_PATH
=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir
/program
94 # echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
95 # echo "setting search path to: ${LD_LIBRARY_PATH}"
96 # echo "execing: ${exedir}/$1"
98 exec ${LO_TRACE} "${exedir}/$@"
102 # vi:set shiftwidth=4 expandtab: