You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2001/12/06 18:52:07 UTC

[PATCH] script to install Apache DSOs

Jeff Trawick <tr...@attglobal.net> writes:

> On some platforms, we get some unexpected names for DSO files because
> of the way libtool works.
> 
> While normally we expect mod_foo.so...
> 
> Tru64:   libmod_foo.so
> AIX:     libmod_foo.a(libmod_foo.so.0)  
>          (not just a name change; archive library is used)
> HP-UX:   mod_foo.sl

With the new shell script in this patch, we have a place to fix-up
libtool-isms so that the normal LoadModule statement works.  This
version of the script fixes up the install on AIX, HP-UX, and Tru64.

Beyond the function in this patch, the next step is to have it
installed in prefix/build and teach apxs to use instdso when it
installs DSOs.

I have only tested this on AIX thus far.  I hesitate to test it much
further before people have a chance to comment on things they might
not like.

Have fun...

? build/instdso

#!/bin/sh
#
# instdso - install Apache DSO modules
#
# usually this just passes through to libtool but on a few
# platforms libtool doesn't install DSOs exactly like we'd want, 
# so more effort is required

ALLARGS=$*
LASTARG=$#
eval TARGETDIR=\$$argv$LASTARG
LASTARG=`expr $LASTARG - 1`
eval DSOARCHIVE=\$$argv$LASTARG
DSOBASE=`echo $DSOARCHIVE | sed s/\.la$//`
TARGET_NAME="$DSOBASE.so"

# special logic for systems where libtool doesn't install
# the DSO exactly like we'd want

SYS=`uname -s`
case $SYS in
    AIX)
        # 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"
        echo $CMD
        $CMD || exit $?
        CMD="cp .libs/lib$DSOBASE.so.0 $TARGETDIR/$TARGET_NAME"
        echo $CMD
        $CMD || exit $?
        ;;
    HP-UX)
        CMD="cp .libs/$DSOBASE.sl $TARGETDIR/$TARGET_NAME"
        echo $CMD
        $CMD || exit $?
        ;;
    OSF1)
        CMD="cp .libs/lib$DSOBASE.so $TARGETDIR/$TARGET_NAME"
        echo $CMD
        $CMD || exit $?
        ;;
    *)
        CMD=$ALLARGS
        echo $CMD
        $CMD || exit $?
        ;;
esac

exit 0

Index: build/special.mk
===================================================================
RCS file: /cvs/apache/httpd-2.0/build/special.mk,v
retrieving revision 1.16
diff -u -r1.16 special.mk
--- special.mk	2001/10/16 17:51:11	1.16
+++ special.mk	2001/12/06 17:43:14
@@ -68,7 +68,7 @@
 	if [ "x$$has_mod_so" = "xhas_mod_so" ]; then \
 		list='$(shared)'; \
 		for i in $$list; do \
-			$(SH_LIBTOOL) --mode=install cp $$i $(libexecdir); \
+			$(top_builddir)/build/instdso $(SH_LIBTOOL) $$i $(libexecdir); \
 		done; \
 	fi	

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...