Commit 635e4908 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

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
parent 7e75ec94
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -104,14 +104,12 @@ build/config_vars.out: build/config_vars.mk
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 \
	@$(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; do \
	 $(INSTALL_PROGRAM) $$f $(DESTDIR)$(installbuilddir); \
	done
		$(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
+40 −36
Original line number Diff line number Diff line
@@ -71,24 +71,26 @@ 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"
if test $# -eq 0 ; then
    echo "install.sh: no input file(s) specified"
    exit 1
fi
if [ "x$dst" = "x" ]; then
if test $# -eq 1 ; then
    echo "install.sh: no destination specified"
    exit 1
fi
for arg ; do
    dstarg="$arg"
done

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
@@ -119,5 +121,7 @@ if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
    $rmcmd $dst
    $mvcmd $dsttmp $dst

done

exit 0
+23 −11
Original line number Diff line number Diff line
@@ -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
+1 −3
Original line number Diff line number Diff line
@@ -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: