3
# This Source Code Form is subject to the terms of the Mozilla Public
4
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
12
## This script is meant to run the application binary from mozilla/dist/bin.
14
## The script will setup all the environment voodoo needed to make
15
## the application binary to work.
18
#uncomment for debugging
21
moz_libdir=%MOZAPPDIR%
23
# Use run-mozilla.sh in the current dir if it exists
24
# If not, then start resolving symlinks until we find run-mozilla.sh
27
curdir=`dirname "$progname"`
28
progbase=`basename "$progname"`
29
run_moz="$curdir/run-mozilla.sh"
30
if test -x "$run_moz"; then
35
while [ -h "$progname" ]; do
36
bn=`basename "$progname"`
37
cd `dirname "$progname"`
38
# Resolve symlink of dirname
40
progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
41
progbase=`basename "$progname"`
42
if [ ! -x "$progname" ]; then
45
curdir=`dirname "$progname"`
46
run_moz="$curdir/run-mozilla.sh"
47
if [ -x "$run_moz" ]; then
50
run_moz="$dist_bin/run-mozilla.sh"
57
if [ $found = 0 ]; then
58
# Check default compile-time libdir
59
if [ -x "$moz_libdir/run-mozilla.sh" ]; then
60
dist_bin="$moz_libdir"
61
run_moz="$moz_libdir/run-mozilla.sh"
63
echo "Cannot find %MOZ_APP_DISPLAYNAME% runtime directory. Exiting."
70
MOZILLA_BIN="${progbase}-bin"
72
if [ "$OSTYPE" = "beos" ]; then
73
mimeset -F "$MOZILLA_BIN"
77
while [ $# -gt $pass_arg_count ]
81
MOZILLA_BIN="${MOZILLA_BIN}.pure"
85
script_args="$script_args -g"
90
script_args="$script_args -d $2"
94
# Move the unrecognized argument to the end of the list.
98
pass_arg_count=`expr $pass_arg_count + 1`
103
if [ $debugging = 1 ]
105
echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
107
exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"