]> granicus.if.org Git - openssl/commitdiff
Make sure LD_PRELOAD is only set when we build shared libraries (and
authorRichard Levitte <levitte@openssl.org>
Fri, 5 Nov 2004 09:12:18 +0000 (09:12 +0000)
committerRichard Levitte <levitte@openssl.org>
Fri, 5 Nov 2004 09:12:18 +0000 (09:12 +0000)
therefore link with them).  Add LD_PRELOAD setting code where it was
still missing.

PR: 966

Makefile.org
apps/Makefile
test/Makefile

index 439f033094178e2e0a75a4a3b1e353c943466876..2a6eb9ad95d54c193ef62b7a4202bde8f062aee3 100644 (file)
@@ -687,6 +687,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
 
@@ -701,6 +705,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:
index b44c8fa3845fdfb74e1a412a0341b916849ab74f..e0cb60a47b288ed961008b1264cb9d6fc0e67405 100644 (file)
@@ -159,6 +159,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
index 98e815cbd60a22d80c7ccf1638ee0ed0110854d8..aedd016f3f661f1655520d45b3c606dd51db168b 100644 (file)
@@ -129,9 +129,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 \