~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to build/instdso.sh

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Licensed to the Apache Software Foundation (ASF) under one or more
 
4
# contributor license agreements.  See the NOTICE file distributed with
 
5
# this work for additional information regarding copyright ownership.
 
6
# The ASF licenses this file to You under the Apache License, Version 2.0
 
7
# (the "License"); you may not use this file except in compliance with
 
8
# the License.  You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# Unless required by applicable law or agreed to in writing, software
 
13
# distributed under the License is distributed on an "AS IS" BASIS,
 
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
15
# See the License for the specific language governing permissions and
 
16
# limitations under the License.
 
17
#
 
18
#
 
19
# instdso.sh - install Apache DSO modules
 
20
#
 
21
# we use this instead of libtool --install because:
 
22
# 1) on a few platforms libtool doesn't install DSOs exactly like we'd
 
23
#    want (weird names, doesn't remove DSO first)
 
24
# 2) we never want the .la files copied, so we might as well copy
 
25
#    the .so files ourselves
 
26
 
 
27
if test "$#" != "3"; then
 
28
    echo "wrong number of arguments to instdso.sh"
 
29
    echo "Usage: instdso.sh SH_LIBTOOL-value dso-name path-to-modules"
 
30
    exit 1
 
31
fi
 
32
 
 
33
SH_LIBTOOL=`echo $1 | sed -e 's/^SH_LIBTOOL=//'`
 
34
DSOARCHIVE=$2
 
35
DSOARCHIVE_BASENAME=`basename $2`
 
36
TARGETDIR=$3
 
37
DSOBASE=`echo $DSOARCHIVE_BASENAME | sed -e 's/\.la$//'`
 
38
TARGET_NAME="$DSOBASE.so"
 
39
 
 
40
SYS=`uname -s`
 
41
 
 
42
if test "$SYS" = "AIX"
 
43
then
 
44
    # on AIX, shared libraries remain in storage even when
 
45
    # all processes using them have exited; standard practice
 
46
    # prior to installing a shared library is to rm -f first
 
47
    CMD="rm -f $TARGETDIR/$TARGET_NAME"
 
48
    echo $CMD
 
49
    $CMD || exit $?
 
50
fi
 
51
 
 
52
CMD="$SH_LIBTOOL --mode=install cp $DSOARCHIVE $TARGETDIR/"
 
53
echo $CMD
 
54
$CMD || exit $?
 
55
 
 
56
if test "$SYS" = "OS/2"
 
57
then
 
58
    # on OS/2, aplibtool --install doesn't copy the .la files & we can't
 
59
    # rename DLLs to have a .so extension or they won't load so none of the 
 
60
    # steps below make sense.
 
61
    exit 0
 
62
fi
 
63
 
 
64
DLNAME=`sed -n "/^dlname=/{s/.*='\([^']*\)'/\1/;p;}" $TARGETDIR/$DSOARCHIVE_BASENAME`
 
65
LIBRARY_NAMES=`sed -n "/^library_names/{s/library_names='\([^']*\)'/\1/;p;}" $TARGETDIR/$DSOARCHIVE_BASENAME`
 
66
LIBRARY_NAMES=`echo $LIBRARY_NAMES | sed -e "s/ *$DLNAME//g"`
 
67
 
 
68
if test -z "$DLNAME"
 
69
then
 
70
  echo "Warning!  dlname not found in $TARGETDIR/$DSOARCHIVE_BASENAME."
 
71
  echo "Assuming installing a .so rather than a libtool archive."
 
72
  exit 0
 
73
fi
 
74
 
 
75
if test -n "$LIBRARY_NAMES"
 
76
then
 
77
    for f in $LIBRARY_NAMES
 
78
    do
 
79
        rm -f $TARGETDIR/$f
 
80
    done
 
81
fi
 
82
 
 
83
if test "$DLNAME" != "$TARGET_NAME"
 
84
then
 
85
    mv $TARGETDIR/$DLNAME $TARGETDIR/$TARGET_NAME
 
86
fi
 
87
 
 
88
rm -f $TARGETDIR/$DSOARCHIVE_BASENAME
 
89
rm -f $TARGETDIR/$DSOBASE.a
 
90
rm -f $TARGETDIR/lib$DSOBASE.a
 
91
rm -f $TARGETDIR/lib$TARGET_NAME
 
92
 
 
93
exit 0