xref: /aoo42x/main/padmin/source/spadmin.sh (revision 30971150)
1cdf0e10cSrcweir#!/bin/sh
2cdf0e10cSrcweir#*************************************************************************
3cdf0e10cSrcweir#
4cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5cdf0e10cSrcweir#
6cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
7cdf0e10cSrcweir#
8cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
9cdf0e10cSrcweir#
10cdf0e10cSrcweir# This file is part of OpenOffice.org.
11cdf0e10cSrcweir#
12cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
13cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
14cdf0e10cSrcweir# only, as published by the Free Software Foundation.
15cdf0e10cSrcweir#
16cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
17cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
18cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
20cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
21cdf0e10cSrcweir#
22cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
23cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
24cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
25cdf0e10cSrcweir# for a copy of the LGPLv3 License.
26cdf0e10cSrcweir#
27cdf0e10cSrcweir#*************************************************************************
28cdf0e10cSrcweir
29cdf0e10cSrcweir# enable file locking
30cdf0e10cSrcweirSAL_ENABLE_FILE_LOCKING=1
31cdf0e10cSrcweirexport SAL_ENABLE_FILE_LOCKING
32cdf0e10cSrcweir
33cdf0e10cSrcweir# resolve installation directory
34cdf0e10cSrcweirsd_cwd="`pwd`"
35cdf0e10cSrcweirif [ -h "$0" ] ; then
36cdf0e10cSrcweir	sd_basename=`basename "$0"`
37cdf0e10cSrcweir 	sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
38cdf0e10cSrcweir    cd "`dirname "$0"`"
39cdf0e10cSrcweir    cd "`dirname "$sd_script"`"
40cdf0e10cSrcweirelse
41cdf0e10cSrcweir    cd "`dirname "$0"`"
42cdf0e10cSrcweirfi
43cdf0e10cSrcweirsd_prog=`pwd`
44cdf0e10cSrcweircd "$sd_cwd"
45cdf0e10cSrcweir
46cdf0e10cSrcweir#collect all bootstrap variables specified on the command line
47cdf0e10cSrcweir#so that they can be passed as arguments to javaldx later on
48cdf0e10cSrcweirfor arg in $@
49cdf0e10cSrcweirdo
50cdf0e10cSrcweir  case "$arg" in
51cdf0e10cSrcweir       -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
52cdf0e10cSrcweir  esac
53cdf0e10cSrcweirdone
54cdf0e10cSrcweir
55cdf0e10cSrcweir# extend the ld_library_path for java: javaldx checks the sofficerc for us
56cdf0e10cSrcweirif [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
57*30971150SPedro Giffuni    # this is a temporary hack until we can live with the default search paths
58*30971150SPedro Giffuni    case "`uname -s`" in
59*30971150SPedro Giffuni    FreeBSD)
60*30971150SPedro Giffuni	sd_prog1="$sd_prog/../basis-link/program"
61*30971150SPedro Giffuni	sd_prog2="$sd_prog/../basis-link/ure-link/lib"
62*30971150SPedro Giffuni	LD_LIBRARY_PATH=$sd_prog1:$sd_prog2${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
63*30971150SPedro Giffuni	export LD_LIBRARY_PATH
64*30971150SPedro Giffuni	;;
65*30971150SPedro Giffuni    esac
66cdf0e10cSrcweir    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
67cdf0e10cSrcweir        "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
68cdf0e10cSrcweir    if [ -n "$my_path" ] ; then
69cdf0e10cSrcweir        LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
70cdf0e10cSrcweir        export LD_LIBRARY_PATH
71cdf0e10cSrcweir    fi
72cdf0e10cSrcweirfi
73cdf0e10cSrcweir
74cdf0e10cSrcweirunset XENVIRONMENT
75cdf0e10cSrcweir
76cdf0e10cSrcweir# uncomment line below to disable anti aliasing of fonts
77cdf0e10cSrcweir# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
78cdf0e10cSrcweir
79cdf0e10cSrcweir# Set PATH so that crash_report is found:
80cdf0e10cSrcweirPATH=$sd_prog${PATH+:$PATH}
81cdf0e10cSrcweirexport PATH
82cdf0e10cSrcweir
83cdf0e10cSrcweir# execute binary
84cdf0e10cSrcweirexec "$sd_prog/../basis-link/program/spadmin.bin" "$@" \
85cdf0e10cSrcweir    "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
86