diff mbox series

[v2,for-3.2,v2,30/30] build-sys: add a basic meson build

Message ID 20181121220647.18844-31-marcandre.lureau@redhat.com
State New
Headers show
Series slirp: make it again a standalone project | expand

Commit Message

Marc-André Lureau Nov. 21, 2018, 10:06 p.m. UTC
This is a minimal file to build a libslirp shared library.

It has been tested to build on Linux and with mingw64 cross-compilation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 slirp/meson.build | 48 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 slirp/meson.build
diff mbox series

Patch

diff --git a/slirp/meson.build b/slirp/meson.build
new file mode 100644
index 0000000000..aa6f1b39e2
--- /dev/null
+++ b/slirp/meson.build
@@ -0,0 +1,48 @@ 
+project('slirp', 'c', version : '3.1')
+
+add_global_arguments('-std=gnu99', language : 'c')
+
+host_system = host_machine.system()
+
+glib_dep = dependency('glib-2.0')
+
+cc = meson.get_compiler('c')
+
+platform_deps = []
+
+if host_system == 'windows'
+  platform_deps += [
+    cc.find_library('ws2_32'),
+    cc.find_library('iphlpapi')
+  ]
+endif
+
+shared_library('slirp',
+               'arp_table.c',
+               'bootp.c',
+               'cksum.c',
+               'dhcpv6.c',
+               'dnssearch.c',
+               'if.c',
+               'ip6_icmp.c',
+               'ip6_input.c',
+               'ip6_output.c',
+               'ip_icmp.c',
+               'ip_input.c',
+               'ip_output.c',
+               'mbuf.c',
+               'misc.c',
+               'ncsi.c',
+               'ndp_table.c',
+               'sbuf.c',
+               'slirp.c',
+               'socket.c',
+               'tcp_input.c',
+               'tcp_output.c',
+               'tcp_subr.c',
+               'tcp_timer.c',
+               'tftp.c',
+               'udp.c',
+               'udp6.c',
+               'util.c',
+               dependencies : [glib_dep, platform_deps])