summaryrefslogtreecommitdiff
path: root/build/instdso.sh
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2012-01-29 20:11:55 +0000
committerStefan Fritsch <sf@apache.org>2012-01-29 20:11:55 +0000
commit4fca50f99735e584ba76d507a9343be791f5d024 (patch)
tree449c517ef54610b0195148bccc53481a485a0c4c /build/instdso.sh
parent95fba12ad8f284926bec1922cc06b1c70ac15089 (diff)
downloadhttpd-4fca50f99735e584ba76d507a9343be791f5d024.tar.gz
Install multiple files per install.sh invocation
Libtool and BSD install support installing several files in one run. Add support to install.sh and instdso.sh, too. Replace for-loops in the Makefiles. This reduces 'make install' time by approx. 50% because we save lots of calls to the huge libtool shell script. The AIX-specific magic in instdso.sh could use some testing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1237447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/instdso.sh')
-rwxr-xr-xbuild/instdso.sh34
1 files changed, 23 insertions, 11 deletions
diff --git a/build/instdso.sh b/build/instdso.sh
index 3ca52722c3..405b304c9a 100755
--- a/build/instdso.sh
+++ b/build/instdso.sh
@@ -24,18 +24,19 @@
# 2) we never want the .la files copied, so we might as well copy
# the .so files ourselves
-if test "$#" != "3"; then
- echo "wrong number of arguments to instdso.sh"
- echo "Usage: instdso.sh SH_LIBTOOL-value dso-name path-to-modules"
+if test "$#" -lt "3"; then
+ echo "too few arguments to instdso.sh"
+ echo "Usage: instdso.sh SH_LIBTOOL-value dso-name [dso-name [...]] path-to-modules"
exit 1
fi
SH_LIBTOOL=`echo $1 | sed -e 's/^SH_LIBTOOL=//'`
-DSOARCHIVE=$2
-DSOARCHIVE_BASENAME=`basename $2`
-TARGETDIR=$3
-DSOBASE=`echo $DSOARCHIVE_BASENAME | sed -e 's/\.la$//'`
-TARGET_NAME="$DSOBASE.so"
+shift
+# get last arg
+for arg ; do
+ DSOARCHIVES="$DSOARCHIVES $TARGETDIR"
+ TARGETDIR=$arg
+done
SYS=`uname -s`
@@ -44,7 +45,11 @@ then
# on AIX, shared libraries remain in storage even when
# all processes using them have exited; standard practice
# prior to installing a shared library is to rm -f first
- CMD="rm -f $TARGETDIR/$TARGET_NAME"
+ CMD="rm -f"
+ for DSOARCHIVE in $DSOARCHIVES ; do
+ DSOBASE=`basename $DSOARCHIVE|sed -e 's/\.la$//'`
+ CMD="$CMD $TARGETDIR/$DSOBASE.so"
+ done
echo $CMD
$CMD || exit $?
fi
@@ -58,7 +63,7 @@ case $SYS in
;;
esac
-CMD="$SH_LIBTOOL --mode=install $INSTALL_CMD $DSOARCHIVE $TARGETDIR/"
+CMD="$SH_LIBTOOL --mode=install $INSTALL_CMD $DSOARCHIVES $TARGETDIR/"
echo $CMD
$CMD || exit $?
@@ -70,6 +75,11 @@ then
exit 0
fi
+for DSOARCHIVE in $DSOARCHIVES ; do
+DSOARCHIVE_BASENAME=`basename $DSOARCHIVE`
+DSOBASE=`echo $DSOARCHIVE_BASENAME | sed -e 's/\.la$//'`
+TARGET_NAME="$DSOBASE.so"
+
if test -s "$TARGETDIR/$DSOARCHIVE_BASENAME"
then
DLNAME=`sed -n "/^dlname=/{s/.*='\([^']*\)'/\1/;p;}" $TARGETDIR/$DSOARCHIVE_BASENAME`
@@ -81,7 +91,7 @@ if test -z "$DLNAME"
then
echo "Warning! dlname not found in $TARGETDIR/$DSOARCHIVE_BASENAME."
echo "Assuming installing a .so rather than a libtool archive."
- exit 0
+ continue
fi
if test -n "$LIBRARY_NAMES"
@@ -102,4 +112,6 @@ rm -f $TARGETDIR/$DSOBASE.a
rm -f $TARGETDIR/lib$DSOBASE.a
rm -f $TARGETDIR/lib$TARGET_NAME
+done
+
exit 0