1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/unix/mozilla.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,108 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +## 1.11 +## Usage: 1.12 +## 1.13 +## $ mozilla [args] 1.14 +## 1.15 +## This script is meant to run the application binary from mozilla/dist/bin. 1.16 +## 1.17 +## The script will setup all the environment voodoo needed to make 1.18 +## the application binary to work. 1.19 +## 1.20 + 1.21 +#uncomment for debugging 1.22 +#set -x 1.23 + 1.24 +moz_libdir=%MOZAPPDIR% 1.25 + 1.26 +# Use run-mozilla.sh in the current dir if it exists 1.27 +# If not, then start resolving symlinks until we find run-mozilla.sh 1.28 +found=0 1.29 +progname="$0" 1.30 +curdir=`dirname "$progname"` 1.31 +progbase=`basename "$progname"` 1.32 +run_moz="$curdir/run-mozilla.sh" 1.33 +if test -x "$run_moz"; then 1.34 + dist_bin="$curdir" 1.35 + found=1 1.36 +else 1.37 + here=`/bin/pwd` 1.38 + while [ -h "$progname" ]; do 1.39 + bn=`basename "$progname"` 1.40 + cd `dirname "$progname"` 1.41 + # Resolve symlink of dirname 1.42 + cd `/bin/pwd` 1.43 + progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' ` 1.44 + progbase=`basename "$progname"` 1.45 + if [ ! -x "$progname" ]; then 1.46 + break 1.47 + fi 1.48 + curdir=`dirname "$progname"` 1.49 + run_moz="$curdir/run-mozilla.sh" 1.50 + if [ -x "$run_moz" ]; then 1.51 + cd "$curdir" 1.52 + dist_bin=`/bin/pwd` 1.53 + run_moz="$dist_bin/run-mozilla.sh" 1.54 + found=1 1.55 + break 1.56 + fi 1.57 + done 1.58 + cd "$here" 1.59 +fi 1.60 +if [ $found = 0 ]; then 1.61 + # Check default compile-time libdir 1.62 + if [ -x "$moz_libdir/run-mozilla.sh" ]; then 1.63 + dist_bin="$moz_libdir" 1.64 + run_moz="$moz_libdir/run-mozilla.sh" 1.65 + else 1.66 + echo "Cannot find %MOZ_APP_DISPLAYNAME% runtime directory. Exiting." 1.67 + exit 1 1.68 + fi 1.69 +fi 1.70 + 1.71 +script_args="" 1.72 +debugging=0 1.73 +MOZILLA_BIN="${progbase}-bin" 1.74 + 1.75 +if [ "$OSTYPE" = "beos" ]; then 1.76 + mimeset -F "$MOZILLA_BIN" 1.77 +fi 1.78 + 1.79 +pass_arg_count=0 1.80 +while [ $# -gt $pass_arg_count ] 1.81 +do 1.82 + case "$1" in 1.83 + -p | --pure | -pure) 1.84 + MOZILLA_BIN="${MOZILLA_BIN}.pure" 1.85 + shift 1.86 + ;; 1.87 + -g | --debug) 1.88 + script_args="$script_args -g" 1.89 + debugging=1 1.90 + shift 1.91 + ;; 1.92 + -d | --debugger) 1.93 + script_args="$script_args -d $2" 1.94 + shift 2 1.95 + ;; 1.96 + *) 1.97 + # Move the unrecognized argument to the end of the list. 1.98 + arg="$1" 1.99 + shift 1.100 + set -- "$@" "$arg" 1.101 + pass_arg_count=`expr $pass_arg_count + 1` 1.102 + ;; 1.103 + esac 1.104 +done 1.105 + 1.106 +if [ $debugging = 1 ] 1.107 +then 1.108 + echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@" 1.109 +fi 1.110 +exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" 1.111 +# EOF.