From a168ec1d27afc234791de0e4ee6a784bad411b22 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 26 May 2011 21:23:11 +0000 Subject: [PATCH] Support shared library builds of FIPS capable OpenSSL, add fipscanister.o to libcrypto.a so linking to libcrypto.a works. --- Makefile.org | 15 +++++++++++++-- crypto/Makefile | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.org b/Makefile.org index 4f5b4351ff..56abf480f9 100644 --- a/Makefile.org +++ b/Makefile.org @@ -285,9 +285,20 @@ all_testapps: build_libs build_testapps build_testapps: @dir=crypto; target=testapps; $(BUILD_ONE_CMD) -libcrypto$(SHLIB_EXT): libcrypto.a +fips_premain_dso$(EXE_EXT): libcrypto.a + [ -n "$(FIPSCANLIB)" ] && $(CC) $(CFLAGS) \ + -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \ + $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ + libcrypto.a $(EX_LIBS) + +libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) @if [ "$(SHLIB_TARGET)" != "" ]; then \ - $(MAKE) SHLIBDIRS=crypto build-shared; \ + if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ + FIPSLD_LIBCRYPTO=libcrypto.a ; \ + FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)bin/fipsld; \ + export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ + fi; \ + $(MAKE) -e SHLIBDIRS=crypto build-shared; \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ diff --git a/crypto/Makefile b/crypto/Makefile index 54c6b46ac0..3e5f7ae882 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -102,6 +102,7 @@ lib: $(LIB) @touch lib $(LIB): $(LIBOBJ) $(AR) $(LIB) $(LIBOBJ) + [ -n "$(FIPSLIBDIR)" ] && $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o $(RANLIB) $(LIB) || echo Never mind. shared: buildinf.h lib subdirs -- 2.40.0