From nobody Mon Feb 9 01:19:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597657792; cv=none; d=zohomail.com; s=zohoarc; b=PIKcafQwuXcGtT5pegk1MRif31g7z14ZzyeWrOeVKD/LR/111i0zoXKpEy0bB08nan6SOFStXcWaS09KSal5YtcrizKgPSRwa8OysfsZ4itr9vOVyt4UDYGz6zNEBtoICFh+taQOuISJZ/BoZ+csgi+VxwTMA2eQ8comA9eKqXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597657792; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K16RvEXO8PITvDHUN1su+E/U6V0jwv2bXbZ6mPJMC0U=; b=GG9jjSsh2YoYX+zp1iT4cg1oWN6UbdRVgrNOjx7H8vQzXc3U0LRJ950pdkVYza/Kv6sEHV/x4dGAt92J/pXX6h7Eyj4nCC6J2IVC+Pp8un1xkiE+gl5De1A8rRmDnl6734/SJjjNaWVdUvdS4eFHNAOl76YP4ftsarScDwF6MxU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597657792349137.5116965633133; Mon, 17 Aug 2020 02:49:52 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k7blj-00047K-7N; Mon, 17 Aug 2020 09:49:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k7bli-00046Z-Aq for xen-devel@lists.xenproject.org; Mon, 17 Aug 2020 09:49:30 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 429207ea-7ee0-4f56-8c83-37559f9c4f86; Mon, 17 Aug 2020 09:49:26 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7B22DAE3A; Mon, 17 Aug 2020 09:49:50 +0000 (UTC) X-Inumbo-ID: 429207ea-7ee0-4f56-8c83-37559f9c4f86 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH II v2 03/17] tools: tweak tools/libs/libs.mk for being able to support libxenctrl Date: Mon, 17 Aug 2020 11:49:08 +0200 Message-Id: <20200817094922.15768-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200817094922.15768-1-jgross@suse.com> References: <20200817094922.15768-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" tools/libs/libs.mk needs to be modified for being able to support building libxenctrl, as the pkg-config file of that library is not following the same conventions as those of the other libraries. So add support for specifying PKG_CONFIG before including libs.mk. In order to make life easier for unstable libraries like libxenctrl set MAJOR and MINOR automatically to the Xen-version and 0 when not specified. This removes the need to bump the versions of unstable libraries when switching to a new Xen version. As all libraries built via libs.mk require a map file generate a dummy one in case there is none existing. This again will help avoiding the need to bump the libarary version in the map file of an unstable library in case it is exporting all symbols. The clean target is missing the removal of _paths.h. Finally drop the foreach loop when setting PKG_CONFIG_LOCAL, as there is always only one element in PKG_CONFIG. Signed-off-by: Juergen Gross --- tools/libs/libs.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 19efc5e743..8b1ca2aa62 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -1,10 +1,13 @@ # Common Makefile for building a lib. # # Variables taken as input: -# MAJOR: major version of lib -# MINOR: minor version of lib +# PKG_CONFIG: name of pkg-config file (xen$(LIBNAME).pc if empty) +# MAJOR: major version of lib (Xen version if empty) +# MINOR: minor version of lib (0 if empty) =20 LIBNAME :=3D $(notdir $(CURDIR)) +MAJOR ?=3D $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) +MINOR ?=3D 0 =20 SHLIB_LDFLAGS +=3D -Wl,--version-script=3Dlibxen$(LIBNAME).map =20 @@ -22,7 +25,7 @@ ifneq ($(nosharedlibs),y) LIB +=3D libxen$(LIBNAME).so endif =20 -PKG_CONFIG :=3D xen$(LIBNAME).pc +PKG_CONFIG ?=3D xen$(LIBNAME).pc PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) =20 ifneq ($(CONFIG_LIBXC_MINIOS),y) @@ -32,7 +35,7 @@ $(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) $(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) endif =20 -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +PKG_CONFIG_LOCAL :=3D $(PKG_CONFIG_DIR)/$(PKG_CONFIG) =20 LIBHEADER ?=3D xen$(LIBNAME).h LIBHEADERS =3D $(foreach h, $(LIBHEADER), include/$(h)) @@ -45,7 +48,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) all: build =20 .PHONY: build -build: libs +build: libs libxen$(LIBNAME).map =20 .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) @@ -64,6 +67,9 @@ endif =20 headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS) =20 +libxen$(LIBNAME).map: + echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@ + $(LIBHEADERSGLOB): $(LIBHEADERS) for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/inclu= de; done =20 @@ -87,7 +93,7 @@ install: build $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir= )/libxen$(LIBNAME).so.$(MAJOR) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$= (LIBNAME).so for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); d= one - $(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR) + $(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR) =20 .PHONY: uninstall uninstall: @@ -107,8 +113,9 @@ clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS) rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) rm -f headers.chk - rm -f xen$(LIBNAME).pc + rm -f $(PKG_CONFIG) rm -f $(LIBHEADERSGLOB) + rm -f _paths.h =20 .PHONY: distclean distclean: clean --=20 2.26.2