Skip to contentSkip to conversation

tools: don't require unavailable optional libraries in pkg-config files

PATCH In review Juergen Gross 4 participants 4 messages May 12, 2017 – May 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: don't require unavailable optional libraries in pkg-config files

blktap2 is optional, so there should be no pkg-config file requiring xenblktapctl if it isn't enabled for the build.

Add a filter mechanism to tools/Rules.mk to filter out optional libraries.

---
 tools/Rules.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
tools/Rules.mk +7 -2
index 7cb28f5c4e..f55fb669b8 100644
@@ -175,6 +175,7 @@ CFLAGS_libblktapctl =
 SHDEPS_libblktapctl =
 LDLIBS_libblktapctl =
 SHLIB_libblktapctl  =
+PKG_CONFIG_REMOVE += xenblktapctl
 endif
 
 CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
@@ -250,6 +251,8 @@ endif
 
 PKG_CONFIG_DIR ?= $(XEN_ROOT)/tools/pkg-config
 
+PKG_CONFIG_FILTER = $(foreach l,$(PKG_CONFIG_REMOVE),-e 's!\([ ,]\)$(l),!\1!g' -e 's![ ,]$(l)$$!!g')
+
 $(PKG_CONFIG_DIR)/%.pc: %.pc.in Makefile
 	mkdir -p $(PKG_CONFIG_DIR)
 	@sed -e 's!@@version@@!$(PKG_CONFIG_VERSION)!g' \
@@ -259,7 +262,8 @@ $(PKG_CONFIG_DIR)/%.pc: %.pc.in Makefile
 	     -e 's!@@firmwaredir@@!$(XENFIRMWAREDIR)!g' \
 	     -e 's!@@libexecbin@@!$(LIBEXEC_BIN)!g' \
 	     -e 's!@@cflagslocal@@!$(PKG_CONFIG_CFLAGS_LOCAL)!g' \
-	     -e 's!@@libsflag@@!-Wl,-rpath-link=!g' < $< > $@
+	     -e 's!@@libsflag@@!-Wl,-rpath-link=!g' \
+	     $(PKG_CONFIG_FILTER) < $< > $@
 
 %.pc: %.pc.in Makefile
 	@sed -e 's!@@version@@!$(PKG_CONFIG_VERSION)!g' \
@@ -269,4 +273,5 @@ $(PKG_CONFIG_DIR)/%.pc: %.pc.in Makefile
 	     -e 's!@@firmwaredir@@!$(XENFIRMWAREDIR)!g' \
 	     -e 's!@@libexecbin@@!$(LIBEXEC_BIN)!g' \
 	     -e 's!@@cflagslocal@@!!g' \
-	     -e 's!@@libsflag@@!-L!g' < $< > $@
+	     -e 's!@@libsflag@@!-L!g' \
+	     $(PKG_CONFIG_FILTER) < $< > $@
Signature · 7 lines
2.12.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#2 lore raw
In reply to Juergen Gross

Juergen Gross writes ("[PATCH] tools: don't require unavailable optional libraries in pkg-config files"):

Quoted 5 lines

blktap2 is optional, so there should be no pkg-config file requiring xenblktapctl if it isn't enabled for the build.

Add a filter mechanism to tools/Rules.mk to filter out optional libraries.

That's some quite impressive shell runes.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
In reply to Juergen Gross

Hi Juergen,

Quoted 7 lines · Juergen Gross

blktap2 is optional, so there should be no pkg-config file requiring xenblktapctl if it isn't enabled for the build.

Add a filter mechanism to tools/Rules.mk to filter out optional libraries.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel