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