From f4ad6fbe739d67c2c73415ec74f158a229b98c91 Mon Sep 17 00:00:00 2001 From: Magnus Edenhill Date: Tue, 3 May 2022 17:27:15 +0200 Subject: [PATCH] Always provide a librdkafka-static.a Even if there are no dependency .a to bundle we should still provide a librdkafka-static.a, since it may be sufficient anyway. This change originally stems from the RPM package librdkafka.spec including librdkafka-static.a, but depending on Redhat distro it may or may not need static library dependencies, which in turn would sometime not create a librdkafka-static.a, thus failing RPM packaging. --- mklove/Makefile.base | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mklove/Makefile.base b/mklove/Makefile.base index 8358ea19..91be4391 100755 --- a/mklove/Makefile.base +++ b/mklove/Makefile.base @@ -162,8 +162,14 @@ endif # MKL_DYNAMIC_LIBS else # MKL_STATIC_LIBS is empty _STATIC_FILENAME=$(LIBNAME).a -$(LIBNAME)-static.a: - @printf "$(MKL_RED)WARNING:$(MKL_YELLOW) $@: Not creating self-contained static library $@: no static libraries available/enabled$(MKL_CLR_RESET)\n" +$(LIBNAME)-static.a: $(LIBNAME).a + @printf "$(MKL_RED)WARNING:$(MKL_YELLOW) $@: No static libraries available/enabled for inclusion in self-contained static library $@: this library will be identical to $(LIBNAME).a$(MKL_CLR_RESET)\n" +ifneq ($(MKL_DYNAMIC_LIBS),) + @printf "$(MKL_RED)WARNING:$(MKL_YELLOW) $@: The following libraries were not available as static libraries and need to be linked dynamically: $(MKL_DYNAMIC_LIBS)$(MKL_CLR_RESET)\n" + cp $(LIBNAME).a $@ + cp $(LIBNAME)-dbg.a $(LIBNAME)-static-dbg.a + cp $@ $(LIBNAME)-static-dbg.a +endif # MKL_DYNAMIC_LIBS endif # MKL_STATIC_LIBS endif # MKL_NO_SELFCONTAINED_STATIC_LIB