Add meson config

Moving the project over to meson per the technical oversight forum.

Change-Id: I9c8d99ec8bcad07fb863f80e5152a93187e91310
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..7650113
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,54 @@
+project(
+  'jsnbd',
+  'c',
+  version : '1.0',
+  meson_version: '>=0.63.0',
+  default_options: [
+    'b_ndebug=if-release',
+    'cpp_rtti=false',
+    'cpp_std=c++20',
+    'warning_level=3',
+    'werror=true',
+  ]
+)
+
+bindir = get_option('prefix') + '/' + get_option('bindir')
+localstatedir = get_option('localstatedir')
+sysconfdir = get_option('sysconfdir')
+
+c = meson.get_compiler('c')
+
+json_c = dependency('json-c', include_type: 'system')
+udev = c.find_library('udev')
+
+conf_data = configuration_data()
+
+if c.has_header_symbol('fcntl.h', 'splice', args: '-D_GNU_SOURCE')
+  conf_data.set('HAVE_SPLICE', 1)
+endif
+
+conf_data.set('RUNSTATEDIR', '"' + localstatedir + '/run"')
+conf_data.set('SYSCONFDIR', '"' + sysconfdir + '"')
+
+conf_h_dep = declare_dependency(
+    sources: configure_file(
+        output: 'config.h',
+        configuration: conf_data
+    )
+)
+
+add_project_arguments([
+  '-Wno-pedantic',
+], language : 'c')
+
+executable(
+  'nbd-proxy',
+  'nbd-proxy.c',
+  dependencies: [
+    json_c,
+    conf_h_dep,
+    udev,
+  ],
+  install: true,
+  install_dir: bindir
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..e6fd709
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+option(
+    'tests',
+    type: 'feature',
+    value: 'enabled',
+    description: 'Build unit tests',
+)