shlib_wrap.sh update [from HEAD].
authorAndy Polyakov <appro@openssl.org>
Mon, 16 Jul 2007 14:02:12 +0000 (14:02 +0000)
committerAndy Polyakov <appro@openssl.org>
Mon, 16 Jul 2007 14:02:12 +0000 (14:02 +0000)
util/shlib_wrap.sh

index dc5f5b1ce4802820a07c14136e55a5fc974f78a6..3866e1851a1c541117418136bc952a6901a5ab5b 100755 (executable)
@@ -22,16 +22,20 @@ SunOS|IRIX*)
        # variables depending on target ABI...
        rld_var=LD_LIBRARY_PATH
        case "`(/usr/bin/file "$LIBCRYPTOSO") 2>/dev/null`" in
-       *ELF\ 64*SPARC*)
+       *ELF\ 64*SPARC*|*ELF\ 64*AMD64*)
                [ -n "$LD_LIBRARY_PATH_64" ] && rld_var=LD_LIBRARY_PATH_64
+               LD_PRELOAD_64="$LIBCRYPTOSO $LIBSSLSO"; export LD_PRELOAD_64
+               preload_var=LD_PRELOAD_64
                ;;
        *ELF\ N32*MIPS*)
                [ -n "$LD_LIBRARYN32_PATH" ] && rld_var=LD_LIBRARYN32_PATH
                _RLDN32_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLDN32_LIST
+               preload_var=_RLDN32_LIST
                ;;
        *ELF\ 64*MIPS*)
                [ -n "$LD_LIBRARY64_PATH"  ] && rld_var=LD_LIBRARY64_PATH
                _RLD64_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLD64_LIST
+               preload_var=_RLD64_LIST
                ;;
        esac
        eval $rld_var=\"${THERE}:'$'$rld_var\"; export $rld_var
@@ -52,7 +56,7 @@ SunOS|IRIX*)
        ;;
 esac
 
-if [ -f "$LIBCRYPTOSO" ]; then
+if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
        # Following three lines are major excuse for isolating them into
        # this wrapper script. Original reason for setting LD_PRELOAD
        # was to make it possible to pass 'make test' when user linked
@@ -64,7 +68,8 @@ if [ -f "$LIBCRYPTOSO" ]; then
        *)      LD_PRELOAD="$LIBCRYPTOSO $LIBSSLSO" ;;  # SunOS, Linux, ELF HP-UX
        esac
        _RLD_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"      # Tru64, o32 IRIX
-       export LD_PRELOAD _RLD_LIST
+       DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO"  # MacOS X
+       export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
 fi
 
 exec "$@"