From nobody Thu May 2 02:17:38 2024 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=1597496667; cv=none; d=zohomail.com; s=zohoarc; b=kgF1AvIlp5o+XVGOs7WBZjgZcjD9XuzmglpMV0YltIatEKlE96ozfKEiac3shDBX+SmTwovrMJsFKR+C32NkQ5fgEmkvCcnZxUI9BzEAi6V1QgcNAiBuGsh/8deCt+3GAnfAluev4IM2TT3v0TDQUyP9UY4Z1UlFAS9y39A1KaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496667; 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=PH6UxLkIFoD7YE5GUr9v72bggRQ+36c+FXDXrlcbu4o=; b=YSFhRUjmMuaMo7yyi9VG56F/aiPs+1+T1+cfEWTICGEvGZzwjFkpGFAMR1Pcpgme5ZxzPPXbX9ugHiXV3V2dz7bEjnn5uasvjaOhQO2xtlpb461cHOB2PUIpISQQbzieC83pBaJdxCdGBadxhwFmg3KyjUsz4rzgj3I/deudU98= 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 1597496667918580.5838865791942; Sat, 15 Aug 2020 06:04:27 -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 1k6vqp-0006Rk-C5; Sat, 15 Aug 2020 13:03:59 +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 1k6vqo-0006R1-5v for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:03:58 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8562101a-e743-4fee-9ff3-d70cccce0bf7; Sat, 15 Aug 2020 13:03:50 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B1E0FB1ED; Sat, 15 Aug 2020 13:04:13 +0000 (UTC) X-Inumbo-ID: 8562101a-e743-4fee-9ff3-d70cccce0bf7 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Samuel Thibault Subject: [PATCH I v2 1/6] stubdom: add stubdom/mini-os.mk for Xen paths used by Mini-OS Date: Sat, 15 Aug 2020 15:03:36 +0200 Message-Id: <20200815130341.27147-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" stubdom/mini-os.mk should contain paths used by Mini-OS when built as stubdom. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- stubdom/mini-os.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 stubdom/mini-os.mk diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk new file mode 100644 index 0000000000..32528bb91f --- /dev/null +++ b/stubdom/mini-os.mk @@ -0,0 +1,17 @@ +# Included by Mini-OS stubdom builds to set variables depending on Xen +# internal paths. +# +# Input variables are: +# XEN_ROOT +# MINIOS_TARGET_ARCH + +XENSTORE_CPPFLAGS =3D -isystem $(XEN_ROOT)/tools/xenstore/include +TOOLCORE_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore +TOOLLOG_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog +EVTCHN_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn +GNTTAB_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab +CALL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call +FOREIGNMEMORY_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/fore= ignmemory +DEVICEMODEL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/device= model +CTRL_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +GUEST_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) --=20 2.26.2 From nobody Thu May 2 02:17:38 2024 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=1597496668; cv=none; d=zohomail.com; s=zohoarc; b=gJ8XDZ4pvAoPacdR2HV/9e9gFrxoxVsk74CgBDVMSdqkuYyWjSD5iQEHeSEEskCr7DMoLHK3yXiJuTRmPhubfHhkHsyRPVFu4A51QLsqwjiW1oIIVs9XSF7Y0Reg2ScinFogKNj5lf+yQnSH97kMshgZuaccMESXkkbtjgoyJ3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496668; 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=p4oz6Um3cLyCaLCFAJH7fPNT5sUk8qwjDIclpmWkrLQ=; b=CBTzIGzT9wwuiyojhwzI77kdbAo67IefTbf+di8TGmDcJpd1bIsiOtn/esLtoxhu940xBmHDwAasBjJiGvQ/i+Df0vrRbzrrltxf9AW+lBDcOhW+ksXaTZjtDpFOzo2lR93ybOutuVKMsLDC0jRh6YrqhwBBWCL68mX0PUQchPo= 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 1597496668224614.0430873829624; Sat, 15 Aug 2020 06:04:28 -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 1k6vqj-0006R6-IV; Sat, 15 Aug 2020 13:03:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6vqi-0006Qw-QT for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:03:52 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ba06c901-3d43-4400-b417-ba719b71ea38; Sat, 15 Aug 2020 13:03:51 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D91ABB57D; Sat, 15 Aug 2020 13:04:13 +0000 (UTC) X-Inumbo-ID: ba06c901-3d43-4400-b417-ba719b71ea38 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 , George Dunlap , Nick Rosbrook Subject: [PATCH I v2 2/6] tools: switch XEN_LIBXEN* make variables to lower case (XEN_libxen*) Date: Sat, 15 Aug 2020 15:03:37 +0200 Message-Id: <20200815130341.27147-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" In order to harmonize names of library related make variables switch XEN_LIBXEN* names to XEN_libxen*, as all other related variables (e.g. CFLAGS_libxen*, SHDEPS_libxen*, ...) already use this pattern. Rename XEN_LIBXC to XEN_libxenctrl, XEN_XENSTORE to XEN_libxenstore, XEN_XENLIGHT to XEN_libxenlight, XEN_XLUTIL to XEN_libxlutil, and XEN_LIBVCHAN to XEN_libxenvchan for the same reason. Introduce XEN_libxenguest with the same value as XEN_libxenctrl. No functional change. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/Rules.mk | 120 +++++++++++++++--------------- tools/golang/xenlight/Makefile | 4 +- tools/libs/call/Makefile | 2 +- tools/libs/devicemodel/Makefile | 2 +- tools/libs/evtchn/Makefile | 2 +- tools/libs/foreignmemory/Makefile | 2 +- tools/libs/gnttab/Makefile | 2 +- tools/libs/hypfs/Makefile | 2 +- tools/libs/toolcore/Makefile | 2 +- tools/libs/toollog/Makefile | 2 +- tools/libvchan/Makefile | 2 +- tools/libxc/Makefile | 2 +- tools/xenstat/libxenstat/Makefile | 2 +- tools/xenstore/Makefile | 2 +- 14 files changed, 75 insertions(+), 73 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 5ed5664bf7..b42e50ebf6 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -12,21 +12,23 @@ INSTALL =3D $(XEN_ROOT)/tools/cross-install LDFLAGS +=3D $(PREPEND_LDFLAGS_XEN_TOOLS) =20 XEN_INCLUDE =3D $(XEN_ROOT)/tools/include -XEN_LIBXENTOOLCORE =3D $(XEN_ROOT)/tools/libs/toolcore -XEN_LIBXENTOOLLOG =3D $(XEN_ROOT)/tools/libs/toollog -XEN_LIBXENEVTCHN =3D $(XEN_ROOT)/tools/libs/evtchn -XEN_LIBXENGNTTAB =3D $(XEN_ROOT)/tools/libs/gnttab -XEN_LIBXENCALL =3D $(XEN_ROOT)/tools/libs/call -XEN_LIBXENFOREIGNMEMORY =3D $(XEN_ROOT)/tools/libs/foreignmemory -XEN_LIBXENDEVICEMODEL =3D $(XEN_ROOT)/tools/libs/devicemodel -XEN_LIBXENHYPFS =3D $(XEN_ROOT)/tools/libs/hypfs -XEN_LIBXC =3D $(XEN_ROOT)/tools/libxc -XEN_XENLIGHT =3D $(XEN_ROOT)/tools/libxl +XEN_libxentoolcore =3D $(XEN_ROOT)/tools/libs/toolcore +XEN_libxentoollog =3D $(XEN_ROOT)/tools/libs/toollog +XEN_libxenevtchn =3D $(XEN_ROOT)/tools/libs/evtchn +XEN_libxengnttab =3D $(XEN_ROOT)/tools/libs/gnttab +XEN_libxencall =3D $(XEN_ROOT)/tools/libs/call +XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/foreignmemory +XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel +XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs +XEN_libxenctrl =3D $(XEN_ROOT)/tools/libxc +# Currently libxenguest lives in the same directory as libxenctrl +XEN_libxenguest =3D $(XEN_libxenctrl) +XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight -XEN_XLUTIL =3D $(XEN_XENLIGHT) -XEN_XENSTORE =3D $(XEN_ROOT)/tools/xenstore -XEN_LIBXENSTAT =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_LIBVCHAN =3D $(XEN_ROOT)/tools/libvchan +XEN_libxlutil =3D $(XEN_libxenlight) +XEN_libxenstore =3D $(XEN_ROOT)/tools/xenstore +XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src +XEN_libxenvchan =3D $(XEN_ROOT)/tools/libvchan =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -97,75 +99,75 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) =20 -CFLAGS_libxentoollog =3D -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclud= e) +CFLAGS_libxentoollog =3D -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclud= e) SHDEPS_libxentoollog =3D -LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_LIBXENTOOLLOG)/libx= entoollog$(libextension) -SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_L= IBXENTOOLLOG) +LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libx= entoollog$(libextension) +SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_l= ibxentoollog) =20 -CFLAGS_libxentoolcore =3D -I$(XEN_LIBXENTOOLCORE)/include $(CFLAGS_xenincl= ude) +CFLAGS_libxentoolcore =3D -I$(XEN_libxentoolcore)/include $(CFLAGS_xenincl= ude) SHDEPS_libxentoolcore =3D -LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_LIBXENTOOLCORE)/l= ibxentoolcore$(libextension) -SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _LIBXENTOOLCORE) +LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/l= ibxentoolcore$(libextension) +SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _libxentoolcore) =20 -CFLAGS_libxenevtchn =3D -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude) +CFLAGS_libxenevtchn =3D -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) SHDEPS_libxenevtchn =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_LIBXENEVTCHN)/libxene= vtchn$(libextension) -SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_LIB= XENEVTCHN) +LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxene= vtchn$(libextension) +SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_lib= xenevtchn) =20 -CFLAGS_libxengnttab =3D -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude) +CFLAGS_libxengnttab =3D -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) SHDEPS_libxengnttab =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_LIBXENGNTTAB)/libxeng= nttab$(libextension) -SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_LIB= XENGNTTAB) +LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxeng= nttab$(libextension) +SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_lib= xengnttab) =20 -CFLAGS_libxencall =3D -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude) +CFLAGS_libxencall =3D -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) SHDEPS_libxencall =3D $(SHLIB_libxentoolcore) -LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_LIBXENCALL)/libxencall$(l= ibextension) -SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_LIBXENC= ALL) +LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(l= ibextension) +SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_libxenc= all) =20 -CFLAGS_libxenforeignmemory =3D -I$(XEN_LIBXENFOREIGNMEMORY)/include $(CFLA= GS_xeninclude) +CFLAGS_libxenforeignmemory =3D -I$(XEN_libxenforeignmemory)/include $(CFLA= GS_xeninclude) SHDEPS_libxenforeignmemory =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_LIBXENF= OREIGNMEMORY)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_LIBXENFOREIGNMEMORY) +LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_libxenf= oreignmemory)/libxenforeignmemory$(libextension) +SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_libxenforeignmemory) =20 -CFLAGS_libxendevicemodel =3D -I$(XEN_LIBXENDEVICEMODEL)/include $(CFLAGS_x= eninclude) +CFLAGS_libxendevicemodel =3D -I$(XEN_libxendevicemodel)/include $(CFLAGS_x= eninclude) SHDEPS_libxendevicemodel =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore= ) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_LIBXENDEVIC= EMODEL)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_LIBXENDEVICEMODEL) +LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_libxendevic= emodel)/libxendevicemodel$(libextension) +SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_libxendevicemodel) =20 -CFLAGS_libxenhypfs =3D -I$(XEN_LIBXENHYPFS)/include $(CFLAGS_xeninclude) +CFLAGS_libxenhypfs =3D -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) SHDEPS_libxenhypfs =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SH= LIB_libxencall) -LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_LIBXENHYPFS)/libxenhypf= s$(libextension) -SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_LIBXE= NHYPFS) +LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypf= s$(libextension) +SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_libxe= nhypfs) =20 # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. -CFLAGS_libxenctrl =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFL= AGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -= D__XEN_TOOLS__ +CFLAGS_libxenctrl =3D -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) = $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclu= de) -D__XEN_TOOLS__ SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB= _libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_lib= xendevicemodel) -LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libext= ension) -SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_LIBXC) +LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(l= ibextension) +SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_libxenc= trl) =20 -CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFL= AGS_libxenforeignmemory) $(CFLAGS_xeninclude) +CFLAGS_libxenguest =3D -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn)= $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn) -LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(lib= extension) -SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_LIBXC) +LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxengues= t$(libextension) +SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_libxe= nguest) =20 -CFLAGS_libxenstore =3D -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude) +CFLAGS_libxenstore =3D -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) SHDEPS_libxenstore =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenstore =3D $(SHDEPS_libxenstore) $(XEN_XENSTORE)/libxenstore$(= libextension) -SHLIB_libxenstore =3D $(SHDEPS_libxenstore) -Wl,-rpath-link=3D$(XEN_XENST= ORE) +LDLIBS_libxenstore =3D $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstor= e$(libextension) +SHLIB_libxenstore =3D $(SHDEPS_libxenstore) -Wl,-rpath-link=3D$(XEN_libxe= nstore) ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 -CFLAGS_libxenstat =3D -I$(XEN_LIBXENSTAT) +CFLAGS_libxenstat =3D -I$(XEN_libxenstat) SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(= libextension) -SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_LIBXEN= STAT) +LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) +SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) =20 -CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN) $(CFLAGS_libxengnttab) $(CFLAGS_l= ibxenevtchn) +CFLAGS_libxenvchan =3D -I$(XEN_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAG= S_libxenevtchn) SHDEPS_libxenvchan =3D $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB= _libxenevtchn) $(SHLIB_libxengnttab) -LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(= libextension) -SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_LIBVC= HAN) +LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvcha= n$(libextension) +SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_libxe= nvchan) =20 ifeq ($(debug),y) # Disable optimizations @@ -176,15 +178,15 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -CFLAGS_libxenlight =3D -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xen= include) +CFLAGS_libxenlight =3D -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_= xeninclude) SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bxenhypfs) -LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_XENLIGHT)/libxenlight$(= libextension) -SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_XENLI= GHT) +LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenligh= t$(libextension) +SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_libxe= nlight) =20 -CFLAGS_libxlutil =3D -I$(XEN_XLUTIL) +CFLAGS_libxlutil =3D -I$(XEN_libxlutil) SHDEPS_libxlutil =3D $(SHLIB_libxenlight) -LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_XLUTIL)/libxlutil$(libexten= sion) -SHLIB_libxlutil =3D $(SHDEPS_libxlutil) -Wl,-rpath-link=3D$(XEN_XLUTIL) +LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libex= tension) +SHLIB_libxlutil =3D $(SHDEPS_libxlutil) -Wl,-rpath-link=3D$(XEN_libxlutil) =20 CFLAGS +=3D -D__XEN_INTERFACE_VERSION__=3D__XEN_LATEST_INTERFACE_VERSION__ =20 diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile index eac9dbf12a..a83fff7573 100644 --- a/tools/golang/xenlight/Makefile +++ b/tools/golang/xenlight/Makefile @@ -30,11 +30,11 @@ idl-gen: $(GOXL_GEN_FILES) # # NB that because the users of this library need to be able to # recompile the library from source, it needs to include '-lxenlight' -# in the LDFLAGS; and thus we need to add -L$(XEN_XENLIGHT) here +# in the LDFLAGS; and thus we need to add -L$(XEN_libxenlight) here # so that it can find the actual library. .PHONY: build build: xenlight.go $(GOXL_GEN_FILES) - CGO_CFLAGS=3D"$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS= =3D"$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_XENLIGHT) -L$(XEN= _LIBXENTOOLLOG)" $(GO) build -x + CGO_CFLAGS=3D"$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS= =3D"$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(= XEN_libxentoollog)" $(GO) build -x =20 .PHONY: install install: build diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 7f6dc3fcbd..7994b411fa 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENCALL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxencall)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makef= ile index 61bfa35273..d9d1d1b850 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) +=3D compat.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENDEVICEMODEL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxendevicemodel)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index 9206f622ef..d7aa4d402f 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -15,4 +15,4 @@ SRCS-$(CONFIG_MiniOS) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENEVTCHN)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenevtchn)/include diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/M= akefile index 28f1bddc96..823989681d 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENFOREIGNMEMORY)/incl= ude +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenforeignmemory)/incl= ude $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index 2da8fbbb7f..c0fffdac71 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -17,5 +17,5 @@ SRCS-$(CONFIG_NetBSD) +=3D gnttab_unimp.c gntshr_unimp.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENGNTTAB)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxengnttab)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index 06dd449929..b4c41f6189 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -12,5 +12,5 @@ SRCS-y +=3D core.c =20 include ../libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENHYPFS)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenhypfs)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile index 9c5a92d93f..85ff2b26fd 100644 --- a/tools/libs/toolcore/Makefile +++ b/tools/libs/toolcore/Makefile @@ -10,7 +10,7 @@ SRCS-y +=3D handlereg.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENTOOLCORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxentoolcore)/include =20 $(LIB_OBJS): $(AUTOINCS) $(PIC_OBJS): $(AUTOINCS) diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 9156e5d08e..2d3ae4e627 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -10,4 +10,4 @@ SRCS-y +=3D xtl_logger_stdio.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENTOOLLOG)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxentoollog)/include diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile index d99a6137e1..a5441162a0 100644 --- a/tools/libvchan/Makefile +++ b/tools/libvchan/Makefile @@ -35,7 +35,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBVCHAN) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenvchan) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 955cd5ab18..c1e41a8ee9 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -168,7 +168,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXC)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenctrl)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/M= akefile index ab980852da..b5e623b155 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -50,7 +50,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENSTAT) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstat) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) =20 .PHONY: all diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 445e9911b2..0a64ac1571 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -128,7 +128,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_XENSTORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstore)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 --=20 2.26.2 From nobody Thu May 2 02:17:38 2024 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=1597496668; cv=none; d=zohomail.com; s=zohoarc; b=YH5iEg7ZwHlW8nA+ypdEo/z8KvTFKf28mKm6ukU8yWaIMFLlcLPCIqlakgwUzGI8ShOvxGXCUTgWQYLy2UfBLGGRiYPmrG0uMX7CKwhm25JJN+SeSdqkwQ52pFNdvxuR+Gc7eiU4IfM8QI4zs7fuEchPVdnrMb7XrNQckmwqvH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496668; 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=O0wkPcJE1V9j6Te3PweRB4n90gM08R92gSJlkocbgPY=; b=VIrEeFCWYXfxfmGNR5kMuY08JLLarTIwSFXKdqOrAzThTp7NMjzwkOObPGjaCEPYuDG13Rsa4QLLTDTizsrAPXRsv2+6rJPcXPWfjVW7HsDMeJErmhf/7D+LkOCBKlu+K1E5Qxk+8Ai3VdShflVH/hS/r3Qkey3HR3YMA/IJDQQ= 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 1597496668240292.77191488830954; Sat, 15 Aug 2020 06:04:28 -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 1k6vqp-0006Rc-3e; Sat, 15 Aug 2020 13:03:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6vqn-0006Qw-Ln for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:03:57 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b91349a9-bf38-429e-bd2a-927eb6923aca; Sat, 15 Aug 2020 13:03:51 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1761BB57E; Sat, 15 Aug 2020 13:04:14 +0000 (UTC) X-Inumbo-ID: b91349a9-bf38-429e-bd2a-927eb6923aca X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH I v2 3/6] tools: add a copy of library headers in tools/include Date: Sat, 15 Aug 2020 15:03:38 +0200 Message-Id: <20200815130341.27147-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" The headers.chk target in tools/Rules.mk tries to compile all headers stand alone for testing them not to include any internal header. Unfortunately the headers tested against are not complete, as any header for a Xen library is not included in the include path of the test compile run, resulting in a failure in case any of the tested headers in including an official Xen library header. Fix that by copying the official headers located in tools/libs/*/include to tools/include. In order to support libraries with header name other than xen.h or with multiple headers add a LIBHEADER make variable a lib specific Makefile can set in that case. Move the headers.chk target from Rules.mk to libs.mk as it is used for libraries in tools/libs only. Add NO_HEADERS_CHK variable to skip checking headers as this will be needed e.g. for libxenctrl. Signed-off-by: Juergen Gross --- .gitignore | 1 + tools/Rules.mk | 8 -------- tools/libs/libs.mk | 26 +++++++++++++++++++++++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 36ce2ea104..5ea48af818 100644 --- a/.gitignore +++ b/.gitignore @@ -188,6 +188,7 @@ tools/hotplug/Linux/xendomains tools/hotplug/NetBSD/rc.d/xencommons tools/hotplug/NetBSD/rc.d/xendriverdomain tools/include/acpi +tools/include/*.h tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) diff --git a/tools/Rules.mk b/tools/Rules.mk index b42e50ebf6..5d699cfd39 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -225,14 +225,6 @@ INSTALL_PYTHON_PROG =3D \ %.opic: %.S $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPE= ND_CFLAGS) =20 -headers.chk: - for i in $(filter %.h,$^); do \ - $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \ - -S -o /dev/null $$i || exit 1; \ - echo $$i; \ - done >$@.new - mv $@.new $@ - subdirs-all subdirs-clean subdirs-install subdirs-distclean subdirs-uninst= all: .phony @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \ $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \ diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 8027ae7400..8045c00e9a 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -34,6 +34,10 @@ endif =20 PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 +LIBHEADER ?=3D xen$(LIBNAME).h +LIBHEADERS =3D $(foreach h, $(LIBHEADER), include/$(h)) +LIBHEADERSGLOB =3D $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(= h)) + $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) =20 @@ -47,7 +51,22 @@ build: .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) =20 -headers.chk: $(wildcard include/*.h) $(AUTOINCS) +ifneq ($(NO_HEADERS_CHK),y) +headers.chk: + for i in $(filter %.h,$^); do \ + $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \ + -S -o /dev/null $$i || exit 1; \ + echo $$i; \ + done >$@.new + mv $@.new $@ +else +.PHONY: headers.chk +endif + +headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS) + +$(LIBHEADERSGLOB): $(LIBHEADERS) + for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/inclu= de; done =20 libxen$(LIBNAME).a: $(LIB_OBJS) $(AR) rc $@ $^ @@ -68,13 +87,13 @@ install: build $(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir= )/libxen$(LIBNAME).so.$(MAJOR) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$= (LIBNAME).so - $(INSTALL_DATA) include/xen$(LIBNAME).h $(DESTDIR)$(includedir) + for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); d= one $(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR) =20 .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc - rm -f $(DESTDIR)$(includedir)/xen$(LIBNAME).h + for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR) @@ -90,6 +109,7 @@ clean: rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) rm -f headers.chk rm -f xen$(LIBNAME).pc + rm -f $(LIBHEADERSGLOB) =20 .PHONY: distclean distclean: clean --=20 2.26.2 From nobody Thu May 2 02:17:38 2024 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=1597496667; cv=none; d=zohomail.com; s=zohoarc; b=Zdg1AkScciKLlACBgTM53hv6rQyJQj0w71/4CwiDuFFXITcS2ewolqYU3UAhrww6PbUp6LxWOXT8tibjByH0+ibNupqvBBwlaWX6Tj5QR6OcexRSNSYS0XuGGOJFSID5Qo+UxI/EKETUmYee2tLcLgC2KcPtTwd5JL6XFJXNYwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496667; 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=xt3jZzD+JOScOQuyahKNCVvf+bZ3ZluY3UV6PVl/QD4=; b=oBO0rMxUFXATeNKtNp2v00RumE+IEbwq+Qr1yprJHxGFtO2SKe8GqQy3qXGd0lWwKkNPmAV2UiR3WcF9Iyu6WYP7UZF/mAScCZuWhAT7HX13w+42Ks0oUkUobUAWAf2DUTYlRoPNdbzo3Szh+qJ/fBABHOtvcQI98ioWy5Xm0GM= 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 1597496667918243.30402103551262; Sat, 15 Aug 2020 06:04:27 -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 1k6vqt-0006Sg-Qw; Sat, 15 Aug 2020 13:04:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6vqs-0006Qw-Lw for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:04:02 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 232fd730-ea1d-432d-a5ad-a8cbac3ec27c; Sat, 15 Aug 2020 13:03:51 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3D35EB57F; Sat, 15 Aug 2020 13:04:14 +0000 (UTC) X-Inumbo-ID: 232fd730-ea1d-432d-a5ad-a8cbac3ec27c 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 I v2 4/6] tools: don't call make recursively from libs.mk Date: Sat, 15 Aug 2020 15:03:39 +0200 Message-Id: <20200815130341.27147-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" During build of a xen library make is called again via libs.mk. This is not necessary as the same can be achieved by a simple dependency. Signed-off-by: Juergen Gross Reviewed-by: Ian Jackson --- tools/libs/libs.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 8045c00e9a..764f5441e2 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -45,8 +45,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) all: build =20 .PHONY: build -build: - $(MAKE) libs +build: libs =20 .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) --=20 2.26.2 From nobody Thu May 2 02:17:38 2024 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=1597496667; cv=none; d=zohomail.com; s=zohoarc; b=RwVU3t7fy4JqyiDt8EB1XXi3PqPlbU00DZwredHnbpWehPYF/iieHiwZIeY1h4CA25uqQlrXkaSUezUIjgMGqDa1012bWoFvsrVO1IDOuK+rCgYE3h1976sfc1KWPXYDtZpwi/82ImxeJ4LFANdowiqPOYfOwBB8hHVf/ZeCpaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496667; 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=omIBslkZ3gf3dpqWkHfDHOnm/Nq6WLEGLQWj8JWzHyU=; b=brVvQJ9Lr/QDJyMEfkUGh9I+cYcAhTz33A7vsfDqhk7e0bDAQ72hsrM80S0xBT8zg5vDFmfYJLDZ7Fiq9uh2KQLyklXcdOXH0c7qIh47EuZgRCBltxGMChb6rce9sZlFTXJU0gSil+XVp4nXGMLOf0HKnaT5Ekrlay6BfQUiIKY= 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 1597496667641882.0396661881717; Sat, 15 Aug 2020 06:04:27 -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 1k6vqu-0006Sr-3N; Sat, 15 Aug 2020 13:04:04 +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 1k6vqt-0006R1-5s for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:04:03 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1045f604-88e3-414d-b10f-d82fccd01c9d; Sat, 15 Aug 2020 13:03:53 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6362CB57B; Sat, 15 Aug 2020 13:04:14 +0000 (UTC) X-Inumbo-ID: 1045f604-88e3-414d-b10f-d82fccd01c9d 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 , Anthony PERARD Subject: [PATCH I v2 5/6] tools: define ROUNDUP() in tools/include/xen-tools/libs.h Date: Sat, 15 Aug 2020 15:03:40 +0200 Message-Id: <20200815130341.27147-6-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" Today there are multiple copies of the ROUNDUP() macro in various sources and headers. Define it once in tools/include/xen-tools/libs.h. Using xen-tools/libs.h enables removing copies of MIN() and MAX(), too. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/console/daemon/io.c | 6 +----- tools/include/xen-tools/libs.h | 4 ++++ tools/libs/call/buffer.c | 3 +-- tools/libs/foreignmemory/linux.c | 3 +-- tools/libs/gnttab/private.h | 3 --- tools/libxc/xg_private.h | 1 - tools/libxl/libxl_internal.h | 3 --- tools/xenstore/xenstored_core.c | 2 -- 8 files changed, 7 insertions(+), 18 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index a43c57edad..4af27ffc5d 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -49,9 +49,7 @@ #include #include #endif - -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#include =20 /* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */ #define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2) @@ -80,8 +78,6 @@ static struct pollfd *fds; static unsigned int current_array_size; static unsigned int nr_fds; =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) - struct buffer { char *data; size_t consumed; diff --git a/tools/include/xen-tools/libs.h b/tools/include/xen-tools/libs.h index cc7dfc8c64..a16e0c3807 100644 --- a/tools/include/xen-tools/libs.h +++ b/tools/include/xen-tools/libs.h @@ -59,4 +59,8 @@ }) #endif =20 +#ifndef ROUNDUP +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) +#endif + #endif /* __XEN_TOOLS_LIBS__ */ diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c index 0b6af2db60..085674d882 100644 --- a/tools/libs/call/buffer.c +++ b/tools/libs/call/buffer.c @@ -16,14 +16,13 @@ #include #include #include +#include =20 #include "private.h" =20 #define DBGPRINTF(_m...) \ xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m) =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) - pthread_mutex_t cache_mutex =3D PTHREAD_MUTEX_INITIALIZER; =20 static void cache_lock(xencall_handle *xcall) diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/li= nux.c index 8daa5828e3..fe73d5ab72 100644 --- a/tools/libs/foreignmemory/linux.c +++ b/tools/libs/foreignmemory/linux.c @@ -25,11 +25,10 @@ =20 #include #include +#include =20 #include "private.h" =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) - #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif diff --git a/tools/libs/gnttab/private.h b/tools/libs/gnttab/private.h index c5e23639b1..eb6a6abe54 100644 --- a/tools/libs/gnttab/private.h +++ b/tools/libs/gnttab/private.h @@ -5,9 +5,6 @@ #include #include =20 -/* Set of macros/defines used by both Linux and FreeBSD */ -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) - #define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f) #define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f) =20 diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h index f0a4b2c616..40b5baecde 100644 --- a/tools/libxc/xg_private.h +++ b/tools/libxc/xg_private.h @@ -95,7 +95,6 @@ typedef uint64_t x86_pgentry_t; #define PAGE_SIZE_X86 (1UL << PAGE_SHIFT_X86) #define PAGE_MASK_X86 (~(PAGE_SIZE_X86-1)) =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT) =20 =20 diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 94a23179d3..c63d0686fd 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -132,9 +132,6 @@ #define MB(_mb) (_AC(_mb, ULL) << 20) #define GB(_gb) (_AC(_gb, ULL) << 30) =20 -#define ROUNDUP(_val, _order) \ - (((unsigned long)(_val)+(1UL<<(_order))-1) & ~((1UL<<(_order))-1)) - #define DIV_ROUNDUP(n, d) (((n) + (d) - 1) / (d)) =20 #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_cor= e.c index 7bd959f28b..9700772d40 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -73,8 +73,6 @@ static unsigned int nr_fds; static int sock =3D -1; static int ro_sock =3D -1; =20 -#define ROUNDUP(_x, _w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w= ))-1)) - static bool verbose =3D false; LIST_HEAD(connections); int tracefd =3D -1; --=20 2.26.2 From nobody Thu May 2 02:17:38 2024 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=1597496668; cv=none; d=zohomail.com; s=zohoarc; b=Ikal3CTWCyxUO3NTZjWqnJPn/amhfLKFWHJ/2TMtnGjcKuy7wtwssIGKe3FEurWnc1gvaOGClBzWcVuG95i4dFkLbpWo3kvKUXos/q+zBsJBFg9jabWVb8N3QVD3ZgnH8UVGB1HTsykUws2dJcshgemAWnGZ1a/lDBAJxyai/6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597496668; 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=Cb/91x2qmXDogvL7WrAGNZgREGg15vQJJswZ+hM4jCM=; b=N38O6kSo2uekeFV9jOUwzi5OzYomR3Suy7Yi1CkiXqYo7CwiJnY+9RKC2rhq77uTl+N+/m2oVA66ouHCQElkfVa/ky9gErTI7llORsEmZ3F8a1zP/Qlp4khwQZuJAOYqGM6O17V+yPrB3CI81mHRE46BmPa3FptyGX5HcS2/PXo= 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 15974966682331004.9543371899122; Sat, 15 Aug 2020 06:04:28 -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 1k6vqz-0006V7-Co; Sat, 15 Aug 2020 13:04:09 +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 1k6vqy-0006R1-64 for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 13:04:08 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 36133b7e-3190-42d0-857b-32e0418b48e3; Sat, 15 Aug 2020 13:03:53 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8A595B584; Sat, 15 Aug 2020 13:04:14 +0000 (UTC) X-Inumbo-ID: 36133b7e-3190-42d0-857b-32e0418b48e3 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 I v2 6/6] tools: generate most contents of library make variables Date: Sat, 15 Aug 2020 15:03:41 +0200 Message-Id: <20200815130341.27147-7-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815130341.27147-1-jgross@suse.com> References: <20200815130341.27147-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" Library related make variables (CFLAGS_lib*, SHDEPS_lib*, LDLIBS_lib* and SHLIB_lib*) mostly have a common pattern for their values. Generate most of this content automatically by adding a new per-library variable defining on which other libraries a lib is depending. This in turn makes it possible to drop the USELIB variable from each library Makefile. The LIBNAME variable can be dropped, too, as it can be derived from the directory name the library is residing in. Signed-off-by: Juergen Gross --- tools/Rules.mk | 70 ++++++++++--------------------- tools/libs/call/Makefile | 2 - tools/libs/devicemodel/Makefile | 2 - tools/libs/evtchn/Makefile | 2 - tools/libs/foreignmemory/Makefile | 2 - tools/libs/gnttab/Makefile | 2 - tools/libs/hypfs/Makefile | 2 - tools/libs/libs.mk | 8 ++-- tools/libs/toolcore/Makefile | 1 - tools/libs/toollog/Makefile | 1 - 10 files changed, 27 insertions(+), 65 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 5d699cfd39..06827ad1d8 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -12,14 +12,24 @@ INSTALL =3D $(XEN_ROOT)/tools/cross-install LDFLAGS +=3D $(PREPEND_LDFLAGS_XEN_TOOLS) =20 XEN_INCLUDE =3D $(XEN_ROOT)/tools/include -XEN_libxentoolcore =3D $(XEN_ROOT)/tools/libs/toolcore -XEN_libxentoollog =3D $(XEN_ROOT)/tools/libs/toollog -XEN_libxenevtchn =3D $(XEN_ROOT)/tools/libs/evtchn -XEN_libxengnttab =3D $(XEN_ROOT)/tools/libs/gnttab -XEN_libxencall =3D $(XEN_ROOT)/tools/libs/call -XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/foreignmemory -XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel -XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs + +LIBS_LIBS +=3D toolcore +USELIBS_toolcore :=3D +LIBS_LIBS +=3D toollog +USELIBS_toollog :=3D +LIBS_LIBS +=3D evtchn +USELIBS_evtchn :=3D toollog toolcore +LIBS_LIBS +=3D gnttab +USELIBS_gnttab :=3D toollog toolcore +LIBS_LIBS +=3D call +USELIBS_call :=3D toollog toolcore +LIBS_LIBS +=3D foreignmemory +USELIBS_foreignmemory :=3D toollog toolcore +LIBS_LIBS +=3D devicemodel +USELIBS_devicemodel :=3D toollog toolcore call +LIBS_LIBS +=3D hypfs +USELIBS_hypfs :=3D toollog toolcore call + XEN_libxenctrl =3D $(XEN_ROOT)/tools/libxc # Currently libxenguest lives in the same directory as libxenctrl XEN_libxenguest =3D $(XEN_libxenctrl) @@ -99,45 +109,11 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) =20 -CFLAGS_libxentoollog =3D -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclud= e) -SHDEPS_libxentoollog =3D -LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libx= entoollog$(libextension) -SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_l= ibxentoollog) - -CFLAGS_libxentoolcore =3D -I$(XEN_libxentoolcore)/include $(CFLAGS_xenincl= ude) -SHDEPS_libxentoolcore =3D -LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/l= ibxentoolcore$(libextension) -SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _libxentoolcore) - -CFLAGS_libxenevtchn =3D -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) -SHDEPS_libxenevtchn =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxene= vtchn$(libextension) -SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_lib= xenevtchn) - -CFLAGS_libxengnttab =3D -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) -SHDEPS_libxengnttab =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxeng= nttab$(libextension) -SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_lib= xengnttab) - -CFLAGS_libxencall =3D -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) -SHDEPS_libxencall =3D $(SHLIB_libxentoolcore) -LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(l= ibextension) -SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_libxenc= all) - -CFLAGS_libxenforeignmemory =3D -I$(XEN_libxenforeignmemory)/include $(CFLA= GS_xeninclude) -SHDEPS_libxenforeignmemory =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_libxenf= oreignmemory)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_libxenforeignmemory) - -CFLAGS_libxendevicemodel =3D -I$(XEN_libxendevicemodel)/include $(CFLAGS_x= eninclude) -SHDEPS_libxendevicemodel =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore= ) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_libxendevic= emodel)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_libxendevicemodel) - -CFLAGS_libxenhypfs =3D -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) -SHDEPS_libxenhypfs =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SH= LIB_libxencall) -LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypf= s$(libextension) -SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_libxe= nhypfs) +$(foreach lib,$(LIBS_LIBS),$(eval XEN_libxen$(lib) =3D $(XEN_ROOT)/tools/l= ibs/$(lib))) +$(foreach lib,$(LIBS_LIBS),$(eval CFLAGS_libxen$(lib) =3D -I$(XEN_libxen$(= lib))/include $(CFLAGS_xeninclude))) +$(foreach lib,$(LIBS_LIBS),$(eval SHDEPS_libxen$(lib) =3D $(foreach use,$(= USELIBS_$(lib)),$(SHLIB_libxen$(use))))) +$(foreach lib,$(LIBS_LIBS),$(eval LDLIBS_libxen$(lib) =3D $(SHDEPS_libxen$= (lib)) $(XEN_libxen$(lib))/libxen$(lib)$(libextension))) +$(foreach lib,$(LIBS_LIBS),$(eval SHLIB_libxen$(lib) =3D $(SHDEPS_libxen$(= lib)) -Wl,-rpath-link=3D$(XEN_libxen$(lib)))) =20 # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 7994b411fa..81c7478efd 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 2 -LIBNAME :=3D call -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c buffer.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makef= ile index d9d1d1b850..42417958f2 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 3 -LIBNAME :=3D devicemodel -USELIBS :=3D toollog toolcore call =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index d7aa4d402f..aec76641e8 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 1 -LIBNAME :=3D evtchn -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/M= akefile index 823989681d..cf444d3c1a 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 3 -LIBNAME :=3D foreignmemory -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index c0fffdac71..d8d4d55e27 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 2 -LIBNAME :=3D gnttab -USELIBS :=3D toollog toolcore =20 SRCS-GNTTAB +=3D gnttab_core.c SRCS-GNTSHR +=3D gntshr_core.c diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index b4c41f6189..668d68853f 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 -LIBNAME :=3D hypfs -USELIBS :=3D toollog toolcore call =20 APPEND_LDFLAGS +=3D -lz =20 diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 764f5441e2..19efc5e743 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -1,18 +1,18 @@ # Common Makefile for building a lib. # # Variables taken as input: -# LIBNAME: name of lib to build, will be prepended with "libxen" # MAJOR: major version of lib # MINOR: minor version of lib -# USELIBS: xen libs to use (e.g. "toolcore toollog") + +LIBNAME :=3D $(notdir $(CURDIR)) =20 SHLIB_LDFLAGS +=3D -Wl,--version-script=3Dlibxen$(LIBNAME).map =20 CFLAGS +=3D -Werror -Wmissing-prototypes CFLAGS +=3D -I./include $(CFLAGS_xeninclude) -CFLAGS +=3D $(foreach lib, $(USELIBS), $(CFLAGS_libxen$(lib))) +CFLAGS +=3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) =20 -LDUSELIBS =3D $(foreach lib, $(USELIBS), $(LDLIBS_libxen$(lib))) +LDUSELIBS =3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib))) =20 LIB_OBJS :=3D $(SRCS-y:.c=3D.o) PIC_OBJS :=3D $(SRCS-y:.c=3D.opic) diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile index 85ff2b26fd..34b08a4236 100644 --- a/tools/libs/toolcore/Makefile +++ b/tools/libs/toolcore/Makefile @@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 -LIBNAME :=3D toolcore AUTOINCS :=3D include/_xentoolcore_list.h =20 SRCS-y +=3D handlereg.c diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 2d3ae4e627..3f986835d6 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 -LIBNAME :=3D toollog =20 SRCS-y +=3D xtl_core.c SRCS-y +=3D xtl_logger_stdio.c --=20 2.26.2