From nobody Thu Apr 18 10:41:02 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=1599652048; cv=none; d=zohomail.com; s=zohoarc; b=gyYXq3TgQ7gQRt1EDGUgWYrREOvnt3SdM+dpHYpH5tJswxOP5zNwATg6bJ8v3ttoOV8sbykBWtA92z5G7dKMjKMAeBDyuzbk0tZ7R7HgMPZmmTzVPNJ9gPp9tL/VDoAOOC/rrFWCswnHgnS1v2nnxCSFwo4tAdFjmAnHsI1o3P0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599652048; 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=lrWWutK61DgN8WKJesc/OGZPBH91povhpkvG55kQ2Tw=; b=hRBJ7CqbZZYwqhyxo2tuG3DaybRQOihYnI/XOZdHDRly+VBUNmd56q8gEEWPcQ1z5NfFAQLv+sg67O0HKlFKfSNPLgPWF4P7e/lnm96EsFzll491BriLbmQfX5W3X+eGQVp3NnN0pHn7nXusJs6hy/0Yc9vcmlmuALN0SB8/C/4= 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 1599652048621513.1717130601036; Wed, 9 Sep 2020 04:47: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 1kFyZ4-0003zI-3Z; Wed, 09 Sep 2020 11:47:02 +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 1kFyZ3-0003uJ-3P for xen-devel@lists.xenproject.org; Wed, 09 Sep 2020 11:47:01 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 35689053-48cd-4446-9f5a-a8ff14f692c7; Wed, 09 Sep 2020 11:46:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AEE30ACCC; Wed, 9 Sep 2020 11:46:48 +0000 (UTC) X-Inumbo-ID: 35689053-48cd-4446-9f5a-a8ff14f692c7 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 , Nick Rosbrook , Anthony PERARD , Shriram Rajagopalan , Yang Hongyang , Christian Lindig , David Scott Subject: [PATCH v5 1/4] tools/libxl: move libxenlight to tools/libs/light Date: Wed, 9 Sep 2020 13:46:42 +0200 Message-Id: <20200909114645.3709-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909114645.3709-1-jgross@suse.com> References: <20200909114645.3709-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" Carve out all libxenlight related sources and move them to tools/libs/light in order to use the generic library build environment. The closely related sources for libxl-save-helper and the libxl test environment are being moved, too. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 31 +- tools/Rules.mk | 11 +- tools/configure | 2 +- tools/configure.ac | 2 +- tools/golang/xenlight/Makefile | 2 +- tools/libs/Makefile | 1 + tools/libs/light/CODING_STYLE | 330 ++++++++++++++++++ tools/libs/light/Makefile | 277 +++++++++++++++ .../light}/check-libxl-api-rules | 0 tools/{libxl =3D> libs/light}/flexarray.c | 0 tools/{libxl =3D> libs/light}/flexarray.h | 0 tools/{libxl =3D> libs/light}/gentest.py | 0 tools/{libxl =3D> libs/light}/gentypes.py | 0 tools/{libxl =3D> libs/light}/idl.py | 0 tools/{libxl =3D> libs/light}/idl.txt | 0 tools/{libxl =3D> libs/light/include}/libxl.h | 0 .../light/include}/libxl_event.h | 0 .../light/include}/libxl_json.h | 0 .../light/include}/libxl_utils.h | 0 .../light/include}/libxl_uuid.h | 0 tools/{libxl =3D> libs/light}/libxl.c | 0 tools/{libxl =3D> libs/light}/libxl_9pfs.c | 0 tools/{libxl =3D> libs/light}/libxl_aoutils.c | 0 tools/{libxl =3D> libs/light}/libxl_arch.h | 0 tools/{libxl =3D> libs/light}/libxl_arm.c | 0 tools/{libxl =3D> libs/light}/libxl_arm.h | 0 tools/{libxl =3D> libs/light}/libxl_arm_acpi.c | 0 .../{libxl =3D> libs/light}/libxl_arm_no_acpi.c | 0 .../{libxl =3D> libs/light}/libxl_bootloader.c | 0 .../light}/libxl_checkpoint_device.c | 0 tools/{libxl =3D> libs/light}/libxl_colo.h | 0 tools/{libxl =3D> libs/light}/libxl_colo_nic.c | 0 .../{libxl =3D> libs/light}/libxl_colo_proxy.c | 0 .../{libxl =3D> libs/light}/libxl_colo_qdisk.c | 0 .../light}/libxl_colo_restore.c | 0 tools/{libxl =3D> libs/light}/libxl_colo_save.c | 0 tools/{libxl =3D> libs/light}/libxl_console.c | 0 .../light}/libxl_convert_callout.c | 0 tools/{libxl =3D> libs/light}/libxl_cpuid.c | 0 tools/{libxl =3D> libs/light}/libxl_cpupool.c | 0 tools/{libxl =3D> libs/light}/libxl_create.c | 0 tools/{libxl =3D> libs/light}/libxl_device.c | 0 tools/{libxl =3D> libs/light}/libxl_disk.c | 0 tools/{libxl =3D> libs/light}/libxl_dm.c | 0 tools/{libxl =3D> libs/light}/libxl_dom.c | 0 tools/{libxl =3D> libs/light}/libxl_dom_save.c | 0 .../{libxl =3D> libs/light}/libxl_dom_suspend.c | 0 tools/{libxl =3D> libs/light}/libxl_domain.c | 0 tools/{libxl =3D> libs/light}/libxl_event.c | 0 tools/{libxl =3D> libs/light}/libxl_exec.c | 0 tools/{libxl =3D> libs/light}/libxl_flask.c | 0 tools/{libxl =3D> libs/light}/libxl_fork.c | 0 tools/{libxl =3D> libs/light}/libxl_freebsd.c | 0 tools/{libxl =3D> libs/light}/libxl_genid.c | 0 tools/{libxl =3D> libs/light}/libxl_internal.c | 0 tools/{libxl =3D> libs/light}/libxl_internal.h | 0 tools/{libxl =3D> libs/light}/libxl_json.c | 0 .../light}/libxl_libfdt_compat.c | 0 .../light}/libxl_libfdt_compat.h | 0 tools/{libxl =3D> libs/light}/libxl_linux.c | 0 tools/{libxl =3D> libs/light}/libxl_mem.c | 0 tools/{libxl =3D> libs/light}/libxl_netbsd.c | 0 tools/{libxl =3D> libs/light}/libxl_netbuffer.c | 0 tools/{libxl =3D> libs/light}/libxl_nic.c | 0 tools/{libxl =3D> libs/light}/libxl_no_colo.c | 0 .../light}/libxl_no_convert_callout.c | 0 tools/{libxl =3D> libs/light}/libxl_nocpuid.c | 0 .../{libxl =3D> libs/light}/libxl_nonetbuffer.c | 0 tools/{libxl =3D> libs/light}/libxl_numa.c | 0 tools/{libxl =3D> libs/light}/libxl_osdeps.h | 0 tools/{libxl =3D> libs/light}/libxl_paths.c | 0 tools/{libxl =3D> libs/light}/libxl_pci.c | 0 tools/{libxl =3D> libs/light}/libxl_psr.c | 0 tools/{libxl =3D> libs/light}/libxl_pvcalls.c | 0 tools/{libxl =3D> libs/light}/libxl_qmp.c | 0 tools/{libxl =3D> libs/light}/libxl_remus.c | 0 .../light}/libxl_remus_disk_drbd.c | 0 .../light}/libxl_save_callout.c | 0 .../{libxl =3D> libs/light}/libxl_save_helper.c | 0 .../light}/libxl_save_msgs_gen.pl | 0 tools/{libxl =3D> libs/light}/libxl_sched.c | 0 .../light}/libxl_sr_stream_format.h | 0 .../{libxl =3D> libs/light}/libxl_stream_read.c | 0 .../light}/libxl_stream_write.c | 0 .../light}/libxl_test_fdevent.c | 0 .../light}/libxl_test_fdevent.h | 0 .../light}/libxl_test_timedereg.c | 0 .../light}/libxl_test_timedereg.h | 0 tools/{libxl =3D> libs/light}/libxl_tmem.c | 0 tools/{libxl =3D> libs/light}/libxl_types.idl | 0 .../light}/libxl_types_internal.idl | 0 tools/{libxl =3D> libs/light}/libxl_usb.c | 0 tools/{libxl =3D> libs/light}/libxl_utils.c | 0 tools/{libxl =3D> libs/light}/libxl_uuid.c | 0 tools/{libxl =3D> libs/light}/libxl_vdispl.c | 0 tools/{libxl =3D> libs/light}/libxl_vkb.c | 0 tools/{libxl =3D> libs/light}/libxl_vnuma.c | 0 tools/{libxl =3D> libs/light}/libxl_vsnd.c | 0 tools/{libxl =3D> libs/light}/libxl_vtpm.c | 0 tools/{libxl =3D> libs/light}/libxl_x86.c | 0 tools/{libxl =3D> libs/light}/libxl_x86_acpi.c | 0 tools/{libxl =3D> libs/light}/libxl_x86_acpi.h | 0 tools/{libxl =3D> libs/light}/libxl_xshelp.c | 0 tools/{libxl =3D> libs/light}/osdeps.c | 0 tools/{libxl =3D> libs/light}/test_common.c | 0 tools/{libxl =3D> libs/light}/test_common.h | 0 .../{libxl =3D> libs/light}/test_fdderegrace.c | 0 tools/{libxl =3D> libs/light}/test_timedereg.c | 0 tools/libs/uselibs.mk | 2 + tools/libxl/Makefile | 278 +-------------- tools/ocaml/libs/xl/Makefile | 8 +- 111 files changed, 645 insertions(+), 299 deletions(-) create mode 100644 tools/libs/light/CODING_STYLE create mode 100644 tools/libs/light/Makefile rename tools/{libxl =3D> libs/light}/check-libxl-api-rules (100%) rename tools/{libxl =3D> libs/light}/flexarray.c (100%) rename tools/{libxl =3D> libs/light}/flexarray.h (100%) rename tools/{libxl =3D> libs/light}/gentest.py (100%) rename tools/{libxl =3D> libs/light}/gentypes.py (100%) rename tools/{libxl =3D> libs/light}/idl.py (100%) rename tools/{libxl =3D> libs/light}/idl.txt (100%) rename tools/{libxl =3D> libs/light/include}/libxl.h (100%) rename tools/{libxl =3D> libs/light/include}/libxl_event.h (100%) rename tools/{libxl =3D> libs/light/include}/libxl_json.h (100%) rename tools/{libxl =3D> libs/light/include}/libxl_utils.h (100%) rename tools/{libxl =3D> libs/light/include}/libxl_uuid.h (100%) rename tools/{libxl =3D> libs/light}/libxl.c (100%) rename tools/{libxl =3D> libs/light}/libxl_9pfs.c (100%) rename tools/{libxl =3D> libs/light}/libxl_aoutils.c (100%) rename tools/{libxl =3D> libs/light}/libxl_arch.h (100%) rename tools/{libxl =3D> libs/light}/libxl_arm.c (100%) rename tools/{libxl =3D> libs/light}/libxl_arm.h (100%) rename tools/{libxl =3D> libs/light}/libxl_arm_acpi.c (100%) rename tools/{libxl =3D> libs/light}/libxl_arm_no_acpi.c (100%) rename tools/{libxl =3D> libs/light}/libxl_bootloader.c (100%) rename tools/{libxl =3D> libs/light}/libxl_checkpoint_device.c (100%) rename tools/{libxl =3D> libs/light}/libxl_colo.h (100%) rename tools/{libxl =3D> libs/light}/libxl_colo_nic.c (100%) rename tools/{libxl =3D> libs/light}/libxl_colo_proxy.c (100%) rename tools/{libxl =3D> libs/light}/libxl_colo_qdisk.c (100%) rename tools/{libxl =3D> libs/light}/libxl_colo_restore.c (100%) rename tools/{libxl =3D> libs/light}/libxl_colo_save.c (100%) rename tools/{libxl =3D> libs/light}/libxl_console.c (100%) rename tools/{libxl =3D> libs/light}/libxl_convert_callout.c (100%) rename tools/{libxl =3D> libs/light}/libxl_cpuid.c (100%) rename tools/{libxl =3D> libs/light}/libxl_cpupool.c (100%) rename tools/{libxl =3D> libs/light}/libxl_create.c (100%) rename tools/{libxl =3D> libs/light}/libxl_device.c (100%) rename tools/{libxl =3D> libs/light}/libxl_disk.c (100%) rename tools/{libxl =3D> libs/light}/libxl_dm.c (100%) rename tools/{libxl =3D> libs/light}/libxl_dom.c (100%) rename tools/{libxl =3D> libs/light}/libxl_dom_save.c (100%) rename tools/{libxl =3D> libs/light}/libxl_dom_suspend.c (100%) rename tools/{libxl =3D> libs/light}/libxl_domain.c (100%) rename tools/{libxl =3D> libs/light}/libxl_event.c (100%) rename tools/{libxl =3D> libs/light}/libxl_exec.c (100%) rename tools/{libxl =3D> libs/light}/libxl_flask.c (100%) rename tools/{libxl =3D> libs/light}/libxl_fork.c (100%) rename tools/{libxl =3D> libs/light}/libxl_freebsd.c (100%) rename tools/{libxl =3D> libs/light}/libxl_genid.c (100%) rename tools/{libxl =3D> libs/light}/libxl_internal.c (100%) rename tools/{libxl =3D> libs/light}/libxl_internal.h (100%) rename tools/{libxl =3D> libs/light}/libxl_json.c (100%) rename tools/{libxl =3D> libs/light}/libxl_libfdt_compat.c (100%) rename tools/{libxl =3D> libs/light}/libxl_libfdt_compat.h (100%) rename tools/{libxl =3D> libs/light}/libxl_linux.c (100%) rename tools/{libxl =3D> libs/light}/libxl_mem.c (100%) rename tools/{libxl =3D> libs/light}/libxl_netbsd.c (100%) rename tools/{libxl =3D> libs/light}/libxl_netbuffer.c (100%) rename tools/{libxl =3D> libs/light}/libxl_nic.c (100%) rename tools/{libxl =3D> libs/light}/libxl_no_colo.c (100%) rename tools/{libxl =3D> libs/light}/libxl_no_convert_callout.c (100%) rename tools/{libxl =3D> libs/light}/libxl_nocpuid.c (100%) rename tools/{libxl =3D> libs/light}/libxl_nonetbuffer.c (100%) rename tools/{libxl =3D> libs/light}/libxl_numa.c (100%) rename tools/{libxl =3D> libs/light}/libxl_osdeps.h (100%) rename tools/{libxl =3D> libs/light}/libxl_paths.c (100%) rename tools/{libxl =3D> libs/light}/libxl_pci.c (100%) rename tools/{libxl =3D> libs/light}/libxl_psr.c (100%) rename tools/{libxl =3D> libs/light}/libxl_pvcalls.c (100%) rename tools/{libxl =3D> libs/light}/libxl_qmp.c (100%) rename tools/{libxl =3D> libs/light}/libxl_remus.c (100%) rename tools/{libxl =3D> libs/light}/libxl_remus_disk_drbd.c (100%) rename tools/{libxl =3D> libs/light}/libxl_save_callout.c (100%) rename tools/{libxl =3D> libs/light}/libxl_save_helper.c (100%) rename tools/{libxl =3D> libs/light}/libxl_save_msgs_gen.pl (100%) rename tools/{libxl =3D> libs/light}/libxl_sched.c (100%) rename tools/{libxl =3D> libs/light}/libxl_sr_stream_format.h (100%) rename tools/{libxl =3D> libs/light}/libxl_stream_read.c (100%) rename tools/{libxl =3D> libs/light}/libxl_stream_write.c (100%) rename tools/{libxl =3D> libs/light}/libxl_test_fdevent.c (100%) rename tools/{libxl =3D> libs/light}/libxl_test_fdevent.h (100%) rename tools/{libxl =3D> libs/light}/libxl_test_timedereg.c (100%) rename tools/{libxl =3D> libs/light}/libxl_test_timedereg.h (100%) rename tools/{libxl =3D> libs/light}/libxl_tmem.c (100%) rename tools/{libxl =3D> libs/light}/libxl_types.idl (100%) rename tools/{libxl =3D> libs/light}/libxl_types_internal.idl (100%) rename tools/{libxl =3D> libs/light}/libxl_usb.c (100%) rename tools/{libxl =3D> libs/light}/libxl_utils.c (100%) rename tools/{libxl =3D> libs/light}/libxl_uuid.c (100%) rename tools/{libxl =3D> libs/light}/libxl_vdispl.c (100%) rename tools/{libxl =3D> libs/light}/libxl_vkb.c (100%) rename tools/{libxl =3D> libs/light}/libxl_vnuma.c (100%) rename tools/{libxl =3D> libs/light}/libxl_vsnd.c (100%) rename tools/{libxl =3D> libs/light}/libxl_vtpm.c (100%) rename tools/{libxl =3D> libs/light}/libxl_x86.c (100%) rename tools/{libxl =3D> libs/light}/libxl_x86_acpi.c (100%) rename tools/{libxl =3D> libs/light}/libxl_x86_acpi.h (100%) rename tools/{libxl =3D> libs/light}/libxl_xshelp.c (100%) rename tools/{libxl =3D> libs/light}/osdeps.c (100%) rename tools/{libxl =3D> libs/light}/test_common.c (100%) rename tools/{libxl =3D> libs/light}/test_common.h (100%) rename tools/{libxl =3D> libs/light}/test_fdderegrace.c (100%) rename tools/{libxl =3D> libs/light}/test_timedereg.c (100%) diff --git a/.gitignore b/.gitignore index 5e8c47e2db..f30550255f 100644 --- a/.gitignore +++ b/.gitignore @@ -128,6 +128,22 @@ tools/libs/guest/xc_core.h tools/libs/guest/xc_core_arm.h tools/libs/guest/xc_core_x86.h tools/libs/guest/xc_private.h +tools/libs/light/_*.[ch] +tools/libs/light/*.pyc +tools/libs/light/_libxl.api-for-check +tools/libs/light/*.api-ok +tools/libs/light/libxenlight.map +tools/libs/light/libxl-save-helper +tools/libs/light/dsdt* +tools/libs/light/mk_dsdt +tools/libs/light/ssdt* +tools/libs/light/testidl +tools/libs/light/testidl.c +tools/libs/light/test_timedereg +tools/libs/light/test_fdderegrace +tools/libs/light/tmp.* +tools/libs/light/xenlight.pc +tools/libs/light/include/_*.h tools/libs/stat/_paths.h tools/libs/stat/headers.chk tools/libs/stat/libxenstat.map @@ -216,16 +232,8 @@ tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker -tools/libxl/_libxl.api-for-check -tools/libxl/*.api-ok tools/libxl/*.pc -tools/libxl/dsdt* tools/libxl/libxlu_cfg_y.output -tools/libxl/mk_dsdt -tools/libxl/ssdt* -tools/libxl/testenum -tools/libxl/testenum.c -tools/libxl/tmp.* tools/misc/cpuperf/cpuperf-perfcntr tools/misc/cpuperf/cpuperf-xen tools/misc/xc_shadow @@ -380,13 +388,6 @@ tools/include/xen-foreign/arm64.h tools/misc/xen-hptool tools/misc/xen-mfndump tools/libs/toolcore/include/_*.h -tools/libxl/_*.[ch] -tools/libxl/testidl -tools/libxl/testidl.c -tools/libxl/*.pyc -tools/libxl/libxl-save-helper -tools/libxl/test_timedereg -tools/libxl/test_fdderegrace tools/firmware/etherboot/eb-roms.h tools/firmware/etherboot/gpxe-git-snapshot.tar.gz tools/misc/xenhypfs diff --git a/tools/Rules.mk b/tools/Rules.mk index 4fd91fa444..94a736a231 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,9 +15,7 @@ XEN_INCLUDE =3D $(XEN_ROOT)/tools/include =20 include $(XEN_ROOT)/tools/libs/uselibs.mk =20 -XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl -# Currently libxlutil lives in the same directory as libxenlight -XEN_libxlutil =3D $(XEN_libxenlight) +XEN_libxlutil =3D $(XEN_ROOT)/tools/libxl =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -107,6 +105,8 @@ ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 +CFLAGS_libxenlight +=3D $(CFLAGS_libxenctrl) + ifeq ($(debug),y) # Disable optimizations CFLAGS +=3D -O0 -fno-omit-frame-pointer @@ -116,11 +116,6 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -CFLAGS_libxenlight =3D -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_= xeninclude) -SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bxenhypfs) $(SHLIB_libxenguest) -LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenligh= t$(libextension) -SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_libxe= nlight) - CFLAGS_libxlutil =3D -I$(XEN_libxlutil) SHDEPS_libxlutil =3D $(SHLIB_libxenlight) LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libex= tension) diff --git a/tools/configure b/tools/configure index edcdcf4f73..8a708e9baa 100755 --- a/tools/configure +++ b/tools/configure @@ -585,7 +585,7 @@ PACKAGE_STRING=3D'Xen Hypervisor Tools 4.15' PACKAGE_BUGREPORT=3D'xen-devel@lists.xen.org' PACKAGE_URL=3D'https://www.xen.org/' =20 -ac_unique_file=3D"libxl/libxl.c" +ac_unique_file=3D"libs/light/libxl.c" # Factoring default headers for most tests. ac_includes_default=3D"\ #include diff --git a/tools/configure.ac b/tools/configure.ac index 6614a4f130..ee8ba5ff24 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ([2.67]) AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]= ), [xen-devel@lists.xen.org], [xen], [https://www.xen.org/]) -AC_CONFIG_SRCDIR([libxl/libxl.c]) +AC_CONFIG_SRCDIR([libs/light/libxl.c]) AC_CONFIG_FILES([ ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile index b17095e64b..fd8e4893db 100644 --- a/tools/golang/xenlight/Makefile +++ b/tools/golang/xenlight/Makefile @@ -8,7 +8,7 @@ GOXL_INSTALL_DIR =3D $(GOCODE_DIR)/src/$(XEN_GOCODE_URL)/xe= nlight/ =20 GO ?=3D go =20 -LIBXL_SRC_DIR =3D ../../libxl +LIBXL_SRC_DIR =3D $(XEN_ROOT)/tools/libs/light =20 .PHONY: all all: build diff --git a/tools/libs/Makefile b/tools/libs/Makefile index e8fcd59214..c41455c604 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -15,6 +15,7 @@ SUBDIRS-y +=3D hypfs SUBDIRS-y +=3D store SUBDIRS-y +=3D stat SUBDIRS-$(CONFIG_Linux) +=3D vchan +SUBDIRS-y +=3D light =20 ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D toolcore diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE new file mode 100644 index 0000000000..3d572f6925 --- /dev/null +++ b/tools/libs/light/CODING_STYLE @@ -0,0 +1,330 @@ +LIBXENLIGHT CODING STYLE +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +AN APOLOGY AND WARNING +---------------------- + +Much of the code in libxl does not yet follow this coding style +document in every respect. However, new code is expected to conform. + +Patches to improve the style of existing code are welcome. Please +separate these out from functional changes. + +If it is not feasible to conform fully to the style while patching old +code, without doing substantial style reengineering first, we may +accept patches which contain nonconformant elements, provided that +they don't make the coding style problem worse overall. + +In this case, the new code should conform to the prevailing style in +the area being touched. + + +MEMORY ALLOCATION +----------------- + +Memory allocation for libxl-internal purposes should normally be done +with the provided gc mechanisms; there is then no need to free. See +"libxl memory management" in libxl.h. + + +CONVENTIONAL VARIABLE NAMES +--------------------------- + +The following local variable names should be used where applicable: + + int rc; /* a libxl error code - and not anything else */ + int r; /* the return value from a system call (or libxc call) */ + bool ok; /* the success return value from a boolean function */ + + uint32_t domid; + libxl__gc *gc; + libxl__egc *egc; + libxl__ao *ao; + + libxl_foo_bar_state *fbs; /* local variable */ + libxl_foo_bar_state foo_bar; /* inside another state struct */ + + +CONVENIENCE MACROS +------------------ + +There are a number of convenience macros which shorten the program and +avoid opportunity for mistakes. In some cases non-use of the macros +produces functional bugs or incorrect error handling. Use the macros +whenever they are applicable. For example: + + Usually, don't use: Instead, use (see libxl_internal.h): + libxl__log[v] LOG, LOGE, LOGEV + libxl__sprintf GCSPRINTF + libxl__*alloc et al. GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY + isalnum etc. directly CTYPE + libxl__ctx_[un]lock CTX_LOCK, CTX_UNLOCK + gc=3D...; ao=3D...; EGC_GC, AO_GC, STATE_AO_GC + explicit gc creation GC_INIT, GC_FREE + memset(..,0,sizeof..) FILLZERO + +Instead of malloc et al one should (as an exception to the above) use +libxl__{zalloc,calloc,realloc} etc but passing NOGC. + +ERROR HANDLING +-------------- + +Unless, there are good reasons to do otherwise, the following error +handling and cleanup paradigm should be used: + + * All local variables referring to resources which might need + cleaning up are declared at the top of the function, and + initialised to a sentinel value indicating "nothing allocated". + For example, + libxl_evgen_disk_eject *evg =3D NULL; + int nullfd =3D -1; + + * If the function is to return a libxl error value, `rc' is + used to contain the error code, but it is NOT initialised: + int rc; + + * There is only one error cleanup path out of the function. It + starts with a label `out:'. That error cleanup path checks for + each allocated resource and frees it iff necessary. It then + returns rc. For example, + out: + if (evg) libxl__evdisable_disk_eject(gc, evg); + if (nullfd >=3D 0) close(nullfd); + return rc; + + * Function calls which might fail (ie most function calls) are + handled by putting the return/status value into a variable, and + then checking it in a separate statement: + char *dompath =3D libxl__xs_get_dompath(gc, bl->domid); + if (!dompath) { rc =3D ERROR_FAIL; goto out; } + + * If a resource is freed in the main body of the function (for + example, in a loop), the corresponding variable has to be reset to + the sentinel at the point where it's freed. + +Whether to use the `out' path for successful returns as well as error +returns is a matter of taste and convenience for the specific +function. Not reusing the out path is fine if the duplicated function +exit code is only `CTX_UNLOCK; GC_FREE;' (or similar). + +If you reuse the `out' path for successful returns, there may be +resources which are to be returned to the caller rather than freed. +In that case you have to reset the local variable to `nothing here', +to avoid the resource being freed on the out path. That resetting +should be done immediately after the resource value is stored at the +applicable _r function parameter (or equivalent). Do not test `rc' in +the out section, to discover whether to free things. + +The uses of the single-line formatting in the examples above are +permitted exceptions to the usual libxl code formatting rules. + + + +IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION +-------------------------------------------------- + +Nontrivial data structures (in structs) should come with an idempotent +_dispose function, which must free all resources associated with the +data structure (but not free the struct itself). + +Such a struct should also come with an _init function which +initialises the struct so that _dispose is a no-op. + + +ASYNCHRONOUS/LONG-RUNNING OPERATIONS +------------------------------------ + +All long-running operations in libxl need to use the asynchronous +operation machinery. Consult the programmer documentation in +libxl_internal.h for details - search for "Machinery for asynchronous +operations". + +The code for asynchronous operations should be laid out in +chronological order. That is, where there is a chain of callback +functions, each subsequent function should be, textually, the next +function in the file. This will normally involve predeclaring the +callback functions. Synchronous helper functions should be separated +out into a section preceding the main callback chain. + +Control flow arrangements in asynchronous operations should be made as +simple as possible, because it can otherwise be very hard to see +through the tangle. + + +When inventing a new sub-operation in asynchronous code, consider +whether to structure it formally as a sub-operation with its own state +structure. (See, for example, libxl__datacopier_*.) + +An ao-suboperation state structure should contain, in this order: + * fields that the caller must fill in, and which are, + effectively, the parameters to the operation, including: + - libxl__ao *ao + - the callback function pointer(s), which + should be named callback or callback_*. + * shared information fields or ones used for returning information + to the calling operation + * private fields +These sections should be clearly demarcated by comments. + +An asynchronous operation should normally have an idempotent stop or +cancel function. It should normally also have an _init function for +its state struct, which arranges that the stop is a no-op. + +The permitted order of calls into your ao operation's methods must be +documented in comments, if it is nontrivial. + + +When using an ao sub-operation, you should normally: + * Physically include the sub-operation state struct in your + own state struct; + * Use CONTAINER_OF to find your own state struct at the start of + your implementations of the sub-operation callback functions; + * Unconditionally initialise the sub-operation's struct (with its + _init method) in your own _init method. + * Unconditionally cancel or destroy the sub-operation in your own + cancel or destroy method. + + +FORMATTING AND NAMING +--------------------- + +Blatantly copied from qemu and linux with few modifications. + + +1. Whitespace + +Of course, the most important aspect in any coding style is whitespace. +Crusty old coders who have trouble spotting the glasses on their noses +can tell the difference between a tab and eight spaces from a distance +of approximately fifteen parsecs. Many a flamewar have been fought and +lost on this issue. + +Libxenlight indents are four spaces. Tabs are never used, except in +Makefiles where they have been irreversibly coded into the syntax. +Spaces of course are superior to tabs because: + + - You have just one way to specify whitespace, not two. Ambiguity breeds + mistakes. + - The confusion surrounding 'use tabs to indent, spaces to justify' is go= ne. + - Tab indents push your code to the right, making your screen seriously + unbalanced. + - Tabs will be rendered incorrectly on editors who are misconfigured not + to use tab stops of eight positions. + - Tabs are rendered badly in patches, causing off-by-one errors in almost + every line. + - It is the libxenlight coding style. + +Do not leave whitespace dangling off the ends of lines. + + +2. Line width + +Lines are limited to 75 characters. + +Rationale: + - Some people like to tile their 24" screens with a 6x4 matrix of 80x24 + xterms and use vi in all of them. The best way to punish them is to + let them keep doing it. + - In an 80 column terminal, some room needs to be left for > quoting + characters, +/- diff characters, and so on, in emails. + - Code and especially patches is much more readable if limited to a sane + line length. Eighty is traditional. + - It is the libxenlight coding style. + + +3. Naming + +C is a Spartan language, and so should your naming be. Unlike Modula-2 +and Pascal programmers, C programmers do not use cute names like +ThisVariableIsATemporaryCounter. A C programmer would call that +variable "tmp", which is much easier to write, and not the least more +difficult to understand. + +HOWEVER, while mixed-case names are frowned upon, descriptive names for +global variables are a must. To call a global function "foo" is a +shooting offense. + +GLOBAL variables (to be used only if you _really_ need them) need to +have descriptive names, as do global functions. If you have a function +that counts the number of active users, you should call that +"count_active_users()" or similar, you should _not_ call it "cntusr()". + +Encoding the type of a function into the name (so-called Hungarian +notation) is brain damaged - the compiler knows the types anyway and can +check those, and it only confuses the programmer. + +LOCAL variable names should be short, and to the point. If you have +some random integer loop counter, it should probably be called "i". +Calling it "loop_counter" is non-productive, if there is no chance of it +being mis-understood. Similarly, "tmp" can be just about any type of +variable that is used to hold a temporary value. + +Local variables used to store return values should have descriptive name +like "rc" or "ret". Following the same reasoning the label used as exit +path should be called "out". + +Function arguments which are used to return values to the caller +should be suffixed `_r' or `_out'. + +Variables, type names and function names are +lower_case_with_underscores. +Type names and function names use the prefix libxl__ when internal to +libxenlight and libxl_ when exported in libxl.h. +Xl should avoid using libxl_ and libxl__ as prefix for its own function +names. + +When wrapping standard library functions, use the prefix libxl_ to alert +readers that they are seeing a wrapped version; otherwise avoid this prefi= x. + +Typedefs are used to eliminate the redundant 'struct' keyword. +It is the libxenlight coding style. + + +4. Statements + +Don't put multiple statements on a single line. +Don't put multiple assignments on a single line either. +Error code paths with an if statement and a goto or a return on the same +line are allowed. Examples: + + if (rc) goto out; + if (rc < 0) return; + +Libxenlight coding style is super simple. Avoid tricky expressions. + + +5. Block structure + +Every indented statement is braced, but blocks that contain just one +statement may have the braces omitted. To avoid confusion, either all +the blocks in an if...else chain have braces, or none of them do. + +The opening brace is on the line that contains the control flow +statement that introduces the new block; the closing brace is on the +same line as the else keyword, or on a line by itself if there is no +else keyword. Examples: + + if (a =3D=3D 5) { + printf("a was 5.\n"); + } else if (a =3D=3D 6) { + printf("a was 6.\n"); + } else { + printf("a was something else entirely.\n"); + } + + if (a =3D=3D 5) + printf("a was 5.\n"); + +An exception is the opening brace for a function; for reasons of tradition +and clarity it comes on a line by itself: + + void a_function(void) + { + do_something(); + } + +Rationale: a consistent (except for functions...) bracing style reduces +ambiguity and avoids needless churn when lines are added or removed. +Furthermore, it is the libxenlight coding style. + diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile new file mode 100644 index 0000000000..f58a3214e5 --- /dev/null +++ b/tools/libs/light/Makefile @@ -0,0 +1,277 @@ +XEN_ROOT =3D $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +SRCS-y +=3D osdeps.c +SRCS-y +=3D libxl_paths.c +SRCS-y +=3D libxl_bootloader.c +SRCS-y +=3D flexarray.c +ifeq ($(CONFIG_LIBNL),y) +SRCS-y +=3D libxl_netbuffer.c +else +SRCS-y +=3D libxl_nonetbuffer.c +endif +ifeq ($(CONFIG_X86),y) +SRCS-y +=3D libxl_convert_callout.c +else +SRCS-y +=3D libxl_no_convert_callout.c +endif +SRCS-y +=3D libxl_remus.c +SRCS-y +=3D libxl_checkpoint_device.c +SRCS-y +=3D libxl_remus_disk_drbd.c +ifeq ($(CONFIG_LIBNL),y) +SRCS-y +=3D libxl_colo_restore.c +SRCS-y +=3D libxl_colo_save.c +SRCS-y +=3D libxl_colo_qdisk.c +SRCS-y +=3D libxl_colo_proxy.c +SRCS-y +=3D libxl_colo_nic.c +else +SRCS-y +=3D libxl_no_colo.c +endif + +ACPI_PATH =3D $(XEN_ROOT)/tools/libacpi +DSDT_FILES-$(CONFIG_X86) =3D dsdt_pvh.c +ACPI_OBJS =3D $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o +ACPI_PIC_OBJS =3D $(patsubst %.o,%.opic,$(ACPI_OBJS)) +$(DSDT_FILES-y): acpi +vpath build.c $(ACPI_PATH)/ +vpath static_tables.c $(ACPI_PATH)/ + +.PHONY: acpi +acpi: + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) DSDT_FILES=3D"$(DSDT_F= ILES-y)" + +SRCS-$(CONFIG_X86) +=3D $(ACPI_OBJS:.o=3D.c) + +CFLAGS +=3D -Wno-format-zero-length -Wmissing-declarations \ + -Wno-declaration-after-statement -Wformat-nonliteral +CFLAGS +=3D -I. + +SRCS-$(CONFIG_X86) +=3D libxl_cpuid.c +SRCS-$(CONFIG_X86) +=3D libxl_x86.c +SRCS-$(CONFIG_X86) +=3D libxl_psr.c +SRCS-$(CONFIG_X86) +=3D libxl_x86_acpi.c +SRCS-$(CONFIG_ARM) +=3D libxl_nocpuid.c +SRCS-$(CONFIG_ARM) +=3D libxl_arm.c +SRCS-$(CONFIG_ARM) +=3D libxl_libfdt_compat.c +ifeq ($(CONFIG_ARM_64),y) +DSDT_FILES-y =3D dsdt_anycpu_arm.c +SRCS-y +=3D libxl_arm_acpi.c +SRCS-y +=3D $(DSDT_FILES-y) +dsdt_anycpu_arm.c: + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) DSDT_FILES=3D"$(DSDT_F= ILES-y)" +else +SRCS-$(CONFIG_ARM) +=3D libxl_arm_no_acpi.c +endif + +SRCS-OS-$(CONFIG_NetBSD) =3D libxl_netbsd.c +SRCS-OS-$(CONFIG_Linux) =3D libxl_linux.c +SRCS-OS-$(CONFIG_FreeBSD) =3D libxl_freebsd.c +ifeq ($(SRCS-OS-y),) +$(error Your Operating System is not supported by libxenlight, \ +please check libxl_linux.c and libxl_netbsd.c to see how to get it ported) +endif +SRCS-y +=3D $(SRCS-OS-y) + +SRCS-y +=3D libxl.c +SRCS-y +=3D libxl_create.c +SRCS-y +=3D libxl_dm.c +SRCS-y +=3D libxl_pci.c +SRCS-y +=3D libxl_dom.c +SRCS-y +=3D libxl_exec.c +SRCS-y +=3D libxl_xshelp.c +SRCS-y +=3D libxl_device.c +SRCS-y +=3D libxl_internal.c +SRCS-y +=3D libxl_utils.c +SRCS-y +=3D libxl_uuid.c +SRCS-y +=3D libxl_json.c +SRCS-y +=3D libxl_aoutils.c +SRCS-y +=3D libxl_numa.c +SRCS-y +=3D libxl_vnuma.c +SRCS-y +=3D libxl_stream_read.c +SRCS-y +=3D libxl_stream_write.c +SRCS-y +=3D libxl_save_callout.c +SRCS-y +=3D _libxl_save_msgs_callout.c +SRCS-y +=3D libxl_qmp.c +SRCS-y +=3D libxl_event.c +SRCS-y +=3D libxl_fork.c +SRCS-y +=3D libxl_dom_suspend.c +SRCS-y +=3D libxl_dom_save.c +SRCS-y +=3D libxl_usb.c +SRCS-y +=3D libxl_vtpm.c +SRCS-y +=3D libxl_nic.c +SRCS-y +=3D libxl_disk.c +SRCS-y +=3D libxl_console.c +SRCS-y +=3D libxl_cpupool.c +SRCS-y +=3D libxl_mem.c +SRCS-y +=3D libxl_sched.c +SRCS-y +=3D libxl_tmem.c +SRCS-y +=3D libxl_9pfs.c +SRCS-y +=3D libxl_domain.c +SRCS-y +=3D libxl_vdispl.c +SRCS-y +=3D libxl_pvcalls.c +SRCS-y +=3D libxl_vsnd.c +SRCS-y +=3D libxl_vkb.c +SRCS-y +=3D libxl_genid.c +SRCS-y +=3D _libxl_types.c +SRCS-y +=3D libxl_flask.c +SRCS-y +=3D _libxl_types_internal.c + +ifeq ($(CONFIG_LIBNL),y) +CFLAGS_LIBXL +=3D $(LIBNL3_CFLAGS) +endif +CFLAGS_LIBXL +=3D -Wshadow +ifeq ($(debug),y) +CFLAGS_LIBXL +=3D -DCONFIG_DEBUG +endif + +CFLAGS +=3D $(PTHREAD_CFLAGS) +LDFLAGS +=3D $(PTHREAD_LDFLAGS) + +LIBXL_TESTS +=3D timedereg +LIBXL_TESTS_PROGS =3D $(LIBXL_TESTS) fdderegrace +LIBXL_TESTS_INSIDE =3D $(LIBXL_TESTS) fdevent + +# Each entry FOO in LIBXL_TESTS has two main .c files: +# libxl_test_FOO.c "inside libxl" code to support the test case +# test_FOO.c "outside libxl" code to exercise the test case +# Conventionally there will also be: +# libxl_test_FOO.h interface between the "inside" and "outside" parts +# The "inside libxl" file is compiled exactly like a piece of libxl, and t= he +# "outside libxl" file is compiled exactly like a piece of application +# code. They must share information via explicit libxl entrypoints. +# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c +# to use private global variables for its state. Note that all the +# "inside" parts are compiled into a single test library, so their +# symbol names must be unique. +# +# To run these tests, either use LD_PRELOAD to get libxenlight_test.so +# loaded, or rename it to libxenlight.so so it is the target of the +# appropriate symlinks. + +LIBXL_TEST_OBJS +=3D $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic) +TEST_PROG_OBJS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_comm= on.o +TEST_PROGS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t) + +AUTOINCS =3D _libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save= _msgs_helper.h +AUTOSRCS =3D _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c + +CLIENTS =3D testidl libxl-save-helper + +SAVE_HELPER_OBJS =3D libxl_save_helper.o _libxl_save_msgs_helper.o + +LIBHEADER :=3D libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_ty= pes_json.h _libxl_list.h libxl_utils.h libxl_uuid.h + +NO_HEADERS_CHK :=3D y + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(CURDIR) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) + +LDUSELIBS-y +=3D $(PTYFUNCS_LIBS) +LDUSELIBS-$(CONFIG_LIBNL) +=3D $(LIBNL3_LIBS) +LDUSELIBS-$(CONFIG_Linux) +=3D -luuid +LDUSELIBS-$(CONFIG_Linux) +=3D -lrt +LDUSELIBS-$(CONFIG_ARM) +=3D -lfdt +LDUSELIBS-y +=3D $(PTHREAD_LIBS) +LDUSELIBS-y +=3D -lyajl +LDUSELIBS +=3D $(LDUSELIBS-y) + +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS +=3D $(CFLAGS_LIBXL) -i= nclude $(XEN_ROOT)/tools/config.h +$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS +=3D -I. -DLIBACPI_STDUTILS=3D\"$(CU= RDIR)/libxl_x86_acpi.h\" +$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS +=3D $(CFLAGS_libxentoollog= ) $(CFLAGS_libxentoolcore) +libxl_dom.o libxl_dom.opic: CFLAGS +=3D -I$(XEN_ROOT)/tools # include lib= acpi/x86.h +libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS +=3D -I$(XEN_ROOT)/tools +$(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) $(CFLAGS_libxenguest) + +testidl.o: CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) +testidl.c: libxl_types.idl gentest.py include/libxl.h $(AUTOINCS) + $(PYTHON) gentest.py libxl_types.idl testidl.c.new + mv testidl.c.new testidl.c + +build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS) + +$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG= _OBJS): $(AUTOINCS) libxl.api-ok + +genpath-target =3D $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +libxl.api-ok: check-libxl-api-rules _libxl.api-for-check + $(PERL) $^ + touch $@ + +_%.api-for-check: include/%.h $(AUTOINCS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ + -DLIBXL_EXTERNAL_CALLERS_ONLY=3DLIBXL_EXTERNAL_CALLERS_ONLY \ + >$@.new + mv -f $@.new $@ + +_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_I= NCLUDE)/xen-external/bsd-sys-queue.h + $(PERL) $^ --prefix=3Dlibxl >$@.new + $(call move-if-changed,$@.new,$@) + +_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ +_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \ + libxl_save_msgs_gen.pl + $(PERL) -w $< $@ >$@.new + $(call move-if-changed,$@.new,$@) + +include/libxl.h: _libxl_types.h _libxl_list.h +include/libxl_json.h: _libxl_types_json.h +libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_ty= pes_internal_private.h _paths.h +libxl_internal_json.h: _libxl_types_internal_json.h +xl.h: _paths.h + +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER= _OBJS): include/libxl.h +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h + +_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: = libxl_type%.idl gentypes.py idl.py + $(eval stem =3D $(notdir $*)) + $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl= _type$(stem)_private.h \ + __libxl_type$(stem)_json.h __libxl_type$(stem).c + $(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h) + $(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_p= rivate.h) + $(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json= .h) + $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c) + +include/_%.h: _%.h + cp $< $@ + +libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB= _LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS) + +test_%: test_%.o test_common.o libxenlight_test.so + $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenli= ght)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFL= AGS) + +libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so + $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLI= BS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFL= AGS) + +testidl: testidl.o libxenlight.so + $(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoo= llog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) + +install: installlocal $(LIBHEADERS) + +.PHONY: installlocal +installlocal: libxl-save-helper + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN) + +uninstall: uninstalllocal + +.PHONY: uninstalllocal +uninstalllocal: + rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + $(RM) -f _*.h *.o $(CLIENTS) + $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check + $(RM) -f testidl.c.new testidl.c *.api-ok + $(RM) -f $(TEST_PROGS) + $(RM) -rf __pycache__ + $(RM) -f include/_*.h + $(RM) -f libxenlight.map + $(RM) -f $(AUTOSRCS) $(AUTOINCS) + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) clean diff --git a/tools/libxl/check-libxl-api-rules b/tools/libs/light/check-lib= xl-api-rules similarity index 100% rename from tools/libxl/check-libxl-api-rules rename to tools/libs/light/check-libxl-api-rules diff --git a/tools/libxl/flexarray.c b/tools/libs/light/flexarray.c similarity index 100% rename from tools/libxl/flexarray.c rename to tools/libs/light/flexarray.c diff --git a/tools/libxl/flexarray.h b/tools/libs/light/flexarray.h similarity index 100% rename from tools/libxl/flexarray.h rename to tools/libs/light/flexarray.h diff --git a/tools/libxl/gentest.py b/tools/libs/light/gentest.py similarity index 100% rename from tools/libxl/gentest.py rename to tools/libs/light/gentest.py diff --git a/tools/libxl/gentypes.py b/tools/libs/light/gentypes.py similarity index 100% rename from tools/libxl/gentypes.py rename to tools/libs/light/gentypes.py diff --git a/tools/libxl/idl.py b/tools/libs/light/idl.py similarity index 100% rename from tools/libxl/idl.py rename to tools/libs/light/idl.py diff --git a/tools/libxl/idl.txt b/tools/libs/light/idl.txt similarity index 100% rename from tools/libxl/idl.txt rename to tools/libs/light/idl.txt diff --git a/tools/libxl/libxl.h b/tools/libs/light/include/libxl.h similarity index 100% rename from tools/libxl/libxl.h rename to tools/libs/light/include/libxl.h diff --git a/tools/libxl/libxl_event.h b/tools/libs/light/include/libxl_eve= nt.h similarity index 100% rename from tools/libxl/libxl_event.h rename to tools/libs/light/include/libxl_event.h diff --git a/tools/libxl/libxl_json.h b/tools/libs/light/include/libxl_json= .h similarity index 100% rename from tools/libxl/libxl_json.h rename to tools/libs/light/include/libxl_json.h diff --git a/tools/libxl/libxl_utils.h b/tools/libs/light/include/libxl_uti= ls.h similarity index 100% rename from tools/libxl/libxl_utils.h rename to tools/libs/light/include/libxl_utils.h diff --git a/tools/libxl/libxl_uuid.h b/tools/libs/light/include/libxl_uuid= .h similarity index 100% rename from tools/libxl/libxl_uuid.h rename to tools/libs/light/include/libxl_uuid.h diff --git a/tools/libxl/libxl.c b/tools/libs/light/libxl.c similarity index 100% rename from tools/libxl/libxl.c rename to tools/libs/light/libxl.c diff --git a/tools/libxl/libxl_9pfs.c b/tools/libs/light/libxl_9pfs.c similarity index 100% rename from tools/libxl/libxl_9pfs.c rename to tools/libs/light/libxl_9pfs.c diff --git a/tools/libxl/libxl_aoutils.c b/tools/libs/light/libxl_aoutils.c similarity index 100% rename from tools/libxl/libxl_aoutils.c rename to tools/libs/light/libxl_aoutils.c diff --git a/tools/libxl/libxl_arch.h b/tools/libs/light/libxl_arch.h similarity index 100% rename from tools/libxl/libxl_arch.h rename to tools/libs/light/libxl_arch.h diff --git a/tools/libxl/libxl_arm.c b/tools/libs/light/libxl_arm.c similarity index 100% rename from tools/libxl/libxl_arm.c rename to tools/libs/light/libxl_arm.c diff --git a/tools/libxl/libxl_arm.h b/tools/libs/light/libxl_arm.h similarity index 100% rename from tools/libxl/libxl_arm.h rename to tools/libs/light/libxl_arm.h diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libs/light/libxl_arm_acpi= .c similarity index 100% rename from tools/libxl/libxl_arm_acpi.c rename to tools/libs/light/libxl_arm_acpi.c diff --git a/tools/libxl/libxl_arm_no_acpi.c b/tools/libs/light/libxl_arm_n= o_acpi.c similarity index 100% rename from tools/libxl/libxl_arm_no_acpi.c rename to tools/libs/light/libxl_arm_no_acpi.c diff --git a/tools/libxl/libxl_bootloader.c b/tools/libs/light/libxl_bootlo= ader.c similarity index 100% rename from tools/libxl/libxl_bootloader.c rename to tools/libs/light/libxl_bootloader.c diff --git a/tools/libxl/libxl_checkpoint_device.c b/tools/libs/light/libxl= _checkpoint_device.c similarity index 100% rename from tools/libxl/libxl_checkpoint_device.c rename to tools/libs/light/libxl_checkpoint_device.c diff --git a/tools/libxl/libxl_colo.h b/tools/libs/light/libxl_colo.h similarity index 100% rename from tools/libxl/libxl_colo.h rename to tools/libs/light/libxl_colo.h diff --git a/tools/libxl/libxl_colo_nic.c b/tools/libs/light/libxl_colo_nic= .c similarity index 100% rename from tools/libxl/libxl_colo_nic.c rename to tools/libs/light/libxl_colo_nic.c diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libs/light/libxl_colo_p= roxy.c similarity index 100% rename from tools/libxl/libxl_colo_proxy.c rename to tools/libs/light/libxl_colo_proxy.c diff --git a/tools/libxl/libxl_colo_qdisk.c b/tools/libs/light/libxl_colo_q= disk.c similarity index 100% rename from tools/libxl/libxl_colo_qdisk.c rename to tools/libs/light/libxl_colo_qdisk.c diff --git a/tools/libxl/libxl_colo_restore.c b/tools/libs/light/libxl_colo= _restore.c similarity index 100% rename from tools/libxl/libxl_colo_restore.c rename to tools/libs/light/libxl_colo_restore.c diff --git a/tools/libxl/libxl_colo_save.c b/tools/libs/light/libxl_colo_sa= ve.c similarity index 100% rename from tools/libxl/libxl_colo_save.c rename to tools/libs/light/libxl_colo_save.c diff --git a/tools/libxl/libxl_console.c b/tools/libs/light/libxl_console.c similarity index 100% rename from tools/libxl/libxl_console.c rename to tools/libs/light/libxl_console.c diff --git a/tools/libxl/libxl_convert_callout.c b/tools/libs/light/libxl_c= onvert_callout.c similarity index 100% rename from tools/libxl/libxl_convert_callout.c rename to tools/libs/light/libxl_convert_callout.c diff --git a/tools/libxl/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c similarity index 100% rename from tools/libxl/libxl_cpuid.c rename to tools/libs/light/libxl_cpuid.c diff --git a/tools/libxl/libxl_cpupool.c b/tools/libs/light/libxl_cpupool.c similarity index 100% rename from tools/libxl/libxl_cpupool.c rename to tools/libs/light/libxl_cpupool.c diff --git a/tools/libxl/libxl_create.c b/tools/libs/light/libxl_create.c similarity index 100% rename from tools/libxl/libxl_create.c rename to tools/libs/light/libxl_create.c diff --git a/tools/libxl/libxl_device.c b/tools/libs/light/libxl_device.c similarity index 100% rename from tools/libxl/libxl_device.c rename to tools/libs/light/libxl_device.c diff --git a/tools/libxl/libxl_disk.c b/tools/libs/light/libxl_disk.c similarity index 100% rename from tools/libxl/libxl_disk.c rename to tools/libs/light/libxl_disk.c diff --git a/tools/libxl/libxl_dm.c b/tools/libs/light/libxl_dm.c similarity index 100% rename from tools/libxl/libxl_dm.c rename to tools/libs/light/libxl_dm.c diff --git a/tools/libxl/libxl_dom.c b/tools/libs/light/libxl_dom.c similarity index 100% rename from tools/libxl/libxl_dom.c rename to tools/libs/light/libxl_dom.c diff --git a/tools/libxl/libxl_dom_save.c b/tools/libs/light/libxl_dom_save= .c similarity index 100% rename from tools/libxl/libxl_dom_save.c rename to tools/libs/light/libxl_dom_save.c diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libs/light/libxl_dom_s= uspend.c similarity index 100% rename from tools/libxl/libxl_dom_suspend.c rename to tools/libs/light/libxl_dom_suspend.c diff --git a/tools/libxl/libxl_domain.c b/tools/libs/light/libxl_domain.c similarity index 100% rename from tools/libxl/libxl_domain.c rename to tools/libs/light/libxl_domain.c diff --git a/tools/libxl/libxl_event.c b/tools/libs/light/libxl_event.c similarity index 100% rename from tools/libxl/libxl_event.c rename to tools/libs/light/libxl_event.c diff --git a/tools/libxl/libxl_exec.c b/tools/libs/light/libxl_exec.c similarity index 100% rename from tools/libxl/libxl_exec.c rename to tools/libs/light/libxl_exec.c diff --git a/tools/libxl/libxl_flask.c b/tools/libs/light/libxl_flask.c similarity index 100% rename from tools/libxl/libxl_flask.c rename to tools/libs/light/libxl_flask.c diff --git a/tools/libxl/libxl_fork.c b/tools/libs/light/libxl_fork.c similarity index 100% rename from tools/libxl/libxl_fork.c rename to tools/libs/light/libxl_fork.c diff --git a/tools/libxl/libxl_freebsd.c b/tools/libs/light/libxl_freebsd.c similarity index 100% rename from tools/libxl/libxl_freebsd.c rename to tools/libs/light/libxl_freebsd.c diff --git a/tools/libxl/libxl_genid.c b/tools/libs/light/libxl_genid.c similarity index 100% rename from tools/libxl/libxl_genid.c rename to tools/libs/light/libxl_genid.c diff --git a/tools/libxl/libxl_internal.c b/tools/libs/light/libxl_internal= .c similarity index 100% rename from tools/libxl/libxl_internal.c rename to tools/libs/light/libxl_internal.c diff --git a/tools/libxl/libxl_internal.h b/tools/libs/light/libxl_internal= .h similarity index 100% rename from tools/libxl/libxl_internal.h rename to tools/libs/light/libxl_internal.h diff --git a/tools/libxl/libxl_json.c b/tools/libs/light/libxl_json.c similarity index 100% rename from tools/libxl/libxl_json.c rename to tools/libs/light/libxl_json.c diff --git a/tools/libxl/libxl_libfdt_compat.c b/tools/libs/light/libxl_lib= fdt_compat.c similarity index 100% rename from tools/libxl/libxl_libfdt_compat.c rename to tools/libs/light/libxl_libfdt_compat.c diff --git a/tools/libxl/libxl_libfdt_compat.h b/tools/libs/light/libxl_lib= fdt_compat.h similarity index 100% rename from tools/libxl/libxl_libfdt_compat.h rename to tools/libs/light/libxl_libfdt_compat.h diff --git a/tools/libxl/libxl_linux.c b/tools/libs/light/libxl_linux.c similarity index 100% rename from tools/libxl/libxl_linux.c rename to tools/libs/light/libxl_linux.c diff --git a/tools/libxl/libxl_mem.c b/tools/libs/light/libxl_mem.c similarity index 100% rename from tools/libxl/libxl_mem.c rename to tools/libs/light/libxl_mem.c diff --git a/tools/libxl/libxl_netbsd.c b/tools/libs/light/libxl_netbsd.c similarity index 100% rename from tools/libxl/libxl_netbsd.c rename to tools/libs/light/libxl_netbsd.c diff --git a/tools/libxl/libxl_netbuffer.c b/tools/libs/light/libxl_netbuff= er.c similarity index 100% rename from tools/libxl/libxl_netbuffer.c rename to tools/libs/light/libxl_netbuffer.c diff --git a/tools/libxl/libxl_nic.c b/tools/libs/light/libxl_nic.c similarity index 100% rename from tools/libxl/libxl_nic.c rename to tools/libs/light/libxl_nic.c diff --git a/tools/libxl/libxl_no_colo.c b/tools/libs/light/libxl_no_colo.c similarity index 100% rename from tools/libxl/libxl_no_colo.c rename to tools/libs/light/libxl_no_colo.c diff --git a/tools/libxl/libxl_no_convert_callout.c b/tools/libs/light/libx= l_no_convert_callout.c similarity index 100% rename from tools/libxl/libxl_no_convert_callout.c rename to tools/libs/light/libxl_no_convert_callout.c diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c similarity index 100% rename from tools/libxl/libxl_nocpuid.c rename to tools/libs/light/libxl_nocpuid.c diff --git a/tools/libxl/libxl_nonetbuffer.c b/tools/libs/light/libxl_nonet= buffer.c similarity index 100% rename from tools/libxl/libxl_nonetbuffer.c rename to tools/libs/light/libxl_nonetbuffer.c diff --git a/tools/libxl/libxl_numa.c b/tools/libs/light/libxl_numa.c similarity index 100% rename from tools/libxl/libxl_numa.c rename to tools/libs/light/libxl_numa.c diff --git a/tools/libxl/libxl_osdeps.h b/tools/libs/light/libxl_osdeps.h similarity index 100% rename from tools/libxl/libxl_osdeps.h rename to tools/libs/light/libxl_osdeps.h diff --git a/tools/libxl/libxl_paths.c b/tools/libs/light/libxl_paths.c similarity index 100% rename from tools/libxl/libxl_paths.c rename to tools/libs/light/libxl_paths.c diff --git a/tools/libxl/libxl_pci.c b/tools/libs/light/libxl_pci.c similarity index 100% rename from tools/libxl/libxl_pci.c rename to tools/libs/light/libxl_pci.c diff --git a/tools/libxl/libxl_psr.c b/tools/libs/light/libxl_psr.c similarity index 100% rename from tools/libxl/libxl_psr.c rename to tools/libs/light/libxl_psr.c diff --git a/tools/libxl/libxl_pvcalls.c b/tools/libs/light/libxl_pvcalls.c similarity index 100% rename from tools/libxl/libxl_pvcalls.c rename to tools/libs/light/libxl_pvcalls.c diff --git a/tools/libxl/libxl_qmp.c b/tools/libs/light/libxl_qmp.c similarity index 100% rename from tools/libxl/libxl_qmp.c rename to tools/libs/light/libxl_qmp.c diff --git a/tools/libxl/libxl_remus.c b/tools/libs/light/libxl_remus.c similarity index 100% rename from tools/libxl/libxl_remus.c rename to tools/libs/light/libxl_remus.c diff --git a/tools/libxl/libxl_remus_disk_drbd.c b/tools/libs/light/libxl_r= emus_disk_drbd.c similarity index 100% rename from tools/libxl/libxl_remus_disk_drbd.c rename to tools/libs/light/libxl_remus_disk_drbd.c diff --git a/tools/libxl/libxl_save_callout.c b/tools/libs/light/libxl_save= _callout.c similarity index 100% rename from tools/libxl/libxl_save_callout.c rename to tools/libs/light/libxl_save_callout.c diff --git a/tools/libxl/libxl_save_helper.c b/tools/libs/light/libxl_save_= helper.c similarity index 100% rename from tools/libxl/libxl_save_helper.c rename to tools/libs/light/libxl_save_helper.c diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libs/light/libxl_sa= ve_msgs_gen.pl similarity index 100% rename from tools/libxl/libxl_save_msgs_gen.pl rename to tools/libs/light/libxl_save_msgs_gen.pl diff --git a/tools/libxl/libxl_sched.c b/tools/libs/light/libxl_sched.c similarity index 100% rename from tools/libxl/libxl_sched.c rename to tools/libs/light/libxl_sched.c diff --git a/tools/libxl/libxl_sr_stream_format.h b/tools/libs/light/libxl_= sr_stream_format.h similarity index 100% rename from tools/libxl/libxl_sr_stream_format.h rename to tools/libs/light/libxl_sr_stream_format.h diff --git a/tools/libxl/libxl_stream_read.c b/tools/libs/light/libxl_strea= m_read.c similarity index 100% rename from tools/libxl/libxl_stream_read.c rename to tools/libs/light/libxl_stream_read.c diff --git a/tools/libxl/libxl_stream_write.c b/tools/libs/light/libxl_stre= am_write.c similarity index 100% rename from tools/libxl/libxl_stream_write.c rename to tools/libs/light/libxl_stream_write.c diff --git a/tools/libxl/libxl_test_fdevent.c b/tools/libs/light/libxl_test= _fdevent.c similarity index 100% rename from tools/libxl/libxl_test_fdevent.c rename to tools/libs/light/libxl_test_fdevent.c diff --git a/tools/libxl/libxl_test_fdevent.h b/tools/libs/light/libxl_test= _fdevent.h similarity index 100% rename from tools/libxl/libxl_test_fdevent.h rename to tools/libs/light/libxl_test_fdevent.h diff --git a/tools/libxl/libxl_test_timedereg.c b/tools/libs/light/libxl_te= st_timedereg.c similarity index 100% rename from tools/libxl/libxl_test_timedereg.c rename to tools/libs/light/libxl_test_timedereg.c diff --git a/tools/libxl/libxl_test_timedereg.h b/tools/libs/light/libxl_te= st_timedereg.h similarity index 100% rename from tools/libxl/libxl_test_timedereg.h rename to tools/libs/light/libxl_test_timedereg.h diff --git a/tools/libxl/libxl_tmem.c b/tools/libs/light/libxl_tmem.c similarity index 100% rename from tools/libxl/libxl_tmem.c rename to tools/libs/light/libxl_tmem.c diff --git a/tools/libxl/libxl_types.idl b/tools/libs/light/libxl_types.idl similarity index 100% rename from tools/libxl/libxl_types.idl rename to tools/libs/light/libxl_types.idl diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libs/light/libxl_= types_internal.idl similarity index 100% rename from tools/libxl/libxl_types_internal.idl rename to tools/libs/light/libxl_types_internal.idl diff --git a/tools/libxl/libxl_usb.c b/tools/libs/light/libxl_usb.c similarity index 100% rename from tools/libxl/libxl_usb.c rename to tools/libs/light/libxl_usb.c diff --git a/tools/libxl/libxl_utils.c b/tools/libs/light/libxl_utils.c similarity index 100% rename from tools/libxl/libxl_utils.c rename to tools/libs/light/libxl_utils.c diff --git a/tools/libxl/libxl_uuid.c b/tools/libs/light/libxl_uuid.c similarity index 100% rename from tools/libxl/libxl_uuid.c rename to tools/libs/light/libxl_uuid.c diff --git a/tools/libxl/libxl_vdispl.c b/tools/libs/light/libxl_vdispl.c similarity index 100% rename from tools/libxl/libxl_vdispl.c rename to tools/libs/light/libxl_vdispl.c diff --git a/tools/libxl/libxl_vkb.c b/tools/libs/light/libxl_vkb.c similarity index 100% rename from tools/libxl/libxl_vkb.c rename to tools/libs/light/libxl_vkb.c diff --git a/tools/libxl/libxl_vnuma.c b/tools/libs/light/libxl_vnuma.c similarity index 100% rename from tools/libxl/libxl_vnuma.c rename to tools/libs/light/libxl_vnuma.c diff --git a/tools/libxl/libxl_vsnd.c b/tools/libs/light/libxl_vsnd.c similarity index 100% rename from tools/libxl/libxl_vsnd.c rename to tools/libs/light/libxl_vsnd.c diff --git a/tools/libxl/libxl_vtpm.c b/tools/libs/light/libxl_vtpm.c similarity index 100% rename from tools/libxl/libxl_vtpm.c rename to tools/libs/light/libxl_vtpm.c diff --git a/tools/libxl/libxl_x86.c b/tools/libs/light/libxl_x86.c similarity index 100% rename from tools/libxl/libxl_x86.c rename to tools/libs/light/libxl_x86.c diff --git a/tools/libxl/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi= .c similarity index 100% rename from tools/libxl/libxl_x86_acpi.c rename to tools/libs/light/libxl_x86_acpi.c diff --git a/tools/libxl/libxl_x86_acpi.h b/tools/libs/light/libxl_x86_acpi= .h similarity index 100% rename from tools/libxl/libxl_x86_acpi.h rename to tools/libs/light/libxl_x86_acpi.h diff --git a/tools/libxl/libxl_xshelp.c b/tools/libs/light/libxl_xshelp.c similarity index 100% rename from tools/libxl/libxl_xshelp.c rename to tools/libs/light/libxl_xshelp.c diff --git a/tools/libxl/osdeps.c b/tools/libs/light/osdeps.c similarity index 100% rename from tools/libxl/osdeps.c rename to tools/libs/light/osdeps.c diff --git a/tools/libxl/test_common.c b/tools/libs/light/test_common.c similarity index 100% rename from tools/libxl/test_common.c rename to tools/libs/light/test_common.c diff --git a/tools/libxl/test_common.h b/tools/libs/light/test_common.h similarity index 100% rename from tools/libxl/test_common.h rename to tools/libs/light/test_common.h diff --git a/tools/libxl/test_fdderegrace.c b/tools/libs/light/test_fddereg= race.c similarity index 100% rename from tools/libxl/test_fdderegrace.c rename to tools/libs/light/test_fdderegrace.c diff --git a/tools/libxl/test_timedereg.c b/tools/libs/light/test_timedereg= .c similarity index 100% rename from tools/libxl/test_timedereg.c rename to tools/libs/light/test_timedereg.c diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index a9dc2ce994..685f368aed 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -26,3 +26,5 @@ LIBS_LIBS +=3D vchan USELIBS_vchan :=3D toollog store gnttab evtchn LIBS_LIBS +=3D stat USELIBS_stat :=3D ctrl store +LIBS_LIBS +=3D light +USELIBS_light :=3D toollog evtchn toolcore ctrl store hypfs guest diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 51c4c22f22..8ab7c9d3f0 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -5,9 +5,6 @@ XEN_ROOT =3D $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk =20 -MAJOR =3D 4.15 -MINOR =3D 0 - XLUMAJOR =3D 4.15 XLUMINOR =3D 0 =20 @@ -15,107 +12,11 @@ CFLAGS +=3D -Werror -Wno-format-zero-length -Wmissing-= declarations \ -Wno-declaration-after-statement -Wformat-nonliteral CFLAGS +=3D -I. -fPIC =20 -ifeq ($(CONFIG_Linux),y) -LIBUUID_LIBS +=3D -luuid -endif - -LIBXL_LIBS =3D -LIBXL_LIBS =3D $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_lib= xenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenhypfs) $(LDLIBS_libxenstore) = $(LDLIBS_libxentoolcore) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS) -ifeq ($(CONFIG_LIBNL),y) -LIBXL_LIBS +=3D $(LIBNL3_LIBS) -endif -ifeq ($(CONFIG_Linux),y) -LIBXL_LIBS +=3D -lrt -endif - -CFLAGS_LIBXL +=3D $(CFLAGS_libxentoollog) -CFLAGS_LIBXL +=3D $(CFLAGS_libxentoolcore) -CFLAGS_LIBXL +=3D $(CFLAGS_libxenevtchn) -CFLAGS_LIBXL +=3D $(CFLAGS_libxenctrl) -CFLAGS_LIBXL +=3D $(CFLAGS_libxenguest) -CFLAGS_LIBXL +=3D $(CFLAGS_libxenhypfs) -CFLAGS_LIBXL +=3D $(CFLAGS_libxenstore) -ifeq ($(CONFIG_LIBNL),y) -CFLAGS_LIBXL +=3D $(LIBNL3_CFLAGS) -endif -CFLAGS_LIBXL +=3D -Wshadow -ifeq ($(debug),y) -CFLAGS_LIBXL +=3D -DCONFIG_DEBUG -endif - -LIBXL_LIBS-$(CONFIG_ARM) +=3D -lfdt - CFLAGS +=3D $(PTHREAD_CFLAGS) LDFLAGS +=3D $(PTHREAD_LDFLAGS) -LIBXL_LIBS +=3D $(PTHREAD_LIBS) -LIBXL_LIBS +=3D $(LIBXL_LIBS-y) =20 LIBXLU_LIBS =3D $(LDLIBS_libxenlight) =20 -LIBXL_OBJS-y =3D osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o - -ifeq ($(CONFIG_LIBNL),y) -LIBXL_OBJS-y +=3D libxl_netbuffer.o -else -LIBXL_OBJS-y +=3D libxl_nonetbuffer.o -endif - -ifeq ($(CONFIG_X86),y) -LIBXL_OBJS-y +=3D libxl_convert_callout.o -else -LIBXL_OBJS-y +=3D libxl_no_convert_callout.o -endif - -LIBXL_OBJS-y +=3D libxl_remus.o libxl_checkpoint_device.o libxl_remus_disk= _drbd.o - -ifeq ($(CONFIG_LIBNL),y) -LIBXL_OBJS-y +=3D libxl_colo_restore.o libxl_colo_save.o -LIBXL_OBJS-y +=3D libxl_colo_qdisk.o -LIBXL_OBJS-y +=3D libxl_colo_proxy.o -LIBXL_OBJS-y +=3D libxl_colo_nic.o -else -LIBXL_OBJS-y +=3D libxl_no_colo.o -endif - -ACPI_PATH =3D $(XEN_ROOT)/tools/libacpi -DSDT_FILES-$(CONFIG_X86) =3D dsdt_pvh.c -ACPI_OBJS =3D $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o -$(DSDT_FILES-y): acpi -$(ACPI_OBJS): CFLAGS +=3D -I. -DLIBACPI_STDUTILS=3D\"$(CURDIR)/libxl_x86_a= cpi.h\" -vpath build.c $(ACPI_PATH)/ -vpath static_tables.c $(ACPI_PATH)/ -LIBXL_OBJS-$(CONFIG_X86) +=3D $(ACPI_OBJS) - -.PHONY: acpi -acpi: - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) DSDT_FILES=3D"$(DSDT_F= ILES-y)" - -LIBXL_OBJS-$(CONFIG_X86) +=3D libxl_cpuid.o libxl_x86.o libxl_psr.o libxl_= x86_acpi.o -LIBXL_OBJS-$(CONFIG_ARM) +=3D libxl_nocpuid.o libxl_arm.o libxl_libfdt_com= pat.o -ifeq ($(CONFIG_ARM_64),y) -DSDT_FILES-y =3D dsdt_anycpu_arm.c -LIBXL_OBJS-y +=3D libxl_arm_acpi.o $(patsubst %.c,%.o,$(DSDT_FILES-y)) -dsdt_anycpu_arm.c: - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) DSDT_FILES=3D"$(DSDT_F= ILES-y)" -else -LIBXL_OBJS-$(CONFIG_ARM) +=3D libxl_arm_no_acpi.o -endif - -ifeq ($(CONFIG_NetBSD),y) -LIBXL_OBJS-y +=3D libxl_netbsd.o -else -ifeq ($(CONFIG_Linux),y) -LIBXL_OBJS-y +=3D libxl_linux.o -else -ifeq ($(CONFIG_FreeBSD),y) -LIBXL_OBJS-y +=3D libxl_freebsd.o -else -$(error Your Operating System is not supported by libxenlight, \ -please check libxl_linux.c and libxl_netbsd.c to see how to get it ported) -endif -endif -endif - ifeq ($(FLEX),) %.c %.h:: %.l $(warning Flex is needed to rebuild some libxl parsers and \ @@ -128,80 +29,16 @@ ifeq ($(BISON),) scanners, please install it an rerun configure) endif =20 -LIBXL_LIBS +=3D -lyajl - -LIBXL_OBJS =3D flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \ - libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o \ - libxl_internal.o libxl_utils.o libxl_uuid.o \ - libxl_json.o libxl_aoutils.o libxl_numa.o libxl_vnuma.o \ - libxl_stream_read.o libxl_stream_write.o \ - libxl_save_callout.o _libxl_save_msgs_callout.o \ - libxl_qmp.o libxl_event.o libxl_fork.o \ - libxl_dom_suspend.o libxl_dom_save.o libxl_usb.o \ - libxl_vtpm.o libxl_nic.o libxl_disk.o libxl_console.o \ - libxl_cpupool.o libxl_mem.o libxl_sched.o libxl_tmem.o \ - libxl_9pfs.o libxl_domain.o libxl_vdispl.o \ - libxl_pvcalls.o libxl_vsnd.o libxl_vkb.o $(LIBXL_OBJS-y) -LIBXL_OBJS +=3D libxl_genid.o -LIBXL_OBJS +=3D _libxl_types.o libxl_flask.o _libxl_types_internal.o - -LIBXL_TESTS +=3D timedereg -LIBXL_TESTS_PROGS =3D $(LIBXL_TESTS) fdderegrace -LIBXL_TESTS_INSIDE =3D $(LIBXL_TESTS) fdevent - -# Each entry FOO in LIBXL_TESTS has two main .c files: -# libxl_test_FOO.c "inside libxl" code to support the test case -# test_FOO.c "outside libxl" code to exercise the test case -# Conventionally there will also be: -# libxl_test_FOO.h interface between the "inside" and "outside" parts -# The "inside libxl" file is compiled exactly like a piece of libxl, and t= he -# "outside libxl" file is compiled exactly like a piece of application -# code. They must share information via explicit libxl entrypoints. -# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c -# to use private global variables for its state. Note that all the -# "inside" parts are compiled into a single test library, so their -# symbol names must be unique. -# -# To run these tests, either use LD_PRELOAD to get libxenlight_test.so -# loaded, or rename it to libxenlight.so so it is the target of the -# appropriate symlinks. - -LIBXL_TEST_OBJS +=3D $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.o) -TEST_PROG_OBJS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_comm= on.o -TEST_PROGS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t) - -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS): CFLAGS +=3D $(CFLAGS_LIBXL) -include $(X= EN_ROOT)/tools/config.h - -AUTOINCS=3D libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \ - libxlu_disk_l.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h +AUTOINCS=3D libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h AUTOSRCS=3D libxlu_cfg_y.c libxlu_cfg_l.c -AUTOSRCS +=3D _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c LIBXLU_OBJS =3D libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o $(LIBXLU_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) # For xentoollog.h =20 -$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS +=3D $(CFLAGS_libxentoollog= ) $(CFLAGS_libxentoolcore) - -CLIENTS =3D testidl libxl-save-helper - -libxl_dom.o: CFLAGS +=3D -I$(XEN_ROOT)/tools # include libacpi/x86.h -libxl_x86_acpi.o: CFLAGS +=3D -I$(XEN_ROOT)/tools - -SAVE_HELPER_OBJS =3D libxl_save_helper.o _libxl_save_msgs_helper.o -$(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) $(CFLAGS_libxenguest) - -PKG_CONFIG =3D xenlight.pc xlutil.pc -PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) +PKG_CONFIG =3D xlutil.pc =20 ifneq ($(CONFIG_LIBXC_MINIOS),y) PKG_CONFIG_INST :=3D $(PKG_CONFIG) -xenlight.pc: PKG_CONFIG_NAME =3D Xenlight -xenlight.pc: PKG_CONFIG_DESC =3D The Xenlight library for Xen hypervisor -xenlight.pc: PKG_CONFIG_VERSION =3D $(MAJOR).$(MINOR) -xenlight.pc: PKG_CONFIG_VARS =3D xenfirmwaredir=3D$(XENFIRMWAREDIR) libexe= c_bin=3D$(LIBEXEC_BIN) -xenlight.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenlight) -xenlight.pc: PKG_CONFIG_LIB =3D xenlight -xenlight.pc: PKG_CONFIG_REQPRIV =3D xentoollog,xenevtchn,xencontrol,xengue= st,xenstore,xenhypfs xlutil.pc: PKG_CONFIG_NAME =3D Xlutil xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library for Xen hypervisor xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) @@ -215,13 +52,6 @@ endif =20 PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_NAME =3D Xenlight -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_DESC =3D The Xenlight library fo= r Xen hypervisor -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_VERSION =3D $(MAJOR).$(MINOR) -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_VARS =3D xenfirmwaredir=3D$(XENF= IRMWAREDIR) libexec_bin=3D$(LIBEXEC_BIN) -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenlight) -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_LIB =3D xenlight -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_REQPRIV =3D xentoollog,xenevtchn= ,xencontrol,xenguest,xenstore,xenhypfs $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_NAME =3D Xlutil $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library fo= r Xen hypervisor $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) @@ -233,19 +63,10 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 -testidl.o: CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) -testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS) - $(PYTHON) gentest.py libxl_types.idl testidl.c.new - mv testidl.c.new testidl.c - .PHONY: all -all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) $(PKG_CONFIG_LOCAL) \ - libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ - $(AUTOSRCS) $(AUTOINCS) +all: libxlutil.so libxlutil.a $(AUTOSRCS) $(AUTOINCS) $(PKG_CONFIG) $(PKG_= CONFIG_LOCAL) =20 -$(LIBXL_OBJS) $(LIBXLU_OBJS) $(SAVE_HELPER_OBJS) \ - $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): \ - $(AUTOINCS) libxl.api-ok +$(LIBXLU_OBJS): $(AUTOINCS) =20 %.c %.h:: %.y @rm -f $*.[ch] @@ -258,123 +79,42 @@ $(LIBXL_OBJS) $(LIBXLU_OBJS) $(SAVE_HELPER_OBJS) \ genpath-target =3D $(call buildmakevars2header,_paths.h) $(eval $(genpath-target)) =20 -libxl.api-ok: check-libxl-api-rules _libxl.api-for-check - $(PERL) $^ - touch $@ - -_%.api-for-check: %.h $(AUTOINCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ - -DLIBXL_EXTERNAL_CALLERS_ONLY=3DLIBXL_EXTERNAL_CALLERS_ONLY \ - >$@.new - mv -f $@.new $@ - -_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_I= NCLUDE)/xen-external/bsd-sys-queue.h - $(PERL) $^ --prefix=3Dlibxl >$@.new - $(call move-if-changed,$@.new,$@) - -_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ -_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \ - libxl_save_msgs_gen.pl - $(PERL) -w $< $@ >$@.new - $(call move-if-changed,$@.new,$@) - -libxl.h: _libxl_types.h _libxl_list.h -libxl_json.h: _libxl_types_json.h -libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_ty= pes_internal_private.h _paths.h -libxl_internal_json.h: _libxl_types_internal_json.h -xl.h: _paths.h - -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \ - $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h - -_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: = libxl_type%.idl gentypes.py idl.py - $(eval stem =3D $(notdir $*)) - $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl= _type$(stem)_private.h \ - __libxl_type$(stem)_json.h __libxl_type$(stem).c - $(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h) - $(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_p= rivate.h) - $(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json= .h) - $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c) - -libxenlight.so: libxenlight.so.$(MAJOR) - $(SYMLINK_SHLIB) $< $@ - -libxenlight.so.$(MAJOR): libxenlight.so.$(MAJOR).$(MINOR) - $(SYMLINK_SHLIB) $< $@ - -libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB= _LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS) - -libxenlight_test.so: $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB= _LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS) - -libxenlight.a: $(LIBXL_OBJS) - $(AR) rcs libxenlight.a $^ - libxlutil.so: libxlutil.so.$(XLUMAJOR) $(SYMLINK_SHLIB) $< $@ =20 libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(SYMLINK_SHLIB) $< $@ =20 -libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) libxenlight.so +libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLI= B_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS) =20 libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^ =20 -test_%: test_%.o test_common.o libxenlight_test.so - $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenli= ght)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFL= AGS) - -libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so - $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLI= BS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFL= AGS) - -testidl: testidl.o libxenlight.so - $(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoo= llog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) - .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)$(libdir) $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) - $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN) - $(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/lib= xenlight.so.$(MAJOR) - $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenlight.= so - $(INSTALL_DATA) libxenlight.a $(DESTDIR)$(libdir) $(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir) $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)= /libxlutil.so.$(XLUMAJOR) $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir) - $(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_= types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR= )$(includedir) - $(INSTALL_DATA) xenlight.pc $(DESTDIR)$(PKG_INSTALLDIR) + $(INSTALL_DATA) libxlutil.h $(DESTDIR)$(includedir) $(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR) =20 .PHONY: uninstall uninstall: - rm -f $(addprefix $(DESTDIR)$(PKG_INSTALLDIR)/,xlutil.pc xenlight.pc) - rm -f $(addprefix $(DESTDIR)$(includedir)/,libxl.h libxl_event.h libxl_js= on.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_u= uid.h libxlutil.h) + rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xlutil.pc + rm -f $(DESTDIR)$(includedir)/libxlutil.h rm -f $(DESTDIR)$(libdir)/libxlutil.a rm -f $(DESTDIR)$(libdir)/libxlutil.so rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - rm -f $(DESTDIR)$(libdir)/libxenlight.a - rm -f $(DESTDIR)$(libdir)/libxenlight.so - rm -f $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR).$(MINOR) - rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper =20 .PHONY: clean clean: - $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS_RM) - $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check - $(RM) -f testidl.c.new testidl.c *.api-ok - $(RM) -f $(TEST_PROGS) - $(RM) -f xenlight.pc + $(RM) -f _*.h *.o *.so* *.a $(DEPS_RM) $(RM) -f xlutil.pc - $(RM) -rf __pycache__ - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) clean =20 distclean: clean =20 diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile index 0d1549dd3a..cbe1569cc5 100644 --- a/tools/ocaml/libs/xl/Makefile +++ b/tools/ocaml/libs/xl/Makefile @@ -50,10 +50,10 @@ xenlight.mli: xenlight.mli.in _libxl_types.mli.in < xenlight.mli.in > xenlight.mli.tmp $(Q)mv xenlight.mli.tmp xenlight.mli =20 -_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_= ROOT)/tools/libxl/libxl_types.idl \ - $(XEN_ROOT)/tools/libxl/idl.py - PYTHONPATH=3D$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \ - $(XEN_ROOT)/tools/libxl/libxl_types.idl \ +_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_= ROOT)/tools/libs/light/libxl_types.idl \ + $(XEN_ROOT)/tools/libs/light/idl.py + PYTHONPATH=3D$(XEN_ROOT)/tools/libs/light $(PYTHON) genwrap.py \ + $(XEN_ROOT)/tools/libs/light/libxl_types.idl \ _libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc =20 libs: $(LIBS) --=20 2.26.2 From nobody Thu Apr 18 10:41:02 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=1599652032; cv=none; d=zohomail.com; s=zohoarc; b=Xl6sOZ7SZlUQmZ9Wutgw9kQ9TGt72HiHF9TTTS2aWQiTu+drdzrlo1LEnGlv+MEJ1c6k2tpfRhs4ebI/lUzZj1aGBABVEbjXFULTVcIK4h5yaXcIxZr/mBtB8fHqUtMtOVeihCK69IU61XBUNJmyD+cj7f6VdNkrLcyYJHVYHsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599652032; 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=pXqva+HnTfjJwPKK2Z3MUXcipAhL+bHPISe5KH2ZANM=; b=f8IprMAsS/ShXLekvW1Xi7pm5B347OEd7THoNb0s5Wi3voAAHpyR7InEMhmeocjlQ7wSDplXjw80qhiKJUFllW8qhoeH8OYLPh+7vp/uNSXilqLswqP29NsjRlmuOvl3KjN+9c68laReZU1vd28SzuwZ+sZEztSQpntiF7Kh3Qk= 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 1599652032153342.91663929910726; Wed, 9 Sep 2020 04:47:12 -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 1kFyYt-0003uO-Gn; Wed, 09 Sep 2020 11:46:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kFyYs-0003uE-BG for xen-devel@lists.xenproject.org; Wed, 09 Sep 2020 11:46:50 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ef26cdeb-9048-4ed6-95d5-af2a6f3deba8; Wed, 09 Sep 2020 11:46:48 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B3AD9ACF6; Wed, 9 Sep 2020 11:46:48 +0000 (UTC) X-Inumbo-ID: ef26cdeb-9048-4ed6-95d5-af2a6f3deba8 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 v5 2/4] tools: rename global libxlutil make variables Date: Wed, 9 Sep 2020 13:46:43 +0200 Message-Id: <20200909114645.3709-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909114645.3709-1-jgross@suse.com> References: <20200909114645.3709-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" Rename *_libxlutil make variables to *_libxenutil in order to avoid nasty indirections when moving libxlutil under the tools/libs infrastructure. Signed-off-by: Juergen Gross --- tools/Rules.mk | 10 +++++----- tools/libxl/Makefile | 4 ++-- tools/xl/Makefile | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 94a736a231..fef6986ab3 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,7 +15,7 @@ XEN_INCLUDE =3D $(XEN_ROOT)/tools/include =20 include $(XEN_ROOT)/tools/libs/uselibs.mk =20 -XEN_libxlutil =3D $(XEN_ROOT)/tools/libxl +XEN_libxenutil =3D $(XEN_ROOT)/tools/libxl =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -116,10 +116,10 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -CFLAGS_libxlutil =3D -I$(XEN_libxlutil) -SHDEPS_libxlutil =3D $(SHLIB_libxenlight) -LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libex= tension) -SHLIB_libxlutil =3D $(SHDEPS_libxlutil) -Wl,-rpath-link=3D$(XEN_libxlutil) +CFLAGS_libxenutil =3D -I$(XEN_libxenutil) +SHDEPS_libxenutil =3D $(SHLIB_libxenlight) +LDLIBS_libxenutil =3D $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(li= bextension) +SHLIB_libxenutil =3D $(SHDEPS_libxenutil) -Wl,-rpath-link=3D$(XEN_libxenu= til) =20 CFLAGS +=3D -D__XEN_INTERFACE_VERSION__=3D__XEN_LATEST_INTERFACE_VERSION__ =20 diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 8ab7c9d3f0..51da1d5be4 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -42,7 +42,7 @@ PKG_CONFIG_INST :=3D $(PKG_CONFIG) xlutil.pc: PKG_CONFIG_NAME =3D Xlutil xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library for Xen hypervisor xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) -xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxlutil) +xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenutil) xlutil.pc: PKG_CONFIG_LIB =3D xlutil xlutil.pc: PKG_CONFIG_REQPRIV =3D xenlight $(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) @@ -55,7 +55,7 @@ PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CO= NFIG_DIR)/$(pc)) $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_NAME =3D Xlutil $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library fo= r Xen hypervisor $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxlutil) +$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenutil) $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_LIB =3D xlutil $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_REQPRIV =3D xenlight $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) diff --git a/tools/xl/Makefile b/tools/xl/Makefile index 407dd7554c..bdf67c8464 100644 --- a/tools/xl/Makefile +++ b/tools/xl/Makefile @@ -13,7 +13,7 @@ CFLAGS +=3D $(PTHREAD_CFLAGS) LDFLAGS +=3D $(PTHREAD_LDFLAGS) =20 CFLAGS_XL +=3D $(CFLAGS_libxenlight) -CFLAGS_XL +=3D $(CFLAGS_libxlutil) +CFLAGS_XL +=3D $(CFLAGS_libxenutil) CFLAGS_XL +=3D -Wshadow =20 XL_OBJS-$(CONFIG_X86) =3D xl_psr.o @@ -38,7 +38,7 @@ $(XL_OBJS): _paths.h all: xl =20 xl: $(XL_OBJS) - $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxlutil) $(LDLIBS_libxenligh= t) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS) + $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlig= ht) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS) =20 .PHONY: install install: all --=20 2.26.2 From nobody Thu Apr 18 10:41:02 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=1599652033; cv=none; d=zohomail.com; s=zohoarc; b=ckUzvP5WJvaVpZRdlIqqOBTJI98HR1JhupZ9vtNbmMZeBR4+ns7AOVerEYJcqHyPmHlc/USrw33bicVpECAI8e09Xa/X04ElNo76hrirIt1qSSSfkQNqVV3dmQ5bHsur/r64KelsHF5irvTbmjfwTQzNuBSeclKmTHETwUef7B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599652033; 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=USPxK54T1pLrHknWvqQm0NI/QX8t89WPI1obAEAt6QE=; b=gai0/+XkGrCw3C7MEJrMcrnLYCQs5m2kdEFt1FdsKh0bkY3qpcf65M0RtzzAq+GrKNiDu2JheI2HObEUkZayPumexN/RP4W6MVDTligV7tREs2GKotcE2RFc0/5eViTNzLhGPzGGxIRSiFAjJH0l6DWJMkXESuLHlwKM3RhdIiw= 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 1599652033453812.686078311563; Wed, 9 Sep 2020 04:47:13 -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 1kFyYy-0003vt-9Z; Wed, 09 Sep 2020 11:46:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kFyYx-0003uE-4V for xen-devel@lists.xenproject.org; Wed, 09 Sep 2020 11:46:55 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c3687299-1d05-47d7-a208-a9b8aa2d8a73; Wed, 09 Sep 2020 11:46:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DC6B1AD1E; Wed, 9 Sep 2020 11:46:48 +0000 (UTC) X-Inumbo-ID: c3687299-1d05-47d7-a208-a9b8aa2d8a73 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 v5 3/4] tools/libs: add option for library names not starting with libxen Date: Wed, 9 Sep 2020 13:46:44 +0200 Message-Id: <20200909114645.3709-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909114645.3709-1-jgross@suse.com> References: <20200909114645.3709-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" libxlutil doesn't follow the standard name pattern of all other Xen libraries, so add another make variable which can be used to allow other names. Signed-off-by: Juergen Gross --- tools/Rules.mk | 3 ++- tools/libs/libs.mk | 41 +++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index fef6986ab3..36094155b7 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -87,10 +87,11 @@ endif # $(SHLIB_libfoo) =20 define LIB_defs + FILENAME_$(1) ?=3D xen$(1) XEN_libxen$(1) =3D $$(XEN_ROOT)/tools/libs/$(1) CFLAGS_libxen$(1) =3D -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude) SHDEPS_libxen$(1) =3D $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(u= se))) - LDLIBS_libxen$(1) =3D $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)= $$(libextension) + LDLIBS_libxen$(1) =3D $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILE= NAME_$(1))$$(libextension) SHLIB_libxen$(1) =3D $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=3D$$(XEN_libxe= n$(1)) endef =20 diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 9d0ed08846..325b7b7cea 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -20,20 +20,21 @@ LDUSELIBS =3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(L= DLIBS_libxen$(lib))) LIB_OBJS :=3D $(SRCS-y:.c=3D.o) PIC_OBJS :=3D $(SRCS-y:.c=3D.opic) =20 -LIB :=3D libxen$(LIBNAME).a +LIB_FILE_NAME =3D $(FILENAME_$(LIBNAME)) +LIB :=3D lib$(LIB_FILE_NAME).a ifneq ($(nosharedlibs),y) -LIB +=3D libxen$(LIBNAME).so +LIB +=3D lib$(LIB_FILE_NAME).so endif =20 comma:=3D , empty:=3D space:=3D $(empty) $(empty) -PKG_CONFIG ?=3D xen$(LIBNAME).pc +PKG_CONFIG ?=3D $(LIB_FILE_NAME).pc PKG_CONFIG_NAME ?=3D Xen$(LIBNAME) PKG_CONFIG_DESC ?=3D The $(PKG_CONFIG_NAME) library for Xen hypervisor PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) PKG_CONFIG_USELIBS :=3D $(SHLIB_libxen$(LIBNAME)) -PKG_CONFIG_LIB :=3D xen$(LIBNAME) +PKG_CONFIG_LIB :=3D $(LIB_FILE_NAME) PKG_CONFIG_REQPRIV :=3D $(subst $(space),$(comma),$(strip $(foreach lib,$(= patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib)))) =20 ifneq ($(CONFIG_LIBXC_MINIOS),y) @@ -45,7 +46,7 @@ endif =20 PKG_CONFIG_LOCAL :=3D $(PKG_CONFIG_DIR)/$(PKG_CONFIG) =20 -LIBHEADER ?=3D xen$(LIBNAME).h +LIBHEADER ?=3D $(LIB_FILE_NAME).h LIBHEADERS =3D $(foreach h, $(LIBHEADER), include/$(h)) LIBHEADERSGLOB =3D $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(= h)) =20 @@ -81,36 +82,36 @@ libxen$(LIBNAME).map: $(LIBHEADERSGLOB): $(LIBHEADERS) for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/inclu= de; done =20 -libxen$(LIBNAME).a: $(LIB_OBJS) +lib$(LIB_FILE_NAME).a: $(LIB_OBJS) $(AR) rc $@ $^ =20 -libxen$(LIBNAME).so: libxen$(LIBNAME).so.$(MAJOR) +lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR) $(SYMLINK_SHLIB) $< $@ -libxen$(LIBNAME).so.$(MAJOR): libxen$(LIBNAME).so.$(MAJOR).$(MINOR) +lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(SYMLINK_SHLIB) $< $@ =20 -libxen$(LIBNAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map - $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxen$(LIBN= AME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_L= DFLAGS) +lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map + $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FIL= E_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEN= D_LDFLAGS) =20 .PHONY: install install: build $(INSTALL_DIR) $(DESTDIR)$(libdir) $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - $(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_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(lib= dir) + $(INSTALL_DATA) lib$(LIB_FILE_NAME).a $(DESTDIR)$(libdir) + $(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(lib= dir)/lib$(LIB_FILE_NAME).so.$(MAJOR) + $(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR) $(DESTDIR)$(libdir)/lib$= (LIB_FILE_NAME).so for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); d= one $(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR) =20 .PHONY: uninstall uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc + rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc 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) - rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).a + rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so + rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR) + rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) + rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).a =20 .PHONY: TAGS TAGS: @@ -119,7 +120,7 @@ TAGS: .PHONY: clean clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS) - rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) + rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(M= AJOR) rm -f headers.chk rm -f $(PKG_CONFIG) rm -f $(LIBHEADERSGLOB) --=20 2.26.2 From nobody Thu Apr 18 10:41:02 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=1599652034; cv=none; d=zohomail.com; s=zohoarc; b=PX6RqjCjvqTvXeP4nojGdg3SRnIKwX3r2S3fuljvIUcPiViuc0UyYGg7PtGlgVGMtwBa/yBoE5arBfTjK9AFH9HfLgb4Swlv1R4iutX7yZfjZMjpyTfCRUq5cgFJgYPm77qvhRuSLdIROplmVeC0wLyd2WgYfmDC72D2HuBiVU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599652034; 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=ocXEAhADtyVkcVIHezgisucq1vTZzKD9mJqKyr4DHmE=; b=jV5DhdDsspnm0q1fAAXoZXlp6s09ynSIjKXAfFSK8jFaRi0x2100gg2iFVifefUXplWpqSc9rItntrZwCrF4NoUM8ED5JP0cIJGY8ELDwTeOKhRGdv2NSThrpw0aQWyNM/l3Kl/M8jljU/vavc4gGO5JKnDeBG+TdM5M2NFdDLc= 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 1599652034748671.3289517833996; Wed, 9 Sep 2020 04:47:14 -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 1kFyYt-0003ue-W2; Wed, 09 Sep 2020 11:46:51 +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 1kFyYt-0003uJ-CQ for xen-devel@lists.xenproject.org; Wed, 09 Sep 2020 11:46:51 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 60d6e43c-a71d-4db8-a2e2-b48bed0bc124; Wed, 09 Sep 2020 11:46:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2361BAD49; Wed, 9 Sep 2020 11:46:49 +0000 (UTC) X-Inumbo-ID: 60d6e43c-a71d-4db8-a2e2-b48bed0bc124 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 , Anthony PERARD Subject: [PATCH v5 4/4] tools: move libxlutil to tools/libs/util Date: Wed, 9 Sep 2020 13:46:45 +0200 Message-Id: <20200909114645.3709-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909114645.3709-1-jgross@suse.com> References: <20200909114645.3709-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" Move the libxlutil source to tools/libs/util and delete tools/libxl. Signed-off-by: Juergen Gross --- .gitignore | 6 +- tools/Makefile | 1 - tools/Rules.mk | 7 - tools/libs/Makefile | 1 + tools/libs/uselibs.mk | 3 + tools/{libxl =3D> libs/util}/CODING_STYLE | 0 tools/libs/util/Makefile | 63 +++++++++ .../{libxl =3D> libs/util/include}/libxlutil.h | 0 tools/{libxl =3D> libs/util}/libxlu_cfg.c | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_i.h | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_l.c | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_l.h | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_l.l | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_y.c | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_y.h | 0 tools/{libxl =3D> libs/util}/libxlu_cfg_y.y | 0 tools/{libxl =3D> libs/util}/libxlu_disk.c | 0 tools/{libxl =3D> libs/util}/libxlu_disk_i.h | 0 tools/{libxl =3D> libs/util}/libxlu_disk_l.c | 0 tools/{libxl =3D> libs/util}/libxlu_disk_l.h | 0 tools/{libxl =3D> libs/util}/libxlu_disk_l.l | 0 tools/{libxl =3D> libs/util}/libxlu_internal.h | 0 tools/{libxl =3D> libs/util}/libxlu_pci.c | 0 tools/{libxl =3D> libs/util}/libxlu_vif.c | 0 tools/libxl/Makefile | 124 ------------------ 25 files changed, 71 insertions(+), 134 deletions(-) rename tools/{libxl =3D> libs/util}/CODING_STYLE (100%) create mode 100644 tools/libs/util/Makefile rename tools/{libxl =3D> libs/util/include}/libxlutil.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_i.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_l.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_l.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_l.l (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_y.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_y.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_cfg_y.y (100%) rename tools/{libxl =3D> libs/util}/libxlu_disk.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_disk_i.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_disk_l.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_disk_l.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_disk_l.l (100%) rename tools/{libxl =3D> libs/util}/libxlu_internal.h (100%) rename tools/{libxl =3D> libs/util}/libxlu_pci.c (100%) rename tools/{libxl =3D> libs/util}/libxlu_vif.c (100%) delete mode 100644 tools/libxl/Makefile diff --git a/.gitignore b/.gitignore index f30550255f..188495783e 100644 --- a/.gitignore +++ b/.gitignore @@ -154,6 +154,10 @@ tools/libs/store/utils.h tools/libs/store/xenstore.pc tools/libs/store/xs_lib.c tools/libs/store/include/xenstore_lib.h +tools/libs/util/*.pc +tools/libs/util/_paths.h +tools/libs/util/libxlu_cfg_y.output +tools/libs/util/libxenutil.map tools/libs/vchan/headers.chk tools/libs/vchan/libxenvchan.map tools/libs/vchan/xenvchan.pc @@ -232,8 +236,6 @@ tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker -tools/libxl/*.pc -tools/libxl/libxlu_cfg_y.output tools/misc/cpuperf/cpuperf-perfcntr tools/misc/cpuperf/cpuperf-xen tools/misc/xc_shadow diff --git a/tools/Makefile b/tools/Makefile index ea69675cca..9c77ee6763 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,7 +29,6 @@ SUBDIRS-$(CONFIG_QEMU_XEN) +=3D qemu-xen-dir endif =20 SUBDIRS-y +=3D xenpmd -SUBDIRS-y +=3D libxl SUBDIRS-$(CONFIG_GOLANG) +=3D golang SUBDIRS-y +=3D xl SUBDIRS-y +=3D helpers diff --git a/tools/Rules.mk b/tools/Rules.mk index 36094155b7..ccb197596e 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,8 +15,6 @@ XEN_INCLUDE =3D $(XEN_ROOT)/tools/include =20 include $(XEN_ROOT)/tools/libs/uselibs.mk =20 -XEN_libxenutil =3D $(XEN_ROOT)/tools/libxl - CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 XENSTORE_XENSTORED ?=3D y @@ -117,11 +115,6 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -CFLAGS_libxenutil =3D -I$(XEN_libxenutil) -SHDEPS_libxenutil =3D $(SHLIB_libxenlight) -LDLIBS_libxenutil =3D $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(li= bextension) -SHLIB_libxenutil =3D $(SHDEPS_libxenutil) -Wl,-rpath-link=3D$(XEN_libxenu= til) - CFLAGS +=3D -D__XEN_INTERFACE_VERSION__=3D__XEN_LATEST_INTERFACE_VERSION__ =20 # Get gcc to generate the dependencies for us. diff --git a/tools/libs/Makefile b/tools/libs/Makefile index c41455c604..1afcd12e2b 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -16,6 +16,7 @@ SUBDIRS-y +=3D store SUBDIRS-y +=3D stat SUBDIRS-$(CONFIG_Linux) +=3D vchan SUBDIRS-y +=3D light +SUBDIRS-y +=3D util =20 ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D toolcore diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index 685f368aed..efd7a475ba 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -28,3 +28,6 @@ LIBS_LIBS +=3D stat USELIBS_stat :=3D ctrl store LIBS_LIBS +=3D light USELIBS_light :=3D toollog evtchn toolcore ctrl store hypfs guest +LIBS_LIBS +=3D util +USELIBS_util :=3D light +FILENAME_util :=3D xlutil diff --git a/tools/libxl/CODING_STYLE b/tools/libs/util/CODING_STYLE similarity index 100% rename from tools/libxl/CODING_STYLE rename to tools/libs/util/CODING_STYLE diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile new file mode 100644 index 0000000000..0c9db8027d --- /dev/null +++ b/tools/libs/util/Makefile @@ -0,0 +1,63 @@ +XEN_ROOT =3D $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +SRCS-y +=3D libxlu_cfg_y.c +SRCS-y +=3D libxlu_cfg_l.c +SRCS-y +=3D libxlu_cfg.c +SRCS-y +=3D libxlu_disk_l.c +SRCS-y +=3D libxlu_disk.c +SRCS-y +=3D libxlu_vif.c +SRCS-y +=3D libxlu_pci.c + +CFLAGS +=3D -Wno-format-zero-length -Wmissing-declarations \ + -Wno-declaration-after-statement -Wformat-nonliteral +CFLAGS +=3D -I. $(CFLAGS_libxenctrl) + +CFLAGS +=3D $(PTHREAD_CFLAGS) +LDFLAGS +=3D $(PTHREAD_LDFLAGS) + +ifeq ($(FLEX),) +%.c %.h:: %.l + $(warning Flex is needed to rebuild some libxl parsers and \ + scanners, please install it and rerun configure) +endif + +ifeq ($(BISON),) +%.c %.h:: %.y + $(warning Bison is needed to rebuild some libxl parsers and \ + scanners, please install it and rerun configure) +endif + +AUTOINCS =3D libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h +AUTOSRCS =3D libxlu_cfg_y.c libxlu_cfg_l.c + +LIBHEADER :=3D libxlutil.h +PKG_CONFIG_NAME :=3D Xlutil +PKG_CONFIG_DESC :=3D The xl utility library for Xen hypervisor + +NO_HEADERS_CHK :=3D y + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenutil)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) + +$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h + +%.c %.h:: %.y + @rm -f $*.[ch] + $(BISON) --output=3D$*.c $< + +%.c %.h:: %.l + @rm -f $*.[ch] + $(FLEX) --header-file=3D$*.h --outfile=3D$*.c $< + +genpath-target =3D $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + $(RM) -f _*.h + $(RM) -f libxlutil.map diff --git a/tools/libxl/libxlutil.h b/tools/libs/util/include/libxlutil.h similarity index 100% rename from tools/libxl/libxlutil.h rename to tools/libs/util/include/libxlutil.h diff --git a/tools/libxl/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c similarity index 100% rename from tools/libxl/libxlu_cfg.c rename to tools/libs/util/libxlu_cfg.c diff --git a/tools/libxl/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h similarity index 100% rename from tools/libxl/libxlu_cfg_i.h rename to tools/libs/util/libxlu_cfg_i.h diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libs/util/libxlu_cfg_l.c similarity index 100% rename from tools/libxl/libxlu_cfg_l.c rename to tools/libs/util/libxlu_cfg_l.c diff --git a/tools/libxl/libxlu_cfg_l.h b/tools/libs/util/libxlu_cfg_l.h similarity index 100% rename from tools/libxl/libxlu_cfg_l.h rename to tools/libs/util/libxlu_cfg_l.h diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libs/util/libxlu_cfg_l.l similarity index 100% rename from tools/libxl/libxlu_cfg_l.l rename to tools/libs/util/libxlu_cfg_l.l diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libs/util/libxlu_cfg_y.c similarity index 100% rename from tools/libxl/libxlu_cfg_y.c rename to tools/libs/util/libxlu_cfg_y.c diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libs/util/libxlu_cfg_y.h similarity index 100% rename from tools/libxl/libxlu_cfg_y.h rename to tools/libs/util/libxlu_cfg_y.h diff --git a/tools/libxl/libxlu_cfg_y.y b/tools/libs/util/libxlu_cfg_y.y similarity index 100% rename from tools/libxl/libxlu_cfg_y.y rename to tools/libs/util/libxlu_cfg_y.y diff --git a/tools/libxl/libxlu_disk.c b/tools/libs/util/libxlu_disk.c similarity index 100% rename from tools/libxl/libxlu_disk.c rename to tools/libs/util/libxlu_disk.c diff --git a/tools/libxl/libxlu_disk_i.h b/tools/libs/util/libxlu_disk_i.h similarity index 100% rename from tools/libxl/libxlu_disk_i.h rename to tools/libs/util/libxlu_disk_i.h diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libs/util/libxlu_disk_l.c similarity index 100% rename from tools/libxl/libxlu_disk_l.c rename to tools/libs/util/libxlu_disk_l.c diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libs/util/libxlu_disk_l.h similarity index 100% rename from tools/libxl/libxlu_disk_l.h rename to tools/libs/util/libxlu_disk_l.h diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libs/util/libxlu_disk_l.l similarity index 100% rename from tools/libxl/libxlu_disk_l.l rename to tools/libs/util/libxlu_disk_l.l diff --git a/tools/libxl/libxlu_internal.h b/tools/libs/util/libxlu_interna= l.h similarity index 100% rename from tools/libxl/libxlu_internal.h rename to tools/libs/util/libxlu_internal.h diff --git a/tools/libxl/libxlu_pci.c b/tools/libs/util/libxlu_pci.c similarity index 100% rename from tools/libxl/libxlu_pci.c rename to tools/libs/util/libxlu_pci.c diff --git a/tools/libxl/libxlu_vif.c b/tools/libs/util/libxlu_vif.c similarity index 100% rename from tools/libxl/libxlu_vif.c rename to tools/libs/util/libxlu_vif.c diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile deleted file mode 100644 index 51da1d5be4..0000000000 --- a/tools/libxl/Makefile +++ /dev/null @@ -1,124 +0,0 @@ -# -# tools/libxl/Makefile -# - -XEN_ROOT =3D $(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -XLUMAJOR =3D 4.15 -XLUMINOR =3D 0 - -CFLAGS +=3D -Werror -Wno-format-zero-length -Wmissing-declarations \ - -Wno-declaration-after-statement -Wformat-nonliteral -CFLAGS +=3D -I. -fPIC - -CFLAGS +=3D $(PTHREAD_CFLAGS) -LDFLAGS +=3D $(PTHREAD_LDFLAGS) - -LIBXLU_LIBS =3D $(LDLIBS_libxenlight) - -ifeq ($(FLEX),) -%.c %.h:: %.l - $(warning Flex is needed to rebuild some libxl parsers and \ - scanners, please install it and rerun configure) -endif - -ifeq ($(BISON),) -%.c %.h:: %.y - $(warning Bison is needed to rebuild some libxl parsers and \ - scanners, please install it an rerun configure) -endif - -AUTOINCS=3D libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h -AUTOSRCS=3D libxlu_cfg_y.c libxlu_cfg_l.c -LIBXLU_OBJS =3D libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ - libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o -$(LIBXLU_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) # For xentoollog.h - -PKG_CONFIG =3D xlutil.pc - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST :=3D $(PKG_CONFIG) -xlutil.pc: PKG_CONFIG_NAME =3D Xlutil -xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library for Xen hypervisor -xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) -xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenutil) -xlutil.pc: PKG_CONFIG_LIB =3D xlutil -xlutil.pc: PKG_CONFIG_REQPRIV =3D xenlight -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) -endif - -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_NAME =3D Xlutil -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_DESC =3D The xl utility library fo= r Xen hypervisor -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION =3D $(XLUMAJOR).$(XLUMINOR) -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS =3D $(SHLIB_libxenutil) -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_LIB =3D xlutil -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_REQPRIV =3D xenlight -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) - -.PHONY: all -all: libxlutil.so libxlutil.a $(AUTOSRCS) $(AUTOINCS) $(PKG_CONFIG) $(PKG_= CONFIG_LOCAL) - -$(LIBXLU_OBJS): $(AUTOINCS) - -%.c %.h:: %.y - @rm -f $*.[ch] - $(BISON) --output=3D$*.c $< - -%.c %.h:: %.l - @rm -f $*.[ch] - $(FLEX) --header-file=3D$*.h --outfile=3D$*.c $< - -genpath-target =3D $(call buildmakevars2header,_paths.h) -$(eval $(genpath-target)) - -libxlutil.so: libxlutil.so.$(XLUMAJOR) - $(SYMLINK_SHLIB) $< $@ - -libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - $(SYMLINK_SHLIB) $< $@ - -libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLI= B_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS) - -libxlutil.a: $(LIBXLU_OBJS) - $(AR) rcs libxlutil.a $^ - -.PHONY: install -install: all - $(INSTALL_DIR) $(DESTDIR)$(libdir) - $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir) - $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)= /libxlutil.so.$(XLUMAJOR) - $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so - $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir) - $(INSTALL_DATA) libxlutil.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR) - -.PHONY: uninstall -uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xlutil.pc - rm -f $(DESTDIR)$(includedir)/libxlutil.h - rm -f $(DESTDIR)$(libdir)/libxlutil.a - rm -f $(DESTDIR)$(libdir)/libxlutil.so - rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) - rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - -.PHONY: clean -clean: - $(RM) -f _*.h *.o *.so* *.a $(DEPS_RM) - $(RM) -f xlutil.pc - -distclean: clean - -realclean: distclean - $(RM) -f $(AUTOSRCS) $(AUTOINCS) - --include $(DEPS_INCLUDE) --=20 2.26.2