forked from cifsd-team/ksmbd-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
140 lines (129 loc) · 2.84 KB
/
meson.build
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
project(
'ksmbsd-tools',
'c',
version: run_command(
'/bin/sh',
'-c',
'''
exec awk '/define KSMBD_TOOLS_VERSION / { gsub(/"/,"",$3); printf "%s", $3 }' include/version.h
''',
check: true,
).stdout(),
default_options: 'c_std=gnu99',
meson_version: '>= 0.51.0',
)
tools_incdir = include_directories([
'.',
'include',
])
glib_dep = dependency(
'glib-2.0',
version: '>= 2.40',
)
libnl_dep = dependency(
'libnl-genl-3.0',
version: '>= 3.0',
)
systemd_dep = dependency(
'systemd',
required: false,
version: '>= 245',
)
krb5_dep = dependency(
get_option('krb5_name'),
required: get_option('krb5'),
)
asn1_lib = []
cdata = configuration_data()
cc = meson.get_compiler('c')
if krb5_dep.found()
cdata.set(
'CONFIG_KRB5',
krb5_dep.found(),
)
cdata.set(
'HAVE_KRB5_AUTH_CON_GETRECVSUBKEY',
cc.has_function(
'krb5_auth_con_getrecvsubkey',
dependencies: krb5_dep,
),
)
cdata.set(
'HAVE_KRB5_KEYBLOCK_KEYVALUE',
cc.has_member(
'krb5_keyblock',
'keyvalue',
prefix: '#include <krb5.h>',
dependencies: krb5_dep,
),
)
cdata.set(
'HAVE_KRB5_AUTHENTICATOR_CLIENT',
cc.has_member(
'krb5_authenticator',
'client',
prefix: '#include <krb5.h>',
dependencies: krb5_dep,
),
)
cdata.set(
'HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER',
cc.compiles(
'''
#include <krb5.h>
krb5_error_code krb5_auth_con_getauthenticator(krb5_context, krb5_auth_context, krb5_authenticator**);
''',
dependencies: krb5_dep,
name: 'krb5_auth_con_getauthenticator has krb5_authenticator** parameter',
),
)
if not cdata.get('HAVE_KRB5_AUTHENTICATOR_CLIENT')
asn1_lib = cc.find_library(
'asn1',
dirs: krb5_dep.get_variable(pkgconfig: 'libdir'),
)
endif
endif
cfile = configure_file(
output: 'config.h',
configuration: cdata,
)
add_project_arguments(
'-DHAVE_CONFIG_H',
language: 'c',
)
rundir = get_option('rundir')
if rundir == ''
if false # meson.version().version_compare('>= ')
runstatedir = get_option('prefix') / get_option('runstatedir')
else
runstatedir = get_option('prefix') / get_option('localstatedir') / 'run'
endif
else
runstatedir = rundir
endif
subdir('lib')
subdir('addshare')
subdir('adduser')
subdir('control')
subdir('mountd')
install_data(
sources: 'smb.conf.example',
install_dir: get_option('sysconfdir') / 'ksmbd',
)
systemdsystemunitdir = get_option('systemdsystemunitdir')
if systemdsystemunitdir == ''
systemdsystemunitdir = systemd_dep.get_variable(
pkgconfig: 'systemdsystemunitdir',
default_value: '',
)
endif
configure_file(
input: 'ksmbd.service.in',
output: 'ksmbd.service',
install_dir: systemdsystemunitdir,
configuration: {
'sbindir': get_option('prefix') / get_option('sbindir'),
'runstatedir': runstatedir,
},
)