From a7b42009c43876f126790b3dc4260e3728695cc4 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 30 Oct 2001 08:00:59 +0000 Subject: [PATCH] Change the shared library support so the shared libraries get built sooner and the programs get built against the shared libraries. This requires a bit more work. Things like -rpath and the possibility to still link the programs statically should be included. Some cleanup is also needed. This will be worked on. --- CHANGES | 10 ++++++++++ Makefile.org | 19 ++++++++++--------- apps/Makefile.ssl | 5 ++++- crypto/Makefile.ssl | 8 +++++++- ssl/Makefile.ssl | 8 +++++++- test/Makefile.ssl | 6 +++++- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index a87097eedf..8f282ff4e2 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,16 @@ *) applies to 0.9.6a/0.9.6b/0.9.6c and 0.9.7 +) applies to 0.9.7 only + +) Change the shared library support so shared libraries are built as + soon as the corresponding static library is finished, and thereby get + openssl and the test programs linked against the shared library. + This still only happens when the keyword "shard" has been given to + the configuration scripts. + + NOTE: shared library support is still an experimental thing, and + backward binary compatibility is still not guaranteed. + ["Maciej W. Rozycki" and Richard Levitte] + +) Add support for Subject Information Access extension. [Peter Sylvester ] diff --git a/Makefile.org b/Makefile.org index d1fb1a9d6d..cf0d307001 100644 --- a/Makefile.org +++ b/Makefile.org @@ -203,23 +203,18 @@ HEADER= e_os.h # When we're prepared to use shared libraries in the programs we link here # we might remove 'clean-shared' from the targets to perform at this stage -all: clean-shared Makefile.ssl sub_all +all: Makefile.ssl sub_all sub_all: @for i in $(DIRS); \ do \ if [ -d "$$i" ]; then \ (cd $$i && echo "making all in $$i..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' all ) || exit 1; \ + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' all ) || exit 1; \ else \ $(MAKE) $$i; \ fi; \ done; \ - if echo "$(DIRS)" | \ - egrep '(^| )(crypto|ssl)( |$$)' > /dev/null 2>&1 && \ - [ -n "$(SHARED_LIBS)" ]; then \ - $(MAKE) $(SHARED_LIBS); \ - fi libcrypto$(SHLIB_EXT): libcrypto.a @if [ "$(SHLIB_TARGET)" != "" ]; then \ @@ -510,7 +505,11 @@ dclean: rehash: rehash.time rehash.time: certs - @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; export OPENSSL OPENSSL_DEBUG_MEMORY; $(PERL) tools/c_rehash certs) + @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \ + export OPENSSL OPENSSL_DEBUG_MEMORY; \ + LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ + export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ + $(PERL) tools/c_rehash certs) touch rehash.time test: tests @@ -518,7 +517,9 @@ 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}' PERL='${PERL}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' OPENSSL_DEBUG_MEMORY=on tests ); - @apps/openssl version -a + @LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ + export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ + apps/openssl version -a report: @$(PERL) util/selftest.pl diff --git a/apps/Makefile.ssl b/apps/Makefile.ssl index 4476a73ca8..92e8c19122 100644 --- a/apps/Makefile.ssl +++ b/apps/Makefile.ssl @@ -140,7 +140,10 @@ $(DLIBCRYPTO): $(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL) $(RM) $(PROGRAM) $(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) - -(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash certs) + -(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; \ + LIBPATH="`pwd`"; LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; \ + export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ + $(PERL) tools/c_rehash certs) progs.h: progs.pl $(PERL) progs.pl $(E_EXE) >progs.h diff --git a/crypto/Makefile.ssl b/crypto/Makefile.ssl index 967d0205de..cfc05fe13a 100644 --- a/crypto/Makefile.ssl +++ b/crypto/Makefile.ssl @@ -35,6 +35,7 @@ SDIRS= md2 md5 sha mdc2 hmac ripemd \ GENERAL=Makefile README crypto-lib.com install.com LIB= $(TOP)/libcrypto.a +SHARED_LIB= libcrypto$(SHLIB_EXT) LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o @@ -49,7 +50,7 @@ ALL= $(GENERAL) $(SRC) $(HEADER) top: @(cd ..; $(MAKE) DIRS=$(DIR) all) -all: buildinf.h lib subdirs +all: buildinf.h lib subdirs shared buildinf.h: ../Makefile.ssl ( echo "#ifndef MK1MF_BUILD"; \ @@ -95,6 +96,11 @@ lib: $(LIBOBJ) $(RANLIB) $(LIB) || echo Never mind. @touch lib +shared: + if [ -n "$(SHARED_LIBS)" ]; then \ + (cd ..; make $(SHARED_LIB)); \ + fi + libs: @for i in $(SDIRS) ;\ do \ diff --git a/ssl/Makefile.ssl b/ssl/Makefile.ssl index d643b4252f..2a3f8406d8 100644 --- a/ssl/Makefile.ssl +++ b/ssl/Makefile.ssl @@ -26,6 +26,7 @@ TEST=ssltest.c APPS= LIB=$(TOP)/libssl.a +SHARED_LIB= libssl$(SHLIB_EXT) LIBSRC= \ s2_meth.c s2_srvr.c s2_clnt.c s2_lib.c s2_enc.c s2_pkt.c \ s3_meth.c s3_srvr.c s3_clnt.c s3_lib.c s3_enc.c s3_pkt.c s3_both.c \ @@ -55,13 +56,18 @@ ALL= $(GENERAL) $(SRC) $(HEADER) top: (cd ..; $(MAKE) DIRS=$(DIR) all) -all: lib +all: lib shared lib: $(LIBOBJ) $(AR) $(LIB) $(LIBOBJ) $(RANLIB) $(LIB) || echo Never mind. @touch lib +shared: + if [ -n "$(SHARED_LIBS)" ]; then \ + (cd ..; make $(SHARED_LIB)); \ + fi + files: $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO diff --git a/test/Makefile.ssl b/test/Makefile.ssl index fd9d992b82..b6e941913c 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -114,7 +114,11 @@ tests: exe apps $(TESTS) apps: @(cd ../apps; $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all) -alltests: \ +alltests: + (LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH=$$LIBPATH; SHLIB_PATH=$$LIBPATH; \ + export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ + $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' alltests.chooser) +alltests.chooser: \ 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_rd \ -- 2.34.1