Deleted Added
full compact
shlib_wrap.sh.in (1.1.1.4) shlib_wrap.sh.in (1.1.1.1)
1#!/bin/sh
1#!/bin/sh
2{-
3 use lib '.';
4 use configdata;
5
2
6 sub shlib {
7 my $lib = shift;
8 return "" if $disabled{shared};
9 $lib = $unified_info{rename}->{$lib}
10 if defined $unified_info{rename}->{$lib};
11 $lib = $unified_info{sharednames}->{$lib}
12 . ($target{shlib_variant} || "")
13 . ($target{shared_extension} || ".so");
14 $lib =~ s|\.\$\(SHLIB_VERSION_NUMBER\)
15 |.$config{shlib_version_number}|x;
16 return $lib;
17 }
18 ""; # Make sure no left over string sneaks its way into the script
19-}
20# To test this OpenSSL version's applications against another version's
21# shared libraries, simply set
22#
23# OPENSSL_REGRESSION=/path/to/other/OpenSSL/build/tree
24if [ -n "$OPENSSL_REGRESSION" ]; then
25 shlibwrap="$OPENSSL_REGRESSION/util/shlib_wrap.sh"
26 if [ -x "$shlibwrap" ]; then
27 # We clear OPENSSL_REGRESSION to avoid a loop, should the shlib_wrap.sh
28 # we exec also support that mechanism...
29 OPENSSL_REGRESSION= exec "$shlibwrap" "$@"
30 else
31 if [ -f "$shlibwrap" ]; then
32 echo "Not permitted to run $shlibwrap" >&2
33 else
34 echo "No $shlibwrap, perhaps OPENSSL_REGRESSION isn't properly set?" >&2
35 fi
36 exit 1
37 fi
38fi
39
40[ $# -ne 0 ] || set -x # debug mode without arguments:-)
41
42THERE="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."
43[ -d "${THERE}" ] || exec "$@" # should never happen...
44
3[ $# -ne 0 ] || set -x # debug mode without arguments:-)
4
5THERE="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."
6[ -d "${THERE}" ] || exec "$@" # should never happen...
7
45LIBCRYPTOSO="${THERE}/{- shlib('libcrypto') -}"
46LIBSSLSO="${THERE}/{- shlib('libssl') -}"
8# Alternative to this is to parse ${THERE}/Makefile...
9LIBCRYPTOSO="${THERE}/libcrypto.so"
10if [ -f "$LIBCRYPTOSO" ]; then
11 while [ -h "$LIBCRYPTOSO" ]; do
12 LIBCRYPTOSO="${THERE}/`ls -l "$LIBCRYPTOSO" | sed -e 's|.*\-> ||'`"
13 done
14 SOSUFFIX=`echo ${LIBCRYPTOSO} | sed -e 's|.*\.so||' 2>/dev/null`
15 LIBSSLSO="${THERE}/libssl.so${SOSUFFIX}"
16fi
47
48SYSNAME=`(uname -s) 2>/dev/null`;
49case "$SYSNAME" in
50SunOS|IRIX*)
51 # SunOS and IRIX run-time linkers evaluate alternative
52 # variables depending on target ABI...
53 rld_var=LD_LIBRARY_PATH
54 case "`(/usr/bin/file "$LIBCRYPTOSO") 2>/dev/null`" in

--- 51 unchanged lines hidden (view full) ---

106 # of SafeDllSearchMode in XP/2003 it's more appropriate to copy
107 # .DLLs in vicinity of executable, which is done elsewhere...
108 if [ "$OSTYPE" != msdosdjgpp ]; then
109 PATH="${THERE}:$PATH"; export PATH
110 fi
111 ;;
112esac
113
17
18SYSNAME=`(uname -s) 2>/dev/null`;
19case "$SYSNAME" in
20SunOS|IRIX*)
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

--- 51 unchanged lines hidden (view full) ---

76 # of SafeDllSearchMode in XP/2003 it's more appropriate to copy
77 # .DLLs in vicinity of executable, which is done elsewhere...
78 if [ "$OSTYPE" != msdosdjgpp ]; then
79 PATH="${THERE}:$PATH"; export PATH
80 fi
81 ;;
82esac
83
114{- output_off() unless grep (/-rpath\b/, @{$config{LDFLAGS}}); ""; -}
84{- output_off() if $config{ex_libs} !~ /,-rpath,/; ""; -}
115if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
116 # Following three lines are major excuse for isolating them into
117 # this wrapper script. Original reason for setting LD_PRELOAD
118 # was to make it possible to pass 'make test' when user linked
119 # with -rpath pointing to previous version installation. Wrapping
120 # it into a script makes it possible to do so on multi-ABI
121 # platforms.
122 case "$SYSNAME" in
85if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
86 # Following three lines are major excuse for isolating them into
87 # this wrapper script. Original reason for setting LD_PRELOAD
88 # was to make it possible to pass 'make test' when user linked
89 # with -rpath pointing to previous version installation. Wrapping
90 # it into a script makes it possible to do so on multi-ABI
91 # platforms.
92 case "$SYSNAME" in
123 *BSD) LD_PRELOAD="$LIBCRYPTOSO:$LIBSSLSO" ;; # *BSD
93 *BSD|QNX) LD_PRELOAD="$LIBCRYPTOSO:$LIBSSLSO" ;; # *BSD, QNX
124 *) LD_PRELOAD="$LIBCRYPTOSO $LIBSSLSO" ;; # SunOS, Linux, ELF HP-UX
125 esac
126 _RLD_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT" # Tru64, o32 IRIX
127 DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO" # MacOS X
128 export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
129fi
94 *) LD_PRELOAD="$LIBCRYPTOSO $LIBSSLSO" ;; # SunOS, Linux, ELF HP-UX
95 esac
96 _RLD_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT" # Tru64, o32 IRIX
97 DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO" # MacOS X
98 export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
99fi
130{- output_on() unless grep (/-rpath\b/, @{$config{LDFLAGS}}); ""; -}
100{- output_on() if $config{ex_libs} !~ /,-rpath,/; ""; -}
131
132cmd="$1"; [ -x "$cmd" ] || cmd="$cmd${EXE_EXT}"
133shift
134if [ $# -eq 0 ]; then
135 exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
136else
137 exec "$cmd" "$@"
138fi
101
102cmd="$1"; [ -x "$cmd" ] || cmd="$cmd${EXE_EXT}"
103shift
104if [ $# -eq 0 ]; then
105 exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
106else
107 exec "$cmd" "$@"
108fi