summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in22
-rwxr-xr-xbuild/install.sh76
-rwxr-xr-xbuild/instdso.sh34
-rw-r--r--build/special.mk4
4 files changed, 73 insertions, 63 deletions
diff --git a/Makefile.in b/Makefile.in
index 39a1b2e11a..31a59fc131 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -102,16 +102,14 @@ build/config_vars.out: build/config_vars.mk
@$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
install-build: build/config_vars.out
- @echo Installing build system files
- @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
- @for f in $(top_srcdir)/build/*.mk build/*.mk; do \
- $(INSTALL_DATA) $$f $(DESTDIR)$(installbuilddir); \
- done
- @for f in $(top_builddir)/config.nice \
- $(top_srcdir)/build/mkdir.sh \
- $(top_srcdir)/build/instdso.sh; do \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(installbuilddir); \
- done
+ @echo Installing build system files
+ @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
+ @$(INSTALL_DATA) $(top_srcdir)/build/*.mk build/*.mk \
+ $(DESTDIR)$(installbuilddir)
+ @$(INSTALL_PROGRAM) $(top_builddir)/config.nice \
+ $(top_srcdir)/build/mkdir.sh \
+ $(top_srcdir)/build/instdso.sh \
+ $(DESTDIR)$(installbuilddir)
@$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
@rm build/config_vars.out
@@ -218,9 +216,7 @@ INSTALL_HEADERS = \
install-include:
@echo Installing header files
@$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
- @for hdr in $(INSTALL_HEADERS); do \
- $(INSTALL_DATA) $$hdr $(DESTDIR)$(includedir); \
- done
+ @$(INSTALL_DATA) $(INSTALL_HEADERS) $(DESTDIR)$(includedir)
install-man:
@echo Installing man pages and online manual
diff --git a/build/install.sh b/build/install.sh
index c5d20dac6b..21bc16c2d2 100755
--- a/build/install.sh
+++ b/build/install.sh
@@ -71,53 +71,57 @@ while [ "x$1" != "x" ]; do
-e) ext="$2"
shift; shift; continue
;;
- *) if [ "x$src" = "x" ]; then
- src=$1
- else
- dst=$1
- fi
- shift; continue
+ *) break
;;
esac
done
-if [ "x$src" = "x" ]; then
- echo "install.sh: no input file specified"
- exit 1
+if test $# -eq 0 ; then
+ echo "install.sh: no input file(s) specified"
+ exit 1
fi
-if [ "x$dst" = "x" ]; then
- echo "install.sh: no destination specified"
- exit 1
+if test $# -eq 1 ; then
+ echo "install.sh: no destination specified"
+ exit 1
fi
+for arg ; do
+ dstarg="$arg"
+done
-#
-# If destination is a directory, append the input filename; if
-# your system does not like double slashes in filenames, you may
-# need to add some logic
-#
-if [ -d $dst ]; then
- dst="$dst/`basename $src`"
-fi
+while test $# -gt 1 ; do
+ dst="$dstarg"
+ src="$1"
+ shift
+ #
+ # If destination is a directory, append the input filename; if
+ # your system does not like double slashes in filenames, you may
+ # need to add some logic
+ #
+ if [ -d $dst ]; then
+ dst="$dst/`basename $src`"
+ fi
+
+ # Add a possible extension (such as ".exe") to src and dst
+ src="$src$ext"
+ dst="$dst$ext"
-# Add a possible extension (such as ".exe") to src and dst
-src="$src$ext"
-dst="$dst$ext"
+ # Make a temp file name in the proper directory.
+ dstdir=`dirname $dst`
+ dsttmp=$dstdir/#inst.$$#
-# Make a temp file name in the proper directory.
-dstdir=`dirname $dst`
-dsttmp=$dstdir/#inst.$$#
+ # Move or copy the file name to the temp name
+ $instcmd $src $dsttmp
-# Move or copy the file name to the temp name
-$instcmd $src $dsttmp
+ # And set any options; do chmod last to preserve setuid bits
+ if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi
+ if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi
+ if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi
+ if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
-# And set any options; do chmod last to preserve setuid bits
-if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi
-if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi
-if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi
-if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
+ # Now rename the file to the real destination.
+ $rmcmd $dst
+ $mvcmd $dsttmp $dst
-# Now rename the file to the real destination.
-$rmcmd $dst
-$mvcmd $dsttmp $dst
+done
exit 0
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
diff --git a/build/special.mk b/build/special.mk
index 38e7a864fd..66c9c7c8ce 100644
--- a/build/special.mk
+++ b/build/special.mk
@@ -28,9 +28,7 @@ include $(top_builddir)/build/rules.mk
install-modules-yes: $(SHARED_TARGETS)
@$(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
- @list='$(shared)'; for i in $$list; do \
- $(top_srcdir)/build/instdso.sh SH_LIBTOOL='$(SH_LIBTOOL)' $$i $(DESTDIR)$(libexecdir); \
- done
+ @$(top_srcdir)/build/instdso.sh SH_LIBTOOL='$(SH_LIBTOOL)' $(shared) $(DESTDIR)$(libexecdir)
install-modules-no: