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