From: Richard Levitte Date: Thu, 11 Nov 2004 18:18:43 +0000 (+0000) Subject: Some find it confusing that environment variables are set when shared X-Git-Tag: BEN_FIPS_TEST_6~14^2~48 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69c922f5d27ea1fef4f67ed8b143540b0e33c364;p=oweals%2Fopenssl.git Some find it confusing that environment variables are set when shared libraries aren't built or used. I can see the point, so I'm reorganising a little for clarity. --- diff --git a/Makefile.org b/Makefile.org index a381960801..8059909453 100644 --- a/Makefile.org +++ b/Makefile.org @@ -403,18 +403,20 @@ dclean: rehash: rehash.time rehash.time: certs @(OPENSSL="`pwd`/apps/openssl$(EXE_EXT)"; OPENSSL_DEBUG_MEMORY=on; \ - export OPENSSL OPENSSL_DEBUG_MEMORY; \ - LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ - DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ - SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ - 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) + export OPENSSL OPENSSL_DEBUG_MEMORY; \ + if [ -n "$(SHARED_LIBS)" ]; then \ + LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ + DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ + SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ + LIBPATH="`pwd`:$$LIBPATH"; \ + if [ "$(PLATFORM)" = "Cygwin" ]; then \ + PATH="`pwd`:$$PATH"; \ + fi; \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + export LD_PRELOAD; \ + fi; \ + $(PERL) tools/c_rehash certs) touch rehash.time test: tests @@ -422,14 +424,14 @@ test: tests tests: rehash @(cd test && echo "testing..." && \ $(MAKE) $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests ); - @LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ - DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ - SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ - 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 \ + @if [ -n "$(SHARED_LIBS)" ]; then \ + LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ + DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ + SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ + LIBPATH="`pwd`:$$LIBPATH"; \ + if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \ LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ export LD_PRELOAD; \ fi; \ apps/openssl version -a diff --git a/apps/Makefile.ssl b/apps/Makefile.ssl index e7bb8d7649..b85c675b50 100644 --- a/apps/Makefile.ssl +++ b/apps/Makefile.ssl @@ -169,18 +169,21 @@ $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL) LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ LIBRPATH=$(INSTALLTOP)/lib \ link_app.$${shlib_target} - -(cd ..; OPENSSL="`pwd`/apps/$(EXE)"; export OPENSSL; \ - LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ - DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ - SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ - 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) + -(cd ..; + if [ -n "$(SHARED_LIBS)" ]; then \ + OPENSSL="`pwd`/apps/$(EXE)"; export OPENSSL; \ + LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ + DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ + SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ + LIBPATH="`pwd`:$$LIBPATH"; \ + if [ "$(PLATFORM)" = "Cygwin" ]; then \ + PATH="`pwd`:$$PATH"; \ + fi; \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + export LD_PRELOAD; \ + fi; \ + $(PERL) tools/c_rehash certs) progs.h: progs.pl $(PERL) progs.pl $(E_EXE) >progs.h diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 09110f3caa..f3a7b58f4c 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -131,17 +131,20 @@ tests: exe apps $(TESTS) apps: @(cd ..; $(MAKE) DIRS=apps all) -SET_SO_PATHS=OSSL_LIBPATH="`cd ..; pwd`"; \ - LD_LIBRARY_PATH="$$OSSL_LIBPATH:$$LD_LIBRARY_PATH"; \ - DYLD_LIBRARY_PATH="$$OSSL_LIBPATH:$$DYLD_LIBRARY_PATH"; \ - SHLIB_PATH="$$OSSL_LIBPATH:$$SHLIB_PATH"; \ - LIBPATH="$$OSSL_LIBPATH:$$LIBPATH"; \ - if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="$${LIBPATH}:$$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 +SET_SO_PATHS=\ + if [ -n "$(SHARED_LIBS)" ]; then \ + OSSL_LIBPATH="`cd ..; pwd`"; \ + LD_LIBRARY_PATH="$$OSSL_LIBPATH:$$LD_LIBRARY_PATH"; \ + DYLD_LIBRARY_PATH="$$OSSL_LIBPATH:$$DYLD_LIBRARY_PATH"; \ + SHLIB_PATH="$$OSSL_LIBPATH:$$SHLIB_PATH"; \ + LIBPATH="$$OSSL_LIBPATH:$$LIBPATH"; \ + if [ "$(PLATFORM)" = "Cygwin" ]; then \ + PATH="$${LIBPATH}:$$PATH"; \ + fi; \ + LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ + export LD_PRELOAD; \ + fi alltests: \ test_des test_idea test_sha test_md4 test_md5 test_hmac \