3 [ $# -ne 0 ] ||
set -x # debug mode without arguments:-)
5 THERE
="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."
6 [ -d "${THERE}" ] ||
exec "$@" # should never happen...
8 # Alternative to this is to parse ${THERE}/Makefile...
9 LIBCRYPTOSO
="${THERE}/libcrypto.so"
10 if [ -f "$LIBCRYPTOSO" ]; then
11 while [ -h "$LIBCRYPTOSO" ]; do
12 LIBCRYPTOSO
="${THERE}/`ls -l "$LIBCRYPTOSO" | sed -e 's|.*\-> ||'`"
14 SOSUFFIX
=`echo ${LIBCRYPTOSO} | sed -e 's|.*\.so||' 2>/dev/null`
15 LIBSSLSO
="${THERE}/libssl.so${SOSUFFIX}"
18 SYSNAME
=`(uname -s) 2>/dev/null`;
21 # SunOS and IRIX run-time linkers evaluate alternative
22 # variables depending on target ABI...
23 rld_var
=LD_LIBRARY_PATH
24 case "`(/usr/bin/file "$LIBCRYPTOSO") 2>/dev/null`" in
26 [ -n "$LD_LIBRARY_PATH_64" ] && rld_var
=LD_LIBRARY_PATH_64
29 [ -n "$LD_LIBRARYN32_PATH" ] && rld_var
=LD_LIBRARYN32_PATH
30 _RLDN32_LIST
="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLDN32_LIST
33 [ -n "$LD_LIBRARY64_PATH" ] && rld_var
=LD_LIBRARY64_PATH
34 _RLD64_LIST
="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLD64_LIST
37 eval $rld_var=\"${THERE}:'$'$rld_var\"; export $rld_var
40 *) LD_LIBRARY_PATH
="${THERE}:$LD_LIBRARY_PATH" # Linux, ELF HP-UX
41 DYLD_LIBRARY_PATH
="${THERE}:$DYLD_LIBRARY_PATH" # MacOS X
42 SHLIB_PATH
="${THERE}:$SHLIB_PATH" # legacy HP-UX
43 LIBPATH
="${THERE}:$LIBPATH" # AIX, OS/2
44 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
45 # Even though $PATH is adjusted [for Windows sake], it doesn't
46 # necessarily does the trick. Trouble is that with introduction
47 # of SafeDllSearchMode in XP/2003 it's more appropriate to copy
48 # .DLLs in vicinity of executable, which is done elsewhere...
49 if [ "$OSTYPE" != msdosdjgpp
]; then
50 PATH
="${THERE}:$PATH"; export PATH
55 if [ -f "$LIBCRYPTOSO" ]; then
56 # Following three lines are major excuse for isolating them into
57 # this wrapper script. Original reason for setting LD_PRELOAD
58 # was to make it possible to pass 'make test' when user linked
59 # with -rpath pointing to previous version installation. Wrapping
60 # it into a script makes it possible to do so on multi-ABI
63 *BSD
) LD_PRELOAD
="$LIBCRYPTOSO:$LIBSSLSO" ;; # *BSD
64 *) LD_PRELOAD
="$LIBCRYPTOSO $LIBSSLSO" ;; # SunOS, Linux, ELF HP-UX
66 _RLD_LIST
="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT" # Tru64, o32 IRIX
67 export LD_PRELOAD _RLD_LIST