Update ooo320-m1
[ooovba.git] / solenv / bin / checkdll.sh
blob8390e373abd0ea634464168390aeccc87a914cfb
1 #! /bin/sh
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2008 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # $RCSfile: header.hxx,v $
12 # $Revision: 1.1 $
14 # This file is part of OpenOffice.org.
16 # OpenOffice.org is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU Lesser General Public License version 3
18 # only, as published by the Free Software Foundation.
20 # OpenOffice.org is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU Lesser General Public License version 3 for more details
24 # (a copy is included in the LICENSE file that accompanied this code).
26 # You should have received a copy of the GNU Lesser General Public License
27 # version 3 along with OpenOffice.org. If not, see
28 # <http://www.openoffice.org/license.html>
29 # for a copy of the LGPLv3 License.
31 #*************************************************************************
32 # checkdll.sh - execute checkdll with all -L arguments to this script
33 # prepended to LD_LIBRARY_PATH
35 set -- `getopt "L:" "$@"` || {
36 echo "Usage: `basename $0` [-L library_path] <shared_library>" 1>&2
37 exit 1
40 checkdll="$SOLARVERSION/$INPATH/bin$UPDMINOREXT/checkdll"
42 if [ -x $checkdll ]; then
43 while :
45 case $1 in
46 -L) shift; option=$1;;
47 --) break;;
48 esac
49 case "${libpath+X}" in
50 X) libpath=$libpath:$option;;
51 *) libpath=$option;;
52 esac
53 shift
54 done
55 shift # remove the trailing ---
57 case `uname -s` in
58 Darwin) case "${DYLD_LIBRARY_PATH+X}" in
59 X) DYLD_LIBRARY_PATH=$libpath:$DYLD_LIBRARY_PATH;;
60 *) DYLD_LIBRARY_PATH=$libpath;;
61 esac
62 export DYLD_LIBRARY_PATH;;
63 IRIX) case "${LD_LIBRARYN32_PATH+X}" in
64 X) LD_LIBRARYN32_PATH=$libpath:$LD_LIBRARYN32_PATH;;
65 *) LD_LIBRARYN32_PATH=$libpath;;
66 esac
67 export LD_LIBRARYN32_PATH;;
68 IRIX64) case "${LD_LIBRARYN32_PATH+X}" in
69 X) LD_LIBRARYN32_PATH=$libpath:$LD_LIBRARYN32_PATH;;
70 *) LD_LIBRARYN32_PATH=$libpath;;
71 esac
72 export LD_LIBRARYN32_PATH;;
73 *) case "${LD_LIBRARY_PATH+X}" in
74 X) LD_LIBRARY_PATH=$libpath:$LD_LIBRARY_PATH;;
75 *) LD_LIBRARY_PATH=$libpath;;
76 esac
77 export LD_LIBRARY_PATH;;
78 esac
80 $checkdll "$@"
81 if [ $? -ne 0 ]; then exit 1 ; fi
83 for parameter in $*; do
84 library=$parameter;
85 done
86 realname=`echo $library | sed "s/check_//"`
87 if [ $library != $realname ]; then
88 LD_LIBRARY_PATH=
89 export LD_LIBRARY_PATH
90 mv $library $realname
92 else
93 echo "WARNING: checkdll not found!" 1>&2
96 exit 0