From edc8662daf06acb9e9d8544336c4aa4a39ed365f Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Wed, 24 Jun 2020 12:36:02 +0200 Subject: [PATCH] meson: src: build libvirt_driver_nodedev_impl.a static library Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- src/meson.build | 1 + src/node_device/Makefile.inc.am | 47 --------------------------------- src/node_device/meson.build | 31 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 47 deletions(-) create mode 100644 src/node_device/meson.build diff --git a/src/meson.build b/src/meson.build index f6b342098d..ab8a5e001f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -153,6 +153,7 @@ subdir('admin') subdir('locking') subdir('logging') subdir('network') +subdir('node_device') subdir('security') subdir('bhyve') diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 8a8bbea01e..d3261cb15c 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -1,20 +1,5 @@ # vim: filetype=automake -NODE_DEVICE_DRIVER_SOURCES = \ - node_device/node_device_driver.c \ - node_device/node_device_driver.h \ - $(NULL) - -NODE_DEVICE_DRIVER_HAL_SOURCES = \ - node_device/node_device_hal.c \ - node_device/node_device_hal.h \ - $(NULL) - -NODE_DEVICE_DRIVER_UDEV_SOURCES = \ - node_device/node_device_udev.c \ - node_device/node_device_udev.h \ - $(NULL) - DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_HAL_SOURCES)) \ @@ -27,42 +12,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES -# Needed to keep automake quiet about conditionals -noinst_LTLIBRARIES += libvirt_driver_nodedev_impl.la libvirt_driver_nodedev_la_SOURCES = libvirt_driver_nodedev_la_LIBADD = libvirt_driver_nodedev_impl.la libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) mod_LTLIBRARIES += libvirt_driver_nodedev.la -libvirt_driver_nodedev_impl_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) - -libvirt_driver_nodedev_impl_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(NULL) -libvirt_driver_nodedev_impl_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - -if WITH_HAL -libvirt_driver_nodedev_impl_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) -libvirt_driver_nodedev_impl_la_CFLAGS += $(HAL_CFLAGS) -libvirt_driver_nodedev_impl_la_LIBADD += $(HAL_LIBS) -endif WITH_HAL -if WITH_UDEV -libvirt_driver_nodedev_impl_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES) -libvirt_driver_nodedev_impl_la_CFLAGS += \ - $(UDEV_CFLAGS) \ - $(PCIACCESS_CFLAGS) \ - $(NULL) -libvirt_driver_nodedev_impl_la_LIBADD += \ - $(UDEV_LIBS) \ - $(PCIACCESS_LIBS) \ - $(NULL) -endif WITH_UDEV sbin_PROGRAMS += virtnodedevd diff --git a/src/node_device/meson.build b/src/node_device/meson.build new file mode 100644 index 0000000000..4ee64f5643 --- /dev/null +++ b/src/node_device/meson.build @@ -0,0 +1,31 @@ +node_device_driver_sources = [ + 'node_device_driver.c', +] + +if conf.has('WITH_HAL') + node_device_driver_sources += 'node_device_hal.c' +endif + +if conf.has('WITH_UDEV') + node_device_driver_sources += 'node_device_udev.c' +endif + +if conf.has('WITH_NODE_DEVICES') + node_device_driver_impl = static_library( + 'virt_driver_nodedev_impl', + [ + node_device_driver_sources, + ], + dependencies: [ + access_dep, + hal_dep, + libnl_dep, + pciaccess_dep, + src_dep, + udev_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif