]>
Commit | Line | Data |
---|---|---|
d4c880d5 | 1 | project('util-linux', 'c', |
e0c1a86b | 2 | version : run_command('tools/git-version-gen', check: true).stdout(), |
e2cd7446 | 3 | meson_version: '>=0.57.0', |
d4c880d5 ZJS |
4 | license : 'GPLv2+') |
5 | ||
3e0bbb12 | 6 | fs = import('fs') |
d4c880d5 ZJS |
7 | pkgconfig = import('pkgconfig') |
8 | ||
9 | libblkid_version = '1.1.0' | |
50736e49 | 10 | libblkid_date = '01-Jun-2021' |
d4c880d5 ZJS |
11 | libuuid_version = '1.3.0' |
12 | libmount_version = '1.1.0' | |
13 | libsmartcols_version = '1.1.0' | |
14 | libfdisk_version = '1.1.0' | |
15 | ||
16 | prefixdir = get_option('prefix') | |
17 | if not prefixdir.startswith('/') | |
18 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) | |
19 | endif | |
20 | bindir = join_paths(prefixdir, get_option('bindir')) | |
21 | sbindir = join_paths(prefixdir, get_option('sbindir')) | |
22 | sysconfstaticdir = join_paths(prefixdir, 'lib') | |
12ebed03 | 23 | docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux') |
53b37016 | 24 | mandir = join_paths(prefixdir, get_option('mandir')) |
d4c880d5 | 25 | runstatedir = '/run' |
0eb2a476 | 26 | execprefixdir = prefixdir |
5e67b421 | 27 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) |
0eb2a476 KL |
28 | usrbin_exec_dir = join_paths(execprefixdir, bindir) |
29 | usrsbin_exec_dir = join_paths(execprefixdir, sbindir) | |
38bb89ee | 30 | bash_completion = dependency('bash-completion', required : get_option('build-bash-completion')) |
d4c880d5 | 31 | |
308a0979 KZ |
32 | vendordir = get_option('vendordir') |
33 | ||
d4c880d5 ZJS |
34 | add_project_arguments('-D_GNU_SOURCE', language : 'c') |
35 | ||
36 | cc = meson.get_compiler('c') | |
37 | ||
38 | conf = configuration_data() | |
3e43f629 RP |
39 | conf.set_quoted('PACKAGE', meson.project_name()) |
40 | conf.set_quoted('PACKAGE_VERSION', meson.project_version()) | |
d4c880d5 ZJS |
41 | package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version()) |
42 | conf.set_quoted('PACKAGE_STRING', package_string) | |
d4c880d5 | 43 | |
d4c880d5 | 44 | pc_version = [] |
922d025a | 45 | pc_version = meson.project_version().split('-')[0].split('.') |
46 | ||
47 | if pc_version.length() < 3 | |
48 | pc_version += '0' | |
49 | endif | |
50 | ||
d4c880d5 ZJS |
51 | pc_version = '.'.join(pc_version) |
52 | ||
53 | conf.set_quoted('LIBBLKID_VERSION', libblkid_version) | |
54 | conf.set_quoted('LIBBLKID_DATE', libblkid_date) | |
55 | ||
56 | conf.set('bindir', bindir) | |
57 | conf.set('sbindir', sbindir) | |
58 | conf.set('runstatedir', runstatedir) | |
5e67b421 | 59 | conf.set('sysconfdir', sysconfdir) |
d4c880d5 ZJS |
60 | conf.set('usrsbin_execdir', usrsbin_exec_dir) |
61 | conf.set('docdir', docdir) | |
62 | conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir) | |
63 | conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir) | |
64 | conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime') | |
65 | conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :( | |
66 | ||
308a0979 KZ |
67 | conf.set_quoted('_PATH_VENDORDIR', vendordir) |
68 | conf.set('USE_VENDORDIR', vendordir == '' ? false : 1) | |
69 | ||
d4c880d5 ZJS |
70 | build_libblkid = not get_option('build-libblkid').disabled() |
71 | conf.set('HAVE_LIBBLKID', build_libblkid ? 1 : false) | |
72 | summary('libblkid', build_libblkid ? 'enabled' : 'disabled', section : 'components') | |
73 | ||
74 | build_libuuid = not get_option('build-libuuid').disabled() | |
75 | conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false) | |
76 | summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components') | |
77 | ||
e23c3262 KZ |
78 | have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0 |
79 | conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false) | |
80 | conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false) | |
81 | ||
7d679f29 | 82 | have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0 |
8bcf89d3 TW |
83 | conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false) |
84 | ||
d4c880d5 ZJS |
85 | build_libmount = not get_option('build-libmount').disabled() |
86 | conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false) | |
375ccf08 | 87 | conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1) |
e23c3262 | 88 | conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false) |
d4c880d5 ZJS |
89 | summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components') |
90 | ||
91 | build_libsmartcols = not get_option('build-libsmartcols').disabled() | |
92 | conf.set('HAVE_LIBSMARTCOLS', build_libsmartcols ? 1 : false) | |
93 | summary('libsmartcols', build_libsmartcols ? 'enabled' : 'disabled', section : 'components') | |
94 | ||
95 | build_libfdisk = not get_option('build-libfdisk').disabled() | |
96 | conf.set('HAVE_LIBFDISK', build_libfdisk ? 1 : false) | |
97 | summary('libfdisk', build_libfdisk ? 'enabled' : 'disabled', section : 'components') | |
98 | ||
99 | build_uuidd = not get_option('build-uuidd').disabled() | |
100 | conf.set('HAVE_UUIDD', build_uuidd ? 1 : false) | |
101 | summary('uuidd', build_uuidd ? 'enabled' : 'disabled', section : 'components') | |
102 | ||
69939195 ZJS |
103 | static_programs = get_option('static-programs') |
104 | need_static_libs = static_programs.length() > 0 # a rough estimate... | |
105 | summary('static programs', static_programs) | |
106 | ||
d4c880d5 ZJS |
107 | LINUX = host_machine.system() in ['linux'] |
108 | BSD = host_machine.system() in ['dragonfly', 'freebsd', 'netbsd', 'openbsd'] | |
109 | ||
110 | ############################################################ | |
111 | ||
112 | code = ''' | |
113 | #include <wchar.h> | |
114 | #include <wctype.h> | |
115 | #include <stdio.h> | |
116 | #include <stdlib.h> | |
117 | int main(void) { | |
118 | wchar_t wc; | |
119 | wint_t w; | |
120 | w = fgetwc(stdin); | |
121 | if (w == WEOF) | |
122 | return 1; | |
123 | wc = w; | |
124 | fputwc(wc,stdout); | |
125 | return 0; | |
126 | } | |
127 | ''' | |
128 | have = cc.compiles(code, name : 'wchar_t support') | |
129 | if not have and get_option('widechar').enabled() | |
130 | error('widechar support requested but unavailable') | |
131 | endif | |
132 | if get_option('ncurses').enabled() and get_option('widechar').enabled() | |
133 | error('widechar support is incompatible with non-wide ncurses') | |
134 | endif | |
135 | conf.set('HAVE_WIDECHAR', have ? 1 : false) | |
136 | ||
137 | headers = ''' | |
138 | byteswap.h | |
139 | crypt.h | |
140 | endian.h | |
141 | err.h | |
142 | errno.h | |
143 | fcntl.h | |
144 | getopt.h | |
145 | inttypes.h | |
146 | langinfo.h | |
147 | lastlog.h | |
148 | libutil.h | |
149 | locale.h | |
150 | mntent.h | |
151 | paths.h | |
152 | pty.h | |
153 | shadow.h | |
154 | stdint.h | |
155 | stdio_ext.h | |
156 | stdlib.h | |
157 | string.h | |
158 | strings.h | |
159 | unistd.h | |
160 | utmp.h | |
161 | utmpx.h | |
908ac36f MY |
162 | asm-generic/fcntl.h |
163 | asm/fcntl.h | |
d4c880d5 ZJS |
164 | asm/io.h |
165 | linux/blkzoned.h | |
166 | linux/capability.h | |
167 | linux/cdrom.h | |
168 | linux/compiler.h | |
169 | linux/falloc.h | |
170 | linux/fd.h | |
0e186591 | 171 | linux/fs.h |
647f80e4 KZ |
172 | linux/fiemap.h |
173 | linux/gsmmux.h | |
0e186591 TW |
174 | linux/if_alg.h |
175 | linux/kcmp.h | |
d4c880d5 | 176 | linux/net_namespace.h |
647f80e4 | 177 | linux/nsfs.h |
241e4a48 | 178 | linux/mount.h |
0e186591 | 179 | linux/pr.h |
d4c880d5 ZJS |
180 | linux/securebits.h |
181 | linux/tiocl.h | |
182 | linux/version.h | |
183 | linux/watchdog.h | |
184 | net/if.h | |
185 | net/if_dl.h | |
186 | netinet/in.h | |
187 | security/openpam.h | |
188 | security/pam_appl.h | |
189 | security/pam_misc.h | |
190 | sys/disk.h | |
191 | sys/disklabel.h | |
192 | sys/endian.h | |
193 | sys/file.h | |
194 | sys/io.h | |
195 | sys/ioccom.h | |
196 | sys/ioctl.h | |
197 | sys/mkdev.h | |
198 | sys/mount.h | |
199 | sys/param.h | |
aa5adf24 | 200 | sys/pidfd.h |
d4c880d5 ZJS |
201 | sys/prctl.h |
202 | sys/resource.h | |
6e92db54 | 203 | sys/sendfile.h |
d4c880d5 ZJS |
204 | sys/signalfd.h |
205 | sys/socket.h | |
206 | sys/sockio.h | |
207 | sys/stat.h | |
0e186591 | 208 | sys/statfs.h |
d4c880d5 ZJS |
209 | sys/swap.h |
210 | sys/syscall.h | |
211 | sys/sysmacros.h | |
212 | sys/time.h | |
213 | sys/timex.h | |
214 | sys/ttydefaults.h | |
215 | sys/types.h | |
216 | sys/ucred.h | |
217 | sys/un.h | |
0e186591 | 218 | sys/vfs.h |
647f80e4 | 219 | sys/xattr.h |
d4c880d5 ZJS |
220 | '''.split() |
221 | ||
222 | lib_m = cc.find_library('m') | |
223 | ||
224 | lib_tinfo = dependency( | |
225 | 'tinfo', | |
226 | required : get_option('tinfo')) | |
227 | ||
228 | lib_ncursesw = dependency( | |
229 | 'ncursesw', | |
230 | required : get_option('ncursesw')) | |
231 | if lib_ncursesw.found() | |
232 | headers += ['ncursesw/ncurses.h', | |
233 | 'ncursesw/term.h', | |
234 | 'ncurses.h', | |
235 | 'term.h'] | |
236 | lib_ncurses = disabler() | |
237 | else | |
238 | lib_ncurses = dependency( | |
239 | 'ncurses', | |
240 | required : get_option('ncurses')) | |
241 | headers += ['ncurses.h', | |
242 | 'term.h'] | |
243 | endif | |
244 | ||
245 | conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found()) | |
246 | conf.set('HAVE_LIBNCURSES', lib_ncurses.found()) | |
247 | conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found()) | |
248 | ||
249 | lib_slang = dependency( | |
250 | 'slang', | |
251 | required : get_option('slang')) | |
252 | if lib_slang.found() | |
253 | headers += ['slang.h', | |
254 | 'slang/slang.h', | |
255 | 'slcurses.h', | |
256 | 'slang/slcurses.h'] | |
257 | endif | |
258 | conf.set('HAVE_SLANG', lib_slang.found()) | |
259 | ||
260 | foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses] | |
261 | if curses_libs.found() | |
6e13cfed KZ |
262 | have = cc.has_function('use_default_colors', dependencies : curses_libs) |
263 | conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false) | |
264 | have = cc.has_function('resizeterm', dependencies : curses_libs) | |
265 | conf.set('HAVE_RESIZETERM', have ? 1 : false) | |
d4c880d5 ZJS |
266 | break |
267 | endif | |
268 | endforeach | |
269 | ||
270 | lib_z = dependency( | |
271 | 'zlib', | |
272 | required : get_option('zlib')) | |
273 | ||
274 | lib_readline = dependency( | |
275 | 'readline', | |
276 | required : get_option('readline')) | |
277 | conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false) | |
278 | ||
69939195 ZJS |
279 | lib_readline_static = dependency( |
280 | 'readline', | |
281 | static : true, | |
282 | required : need_static_libs ? get_option('readline') : disabler()) | |
283 | ||
fc63a3d0 RP |
284 | if meson.version().version_compare('>= 0.59.0') |
285 | lib_intl = dependency( | |
286 | 'intl', | |
287 | required : get_option('nls')) | |
288 | conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false) | |
289 | else | |
290 | if get_option('nls').enabled() | |
291 | error('nls is not supported with meson before 0.59.0') | |
292 | endif | |
293 | lib_intl = dependency('', required : false) | |
294 | endif | |
295 | ||
d4c880d5 ZJS |
296 | lib_user = dependency( |
297 | 'libuser', | |
298 | version : '>= 0.58', | |
299 | required : get_option('libuser')) | |
300 | conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false) | |
301 | ||
302 | lib_util = cc.find_library( | |
303 | 'util', | |
304 | required : get_option('libutil')) | |
305 | conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false) | |
306 | ||
307 | lib_utempter = cc.find_library( | |
308 | 'utempter', | |
309 | required : get_option('libutempter')) | |
310 | conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false) | |
311 | ||
312 | systemd = dependency( | |
313 | 'systemd', | |
314 | required : get_option('systemd')) | |
315 | ||
316 | lib_systemd = dependency( | |
317 | 'libsystemd', | |
318 | required : get_option('systemd')) | |
319 | conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false) | |
0e186591 | 320 | conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false) |
d4c880d5 | 321 | |
87fcd95a TK |
322 | have = cc.has_function( |
323 | 'sd_session_get_username', | |
324 | dependencies : lib_systemd) | |
325 | conf.set('HAVE_DECL_SD_SESSION_GET_USERNAME', have ? 1 : false) | |
326 | ||
d4c880d5 ZJS |
327 | lib_udev = dependency( |
328 | 'libudev', | |
329 | required : get_option('systemd')) | |
330 | conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false) | |
331 | ||
332 | lib_crypt = cc.find_library('crypt') | |
333 | ||
e279e9b2 RP |
334 | lib_pam = cc.find_library('pam', required : get_option('build-login')) |
335 | if not lib_pam.found() | |
336 | lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh')) | |
337 | endif | |
338 | if not lib_pam.found() | |
339 | lib_pam = cc.find_library('pam', required : get_option('build-su')) | |
340 | endif | |
341 | if not lib_pam.found() | |
342 | lib_pam = cc.find_library('pam', required : get_option('build-runuser')) | |
343 | endif | |
d4c880d5 ZJS |
344 | if lib_pam.found() |
345 | lib_pam_misc = cc.find_library('pam_misc') | |
346 | lib_pam = [lib_pam, lib_pam_misc] | |
7bce9496 RP |
347 | else |
348 | lib_pam_misc = declare_dependency() | |
d4c880d5 ZJS |
349 | endif |
350 | ||
351 | lib_cryptsetup = dependency( | |
352 | 'libcryptsetup', | |
353 | required : get_option('cryptsetup')) | |
354 | conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false) | |
355 | ||
e6a4b4a1 | 356 | if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled() |
324aa32c RP |
357 | if meson.version().version_compare('>= 0.62.0') |
358 | lib_dl = dependency('dl') | |
359 | else | |
360 | lib_dl = cc.find_library('dl') | |
361 | endif | |
e6a4b4a1 LB |
362 | conf.set('CRYPTSETUP_VIA_DLOPEN', 1) |
363 | summary('cryptsetup support (dlopen)', | |
364 | 'enabled', | |
365 | section : 'components') | |
366 | else | |
367 | summary('cryptsetup support', | |
368 | lib_cryptsetup.found() ? 'enabled' : 'disabled', | |
369 | section : 'components') | |
370 | endif | |
6e92db54 | 371 | |
d4c880d5 ZJS |
372 | have = cc.has_function( |
373 | 'crypt_activate_by_signed_key', | |
374 | dependencies : lib_cryptsetup) | |
5a6e9adf | 375 | conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false) |
d4c880d5 ZJS |
376 | |
377 | lib_cap_ng = dependency( | |
cd23a433 RP |
378 | 'libcap-ng', |
379 | required : get_option('build-setpriv')) | |
d4c880d5 ZJS |
380 | |
381 | lib_selinux = dependency( | |
382 | 'libselinux', | |
6e92db54 | 383 | version : '>= 2.5', |
d4c880d5 ZJS |
384 | required : get_option('selinux')) |
385 | conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false) | |
386 | ||
6e92db54 KZ |
387 | lib_magic = dependency( |
388 | 'libmagic', | |
389 | required : get_option('magic')) | |
390 | conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false) | |
391 | ||
392 | lib_econf = dependency( | |
393 | 'libeconf', | |
394 | required : get_option('econf')) | |
395 | conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false) | |
396 | ||
d4c880d5 | 397 | lib_audit = dependency( |
b2ae39f6 | 398 | 'audit', |
d4c880d5 ZJS |
399 | required : get_option('audit')) |
400 | conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false) | |
401 | ||
402 | conf.set('HAVE_SMACK', not get_option('smack').disabled()) | |
403 | ||
404 | foreach header : headers | |
405 | have = cc.has_header(header) | |
406 | conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false) | |
407 | endforeach | |
408 | ||
409 | header = 'linux/btrfs.h' | |
410 | enable_btrfs = cc.has_header(header, | |
411 | required : get_option('btrfs')) | |
412 | conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false) | |
413 | conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false) | |
414 | ||
415 | prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : '' | |
416 | foreach header : [ | |
417 | 'linux/blkpg.h', | |
418 | 'linux/major.h', | |
419 | ] | |
420 | have = cc.has_header(header, | |
421 | prefix : prefix) | |
422 | conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false) | |
423 | endforeach | |
424 | ||
425 | have = cc.has_header('sched.h') | |
426 | conf.set10('HAVE_DECL_CPU_ALLOC', have) | |
427 | # We get -1 if the size cannot be determined | |
4194bb5b | 428 | have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0 |
d4c880d5 ZJS |
429 | conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false) |
430 | ||
5afe34ef | 431 | have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE') |
d4c880d5 ZJS |
432 | conf.set10('HAVE_ENVIRON_DECL', have) |
433 | ||
5afe34ef | 434 | have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE') |
d4c880d5 ZJS |
435 | conf.set('HAVE_SIGHANDLER_T', have ? 1 : false) |
436 | ||
f3b9a18e | 437 | have = cc.has_function('strsignal') |
d4c880d5 ZJS |
438 | conf.set10('HAVE_STRSIGNAL_DECL', have) |
439 | ||
440 | have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0 | |
441 | conf.set('HAVE_UNION_SEMUN', have ? 1 : false) | |
442 | ||
0e186591 TW |
443 | have = cc.has_type('loff_t', prefix : '#include <sys/types.h>') |
444 | conf.set('HAVE_LOFF_T', have ? 1 : false) | |
445 | ||
d4c880d5 ZJS |
446 | have = cc.compiles(''' |
447 | #define _GNU_SOURCE 1 | |
448 | #include <langinfo.h> | |
449 | int main(void) { | |
450 | char *str; | |
451 | str = nl_langinfo (ALTMON_1); | |
452 | str = nl_langinfo (ALTMON_2); | |
453 | str = nl_langinfo (ALTMON_3); | |
454 | str = nl_langinfo (ALTMON_4); | |
455 | str = nl_langinfo (ALTMON_5); | |
456 | str = nl_langinfo (ALTMON_6); | |
457 | str = nl_langinfo (ALTMON_7); | |
458 | str = nl_langinfo (ALTMON_8); | |
459 | str = nl_langinfo (ALTMON_9); | |
460 | str = nl_langinfo (ALTMON_10); | |
461 | str = nl_langinfo (ALTMON_11); | |
462 | str = nl_langinfo (ALTMON_12); | |
463 | return 0; | |
464 | } | |
465 | ''', | |
466 | name : 'langinfo.h defines ALTMON_x constants') | |
467 | conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false) | |
468 | ||
469 | have = cc.compiles(''' | |
470 | #define _GNU_SOURCE 1 | |
471 | #include <langinfo.h> | |
472 | int main(void) { | |
473 | char *str; | |
474 | str = nl_langinfo (_NL_ABALTMON_1); | |
475 | str = nl_langinfo (_NL_ABALTMON_2); | |
476 | str = nl_langinfo (_NL_ABALTMON_3); | |
477 | str = nl_langinfo (_NL_ABALTMON_4); | |
478 | str = nl_langinfo (_NL_ABALTMON_5); | |
479 | str = nl_langinfo (_NL_ABALTMON_6); | |
480 | str = nl_langinfo (_NL_ABALTMON_7); | |
481 | str = nl_langinfo (_NL_ABALTMON_8); | |
482 | str = nl_langinfo (_NL_ABALTMON_9); | |
483 | str = nl_langinfo (_NL_ABALTMON_10); | |
484 | str = nl_langinfo (_NL_ABALTMON_11); | |
485 | str = nl_langinfo (_NL_ABALTMON_12); | |
486 | return 0; | |
487 | } | |
488 | ''', | |
489 | name : 'langinfo.h defines _NL_ABALTMON_x constants') | |
490 | conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false) | |
491 | ||
17bc58e0 CH |
492 | have = cc.compiles(''' |
493 | #define _GNU_SOURCE 1 | |
494 | #include <langinfo.h> | |
495 | int main(void) { | |
496 | char *str; | |
497 | str = nl_langinfo (_NL_TIME_WEEK_1STDAY); | |
498 | return 0; | |
499 | } | |
500 | ''', | |
501 | name : 'langinfo.h defines _NL_TIME_WEEK_1STDAY constant') | |
502 | conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false) | |
503 | ||
d4c880d5 | 504 | funcs = ''' |
c214cbeb | 505 | cachestat |
d4c880d5 | 506 | clearenv |
5bd1462d | 507 | close_range |
d4c880d5 ZJS |
508 | __fpurge |
509 | fpurge | |
510 | __fpending | |
511 | secure_getenv | |
512 | __secure_getenv | |
513 | eaccess | |
514 | err | |
515 | errx | |
516 | explicit_bzero | |
d9b022bd | 517 | fnmatch |
d4c880d5 | 518 | fseeko |
0120be6f KZ |
519 | fsconfig |
520 | fsmount | |
521 | fsopen | |
522 | fspick | |
d4c880d5 | 523 | fsync |
0e186591 | 524 | getttynam |
d4c880d5 ZJS |
525 | utimensat |
526 | getdomainname | |
527 | getdtablesize | |
528 | getexecname | |
529 | getmntinfo | |
530 | getrandom | |
531 | getrlimit | |
532 | getsgnam | |
533 | inotify_init | |
534 | jrand48 | |
535 | lchown | |
6124a6a3 TW |
536 | lgetxattr |
537 | llistxattr | |
d4c880d5 | 538 | llseek |
5bd1462d | 539 | newlocale |
d4c880d5 ZJS |
540 | mempcpy |
541 | mkostemp | |
10efb9ea KZ |
542 | move_mount |
543 | mount_setattr | |
d4c880d5 ZJS |
544 | nanosleep |
545 | ntp_gettime | |
10efb9ea | 546 | open_tree |
d4c880d5 ZJS |
547 | personality |
548 | pidfd_open | |
549 | pidfd_send_signal | |
550 | posix_fadvise | |
551 | prctl | |
552 | qsort_r | |
553 | rpmatch | |
554 | scandirat | |
555 | setprogname | |
5bd1462d | 556 | sendfile |
d4c880d5 ZJS |
557 | setns |
558 | setresgid | |
559 | setresuid | |
560 | sched_setattr | |
561 | sched_setscheduler | |
562 | sigqueue | |
563 | srandom | |
30c59d67 | 564 | statx |
d4c880d5 ZJS |
565 | strnchr |
566 | strndup | |
567 | strnlen | |
5bd1462d | 568 | strtod_l |
d4c880d5 ZJS |
569 | sysconf |
570 | sysinfo | |
571 | swapon | |
572 | swapoff | |
573 | timegm | |
574 | unshare | |
575 | usleep | |
5bd1462d TW |
576 | uselocale |
577 | utimensat | |
d4c880d5 ZJS |
578 | vwarnx |
579 | warn | |
580 | warnx | |
581 | prlimit | |
582 | ||
583 | openat | |
584 | fstatat | |
585 | unlinkat | |
586 | ioperm | |
587 | iopl | |
588 | futimens | |
589 | inotify_init1 | |
590 | open_memstream | |
591 | reboot | |
592 | getusershell | |
593 | '''.split() | |
594 | ||
595 | foreach func: funcs | |
596 | have = cc.has_function(func) | |
993556aa | 597 | # For autotools compatibility, use either #define FOO 1 or #undef FOO. |
d4c880d5 ZJS |
598 | # This makes little sense, but is necessary to avoid warnings about |
599 | # redefined macros from Python.h, which uses this convention. | |
600 | conf.set('HAVE_' + func.to_upper(), have ? 1 : false) | |
d4c880d5 ZJS |
601 | endforeach |
602 | ||
603 | have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1] | |
604 | conf.set('AGETTY_RELOAD', have ? 1 : false) | |
605 | if not have | |
606 | warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality') | |
607 | endif | |
608 | ||
609 | have_dirfd = (cc.has_function('dirfd') or | |
610 | cc.has_header_symbol('dirent.h', 'dirfd', | |
611 | prefix : '#include <sys/types.h>')) | |
612 | conf.set('HAVE_DIRFD', have_dirfd ? 1 : false) | |
613 | ||
614 | have_ddfd = cc.has_member('DIR', 'dd_fd', | |
615 | prefix : ''' | |
616 | #include <sys/types.h> | |
617 | #include <dirent.h> | |
618 | ''') | |
619 | conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false) | |
620 | ||
621 | have = cc.has_member('struct tm', 'tm_gmtoff', | |
622 | prefix : ''' | |
623 | #include <time.h> | |
624 | #include <unistd.h> | |
625 | ''') | |
626 | conf.set('HAVE_TM_GMTOFF', have ? 1 : false) | |
627 | ||
10efb9ea | 628 | |
10efb9ea | 629 | |
0120be6f | 630 | have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0 |
e23c3262 | 631 | conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false) |
0120be6f | 632 | |
d4c880d5 ZJS |
633 | have = cc.has_member('struct termios', 'c_line', |
634 | prefix : '#include <termios.h>') | |
635 | conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false) | |
636 | ||
637 | have = cc.has_member('struct stat', 'st_mtim.tv_nsec', | |
638 | prefix : '#include <sys/stat.h>') | |
639 | conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false) | |
640 | ||
2f82c248 | 641 | have = cc.has_member('struct statx', 'stx_mnt_id', |
7d679f29 | 642 | prefix : '#include <sys/stat.h>') |
2f82c248 KZ |
643 | conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false) |
644 | ||
d4c880d5 ZJS |
645 | # replacement for AC_STRUCT_TIMEZONE |
646 | have = cc.has_member('struct tm', 'tm_zone', | |
647 | prefix : '#include <time.h>') | |
648 | conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false) | |
649 | ||
5afe34ef | 650 | have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE') |
d4c880d5 ZJS |
651 | conf.set('HAVE_DECL_TZNAME', have ? 1 : false) |
652 | ||
0e186591 TW |
653 | have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY') |
654 | conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false) | |
655 | ||
656 | have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY') | |
657 | conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false) | |
658 | ||
d4c880d5 ZJS |
659 | code = ''' |
660 | #include <time.h> | |
661 | #if !@0@ | |
662 | extern char *tzname[]; | |
663 | #endif | |
664 | int main(void) { | |
665 | return tzname ? 0 : 1; | |
666 | } | |
667 | '''.format(have ? 1 : 0) | |
e25db916 | 668 | have = cc.compiles(code, name : 'using tzname[]') |
d4c880d5 ZJS |
669 | conf.set('HAVE_TZNAME', have ? 1 : false) |
670 | ||
671 | socket_libs = [] | |
672 | if not cc.has_function('socket') | |
673 | socket_libs += cc.find_library('socket', required : true) | |
674 | have = cc.has_function('socket', | |
675 | dependencies : socket_libs) | |
676 | if not have | |
677 | error('socket() function not available') | |
678 | endif | |
679 | endif | |
680 | ||
681 | realtime_libs = [] | |
682 | have = cc.has_function('clock_gettime') | |
683 | if not have | |
684 | realtime_libs += cc.find_library('rt', required : true) | |
685 | have = cc.has_function('clock_gettime', | |
686 | dependencies : realtime_libs) | |
687 | endif | |
e51565b6 | 688 | conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false) |
d4c880d5 ZJS |
689 | |
690 | thread_libs = dependency('threads') | |
691 | ||
692 | have = cc.has_function('timer_create') | |
693 | if not have | |
c41e47c1 | 694 | realtime_libs = [cc.find_library('rt', required : true)] |
d4c880d5 ZJS |
695 | have = cc.has_function('timer_create', |
696 | dependencies : realtime_libs) | |
697 | if not have | |
698 | realtime_libs += thread_libs | |
699 | have = cc.has_function('timer_create', | |
700 | dependencies : realtime_libs) | |
701 | endif | |
702 | endif | |
703 | conf.set('HAVE_TIMER_CREATE', have ? 1 : false) | |
704 | if not have | |
705 | have = cc.has_function('setitimer') | |
706 | conf.set('HAVE_SETITIMER', have ? 1 : false) | |
707 | endif | |
708 | ||
709 | rtas_libs = cc.find_library('rtas', required : false) | |
710 | conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false) | |
711 | ||
712 | math_libs = [] | |
77765258 | 713 | if not cc.has_header_symbol('math.h', 'isnan') |
d4c880d5 ZJS |
714 | lib = cc.find_library('m', required : true) |
715 | if (cc.has_function('isnan', dependencies : lib) and | |
716 | cc.has_function('__isnan', dependencies : lib)) | |
717 | math_libs += lib | |
718 | endif | |
719 | endif | |
720 | ||
721 | have = cc.has_header_symbol('errno.h', 'program_invocation_short_name', | |
722 | args : '-D_GNU_SOURCE') | |
723 | conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false) | |
724 | ||
725 | code = ''' | |
726 | extern char *__progname; | |
727 | int main(void) { | |
728 | return (*__progname != 0); | |
729 | } | |
730 | ''' | |
e25db916 | 731 | have = cc.compiles(code, name : 'using __progname') |
d4c880d5 ZJS |
732 | conf.set('HAVE___PROGNAME', have ? 1 : false) |
733 | ||
44475360 ZJS |
734 | have = conf.get('HAVE_PTY_H') != false and conf.get('HAVE_SYS_SIGNALFD_H') != false |
735 | conf.set('HAVE_PTY', have ? 1 : false) | |
736 | ||
a0cf9105 LB |
737 | have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS') |
738 | conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false) | |
739 | ||
d4c880d5 ZJS |
740 | build_plymouth_support = get_option('build-plymouth-support') |
741 | have_tiocglcktrmios = cc.has_header_symbol( | |
742 | 'sys/ioctl.h', 'TIOCGLCKTRMIOS', | |
743 | required : build_plymouth_support.enabled()) | |
744 | have_sock_cloexec = cc.has_header_symbol( | |
745 | 'sys/socket.h', 'SOCK_CLOEXEC', | |
746 | prefix : '#include <sys/types.h>', | |
747 | required : build_plymouth_support.enabled()) | |
748 | have_sock_nonblock = cc.has_header_symbol( | |
749 | 'sys/socket.h', 'SOCK_NONBLOCK', | |
750 | prefix : '#include <sys/types.h>', | |
751 | required : build_plymouth_support.enabled()) | |
752 | have_so_passcred = cc.has_header_symbol( | |
753 | 'sys/socket.h', 'SO_PASSCRED', | |
754 | prefix : '#include <sys/types.h>', | |
755 | required : build_plymouth_support.enabled()) | |
756 | ||
757 | build_plymouth_support = (not build_plymouth_support.disabled() and | |
758 | have_tiocglcktrmios and | |
759 | have_sock_cloexec and | |
760 | have_sock_nonblock and | |
761 | have_so_passcred) | |
762 | conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false) | |
763 | summary('plymouth support', | |
764 | build_plymouth_support ? 'enabled' : 'disabled', | |
765 | section : 'components') | |
766 | ||
767 | # check for valid fallocate() function | |
768 | # with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
769 | # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
770 | # and program can't be linked. | |
771 | code = ''' | |
772 | #define _GNU_SOURCE | |
773 | #include <unistd.h> | |
774 | #include <fcntl.h> | |
775 | ||
776 | int main(void) { | |
777 | long ret; | |
778 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); | |
779 | return ret == 0 ? 0 : 1; | |
780 | } | |
781 | ''' | |
782 | have = cc.links(code, name : 'fallocate() function') | |
783 | conf.set('HAVE_FALLOCATE', have ? 1 : false) | |
784 | ||
785 | code = ''' | |
786 | #include <unistd.h> | |
787 | #include <fcntl.h> | |
788 | ||
789 | int main(void) { | |
790 | long ret; | |
791 | ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); | |
792 | return ret == 0 ? 0 : 1; | |
793 | } | |
794 | ''' | |
795 | have = cc.links(code, name : 'posix_fallocate() function') | |
796 | conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false) | |
797 | ||
798 | use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64'] | |
799 | message('Use CMOS clock: @0@'.format(use_hwclock_cmos)) | |
800 | conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false) | |
801 | ||
802 | conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false) | |
803 | conf.set('PG_BELL', get_option('pg-bell') ? 1 : false) | |
e0806c40 | 804 | conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false) |
d4c880d5 ZJS |
805 | |
806 | ############################################################ | |
807 | ||
6e92db54 | 808 | |
d4c880d5 ZJS |
809 | fs_search_path = get_option('fs-search-path') |
810 | fs_search_path_extra = get_option('fs-search-path-extra') | |
811 | if fs_search_path_extra != '' | |
812 | fs_search_path = ':'.join(fs_search_path, fs_search_path_extra) | |
813 | endif | |
814 | conf.set_quoted('FS_SEARCH_PATH', fs_search_path) | |
815 | ||
38b15ca2 | 816 | systemdsystemunitdir = '' |
fcbcb0cd | 817 | if systemd.found() |
e2b4f5be | 818 | systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir') |
fcbcb0cd | 819 | endif |
6e92db54 | 820 | |
5e67b421 CH |
821 | sysvinit = get_option('sysvinit').enabled() |
822 | sysvinitrcdir = sysconfdir + '/init.d' | |
823 | ||
ba30b89c | 824 | program_tests = get_option('program-tests') |
825 | ||
d4c880d5 ZJS |
826 | chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found() |
827 | conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false) | |
828 | ||
829 | have = get_option('chsh-only-listed') | |
830 | conf.set('ONLY_LISTED_SHELLS', have ? 1 : false) | |
831 | ||
832 | have = get_option('use-tty-group') | |
833 | conf.set('USE_TTY_GROUP', have ? 1 : false) | |
834 | ||
835 | build_hwclock = not get_option('build-hwclock').disabled() | |
836 | bison = find_program('bison', required: build_hwclock) | |
837 | bison_gen = generator( | |
838 | bison, | |
839 | output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], | |
840 | arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) | |
841 | ||
53b37016 KZ |
842 | |
843 | ||
d4c880d5 | 844 | meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh' |
38bb89ee | 845 | meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh' |
d4c880d5 | 846 | |
7da59534 | 847 | configure_file( |
d4c880d5 ZJS |
848 | output : 'config.h', |
849 | configuration : conf) | |
850 | ||
5f2c862a | 851 | add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c') |
d4c880d5 | 852 | |
24b8804b TW |
853 | compiler_flags = [ |
854 | '-fno-common', | |
855 | ||
856 | '-Waddress-of-packed-member', | |
857 | '-Wdiscarded-qualifiers', | |
858 | '-Wembedded-directive', | |
859 | '-Wextra-semi', | |
860 | '-Wformat-security', | |
861 | '-Wimplicit-function-declaration', | |
862 | '-Wmissing-declarations', | |
863 | '-Wmissing-parameter-type', | |
864 | '-Wmissing-prototypes', | |
865 | '-Wnested-externs', | |
866 | '-Wno-missing-field-initializers', | |
9df5ac34 | 867 | '-Wold-style-definition', |
24b8804b TW |
868 | '-Wpointer-arith', |
869 | '-Wredundant-decls', | |
870 | '-Wsign-compare', | |
871 | '-Wstrict-prototypes', | |
872 | '-Wtype-limits', | |
873 | '-Wuninitialized', | |
874 | '-Wunused-but-set-parameter', | |
875 | '-Wunused-but-set-variable', | |
876 | '-Wunused-parameter', | |
877 | '-Wunused-result', | |
878 | '-Wunused-variable', | |
879 | ] | |
880 | foreach compiler_flag : compiler_flags | |
881 | if cc.has_argument(compiler_flag) | |
882 | add_project_arguments(compiler_flag, language : 'c') | |
883 | endif | |
884 | endforeach | |
885 | ||
53b37016 | 886 | manadocs = [] |
38bb89ee | 887 | manlinks = {} |
aa519054 | 888 | |
38bb89ee | 889 | bashcompletions = [] |
aa519054 | 890 | bashcompletionslinks = {} |
53b37016 | 891 | |
d4c880d5 ZJS |
892 | subdir('include') |
893 | subdir('lib') | |
894 | subdir('libblkid') | |
895 | subdir('libmount') | |
896 | subdir('libsmartcols') | |
897 | subdir('libuuid') | |
898 | subdir('libfdisk') | |
899 | subdir('login-utils') | |
900 | subdir('sys-utils') | |
901 | subdir('disk-utils') | |
902 | subdir('misc-utils') | |
903 | subdir('text-utils') | |
904 | subdir('term-utils') | |
905 | subdir('po') | |
906 | ||
907 | includes = [dir_include, | |
908 | dir_libblkid, | |
909 | dir_libsmartcols, | |
910 | dir_libmount, | |
911 | dir_libfdisk, | |
912 | dir_libuuid, | |
913 | dir_sys_utils] | |
914 | ||
915 | exes = [] | |
916 | ||
917 | opt = not get_option('build-chfn-chsh').disabled() | |
918 | exe = executable( | |
919 | 'chfn', | |
920 | chfn_sources, | |
921 | chfn_chsh_sources, | |
922 | include_directories : includes, | |
0333c40b | 923 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
924 | dependencies : chfn_chsh_deps, |
925 | install_dir : usrbin_exec_dir, | |
60d457f5 | 926 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
927 | install : opt, |
928 | build_by_default : opt) | |
38bb89ee | 929 | |
d4c880d5 ZJS |
930 | exe2 = executable( |
931 | 'chsh', | |
932 | 'login-utils/chsh.c', | |
4b724469 | 933 | 'lib/shells.c', |
d4c880d5 ZJS |
934 | chfn_chsh_sources, |
935 | include_directories : includes, | |
936 | link_with : lib_common, | |
937 | dependencies : chfn_chsh_deps, | |
938 | install_dir : usrbin_exec_dir, | |
a13574b1 | 939 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
940 | install : opt, |
941 | build_by_default : opt) | |
942 | if opt and not is_disabler(exe) | |
943 | exes += [exe, exe2] | |
38bb89ee TW |
944 | manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc'] |
945 | bashcompletions += ['chfn', 'chsh'] | |
d4c880d5 ZJS |
946 | endif |
947 | ||
948 | exe = executable( | |
949 | 'test_islocal', | |
950 | test_islocal_sources, | |
951 | include_directories : includes, | |
ba30b89c | 952 | c_args : '-DTEST_PROGRAM', |
953 | build_by_default : program_tests) | |
d4c880d5 ZJS |
954 | exes += exe |
955 | ||
d4c880d5 ZJS |
956 | exe = executable( |
957 | 'test-consoles', | |
958 | test_consoles_sources, | |
959 | c_args : ['-DTEST_PROGRAM'], | |
960 | include_directories : includes, | |
ba30b89c | 961 | link_with : lib_common, |
962 | build_by_default : program_tests) | |
d4c880d5 ZJS |
963 | exes += exe |
964 | ||
965 | opt = not get_option('build-last').disabled() | |
966 | exe = executable( | |
967 | 'last', | |
968 | last_sources, | |
969 | include_directories : includes, | |
970 | link_with : [lib_common], | |
971 | install_dir : usrbin_exec_dir, | |
972 | install : opt, | |
973 | build_by_default : opt) | |
974 | if opt and not is_disabler(exe) | |
975 | exes += exe | |
976 | meson.add_install_script(meson_make_symlink, | |
977 | 'last', | |
978 | join_paths(usrbin_exec_dir, 'lastb')) | |
38bb89ee TW |
979 | manadocs += ['login-utils/last.1.adoc'] |
980 | manlinks += {'lastb.1': 'last.1'} | |
981 | bashcompletions += ['last'] | |
aa519054 | 982 | bashcompletionslinks += {'lastb': 'last'} |
d4c880d5 ZJS |
983 | endif |
984 | ||
985 | opt = not get_option('build-nologin').disabled() | |
986 | exe = executable( | |
987 | 'nologin', | |
988 | 'login-utils/nologin.c', | |
989 | include_directories : includes, | |
990 | install_dir : sbindir, | |
308a0979 | 991 | link_with : [lib_common], |
d4c880d5 ZJS |
992 | install : opt, |
993 | build_by_default : opt) | |
994 | if opt and not is_disabler(exe) | |
995 | exes += exe | |
38bb89ee | 996 | manadocs += ['login-utils/nologin.8.adoc'] |
d4c880d5 ZJS |
997 | endif |
998 | ||
999 | opt = not get_option('build-utmpdump').disabled() | |
1000 | exe = executable( | |
1001 | 'utmpdump', | |
1002 | 'login-utils/utmpdump.c', | |
1003 | include_directories : includes, | |
1004 | link_with : [lib_common], | |
1005 | install_dir : usrbin_exec_dir, | |
1006 | install : opt, | |
1007 | build_by_default : opt) | |
1008 | if opt and not is_disabler(exe) | |
1009 | exes += exe | |
38bb89ee TW |
1010 | manadocs += ['login-utils/utmpdump.1.adoc'] |
1011 | bashcompletions += ['utmpdump'] | |
d4c880d5 ZJS |
1012 | endif |
1013 | ||
1014 | opt = not get_option('build-su').disabled() | |
1015 | exe = executable( | |
1016 | 'su', | |
1017 | 'login-utils/su.c', | |
1018 | 'login-utils/su-common.c', | |
1019 | 'login-utils/su-common.h', | |
4b724469 | 1020 | 'lib/shells.c', |
d4c880d5 ZJS |
1021 | pty_session_c, |
1022 | monotonic_c, | |
1023 | include_directories : includes, | |
0333c40b | 1024 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
1025 | dependencies : [lib_pam, |
1026 | lib_pam_misc, | |
1027 | lib_util, | |
1028 | realtime_libs], | |
fb8c224e | 1029 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1030 | install : opt, |
1031 | build_by_default : opt) | |
1032 | if opt and not is_disabler(exe) | |
1033 | exes += exe | |
38bb89ee TW |
1034 | manadocs += ['login-utils/su.1.adoc'] |
1035 | bashcompletions += ['su'] | |
d4c880d5 ZJS |
1036 | endif |
1037 | ||
1038 | opt = not get_option('build-newgrp').disabled() | |
1039 | exe = executable( | |
1040 | 'newgrp', | |
1041 | 'login-utils/newgrp.c', | |
1042 | include_directories : includes, | |
1043 | dependencies : [lib_crypt], | |
1044 | install_dir : usrbin_exec_dir, | |
cb3dee5a | 1045 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1046 | install : opt, |
1047 | build_by_default : opt) | |
1048 | if opt and not is_disabler(exe) | |
1049 | exes += exe | |
38bb89ee | 1050 | manadocs += ['login-utils/newgrp.1.adoc'] |
f265b432 | 1051 | bashcompletions += ['newgrp'] |
d4c880d5 ZJS |
1052 | endif |
1053 | ||
1054 | opt = not get_option('build-lslogins').disabled() | |
1055 | exe = executable( | |
1056 | 'lslogins', | |
1057 | 'login-utils/lslogins.c', | |
d4c880d5 ZJS |
1058 | include_directories : includes, |
1059 | link_with : [lib_common, | |
0333c40b TW |
1060 | lib_smartcols, |
1061 | logindefs_c], | |
d4c880d5 ZJS |
1062 | dependencies : [lib_selinux, |
1063 | lib_systemd], | |
1064 | install_dir : usrbin_exec_dir, | |
1065 | install : opt, | |
1066 | build_by_default : opt) | |
1067 | if opt and not is_disabler(exe) | |
1068 | exes += exe | |
38bb89ee TW |
1069 | manadocs += ['login-utils/lslogins.1.adoc'] |
1070 | bashcompletions += ['lslogins'] | |
d4c880d5 ZJS |
1071 | endif |
1072 | ||
1073 | opt = not get_option('build-vipw').disabled() | |
1074 | exe = executable( | |
1075 | 'vipw', | |
1076 | 'login-utils/vipw.c', | |
1077 | 'login-utils/setpwnam.h', | |
1078 | include_directories : includes, | |
1079 | link_with : [lib_common], | |
1080 | dependencies : [lib_selinux], | |
1081 | install_dir : usrbin_exec_dir, | |
1082 | install : opt, | |
1083 | build_by_default : opt) | |
1084 | if opt and not is_disabler(exe) | |
1085 | exes += exe | |
1086 | meson.add_install_script(meson_make_symlink, | |
1087 | 'vipw', | |
1088 | join_paths(usrbin_exec_dir, 'vigr')) | |
38bb89ee | 1089 | manadocs += ['login-utils/vipw.8.adoc'] |
f6fb7fa7 CH |
1090 | meson.add_install_script(meson_make_symlink, |
1091 | 'vipw.8', | |
1092 | join_paths(mandir, 'man8/vigr.8')) | |
d4c880d5 ZJS |
1093 | endif |
1094 | ||
1095 | opt = not get_option('build-runuser').disabled() | |
1096 | exe = executable( | |
1097 | 'runuser', | |
1098 | 'login-utils/runuser.c', | |
1099 | 'login-utils/su-common.c', | |
1100 | 'login-utils/su-common.h', | |
4b724469 | 1101 | 'lib/shells.c', |
d4c880d5 ZJS |
1102 | pty_session_c, |
1103 | monotonic_c, | |
1104 | include_directories : includes, | |
0333c40b | 1105 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
1106 | dependencies : [lib_pam, |
1107 | lib_pam_misc, | |
1108 | lib_util, | |
1109 | realtime_libs], | |
1110 | install_dir : sbindir, | |
1111 | install : opt, | |
1112 | build_by_default : opt) | |
1113 | if opt and not is_disabler(exe) | |
1114 | exes += exe | |
38bb89ee | 1115 | manadocs += ['login-utils/runuser.1.adoc'] |
aa519054 | 1116 | bashcompletionslinks += {'runuser': 'su'} |
d4c880d5 ZJS |
1117 | endif |
1118 | ||
1119 | ############################################################ | |
1120 | ||
1121 | exe = executable( | |
1122 | 'col', | |
1123 | col_sources, | |
1124 | include_directories : includes, | |
1125 | link_with : lib_common, | |
1126 | install_dir : usrbin_exec_dir, | |
1127 | install : true) | |
1128 | exes += exe | |
38bb89ee TW |
1129 | manadocs += ['text-utils/col.1.adoc'] |
1130 | bashcompletions += ['col'] | |
d4c880d5 ZJS |
1131 | |
1132 | exe = executable( | |
1133 | 'colcrt', | |
1134 | colcrt_sources, | |
1135 | include_directories : includes, | |
1136 | install_dir : usrbin_exec_dir, | |
1137 | install : true) | |
1138 | exes += exe | |
38bb89ee TW |
1139 | manadocs += ['text-utils/colcrt.1.adoc'] |
1140 | bashcompletions += ['colcrt'] | |
d4c880d5 ZJS |
1141 | |
1142 | exe = executable( | |
1143 | 'colrm', | |
1144 | colrm_sources, | |
1145 | include_directories : includes, | |
1146 | link_with : lib_common, | |
1147 | install_dir : usrbin_exec_dir, | |
1148 | install : true) | |
1149 | exes += exe | |
38bb89ee TW |
1150 | manadocs += ['text-utils/colrm.1.adoc'] |
1151 | bashcompletions += ['colrm'] | |
d4c880d5 ZJS |
1152 | |
1153 | exe = executable( | |
1154 | 'rev', | |
1155 | rev_sources, | |
1156 | include_directories : includes, | |
1157 | install_dir : usrbin_exec_dir, | |
1158 | install : true) | |
1159 | exes += exe | |
38bb89ee TW |
1160 | manadocs += ['text-utils/rev.1.adoc'] |
1161 | bashcompletions += ['rev'] | |
d4c880d5 ZJS |
1162 | |
1163 | exe = executable( | |
1164 | 'column', | |
1165 | column_sources, | |
1166 | include_directories : includes, | |
1167 | link_with : [lib_common, | |
1168 | lib_smartcols], | |
1169 | install_dir : usrbin_exec_dir, | |
1170 | install : true) | |
1171 | if not is_disabler(exe) | |
1172 | exes += exe | |
38bb89ee TW |
1173 | manadocs += ['text-utils/column.1.adoc'] |
1174 | bashcompletions += ['column'] | |
d4c880d5 ZJS |
1175 | endif |
1176 | ||
1177 | opt = not get_option('build-line').disabled() | |
1178 | exe = executable( | |
1179 | 'line', | |
1180 | line_sources, | |
1181 | include_directories : includes, | |
1182 | install_dir : usrbin_exec_dir, | |
1183 | install : opt, | |
1184 | build_by_default : opt) | |
1185 | if opt and not is_disabler(exe) | |
1186 | exes += exe | |
38bb89ee | 1187 | manadocs += ['text-utils/line.1.adoc'] |
d4c880d5 ZJS |
1188 | endif |
1189 | ||
1190 | opt = not get_option('build-pg').disabled() | |
1191 | exe = executable( | |
1192 | 'pg', | |
1193 | pg_sources, | |
1194 | link_with : lib_common, | |
1195 | include_directories : includes, | |
1196 | dependencies : [lib_tinfo, | |
1197 | curses_libs], | |
1198 | install_dir : usrbin_exec_dir, | |
1199 | install : opt, | |
1200 | build_by_default : opt) | |
1201 | if opt and not is_disabler(exe) | |
1202 | exes += exe | |
38bb89ee TW |
1203 | manadocs += ['text-utils/pg.1.adoc'] |
1204 | bashcompletions += ['pg'] | |
d4c880d5 ZJS |
1205 | endif |
1206 | ||
1207 | opt = not get_option('build-ul').disabled() | |
1208 | exe = executable( | |
1209 | 'ul', | |
1210 | ul_sources, | |
1211 | include_directories : includes, | |
1212 | dependencies : [lib_tinfo, | |
1213 | curses_libs], | |
1214 | install_dir : usrbin_exec_dir, | |
1215 | install : opt, | |
1216 | build_by_default : opt) | |
1217 | if opt and not is_disabler(exe) | |
1218 | exes += exe | |
38bb89ee TW |
1219 | manadocs += ['text-utils/ul.1.adoc'] |
1220 | bashcompletions += ['ul'] | |
d4c880d5 ZJS |
1221 | endif |
1222 | ||
1223 | opt = not get_option('build-more').disabled() | |
1224 | exe = executable( | |
1225 | 'more', | |
1226 | more_sources, | |
308a0979 | 1227 | link_with : [lib_common], |
d4c880d5 ZJS |
1228 | include_directories : includes, |
1229 | dependencies : [lib_tinfo, | |
6e92db54 KZ |
1230 | curses_libs, |
1231 | lib_magic], | |
d4c880d5 ZJS |
1232 | install : opt, |
1233 | build_by_default : opt) | |
1234 | exe2 = executable( | |
1235 | 'test_more', | |
1236 | more_sources, | |
308a0979 | 1237 | link_with : [lib_common], |
d4c880d5 ZJS |
1238 | include_directories : includes, |
1239 | c_args : '-DTEST_PROGRAM', | |
1240 | dependencies : [lib_tinfo, | |
6e92db54 KZ |
1241 | curses_libs, |
1242 | lib_magic], | |
ba30b89c | 1243 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
1244 | exes += exe |
1245 | if opt and not is_disabler(exe) | |
1246 | exes += [exe, exe2] | |
38bb89ee TW |
1247 | manadocs += ['text-utils/more.1.adoc'] |
1248 | bashcompletions += ['more'] | |
d4c880d5 ZJS |
1249 | endif |
1250 | ||
1251 | exe = executable( | |
1252 | 'hexdump', | |
1253 | hexdump_sources, | |
1254 | include_directories : includes, | |
1255 | link_with : [lib_common, | |
1256 | lib_tcolors], | |
1257 | install_dir : usrbin_exec_dir, | |
1258 | install : true) | |
1259 | if not is_disabler(exe) | |
1260 | exes += exe | |
53b37016 | 1261 | manadocs += ['text-utils/hexdump.1.adoc'] |
38bb89ee | 1262 | bashcompletions += ['hexdump'] |
d4c880d5 ZJS |
1263 | endif |
1264 | ||
1265 | opt = not get_option('build-lsmem').disabled() | |
1266 | exe = executable( | |
1267 | 'lsmem', | |
1268 | lsmem_sources, | |
1269 | include_directories : includes, | |
1270 | link_with : [lib_common, | |
1271 | lib_smartcols], | |
1272 | install_dir : usrbin_exec_dir, | |
1273 | install : opt, | |
1274 | build_by_default : opt) | |
1275 | if opt and not is_disabler(exe) | |
1276 | exes += exe | |
53b37016 | 1277 | manadocs += ['sys-utils/lsmem.1.adoc'] |
38bb89ee | 1278 | bashcompletions += ['lsmem'] |
d4c880d5 ZJS |
1279 | endif |
1280 | ||
1281 | opt = not get_option('build-chmem').disabled() | |
1282 | exe = executable( | |
1283 | 'chmem', | |
1284 | chmem_sources, | |
1285 | include_directories : includes, | |
1286 | link_with : [lib_common], | |
1287 | install_dir : usrbin_exec_dir, | |
1288 | install : opt, | |
1289 | build_by_default : opt) | |
1290 | if opt and not is_disabler(exe) | |
1291 | exes += exe | |
53b37016 | 1292 | manadocs += ['sys-utils/chmem.8.adoc'] |
38bb89ee | 1293 | bashcompletions += ['chmem'] |
d4c880d5 ZJS |
1294 | endif |
1295 | ||
1296 | exe = executable( | |
1297 | 'choom', | |
1298 | choom_sources, | |
1299 | include_directories : includes, | |
1300 | link_with : [lib_common], | |
1301 | install_dir : usrbin_exec_dir, | |
1302 | install : true) | |
1303 | exes += exe | |
53b37016 | 1304 | manadocs += ['sys-utils/choom.1.adoc'] |
d4c880d5 ZJS |
1305 | |
1306 | exe = executable( | |
1307 | 'ipcmk', | |
1308 | ipcmk_sources, | |
1309 | include_directories : includes, | |
1310 | link_with : [lib_common], | |
1311 | install_dir : usrbin_exec_dir, | |
1312 | install : true) | |
1313 | exes += exe | |
53b37016 | 1314 | manadocs += ['sys-utils/ipcmk.1.adoc'] |
38bb89ee | 1315 | bashcompletions += ['ipcmk'] |
d4c880d5 ZJS |
1316 | |
1317 | exe = executable( | |
1318 | 'ipcrm', | |
1319 | ipcrm_sources, | |
1320 | include_directories : includes, | |
1321 | link_with : [lib_common], | |
1322 | install_dir : usrbin_exec_dir, | |
1323 | install : true) | |
1324 | exes += exe | |
53b37016 | 1325 | manadocs += ['sys-utils/ipcrm.1.adoc'] |
38bb89ee | 1326 | bashcompletions += ['ipcrm'] |
d4c880d5 ZJS |
1327 | |
1328 | opt = not get_option('build-ipcs').disabled() | |
1329 | exe = executable( | |
1330 | 'ipcs', | |
1331 | ipcs_sources, | |
1332 | include_directories : includes, | |
1333 | link_with : [lib_common], | |
1334 | install_dir : usrbin_exec_dir, | |
1335 | install : opt, | |
1336 | build_by_default : opt) | |
1337 | if opt and not is_disabler(exe) | |
1338 | exes += exe | |
53b37016 | 1339 | manadocs += ['sys-utils/ipcs.1.adoc'] |
38bb89ee | 1340 | bashcompletions += ['ipcs'] |
d4c880d5 ZJS |
1341 | endif |
1342 | ||
1343 | opt = not get_option('build-rfkill').disabled() | |
1344 | exe = executable( | |
1345 | 'rfkill', | |
1346 | rfkill_sources, | |
1347 | include_directories : includes, | |
1348 | link_with : [lib_common, | |
1349 | lib_smartcols], | |
1350 | install_dir : usrsbin_exec_dir, | |
1351 | install : opt, | |
1352 | build_by_default : opt) | |
1353 | if opt and not is_disabler(exe) | |
1354 | exes += exe | |
53b37016 | 1355 | manadocs += ['sys-utils/rfkill.8.adoc'] |
38bb89ee | 1356 | bashcompletions += ['rfkill'] |
d4c880d5 ZJS |
1357 | endif |
1358 | ||
1359 | exe = executable( | |
1360 | 'renice', | |
1361 | renice_sources, | |
1362 | include_directories : includes, | |
1363 | link_with : [lib_common, | |
1364 | lib_smartcols], | |
1365 | install_dir : usrbin_exec_dir, | |
1366 | install : true) | |
1367 | if not is_disabler(exe) | |
1368 | exes += exe | |
53b37016 | 1369 | manadocs += ['sys-utils/renice.1.adoc'] |
38bb89ee | 1370 | bashcompletions += ['renice'] |
d4c880d5 ZJS |
1371 | endif |
1372 | ||
f092076f DDM |
1373 | exe = executable( |
1374 | 'setpgid', | |
1375 | setpgid_sources, | |
1376 | include_directories: includes, | |
1377 | link_with : [lib_common, | |
1378 | lib_smartcols], | |
1379 | install_dir : usrbin_exec_dir, | |
1380 | install : true) | |
1381 | if opt and not is_disabler(exe) | |
1382 | exes += exe | |
1383 | manadocs += ['sys-utils/setpgid.1.adoc'] | |
1384 | bashcompletions += ['setpgid'] | |
1385 | endif | |
1386 | ||
d4c880d5 ZJS |
1387 | exe = executable( |
1388 | 'setsid', | |
1389 | setsid_sources, | |
1390 | include_directories : includes, | |
1391 | link_with : [lib_common, | |
1392 | lib_smartcols], | |
1393 | install_dir : usrbin_exec_dir, | |
1394 | install : true) | |
1395 | if opt and not is_disabler(exe) | |
1396 | exes += exe | |
53b37016 | 1397 | manadocs += ['sys-utils/setsid.1.adoc'] |
38bb89ee | 1398 | bashcompletions += ['setsid'] |
d4c880d5 ZJS |
1399 | endif |
1400 | ||
1401 | exe = executable( | |
1402 | 'readprofile', | |
1403 | readprofile_sources, | |
1404 | include_directories : includes, | |
1405 | link_with : [lib_common, | |
1406 | lib_smartcols], | |
1407 | install_dir : usrsbin_exec_dir, | |
1408 | install : true) | |
1409 | if not is_disabler(exe) | |
1410 | exes += exe | |
53b37016 | 1411 | manadocs += ['sys-utils/readprofile.8.adoc'] |
38bb89ee | 1412 | bashcompletions += ['readprofile'] |
d4c880d5 ZJS |
1413 | endif |
1414 | ||
1415 | opt = not get_option('build-tunelp').disabled() | |
1416 | exe = executable( | |
1417 | 'tunelp', | |
1418 | tunelp_sources, | |
1419 | include_directories : includes, | |
1420 | link_with : [lib_common], | |
1421 | install_dir : usrsbin_exec_dir, | |
1422 | install : opt, | |
1423 | build_by_default : opt) | |
1424 | if opt and not is_disabler(exe) | |
1425 | exes += exe | |
53b37016 | 1426 | manadocs += ['sys-utils/tunelp.8.adoc'] |
38bb89ee | 1427 | bashcompletions += ['tunelp'] |
d4c880d5 ZJS |
1428 | endif |
1429 | ||
1430 | exe = executable( | |
1431 | 'fstrim', | |
1432 | fstrim_sources, | |
1433 | include_directories : includes, | |
1434 | link_with : [lib_common, | |
1435 | lib_mount], | |
1436 | install_dir : sbindir, | |
1437 | install : true) | |
1438 | if not is_disabler(exe) | |
1439 | exes += exe | |
53b37016 | 1440 | manadocs += ['sys-utils/fstrim.8.adoc'] |
38bb89ee | 1441 | bashcompletions += ['fstrim'] |
d4c880d5 ZJS |
1442 | endif |
1443 | ||
1444 | exe = executable( | |
1445 | 'dmesg', | |
1446 | dmesg_sources, | |
1447 | include_directories : includes, | |
1448 | link_with : [lib_common, | |
1449 | lib_tcolors], | |
1450 | install : true) | |
1451 | if not is_disabler(exe) | |
1452 | exes += exe | |
53b37016 | 1453 | manadocs += ['sys-utils/dmesg.1.adoc'] |
38bb89ee | 1454 | bashcompletions += ['dmesg'] |
d4c880d5 ZJS |
1455 | endif |
1456 | ||
1457 | exe = executable( | |
1458 | 'test_dmesg', | |
1459 | dmesg_sources, | |
1460 | include_directories : dir_include, | |
1461 | c_args : '-DTEST_DMESG', | |
1462 | link_with : [lib_common, | |
ba30b89c | 1463 | lib_tcolors], |
1464 | build_by_default : program_tests) | |
d4c880d5 ZJS |
1465 | if not is_disabler(exe) |
1466 | exes += exe | |
1467 | endif | |
1468 | ||
1469 | exe = executable( | |
1470 | 'ctrlaltdel', | |
1471 | ctrlaltdel_sources, | |
1472 | include_directories : includes, | |
1473 | link_with : [lib_common], | |
1474 | install_dir : sbindir, | |
1475 | install : true) | |
1476 | exes += exe | |
53b37016 | 1477 | manadocs += ['sys-utils/ctrlaltdel.8.adoc'] |
38bb89ee | 1478 | bashcompletions += ['ctrlaltdel'] |
d4c880d5 ZJS |
1479 | |
1480 | exe = executable( | |
1481 | 'fsfreeze', | |
1482 | fsfreeze_sources, | |
1483 | include_directories : includes, | |
1484 | install_dir : sbindir, | |
1485 | install : true) | |
1486 | exes += exe | |
53b37016 | 1487 | manadocs += ['sys-utils/fsfreeze.8.adoc'] |
38bb89ee | 1488 | bashcompletions += ['fsfreeze'] |
d4c880d5 ZJS |
1489 | |
1490 | exe = executable( | |
1491 | 'blkdiscard', | |
1492 | blkdiscard_sources, | |
1493 | include_directories : includes, | |
308a0979 KZ |
1494 | link_with : [lib_common, |
1495 | lib_blkid], | |
d4c880d5 ZJS |
1496 | install_dir : sbindir, |
1497 | install : true) | |
1498 | exes += exe | |
53b37016 | 1499 | manadocs += ['sys-utils/blkdiscard.8.adoc'] |
38bb89ee | 1500 | bashcompletions += ['blkdiscard'] |
d4c880d5 ZJS |
1501 | |
1502 | exe = executable( | |
1503 | 'blkzone', | |
1504 | blkzone_sources, | |
1505 | include_directories : includes, | |
1506 | link_with : [lib_common], | |
1507 | install_dir : sbindir, | |
1508 | install : true) | |
1509 | exes += exe | |
53b37016 | 1510 | manadocs += ['sys-utils/blkzone.8.adoc'] |
38bb89ee | 1511 | bashcompletions += ['blkzone'] |
d4c880d5 | 1512 | |
61c2946d TW |
1513 | exe = executable( |
1514 | 'blkpr', | |
1515 | blkpr_sources, | |
1516 | include_directories : includes, | |
1517 | link_with : [lib_common], | |
1518 | install_dir : sbindir, | |
1519 | install : true) | |
1520 | exes += exe | |
1521 | manadocs += ['sys-utils/blkpr.8.adoc'] | |
1522 | ||
d4c880d5 ZJS |
1523 | exe = executable( |
1524 | 'ldattach', | |
1525 | ldattach_sources, | |
1526 | include_directories : includes, | |
1527 | link_with : [lib_common], | |
1528 | install_dir : usrsbin_exec_dir, | |
1529 | install : true) | |
1530 | exes += exe | |
53b37016 | 1531 | manadocs += ['sys-utils/ldattach.8.adoc'] |
38bb89ee | 1532 | bashcompletions += ['ldattach'] |
d4c880d5 ZJS |
1533 | |
1534 | exe = executable( | |
1535 | 'rtcwake', | |
1536 | rtcwake_sources, | |
1537 | include_directories : includes, | |
1538 | link_with : [lib_common], | |
1539 | install_dir : usrsbin_exec_dir, | |
1540 | install : true) | |
1541 | exes += exe | |
53b37016 | 1542 | manadocs += ['sys-utils/rtcwake.8.adoc'] |
38bb89ee | 1543 | bashcompletions += ['rtcwake'] |
d4c880d5 ZJS |
1544 | |
1545 | exe = executable( | |
1546 | 'setarch', | |
1547 | setarch_sources, | |
1548 | include_directories : includes, | |
035fc2d9 | 1549 | link_with : [lib_common], |
d4c880d5 ZJS |
1550 | install_dir : usrbin_exec_dir, |
1551 | install : true) | |
1552 | exes += exe | |
53b37016 | 1553 | manadocs += ['sys-utils/setarch.8.adoc'] |
38bb89ee | 1554 | bashcompletions += ['setarch'] |
d4c880d5 ZJS |
1555 | |
1556 | setarch_links = ['uname26', 'linux32', 'linux64'] | |
1557 | setarch_links_arch = { | |
1558 | 's390x' : ['s390', 's390x'], | |
1559 | 'x86' : ['i386'], | |
1560 | 'x86_64' : ['i386', 'x86_64'], | |
1561 | 'ppc64' : ['ppc', 'ppc64', 'ppc32'], | |
1562 | 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'], | |
1563 | 'mips64' : ['mips', 'mips64', 'mips32'], | |
1564 | 'ia64' : ['i386', 'ia64'], | |
1565 | 'hppa' : ['parisc', 'parisc64', 'parisc32'], | |
1566 | } | |
1567 | setarch_links += setarch_links_arch.get(host_machine.cpu_family(), []) | |
1568 | ||
1569 | foreach link: setarch_links | |
1570 | meson.add_install_script(meson_make_symlink, | |
1571 | 'setarch', | |
1572 | join_paths(usrbin_exec_dir, link)) | |
38bb89ee | 1573 | manlinks += {link + '.8': 'setarch.8'} |
d4c880d5 ZJS |
1574 | endforeach |
1575 | ||
1576 | opt = not get_option('build-eject').disabled() | |
1577 | exe = executable( | |
1578 | 'eject', | |
1579 | eject_sources, | |
1580 | include_directories : includes, | |
1581 | link_with : [lib_common, | |
1582 | lib_mount], | |
1583 | install_dir : usrbin_exec_dir, | |
1584 | install : opt, | |
1585 | build_by_default : opt) | |
1586 | if opt and not is_disabler(exe) | |
1587 | exe = exe | |
53b37016 | 1588 | manadocs += ['sys-utils/eject.1.adoc'] |
38bb89ee | 1589 | bashcompletions += ['eject'] |
d4c880d5 ZJS |
1590 | endif |
1591 | ||
1592 | opt = not get_option('build-losetup').disabled() | |
1593 | exe = executable( | |
1594 | 'losetup', | |
1595 | losetup_sources, | |
1596 | include_directories : includes, | |
1597 | link_with : [lib_common, | |
1598 | lib_smartcols], | |
1599 | install_dir : sbindir, | |
1600 | install : opt, | |
1601 | build_by_default : opt) | |
1602 | if opt and not is_disabler(exe) | |
53b37016 | 1603 | manadocs += ['sys-utils/losetup.8.adoc'] |
d4c880d5 | 1604 | exes += exe |
38bb89ee | 1605 | bashcompletions += ['losetup'] |
d4c880d5 ZJS |
1606 | endif |
1607 | ||
69939195 ZJS |
1608 | opt = opt and 'losetup' in static_programs |
1609 | exe = executable( | |
1610 | 'losetup.static', | |
1611 | losetup_sources, | |
1612 | include_directories : includes, | |
1613 | link_args : ['--static'], | |
1614 | link_with : [lib_common, | |
1615 | lib_smartcols.get_static_lib()], | |
1616 | install_dir : sbindir, | |
1617 | install : opt, | |
1618 | build_by_default : opt) | |
1619 | if opt and not is_disabler(exe) | |
1620 | exes += exe | |
1621 | endif | |
1622 | ||
d4c880d5 ZJS |
1623 | opt = not get_option('build-zramctl').disabled() |
1624 | exe = executable( | |
1625 | 'zramctl', | |
1626 | zramctl_sources, | |
1627 | include_directories : includes, | |
1628 | link_with : [lib_common, | |
1629 | lib_smartcols], | |
1630 | install_dir : sbindir, | |
1631 | install : opt, | |
1632 | build_by_default : opt) | |
1633 | if opt and not is_disabler(exe) | |
1634 | exes += exe | |
53b37016 | 1635 | manadocs += ['sys-utils/zramctl.8.adoc'] |
38bb89ee | 1636 | bashcompletions += ['zramctl'] |
d4c880d5 ZJS |
1637 | endif |
1638 | ||
1639 | exe = executable( | |
1640 | 'prlimit', | |
1641 | prlimit_sources, | |
1642 | include_directories : includes, | |
1643 | link_with : [lib_common, | |
1644 | lib_smartcols], | |
1645 | install_dir : usrbin_exec_dir, | |
1646 | install : true) | |
1647 | if not is_disabler(exe) | |
1648 | exes += exe | |
53b37016 | 1649 | manadocs += ['sys-utils/prlimit.1.adoc'] |
38bb89ee | 1650 | bashcompletions += ['prlimit'] |
d4c880d5 ZJS |
1651 | endif |
1652 | ||
1653 | exe = executable( | |
1654 | 'lsns', | |
1655 | lsns_sources, | |
1656 | include_directories : includes, | |
1657 | link_with : [lib_common, | |
1658 | lib_smartcols, | |
1659 | lib_mount], | |
1660 | install_dir : usrbin_exec_dir, | |
1661 | install : true) | |
1662 | if not is_disabler(exe) | |
1663 | exes += exe | |
53b37016 | 1664 | manadocs += ['sys-utils/lsns.8.adoc'] |
38bb89ee | 1665 | bashcompletions += ['lsns'] |
d4c880d5 ZJS |
1666 | endif |
1667 | ||
1668 | opt = not get_option('build-mount').disabled() | |
1669 | exe = executable( | |
1670 | 'mount', | |
1671 | mount_sources, | |
1672 | include_directories : includes, | |
1673 | link_with : [lib_common, | |
1674 | lib_smartcols, | |
1675 | lib_mount], | |
1676 | dependencies : lib_selinux, | |
8f49b369 | 1677 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1678 | install : opt, |
1679 | build_by_default : opt) | |
1680 | exe2 = executable( | |
1681 | 'umount', | |
1682 | umount_sources, | |
1683 | include_directories : includes, | |
1684 | link_with : [lib_common, | |
1685 | lib_mount], | |
1cb3c90c | 1686 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1687 | install : opt, |
1688 | build_by_default : opt) | |
1689 | if opt and not is_disabler(exe) | |
1690 | exes += [exe, exe2] | |
53b37016 KZ |
1691 | manadocs += ['sys-utils/fstab.5.adoc', |
1692 | 'sys-utils/mount.8.adoc', | |
1693 | 'sys-utils/umount.8.adoc'] | |
38bb89ee | 1694 | bashcompletions += ['mount', 'umount'] |
d4c880d5 ZJS |
1695 | endif |
1696 | ||
69939195 ZJS |
1697 | opt2 = opt and 'mount' in static_programs |
1698 | exe = executable( | |
1699 | 'mount.static', | |
1700 | mount_sources, | |
1701 | include_directories : includes, | |
1702 | link_args : ['--static'], | |
1703 | link_with : [lib_common, | |
1704 | lib_smartcols_static, | |
1705 | lib_mount_static], | |
1706 | install : opt2, | |
1707 | build_by_default : opt2) | |
1708 | if opt2 and not is_disabler(exe) | |
1709 | exes += exe | |
1710 | endif | |
1711 | ||
1712 | opt2 = opt and 'umount' in static_programs | |
1713 | exe = executable( | |
1714 | 'umount.static', | |
1715 | umount_sources, | |
1716 | include_directories : includes, | |
1717 | link_args : ['--static'], | |
1718 | link_with : [lib_common, | |
1719 | lib_mount_static], | |
1720 | install : opt2, | |
1721 | build_by_default : opt2) | |
1722 | if opt2 and not is_disabler(exe) | |
1723 | exes += exe | |
1724 | endif | |
1725 | ||
d4c880d5 ZJS |
1726 | # setuid? |
1727 | ||
1728 | exe = executable( | |
1729 | 'swapon', | |
1730 | swapon_sources, | |
1731 | include_directories : includes, | |
1732 | link_with : [lib_common, | |
1733 | lib_blkid, | |
1734 | lib_mount, | |
1735 | lib_smartcols], | |
1736 | install_dir : sbindir, | |
1737 | install : true) | |
1738 | if not is_disabler(exe) | |
1739 | exes += exe | |
53b37016 | 1740 | manadocs += ['sys-utils/swapon.8.adoc'] |
38bb89ee | 1741 | bashcompletions += ['swapon'] |
d4c880d5 ZJS |
1742 | endif |
1743 | ||
1744 | exe = executable( | |
1745 | 'swapoff', | |
1746 | swapoff_sources, | |
1747 | include_directories : includes, | |
1748 | link_with : [lib_common, | |
1749 | lib_blkid, | |
1750 | lib_mount], | |
1751 | install_dir : sbindir, | |
1752 | install : true) | |
1753 | if not is_disabler(exe) | |
1754 | exes += exe | |
38bb89ee TW |
1755 | manlinks += {'swapoff.8': 'swapon.8'} |
1756 | bashcompletions += ['swapoff'] | |
d4c880d5 ZJS |
1757 | endif |
1758 | ||
1759 | exe = executable( | |
1760 | 'lscpu', | |
1761 | lscpu_sources, | |
1762 | include_directories : includes, | |
1763 | link_with : [lib_common, | |
1764 | lib_smartcols], | |
1765 | dependencies : [rtas_libs], | |
1766 | install_dir : usrbin_exec_dir, | |
1767 | install : true) | |
1768 | if not is_disabler(exe) | |
1769 | exes += exe | |
53b37016 | 1770 | manadocs += ['sys-utils/lscpu.1.adoc'] |
38bb89ee | 1771 | bashcompletions += ['lscpu'] |
d4c880d5 ZJS |
1772 | endif |
1773 | ||
1774 | exe = executable( | |
1775 | 'chcpu', | |
1776 | chcpu_sources, | |
1777 | include_directories : includes, | |
1778 | link_with : [lib_common], | |
1779 | install_dir : sbindir, | |
1780 | install : true) | |
1781 | exes += exe | |
53b37016 | 1782 | manadocs += ['sys-utils/chcpu.8.adoc'] |
38bb89ee | 1783 | bashcompletions += ['chcpu'] |
d4c880d5 ZJS |
1784 | |
1785 | exe = executable( | |
1786 | 'wdctl', | |
1787 | wdctl_sources, | |
1788 | include_directories : includes, | |
1789 | link_with : [lib_common, | |
1790 | lib_smartcols], | |
1791 | install : true) | |
1792 | if not is_disabler(exe) | |
1793 | exes += exe | |
53b37016 | 1794 | manadocs += ['sys-utils/wdctl.8.adoc'] |
38bb89ee | 1795 | bashcompletions += ['wdctl'] |
d4c880d5 ZJS |
1796 | endif |
1797 | ||
1798 | opt = not get_option('build-mountpoint').disabled() | |
1799 | exe = executable( | |
1800 | 'mountpoint', | |
1801 | mountpoint_sources, | |
1802 | include_directories : includes, | |
1803 | link_with : [lib_mount], | |
1804 | install : opt, | |
1805 | build_by_default : opt) | |
1806 | if opt and not is_disabler(exe) | |
1807 | exes += exe | |
53b37016 | 1808 | manadocs += ['sys-utils/mountpoint.1.adoc'] |
38bb89ee | 1809 | bashcompletions += ['mountpoint'] |
d4c880d5 ZJS |
1810 | endif |
1811 | ||
1812 | opt = not get_option('build-fallocate').disabled() | |
1813 | exe = executable( | |
1814 | 'fallocate', | |
1815 | fallocate_sources, | |
1816 | include_directories : includes, | |
1817 | link_with : [lib_common], | |
1818 | install_dir : usrbin_exec_dir, | |
1819 | install : opt, | |
1820 | build_by_default : opt) | |
1821 | if opt and not is_disabler(exe) | |
1822 | exes += exe | |
53b37016 | 1823 | manadocs += ['sys-utils/fallocate.1.adoc'] |
38bb89ee | 1824 | bashcompletions += ['fallocate'] |
d4c880d5 ZJS |
1825 | endif |
1826 | ||
1827 | opt = not get_option('build-pivot_root').disabled() | |
1828 | exe = executable( | |
1829 | 'pivot_root', | |
1830 | pivot_root_sources, | |
1831 | include_directories : includes, | |
1832 | install_dir : sbindir, | |
1833 | install : opt, | |
1834 | build_by_default : opt) | |
1835 | if opt and not is_disabler(exe) | |
1836 | exes += exe | |
53b37016 | 1837 | manadocs += ['sys-utils/pivot_root.8.adoc'] |
38bb89ee | 1838 | bashcompletions += ['pivot_root'] |
d4c880d5 ZJS |
1839 | endif |
1840 | ||
1841 | opt = not get_option('build-switch_root').disabled() | |
1842 | if opt and not have_dirfd and not have_ddfd | |
1843 | error('neither dirfd nor ddfd are available') | |
1844 | endif | |
1845 | exe = executable( | |
1846 | 'switch_root', | |
1847 | switch_root_sources, | |
1848 | include_directories : includes, | |
1849 | install_dir : sbindir, | |
1850 | install : opt, | |
1851 | build_by_default : opt) | |
1852 | if opt and not is_disabler(exe) | |
1853 | exes += exe | |
53b37016 | 1854 | manadocs += ['sys-utils/switch_root.8.adoc'] |
d4c880d5 ZJS |
1855 | endif |
1856 | ||
1857 | opt = not get_option('build-unshare').disabled() | |
1858 | exe = executable( | |
1859 | 'unshare', | |
1860 | unshare_sources, | |
1861 | include_directories : includes, | |
1862 | link_with : [lib_common], | |
1863 | install_dir : usrbin_exec_dir, | |
1864 | install : opt, | |
1865 | build_by_default : opt) | |
1866 | if opt and not is_disabler(exe) | |
1867 | exes += exe | |
53b37016 | 1868 | manadocs += ['sys-utils/unshare.1.adoc'] |
38bb89ee | 1869 | bashcompletions += ['unshare'] |
d4c880d5 ZJS |
1870 | endif |
1871 | ||
69939195 ZJS |
1872 | opt = opt and 'unshare' in static_programs |
1873 | exe = executable( | |
1874 | 'unshare.static', | |
1875 | unshare_sources, | |
1876 | include_directories : includes, | |
1877 | link_with : [lib_common], | |
1878 | install_dir : usrbin_exec_dir, | |
1879 | install : opt, | |
1880 | build_by_default : opt) | |
1881 | if opt and not is_disabler(exe) | |
1882 | exes += exe | |
1883 | endif | |
1884 | ||
d4c880d5 ZJS |
1885 | opt = not get_option('build-nsenter').disabled() |
1886 | exe = executable( | |
1887 | 'nsenter', | |
1888 | nsenter_sources, | |
1889 | include_directories : includes, | |
1890 | link_with : [lib_common], | |
1891 | dependencies : [lib_selinux], | |
1892 | install_dir : usrbin_exec_dir, | |
1893 | install : opt, | |
1894 | build_by_default : opt) | |
1895 | if opt and not is_disabler(exe) | |
1896 | exes += exe | |
53b37016 | 1897 | manadocs += ['sys-utils/nsenter.1.adoc'] |
38bb89ee | 1898 | bashcompletions += ['nsenter'] |
d4c880d5 ZJS |
1899 | endif |
1900 | ||
69939195 ZJS |
1901 | opt = opt and 'nsenter' in static_programs |
1902 | exe = executable( | |
1903 | 'nsenter.static', | |
1904 | nsenter_sources, | |
1905 | include_directories : includes, | |
1906 | link_with : [lib_common], | |
1907 | dependencies : [lib_selinux], | |
1908 | install_dir : usrbin_exec_dir, | |
1909 | install : opt, | |
1910 | build_by_default : opt) | |
1911 | if opt and not is_disabler(exe) | |
1912 | exes += exe | |
1913 | endif | |
1914 | ||
cd23a433 | 1915 | opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found() |
d4c880d5 ZJS |
1916 | exe = executable( |
1917 | 'setpriv', | |
1918 | setpriv_sources, | |
1919 | include_directories : includes, | |
1920 | link_with : [lib_common], | |
1921 | dependencies : [lib_cap_ng], | |
1922 | install_dir : usrbin_exec_dir, | |
1923 | install : opt, | |
1924 | build_by_default : opt) | |
1925 | if opt and not is_disabler(exe) | |
1926 | exes += exe | |
53b37016 | 1927 | manadocs += ['sys-utils/setpriv.1.adoc'] |
38bb89ee | 1928 | bashcompletions += ['setpriv'] |
d4c880d5 ZJS |
1929 | endif |
1930 | ||
1931 | exe = executable( | |
1932 | 'flock', | |
1933 | flock_sources, | |
1934 | include_directories : includes, | |
1935 | link_with : [lib_common], | |
1936 | dependencies : realtime_libs, | |
1937 | install_dir : usrbin_exec_dir, | |
1938 | install : true) | |
1939 | exes += exe | |
53b37016 | 1940 | manadocs += ['sys-utils/flock.1.adoc'] |
38bb89ee | 1941 | bashcompletions += ['flock'] |
d4c880d5 | 1942 | |
645577c7 KZ |
1943 | opt = not get_option('build-lsirq').disabled() |
1944 | exe = executable( | |
1945 | 'lsirq', | |
1946 | lsirq_sources, | |
1947 | include_directories : includes, | |
1948 | link_with : [lib_common, | |
1949 | lib_smartcols], | |
1950 | install_dir : usrbin_exec_dir, | |
1951 | install : opt, | |
1952 | build_by_default : opt) | |
1953 | if opt and not is_disabler(exe) | |
1954 | exes += exe | |
53b37016 | 1955 | manadocs += ['sys-utils/lsirq.1.adoc'] |
38bb89ee | 1956 | bashcompletions += ['lsirq'] |
645577c7 KZ |
1957 | endif |
1958 | ||
1959 | opt = not get_option('build-irqtop').disabled() | |
1960 | exe = executable( | |
1961 | 'irqtop', | |
1962 | irqtop_sources, | |
1963 | include_directories : includes, | |
1964 | dependencies : [realtime_libs, curses_libs], | |
1965 | link_with : [lib_common, | |
1966 | lib_smartcols, | |
1967 | lib_tcolors], | |
1968 | install_dir : usrbin_exec_dir, | |
1969 | install : opt, | |
1970 | build_by_default : opt) | |
1971 | if opt and not is_disabler(exe) | |
1972 | exes += exe | |
53b37016 | 1973 | manadocs += ['sys-utils/irqtop.1.adoc'] |
38bb89ee | 1974 | bashcompletions += ['irqtop'] |
645577c7 KZ |
1975 | endif |
1976 | ||
d4c880d5 ZJS |
1977 | opt = not get_option('build-ipcs').disabled() |
1978 | exe = executable( | |
1979 | 'lsipc', | |
1980 | lsipc_sources, | |
1981 | include_directories : includes, | |
1982 | link_with : [lib_common, | |
1983 | lib_smartcols], | |
1984 | install_dir : usrbin_exec_dir, | |
1985 | install : opt, | |
1986 | build_by_default : opt) | |
1987 | if opt and not is_disabler(exe) | |
1988 | exes += exe | |
53b37016 | 1989 | manadocs += ['sys-utils/lsipc.1.adoc'] |
38bb89ee | 1990 | bashcompletions += ['lsipc'] |
d4c880d5 ZJS |
1991 | endif |
1992 | ||
1993 | opt = build_hwclock | |
1994 | exe = executable( | |
1995 | 'hwclock', | |
1996 | hwclock_sources, | |
1997 | include_directories : includes, | |
1998 | link_with : [lib_common], | |
1999 | dependencies : [lib_m, | |
2000 | lib_audit], | |
2001 | install_dir : sbindir, | |
2002 | install : opt, | |
2003 | build_by_default : opt) | |
2004 | if opt and not is_disabler(exe) | |
2005 | exes += exe | |
38bb89ee TW |
2006 | manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc'] |
2007 | bashcompletions += ['hwclock'] | |
d4c880d5 ZJS |
2008 | endif |
2009 | ||
2010 | exe = executable( | |
2011 | 'mkfs', | |
2012 | mkfs_sources, | |
2013 | include_directories : includes, | |
2014 | install_dir : sbindir, | |
2015 | install : true) | |
2016 | exes += exe | |
53b37016 | 2017 | manadocs += ['disk-utils/mkfs.8.adoc'] |
38bb89ee | 2018 | bashcompletions += ['mkfs'] |
d4c880d5 ZJS |
2019 | |
2020 | opt = not get_option('build-bfs').disabled() | |
2021 | exe = executable( | |
2022 | 'mkfs.bfs', | |
2023 | mkfs_bfs_sources, | |
2024 | include_directories : includes, | |
2025 | link_with : [lib_common], | |
2026 | install_dir : sbindir, | |
2027 | install : opt, | |
2028 | build_by_default : opt) | |
2029 | if opt and not is_disabler(exe) | |
2030 | exes += exe | |
53b37016 | 2031 | manadocs += ['disk-utils/mkfs.bfs.8.adoc'] |
38bb89ee | 2032 | bashcompletions += ['mkfs.bfs'] |
d4c880d5 ZJS |
2033 | endif |
2034 | ||
2035 | exe = executable( | |
2036 | 'isosize', | |
2037 | isosize_sources, | |
2038 | include_directories : includes, | |
2039 | link_with : [lib_common], | |
2040 | install_dir : usrbin_exec_dir, | |
2041 | install : true) | |
2042 | exes += exe | |
53b37016 | 2043 | manadocs += ['disk-utils/isosize.8.adoc'] |
38bb89ee | 2044 | bashcompletions += ['isosize'] |
d4c880d5 ZJS |
2045 | |
2046 | exe = executable( | |
2047 | 'mkswap', | |
2048 | mkswap_sources, | |
2049 | include_directories : includes, | |
2050 | link_with : [lib_common, | |
2051 | lib_blkid, | |
2052 | lib_uuid], | |
2053 | dependencies: [lib_selinux], | |
2054 | install_dir : sbindir, | |
2055 | install : true) | |
2056 | if opt and not is_disabler(exe) | |
2057 | exes += exe | |
53b37016 | 2058 | manadocs += ['disk-utils/mkswap.8.adoc'] |
38bb89ee | 2059 | bashcompletions += ['mkswap'] |
d4c880d5 ZJS |
2060 | endif |
2061 | ||
2062 | exe = executable( | |
2063 | 'swaplabel', | |
2064 | swaplabel_sources, | |
2065 | include_directories : includes, | |
2066 | link_with : [lib_common, | |
2067 | lib_blkid, | |
2068 | lib_uuid], | |
2069 | install_dir : sbindir, | |
2070 | install : true) | |
2071 | if opt and not is_disabler(exe) | |
2072 | exes += exe | |
53b37016 | 2073 | manadocs += ['disk-utils/swaplabel.8.adoc'] |
38bb89ee | 2074 | bashcompletions += ['swaplabel'] |
d4c880d5 ZJS |
2075 | endif |
2076 | ||
2077 | opt = not get_option('build-fsck').disabled() | |
2078 | exe = executable( | |
2079 | 'fsck', | |
2080 | fsck_sources, | |
2081 | include_directories : includes, | |
2082 | link_with : [lib_common, | |
2083 | lib_blkid, | |
2084 | lib_mount], | |
2085 | dependencies : realtime_libs, | |
2086 | install_dir : sbindir, | |
2087 | install : opt, | |
2088 | build_by_default : opt) | |
2089 | if opt and not is_disabler(exe) | |
2090 | exes += exe | |
53b37016 | 2091 | manadocs += ['disk-utils/fsck.8.adoc'] |
38bb89ee | 2092 | bashcompletions += ['fsck'] |
d4c880d5 ZJS |
2093 | endif |
2094 | ||
2095 | opt = not get_option('build-minix').disabled() | |
2096 | exe = executable( | |
2097 | 'mkfs.minix', | |
2098 | mkfs_minix_sources, | |
2099 | include_directories : includes, | |
2100 | link_with : [lib_common], | |
2101 | install_dir : sbindir, | |
2102 | install : opt, | |
2103 | build_by_default : opt) | |
2104 | exe2 = executable( | |
2105 | 'test_mkfs_minix', | |
2106 | mkfs_minix_sources, | |
2107 | include_directories : includes, | |
2108 | c_args : '-DTEST_SCRIPT', | |
2109 | link_with : [lib_common], | |
ba30b89c | 2110 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
2111 | exe3 = executable( |
2112 | 'fsck.minix', | |
2113 | fsck_minix_sources, | |
2114 | include_directories : includes, | |
2115 | link_with : [lib_common], | |
2116 | install_dir : sbindir, | |
2117 | install : opt, | |
2118 | build_by_default : opt) | |
2119 | if opt and not is_disabler(exe) | |
2120 | exes += [exe, exe2, exe3] | |
53b37016 | 2121 | manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc'] |
38bb89ee | 2122 | bashcompletions += ['mkfs.minix', 'fsck.minix'] |
d4c880d5 ZJS |
2123 | endif |
2124 | ||
2125 | opt = not get_option('build-cramfs').disabled() | |
2126 | exe = executable( | |
2127 | 'mkfs.cramfs', | |
2128 | mkfs_cramfs_sources, | |
2129 | include_directories : includes, | |
2130 | link_with : [lib_common], | |
2131 | dependencies : [lib_z], | |
2132 | install_dir : sbindir, | |
2133 | install : opt, | |
2134 | build_by_default : opt) | |
2135 | exe2 = executable( | |
2136 | 'fsck.cramfs', | |
2137 | fsck_cramfs_sources, | |
2138 | include_directories : includes, | |
2139 | link_with : [lib_common], | |
2140 | dependencies : [lib_z], | |
2141 | install_dir : sbindir, | |
2142 | install : opt, | |
2143 | build_by_default : opt) | |
2144 | if not is_disabler(exe) | |
2145 | exes += [exe, exe2] | |
53b37016 | 2146 | manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc'] |
38bb89ee | 2147 | bashcompletions += ['mkfs.cramfs', 'fsck.cramfs'] |
d4c880d5 ZJS |
2148 | endif |
2149 | ||
2150 | opt = not get_option('build-raw').disabled() | |
dff176e2 | 2151 | if opt |
433e4b77 | 2152 | cc.has_header('linux/raw.h', required: opt) |
dff176e2 | 2153 | endif |
d4c880d5 ZJS |
2154 | exe = executable( |
2155 | 'raw', | |
2156 | raw_sources, | |
2157 | include_directories : includes, | |
2158 | install_dir : sbindir, | |
2159 | install : opt, | |
2160 | build_by_default : opt) | |
2161 | if opt and not is_disabler(exe) | |
2162 | exes += exe | |
53b37016 | 2163 | manadocs += ['disk-utils/raw.8.adoc'] |
38bb89ee | 2164 | bashcompletions += ['raw'] |
d4c880d5 ZJS |
2165 | endif |
2166 | ||
2167 | opt = not get_option('build-fdformat').disabled() | |
2168 | exe = executable( | |
2169 | 'fdformat', | |
2170 | fdformat_sources, | |
2171 | include_directories : includes, | |
2172 | link_with : [lib_common], | |
2173 | install_dir : usrsbin_exec_dir, | |
2174 | install : opt, | |
2175 | build_by_default : opt) | |
2176 | if opt and not is_disabler(exe) | |
2177 | exes += exe | |
53b37016 | 2178 | manadocs += ['disk-utils/fdformat.8.adoc'] |
d4c880d5 ZJS |
2179 | endif |
2180 | ||
2181 | exe = executable( | |
2182 | 'blockdev', | |
2183 | blockdev_sources, | |
2184 | include_directories : includes, | |
2185 | link_with : [lib_common], | |
2186 | install_dir : sbindir, | |
2187 | install : true) | |
53b37016 | 2188 | manadocs += ['disk-utils/blockdev.8.adoc'] |
38bb89ee | 2189 | bashcompletions += ['blockdev'] |
d4c880d5 ZJS |
2190 | |
2191 | opt = not get_option('build-fdisks').disabled() | |
2192 | if opt and not have_dirfd and not have_ddfd | |
2193 | error('neither dirfd nor ddfd are available') | |
2194 | endif | |
2195 | exe = executable( | |
2196 | 'fdisk', | |
2197 | fdisk_sources, | |
2198 | include_directories : includes, | |
2199 | link_with : [lib_common, | |
2200 | lib_fdisk, | |
2201 | lib_smartcols, | |
2202 | lib_tcolors], | |
2203 | dependencies : [lib_readline], | |
2204 | install_dir : sbindir, | |
2205 | install : opt, | |
2206 | build_by_default : opt) | |
2207 | if opt and not is_disabler(exe) | |
2208 | exes += exe | |
38bb89ee | 2209 | bashcompletions += ['fdisk'] |
d4c880d5 ZJS |
2210 | endif |
2211 | ||
69939195 ZJS |
2212 | opt2 = opt and 'fdisk' in static_programs |
2213 | exe = executable( | |
2214 | 'fdisk.static', | |
2215 | fdisk_sources, | |
2216 | link_args : ['--static'], | |
2217 | include_directories : includes, | |
2218 | link_with : [lib_common, | |
2219 | lib_tcolors, | |
2220 | lib_fdisk_static, | |
2221 | lib_smartcols.get_static_lib()], | |
2222 | dependencies : [lib_readline_static], | |
2223 | install_dir : sbindir, | |
2224 | install : opt2, | |
2225 | build_by_default : opt2) | |
2226 | if opt2 and not is_disabler(exe) | |
2227 | exes += exe | |
2228 | endif | |
d4c880d5 ZJS |
2229 | |
2230 | exe = executable( | |
2231 | 'sfdisk', | |
2232 | sfdisk_sources, | |
2233 | include_directories : includes, | |
2234 | link_with : [lib_common, | |
2235 | lib_fdisk, | |
2236 | lib_smartcols, | |
2237 | lib_tcolors], | |
2238 | dependencies : [lib_readline], | |
2239 | install_dir : sbindir, | |
2240 | install : opt, | |
2241 | build_by_default : opt) | |
2242 | if opt and not is_disabler(exe) | |
2243 | exes += exe | |
38bb89ee | 2244 | bashcompletions += ['sfdisk'] |
d4c880d5 ZJS |
2245 | endif |
2246 | ||
69939195 ZJS |
2247 | opt2 = opt and 'sfdisk' in static_programs |
2248 | exe = executable( | |
2249 | 'sfdisk.static', | |
2250 | sfdisk_sources, | |
2251 | include_directories : includes, | |
2252 | link_with : [lib_common, | |
2253 | lib_tcolors, | |
2254 | lib_fdisk_static, | |
2255 | lib_smartcols.get_static_lib()], | |
2256 | dependencies : [lib_readline_static], | |
2257 | install_dir : sbindir, | |
2258 | install : opt2, | |
2259 | build_by_default : opt2) | |
2260 | if opt2 and not is_disabler(exe) | |
2261 | exes += exe | |
2262 | endif | |
d4c880d5 ZJS |
2263 | |
2264 | exe = executable( | |
2265 | 'cfdisk', | |
2266 | cfdisk_sources, | |
2267 | include_directories : includes, | |
2268 | link_with : [lib_common, | |
2269 | lib_fdisk, | |
2270 | lib_smartcols, | |
2271 | lib_tcolors, | |
2272 | lib_mount], | |
2273 | dependencies : [curses_libs], | |
2274 | install_dir : sbindir, | |
2275 | install : opt, | |
2276 | build_by_default : opt) | |
2277 | if opt and not is_disabler(exe) | |
2278 | exes += exe | |
53b37016 KZ |
2279 | manadocs += ['disk-utils/fdisk.8.adoc', |
2280 | 'disk-utils/sfdisk.8.adoc', | |
2281 | 'disk-utils/cfdisk.8.adoc'] | |
38bb89ee | 2282 | bashcompletions += ['cfdisk'] |
d4c880d5 ZJS |
2283 | endif |
2284 | ||
2285 | opt = not get_option('build-partx').disabled() | |
2286 | exe = executable( | |
2287 | 'addpart', | |
2288 | addpart_sources, | |
2289 | include_directories : includes, | |
2290 | link_with : [lib_common], | |
2291 | install_dir : usrsbin_exec_dir, | |
2292 | install : opt, | |
2293 | build_by_default : opt) | |
2294 | exe2 = executable( | |
2295 | 'delpart', | |
2296 | delpart_sources, | |
2297 | include_directories : includes, | |
2298 | link_with : [lib_common], | |
2299 | install_dir : usrsbin_exec_dir, | |
2300 | install : opt, | |
2301 | build_by_default : opt) | |
2302 | exe3 = executable( | |
2303 | 'resizepart', | |
2304 | resizepart_sources, | |
2305 | include_directories : includes, | |
2306 | link_with : [lib_common], | |
2307 | install_dir : usrsbin_exec_dir, | |
2308 | install : opt, | |
2309 | build_by_default : opt) | |
2310 | exe4 = executable( | |
2311 | 'partx', | |
2312 | partx_sources, | |
2313 | include_directories : includes, | |
2314 | link_with : [lib_common, | |
2315 | lib_blkid, | |
2316 | lib_smartcols], | |
2317 | install_dir : usrsbin_exec_dir, | |
2318 | install : opt, | |
2319 | build_by_default : opt) | |
2320 | if opt | |
2321 | exes += [exe, exe2, exe3, exe4] | |
53b37016 KZ |
2322 | manadocs += ['disk-utils/addpart.8.adoc', |
2323 | 'disk-utils/delpart.8.adoc', | |
2324 | 'disk-utils/resizepart.8.adoc', | |
2325 | 'disk-utils/partx.8.adoc'] | |
38bb89ee | 2326 | bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx'] |
d4c880d5 ZJS |
2327 | endif |
2328 | ||
2329 | ############################################################ | |
2330 | ||
2331 | exe = executable( | |
2332 | 'script', | |
2333 | script_sources, | |
2334 | include_directories : includes, | |
2335 | link_with : [lib_common], | |
2336 | dependencies : [lib_util, | |
2337 | lib_utempter, | |
2338 | realtime_libs, | |
2339 | math_libs], | |
2340 | install_dir : usrbin_exec_dir, | |
2341 | install : true) | |
2342 | exes += exe | |
53b37016 | 2343 | manadocs += ['term-utils/script.1.adoc'] |
38bb89ee | 2344 | bashcompletions += ['script'] |
d4c880d5 ZJS |
2345 | |
2346 | exe = executable( | |
2347 | 'test_script', | |
2348 | script_sources, | |
2349 | include_directories : includes, | |
2350 | c_args : '-DTEST_SCRIPT', | |
2351 | link_with : [lib_common], | |
2352 | dependencies : [lib_util, | |
2353 | lib_utempter, | |
2354 | realtime_libs, | |
ba30b89c | 2355 | math_libs], |
2356 | build_by_default : program_tests) | |
d4c880d5 ZJS |
2357 | exes += exe |
2358 | ||
2359 | exe = executable( | |
2360 | 'scriptlive', | |
2361 | scriptlive_sources, | |
2362 | include_directories : includes, | |
2363 | link_with : [lib_common], | |
2364 | dependencies : [lib_util, | |
2365 | realtime_libs, | |
2366 | math_libs], | |
2367 | install_dir : usrbin_exec_dir, | |
2368 | install : true) | |
2369 | exes += exe | |
53b37016 | 2370 | manadocs += ['term-utils/scriptlive.1.adoc'] |
38bb89ee | 2371 | bashcompletions += ['scriptlive'] |
d4c880d5 ZJS |
2372 | |
2373 | exe = executable( | |
2374 | 'scriptreplay', | |
2375 | scriptreplay_sources, | |
2376 | include_directories : includes, | |
2377 | link_with : [lib_common], | |
2378 | dependencies : [math_libs], | |
2379 | install_dir : usrbin_exec_dir, | |
2380 | install : true) | |
2381 | exes += exe | |
53b37016 | 2382 | manadocs += ['term-utils/scriptreplay.1.adoc'] |
38bb89ee | 2383 | bashcompletions += ['scriptreplay'] |
d4c880d5 ZJS |
2384 | |
2385 | opt = not get_option('build-agetty').disabled() | |
2386 | exe = executable( | |
2387 | 'agetty', | |
2388 | agetty_sources, | |
2389 | include_directories : includes, | |
0333c40b | 2390 | link_with : [lib_common, logindefs_c], |
87fcd95a | 2391 | dependencies : [BSD ? lib_util : [], lib_systemd], |
d4c880d5 ZJS |
2392 | install_dir : sbindir, |
2393 | install : opt, | |
2394 | build_by_default : opt) | |
2395 | if opt | |
2396 | exes += exe | |
53b37016 | 2397 | manadocs += ['term-utils/agetty.8.adoc'] |
d4c880d5 ZJS |
2398 | endif |
2399 | ||
2400 | opt = not get_option('build-setterm').disabled() | |
2401 | exe = executable( | |
2402 | 'setterm', | |
2403 | setterm_sources, | |
2404 | include_directories : includes, | |
2405 | link_with : [lib_common], | |
2406 | dependencies : [curses_libs], | |
2407 | install_dir : usrbin_exec_dir, | |
2408 | install : opt, | |
2409 | build_by_default : opt) | |
2410 | if opt | |
2411 | exes += exe | |
53b37016 | 2412 | manadocs += ['term-utils/setterm.1.adoc'] |
38bb89ee | 2413 | bashcompletions += ['setterm'] |
d4c880d5 ZJS |
2414 | endif |
2415 | ||
2416 | opt = not get_option('build-mesg').disabled() | |
2417 | exe = executable( | |
2418 | 'mesg', | |
2419 | mesg_sources, | |
2420 | include_directories : includes, | |
2421 | link_with : [lib_common], | |
2422 | install_dir : usrbin_exec_dir, | |
2423 | install : opt, | |
2424 | build_by_default : opt) | |
2425 | if opt | |
2426 | exes += exe | |
53b37016 | 2427 | manadocs += ['term-utils/mesg.1.adoc'] |
38bb89ee | 2428 | bashcompletions += ['mesg'] |
d4c880d5 ZJS |
2429 | endif |
2430 | ||
2431 | opt = not get_option('build-wall').disabled() | |
2432 | exe = executable( | |
2433 | 'wall', | |
2434 | wall_sources, | |
2435 | include_directories : includes, | |
2436 | link_with : [lib_common], | |
87fcd95a | 2437 | dependencies : [lib_systemd], |
d4c880d5 | 2438 | install_dir : usrbin_exec_dir, |
07641fd9 | 2439 | install_mode : 'rwxr-sr-x', |
d4c880d5 ZJS |
2440 | install : opt, |
2441 | build_by_default : opt) | |
2442 | if opt | |
2443 | exes += exe | |
53b37016 | 2444 | manadocs += ['term-utils/wall.1.adoc'] |
38bb89ee | 2445 | bashcompletions += ['wall'] |
d4c880d5 ZJS |
2446 | endif |
2447 | ||
2448 | # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall | |
2449 | # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall | |
2450 | ||
2451 | opt = not get_option('build-write').disabled() | |
2452 | exe = executable( | |
2453 | 'write', | |
2454 | write_sources, | |
2455 | include_directories : includes, | |
2456 | link_with : [lib_common], | |
87fcd95a | 2457 | dependencies : [lib_systemd], |
d4c880d5 | 2458 | install_dir : usrbin_exec_dir, |
cee78467 | 2459 | install_mode : 'rwxr-sr-x', |
d4c880d5 ZJS |
2460 | install : opt, |
2461 | build_by_default : opt) | |
2462 | if opt | |
2463 | exes += exe | |
53b37016 | 2464 | manadocs += ['term-utils/write.1.adoc'] |
e1cd4002 | 2465 | bashcompletions += ['write'] |
d4c880d5 ZJS |
2466 | endif |
2467 | ||
2468 | # chgrp tty $(DESTDIR)$(usrbin_execdir)/write | |
2469 | # chmod g+s $(DESTDIR)$(usrbin_execdir)/write | |
2470 | ||
2471 | opt = not get_option('build-login').disabled() | |
2472 | exe = executable( | |
2473 | 'login', | |
2474 | login_sources, | |
2475 | include_directories : includes, | |
0333c40b | 2476 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
2477 | dependencies : [lib_pam, |
2478 | lib_audit, | |
2479 | lib_selinux], | |
2480 | install : opt, | |
2481 | build_by_default : opt) | |
2482 | if not is_disabler(exe) | |
2483 | exes += exe | |
53b37016 | 2484 | manadocs += ['login-utils/login.1.adoc'] |
d4c880d5 ZJS |
2485 | endif |
2486 | ||
2487 | opt = not get_option('build-sulogin').disabled() | |
2488 | exe = executable( | |
2489 | 'sulogin', | |
2490 | sulogin_sources, | |
2491 | include_directories : includes, | |
2492 | link_with : [lib_common], | |
2493 | dependencies : [lib_crypt, | |
2494 | lib_selinux], | |
2495 | install_dir : sbindir, | |
2496 | install : opt, | |
2497 | build_by_default : opt) | |
2498 | if not is_disabler(exe) | |
2499 | exes += exe | |
53b37016 | 2500 | manadocs += ['login-utils/sulogin.8.adoc'] |
d4c880d5 ZJS |
2501 | endif |
2502 | ||
2503 | exe = executable( | |
2504 | 'cal', | |
2505 | cal_sources, | |
2506 | include_directories : includes, | |
2507 | link_with : [lib_common, | |
2508 | lib_tcolors], | |
2509 | dependencies : [curses_libs], | |
2510 | install_dir : usrbin_exec_dir, | |
2511 | install : true) | |
2512 | exes += exe | |
53b37016 | 2513 | manadocs += ['misc-utils/cal.1.adoc'] |
38bb89ee | 2514 | bashcompletions += ['cal'] |
d4c880d5 ZJS |
2515 | |
2516 | opt = not get_option('build-logger').disabled() | |
2517 | exe = executable( | |
2518 | 'logger', | |
2519 | logger_sources, | |
2520 | include_directories : includes, | |
dbb9999f | 2521 | link_with : [lib_common], |
d4c880d5 ZJS |
2522 | dependencies : [lib_systemd], |
2523 | install_dir : usrbin_exec_dir, | |
2524 | install : opt, | |
2525 | build_by_default : opt) | |
2526 | if opt and not is_disabler(exe) | |
2527 | exes += exe | |
53b37016 | 2528 | manadocs += ['misc-utils/logger.1.adoc'] |
38bb89ee | 2529 | bashcompletions += ['logger'] |
d4c880d5 ZJS |
2530 | endif |
2531 | ||
2532 | exe = executable( | |
2533 | 'test_logger', | |
2534 | logger_sources, | |
2535 | include_directories : includes, | |
2536 | c_args : '-DTEST_LOGGER', | |
dbb9999f | 2537 | link_with : [lib_common], |
ba30b89c | 2538 | dependencies : [lib_systemd], |
2539 | build_by_default: program_tests) | |
d4c880d5 ZJS |
2540 | if not is_disabler(exe) |
2541 | exes += exe | |
2542 | endif | |
2543 | ||
2544 | exe = executable( | |
2545 | 'look', | |
2546 | look_sources, | |
2547 | include_directories : includes, | |
2548 | install_dir : usrbin_exec_dir, | |
2549 | install : true) | |
2550 | exes += exe | |
53b37016 | 2551 | manadocs += ['misc-utils/look.1.adoc'] |
38bb89ee | 2552 | bashcompletions += ['look'] |
d4c880d5 ZJS |
2553 | |
2554 | exe = executable( | |
2555 | 'mcookie', | |
2556 | mcookie_sources, | |
2557 | include_directories : includes, | |
2558 | link_with : [lib_common], | |
2559 | install_dir : usrbin_exec_dir, | |
2560 | install : true) | |
2561 | exes += exe | |
53b37016 | 2562 | manadocs += ['misc-utils/mcookie.1.adoc'] |
38bb89ee | 2563 | bashcompletions += ['mcookie'] |
d4c880d5 ZJS |
2564 | |
2565 | exe = executable( | |
2566 | 'namei', | |
2567 | namei_sources, | |
2568 | include_directories : includes, | |
c07f7b4e | 2569 | dependencies : [lib_selinux], |
d4c880d5 ZJS |
2570 | install_dir : usrbin_exec_dir, |
2571 | install : true) | |
2572 | exes += exe | |
53b37016 | 2573 | manadocs += ['misc-utils/namei.1.adoc'] |
38bb89ee | 2574 | bashcompletions += ['namei'] |
d4c880d5 ZJS |
2575 | |
2576 | exe = executable( | |
2577 | 'whereis', | |
2578 | whereis_sources, | |
2579 | include_directories : includes, | |
2580 | link_with : [lib_common], | |
2581 | install_dir : usrbin_exec_dir, | |
2582 | install : true) | |
2583 | exes += exe | |
53b37016 | 2584 | manadocs += ['misc-utils/whereis.1.adoc'] |
38bb89ee | 2585 | bashcompletions += ['whereis'] |
d4c880d5 ZJS |
2586 | |
2587 | exe = executable( | |
2588 | 'lslocks', | |
2589 | lslocks_sources, | |
2590 | include_directories : includes, | |
2591 | link_with : [lib_common, | |
2592 | lib_mount, | |
2593 | lib_smartcols], | |
2594 | install_dir : usrbin_exec_dir, | |
2595 | install : true) | |
2596 | if not is_disabler(exe) | |
2597 | exes += exe | |
53b37016 | 2598 | manadocs += ['misc-utils/lslocks.8.adoc'] |
38bb89ee | 2599 | bashcompletions += ['lslocks'] |
d4c880d5 ZJS |
2600 | endif |
2601 | ||
2602 | exe = executable( | |
2603 | 'lsblk', | |
2604 | lsblk_sources, | |
2605 | include_directories : includes, | |
2606 | link_with : [lib_common, | |
2607 | lib_blkid, | |
2608 | lib_mount, | |
2609 | lib_smartcols], | |
2610 | dependencies : lib_udev, | |
2611 | install : true) | |
2612 | if not is_disabler(exe) | |
2613 | exes += exe | |
53b37016 | 2614 | manadocs += ['misc-utils/lsblk.8.adoc'] |
38bb89ee | 2615 | bashcompletions += ['lsblk'] |
d4c880d5 ZJS |
2616 | endif |
2617 | ||
ee194909 KZ |
2618 | exe = executable( |
2619 | 'lsfd', | |
2620 | lsfd_sources, | |
2621 | include_directories : includes, | |
2622 | link_with : [lib_common, | |
2623 | lib_smartcols], | |
2624 | install_dir : usrbin_exec_dir, | |
2625 | install : true) | |
2626 | if not is_disabler(exe) | |
2627 | exes += exe | |
2628 | manadocs += ['misc-utils/lsfd.1.adoc'] | |
2629 | endif | |
2630 | ||
d4c880d5 ZJS |
2631 | exe = executable( |
2632 | 'uuidgen', | |
2633 | uuidgen_sources, | |
2634 | include_directories : includes, | |
06d3a851 KZ |
2635 | link_with : [lib_common, |
2636 | lib_uuid], | |
d4c880d5 ZJS |
2637 | install_dir : usrbin_exec_dir, |
2638 | install : true) | |
2639 | if not is_disabler(exe) | |
2640 | exes += exe | |
53b37016 | 2641 | manadocs += ['misc-utils/uuidgen.1.adoc'] |
38bb89ee | 2642 | bashcompletions += ['uuidgen'] |
d4c880d5 ZJS |
2643 | endif |
2644 | ||
2645 | exe = executable( | |
2646 | 'uuidparse', | |
2647 | uuidparse_sources, | |
2648 | include_directories : includes, | |
2649 | link_with : [lib_common, | |
2650 | lib_uuid, | |
2651 | lib_smartcols], | |
2652 | install_dir : usrbin_exec_dir, | |
2653 | install : true) | |
2654 | if not is_disabler(exe) | |
2655 | exes += exe | |
53b37016 | 2656 | manadocs += ['misc-utils/uuidparse.1.adoc'] |
38bb89ee | 2657 | bashcompletions += ['uuidparse'] |
d4c880d5 ZJS |
2658 | endif |
2659 | ||
2660 | opt = build_uuidd | |
2661 | exe = executable( | |
2662 | 'uuidd', | |
2663 | uuidd_sources, | |
2664 | include_directories : includes, | |
2665 | link_with : [lib_common, | |
2666 | lib_uuid], | |
2667 | dependencies : [realtime_libs, | |
2668 | lib_systemd], | |
2669 | install_dir : usrsbin_exec_dir, | |
2670 | install : opt, | |
2671 | build_by_default : opt) | |
2672 | exe2 = executable( | |
2673 | 'test_uuidd', | |
2674 | test_uuidd_sources, | |
2675 | include_directories : includes, | |
2676 | link_with : [lib_common, | |
2677 | lib_uuid], | |
2678 | dependencies : thread_libs, | |
ba30b89c | 2679 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
2680 | if not is_disabler(exe) |
2681 | exes += [exe, exe2] | |
53b37016 | 2682 | manadocs += ['misc-utils/uuidd.8.adoc'] |
38bb89ee | 2683 | bashcompletions += ['uuidd'] |
d4c880d5 ZJS |
2684 | endif |
2685 | ||
2686 | opt = build_libblkid | |
2687 | exe = executable( | |
2688 | 'blkid', | |
2689 | blkid_sources, | |
2690 | include_directories : includes, | |
2691 | link_with : [lib_common, | |
2692 | lib_blkid], | |
2693 | install_dir : sbindir, | |
2694 | install : opt, | |
2695 | build_by_default : opt) | |
2696 | if opt and not is_disabler(exe) | |
2697 | exes += exe | |
53b37016 | 2698 | manadocs += ['misc-utils/blkid.8.adoc'] |
38bb89ee | 2699 | bashcompletions += ['blkid'] |
d4c880d5 ZJS |
2700 | endif |
2701 | ||
69939195 ZJS |
2702 | opt = opt and 'blkid' in static_programs |
2703 | exe = executable( | |
2704 | 'blkid.static', | |
2705 | blkid_sources, | |
2706 | include_directories : includes, | |
2707 | link_with : [lib_common, | |
2708 | lib_blkid_static], | |
2709 | install_dir : sbindir, | |
2710 | install : opt, | |
2711 | build_by_default : opt) | |
2712 | if opt and not is_disabler(exe) | |
2713 | exes += exe | |
2714 | endif | |
d4c880d5 ZJS |
2715 | |
2716 | exe = executable( | |
2717 | 'sample-mkfs', | |
2718 | 'libblkid/samples/mkfs.c', | |
2719 | include_directories : includes, | |
2720 | link_with : lib_blkid) | |
2721 | if not is_disabler(exe) | |
2722 | exes += exe | |
2723 | endif | |
2724 | ||
2725 | exe = executable( | |
2726 | 'sample-partitions', | |
2727 | 'libblkid/samples/partitions.c', | |
2728 | include_directories : includes, | |
2729 | link_with : lib_blkid) | |
2730 | if not is_disabler(exe) | |
2731 | exes += exe | |
2732 | endif | |
2733 | ||
2734 | exe = executable( | |
2735 | 'sample-superblocks', | |
2736 | 'libblkid/samples/superblocks.c', | |
2737 | include_directories : includes, | |
2738 | link_with : lib_blkid) | |
2739 | if not is_disabler(exe) | |
2740 | exes += exe | |
2741 | endif | |
2742 | ||
2743 | exe = executable( | |
2744 | 'sample-topology', | |
2745 | 'libblkid/samples/topology.c', | |
2746 | include_directories : includes, | |
2747 | link_with : lib_blkid) | |
2748 | if not is_disabler(exe) | |
2749 | exes += exe | |
2750 | endif | |
2751 | ||
97e673a0 TW |
2752 | exe = executable( |
2753 | 'test_blkid_fuzz_sample', | |
2754 | 'libblkid/src/fuzz.c', | |
2755 | include_directories: includes, | |
ba30b89c | 2756 | link_with: lib_blkid, |
2757 | build_by_default: program_tests) | |
97e673a0 TW |
2758 | if not is_disabler(exe) |
2759 | exes += exe | |
2760 | endif | |
2761 | ||
d4c880d5 ZJS |
2762 | ############################################################ |
2763 | ||
2764 | exe = executable( | |
2765 | 'findfs', | |
2766 | findfs_sources, | |
2767 | include_directories : includes, | |
2768 | link_with : [lib_blkid], | |
2769 | install_dir : sbindir, | |
2770 | install : true) | |
2771 | if not is_disabler(exe) | |
2772 | exes += exe | |
53b37016 | 2773 | manadocs += ['misc-utils/findfs.8.adoc'] |
38bb89ee | 2774 | bashcompletions += ['findfs'] |
d4c880d5 ZJS |
2775 | endif |
2776 | ||
2777 | exe = executable( | |
2778 | 'wipefs', | |
2779 | wipefs_sources, | |
2780 | include_directories : includes, | |
2781 | link_with : [lib_common, | |
2782 | lib_blkid, | |
2783 | lib_smartcols], | |
2784 | install_dir : sbindir, | |
2785 | install : true) | |
2786 | if not is_disabler(exe) | |
2787 | exes += exe | |
53b37016 | 2788 | manadocs += ['misc-utils/wipefs.8.adoc'] |
38bb89ee | 2789 | bashcompletions += ['wipefs'] |
d4c880d5 ZJS |
2790 | endif |
2791 | ||
2792 | exe = executable( | |
2793 | 'findmnt', | |
2794 | findmnt_sources, | |
2795 | include_directories : includes, | |
2796 | link_with : [lib_common, | |
2797 | lib_blkid, | |
2798 | lib_mount, | |
2799 | lib_smartcols], | |
2800 | dependencies : [lib_udev], | |
2801 | install : true) | |
2802 | if not is_disabler(exe) | |
2803 | exes += exe | |
53b37016 | 2804 | manadocs += ['misc-utils/findmnt.8.adoc'] |
38bb89ee | 2805 | bashcompletions += ['findmnt'] |
d4c880d5 ZJS |
2806 | endif |
2807 | ||
2808 | exe = executable( | |
2809 | 'kill', | |
2810 | kill_sources, | |
2811 | include_directories : includes, | |
2812 | link_with : [lib_common], | |
2813 | install : true) | |
2814 | if not is_disabler(exe) | |
2815 | exes += exe | |
53b37016 | 2816 | manadocs += ['misc-utils/kill.1.adoc'] |
d4c880d5 ZJS |
2817 | endif |
2818 | ||
2819 | opt = not get_option('build-rename').disabled() | |
2820 | exe = executable( | |
2821 | 'rename', | |
2822 | rename_sources, | |
2823 | include_directories : includes, | |
2824 | install_dir : usrbin_exec_dir, | |
2825 | install : opt, | |
2826 | build_by_default : opt) | |
2827 | if opt and not is_disabler(exe) | |
2828 | exes += exe | |
53b37016 | 2829 | manadocs += ['misc-utils/rename.1.adoc'] |
38bb89ee | 2830 | bashcompletions += ['rename'] |
d4c880d5 ZJS |
2831 | endif |
2832 | ||
2833 | exe = executable( | |
2834 | 'getopt', | |
2835 | getopt_sources, | |
2836 | include_directories : includes, | |
308a0979 | 2837 | link_with : [lib_common], |
d4c880d5 ZJS |
2838 | install_dir : usrbin_exec_dir, |
2839 | install : true) | |
2840 | exes += exe | |
53b37016 | 2841 | manadocs += ['misc-utils/getopt.1.adoc'] |
38bb89ee | 2842 | bashcompletions += ['getopt'] |
d4c880d5 ZJS |
2843 | |
2844 | exe = executable( | |
2845 | 'fincore', | |
2846 | fincore_sources, | |
2847 | include_directories : includes, | |
2848 | link_with : [lib_common, | |
2849 | lib_smartcols], | |
2850 | install_dir : usrbin_exec_dir, | |
2851 | install : true) | |
2852 | if not is_disabler(exe) | |
2853 | exes += exe | |
53b37016 | 2854 | manadocs += ['misc-utils/fincore.1.adoc'] |
38bb89ee | 2855 | bashcompletions += ['fincore'] |
d4c880d5 ZJS |
2856 | endif |
2857 | ||
2858 | exe = executable( | |
2859 | 'hardlink', | |
2860 | hardlink_sources, | |
2861 | include_directories : includes, | |
2862 | link_with : [lib_common], | |
d4c880d5 ZJS |
2863 | install_dir : usrbin_exec_dir, |
2864 | install : true) | |
2865 | if not is_disabler(exe) | |
2866 | exes += exe | |
53b37016 | 2867 | manadocs += ['misc-utils/hardlink.1.adoc'] |
38bb89ee | 2868 | bashcompletions += ['hardlink'] |
d4c880d5 ZJS |
2869 | endif |
2870 | ||
c221578e NS |
2871 | opt = not get_option('build-pipesz').disabled() |
2872 | exe = executable( | |
2873 | 'pipesz', | |
2874 | pipesz_sources, | |
2875 | include_directories : includes, | |
2876 | link_with : [lib_common], | |
2877 | install_dir : usrbin_exec_dir, | |
2878 | install : true) | |
2879 | if opt and not is_disabler(exe) | |
2880 | exes += exe | |
62c27bd0 | 2881 | manadocs += ['misc-utils/pipesz.1.adoc'] |
80af57ed | 2882 | bashcompletions += ['pipesz'] |
c221578e NS |
2883 | endif |
2884 | ||
d4c880d5 ZJS |
2885 | exe = executable( |
2886 | 'test_cal', | |
2887 | cal_sources, | |
2888 | include_directories : includes, | |
2889 | c_args : '-DTEST_CAL', | |
2890 | link_with : [lib_common, | |
2891 | lib_tcolors], | |
ba30b89c | 2892 | dependencies : [curses_libs], |
2893 | build_by_default: program_tests) | |
d4c880d5 ZJS |
2894 | if not is_disabler(exe) |
2895 | exes += exe | |
2896 | endif | |
2897 | ||
64bc8ab5 MY |
2898 | exe = executable( |
2899 | 'fadvise', | |
2900 | fadvise_sources, | |
2901 | include_directories : includes, | |
2902 | link_with : [lib_common], | |
2903 | install_dir : usrbin_exec_dir, | |
2904 | install : true) | |
2905 | if not is_disabler(exe) | |
2906 | exes += exe | |
2907 | manadocs += ['misc-utils/fadvise.1.adoc'] | |
2908 | bashcompletions += ['fadvise'] | |
2909 | endif | |
2910 | ||
334939a1 ZJS |
2911 | if LINUX and conf.get('HAVE_PIDFD_OPEN') != false |
2912 | exe = executable( | |
2913 | 'waitpid', | |
2914 | waitpid_sources, | |
2915 | include_directories : includes, | |
2916 | link_with : [lib_common], | |
2917 | install_dir : usrbin_exec_dir, | |
2918 | install : true) | |
2919 | if not is_disabler(exe) | |
2920 | exes += exe | |
2921 | manadocs += ['misc-utils/waitpid.1.adoc'] | |
2922 | bashcompletions += ['waitpid'] | |
2923 | endif | |
550d32c4 TW |
2924 | endif |
2925 | ||
69e542bd TW |
2926 | syscalls_h = custom_target('syscalls.h', |
2927 | input : 'tools/all_syscalls', | |
2928 | output : 'syscalls.h', | |
922d025a | 2929 | command : ['tools/all_syscalls', cc.cmd_array()] |
69e542bd TW |
2930 | ) |
2931 | ||
3e0bbb12 TW |
2932 | if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE') |
2933 | exe = executable( | |
2934 | 'enosys', | |
2935 | 'misc-utils/enosys.c', syscalls_h, | |
2936 | include_directories : includes, | |
2937 | link_with : [lib_common], | |
2938 | install_dir : usrbin_exec_dir, | |
2939 | install : true) | |
2940 | if not is_disabler(exe) | |
2941 | exes += exe | |
2942 | manadocs += ['misc-utils/enosys.1.adoc'] | |
2943 | bashcompletions += ['enosys'] | |
2944 | endif | |
cba52cc1 TW |
2945 | endif |
2946 | ||
e9ddea79 TW |
2947 | exe = executable( |
2948 | 'lsclocks', | |
2949 | lsclocks_sources, | |
2950 | include_directories : includes, | |
2951 | link_with : [lib_common, lib_smartcols], | |
2952 | install_dir : usrbin_exec_dir, | |
2953 | install : true) | |
2954 | if not is_disabler(exe) | |
2955 | exes += exe | |
2956 | manadocs += ['misc-utils/lsclocks.1.adoc'] | |
2957 | bashcompletions += ['lsclocks'] | |
2958 | endif | |
2959 | ||
d4c880d5 ZJS |
2960 | ############################################################ |
2961 | ||
2962 | opt = not get_option('build-schedutils').disabled() | |
2963 | exe = executable( | |
2964 | 'chrt', | |
2965 | 'schedutils/chrt.c', | |
2966 | include_directories : includes, | |
2967 | link_with : lib_common, | |
2968 | install_dir : usrbin_exec_dir, | |
2969 | install : opt, | |
2970 | build_by_default : opt) | |
2971 | ||
2972 | exe2 = executable( | |
2973 | 'ionice', | |
2974 | 'schedutils/ionice.c', | |
2975 | include_directories : includes, | |
2976 | link_with : lib_common, | |
2977 | install_dir : usrbin_exec_dir, | |
2978 | install : opt, | |
2979 | build_by_default : opt) | |
2980 | ||
2981 | exe3 = executable( | |
2982 | 'taskset', | |
2983 | 'schedutils/taskset.c', | |
2984 | include_directories : includes, | |
2985 | link_with : lib_common, | |
2986 | install_dir : usrbin_exec_dir, | |
2987 | install : opt, | |
2988 | build_by_default : opt) | |
2989 | ||
6e92db54 KZ |
2990 | exe4 = executable( |
2991 | 'uclampset', | |
2992 | 'schedutils/uclampset.c', | |
2993 | include_directories : includes, | |
2994 | link_with : lib_common, | |
2995 | install_dir : usrbin_exec_dir, | |
2996 | install : opt, | |
2997 | build_by_default : opt) | |
2998 | ||
d4c880d5 | 2999 | if opt and not is_disabler(exe) |
6e92db54 | 3000 | exes += [exe, exe2, exe3, exe4] |
53b37016 KZ |
3001 | manadocs += ['schedutils/chrt.1.adoc', |
3002 | 'schedutils/ionice.1.adoc', | |
3003 | 'schedutils/taskset.1.adoc', | |
3004 | 'schedutils/uclampset.1.adoc'] | |
38bb89ee | 3005 | bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset'] |
d4c880d5 ZJS |
3006 | endif |
3007 | ||
3008 | ############################################################ | |
3009 | ||
3010 | # TODO: when autotools compat is not needed, s/_/-/g in file names? | |
3011 | ||
3012 | exe = executable( | |
3013 | 'test_ttyutils', | |
3014 | 'lib/ttyutils.c', | |
3015 | c_args : ['-DTEST_PROGRAM_TTYUTILS'], | |
3016 | include_directories : dir_include, | |
ba30b89c | 3017 | link_with : lib_common, |
3018 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3019 | exes += exe |
3020 | ||
3021 | exe = executable( | |
3022 | 'test_blkdev', | |
3023 | 'lib/blkdev.c', | |
3024 | c_args : ['-DTEST_PROGRAM_BLKDEV'], | |
3025 | include_directories : dir_include, | |
ba30b89c | 3026 | link_with : lib_common, |
3027 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3028 | exes += exe |
3029 | ||
3030 | exe = executable( | |
3031 | 'test_ismounted', | |
3032 | 'lib/ismounted.c', | |
3033 | c_args : ['-DTEST_PROGRAM_ISMOUNTED'], | |
3034 | include_directories : dir_include, | |
ba30b89c | 3035 | link_with : lib_common, |
3036 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3037 | exes += exe |
3038 | ||
3039 | exe = executable( | |
3040 | 'test_mangle', | |
3041 | 'lib/mangle.c', | |
3042 | c_args : ['-DTEST_PROGRAM_MANGLE'], | |
ba30b89c | 3043 | include_directories : dir_include, |
3044 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3045 | exes += exe |
3046 | ||
3047 | exe = executable( | |
3048 | 'test_strutils', | |
3049 | 'lib/strutils.c', | |
3050 | c_args : ['-DTEST_PROGRAM_STRUTILS'], | |
ba30b89c | 3051 | include_directories : dir_include, |
3052 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3053 | exes += exe |
3054 | ||
3055 | exe = executable( | |
3056 | 'test_colors', | |
3057 | 'lib/colors.c', | |
3058 | 'lib/color-names.c', | |
3059 | c_args : ['-DTEST_PROGRAM_COLORS'], | |
3060 | include_directories : dir_include, | |
ba30b89c | 3061 | link_with : [lib_common, lib_tcolors], |
3062 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3063 | exes += exe |
3064 | ||
3065 | exe = executable( | |
3066 | 'test_randutils', | |
3067 | 'lib/randutils.c', | |
3068 | c_args : ['-DTEST_PROGRAM_RANDUTILS'], | |
ba30b89c | 3069 | include_directories : dir_include, |
3070 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3071 | exes += exe |
3072 | ||
d6418774 ZJS |
3073 | if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false |
3074 | exe = executable( | |
3075 | 'test_procfs', | |
3076 | 'lib/procfs.c', | |
3077 | c_args : ['-DTEST_PROGRAM_PROCFS'], | |
3078 | include_directories : dir_include, | |
ba30b89c | 3079 | link_with : lib_common, |
3080 | build_by_default: program_tests) | |
d6418774 | 3081 | exes += exe |
d4c880d5 | 3082 | |
d6418774 ZJS |
3083 | exe = executable( |
3084 | 'test_path', | |
3085 | 'lib/path.c', | |
3086 | 'lib/fileutils.c', | |
3087 | have_cpu_set_t ? 'lib/cpuset.c' : [], | |
3088 | c_args : ['-DTEST_PROGRAM_PATH'], | |
3089 | include_directories : dir_include, | |
ba30b89c | 3090 | link_with : lib_common, |
3091 | build_by_default: program_tests) | |
d6418774 ZJS |
3092 | exes += exe |
3093 | endif | |
d4c880d5 | 3094 | |
44475360 ZJS |
3095 | if conf.get('HAVE_PTY') != false |
3096 | exe = executable( | |
3097 | 'test_pty', | |
3098 | pty_session_c, | |
3099 | monotonic_c, | |
3100 | c_args : ['-DTEST_PROGRAM_PTY'], | |
3101 | include_directories : dir_include, | |
3102 | link_with : [lib_common], | |
3103 | dependencies : [lib_m, | |
3104 | realtime_libs, | |
ba30b89c | 3105 | lib_util], |
3106 | build_by_default: program_tests) | |
44475360 ZJS |
3107 | exes += exe |
3108 | endif | |
d4c880d5 | 3109 | |
d6418774 ZJS |
3110 | if LINUX |
3111 | exe = executable( | |
3112 | 'test_cpuset', | |
3113 | 'lib/cpuset.c', | |
3114 | c_args : ['-DTEST_PROGRAM_CPUSET'], | |
ba30b89c | 3115 | include_directories : dir_include, |
3116 | build_by_default: program_tests) | |
d6418774 ZJS |
3117 | exes += exe |
3118 | endif | |
d4c880d5 ZJS |
3119 | |
3120 | exe = executable( | |
3121 | 'test_sysfs', | |
3122 | 'lib/sysfs.c', | |
3123 | 'lib/path.c', | |
35d26ae8 | 3124 | 'lib/buffer.c', |
fb8493fd | 3125 | 'lib/mbsalign.c', |
d4c880d5 ZJS |
3126 | 'lib/fileutils.c', |
3127 | have_cpu_set_t ? 'lib/cpuset.c' : [], | |
3128 | c_args : ['-DTEST_PROGRAM_SYSFS'], | |
ba30b89c | 3129 | include_directories : dir_include, |
3130 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3131 | exes += exe |
3132 | ||
3133 | exe = executable( | |
3134 | 'test_pager', | |
3135 | 'lib/pager.c', | |
3136 | c_args : ['-DTEST_PROGRAM_PAGER'], | |
ba30b89c | 3137 | include_directories : dir_include, |
3138 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3139 | exes += exe |
3140 | ||
3141 | exe = executable( | |
3142 | 'test_linux_version', | |
3143 | 'lib/linux_version.c', | |
3144 | c_args : ['-DTEST_PROGRAM_LINUXVERSION'], | |
ba30b89c | 3145 | include_directories : dir_include, |
3146 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3147 | exes += exe |
3148 | ||
3149 | exe = executable( | |
3150 | 'test_fileutils', | |
3151 | 'lib/fileutils.c', | |
3152 | c_args : ['-DTEST_PROGRAM_FILEUTILS'], | |
ba30b89c | 3153 | include_directories : dir_include, |
3154 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3155 | exes += exe |
3156 | ||
3157 | exe = executable( | |
3158 | 'test_canonicalize', | |
3159 | 'lib/canonicalize.c', | |
3160 | c_args : ['-DTEST_PROGRAM_CANONICALIZE'], | |
ba30b89c | 3161 | include_directories : dir_include, |
3162 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3163 | exes += exe |
3164 | ||
3165 | exe = executable( | |
3166 | 'test_timeutils', | |
3167 | 'lib/timeutils.c', | |
3168 | 'lib/strutils.c', | |
3169 | c_args : ['-DTEST_PROGRAM_TIMEUTILS'], | |
ba30b89c | 3170 | include_directories : dir_include, |
3171 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3172 | exes += exe |
3173 | ||
3174 | exe = executable( | |
3175 | 'test_pwdutils', | |
3176 | 'lib/pwdutils.c', | |
3177 | c_args : ['-DTEST_PROGRAM'], | |
3178 | include_directories : dir_include, | |
ba30b89c | 3179 | link_with : lib_common, |
3180 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3181 | exes += exe |
3182 | ||
866d922b KZ |
3183 | exe = executable( |
3184 | 'test_logindefs', | |
3185 | 'lib/logindefs.c', | |
3186 | c_args : ['-DTEST_PROGRAM'], | |
3187 | include_directories : dir_include, | |
ba30b89c | 3188 | link_with : [lib_common, logindefs_c], |
3189 | build_by_default: program_tests) | |
866d922b KZ |
3190 | exes += exe |
3191 | ||
3192 | ||
d4c880d5 ZJS |
3193 | ############################################################ |
3194 | ||
3195 | exe = executable( | |
3196 | 'test_uuid_parser', | |
3197 | 'libuuid/src/test_uuid.c', | |
3198 | include_directories : [dir_include, dir_libuuid], | |
3199 | link_with : lib_uuid, | |
ba30b89c | 3200 | dependencies : socket_libs, |
3201 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3202 | if not is_disabler(exe) |
3203 | exes += exe | |
3204 | endif | |
3205 | ||
3206 | ############################################################ | |
3207 | ||
3208 | libfdisk_tests_cflags = ['-DTEST_PROGRAM', | |
3209 | '-Wno-unused'] | |
69939195 | 3210 | libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid] |
d4c880d5 ZJS |
3211 | |
3212 | exe = executable( | |
3213 | 'test_fdisk_ask', | |
3214 | 'libfdisk/src/ask.c', | |
3215 | c_args : libfdisk_tests_cflags, | |
3216 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3217 | link_with : libfdisk_tests_ldadd, |
3218 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3219 | if not is_disabler(exe) |
3220 | exes += exe | |
3221 | endif | |
3222 | ||
3223 | exe = executable( | |
3224 | 'test_fdisk_gpt', | |
3225 | 'libfdisk/src/gpt.c', | |
3226 | c_args : libfdisk_tests_cflags, | |
3227 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3228 | link_with : libfdisk_tests_ldadd, |
3229 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3230 | if not is_disabler(exe) |
3231 | exes += exe | |
3232 | endif | |
3233 | ||
3234 | exe = executable( | |
3235 | 'test_fdisk_utils', | |
3236 | 'libfdisk/src/utils.c', | |
3237 | c_args : libfdisk_tests_cflags, | |
3238 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3239 | link_with : libfdisk_tests_ldadd, |
3240 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3241 | if not is_disabler(exe) |
3242 | exes += exe | |
3243 | endif | |
3244 | ||
3245 | exe = executable( | |
3246 | 'test_fdisk_script', | |
3247 | 'libfdisk/src/script.c', | |
3248 | c_args : libfdisk_tests_cflags, | |
3249 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3250 | link_with : libfdisk_tests_ldadd, |
3251 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3252 | if not is_disabler(exe) |
3253 | exes += exe | |
3254 | endif | |
3255 | ||
3256 | exe = executable( | |
3257 | 'test_fdisk_version', | |
3258 | 'libfdisk/src/version.c', | |
3259 | c_args : libfdisk_tests_cflags, | |
3260 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3261 | link_with : libfdisk_tests_ldadd, |
3262 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3263 | if not is_disabler(exe) |
3264 | exes += exe | |
3265 | endif | |
3266 | ||
3267 | exe = executable( | |
3268 | 'test_fdisk_item', | |
3269 | 'libfdisk/src/item.c', | |
3270 | c_args : libfdisk_tests_cflags, | |
3271 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3272 | link_with : libfdisk_tests_ldadd, |
3273 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3274 | if not is_disabler(exe) |
3275 | exes += exe | |
3276 | endif | |
3277 | ||
3278 | sample_fdisk_cflags = ['-Wno-unused'] | |
3279 | sample_fdisk_ldadd = [lib_common, lib_fdisk] | |
3280 | ||
3281 | exe = executable( | |
3282 | 'sample-fdisk-mkpart', | |
3283 | 'libfdisk/samples/mkpart.c', | |
3284 | c_args : sample_fdisk_cflags, | |
3285 | include_directories : lib_fdisk_includes, | |
3286 | link_with : sample_fdisk_ldadd) | |
3287 | if not is_disabler(exe) | |
3288 | exes += exe | |
3289 | endif | |
3290 | ||
3291 | exe = executable( | |
3292 | 'sample-fdisk-mkpart-fullspec', | |
3293 | 'libfdisk/samples/mkpart-fullspec.c', | |
3294 | c_args : sample_fdisk_cflags, | |
3295 | include_directories : lib_fdisk_includes, | |
3296 | link_with : sample_fdisk_ldadd) | |
3297 | if not is_disabler(exe) | |
3298 | exes += exe | |
3299 | endif | |
3300 | ||
3301 | ############################################################ | |
3302 | ||
3303 | exe = executable( | |
3304 | 'test_mbsencode', | |
3305 | 'tests/helpers/test_mbsencode.c', | |
3306 | include_directories : includes, | |
ba30b89c | 3307 | link_with : lib_common, |
3308 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3309 | exes += exe |
3310 | ||
3311 | exe = executable( | |
3312 | 'test_byteswap', | |
3313 | 'tests/helpers/test_byteswap.c', | |
ba30b89c | 3314 | include_directories : includes, |
3315 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3316 | exes += exe |
3317 | ||
3318 | exe = executable( | |
3319 | 'test_md5', | |
3320 | 'tests/helpers/test_md5.c', | |
3321 | md5_c, | |
ba30b89c | 3322 | include_directories : includes, |
3323 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3324 | exes += exe |
3325 | ||
3326 | exe = executable( | |
3327 | 'test_sha1', | |
3328 | 'tests/helpers/test_sha1.c', | |
3329 | sha1_c, | |
ba30b89c | 3330 | include_directories : includes, |
3331 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3332 | exes += exe |
3333 | ||
3334 | exe = executable( | |
3335 | 'test_pathnames', | |
3336 | 'tests/helpers/test_pathnames.c', | |
ba30b89c | 3337 | include_directories : includes, |
3338 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3339 | exes += exe |
3340 | ||
3341 | exe = executable( | |
3342 | 'test_strerror', | |
3343 | 'tests/helpers/test_strerror.c', | |
ba30b89c | 3344 | include_directories : includes, |
3345 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3346 | exes += exe |
3347 | ||
3348 | exe = executable( | |
3349 | 'test_sysinfo', | |
3350 | 'tests/helpers/test_sysinfo.c', | |
ba30b89c | 3351 | include_directories : includes, |
3352 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3353 | exes += exe |
3354 | ||
3355 | exe = executable( | |
3356 | 'test_sigreceive', | |
3357 | 'tests/helpers/test_sigreceive.c', | |
3358 | include_directories : includes, | |
ba30b89c | 3359 | link_with : lib_common, |
3360 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3361 | exes += exe |
3362 | ||
3363 | exe = executable( | |
3364 | 'test_tiocsti', | |
3365 | 'tests/helpers/test_tiocsti.c', | |
ba30b89c | 3366 | include_directories : includes, |
3367 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3368 | exes += exe |
3369 | ||
3370 | exe = executable( | |
3371 | 'test_uuid_namespace', | |
3372 | 'tests/helpers/test_uuid_namespace.c', | |
3373 | predefined_c, | |
3374 | unpack_c, | |
3375 | unparse_c, | |
ba30b89c | 3376 | include_directories : includes, |
3377 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3378 | exes += exe |
3379 | ||
330555c4 MY |
3380 | mq_libs = [] |
3381 | mq_libs += cc.find_library('rt', required : true) | |
d6418774 ZJS |
3382 | |
3383 | if LINUX | |
3384 | exe = executable( | |
3385 | 'test_mkfds', | |
3386 | 'tests/helpers/test_mkfds.c', | |
3387 | include_directories : includes, | |
ba30b89c | 3388 | dependencies : mq_libs, |
3389 | build_by_default: program_tests) | |
d6418774 ZJS |
3390 | exes += exe |
3391 | endif | |
f7b41ef8 | 3392 | |
42900563 TW |
3393 | exe = executable( |
3394 | 'test_enosys', | |
3395 | 'tests/helpers/test_enosys.c', | |
ba30b89c | 3396 | include_directories : includes, |
3397 | build_by_default: program_tests) | |
42900563 TW |
3398 | exes += exe |
3399 | ||
d4c880d5 ZJS |
3400 | ############################################################ |
3401 | ||
d6418774 ZJS |
3402 | if conf.get('HAVE_OPENAT') != false |
3403 | exe = executable( | |
3404 | 'sample-scols-tree', | |
3405 | 'libsmartcols/samples/tree.c', | |
3406 | include_directories : includes, | |
ba30b89c | 3407 | link_with : [lib_smartcols, lib_common], |
3408 | build_by_default: program_tests) | |
d6418774 ZJS |
3409 | if not is_disabler(exe) |
3410 | exes += exe | |
3411 | endif | |
d4c880d5 ZJS |
3412 | endif |
3413 | ||
3414 | exe = executable( | |
3415 | 'sample-scols-title', | |
3416 | 'libsmartcols/samples/title.c', | |
3417 | include_directories : includes, | |
3418 | link_with : [lib_smartcols, lib_common]) | |
3419 | if not is_disabler(exe) | |
3420 | exes += exe | |
3421 | endif | |
3422 | ||
3423 | exe = executable( | |
3424 | 'sample-scols-wrap', | |
3425 | 'libsmartcols/samples/wrap.c', | |
3426 | include_directories : includes, | |
3427 | link_with : [lib_smartcols, lib_common]) | |
3428 | if not is_disabler(exe) | |
3429 | exes += exe | |
3430 | endif | |
3431 | ||
3432 | exe = executable( | |
3433 | 'sample-scols-continuous', | |
3434 | 'libsmartcols/samples/continuous.c', | |
3435 | include_directories : includes, | |
3436 | link_with : [lib_smartcols, lib_common]) | |
3437 | if not is_disabler(exe) | |
3438 | exes += exe | |
3439 | endif | |
3440 | ||
3441 | exe = executable( | |
3442 | 'sample-scols-maxout', | |
3443 | 'libsmartcols/samples/maxout.c', | |
3444 | include_directories : includes, | |
3445 | link_with : [lib_smartcols, lib_common]) | |
3446 | if not is_disabler(exe) | |
3447 | exes += exe | |
3448 | endif | |
3449 | ||
3450 | exe = executable( | |
3451 | 'sample-scols-fromfile', | |
3452 | 'libsmartcols/samples/fromfile.c', | |
3453 | include_directories : includes, | |
3454 | link_with : [lib_smartcols, lib_common]) | |
3455 | if not is_disabler(exe) | |
3456 | exes += exe | |
3457 | endif | |
3458 | ||
3459 | exe = executable( | |
3460 | 'sample-scols-grouping-simple', | |
3461 | 'libsmartcols/samples/grouping-simple.c', | |
3462 | include_directories : includes, | |
3463 | link_with : [lib_smartcols, lib_common]) | |
3464 | if not is_disabler(exe) | |
3465 | exes += exe | |
3466 | endif | |
3467 | ||
3468 | exe = executable( | |
3469 | 'sample-scols-grouping-overlay', | |
3470 | 'libsmartcols/samples/grouping-overlay.c', | |
3471 | include_directories : includes, | |
3472 | link_with : [lib_smartcols, lib_common]) | |
3473 | if not is_disabler(exe) | |
3474 | exes += exe | |
3475 | endif | |
3476 | ||
3477 | ############################################################ | |
3478 | ||
3479 | # Let the test runner know whether we're running under asan and export | |
3480 | # some paths. We use a file on disk so that it is possible to run the | |
3481 | # test scripts from commandline without setting any variables. | |
3482 | configure_file(output : 'meson.conf', | |
3483 | capture : true, | |
3484 | command : ['echo', | |
3485 | '''asan=@0@ | |
3486 | PYTHON=@1@ | |
3487 | '''.format(get_option('b_sanitize')=='address' ? 'yes' : '', | |
e2cd7446 | 3488 | python.full_path())]) |
d4c880d5 ZJS |
3489 | |
3490 | run_sh = find_program('tests/run.sh') | |
3491 | run_target( | |
3492 | 'check', | |
3493 | command : [run_sh, | |
3494 | '--srcdir=' + meson.current_source_dir(), | |
3495 | '--builddir=' + meson.current_build_dir(), | |
3496 | '--parallel', | |
3497 | '--nonroot'], | |
3498 | depends : exes) | |
53b37016 KZ |
3499 | |
3500 | ||
3501 | manadocs += ['lib/terminal-colors.d.5.adoc'] | |
3502 | manadocs += ['libblkid/libblkid.3.adoc'] | |
3503 | ||
3504 | if build_libuuid | |
3505 | manadocs += [ | |
3506 | 'libuuid/man/uuid.3.adoc', | |
3507 | 'libuuid/man/uuid_clear.3.adoc', | |
3508 | 'libuuid/man/uuid_compare.3.adoc', | |
3509 | 'libuuid/man/uuid_copy.3.adoc', | |
3510 | 'libuuid/man/uuid_generate.3.adoc', | |
3511 | 'libuuid/man/uuid_is_null.3.adoc', | |
3512 | 'libuuid/man/uuid_parse.3.adoc', | |
3513 | 'libuuid/man/uuid_time.3.adoc', | |
3514 | 'libuuid/man/uuid_unparse.3.adoc'] | |
38bb89ee TW |
3515 | manlinks += { |
3516 | 'uuid_generate_random.3': 'uuid_generate.3', | |
3517 | 'uuid_generate_time.3': 'uuid_generate.3', | |
3518 | 'uuid_generate_time_safe.3': 'uuid_generate.3', | |
3519 | } | |
53b37016 KZ |
3520 | endif |
3521 | ||
00b8a51f | 3522 | asciidoctor = find_program('asciidoctor', required : false) |
53b37016 KZ |
3523 | if asciidoctor.found() |
3524 | foreach adoc : manadocs | |
3525 | name = adoc.split('/')[-1] | |
3526 | page = name.split('.adoc')[0] | |
3527 | section = page.split('.')[-1] | |
3528 | mandirn = join_paths(mandir, 'man' + section) | |
3529 | input = adoc | |
3530 | ||
3531 | custom_target( | |
3532 | page, | |
3533 | command : [ asciidoctor, | |
3534 | '-b', 'manpage', | |
3535 | '-a', 'VERSION=' + meson.project_version(), | |
38bb89ee | 3536 | '-a', 'release-version=' + meson.project_version(), |
53b37016 | 3537 | '-a', 'ADJTIME_PATH=/etc/adjtime', |
38bb89ee | 3538 | '-a', 'package-docdir=' + docdir, |
53b37016 KZ |
3539 | '--base-dir=' + meson.current_source_dir(), |
3540 | '--destination-dir=' + meson.current_build_dir(), | |
adcab835 TW |
3541 | '--load-path', '@SOURCE_ROOT@/tools', |
3542 | '--require', 'asciidoctor-includetracker', | |
53b37016 KZ |
3543 | '@INPUT@'], |
3544 | input : input, | |
3545 | output : [page], | |
adcab835 | 3546 | depfile : page + '.deps', |
53b37016 KZ |
3547 | install: true, |
3548 | install_dir : mandirn) | |
3549 | endforeach | |
38bb89ee TW |
3550 | |
3551 | foreach link_name, target : manlinks | |
3552 | link_section = link_name.split('.')[-1] | |
3553 | target_section = target.split('.')[-1] | |
3554 | meson.add_install_script(meson_make_manpage_stub, | |
3555 | join_paths('man' + target_section, target), | |
3556 | join_paths(mandir, 'man' + link_section, link_name)) | |
3557 | endforeach | |
3558 | endif | |
3559 | ||
3560 | if bash_completion.found() | |
3561 | foreach completion : bashcompletions | |
3562 | install_data( | |
3563 | join_paths('bash-completion', completion), | |
caa85688 | 3564 | install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir') |
38bb89ee TW |
3565 | ) |
3566 | endforeach | |
aa519054 KZ |
3567 | foreach link_name, target : bashcompletionslinks |
3568 | meson.add_install_script(meson_make_symlink, | |
3569 | target, | |
caa85688 | 3570 | join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name)) |
aa519054 | 3571 | endforeach |
53b37016 | 3572 | endif |