diff --git a/Makefile.org b/Makefile.org index 65ee439bff..a381960801 100644 --- a/Makefile.org +++ b/Makefile.org @@ -410,6 +410,10 @@ rehash.time: certs LIBPATH="`pwd`:$$LIBPATH"; \ if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + if [ -n "$(SHARED_LIBS)" ]; then \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_PRELOAD; \ + fi; \ $(PERL) tools/c_rehash certs) touch rehash.time @@ -424,6 +428,10 @@ tests: rehash LIBPATH="`pwd`:$$LIBPATH"; \ if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + if [ -n "$(SHARED_LIBS)" ]; then \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_PRELOAD; \ + fi; \ apps/openssl version -a report: diff --git a/apps/Makefile.ssl b/apps/Makefile.ssl index 4f9ae326be..e7bb8d7649 100644 --- a/apps/Makefile.ssl +++ b/apps/Makefile.ssl @@ -176,6 +176,10 @@ $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL) LIBPATH="`pwd`:$$LIBPATH"; \ if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + if [ -n "$(SHARED_LIBS)" ]; then \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_PRELOAD; \ + fi; \ $(PERL) tools/c_rehash certs) progs.h: progs.pl diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 1dc1edf997..09110f3caa 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -136,9 +136,12 @@ SET_SO_PATHS=OSSL_LIBPATH="`cd ..; pwd`"; \ DYLD_LIBRARY_PATH="$$OSSL_LIBPATH:$$DYLD_LIBRARY_PATH"; \ SHLIB_PATH="$$OSSL_LIBPATH:$$SHLIB_PATH"; \ LIBPATH="$$OSSL_LIBPATH:$$LIBPATH"; \ - LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="$${LIBPATH}:$$PATH"; fi; \ - export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH LD_PRELOAD + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + if [ -n "$(SHARED_LIBS)" ]; then \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_PRELOAD; \ + fi alltests: \ test_des test_idea test_sha test_md4 test_md5 test_hmac \