1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
From a8ed6b5a752bd7e50940c9e198af3edc3af0d5f7 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sat, 2 Jan 2021 21:05:53 -0800
Subject: [PATCH] add meson build
meson compiles faster and is simpler than autotools.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
addshare/meson.build | 10 ++++++++++
adduser/meson.build | 12 ++++++++++++
control/meson.build | 8 ++++++++
lib/meson.build | 18 ++++++++++++++++++
meson.build | 29 +++++++++++++++++++++++++++++
meson_options.txt | 3 +++
mountd/meson.build | 16 ++++++++++++++++
7 files changed, 96 insertions(+)
create mode 100644 addshare/meson.build
create mode 100644 adduser/meson.build
create mode 100644 control/meson.build
create mode 100644 lib/meson.build
create mode 100644 meson.build
create mode 100644 meson_options.txt
create mode 100644 mountd/meson.build
--- /dev/null
+++ b/addshare/meson.build
@@ -0,0 +1,10 @@
+addshare = executable(
+ 'ksmbd.addshare',
+ 'share_admin.c',
+ 'addshare.c',
+ 'share_admin.h',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/adduser/meson.build
@@ -0,0 +1,12 @@
+adduser = executable(
+ 'ksmbd.adduser',
+ 'md4_hash.c',
+ 'user_admin.c',
+ 'adduser.c',
+ 'md4_hash.h',
+ 'user_admin.h',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/control/meson.build
@@ -0,0 +1,8 @@
+control = executable(
+ 'ksmbd.control',
+ 'control.c',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,18 @@
+core_files = [
+ 'management/tree_conn.c',
+ 'management/user.c',
+ 'management/share.c',
+ 'management/session.c',
+ 'config_parser.c',
+ 'ksmbdtools.c',
+]
+
+if krb5_dep.found()
+ core_files += [
+ 'management/spnego.c',
+ 'asn1.c',
+ 'management/spnego_krb5.c',
+ ]
+endif
+
+libksmbdtools = static_library('ksmbdtools', core_files, include_directories: tools_incdir, dependencies: [glib_dep, krb5_dep])
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,29 @@
+project('ksmbsd-tools', 'c', version: '3.3.2', default_options: 'c_std=gnu99')
+
+tools_incdir = include_directories(['include', '.'])
+
+glib_dep = dependency('glib-2.0', static: true)
+netlink_dep = dependency('libnl-genl-3.0')
+krb5_dep = dependency('krb5', required: get_option('krb5'))
+
+cc = meson.get_compiler('c')
+
+cdata = configuration_data()
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
+if krb5_dep.found()
+ cdata.set('CONFIG_KRB5', krb5_dep.found())
+ cdata.set('HAVE_KRB5_KEYBLOCK_KEYVALUE', cc.has_member('krb5_keyblock', 'keyvalue', prefix: '#include <krb5.h>'))
+ cdata.set('HAVE_KRB5_AUTHENTICATOR_CLIENT', cc.has_member('krb5_authenticator', 'client', prefix: '#include <krb5.h>'))
+ cdata.set('HAVE_KRB5_AUTH_CON_GETRECVSUBKEY', cc.has_header_symbol('krb5.h', 'krb5_auth_con_getrecvsubkey'))
+ cdata.set('HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER', true)
+endif
+cfile = configure_file(
+ output: 'config.h',
+ configuration: cdata,
+)
+
+subdir('lib')
+subdir('addshare')
+subdir('adduser')
+subdir('control')
+subdir('mountd')
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,3 @@
+option('krb5', type : 'feature',
+ description : 'Build with Kerberos support',
+)
--- /dev/null
+++ b/mountd/meson.build
@@ -0,0 +1,16 @@
+mountd = executable(
+ 'ksmbd.mountd',
+ 'worker.c',
+ 'ipc.c',
+ 'rpc.c',
+ 'rpc_srvsvc.c',
+ 'rpc_wkssvc.c',
+ 'mountd.c',
+ 'smbacl.c',
+ 'rpc_samr.c',
+ 'rpc_lsarpc.c',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
|