Skip to content

Commit f4ad6fb

Browse files
committed
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.
1 parent 23324d2 commit f4ad6fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mklove/Makefile.base

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,14 @@ endif # MKL_DYNAMIC_LIBS
162162

163163
else # MKL_STATIC_LIBS is empty
164164
_STATIC_FILENAME=$(LIBNAME).a
165-
$(LIBNAME)-static.a:
166-
@printf "$(MKL_RED)WARNING:$(MKL_YELLOW) $@: Not creating self-contained static library $@: no static libraries available/enabled$(MKL_CLR_RESET)\n"
165+
$(LIBNAME)-static.a: $(LIBNAME).a
166+
@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"
167+
ifneq ($(MKL_DYNAMIC_LIBS),)
168+
@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"
169+
cp $(LIBNAME).a $@
170+
cp $(LIBNAME)-dbg.a $(LIBNAME)-static-dbg.a
171+
cp $@ $(LIBNAME)-static-dbg.a
172+
endif # MKL_DYNAMIC_LIBS
167173
endif # MKL_STATIC_LIBS
168174

169175
endif # MKL_NO_SELFCONTAINED_STATIC_LIB

0 commit comments

Comments
 (0)