]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: build libvirt_driver_nodedev_impl.a static library
authorPavel Hrdina <phrdina@redhat.com>
Wed, 24 Jun 2020 10:36:02 +0000 (12:36 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:04 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/meson.build
src/node_device/Makefile.inc.am
src/node_device/meson.build [new file with mode: 0644]

index f6b342098d1e248ac1f8ce37d953c8f41940b3d3..ab8a5e001fe75487ae0e4c0577b00c578cb2e0fa 100644 (file)
@@ -153,6 +153,7 @@ subdir('admin')
 subdir('locking')
 subdir('logging')
 subdir('network')
+subdir('node_device')
 subdir('security')
 
 subdir('bhyve')
index 8a8bbea01e97db1a35b5cf7ccc61878d424cda83..d3261cb15c49b2d51d13b78c21c80dda47b9f8ec 100644 (file)
@@ -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 (file)
index 0000000..4ee64f5
--- /dev/null
@@ -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