214087
From 378d4707c26acf05e551219d8b09ddf440bdba2a Mon Sep 17 00:00:00 2001
214087
From: Rosen Penev <rosenp@gmail.com>
214087
Date: Fri, 10 Jun 2022 23:14:27 -0700
214087
Subject: [PATCH 03/14] add meson
214087
214087
Simpler build system. Placing in contrib for now.
214087
214087
Signed-off-by: Rosen Penev <rosenp@gmail.com>
214087
---
214087
 contrib/README            |  2 ++
214087
 contrib/meson.build       | 45 +++++++++++++++++++++++++++++++++++++++
214087
 contrib/meson_options.txt | 11 ++++++++++
214087
 3 files changed, 58 insertions(+)
214087
 create mode 100644 contrib/README
214087
 create mode 100644 contrib/meson.build
214087
 create mode 100644 contrib/meson_options.txt
214087
214087
diff --git a/contrib/README b/contrib/README
214087
new file mode 100644
214087
index 0000000..2158dac
214087
--- /dev/null
214087
+++ b/contrib/README
214087
@@ -0,0 +1,2 @@
214087
+This directory contains meson build instructions for irqbalance. This is here to see if there is any interest from
214087
+the general community.
214087
diff --git a/contrib/meson.build b/contrib/meson.build
214087
new file mode 100644
214087
index 0000000..d813233
214087
--- /dev/null
214087
+++ b/contrib/meson.build
214087
@@ -0,0 +1,45 @@
214087
+project('irqbalance', 'c', version: '1.9.0', default_options: ['warning_level=1'])
214087
+cc = meson.get_compiler('c')
214087
+
214087
+glib_dep = dependency('glib-2.0')
214087
+m_dep = cc.find_library('m', required: false)
214087
+capng_dep = dependency('libcap-ng', required: get_option('capng'))
214087
+ncurses_dep = dependency('curses', required: get_option('ui'))
214087
+systemd_dep = dependency('libsystemd', required: get_option('systemd'))
214087
+
214087
+cdata = configuration_data()
214087
+cdata.set('HAVE_GETOPT_LONG', cc.has_function('getopt_long'))
214087
+cdata.set('HAVE_IRQBALANCEUI', ncurses_dep.found())
214087
+cdata.set('HAVE_NUMA_H', cc.has_header('numa.h'))
214087
+cdata.set('HAVE_LIBCAP_NG', capng_dep.found())
214087
+cdata.set('HAVE_LIBSYSTEMD', systemd_dep.found())
214087
+cdata.set_quoted('VERSION', meson.project_version())
214087
+cfile = configure_file(output: 'config.h', configuration: cdata)
214087
+
214087
+if cdata.get('HAVE_IRQBALANCEUI')
214087
+  add_project_arguments('-D_GNU_SOURCE', language: 'c')
214087
+
214087
+  executable(
214087
+    'irqbalance-ui',
214087
+    '../ui/helpers.c',
214087
+    '../ui/irqbalance-ui.c',
214087
+    '../ui/ui.c',
214087
+    dependencies: [glib_dep, ncurses_dep],
214087
+    install: true,
214087
+  )
214087
+endif
214087
+
214087
+executable(
214087
+  'irqbalance',
214087
+  '../activate.c',
214087
+  '../bitmap.c',
214087
+  '../classify.c',
214087
+  '../cputree.c',
214087
+  '../irqbalance.c',
214087
+  '../irqlist.c',
214087
+  '../numa.c',
214087
+  '../placement.c',
214087
+  '../procinterrupts.c',
214087
+  dependencies: [glib_dep, m_dep, capng_dep, systemd_dep],
214087
+  install: true,
214087
+)
214087
diff --git a/contrib/meson_options.txt b/contrib/meson_options.txt
214087
new file mode 100644
214087
index 0000000..3515dc3
214087
--- /dev/null
214087
+++ b/contrib/meson_options.txt
214087
@@ -0,0 +1,11 @@
214087
+option('capng', type : 'feature',
214087
+  description : 'Build with libcap-ng support',
214087
+)
214087
+
214087
+option('systemd', type : 'feature',
214087
+  description : 'Build with systemd support',
214087
+)
214087
+
214087
+option('ui', type : 'feature',
214087
+  description : 'Build the UI component',
214087
+)
214087
-- 
214087
2.33.1
214087