forked from namjaejeon/ksmbd-tools
-
Notifications
You must be signed in to change notification settings - Fork 27
/
meson.build
162 lines (147 loc) · 3.37 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
project(
'ksmbd-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.61.5',
)
include_dirs = include_directories(
'.',
'include',
)
glib_dep = dependency(
'glib-2.0',
version: '>= 2.58',
)
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 = []
config_h_data = configuration_data()
cc = meson.get_compiler('c')
pthread_lib = cc.find_library(
'pthread',
)
if krb5_dep.found()
config_h_data.set(
'CONFIG_KRB5',
krb5_dep.found(),
)
config_h_data.set(
'HAVE_KRB5_AUTH_CON_GETRECVSUBKEY',
cc.has_function(
'krb5_auth_con_getrecvsubkey',
dependencies: krb5_dep,
),
)
config_h_data.set(
'HAVE_KRB5_KEYBLOCK_KEYVALUE',
cc.has_member(
'krb5_keyblock',
'keyvalue',
prefix: '#include <krb5.h>',
dependencies: krb5_dep,
),
)
config_h_data.set(
'HAVE_KRB5_AUTHENTICATOR_CLIENT',
cc.has_member(
'krb5_authenticator',
'client',
prefix: '#include <krb5.h>',
dependencies: krb5_dep,
),
)
config_h_data.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 config_h_data.get('HAVE_KRB5_AUTHENTICATOR_CLIENT')
asn1_lib = cc.find_library(
'asn1',
dirs: krb5_dep.get_variable(pkgconfig: 'libdir'),
)
endif
endif
configure_file(
output: 'config.h',
configuration: config_h_data,
)
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
install_data(
sources: 'ksmbd.conf.example',
install_dir: get_option('sysconfdir') / 'ksmbd',
)
systemdsystemunitdir = get_option('systemdsystemunitdir')
if systemdsystemunitdir == ''
systemdsystemunitdir = systemd_dep.get_variable(
pkgconfig: 'systemdsystemunitdir',
default_value: '',
)
endif
in_data = configuration_data({
'sbindir': get_option('prefix') / get_option('sbindir'),
'sysconfdir': get_option('prefix') / get_option('sysconfdir'),
'runstatedir': runstatedir,
'ksmbd_tools_version': meson.project_version(),
})
configure_file(
input: 'ksmbd.conf.5.in',
output: 'ksmbd.conf.5',
install_dir: get_option('mandir') / 'man5',
configuration: in_data,
)
configure_file(
input: 'ksmbdpwd.db.5.in',
output: 'ksmbdpwd.db.5',
install_dir: get_option('mandir') / 'man5',
configuration: in_data,
)
configure_file(
input: 'ksmbd.service.in',
output: 'ksmbd.service',
install_dir: systemdsystemunitdir,
configuration: in_data,
)
subdir('addshare')
subdir('adduser')
subdir('control')
subdir('mountd')
subdir('tools')