From 7f42b75c0fba0dfc97cba65ec25b0cdaf129be7e Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 8 Nov 2021 20:30:50 +0100 Subject: [PATCH] Allow system versions of libwhich and libblastrampoline (#43000) --- Make.inc | 6 ++++++ base/Makefile | 2 +- deps/Makefile | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Make.inc b/Make.inc index 4719a3d49b039d..eda72170a71c07 100644 --- a/Make.inc +++ b/Make.inc @@ -1085,6 +1085,12 @@ else PATCHELF := $(build_depsbindir)/patchelf endif +ifeq ($(USE_SYSTEM_LIBWHICH), 1) +LIBWHICH := libwhich +else +LIBWHICH := $(build_depsbindir)/libwhich +endif + # On aarch64 and powerpc64le, we assume the page size is 64K. Our binutils linkers # and such already assume this, but `patchelf` seems to be behind the times. We # explicitly tell it to use this large page size so that when we rewrite rpaths and diff --git a/base/Makefile b/base/Makefile index 2bef6aab7f1f4c..355310ce17c264 100644 --- a/base/Makefile +++ b/base/Makefile @@ -170,7 +170,7 @@ endif define symlink_system_library libname_$2 := $$(notdir $(call versioned_libname,$2,$3)) -libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null) +libpath_$2 := $$(shell $$(call spawn,$$(LIBWHICH)) -p $$(libname_$2) 2>/dev/null) symlink_$2: $$(build_private_libdir)/$$(libname_$2) $$(build_private_libdir)/$$(libname_$2): @if [ -e "$$(libpath_$2)" ]; then \ diff --git a/deps/Makefile b/deps/Makefile index 3d3f79513135b3..50ca806307576c 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -159,9 +159,11 @@ DEP_LIBS += lapack endif endif +ifeq ($(USE_SYSTEM_LIBWHICH), 0) ifneq ($(OS), WINNT) DEP_LIBS += libwhich endif +endif # unlist targets that have not been converted to use the staged-install DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS))