qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 059/132] meson: convert backends directory to Meson


From: Paolo Bonzini
Subject: [PATCH 059/132] meson: convert backends directory to Meson
Date: Thu, 12 Dec 2019 13:51:43 +0100

From: Marc-André Lureau <address@hidden>

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 Makefile.objs          |  1 -
 backends/Makefile.objs | 19 -------------------
 backends/meson.build   | 16 ++++++++++++++++
 configure              |  2 ++
 meson.build            |  5 +++++
 5 files changed, 23 insertions(+), 20 deletions(-)
 delete mode 100644 backends/Makefile.objs
 create mode 100644 backends/meson.build

diff --git a/Makefile.objs b/Makefile.objs
index e316e96..12d0a78 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -58,7 +58,6 @@ common-obj-$(if $(CONFIG_LZFSE),m) += block-dmg-lzfse$(DSOSUF)
 common-obj-$(if $(and $(CONFIG_BZIP2),$(CONFIG_DMG)),m) += 
block-dmg-bz2$(DSOSUF)
 
 common-obj-y += hw/
-common-obj-y += backends/
 endif
 
 #######################################################################
diff --git a/backends/Makefile.objs b/backends/Makefile.objs
deleted file mode 100644
index 981e8e1..0000000
--- a/backends/Makefile.objs
+++ /dev/null
@@ -1,19 +0,0 @@
-common-obj-y += rng.o rng-egd.o
-common-obj-$(CONFIG_POSIX) += rng-random.o
-
-common-obj-$(CONFIG_TPM) += tpm.o
-
-common-obj-y += hostmem.o hostmem-ram.o
-common-obj-$(CONFIG_POSIX) += hostmem-file.o
-
-common-obj-y += cryptodev.o
-common-obj-y += cryptodev-builtin.o
-
-ifeq ($(CONFIG_VIRTIO_CRYPTO),y)
-common-obj-y += cryptodev-vhost.o
-common-obj-$(CONFIG_VHOST_CRYPTO) += cryptodev-vhost-user.o
-endif
-
-common-obj-$(call land,$(CONFIG_VHOST_USER),$(CONFIG_VIRTIO)) += vhost-user.o
-
-common-obj-$(CONFIG_LINUX) += hostmem-memfd.o
diff --git a/backends/meson.build b/backends/meson.build
new file mode 100644
index 0000000..b47864f
--- /dev/null
+++ b/backends/meson.build
@@ -0,0 +1,16 @@
+softmmu_ss.add([files(
+  'cryptodev-builtin.c',
+  'cryptodev.c',
+  'hostmem-ram.c',
+  'hostmem.c',
+  'rng-egd.c',
+  'rng.c',
+), numa])
+
+softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c'))
+softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c'))
+softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
+softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('hostmem-memfd.c'))
+softmmu_ss.add(when: ['CONFIG_VHOST_USER', 'CONFIG_VIRTIO'], if_true: 
files('vhost-user.c'))
+softmmu_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: 
files('cryptodev-vhost.c'))
+softmmu_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VHOST_CRYPTO'], if_true: 
files('cryptodev-vhost-user.c'))
diff --git a/configure b/configure
index fc57ec5..28746c1 100755
--- a/configure
+++ b/configure
@@ -4317,6 +4317,7 @@ EOF
   if compile_prog "" "-lnuma" ; then
     numa=yes
     libs_softmmu="-lnuma $libs_softmmu"
+    numa_libs="-lnuma"
   else
     if test "$numa" = "yes" ; then
       feature_not_found "numa" "install numactl devel"
@@ -7798,6 +7799,7 @@ fi
 
 if test "$numa" = "yes"; then
   echo "CONFIG_NUMA=y" >> $config_host_mak
+  echo "NUMA_LIBS=$numa_libs" >> $config_host_mak
 fi
 
 if test "$ccache_cpp2" = "yes"; then
diff --git a/meson.build b/meson.build
index 2333a87..94bc696 100644
--- a/meson.build
+++ b/meson.build
@@ -291,6 +291,10 @@ if 'CONFIG_LIBPMEM' in config_host
   libpmem = declare_dependency(compile_args: 
config_host['LIBPMEM_CFLAGS'].split(),
                                link_args: config_host['LIBPMEM_LIBS'].split())
 endif
+numa = declare_dependency()
+if 'CONFIG_NUMA' in config_host
+  numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
+endif
 
 create_config = find_program('scripts/create_config')
 minikconf = find_program('scripts/minikconf.py')
@@ -608,6 +612,7 @@ softmmu_ss.add(when: ['CONFIG_FDT', fdt],  if_true: 
[files('device_tree.c')])
 
 common_ss.add(files('cpus-common.c'))
 
+subdir('backends')
 subdir('migration')
 subdir('monitor')
 subdir('net')
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]