Hi,

 In general it's impossible to load uninstalled shared libraries without
additional special steps.  Since openssl only supports ELF and OSF/1 ECOFF
shared libraries the solution is simple and uniform -- you just need to
point to a directory containing uninstalled libraries via the
LD_LIBRARY_PATH environment variable.

 The following simple patch does just that.  It allows running `make
rehash test' against shared libraries.  It was tested on an i386/Linux
system succesfully.  Without the patch the tests would either fail or get
loaded against system-installed libraries leading to useless results.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [EMAIL PROTECTED], PGP key available        +

openssl-0.9.6b-run_uninst.patch
diff -up --recursive --new-file openssl-0.9.6b.macro/Makefile.org 
openssl-0.9.6b/Makefile.org
--- openssl-0.9.6b.macro/Makefile.org   Mon Jul  9 14:08:41 2001
+++ openssl-0.9.6b/Makefile.org Fri Oct 26 17:56:18 2001
@@ -343,7 +343,9 @@ dclean:
 
 rehash: rehash.time
 rehash.time: certs
-       @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash certs)
+       @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; \
+               LD_LIBRARY_PATH="`pwd`"; export LD_LIBRARY_PATH; \
+               $(PERL) tools/c_rehash certs)
        touch rehash.time
 
 test:   tests
@@ -351,7 +353,8 @@ test:   tests
 tests: rehash
        @(cd test && echo "testing..." && \
        $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' 
PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' 
BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' 
SDIRS='${SDIRS}' SHA1_
ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' 
RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' EXE_EXT='${EXE_EXT}' tests );
-       @apps/openssl version -a
+       @(LD_LIBRARY_PATH="`pwd`"; export LD_LIBRARY_PATH; \
+               apps/openssl version -a)
 
 report:
        @$(PERL) util/selftest.pl
diff -up --recursive --new-file openssl-0.9.6b.macro/apps/Makefile.ssl 
openssl-0.9.6b/apps/Makefile.ssl
--- openssl-0.9.6b.macro/apps/Makefile.ssl      Mon Jul  9 14:08:56 2001
+++ openssl-0.9.6b/apps/Makefile.ssl    Fri Oct 26 17:33:11 2001
@@ -136,7 +136,10 @@ $(DLIBCRYPTO):
 $(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
        $(RM) $(PROGRAM)
        $(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) 
$(LIBCRYPTO) $(EX_LIBS)
-       -(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash 
certs)
+       -(cd ..; \
+               OPENSSL="`pwd`/apps/openssl"; export OPENSSL; \
+               LD_LIBRARY_PATH="`pwd`"; export LD_LIBRARY_PATH; \
+               $(PERL) tools/c_rehash certs)
 
 progs.h: progs.pl
        $(PERL) progs.pl $(E_EXE) >progs.h
diff -up --recursive --new-file openssl-0.9.6b.macro/test/Makefile.ssl 
openssl-0.9.6b/test/Makefile.ssl
--- openssl-0.9.6b.macro/test/Makefile.ssl      Mon Jul  9 14:11:10 2001
+++ openssl-0.9.6b/test/Makefile.ssl    Fri Oct 26 17:37:31 2001
@@ -100,13 +100,17 @@ install:
 tags:
        ctags $(SRC)
 
-tests: exe apps \
+tests_redirect:        exe apps \
        test_des test_idea test_sha test_md4 test_md5 test_hmac \
        test_md2 test_mdc2 \
        test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast \
        test_rand test_bn test_enc test_x509 test_rsa test_crl test_sid \
        test_gen test_req test_pkcs7 test_verify test_dh test_dsa \
        test_ss test_ca test_ssl
+
+tests:
+       @(LD_LIBRARY_PATH="`cd $(TOP); pwd`"; export LD_LIBRARY_PATH; \
+               $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' 
+PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' 
+BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' 
+SDIRS='${SDIRS}' SHA1
_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' 
RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' EXE_EXT='${EXE_EXT}' tests_redirect)
 
 apps:
        @(cd ../apps; $(MAKE)  CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' 
PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all)

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to