xref: /minix3/crypto/external/bsd/openssl/dist/util/opensslwrap.sh (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc#!/bin/sh
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel SambucHERE="`echo $0 | sed -e 's|[^/]*$||'`"
4*ebfedea0SLionel SambucOPENSSL="${HERE}../apps/openssl"
5*ebfedea0SLionel Sambuc
6*ebfedea0SLionel Sambucif [ -d "${HERE}../engines" -a "x$OPENSSL_ENGINES" = "x" ]; then
7*ebfedea0SLionel Sambuc	OPENSSL_ENGINES="${HERE}../engines"; export OPENSSL_ENGINES
8*ebfedea0SLionel Sambucfi
9*ebfedea0SLionel Sambuc
10*ebfedea0SLionel Sambucif [ -x "${OPENSSL}.exe" ]; then
11*ebfedea0SLionel Sambuc	# The original reason for this script existence is to work around
12*ebfedea0SLionel Sambuc	# certain caveats in run-time linker behaviour. On Windows platforms
13*ebfedea0SLionel Sambuc	# adjusting $PATH used to be sufficient, but with introduction of
14*ebfedea0SLionel Sambuc	# SafeDllSearchMode in XP/2003 the only way to get it right in
15*ebfedea0SLionel Sambuc	# *all* possible situations is to copy newly built .DLLs to apps/
16*ebfedea0SLionel Sambuc	# and test/, which is now done elsewhere... The $PATH is adjusted
17*ebfedea0SLionel Sambuc	# for backward compatibility (and nostagical reasons:-).
18*ebfedea0SLionel Sambuc	if [ "$OSTYPE" != msdosdjgpp ]; then
19*ebfedea0SLionel Sambuc		PATH="${HERE}..:$PATH"; export PATH
20*ebfedea0SLionel Sambuc	fi
21*ebfedea0SLionel Sambuc	exec "${OPENSSL}.exe" "$@"
22*ebfedea0SLionel Sambucelif [ -x "${OPENSSL}" -a -x "${HERE}shlib_wrap.sh" ]; then
23*ebfedea0SLionel Sambuc	exec "${HERE}shlib_wrap.sh" "${OPENSSL}" "$@"
24*ebfedea0SLionel Sambucelse
25*ebfedea0SLionel Sambuc	exec "${OPENSSL}" "$@"	# hope for the best...
26*ebfedea0SLionel Sambucfi
27