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
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
="${dir}"/workdir
/LinkTarget
/Executable
25 export URE_BOOTSTRAP
=file://"${dir}"/instdir
/program
/fundamentalrc
28 if uname |
grep -i CYGWIN
>/dev
/null
; then
32 exedir
=$
(cygpath
-m "${dir}"/workdir
/LinkTarget
/Executable
)
33 export URE_BOOTSTRAP
=file:///$
(cygpath
-m "${dir}")/instdir
/program
/fundamental.ini
34 export PATH
=${PATH:+$PATH:}"${dir}"/instdir
/program
37 elif [ $
(uname
) = Darwin
]; then
41 # Get PRODUCTNAME from config_host.mk, LibreOffice or LibreOfficeDev
42 eval `grep 'export PRODUCTNAME=' config_host.mk`
44 if [ ! -d "${dir}/instdir/$PRODUCTNAME.app" ]; then
45 echo "error: cannot find \"instdir/$PRODUCTNAME.app\" dir in \"$(pwd)\""
49 exedir
="$dir"/workdir
/LinkTarget
/Executable
50 export URE_BOOTSTRAP
=file://"${dir}"/instdir
/$PRODUCTNAME.app
/Contents
/Resources
/fundamentalrc
51 export DYLD_LIBRARY_PATH
=${DYLD_LIBRARY_PATH:+$DYLD_LIBRARY_PATH:}"${dir}"/instdir
/$PRODUCTNAME.app
/Contents
/Frameworks
52 SEARCH_PATH
="${DYLD_LIBRARY_PATH}"
54 elif [ $
(uname
) = Haiku
]; then
58 export LIBRARY_PATH
=${LIBRARY_PATH:+$LIBRARY_PATH:}"${dir}"/instdir
/program
59 SEARCH_PATH
="${LIBRARY_PATH}"
65 export LD_LIBRARY_PATH
=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir
/program
66 SEARCH_PATH
="${LD_LIBRARY_PATH}"
70 # echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
71 # echo "setting search path to: ${SEARCH_PATH}"
72 # echo "execing: ${exedir}/$1"
74 exec ${LO_TRACE} "${exedir}/$@"
76 # vi:set shiftwidth=4 expandtab: