]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: examples: build and install example files
authorPavel Hrdina <phrdina@redhat.com>
Thu, 25 Jun 2020 16:14:13 +0000 (18:14 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:06 +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>
15 files changed:
Makefile.am
configure.ac
examples/Makefile.am [deleted file]
examples/c/admin/meson.build [new file with mode: 0644]
examples/c/domain/meson.build [new file with mode: 0644]
examples/c/meson.build [new file with mode: 0644]
examples/c/misc/meson.build [new file with mode: 0644]
examples/meson.build [new file with mode: 0644]
examples/polkit/meson.build [new file with mode: 0644]
examples/sh/meson.build [new file with mode: 0644]
examples/systemtap/meson.build [new file with mode: 0644]
examples/xml/meson.build [new file with mode: 0644]
examples/xml/storage/meson.build [new file with mode: 0644]
examples/xml/test/meson.build [new file with mode: 0644]
meson.build

index 549ade3db2000054ba9e680dee11589d9dad122e..4b3abc827282cba4619ecdce7ebc721b095a1a83 100644 (file)
@@ -21,7 +21,7 @@
 DISTCHECK_CONFIGURE_FLAGS = --enable-werror
 
 SUBDIRS = . docs \
-  po examples
+  po
 
 XZ_OPT ?= -v -T0
 export XZ_OPT
index b7bfb1c26d20477c94ca5ce3467d79cb04758464..94e8796af1a00f442daf09c46bd1aaaff7faeca8 100644 (file)
@@ -114,6 +114,5 @@ AC_CONFIG_FILES([\
         libvirt-lxc.pc \
         libvirt-admin.pc \
         libvirt.spec mingw-libvirt.spec \
-        po/Makefile \
-        examples/Makefile])
+        po/Makefile])
 AC_OUTPUT
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644 (file)
index 15ff897..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-## Copyright (C) 2005-2016 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-ADMIN_EXAMPLES = \
-       $(wildcard $(srcdir)/c/admin/*.c) \
-       $(NULL)
-
-DOMAIN_EXAMPLES = \
-       $(wildcard $(srcdir)/c/domain/*.c) \
-       $(NULL)
-
-MISC_EXAMPLES = \
-       $(wildcard $(srcdir)/c/misc/*.c) \
-       $(NULL)
-
-POLKIT_EXAMPLES = \
-       $(wildcard $(srcdir)/polkit/*.rules) \
-       $(NULL)
-
-SH_EXAMPLES = \
-       $(wildcard $(srcdir)/sh/*) \
-       $(NULL)
-
-STORAGE_XML_EXAMPLES = \
-       $(wildcard $(srcdir)/xml/storage/*.xml) \
-       $(NULL)
-
-SYSTEMTAP_EXAMPLES = \
-       $(wildcard $(srcdir)/systemtap/*.stp) \
-       $(NULL)
-
-TEST_XML_EXAMPLES = \
-       $(wildcard $(srcdir)/xml/test/*.xml) \
-       $(NULL)
-
-AM_CPPFLAGS = \
-       -I$(top_builddir)/include \
-       -I$(top_srcdir)/include \
-       $(NULL)
-
-AM_CFLAGS = \
-       $(WARN_CFLAGS) \
-       $(NULL)
-
-AM_LDFLAGS = \
-       $(STATIC_BINARIES) \
-       $(NULL)
-
-LDADD = \
-       $(top_builddir)/src/libvirt.la \
-       $(top_builddir)/src/libvirt-admin.la \
-       $(NULL)
-
-noinst_PROGRAMS = \
-       c/admin/client_close \
-       c/admin/client_info \
-       c/admin/client_limits \
-       c/admin/list_clients \
-       c/admin/list_servers \
-       c/admin/logging \
-       c/admin/threadpool_params \
-       c/domain/dommigrate \
-       c/domain/domtop \
-       c/domain/info1 \
-       c/domain/rename \
-       c/domain/suspend \
-       c/misc/event-test \
-       c/misc/hellolibvirt \
-       c/misc/openauth \
-       $(NULL)
-
-c_admin_client_close_SOURCES = c/admin/client_close.c
-c_admin_client_info_SOURCES = c/admin/client_info.c
-c_admin_client_limits_SOURCES = c/admin/client_limits.c
-c_admin_list_clients_SOURCES = c/admin/list_clients.c
-c_admin_list_servers_SOURCES = c/admin/list_servers.c
-c_admin_logging_SOURCES = c/admin/logging.c
-c_admin_threadpool_params_SOURCES = c/admin/threadpool_params.c
-c_domain_dommigrate_SOURCES = c/domain/dommigrate.c
-c_domain_domtop_SOURCES = c/domain/domtop.c
-c_domain_info1_SOURCES = c/domain/info1.c
-c_domain_rename_SOURCES = c/domain/rename.c
-c_domain_suspend_SOURCES = c/domain/suspend.c
-c_misc_event_test_SOURCES = c/misc/event-test.c
-c_misc_hellolibvirt_SOURCES = c/misc/hellolibvirt.c
-c_misc_openauth_SOURCES = c/misc/openauth.c
-
-examplesdir = $(docdir)/examples
-
-adminexamplesdir = $(examplesdir)/c/admin
-adminexamples_DATA = $(ADMIN_EXAMPLES)
-
-domainexamplesdir = $(examplesdir)/c/domain
-domainexamples_DATA = $(DOMAIN_EXAMPLES)
-
-miscexamplesdir = $(examplesdir)/c/misc
-miscexamples_DATA = $(MISC_EXAMPLES)
-
-polkitexamplesdir = $(examplesdir)/polkit
-polkitexamples_DATA = $(POLKIT_EXAMPLES)
-
-shexamplesdir = $(examplesdir)/sh
-shexamples_DATA = $(SH_EXAMPLES)
-
-storagexmlexamplesdir = $(examplesdir)/xml/storage
-storagexmlexamples_DATA = $(STORAGE_XML_EXAMPLES)
-
-systemtapexamplesdir = $(examplesdir)/systemtap
-systemtapexamples_DATA = $(SYSTEMTAP_EXAMPLES)
-
-testxmlexamplesdir = $(examplesdir)/xml/test
-testxmlexamples_DATA = $(TEST_XML_EXAMPLES)
diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build
new file mode 100644 (file)
index 0000000..094408a
--- /dev/null
@@ -0,0 +1,27 @@
+example_admin_files = [
+  'client_close',
+  'client_info',
+  'client_limits',
+  'list_clients',
+  'list_servers',
+  'logging',
+  'threadpool_params',
+]
+
+foreach name : example_admin_files
+  source_file = '@0@.c'.format(name)
+  executable(
+    name,
+    [
+      source_file,
+    ],
+    include_directories: [
+      libvirt_inc,
+    ],
+    link_with: [
+      libvirt_lib,
+      libvirt_admin_lib,
+    ],
+  )
+  install_data(source_file, install_dir: example_dir / 'c' / 'admin')
+endforeach
diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build
new file mode 100644 (file)
index 0000000..51cd03a
--- /dev/null
@@ -0,0 +1,24 @@
+example_domain_files = [
+  'dommigrate',
+  'domtop',
+  'info1',
+  'rename',
+  'suspend',
+]
+
+foreach name : example_domain_files
+  source_file = '@0@.c'.format(name)
+  executable(
+    name,
+    [
+      source_file,
+    ],
+    include_directories: [
+      libvirt_inc,
+    ],
+    link_with: [
+      libvirt_lib,
+    ],
+  )
+  install_data(source_file, install_dir: example_dir / 'c' / 'domain')
+endforeach
diff --git a/examples/c/meson.build b/examples/c/meson.build
new file mode 100644 (file)
index 0000000..727e4ca
--- /dev/null
@@ -0,0 +1,3 @@
+subdir('admin')
+subdir('domain')
+subdir('misc')
diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build
new file mode 100644 (file)
index 0000000..b106467
--- /dev/null
@@ -0,0 +1,22 @@
+example_misc_files = [
+  'event-test',
+  'hellolibvirt',
+  'openauth',
+]
+
+foreach name : example_misc_files
+  source_file = '@0@.c'.format(name)
+  executable(
+    name,
+    [
+      source_file,
+    ],
+    include_directories: [
+      libvirt_inc,
+    ],
+    link_with: [
+      libvirt_lib,
+    ],
+  )
+  install_data(source_file, install_dir: example_dir / 'c' / 'misc')
+endforeach
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644 (file)
index 0000000..a57820a
--- /dev/null
@@ -0,0 +1,7 @@
+example_dir = docdir / 'examples'
+
+subdir('c')
+subdir('polkit')
+subdir('sh')
+subdir('systemtap')
+subdir('xml')
diff --git a/examples/polkit/meson.build b/examples/polkit/meson.build
new file mode 100644 (file)
index 0000000..d57c5a1
--- /dev/null
@@ -0,0 +1 @@
+install_data('libvirt-acl.rules', install_dir: example_dir / 'polkit')
diff --git a/examples/sh/meson.build b/examples/sh/meson.build
new file mode 100644 (file)
index 0000000..0cdbe17
--- /dev/null
@@ -0,0 +1 @@
+install_data('virt-lxc-convert', install_dir: example_dir / 'sh')
diff --git a/examples/systemtap/meson.build b/examples/systemtap/meson.build
new file mode 100644 (file)
index 0000000..f31187e
--- /dev/null
@@ -0,0 +1,9 @@
+install_data(
+  [
+    'rpc-monitor.stp',
+    'qemu-monitor.stp',
+    'lock-debug.stp',
+    'events.stp',
+  ],
+  install_dir: example_dir / 'systemtap',
+)
diff --git a/examples/xml/meson.build b/examples/xml/meson.build
new file mode 100644 (file)
index 0000000..650d6a1
--- /dev/null
@@ -0,0 +1,2 @@
+subdir('storage')
+subdir('test')
diff --git a/examples/xml/storage/meson.build b/examples/xml/storage/meson.build
new file mode 100644 (file)
index 0000000..c142bb1
--- /dev/null
@@ -0,0 +1,15 @@
+install_data(
+  [
+    'pool-dir.xml',
+    'pool-fs.xml',
+    'pool-logical.xml',
+    'pool-netfs.xml',
+    'vol-cow.xml',
+    'vol-qcow.xml',
+    'vol-qcow2.xml',
+    'vol-raw.xml',
+    'vol-sparse.xml',
+    'vol-vmdk.xml',
+  ],
+  install_dir: example_dir / 'xml' / 'storage',
+)
diff --git a/examples/xml/test/meson.build b/examples/xml/test/meson.build
new file mode 100644 (file)
index 0000000..89ebf03
--- /dev/null
@@ -0,0 +1,14 @@
+install_data(
+  [
+    'testdev.xml',
+    'testnodeinline.xml',
+    'testdomfc4.xml',
+    'testdomfv0.xml',
+    'testnode.xml',
+    'testnetdef.xml',
+    'testvol.xml',
+    'testnetpriv.xml',
+    'testpool.xml',
+  ],
+  install_dir: example_dir / 'xml' / 'test',
+)
index a5f97f2ab33eaeb77343decc858feb025a3f2b9a..e8d79caf1d7148c7a57757409c265c2a65a7bd36 100644 (file)
@@ -2227,6 +2227,8 @@ subdir('tools')
 
 subdir('tests')
 
+subdir('examples')
+
 
 # generate meson-config.h file
 configure_file(output: 'meson-config.h', configuration: conf)