From bab8c072fd6303408ab2908ad8150e532e04c0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 7 Apr 2017 11:24:46 -0400 Subject: [PATCH 01/82] gitignore: ignore all build* subdirs in main directory Now that meson builds require a separate build dir, everybody's bound to have at least one. So let's accept the convention that build*/ is for builds, and apply a blanket ignore rule, we shouldn't have any important files named build* in the main directory. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 01cb6e7db7..7cbf0a9e0c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ /TAGS /ata_id /bootctl -/build-aux +/build* /busctl /cdrom_id /collect From 521e7c3aea7cfc478380acb9857beb938855f00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 22 Apr 2017 18:49:49 -0400 Subject: [PATCH 02/82] journal/fsprg: set -Wno-pointer-arithm only for that file Both gcc and clang issue a host of warnings about void pointers used in arithmetic. The warning must be ignored in that file to avoid multiple warnings. Makefile.am used to set this for all libsystemd-journal-internal.a sources, because there's no finer granularity for warnings. Let's just set it for this one file. --- Makefile.am | 4 +--- src/journal/fsprg.c | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4ba230569a..e362060326 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4556,10 +4556,8 @@ libsystemd_journal_internal_la_SOURCES += \ libsystemd_journal_internal_la_LIBADD += \ $(GCRYPT_LIBS) -# fsprg.c is a drop-in file using void pointer arithmetic libsystemd_journal_internal_la_CFLAGS += \ - $(GCRYPT_CFLAGS) \ - -Wno-pointer-arith + $(GCRYPT_CFLAGS) endif noinst_LTLIBRARIES += \ diff --git a/src/journal/fsprg.c b/src/journal/fsprg.c index 612b10f3a9..e7c22880be 100644 --- a/src/journal/fsprg.c +++ b/src/journal/fsprg.c @@ -40,6 +40,9 @@ #define RND_GEN_Q 0x02 #define RND_GEN_X 0x03 +#pragma GCC diagnostic ignored "-Wpointer-arith" +/* TODO: remove void* arithmetic and this work-around */ + /******************************************************************************/ static void mpi_export(void *buf, size_t buflen, const gcry_mpi_t x) { From 5c23128daba7236a6080383b2a5649033cfef85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 4 Apr 2017 23:03:47 -0400 Subject: [PATCH 03/82] meson: build systemd using meson It's crucial that we can build systemd using VS2010! ... er, wait, no, that's not the official reason. We need to shed old systems by requring python 3! Oh, no, it's something else. Maybe we need to throw out 345 years of knowlege accumulated in autotools? Whatever, this new thing is cool and shiny, let's use it. This is not complete, I'm throwing it out here for your amusement and critique. - rules for sd-boot are missing. Those might be quite complicated. - rules for tests are missing too. Those are probably quite simple and repetitive, but there's lots of them. - it's likely that I didn't get all the conditions right, I only tested "full" compilation where most deps are provided and nothing is disabled. - busname.target and all .busname units are skipped on purpose. Otherwise, installation into $DESTDIR has the same list of files and the autoconf install, except for .la files. It'd be great if people had a careful look at all the library linking options. I added stuff until things compiled, and in the end there's much less linking then in the old system. But it seems that there's still a lot of unnecessary deps. meson has a `shared_module` statement, which sounds like something appropriate for our nss and pam modules. Unfortunately, I couldn't get it to work. For the nss modules, we need an .so version of '2', but `shared_module` disallows the version argument. For the pam module, it also didn't work, I forgot the reason. The handling of .m4 and .in and .m4.in files is rather awkward. It's likely that this could be simplified. If make support is ever dropped, I think it'd make sense to switch to a different templating system so that two different languages and not required, which would make everything simpler yet. v2: - use get_pkgconfig_variable - use sh not bash - use add_project_arguments v3: - drop required:true and fix progs/prog typo v4: - use find_library('bz2') - add TTY_GID definition - define __SANE_USERSPACE_TYPES__ - use join_paths(prefix, ...) is used on all paths to make them all absolute v5: - replace all declare_dependency's with [] - add more conf.get guards around optional components v6: - drop -pipe, -Wall which are the default in meson - use compiler.has_function() and compiler.has_header_symbol instead of the hand-rolled checks. - fix duplication in 'liblibsystemd' library name - use the right .sym file for pam_systemd - rename 'compiler' to 'cc': shorter, and more idiomatic. v7: - use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D - rename prefix to prefixdir, rootprefix to rootprefixdir ("prefix" is too common of a name and too easy to overwrite by mistake) - wrap more stuff with conf.get('ENABLE...') == 1 - use rootprefix=='/' and rootbindir as install_dir, to fix paths under split-usr==true. v8: - use .split() also for src/coredump. Now everything is consistent ;) - add rootlibdir option and use it on the libraries that require it v9: - indentation v10: - fix check for qrencode and libaudit v11: - unify handling of executable paths, provide options for all progs This makes the meson build behave slightly differently than the autoconf-based one, because we always first try to find the executable in the filesystem, and fall back to the default. I think different handling of loadkeys, setfont, and telinit was just a historical accident. In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs. In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin), but in Debian, those directories are not included in the path. C.f. https://github.com/mesonbuild/meson/issues/1576. - call all the options 'xxx-path' for clarity. - sort man/rules/meson.build properly so it's stable --- catalog/meson.build | 29 + docs/sysvinit/meson.build | 8 + docs/var-log/meson.build | 8 + hwdb/meson.build | 25 + man/meson.build | 109 ++ man/rules/meson.build | 763 ++++++++++ meson.build | 1857 +++++++++++++++++++++++ meson_options.txt | 191 +++ network/meson.build | 9 + po/meson.build | 14 + rules/meson.build | 40 + shell-completion/bash/meson.build | 52 + shell-completion/zsh/meson.build | 49 + src/analyze/meson.build | 7 + src/basic/af-to-name.awk | 5 + src/basic/arphrd-to-name.awk | 5 + src/basic/cap-to-name.awk | 5 + src/basic/errno-to-name.awk | 4 + src/basic/generate-af-list.sh | 5 + src/basic/generate-arphrd-list.sh | 5 + src/basic/generate-cap-list.sh | 5 + src/basic/generate-errno-list.sh | 4 + src/basic/generate-gperfs.py | 16 + src/basic/meson.build | 283 ++++ src/core/load-fragment-gperf-nulstr.awk | 12 + src/core/meson.build | 222 +++ src/coredump/meson.build | 17 + src/hostname/meson.build | 16 + src/import/meson.build | 70 + src/journal-remote/meson.build | 45 + src/journal/audit_type-to-name.awk | 5 + src/journal/generate-audit_type-list.sh | 10 + src/journal/meson.build | 104 ++ src/kernel-install/meson.build | 10 + src/libsystemd-network/meson.build | 48 + src/libsystemd/meson.build | 98 ++ src/libudev/meson.build | 47 + src/locale/meson.build | 28 + src/login/meson.build | 106 ++ src/machine/meson.build | 39 + src/network/meson.build | 111 ++ src/nspawn/meson.build | 33 + src/resolve/dns_type-to-name.awk | 7 + src/resolve/generate-dns_type-gperf.py | 18 + src/resolve/generate-dns_type-list.sed | 1 + src/resolve/meson.build | 145 ++ src/shared/meson.build | 154 ++ src/systemd/meson.build | 33 + src/timedate/meson.build | 16 + src/timesync/meson.build | 28 + src/udev/generate-keyboard-keys-list.sh | 4 + src/udev/meson.build | 164 ++ src/vconsole/meson.build | 10 + sysctl.d/meson.build | 20 + sysusers.d/meson.build | 33 + tmpfiles.d/meson.build | 39 + units/meson.build | 221 +++ units/user/meson.build | 36 + 58 files changed, 5448 insertions(+) create mode 100644 catalog/meson.build create mode 100644 docs/sysvinit/meson.build create mode 100644 docs/var-log/meson.build create mode 100644 hwdb/meson.build create mode 100644 man/meson.build create mode 100644 man/rules/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 network/meson.build create mode 100644 po/meson.build create mode 100644 rules/meson.build create mode 100644 shell-completion/bash/meson.build create mode 100644 shell-completion/zsh/meson.build create mode 100644 src/analyze/meson.build create mode 100644 src/basic/af-to-name.awk create mode 100644 src/basic/arphrd-to-name.awk create mode 100644 src/basic/cap-to-name.awk create mode 100644 src/basic/errno-to-name.awk create mode 100644 src/basic/generate-af-list.sh create mode 100644 src/basic/generate-arphrd-list.sh create mode 100644 src/basic/generate-cap-list.sh create mode 100644 src/basic/generate-errno-list.sh create mode 100644 src/basic/generate-gperfs.py create mode 100644 src/basic/meson.build create mode 100644 src/core/load-fragment-gperf-nulstr.awk create mode 100644 src/core/meson.build create mode 100644 src/coredump/meson.build create mode 100644 src/hostname/meson.build create mode 100644 src/import/meson.build create mode 100644 src/journal-remote/meson.build create mode 100644 src/journal/audit_type-to-name.awk create mode 100644 src/journal/generate-audit_type-list.sh create mode 100644 src/journal/meson.build create mode 100644 src/kernel-install/meson.build create mode 100644 src/libsystemd-network/meson.build create mode 100644 src/libsystemd/meson.build create mode 100644 src/libudev/meson.build create mode 100644 src/locale/meson.build create mode 100644 src/login/meson.build create mode 100644 src/machine/meson.build create mode 100644 src/network/meson.build create mode 100644 src/nspawn/meson.build create mode 100644 src/resolve/dns_type-to-name.awk create mode 100644 src/resolve/generate-dns_type-gperf.py create mode 100644 src/resolve/generate-dns_type-list.sed create mode 100644 src/resolve/meson.build create mode 100644 src/shared/meson.build create mode 100644 src/systemd/meson.build create mode 100644 src/timedate/meson.build create mode 100644 src/timesync/meson.build create mode 100644 src/udev/generate-keyboard-keys-list.sh create mode 100644 src/udev/meson.build create mode 100644 src/vconsole/meson.build create mode 100644 sysctl.d/meson.build create mode 100644 sysusers.d/meson.build create mode 100644 tmpfiles.d/meson.build create mode 100644 units/meson.build create mode 100644 units/user/meson.build diff --git a/catalog/meson.build b/catalog/meson.build new file mode 100644 index 0000000000..b50792ee2e --- /dev/null +++ b/catalog/meson.build @@ -0,0 +1,29 @@ +# -*- mode: meson -*- + +in_files = ''' + systemd.bg.catalog + systemd.be.catalog + systemd.be@latin.catalog + systemd.fr.catalog + systemd.it.catalog + systemd.pl.catalog + systemd.pt_BR.catalog + systemd.ru.catalog + systemd.zh_CN.catalog + systemd.zh_TW.catalog + systemd.catalog +'''.split() + +support_url = get_option('support-url') +support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url) + +foreach file : in_files + custom_target( + file, + input : file + '.in', + output: file, + command : [sed, support_sed, '@INPUT@'], + capture : true, + install : true, + install_dir : catalogdir) +endforeach diff --git a/docs/sysvinit/meson.build b/docs/sysvinit/meson.build new file mode 100644 index 0000000000..a519f74cee --- /dev/null +++ b/docs/sysvinit/meson.build @@ -0,0 +1,8 @@ +# -*- mode: meson -*- + +file = configure_file( + input : 'README.in', + output : 'README', + configuration : substs) +install_data(file, + install_dir : sysvinit_path) diff --git a/docs/var-log/meson.build b/docs/var-log/meson.build new file mode 100644 index 0000000000..c3d0cdbf82 --- /dev/null +++ b/docs/var-log/meson.build @@ -0,0 +1,8 @@ +# -*- mode: meson -*- + +file = configure_file( + input : 'README.in', + output : 'README', + configuration : substs) +install_data(file, + install_dir : varlogdir) diff --git a/hwdb/meson.build b/hwdb/meson.build new file mode 100644 index 0000000000..4c13a2e7a9 --- /dev/null +++ b/hwdb/meson.build @@ -0,0 +1,25 @@ +# -*- mode: meson -*- + +hwdb_files = files(''' + 20-pci-vendor-model.hwdb + 20-pci-classes.hwdb + 20-usb-vendor-model.hwdb + 20-usb-classes.hwdb + 20-sdio-vendor-model.hwdb + 20-sdio-classes.hwdb + 20-bluetooth-vendor-product.hwdb + 20-acpi-vendor.hwdb + 20-OUI.hwdb + 20-net-ifname.hwdb + 60-evdev.hwdb + 60-keyboard.hwdb + 60-sensor.hwdb + 70-mouse.hwdb + 70-pointingstick.hwdb + 70-touchpad.hwdb +'''.split()) + +if conf.get('ENABLE_HWDB', 0) == 1 + install_data(hwdb_files, + install_dir : udevhwdbdir) +endif diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 0000000000..0f0bbd6ffc --- /dev/null +++ b/man/meson.build @@ -0,0 +1,109 @@ +# -*- mode: meson -*- + +# This is lame, I know, but meson has no other include mechanism +subdir('rules') + +# TODO: add regeneration rule: +# python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build + +xsltproc = find_program('xsltproc') +xsltproc_flags = [ + '--nonet', + '--xinclude', + '--stringparam', 'man.output.quietly', '1', + '--stringparam', 'funcsynopsis.style', 'ansi', + '--stringparam', 'man.authors.section.enabled', '0', + '--stringparam', 'man.copyright.section.enabled', '0', + '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()), + '--path', + '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())] + +custom_man_xsl = files('custom-man.xsl') +custom_html_xsl = files('custom-man.xsl') +custom_entities_ent = files('custom-entities.ent') + +foreach tuple : manpages + stem = tuple[0] + section = tuple[1] + aliases = tuple[2] + condition = tuple[3] + + xml = stem + '.xml' + html = stem + '.html' + man = stem + '.' + section + + manaliases = [] + htmlaliases = [] + foreach alias : aliases + manaliases += [alias + '.' + section] + htmlaliases += [alias + '.html'] + endforeach + + mandirn = get_option('mandir') + '/man' + section + + install = condition == '' or conf.get(condition, 0) == 1 + + custom_target( + man, + input : xml, + output : [man] + manaliases, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], + install : install, + install_dir : mandirn) + + custom_target( + html, + input : xml, + output : [html] + htmlaliases, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@']) + + if not install + message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, install)) + endif +endforeach + +############################################################ + +source_xml_files = files() +foreach tuple : manpages + source_xml_files += files(tuple[0] + '.xml') +endforeach + +systemd_directives_xml = custom_target( + 'systemd.directives.xml', + input : source_xml_files, + output : 'systemd.directives.xml', + command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files) + +nonindex_xml_files = source_xml_files + [systemd_directives_xml] +systemd_index_xml = custom_target( + 'systemd.index.xml', + input : nonindex_xml_files, + output : 'systemd.index.xml', + command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files) + +foreach tuple : [['systemd.directives', '7', systemd_directives_xml], + ['systemd.index', '7', systemd_index_xml]] + stem = tuple[0] + section = tuple[1] + xml = tuple[2] + + html = stem + '.html' + man = stem + '.' + section + + mandirn = get_option('mandir') + '/man' + section + + custom_target( + man, + input : xml, + output : man, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], + install : install, + install_dir : mandirn) + + custom_target( + html, + input : xml, + output : html, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@']) +endforeach diff --git a/man/rules/meson.build b/man/rules/meson.build new file mode 100644 index 0000000000..00a1413325 --- /dev/null +++ b/man/rules/meson.build @@ -0,0 +1,763 @@ +# Do not edit. Generated by make-man-rules.py. +manpages = [ +['binfmt.d', '5', [], 'ENABLE_BINFMT'], + ['bootctl', '1', [], 'ENABLE_EFI'], + ['bootup', '7', [], ''], + ['busctl', '1', [], ''], + ['coredump.conf', '5', ['coredump.conf.d'], 'ENABLE_COREDUMP'], + ['coredumpctl', '1', [], 'ENABLE_COREDUMP'], + ['crypttab', '5', [], 'HAVE_LIBCRYPTSETUP'], + ['daemon', '7', [], ''], + ['dnssec-trust-anchors.d', + '5', + ['systemd.negative', 'systemd.positive'], + 'ENABLE_RESOLVED'], + ['environment.d', '5', [], ''], + ['file-hierarchy', '7', [], ''], + ['halt', '8', ['poweroff', 'reboot'], ''], + ['hostname', '5', [], ''], + ['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'], + ['hwdb', '7', [], 'ENABLE_HWDB'], + ['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'], + ['journal-upload.conf', '5', ['journal-upload.conf.d'], 'HAVE_MICROHTTPD'], + ['journalctl', '1', [], ''], + ['journald.conf', '5', ['journald.conf.d'], ''], + ['kernel-command-line', '7', [], ''], + ['kernel-install', '8', [], ''], + ['libudev', '3', [], ''], + ['locale.conf', '5', [], ''], + ['localectl', '1', [], 'ENABLE_LOCALED'], + ['localtime', '5', [], ''], + ['loginctl', '1', [], 'ENABLE_LOGIND'], + ['logind.conf', '5', ['logind.conf.d'], 'ENABLE_LOGIND'], + ['machine-id', '5', [], ''], + ['machine-info', '5', [], ''], + ['machinectl', '1', [], 'ENABLE_MACHINED'], + ['modules-load.d', '5', [], 'HAVE_KMOD'], + ['networkctl', '1', [], 'ENABLE_NETWORKD'], + ['networkd.conf', '5', ['networkd.conf.d'], 'ENABLE_NETWORKD'], + ['nss-myhostname', '8', ['libnss_myhostname.so.2'], 'HAVE_MYHOSTNAME'], + ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_MACHINED'], + ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_RESOLVED'], + ['nss-systemd', '8', ['libnss_systemd.so.2'], ''], + ['os-release', '5', [], ''], + ['pam_systemd', '8', [], 'HAVE_PAM'], + ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVED'], + ['runlevel', '8', [], 'HAVE_UTMP'], + ['sd-bus-errors', + '3', + ['SD_BUS_ERROR_ACCESS_DENIED', + 'SD_BUS_ERROR_ADDRESS_IN_USE', + 'SD_BUS_ERROR_AUTH_FAILED', + 'SD_BUS_ERROR_BAD_ADDRESS', + 'SD_BUS_ERROR_DISCONNECTED', + 'SD_BUS_ERROR_FAILED', + 'SD_BUS_ERROR_FILE_EXISTS', + 'SD_BUS_ERROR_FILE_NOT_FOUND', + 'SD_BUS_ERROR_INCONSISTENT_MESSAGE', + 'SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED', + 'SD_BUS_ERROR_INVALID_ARGS', + 'SD_BUS_ERROR_INVALID_SIGNATURE', + 'SD_BUS_ERROR_IO_ERROR', + 'SD_BUS_ERROR_LIMITS_EXCEEDED', + 'SD_BUS_ERROR_MATCH_RULE_INVALID', + 'SD_BUS_ERROR_MATCH_RULE_NOT_FOUND', + 'SD_BUS_ERROR_NAME_HAS_NO_OWNER', + 'SD_BUS_ERROR_NOT_SUPPORTED', + 'SD_BUS_ERROR_NO_MEMORY', + 'SD_BUS_ERROR_NO_NETWORK', + 'SD_BUS_ERROR_NO_REPLY', + 'SD_BUS_ERROR_NO_SERVER', + 'SD_BUS_ERROR_PROPERTY_READ_ONLY', + 'SD_BUS_ERROR_SERVICE_UNKNOWN', + 'SD_BUS_ERROR_TIMEOUT', + 'SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN', + 'SD_BUS_ERROR_UNKNOWN_INTERFACE', + 'SD_BUS_ERROR_UNKNOWN_METHOD', + 'SD_BUS_ERROR_UNKNOWN_OBJECT', + 'SD_BUS_ERROR_UNKNOWN_PROPERTY'], + ''], + ['sd-bus', '3', [], ''], + ['sd-daemon', + '3', + ['SD_ALERT', + 'SD_CRIT', + 'SD_DEBUG', + 'SD_EMERG', + 'SD_ERR', + 'SD_INFO', + 'SD_NOTICE', + 'SD_WARNING'], + ''], + ['sd-event', '3', [], ''], + ['sd-id128', + '3', + ['SD_ID128_CONST_STR', + 'SD_ID128_FORMAT_STR', + 'SD_ID128_FORMAT_VAL', + 'SD_ID128_MAKE', + 'SD_ID128_MAKE_STR', + 'SD_ID128_NULL', + 'sd_id128_equal', + 'sd_id128_is_null', + 'sd_id128_t'], + ''], + ['sd-journal', '3', [], ''], + ['sd-login', '3', [], 'HAVE_PAM'], + ['sd_booted', '3', [], ''], + ['sd_bus_add_match', '3', [], ''], + ['sd_bus_creds_get_pid', + '3', + ['sd_bus_creds_get_audit_login_uid', + 'sd_bus_creds_get_audit_session_id', + 'sd_bus_creds_get_cgroup', + 'sd_bus_creds_get_cmdline', + 'sd_bus_creds_get_comm', + 'sd_bus_creds_get_description', + 'sd_bus_creds_get_egid', + 'sd_bus_creds_get_euid', + 'sd_bus_creds_get_exe', + 'sd_bus_creds_get_fsgid', + 'sd_bus_creds_get_fsuid', + 'sd_bus_creds_get_gid', + 'sd_bus_creds_get_owner_uid', + 'sd_bus_creds_get_ppid', + 'sd_bus_creds_get_selinux_context', + 'sd_bus_creds_get_session', + 'sd_bus_creds_get_sgid', + 'sd_bus_creds_get_slice', + 'sd_bus_creds_get_suid', + 'sd_bus_creds_get_supplementary_gids', + 'sd_bus_creds_get_tid', + 'sd_bus_creds_get_tid_comm', + 'sd_bus_creds_get_tty', + 'sd_bus_creds_get_uid', + 'sd_bus_creds_get_unique_name', + 'sd_bus_creds_get_unit', + 'sd_bus_creds_get_user_slice', + 'sd_bus_creds_get_user_unit', + 'sd_bus_creds_get_well_known_names', + 'sd_bus_creds_has_bounding_cap', + 'sd_bus_creds_has_effective_cap', + 'sd_bus_creds_has_inheritable_cap', + 'sd_bus_creds_has_permitted_cap'], + ''], + ['sd_bus_creds_new_from_pid', + '3', + ['sd_bus_creds_get_augmented_mask', + 'sd_bus_creds_get_mask', + 'sd_bus_creds_ref', + 'sd_bus_creds_unref', + 'sd_bus_creds_unrefp'], + ''], + ['sd_bus_default', + '3', + ['sd_bus_default_system', + 'sd_bus_default_user', + 'sd_bus_open', + 'sd_bus_open_system', + 'sd_bus_open_system_machine', + 'sd_bus_open_system_remote', + 'sd_bus_open_user'], + ''], + ['sd_bus_error', + '3', + ['SD_BUS_ERROR_MAKE_CONST', + 'SD_BUS_ERROR_NULL', + 'sd_bus_error_copy', + 'sd_bus_error_free', + 'sd_bus_error_get_errno', + 'sd_bus_error_has_name', + 'sd_bus_error_is_set', + 'sd_bus_error_set', + 'sd_bus_error_set_const', + 'sd_bus_error_set_errno', + 'sd_bus_error_set_errnof', + 'sd_bus_error_set_errnofv', + 'sd_bus_error_setf'], + ''], + ['sd_bus_error_add_map', + '3', + ['SD_BUS_ERROR_END', 'SD_BUS_ERROR_MAP', 'sd_bus_error_map'], + ''], + ['sd_bus_get_fd', '3', [], ''], + ['sd_bus_message_append', '3', [], ''], + ['sd_bus_message_append_array', + '3', + ['sd_bus_message_append_array_iovec', + 'sd_bus_message_append_array_memfd', + 'sd_bus_message_append_array_space'], + ''], + ['sd_bus_message_append_basic', '3', [], ''], + ['sd_bus_message_append_string_memfd', + '3', + ['sd_bus_message_append_string_iovec', 'sd_bus_message_append_string_space'], + ''], + ['sd_bus_message_append_strv', '3', [], ''], + ['sd_bus_message_get_cookie', '3', ['sd_bus_message_get_reply_cookie'], ''], + ['sd_bus_message_get_monotonic_usec', + '3', + ['sd_bus_message_get_realtime_usec', 'sd_bus_message_get_seqnum'], + ''], + ['sd_bus_message_read_basic', '3', [], ''], + ['sd_bus_negotiate_fds', + '3', + ['sd_bus_negotiate_creds', 'sd_bus_negotiate_timestamp'], + ''], + ['sd_bus_new', '3', ['sd_bus_ref', 'sd_bus_unref', 'sd_bus_unrefp'], ''], + ['sd_bus_path_encode', + '3', + ['sd_bus_path_decode', 'sd_bus_path_decode_many', 'sd_bus_path_encode_many'], + ''], + ['sd_bus_process', '3', [], ''], + ['sd_bus_request_name', '3', ['sd_bus_release_name'], ''], + ['sd_bus_track_add_name', + '3', + ['sd_bus_track_add_sender', + 'sd_bus_track_contains', + 'sd_bus_track_count', + 'sd_bus_track_count_name', + 'sd_bus_track_count_sender', + 'sd_bus_track_first', + 'sd_bus_track_next', + 'sd_bus_track_remove_name', + 'sd_bus_track_remove_sender'], + ''], + ['sd_bus_track_new', + '3', + ['sd_bus_track_get_bus', + 'sd_bus_track_get_recursive', + 'sd_bus_track_get_userdata', + 'sd_bus_track_ref', + 'sd_bus_track_set_recursive', + 'sd_bus_track_set_userdata', + 'sd_bus_track_unref', + 'sd_bus_track_unrefp'], + ''], + ['sd_event_add_child', + '3', + ['sd_event_child_handler_t', 'sd_event_source_get_child_pid'], + ''], + ['sd_event_add_defer', + '3', + ['sd_event_add_exit', 'sd_event_add_post', 'sd_event_handler_t'], + ''], + ['sd_event_add_io', + '3', + ['sd_event_io_handler_t', + 'sd_event_source', + 'sd_event_source_get_io_events', + 'sd_event_source_get_io_fd', + 'sd_event_source_get_io_revents', + 'sd_event_source_set_io_events', + 'sd_event_source_set_io_fd'], + ''], + ['sd_event_add_signal', + '3', + ['sd_event_signal_handler_t', 'sd_event_source_get_signal'], + ''], + ['sd_event_add_time', + '3', + ['sd_event_source_get_time', + 'sd_event_source_get_time_accuracy', + 'sd_event_source_get_time_clock', + 'sd_event_source_set_time', + 'sd_event_source_set_time_accuracy', + 'sd_event_time_handler_t'], + ''], + ['sd_event_exit', '3', ['sd_event_get_exit_code'], ''], + ['sd_event_get_fd', '3', [], ''], + ['sd_event_new', + '3', + ['sd_event', + 'sd_event_default', + 'sd_event_get_tid', + 'sd_event_ref', + 'sd_event_unref', + 'sd_event_unrefp'], + ''], + ['sd_event_now', '3', [], ''], + ['sd_event_run', '3', ['sd_event_loop'], ''], + ['sd_event_set_watchdog', '3', ['sd_event_get_watchdog'], ''], + ['sd_event_source_get_event', '3', [], ''], + ['sd_event_source_get_pending', '3', [], ''], + ['sd_event_source_set_description', + '3', + ['sd_event_source_get_description'], + ''], + ['sd_event_source_set_enabled', + '3', + ['SD_EVENT_OFF', + 'SD_EVENT_ON', + 'SD_EVENT_ONESHOT', + 'sd_event_source_get_enabled'], + ''], + ['sd_event_source_set_prepare', '3', [], ''], + ['sd_event_source_set_priority', + '3', + ['SD_EVENT_PRIORITY_IDLE', + 'SD_EVENT_PRIORITY_IMPORTANT', + 'SD_EVENT_PRIORITY_NORMAL', + 'sd_event_source_get_priority'], + ''], + ['sd_event_source_set_userdata', '3', ['sd_event_source_get_userdata'], ''], + ['sd_event_source_unref', + '3', + ['sd_event_source_ref', 'sd_event_source_unrefp'], + ''], + ['sd_event_wait', + '3', + ['SD_EVENT_ARMED', + 'SD_EVENT_EXITING', + 'SD_EVENT_FINISHED', + 'SD_EVENT_INITIAL', + 'SD_EVENT_PENDING', + 'SD_EVENT_PREPARING', + 'SD_EVENT_RUNNING', + 'sd_event_dispatch', + 'sd_event_get_iteration', + 'sd_event_get_state', + 'sd_event_prepare'], + ''], + ['sd_get_seats', + '3', + ['sd_get_machine_names', 'sd_get_sessions', 'sd_get_uids'], + 'HAVE_PAM'], + ['sd_id128_get_machine', + '3', + ['sd_id128_get_boot', + 'sd_id128_get_invocation', + 'sd_id128_get_machine_app_specific'], + ''], + ['sd_id128_randomize', '3', [], ''], + ['sd_id128_to_string', '3', ['sd_id128_from_string'], ''], + ['sd_is_fifo', + '3', + ['sd_is_mq', + 'sd_is_socket', + 'sd_is_socket_inet', + 'sd_is_socket_sockaddr', + 'sd_is_socket_unix', + 'sd_is_special'], + ''], + ['sd_journal_add_match', + '3', + ['sd_journal_add_conjunction', + 'sd_journal_add_disjunction', + 'sd_journal_flush_matches'], + ''], + ['sd_journal_enumerate_fields', + '3', + ['SD_JOURNAL_FOREACH_FIELD', 'sd_journal_restart_fields'], + ''], + ['sd_journal_get_catalog', '3', ['sd_journal_get_catalog_for_message_id'], ''], + ['sd_journal_get_cursor', '3', ['sd_journal_test_cursor'], ''], + ['sd_journal_get_cutoff_realtime_usec', + '3', + ['sd_journal_get_cutoff_monotonic_usec'], + ''], + ['sd_journal_get_data', + '3', + ['SD_JOURNAL_FOREACH_DATA', + 'sd_journal_enumerate_data', + 'sd_journal_get_data_threshold', + 'sd_journal_restart_data', + 'sd_journal_set_data_threshold'], + ''], + ['sd_journal_get_fd', + '3', + ['SD_JOURNAL_APPEND', + 'SD_JOURNAL_INVALIDATE', + 'SD_JOURNAL_NOP', + 'sd_journal_get_events', + 'sd_journal_get_timeout', + 'sd_journal_process', + 'sd_journal_reliable_fd', + 'sd_journal_wait'], + ''], + ['sd_journal_get_realtime_usec', '3', ['sd_journal_get_monotonic_usec'], ''], + ['sd_journal_get_usage', '3', [], ''], + ['sd_journal_has_runtime_files', '3', ['sd_journal_has_persistent_files'], ''], + ['sd_journal_next', + '3', + ['SD_JOURNAL_FOREACH', + 'SD_JOURNAL_FOREACH_BACKWARDS', + 'sd_journal_next_skip', + 'sd_journal_previous', + 'sd_journal_previous_skip'], + ''], + ['sd_journal_open', + '3', + ['SD_JOURNAL_CURRENT_USER', + 'SD_JOURNAL_LOCAL_ONLY', + 'SD_JOURNAL_OS_ROOT', + 'SD_JOURNAL_RUNTIME_ONLY', + 'SD_JOURNAL_SYSTEM', + 'sd_journal', + 'sd_journal_close', + 'sd_journal_open_directory', + 'sd_journal_open_directory_fd', + 'sd_journal_open_files', + 'sd_journal_open_files_fd'], + ''], + ['sd_journal_print', + '3', + ['SD_JOURNAL_SUPPRESS_LOCATION', + 'sd_journal_perror', + 'sd_journal_printv', + 'sd_journal_send', + 'sd_journal_sendv'], + ''], + ['sd_journal_query_unique', + '3', + ['SD_JOURNAL_FOREACH_UNIQUE', + 'sd_journal_enumerate_unique', + 'sd_journal_restart_unique'], + ''], + ['sd_journal_seek_head', + '3', + ['sd_journal_seek_cursor', + 'sd_journal_seek_monotonic_usec', + 'sd_journal_seek_realtime_usec', + 'sd_journal_seek_tail'], + ''], + ['sd_journal_stream_fd', '3', [], ''], + ['sd_listen_fds', + '3', + ['SD_LISTEN_FDS_START', 'sd_listen_fds_with_names'], + ''], + ['sd_login_monitor_new', + '3', + ['sd_login_monitor', + 'sd_login_monitor_flush', + 'sd_login_monitor_get_events', + 'sd_login_monitor_get_fd', + 'sd_login_monitor_get_timeout', + 'sd_login_monitor_unref', + 'sd_login_monitor_unrefp'], + 'HAVE_PAM'], + ['sd_machine_get_class', '3', ['sd_machine_get_ifindices'], ''], + ['sd_notify', + '3', + ['sd_notifyf', 'sd_pid_notify', 'sd_pid_notify_with_fds', 'sd_pid_notifyf'], + ''], + ['sd_pid_get_session', + '3', + ['sd_peer_get_cgroup', + 'sd_peer_get_machine_name', + 'sd_peer_get_owner_uid', + 'sd_peer_get_session', + 'sd_peer_get_slice', + 'sd_peer_get_unit', + 'sd_peer_get_user_slice', + 'sd_peer_get_user_unit', + 'sd_pid_get_cgroup', + 'sd_pid_get_machine_name', + 'sd_pid_get_owner_uid', + 'sd_pid_get_slice', + 'sd_pid_get_unit', + 'sd_pid_get_user_slice', + 'sd_pid_get_user_unit'], + 'HAVE_PAM'], + ['sd_seat_get_active', + '3', + ['sd_seat_can_graphical', + 'sd_seat_can_multi_session', + 'sd_seat_can_tty', + 'sd_seat_get_sessions'], + 'HAVE_PAM'], + ['sd_session_is_active', + '3', + ['sd_session_get_class', + 'sd_session_get_desktop', + 'sd_session_get_display', + 'sd_session_get_remote_host', + 'sd_session_get_remote_user', + 'sd_session_get_seat', + 'sd_session_get_service', + 'sd_session_get_state', + 'sd_session_get_tty', + 'sd_session_get_type', + 'sd_session_get_uid', + 'sd_session_get_vt', + 'sd_session_is_remote'], + 'HAVE_PAM'], + ['sd_uid_get_state', + '3', + ['sd_uid_get_display', + 'sd_uid_get_seats', + 'sd_uid_get_sessions', + 'sd_uid_is_on_seat'], + 'HAVE_PAM'], + ['sd_watchdog_enabled', '3', [], ''], + ['shutdown', '8', [], ''], + ['sysctl.d', '5', [], ''], + ['systemctl', '1', [], ''], + ['systemd-analyze', '1', [], ''], + ['systemd-ask-password-console.service', + '8', + ['systemd-ask-password-console.path', + 'systemd-ask-password-wall.path', + 'systemd-ask-password-wall.service'], + ''], + ['systemd-ask-password', '1', [], ''], + ['systemd-backlight@.service', '8', ['systemd-backlight'], 'ENABLE_BACKLIGHT'], + ['systemd-binfmt.service', '8', ['systemd-binfmt'], 'ENABLE_BINFMT'], + ['systemd-cat', '1', [], ''], + ['systemd-cgls', '1', [], ''], + ['systemd-cgtop', '1', [], ''], + ['systemd-coredump', + '8', + ['systemd-coredump.socket', 'systemd-coredump@.service'], + 'ENABLE_COREDUMP'], + ['systemd-cryptsetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'], + ['systemd-cryptsetup@.service', + '8', + ['systemd-cryptsetup'], + 'HAVE_LIBCRYPTSETUP'], + ['systemd-debug-generator', '8', [], ''], + ['systemd-delta', '1', [], ''], + ['systemd-detect-virt', '1', [], ''], + ['systemd-environment-d-generator', + '8', + ['30-systemd-environment-d-generator'], + ''], + ['systemd-escape', '1', [], ''], + ['systemd-firstboot', '1', ['systemd-firstboot.service'], 'ENABLE_FIRSTBOOT'], + ['systemd-fsck@.service', + '8', + ['systemd-fsck', 'systemd-fsck-root.service'], + ''], + ['systemd-fstab-generator', '8', [], ''], + ['systemd-getty-generator', '8', [], ''], + ['systemd-gpt-auto-generator', '8', [], ''], + ['systemd-halt.service', + '8', + ['systemd-kexec.service', + 'systemd-poweroff.service', + 'systemd-reboot.service', + 'systemd-shutdown'], + ''], + ['systemd-hibernate-resume-generator', '8', [], ''], + ['systemd-hibernate-resume@.service', '8', ['systemd-hibernate-resume'], ''], + ['systemd-hostnamed.service', '8', ['systemd-hostnamed'], 'ENABLE_HOSTNAMED'], + ['systemd-hwdb', '8', [], 'ENABLE_HWDB'], + ['systemd-importd.service', '8', ['systemd-importd'], 'ENABLE_IMPORTD'], + ['systemd-inhibit', '1', [], ''], + ['systemd-initctl.service', + '8', + ['systemd-initctl', 'systemd-initctl.socket'], + ''], + ['systemd-journal-gatewayd.service', + '8', + ['systemd-journal-gatewayd', 'systemd-journal-gatewayd.socket'], + 'HAVE_MICROHTTPD'], + ['systemd-journal-remote', '8', [], 'HAVE_MICROHTTPD'], + ['systemd-journal-upload', '8', [], 'HAVE_MICROHTTPD'], + ['systemd-journald.service', + '8', + ['systemd-journald', + 'systemd-journald-audit.socket', + 'systemd-journald-dev-log.socket', + 'systemd-journald.socket'], + ''], + ['systemd-localed.service', '8', ['systemd-localed'], 'ENABLE_LOCALED'], + ['systemd-logind.service', '8', ['systemd-logind'], 'ENABLE_LOGIND'], + ['systemd-machine-id-commit.service', '8', [], ''], + ['systemd-machine-id-setup', '1', [], ''], + ['systemd-machined.service', '8', ['systemd-machined'], 'ENABLE_MACHINED'], + ['systemd-modules-load.service', '8', ['systemd-modules-load'], 'HAVE_KMOD'], + ['systemd-mount', '1', ['systemd-umount'], ''], + ['systemd-networkd-wait-online.service', + '8', + ['systemd-networkd-wait-online'], + 'ENABLE_NETWORKD'], + ['systemd-networkd.service', '8', ['systemd-networkd'], 'ENABLE_NETWORKD'], + ['systemd-notify', '1', [], ''], + ['systemd-nspawn', '1', [], ''], + ['systemd-path', '1', [], ''], + ['systemd-quotacheck.service', + '8', + ['systemd-quotacheck'], + 'ENABLE_QUOTACHECK'], + ['systemd-random-seed.service', + '8', + ['systemd-random-seed'], + 'ENABLE_RANDOMSEED'], + ['systemd-remount-fs.service', '8', ['systemd-remount-fs'], ''], + ['systemd-resolve', '1', [], ''], + ['systemd-resolved.service', '8', ['systemd-resolved'], 'ENABLE_RESOLVED'], + ['systemd-rfkill.service', + '8', + ['systemd-rfkill', 'systemd-rfkill.socket'], + 'ENABLE_RFKILL'], + ['systemd-run', '1', [], ''], + ['systemd-sleep.conf', '5', ['sleep.conf.d'], ''], + ['systemd-socket-activate', '1', [], ''], + ['systemd-socket-proxyd', '8', [], ''], + ['systemd-suspend.service', + '8', + ['systemd-hibernate.service', + 'systemd-hybrid-sleep.service', + 'systemd-sleep'], + ''], + ['systemd-sysctl.service', '8', ['systemd-sysctl'], ''], + ['systemd-system-update-generator', '8', [], ''], + ['systemd-system.conf', + '5', + ['system.conf.d', 'systemd-user.conf', 'user.conf.d'], + ''], + ['systemd-sysusers', '8', ['systemd-sysusers.service'], ''], + ['systemd-sysv-generator', '8', [], 'HAVE_SYSV_COMPAT'], + ['systemd-timedated.service', '8', ['systemd-timedated'], 'ENABLE_TIMEDATED'], + ['systemd-timesyncd.service', '8', ['systemd-timesyncd'], 'ENABLE_TIMESYNCD'], + ['systemd-tmpfiles', + '8', + ['systemd-tmpfiles-clean.service', + 'systemd-tmpfiles-clean.timer', + 'systemd-tmpfiles-setup-dev.service', + 'systemd-tmpfiles-setup.service'], + ''], + ['systemd-tty-ask-password-agent', '1', [], ''], + ['systemd-udevd.service', + '8', + ['systemd-udevd', + 'systemd-udevd-control.socket', + 'systemd-udevd-kernel.socket'], + ''], + ['systemd-update-done.service', '8', ['systemd-update-done'], ''], + ['systemd-update-utmp.service', + '8', + ['systemd-update-utmp', 'systemd-update-utmp-runlevel.service'], + 'HAVE_UTMP'], + ['systemd-user-sessions.service', '8', ['systemd-user-sessions'], 'HAVE_PAM'], + ['systemd-vconsole-setup.service', + '8', + ['systemd-vconsole-setup'], + 'ENABLE_VCONSOLE'], + ['systemd-veritysetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'], + ['systemd-veritysetup@.service', + '8', + ['systemd-veritysetup'], + 'HAVE_LIBCRYPTSETUP'], + ['systemd-volatile-root.service', '8', ['systemd-volatile-root'], ''], + ['systemd', '1', ['init'], ''], + ['systemd.automount', '5', [], ''], + ['systemd.device', '5', [], ''], + ['systemd.environment-generator', '7', [], ''], + ['systemd.exec', '5', [], ''], + ['systemd.generator', '7', [], ''], + ['systemd.journal-fields', '7', [], ''], + ['systemd.kill', '5', [], ''], + ['systemd.link', '5', [], ''], + ['systemd.mount', '5', [], ''], + ['systemd.netdev', '5', [], 'ENABLE_NETWORKD'], + ['systemd.network', '5', [], 'ENABLE_NETWORKD'], + ['systemd.nspawn', '5', [], ''], + ['systemd.offline-updates', '7', [], ''], + ['systemd.path', '5', [], ''], + ['systemd.preset', '5', [], ''], + ['systemd.resource-control', '5', [], ''], + ['systemd.scope', '5', [], ''], + ['systemd.service', '5', [], ''], + ['systemd.slice', '5', [], ''], + ['systemd.socket', '5', [], ''], + ['systemd.special', '7', [], ''], + ['systemd.swap', '5', [], ''], + ['systemd.target', '5', [], ''], + ['systemd.time', '7', [], ''], + ['systemd.timer', '5', [], ''], + ['systemd.unit', '5', [], ''], + ['sysusers.d', '5', [], 'ENABLE_SYSUSERS'], + ['telinit', '8', [], ''], + ['timedatectl', '1', [], 'ENABLE_TIMEDATED'], + ['timesyncd.conf', '5', ['timesyncd.conf.d'], 'ENABLE_TIMESYNCD'], + ['tmpfiles.d', '5', [], ''], + ['udev', '7', [], ''], + ['udev.conf', '5', [], ''], + ['udev_device_get_syspath', + '3', + ['udev_device_get_action', + 'udev_device_get_devnode', + 'udev_device_get_devnum', + 'udev_device_get_devpath', + 'udev_device_get_devtype', + 'udev_device_get_driver', + 'udev_device_get_is_initialized', + 'udev_device_get_parent', + 'udev_device_get_parent_with_subsystem_devtype', + 'udev_device_get_subsystem', + 'udev_device_get_sysname', + 'udev_device_get_sysnum', + 'udev_device_get_udev'], + ''], + ['udev_device_has_tag', + '3', + ['udev_device_get_devlinks_list_entry', + 'udev_device_get_properties_list_entry', + 'udev_device_get_property_value', + 'udev_device_get_sysattr_list_entry', + 'udev_device_get_sysattr_value', + 'udev_device_get_tags_list_entry', + 'udev_device_set_sysattr_value'], + ''], + ['udev_device_new_from_syspath', + '3', + ['udev_device_new_from_device_id', + 'udev_device_new_from_devnum', + 'udev_device_new_from_environment', + 'udev_device_new_from_subsystem_sysname', + 'udev_device_ref', + 'udev_device_unref'], + ''], + ['udev_enumerate_add_match_subsystem', + '3', + ['udev_enumerate_add_match_is_initialized', + 'udev_enumerate_add_match_parent', + 'udev_enumerate_add_match_property', + 'udev_enumerate_add_match_sysattr', + 'udev_enumerate_add_match_sysname', + 'udev_enumerate_add_match_tag', + 'udev_enumerate_add_nomatch_subsystem', + 'udev_enumerate_add_nomatch_sysattr'], + ''], + ['udev_enumerate_new', + '3', + ['udev_enumerate_ref', 'udev_enumerate_unref'], + ''], + ['udev_enumerate_scan_devices', + '3', + ['udev_enumerate_add_syspath', + 'udev_enumerate_get_list_entry', + 'udev_enumerate_get_udev', + 'udev_enumerate_scan_subsystems'], + ''], + ['udev_list_entry', + '3', + ['udev_list_entry_get_by_name', + 'udev_list_entry_get_name', + 'udev_list_entry_get_next', + 'udev_list_entry_get_value'], + ''], + ['udev_monitor_filter_update', + '3', + ['udev_monitor_filter_add_match_subsystem_devtype', + 'udev_monitor_filter_add_match_tag', + 'udev_monitor_filter_remove'], + ''], + ['udev_monitor_new_from_netlink', + '3', + ['udev_monitor_ref', 'udev_monitor_unref'], + ''], + ['udev_monitor_receive_device', + '3', + ['udev_monitor_enable_receiving', + 'udev_monitor_get_fd', + 'udev_monitor_get_udev', + 'udev_monitor_set_receive_buffer_size'], + ''], + ['udev_new', '3', ['udev_ref', 'udev_unref'], ''], + ['udevadm', '8', [], ''], + ['vconsole.conf', '5', [], 'ENABLE_VCONSOLE'] +] +# Really, do not edit. diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..95445f9559 --- /dev/null +++ b/meson.build @@ -0,0 +1,1857 @@ +# -*- mode: meson -*- + +project('systemd', 'c', + version : '233', + license : 'LGPLv2+', + default_options: [ + 'c_std=gnu99', + 'prefix=/usr', + 'sysconfdir=/etc', + 'localstatedir=/var', + ], + meson_version : '>= 0.39.1', + ) + +# We need the same data in three different formats, ugh! +# Also, for hysterical reasons, we use different variable +# names, sometimes. Not all variables are included in every +# set. Ugh, ugh, ugh! +conf = configuration_data() +conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version()) +conf.set_quoted('PACKAGE_VERSION', meson.project_version()) + +substs = configuration_data() +substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd') +substs.set('PACKAGE_VERSION', meson.project_version()) + +m4_defines = [] + +##################################################################### + +if get_option('split-usr') + conf.set('HAVE_SPLIT_USR', 1) + rootprefixdir = '/' +else + rootprefixdir = '/usr' +endif + +sysvinit_path = get_option('sysvinit-path') +sysvrcnd_path = get_option('sysvrcnd-path') +if sysvinit_path != '' or sysvrcnd_path != '' + conf.set('HAVE_SYSV_COMPAT', 1, + description : 'SysV init scripts and rcN.d links are supported') +endif + +# join_paths ignore the preceding arguments if an absolute component is +# encountered, so this should canonicalize various paths when they are +# absolute or relative. +prefixdir = get_option('prefix') +if not prefixdir.startswith('/') + error('Prefix is not absolute: "@0@"'.format(prefixdir)) +endif +bindir = join_paths(prefixdir, get_option('bindir')) +libdir = join_paths(prefixdir, get_option('libdir')) +sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) +includedir = join_paths(prefixdir, get_option('includedir')) +datadir = join_paths(prefixdir, get_option('datadir')) +localstatedir = join_paths('/', get_option('localstatedir')) + +rootbindir = join_paths(rootprefixdir, 'bin') +rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd') + +rootlibdir = get_option('rootlibdir') +if rootlibdir == '' + rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) +endif + +# Dirs of external packages +pkgconfigdatadir = datadir + '/pkgconfig' +pkgconfiglibdir = libdir + '/pkgconfig' +polkitpolicydir = datadir + '/polkit-1/actions' +polkitrulesdir = datadir + '/polkit-1/rules.d' +polkitpkladir = localstatedir + '/lib/polkit-1/localauthority/10-vendor.d' +varlogdir = localstatedir + '/log' +xinitrcdir = sysconfdir + '/X11/xinit/xinitrc.d' +rpmmacrosdir = get_option('rpmmacrosdir') + +# Our own paths +pkgdatadir = datadir + '/systemd' +environmentdir = prefixdir + '/lib/environment.d' +pkgsysconfdir = sysconfdir + '/systemd' +userunitdir = prefixdir + '/lib/systemd/user' +userpresetdir = prefixdir + '/lib/systemd/user-preset' +tmpfilesdir = prefixdir + '/lib/tmpfiles.d' +sysusersdir = prefixdir + '/lib/sysusers.d' +sysctldir = prefixdir + '/lib/sysctl.d' +binfmtdir = prefixdir + '/lib/binfmt.d' +modulesloaddir = prefixdir + '/lib/modules-load.d' +networkdir = rootprefixdir + '/lib/systemd/network' +pkgincludedir = includedir + '/systemd' +systemgeneratordir = rootlibexecdir + '/system-generators' +usergeneratordir = prefixdir + '/lib/systemd/user-generators' +systemenvgeneratordir = prefixdir + '/lib/systemd/system-environment-generators' +userenvgeneratordir = prefixdir + '/lib/systemd/user-environment-generators' +systemshutdowndir = rootlibexecdir + '/system-shutdown' +systemsleepdir = rootlibexecdir + '/system-sleep' +systemunitdir = rootprefixdir + '/lib/systemd/system' +systempresetdir = rootprefixdir + '/lib/systemd/system-preset' +udevlibexecdir = rootprefixdir + '/lib/udev' +udevhomedir = udevlibexecdir + '' +udevrulesdir = udevlibexecdir + '/rules.d' +udevhwdbdir = udevlibexecdir + '/hwdb.d' +catalogdir = prefixdir + '/lib/systemd/catalog' +kernelinstalldir = prefixdir + '/lib/kernel/install.d' +factorydir = datadir + '/factory' +docdir = datadir + '/doc/systemd' +bootlibdir = prefixdir + '/lib/systemd/boot/efi' +testsdir = prefixdir + '/lib/systemd/tests' +systemdstatedir = localstatedir + '/lib/systemd' +catalogstatedir = systemdstatedir + '/catalog' + +dbuspolicydir = get_option('dbuspolicydir') +if dbuspolicydir == '' + dbuspolicydir = datadir + '/dbus-1/system.d' +endif + +dbussessionservicedir = get_option('dbussessionservicedir') +if dbussessionservicedir == '' + dbussessionservicedir = datadir + '/dbus-1/services' +endif + +dbussystemservicedir = get_option('dbussystemservicedir') +if dbussystemservicedir == '' + dbussystemservicedir = datadir + '/dbus-1/system-services' +endif + +pamlibdir = get_option('pamlibdir') +if pamlibdir == '' + pamlibdir = rootlibdir + '/security' +endif + +pamconfdir = get_option('pamconfdir') +if pamconfdir == '' + pamconfdir = sysconfdir + '/pam.d' +endif + +conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) +conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', pkgsysconfdir + '/system') +conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) +conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) +conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) +conf.set_quoted('USER_CONFIG_UNIT_PATH', pkgsysconfdir + '/user') +conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) +conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) +conf.set_quoted('CATALOG_DATABASE', catalogstatedir + '/database') +conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', rootlibexecdir + '/systemd-cgroups-agent') +conf.set_quoted('SYSTEMD_BINARY_PATH', rootlibexecdir + '/systemd') +conf.set_quoted('SYSTEMD_FSCK_PATH', rootlibexecdir + '/systemd-fsck') +conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir + '/systemd-shutdown') +conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', rootlibexecdir + '/systemd-sleep') +conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir + '/systemctl') +conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir + '/systemd-tty-ask-password-agent') +conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir + '/systemd-stdio-bridge') +conf.set_quoted('ROOTPREFIX', rootprefixdir) +conf.set_quoted('RANDOM_SEED_DIR', localstatedir + '/lib/systemd/') +conf.set_quoted('RANDOM_SEED', localstatedir + '/lib/systemd/random-seed') +conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir + '/systemd-cryptsetup') +conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) +conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) +conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) +conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) +conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) +conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) +conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', pkgdatadir + '/kbd-model-map') +conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir + '/language-fallback-map') +conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) +conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir + '/pkttyagent') +conf.set_quoted('LIBDIR', libdir) +conf.set_quoted('ROOTLIBDIR', rootlibdir) +conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) +conf.set_quoted('BOOTLIBDIR', bootlibdir) +conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir + '/systemd-pull') +conf.set_quoted('SYSTEMD_IMPORT_PATH', rootlibexecdir + '/systemd-import') +conf.set_quoted('SYSTEMD_EXPORT_PATH', rootlibexecdir + '/systemd-export') +conf.set_quoted('VENDOR_KEYRING_PATH', rootlibexecdir + '/import-pubring.gpg') +conf.set_quoted('USER_KEYRING_PATH', pkgsysconfdir + '/import-pubring.gpg') +conf.set_quoted('DOCUMENT_ROOT', pkgdatadir + '/gatewayd') + +conf.set_quoted('ABS_BUILD_DIR', meson.build_root()) +conf.set_quoted('ABS_SRC_DIR', meson.source_root()) + +substs.set('prefix', prefixdir) +substs.set('pkgsysconfdir', pkgsysconfdir) +substs.set('rootlibexecdir', rootlibexecdir) +substs.set('systemunitdir', systemunitdir) +substs.set('userunitdir', userunitdir) +substs.set('systempresetdir', systempresetdir) +substs.set('userpresetdir', userpresetdir) +substs.set('udevhwdbdir', udevhwdbdir) +substs.set('udevrulesdir', udevrulesdir) +substs.set('catalogdir', catalogdir) +substs.set('tmpfilesdir', tmpfilesdir) +substs.set('sysusersdir', sysusersdir) +substs.set('sysctldir', sysctldir) +substs.set('binfmtdir', binfmtdir) +substs.set('modulesloaddir', modulesloaddir) +substs.set('systemgeneratordir', systemgeneratordir) +substs.set('usergeneratordir', usergeneratordir) +substs.set('systemenvgeneratordir', systemenvgeneratordir) +substs.set('userenvgeneratordir', userenvgeneratordir) +substs.set('systemshutdowndir', systemshutdowndir) +substs.set('systemsleepdir', systemsleepdir) + +##################################################################### + +cc = meson.get_compiler('c') +pkgconfig = import('pkgconfig') + +foreach arg : ['-Wundef', + '-Wlogical-op', + '-Wmissing-include-dirs', + '-Wold-style-definition', + '-Wpointer-arith', + '-Winit-self', + '-Wdeclaration-after-statement', + '-Wfloat-equal', + '-Wsuggest-attribute=noreturn', + '-Werror=missing-prototypes', + '-Werror=implicit-function-declaration', + '-Werror=missing-declarations', + '-Werror=return-type', + '-Werror=incompatible-pointer-types', + '-Werror=format=2', + '-Wstrict-prototypes', + '-Wredundant-decls', + '-Wmissing-noreturn', + '-Wshadow', + '-Wendif-labels', + '-Wstrict-aliasing=2', + '-Wwrite-strings', + '-Wno-unused-parameter', + '-Wno-missing-field-initializers', + '-Wno-unused-result', + '-Wno-format-signedness', + '-Werror=overflow', + '-Wdate-time', + '-Wnested-externs', + '-ffast-math', + '-fno-common', + '-fdiagnostics-show-option', + '-fno-strict-aliasing', + '-fvisibility=hidden', + '-fstack-protector', + '-fstack-protector-strong', + '-fPIE', + '--param=ssp-buffer-size=4', + ] + if cc.has_argument(arg) + add_project_arguments(arg, language : 'c') + endif +endforeach + +if cc.compiles(' + #include + #include + typedef uint64_t usec_t; + usec_t now(clockid_t clock); + int main(void) { + struct timespec now; + return 0; + } +') + # TODO: message? + add_project_arguments('-Werror=shadow', language : 'c') +endif + +if cc.get_id() == 'clang' + foreach arg : ['-Wno-typedef-redefinition', + '-Wno-gnu-variable-sized-type-not-at-end', + ] + if cc.has_argument(arg) + add_project_arguments(arg, language : 'c') + endif + endforeach +endif + +# --as-needed and --no-undefined are provided by meson by default, +# run mesonconf to see what is enabled +foreach arg : ['-Wl,-z,relro', + '-Wl,-z,now', + '-pie', + '-Wl,-fuse-ld=gold', + ] + if cc.has_argument(arg) + add_project_link_arguments(arg, language : 'c') + endif +endforeach + +##################################################################### +# compilation result tests + +conf.set('_GNU_SOURCE', 1) +conf.set('__SANE_USERSPACE_TYPES__', 1) + +conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include ')) +conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include ')) +conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include ')) +conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include ')) +conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include ')) +conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include ')) +conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include ')) + +decl_headers = ''' +#include +#include +''' +# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail + +foreach decl : ['char16_t', + 'char32_t', + 'key_serial_t', + 'struct ethtool_link_settings', + ] + if cc.sizeof(decl, prefix : decl_headers) > 0 + # We get -1 if the size cannot be determined + conf.set('HAVE_' + decl.underscorify().to_upper(), 1) + endif +endforeach + +foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], + ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], + ['IFLA_VRF_TABLE', 'linux/if_link.h'], + ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'], + ['IFLA_IPVLAN_MODE', 'linux/if_link.h'], + ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], + ['IFLA_BOND_AD_INFO', 'linux/if_link.h'], + ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'], + ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], + ['IFLA_VXLAN_GPE', 'linux/if_link.h'], + # if_tunnel.h is buggy and cannot be included on its own + ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include '], + ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], + ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'], + ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'], + ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'], + ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'], + ['NDA_IFINDEX', 'linux/neighbour.h'], + ['IFA_FLAGS', 'linux/if_addr.h'], + ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], + ] + prefix = decl.length() > 2 ? decl[2] : '' + have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) + conf.set10('HAVE_DECL_' + decl[0], have) +endforeach + +skip = false +foreach ident : ['secure_getenv', '__secure_getenv'] + if not skip and cc.has_function(ident) + conf.set('HAVE_' + ident.to_upper(), 1) + skip = true + endif +endforeach + +foreach ident : [ + ['memfd_create', '''#include '''], + ['gettid', '''#include '''], + ['pivot_root', '''#include '''], # no known header declares pivot_root + ['name_to_handle_at', '''#define _GNU_SOURCE + #include + #include + #include '''], + ['setns', '''#define _GNU_SOURCE + #include '''], + ['getrandom', '''#include '''], + ['renameat2', '''#include '''], + ['kcmp', '''#include '''], + ['keyctl', '''#include + #include '''], + ['copy_file_range', '''#include + #include '''], + ['explicit_bzero' , '''#include '''], + ] + + have = cc.has_function(ident[0], prefix : ident[1]) + conf.set10('HAVE_DECL_' + ident[0].to_upper(), have) +endforeach + +##################################################################### + +sed = find_program('sed') +grep = find_program('grep') +awk = find_program('awk') +m4 = find_program('m4') +stat = find_program('stat') + +# if -Dxxx-path option is found, use that. Otherwise, check in $PATH, +# /usr/sbin, /sbin, and fall back to the default from middle column. +progs = [['telinit', '/lib/sysvinit/telinit'], + ['quotaon', '/usr/sbin/quotaon' ], + ['quotacheck', '/usr/sbin/quotacheck' ], + ['kill', '/usr/bin/kill' ], + ['kmod', '/usr/bin/kmod' ], + ['kexec', '/usr/sbin/kexec' ], + ['sulogin', '/usr/sbin/sulogin' ], + ['mount', '/usr/bin/mount', 'MOUNT_PATH'], + ['umount', '/usr/bin/umount', 'UMOUNT_PATH'], + ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'], + ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'], + ] +foreach prog : progs + path = get_option(prog[0] + '-path') + if path != '' + message('Using @1@ for @0@'.format(prog[0], path)) + else + exe = find_program(prog[0], '/usr/sbin/' + prog[0], '/sbin/' + prog[0], required: false) + path = exe.found() ? exe.path() : prog[1] + endif + name = prog.length() > 2 ? prog[2] : prog[0].to_upper() + conf.set_quoted(name, path) +endforeach + +# TODO: add ln --relative check +# AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])]) + +############################################################ + +gperf = find_program('gperf') + +gperf_test_format = ''' +#include +const char * in_word_set(const char *, @0@); +@1@ +''' +gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C' +gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path())) +gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) +if cc.compiles(gperf_test) + gperf_len_type = 'size_t' +else + gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) + if cc.compiles(gperf_test) + gperf_len_type = 'unsigned' + else + error('unable to determine gperf len type') + endif +endif +message('gperf len type is @0@'.format(gperf_len_type)) +conf.set('GPERF_LEN_TYPE', gperf_len_type, description : 'The type of gperf "len" parameter') + +############################################################ + +if not cc.has_header('sys/capability.h') + error('POSIX caps headers not found') +endif +foreach header : ['linux/btrfs.h', + 'linux/memfd.h', + 'linux/vm_sockets.h', + 'valgrind/memcheck.h', + 'valgrind/valgrind.h', + ] + if cc.has_header(header) + conf.set('HAVE_' + header.underscorify().to_upper(), 1) + endif +endforeach + +############################################################ + +conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname')) + +default_hierarchy = get_option('default-hierarchy') +conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, + description : 'default cgroup hierarchy as string') +if default_hierarchy == 'legacy' + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') +elif default_hierarchy == 'hybrid' + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') +else + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') +endif + +time_epoch = get_option('time-epoch') +if time_epoch == '' + NEWS = files('NEWS') + time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() +endif +time_epoch = time_epoch.to_int() +conf.set('TIME_EPOCH', time_epoch) + +system_uid_max = get_option('system-uid-max') +if system_uid_max == '' + system_uid_max = run_command( + awk, + 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', + '/etc/login.defs').stdout() +endif +system_uid_max = system_uid_max.to_int() +conf.set('SYSTEM_UID_MAX', system_uid_max) +substs.set('systemuidmax', system_uid_max) +message('Maximum system UID is @0@'.format(system_uid_max)) + +conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user')) +conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group')) + +system_gid_max = get_option('system-gid-max') +if system_gid_max == '' + system_gid_max = run_command( + awk, + 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', + '/etc/login.defs').stdout() +endif +system_gid_max = system_gid_max.to_int() +conf.set('SYSTEM_GID_MAX', system_gid_max) +substs.set('systemgidmax', system_gid_max) +message('Maximum system GID is @0@'.format(system_gid_max)) + +tty_gid = get_option('tty-gid') +conf.set('TTY_GID', tty_gid) +m4_defines += ['-DTTY_GID=' + tty_gid] + +if get_option('adm-group') + m4_defines += ['-DENABLE_ADM_GROUP'] +endif + +if get_option('wheel-group') + m4_defines += ['-DENABLE_WHEEL_GROUP'] +endif + +substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) + +conf.set10('KILL_USER_PROCESSES', get_option('default-kill-user-processes')) + +default_dnssec = get_option('default-dnssec') +conf.set('DEFAULT_DNSSEC_MODE', + 'DNSSEC_' + default_dnssec.underscorify().to_upper()) + +conf.set_quoted('DNS_SERVERS', get_option('dns-servers')) + +conf.set_quoted('NTP_SERVERS', get_option('ntp-servers')) + +conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) + +##################################################################### + +threads = dependency('threads') +librt = cc.find_library('rt') +libm = cc.find_library('m') +libdl = cc.find_library('dl') +libcrypt = cc.find_library('crypt') + +libcap = dependency('libcap') +libmount = dependency('mount', + version : '>= 2.27') + +want_seccomp = get_option('seccomp') +if want_seccomp != 'no' + libseccomp = dependency('libseccomp', + required : want_seccomp == 'yes') + if libseccomp.found() + conf.set('HAVE_SECCOMP', 1) + m4_defines += ['-DHAVE_SECCOMP'] + endif +else + libseccomp = [] +endif + +want_selinux = get_option('selinux') +if want_selinux != 'no' + libselinux = dependency('libselinux', + version : '>= 2.1.9', + required : want_selinux == 'yes') + if libselinux.found() + conf.set('HAVE_SELINUX', 1) + m4_defines += ['-DHAVE_SELINUX'] + endif +else + libselinux = [] +endif + +want_apparmor = get_option('apparmor') +if want_apparmor != 'no' + libapparmor = dependency('libapparmor', + required : want_apparmor == 'yes') + if libapparmor.found() + conf.set('HAVE_APPARMOR', 1) + m4_defines += ['-DHAVE_APPARMOR'] + endif +else + libapparmor = [] +endif + +want_smack = get_option('smack') +if want_smack != 'no' + libsmack = dependency('libsmack', + required : want_smack == 'yes') + if libsmack.found() + conf.set('HAVE_SMACK', 1) + m4_defines += ['-DHAVE_SMACK'] + endif +else + libsmack = [] +endif + +smack_run_label = get_option('smack-run-label') +if smack_run_label != '' + conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) + m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] +endif + +want_audit = get_option('audit') +if want_audit != 'no' + libaudit = dependency('audit', required : want_audit == 'yes') + if libaudit.found() + conf.set('HAVE_AUDIT', 1) + endif +else + libaudit = [] +endif + +want_blkid = get_option('blkid') +if want_blkid != 'no' + libblkid = dependency('blkid', required : want_blkid == 'yes') + if libblkid.found() + conf.set('HAVE_BLKID', 1) + endif +else + libblkid = [] +endif + +want_kmod = get_option('kmod') +if want_kmod != 'no' + libkmod = dependency('libkmod', + version : '>= 15', + required : want_kmod == 'yes') + if libkmod.found() + conf.set('HAVE_KMOD', 1) + endif +else + libkmod = [] +endif + +want_pam = get_option('pam') +if want_pam != 'no' + libpam = cc.find_library('pam', required : want_pam == 'yes') + libpam_misc = cc.find_library('pam_misc', required : want_pam == 'yes') + if libpam.found() and libpam_misc.found() + conf.set('HAVE_PAM', 1) + m4_defines += ['-DHAVE_PAM'] + endif +else + libpam = [] + libpam_misc = [] +endif + +want_microhttpd = get_option('microhttpd') +if want_microhttpd != 'no' + libmicrohttpd = dependency('libmicrohttpd', + version : '>= 0.9.33', + required : want_microhttpd == 'yes') + if libmicrohttpd.found() + conf.set('HAVE_MICROHTTPD', 1) + m4_defines += ['-DHAVE_MICROHTTPD'] + endif +else + libmicrohttpd = [] +endif + +want_libcryptsetup = get_option('libcryptsetup') +if want_libcryptsetup != 'no' + libcryptsetup = dependency('libcryptsetup', + version : '>= 1.6.0', + required : want_libcryptsetup == 'yes') + if libcryptsetup.found() + conf.set('HAVE_LIBCRYPTSETUP', 1) + endif +else + libcryptsetup = [] +endif + +want_libcurl = get_option('libcurl') +if want_libcurl != 'no' + libcurl = dependency('libcurl', + version : '>= 7.32.0', + required : want_libcurl == 'yes') + if libcurl.found() + conf.set('HAVE_LIBCURL', 1) + m4_defines += ['-DHAVE_LIBCURL'] + endif +else + libcurl = [] +endif + +want_libidn = get_option('libidn') +if want_libidn != 'no' + libidn = dependency('libidn', + required : want_libidn == 'yes') + if libidn.found() + conf.set('HAVE_LIBIDN', 1) + m4_defines += ['-DHAVE_LIBIDN'] + endif +else + libidn = [] +endif + +want_libiptc = get_option('libiptc') +if want_libiptc != 'no' + libiptc = dependency('libiptc', + required : want_libiptc == 'yes') + if libiptc.found() + conf.set('HAVE_LIBIPTC', 1) + m4_defines += ['-DHAVE_LIBIPTC'] + endif +else + libiptc = [] +endif + +want_qrencode = get_option('qrencode') +if want_qrencode != 'no' + libqrencode = dependency('libqrencode', + required : want_qrencode == 'yes') + if libqrencode.found() + conf.set('HAVE_QRENCODE', 1) + endif +else + libqrencode = [] +endif + +want_gnutls = get_option('gnutls') +if want_gnutls != 'no' + libgnutls = dependency('gnutls', + version : '>= 3.1.4', + required : want_gnutls == 'yes') + if libgnutls.found() + conf.set('HAVE_GNUTLS', 1) + endif +else + libgnutls = [] +endif + +want_elfutils = get_option('elfutils') +if want_elfutils != 'no' + libdw = dependency('libdw', + required : want_elfutils == 'yes') + if libdw.found() + conf.set('HAVE_ELFUTILS', 1) + endif +else + libdw = [] +endif + +want_zlib = get_option('zlib') +if want_zlib != 'no' + libz = dependency('zlib', + required : want_zlib == 'yes') + if libz.found() + conf.set('HAVE_ZLIB', 1) + endif +else + libz = [] +endif + +want_bzip2 = get_option('bzip2') +if want_bzip2 != 'no' + libbzip2 = cc.find_library('bz2', + required : want_bzip2 == 'yes') + if libbzip2.found() + conf.set('HAVE_BZIP2', 1) + endif +else + libbzip2 = [] +endif + +want_xz = get_option('xz') +if want_xz != 'no' + libxz = dependency('liblzma', + required : want_xz == 'yes') + if libxz.found() + conf.set('HAVE_XZ', 1) + endif +else + libxz = [] +endif + +want_lz4 = get_option('lz4') +if want_lz4 != 'no' + liblz4 = dependency('liblz4', + required : want_lz4 == 'yes') + if liblz4.found() + conf.set('HAVE_LZ4', 1) + endif +else + liblz4 = [] +endif + +libacl = cc.find_library('acl', required : false) +if libacl.found() + conf.set('HAVE_ACL', 1) + m4_defines += ['-DHAVE_ACL'] +endif + +want_libgcrypt = get_option('libgcrypt') +if want_libgcrypt != 'no' + libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'yes') + if libgcrypt.found() + conf.set('HAVE_LIBGCRYPT', 1) + endif +else + libgcrypt = [] +endif + +want_importd = get_option('importd') +if want_importd != 'no' + have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and + conf.get('HAVE_ZLIB', 0) == 1 and + conf.get('HAVE_BZIP2', 0) == 1 and + conf.get('HAVE_XZ', 0) == 1 and + conf.get('HAVE_LZ4', 0) == 1) + if have_deps + conf.set('ENABLE_IMPORTD', 1) + elif want_importd == 'yes' + error('importd support was requested, but dependencies are not available') + endif +endif + +want_remote = get_option('remote') +if want_remote != 'no' + have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1, + conf.get('HAVE_LIBCURL', 0) == 1] + # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so + # it's possible to build one without the other. Complain only if + # support was explictly requested. The auxiliary files like sysusers + # config should be installed when any of the programs are built. + if want_remote == 'yes' and not (have_deps[0] and have_deps[1]) + error('remote support was requested, but dependencies are not available') + endif + if have_deps[0] or have_deps[1] + conf.set('ENABLE_REMOTE', 1) + endif +endif + +foreach pair : [['utmp', 'HAVE_UTMP'], + ['hibernate', 'ENABLE_HIBERNATE'], + ['environment-d', 'ENABLE_ENVIRONMENT_D'], + ['binfmt', 'ENABLE_BINFMT'], + ['coredump', 'ENABLE_COREDUMP'], + ['resolve', 'ENABLE_RESOLVED'], + ['logind', 'ENABLE_LOGIND'], + ['hostnamed', 'ENABLE_HOSTNAMED'], + ['localed', 'ENABLE_LOCALED'], + ['machined', 'ENABLE_MACHINED'], + ['networkd', 'ENABLE_NETWORKD'], + ['timedated', 'ENABLE_TIMEDATED'], + ['timesyncd', 'ENABLE_TIMESYNCD'], + ['myhostname', 'HAVE_MYHOSTNAME'], + ['firstboot', 'ENABLE_FIRSTBOOT'], + ['randomseed', 'ENABLE_RANDOMSEED'], + ['backlight', 'ENABLE_BACKLIGHT'], + ['vconsole', 'ENABLE_VCONSOLE'], + ['quotacheck', 'ENABLE_QUOTACHECK'], + ['sysusers', 'ENABLE_SYSUSERS'], + ['tmpfiles', 'ENABLE_TMPFILES'], + ['hwdb', 'ENABLE_HWDB'], + ['rfkill', 'ENABLE_RFKILL'], + ['ldconfig', 'ENABLE_LDCONFIG'], + ] + + if get_option(pair[0]) + conf.set(pair[1], 1) + endif +endforeach + +##################################################################### + +if get_option('efi') + efi_arch = host_machine.cpu_family() # TODO: check this works at all + if efi_arch == 'ia32' + EFI_MACHINE_TYPE_NAME = 'ia32' + elif efi_arch == 'x86_64' + EFI_MACHINE_TYPE_NAME = 'x64' + elif efi_arch == 'aarch64' + EFI_MACHINE_TYPE_NAME = 'x64' + else + EFI_MACHINE_TYPE_NAME = efi_arch + endif + + conf.set('ENABLE_EFI', 1) + conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) +endif + +##################################################################### + +config_h = configure_file( + output : 'config.h', + configuration : conf) + +includes = include_directories('src/basic', + 'src/shared', + 'src/systemd', + 'src/journal', + 'src/resolve', + 'src/timesync', + 'src/login', + 'src/udev', + 'src/libudev', + 'src/core', + 'src/libsystemd/sd-bus', + 'src/libsystemd/sd-device', + 'src/libsystemd/sd-hwdb', + 'src/libsystemd/sd-id128', + 'src/libsystemd/sd-netlink', + 'src/libsystemd/sd-network', + 'src/libsystemd-network', + ) + +add_project_arguments('-include', 'config.h', language : 'c') + +gcrypt_util_sources = files('src/shared/gcrypt-util.h', + 'src/shared/gcrypt-util.c') + +subdir('po') +subdir('catalog') +subdir('src/systemd') +subdir('src/basic') +subdir('src/libsystemd') +subdir('src/libsystemd-network') +subdir('src/analyze') +subdir('src/coredump') +subdir('src/hostname') +subdir('src/import') +subdir('src/journal') +subdir('src/journal-remote') +subdir('src/kernel-install') +subdir('src/locale') +subdir('src/login') +subdir('src/machine') +subdir('src/nspawn') +subdir('src/resolve') +subdir('src/timedate') +subdir('src/timesync') +subdir('src/vconsole') + +libjournal_core = static_library( + 'journal-core', + libjournal_core_sources, + journald_gperf_c, + include_directories : includes, + link_with : [libbasic, + libsystemd_internal, + libsystemd_journal_internal], + install : false) + +libsystemd = shared_library( + 'systemd', + libsystemd_internal_sources, + version : '0.18.0', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + libsystemd_sym], + link_with : [libbasic, + libsystemd_internal, + libsystemd_journal_internal], + dependencies : [threads], + install : true, + install_dir : rootlibdir) + +############################################################ + +foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], + ['systemd', '', []], + ['mymachines', 'ENABLE_MACHINED', []], + ['resolve', 'ENABLE_RESOLVED', [libdl]]] + + condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 + if condition + module = tuple[0] + extra_deps = tuple[2] + + sym = meson.current_source_dir() + '/src/nss-@0@/nss-@0@.sym'.format(module) + + shared_library( + 'nss_' + module, + 'src/nss-@0@/nss-@0@.c'.format(module), + version : '2', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + sym, + '-Wl,--undefined'], + link_with : [libsystemd_internal, + libbasic], + dependencies : [threads, + librt] + extra_deps, + install : true, + install_dir : rootlibdir) + endif +endforeach + +############################################################ + +subdir('src/libudev') +subdir('src/shared') +subdir('src/core') +subdir('src/udev') +subdir('src/network') + +executable('systemd', + systemd_sources, + include_directories : includes, + link_with : [libcore, + libshared], + dependencies : [threads, + librt, + libseccomp, + libselinux, + libmount], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-analyze', + systemd_analyze_sources, + include_directories : includes, + link_with : [libcore, + libshared], + dependencies : [threads, + librt, + libseccomp, + libselinux, + libmount], + install : true) + +executable('systemd-journald', + systemd_journald_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libjournal_core, + libshared, + libudev], + dependencies : [threads, + libxz, + liblz4], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-cat', + systemd_cat_sources, + include_directories : includes, + link_with : [libjournal_core, + libshared, + libudev], + dependencies : [threads], + install : true) + +executable('journalctl', + journalctl_sources, + include_directories : includes, + link_with : [libshared, + libudev], + dependencies : [threads, + libqrencode, + libxz, + liblz4], + install : true, + install_dir : rootbindir) + +executable('systemd-getty-generator', + 'src/getty-generator/getty-generator.c', + install : true, + install_dir : systemgeneratordir, + include_directories : includes, + link_with : [libshared]) + +executable('systemd-debug-generator', + 'src/debug-generator/debug-generator.c', + install : true, + install_dir : systemgeneratordir, + include_directories : includes, + link_with : [libshared]) + +executable('systemd-fstab-generator', + 'src/fstab-generator/fstab-generator.c', + 'src/core/mount-setup.c', + install : true, + install_dir : systemgeneratordir, + include_directories : includes, + link_with : [libshared]) + +if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 + executable('30-systemd-environment-d-generator', + 'src/environment-d-generator/environment-d-generator.c', + install : true, + install_dir : userenvgeneratordir, + include_directories : includes, + link_with : [libshared]) +endif + +if conf.get('ENABLE_HIBERNATE', 0) == 1 + executable('systemd-hibernate-resume-generator', + 'src/hibernate-resume/hibernate-resume-generator.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : systemgeneratordir) + + executable('systemd-hibernate-resume', + 'src/hibernate-resume/hibernate-resume.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('HAVE_BLKID', 0) == 1 + executable('systemd-gpt-auto-generator', + 'src/gpt-auto-generator/gpt-auto-generator.c', + 'src/basic/blkid-util.h', + install : true, + install_dir : systemgeneratordir, + include_directories : includes, + link_with : libshared, + dependencies : libblkid) + + executable('systemd-dissect', + 'src/dissect/dissect.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_RESOLVED', 0) == 1 + executable('systemd-resolved', + systemd_resolved_sources, + include_directories : includes, + link_with : [libshared, + ], + dependencies : [threads, + libm, + libidn], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-resolve', + systemd_resolve_sources, + include_directories : includes, + link_with : [libshared, + ], + dependencies : [threads, + libm, + libidn], + install : true) +endif + +if conf.get('ENABLE_LOGIND', 0) == 1 + executable('systemd-logind', + systemd_logind_sources, + include_directories : includes, + link_with : [liblogind_core, + libshared], + dependencies : [threads, + libacl], + install : true, + install_dir : rootlibexecdir) + + executable('loginctl', + loginctl_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + liblz4, + libxz], + install : true, + install_dir : rootbindir) + + executable('systemd-inhibit', + 'src/login/inhibit.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + + if conf.get('HAVE_PAM', 0) == 1 + shared_library( + 'pam_systemd', + pam_systemd_c, + name_prefix : '', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + pam_systemd_sym], + link_with : [libshared], + dependencies : [libpam, + libpam_misc], + install : true, + install_dir : pamlibdir) + endif +endif + +if conf.get('HAVE_PAM', 0) == 1 + executable('systemd-user-sessions', + 'src/user-sessions/user-sessions.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_EFI', 0) == 1 + executable('bootctl', + 'src/boot/bootctl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libblkid], + install : true) +endif + +executable('systemd-socket-activate', 'src/activate/activate.c', + include_directories : includes, + link_with : [libshared], + dependencies : [threads], + install : true) + +executable('systemctl', 'src/systemctl/systemctl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcap, + libselinux, + libxz, + liblz4], + install : true, + install_dir : rootbindir) + +if conf.get('ENABLE_BACKLIGHT', 0) == 1 + executable('systemd-backlight', + 'src/backlight/backlight.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_RFKILL', 0) == 1 + executable('systemd-rfkill', + 'src/rfkill/rfkill.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +executable('systemd-system-update-generator', + 'src/system-update-generator/system-update-generator.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : systemgeneratordir) + +if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 + executable('systemd-cryptsetup', + 'src/cryptsetup/cryptsetup.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-cryptsetup-generator', + 'src/cryptsetup/cryptsetup-generator.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install : true, + install_dir : systemgeneratordir) + + executable('systemd-veritysetup', + 'src/veritysetup/veritysetup.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-veritysetup-generator', + 'src/veritysetup/veritysetup-generator.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install : true, + install_dir : systemgeneratordir) +endif + +if conf.get('HAVE_SYSV_COMPAT', 0) == 1 + executable('systemd-sysv-generator', + 'src/sysv-generator/sysv-generator.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : systemgeneratordir) + + executable('systemd-rc-local-generator', + 'src/rc-local-generator/rc-local-generator.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : systemgeneratordir) +endif + +if conf.get('ENABLE_HOSTNAMED', 0) == 1 + executable('systemd-hostnamed', + 'src/hostname/hostnamed.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + + executable('hostnamectl', + 'src/hostname/hostnamectl.c', + include_directories : includes, + link_with : [libshared], + install : true) +endif + +if conf.get('ENABLE_LOCALED', 0) == 1 + executable('systemd-localed', + systemd_localed_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libdl], + install : true, + install_dir : rootlibexecdir) + + executable('localectl', + localectl_sources, + include_directories : includes, + link_with : [libshared], + install : true) +endif + +if conf.get('ENABLE_TIMEDATED', 0) == 1 + executable('systemd-timedated', + 'src/timedate/timedated.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + + executable('timedatectl', + 'src/timedate/timedatectl.c', + include_directories : includes, + link_with : [libshared], + install : true) +endif + +if conf.get('ENABLE_TIMESYNCD', 0) == 1 + executable('systemd-timesyncd', + systemd_timesyncd_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libm], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_MACHINED', 0) == 1 + executable('systemd-machined', + systemd_machined_sources, + include_directories : includes, + link_with : [libmachine_core, + libshared], + install : true, + install_dir : rootlibexecdir) + + executable('machinectl', + 'src/machine/machinectl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libxz, + liblz4], + install : true, + install_dir : rootbindir) +endif + +if conf.get('ENABLE_IMPORTD', 0) == 1 + executable('systemd-importd', + systemd_importd_sources, + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-pull', + systemd_pull_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz, + libgcrypt], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-import', + systemd_import_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-export', + systemd_export_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 + executable('systemd-journal-upload', + systemd_journal_upload_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcurl, + libgnutls, + libxz, + liblz4], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 + executable('systemd-journal-remote', + systemd_journal_remote_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install : true, + install_dir : rootlibexecdir) + + executable('systemd-journal-gatewayd', + systemd_journal_gatewayd_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_COREDUMP', 0) == 1 + executable('systemd-coredump', + systemd_coredump_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libacl, + libdw, + libxz, + liblz4], + install : true, + install_dir : rootlibexecdir) + + executable('coredumpctl', + coredumpctl_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libxz, + liblz4], + install : true) +endif + +if conf.get('ENABLE_BINFMT', 0) == 1 + executable('systemd-binfmt', + 'src/binfmt/binfmt.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_VCONSOLE', 0) == 1 + executable('systemd-vconsole-setup', + 'src/vconsole/vconsole-setup.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_RANDOMSEED', 0) == 1 + executable('systemd-random-seed', + 'src/random-seed/random-seed.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +if conf.get('ENABLE_FIRSTBOOT', 0) == 1 + executable('systemd-firstboot', + 'src/firstboot/firstboot.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcrypt], + install : true, + install_dir : rootbindir) +endif + +executable('systemd-remount-fs', + 'src/remount-fs/remount-fs.c', + 'src/core/mount-setup.c', + 'src/core/mount-setup.h', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-machine-id-setup', + 'src/machine-id-setup/machine-id-setup-main.c', + 'src/core/machine-id-setup.c', + 'src/core/machine-id-setup.h', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + +executable('systemd-fsck', + 'src/fsck/fsck.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-sleep', + 'src/sleep/sleep.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-sysctl', + 'src/sysctl/sysctl.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-ac-power', + 'src/ac-power/ac-power.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-detect-virt', + 'src/detect-virt/detect-virt.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-delta', + 'src/delta/delta.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-escape', + 'src/escape/escape.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + +executable('systemd-notify', + 'src/notify/notify.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + +executable('systemd-volatile-root', + 'src/volatile-root/volatile-root.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-cgroups-agent', + 'src/cgroups-agent/cgroups-agent.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-path', + 'src/path/path.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-ask-password', + 'src/ask-password/ask-password.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + +executable('systemd-reply-password', + 'src/reply-password/reply-password.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-tty-ask-password-agent', + 'src/tty-ask-password-agent/tty-ask-password-agent.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) + +executable('systemd-cgls', + 'src/cgls/cgls.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-cgtop', + 'src/cgtop/cgtop.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-initctl', + 'src/initctl/initctl.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-mount', + 'src/mount/mount-tool.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-run', + 'src/run/run.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('systemd-stdio-bridge', + 'src/stdio-bridge/stdio-bridge.c', + include_directories : includes, + link_with : [libshared], + install : true) + +executable('busctl', + 'src/busctl/busctl.c', + 'src/busctl/busctl-introspect.c', + 'src/busctl/busctl-introspect.h', + include_directories : includes, + link_with : [libshared], + install : true) + +if conf.get('ENABLE_SYSUSERS', 0) == 1 + executable('systemd-sysusers', + 'src/sysusers/sysusers.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) +endif + +if conf.get('ENABLE_TMPFILES', 0) == 1 + executable('systemd-tmpfiles', + 'src/tmpfiles/tmpfiles.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libacl], + install : true, + install_dir : rootbindir) +endif + +if conf.get('ENABLE_HWDB', 0) == 1 + executable('systemd-hwdb', + 'src/hwdb/hwdb.c', + 'src/libsystemd/sd-hwdb/hwdb-internal.h', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootbindir) +endif + +if conf.get('ENABLE_QUOTACHECK', 0) == 1 + executable('systemd-quotacheck', + 'src/quotacheck/quotacheck.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) +endif + +executable('systemd-socket-proxyd', + 'src/socket-proxy/socket-proxyd.c', + include_directories : includes, + link_with : [libshared, + libsystemd], + dependencies : [threads], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-udevd', + systemd_udevd_sources, + include_directories : includes, + link_with : [libudev_core, + libudev_internal, + libsystemd_network, + libshared], + dependencies : [libkmod, + libidn, + libacl], + install : true, + install_dir : rootlibexecdir) + +executable('udevadm', + udevadm_sources, + include_directories : includes, + link_with : [libudev_core, + libudev_internal, + libsystemd_network, + libshared], + dependencies : [libkmod, + libidn, + libacl], + install : true, + install_dir : rootbindir) + +executable('systemd-shutdown', + systemd_shutdown_sources, + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-update-done', + 'src/update-done/update-done.c', + include_directories : includes, + link_with : [libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-update-utmp', + 'src/update-utmp/update-utmp.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libaudit], + install : true, + install_dir : rootlibexecdir) + +if conf.get('HAVE_KMOD', 0) == 1 + executable('systemd-modules-load', + 'src/modules-load/modules-load.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libkmod], + install : true, + install_dir : rootlibexecdir) +endif + +executable('systemd-nspawn', + systemd_nspawn_sources, + 'src/core/mount-setup.c', # FIXME: use a variable? + 'src/core/mount-setup.h', + 'src/core/loopback-setup.c', + 'src/core/loopback-setup.h', + include_directories : [includes, include_directories('src/nspawn')], + link_with : [libfirewall, + libshared], + dependencies : [libacl, + libblkid, + libseccomp, + libselinux], + install : true) + +executable('systemd-networkd', + systemd_networkd_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libfirewall, + libsystemd_network, + libudev_internal, + libshared], + install : true, + install_dir : rootlibexecdir) + +executable('systemd-networkd-wait-online', + systemd_networkd_wait_online_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libshared], + install : true, + install_dir : rootlibexecdir) + +executable('networkctl', + networkctl_sources, + include_directories : includes, + link_with : [libsystemd_network, + libshared], + install : true, + install_dir : rootbindir) + +executable('test-sizeof', 'src/test/test-sizeof.c', + include_directories : includes) + +make_directive_index_py = find_program('tools/make-directive-index.py') +make_man_index_py = find_program('tools/make-man-index.py') + +subdir('units') +subdir('sysctl.d') +subdir('sysusers.d') +subdir('tmpfiles.d') +subdir('rules') +subdir('hwdb') +subdir('network') +subdir('man') +subdir('shell-completion/bash') +subdir('shell-completion/zsh') +subdir('docs/sysvinit') +subdir('docs/var-log') + +# FIXME: figure out if the warning is true: +# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir +install_subdir('factory/etc', + install_dir : factorydir) + + +install_data('xorg/50-systemd-user.sh', + install_dir : xinitrcdir) +install_data('system-preset/90-systemd.preset', + install_dir : systempresetdir) +install_data('README', + 'NEWS', + 'CODING_STYLE', + 'DISTRO_PORTING', + 'ENVIRONMENT.md', + 'LICENSE.GPL2', + 'LICENSE.LGPL2.1', + 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', + install_dir : docdir) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..8a08852983 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,191 @@ +# -*- mode: meson -*- + +option('split-usr', type : 'boolean', value : false, + description : '''assume that /bin, /sbin aren't symlinks into /usr''') +option('rootlibdir', type : 'string', + description : '''[/usr]/lib/x86_64-linux-gnu or such''') + +option('sysvinit-path', type : 'string', value : '/etc/init.d', + description : 'the directory where the SysV init scripts are located') +option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', + description : 'the base directory for SysV rcN.d directories') +option('telinit-path', type : 'string', description : 'path to telinit') + +option('quotaon-path', type : 'string', description : 'path to quotaon') +option('quotacheck-path', type : 'string', description : 'path to quotacheck') +option('kill-path', type : 'string', description : 'path to kill') +option('kmod-path', type : 'string', description : 'path to kmod') +option('kexec-path', type : 'string', description : 'path to kexec') +option('sulogin-path', type : 'string', description : 'path to sulogin') +option('mount-path', type : 'string', description : 'path to mount') +option('umount-path', type : 'string', description : 'path to umount') +option('loadkeys-path', type : 'string', description : 'path to loadkeys') +option('setfont-path', type : 'string', description : 'path to setfont') + +option('utmp', type : 'boolean', + description : 'support for utmp/wtmp log handling') +option('hibernate', type : 'boolean', + description : 'support for hibernation') +option('ldconfig', type : 'boolean', + description : 'support for dynamic linker cache creation') +option('resolve', type : 'boolean', + description : 'systemd-resolved stack') +option('efi', type : 'boolean', + description : 'support for EFI') +option('environment-d', type : 'boolean', + description : 'support for environment.d') +option('binfmt', type : 'boolean', + description : 'support for custom binary formats') +option('coredump', type : 'boolean', + description : 'install the coredump handler') +option('logind', type : 'boolean', + description : 'install the systemd-logind stack') +option('hostnamed', type : 'boolean', + description : 'install the systemd-hostnamed stack') +option('localed', type : 'boolean', + description : 'install the systemd-localed stack') +option('machined', type : 'boolean', + description : 'install the systemd-machined stack') +option('networkd', type : 'boolean', + description : 'install the systemd-networkd stack') +option('timedated', type : 'boolean', + description : 'install the systemd-timedated daemon') +option('timesyncd', type : 'boolean', + description : 'install the systemd-timesyncd daemon') +option('remote', type : 'boolean', + description : 'support for "journal over the network"') +option('myhostname', type : 'boolean', + description : 'nss-myhostname support') +option('firstboot', type : 'boolean', + description : 'support for firstboot mechanism') +option('randomseed', type : 'boolean', + description : 'support for restoring random seed') +option('backlight', type : 'boolean', + description : 'support for restoring backlight state') +option('vconsole', type : 'boolean', + description : 'support for vconsole configuration') +option('quotacheck', type : 'boolean', + description : 'support for the quotacheck tools') +option('sysusers', type : 'boolean', + description : 'support for the sysusers configuration') +option('tmpfiles', type : 'boolean', + description : 'support for tmpfiles.d') +option('importd', type : 'boolean', + description : 'install the systemd-importd daemon') +option('hwdb', type : 'boolean', + description : 'support for the hardware database') +option('rfkill', type : 'boolean', + description : 'support for the rfkill tools') + +option('certificate-root', type : 'string', value : '/etc/ssl', + description : 'the prefix for TLS certificates') +option('dbuspolicydir', type : 'string', + description : 'D-Bus policy directory') +option('dbussessionservicedir', type : 'string', + description : 'D-Bus session service directory') +option('dbussystemservicedir', type : 'string', + description : 'D-Bus system service directory') +option('pkgconfigdatadir', type : 'string', value : 'share/pkgconfig', + description : 'directory for ') +option('pkgconfiglibdir', type : 'string', value : '', + description : 'directory for ') +option('rpmmacrosdir', type : 'string', value : 'lib/rpm/macros.d', + description : 'directory for rpm macros ["no" disables]') +option('pamlibdir', type : 'string', + description : 'directory for PAM modules') +option('pamconfdir', type : 'string', + description : 'directory for PAM configuration ["no" disables]') + +option('fallback-hostname', type : 'string', value : 'localhost', + description : 'the hostname used if none configured') +option('default-hierarchy', type : 'combo', + choices : ['legacy', 'hybrid', 'unified'], value : 'hybrid', + description : 'default cgroup hierarchy') +option('time-epoch', type : 'string', + description : 'time epoch for time clients') +option('system-uid-max', type : 'string', + description : 'maximum system UID') +option('system-gid-max', type : 'string', + description : 'maximum system GID') +option('tty-gid', type : 'string', + description : 'the numeric GID of the "tty" group', + value : '5') +option('adm-group', type : 'boolean', + description : 'the ACL for adm group should be added') +option('wheel-group', type : 'boolean', + description : 'the ACL for wheel group should be added') +option('nobody-user', type : 'string', + description : 'The name of the nobody user (the one with UID 65534)', + value : 'nobody') +option('nobody-group', type : 'string', + description : 'The name of the nobody group (the one with GID 65534)', + value : 'nobody') +option('dev-kvm-mode', type : 'string', value : '0660', + description : '/dev/kvm access mode') +option('default-kill-user-processes', type : 'boolean', + description : 'the default value for KillUserProcesses= setting') + +option('default-dnssec', type : 'combo', + description : 'default DNSSEC mode', + choices : ['yes', 'allow-downgrade', 'no'], + value : 'allow-downgrade') +option('dns-servers', type : 'string', + description : 'space-separated list of default DNS servers', + value : '8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844') +option('ntp-servers', type : 'string', + description : 'space-separated list of default NTP servers', + value : 'time1.google.com time2.google.com time3.google.com time4.google.com') +option('support-url', type : 'string', + description : 'the support URL to show in catalog entries included in systemd', + value : 'https://lists.freedesktop.org/mailman/listinfo/systemd-devel') + +option('seccomp', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'SECCOMP support') +option('selinux', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'SELinux support') +option('apparmor', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'AppArmor support') +option('smack', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'SMACK support') +option('smack-run-label', type : 'string', + description : 'run systemd --system itself with a specific SMACK label') + +option('audit', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libaudit support') +option('blkid', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libblkid support') +option('kmod', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'support for loadable modules') +option('pam', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'PAM support') +option('microhttpd', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libµhttpd support') +option('libcryptsetup', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libcryptsetup support') +option('libcurl', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libcurl support') +option('libidn', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libidn support') +option('libiptc', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libiptc support') +option('qrencode', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libqrencode support') +option('libgcrypt', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libgcrypt support') +option('gnutls', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'gnutls support') +option('elfutils', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'elfutils support') +option('zlib', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'zlib compression support') +option('bzip2', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'bzip2 compression support') +option('xz', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'xz compression support') +option('lz4', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'lz4 compression support') + +option('bashcompletiondir', type : 'string', + description : 'directory for bash completion scripts ["no" disables]') +option('zshcompletiondir', type : 'string', + description : 'directory for zsh completion scripts ["no" disables]') diff --git a/network/meson.build b/network/meson.build new file mode 100644 index 0000000000..b578159b03 --- /dev/null +++ b/network/meson.build @@ -0,0 +1,9 @@ +# -*- mode: meson -*- + +if conf.get('ENABLE_NETWORKD', 0) == 1 + install_data('80-container-host0.network', + '80-container-ve.network', + '80-container-vz.network', + '99-default.link', + install_dir : networkdir) +endif diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..b95c2a3550 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,14 @@ +# -*- mode: meson -*- + +i18n = import('i18n') +i18n.gettext(meson.project_name()) + +##################################################################### + +intltool_merge = find_program('intltool-merge') +po_dir = meson.current_source_dir() + +intltool_cache = meson.current_build_dir() + '/intltool-merge-cache' +intltool_command = [intltool_merge, '-x', '-u', + '-c', intltool_cache, + po_dir, '@INPUT@', '@OUTPUT@'] diff --git a/rules/meson.build b/rules/meson.build new file mode 100644 index 0000000000..43142ca991 --- /dev/null +++ b/rules/meson.build @@ -0,0 +1,40 @@ +# -*- mode: meson -*- + +rules = files(''' + 60-block.rules + 60-cdrom_id.rules + 60-drm.rules + 60-evdev.rules + 60-persistent-alsa.rules + 60-persistent-input.rules + 60-persistent-storage.rules + 60-persistent-storage-tape.rules + 60-persistent-v4l.rules + 60-sensor.rules + 60-serial.rules + 64-btrfs.rules + 70-mouse.rules + 70-touchpad.rules + 75-net-description.rules + 75-probe_mtd.rules + 78-sound-card.rules + 80-drivers.rules + 80-net-setup-link.rules +'''.split()) + +install_data(rules, + install_dir : udevrulesdir) + +rules_in = ''' + 50-udev-default.rules + 99-systemd.rules +'''.split() + +foreach file : rules_in + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + install_data(gen, + install_dir : udevrulesdir) +endforeach diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build new file mode 100644 index 0000000000..bbd705c1cf --- /dev/null +++ b/shell-completion/bash/meson.build @@ -0,0 +1,52 @@ +# -*- mode: meson -*- + +bashcompletiondir = get_option('bashcompletiondir') +if bashcompletiondir == '' + bash_completion = dependency('bash-completion', required : false) + if bash_completion.found() + bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') + else + bashcompletiondir = datadir + '/bash-completion/completions' + endif + + message('bash completions: @0@'.format(bashcompletiondir)) +endif + +if bashcompletiondir != 'no' + bash_systemctl = configure_file( + input : 'systemctl.in', + output : 'systemctl', + configuration : substs) + + items = [['busctl', ''], + ['journalctl', ''], + ['systemd-analyze', ''], + ['systemd-cat', ''], + ['systemd-cgls', ''], + ['systemd-cgtop', ''], + ['systemd-delta', ''], + ['systemd-detect-virt', ''], + ['systemd-nspawn', ''], + ['systemd-path', ''], + ['systemd-run', ''], + ['udevadm', ''], + ['kernel-install', ''], + [bash_systemctl, ''], + ['bootctl', 'ENABLE_EFI'], + ['coredumpctl', 'ENABLE_COREDUMP'], + ['hostnamectl', 'ENABLE_HOSTNAMED'], + ['localectl', 'ENABLE_LOCALED'], + ['loginctl', 'ENABLE_LOGIND'], + ['machinectl', 'ENABLE_MACHINED'], + ['networkctl', 'ENABLE_NETWORKD'], + ['systemd-resolve', 'ENABLE_RESOLVED'], + ['timedatectl', 'ENABLE_TIMEDATED'], + ] + + foreach item : items + if item[1] == '' or conf.get(item[1], 0) == 1 + install_data(item[0], + install_dir : bashcompletiondir) + endif + endforeach +endif diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build new file mode 100644 index 0000000000..56bf7aeb03 --- /dev/null +++ b/shell-completion/zsh/meson.build @@ -0,0 +1,49 @@ +# -*- mode: meson -*- + +zshcompletiondir = get_option('zshcompletiondir') +if zshcompletiondir == '' + zshcompletiondir = datadir + '/zsh/site-functions' + + message('zsh completions: @0@'.format(zshcompletiondir)) +endif + +if zshcompletiondir != 'no' + zsh_systemctl = configure_file( + input : '_systemctl.in', + output : '_systemctl', + configuration : substs) + + items = [['_busctl', ''], + ['_journalctl', ''], + ['_systemd-analyze', ''], + ['_systemd-delta', ''], + ['_systemd-nspawn', ''], + ['_systemd', ''], + ['_systemd-run', ''], + ['_udevadm', ''], + ['_kernel-install', ''], + ['_sd_hosts_or_user_at_host', ''], + ['_sd_outputmodes', ''], + ['_sd_unit_files', ''], + ['_sd_machines', ''], + [zsh_systemctl, ''], + ['_bootctl', 'ENABLE_EFI'], + ['_coredumpctl', 'ENABLE_COREDUMP'], + ['_hostnamectl', 'ENABLE_HOSTNAMED'], + ['_localectl', 'ENABLE_LOCALED'], + ['_loginctl', 'ENABLE_LOGIND'], + ['_machinectl', 'ENABLE_MACHINED'], + ['_networkctl', 'ENABLE_NETWORKD'], + ['_systemd-inhibit', 'ENABLE_LOGIND'], + ['_systemd-resolve', 'ENABLE_RESOLVED'], + ['_systemd-tmpfiles', 'ENABLE_TMPFILES'], + ['_timedatectl', 'ENABLE_TIMEDATED'], + ] + + foreach item : items + if item[1] == '' or conf.get(item[1], 0) == 1 + install_data(item[0], + install_dir : zshcompletiondir) + endif + endforeach +endif diff --git a/src/analyze/meson.build b/src/analyze/meson.build new file mode 100644 index 0000000000..1ff6b182d1 --- /dev/null +++ b/src/analyze/meson.build @@ -0,0 +1,7 @@ +# -*- mode: meson -*- + +systemd_analyze_sources = files(''' + analyze.c + analyze-verify.c + analyze-verify.h +'''.split()) diff --git a/src/basic/af-to-name.awk b/src/basic/af-to-name.awk new file mode 100644 index 0000000000..e20830487f --- /dev/null +++ b/src/basic/af-to-name.awk @@ -0,0 +1,5 @@ +BEGIN{ print "static const char* const af_names[] = { "} +!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { + printf " [%s] = \"%s\",\n", $1, $1 +} +END{print "};"} diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk new file mode 100644 index 0000000000..57e4680f17 --- /dev/null +++ b/src/basic/arphrd-to-name.awk @@ -0,0 +1,5 @@ +BEGIN{ print "static const char* const arphrd_names[] = { "} +!/CISCO/ { + printf " [ARPHRD_%s] = \"%s\",\n", $1, $1 +} +END{print "};"} diff --git a/src/basic/cap-to-name.awk b/src/basic/cap-to-name.awk new file mode 100644 index 0000000000..d252291851 --- /dev/null +++ b/src/basic/cap-to-name.awk @@ -0,0 +1,5 @@ +BEGIN{ print "static const char* const capability_names[] = { "} +{ + printf " [%s] = \"%s\",\n", $1, tolower($1) +} +END{print "};"} diff --git a/src/basic/errno-to-name.awk b/src/basic/errno-to-name.awk new file mode 100644 index 0000000000..c48c8f93ab --- /dev/null +++ b/src/basic/errno-to-name.awk @@ -0,0 +1,4 @@ +BEGIN{ print "static const char* const errno_names[] = { " } +!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { + printf " [%s] = \"%s\",\n", $1, $1 } +END{ print "};" } diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh new file mode 100644 index 0000000000..e4f9f68312 --- /dev/null +++ b/src/basic/generate-af-list.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cpp -dM -include sys/socket.h - Date: Tue, 4 Apr 2017 23:21:04 -0400 Subject: [PATCH 04/82] make-man-rules: add support for generating the list in meson.build format v2: - sort the alias array too, otherwise the output is not stable --- tools/make-man-rules.py | 46 +++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py index 18aa513952..ecb9d2d9b5 100644 --- a/tools/make-man-rules.py +++ b/tools/make-man-rules.py @@ -3,7 +3,7 @@ # # This file is part of systemd. # -# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013, 2017 Zbigniew Jędrzejewski-Szmek # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by @@ -22,6 +22,7 @@ from __future__ import print_function import collections import sys import os.path +import pprint from xml_helper import * SECTION = '''\ @@ -66,11 +67,13 @@ EXTRA_DIST += \\ {dist_files} ''' +meson = False + def man(page, number): - return 'man/{}.{}'.format(page, number) + return ('man/' if not meson else '') + '{}.{}'.format(page, number) def xml(file): - return 'man/{}'.format(os.path.basename(file)) + return ('man/' if not meson else '') + os.path.basename(file) def add_rules(rules, name): xml = xml_parse(name) @@ -122,9 +125,40 @@ def make_makefile(rules, dist_files): for conditional,rulegroup in sorted(rules.items()) ) + FOOTER.format(dist_files=mjoin(sorted(dist_files))) +MESON_HEADER = '''\ +# Do not edit. Generated by make-man-rules.py. +manpages = [''' + +MESON_FOOTER = '''\ +] +# Really, do not edit.''' + +def make_mesonfile(rules, dist_files): + # reformat rules as + # grouped = [ [name, section, [alias...], condition], ...] + # + # but first create a dictionary like + # lists = { (name, condition) => [alias...] + grouped = collections.defaultdict(list) + for condition, items in rules.items(): + for alias, name in items.items(): + group = grouped[(name, condition)] + if name != alias: + group.append(alias) + + lines = [ [p[0][:-2], p[0][-1], sorted(a[:-2] for a in aliases), p[1]] + for p, aliases in sorted(grouped.items()) ] + return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER)) + if __name__ == '__main__': - rules = create_rules(sys.argv[1:]) - dist_files = (xml(file) for file in sys.argv[1:] + meson = sys.argv[1] == '--meson' + pages = sys.argv[1+meson:] + + rules = create_rules(pages) + dist_files = (xml(file) for file in pages if not file.endswith(".directives.xml") and not file.endswith(".index.xml")) - print(make_makefile(rules, dist_files), end='') + if meson: + print(make_mesonfile(rules, dist_files)) + else: + print(make_makefile(rules, dist_files), end='') From 78b68dcb55c4da1148296ca5b101d23fa3898f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Apr 2017 00:40:21 -0400 Subject: [PATCH 05/82] meson: avoid detecting m4 dir as a program This is a bug in meson, already fixed upstream. For now, just specify the full path. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 95445f9559..506b43dfca 100644 --- a/meson.build +++ b/meson.build @@ -380,7 +380,7 @@ endforeach sed = find_program('sed') grep = find_program('grep') awk = find_program('awk') -m4 = find_program('m4') +m4 = find_program('/usr/bin/m4') stat = find_program('stat') # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, From 04e3eb46e316dacc990bed1e520df44327bbf5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Apr 2017 19:44:41 -0400 Subject: [PATCH 06/82] meson: add rule to generate custom-entities.ent This is a bit bare-bones, but should work for now. Maybe in the future we'll have a way to make meson generate it for us, without specifying all the names by hand. --- man/custom-entities.ent.in | 7 +++++++ man/meson.build | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 man/custom-entities.ent.in diff --git a/man/custom-entities.ent.in b/man/custom-entities.ent.in new file mode 100644 index 0000000000..0257c2a94f --- /dev/null +++ b/man/custom-entities.ent.in @@ -0,0 +1,7 @@ + + + + + + + diff --git a/man/meson.build b/man/meson.build index 0f0bbd6ffc..c78c24d3e6 100644 --- a/man/meson.build +++ b/man/meson.build @@ -20,7 +20,11 @@ xsltproc_flags = [ custom_man_xsl = files('custom-man.xsl') custom_html_xsl = files('custom-man.xsl') -custom_entities_ent = files('custom-entities.ent') + +custom_entities_ent = configure_file( + input : 'custom-entities.ent.in', + output : 'custom-entities.ent', + configuration : conf) foreach tuple : manpages stem = tuple[0] @@ -48,6 +52,7 @@ foreach tuple : manpages input : xml, output : [man] + manaliases, command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], + depend_files : custom_entities_ent, install : install, install_dir : mandirn) @@ -55,7 +60,8 @@ foreach tuple : manpages html, input : xml, output : [html] + htmlaliases, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@']) + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], + depend_files : custom_entities_ent) if not install message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, install)) From 527d43d7012d9f9a33be18b51306487edfe5ae57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Apr 2017 22:46:03 -0400 Subject: [PATCH 07/82] meson: add custom targets man/man and man/html This provides functionality similar to the ./configure --disable-manpages switch. Man pages are built by default (if xsltproc is found), html pages are not. Those default can be changed with -Dman=no, -Dhtml=yes/auto. It is still possible to build one or the either, even if not configured, with ninja-build man/man and ninja-build man/html. v2: - obey conditionals in index/directives list --- man/meson.build | 80 ++++++++++++++++++++++++++++++----------------- meson_options.txt | 5 +++ 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/man/meson.build b/man/meson.build index c78c24d3e6..691750c466 100644 --- a/man/meson.build +++ b/man/meson.build @@ -6,7 +6,13 @@ subdir('rules') # TODO: add regeneration rule: # python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build -xsltproc = find_program('xsltproc') +want_man = get_option('man') +want_html = get_option('html') +xsltproc = find_program('xsltproc', + required : want_man == 'yes' or want_html == 'yes') +want_man = want_man != 'no' and xsltproc.found() +want_html = want_html != 'no' and xsltproc.found() + xsltproc_flags = [ '--nonet', '--xinclude', @@ -19,13 +25,16 @@ xsltproc_flags = [ '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())] custom_man_xsl = files('custom-man.xsl') -custom_html_xsl = files('custom-man.xsl') +custom_html_xsl = files('custom-html.xsl') custom_entities_ent = configure_file( input : 'custom-entities.ent.in', output : 'custom-entities.ent', configuration : conf) +man_pages = [] +html_pages = [] +source_xml_files = [] foreach tuple : manpages stem = tuple[0] section = tuple[1] @@ -45,36 +54,37 @@ foreach tuple : manpages mandirn = get_option('mandir') + '/man' + section - install = condition == '' or conf.get(condition, 0) == 1 + have = condition == '' or conf.get(condition, 0) == 1 - custom_target( - man, - input : xml, - output : [man] + manaliases, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], - depend_files : custom_entities_ent, - install : install, - install_dir : mandirn) + if have + p1 = custom_target( + man, + input : xml, + output : [man] + manaliases, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], + depend_files : custom_entities_ent, + install : want_man, + install_dir : mandirn) + man_pages += [p1] - custom_target( - html, - input : xml, - output : [html] + htmlaliases, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], - depend_files : custom_entities_ent) + p2 = custom_target( + html, + input : xml, + output : [html] + htmlaliases, + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], + depend_files : custom_entities_ent, + install : want_html, + install_dir : docdir + '/html') + html_pages += [p2] - if not install - message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, install)) + source_xml_files += files(tuple[0] + '.xml') + else + message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, have)) endif endforeach ############################################################ -source_xml_files = files() -foreach tuple : manpages - source_xml_files += files(tuple[0] + '.xml') -endforeach - systemd_directives_xml = custom_target( 'systemd.directives.xml', input : source_xml_files, @@ -99,17 +109,31 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], mandirn = get_option('mandir') + '/man' + section - custom_target( + p1 = custom_target( man, input : xml, output : man, command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], - install : install, + install : want_man, install_dir : mandirn) + man_pages += [p1] - custom_target( + p2 = custom_target( html, input : xml, output : html, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@']) + command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], + install : want_html, + install_dir : docdir + '/html') + html_pages += [p2] endforeach + +custom_target('man', + depends : man_pages, + output : ['man'], + command : ['echo']) + +custom_target('html', + depends : html_pages, + output : ['html'], + command : ['echo']) diff --git a/meson_options.txt b/meson_options.txt index 8a08852983..cc93310679 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -76,6 +76,11 @@ option('hwdb', type : 'boolean', description : 'support for the hardware database') option('rfkill', type : 'boolean', description : 'support for the rfkill tools') +option('man', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'build and install man pages') +option('html', type : 'combo', choices : ['auto', 'yes', 'no'], + value : 'no', + description : 'build and install html pages') option('certificate-root', type : 'string', value : '/etc/ssl', description : 'the prefix for TLS certificates') From d68b342b03dea3ddd675200ae2ee82fc36160def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 6 Apr 2017 14:33:27 -0400 Subject: [PATCH 08/82] meson: add TAGS target Quite necessary for all the emacs users out there ;) v2: - fix error with etags or git are not found v3: - move the definition of git and etags up so it's available for man/ --- meson.build | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/meson.build b/meson.build index 506b43dfca..20c6cd1a8b 100644 --- a/meson.build +++ b/meson.build @@ -382,6 +382,8 @@ grep = find_program('grep') awk = find_program('awk') m4 = find_program('/usr/bin/m4') stat = find_program('stat') +git = find_program('git', required : false) +etags = find_program('etags', required : false) # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. @@ -1855,3 +1857,20 @@ install_data('README', 'LICENSE.LGPL2.1', 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', install_dir : docdir) + +############################################################ + +if git.found() and etags.found() + all_files = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'ls-files', + ':/*.[ch]']) + all_files = files(all_files.stdout().split()) + + custom_target( + 'TAGS', + output : 'TAGS', + input : all_files, + command : [etags, '-o', '@OUTPUT@'] + all_files) +endif From 69e96427a2a77a4d1061ab9c54b9fd3dd1deafca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 7 Apr 2017 00:19:09 -0400 Subject: [PATCH 09/82] meson: define tests Tests can be run with 'ninja-build test' or using 'mesontest'. '-Dtests=unsafe' can be used to include the "unsafe" tests in the test suite, same as with autotools. v2: - use more conf.get guards are optional components - declare deps on generated headers for test-{af,arphrd,cap}-list v3: - define environment for tests Most test don't need this, but to be consistent with autotools-based build, and to avoid questions which tests need it and which don't, set the same environment for all tests. v4: - rework test generation Use a list of lists to define each test. This way we can reduce the boilerplate somewhat, although the test listings are still pretty verbose. We can also move the definitions of the tests to the subdirs. Unfortunately some subdirs are included earlier than some of the libraries that test binaries are linked to. So just dump all definitions of all tests that cannot be defined earlier into src/test. The `executable` definitions are still at the top level, so the binaries are compiled into the build root. v5: - tag test-dnssec-complex as manual v6: - fix HAVE_LIBZ typo - add missing libgobject/libgio defs - mark test-qcow2 as manual --- catalog/meson.build | 1 + meson.build | 99 ++++- meson_options.txt | 7 + src/coredump/meson.build | 9 + src/import/meson.build | 9 + src/libsystemd/meson.build | 92 ++++ src/locale/meson.build | 14 + src/machine/meson.build | 8 + src/network/meson.build | 28 ++ src/nspawn/meson.build | 9 + src/resolve/meson.build | 34 ++ src/shared/meson.build | 4 +- src/test/meson.build | 699 ++++++++++++++++++++++++++++++ src/test/test-hashmap-ordered.awk | 11 + src/udev/meson.build | 3 +- 15 files changed, 1010 insertions(+), 17 deletions(-) create mode 100644 src/test/meson.build create mode 100644 src/test/test-hashmap-ordered.awk diff --git a/catalog/meson.build b/catalog/meson.build index b50792ee2e..0ac48f69c3 100644 --- a/catalog/meson.build +++ b/catalog/meson.build @@ -16,6 +16,7 @@ in_files = ''' support_url = get_option('support-url') support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url) +build_catalog_dir = meson.current_build_dir() foreach file : in_files custom_target( diff --git a/meson.build b/meson.build index 20c6cd1a8b..f7bcf48b9e 100644 --- a/meson.build +++ b/meson.build @@ -789,6 +789,37 @@ if libacl.found() m4_defines += ['-DHAVE_ACL'] endif +want_glib = get_option('glib') +if want_glib != 'no' + libglib = dependency('glib-2.0', + version : '>= 2.22.0', + required : want_glib == 'yes') + libgobject = dependency('gobject-2.0', + version : '>= 2.22.0', + required : want_glib == 'yes') + libgio = dependency('gio-2.0', + required : want_glib == 'yes') + if libglib.found() and libgobject.found() and libgio.found() + conf.set('HAVE_GLIB', 1) + endif +else + libglib = [] + libgobject = [] + libgio = [] +endif + +want_dbus = get_option('dbus') +if want_dbus != 'no' + libdbus = dependency('dbus-1', + version : '>= 1.3.2', + required : want_dbus == 'yes') + if libdbus.found() + conf.set('HAVE_DBUS', 1) + endif +else + libdbus = [] +endif + want_libgcrypt = get_option('libgcrypt') if want_libgcrypt != 'no' libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'yes') @@ -860,6 +891,9 @@ foreach pair : [['utmp', 'HAVE_UTMP'], endif endforeach +want_tests = get_option('tests') +tests = [] + ##################################################################### if get_option('efi') @@ -914,21 +948,8 @@ subdir('src/systemd') subdir('src/basic') subdir('src/libsystemd') subdir('src/libsystemd-network') -subdir('src/analyze') -subdir('src/coredump') -subdir('src/hostname') -subdir('src/import') subdir('src/journal') -subdir('src/journal-remote') -subdir('src/kernel-install') -subdir('src/locale') subdir('src/login') -subdir('src/machine') -subdir('src/nspawn') -subdir('src/resolve') -subdir('src/timedate') -subdir('src/timesync') -subdir('src/vconsole') libjournal_core = static_library( 'journal-core', @@ -993,6 +1014,22 @@ subdir('src/core') subdir('src/udev') subdir('src/network') +subdir('src/analyze') +subdir('src/journal-remote') +subdir('src/coredump') +subdir('src/hostname') +subdir('src/import') +subdir('src/kernel-install') +subdir('src/locale') +subdir('src/machine') +subdir('src/nspawn') +subdir('src/resolve') +subdir('src/timedate') +subdir('src/timesync') +subdir('src/vconsole') + +subdir('src/test') + executable('systemd', systemd_sources, include_directories : includes, @@ -1819,8 +1856,40 @@ executable('networkctl', install : true, install_dir : rootbindir) -executable('test-sizeof', 'src/test/test-sizeof.c', - include_directories : includes) +############################################################ + +foreach tuple : tests + sources = tuple[0] + link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] + dependencies = tuple[2] + condition = tuple.length() >= 4 ? tuple[3] : '' + type = tuple.length() >= 5 ? tuple[4] : '' + defs = tuple.length() >= 6 ? tuple[5] : [] + incs = tuple.length() >= 7 ? tuple[6] : includes + + name = sources[0].split('/')[-1].split('.')[0] + + if condition == '' or conf.get(condition, 0) == 1 + exe = executable( + name, + sources, + include_directories : incs, + link_with : link_with, + dependencies : dependencies, + c_args : defs) + if type == 'manual' + message('@0@ is a manual test'.format(name)) + elif type == 'unsafe' and want_tests != 'unsafe' + message('@0@ is an unsafe test'.format(name)) + else + test(name, exe, env : test_env) + endif + else + message('Not compiling @0@ because @1@ is not true'.format(name, condition)) + endif +endforeach + +############################################################ make_directive_index_py = find_program('tools/make-directive-index.py') make_man_index_py = find_program('tools/make-man-index.py') diff --git a/meson_options.txt b/meson_options.txt index cc93310679..9295b9c27c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -189,8 +189,15 @@ option('xz', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'xz compression support') option('lz4', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'lz4 compression support') +option('glib', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libglib support (for tests only)') +option('dbus', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'libdbus support (for tests only)') option('bashcompletiondir', type : 'string', description : 'directory for bash completion scripts ["no" disables]') option('zshcompletiondir', type : 'string', description : 'directory for zsh completion scripts ["no" disables]') + +option('tests', type : 'combo', choices : ['yes', 'unsafe'], + description : 'enable extra tests with =unsafe') diff --git a/src/coredump/meson.build b/src/coredump/meson.build index c7aa8be46c..f70a65f7a7 100644 --- a/src/coredump/meson.build +++ b/src/coredump/meson.build @@ -15,3 +15,12 @@ coredumpctl_sources = files('coredumpctl.c') install_data('coredump.conf', install_dir : pkgsysconfdir) + +tests += [ + [['src/coredump/test-coredump-vacuum.c', + 'src/coredump/coredump-vacuum.c', + 'src/coredump/coredump-vacuum.h'], + [], + [], + 'ENABLE_COREDUMP', 'manual'], + ] diff --git a/src/import/meson.build b/src/import/meson.build index 0c9c4fb46c..173d6d6f3f 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -68,3 +68,12 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 install_dir : rootlibexecdir) # TODO: shouldn't this be in pkgdatadir? endif + +tests += [ + [['src/import/test-qcow2.c', + 'src/import/qcow2-util.c', + 'src/import/qcow2-util.h'], + [libshared], + [libz], + 'HAVE_ZLIB', 'manual'], + ] diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index e46b57ae68..9c6e494b93 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -96,3 +96,95 @@ libsystemd_pc = configure_file( configuration : substs) install_data(libsystemd_pc, install_dir : pkgconfiglibdir) + +tests += [ + [['src/libsystemd/sd-bus/test-bus-marshal.c'], + [], + [libglib, + libgobject, + libgio, + libdbus]], + + [['src/libsystemd/sd-bus/test-bus-signature.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-chat.c'], + [], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-cleanup.c'], + [], + [libseccomp]], + + [['src/libsystemd/sd-bus/test-bus-track.c'], + [], + [libseccomp]], + + [['src/libsystemd/sd-bus/test-bus-server.c'], + [], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-objects.c'], + [], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-error.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-gvariant.c'], + [], + [libglib, + libgobject, + libgio]], + + [['src/libsystemd/sd-bus/test-bus-creds.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-match.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-benchmark.c'], + [], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-introspect.c'], + [], + []], + + [['src/libsystemd/sd-event/test-event.c'], + [], + []], + + [['src/libsystemd/sd-netlink/test-netlink.c'], + [], + []], + + [['src/libsystemd/sd-netlink/test-local-addresses.c'], + [], + []], + + [['src/libsystemd/sd-resolve/test-resolve.c'], + [], + [threads]], + + [['src/libsystemd/sd-login/test-login.c'], + [], + [], + '', 'manual'], + ] diff --git a/src/locale/meson.build b/src/locale/meson.build index 0f3c5b2094..2f903cffd0 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -23,6 +23,20 @@ if conf.get('ENABLE_LOCALED', 0) == 1 install_dir : polkitpolicydir) endif +# If you know a way that allows the same variables to be used +# in sources list and concatenated to a string for test_env, +# let me know. +kbd_model_map = meson.current_source_dir() + '/kbd-model-map' +language_fallback_map = meson.current_source_dir() + '/language-fallback-map' + install_data('kbd-model-map', 'language-fallback-map', install_dir : pkgdatadir) + +tests += [ + [['src/locale/test-keymap-util.c', + 'src/locale/keymap-util.c', + 'src/locale/keymap-util.h'], + [libshared], + [libdl]], + ] diff --git a/src/machine/meson.build b/src/machine/meson.build index 8e2ca64665..1d83fece05 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -37,3 +37,11 @@ if conf.get('ENABLE_MACHINED', 0) == 1 install : true, install_dir : polkitpolicydir) endif + +tests += [ + [['src/machine/test-machine-tables.c'], + [libmachine_core, + libshared], + [], + 'ENABLE_MACHINED'], + ] diff --git a/src/network/meson.build b/src/network/meson.build index 8af6cfde0c..8a15016307 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -73,6 +73,8 @@ systemd_networkd_wait_online_sources = files(''' networkctl_sources = files('networkctl.c') +network_include_dir = include_directories('.') + if conf.get('ENABLE_NETWORKD', 0) == 1 networkd_gperf_c = custom_target( 'networkd-gperf.c', @@ -109,3 +111,29 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_data('systemd-networkd.rules', install_dir : polkitrulesdir) endif + +tests += [ + [['src/network/test-networkd-conf.c'], + [libnetworkd_core, + libsystemd_network], + []], + + [['src/network/test-network.c'], + [libnetworkd_core, + libudev_internal, + libsystemd_network, + libfirewall], + [libiptc]], + + [['src/network/test-network-tables.c', + 'src/network/test-network-tables.c', + test_tables_h], + [libnetworkd_core, + libudev_internal, + libudev_core, + libsystemd_network, + libfirewall], + [], + '', '', [], + [network_include_dir] + libudev_core_includes], + ] diff --git a/src/nspawn/meson.build b/src/nspawn/meson.build index 7f91eaf2d7..c231486cfc 100644 --- a/src/nspawn/meson.build +++ b/src/nspawn/meson.build @@ -31,3 +31,12 @@ nspawn_gperf_c = custom_target( command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) systemd_nspawn_sources += [nspawn_gperf_c] + +tests += [ + [['src/nspawn/test-patch-uid.c', + 'src/nspawn/nspawn-patch-uid.c', + 'src/nspawn/nspawn-patch-uid.h'], + [libshared], + [libacl], + '', 'manual'], + ] diff --git a/src/resolve/meson.build b/src/resolve/meson.build index b2250180f0..5ece75b5be 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -143,3 +143,37 @@ endif install_data('resolv.conf', install_dir : rootlibexecdir) + +tests += [ + [['src/resolve/test-resolve-tables.c', + basic_dns_sources, + dns_type_headers, + 'src/shared/test-tables.h'], + [libshared], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], + + [['src/resolve/test-dns-packet.c', + basic_dns_sources, + dns_type_headers], + [libshared], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], + + [['src/resolve/test-dnssec.c', + basic_dns_sources, + dns_type_headers], + [libshared], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], + + [['src/resolve/test-dnssec-complex.c', + 'src/resolve/dns-type.c', + dns_type_headers], + [libshared], + [], + 'ENABLE_RESOLVED', 'manual'], + ] diff --git a/src/shared/meson.build b/src/shared/meson.build index f0bc8043e1..bbe08e983b 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -89,7 +89,6 @@ shared_sources = ''' sysctl-util.h tests.c tests.h - test-tables.h udev-util.h uid-range.c uid-range.h @@ -102,6 +101,9 @@ shared_sources = ''' watchdog.h '''.split() +test_tables_h = files('test-tables.h') +shared_sources += [test_tables_h] + if conf.get('HAVE_ACL', 0) == 1 shared_sources += ['acl-util.c'] endif diff --git a/src/test/meson.build b/src/test/meson.build new file mode 100644 index 0000000000..df074d8f19 --- /dev/null +++ b/src/test/meson.build @@ -0,0 +1,699 @@ +# -*- mode: meson -*- + +awkscript = 'test-hashmap-ordered.awk' +test_hashmap_ordered_c = custom_target( + 'test-hashmap-ordered.c', + input : [awkscript, 'test-hashmap-plain.c'], + output : 'test-hashmap-ordered.c', + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) + +test_include_dir = include_directories('.') + +path = run_command('sh', ['-c', 'echo "$PATH"']).stdout() +test_env = environment() +test_env.set('SYSTEMD_KBD_MODEL_MAP', kbd_model_map) +test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map) +test_env.set('PATH', path) +test_env.prepend('PATH', meson.build_root()) + +tests += [ + [['src/test/test-device-nodes.c'], + [libshared], + []], + + [['src/test/test-engine.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-job-type.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-ns.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount], + '', 'unsafe'], + + [['src/test/test-loopback.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-hostname.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount], + '', 'unsafe'], + + [['src/test/test-dns-domain.c'], + [libcore, + libsystemd_network], + []], + + [['src/test/test-boot-timestamps.c'], + [libshared], + [], + 'ENABLE_EFI'], + + [['src/test/test-unit-name.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-unit-file.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-utf8.c'], + [libshared], + []], + + [['src/test/test-capability.c'], + [libshared], + [libcap]], + + [['src/test/test-async.c'], + [libshared], + []], + + [['src/test/test-locale-util.c'], + [libshared], + []], + + [['src/test/test-copy.c'], + [libshared], + []], + + [['src/test/test-sigbus.c'], + [libshared], + []], + + [['src/test/test-condition.c'], + [libshared], + []], + + [['src/test/test-fdset.c'], + [libshared], + []], + + [['src/test/test-fstab-util.c'], + [libshared], + []], + + [['src/test/test-ratelimit.c'], + [libshared], + []], + + [['src/test/test-util.c'], + [libshared], + []], + + [['src/test/test-mount-util.c'], + [libshared], + []], + + [['src/test/test-exec-util.c'], + [libshared], + []], + + [['src/test/test-hexdecoct.c'], + [libshared], + []], + + [['src/test/test-alloc-util.c'], + [libshared], + []], + + [['src/test/test-xattr-util.c'], + [libshared], + []], + + [['src/test/test-io-util.c'], + [libshared], + []], + + [['src/test/test-glob-util.c'], + [libshared], + []], + + [['src/test/test-fs-util.c'], + [libshared], + []], + + [['src/test/test-proc-cmdline.c'], + [libshared], + []], + + [['src/test/test-fd-util.c'], + [libshared], + []], + + [['src/test/test-web-util.c'], + [libshared], + []], + + [['src/test/test-cpu-set-util.c'], + [libshared], + []], + + [['src/test/test-stat-util.c'], + [libshared], + []], + + [['src/test/test-escape.c'], + [libshared], + []], + + [['src/test/test-string-util.c'], + [libshared], + []], + + [['src/test/test-extract-word.c'], + [libshared], + []], + + [['src/test/test-parse-util.c'], + [libshared], + []], + + [['src/test/test-user-util.c'], + [libshared], + []], + + [['src/test/test-hostname-util.c'], + [libshared], + []], + + [['src/test/test-process-util.c'], + [libshared], + []], + + [['src/test/test-terminal-util.c'], + [libshared], + []], + + [['src/test/test-path-lookup.c'], + [libshared], + []], + + [['src/test/test-uid-range.c'], + [libshared], + []], + + [['src/test/test-cap-list.c', + generated_gperf_headers], + [libshared], + [libcap]], + + [['src/test/test-socket-util.c'], + [libshared], + []], + + [['src/test/test-barrier.c'], + [libshared], + []], + + [['src/test/test-tmpfiles.c'], + [libshared], + []], + + [['src/test/test-namespace.c'], + [libcore], + []], + + [['src/test/test-verbs.c'], + [libshared], + []], + + [['src/test/test-install-root.c'], + [libshared], + []], + + [['src/test/test-acl-util.c'], + [libshared], + [], + 'HAVE_ACL'], + + [['src/test/test-seccomp.c'], + [libshared], + [libseccomp], + 'HAVE_SECCOMP'], + + [['src/test/test-rlimit-util.c'], + [libshared], + []], + + [['src/test/test-ask-password-api.c'], + [libshared], + [], + '', 'manual'], + + [['src/test/test-dissect-image.c'], + [libshared], + [libblkid], + '', 'manual'], + + [['src/test/test-signal-util.c'], + [libshared], + []], + + [['src/test/test-selinux.c'], + [libshared], + []], + + [['src/test/test-sizeof.c'], + [], + []], + + [['src/test/test-hashmap.c', + 'src/test/test-hashmap-plain.c', + test_hashmap_ordered_c], + [libshared], + []], + + [['src/test/test-set.c'], + [libshared], + []], + + [['src/test/test-bitmap.c'], + [libshared], + []], + + [['src/test/test-xml.c'], + [libshared], + []], + + [['src/test/test-list.c'], + [libshared], + []], + + [['src/test/test-unaligned.c'], + [libshared], + []], + + [['src/test/test-tables.c', + 'src/shared/test-tables.h', + 'src/journal/journald-server.c', + 'src/journal/journald-server.h'], + [libcore, + libjournal_core, + libudev_core, + libudev_internal, + libsystemd_network], + [threads, + libseccomp, + libmount, + libxz, + liblz4], + '', '', [], libudev_core_includes], + + [['src/test/test-prioq.c'], + [libshared], + []], + + [['src/test/test-fileio.c'], + [libshared], + []], + + [['src/test/test-time.c'], + [libshared], + []], + + [['src/test/test-clock.c'], + [libshared], + []], + + [['src/test/test-architecture.c'], + [libshared], + []], + + [['src/test/test-log.c'], + [libshared], + []], + + [['src/test/test-ipcrm.c'], + [libshared], + [], + '', 'unsafe'], + + [['src/test/test-btrfs.c'], + [libshared], + [], + '', 'manual'], + + + [['src/test/test-firewall-util.c'], + [libfirewall, + libshared], + [], + 'HAVE_LIBIPTC'], + + [['src/test/test-netlink-manual.c'], + [libshared], + [libkmod], + '', 'manual'], + + [['src/test/test-ellipsize.c'], + [libshared], + []], + + [['src/test/test-date.c'], + [libshared], + []], + + [['src/test/test-sleep.c'], + [libshared], + []], + + [['src/test/test-replace-var.c'], + [libshared], + []], + + [['src/test/test-calendarspec.c'], + [libshared], + []], + + [['src/test/test-strip-tab-ansi.c'], + [libshared], + []], + + [['src/test/test-daemon.c'], + [libshared], + []], + + [['src/test/test-cgroup.c'], + [libshared], + [], + '', 'manual'], + + + [['src/test/test-cgroup-mask.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-cgroup-util.c'], + [libshared], + []], + + [['src/test/test-env-util.c'], + [libshared], + []], + + [['src/test/test-strbuf.c'], + [libshared], + []], + + [['src/test/test-strv.c'], + [libshared], + []], + + [['src/test/test-path-util.c'], + [libshared], + []], + + [['src/test/test-path.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-execute.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-siphash24.c'], + [libshared], + []], + + [['src/test/test-strxcpyx.c'], + [libshared], + []], + + [['src/test/test-install.c'], + [libcore], + [], + '', 'manual'], + + [['src/test/test-watchdog.c'], + [libshared], + []], + + [['src/test/test-sched-prio.c'], + [libcore], + [librt, + libseccomp, + libselinux, + libmount]], + + [['src/test/test-conf-files.c'], + [libshared], + []], + + [['src/test/test-conf-parser.c'], + [libshared], + []], + + [['src/test/test-af-list.c', + generated_gperf_headers], + [libshared], + []], + + [['src/test/test-arphrd-list.c', + generated_gperf_headers], + [libshared], + []], + + [['src/test/test-journal-importer.c'], + [libshared], + []], + + [['src/test/test-libudev.c'], + [libshared], + []], + + [['src/test/test-udev.c'], + [libudev_core, + libudev_internal, + libsystemd_network, + libshared], + [librt, + libblkid, + libkmod, + libacl], + '', 'manual'], + + [['src/test/test-id128.c'], + [libshared], + []], + + [['src/test/test-hash.c'], + [libshared], + []], + + [['src/test/test-nss.c'], + [libshared], + [libdl], + '', 'manual'], + ] + +############################################################ + +# define some tests here, because the link_with deps were not defined earlier + +tests += [ + [['src/journal/test-journal.c'], + [libjournal_core], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-send.c'], + [libjournal_core, + libshared], + []], + + [['src/journal/test-journal-syslog.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-match.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-enum.c'], + [libshared], + []], + + [['src/journal/test-journal-stream.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-flush.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-init.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-verify.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-interleaving.c'], + [libshared], + [threads, + libxz, + liblz4]], + + [['src/journal/test-mmap-cache.c'], + [libshared], + []], + + [['src/journal/test-catalog.c'], + [libshared], + [], + '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)], + + [['src/journal/test-compress.c'], + [libshared], + [liblz4, + libxz]], + + [['src/journal/test-compress-benchmark.c'], + [libshared], + [liblz4, + libxz]], + + [['src/journal/test-audit-type.c'], + [libshared], + []], + ] + +############################################################ + +tests += [ + [['src/libsystemd-network/test-dhcp-option.c', + 'src/libsystemd-network/dhcp-protocol.h', + 'src/libsystemd-network/dhcp-internal.h'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-dhcp-client.c', + 'src/libsystemd-network/dhcp-protocol.h', + 'src/libsystemd-network/dhcp-internal.h', + 'src/systemd/sd-dhcp-client.h'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-dhcp-server.c'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-ipv4ll.c', + 'src/libsystemd-network/arp-util.h', + 'src/systemd/sd-ipv4ll.h'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-ipv4ll-manual.c', + 'src/systemd/sd-ipv4ll.h'], + [libshared, + libsystemd_network], + [], + '', 'manual'], + + [['src/libsystemd-network/test-acd.c', + 'src/systemd/sd-ipv4acd.h'], + [libshared, + libsystemd_network], + [], + '', 'manual'], + + [['src/libsystemd-network/test-ndisc-rs.c', + 'src/libsystemd-network/dhcp-identifier.h', + 'src/libsystemd-network/dhcp-identifier.c', + 'src/libsystemd-network/icmp6-util.h', + 'src/systemd/sd-dhcp6-client.h', + 'src/systemd/sd-ndisc.h'], + [libshared, + libsystemd_network, + libudev], + []], + + [['src/libsystemd-network/test-dhcp6-client.c', + 'src/libsystemd-network/dhcp-identifier.h', + 'src/libsystemd-network/dhcp-identifier.c', + 'src/libsystemd-network/dhcp6-internal.h', + 'src/systemd/sd-dhcp6-client.h'], + [libshared, + libsystemd_network, + libudev], + []], + + [['src/libsystemd-network/test-lldp.c'], + [libshared, + libsystemd_network], + []], + ] + +############################################################ + +tests += [ + [['src/login/test-login-shared.c'], + [libshared], + []], + + [['src/login/test-inhibit.c'], + [libshared], + [], + '', 'manual'], + + [['src/login/test-login-tables.c'], + [liblogind_core, + libshared], + []], + ] diff --git a/src/test/test-hashmap-ordered.awk b/src/test/test-hashmap-ordered.awk new file mode 100644 index 0000000000..4e75a4655a --- /dev/null +++ b/src/test/test-hashmap-ordered.awk @@ -0,0 +1,11 @@ +BEGIN { + print "/* GENERATED FILE */"; + print "#define ORDERED" +} +{ + if (!match($0, "^#include")) + gsub(/hashmap/, "ordered_hashmap"); + gsub(/HASHMAP/, "ORDERED_HASHMAP"); + gsub(/Hashmap/, "OrderedHashmap"); + print +} diff --git a/src/udev/meson.build b/src/udev/meson.build index 4965ee3534..6edec7dabc 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -92,12 +92,13 @@ link_config_gperf_c = custom_target( ############################################################ +libudev_core_includes = [includes, include_directories('net')] libudev_core = static_library( 'udev-core', libudev_core_sources, link_config_gperf_c, keyboard_keys_from_name_h, - include_directories : [includes, include_directories('net')], + include_directories : libudev_core_includes, link_with : [libshared]) executable('ata_id', From 572baca1d4bad218805b71be7f92b2c0385ec1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 8 Apr 2017 01:55:38 -0400 Subject: [PATCH 10/82] meson: add option to install tests Instead of a separate target as with make, it is decided at configure time whether to install tests as part of the install target. The effect should be the same. --- meson.build | 8 +++++++- meson_options.txt | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f7bcf48b9e..fc03f68d10 100644 --- a/meson.build +++ b/meson.build @@ -892,6 +892,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], endforeach want_tests = get_option('tests') +install_tests = get_option('install-tests') tests = [] ##################################################################### @@ -1870,13 +1871,18 @@ foreach tuple : tests name = sources[0].split('/')[-1].split('.')[0] if condition == '' or conf.get(condition, 0) == 1 + install = install_tests and type == '' + exe = executable( name, sources, include_directories : incs, link_with : link_with, dependencies : dependencies, - c_args : defs) + c_args : defs, + install : install, + install_dir : testsdir) + if type == 'manual' message('@0@ is a manual test'.format(name)) elif type == 'unsafe' and want_tests != 'unsafe' diff --git a/meson_options.txt b/meson_options.txt index 9295b9c27c..981eace590 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -201,3 +201,5 @@ option('zshcompletiondir', type : 'string', option('tests', type : 'combo', choices : ['yes', 'unsafe'], description : 'enable extra tests with =unsafe') +option('install-tests', type : 'boolean', value : 'false', + description : 'install test executables') From 6b30f2801b426dc8a48412f8fd3789fd84521407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 9 Apr 2017 13:11:49 -0400 Subject: [PATCH 11/82] meson: include the library symbol version list in link_depends This is pretty ugly, because I don't know how to use a single definition for two purposes: - --version-script needs a path relative to the build root - link_depends needs a path relative to source root Also, link_depends does not accept files() output [https://github.com/mesonbuild/meson/issues/1172], and I don't see a way to go from files() output to a string path that can be used to craft the -Wl arg. Ideally, a single files() result could be used in both places. I'm leaving this as a separate commit for now. --- meson.build | 14 ++++++++++---- src/libsystemd/meson.build | 2 +- src/libudev/meson.build | 6 ++++-- src/login/meson.build | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index fc03f68d10..ffdd59071f 100644 --- a/meson.build +++ b/meson.build @@ -962,17 +962,19 @@ libjournal_core = static_library( libsystemd_journal_internal], install : false) +version_script_arg = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) libsystemd = shared_library( 'systemd', libsystemd_internal_sources, version : '0.18.0', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + libsystemd_sym], + '-Wl,--version-script=' + version_script_arg], link_with : [libbasic, libsystemd_internal, libsystemd_journal_internal], dependencies : [threads], + link_depends : libsystemd_sym, install : true, install_dir : rootlibdir) @@ -988,7 +990,8 @@ foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], module = tuple[0] extra_deps = tuple[2] - sym = meson.current_source_dir() + '/src/nss-@0@/nss-@0@.sym'.format(module) + sym = 'src/nss-@0@/nss-@0@.sym'.format(module) + version_script_arg = join_paths(meson.current_source_dir(), sym) shared_library( 'nss_' + module, @@ -996,12 +999,13 @@ foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], version : '2', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + sym, + '-Wl,--version-script=' + version_script_arg, '-Wl,--undefined'], link_with : [libsystemd_internal, libbasic], dependencies : [threads, librt] + extra_deps, + link_depends : sym, install : true, install_dir : rootlibdir) endif @@ -1207,16 +1211,18 @@ if conf.get('ENABLE_LOGIND', 0) == 1 install_dir : rootbindir) if conf.get('HAVE_PAM', 0) == 1 + version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) shared_library( 'pam_systemd', pam_systemd_c, name_prefix : '', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + pam_systemd_sym], + '-Wl,--version-script=' + version_script_arg], link_with : [libshared], dependencies : [libpam, libpam_misc], + link_depends : pam_systemd_sym, install : true, install_dir : pamlibdir) endif diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 9c6e494b93..5df62ac763 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -88,7 +88,7 @@ libsystemd_internal = static_library( dependencies : [threads, librt]) -libsystemd_sym = meson.current_source_dir() + '/libsystemd.sym' +libsystemd_sym = 'src/libsystemd/libsystemd.sym' libsystemd_pc = configure_file( input : 'libsystemd.pc.in', diff --git a/src/libudev/meson.build b/src/libudev/meson.build index 5730522ce0..e303ee8518 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -16,17 +16,19 @@ libudev_sources = ''' ############################################################ -libudev_sym = meson.current_source_dir() + '/libudev.sym' +libudev_sym = 'libudev.sym' +version_script_arg = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym) libudev = shared_library( 'udev', libudev_sources, version : '1.6.6', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + libudev_sym], + '-Wl,--version-script=' + version_script_arg], link_with : [libbasic, libsystemd], + link_depends : libudev_sym, install : true, install_dir : rootlibdir) diff --git a/src/login/meson.build b/src/login/meson.build index 5c957063eb..75b8498862 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -65,7 +65,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 install_data(logind_conf, install_dir : pkgsysconfdir) - pam_systemd_sym = meson.current_source_dir() + '/pam_systemd.sym' + pam_systemd_sym = 'src/login/pam_systemd.sym' pam_systemd_c = files('pam_systemd.c') install_data('org.freedesktop.login1.conf', From f4ee10a2829e8b10f749de59b2885efb959e7ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 9 Apr 2017 14:08:53 -0400 Subject: [PATCH 12/82] meson: create a static version of libshared and link libcore and some tests to it This is what autoconf-based build does, and it makes test-bus-error and test-engine able to access the bus error mapping table. OTOH, this is a heavy price to pay: it would be excellent to link libcore.a to libsystemd-shared-NNN.so. Otherwise we duplicate the same code in 'systemd' and 'libsystemd-shared-NNN.so'. -rwxrwxr-x. 1 4075544 Apr 6 20:30 systemd* <-- libcore linked against libsystemd-shared.so -rwxrwxr-x. 1 5596504 Apr 9 14:07 systemd* <-- libcore linked against libsystemd-shared.a v2: - update for 6b5cf3ea621a5bfd218cd2249e066a52c0e73657 --- meson.build | 6 +- src/core/meson.build | 2 +- src/libsystemd/meson.build | 4 -- src/shared/meson.build | 18 +++++ src/test/meson.build | 130 ++++++++++++++++++++++++++----------- 5 files changed, 116 insertions(+), 44 deletions(-) diff --git a/meson.build b/meson.build index ffdd59071f..e2e28438b7 100644 --- a/meson.build +++ b/meson.build @@ -1044,7 +1044,8 @@ executable('systemd', librt, libseccomp, libselinux, - libmount], + libmount, + libblkid], install : true, install_dir : rootlibexecdir) @@ -1057,7 +1058,8 @@ executable('systemd-analyze', librt, libseccomp, libselinux, - libmount], + libmount, + libblkid], install : true) executable('systemd-journald', diff --git a/src/core/meson.build b/src/core/meson.build index 3d2f9f37a7..f6d3e7fb00 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -146,7 +146,7 @@ libcore = static_library( load_fragment_gperf_c, load_fragment_gperf_nulstr_c, include_directories : includes, - link_with : [libshared], + link_with : [libshared_static], dependencies : [threads, libpam, libaudit, diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 5df62ac763..999347da46 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -129,10 +129,6 @@ tests += [ [], [threads]], - [['src/libsystemd/sd-bus/test-bus-error.c'], - [], - []], - [['src/libsystemd/sd-bus/test-bus-gvariant.c'], [], [libglib, diff --git a/src/shared/meson.build b/src/shared/meson.build index bbe08e983b..3024db6a44 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -144,6 +144,24 @@ libshared = shared_library( install : true, install_dir : rootlibexecdir) +libshared_static = static_library( + libshared_name, + shared_sources, + basic_sources, + include_directories : includes, + dependencies : [threads, + librt, + libcap, + libacl, + libcryptsetup, + libiptc, + libseccomp, + libselinux, + libidn, + libxz, + liblz4, + libblkid]) + if conf.get('HAVE_LIBIPTC', 0) == 1 libfirewall = static_library( 'firewall', diff --git a/src/test/meson.build b/src/test/meson.build index df074d8f19..e68e6bd793 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -23,40 +23,60 @@ tests += [ []], [['src/test/test-engine.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-job-type.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-ns.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount], + libmount, + libblkid], '', 'unsafe'], [['src/test/test-loopback.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-hostname.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount], + libmount, + libblkid], '', 'unsafe'], [['src/test/test-dns-domain.c'], @@ -70,18 +90,26 @@ tests += [ 'ENABLE_EFI'], [['src/test/test-unit-name.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-unit-file.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-utf8.c'], [libshared], @@ -100,7 +128,7 @@ tests += [ []], [['src/test/test-copy.c'], - [libshared], + [libshared_static], []], [['src/test/test-sigbus.c'], @@ -237,8 +265,10 @@ tests += [ []], [['src/test/test-namespace.c'], - [libcore], - []], + [libcore, + libudev, + libsystemd], + [libblkid]], [['src/test/test-verbs.c'], [libshared], @@ -407,11 +437,15 @@ tests += [ [['src/test/test-cgroup-mask.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-cgroup-util.c'], [libshared], @@ -434,18 +468,26 @@ tests += [ []], [['src/test/test-path.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-execute.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-siphash24.c'], [libshared], @@ -456,7 +498,8 @@ tests += [ []], [['src/test/test-install.c'], - [libcore], + [libcore, + libsystemd], [], '', 'manual'], @@ -465,11 +508,15 @@ tests += [ []], [['src/test/test-sched-prio.c'], - [libcore], - [librt, + [libcore, + libudev, + libsystemd], + [threads, + librt, libseccomp, libselinux, - libmount]], + libmount, + libblkid]], [['src/test/test-conf-files.c'], [libshared], @@ -611,6 +658,15 @@ tests += [ ############################################################ +tests += [ + [['src/libsystemd/sd-bus/test-bus-error.c'], + [libshared_static, + libsystemd], + []], + ] + +############################################################ + tests += [ [['src/libsystemd-network/test-dhcp-option.c', 'src/libsystemd-network/dhcp-protocol.h', From 2d9f0c68780b5ea6be92fa247a61688b1e73d28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 9 Apr 2017 23:43:53 -0400 Subject: [PATCH 13/82] meson: add unit installation symlinks This is the equivalent of $(SYSTEM_UNIT_ALIASES) and $(GENERAL_ALIASES) in Makefile.am. ninja-build uninstall does not remove the symlinks, see https://github.com/mesonbuild/meson/issues/1602. I don't consider this a blocker: after all either one installs into $DESTDIR, where uninstallation doesn't make much sense, or into a real system, where a successfull uninstallation would likely destroy the system. v2: - remove bashisms - add various forgotten symlinks and fix service/timer/target confusions --- units/meson-add-wants.sh | 27 +++++ units/meson.build | 235 +++++++++++++++++++++++++++------------ 2 files changed, 189 insertions(+), 73 deletions(-) create mode 100644 units/meson-add-wants.sh diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh new file mode 100644 index 0000000000..ce93d71255 --- /dev/null +++ b/units/meson-add-wants.sh @@ -0,0 +1,27 @@ +#!/bin/sh -e + +unitdir="$1" +target="$2" +unit="$3" + +case "$target" in + */?*) # a path, but not just a slash at the end + dir="${DESTDIR}${target}" + ;; + *) + dir="${DESTDIR}${unitdir}/${target}" + ;; +esac + +unitpath="${DESTDIR}${unitdir}/${unit}" + +case "$target" in + */) + mkdir -p -m 0755 "$dir" + ;; + *) + mkdir -p -m 0755 "$(basename "$dir")" + ;; +esac + +ln -vfs --relative "$unitpath" "$dir" diff --git a/units/meson.build b/units/meson.build index 2013973c36..3dfb9853f6 100644 --- a/units/meson.build +++ b/units/meson.build @@ -4,14 +4,19 @@ units = [ ['basic.target', ''], ['bluetooth.target', ''], ['cryptsetup-pre.target', 'HAVE_LIBCRYPTSETUP'], - ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP'], - ['dev-hugepages.mount', ''], - ['dev-mqueue.mount', ''], + ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP', + 'sysinit.target.wants/'], + ['dev-hugepages.mount', '', + 'sysinit.target.wants/'], + ['dev-mqueue.mount', '', + 'sysinit.target.wants/'], ['emergency.target', ''], ['exit.target', ''], ['final.target', ''], - ['getty.target', ''], - ['graphical.target', ''], + ['getty.target', '', + 'multi-user.target.wants/'], + ['graphical.target', '', + 'runlevel5.target default.target'], ['halt.target', ''], ['hibernate.target', 'ENABLE_HIBERNATE'], ['hybrid-sleep.target', 'ENABLE_HIBERNATE'], @@ -21,26 +26,34 @@ units = [ ['initrd-switch-root.target', ''], ['initrd.target', ''], ['kexec.target', ''], - ['ldconfig.service', 'ENABLE_LDCONFIG'], + ['ldconfig.service', 'ENABLE_LDCONFIG', + 'sysinit.target.wants/'], ['local-fs-pre.target', ''], ['local-fs.target', ''], ['machine.slice', 'ENABLE_MACHINED'], - ['machines.target', 'ENABLE_MACHINED'], - ['multi-user.target', ''], + ['machines.target', 'ENABLE_MACHINED', + pkgsysconfdir + '/system/multi-user.target.wants/'], + ['multi-user.target', '', + 'runlevel2.target runlevel3.target runlevel4.target'], ['network-online.target', ''], ['network-pre.target', ''], ['network.target', ''], ['nss-lookup.target', ''], ['nss-user-lookup.target', ''], ['paths.target', ''], - ['poweroff.target', ''], + ['poweroff.target', '', + 'runlevel0.target'], ['printer.target', ''], - ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'], + ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT', + 'sysinit.target.wants/'], ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], - ['reboot.target', ''], + ['reboot.target', '', + 'runlevel6.target ctrl-alt-del.target'], ['remote-fs-pre.target', ''], - ['remote-fs.target', ''], - ['rescue.target', ''], + ['remote-fs.target', '', + pkgsysconfdir + '/system/multi-user.target.wants/'], + ['rescue.target', '', + 'runlevel1.target'], ['rpcbind.target', ''], ['shutdown.target', ''], ['sigpwr.target', ''], @@ -51,38 +64,60 @@ units = [ ['sound.target', ''], ['suspend.target', ''], ['swap.target', ''], - ['sys-fs-fuse-connections.mount', ''], - ['sys-kernel-config.mount', ''], - ['sys-kernel-debug.mount', ''], + ['sys-fs-fuse-connections.mount', '', + 'sysinit.target.wants/'], + ['sys-kernel-config.mount', '', + 'sysinit.target.wants/'], + ['sys-kernel-debug.mount', '', + 'sysinit.target.wants/'], ['sysinit.target', ''], ['syslog.socket', ''], ['system-update.target', ''], ['system.slice', ''], - ['systemd-ask-password-console.path', ''], - ['systemd-ask-password-wall.path', ''], - ['systemd-coredump.socket', 'ENABLE_COREDUMP'], - ['systemd-initctl.socket', ''], + ['systemd-ask-password-console.path', '', + 'sysinit.target.wants/'], + ['systemd-ask-password-wall.path', '', + 'multi-user.target.wants/'], + ['systemd-coredump.socket', 'ENABLE_COREDUMP', + 'sockets.target.wants/'], + ['systemd-initctl.socket', '', + 'sockets.target.wants/'], ['systemd-journal-gatewayd.socket', ''], ['systemd-journal-remote.socket', ''], - ['systemd-journald-audit.socket', ''], - ['systemd-journald-dev-log.socket', ''], - ['systemd-journald.socket', ''], - ['systemd-networkd.socket', ''], + ['systemd-journald-audit.socket', '', + 'sockets.target.wants/'], + ['systemd-journald-dev-log.socket', '', + 'sockets.target.wants/'], + ['systemd-journald.socket', '', + 'sockets.target.wants/'], + ['systemd-networkd.socket', '', + pkgsysconfdir + '/system/sockets.target.wants/'], ['systemd-rfkill.socket', 'ENABLE_RFKILL'], - ['systemd-tmpfiles-clean.timer', ''], - ['systemd-udevd-control.socket', ''], - ['systemd-udevd-kernel.socket', ''], + ['systemd-tmpfiles-clean.timer', '', + 'timers.target.wants/'], + ['systemd-udevd-control.socket', '', + 'sockets.target.wants/'], + ['systemd-udevd-kernel.socket', '', + 'sockets.target.wants/'], ['time-sync.target', ''], ['timers.target', ''], ['umount.target', ''], ['user.slice', ''], - ['var-lib-machines.mount', ''], + ['var-lib-machines.mount', '', + 'local-fs.target.wants/'], ] -foreach pair : units - if pair[1] == '' or conf.get(pair[1], 0) == 1 - install_data(pair[0], +foreach tuple : units + file = tuple[0] + if tuple[1] == '' or conf.get(tuple[1], 0) == 1 + install_data(file, install_dir : systemunitdir) + + if tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endif endforeach @@ -94,7 +129,8 @@ in_units = [ ['initrd-parse-etc.service', ''], ['initrd-switch-root.service', ''], ['initrd-udevadm-cleanup-db.service', ''], - ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES'], + ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES', + 'sysinit.target.wants/'], ['quotaon.service', 'ENABLE_QUOTACHECK'], ['rc-local.service', 'HAVE_SYSV_COMPAT'], ['rescue.service', ''], @@ -102,62 +138,90 @@ in_units = [ ['systemd-ask-password-console.service', ''], ['systemd-ask-password-wall.service', ''], ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], - ['systemd-binfmt.service', 'ENABLE_BINFMT'], + ['systemd-binfmt.service', 'ENABLE_BINFMT', + 'sysinit.target.wants/'], ['systemd-coredump@.service', 'ENABLE_COREDUMP'], ['systemd-exit.service', ''], - ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT'], + ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT', + 'sysinit.target.wants/'], ['systemd-fsck-root.service', ''], ['systemd-fsck@.service', ''], ['systemd-halt.service', ''], ['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'], ['systemd-hibernate.service', 'ENABLE_HIBERNATE'], ['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'], - ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED'], - ['systemd-hwdb-update.service', 'ENABLE_HWDB'], - ['systemd-importd.service', 'ENABLE_IMPORTD'], + ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED', + 'dbus-org.freedesktop.hostname1.service'], + ['systemd-hwdb-update.service', 'ENABLE_HWDB', + 'sysinit.target.wants/'], + ['systemd-importd.service', 'ENABLE_IMPORTD', + 'dbus-org.freedesktop.import1.service'], ['systemd-initctl.service', ''], - ['systemd-journal-catalog-update.service', ''], - ['systemd-journal-flush.service', ''], + ['systemd-journal-catalog-update.service', '', + 'sysinit.target.wants/'], + ['systemd-journal-flush.service', '', + 'sysinit.target.wants/'], ['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], ['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], ['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'], - ['systemd-journald.service', ''], + ['systemd-journald.service', '', + 'sysinit.target.wants/'], ['systemd-kexec.service', ''], - ['systemd-localed.service', 'ENABLE_LOCALED'], - ['systemd-logind.service', 'ENABLE_LOGIND'], - ['systemd-machine-id-commit.service', ''], - ['systemd-machined.service', 'ENABLE_MACHINED'], - ['systemd-modules-load.service', 'HAVE_KMOD'], - ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD'], + ['systemd-localed.service', 'ENABLE_LOCALED', + 'dbus-org.freedesktop.locale1.service'], + ['systemd-logind.service', 'ENABLE_LOGIND', + 'multi-user.target.wants/ dbus-org.freedesktop.login1.service'], + ['systemd-machine-id-commit.service', '', + 'sysinit.target.wants/'], + ['systemd-machined.service', 'ENABLE_MACHINED', + 'dbus-org.freedesktop.machine1.service'], + ['systemd-modules-load.service', 'HAVE_KMOD', + 'sysinit.target.wants/'], + ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD', + pkgsysconfdir + '/system/network-online.target.wants/'], ['systemd-nspawn@.service', ''], ['systemd-poweroff.service', ''], ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'], - ['systemd-random-seed.service', 'ENABLE_RANDOMSEED'], + ['systemd-random-seed.service', 'ENABLE_RANDOMSEED', + 'sysinit.target.wants/'], ['systemd-reboot.service', ''], - ['systemd-remount-fs.service', ''], + ['systemd-remount-fs.service', '', + 'local-fs.target.wants/'], ['systemd-rfkill.service', 'ENABLE_RFKILL'], ['systemd-suspend.service', ''], - ['systemd-sysctl.service', ''], - ['systemd-sysusers.service', 'ENABLE_SYSUSERS'], - ['systemd-timedated.service', 'ENABLE_TIMEDATED'], - ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD'], + ['systemd-sysctl.service', '', + 'sysinit.target.wants/'], + ['systemd-sysusers.service', 'ENABLE_SYSUSERS', + 'sysinit.target.wants/'], + ['systemd-timedated.service', 'ENABLE_TIMEDATED', + 'dbus-org.freedesktop.timedate1.service'], + ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD', + pkgsysconfdir + '/system/sysinit.target.wants/'], ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'], - ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES'], - ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES'], + ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES', + 'sysinit.target.wants/'], + ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES', + 'sysinit.target.wants/'], ['systemd-udev-settle.service', ''], - ['systemd-udev-trigger.service', ''], - ['systemd-udevd.service', ''], - ['systemd-update-done.service', ''], - ['systemd-update-utmp-runlevel.service', 'HAVE_UTMP HAVE_SYSV_COMPAT'], - ['systemd-update-utmp.service', 'HAVE_UTMP'], - ['systemd-user-sessions.service', ''], + ['systemd-udev-trigger.service', '', + 'sysinit.target.wants/'], + ['systemd-udevd.service', '', + 'sysinit.target.wants/'], + ['systemd-update-done.service', '', + 'sysinit.target.wants/'], + ['systemd-update-utmp-runlevel.service', 'HAVE_UTMP HAVE_SYSV_COMPAT', + 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'], + ['systemd-update-utmp.service', 'HAVE_UTMP', + 'sysinit.target.wants/'], + ['systemd-user-sessions.service', '', + 'multi-user.target.wants/'], ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'], ['systemd-volatile-root.service', ''], ] -foreach pair : in_units - file = pair[0] - conds = pair[1].split(' ') +foreach tuple : in_units + file = tuple[0] + conds = tuple[1].split(' ') install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) @@ -168,18 +232,27 @@ foreach pair : in_units if install install_data(gen, install_dir : systemunitdir) + + if tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endif endforeach m4_units = [ - ['getty@.service', ''], + ['getty@.service', '', + 'autovt@.service ' + + pkgsysconfdir + '/system/getty.target.wants/getty@tty1.service'], ['serial-getty@.service', ''], - ['tmp.mount', ''], + ['tmp.mount', '', + 'local-fs.target.wants/'], ] -foreach pair : m4_units - file = pair[0] - install = pair[1] == '' or conf.get(pair[1], 0) == 1 +foreach tuple : m4_units + file = tuple[0] + install = tuple[1] == '' or conf.get(tuple[1], 0) == 1 custom_target( file, @@ -189,19 +262,29 @@ foreach pair : m4_units capture : true, install : install, install_dir : systemunitdir) + + if tuple.length() > 2 and install + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endforeach m4_in_units = [ ['console-getty.service', ''], ['container-getty@.service', ''], - ['systemd-networkd.service', 'ENABLE_NETWORKD'], - ['systemd-resolved.service', 'ENABLE_RESOLVED'], + ['systemd-networkd.service', 'ENABLE_NETWORKD', + 'dbus-org.freedesktop.network1.service ' + + pkgsysconfdir + '/system/multi-user.target.wants/ '], + ['systemd-resolved.service', 'ENABLE_RESOLVED', + 'dbus-org.freedesktop.resolve1.service ' + + pkgsysconfdir + '/system/multi-user.target.wants/'], ['user@.service', ''], ] -foreach pair : m4_in_units - file = pair[0] - install = pair[1] == '' or conf.get(pair[1], 0) == 1 +foreach tuple : m4_in_units + file = tuple[0] + install = tuple[1] == '' or conf.get(tuple[1], 0) == 1 gen = configure_file( input : file + '.m4.in', @@ -216,6 +299,12 @@ foreach pair : m4_in_units capture : true, install : install, install_dir : systemunitdir) + + if tuple.length() > 2 and install + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endforeach subdir('user') From 94e75a54097b32252ef86e9253a288db7529f1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 9 Apr 2017 23:55:05 -0400 Subject: [PATCH 14/82] meson: create dirs and touch /usr This is the equivalent of $(INSTALL_DIRS) and install-touch-usr-hook. I did not bother to create the directories into which we install files, since they will be created anyway. v2: - remove bashism --- hwdb/meson.build | 3 +++ meson.build | 15 +++++++++++++++ network/meson.build | 3 +++ src/core/meson.build | 14 ++++++++++++++ src/kernel-install/meson.build | 3 +++ src/udev/meson.build | 3 +++ sysctl.d/meson.build | 3 +++ tmpfiles.d/meson.build | 5 +++++ units/meson.build | 8 ++++++++ 9 files changed, 57 insertions(+) diff --git a/hwdb/meson.build b/hwdb/meson.build index 4c13a2e7a9..bffac3bae6 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -22,4 +22,7 @@ hwdb_files = files(''' if conf.get('ENABLE_HWDB', 0) == 1 install_data(hwdb_files, install_dir : udevhwdbdir) + + meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/udev/hwdb.d')) endif diff --git a/meson.build b/meson.build index e2e28438b7..a5b57d8e05 100644 --- a/meson.build +++ b/meson.build @@ -385,6 +385,8 @@ stat = find_program('stat') git = find_program('git', required : false) etags = find_program('etags', required : false) +mkdir_p = 'mkdir -p $DESTDIR/@0@' + # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. progs = [['telinit', '/lib/sysvinit/telinit'], @@ -1530,6 +1532,11 @@ if conf.get('ENABLE_BINFMT', 0) == 1 link_with : [libshared], install : true, install_dir : rootlibexecdir) + + meson.add_install_script('sh', '-c', + mkdir_p.format(binfmtdir)) + meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/binfmt.d')) endif if conf.get('ENABLE_VCONSOLE', 0) == 1 @@ -1821,6 +1828,11 @@ if conf.get('HAVE_KMOD', 0) == 1 dependencies : [libkmod], install : true, install_dir : rootlibexecdir) + + meson.add_install_script('sh', '-c', + mkdir_p.format(modulesloaddir)) + meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/modules-load.d')) endif executable('systemd-nspawn', @@ -1941,6 +1953,9 @@ install_data('README', 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', install_dir : docdir) +meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir)) +meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) + ############################################################ if git.found() and etags.found() diff --git a/network/meson.build b/network/meson.build index b578159b03..d2eb89ad4d 100644 --- a/network/meson.build +++ b/network/meson.build @@ -6,4 +6,7 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 '80-container-vz.network', '99-default.link', install_dir : networkdir) + + meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/systemd/network')) endif diff --git a/src/core/meson.build b/src/core/meson.build index f6d3e7fb00..bf4e2dbed9 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -220,3 +220,17 @@ custom_target( install_data('system.conf', 'user.conf', install_dir : pkgsysconfdir) + +meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir)) +meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir)) +meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir)) +meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir)) + +meson.add_install_script('sh', '-c', + mkdir_p.format(pkgsysconfdir + '/system/multi-user.target.wants')) +meson.add_install_script('sh', '-c', + mkdir_p.format(pkgsysconfdir + '/system/getty.target.wants')) +meson.add_install_script('sh', '-c', + mkdir_p.format(pkgsysconfdir + '/user')) +meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/xdg/systemd')) diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build index 517cd69c0e..4ecea20f89 100644 --- a/src/kernel-install/meson.build +++ b/src/kernel-install/meson.build @@ -8,3 +8,6 @@ install_data('50-depmod.install', '90-loaderentry.install', install_mode : 'rwxr-xr-x', install_dir : kernelinstalldir) + +meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/kernel/install.d')) diff --git a/src/udev/meson.build b/src/udev/meson.build index 6edec7dabc..f3c68a9d45 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -163,3 +163,6 @@ udev_pc = configure_file( configuration : substs) install_data(udev_pc, install_dir : pkgconfigdatadir) + +meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/udev/rules.d')) diff --git a/sysctl.d/meson.build b/sysctl.d/meson.build index a8cf868a9b..cdd95f857a 100644 --- a/sysctl.d/meson.build +++ b/sysctl.d/meson.build @@ -18,3 +18,6 @@ foreach file : in_files install_data(gen, install_dir : sysctldir) endforeach + +meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/sysctl.d')) diff --git a/tmpfiles.d/meson.build b/tmpfiles.d/meson.build index cba5e1781d..36a053bc0e 100644 --- a/tmpfiles.d/meson.build +++ b/tmpfiles.d/meson.build @@ -37,3 +37,8 @@ foreach file : m4_files install : enable_tmpfiles, install_dir : tmpfilesdir) endforeach + +if enable_tmpfiles + meson.add_install_script('sh', '-c', + mkdir_p.format(sysconfdir + '/tmpfiles.d')) +endif diff --git a/units/meson.build b/units/meson.build index 3dfb9853f6..957153c0b5 100644 --- a/units/meson.build +++ b/units/meson.build @@ -307,4 +307,12 @@ foreach tuple : m4_in_units endif endforeach +if conf.get('HAVE_SYSV_COMPAT', 0) == 1 + foreach i : [1, 2, 3, 4, 5] + meson.add_install_script('sh', '-c', + mkdir_p + .format(systemunitdir + '/runlevel@0@.target.wants'.format(i))) + endforeach +endif + subdir('user') From 7b76fce1a5d2590524f713586d2b38dca5224ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 9 Apr 2017 23:55:50 -0400 Subject: [PATCH 15/82] meson: create various symlinks v2: - remove bashisms --- meson.build | 8 ++++++++ tools/meson-make-symlink.sh | 11 +++++++++++ units/meson.build | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 tools/meson-make-symlink.sh diff --git a/meson.build b/meson.build index a5b57d8e05..a56476a71d 100644 --- a/meson.build +++ b/meson.build @@ -385,6 +385,7 @@ stat = find_program('stat') git = find_program('git', required : false) etags = find_program('etags', required : false) +meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' mkdir_p = 'mkdir -p $DESTDIR/@0@' # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, @@ -1127,6 +1128,10 @@ if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 install_dir : userenvgeneratordir, include_directories : includes, link_with : [libshared]) + + meson.add_install_script(meson_make_symlink, + sysconfdir + '/environment', + environmentdir + '/99-environment.conf') endif if conf.get('ENABLE_HIBERNATE', 0) == 1 @@ -1705,6 +1710,9 @@ executable('systemd-mount', link_with : [libshared], install : true) +meson.add_install_script(meson_make_symlink, + 'systemd-mount', bindir + '/systemd-umount') + executable('systemd-run', 'src/run/run.c', include_directories : includes, diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh new file mode 100644 index 0000000000..87f198694c --- /dev/null +++ b/tools/meson-make-symlink.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# this is needed mostly because $DESTDIR is provided as a variable, +# and we need to create the target directory... + +mkdir -vp "$(dirname "${DESTDIR}$2")" +if [ "$(dirname $1)" = . ]; then + ln -vfs -T "$1" "${DESTDIR}$2" +else + ln -vfs -T --relative "${DESTDIR}$1" "${DESTDIR}$2" +fi diff --git a/units/meson.build b/units/meson.build index 957153c0b5..b051c5d3cc 100644 --- a/units/meson.build +++ b/units/meson.build @@ -307,6 +307,12 @@ foreach tuple : m4_in_units endif endforeach +meson.add_install_script(meson_make_symlink, + pkgsysconfdir + '/user', + sysconfdir + '/xdg/systemd/user') +meson.add_install_script(meson_make_symlink, + dbussystemservicedir + '/org.freedesktop.systemd1.service', + dbussessionservicedir + '/org.freedesktop.systemd1.service') if conf.get('HAVE_SYSV_COMPAT', 0) == 1 foreach i : [1, 2, 3, 4, 5] meson.add_install_script('sh', '-c', From a3e34ac80d223461611d6768b11eb4735b90cb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 12:20:03 -0400 Subject: [PATCH 16/82] meson: create /var/log/journal/remote C.f. https://github.com/mesonbuild/meson/issues/1604. --- src/journal-remote/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index 8c89d258cf..ca05390244 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -43,3 +43,9 @@ endif install_data('browse.html', install_dir : pkgdatadir + '/gatewayd') + +meson.add_install_script('sh', '-c', + mkdir_p.format('/var/log/journal/remote')) +meson.add_install_script('sh', '-c', + '''chown 0:0 $DESTDIR/var/log/journal/remote; + chmod 755 $DESTDIR/var/log/journal/remote''') From d7148676863c716320798ede129a3af5d27c8d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 12:26:39 -0400 Subject: [PATCH 17/82] meson: remove libnss_*.so symlinks after install --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index a56476a71d..780c308ca0 100644 --- a/meson.build +++ b/meson.build @@ -1011,6 +1011,12 @@ foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], link_depends : sym, install : true, install_dir : rootlibdir) + + # We cannot use shared_module because it does not support version suffix. + # Unfortunately shared_library insists on creating the symlink… + meson.add_install_script('sh', '-c', + 'rm $DESTDIR@0@/libnss_@1@.so' + .format(rootlibdir, module)) endif endforeach From 4e4ab1c32a2dfd7ac0d03e65ea669fc58d61cc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 12:37:52 -0400 Subject: [PATCH 18/82] meson: install systemd-sulogin-shell too --- meson.build | 3 +++ src/sulogin-shell/meson.build | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/sulogin-shell/meson.build diff --git a/meson.build b/meson.build index 780c308ca0..6d2ecc8a64 100644 --- a/meson.build +++ b/meson.build @@ -199,6 +199,7 @@ substs.set('systemenvgeneratordir', systemenvgenerator substs.set('userenvgeneratordir', userenvgeneratordir) substs.set('systemshutdowndir', systemshutdowndir) substs.set('systemsleepdir', systemsleepdir) +substs.set('SYSTEMCTL', rootbindir + '/systemctl') ##################################################################### @@ -412,6 +413,7 @@ foreach prog : progs endif name = prog.length() > 2 ? prog[2] : prog[0].to_upper() conf.set_quoted(name, path) + substs.set(name, path) endforeach # TODO: add ln --relative check @@ -1041,6 +1043,7 @@ subdir('src/resolve') subdir('src/timedate') subdir('src/timesync') subdir('src/vconsole') +subdir('src/sulogin-shell') subdir('src/test') diff --git a/src/sulogin-shell/meson.build b/src/sulogin-shell/meson.build new file mode 100644 index 0000000000..80ac8c43d0 --- /dev/null +++ b/src/sulogin-shell/meson.build @@ -0,0 +1,9 @@ +# -*- mode: meson -*- + +gen = configure_file( + input : 'systemd-sulogin-shell.in', + output : 'systemd-sulogin-shell', + configuration : substs) + +install_data(gen, + install_dir : rootlibexecdir) From 37ab1a25ec6af5fd16568fabe415b20f03cae1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 14:13:40 -0400 Subject: [PATCH 19/82] meson: add test-libsystemd-sym, fix linking of libsystemd This is quite messy. I think libtool might have been using something like -Wl,--whole-archive, but I don't think meson has support for that. For now, just recompile all the sources for linking into libsystemd directly. This should not matter much for efficiency, since it's a few small files. --- meson.build | 28 ++++++++++++++++++++++------ src/systemd/meson.build | 10 ++++++---- src/test/generate-sym-test.py | 23 +++++++++++++++++++++++ src/test/meson.build | 13 +++++++++++++ 4 files changed, 64 insertions(+), 10 deletions(-) create mode 100755 src/test/generate-sym-test.py diff --git a/meson.build b/meson.build index 6d2ecc8a64..83231c91fe 100644 --- a/meson.build +++ b/meson.build @@ -967,18 +967,20 @@ libjournal_core = static_library( libsystemd_journal_internal], install : false) -version_script_arg = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) +libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) libsystemd = shared_library( 'systemd', libsystemd_internal_sources, + libsystemd_journal_internal_sources, version : '0.18.0', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + version_script_arg], - link_with : [libbasic, - libsystemd_internal, - libsystemd_journal_internal], - dependencies : [threads], + '-Wl,--version-script=' + libsystemd_sym_path], + link_with : [libbasic], + dependencies : [threads, + librt, + libxz, + liblz4], link_depends : libsystemd_sym, install : true, install_dir : rootlibdir) @@ -1932,6 +1934,20 @@ foreach tuple : tests endif endforeach +test_libsystemd_sym = executable( + 'test-libsystemd-sym', + test_libsystemd_sym_c, + include_directories : includes, + # link_with : [libsystemd], + # TODO: try again with https://github.com/mesonbuild/meson/pull/1545 + link_args : ['libsystemd.so.0.18.0'], + # link_depends : [libsystemd], + # TODO: try again after "Link_depends arguments must be strings." is solved + install : install_tests, + install_dir : testsdir) +test('test-libsystemd-sym', + test_libsystemd_sym) + ############################################################ make_directive_index_py = find_program('tools/make-directive-index.py') diff --git a/src/systemd/meson.build b/src/systemd/meson.build index 91a35b13fe..c7d7d50963 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -1,6 +1,6 @@ # -*- mode: meson -*- -headers = ''' +systemd_headers = files(''' sd-bus.h sd-bus-protocol.h sd-bus-vtable.h @@ -10,8 +10,7 @@ headers = ''' sd-journal.h sd-login.h sd-messages.h - _sd-common.h -'''.split() +'''.split()) # sd-device.h # sd-hwdb.h @@ -30,4 +29,7 @@ headers = ''' # sd-resolve.h # sd-utf8.h -install_headers(headers, subdir : 'systemd') +install_headers( + systemd_headers, + '_sd-common.h', + subdir : 'systemd') diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py new file mode 100755 index 0000000000..a3350c8a81 --- /dev/null +++ b/src/test/generate-sym-test.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +import sys, re + +print('#include ') +for header in sys.argv[2:]: + print('#include "{}"'.format(header.split('/')[-1])) + +print(''' +void* functions[] = {''') + +for line in open(sys.argv[1]): + match = re.search('^ +([a-zA-Z0-9_]+);', line) + if match: + print(' {},'.format(match.group(1))) + +print('''}; + +int main(void) { + unsigned i; + for (i = 0; i < sizeof(functions)/sizeof(void*); i++) + printf("%p\\n", functions[i]); + return 0; +}''') diff --git a/src/test/meson.build b/src/test/meson.build index e68e6bd793..32affa83e3 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -17,6 +17,19 @@ test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map) test_env.set('PATH', path) test_env.prepend('PATH', meson.build_root()) +############################################################ + +generate_sym_test_py = find_program('generate-sym-test.py') + +test_libsystemd_sym_c = custom_target( + 'test-libsystemd-sym.c', + input : [libsystemd_sym_path] + systemd_headers, + output : 'test-libsystemd-sym.c', + command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers, + capture : true) + +############################################################ + tests += [ [['src/test/test-device-nodes.c'], [libshared], From e0bec52f2707c3dff041755972e3c4e8bdcf0dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 15:20:42 -0400 Subject: [PATCH 20/82] meson: add test-libudev-sym This is slightly complicated by the fact that files('libudev.h') cannot be used as an argument in custom_target command (string is required). This restriction should be lifted in future versions of mesons, so this could be simplified. --- meson.build | 11 +++++++++++ src/libudev/meson.build | 6 +++--- src/test/meson.build | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 83231c91fe..154f380223 100644 --- a/meson.build +++ b/meson.build @@ -1948,6 +1948,17 @@ test_libsystemd_sym = executable( test('test-libsystemd-sym', test_libsystemd_sym) +test_libudev_sym = executable( + 'test-libudev-sym', + test_libudev_sym_c, + include_directories : includes, + c_args : ['-Wno-deprecated-declarations'], + link_args : ['src/libudev/libudev.so.1.6.6'], + install : install_tests, + install_dir : testsdir) +test('test-libudev-sym', + test_libudev_sym) + ############################################################ make_directive_index_py = find_program('tools/make-directive-index.py') diff --git a/src/libudev/meson.build b/src/libudev/meson.build index e303ee8518..9fc3a3c742 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -17,15 +17,14 @@ libudev_sources = ''' ############################################################ libudev_sym = 'libudev.sym' - -version_script_arg = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym) +libudev_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym) libudev = shared_library( 'udev', libudev_sources, version : '1.6.6', include_directories : includes, link_args : ['-shared', - '-Wl,--version-script=' + version_script_arg], + '-Wl,--version-script=' + libudev_sym_path], link_with : [libbasic, libsystemd], link_depends : libudev_sym, @@ -40,6 +39,7 @@ libudev_internal = static_library( libsystemd]) install_headers('libudev.h') +libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir()) libudev_pc = configure_file( input : 'libudev.pc.in', diff --git a/src/test/meson.build b/src/test/meson.build index 32affa83e3..568378e381 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -28,6 +28,13 @@ test_libsystemd_sym_c = custom_target( command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers, capture : true) +test_libudev_sym_c = custom_target( + 'test-libudev-sym.c', + input : [libudev_sym_path, libudev_h_path], + output : 'test-libudev-sym.c', + command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'], + capture : true) + ############################################################ tests += [ From 826472ce367cb93c64cc80225cab3fe5fd687363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 17:11:10 -0400 Subject: [PATCH 21/82] meson: update linking for fixed meson linking With mesonbuid/meson#1545, meson does not propagate deps of a library when linking with that library. That's of course the right thing to do, but it exposes a bunch of missing deps. This compiles with both meson-0.39.1 and meson-git + pr/1545. --- meson.build | 168 +++++++++++++++++--------- src/libsystemd/meson.build | 88 -------------- src/libudev/meson.build | 3 +- src/machine/meson.build | 6 +- src/network/meson.build | 5 +- src/resolve/meson.build | 3 +- src/shared/meson.build | 2 +- src/test/meson.build | 236 +++++++++++++++++++++++++++++-------- src/udev/meson.build | 18 ++- 9 files changed, 329 insertions(+), 200 deletions(-) diff --git a/meson.build b/meson.build index 154f380223..3f53b8a7e2 100644 --- a/meson.build +++ b/meson.build @@ -1053,7 +1053,9 @@ executable('systemd', systemd_sources, include_directories : includes, link_with : [libcore, - libshared], + libshared, + libudev, + libsystemd_internal], dependencies : [threads, librt, libseccomp, @@ -1067,6 +1069,8 @@ executable('systemd-analyze', systemd_analyze_sources, include_directories : includes, link_with : [libcore, + libudev, + libsystemd_internal, libshared], dependencies : [threads, librt, @@ -1101,8 +1105,10 @@ executable('systemd-cat', executable('journalctl', journalctl_sources, include_directories : includes, - link_with : [libshared, - libudev], + link_with : [libsystemd_journal_internal, + libshared, + libudev, + libsystemd_internal], dependencies : [threads, libqrencode, libxz, @@ -1138,7 +1144,8 @@ if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 install : true, install_dir : userenvgeneratordir, include_directories : includes, - link_with : [libshared]) + link_with : [libshared, + libsystemd_internal]) meson.add_install_script(meson_make_symlink, sysconfdir + '/environment', @@ -1168,7 +1175,9 @@ if conf.get('HAVE_BLKID', 0) == 1 install : true, install_dir : systemgeneratordir, include_directories : includes, - link_with : libshared, + link_with : [libsystemd_internal, + libshared, + libudev], dependencies : libblkid) executable('systemd-dissect', @@ -1184,7 +1193,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 systemd_resolved_sources, include_directories : includes, link_with : [libshared, - ], + libsystemd_internal], dependencies : [threads, libm, libidn], @@ -1195,7 +1204,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 systemd_resolve_sources, include_directories : includes, link_with : [libshared, - ], + libsystemd_internal], dependencies : [threads, libm, libidn], @@ -1207,7 +1216,9 @@ if conf.get('ENABLE_LOGIND', 0) == 1 systemd_logind_sources, include_directories : includes, link_with : [liblogind_core, - libshared], + libudev, + libshared, + libsystemd_internal], dependencies : [threads, libacl], install : true, @@ -1216,7 +1227,9 @@ if conf.get('ENABLE_LOGIND', 0) == 1 executable('loginctl', loginctl_sources, include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libudev, + libsystemd_internal], dependencies : [threads, liblz4, libxz], @@ -1226,7 +1239,8 @@ if conf.get('ENABLE_LOGIND', 0) == 1 executable('systemd-inhibit', 'src/login/inhibit.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootbindir) @@ -1239,8 +1253,10 @@ if conf.get('ENABLE_LOGIND', 0) == 1 include_directories : includes, link_args : ['-shared', '-Wl,--version-script=' + version_script_arg], - link_with : [libshared], - dependencies : [libpam, + link_with : [libsystemd_internal, + libshared_static], + dependencies : [threads, + libpam, libpam_misc], link_depends : pam_systemd_sym, install : true, @@ -1274,7 +1290,8 @@ executable('systemd-socket-activate', 'src/activate/activate.c', executable('systemctl', 'src/systemctl/systemctl.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [threads, libcap, libselinux, @@ -1287,7 +1304,8 @@ if conf.get('ENABLE_BACKLIGHT', 0) == 1 executable('systemd-backlight', 'src/backlight/backlight.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libudev], install : true, install_dir : rootlibexecdir) endif @@ -1296,7 +1314,8 @@ if conf.get('ENABLE_RFKILL', 0) == 1 executable('systemd-rfkill', 'src/rfkill/rfkill.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libudev], install : true, install_dir : rootlibexecdir) endif @@ -1312,7 +1331,8 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 executable('systemd-cryptsetup', 'src/cryptsetup/cryptsetup.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [libcryptsetup], install : true, install_dir : rootlibexecdir) @@ -1336,7 +1356,8 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 executable('systemd-veritysetup-generator', 'src/veritysetup/veritysetup-generator.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [libcryptsetup], install : true, install_dir : systemgeneratordir) @@ -1369,7 +1390,8 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 executable('hostnamectl', 'src/hostname/hostnamectl.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) endif @@ -1377,7 +1399,8 @@ if conf.get('ENABLE_LOCALED', 0) == 1 executable('systemd-localed', systemd_localed_sources, include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [libdl], install : true, install_dir : rootlibexecdir) @@ -1385,7 +1408,8 @@ if conf.get('ENABLE_LOCALED', 0) == 1 executable('localectl', localectl_sources, include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) endif @@ -1393,14 +1417,16 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 executable('systemd-timedated', 'src/timedate/timedated.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) executable('timedatectl', 'src/timedate/timedatectl.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) endif @@ -1408,7 +1434,8 @@ if conf.get('ENABLE_TIMESYNCD', 0) == 1 executable('systemd-timesyncd', systemd_timesyncd_sources, include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [threads, libm], install : true, @@ -1420,14 +1447,16 @@ if conf.get('ENABLE_MACHINED', 0) == 1 systemd_machined_sources, include_directories : includes, link_with : [libmachine_core, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) executable('machinectl', 'src/machine/machinectl.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [threads, libxz, liblz4], @@ -1439,7 +1468,9 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 executable('systemd-importd', systemd_importd_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_internal, + libshared], + dependencies : [threads], install : true, install_dir : rootlibexecdir) @@ -1482,7 +1513,8 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 executable('systemd-journal-upload', systemd_journal_upload_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_journal_internal, + libshared], dependencies : [threads, libcurl, libgnutls, @@ -1496,7 +1528,8 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 executable('systemd-journal-remote', systemd_journal_remote_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_journal_internal, + libshared], dependencies : [threads, libmicrohttpd, libgnutls, @@ -1508,7 +1541,8 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 executable('systemd-journal-gatewayd', systemd_journal_gatewayd_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_journal_internal, + libshared], dependencies : [threads, libmicrohttpd, libgnutls, @@ -1522,7 +1556,9 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 executable('systemd-coredump', systemd_coredump_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_journal_internal, + libshared, + libsystemd], dependencies : [threads, libacl, libdw, @@ -1534,7 +1570,9 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 executable('coredumpctl', coredumpctl_sources, include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_journal_internal, + libshared, + libsystemd_internal], dependencies : [threads, libxz, liblz4], @@ -1597,14 +1635,16 @@ executable('systemd-machine-id-setup', 'src/core/machine-id-setup.c', 'src/core/machine-id-setup.h', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootbindir) executable('systemd-fsck', 'src/fsck/fsck.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) @@ -1672,53 +1712,62 @@ executable('systemd-cgroups-agent', executable('systemd-path', 'src/path/path.c', include_directories : includes, - link_with : [libshared], + link_with : [libsystemd_internal, + libshared], install : true) executable('systemd-ask-password', 'src/ask-password/ask-password.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootbindir) executable('systemd-reply-password', 'src/reply-password/reply-password.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) executable('systemd-tty-ask-password-agent', 'src/tty-ask-password-agent/tty-ask-password-agent.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootbindir) executable('systemd-cgls', 'src/cgls/cgls.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) executable('systemd-cgtop', 'src/cgtop/cgtop.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) executable('systemd-initctl', 'src/initctl/initctl.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) executable('systemd-mount', 'src/mount/mount-tool.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal, + libudev], install : true) meson.add_install_script(meson_make_symlink, @@ -1727,13 +1776,15 @@ meson.add_install_script(meson_make_symlink, executable('systemd-run', 'src/run/run.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) executable('systemd-stdio-bridge', 'src/stdio-bridge/stdio-bridge.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) executable('busctl', @@ -1741,7 +1792,8 @@ executable('busctl', 'src/busctl/busctl-introspect.c', 'src/busctl/busctl-introspect.h', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true) if conf.get('ENABLE_SYSUSERS', 0) == 1 @@ -1768,7 +1820,8 @@ if conf.get('ENABLE_HWDB', 0) == 1 'src/hwdb/hwdb.c', 'src/libsystemd/sd-hwdb/hwdb-internal.h', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], install : true, install_dir : rootbindir) endif @@ -1786,7 +1839,7 @@ executable('systemd-socket-proxyd', 'src/socket-proxy/socket-proxyd.c', include_directories : includes, link_with : [libshared, - libsystemd], + libsystemd_internal], dependencies : [threads], install : true, install_dir : rootlibexecdir) @@ -1797,6 +1850,7 @@ executable('systemd-udevd', link_with : [libudev_core, libudev_internal, libsystemd_network, + libsystemd_internal, libshared], dependencies : [libkmod, libidn, @@ -1810,7 +1864,8 @@ executable('udevadm', link_with : [libudev_core, libudev_internal, libsystemd_network, - libshared], + libshared, + libsystemd_internal], dependencies : [libkmod, libidn, libacl], @@ -1820,7 +1875,8 @@ executable('udevadm', executable('systemd-shutdown', systemd_shutdown_sources, include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libudev], install : true, install_dir : rootlibexecdir) @@ -1834,7 +1890,8 @@ executable('systemd-update-done', executable('systemd-update-utmp', 'src/update-utmp/update-utmp.c', include_directories : includes, - link_with : [libshared], + link_with : [libshared, + libsystemd_internal], dependencies : [libaudit], install : true, install_dir : rootlibexecdir) @@ -1862,7 +1919,9 @@ executable('systemd-nspawn', 'src/core/loopback-setup.h', include_directories : [includes, include_directories('src/nspawn')], link_with : [libfirewall, - libshared], + libshared, + libudev, + libsystemd_internal], dependencies : [libacl, libblkid, libseccomp, @@ -1876,7 +1935,8 @@ executable('systemd-networkd', libfirewall, libsystemd_network, libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) @@ -1884,7 +1944,8 @@ executable('systemd-networkd-wait-online', systemd_networkd_wait_online_sources, include_directories : includes, link_with : [libnetworkd_core, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : rootlibexecdir) @@ -1892,7 +1953,8 @@ executable('networkctl', networkctl_sources, include_directories : includes, link_with : [libsystemd_network, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : rootbindir) diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 999347da46..15e7d77693 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -96,91 +96,3 @@ libsystemd_pc = configure_file( configuration : substs) install_data(libsystemd_pc, install_dir : pkgconfiglibdir) - -tests += [ - [['src/libsystemd/sd-bus/test-bus-marshal.c'], - [], - [libglib, - libgobject, - libgio, - libdbus]], - - [['src/libsystemd/sd-bus/test-bus-signature.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-chat.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-cleanup.c'], - [], - [libseccomp]], - - [['src/libsystemd/sd-bus/test-bus-track.c'], - [], - [libseccomp]], - - [['src/libsystemd/sd-bus/test-bus-server.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-objects.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-gvariant.c'], - [], - [libglib, - libgobject, - libgio]], - - [['src/libsystemd/sd-bus/test-bus-creds.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-match.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-kernel.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-benchmark.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-introspect.c'], - [], - []], - - [['src/libsystemd/sd-event/test-event.c'], - [], - []], - - [['src/libsystemd/sd-netlink/test-netlink.c'], - [], - []], - - [['src/libsystemd/sd-netlink/test-local-addresses.c'], - [], - []], - - [['src/libsystemd/sd-resolve/test-resolve.c'], - [], - [threads]], - - [['src/libsystemd/sd-login/test-login.c'], - [], - [], - '', 'manual'], - ] diff --git a/src/libudev/meson.build b/src/libudev/meson.build index 9fc3a3c742..f7bd62e3dd 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -26,7 +26,8 @@ libudev = shared_library( link_args : ['-shared', '-Wl,--version-script=' + libudev_sym_path], link_with : [libbasic, - libsystemd], + libsystemd_internal], + dependencies : [threads], link_depends : libudev_sym, install : true, install_dir : rootlibdir) diff --git a/src/machine/meson.build b/src/machine/meson.build index 1d83fece05..bf4f88f1aa 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -41,7 +41,9 @@ endif tests += [ [['src/machine/test-machine-tables.c'], [libmachine_core, - libshared], - [], + libshared_static, + libsystemd_internal, + libudev], + [threads], 'ENABLE_MACHINED'], ] diff --git a/src/network/meson.build b/src/network/meson.build index 8a15016307..a41ead952b 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -115,13 +115,15 @@ endif tests += [ [['src/network/test-networkd-conf.c'], [libnetworkd_core, - libsystemd_network], + libsystemd_network, + libudev], []], [['src/network/test-network.c'], [libnetworkd_core, libudev_internal, libsystemd_network, + libsystemd_internal, libfirewall], [libiptc]], @@ -132,6 +134,7 @@ tests += [ libudev_internal, libudev_core, libsystemd_network, + libsystemd_internal, libfirewall], [], '', '', [], diff --git a/src/resolve/meson.build b/src/resolve/meson.build index 5ece75b5be..c06cc997ad 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -173,7 +173,8 @@ tests += [ [['src/resolve/test-dnssec-complex.c', 'src/resolve/dns-type.c', dns_type_headers], - [libshared], + [libshared, + libsystemd_internal], [], 'ENABLE_RESOLVED', 'manual'], ] diff --git a/src/shared/meson.build b/src/shared/meson.build index 3024db6a44..3608575be4 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -126,7 +126,7 @@ libshared = shared_library( link_args : ['-shared'], c_args : ['-fvisibility=default'], link_with : [libsystemd_journal_internal, - libsystemd, + libsystemd_internal, libudev, ], dependencies : [threads, diff --git a/src/test/meson.build b/src/test/meson.build index 568378e381..6c950c3f0c 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -45,7 +45,7 @@ tests += [ [['src/test/test-engine.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -56,7 +56,7 @@ tests += [ [['src/test/test-job-type.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -67,7 +67,7 @@ tests += [ [['src/test/test-ns.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -79,7 +79,7 @@ tests += [ [['src/test/test-loopback.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -90,7 +90,7 @@ tests += [ [['src/test/test-hostname.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -112,7 +112,7 @@ tests += [ [['src/test/test-unit-name.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -123,7 +123,7 @@ tests += [ [['src/test/test-unit-file.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -156,7 +156,8 @@ tests += [ []], [['src/test/test-condition.c'], - [libshared], + [libsystemd_internal, + libshared], []], [['src/test/test-fdset.c'], @@ -287,8 +288,9 @@ tests += [ [['src/test/test-namespace.c'], [libcore, libudev, - libsystemd], - [libblkid]], + libsystemd_internal], + [threads, + libblkid]], [['src/test/test-verbs.c'], [libshared], @@ -368,7 +370,8 @@ tests += [ libjournal_core, libudev_core, libudev_internal, - libsystemd_network], + libsystemd_network, + libsystemd_internal], [threads, libseccomp, libmount, @@ -418,7 +421,8 @@ tests += [ 'HAVE_LIBIPTC'], [['src/test/test-netlink-manual.c'], - [libshared], + [libshared, + libsystemd_internal], [libkmod], '', 'manual'], @@ -459,7 +463,7 @@ tests += [ [['src/test/test-cgroup-mask.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -490,7 +494,7 @@ tests += [ [['src/test/test-path.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -501,7 +505,7 @@ tests += [ [['src/test/test-execute.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -519,7 +523,7 @@ tests += [ [['src/test/test-install.c'], [libcore, - libsystemd], + libsystemd_internal], [], '', 'manual'], @@ -530,7 +534,7 @@ tests += [ [['src/test/test-sched-prio.c'], [libcore, libudev, - libsystemd], + libsystemd_internal], [threads, librt, libseccomp, @@ -561,13 +565,15 @@ tests += [ []], [['src/test/test-libudev.c'], - [libshared], + [libshared, + libudev], []], [['src/test/test-udev.c'], [libudev_core, libudev_internal, libsystemd_network, + libsystemd_internal, libshared], [librt, libblkid, @@ -576,7 +582,8 @@ tests += [ '', 'manual'], [['src/test/test-id128.c'], - [libshared], + [libshared, + libsystemd_internal], []], [['src/test/test-hash.c'], @@ -584,7 +591,8 @@ tests += [ []], [['src/test/test-nss.c'], - [libshared], + [libshared, + libsystemd_internal], [libdl], '', 'manual'], ] @@ -595,7 +603,8 @@ tests += [ tests += [ [['src/journal/test-journal.c'], - [libjournal_core], + [libjournal_core, + libshared], [threads, libxz, liblz4]], @@ -603,87 +612,215 @@ tests += [ [['src/journal/test-journal-send.c'], [libjournal_core, libshared], - []], + [threads, + libxz, + liblz4]], [['src/journal/test-journal-syslog.c'], + [libjournal_core, + libshared, + libudev], + [threads, + libxz, + liblz4]], + + [['src/journal/test-journal-match.c'], [libjournal_core, libshared], [threads, libxz, liblz4]], - [['src/journal/test-journal-match.c'], - [libshared], + [['src/journal/test-journal-enum.c'], + [libjournal_core, + libshared], [threads, libxz, liblz4]], - [['src/journal/test-journal-enum.c'], - [libshared], - []], - [['src/journal/test-journal-stream.c'], - [libshared], + [libjournal_core, + libshared], [threads, libxz, liblz4]], [['src/journal/test-journal-flush.c'], - [libshared], + [libjournal_core, + libshared], [threads, libxz, liblz4]], [['src/journal/test-journal-init.c'], - [libshared], + [libjournal_core, + libshared], [threads, libxz, liblz4]], [['src/journal/test-journal-verify.c'], - [libshared], + [libjournal_core, + libshared], [threads, libxz, liblz4]], [['src/journal/test-journal-interleaving.c'], - [libshared], + [libjournal_core, + libshared], [threads, libxz, liblz4]], [['src/journal/test-mmap-cache.c'], - [libshared], - []], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], [['src/journal/test-catalog.c'], - [libshared], - [], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4], '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)], [['src/journal/test-compress.c'], - [libshared], + [libjournal_core, + libshared], [liblz4, libxz]], [['src/journal/test-compress-benchmark.c'], - [libshared], + [libjournal_core, + libshared], [liblz4, libxz]], [['src/journal/test-audit-type.c'], - [libshared], - []], + [libjournal_core, + libshared], + [liblz4, + libxz]], ] ############################################################ tests += [ + [['src/libsystemd/sd-bus/test-bus-marshal.c'], + [libsystemd_internal, + libshared], + [threads, + libglib, + libgobject, + libgio, + libdbus]], + + [['src/libsystemd/sd-bus/test-bus-signature.c'], + [libshared_static, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-chat.c'], + [libshared_static, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-cleanup.c'], + [libshared_static, + libsystemd_internal], + [threads, + libseccomp]], + [['src/libsystemd/sd-bus/test-bus-error.c'], [libshared_static, - libsystemd], + libsystemd_internal], []], - ] + + [['src/libsystemd/sd-bus/test-bus-track.c'], + [], + [libseccomp]], + + [['src/libsystemd/sd-bus/test-bus-server.c'], + [libshared_static, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-objects.c'], + [libshared_static, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-gvariant.c'], + [libshared, + libsystemd_internal], + [libglib, + libgobject, + libgio]], + + [['src/libsystemd/sd-bus/test-bus-creds.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-bus/test-bus-match.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-bus/test-bus-benchmark.c'], + [libshared, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-bus/test-bus-introspect.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-event/test-event.c'], + [], + []], + + [['src/libsystemd/sd-netlink/test-netlink.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-netlink/test-local-addresses.c'], + [libshared, + libsystemd_internal], + []], + + [['src/libsystemd/sd-resolve/test-resolve.c'], + [libshared, + libsystemd_internal], + [threads]], + + [['src/libsystemd/sd-login/test-login.c'], + [libshared, + libsystemd], + [], + '', 'manual'], +] ############################################################ @@ -700,7 +837,8 @@ tests += [ 'src/libsystemd-network/dhcp-internal.h', 'src/systemd/sd-dhcp-client.h'], [libshared, - libsystemd_network], + libsystemd_network, + libudev], []], [['src/libsystemd-network/test-dhcp-server.c'], @@ -718,14 +856,16 @@ tests += [ [['src/libsystemd-network/test-ipv4ll-manual.c', 'src/systemd/sd-ipv4ll.h'], [libshared, - libsystemd_network], + libsystemd_network, + libsystemd_internal], [], '', 'manual'], [['src/libsystemd-network/test-acd.c', 'src/systemd/sd-ipv4acd.h'], [libshared, - libsystemd_network], + libsystemd_network, + libsystemd_internal], [], '', 'manual'], @@ -770,6 +910,8 @@ tests += [ [['src/login/test-login-tables.c'], [liblogind_core, + libsystemd_internal, + libudev, libshared], - []], + [threads]], ] diff --git a/src/udev/meson.build b/src/udev/meson.build index f3c68a9d45..dd8ec53cdf 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -105,7 +105,8 @@ executable('ata_id', 'ata_id/ata_id.c', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) @@ -113,7 +114,8 @@ executable('cdrom_id', 'cdrom_id/cdrom_id.c', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) @@ -121,7 +123,8 @@ executable('collect', 'collect/collect.c', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) @@ -132,7 +135,8 @@ executable('scsi_id', 'scsi_id/scsi.h', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) @@ -140,7 +144,8 @@ executable('v4l_id', 'v4l_id/v4l_id.c', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) @@ -150,7 +155,8 @@ executable('mtd_probe', 'mtd_probe/probe_smartmedia.c', include_directories : includes, link_with : [libudev_internal, - libshared], + libshared, + libsystemd_internal], install : true, install_dir : udevlibexecdir) From 09cef4e7cc1e73f5fad0dbf9309832f5c1f28ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 17:35:21 -0400 Subject: [PATCH 22/82] meson: fix compilation of libsystemd It uses libsystemd_journal_internal_sources, so we need to make sure that audit_type-to-name.h is generated early enough. --- src/journal/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/journal/meson.build b/src/journal/meson.build index b05db85a43..f06b564c19 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -45,12 +45,13 @@ audit_type_to_name = custom_target( command : [awk, '-f', '@INPUT0@', '@INPUT1@'], capture : true) +libsystemd_journal_internal_sources += [audit_type_to_name] + ############################################################ libsystemd_journal_internal = static_library( 'systemd-journal-internal', libsystemd_journal_internal_sources, - audit_type_to_name, gcrypt_util_sources, install : false, include_directories : includes, From ef0221bc954a6341bd172950d1e163d35d472f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 17:35:55 -0400 Subject: [PATCH 23/82] meson: link test-lib{systemd,udev}-sym in the usual way I tried to link to the right library by hand, because without mesonbuid/meson#1545, libbasic.a is added to the link arguments. We want to link the test with nothing but the library being tested. Doing the linking by hand did achieve that, but it caused a bigger issue: meson didn't know about the dependency on the library. And the dependency cannot be added using link_depends, because "link_depends arguments must be strings...", and this does not work with a compilation target. So just link in the usual way and accept the overlinking (for now). --- meson.build | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 3f53b8a7e2..9d253590e3 100644 --- a/meson.build +++ b/meson.build @@ -2000,11 +2000,7 @@ test_libsystemd_sym = executable( 'test-libsystemd-sym', test_libsystemd_sym_c, include_directories : includes, - # link_with : [libsystemd], - # TODO: try again with https://github.com/mesonbuild/meson/pull/1545 - link_args : ['libsystemd.so.0.18.0'], - # link_depends : [libsystemd], - # TODO: try again after "Link_depends arguments must be strings." is solved + link_with : [libsystemd], install : install_tests, install_dir : testsdir) test('test-libsystemd-sym', @@ -2015,7 +2011,7 @@ test_libudev_sym = executable( test_libudev_sym_c, include_directories : includes, c_args : ['-Wno-deprecated-declarations'], - link_args : ['src/libudev/libudev.so.1.6.6'], + link_with : [libudev], install : install_tests, install_dir : testsdir) test('test-libudev-sym', From b2fc5836b2a9030ef6b33e62bb27ac0ed414777b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 18:13:00 -0400 Subject: [PATCH 24/82] meson: specify rpath on all executables linking to libshared (i.e. pretty much all of them). libtools does this automatically for us. It would be great if meson did too. Otherwise, it would be nice to simply attach the information about necessary rpath to the library object, and have it used automatically for all users. Dunno, maybe there's already a way to do this. I used '$ORIGIN' for stuff installed into libexecdir, since that's where libshared ends up, and a full path for everything else. The advantage of using $ORIGIN is that those binaries can be started from $DESTDIR, which can sometimes be useful. --- meson.build | 122 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 107 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 9d253590e3..82ec599537 100644 --- a/meson.build +++ b/meson.build @@ -1062,6 +1062,7 @@ executable('systemd', libselinux, libmount, libblkid], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1078,6 +1079,7 @@ executable('systemd-analyze', libselinux, libmount, libblkid], + install_rpath : '$ORIGIN', install : true) executable('systemd-journald', @@ -1090,6 +1092,7 @@ executable('systemd-journald', dependencies : [threads, libxz, liblz4], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1100,6 +1103,7 @@ executable('systemd-cat', libshared, libudev], dependencies : [threads], + install_rpath : rootlibexecdir, install : true) executable('journalctl', @@ -1113,39 +1117,44 @@ executable('journalctl', libqrencode, libxz, liblz4], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) executable('systemd-getty-generator', 'src/getty-generator/getty-generator.c', - install : true, - install_dir : systemgeneratordir, include_directories : includes, - link_with : [libshared]) + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) executable('systemd-debug-generator', 'src/debug-generator/debug-generator.c', - install : true, - install_dir : systemgeneratordir, include_directories : includes, - link_with : [libshared]) + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) executable('systemd-fstab-generator', 'src/fstab-generator/fstab-generator.c', 'src/core/mount-setup.c', - install : true, - install_dir : systemgeneratordir, include_directories : includes, - link_with : [libshared]) + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 executable('30-systemd-environment-d-generator', 'src/environment-d-generator/environment-d-generator.c', - install : true, - install_dir : userenvgeneratordir, include_directories : includes, link_with : [libshared, - libsystemd_internal]) + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : userenvgeneratordir) meson.add_install_script(meson_make_symlink, sysconfdir + '/environment', @@ -1157,6 +1166,7 @@ if conf.get('ENABLE_HIBERNATE', 0) == 1 'src/hibernate-resume/hibernate-resume-generator.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) @@ -1164,6 +1174,7 @@ if conf.get('ENABLE_HIBERNATE', 0) == 1 'src/hibernate-resume/hibernate-resume.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1172,18 +1183,20 @@ if conf.get('HAVE_BLKID', 0) == 1 executable('systemd-gpt-auto-generator', 'src/gpt-auto-generator/gpt-auto-generator.c', 'src/basic/blkid-util.h', - install : true, - install_dir : systemgeneratordir, include_directories : includes, link_with : [libsystemd_internal, libshared, libudev], - dependencies : libblkid) + dependencies : libblkid, + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) executable('systemd-dissect', 'src/dissect/dissect.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1197,6 +1210,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 dependencies : [threads, libm, libidn], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1208,6 +1222,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 dependencies : [threads, libm, libidn], + install_rpath : rootlibexecdir, install : true) endif @@ -1221,6 +1236,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 libsystemd_internal], dependencies : [threads, libacl], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1233,6 +1249,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 dependencies : [threads, liblz4, libxz], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1241,6 +1258,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1269,6 +1287,7 @@ if conf.get('HAVE_PAM', 0) == 1 'src/user-sessions/user-sessions.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1279,6 +1298,7 @@ if conf.get('ENABLE_EFI', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libblkid], + install_rpath : rootlibexecdir, install : true) endif @@ -1286,6 +1306,7 @@ executable('systemd-socket-activate', 'src/activate/activate.c', include_directories : includes, link_with : [libshared], dependencies : [threads], + install_rpath : rootlibexecdir, install : true) executable('systemctl', 'src/systemctl/systemctl.c', @@ -1297,6 +1318,7 @@ executable('systemctl', 'src/systemctl/systemctl.c', libselinux, libxz, liblz4], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1306,6 +1328,7 @@ if conf.get('ENABLE_BACKLIGHT', 0) == 1 include_directories : includes, link_with : [libshared, libudev], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1316,6 +1339,7 @@ if conf.get('ENABLE_RFKILL', 0) == 1 include_directories : includes, link_with : [libshared, libudev], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1324,6 +1348,7 @@ executable('systemd-system-update-generator', 'src/system-update-generator/system-update-generator.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) @@ -1334,6 +1359,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 link_with : [libshared, libsystemd_internal], dependencies : [libcryptsetup], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1342,6 +1368,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) @@ -1350,6 +1377,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libcryptsetup], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1359,6 +1387,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 link_with : [libshared, libsystemd_internal], dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) endif @@ -1368,6 +1397,7 @@ if conf.get('HAVE_SYSV_COMPAT', 0) == 1 'src/sysv-generator/sysv-generator.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) @@ -1375,6 +1405,7 @@ if conf.get('HAVE_SYSV_COMPAT', 0) == 1 'src/rc-local-generator/rc-local-generator.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : systemgeneratordir) endif @@ -1384,6 +1415,7 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 'src/hostname/hostnamed.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1392,6 +1424,7 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) endif @@ -1402,6 +1435,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 link_with : [libshared, libsystemd_internal], dependencies : [libdl], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1410,6 +1444,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) endif @@ -1419,12 +1454,14 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) executable('timedatectl', 'src/timedate/timedatectl.c', include_directories : includes, + install_rpath : rootlibexecdir, link_with : [libshared, libsystemd_internal], install : true) @@ -1438,6 +1475,7 @@ if conf.get('ENABLE_TIMESYNCD', 0) == 1 libsystemd_internal], dependencies : [threads, libm], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1449,6 +1487,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 link_with : [libmachine_core, libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1460,6 +1499,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 dependencies : [threads, libxz, liblz4], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) endif @@ -1471,6 +1511,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 link_with : [libsystemd_internal, libshared], dependencies : [threads], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1483,6 +1524,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libbzip2, libxz, libgcrypt], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1494,6 +1536,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libz, libbzip2, libxz], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1505,6 +1548,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libz, libbzip2, libxz], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1520,6 +1564,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 libgnutls, libxz, liblz4], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1535,6 +1580,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 libgnutls, libxz, liblz4], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1548,6 +1594,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 libgnutls, libxz, liblz4], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1564,6 +1611,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 libdw, libxz, liblz4], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1576,6 +1624,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 dependencies : [threads, libxz, liblz4], + install_rpath : rootlibexecdir, install : true) endif @@ -1584,6 +1633,7 @@ if conf.get('ENABLE_BINFMT', 0) == 1 'src/binfmt/binfmt.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1598,6 +1648,7 @@ if conf.get('ENABLE_VCONSOLE', 0) == 1 'src/vconsole/vconsole-setup.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1607,6 +1658,7 @@ if conf.get('ENABLE_RANDOMSEED', 0) == 1 'src/random-seed/random-seed.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1617,6 +1669,7 @@ if conf.get('ENABLE_FIRSTBOOT', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libcrypt], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) endif @@ -1627,6 +1680,7 @@ executable('systemd-remount-fs', 'src/core/mount-setup.h', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1637,6 +1691,7 @@ executable('systemd-machine-id-setup', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1645,6 +1700,7 @@ executable('systemd-fsck', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1652,6 +1708,7 @@ executable('systemd-sleep', 'src/sleep/sleep.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1659,6 +1716,7 @@ executable('systemd-sysctl', 'src/sysctl/sysctl.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1666,6 +1724,7 @@ executable('systemd-ac-power', 'src/ac-power/ac-power.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1673,18 +1732,21 @@ executable('systemd-detect-virt', 'src/detect-virt/detect-virt.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true) executable('systemd-delta', 'src/delta/delta.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true) executable('systemd-escape', 'src/escape/escape.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1692,6 +1754,7 @@ executable('systemd-notify', 'src/notify/notify.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1699,6 +1762,7 @@ executable('systemd-volatile-root', 'src/volatile-root/volatile-root.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1706,6 +1770,7 @@ executable('systemd-cgroups-agent', 'src/cgroups-agent/cgroups-agent.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1714,6 +1779,7 @@ executable('systemd-path', include_directories : includes, link_with : [libsystemd_internal, libshared], + install_rpath : rootlibexecdir, install : true) executable('systemd-ask-password', @@ -1721,6 +1787,7 @@ executable('systemd-ask-password', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1729,6 +1796,7 @@ executable('systemd-reply-password', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1737,6 +1805,7 @@ executable('systemd-tty-ask-password-agent', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1745,6 +1814,7 @@ executable('systemd-cgls', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) executable('systemd-cgtop', @@ -1752,6 +1822,7 @@ executable('systemd-cgtop', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) executable('systemd-initctl', @@ -1759,6 +1830,7 @@ executable('systemd-initctl', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1768,6 +1840,7 @@ executable('systemd-mount', link_with : [libshared, libsystemd_internal, libudev], + install_rpath : rootlibexecdir, install : true) meson.add_install_script(meson_make_symlink, @@ -1778,6 +1851,7 @@ executable('systemd-run', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) executable('systemd-stdio-bridge', @@ -1785,6 +1859,7 @@ executable('systemd-stdio-bridge', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) executable('busctl', @@ -1794,6 +1869,7 @@ executable('busctl', include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true) if conf.get('ENABLE_SYSUSERS', 0) == 1 @@ -1801,6 +1877,7 @@ if conf.get('ENABLE_SYSUSERS', 0) == 1 'src/sysusers/sysusers.c', include_directories : includes, link_with : [libshared], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) endif @@ -1811,6 +1888,7 @@ if conf.get('ENABLE_TMPFILES', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libacl], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) endif @@ -1822,6 +1900,7 @@ if conf.get('ENABLE_HWDB', 0) == 1 include_directories : includes, link_with : [libshared, libsystemd_internal], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) endif @@ -1831,6 +1910,7 @@ if conf.get('ENABLE_QUOTACHECK', 0) == 1 'src/quotacheck/quotacheck.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) endif @@ -1841,6 +1921,7 @@ executable('systemd-socket-proxyd', link_with : [libshared, libsystemd_internal], dependencies : [threads], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1855,6 +1936,7 @@ executable('systemd-udevd', dependencies : [libkmod, libidn, libacl], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1869,6 +1951,7 @@ executable('udevadm', dependencies : [libkmod, libidn, libacl], + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1877,6 +1960,7 @@ executable('systemd-shutdown', include_directories : includes, link_with : [libshared, libudev], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1884,6 +1968,7 @@ executable('systemd-update-done', 'src/update-done/update-done.c', include_directories : includes, link_with : [libshared], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1893,6 +1978,7 @@ executable('systemd-update-utmp', link_with : [libshared, libsystemd_internal], dependencies : [libaudit], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1902,6 +1988,7 @@ if conf.get('HAVE_KMOD', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libkmod], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1926,6 +2013,7 @@ executable('systemd-nspawn', libblkid, libseccomp, libselinux], + install_rpath : rootlibexecdir, install : true) executable('systemd-networkd', @@ -1937,6 +2025,7 @@ executable('systemd-networkd', libudev_internal, libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1946,6 +2035,7 @@ executable('systemd-networkd-wait-online', link_with : [libnetworkd_core, libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootlibexecdir) @@ -1955,6 +2045,7 @@ executable('networkctl', link_with : [libsystemd_network, libshared, libsystemd_internal], + install_rpath : '$ORIGIN', install : true, install_dir : rootbindir) @@ -1981,6 +2072,7 @@ foreach tuple : tests link_with : link_with, dependencies : dependencies, c_args : defs, + install_rpath : rootlibexecdir, install : install, install_dir : testsdir) From 3131bfe302d3d2657576499a86827ca979846b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Apr 2017 19:06:45 -0400 Subject: [PATCH 25/82] meson: add a few forgotten substitutions v2: - a few more --- meson.build | 16 ++++++++++++++-- meson_options.txt | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 82ec599537..57e439e733 100644 --- a/meson.build +++ b/meson.build @@ -107,6 +107,7 @@ bootlibdir = prefixdir + '/lib/systemd/boot/efi' testsdir = prefixdir + '/lib/systemd/tests' systemdstatedir = localstatedir + '/lib/systemd' catalogstatedir = systemdstatedir + '/catalog' +randomseeddir = localstatedir + '/lib/systemd/' dbuspolicydir = get_option('dbuspolicydir') if dbuspolicydir == '' @@ -151,8 +152,8 @@ conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir + '/sys conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir + '/systemd-tty-ask-password-agent') conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir + '/systemd-stdio-bridge') conf.set_quoted('ROOTPREFIX', rootprefixdir) -conf.set_quoted('RANDOM_SEED_DIR', localstatedir + '/lib/systemd/') -conf.set_quoted('RANDOM_SEED', localstatedir + '/lib/systemd/random-seed') +conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) +conf.set_quoted('RANDOM_SEED', randomseeddir + '/random-seed') conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir + '/systemd-cryptsetup') conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) @@ -179,7 +180,13 @@ conf.set_quoted('ABS_BUILD_DIR', meson.build_root() conf.set_quoted('ABS_SRC_DIR', meson.source_root()) substs.set('prefix', prefixdir) +substs.set('exec_prefix', prefixdir) +substs.set('libdir', libdir) +substs.set('rootlibdir', rootlibdir) +substs.set('includedir', includedir) substs.set('pkgsysconfdir', pkgsysconfdir) +substs.set('bindir', bindir) +substs.set('rootbindir', rootbindir) substs.set('rootlibexecdir', rootlibexecdir) substs.set('systemunitdir', systemunitdir) substs.set('userunitdir', userunitdir) @@ -187,6 +194,7 @@ substs.set('systempresetdir', systempresetdir) substs.set('userpresetdir', userpresetdir) substs.set('udevhwdbdir', udevhwdbdir) substs.set('udevrulesdir', udevrulesdir) +substs.set('udevlibexecdir', udevlibexecdir) substs.set('catalogdir', catalogdir) substs.set('tmpfilesdir', tmpfilesdir) substs.set('sysusersdir', sysusersdir) @@ -200,6 +208,7 @@ substs.set('userenvgeneratordir', userenvgeneratordi substs.set('systemshutdowndir', systemshutdowndir) substs.set('systemsleepdir', systemsleepdir) substs.set('SYSTEMCTL', rootbindir + '/systemctl') +substs.set('RANDOM_SEED', randomseeddir + '/random-seed') ##################################################################### @@ -536,6 +545,9 @@ conf.set_quoted('NTP_SERVERS', get_option('ntp-servers')) conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) +substs.set('SUSHELL', get_option('debug-shell')) +substs.set('DEBUGTTY', get_option('debug-tty')) + ##################################################################### threads = dependency('threads') diff --git a/meson_options.txt b/meson_options.txt index 981eace590..5b3d37ce9e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,11 @@ option('umount-path', type : 'string', description : 'path to umount') option('loadkeys-path', type : 'string', description : 'path to loadkeys') option('setfont-path', type : 'string', description : 'path to setfont') +option('debug-shell', type : 'string', value : '/bin/sh', + description : 'path to debug shell binary') +option('debug-tty', type : 'string', value : '/dev/tty9', + description : 'specify the tty device for debug shell') + option('utmp', type : 'boolean', description : 'support for utmp/wtmp log handling') option('hibernate', type : 'boolean', From 9cc0e6e99ca3645b87c22fecdaa9ba9965a12e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 11 Apr 2017 10:25:34 -0400 Subject: [PATCH 26/82] meson: make cpp invocations cross-compilation friendly This implementation assumes that the arguments in compiler.cmd_array() don't contain any spaces. Since we are only interested in compilation on Linux, I think this is a safe assumption. Solution suggested by Nirbheek Chauhan. --- meson.build | 2 ++ src/basic/generate-af-list.sh | 2 +- src/basic/generate-arphrd-list.sh | 2 +- src/basic/generate-cap-list.sh | 2 +- src/basic/generate-errno-list.sh | 2 +- src/basic/meson.build | 8 ++++---- src/journal/generate-audit_type-list.sh | 6 +++++- src/journal/meson.build | 2 +- src/udev/generate-keyboard-keys-list.sh | 2 +- src/udev/meson.build | 2 +- 10 files changed, 18 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 57e439e733..8c01872a26 100644 --- a/meson.build +++ b/meson.build @@ -295,6 +295,8 @@ foreach arg : ['-Wl,-z,relro', endif endforeach +cpp = ' '.join(cc.cmd_array()) + ' -E' + ##################################################################### # compilation result tests diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh index e4f9f68312..3fdfe2ea60 100644 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -1,5 +1,5 @@ #!/bin/sh -cpp -dM -include sys/socket.h - Date: Wed, 12 Apr 2017 12:02:30 -0400 Subject: [PATCH 27/82] meson: replace $ORIGIN with rootlibdir everywhere $ORIGIN does not work when /proc is not mounted. So the systemd binary cannot use $ORIGIN. Use the full path everywhere for consistency. --- meson.build | 88 ++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/meson.build b/meson.build index 8c01872a26..404a2aa473 100644 --- a/meson.build +++ b/meson.build @@ -1076,7 +1076,7 @@ executable('systemd', libselinux, libmount, libblkid], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1093,7 +1093,7 @@ executable('systemd-analyze', libselinux, libmount, libblkid], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true) executable('systemd-journald', @@ -1106,7 +1106,7 @@ executable('systemd-journald', dependencies : [threads, libxz, liblz4], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1210,7 +1210,7 @@ if conf.get('HAVE_BLKID', 0) == 1 'src/dissect/dissect.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1224,7 +1224,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 dependencies : [threads, libm, libidn], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1250,7 +1250,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 libsystemd_internal], dependencies : [threads, libacl], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1301,7 +1301,7 @@ if conf.get('HAVE_PAM', 0) == 1 'src/user-sessions/user-sessions.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1342,7 +1342,7 @@ if conf.get('ENABLE_BACKLIGHT', 0) == 1 include_directories : includes, link_with : [libshared, libudev], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1353,7 +1353,7 @@ if conf.get('ENABLE_RFKILL', 0) == 1 include_directories : includes, link_with : [libshared, libudev], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1373,7 +1373,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 link_with : [libshared, libsystemd_internal], dependencies : [libcryptsetup], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1391,7 +1391,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libcryptsetup], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1429,7 +1429,7 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 'src/hostname/hostnamed.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1449,7 +1449,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 link_with : [libshared, libsystemd_internal], dependencies : [libdl], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1489,7 +1489,7 @@ if conf.get('ENABLE_TIMESYNCD', 0) == 1 libsystemd_internal], dependencies : [threads, libm], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1501,7 +1501,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 link_with : [libmachine_core, libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1525,7 +1525,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 link_with : [libsystemd_internal, libshared], dependencies : [threads], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1538,7 +1538,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libbzip2, libxz, libgcrypt], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1550,7 +1550,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libz, libbzip2, libxz], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1562,7 +1562,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 libz, libbzip2, libxz], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1578,7 +1578,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 libgnutls, libxz, liblz4], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1594,7 +1594,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 libgnutls, libxz, liblz4], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1608,7 +1608,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 libgnutls, libxz, liblz4], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1625,7 +1625,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 libdw, libxz, liblz4], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1647,7 +1647,7 @@ if conf.get('ENABLE_BINFMT', 0) == 1 'src/binfmt/binfmt.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1662,7 +1662,7 @@ if conf.get('ENABLE_VCONSOLE', 0) == 1 'src/vconsole/vconsole-setup.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1672,7 +1672,7 @@ if conf.get('ENABLE_RANDOMSEED', 0) == 1 'src/random-seed/random-seed.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1714,7 +1714,7 @@ executable('systemd-fsck', include_directories : includes, link_with : [libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1722,7 +1722,7 @@ executable('systemd-sleep', 'src/sleep/sleep.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1730,7 +1730,7 @@ executable('systemd-sysctl', 'src/sysctl/sysctl.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1738,7 +1738,7 @@ executable('systemd-ac-power', 'src/ac-power/ac-power.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1776,7 +1776,7 @@ executable('systemd-volatile-root', 'src/volatile-root/volatile-root.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1784,7 +1784,7 @@ executable('systemd-cgroups-agent', 'src/cgroups-agent/cgroups-agent.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1810,7 +1810,7 @@ executable('systemd-reply-password', include_directories : includes, link_with : [libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1844,7 +1844,7 @@ executable('systemd-initctl', include_directories : includes, link_with : [libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1924,7 +1924,7 @@ if conf.get('ENABLE_QUOTACHECK', 0) == 1 'src/quotacheck/quotacheck.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) endif @@ -1935,7 +1935,7 @@ executable('systemd-socket-proxyd', link_with : [libshared, libsystemd_internal], dependencies : [threads], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1950,7 +1950,7 @@ executable('systemd-udevd', dependencies : [libkmod, libidn, libacl], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1974,7 +1974,7 @@ executable('systemd-shutdown', include_directories : includes, link_with : [libshared, libudev], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1982,7 +1982,7 @@ executable('systemd-update-done', 'src/update-done/update-done.c', include_directories : includes, link_with : [libshared], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1992,7 +1992,7 @@ executable('systemd-update-utmp', link_with : [libshared, libsystemd_internal], dependencies : [libaudit], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2002,7 +2002,7 @@ if conf.get('HAVE_KMOD', 0) == 1 include_directories : includes, link_with : [libshared], dependencies : [libkmod], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2039,7 +2039,7 @@ executable('systemd-networkd', libudev_internal, libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2049,7 +2049,7 @@ executable('systemd-networkd-wait-online', link_with : [libnetworkd_core, libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2059,7 +2059,7 @@ executable('networkctl', link_with : [libsystemd_network, libshared, libsystemd_internal], - install_rpath : '$ORIGIN', + install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) From f0bd7cc7012190e91183e9ee7649dd423e25629d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 12:14:30 -0400 Subject: [PATCH 28/82] meson: fix compilation with -Dnetworkd=false, -Dkmod=no, -Dlibgcrypt=no The tests are included under the conditional too, instead of specifying 'ENABLE_NETWORKD' in the test definition array, because libnetworkd_core dependency is undefined if networkd is disabled. --- meson.build | 46 +++++++++++++++++++----------------- src/network/meson.build | 52 ++++++++++++++++++++--------------------- src/test/meson.build | 2 +- 3 files changed, 51 insertions(+), 49 deletions(-) diff --git a/meson.build b/meson.build index 404a2aa473..116325fb7d 100644 --- a/meson.build +++ b/meson.build @@ -855,7 +855,7 @@ if want_importd != 'no' conf.get('HAVE_ZLIB', 0) == 1 and conf.get('HAVE_BZIP2', 0) == 1 and conf.get('HAVE_XZ', 0) == 1 and - conf.get('HAVE_LZ4', 0) == 1) + conf.get('HAVE_LIBGCRYPT', 0) == 1) if have_deps conf.set('ENABLE_IMPORTD', 1) elif want_importd == 'yes' @@ -2030,28 +2030,30 @@ executable('systemd-nspawn', install_rpath : rootlibexecdir, install : true) -executable('systemd-networkd', - systemd_networkd_sources, - include_directories : includes, - link_with : [libnetworkd_core, - libfirewall, - libsystemd_network, - libudev_internal, - libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) +if conf.get('ENABLE_NETWORKD', 0) == 1 + executable('systemd-networkd', + systemd_networkd_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libfirewall, + libsystemd_network, + libudev_internal, + libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) -executable('systemd-networkd-wait-online', - systemd_networkd_wait_online_sources, - include_directories : includes, - link_with : [libnetworkd_core, - libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-networkd-wait-online', + systemd_networkd_wait_online_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) +endif executable('networkctl', networkctl_sources, diff --git a/src/network/meson.build b/src/network/meson.build index a41ead952b..66d6a52dcf 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -110,33 +110,33 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_dir : dbussystemservicedir) install_data('systemd-networkd.rules', install_dir : polkitrulesdir) -endif -tests += [ - [['src/network/test-networkd-conf.c'], - [libnetworkd_core, - libsystemd_network, - libudev], - []], + tests += [ + [['src/network/test-networkd-conf.c'], + [libnetworkd_core, + libsystemd_network, + libudev], + []], - [['src/network/test-network.c'], - [libnetworkd_core, - libudev_internal, - libsystemd_network, - libsystemd_internal, - libfirewall], - [libiptc]], + [['src/network/test-network.c'], + [libnetworkd_core, + libudev_internal, + libsystemd_network, + libsystemd_internal, + libfirewall], + [libiptc]], - [['src/network/test-network-tables.c', - 'src/network/test-network-tables.c', - test_tables_h], - [libnetworkd_core, - libudev_internal, - libudev_core, - libsystemd_network, - libsystemd_internal, - libfirewall], - [], - '', '', [], - [network_include_dir] + libudev_core_includes], + [['src/network/test-network-tables.c', + 'src/network/test-network-tables.c', + test_tables_h], + [libnetworkd_core, + libudev_internal, + libudev_core, + libsystemd_network, + libsystemd_internal, + libfirewall], + [], + '', '', [], + [network_include_dir] + libudev_core_includes], ] +endif diff --git a/src/test/meson.build b/src/test/meson.build index 6c950c3f0c..26b399dfc5 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -424,7 +424,7 @@ tests += [ [libshared, libsystemd_internal], [libkmod], - '', 'manual'], + 'HAVE_KMOD', 'manual'], [['src/test/test-ellipsize.c'], [libshared], From 8191c5948baaaf666aebb5201adb317026d28912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 12:36:20 -0400 Subject: [PATCH 29/82] meson: disable bootctl without libblkid bootctl uses blkid probe functions to find the ESP, hence it's useless without it. Don't even try to build it if libblkid is unavailable. --- meson.build | 2 +- meson_options.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 116325fb7d..7eac7b48fe 100644 --- a/meson.build +++ b/meson.build @@ -1306,7 +1306,7 @@ if conf.get('HAVE_PAM', 0) == 1 install_dir : rootlibexecdir) endif -if conf.get('ENABLE_EFI', 0) == 1 +if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1 executable('bootctl', 'src/boot/bootctl.c', include_directories : includes, diff --git a/meson_options.txt b/meson_options.txt index 5b3d37ce9e..653a3a6ec7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,7 +36,7 @@ option('ldconfig', type : 'boolean', option('resolve', type : 'boolean', description : 'systemd-resolved stack') option('efi', type : 'boolean', - description : 'support for EFI') + description : 'enable systemd-boot and bootctl') option('environment-d', type : 'boolean', description : 'support for environment.d') option('binfmt', type : 'boolean', From 81efcc1c8979451e74725c97ad901a4bf5780a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 13:08:47 -0400 Subject: [PATCH 30/82] meson: specify a timeout of 90 s for tests which take a bit longer Both test-hashmap and test-benchmark need 10-11 s here, but might time out under load with the default meson timeout of 30 s. --- meson.build | 9 ++++++++- src/test/meson.build | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7eac7b48fe..aab0e550f6 100644 --- a/meson.build +++ b/meson.build @@ -2075,8 +2075,13 @@ foreach tuple : tests type = tuple.length() >= 5 ? tuple[4] : '' defs = tuple.length() >= 6 ? tuple[5] : [] incs = tuple.length() >= 7 ? tuple[6] : includes + timeout = 30 name = sources[0].split('/')[-1].split('.')[0] + if type.startswith('timeout=') + timeout = type.split('=')[1].to_int() + type = '' + endif if condition == '' or conf.get(condition, 0) == 1 install = install_tests and type == '' @@ -2097,7 +2102,9 @@ foreach tuple : tests elif type == 'unsafe' and want_tests != 'unsafe' message('@0@ is an unsafe test'.format(name)) else - test(name, exe, env : test_env) + test(name, exe, + env : test_env, + timeout : timeout) endif else message('Not compiling @0@ because @1@ is not true'.format(name, condition)) diff --git a/src/test/meson.build b/src/test/meson.build index 26b399dfc5..234fb77475 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -340,7 +340,8 @@ tests += [ 'src/test/test-hashmap-plain.c', test_hashmap_ordered_c], [libshared], - []], + [], + '', 'timeout=90'], [['src/test/test-set.c'], [libshared], @@ -698,7 +699,8 @@ tests += [ [libjournal_core, libshared], [liblz4, - libxz]], + libxz], + '', 'timeout=90'], [['src/journal/test-audit-type.c'], [libjournal_core, From b710072da4410641512d328f82ee35a7d5d8248a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 15:05:55 -0400 Subject: [PATCH 31/82] meson: add support for building efi modules This is a very straightforward conversion of the rules in Makefile.am. Generated objects (on arm64) are identical. The only difference in executed commands is that automake uses ld -m elf_x86_64, without us specifying the -m option anywhere. I suspect that using the default for the given linker should be OK, so it's fine to just skip it. --- meson.build | 11 +- meson_options.txt | 13 ++ src/boot/efi/meson.build | 179 +++++++++++++++++++++++++++ src/boot/efi/no-undefined-symbols.sh | 6 + 4 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 src/boot/efi/meson.build create mode 100644 src/boot/efi/no-undefined-symbols.sh diff --git a/meson.build b/meson.build index aab0e550f6..b04c92776c 100644 --- a/meson.build +++ b/meson.build @@ -903,6 +903,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['hwdb', 'ENABLE_HWDB'], ['rfkill', 'ENABLE_RFKILL'], ['ldconfig', 'ENABLE_LDCONFIG'], + ['efi', 'ENABLE_EFI'], ] if get_option(pair[0]) @@ -917,15 +918,18 @@ tests = [] ##################################################################### if get_option('efi') - efi_arch = host_machine.cpu_family() # TODO: check this works at all + efi_arch = host_machine.cpu_family() + if efi_arch == 'ia32' EFI_MACHINE_TYPE_NAME = 'ia32' elif efi_arch == 'x86_64' EFI_MACHINE_TYPE_NAME = 'x64' + elif efi_arch == 'arm' + EFI_MACHINE_TYPE_NAME = 'arm' elif efi_arch == 'aarch64' - EFI_MACHINE_TYPE_NAME = 'x64' + EFI_MACHINE_TYPE_NAME = 'aa64' else - EFI_MACHINE_TYPE_NAME = efi_arch + EFI_MACHINE_TYPE_NAME = '' endif conf.set('ENABLE_EFI', 1) @@ -1060,6 +1064,7 @@ subdir('src/timedate') subdir('src/timesync') subdir('src/vconsole') subdir('src/sulogin-shell') +subdir('src/boot/efi') subdir('src/test') diff --git a/meson_options.txt b/meson_options.txt index 653a3a6ec7..610e365fcd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -199,6 +199,19 @@ option('glib', type : 'combo', choices : ['auto', 'yes', 'no'], option('dbus', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'libdbus support (for tests only)') +option('gnu-efi', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'gnu-efi support for sd-boot') +option('efi-cc', type : 'string', value : 'gcc', + description : 'the compiler to use for EFI modules') +option('efi-ld', type : 'string', value : 'ld', + description : 'the linker to use for EFI modules') +option('efi-libdir', type : 'string', + description : 'path to the EFI lib directory') +option('efi-ldsdir', type : 'string', + description : 'path to the EFI lds directory') +option('efi-includedir', type : 'string', value : '/usr/include/efi', + description : 'path to the EFI header directory') + option('bashcompletiondir', type : 'string', description : 'directory for bash completion scripts ["no" disables]') option('zshcompletiondir', type : 'string', diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build new file mode 100644 index 0000000000..858dd4a870 --- /dev/null +++ b/src/boot/efi/meson.build @@ -0,0 +1,179 @@ +efi_headers = files(''' + console.h + disk.h + graphics.h + linux.h + measure.h + pefile.h + splash.h + util.h +'''.split()) + +common_sources = ''' + disk.c + graphics.c + measure.c + pefile.c + util.c +'''.split() + +systemd_boot_sources = ''' + boot.c + console.c +'''.split() + +stub_sources = ''' + linux.c + splash.c + stub.c +'''.split() + +if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'no' + efi_cc = get_option('efi-cc') + efi_ld = get_option('efi-ld') + + efibind_h = 'efi/@0@/efibind.h'.format(efi_arch) + have_header = cc.has_header(efibind_h) + + if have_header and EFI_MACHINE_TYPE_NAME == '' + error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown') + endif + + efi_libdir = get_option('efi-libdir') + if efi_libdir == '' + cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc) + ret = run_command('sh', '-c', cmd) + if ret.returncode() == 0 + efi_libdir = ret.stdout().strip() + endif + endif + + have_gnu_efi = have_header and efi_libdir != '' +else + have_gnu_efi = false +endif + +if get_option('gnu-efi') == 'yes' and not have_gnu_efi + error('gnu-efi support requested, but headers were not found') +endif + +if have_gnu_efi + efi_conf = configuration_data() + efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) + efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) + + efi_config_h = configure_file( + output : 'efi_config.h', + configuration : efi_conf) + + objcopy = find_program('objcopy') + + efi_ldsdir = get_option('efi-ldsdir') + if efi_ldsdir == '' + efi_ldsdir = efi_libdir + '/gnuefi' + endif + + efi_incdir = get_option('efi-includedir') + + message('efi-libdir: "@0@"'.format(efi_libdir)) + message('efi-ldsdir: "@0@"'.format(efi_ldsdir)) + message('efi-includedir: "@0@"'.format(efi_incdir)) + + compile_args = ['-Wall', + '-Wextra', + '-std=gnu90', + '-nostdinc', + '-ggdb', '-O0', + '-fpic', + '-fshort-wchar', + '-ffreestanding', + '-fno-strict-aliasing', + '-fno-stack-protector', + '-Wsign-compare', + '-Wno-missing-field-initializers', + '-isystem', efi_incdir, + '-isystem', efi_incdir + '/' + efi_arch, + '-include', efi_config_h] + if efi_arch == 'x86_64' + compile_args += ['-mno-red-zone', + '-mno-sse', + '-mno-mmx', + '-DEFI_FUNCTION_WRAPPER', + '-DGNU_EFI_USE_MS_ABI'] + elif efi_arch == 'ia32' + compile_args += ['-mno-sse', + '-mno-mmx'] + endif + + efi_ldflags = ['-T', + '@0@/elf_@1@_efi.lds'.format(efi_ldsdir, efi_arch), + '-shared', + '-Bsymbolic', + '-nostdlib', + '-znocombreloc', + '-L', efi_libdir, + '@0@/crt0-efi-@1@.o'.format(efi_ldsdir, efi_arch)] + if efi_arch == 'aarch64' or efi_arch == 'arm' + # Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' + # instead, and add required symbols manually. + efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa'] + efi_format = ['-O', 'binary'] + else + efi_format = ['--target=efi-app-@0@'.format(efi_arch)] + endif + + systemd_boot_objects = [] + stub_objects = [] + foreach file : common_sources + systemd_boot_sources + stub_sources + o_file = custom_target(file + '.o', + input : file, + output : file + '.o', + command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@'] + + compile_args, + depend_files : efi_headers) + if (common_sources + systemd_boot_sources).contains(file) + systemd_boot_objects += [o_file] + endif + if (common_sources + stub_sources).contains(file) + stub_objects += [o_file] + endif + endforeach + + libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip() + systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME) + stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME) + no_undefined_symbols = find_program('no-undefined-symbols.sh') + + foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects], + ['stub.so', stub_efi_name, stub_objects]] + so = custom_target( + tuple[0], + input : tuple[2], + output : tuple[0], + command : [efi_ld, '-o', '@OUTPUT@'] + + efi_ldflags + tuple[2] + + ['-lefi', '-lgnuefi', libgcc_file_name]) + + test('no-undefined-symbols-' + tuple[0], + no_undefined_symbols, + args : [so]) + + custom_target( + tuple[1], + input : so, + output : tuple[1], + command : [objcopy, + '-j', '.text', + '-j', '.sdata', + '-j', '.data', + '-j', '.dynamic', + '-j', '.dynsym', + '-j', '.rel', + '-j', '.rela', + '-j', '.reloc'] + + efi_format + + ['@INPUT@', '@OUTPUT@'], + install : true, + install_dir : bootlibdir) + endforeach +endif diff --git a/src/boot/efi/no-undefined-symbols.sh b/src/boot/efi/no-undefined-symbols.sh new file mode 100644 index 0000000000..4d92082825 --- /dev/null +++ b/src/boot/efi/no-undefined-symbols.sh @@ -0,0 +1,6 @@ +#!/bin/sh -e + +if nm -D -u "$1" | grep ' U '; then + echo "Undefined symbols detected!" + exit 1 +fi From 3ca0cb7363bca613eaa5d206f4e13ae2927ae9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 19:09:26 -0400 Subject: [PATCH 32/82] meson: properly conditionalize polkit installation ... including pkla installation on Debian. v2: - fix polkit-gobject-1 pkgconfig name --- meson.build | 15 +++++++++++++++ meson_options.txt | 2 ++ src/core/meson.build | 4 ++-- src/hostname/meson.build | 2 +- src/import/meson.build | 2 +- src/locale/meson.build | 2 +- src/login/meson.build | 2 +- src/machine/meson.build | 2 +- src/network/meson.build | 10 ++++++++-- src/timedate/meson.build | 2 +- 10 files changed, 33 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index b04c92776c..9b46a7edd8 100644 --- a/meson.build +++ b/meson.build @@ -617,6 +617,21 @@ if smack_run_label != '' m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] endif +want_polkit = get_option('polkit') +install_polkit = false +install_polkit_pkla = false +if want_polkit != 'no' + conf.set('ENABLE_POLKIT', 1) + install_polkit = true + + libpolkit = dependency('polkit-gobject-1', + required : false) + if libpolkit.found() and libpolkit.version().version_compare('< 0.106') + message('Old polkit detected, will install pkla files') + install_polkit_pkla = true + endif +endif + want_audit = get_option('audit') if want_audit != 'no' libaudit = dependency('audit', required : want_audit == 'yes') diff --git a/meson_options.txt b/meson_options.txt index 610e365fcd..b1b80bfa69 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -159,6 +159,8 @@ option('smack', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'SMACK support') option('smack-run-label', type : 'string', description : 'run systemd --system itself with a specific SMACK label') +option('polkit', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'PolicyKit support') option('audit', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'libaudit support') diff --git a/src/core/meson.build b/src/core/meson.build index bf4e2dbed9..97410a8cc4 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -203,7 +203,7 @@ custom_target( input : policy_in, output : 'org.freedesktop.systemd1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) # TODO: this might work with meson from git, see @@ -214,7 +214,7 @@ custom_target( # po_dir : po_dir, # input : policy_in, # output : 'org.freedesktop.systemd1.policy', -# install : true, +# install : install_polkit, # install_dir : polkitpolicydir) install_data('system.conf', diff --git a/src/hostname/meson.build b/src/hostname/meson.build index 43a035c0bf..6985a41910 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -11,6 +11,6 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 input : 'org.freedesktop.hostname1.policy.in', output : 'org.freedesktop.hostname1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/import/meson.build b/src/import/meson.build index 173d6d6f3f..66f43dd714 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -61,7 +61,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 input : 'org.freedesktop.import1.policy.in', output : 'org.freedesktop.import1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) install_data('import-pubring.gpg', diff --git a/src/locale/meson.build b/src/locale/meson.build index 2f903cffd0..775ad2ce77 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -19,7 +19,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 input : 'org.freedesktop.locale1.policy.in', output : 'org.freedesktop.locale1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/login/meson.build b/src/login/meson.build index 75b8498862..d3e2b73e8b 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -78,7 +78,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 input : 'org.freedesktop.login1.policy.in', output : 'org.freedesktop.login1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) install_data('70-power-switch.rules', diff --git a/src/machine/meson.build b/src/machine/meson.build index bf4f88f1aa..de98246282 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -34,7 +34,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 input : 'org.freedesktop.machine1.policy.in', output : 'org.freedesktop.machine1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/network/meson.build b/src/network/meson.build index 66d6a52dcf..4cde777292 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -108,8 +108,14 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.network1.service', install_dir : dbussystemservicedir) - install_data('systemd-networkd.rules', - install_dir : polkitrulesdir) + if install_polkit + install_data('systemd-networkd.rules', + install_dir : polkitrulesdir) + endif + if install_polkit_pkla + install_data('systemd-networkd.pkla', + install_dir : polkitpkladir) + endif tests += [ [['src/network/test-networkd-conf.c'], diff --git a/src/timedate/meson.build b/src/timedate/meson.build index f9c19f1d67..52518a87e4 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -11,6 +11,6 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 input : 'org.freedesktop.timedate1.policy.in', output : 'org.freedesktop.timedate1.policy', command : intltool_command, - install : true, + install : install_polkit, install_dir : polkitpolicydir) endif From 2a4c156d6487e60ec7122bbf2c15c259156fb868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 19:54:33 -0400 Subject: [PATCH 33/82] meson: fix a bunch of substitutions This makes the diff -r output on autotools and meson installations empty, except for binary files and ## comments. --- meson.build | 21 ++++++++++++++++++--- meson_options.txt | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 9b46a7edd8..a28090240d 100644 --- a/meson.build +++ b/meson.build @@ -40,6 +40,7 @@ sysvrcnd_path = get_option('sysvrcnd-path') if sysvinit_path != '' or sysvrcnd_path != '' conf.set('HAVE_SYSV_COMPAT', 1, description : 'SysV init scripts and rcN.d links are supported') + m4_defines += ['-DHAVE_SYSV_COMPAT'] endif # join_paths ignore the preceding arguments if an absolute component is @@ -107,7 +108,7 @@ bootlibdir = prefixdir + '/lib/systemd/boot/efi' testsdir = prefixdir + '/lib/systemd/tests' systemdstatedir = localstatedir + '/lib/systemd' catalogstatedir = systemdstatedir + '/catalog' -randomseeddir = localstatedir + '/lib/systemd/' +randomseeddir = localstatedir + '/lib/systemd' dbuspolicydir = get_option('dbuspolicydir') if dbuspolicydir == '' @@ -139,6 +140,8 @@ conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', pkgsysconfdir + '/ conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) +conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) +conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) conf.set_quoted('USER_CONFIG_UNIT_PATH', pkgsysconfdir + '/user') conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) @@ -207,8 +210,14 @@ substs.set('systemenvgeneratordir', systemenvgenerator substs.set('userenvgeneratordir', userenvgeneratordir) substs.set('systemshutdowndir', systemshutdowndir) substs.set('systemsleepdir', systemsleepdir) +substs.set('VARLOGDIR', varlogdir) +substs.set('CERTIFICATEROOT', get_option('certificate-root')) substs.set('SYSTEMCTL', rootbindir + '/systemctl') substs.set('RANDOM_SEED', randomseeddir + '/random-seed') +substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) +substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) +substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) +substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) ##################################################################### @@ -523,7 +532,7 @@ message('Maximum system GID is @0@'.format(system_gid_max)) tty_gid = get_option('tty-gid') conf.set('TTY_GID', tty_gid) -m4_defines += ['-DTTY_GID=' + tty_gid] +substs.set('TTY_GID', tty_gid) if get_option('adm-group') m4_defines += ['-DENABLE_ADM_GROUP'] @@ -535,15 +544,20 @@ endif substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) -conf.set10('KILL_USER_PROCESSES', get_option('default-kill-user-processes')) +kill_user_processes = get_option('default-kill-user-processes') +conf.set10('KILL_USER_PROCESSES', kill_user_processes) +substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no') default_dnssec = get_option('default-dnssec') conf.set('DEFAULT_DNSSEC_MODE', 'DNSSEC_' + default_dnssec.underscorify().to_upper()) +substs.set('DEFAULT_DNSSEC_MODE', default_dnssec) conf.set_quoted('DNS_SERVERS', get_option('dns-servers')) +substs.set('DNS_SERVERS', get_option('dns-servers')) conf.set_quoted('NTP_SERVERS', get_option('ntp-servers')) +substs.set('NTP_SERVERS', get_option('ntp-servers')) conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) @@ -923,6 +937,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], if get_option(pair[0]) conf.set(pair[1], 1) + m4_defines += ['-D' + pair[1]] endif endforeach diff --git a/meson_options.txt b/meson_options.txt index b1b80bfa69..d5ce9d9f93 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,6 +10,10 @@ option('sysvinit-path', type : 'string', value : '/etc/init.d', option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', description : 'the base directory for SysV rcN.d directories') option('telinit-path', type : 'string', description : 'path to telinit') +option('rc-local', type : 'string', + value : '/etc/rc.local') +option('halt-local', type : 'string', + value : '/usr/sbin/halt.local') option('quotaon-path', type : 'string', description : 'path to quotaon') option('quotacheck-path', type : 'string', description : 'path to quotacheck') From aa13df58741de826cf298825f66d6a7036884fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 20:05:33 -0400 Subject: [PATCH 34/82] meson: support (the removal of) lines with ## --- units/meson.build | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/units/meson.build b/units/meson.build index b051c5d3cc..62f1e33dbf 100644 --- a/units/meson.build +++ b/units/meson.build @@ -225,19 +225,23 @@ foreach tuple : in_units install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - if install - install_data(gen, - install_dir : systemunitdir) + gen1 = configure_file( + input : file + '.in', + output : file + '.tmp', + configuration : substs) + gen2 = custom_target( + file, + input : gen1, + output : file, + command : [sed, '/^## /d', '@INPUT@'], + capture : true, + install : install, + install_dir : systemunitdir) - if tuple.length() > 2 - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach - endif + if install and tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach endif endforeach From 082ef2adbddecde5432608298a19551319b162c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 12 Apr 2017 20:58:55 -0400 Subject: [PATCH 35/82] meson: rework processing of unit files Ideally, we would chain the m4 processing, .in substitutions, and file installation so that the commands don't have to be repeated. Unfortunately this does not seem currently possible, because custom_target() output cannot be fed into install_data(), so it's necessary to use the 'install', 'install_dir' arguments to control installation. Nevertheless, rework the rules to repeat less stuff and unify handling of conditions between the different file types. --- units/meson.build | 117 +++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/units/meson.build b/units/meson.build index 62f1e33dbf..44bfda4a82 100644 --- a/units/meson.build +++ b/units/meson.build @@ -105,21 +105,7 @@ units = [ ['user.slice', ''], ['var-lib-machines.mount', '', 'local-fs.target.wants/'], - ] - -foreach tuple : units - file = tuple[0] - if tuple[1] == '' or conf.get(tuple[1], 0) == 1 - install_data(file, - install_dir : systemunitdir) - - if tuple.length() > 2 - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach - endif - endif -endforeach +] in_units = [ ['debug-shell.service', ''], @@ -217,10 +203,44 @@ in_units = [ 'multi-user.target.wants/'], ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'], ['systemd-volatile-root.service', ''], - ] +] + +m4_units = [ + ['getty@.service', '', + 'autovt@.service ' + + pkgsysconfdir + '/system/getty.target.wants/getty@tty1.service'], + ['serial-getty@.service', ''], + ['tmp.mount', '', + 'local-fs.target.wants/'], +] + +m4_in_units = [ + ['console-getty.service', ''], + ['container-getty@.service', ''], + ['systemd-networkd.service', 'ENABLE_NETWORKD', + 'dbus-org.freedesktop.network1.service ' + + pkgsysconfdir + '/system/multi-user.target.wants/ '], + ['systemd-resolved.service', 'ENABLE_RESOLVED', + 'dbus-org.freedesktop.resolve1.service ' + + pkgsysconfdir + '/system/multi-user.target.wants/'], + ['user@.service', ''], +] + +foreach tuple : m4_in_units + file = tuple[0] + + gen = configure_file( + input : file + '.m4.in', + output : file + '.m4', + configuration : substs) + + m4_units += [[file, tuple.get(1, ''), tuple.get(2, ''), gen]] +endforeach foreach tuple : in_units file = tuple[0] + + # we do this here because install_data does not accept custom_target output conds = tuple[1].split(' ') install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) @@ -235,7 +255,7 @@ foreach tuple : in_units output : file, command : [sed, '/^## /d', '@INPUT@'], capture : true, - install : install, + install : true, install_dir : systemunitdir) if install and tuple.length() > 2 @@ -245,22 +265,18 @@ foreach tuple : in_units endif endforeach -m4_units = [ - ['getty@.service', '', - 'autovt@.service ' + - pkgsysconfdir + '/system/getty.target.wants/getty@tty1.service'], - ['serial-getty@.service', ''], - ['tmp.mount', '', - 'local-fs.target.wants/'], - ] - foreach tuple : m4_units file = tuple[0] - install = tuple[1] == '' or conf.get(tuple[1], 0) == 1 + input = tuple.get(3, file + '.m4') + + # we do this here because install_data does not accept custom_target output + conds = tuple[1].split(' ') + install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and + (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) custom_target( file, - input : file + '.m4', + input : input, output: file, command : [m4, '-P'] + m4_defines + ['@INPUT@'], capture : true, @@ -274,43 +290,28 @@ foreach tuple : m4_units endif endforeach -m4_in_units = [ - ['console-getty.service', ''], - ['container-getty@.service', ''], - ['systemd-networkd.service', 'ENABLE_NETWORKD', - 'dbus-org.freedesktop.network1.service ' + - pkgsysconfdir + '/system/multi-user.target.wants/ '], - ['systemd-resolved.service', 'ENABLE_RESOLVED', - 'dbus-org.freedesktop.resolve1.service ' + - pkgsysconfdir + '/system/multi-user.target.wants/'], - ['user@.service', ''], - ] - -foreach tuple : m4_in_units +foreach tuple : units file = tuple[0] - install = tuple[1] == '' or conf.get(tuple[1], 0) == 1 + input = tuple.get(3, file) - gen = configure_file( - input : file + '.m4.in', - output : file + '.m4', - configuration : substs) + conds = tuple[1].split(' ') + install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and + (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) - custom_target( - file, - input : gen, - output: file, - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true, - install : install, - install_dir : systemunitdir) + if install + install_data(input, + install_dir : systemunitdir) - if tuple.length() > 2 and install - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach + if tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endif endforeach +############################################################ + meson.add_install_script(meson_make_symlink, pkgsysconfdir + '/user', sysconfdir + '/xdg/systemd/user') From e17e5ba9bff633b5f2b6e9950b3bb64b59079c74 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 13 Apr 2017 10:30:56 -0400 Subject: [PATCH 36/82] meson: use join_paths consistently With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or //lib/udev for various dir variables. Using join_paths() avoids this. --- hwdb/meson.build | 2 +- man/meson.build | 8 +- meson.build | 148 +++++++++++++++--------------- network/meson.build | 2 +- po/meson.build | 2 +- shell-completion/bash/meson.build | 2 +- shell-completion/zsh/meson.build | 2 +- src/boot/efi/meson.build | 4 +- src/core/meson.build | 8 +- src/journal-remote/meson.build | 2 +- src/kernel-install/meson.build | 2 +- src/locale/meson.build | 4 +- src/udev/meson.build | 4 +- sysctl.d/meson.build | 2 +- tmpfiles.d/meson.build | 2 +- units/meson.build | 26 +++--- 16 files changed, 110 insertions(+), 110 deletions(-) diff --git a/hwdb/meson.build b/hwdb/meson.build index bffac3bae6..cbc9016652 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -24,5 +24,5 @@ if conf.get('ENABLE_HWDB', 0) == 1 install_dir : udevhwdbdir) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/udev/hwdb.d')) + mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d'))) endif diff --git a/man/meson.build b/man/meson.build index 691750c466..c945c662f5 100644 --- a/man/meson.build +++ b/man/meson.build @@ -52,7 +52,7 @@ foreach tuple : manpages htmlaliases += [alias + '.html'] endforeach - mandirn = get_option('mandir') + '/man' + section + mandirn = join_paths(get_option('mandir'), 'man' + section) have = condition == '' or conf.get(condition, 0) == 1 @@ -74,7 +74,7 @@ foreach tuple : manpages command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], depend_files : custom_entities_ent, install : want_html, - install_dir : docdir + '/html') + install_dir : join_paths(docdir, 'html')) html_pages += [p2] source_xml_files += files(tuple[0] + '.xml') @@ -107,7 +107,7 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], html = stem + '.html' man = stem + '.' + section - mandirn = get_option('mandir') + '/man' + section + mandirn = join_paths(get_option('mandir'), 'man' + section) p1 = custom_target( man, @@ -124,7 +124,7 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], output : html, command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], install : want_html, - install_dir : docdir + '/html') + install_dir : join_paths(docdir, 'html')) html_pages += [p2] endforeach diff --git a/meson.build b/meson.build index a28090240d..835da3174e 100644 --- a/meson.build +++ b/meson.build @@ -66,118 +66,118 @@ if rootlibdir == '' endif # Dirs of external packages -pkgconfigdatadir = datadir + '/pkgconfig' -pkgconfiglibdir = libdir + '/pkgconfig' -polkitpolicydir = datadir + '/polkit-1/actions' -polkitrulesdir = datadir + '/polkit-1/rules.d' -polkitpkladir = localstatedir + '/lib/polkit-1/localauthority/10-vendor.d' -varlogdir = localstatedir + '/log' -xinitrcdir = sysconfdir + '/X11/xinit/xinitrc.d' +pkgconfigdatadir = join_paths(datadir, 'pkgconfig') +pkgconfiglibdir = join_paths(libdir, 'pkgconfig') +polkitpolicydir = join_paths(datadir, 'polkit-1/actions') +polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d') +polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d') +varlogdir = join_paths(localstatedir, 'log') +xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d') rpmmacrosdir = get_option('rpmmacrosdir') # Our own paths -pkgdatadir = datadir + '/systemd' -environmentdir = prefixdir + '/lib/environment.d' -pkgsysconfdir = sysconfdir + '/systemd' -userunitdir = prefixdir + '/lib/systemd/user' -userpresetdir = prefixdir + '/lib/systemd/user-preset' -tmpfilesdir = prefixdir + '/lib/tmpfiles.d' -sysusersdir = prefixdir + '/lib/sysusers.d' -sysctldir = prefixdir + '/lib/sysctl.d' -binfmtdir = prefixdir + '/lib/binfmt.d' -modulesloaddir = prefixdir + '/lib/modules-load.d' -networkdir = rootprefixdir + '/lib/systemd/network' -pkgincludedir = includedir + '/systemd' -systemgeneratordir = rootlibexecdir + '/system-generators' -usergeneratordir = prefixdir + '/lib/systemd/user-generators' -systemenvgeneratordir = prefixdir + '/lib/systemd/system-environment-generators' -userenvgeneratordir = prefixdir + '/lib/systemd/user-environment-generators' -systemshutdowndir = rootlibexecdir + '/system-shutdown' -systemsleepdir = rootlibexecdir + '/system-sleep' -systemunitdir = rootprefixdir + '/lib/systemd/system' -systempresetdir = rootprefixdir + '/lib/systemd/system-preset' -udevlibexecdir = rootprefixdir + '/lib/udev' -udevhomedir = udevlibexecdir + '' -udevrulesdir = udevlibexecdir + '/rules.d' -udevhwdbdir = udevlibexecdir + '/hwdb.d' -catalogdir = prefixdir + '/lib/systemd/catalog' -kernelinstalldir = prefixdir + '/lib/kernel/install.d' -factorydir = datadir + '/factory' -docdir = datadir + '/doc/systemd' -bootlibdir = prefixdir + '/lib/systemd/boot/efi' -testsdir = prefixdir + '/lib/systemd/tests' -systemdstatedir = localstatedir + '/lib/systemd' -catalogstatedir = systemdstatedir + '/catalog' -randomseeddir = localstatedir + '/lib/systemd' +pkgdatadir = join_paths(datadir, 'systemd') +environmentdir = join_paths(prefixdir, 'lib/environment.d') +pkgsysconfdir = join_paths(sysconfdir, 'systemd') +userunitdir = join_paths(prefixdir, 'lib/systemd/user') +userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset') +tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d') +sysusersdir = join_paths(prefixdir, 'lib/sysusers.d') +sysctldir = join_paths(prefixdir, 'lib/sysctl.d') +binfmtdir = join_paths(prefixdir, 'lib/binfmt.d') +modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d') +networkdir = join_paths(rootprefixdir, 'lib/systemd/network') +pkgincludedir = join_paths(includedir, 'systemd') +systemgeneratordir = join_paths(rootlibexecdir, 'system-generators') +usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators') +systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators') +userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators') +systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown') +systemsleepdir = join_paths(rootlibexecdir, 'system-sleep') +systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system') +systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset') +udevlibexecdir = join_paths(rootprefixdir, 'lib/udev') +udevhomedir = udevlibexecdir +udevrulesdir = join_paths(udevlibexecdir, 'rules.d') +udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d') +catalogdir = join_paths(prefixdir, 'lib/systemd/catalog') +kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d') +factorydir = join_paths(datadir, 'factory') +docdir = join_paths(datadir, 'doc/systemd') +bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi') +testsdir = join_paths(prefixdir, 'lib/systemd/tests') +systemdstatedir = join_paths(localstatedir, 'lib/systemd') +catalogstatedir = join_paths(systemdstatedir, 'catalog') +randomseeddir = join_paths(localstatedir, 'lib/systemd') dbuspolicydir = get_option('dbuspolicydir') if dbuspolicydir == '' - dbuspolicydir = datadir + '/dbus-1/system.d' + dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') endif dbussessionservicedir = get_option('dbussessionservicedir') if dbussessionservicedir == '' - dbussessionservicedir = datadir + '/dbus-1/services' + dbussessionservicedir = join_paths(datadir, 'dbus-1/services') endif dbussystemservicedir = get_option('dbussystemservicedir') if dbussystemservicedir == '' - dbussystemservicedir = datadir + '/dbus-1/system-services' + dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') endif pamlibdir = get_option('pamlibdir') if pamlibdir == '' - pamlibdir = rootlibdir + '/security' + pamlibdir = join_paths(rootlibdir, 'security') endif pamconfdir = get_option('pamconfdir') if pamconfdir == '' - pamconfdir = sysconfdir + '/pam.d' + pamconfdir = join_paths(sysconfdir, 'pam.d') endif conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) -conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', pkgsysconfdir + '/system') +conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system')) conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) -conf.set_quoted('USER_CONFIG_UNIT_PATH', pkgsysconfdir + '/user') +conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user')) conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) -conf.set_quoted('CATALOG_DATABASE', catalogstatedir + '/database') -conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', rootlibexecdir + '/systemd-cgroups-agent') -conf.set_quoted('SYSTEMD_BINARY_PATH', rootlibexecdir + '/systemd') -conf.set_quoted('SYSTEMD_FSCK_PATH', rootlibexecdir + '/systemd-fsck') -conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir + '/systemd-shutdown') -conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', rootlibexecdir + '/systemd-sleep') -conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir + '/systemctl') -conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir + '/systemd-tty-ask-password-agent') -conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir + '/systemd-stdio-bridge') +conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) +conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) +conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd')) +conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck')) +conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) +conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep')) +conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) +conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) +conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge')) conf.set_quoted('ROOTPREFIX', rootprefixdir) conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) -conf.set_quoted('RANDOM_SEED', randomseeddir + '/random-seed') -conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir + '/systemd-cryptsetup') +conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) +conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup')) conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) -conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', pkgdatadir + '/kbd-model-map') -conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir + '/language-fallback-map') +conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map')) +conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map')) conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) -conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir + '/pkttyagent') +conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent')) conf.set_quoted('LIBDIR', libdir) conf.set_quoted('ROOTLIBDIR', rootlibdir) conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) conf.set_quoted('BOOTLIBDIR', bootlibdir) -conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir + '/systemd-pull') -conf.set_quoted('SYSTEMD_IMPORT_PATH', rootlibexecdir + '/systemd-import') -conf.set_quoted('SYSTEMD_EXPORT_PATH', rootlibexecdir + '/systemd-export') -conf.set_quoted('VENDOR_KEYRING_PATH', rootlibexecdir + '/import-pubring.gpg') -conf.set_quoted('USER_KEYRING_PATH', pkgsysconfdir + '/import-pubring.gpg') -conf.set_quoted('DOCUMENT_ROOT', pkgdatadir + '/gatewayd') +conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull')) +conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import')) +conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export')) +conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg')) +conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg')) +conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd')) conf.set_quoted('ABS_BUILD_DIR', meson.build_root()) conf.set_quoted('ABS_SRC_DIR', meson.source_root()) @@ -212,8 +212,8 @@ substs.set('systemshutdowndir', systemshutdowndir) substs.set('systemsleepdir', systemsleepdir) substs.set('VARLOGDIR', varlogdir) substs.set('CERTIFICATEROOT', get_option('certificate-root')) -substs.set('SYSTEMCTL', rootbindir + '/systemctl') -substs.set('RANDOM_SEED', randomseeddir + '/random-seed') +substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl')) +substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) @@ -1206,8 +1206,8 @@ if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 install_dir : userenvgeneratordir) meson.add_install_script(meson_make_symlink, - sysconfdir + '/environment', - environmentdir + '/99-environment.conf') + join_paths(sysconfdir, 'environment'), + join_paths(environmentdir, '99-environment.conf')) endif if conf.get('ENABLE_HIBERNATE', 0) == 1 @@ -1689,7 +1689,7 @@ if conf.get('ENABLE_BINFMT', 0) == 1 meson.add_install_script('sh', '-c', mkdir_p.format(binfmtdir)) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/binfmt.d')) + mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) endif if conf.get('ENABLE_VCONSOLE', 0) == 1 @@ -1893,7 +1893,7 @@ executable('systemd-mount', install : true) meson.add_install_script(meson_make_symlink, - 'systemd-mount', bindir + '/systemd-umount') + 'systemd-mount', join_paths(bindir, 'systemd-umount')) executable('systemd-run', 'src/run/run.c', @@ -2044,7 +2044,7 @@ if conf.get('HAVE_KMOD', 0) == 1 meson.add_install_script('sh', '-c', mkdir_p.format(modulesloaddir)) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/modules-load.d')) + mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) endif executable('systemd-nspawn', diff --git a/network/meson.build b/network/meson.build index d2eb89ad4d..d36aadb9da 100644 --- a/network/meson.build +++ b/network/meson.build @@ -8,5 +8,5 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_dir : networkdir) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/systemd/network')) + mkdir_p.format(join_paths(sysconfdir, 'systemd/network'))) endif diff --git a/po/meson.build b/po/meson.build index b95c2a3550..c3976b3846 100644 --- a/po/meson.build +++ b/po/meson.build @@ -8,7 +8,7 @@ i18n.gettext(meson.project_name()) intltool_merge = find_program('intltool-merge') po_dir = meson.current_source_dir() -intltool_cache = meson.current_build_dir() + '/intltool-merge-cache' +intltool_cache = join_paths(meson.current_build_dir(), 'intltool-merge-cache') intltool_command = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'] diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build index bbd705c1cf..07de1d232a 100644 --- a/shell-completion/bash/meson.build +++ b/shell-completion/bash/meson.build @@ -6,7 +6,7 @@ if bashcompletiondir == '' if bash_completion.found() bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') else - bashcompletiondir = datadir + '/bash-completion/completions' + bashcompletiondir = join_paths(datadir, 'bash-completion/completions') endif message('bash completions: @0@'.format(bashcompletiondir)) diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build index 56bf7aeb03..0ba4136496 100644 --- a/shell-completion/zsh/meson.build +++ b/shell-completion/zsh/meson.build @@ -2,7 +2,7 @@ zshcompletiondir = get_option('zshcompletiondir') if zshcompletiondir == '' - zshcompletiondir = datadir + '/zsh/site-functions' + zshcompletiondir = join_paths(datadir, 'zsh/site-functions') message('zsh completions: @0@'.format(zshcompletiondir)) endif diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 858dd4a870..7e0c626f28 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -70,7 +70,7 @@ if have_gnu_efi efi_ldsdir = get_option('efi-ldsdir') if efi_ldsdir == '' - efi_ldsdir = efi_libdir + '/gnuefi' + efi_ldsdir = join_paths(efi_libdir, 'gnuefi') endif efi_incdir = get_option('efi-includedir') @@ -92,7 +92,7 @@ if have_gnu_efi '-Wsign-compare', '-Wno-missing-field-initializers', '-isystem', efi_incdir, - '-isystem', efi_incdir + '/' + efi_arch, + '-isystem', join_paths(efi_incdir, efi_arch), '-include', efi_config_h] if efi_arch == 'x86_64' compile_args += ['-mno-red-zone', diff --git a/src/core/meson.build b/src/core/meson.build index 97410a8cc4..a06c9414d1 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -227,10 +227,10 @@ meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir)) meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir)) meson.add_install_script('sh', '-c', - mkdir_p.format(pkgsysconfdir + '/system/multi-user.target.wants')) + mkdir_p.format(join_paths(pkgsysconfdir, 'system/multi-user.target.wants'))) meson.add_install_script('sh', '-c', - mkdir_p.format(pkgsysconfdir + '/system/getty.target.wants')) + mkdir_p.format(join_paths(pkgsysconfdir, 'system/getty.target.wants'))) meson.add_install_script('sh', '-c', - mkdir_p.format(pkgsysconfdir + '/user')) + mkdir_p.format(join_paths(pkgsysconfdir, 'user'))) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/xdg/systemd')) + mkdir_p.format(join_paths(sysconfdir, 'xdg/systemd'))) diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index ca05390244..35342755d3 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -42,7 +42,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 endif install_data('browse.html', - install_dir : pkgdatadir + '/gatewayd') + install_dir : join_paths(pkgdatadir, 'gatewayd')) meson.add_install_script('sh', '-c', mkdir_p.format('/var/log/journal/remote')) diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build index 4ecea20f89..3e2d2e587c 100644 --- a/src/kernel-install/meson.build +++ b/src/kernel-install/meson.build @@ -10,4 +10,4 @@ install_data('50-depmod.install', install_dir : kernelinstalldir) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/kernel/install.d')) + mkdir_p.format(join_paths(sysconfdir, 'kernel/install.d'))) diff --git a/src/locale/meson.build b/src/locale/meson.build index 775ad2ce77..8bd22fe321 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -26,8 +26,8 @@ endif # If you know a way that allows the same variables to be used # in sources list and concatenated to a string for test_env, # let me know. -kbd_model_map = meson.current_source_dir() + '/kbd-model-map' -language_fallback_map = meson.current_source_dir() + '/language-fallback-map' +kbd_model_map = join_paths(meson.current_source_dir(), 'kbd-model-map') +language_fallback_map = join_paths(meson.current_source_dir(), 'language-fallback-map') install_data('kbd-model-map', 'language-fallback-map', diff --git a/src/udev/meson.build b/src/udev/meson.build index fdd73046dc..19dc522172 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -161,7 +161,7 @@ executable('mtd_probe', install_dir : udevlibexecdir) install_data('udev.conf', - install_dir : sysconfdir + '/udev') + install_dir : join_paths(sysconfdir, 'udev')) udev_pc = configure_file( input : 'udev.pc.in', @@ -171,4 +171,4 @@ install_data(udev_pc, install_dir : pkgconfigdatadir) meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/udev/rules.d')) + mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d'))) diff --git a/sysctl.d/meson.build b/sysctl.d/meson.build index cdd95f857a..826542debc 100644 --- a/sysctl.d/meson.build +++ b/sysctl.d/meson.build @@ -20,4 +20,4 @@ foreach file : in_files endforeach meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/sysctl.d')) + mkdir_p.format(join_paths(sysconfdir, 'sysctl.d'))) diff --git a/tmpfiles.d/meson.build b/tmpfiles.d/meson.build index 36a053bc0e..eebdbb9501 100644 --- a/tmpfiles.d/meson.build +++ b/tmpfiles.d/meson.build @@ -40,5 +40,5 @@ endforeach if enable_tmpfiles meson.add_install_script('sh', '-c', - mkdir_p.format(sysconfdir + '/tmpfiles.d')) + mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) endif diff --git a/units/meson.build b/units/meson.build index 44bfda4a82..e49a293ba9 100644 --- a/units/meson.build +++ b/units/meson.build @@ -32,7 +32,7 @@ units = [ ['local-fs.target', ''], ['machine.slice', 'ENABLE_MACHINED'], ['machines.target', 'ENABLE_MACHINED', - pkgsysconfdir + '/system/multi-user.target.wants/'], + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['multi-user.target', '', 'runlevel2.target runlevel3.target runlevel4.target'], ['network-online.target', ''], @@ -51,7 +51,7 @@ units = [ 'runlevel6.target ctrl-alt-del.target'], ['remote-fs-pre.target', ''], ['remote-fs.target', '', - pkgsysconfdir + '/system/multi-user.target.wants/'], + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['rescue.target', '', 'runlevel1.target'], ['rpcbind.target', ''], @@ -91,7 +91,7 @@ units = [ ['systemd-journald.socket', '', 'sockets.target.wants/'], ['systemd-networkd.socket', '', - pkgsysconfdir + '/system/sockets.target.wants/'], + join_paths(pkgsysconfdir, 'system/sockets.target.wants/')], ['systemd-rfkill.socket', 'ENABLE_RFKILL'], ['systemd-tmpfiles-clean.timer', '', 'timers.target.wants/'], @@ -164,7 +164,7 @@ in_units = [ ['systemd-modules-load.service', 'HAVE_KMOD', 'sysinit.target.wants/'], ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD', - pkgsysconfdir + '/system/network-online.target.wants/'], + join_paths(pkgsysconfdir, 'system/network-online.target.wants/')], ['systemd-nspawn@.service', ''], ['systemd-poweroff.service', ''], ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'], @@ -182,7 +182,7 @@ in_units = [ ['systemd-timedated.service', 'ENABLE_TIMEDATED', 'dbus-org.freedesktop.timedate1.service'], ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD', - pkgsysconfdir + '/system/sysinit.target.wants/'], + join_paths(pkgsysconfdir, 'system/sysinit.target.wants/')], ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'], ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES', 'sysinit.target.wants/'], @@ -208,7 +208,7 @@ in_units = [ m4_units = [ ['getty@.service', '', 'autovt@.service ' + - pkgsysconfdir + '/system/getty.target.wants/getty@tty1.service'], + join_paths(pkgsysconfdir, 'system/getty.target.wants/getty@tty1.service')], ['serial-getty@.service', ''], ['tmp.mount', '', 'local-fs.target.wants/'], @@ -219,10 +219,10 @@ m4_in_units = [ ['container-getty@.service', ''], ['systemd-networkd.service', 'ENABLE_NETWORKD', 'dbus-org.freedesktop.network1.service ' + - pkgsysconfdir + '/system/multi-user.target.wants/ '], + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['systemd-resolved.service', 'ENABLE_RESOLVED', 'dbus-org.freedesktop.resolve1.service ' + - pkgsysconfdir + '/system/multi-user.target.wants/'], + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['user@.service', ''], ] @@ -313,16 +313,16 @@ endforeach ############################################################ meson.add_install_script(meson_make_symlink, - pkgsysconfdir + '/user', - sysconfdir + '/xdg/systemd/user') + join_paths(pkgsysconfdir, 'user'), + join_paths(sysconfdir, 'xdg/systemd/user')) meson.add_install_script(meson_make_symlink, - dbussystemservicedir + '/org.freedesktop.systemd1.service', - dbussessionservicedir + '/org.freedesktop.systemd1.service') + join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'), + join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service')) if conf.get('HAVE_SYSV_COMPAT', 0) == 1 foreach i : [1, 2, 3, 4, 5] meson.add_install_script('sh', '-c', mkdir_p - .format(systemunitdir + '/runlevel@0@.target.wants'.format(i))) + .format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i)))) endforeach endif From 005a29f23423782660703cdc6b9330b5fc9eeff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 11:52:05 -0400 Subject: [PATCH 37/82] meson: recreate dist-check-help --- meson.build | 878 ++++++++++++++++++++------------------ tools/meson-check-help.sh | 20 + 2 files changed, 487 insertions(+), 411 deletions(-) create mode 100755 tools/meson-check-help.sh diff --git a/meson.build b/meson.build index 835da3174e..15808e6447 100644 --- a/meson.build +++ b/meson.build @@ -1074,6 +1074,10 @@ endforeach ############################################################ +# binaries that have --help and are intended for use by humans, +# usually, but not always, installed in /bin. +public_programs = [] + subdir('src/libudev') subdir('src/shared') subdir('src/core') @@ -1115,21 +1119,22 @@ executable('systemd', install : true, install_dir : rootlibexecdir) -executable('systemd-analyze', - systemd_analyze_sources, - include_directories : includes, - link_with : [libcore, - libudev, - libsystemd_internal, - libshared], - dependencies : [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-analyze', + systemd_analyze_sources, + include_directories : includes, + link_with : [libcore, + libudev, + libsystemd_internal, + libshared], + dependencies : [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] executable('systemd-journald', systemd_journald_sources, @@ -1145,30 +1150,32 @@ executable('systemd-journald', install : true, install_dir : rootlibexecdir) -executable('systemd-cat', - systemd_cat_sources, - include_directories : includes, - link_with : [libjournal_core, - libshared, - libudev], - dependencies : [threads], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-cat', + systemd_cat_sources, + include_directories : includes, + link_with : [libjournal_core, + libshared, + libudev], + dependencies : [threads], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('journalctl', - journalctl_sources, - include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared, - libudev, - libsystemd_internal], - dependencies : [threads, - libqrencode, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('journalctl', + journalctl_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libshared, + libudev, + libsystemd_internal], + dependencies : [threads, + libqrencode, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] executable('systemd-getty-generator', 'src/getty-generator/getty-generator.c', @@ -1241,13 +1248,14 @@ if conf.get('HAVE_BLKID', 0) == 1 install : true, install_dir : systemgeneratordir) - executable('systemd-dissect', - 'src/dissect/dissect.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + exe = executable('systemd-dissect', + 'src/dissect/dissect.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] endif if conf.get('ENABLE_RESOLVED', 0) == 1 @@ -1263,16 +1271,17 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('systemd-resolve', - systemd_resolve_sources, - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - dependencies : [threads, - libm, - libidn], - install_rpath : rootlibexecdir, - install : true) + exe = executable('systemd-resolve', + systemd_resolve_sources, + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + dependencies : [threads, + libm, + libidn], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_LOGIND', 0) == 1 @@ -1289,27 +1298,29 @@ if conf.get('ENABLE_LOGIND', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('loginctl', - loginctl_sources, - include_directories : includes, - link_with : [libshared, - libudev, - libsystemd_internal], - dependencies : [threads, - liblz4, - libxz], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('loginctl', + loginctl_sources, + include_directories : includes, + link_with : [libshared, + libudev, + libsystemd_internal], + dependencies : [threads, + liblz4, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] - executable('systemd-inhibit', - 'src/login/inhibit.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('systemd-inhibit', + 'src/login/inhibit.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] if conf.get('HAVE_PAM', 0) == 1 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) @@ -1342,34 +1353,37 @@ if conf.get('HAVE_PAM', 0) == 1 endif if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1 - executable('bootctl', - 'src/boot/bootctl.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libblkid], - install_rpath : rootlibexecdir, - install : true) + exe = executable('bootctl', + 'src/boot/bootctl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libblkid], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif -executable('systemd-socket-activate', 'src/activate/activate.c', - include_directories : includes, - link_with : [libshared], - dependencies : [threads], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-socket-activate', 'src/activate/activate.c', + include_directories : includes, + link_with : [libshared], + dependencies : [threads], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemctl', 'src/systemctl/systemctl.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - dependencies : [threads, - libcap, - libselinux, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('systemctl', 'src/systemctl/systemctl.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + dependencies : [threads, + libcap, + libselinux, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] if conf.get('ENABLE_BACKLIGHT', 0) == 1 executable('systemd-backlight', @@ -1468,13 +1482,14 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('hostnamectl', - 'src/hostname/hostnamectl.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) + exe = executable('hostnamectl', + 'src/hostname/hostnamectl.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_LOCALED', 0) == 1 @@ -1488,13 +1503,14 @@ if conf.get('ENABLE_LOCALED', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('localectl', - localectl_sources, - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) + exe = executable('localectl', + localectl_sources, + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_TIMEDATED', 0) == 1 @@ -1507,13 +1523,14 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('timedatectl', - 'src/timedate/timedatectl.c', - include_directories : includes, - install_rpath : rootlibexecdir, - link_with : [libshared, - libsystemd_internal], - install : true) + exe = executable('timedatectl', + 'src/timedate/timedatectl.c', + include_directories : includes, + install_rpath : rootlibexecdir, + link_with : [libshared, + libsystemd_internal], + install : true) + public_programs += [exe] endif if conf.get('ENABLE_TIMESYNCD', 0) == 1 @@ -1540,17 +1557,18 @@ if conf.get('ENABLE_MACHINED', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('machinectl', - 'src/machine/machinectl.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - dependencies : [threads, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('machinectl', + 'src/machine/machinectl.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + dependencies : [threads, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_IMPORTD', 0) == 1 @@ -1564,88 +1582,91 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('systemd-pull', - systemd_pull_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz, - libgcrypt], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + systemd_pull = executable('systemd-pull', + systemd_pull_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz, + libgcrypt], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-import', - systemd_import_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + systemd_import = executable('systemd-import', + systemd_import_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-export', - systemd_export_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + systemd_export = executable('systemd-export', + systemd_export_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [systemd_pull, systemd_import, systemd_export] endif if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 - executable('systemd-journal-upload', - systemd_journal_upload_sources, - include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], - dependencies : [threads, - libcurl, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + exe = executable('systemd-journal-upload', + systemd_journal_upload_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libshared], + dependencies : [threads, + libcurl, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] endif if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 - executable('systemd-journal-remote', - systemd_journal_remote_sources, - include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], - dependencies : [threads, - libmicrohttpd, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + s_j_remote = executable('systemd-journal-remote', + systemd_journal_remote_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-journal-gatewayd', - systemd_journal_gatewayd_sources, - include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], - dependencies : [threads, - libmicrohttpd, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + s_j_gatewayd = executable('systemd-journal-gatewayd', + systemd_journal_gatewayd_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [s_j_remote, s_j_gatewayd] endif if conf.get('ENABLE_COREDUMP', 0) == 1 @@ -1664,27 +1685,29 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 install : true, install_dir : rootlibexecdir) - executable('coredumpctl', - coredumpctl_sources, - include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared, - libsystemd_internal], - dependencies : [threads, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true) + exe = executable('coredumpctl', + coredumpctl_sources, + include_directories : includes, + link_with : [libsystemd_journal_internal, + libshared, + libsystemd_internal], + dependencies : [threads, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_BINFMT', 0) == 1 - executable('systemd-binfmt', - 'src/binfmt/binfmt.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + exe = executable('systemd-binfmt', + 'src/binfmt/binfmt.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] meson.add_install_script('sh', '-c', mkdir_p.format(binfmtdir)) @@ -1761,13 +1784,14 @@ executable('systemd-sleep', install : true, install_dir : rootlibexecdir) -executable('systemd-sysctl', - 'src/sysctl/sysctl.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) +exe = executable('systemd-sysctl', + 'src/sysctl/sysctl.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) +public_programs += [exe] executable('systemd-ac-power', 'src/ac-power/ac-power.c', @@ -1777,35 +1801,39 @@ executable('systemd-ac-power', install : true, install_dir : rootlibexecdir) -executable('systemd-detect-virt', - 'src/detect-virt/detect-virt.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-detect-virt', + 'src/detect-virt/detect-virt.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemd-delta', - 'src/delta/delta.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-delta', + 'src/delta/delta.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemd-escape', - 'src/escape/escape.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('systemd-escape', + 'src/escape/escape.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] -executable('systemd-notify', - 'src/notify/notify.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('systemd-notify', + 'src/notify/notify.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] executable('systemd-volatile-root', 'src/volatile-root/volatile-root.c', @@ -1823,22 +1851,24 @@ executable('systemd-cgroups-agent', install : true, install_dir : rootlibexecdir) -executable('systemd-path', - 'src/path/path.c', - include_directories : includes, - link_with : [libsystemd_internal, - libshared], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-path', + 'src/path/path.c', + include_directories : includes, + link_with : [libsystemd_internal, + libshared], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemd-ask-password', - 'src/ask-password/ask-password.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('systemd-ask-password', + 'src/ask-password/ask-password.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] executable('systemd-reply-password', 'src/reply-password/reply-password.c', @@ -1849,30 +1879,33 @@ executable('systemd-reply-password', install : true, install_dir : rootlibexecdir) -executable('systemd-tty-ask-password-agent', - 'src/tty-ask-password-agent/tty-ask-password-agent.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('systemd-tty-ask-password-agent', + 'src/tty-ask-password-agent/tty-ask-password-agent.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] -executable('systemd-cgls', - 'src/cgls/cgls.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-cgls', + 'src/cgls/cgls.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemd-cgtop', - 'src/cgtop/cgtop.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-cgtop', + 'src/cgtop/cgtop.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] executable('systemd-initctl', 'src/initctl/initctl.c', @@ -1883,75 +1916,82 @@ executable('systemd-initctl', install : true, install_dir : rootlibexecdir) -executable('systemd-mount', - 'src/mount/mount-tool.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal, - libudev], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-mount', + 'src/mount/mount-tool.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal, + libudev], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] meson.add_install_script(meson_make_symlink, 'systemd-mount', join_paths(bindir, 'systemd-umount')) -executable('systemd-run', - 'src/run/run.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-run', + 'src/run/run.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('systemd-stdio-bridge', - 'src/stdio-bridge/stdio-bridge.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-stdio-bridge', + 'src/stdio-bridge/stdio-bridge.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] -executable('busctl', - 'src/busctl/busctl.c', - 'src/busctl/busctl-introspect.c', - 'src/busctl/busctl-introspect.h', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true) +exe = executable('busctl', + 'src/busctl/busctl.c', + 'src/busctl/busctl-introspect.c', + 'src/busctl/busctl-introspect.h', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] if conf.get('ENABLE_SYSUSERS', 0) == 1 - executable('systemd-sysusers', - 'src/sysusers/sysusers.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('systemd-sysusers', + 'src/sysusers/sysusers.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_TMPFILES', 0) == 1 - executable('systemd-tmpfiles', - 'src/tmpfiles/tmpfiles.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libacl], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('systemd-tmpfiles', + 'src/tmpfiles/tmpfiles.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libacl], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_HWDB', 0) == 1 - executable('systemd-hwdb', - 'src/hwdb/hwdb.c', - 'src/libsystemd/sd-hwdb/hwdb-internal.h', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + exe = executable('systemd-hwdb', + 'src/hwdb/hwdb.c', + 'src/libsystemd/sd-hwdb/hwdb-internal.h', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_QUOTACHECK', 0) == 1 @@ -1964,45 +2004,48 @@ if conf.get('ENABLE_QUOTACHECK', 0) == 1 install_dir : rootlibexecdir) endif -executable('systemd-socket-proxyd', - 'src/socket-proxy/socket-proxyd.c', - include_directories : includes, - link_with : [libshared, - libsystemd_internal], - dependencies : [threads], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) +exe = executable('systemd-socket-proxyd', + 'src/socket-proxy/socket-proxyd.c', + include_directories : includes, + link_with : [libshared, + libsystemd_internal], + dependencies : [threads], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) +public_programs += [exe] -executable('systemd-udevd', - systemd_udevd_sources, - include_directories : includes, - link_with : [libudev_core, - libudev_internal, - libsystemd_network, - libsystemd_internal, - libshared], - dependencies : [libkmod, - libidn, - libacl], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) +exe = executable('systemd-udevd', + systemd_udevd_sources, + include_directories : includes, + link_with : [libudev_core, + libudev_internal, + libsystemd_network, + libsystemd_internal, + libshared], + dependencies : [libkmod, + libidn, + libacl], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) +public_programs += [exe] -executable('udevadm', - udevadm_sources, - include_directories : includes, - link_with : [libudev_core, - libudev_internal, - libsystemd_network, - libshared, - libsystemd_internal], - dependencies : [libkmod, - libidn, - libacl], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('udevadm', + udevadm_sources, + include_directories : includes, + link_with : [libudev_core, + libudev_internal, + libsystemd_network, + libshared, + libsystemd_internal], + dependencies : [libkmod, + libidn, + libacl], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] executable('systemd-shutdown', systemd_shutdown_sources, @@ -2047,23 +2090,24 @@ if conf.get('HAVE_KMOD', 0) == 1 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) endif -executable('systemd-nspawn', - systemd_nspawn_sources, - 'src/core/mount-setup.c', # FIXME: use a variable? - 'src/core/mount-setup.h', - 'src/core/loopback-setup.c', - 'src/core/loopback-setup.h', - include_directories : [includes, include_directories('src/nspawn')], - link_with : [libfirewall, - libshared, - libudev, - libsystemd_internal], - dependencies : [libacl, - libblkid, - libseccomp, - libselinux], - install_rpath : rootlibexecdir, - install : true) +exe = executable('systemd-nspawn', + systemd_nspawn_sources, + 'src/core/mount-setup.c', # FIXME: use a variable? + 'src/core/mount-setup.h', + 'src/core/loopback-setup.c', + 'src/core/loopback-setup.h', + include_directories : [includes, include_directories('src/nspawn')], + link_with : [libfirewall, + libshared, + libudev, + libsystemd_internal], + dependencies : [libacl, + libblkid, + libseccomp, + libselinux], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] if conf.get('ENABLE_NETWORKD', 0) == 1 executable('systemd-networkd', @@ -2090,15 +2134,16 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_dir : rootlibexecdir) endif -executable('networkctl', - networkctl_sources, - include_directories : includes, - link_with : [libsystemd_network, - libshared, - libsystemd_internal], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) +exe = executable('networkctl', + networkctl_sources, + include_directories : includes, + link_with : [libsystemd_network, + libshared, + libsystemd_internal], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) +public_programs += [exe] ############################################################ @@ -2210,6 +2255,17 @@ meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) ############################################################ +meson_check_help = find_program('tools/meson-check-help.sh') + +foreach exec : public_programs + name = exec.full_path().split('/')[-1] + test('check-help-' + name, + meson_check_help, + args : [exec.full_path()]) +endforeach + +############################################################ + if git.found() and etags.found() all_files = run_command( git, diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh new file mode 100755 index 0000000000..2f7ba3978d --- /dev/null +++ b/tools/meson-check-help.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e + +# output width +if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then + echo "$(basename "$1") --help output is too wide:" + "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}' + exit 1 +fi + +# no --help output to stdout +if "$1" --help 2>&1 1>/dev/null | grep .; then + echo "$(basename "$1") --help prints to stderr" + exit 2 +fi + +# error output to stderr +if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then + echo "$(basename "$1") with an unknown parameter does not print to stderr" + exit 3 +fi From 1eeb43f5afed1405402f37a2546d1e923030c487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 19:37:14 -0400 Subject: [PATCH 38/82] meson: libxkbcommon support --- meson.build | 21 ++++++++++++++++++++- meson_options.txt | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 15808e6447..ec1ab11700 100644 --- a/meson.build +++ b/meson.build @@ -856,6 +856,18 @@ else libgio = [] endif +want_xkbcommon = get_option('xkbcommon') +if want_xkbcommon != 'no' + libxkbcommon = dependency('xkbcommon', + version : '>= 0.3.0', + required : want_xkbcommon == 'yes') + if libxkbcommon.found() + conf.set('HAVE_XKBCOMMON', 1) + endif +else + libxkbcommon = [] +endif + want_dbus = get_option('dbus') if want_dbus != 'no' libdbus = dependency('dbus-1', @@ -1493,12 +1505,19 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 endif if conf.get('ENABLE_LOCALED', 0) == 1 + if conf.get('HAVE_XKBCOMMON', 0) == 1 + # logind will load libxkbcommon.so dynamically on its own + deps = [libdl] + else + deps = [] + endif + executable('systemd-localed', systemd_localed_sources, include_directories : includes, link_with : [libshared, libsystemd_internal], - dependencies : [libdl], + dependencies : deps, install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) diff --git a/meson_options.txt b/meson_options.txt index d5ce9d9f93..59e38515da 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -200,6 +200,8 @@ option('xz', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'xz compression support') option('lz4', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'lz4 compression support') +option('xkbcommon', type : 'combo', choices : ['auto', 'yes', 'no'], + description : 'xkbcommon keymap support') option('glib', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'libglib support (for tests only)') option('dbus', type : 'combo', choices : ['auto', 'yes', 'no'], From 2895c8ee9f28549438c1a522dd0e95ca52a6148c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 19:45:05 -0400 Subject: [PATCH 39/82] meson: ima support --- meson.build | 1 + meson_options.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/meson.build b/meson.build index ec1ab11700..ea65f1502a 100644 --- a/meson.build +++ b/meson.build @@ -945,6 +945,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['rfkill', 'ENABLE_RFKILL'], ['ldconfig', 'ENABLE_LDCONFIG'], ['efi', 'ENABLE_EFI'], + ['ima', 'HAVE_IMA'], ] if get_option(pair[0]) diff --git a/meson_options.txt b/meson_options.txt index 59e38515da..25875ca031 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -165,6 +165,8 @@ option('smack-run-label', type : 'string', description : 'run systemd --system itself with a specific SMACK label') option('polkit', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'PolicyKit support') +option('ima', type : 'boolean', + description : 'IMA support') option('audit', type : 'combo', choices : ['auto', 'yes', 'no'], description : 'libaudit support') From b184e8feb913d08db059b0811d27ec5e564388a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 19:59:21 -0400 Subject: [PATCH 40/82] meson: skip index generation when lxml is not available --- man/meson.build | 9 +++++++-- meson.build | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/man/meson.build b/man/meson.build index c945c662f5..1b7b5a2419 100644 --- a/man/meson.build +++ b/man/meson.build @@ -85,6 +85,11 @@ endforeach ############################################################ +have_lxml = run_command(xml_helper_py).returncode() == 0 +if not have_lxml + message('python-lxml not available, not making man page indices') +endif + systemd_directives_xml = custom_target( 'systemd.directives.xml', input : source_xml_files, @@ -114,7 +119,7 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], input : xml, output : man, command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], - install : want_man, + install : want_man and have_lxml, install_dir : mandirn) man_pages += [p1] @@ -123,7 +128,7 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], input : xml, output : html, command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], - install : want_html, + install : want_html and have_lxml, install_dir : join_paths(docdir, 'html')) html_pages += [p2] endforeach diff --git a/meson.build b/meson.build index ea65f1502a..cbc240122a 100644 --- a/meson.build +++ b/meson.build @@ -2236,6 +2236,7 @@ test('test-libudev-sym', make_directive_index_py = find_program('tools/make-directive-index.py') make_man_index_py = find_program('tools/make-man-index.py') +xml_helper_py = find_program('tools/xml_helper.py') subdir('units') subdir('sysctl.d') From 9ac47f38151808712f1bdcae8e2eb42a0b53e5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 20:17:04 -0400 Subject: [PATCH 41/82] meson: fix condition for installation of .in units, 99-default.link The condition to install in_units was calculated, but not used. 99-default.link should be installed uncoditionally. --- network/meson.build | 4 +++- units/meson.build | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/network/meson.build b/network/meson.build index d36aadb9da..4cca408c7f 100644 --- a/network/meson.build +++ b/network/meson.build @@ -4,9 +4,11 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 install_data('80-container-host0.network', '80-container-ve.network', '80-container-vz.network', - '99-default.link', install_dir : networkdir) meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'systemd/network'))) endif + +install_data('99-default.link', + install_dir : networkdir) diff --git a/units/meson.build b/units/meson.build index e49a293ba9..37903e45c0 100644 --- a/units/meson.build +++ b/units/meson.build @@ -255,7 +255,7 @@ foreach tuple : in_units output : file, command : [sed, '/^## /d', '@INPUT@'], capture : true, - install : true, + install : install, install_dir : systemunitdir) if install and tuple.length() > 2 From 4390be305b235e647dd18c95c74d79a2a085d561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 20:30:07 -0400 Subject: [PATCH 42/82] meson: replace yes/no/auto with true/false/auto This doesn't feel as natural, but is more consistent with the boolean options which require true/false, and allows setting of options without knowing of which type the option is. --- man/meson.build | 6 +-- meson.build | 112 +++++++++++++++++++-------------------- meson_options.txt | 60 ++++++++++----------- src/boot/efi/meson.build | 4 +- 4 files changed, 91 insertions(+), 91 deletions(-) diff --git a/man/meson.build b/man/meson.build index 1b7b5a2419..6efec40695 100644 --- a/man/meson.build +++ b/man/meson.build @@ -9,9 +9,9 @@ subdir('rules') want_man = get_option('man') want_html = get_option('html') xsltproc = find_program('xsltproc', - required : want_man == 'yes' or want_html == 'yes') -want_man = want_man != 'no' and xsltproc.found() -want_html = want_html != 'no' and xsltproc.found() + required : want_man == 'true' or want_html == 'true') +want_man = want_man != 'false' and xsltproc.found() +want_html = want_html != 'false' and xsltproc.found() xsltproc_flags = [ '--nonet', diff --git a/meson.build b/meson.build index cbc240122a..60be100377 100644 --- a/meson.build +++ b/meson.build @@ -577,9 +577,9 @@ libmount = dependency('mount', version : '>= 2.27') want_seccomp = get_option('seccomp') -if want_seccomp != 'no' +if want_seccomp != 'false' libseccomp = dependency('libseccomp', - required : want_seccomp == 'yes') + required : want_seccomp == 'true') if libseccomp.found() conf.set('HAVE_SECCOMP', 1) m4_defines += ['-DHAVE_SECCOMP'] @@ -589,10 +589,10 @@ else endif want_selinux = get_option('selinux') -if want_selinux != 'no' +if want_selinux != 'false' libselinux = dependency('libselinux', version : '>= 2.1.9', - required : want_selinux == 'yes') + required : want_selinux == 'true') if libselinux.found() conf.set('HAVE_SELINUX', 1) m4_defines += ['-DHAVE_SELINUX'] @@ -602,9 +602,9 @@ else endif want_apparmor = get_option('apparmor') -if want_apparmor != 'no' +if want_apparmor != 'false' libapparmor = dependency('libapparmor', - required : want_apparmor == 'yes') + required : want_apparmor == 'true') if libapparmor.found() conf.set('HAVE_APPARMOR', 1) m4_defines += ['-DHAVE_APPARMOR'] @@ -614,9 +614,9 @@ else endif want_smack = get_option('smack') -if want_smack != 'no' +if want_smack != 'false' libsmack = dependency('libsmack', - required : want_smack == 'yes') + required : want_smack == 'true') if libsmack.found() conf.set('HAVE_SMACK', 1) m4_defines += ['-DHAVE_SMACK'] @@ -634,7 +634,7 @@ endif want_polkit = get_option('polkit') install_polkit = false install_polkit_pkla = false -if want_polkit != 'no' +if want_polkit != 'false' conf.set('ENABLE_POLKIT', 1) install_polkit = true @@ -647,8 +647,8 @@ if want_polkit != 'no' endif want_audit = get_option('audit') -if want_audit != 'no' - libaudit = dependency('audit', required : want_audit == 'yes') +if want_audit != 'false' + libaudit = dependency('audit', required : want_audit == 'true') if libaudit.found() conf.set('HAVE_AUDIT', 1) endif @@ -657,8 +657,8 @@ else endif want_blkid = get_option('blkid') -if want_blkid != 'no' - libblkid = dependency('blkid', required : want_blkid == 'yes') +if want_blkid != 'false' + libblkid = dependency('blkid', required : want_blkid == 'true') if libblkid.found() conf.set('HAVE_BLKID', 1) endif @@ -667,10 +667,10 @@ else endif want_kmod = get_option('kmod') -if want_kmod != 'no' +if want_kmod != 'false' libkmod = dependency('libkmod', version : '>= 15', - required : want_kmod == 'yes') + required : want_kmod == 'true') if libkmod.found() conf.set('HAVE_KMOD', 1) endif @@ -679,9 +679,9 @@ else endif want_pam = get_option('pam') -if want_pam != 'no' - libpam = cc.find_library('pam', required : want_pam == 'yes') - libpam_misc = cc.find_library('pam_misc', required : want_pam == 'yes') +if want_pam != 'false' + libpam = cc.find_library('pam', required : want_pam == 'true') + libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') if libpam.found() and libpam_misc.found() conf.set('HAVE_PAM', 1) m4_defines += ['-DHAVE_PAM'] @@ -692,10 +692,10 @@ else endif want_microhttpd = get_option('microhttpd') -if want_microhttpd != 'no' +if want_microhttpd != 'false' libmicrohttpd = dependency('libmicrohttpd', version : '>= 0.9.33', - required : want_microhttpd == 'yes') + required : want_microhttpd == 'true') if libmicrohttpd.found() conf.set('HAVE_MICROHTTPD', 1) m4_defines += ['-DHAVE_MICROHTTPD'] @@ -705,10 +705,10 @@ else endif want_libcryptsetup = get_option('libcryptsetup') -if want_libcryptsetup != 'no' +if want_libcryptsetup != 'false' libcryptsetup = dependency('libcryptsetup', version : '>= 1.6.0', - required : want_libcryptsetup == 'yes') + required : want_libcryptsetup == 'true') if libcryptsetup.found() conf.set('HAVE_LIBCRYPTSETUP', 1) endif @@ -717,10 +717,10 @@ else endif want_libcurl = get_option('libcurl') -if want_libcurl != 'no' +if want_libcurl != 'false' libcurl = dependency('libcurl', version : '>= 7.32.0', - required : want_libcurl == 'yes') + required : want_libcurl == 'true') if libcurl.found() conf.set('HAVE_LIBCURL', 1) m4_defines += ['-DHAVE_LIBCURL'] @@ -730,9 +730,9 @@ else endif want_libidn = get_option('libidn') -if want_libidn != 'no' +if want_libidn != 'false' libidn = dependency('libidn', - required : want_libidn == 'yes') + required : want_libidn == 'true') if libidn.found() conf.set('HAVE_LIBIDN', 1) m4_defines += ['-DHAVE_LIBIDN'] @@ -742,9 +742,9 @@ else endif want_libiptc = get_option('libiptc') -if want_libiptc != 'no' +if want_libiptc != 'false' libiptc = dependency('libiptc', - required : want_libiptc == 'yes') + required : want_libiptc == 'true') if libiptc.found() conf.set('HAVE_LIBIPTC', 1) m4_defines += ['-DHAVE_LIBIPTC'] @@ -754,9 +754,9 @@ else endif want_qrencode = get_option('qrencode') -if want_qrencode != 'no' +if want_qrencode != 'false' libqrencode = dependency('libqrencode', - required : want_qrencode == 'yes') + required : want_qrencode == 'true') if libqrencode.found() conf.set('HAVE_QRENCODE', 1) endif @@ -765,10 +765,10 @@ else endif want_gnutls = get_option('gnutls') -if want_gnutls != 'no' +if want_gnutls != 'false' libgnutls = dependency('gnutls', version : '>= 3.1.4', - required : want_gnutls == 'yes') + required : want_gnutls == 'true') if libgnutls.found() conf.set('HAVE_GNUTLS', 1) endif @@ -777,9 +777,9 @@ else endif want_elfutils = get_option('elfutils') -if want_elfutils != 'no' +if want_elfutils != 'false' libdw = dependency('libdw', - required : want_elfutils == 'yes') + required : want_elfutils == 'true') if libdw.found() conf.set('HAVE_ELFUTILS', 1) endif @@ -788,9 +788,9 @@ else endif want_zlib = get_option('zlib') -if want_zlib != 'no' +if want_zlib != 'false' libz = dependency('zlib', - required : want_zlib == 'yes') + required : want_zlib == 'true') if libz.found() conf.set('HAVE_ZLIB', 1) endif @@ -799,9 +799,9 @@ else endif want_bzip2 = get_option('bzip2') -if want_bzip2 != 'no' +if want_bzip2 != 'false' libbzip2 = cc.find_library('bz2', - required : want_bzip2 == 'yes') + required : want_bzip2 == 'true') if libbzip2.found() conf.set('HAVE_BZIP2', 1) endif @@ -810,9 +810,9 @@ else endif want_xz = get_option('xz') -if want_xz != 'no' +if want_xz != 'false' libxz = dependency('liblzma', - required : want_xz == 'yes') + required : want_xz == 'true') if libxz.found() conf.set('HAVE_XZ', 1) endif @@ -821,9 +821,9 @@ else endif want_lz4 = get_option('lz4') -if want_lz4 != 'no' +if want_lz4 != 'false' liblz4 = dependency('liblz4', - required : want_lz4 == 'yes') + required : want_lz4 == 'true') if liblz4.found() conf.set('HAVE_LZ4', 1) endif @@ -838,15 +838,15 @@ if libacl.found() endif want_glib = get_option('glib') -if want_glib != 'no' +if want_glib != 'false' libglib = dependency('glib-2.0', version : '>= 2.22.0', - required : want_glib == 'yes') + required : want_glib == 'true') libgobject = dependency('gobject-2.0', version : '>= 2.22.0', - required : want_glib == 'yes') + required : want_glib == 'true') libgio = dependency('gio-2.0', - required : want_glib == 'yes') + required : want_glib == 'true') if libglib.found() and libgobject.found() and libgio.found() conf.set('HAVE_GLIB', 1) endif @@ -857,10 +857,10 @@ else endif want_xkbcommon = get_option('xkbcommon') -if want_xkbcommon != 'no' +if want_xkbcommon != 'false' libxkbcommon = dependency('xkbcommon', version : '>= 0.3.0', - required : want_xkbcommon == 'yes') + required : want_xkbcommon == 'true') if libxkbcommon.found() conf.set('HAVE_XKBCOMMON', 1) endif @@ -869,10 +869,10 @@ else endif want_dbus = get_option('dbus') -if want_dbus != 'no' +if want_dbus != 'false' libdbus = dependency('dbus-1', version : '>= 1.3.2', - required : want_dbus == 'yes') + required : want_dbus == 'true') if libdbus.found() conf.set('HAVE_DBUS', 1) endif @@ -881,8 +881,8 @@ else endif want_libgcrypt = get_option('libgcrypt') -if want_libgcrypt != 'no' - libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'yes') +if want_libgcrypt != 'false' + libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true') if libgcrypt.found() conf.set('HAVE_LIBGCRYPT', 1) endif @@ -891,7 +891,7 @@ else endif want_importd = get_option('importd') -if want_importd != 'no' +if want_importd != 'false' have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and conf.get('HAVE_ZLIB', 0) == 1 and conf.get('HAVE_BZIP2', 0) == 1 and @@ -899,20 +899,20 @@ if want_importd != 'no' conf.get('HAVE_LIBGCRYPT', 0) == 1) if have_deps conf.set('ENABLE_IMPORTD', 1) - elif want_importd == 'yes' + elif want_importd == 'true' error('importd support was requested, but dependencies are not available') endif endif want_remote = get_option('remote') -if want_remote != 'no' +if want_remote != 'false' have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1, conf.get('HAVE_LIBCURL', 0) == 1] # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so # it's possible to build one without the other. Complain only if # support was explictly requested. The auxiliary files like sysusers # config should be installed when any of the programs are built. - if want_remote == 'yes' and not (have_deps[0] and have_deps[1]) + if want_remote == 'true' and not (have_deps[0] and have_deps[1]) error('remote support was requested, but dependencies are not available') endif if have_deps[0] or have_deps[1] diff --git a/meson_options.txt b/meson_options.txt index 25875ca031..1058e10db6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -85,10 +85,10 @@ option('hwdb', type : 'boolean', description : 'support for the hardware database') option('rfkill', type : 'boolean', description : 'support for the rfkill tools') -option('man', type : 'combo', choices : ['auto', 'yes', 'no'], +option('man', type : 'combo', choices : ['auto', 'true', 'false'], description : 'build and install man pages') -option('html', type : 'combo', choices : ['auto', 'yes', 'no'], - value : 'no', +option('html', type : 'combo', choices : ['auto', 'true', 'false'], + value : 'false', description : 'build and install html pages') option('certificate-root', type : 'string', value : '/etc/ssl', @@ -153,63 +153,63 @@ option('support-url', type : 'string', description : 'the support URL to show in catalog entries included in systemd', value : 'https://lists.freedesktop.org/mailman/listinfo/systemd-devel') -option('seccomp', type : 'combo', choices : ['auto', 'yes', 'no'], +option('seccomp', type : 'combo', choices : ['auto', 'true', 'false'], description : 'SECCOMP support') -option('selinux', type : 'combo', choices : ['auto', 'yes', 'no'], +option('selinux', type : 'combo', choices : ['auto', 'true', 'false'], description : 'SELinux support') -option('apparmor', type : 'combo', choices : ['auto', 'yes', 'no'], +option('apparmor', type : 'combo', choices : ['auto', 'true', 'false'], description : 'AppArmor support') -option('smack', type : 'combo', choices : ['auto', 'yes', 'no'], +option('smack', type : 'combo', choices : ['auto', 'true', 'false'], description : 'SMACK support') option('smack-run-label', type : 'string', description : 'run systemd --system itself with a specific SMACK label') -option('polkit', type : 'combo', choices : ['auto', 'yes', 'no'], +option('polkit', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PolicyKit support') option('ima', type : 'boolean', description : 'IMA support') -option('audit', type : 'combo', choices : ['auto', 'yes', 'no'], +option('audit', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libaudit support') -option('blkid', type : 'combo', choices : ['auto', 'yes', 'no'], +option('blkid', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libblkid support') -option('kmod', type : 'combo', choices : ['auto', 'yes', 'no'], +option('kmod', type : 'combo', choices : ['auto', 'true', 'false'], description : 'support for loadable modules') -option('pam', type : 'combo', choices : ['auto', 'yes', 'no'], +option('pam', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PAM support') -option('microhttpd', type : 'combo', choices : ['auto', 'yes', 'no'], +option('microhttpd', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libµhttpd support') -option('libcryptsetup', type : 'combo', choices : ['auto', 'yes', 'no'], +option('libcryptsetup', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libcryptsetup support') -option('libcurl', type : 'combo', choices : ['auto', 'yes', 'no'], +option('libcurl', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libcurl support') -option('libidn', type : 'combo', choices : ['auto', 'yes', 'no'], +option('libidn', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libidn support') -option('libiptc', type : 'combo', choices : ['auto', 'yes', 'no'], +option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libiptc support') -option('qrencode', type : 'combo', choices : ['auto', 'yes', 'no'], +option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libqrencode support') -option('libgcrypt', type : 'combo', choices : ['auto', 'yes', 'no'], +option('libgcrypt', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libgcrypt support') -option('gnutls', type : 'combo', choices : ['auto', 'yes', 'no'], +option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'], description : 'gnutls support') -option('elfutils', type : 'combo', choices : ['auto', 'yes', 'no'], +option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'], description : 'elfutils support') -option('zlib', type : 'combo', choices : ['auto', 'yes', 'no'], +option('zlib', type : 'combo', choices : ['auto', 'true', 'false'], description : 'zlib compression support') -option('bzip2', type : 'combo', choices : ['auto', 'yes', 'no'], +option('bzip2', type : 'combo', choices : ['auto', 'true', 'false'], description : 'bzip2 compression support') -option('xz', type : 'combo', choices : ['auto', 'yes', 'no'], +option('xz', type : 'combo', choices : ['auto', 'true', 'false'], description : 'xz compression support') -option('lz4', type : 'combo', choices : ['auto', 'yes', 'no'], +option('lz4', type : 'combo', choices : ['auto', 'true', 'false'], description : 'lz4 compression support') -option('xkbcommon', type : 'combo', choices : ['auto', 'yes', 'no'], +option('xkbcommon', type : 'combo', choices : ['auto', 'true', 'false'], description : 'xkbcommon keymap support') -option('glib', type : 'combo', choices : ['auto', 'yes', 'no'], +option('glib', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libglib support (for tests only)') -option('dbus', type : 'combo', choices : ['auto', 'yes', 'no'], +option('dbus', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libdbus support (for tests only)') -option('gnu-efi', type : 'combo', choices : ['auto', 'yes', 'no'], +option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'], description : 'gnu-efi support for sd-boot') option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules') @@ -227,7 +227,7 @@ option('bashcompletiondir', type : 'string', option('zshcompletiondir', type : 'string', description : 'directory for zsh completion scripts ["no" disables]') -option('tests', type : 'combo', choices : ['yes', 'unsafe'], +option('tests', type : 'combo', choices : ['true', 'unsafe'], description : 'enable extra tests with =unsafe') option('install-tests', type : 'boolean', value : 'false', description : 'install test executables') diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 7e0c626f28..69c7405983 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -28,7 +28,7 @@ stub_sources = ''' stub.c '''.split() -if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'no' +if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'false' efi_cc = get_option('efi-cc') efi_ld = get_option('efi-ld') @@ -53,7 +53,7 @@ else have_gnu_efi = false endif -if get_option('gnu-efi') == 'yes' and not have_gnu_efi +if get_option('gnu-efi') == 'true' and not have_gnu_efi error('gnu-efi support requested, but headers were not found') endif From 4ff3f251b9e760a3894e23e9a208bccc54aaa25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 20:47:20 -0400 Subject: [PATCH 43/82] meson: install test data v2: - do not install test-data if instal-tests=no --- meson.build | 1 + test/meson.build | 166 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 test/meson.build diff --git a/meson.build b/meson.build index 60be100377..ee886b8adc 100644 --- a/meson.build +++ b/meson.build @@ -1114,6 +1114,7 @@ subdir('src/sulogin-shell') subdir('src/boot/efi') subdir('src/test') +subdir('test') executable('systemd', systemd_sources, diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000000..79446d0dad --- /dev/null +++ b/test/meson.build @@ -0,0 +1,166 @@ +test_data_files = ''' + a.service + basic.target + b.service + c.service + daughter.service + d.service + end.service + e.service + f.service + grandchild.service + g.service + hello-after-sleep.target + hello.service + h.service + parent-deep.slice + parent.slice + sched_idle_bad.service + sched_idle_ok.service + sched_rr_bad.service + sched_rr_change.service + sched_rr_ok.service + shutdown.target + sleep.service + sockets.target + son.service + sysinit.target + testsuite.target + timers.target + unstoppable.service + test-path/paths.target + test-path/basic.target + test-path/sysinit.target + test-path/path-changed.service + test-path/path-directorynotempty.service + test-path/path-existsglob.service + test-path/path-exists.service + test-path/path-makedirectory.service + test-path/path-modified.service + test-path/path-mycustomunit.service + test-path/path-service.service + test-path/path-changed.path + test-path/path-directorynotempty.path + test-path/path-existsglob.path + test-path/path-exists.path + test-path/path-makedirectory.path + test-path/path-modified.path + test-path/path-unit.path + test-execute/exec-environment-empty.service + test-execute/exec-environment-multiple.service + test-execute/exec-environment.service + test-execute/exec-passenvironment-absent.service + test-execute/exec-passenvironment-empty.service + test-execute/exec-passenvironment-repeated.service + test-execute/exec-passenvironment.service + test-execute/exec-group.service + test-execute/exec-group-nfsnobody.service + test-execute/exec-supplementarygroups.service + test-execute/exec-supplementarygroups-single-group.service + test-execute/exec-supplementarygroups-single-group-user.service + test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service + test-execute/exec-supplementarygroups-multiple-groups-withgid.service + test-execute/exec-supplementarygroups-multiple-groups-withuid.service + test-execute/exec-dynamicuser-fixeduser.service + test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service + test-execute/exec-dynamicuser-supplementarygroups.service + test-execute/exec-ignoresigpipe-no.service + test-execute/exec-ignoresigpipe-yes.service + test-execute/exec-personality-x86-64.service + test-execute/exec-personality-x86.service + test-execute/exec-personality-s390.service + test-execute/exec-personality-ppc64.service + test-execute/exec-personality-ppc64le.service + test-execute/exec-personality-aarch64.service + test-execute/exec-privatedevices-no.service + test-execute/exec-privatedevices-yes.service + test-execute/exec-privatedevices-no-capability-mknod.service + test-execute/exec-privatedevices-yes-capability-mknod.service + test-execute/exec-protectkernelmodules-no-capabilities.service + test-execute/exec-protectkernelmodules-yes-capabilities.service + test-execute/exec-protectkernelmodules-yes-mount-propagation.service + test-execute/exec-privatetmp-no.service + test-execute/exec-privatetmp-yes.service + test-execute/exec-readonlypaths.service + test-execute/exec-readonlypaths-mount-propagation.service + test-execute/exec-readwritepaths-mount-propagation.service + test-execute/exec-inaccessiblepaths-mount-propagation.service + test-execute/exec-spec-interpolation.service + test-execute/exec-systemcallerrornumber.service + test-execute/exec-systemcallfilter-failing2.service + test-execute/exec-systemcallfilter-failing.service + test-execute/exec-systemcallfilter-not-failing2.service + test-execute/exec-systemcallfilter-not-failing.service + test-execute/exec-systemcallfilter-system-user.service + test-execute/exec-systemcallfilter-system-user-nfsnobody.service + test-execute/exec-user.service + test-execute/exec-user-nfsnobody.service + test-execute/exec-workingdirectory.service + test-execute/exec-umask-0177.service + test-execute/exec-umask-default.service + test-execute/exec-privatenetwork-yes.service + test-execute/exec-environmentfile.service + test-execute/exec-oomscoreadjust-positive.service + test-execute/exec-oomscoreadjust-negative.service + test-execute/exec-ioschedulingclass-best-effort.service + test-execute/exec-ioschedulingclass-idle.service + test-execute/exec-ioschedulingclass-none.service + test-execute/exec-ioschedulingclass-realtime.service + test-execute/exec-capabilityboundingset-invert.service + test-execute/exec-capabilityboundingset-merge.service + test-execute/exec-capabilityboundingset-reset.service + test-execute/exec-capabilityboundingset-simple.service + test-execute/exec-capabilityambientset.service + test-execute/exec-capabilityambientset-nfsnobody.service + test-execute/exec-capabilityambientset-merge.service + test-execute/exec-capabilityambientset-merge-nfsnobody.service + test-execute/exec-runtimedirectory.service + test-execute/exec-runtimedirectory-mode.service + test-execute/exec-runtimedirectory-owner.service + test-execute/exec-runtimedirectory-owner-nfsnobody.service + test-execute/exec-restrict-namespaces-no.service + test-execute/exec-restrict-namespaces-yes.service + test-execute/exec-restrict-namespaces-mnt.service + test-execute/exec-restrict-namespaces-mnt-blacklist.service + test-execute/exec-read-only-path-succeed.service + test-execute/exec-privatedevices-yes-capability-sys-rawio.service + test-execute/exec-privatedevices-no-capability-sys-rawio.service + bus-policy/hello.conf + bus-policy/methods.conf + bus-policy/ownerships.conf + bus-policy/signals.conf + bus-policy/check-own-rules.conf + bus-policy/many-rules.conf + bus-policy/test.conf + hwdb/10-bad.hwdb + journal-data/journal-1.txt + journal-data/journal-2.txt +'''.split() + +if conf.get('ENABLE_RESOLVED', 0) == 1 + test_data_files += ''' + test-resolve/_openpgpkey.fedoraproject.org.pkts + test-resolve/fedoraproject.org.pkts + test-resolve/gandi.net.pkts + test-resolve/google.com.pkts + test-resolve/root.pkts + test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts + test-resolve/teamits.com.pkts + test-resolve/zbyszek@fedoraproject.org.pkts + test-resolve/_443._tcp.fedoraproject.org.pkts + test-resolve/kyhwana.org.pkts + test-resolve/fake-caa.pkts + '''.split() +endif + +if install_tests + foreach file : test_data_files + subdir = file.split('/')[0] + if subdir == file + subdir = '' + endif + + install_data(file, + install_dir : testsdir + '/testdata/' + subdir) + endforeach +endif From ab916f2e8101a4733f66b8d291895af73965b379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Apr 2017 22:15:01 -0400 Subject: [PATCH 44/82] meson: add rootprefix option (for Gentoo) --- meson.build | 5 +++-- meson_options.txt | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index ee886b8adc..4406db980c 100644 --- a/meson.build +++ b/meson.build @@ -28,11 +28,12 @@ m4_defines = [] ##################################################################### +rootprefixdir = get_option('rootprefix') if get_option('split-usr') conf.set('HAVE_SPLIT_USR', 1) - rootprefixdir = '/' + rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/' else - rootprefixdir = '/usr' + rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr' endif sysvinit_path = get_option('sysvinit-path') diff --git a/meson_options.txt b/meson_options.txt index 1058e10db6..005fd0e992 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,6 +4,8 @@ option('split-usr', type : 'boolean', value : false, description : '''assume that /bin, /sbin aren't symlinks into /usr''') option('rootlibdir', type : 'string', description : '''[/usr]/lib/x86_64-linux-gnu or such''') +option('rootprefix', type : 'string', + description : '''override the root prefix''') option('sysvinit-path', type : 'string', value : '/etc/init.d', description : 'the directory where the SysV init scripts are located') From aac2605820859fe2908ba9adfcb96a65b2e375e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 14 Apr 2017 18:49:47 -0400 Subject: [PATCH 45/82] meson: eliminate libsystemd_journal_internal and use libsystemd_internal less This simplifies things and leads to a smaller installation footprint. libsystemd_internal and libsystemd_journal_internal are linked into libystemd-shared and available to all programs linked to libsystemd-shared. libsystemd_journal_internal is not needed anymore, and libsystemd-shared is used everwhere. The few exceptions are: libsystemd.so, test-engine, test-bus-error, and various loadable modules. --- meson.build | 163 ++++++++------------- src/journal/meson.build | 14 +- src/libudev/meson.build | 11 +- src/machine/meson.build | 3 +- src/network/meson.build | 4 +- src/resolve/meson.build | 9 +- src/shared/meson.build | 9 +- src/test/meson.build | 303 ++++++++++++++++++---------------------- src/udev/meson.build | 24 ++-- 9 files changed, 221 insertions(+), 319 deletions(-) diff --git a/meson.build b/meson.build index 4406db980c..2b719ec257 100644 --- a/meson.build +++ b/meson.build @@ -1024,16 +1024,13 @@ libjournal_core = static_library( libjournal_core_sources, journald_gperf_c, include_directories : includes, - link_with : [libbasic, - libsystemd_internal, - libsystemd_journal_internal], install : false) libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) libsystemd = shared_library( 'systemd', libsystemd_internal_sources, - libsystemd_journal_internal_sources, + journal_internal_sources, version : '0.18.0', include_directories : includes, link_args : ['-shared', @@ -1122,8 +1119,7 @@ executable('systemd', include_directories : includes, link_with : [libcore, libshared, - libudev, - libsystemd_internal], + libudev], dependencies : [threads, librt, libseccomp, @@ -1139,7 +1135,6 @@ exe = executable('systemd-analyze', include_directories : includes, link_with : [libcore, libudev, - libsystemd_internal, libshared], dependencies : [threads, librt, @@ -1154,13 +1149,13 @@ public_programs += [exe] executable('systemd-journald', systemd_journald_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libjournal_core, + link_with : [libjournal_core, libshared, libudev], dependencies : [threads, libxz, - liblz4], + liblz4, + libselinux], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1179,10 +1174,8 @@ public_programs += [exe] exe = executable('journalctl', journalctl_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared, - libudev, - libsystemd_internal], + link_with : [libshared, + libudev], dependencies : [threads, libqrencode, libxz, @@ -1221,8 +1214,7 @@ if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 executable('30-systemd-environment-d-generator', 'src/environment-d-generator/environment-d-generator.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : userenvgeneratordir) @@ -1255,8 +1247,7 @@ if conf.get('HAVE_BLKID', 0) == 1 'src/gpt-auto-generator/gpt-auto-generator.c', 'src/basic/blkid-util.h', include_directories : includes, - link_with : [libsystemd_internal, - libshared, + link_with : [libshared, libudev], dependencies : libblkid, install_rpath : rootlibexecdir, @@ -1277,8 +1268,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 executable('systemd-resolved', systemd_resolved_sources, include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libm, libidn], @@ -1289,8 +1279,7 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 exe = executable('systemd-resolve', systemd_resolve_sources, include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libm, libidn], @@ -1304,9 +1293,8 @@ if conf.get('ENABLE_LOGIND', 0) == 1 systemd_logind_sources, include_directories : includes, link_with : [liblogind_core, - libudev, libshared, - libsystemd_internal], + libudev], dependencies : [threads, libacl], install_rpath : rootlibexecdir, @@ -1317,8 +1305,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 loginctl_sources, include_directories : includes, link_with : [libshared, - libudev, - libsystemd_internal], + libudev], dependencies : [threads, liblz4, libxz], @@ -1330,8 +1317,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 exe = executable('systemd-inhibit', 'src/login/inhibit.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1388,8 +1374,7 @@ public_programs += [exe] exe = executable('systemctl', 'src/systemctl/systemctl.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libcap, libselinux, @@ -1434,8 +1419,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 executable('systemd-cryptsetup', 'src/cryptsetup/cryptsetup.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [libcryptsetup], install_rpath : rootlibexecdir, install : true, @@ -1462,8 +1446,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 executable('systemd-veritysetup-generator', 'src/veritysetup/veritysetup-generator.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [libcryptsetup], install_rpath : rootlibexecdir, install : true, @@ -1500,8 +1483,7 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1 exe = executable('hostnamectl', 'src/hostname/hostnamectl.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1518,8 +1500,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 executable('systemd-localed', systemd_localed_sources, include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : deps, install_rpath : rootlibexecdir, install : true, @@ -1528,8 +1509,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1 exe = executable('localectl', localectl_sources, include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1539,8 +1519,7 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 executable('systemd-timedated', 'src/timedate/timedated.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1549,8 +1528,7 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1 'src/timedate/timedatectl.c', include_directories : includes, install_rpath : rootlibexecdir, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install : true) public_programs += [exe] endif @@ -1559,8 +1537,7 @@ if conf.get('ENABLE_TIMESYNCD', 0) == 1 executable('systemd-timesyncd', systemd_timesyncd_sources, include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libm], install_rpath : rootlibexecdir, @@ -1573,8 +1550,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 systemd_machined_sources, include_directories : includes, link_with : [libmachine_core, - libshared, - libsystemd_internal], + libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1582,8 +1558,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1 exe = executable('machinectl', 'src/machine/machinectl.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libxz, liblz4], @@ -1597,8 +1572,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1 executable('systemd-importd', systemd_importd_sources, include_directories : includes, - link_with : [libsystemd_internal, - libshared], + link_with : [libshared], dependencies : [threads], install_rpath : rootlibexecdir, install : true, @@ -1647,8 +1621,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 exe = executable('systemd-journal-upload', systemd_journal_upload_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], + link_with : [libshared], dependencies : [threads, libcurl, libgnutls, @@ -1664,8 +1637,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 s_j_remote = executable('systemd-journal-remote', systemd_journal_remote_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], + link_with : [libshared], dependencies : [threads, libmicrohttpd, libgnutls, @@ -1678,8 +1650,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 s_j_gatewayd = executable('systemd-journal-gatewayd', systemd_journal_gatewayd_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared], + link_with : [libshared], dependencies : [threads, libmicrohttpd, libgnutls, @@ -1695,9 +1666,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 executable('systemd-coredump', systemd_coredump_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared, - libsystemd], + link_with : [libshared], dependencies : [threads, libacl, libdw, @@ -1710,9 +1679,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1 exe = executable('coredumpctl', coredumpctl_sources, include_directories : includes, - link_with : [libsystemd_journal_internal, - libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads, libxz, liblz4], @@ -1783,8 +1750,7 @@ executable('systemd-machine-id-setup', 'src/core/machine-id-setup.c', 'src/core/machine-id-setup.h', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1792,8 +1758,7 @@ executable('systemd-machine-id-setup', executable('systemd-fsck', 'src/fsck/fsck.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1876,8 +1841,7 @@ executable('systemd-cgroups-agent', exe = executable('systemd-path', 'src/path/path.c', include_directories : includes, - link_with : [libsystemd_internal, - libshared], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1885,8 +1849,7 @@ public_programs += [exe] exe = executable('systemd-ask-password', 'src/ask-password/ask-password.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1895,8 +1858,7 @@ public_programs += [exe] executable('systemd-reply-password', 'src/reply-password/reply-password.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1904,8 +1866,7 @@ executable('systemd-reply-password', exe = executable('systemd-tty-ask-password-agent', 'src/tty-ask-password-agent/tty-ask-password-agent.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -1914,8 +1875,7 @@ public_programs += [exe] exe = executable('systemd-cgls', 'src/cgls/cgls.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1923,8 +1883,7 @@ public_programs += [exe] exe = executable('systemd-cgtop', 'src/cgtop/cgtop.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1932,8 +1891,7 @@ public_programs += [exe] executable('systemd-initctl', 'src/initctl/initctl.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -1942,7 +1900,6 @@ exe = executable('systemd-mount', 'src/mount/mount-tool.c', include_directories : includes, link_with : [libshared, - libsystemd_internal, libudev], install_rpath : rootlibexecdir, install : true) @@ -1954,8 +1911,7 @@ meson.add_install_script(meson_make_symlink, exe = executable('systemd-run', 'src/run/run.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1963,8 +1919,7 @@ public_programs += [exe] exe = executable('systemd-stdio-bridge', 'src/stdio-bridge/stdio-bridge.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -1974,8 +1929,7 @@ exe = executable('busctl', 'src/busctl/busctl-introspect.c', 'src/busctl/busctl-introspect.h', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true) public_programs += [exe] @@ -2008,8 +1962,7 @@ if conf.get('ENABLE_HWDB', 0) == 1 'src/hwdb/hwdb.c', 'src/libsystemd/sd-hwdb/hwdb-internal.h', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -2029,8 +1982,7 @@ endif exe = executable('systemd-socket-proxyd', 'src/socket-proxy/socket-proxyd.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [threads], install_rpath : rootlibexecdir, install : true, @@ -2043,11 +1995,11 @@ exe = executable('systemd-udevd', link_with : [libudev_core, libudev_internal, libsystemd_network, - libsystemd_internal, libshared], dependencies : [libkmod, libidn, - libacl], + libacl, + libblkid], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2059,11 +2011,11 @@ exe = executable('udevadm', link_with : [libudev_core, libudev_internal, libsystemd_network, - libshared, - libsystemd_internal], + libshared], dependencies : [libkmod, libidn, - libacl], + libacl, + libblkid], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) @@ -2089,8 +2041,7 @@ executable('systemd-update-done', executable('systemd-update-utmp', 'src/update-utmp/update-utmp.c', include_directories : includes, - link_with : [libshared, - libsystemd_internal], + link_with : [libshared], dependencies : [libaudit], install_rpath : rootlibexecdir, install : true, @@ -2121,8 +2072,7 @@ exe = executable('systemd-nspawn', include_directories : [includes, include_directories('src/nspawn')], link_with : [libfirewall, libshared, - libudev, - libsystemd_internal], + libudev], dependencies : [libacl, libblkid, libseccomp, @@ -2139,8 +2089,7 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 libfirewall, libsystemd_network, libudev_internal, - libshared, - libsystemd_internal], + libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2149,8 +2098,7 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 systemd_networkd_wait_online_sources, include_directories : includes, link_with : [libnetworkd_core, - libshared, - libsystemd_internal], + libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2160,8 +2108,7 @@ exe = executable('networkctl', networkctl_sources, include_directories : includes, link_with : [libsystemd_network, - libshared, - libsystemd_internal], + libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) diff --git a/src/journal/meson.build b/src/journal/meson.build index 360c52b92d..a1d33d0810 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -1,6 +1,6 @@ # -*- mode: meson -*- -libsystemd_journal_internal_sources = files(''' +journal_internal_sources = files(''' audit-type.c audit-type.h catalog.c @@ -45,20 +45,10 @@ audit_type_to_name = custom_target( command : [awk, '-f', '@INPUT0@', '@INPUT1@'], capture : true) -libsystemd_journal_internal_sources += [audit_type_to_name] +journal_internal_sources += [audit_type_to_name] ############################################################ -libsystemd_journal_internal = static_library( - 'systemd-journal-internal', - libsystemd_journal_internal_sources, - gcrypt_util_sources, - install : false, - include_directories : includes, - link_with : libbasic, - dependencies : [libaudit, - ]) - libjournal_core_sources = files(''' journald-kmsg.c journald-kmsg.h diff --git a/src/libudev/meson.build b/src/libudev/meson.build index f7bd62e3dd..6c5ebebb7c 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -1,6 +1,6 @@ # -*- mode: meson -*- -libudev_sources = ''' +libudev_sources = files(''' libudev-private.h libudev-device-internal.h libudev.c @@ -12,7 +12,7 @@ libudev_sources = ''' libudev-monitor.c libudev-queue.c libudev-hwdb.c -'''.split() +'''.split()) ############################################################ @@ -32,13 +32,6 @@ libudev = shared_library( install : true, install_dir : rootlibdir) -libudev_internal = static_library( - 'udev', - libudev_sources, - include_directories : includes, - link_with : [libbasic, - libsystemd]) - install_headers('libudev.h') libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir()) diff --git a/src/machine/meson.build b/src/machine/meson.build index de98246282..515defcb6c 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -41,8 +41,7 @@ endif tests += [ [['src/machine/test-machine-tables.c'], [libmachine_core, - libshared_static, - libsystemd_internal, + libshared, libudev], [threads], 'ENABLE_MACHINED'], diff --git a/src/network/meson.build b/src/network/meson.build index 4cde777292..1e8da8cfb7 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -128,7 +128,7 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 [libnetworkd_core, libudev_internal, libsystemd_network, - libsystemd_internal, + libshared, libfirewall], [libiptc]], @@ -139,7 +139,7 @@ if conf.get('ENABLE_NETWORKD', 0) == 1 libudev_internal, libudev_core, libsystemd_network, - libsystemd_internal, + libshared, libfirewall], [], '', '', [], diff --git a/src/resolve/meson.build b/src/resolve/meson.build index c06cc997ad..f0bbce49c4 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -149,7 +149,7 @@ tests += [ basic_dns_sources, dns_type_headers, 'src/shared/test-tables.h'], - [libshared], + [], [libgcrypt, libm], 'ENABLE_RESOLVED'], @@ -157,7 +157,7 @@ tests += [ [['src/resolve/test-dns-packet.c', basic_dns_sources, dns_type_headers], - [libshared], + [], [libgcrypt, libm], 'ENABLE_RESOLVED'], @@ -165,7 +165,7 @@ tests += [ [['src/resolve/test-dnssec.c', basic_dns_sources, dns_type_headers], - [libshared], + [], [libgcrypt, libm], 'ENABLE_RESOLVED'], @@ -173,8 +173,7 @@ tests += [ [['src/resolve/test-dnssec-complex.c', 'src/resolve/dns-type.c', dns_type_headers], - [libshared, - libsystemd_internal], + [], [], 'ENABLE_RESOLVED', 'manual'], ] diff --git a/src/shared/meson.build b/src/shared/meson.build index 3608575be4..4a51241d44 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -122,13 +122,12 @@ libshared = shared_library( libshared_name, shared_sources, basic_sources, + journal_internal_sources, + libsystemd_internal_sources, include_directories : includes, link_args : ['-shared'], c_args : ['-fvisibility=default'], - link_with : [libsystemd_journal_internal, - libsystemd_internal, - libudev, - ], + link_with : [libudev], dependencies : [threads, librt, libcap, @@ -140,7 +139,7 @@ libshared = shared_library( libidn, libxz, liblz4, - ], + libblkid], install : true, install_dir : rootlibexecdir) diff --git a/src/test/meson.build b/src/test/meson.build index 234fb77475..17fda96af0 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -39,7 +39,7 @@ test_libudev_sym_c = custom_target( tests += [ [['src/test/test-device-nodes.c'], - [libshared], + [], []], [['src/test/test-engine.c'], @@ -55,8 +55,8 @@ tests += [ [['src/test/test-job-type.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -66,8 +66,8 @@ tests += [ [['src/test/test-ns.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -78,8 +78,7 @@ tests += [ [['src/test/test-loopback.c'], [libcore, - libudev, - libsystemd_internal], + libshared], [threads, librt, libseccomp, @@ -89,8 +88,8 @@ tests += [ [['src/test/test-hostname.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -105,14 +104,14 @@ tests += [ []], [['src/test/test-boot-timestamps.c'], - [libshared], + [], [], 'ENABLE_EFI'], [['src/test/test-unit-name.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -122,8 +121,8 @@ tests += [ [['src/test/test-unit-file.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -132,19 +131,19 @@ tests += [ libblkid]], [['src/test/test-utf8.c'], - [libshared], + [], []], [['src/test/test-capability.c'], - [libshared], + [], [libcap]], [['src/test/test-async.c'], - [libshared], + [], []], [['src/test/test-locale-util.c'], - [libshared], + [], []], [['src/test/test-copy.c'], @@ -152,215 +151,214 @@ tests += [ []], [['src/test/test-sigbus.c'], - [libshared], + [], []], [['src/test/test-condition.c'], - [libsystemd_internal, - libshared], + [], []], [['src/test/test-fdset.c'], - [libshared], + [], []], [['src/test/test-fstab-util.c'], - [libshared], + [], []], [['src/test/test-ratelimit.c'], - [libshared], + [], []], [['src/test/test-util.c'], - [libshared], + [], []], [['src/test/test-mount-util.c'], - [libshared], + [], []], [['src/test/test-exec-util.c'], - [libshared], + [], []], [['src/test/test-hexdecoct.c'], - [libshared], + [], []], [['src/test/test-alloc-util.c'], - [libshared], + [], []], [['src/test/test-xattr-util.c'], - [libshared], + [], []], [['src/test/test-io-util.c'], - [libshared], + [], []], [['src/test/test-glob-util.c'], - [libshared], + [], []], [['src/test/test-fs-util.c'], - [libshared], + [], []], [['src/test/test-proc-cmdline.c'], - [libshared], + [], []], [['src/test/test-fd-util.c'], - [libshared], + [], []], [['src/test/test-web-util.c'], - [libshared], + [], []], [['src/test/test-cpu-set-util.c'], - [libshared], + [], []], [['src/test/test-stat-util.c'], - [libshared], + [], []], [['src/test/test-escape.c'], - [libshared], + [], []], [['src/test/test-string-util.c'], - [libshared], + [], []], [['src/test/test-extract-word.c'], - [libshared], + [], []], [['src/test/test-parse-util.c'], - [libshared], + [], []], [['src/test/test-user-util.c'], - [libshared], + [], []], [['src/test/test-hostname-util.c'], - [libshared], + [], []], [['src/test/test-process-util.c'], - [libshared], + [], []], [['src/test/test-terminal-util.c'], - [libshared], + [], []], [['src/test/test-path-lookup.c'], - [libshared], + [], []], [['src/test/test-uid-range.c'], - [libshared], + [], []], [['src/test/test-cap-list.c', generated_gperf_headers], - [libshared], + [], [libcap]], [['src/test/test-socket-util.c'], - [libshared], + [], []], [['src/test/test-barrier.c'], - [libshared], + [], []], [['src/test/test-tmpfiles.c'], - [libshared], + [], []], [['src/test/test-namespace.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, libblkid]], [['src/test/test-verbs.c'], - [libshared], + [], []], [['src/test/test-install-root.c'], - [libshared], + [], []], [['src/test/test-acl-util.c'], - [libshared], + [], [], 'HAVE_ACL'], [['src/test/test-seccomp.c'], - [libshared], + [], [libseccomp], 'HAVE_SECCOMP'], [['src/test/test-rlimit-util.c'], - [libshared], + [], []], [['src/test/test-ask-password-api.c'], - [libshared], + [], [], '', 'manual'], [['src/test/test-dissect-image.c'], - [libshared], + [], [libblkid], '', 'manual'], [['src/test/test-signal-util.c'], - [libshared], + [], []], [['src/test/test-selinux.c'], - [libshared], + [], []], [['src/test/test-sizeof.c'], - [], + [libbasic], []], [['src/test/test-hashmap.c', 'src/test/test-hashmap-plain.c', test_hashmap_ordered_c], - [libshared], + [], [], '', 'timeout=90'], [['src/test/test-set.c'], - [libshared], + [], []], [['src/test/test-bitmap.c'], - [libshared], + [], []], [['src/test/test-xml.c'], - [libshared], + [], []], [['src/test/test-list.c'], - [libshared], + [], []], [['src/test/test-unaligned.c'], - [libshared], + [], []], [['src/test/test-tables.c', @@ -372,45 +370,46 @@ tests += [ libudev_core, libudev_internal, libsystemd_network, - libsystemd_internal], + libshared], [threads, libseccomp, libmount, libxz, - liblz4], + liblz4, + libblkid], '', '', [], libudev_core_includes], [['src/test/test-prioq.c'], - [libshared], + [], []], [['src/test/test-fileio.c'], - [libshared], + [], []], [['src/test/test-time.c'], - [libshared], + [], []], [['src/test/test-clock.c'], - [libshared], + [], []], [['src/test/test-architecture.c'], - [libshared], + [], []], [['src/test/test-log.c'], - [libshared], + [], []], [['src/test/test-ipcrm.c'], - [libshared], + [], [], '', 'unsafe'], [['src/test/test-btrfs.c'], - [libshared], + [], [], '', 'manual'], @@ -422,49 +421,48 @@ tests += [ 'HAVE_LIBIPTC'], [['src/test/test-netlink-manual.c'], - [libshared, - libsystemd_internal], + [], [libkmod], 'HAVE_KMOD', 'manual'], [['src/test/test-ellipsize.c'], - [libshared], + [], []], [['src/test/test-date.c'], - [libshared], + [], []], [['src/test/test-sleep.c'], - [libshared], + [], []], [['src/test/test-replace-var.c'], - [libshared], + [], []], [['src/test/test-calendarspec.c'], - [libshared], + [], []], [['src/test/test-strip-tab-ansi.c'], - [libshared], + [], []], [['src/test/test-daemon.c'], - [libshared], + [], []], [['src/test/test-cgroup.c'], - [libshared], + [], [], '', 'manual'], [['src/test/test-cgroup-mask.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -473,29 +471,29 @@ tests += [ libblkid]], [['src/test/test-cgroup-util.c'], - [libshared], + [], []], [['src/test/test-env-util.c'], - [libshared], + [], []], [['src/test/test-strbuf.c'], - [libshared], + [], []], [['src/test/test-strv.c'], - [libshared], + [], []], [['src/test/test-path-util.c'], - [libshared], + [], []], [['src/test/test-path.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -505,8 +503,8 @@ tests += [ [['src/test/test-execute.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -515,27 +513,27 @@ tests += [ libblkid]], [['src/test/test-siphash24.c'], - [libshared], + [], []], [['src/test/test-strxcpyx.c'], - [libshared], + [], []], [['src/test/test-install.c'], [libcore, - libsystemd_internal], + libshared], [], '', 'manual'], [['src/test/test-watchdog.c'], - [libshared], + [], []], [['src/test/test-sched-prio.c'], [libcore, - libudev, - libsystemd_internal], + libshared, + libudev], [threads, librt, libseccomp, @@ -544,25 +542,25 @@ tests += [ libblkid]], [['src/test/test-conf-files.c'], - [libshared], + [], []], [['src/test/test-conf-parser.c'], - [libshared], + [], []], [['src/test/test-af-list.c', generated_gperf_headers], - [libshared], + [], []], [['src/test/test-arphrd-list.c', generated_gperf_headers], - [libshared], + [], []], [['src/test/test-journal-importer.c'], - [libshared], + [], []], [['src/test/test-libudev.c'], @@ -574,7 +572,6 @@ tests += [ [libudev_core, libudev_internal, libsystemd_network, - libsystemd_internal, libshared], [librt, libblkid, @@ -583,17 +580,15 @@ tests += [ '', 'manual'], [['src/test/test-id128.c'], - [libshared, - libsystemd_internal], + [], []], [['src/test/test-hash.c'], - [libshared], + [], []], [['src/test/test-nss.c'], - [libshared, - libsystemd_internal], + [], [libdl], '', 'manual'], ] @@ -623,7 +618,8 @@ tests += [ libudev], [threads, libxz, - liblz4]], + liblz4, + libselinux]], [['src/journal/test-journal-match.c'], [libjournal_core, @@ -713,8 +709,7 @@ tests += [ tests += [ [['src/libsystemd/sd-bus/test-bus-marshal.c'], - [libsystemd_internal, - libshared], + [], [threads, libglib, libgobject, @@ -722,18 +717,15 @@ tests += [ libdbus]], [['src/libsystemd/sd-bus/test-bus-signature.c'], - [libshared_static, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-bus/test-bus-chat.c'], - [libshared_static, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-bus/test-bus-cleanup.c'], - [libshared_static, - libsystemd_internal], + [], [threads, libseccomp]], @@ -747,55 +739,45 @@ tests += [ [libseccomp]], [['src/libsystemd/sd-bus/test-bus-server.c'], - [libshared_static, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-bus/test-bus-objects.c'], - [libshared_static, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-bus/test-bus-gvariant.c'], - [libshared, - libsystemd_internal], + [], [libglib, libgobject, libgio]], [['src/libsystemd/sd-bus/test-bus-creds.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-bus/test-bus-match.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-bus/test-bus-kernel.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-bus/test-bus-benchmark.c'], - [libshared, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-bus/test-bus-introspect.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-event/test-event.c'], @@ -803,23 +785,19 @@ tests += [ []], [['src/libsystemd/sd-netlink/test-netlink.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-netlink/test-local-addresses.c'], - [libshared, - libsystemd_internal], + [], []], [['src/libsystemd/sd-resolve/test-resolve.c'], - [libshared, - libsystemd_internal], + [], [threads]], [['src/libsystemd/sd-login/test-login.c'], - [libshared, - libsystemd], + [], [], '', 'manual'], ] @@ -858,16 +836,14 @@ tests += [ [['src/libsystemd-network/test-ipv4ll-manual.c', 'src/systemd/sd-ipv4ll.h'], [libshared, - libsystemd_network, - libsystemd_internal], + libsystemd_network], [], '', 'manual'], [['src/libsystemd-network/test-acd.c', 'src/systemd/sd-ipv4acd.h'], [libshared, - libsystemd_network, - libsystemd_internal], + libsystemd_network], [], '', 'manual'], @@ -902,18 +878,17 @@ tests += [ tests += [ [['src/login/test-login-shared.c'], - [libshared], + [], []], [['src/login/test-inhibit.c'], - [libshared], + [], [], '', 'manual'], [['src/login/test-login-tables.c'], [liblogind_core, - libsystemd_internal, - libudev, - libshared], + libshared, + libudev], [threads]], ] diff --git a/src/udev/meson.build b/src/udev/meson.build index 19dc522172..e7feaedb4f 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -92,6 +92,12 @@ link_config_gperf_c = custom_target( ############################################################ +libudev_internal = static_library( + 'udev', + libudev_sources, + include_directories : includes, + link_with : [libshared]) + libudev_core_includes = [includes, include_directories('net')] libudev_core = static_library( 'udev-core', @@ -105,8 +111,7 @@ executable('ata_id', 'ata_id/ata_id.c', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) @@ -114,8 +119,7 @@ executable('cdrom_id', 'cdrom_id/cdrom_id.c', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) @@ -123,8 +127,7 @@ executable('collect', 'collect/collect.c', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) @@ -135,8 +138,7 @@ executable('scsi_id', 'scsi_id/scsi.h', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) @@ -144,8 +146,7 @@ executable('v4l_id', 'v4l_id/v4l_id.c', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) @@ -155,8 +156,7 @@ executable('mtd_probe', 'mtd_probe/probe_smartmedia.c', include_directories : includes, link_with : [libudev_internal, - libshared, - libsystemd_internal], + libshared], install : true, install_dir : udevlibexecdir) From 3762b6722e24c17dccf1ec7d352b403469398ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 14 Apr 2017 19:49:15 -0400 Subject: [PATCH 46/82] test-nss: fix loading of modules under meson There is no .libs dirs under meson. Just try both paths. --- src/test/test-nss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/test-nss.c b/src/test/test-nss.c index b59cb7aa69..b4cb3f0d37 100644 --- a/src/test/test-nss.c +++ b/src/test/test-nss.c @@ -71,9 +71,11 @@ static void* open_handle(const char* dir, const char* module, int flags) { const char *path; void *handle; - if (dir) - path = strjoina(dir, "/.libs/libnss_", module, ".so.2"); - else + if (dir) { + path = strjoina(dir, "/libnss_", module, ".so.2"); + if (access(path, F_OK) < 0) + path = strjoina(dir, "/.libs/libnss_", module, ".so.2"); + } else path = strjoina("libnss_", module, ".so.2"); handle = dlopen(path, flags); From 83b6af36d1ea1d1250ad2836c00193021e908cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 14 Apr 2017 20:10:28 -0400 Subject: [PATCH 47/82] meson: add test-dlopen test-dlopen is a very simple binary that is only linked with libc and libdl. From it we do dlopen() on the nss and pam modules to check that they are linked to all necessary libs. (meson-compiled nss modules are linked to less libraries, for whatever reason. I suspected that some deps are missing, but it turns out that my suspicions weren't justified, and the modules load just fine. Let's keep the test though, it is very quick, and might detect missing linkage in the future.) --- meson.build | 99 +++++++++++++++++++++++++----------------- src/test/meson.build | 2 + src/test/test-dlopen.c | 32 ++++++++++++++ 3 files changed, 93 insertions(+), 40 deletions(-) create mode 100644 src/test/test-dlopen.c diff --git a/meson.build b/meson.build index 2b719ec257..86a04a70ed 100644 --- a/meson.build +++ b/meson.build @@ -1046,45 +1046,6 @@ libsystemd = shared_library( ############################################################ -foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], - ['systemd', '', []], - ['mymachines', 'ENABLE_MACHINED', []], - ['resolve', 'ENABLE_RESOLVED', [libdl]]] - - condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 - if condition - module = tuple[0] - extra_deps = tuple[2] - - sym = 'src/nss-@0@/nss-@0@.sym'.format(module) - version_script_arg = join_paths(meson.current_source_dir(), sym) - - shared_library( - 'nss_' + module, - 'src/nss-@0@/nss-@0@.c'.format(module), - version : '2', - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + version_script_arg, - '-Wl,--undefined'], - link_with : [libsystemd_internal, - libbasic], - dependencies : [threads, - librt] + extra_deps, - link_depends : sym, - install : true, - install_dir : rootlibdir) - - # We cannot use shared_module because it does not support version suffix. - # Unfortunately shared_library insists on creating the symlink… - meson.add_install_script('sh', '-c', - 'rm $DESTDIR@0@/libnss_@1@.so' - .format(rootlibdir, module)) - endif -endforeach - -############################################################ - # binaries that have --help and are intended for use by humans, # usually, but not always, installed in /bin. public_programs = [] @@ -1114,6 +1075,60 @@ subdir('src/boot/efi') subdir('src/test') subdir('test') +############################################################ + +# only static linking apart from libdl, to make sure that the +# module is linked to all libraries that it uses. +test_dlopen = executable( + 'test-dlopen', + test_dlopen_c, + include_directories : includes, + link_with : [libbasic], + dependencies : [libdl]) + +foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], + ['systemd', '', []], + ['mymachines', 'ENABLE_MACHINED', []], + ['resolve', 'ENABLE_RESOLVED', [libdl]]] + + condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 + if condition + module = tuple[0] + extra_deps = tuple[2] + + sym = 'src/nss-@0@/nss-@0@.sym'.format(module) + version_script_arg = join_paths(meson.current_source_dir(), sym) + + nss = shared_library( + 'nss_' + module, + 'src/nss-@0@/nss-@0@.c'.format(module), + version : '2', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + version_script_arg, + '-Wl,--undefined'], + link_with : [libsystemd_internal, + libbasic], + dependencies : [threads, + librt] + extra_deps, + link_depends : sym, + install : true, + install_dir : rootlibdir) + + # We cannot use shared_module because it does not support version suffix. + # Unfortunately shared_library insists on creating the symlink… + meson.add_install_script('sh', '-c', + 'rm $DESTDIR@0@/libnss_@1@.so' + .format(rootlibdir, module)) + + test('dlopen-nss_' + module, + test_dlopen, + args : [nss.full_path()]) # path to dlopen must include a slash + endif +endforeach + +############################################################ + executable('systemd', systemd_sources, include_directories : includes, @@ -1325,7 +1340,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1 if conf.get('HAVE_PAM', 0) == 1 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) - shared_library( + pam_systemd = shared_library( 'pam_systemd', pam_systemd_c, name_prefix : '', @@ -1340,6 +1355,10 @@ if conf.get('ENABLE_LOGIND', 0) == 1 link_depends : pam_systemd_sym, install : true, install_dir : pamlibdir) + + test('dlopen-pam_systemd', + test_dlopen, + args : [pam_systemd.full_path()]) # path to dlopen must include a slash endif endif diff --git a/src/test/meson.build b/src/test/meson.build index 17fda96af0..59a51d857e 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -35,6 +35,8 @@ test_libudev_sym_c = custom_target( command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'], capture : true) +test_dlopen_c = files('test-dlopen.c') + ############################################################ tests += [ diff --git a/src/test/test-dlopen.c b/src/test/test-dlopen.c new file mode 100644 index 0000000000..9f5343a7ea --- /dev/null +++ b/src/test/test-dlopen.c @@ -0,0 +1,32 @@ +/*** + This file is part of systemd. + + Copyright 2016 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include "macro.h" + +int main(int argc, char **argv) { + void *handle; + + assert_se((handle = dlopen(argv[1], RTLD_NOW))); + assert_se(dlclose(handle) == 0); + + return EXIT_SUCCESS; +} From f75d75eb66308aed2e199ab82fdc2a99170e015c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 15 Apr 2017 00:07:57 -0400 Subject: [PATCH 48/82] meson: add man/doc-sync target Seems to work OK. It would be nicer to call it 'doc-sync' not 'man/doc-sync', but OK. --- man/meson.build | 28 ++++++++++++++++++++-------- meson_options.txt | 3 +++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/man/meson.build b/man/meson.build index 6efec40695..9d8d1a9922 100644 --- a/man/meson.build +++ b/man/meson.build @@ -133,12 +133,24 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], html_pages += [p2] endforeach -custom_target('man', - depends : man_pages, - output : ['man'], - command : ['echo']) +man = custom_target('man', + depends : man_pages, + output : 'man', + command : ['echo']) -custom_target('html', - depends : html_pages, - output : ['html'], - command : ['echo']) +html = custom_target('html', + depends : html_pages, + output : 'html', + command : ['echo']) + +custom_target('doc-sync', + depends : [man, html], + output : ['doc-sync'], + command : ['rsync', '-rlv', + '--delete-excluded', + '--include=man', + '--include=*.html', + '--exclude=*', + '--omit-dir-times', + meson.current_build_dir(), + get_option('www-target')]) diff --git a/meson_options.txt b/meson_options.txt index 005fd0e992..9caf9a329f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -154,6 +154,9 @@ option('ntp-servers', type : 'string', option('support-url', type : 'string', description : 'the support URL to show in catalog entries included in systemd', value : 'https://lists.freedesktop.org/mailman/listinfo/systemd-devel') +option('www-target', type : 'string', + description : 'the address and dir to upload docs too', + value : 'www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd') option('seccomp', type : 'combo', choices : ['auto', 'true', 'false'], description : 'SECCOMP support') From 177929c2363d86ee17814f00d27e0dca4e327b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 15 Apr 2017 00:16:23 -0400 Subject: [PATCH 49/82] meson: add git-contrib target --- meson.build | 8 ++++++++ tools/meson-git-contrib.sh | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 tools/meson-git-contrib.sh diff --git a/meson.build b/meson.build index 86a04a70ed..035e2f0424 100644 --- a/meson.build +++ b/meson.build @@ -2269,3 +2269,11 @@ if git.found() and etags.found() input : all_files, command : [etags, '-o', '@OUTPUT@'] + all_files) endif + +if git.found() + meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') + custom_target( + 'git-contrib', + output : 'git-contrib', + command : [meson_git_contrib_sh]) +endif diff --git a/tools/meson-git-contrib.sh b/tools/meson-git-contrib.sh new file mode 100644 index 0000000000..c9d3775bcf --- /dev/null +++ b/tools/meson-git-contrib.sh @@ -0,0 +1,7 @@ +#!/bin/sh -e + +git shortlog -s `git describe --abbrev=0`.. | \ + cut -c8- | \ + sed 's/ / /g' | \ + awk '{ print $$0 "," }' | \ + sort -u From abba22c51c44871395316a73cf0e69106eeb94a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 15 Apr 2017 00:40:59 -0400 Subject: [PATCH 50/82] meson: add hwdb/update target --- Makefile.am | 14 ++------------ hwdb/meson.build | 7 +++++++ meson.build | 1 + tools/meson-hwdb-update.sh | 13 +++++++++++++ 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100755 tools/meson-hwdb-update.sh diff --git a/Makefile.am b/Makefile.am index e362060326..18f4accb4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6602,18 +6602,8 @@ dist-check-includes: $(public_headers) done; exit $$res .PHONY: hwdb-update -hwdb-update: - ( cd $(top_srcdir)/hwdb && \ - wget -O usb.ids 'http://www.linux-usb.org/usb.ids' && \ - wget -O pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' && \ - wget -O ma-large.txt 'http://standards.ieee.org/develop/regauth/oui/oui.txt' && \ - wget -O ma-medium.txt 'http://standards.ieee.org/develop/regauth/oui28/mam.txt' && \ - wget -O ma-small.txt 'http://standards.ieee.org/develop/regauth/oui36/oui36.txt' && \ - wget -O pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export' && \ - wget -O acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export' && \ - ./ids-update.pl && \ - ./acpi-update.py > 20-acpi-vendor.hwdb.base && \ - patch -p0 -o- 20-acpi-vendor.hwdb.base < 20-acpi-vendor.hwdb.patch > 20-acpi-vendor.hwdb ) +hwdb-update: tools/meson-hwdb-update.sh + $< $(top_srcdir)/hwdb .PHONY: built-sources built-sources: $(BUILT_SOURCES) diff --git a/hwdb/meson.build b/hwdb/meson.build index cbc9016652..4498d5e08b 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -26,3 +26,10 @@ if conf.get('ENABLE_HWDB', 0) == 1 meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d'))) endif + +############################################################ + +custom_target( + 'update', + output : 'update', + command : [hwdb_update_sh, meson.current_source_dir()]) diff --git a/meson.build b/meson.build index 035e2f0424..b752634c88 100644 --- a/meson.build +++ b/meson.build @@ -2205,6 +2205,7 @@ test('test-libudev-sym', make_directive_index_py = find_program('tools/make-directive-index.py') make_man_index_py = find_program('tools/make-man-index.py') xml_helper_py = find_program('tools/xml_helper.py') +hwdb_update_sh = find_program('tools/meson-hwdb-update.sh') subdir('units') subdir('sysctl.d') diff --git a/tools/meson-hwdb-update.sh b/tools/meson-hwdb-update.sh new file mode 100755 index 0000000000..339ebb9ace --- /dev/null +++ b/tools/meson-hwdb-update.sh @@ -0,0 +1,13 @@ +#!/bin/sh -ex + +cd "$1" +wget -O usb.ids 'http://www.linux-usb.org/usb.ids' +wget -O pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' +wget -O ma-large.txt 'http://standards.ieee.org/develop/regauth/oui/oui.txt' +wget -O ma-medium.txt 'http://standards.ieee.org/develop/regauth/oui28/mam.txt' +wget -O ma-small.txt 'http://standards.ieee.org/develop/regauth/oui36/oui36.txt' +wget -O pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export' +wget -O acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export' +./ids-update.pl +./acpi-update.py > 20-acpi-vendor.hwdb.base +patch -p0 -o- 20-acpi-vendor.hwdb.base <20-acpi-vendor.hwdb.patch >20-acpi-vendor.hwdb From f6e49d4e52dbd8f67e76689103a59d524423cbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 15 Apr 2017 00:56:05 -0400 Subject: [PATCH 51/82] meson: add journal-install and hwdb-update hooks v2: - ignore errors in chown/chmod/setfacl - obey -Dadm-group=false, -Dwheel-group=false - fix reversed condition for systemd-hwdb update hook --- hwdb/meson.build | 4 ++++ src/journal-remote/meson.build | 4 ++-- src/journal/meson.build | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hwdb/meson.build b/hwdb/meson.build index 4498d5e08b..1e859fd20d 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -25,6 +25,10 @@ if conf.get('ENABLE_HWDB', 0) == 1 meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d'))) + + meson.add_install_script('sh', '-c', + 'test -n "$DESTDIR" || @0@/systemd-hwdb update' + .format(rootbindir)) endif ############################################################ diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index 35342755d3..c182e7c477 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -47,5 +47,5 @@ install_data('browse.html', meson.add_install_script('sh', '-c', mkdir_p.format('/var/log/journal/remote')) meson.add_install_script('sh', '-c', - '''chown 0:0 $DESTDIR/var/log/journal/remote; - chmod 755 $DESTDIR/var/log/journal/remote''') + 'chown 0:0 $DESTDIR/var/log/journal/remote && + chmod 755 $DESTDIR/var/log/journal/remote || :') diff --git a/src/journal/meson.build b/src/journal/meson.build index a1d33d0810..2457bc7234 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -93,3 +93,17 @@ endif install_data('journald.conf', install_dir : pkgsysconfdir) + +meson.add_install_script('sh', '-c', + mkdir_p.format('/var/log/journal')) +meson.add_install_script('sh', '-c', + 'chown 0:0 $DESTDIR/var/log/journal && + chmod 755 $DESTDIR/var/log/journal || :') +if get_option('adm-group') + meson.add_install_script('sh', '-c', + 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') +endif +if get_option('wheel-group') + meson.add_install_script('sh', '-c', + 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') +endif From 734005fe75777b5784033ee9ccbed6acd414b30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Apr 2017 17:28:14 -0400 Subject: [PATCH 52/82] hwdb: use curl instead of wget, and regenerate patch after successful update libcurl is already our build dependency, so using curl reduces the deps a bit, and curl also has a more modern codebase. Regenerating the patch makes it more likely that the patch will apply in the future. Also, update URLs which return 302 to the new location. (Patch suggested by Igor Gnatenko.) --- tools/meson-hwdb-update.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/meson-hwdb-update.sh b/tools/meson-hwdb-update.sh index 339ebb9ace..f97e65c9af 100755 --- a/tools/meson-hwdb-update.sh +++ b/tools/meson-hwdb-update.sh @@ -1,13 +1,15 @@ #!/bin/sh -ex cd "$1" -wget -O usb.ids 'http://www.linux-usb.org/usb.ids' -wget -O pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' -wget -O ma-large.txt 'http://standards.ieee.org/develop/regauth/oui/oui.txt' -wget -O ma-medium.txt 'http://standards.ieee.org/develop/regauth/oui28/mam.txt' -wget -O ma-small.txt 'http://standards.ieee.org/develop/regauth/oui36/oui36.txt' -wget -O pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export' -wget -O acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export' + +curl -L -o usb.ids 'http://www.linux-usb.org/usb.ids' +curl -L -o pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' +curl -L -o ma-large.txt 'http://standards-oui.ieee.org/oui/oui.txt' +curl -L -o ma-medium.txt 'http://standards-oui.ieee.org/oui28/mam.txt' +curl -L -o ma-small.txt 'http://standards-oui.ieee.org/oui36/oui36.txt' +curl -L -o pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export' +curl -L -o acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export' ./ids-update.pl ./acpi-update.py > 20-acpi-vendor.hwdb.base patch -p0 -o- 20-acpi-vendor.hwdb.base <20-acpi-vendor.hwdb.patch >20-acpi-vendor.hwdb +diff -u 20-acpi-vendor.hwdb.base 20-acpi-vendor.hwdb >20-acpi-vendor.hwdb.patch From fdd147a88e888e14fbd86b522998a8a566d09fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 15 Apr 2017 22:50:56 -0400 Subject: [PATCH 53/82] meson: add dist-check-includes replacement This is more-or-less the same as dist-check-includes. meson doesn't exactly make it easy to call a compiler with a custom set of options. The tests are included in the test listing. --- meson.build | 1 + src/systemd/meson.build | 25 +++++++++++++++++++++++-- tools/meson-check-compilation.sh | 3 +++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 tools/meson-check-compilation.sh diff --git a/meson.build b/meson.build index b752634c88..88f2523f43 100644 --- a/meson.build +++ b/meson.build @@ -409,6 +409,7 @@ etags = find_program('etags', required : false) meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' mkdir_p = 'mkdir -p $DESTDIR/@0@' +check_compilation_sh = find_program('tools/meson-check-compilation.sh') # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. diff --git a/src/systemd/meson.build b/src/systemd/meson.build index c7d7d50963..f3b969bb2b 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -1,6 +1,6 @@ # -*- mode: meson -*- -systemd_headers = files(''' +_systemd_headers = ''' sd-bus.h sd-bus-protocol.h sd-bus-vtable.h @@ -10,7 +10,10 @@ systemd_headers = files(''' sd-journal.h sd-login.h sd-messages.h -'''.split()) +'''.split() + +# https://github.com/mesonbuild/meson/issues/1633 +systemd_headers = files(_systemd_headers) # sd-device.h # sd-hwdb.h @@ -33,3 +36,21 @@ install_headers( systemd_headers, '_sd-common.h', subdir : 'systemd') + + +############################################################ + +opts = [[], + ['-ansi'], + ['-std=iso9899:1990']] + +foreach header : _systemd_headers + foreach opt : opts + name = ''.join([header] + opt) + test('cc-' + name, + check_compilation_sh, + args : cc.cmd_array() + ['-x', 'c'] + opt + + ['-Werror', '-include', + join_paths(meson.current_source_dir(), header)]) + endforeach +endforeach diff --git a/tools/meson-check-compilation.sh b/tools/meson-check-compilation.sh new file mode 100644 index 0000000000..9bbe54669b --- /dev/null +++ b/tools/meson-check-compilation.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e + +"$@" '-' '-c' -o/dev/null Date: Sun, 16 Apr 2017 12:04:46 -0400 Subject: [PATCH 54/82] test-efi-create-disk.sh: allow running from separate build dir, hook up to meson This allow test-efi-disk.img to be created under meson. The invocation of qemu is not converted yet, in particular because the command-line used in Makefile.am is outdated. --- Makefile.am | 4 ++-- meson.build | 2 ++ src/boot/efi/meson.build | 15 ++++++++++++++- test/test-efi-create-disk.sh | 24 ++++++++++++++++-------- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 18f4accb4f..ea5883bf01 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3077,8 +3077,8 @@ CLEANFILES += $(stub_objects) $(stub_solib) $(stub) # ------------------------------------------------------------------------------ CLEANFILES += test-efi-disk.img -test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh - $(AM_V_GEN)test/test-efi-create-disk.sh +test-efi-disk.img: $(systemd_boot) $(stub) test/splash.bmp test/test-efi-create-disk.sh + $(AM_V_GEN)test/test-efi-create-disk.sh $@ $(systemd_boot) $(stub) test/splash.bmp test-efi: test-efi-disk.img $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img diff --git a/meson.build b/meson.build index 88f2523f43..6fca0b0932 100644 --- a/meson.build +++ b/meson.build @@ -410,6 +410,8 @@ etags = find_program('etags', required : false) meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' mkdir_p = 'mkdir -p $DESTDIR/@0@' check_compilation_sh = find_program('tools/meson-check-compilation.sh') +test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh') +splash_bmp = files('test/splash.bmp') # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 69c7405983..2a69bc5c25 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -158,7 +158,7 @@ if have_gnu_efi no_undefined_symbols, args : [so]) - custom_target( + stub = custom_target( tuple[1], input : so, output : tuple[1], @@ -175,5 +175,18 @@ if have_gnu_efi ['@INPUT@', '@OUTPUT@'], install : true, install_dir : bootlibdir) + + set_variable(tuple[0].underscorify(), so) + set_variable(tuple[0].underscorify() + '_stub', stub) endforeach endif + +############################################################ + +if have_gnu_efi + test_efi_disk_img = custom_target( + 'test-efi-disk.img', + input : [systemd_boot_so, stub_so_stub], + output : 'test-efi-disk.img', + command : [test_efi_create_disk_sh, '@OUTPUT@', '@INPUT0@', '@INPUT1@', splash_bmp]) +endif diff --git a/test/test-efi-create-disk.sh b/test/test-efi-create-disk.sh index cd4699dc18..d3a8b5f8ed 100755 --- a/test/test-efi-create-disk.sh +++ b/test/test-efi-create-disk.sh @@ -1,30 +1,38 @@ #!/bin/bash -e +out="$1" +systemd_efi="$2" +boot_stub="$3" +splash_bmp="$4" +if [ -z "$out" -o -z "$systemd_efi" -o -z "$boot_stub" -o -z "$splash_bmp" ]; then + exit 1 +fi + # create GPT table with EFI System Partition -rm -f test-efi-disk.img -dd if=/dev/null of=test-efi-disk.img bs=1M seek=512 count=1 -parted --script test-efi-disk.img "mklabel gpt" "mkpart ESP fat32 1MiB 511MiB" "set 1 boot on" +rm -f "$out" +dd if=/dev/null of="$out" bs=1M seek=512 count=1 status=none +parted --script "$out" "mklabel gpt" "mkpart ESP fat32 1MiB 511MiB" "set 1 boot on" # create FAT32 file system -LOOP=$(losetup --show -f -P test-efi-disk.img) +LOOP=$(losetup --show -f -P "$out") mkfs.vfat -F32 ${LOOP}p1 mkdir -p mnt mount ${LOOP}p1 mnt mkdir -p mnt/EFI/{BOOT,systemd} -cp systemd-bootx64.efi mnt/EFI/BOOT/BOOTX64.efi +cp "$systemd_efi" mnt/EFI/BOOT/BOOTX64.efi [ -e /boot/shellx64.efi ] && cp /boot/shellx64.efi mnt/ mkdir mnt/EFI/Linux -echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" > mnt/cmdline.txt +echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt objcopy \ --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \ - --add-section .splash=test/splash.bmp --change-section-vma .splash=0x40000 \ + --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \ --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \ --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \ - linuxx64.efi.stub mnt/EFI/Linux/linux-test.efi + "$boot_stub" mnt/EFI/Linux/linux-test.efi # install entries mkdir -p mnt/loader/entries From 3a30f21ff8ddbef5eae61d6e4305ec1cd2e4e041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Apr 2017 12:07:12 -0400 Subject: [PATCH 55/82] meson: allow optional static linking of shared code in udev helpers This makes the helper binaries significantly bigger (in some cases, the final size depends on link options and optimization level), and is only useful for distributions which want to provide the option to install udev without systemd. As the linking is improved, the difference between the columns might shrink, but it's unlikely that linking libshared statically could ever be more efficient. E.g. with -O0, no -flto: (static) (shared) src/udev/ata_id 999176 85696 src/udev/cdrom_id 1024344 111656 src/udev/collect 990344 81280 src/udev/scsi_id 1023592 115656 src/udev/v4l_id 811736 17744 When linked dynamically, install_rpath must be specified, so add that. --- meson.build | 6 ++-- meson_options.txt | 2 ++ src/test/meson.build | 3 +- src/udev/meson.build | 83 ++++++++++++++++---------------------------- 4 files changed, 38 insertions(+), 56 deletions(-) diff --git a/meson.build b/meson.build index 6fca0b0932..9504e984ec 100644 --- a/meson.build +++ b/meson.build @@ -2018,7 +2018,8 @@ exe = executable('systemd-udevd', libudev_internal, libsystemd_network, libshared], - dependencies : [libkmod, + dependencies : [threads, + libkmod, libidn, libacl, libblkid], @@ -2034,7 +2035,8 @@ exe = executable('udevadm', libudev_internal, libsystemd_network, libshared], - dependencies : [libkmod, + dependencies : [threads, + libkmod, libidn, libacl, libblkid], diff --git a/meson_options.txt b/meson_options.txt index 9caf9a329f..132c05ab56 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,8 @@ option('rootlibdir', type : 'string', description : '''[/usr]/lib/x86_64-linux-gnu or such''') option('rootprefix', type : 'string', description : '''override the root prefix''') +option('link-udev-shared', type : 'boolean', + description : 'link systemd-udev and its helpers to libsystemd-shared.so') option('sysvinit-path', type : 'string', value : '/etc/init.d', description : 'the directory where the SysV init scripts are located') diff --git a/src/test/meson.build b/src/test/meson.build index 59a51d857e..0014fed79b 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -575,7 +575,8 @@ tests += [ libudev_internal, libsystemd_network, libshared], - [librt, + [threads, + librt, libblkid, libkmod, libacl], diff --git a/src/udev/meson.build b/src/udev/meson.build index e7feaedb4f..1eac8754eb 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -92,11 +92,20 @@ link_config_gperf_c = custom_target( ############################################################ +if get_option('link-udev-shared') + libudev_link_with = [libshared] + rpath = rootlibexecdir +else + libudev_link_with = [libshared_static, + libsystemd_internal] + rpath = '' +endif + libudev_internal = static_library( 'udev', libudev_sources, include_directories : includes, - link_with : [libshared]) + link_with : libudev_link_with) libudev_core_includes = [includes, include_directories('net')] libudev_core = static_library( @@ -105,60 +114,28 @@ libudev_core = static_library( link_config_gperf_c, keyboard_keys_from_name_h, include_directories : libudev_core_includes, - link_with : [libshared]) + link_with : libudev_link_with) -executable('ata_id', - 'ata_id/ata_id.c', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) +foreach prog : [['ata_id/ata_id.c'], + ['cdrom_id/cdrom_id.c'], + ['collect/collect.c'], + ['scsi_id/scsi_id.c', + 'scsi_id/scsi_id.h', + 'scsi_id/scsi_serial.c', + 'scsi_id/scsi.h'], + ['v4l_id/v4l_id.c'], + ['mtd_probe/mtd_probe.c', + 'mtd_probe/mtd_probe.h', + 'mtd_probe/probe_smartmedia.c']] -executable('cdrom_id', - 'cdrom_id/cdrom_id.c', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) - -executable('collect', - 'collect/collect.c', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) - -executable('scsi_id', - 'scsi_id/scsi_id.c', - 'scsi_id/scsi_id.h', - 'scsi_id/scsi_serial.c', - 'scsi_id/scsi.h', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) - -executable('v4l_id', - 'v4l_id/v4l_id.c', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) - -executable('mtd_probe', - 'mtd_probe/mtd_probe.c', - 'mtd_probe/mtd_probe.h', - 'mtd_probe/probe_smartmedia.c', - include_directories : includes, - link_with : [libudev_internal, - libshared], - install : true, - install_dir : udevlibexecdir) + executable(prog[0].split('/')[0], + prog, + include_directories : includes, + link_with : [libudev_internal], + install_rpath : rpath, + install : true, + install_dir : udevlibexecdir) +endforeach install_data('udev.conf', install_dir : join_paths(sysconfdir, 'udev')) From 0a76b0e8a2043936b6dd598a7a3f924bd683eec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Apr 2017 13:22:28 -0400 Subject: [PATCH 56/82] meson: use efi-includedir to look for header This change mirrors cba49f2deab481045408d5452ac8c84fc03bccd5. --- src/boot/efi/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 2a69bc5c25..059cc7be31 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -32,7 +32,8 @@ if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'false' efi_cc = get_option('efi-cc') efi_ld = get_option('efi-ld') - efibind_h = 'efi/@0@/efibind.h'.format(efi_arch) + efi_incdir = get_option('efi-includedir') + efibind_h = '@0@/@1@/efibind.h'.format(efi_incdir, efi_arch) have_header = cc.has_header(efibind_h) if have_header and EFI_MACHINE_TYPE_NAME == '' @@ -73,8 +74,6 @@ if have_gnu_efi efi_ldsdir = join_paths(efi_libdir, 'gnuefi') endif - efi_incdir = get_option('efi-includedir') - message('efi-libdir: "@0@"'.format(efi_libdir)) message('efi-ldsdir: "@0@"'.format(efi_ldsdir)) message('efi-includedir: "@0@"'.format(efi_incdir)) From 37efbbd8211bd40e2d1f1732e27bd7d3ca504a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Apr 2017 19:25:00 -0400 Subject: [PATCH 57/82] meson: reindent all files with 8 spaces The indentation for emacs'es meson-mode is added .dir-locals. All files are reindented automatically, using the lasest meson-mode from git. Indentation should now be fairly consistent. --- .dir-locals.el | 3 +- catalog/meson.build | 40 +- docs/sysvinit/meson.build | 8 +- docs/var-log/meson.build | 8 +- hwdb/meson.build | 54 +- man/meson.build | 165 ++- meson.build | 1788 ++++++++++++++-------------- network/meson.build | 14 +- po/meson.build | 2 - rules/meson.build | 56 +- shell-completion/bash/meson.build | 84 +- shell-completion/zsh/meson.build | 78 +- src/analyze/meson.build | 8 +- src/basic/meson.build | 498 ++++---- src/boot/efi/meson.build | 299 ++--- src/core/meson.build | 352 +++--- src/coredump/meson.build | 26 +- src/hostname/meson.build | 16 +- src/import/meson.build | 120 +- src/journal-remote/meson.build | 54 +- src/journal/meson.build | 136 +-- src/kernel-install/meson.build | 2 - src/libsystemd-network/meson.build | 82 +- src/libsystemd/meson.build | 170 ++- src/libudev/meson.build | 54 +- src/locale/meson.build | 42 +- src/login/meson.build | 154 ++- src/machine/meson.build | 68 +- src/network/meson.build | 202 ++-- src/nspawn/meson.build | 66 +- src/resolve/meson.build | 276 +++-- src/shared/meson.build | 296 +++-- src/sulogin-shell/meson.build | 8 +- src/systemd/meson.build | 42 +- src/test/meson.build | 1664 +++++++++++++------------- src/timedate/meson.build | 24 +- src/timesync/meson.build | 36 +- src/udev/meson.build | 168 ++- src/vconsole/meson.build | 14 +- sysctl.d/meson.build | 20 +- sysusers.d/meson.build | 36 +- test/meson.build | 314 ++--- tmpfiles.d/meson.build | 39 +- units/meson.build | 564 ++++----- units/user/meson.build | 51 +- 45 files changed, 4063 insertions(+), 4138 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 3e1b2d76c0..9dfdbe3fe2 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -20,4 +20,5 @@ (eval . (c-set-offset 'arglist-intro '++)) (eval . (c-set-offset 'arglist-close 0)))) (nxml-mode . ((nxml-child-indent . 2) - (fill-column . 119)))) + (fill-column . 119))) + (meson-mode . ((meson-indent-basic . 8)))) diff --git a/catalog/meson.build b/catalog/meson.build index 0ac48f69c3..6d205b1d42 100644 --- a/catalog/meson.build +++ b/catalog/meson.build @@ -1,17 +1,15 @@ -# -*- mode: meson -*- - in_files = ''' - systemd.bg.catalog - systemd.be.catalog - systemd.be@latin.catalog - systemd.fr.catalog - systemd.it.catalog - systemd.pl.catalog - systemd.pt_BR.catalog - systemd.ru.catalog - systemd.zh_CN.catalog - systemd.zh_TW.catalog - systemd.catalog + systemd.bg.catalog + systemd.be.catalog + systemd.be@latin.catalog + systemd.fr.catalog + systemd.it.catalog + systemd.pl.catalog + systemd.pt_BR.catalog + systemd.ru.catalog + systemd.zh_CN.catalog + systemd.zh_TW.catalog + systemd.catalog '''.split() support_url = get_option('support-url') @@ -19,12 +17,12 @@ support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url) build_catalog_dir = meson.current_build_dir() foreach file : in_files - custom_target( - file, - input : file + '.in', - output: file, - command : [sed, support_sed, '@INPUT@'], - capture : true, - install : true, - install_dir : catalogdir) + custom_target( + file, + input : file + '.in', + output: file, + command : [sed, support_sed, '@INPUT@'], + capture : true, + install : true, + install_dir : catalogdir) endforeach diff --git a/docs/sysvinit/meson.build b/docs/sysvinit/meson.build index a519f74cee..36b2f6f98c 100644 --- a/docs/sysvinit/meson.build +++ b/docs/sysvinit/meson.build @@ -1,8 +1,6 @@ -# -*- mode: meson -*- - file = configure_file( - input : 'README.in', - output : 'README', - configuration : substs) + input : 'README.in', + output : 'README', + configuration : substs) install_data(file, install_dir : sysvinit_path) diff --git a/docs/var-log/meson.build b/docs/var-log/meson.build index c3d0cdbf82..43078c40e9 100644 --- a/docs/var-log/meson.build +++ b/docs/var-log/meson.build @@ -1,8 +1,6 @@ -# -*- mode: meson -*- - file = configure_file( - input : 'README.in', - output : 'README', - configuration : substs) + input : 'README.in', + output : 'README', + configuration : substs) install_data(file, install_dir : varlogdir) diff --git a/hwdb/meson.build b/hwdb/meson.build index 1e859fd20d..b9fc5ab594 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -1,39 +1,37 @@ -# -*- mode: meson -*- - hwdb_files = files(''' - 20-pci-vendor-model.hwdb - 20-pci-classes.hwdb - 20-usb-vendor-model.hwdb - 20-usb-classes.hwdb - 20-sdio-vendor-model.hwdb - 20-sdio-classes.hwdb - 20-bluetooth-vendor-product.hwdb - 20-acpi-vendor.hwdb - 20-OUI.hwdb - 20-net-ifname.hwdb - 60-evdev.hwdb - 60-keyboard.hwdb - 60-sensor.hwdb - 70-mouse.hwdb - 70-pointingstick.hwdb - 70-touchpad.hwdb + 20-pci-vendor-model.hwdb + 20-pci-classes.hwdb + 20-usb-vendor-model.hwdb + 20-usb-classes.hwdb + 20-sdio-vendor-model.hwdb + 20-sdio-classes.hwdb + 20-bluetooth-vendor-product.hwdb + 20-acpi-vendor.hwdb + 20-OUI.hwdb + 20-net-ifname.hwdb + 60-evdev.hwdb + 60-keyboard.hwdb + 60-sensor.hwdb + 70-mouse.hwdb + 70-pointingstick.hwdb + 70-touchpad.hwdb '''.split()) if conf.get('ENABLE_HWDB', 0) == 1 - install_data(hwdb_files, - install_dir : udevhwdbdir) + install_data(hwdb_files, + install_dir : udevhwdbdir) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d'))) + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d'))) - meson.add_install_script('sh', '-c', - 'test -n "$DESTDIR" || @0@/systemd-hwdb update' - .format(rootbindir)) + meson.add_install_script('sh', '-c', + 'test -n "$DESTDIR" || @0@/systemd-hwdb update' + .format(rootbindir)) endif ############################################################ custom_target( - 'update', - output : 'update', - command : [hwdb_update_sh, meson.current_source_dir()]) + 'update', + output : 'update', + command : [hwdb_update_sh, meson.current_source_dir()]) diff --git a/man/meson.build b/man/meson.build index 9d8d1a9922..1c1dbd86b7 100644 --- a/man/meson.build +++ b/man/meson.build @@ -1,5 +1,3 @@ -# -*- mode: meson -*- - # This is lame, I know, but meson has no other include mechanism subdir('rules') @@ -14,123 +12,122 @@ want_man = want_man != 'false' and xsltproc.found() want_html = want_html != 'false' and xsltproc.found() xsltproc_flags = [ - '--nonet', - '--xinclude', - '--stringparam', 'man.output.quietly', '1', - '--stringparam', 'funcsynopsis.style', 'ansi', - '--stringparam', 'man.authors.section.enabled', '0', - '--stringparam', 'man.copyright.section.enabled', '0', - '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()), - '--path', - '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())] + '--nonet', + '--xinclude', + '--stringparam', 'man.output.quietly', '1', + '--stringparam', 'funcsynopsis.style', 'ansi', + '--stringparam', 'man.authors.section.enabled', '0', + '--stringparam', 'man.copyright.section.enabled', '0', + '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()), + '--path', + '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())] custom_man_xsl = files('custom-man.xsl') custom_html_xsl = files('custom-html.xsl') +xslt_cmd = [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags custom_entities_ent = configure_file( - input : 'custom-entities.ent.in', - output : 'custom-entities.ent', - configuration : conf) + input : 'custom-entities.ent.in', + output : 'custom-entities.ent', + configuration : conf) man_pages = [] html_pages = [] source_xml_files = [] foreach tuple : manpages - stem = tuple[0] - section = tuple[1] - aliases = tuple[2] - condition = tuple[3] + stem = tuple[0] + section = tuple[1] + aliases = tuple[2] + condition = tuple[3] - xml = stem + '.xml' - html = stem + '.html' - man = stem + '.' + section + xml = stem + '.xml' + html = stem + '.html' + man = stem + '.' + section - manaliases = [] - htmlaliases = [] - foreach alias : aliases - manaliases += [alias + '.' + section] - htmlaliases += [alias + '.html'] - endforeach + manaliases = [] + htmlaliases = [] + foreach alias : aliases + manaliases += [alias + '.' + section] + htmlaliases += [alias + '.html'] + endforeach - mandirn = join_paths(get_option('mandir'), 'man' + section) + mandirn = join_paths(get_option('mandir'), 'man' + section) - have = condition == '' or conf.get(condition, 0) == 1 + if condition == '' or conf.get(condition, 0) == 1 + p1 = custom_target( + man, + input : xml, + output : [man] + manaliases, + command : xslt_cmd + [custom_man_xsl, '@INPUT@'], + depend_files : custom_entities_ent, + install : want_man, + install_dir : mandirn) + man_pages += [p1] - if have - p1 = custom_target( - man, - input : xml, - output : [man] + manaliases, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], - depend_files : custom_entities_ent, - install : want_man, - install_dir : mandirn) - man_pages += [p1] + p2 = custom_target( + html, + input : xml, + output : [html] + htmlaliases, + command : xslt_cmd + [custom_html_xsl, '@INPUT@'], + depend_files : custom_entities_ent, + install : want_html, + install_dir : join_paths(docdir, 'html')) + html_pages += [p2] - p2 = custom_target( - html, - input : xml, - output : [html] + htmlaliases, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], - depend_files : custom_entities_ent, - install : want_html, - install_dir : join_paths(docdir, 'html')) - html_pages += [p2] - - source_xml_files += files(tuple[0] + '.xml') - else - message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, have)) - endif + source_xml_files += files(tuple[0] + '.xml') + else + message('Skipping @0@.@1@ because @2@ is false'.format(stem, section, condition)) + endif endforeach ############################################################ have_lxml = run_command(xml_helper_py).returncode() == 0 if not have_lxml - message('python-lxml not available, not making man page indices') + message('python-lxml not available, not making man page indices') endif systemd_directives_xml = custom_target( - 'systemd.directives.xml', - input : source_xml_files, - output : 'systemd.directives.xml', - command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files) + 'systemd.directives.xml', + input : source_xml_files, + output : 'systemd.directives.xml', + command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files) nonindex_xml_files = source_xml_files + [systemd_directives_xml] systemd_index_xml = custom_target( - 'systemd.index.xml', - input : nonindex_xml_files, - output : 'systemd.index.xml', - command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files) + 'systemd.index.xml', + input : nonindex_xml_files, + output : 'systemd.index.xml', + command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files) foreach tuple : [['systemd.directives', '7', systemd_directives_xml], ['systemd.index', '7', systemd_index_xml]] - stem = tuple[0] - section = tuple[1] - xml = tuple[2] + stem = tuple[0] + section = tuple[1] + xml = tuple[2] - html = stem + '.html' - man = stem + '.' + section + html = stem + '.html' + man = stem + '.' + section - mandirn = join_paths(get_option('mandir'), 'man' + section) + mandirn = join_paths(get_option('mandir'), 'man' + section) - p1 = custom_target( - man, - input : xml, - output : man, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'], - install : want_man and have_lxml, - install_dir : mandirn) - man_pages += [p1] + p1 = custom_target( + man, + input : xml, + output : man, + command : xslt_cmd + [custom_man_xsl, '@INPUT@'], + install : want_man and have_lxml, + install_dir : mandirn) + man_pages += [p1] - p2 = custom_target( - html, - input : xml, - output : html, - command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'], - install : want_html and have_lxml, - install_dir : join_paths(docdir, 'html')) - html_pages += [p2] + p2 = custom_target( + html, + input : xml, + output : html, + command : xslt_cmd + [custom_html_xsl, '@INPUT@'], + install : want_html and have_lxml, + install_dir : join_paths(docdir, 'html')) + html_pages += [p2] endforeach man = custom_target('man', diff --git a/meson.build b/meson.build index 9504e984ec..a9011e50d2 100644 --- a/meson.build +++ b/meson.build @@ -1,13 +1,11 @@ -# -*- mode: meson -*- - project('systemd', 'c', version : '233', license : 'LGPLv2+', default_options: [ - 'c_std=gnu99', - 'prefix=/usr', - 'sysconfdir=/etc', - 'localstatedir=/var', + 'c_std=gnu99', + 'prefix=/usr', + 'sysconfdir=/etc', + 'localstatedir=/var', ], meson_version : '>= 0.39.1', ) @@ -30,18 +28,18 @@ m4_defines = [] rootprefixdir = get_option('rootprefix') if get_option('split-usr') - conf.set('HAVE_SPLIT_USR', 1) - rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/' + conf.set('HAVE_SPLIT_USR', 1) + rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/' else - rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr' + rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr' endif sysvinit_path = get_option('sysvinit-path') sysvrcnd_path = get_option('sysvrcnd-path') if sysvinit_path != '' or sysvrcnd_path != '' - conf.set('HAVE_SYSV_COMPAT', 1, - description : 'SysV init scripts and rcN.d links are supported') - m4_defines += ['-DHAVE_SYSV_COMPAT'] + conf.set('HAVE_SYSV_COMPAT', 1, + description : 'SysV init scripts and rcN.d links are supported') + m4_defines += ['-DHAVE_SYSV_COMPAT'] endif # join_paths ignore the preceding arguments if an absolute component is @@ -49,7 +47,7 @@ endif # absolute or relative. prefixdir = get_option('prefix') if not prefixdir.startswith('/') - error('Prefix is not absolute: "@0@"'.format(prefixdir)) + error('Prefix is not absolute: "@0@"'.format(prefixdir)) endif bindir = join_paths(prefixdir, get_option('bindir')) libdir = join_paths(prefixdir, get_option('libdir')) @@ -63,7 +61,7 @@ rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd') rootlibdir = get_option('rootlibdir') if rootlibdir == '' - rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) + rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) endif # Dirs of external packages @@ -113,27 +111,27 @@ randomseeddir = join_paths(localstatedir, 'lib/systemd') dbuspolicydir = get_option('dbuspolicydir') if dbuspolicydir == '' - dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') + dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') endif dbussessionservicedir = get_option('dbussessionservicedir') if dbussessionservicedir == '' - dbussessionservicedir = join_paths(datadir, 'dbus-1/services') + dbussessionservicedir = join_paths(datadir, 'dbus-1/services') endif dbussystemservicedir = get_option('dbussystemservicedir') if dbussystemservicedir == '' - dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') + dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') endif pamlibdir = get_option('pamlibdir') if pamlibdir == '' - pamlibdir = join_paths(rootlibdir, 'security') + pamlibdir = join_paths(rootlibdir, 'security') endif pamconfdir = get_option('pamconfdir') if pamconfdir == '' - pamconfdir = join_paths(sysconfdir, 'pam.d') + pamconfdir = join_paths(sysconfdir, 'pam.d') endif conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) @@ -264,9 +262,9 @@ foreach arg : ['-Wundef', '-fPIE', '--param=ssp-buffer-size=4', ] - if cc.has_argument(arg) - add_project_arguments(arg, language : 'c') - endif + if cc.has_argument(arg) + add_project_arguments(arg, language : 'c') + endif endforeach if cc.compiles(' @@ -279,18 +277,18 @@ if cc.compiles(' return 0; } ') - # TODO: message? - add_project_arguments('-Werror=shadow', language : 'c') + # TODO: message? + add_project_arguments('-Werror=shadow', language : 'c') endif if cc.get_id() == 'clang' - foreach arg : ['-Wno-typedef-redefinition', - '-Wno-gnu-variable-sized-type-not-at-end', - ] - if cc.has_argument(arg) - add_project_arguments(arg, language : 'c') - endif - endforeach + foreach arg : ['-Wno-typedef-redefinition', + '-Wno-gnu-variable-sized-type-not-at-end', + ] + if cc.has_argument(arg) + add_project_arguments(arg, language : 'c') + endif + endforeach endif # --as-needed and --no-undefined are provided by meson by default, @@ -300,9 +298,9 @@ foreach arg : ['-Wl,-z,relro', '-pie', '-Wl,-fuse-ld=gold', ] - if cc.has_argument(arg) - add_project_link_arguments(arg, language : 'c') - endif + if cc.has_argument(arg) + add_project_link_arguments(arg, language : 'c') + endif endforeach cpp = ' '.join(cc.cmd_array()) + ' -E' @@ -332,10 +330,10 @@ foreach decl : ['char16_t', 'key_serial_t', 'struct ethtool_link_settings', ] - if cc.sizeof(decl, prefix : decl_headers) > 0 - # We get -1 if the size cannot be determined - conf.set('HAVE_' + decl.underscorify().to_upper(), 1) - endif + if cc.sizeof(decl, prefix : decl_headers) > 0 + # We get -1 if the size cannot be determined + conf.set('HAVE_' + decl.underscorify().to_upper(), 1) + endif endforeach foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], @@ -360,41 +358,41 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['IFA_FLAGS', 'linux/if_addr.h'], ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], ] - prefix = decl.length() > 2 ? decl[2] : '' - have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) - conf.set10('HAVE_DECL_' + decl[0], have) + prefix = decl.length() > 2 ? decl[2] : '' + have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) + conf.set10('HAVE_DECL_' + decl[0], have) endforeach skip = false foreach ident : ['secure_getenv', '__secure_getenv'] - if not skip and cc.has_function(ident) - conf.set('HAVE_' + ident.to_upper(), 1) - skip = true - endif + if not skip and cc.has_function(ident) + conf.set('HAVE_' + ident.to_upper(), 1) + skip = true + endif endforeach foreach ident : [ - ['memfd_create', '''#include '''], - ['gettid', '''#include '''], - ['pivot_root', '''#include '''], # no known header declares pivot_root - ['name_to_handle_at', '''#define _GNU_SOURCE - #include - #include - #include '''], - ['setns', '''#define _GNU_SOURCE - #include '''], - ['getrandom', '''#include '''], - ['renameat2', '''#include '''], - ['kcmp', '''#include '''], - ['keyctl', '''#include - #include '''], - ['copy_file_range', '''#include - #include '''], - ['explicit_bzero' , '''#include '''], - ] + ['memfd_create', '''#include '''], + ['gettid', '''#include '''], + ['pivot_root', '''#include '''], # no known header declares pivot_root + ['name_to_handle_at', '''#define _GNU_SOURCE + #include + #include + #include '''], + ['setns', '''#define _GNU_SOURCE + #include '''], + ['getrandom', '''#include '''], + ['renameat2', '''#include '''], + ['kcmp', '''#include '''], + ['keyctl', '''#include + #include '''], + ['copy_file_range', '''#include + #include '''], + ['explicit_bzero' , '''#include '''], +] - have = cc.has_function(ident[0], prefix : ident[1]) - conf.set10('HAVE_DECL_' + ident[0].to_upper(), have) + have = cc.has_function(ident[0], prefix : ident[1]) + conf.set10('HAVE_DECL_' + ident[0].to_upper(), have) endforeach ##################################################################### @@ -428,16 +426,19 @@ progs = [['telinit', '/lib/sysvinit/telinit'], ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'], ] foreach prog : progs - path = get_option(prog[0] + '-path') - if path != '' - message('Using @1@ for @0@'.format(prog[0], path)) - else - exe = find_program(prog[0], '/usr/sbin/' + prog[0], '/sbin/' + prog[0], required: false) - path = exe.found() ? exe.path() : prog[1] - endif - name = prog.length() > 2 ? prog[2] : prog[0].to_upper() - conf.set_quoted(name, path) - substs.set(name, path) + path = get_option(prog[0] + '-path') + if path != '' + message('Using @1@ for @0@'.format(prog[0], path)) + else + exe = find_program(prog[0], + '/usr/sbin/' + prog[0], + '/sbin/' + prog[0], + required: false) + path = exe.found() ? exe.path() : prog[1] + endif + name = prog.length() > 2 ? prog[2] : prog[0].to_upper() + conf.set_quoted(name, path) + substs.set(name, path) endforeach # TODO: add ln --relative check @@ -456,22 +457,23 @@ gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C' gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path())) gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) if cc.compiles(gperf_test) - gperf_len_type = 'size_t' + gperf_len_type = 'size_t' else - gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) - if cc.compiles(gperf_test) - gperf_len_type = 'unsigned' - else - error('unable to determine gperf len type') - endif + gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) + if cc.compiles(gperf_test) + gperf_len_type = 'unsigned' + else + error('unable to determine gperf len type') + endif endif message('gperf len type is @0@'.format(gperf_len_type)) -conf.set('GPERF_LEN_TYPE', gperf_len_type, description : 'The type of gperf "len" parameter') +conf.set('GPERF_LEN_TYPE', gperf_len_type, + description : 'The type of gperf "len" parameter') ############################################################ if not cc.has_header('sys/capability.h') - error('POSIX caps headers not found') + error('POSIX caps headers not found') endif foreach header : ['linux/btrfs.h', 'linux/memfd.h', @@ -479,9 +481,9 @@ foreach header : ['linux/btrfs.h', 'valgrind/memcheck.h', 'valgrind/valgrind.h', ] - if cc.has_header(header) - conf.set('HAVE_' + header.underscorify().to_upper(), 1) - endif + if cc.has_header(header) + conf.set('HAVE_' + header.underscorify().to_upper(), 1) + endif endforeach ############################################################ @@ -492,27 +494,27 @@ default_hierarchy = get_option('default-hierarchy') conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, description : 'default cgroup hierarchy as string') if default_hierarchy == 'legacy' - conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') elif default_hierarchy == 'hybrid' - conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') else - conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') + conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') endif time_epoch = get_option('time-epoch') if time_epoch == '' - NEWS = files('NEWS') - time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() + NEWS = files('NEWS') + time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() endif time_epoch = time_epoch.to_int() conf.set('TIME_EPOCH', time_epoch) system_uid_max = get_option('system-uid-max') if system_uid_max == '' - system_uid_max = run_command( - awk, - 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', - '/etc/login.defs').stdout() + system_uid_max = run_command( + awk, + 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', + '/etc/login.defs').stdout() endif system_uid_max = system_uid_max.to_int() conf.set('SYSTEM_UID_MAX', system_uid_max) @@ -524,10 +526,10 @@ conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group')) system_gid_max = get_option('system-gid-max') if system_gid_max == '' - system_gid_max = run_command( - awk, - 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', - '/etc/login.defs').stdout() + system_gid_max = run_command( + awk, + 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', + '/etc/login.defs').stdout() endif system_gid_max = system_gid_max.to_int() conf.set('SYSTEM_GID_MAX', system_gid_max) @@ -539,11 +541,11 @@ conf.set('TTY_GID', tty_gid) substs.set('TTY_GID', tty_gid) if get_option('adm-group') - m4_defines += ['-DENABLE_ADM_GROUP'] + m4_defines += ['-DENABLE_ADM_GROUP'] endif if get_option('wheel-group') - m4_defines += ['-DENABLE_WHEEL_GROUP'] + m4_defines += ['-DENABLE_WHEEL_GROUP'] endif substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) @@ -582,346 +584,346 @@ libmount = dependency('mount', want_seccomp = get_option('seccomp') if want_seccomp != 'false' - libseccomp = dependency('libseccomp', - required : want_seccomp == 'true') - if libseccomp.found() - conf.set('HAVE_SECCOMP', 1) - m4_defines += ['-DHAVE_SECCOMP'] - endif + libseccomp = dependency('libseccomp', + required : want_seccomp == 'true') + if libseccomp.found() + conf.set('HAVE_SECCOMP', 1) + m4_defines += ['-DHAVE_SECCOMP'] + endif else - libseccomp = [] + libseccomp = [] endif want_selinux = get_option('selinux') if want_selinux != 'false' - libselinux = dependency('libselinux', - version : '>= 2.1.9', - required : want_selinux == 'true') - if libselinux.found() - conf.set('HAVE_SELINUX', 1) - m4_defines += ['-DHAVE_SELINUX'] - endif + libselinux = dependency('libselinux', + version : '>= 2.1.9', + required : want_selinux == 'true') + if libselinux.found() + conf.set('HAVE_SELINUX', 1) + m4_defines += ['-DHAVE_SELINUX'] + endif else - libselinux = [] + libselinux = [] endif want_apparmor = get_option('apparmor') if want_apparmor != 'false' - libapparmor = dependency('libapparmor', - required : want_apparmor == 'true') - if libapparmor.found() - conf.set('HAVE_APPARMOR', 1) - m4_defines += ['-DHAVE_APPARMOR'] - endif + libapparmor = dependency('libapparmor', + required : want_apparmor == 'true') + if libapparmor.found() + conf.set('HAVE_APPARMOR', 1) + m4_defines += ['-DHAVE_APPARMOR'] + endif else - libapparmor = [] + libapparmor = [] endif want_smack = get_option('smack') if want_smack != 'false' - libsmack = dependency('libsmack', - required : want_smack == 'true') - if libsmack.found() - conf.set('HAVE_SMACK', 1) - m4_defines += ['-DHAVE_SMACK'] - endif + libsmack = dependency('libsmack', + required : want_smack == 'true') + if libsmack.found() + conf.set('HAVE_SMACK', 1) + m4_defines += ['-DHAVE_SMACK'] + endif else - libsmack = [] + libsmack = [] endif smack_run_label = get_option('smack-run-label') if smack_run_label != '' - conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) - m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] + conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) + m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] endif want_polkit = get_option('polkit') install_polkit = false install_polkit_pkla = false if want_polkit != 'false' - conf.set('ENABLE_POLKIT', 1) - install_polkit = true + conf.set('ENABLE_POLKIT', 1) + install_polkit = true - libpolkit = dependency('polkit-gobject-1', - required : false) - if libpolkit.found() and libpolkit.version().version_compare('< 0.106') - message('Old polkit detected, will install pkla files') - install_polkit_pkla = true - endif + libpolkit = dependency('polkit-gobject-1', + required : false) + if libpolkit.found() and libpolkit.version().version_compare('< 0.106') + message('Old polkit detected, will install pkla files') + install_polkit_pkla = true + endif endif want_audit = get_option('audit') if want_audit != 'false' - libaudit = dependency('audit', required : want_audit == 'true') - if libaudit.found() - conf.set('HAVE_AUDIT', 1) - endif + libaudit = dependency('audit', required : want_audit == 'true') + if libaudit.found() + conf.set('HAVE_AUDIT', 1) + endif else - libaudit = [] + libaudit = [] endif want_blkid = get_option('blkid') if want_blkid != 'false' - libblkid = dependency('blkid', required : want_blkid == 'true') - if libblkid.found() - conf.set('HAVE_BLKID', 1) - endif + libblkid = dependency('blkid', required : want_blkid == 'true') + if libblkid.found() + conf.set('HAVE_BLKID', 1) + endif else - libblkid = [] + libblkid = [] endif want_kmod = get_option('kmod') if want_kmod != 'false' - libkmod = dependency('libkmod', - version : '>= 15', - required : want_kmod == 'true') - if libkmod.found() - conf.set('HAVE_KMOD', 1) - endif + libkmod = dependency('libkmod', + version : '>= 15', + required : want_kmod == 'true') + if libkmod.found() + conf.set('HAVE_KMOD', 1) + endif else - libkmod = [] + libkmod = [] endif want_pam = get_option('pam') if want_pam != 'false' - libpam = cc.find_library('pam', required : want_pam == 'true') - libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') - if libpam.found() and libpam_misc.found() - conf.set('HAVE_PAM', 1) - m4_defines += ['-DHAVE_PAM'] - endif + libpam = cc.find_library('pam', required : want_pam == 'true') + libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') + if libpam.found() and libpam_misc.found() + conf.set('HAVE_PAM', 1) + m4_defines += ['-DHAVE_PAM'] + endif else - libpam = [] - libpam_misc = [] + libpam = [] + libpam_misc = [] endif want_microhttpd = get_option('microhttpd') if want_microhttpd != 'false' - libmicrohttpd = dependency('libmicrohttpd', - version : '>= 0.9.33', - required : want_microhttpd == 'true') - if libmicrohttpd.found() - conf.set('HAVE_MICROHTTPD', 1) - m4_defines += ['-DHAVE_MICROHTTPD'] - endif + libmicrohttpd = dependency('libmicrohttpd', + version : '>= 0.9.33', + required : want_microhttpd == 'true') + if libmicrohttpd.found() + conf.set('HAVE_MICROHTTPD', 1) + m4_defines += ['-DHAVE_MICROHTTPD'] + endif else - libmicrohttpd = [] + libmicrohttpd = [] endif want_libcryptsetup = get_option('libcryptsetup') if want_libcryptsetup != 'false' - libcryptsetup = dependency('libcryptsetup', - version : '>= 1.6.0', - required : want_libcryptsetup == 'true') - if libcryptsetup.found() - conf.set('HAVE_LIBCRYPTSETUP', 1) - endif + libcryptsetup = dependency('libcryptsetup', + version : '>= 1.6.0', + required : want_libcryptsetup == 'true') + if libcryptsetup.found() + conf.set('HAVE_LIBCRYPTSETUP', 1) + endif else - libcryptsetup = [] + libcryptsetup = [] endif want_libcurl = get_option('libcurl') if want_libcurl != 'false' - libcurl = dependency('libcurl', - version : '>= 7.32.0', - required : want_libcurl == 'true') - if libcurl.found() - conf.set('HAVE_LIBCURL', 1) - m4_defines += ['-DHAVE_LIBCURL'] - endif + libcurl = dependency('libcurl', + version : '>= 7.32.0', + required : want_libcurl == 'true') + if libcurl.found() + conf.set('HAVE_LIBCURL', 1) + m4_defines += ['-DHAVE_LIBCURL'] + endif else - libcurl = [] + libcurl = [] endif want_libidn = get_option('libidn') if want_libidn != 'false' - libidn = dependency('libidn', - required : want_libidn == 'true') - if libidn.found() - conf.set('HAVE_LIBIDN', 1) - m4_defines += ['-DHAVE_LIBIDN'] - endif + libidn = dependency('libidn', + required : want_libidn == 'true') + if libidn.found() + conf.set('HAVE_LIBIDN', 1) + m4_defines += ['-DHAVE_LIBIDN'] + endif else - libidn = [] + libidn = [] endif want_libiptc = get_option('libiptc') if want_libiptc != 'false' - libiptc = dependency('libiptc', - required : want_libiptc == 'true') - if libiptc.found() - conf.set('HAVE_LIBIPTC', 1) - m4_defines += ['-DHAVE_LIBIPTC'] - endif + libiptc = dependency('libiptc', + required : want_libiptc == 'true') + if libiptc.found() + conf.set('HAVE_LIBIPTC', 1) + m4_defines += ['-DHAVE_LIBIPTC'] + endif else - libiptc = [] + libiptc = [] endif want_qrencode = get_option('qrencode') if want_qrencode != 'false' - libqrencode = dependency('libqrencode', - required : want_qrencode == 'true') - if libqrencode.found() - conf.set('HAVE_QRENCODE', 1) - endif + libqrencode = dependency('libqrencode', + required : want_qrencode == 'true') + if libqrencode.found() + conf.set('HAVE_QRENCODE', 1) + endif else - libqrencode = [] + libqrencode = [] endif want_gnutls = get_option('gnutls') if want_gnutls != 'false' - libgnutls = dependency('gnutls', - version : '>= 3.1.4', - required : want_gnutls == 'true') - if libgnutls.found() - conf.set('HAVE_GNUTLS', 1) - endif + libgnutls = dependency('gnutls', + version : '>= 3.1.4', + required : want_gnutls == 'true') + if libgnutls.found() + conf.set('HAVE_GNUTLS', 1) + endif else - libgnutls = [] + libgnutls = [] endif want_elfutils = get_option('elfutils') if want_elfutils != 'false' - libdw = dependency('libdw', - required : want_elfutils == 'true') - if libdw.found() - conf.set('HAVE_ELFUTILS', 1) - endif + libdw = dependency('libdw', + required : want_elfutils == 'true') + if libdw.found() + conf.set('HAVE_ELFUTILS', 1) + endif else - libdw = [] + libdw = [] endif want_zlib = get_option('zlib') if want_zlib != 'false' - libz = dependency('zlib', - required : want_zlib == 'true') - if libz.found() - conf.set('HAVE_ZLIB', 1) - endif + libz = dependency('zlib', + required : want_zlib == 'true') + if libz.found() + conf.set('HAVE_ZLIB', 1) + endif else - libz = [] + libz = [] endif want_bzip2 = get_option('bzip2') if want_bzip2 != 'false' - libbzip2 = cc.find_library('bz2', - required : want_bzip2 == 'true') - if libbzip2.found() - conf.set('HAVE_BZIP2', 1) - endif + libbzip2 = cc.find_library('bz2', + required : want_bzip2 == 'true') + if libbzip2.found() + conf.set('HAVE_BZIP2', 1) + endif else - libbzip2 = [] + libbzip2 = [] endif want_xz = get_option('xz') if want_xz != 'false' - libxz = dependency('liblzma', - required : want_xz == 'true') - if libxz.found() - conf.set('HAVE_XZ', 1) - endif + libxz = dependency('liblzma', + required : want_xz == 'true') + if libxz.found() + conf.set('HAVE_XZ', 1) + endif else - libxz = [] + libxz = [] endif want_lz4 = get_option('lz4') if want_lz4 != 'false' - liblz4 = dependency('liblz4', - required : want_lz4 == 'true') - if liblz4.found() - conf.set('HAVE_LZ4', 1) - endif + liblz4 = dependency('liblz4', + required : want_lz4 == 'true') + if liblz4.found() + conf.set('HAVE_LZ4', 1) + endif else - liblz4 = [] + liblz4 = [] endif libacl = cc.find_library('acl', required : false) if libacl.found() - conf.set('HAVE_ACL', 1) - m4_defines += ['-DHAVE_ACL'] + conf.set('HAVE_ACL', 1) + m4_defines += ['-DHAVE_ACL'] endif want_glib = get_option('glib') if want_glib != 'false' - libglib = dependency('glib-2.0', - version : '>= 2.22.0', - required : want_glib == 'true') - libgobject = dependency('gobject-2.0', - version : '>= 2.22.0', - required : want_glib == 'true') - libgio = dependency('gio-2.0', - required : want_glib == 'true') - if libglib.found() and libgobject.found() and libgio.found() - conf.set('HAVE_GLIB', 1) - endif + libglib = dependency('glib-2.0', + version : '>= 2.22.0', + required : want_glib == 'true') + libgobject = dependency('gobject-2.0', + version : '>= 2.22.0', + required : want_glib == 'true') + libgio = dependency('gio-2.0', + required : want_glib == 'true') + if libglib.found() and libgobject.found() and libgio.found() + conf.set('HAVE_GLIB', 1) + endif else - libglib = [] - libgobject = [] - libgio = [] + libglib = [] + libgobject = [] + libgio = [] endif want_xkbcommon = get_option('xkbcommon') if want_xkbcommon != 'false' - libxkbcommon = dependency('xkbcommon', - version : '>= 0.3.0', - required : want_xkbcommon == 'true') - if libxkbcommon.found() - conf.set('HAVE_XKBCOMMON', 1) - endif + libxkbcommon = dependency('xkbcommon', + version : '>= 0.3.0', + required : want_xkbcommon == 'true') + if libxkbcommon.found() + conf.set('HAVE_XKBCOMMON', 1) + endif else - libxkbcommon = [] + libxkbcommon = [] endif want_dbus = get_option('dbus') if want_dbus != 'false' - libdbus = dependency('dbus-1', - version : '>= 1.3.2', - required : want_dbus == 'true') - if libdbus.found() - conf.set('HAVE_DBUS', 1) - endif + libdbus = dependency('dbus-1', + version : '>= 1.3.2', + required : want_dbus == 'true') + if libdbus.found() + conf.set('HAVE_DBUS', 1) + endif else - libdbus = [] + libdbus = [] endif want_libgcrypt = get_option('libgcrypt') if want_libgcrypt != 'false' - libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true') - if libgcrypt.found() - conf.set('HAVE_LIBGCRYPT', 1) - endif + libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true') + if libgcrypt.found() + conf.set('HAVE_LIBGCRYPT', 1) + endif else - libgcrypt = [] + libgcrypt = [] endif want_importd = get_option('importd') if want_importd != 'false' - have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and - conf.get('HAVE_ZLIB', 0) == 1 and - conf.get('HAVE_BZIP2', 0) == 1 and - conf.get('HAVE_XZ', 0) == 1 and - conf.get('HAVE_LIBGCRYPT', 0) == 1) - if have_deps - conf.set('ENABLE_IMPORTD', 1) - elif want_importd == 'true' - error('importd support was requested, but dependencies are not available') - endif + have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and + conf.get('HAVE_ZLIB', 0) == 1 and + conf.get('HAVE_BZIP2', 0) == 1 and + conf.get('HAVE_XZ', 0) == 1 and + conf.get('HAVE_LIBGCRYPT', 0) == 1) + if have_deps + conf.set('ENABLE_IMPORTD', 1) + elif want_importd == 'true' + error('importd support was requested, but dependencies are not available') + endif endif want_remote = get_option('remote') if want_remote != 'false' - have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1, - conf.get('HAVE_LIBCURL', 0) == 1] - # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so - # it's possible to build one without the other. Complain only if - # support was explictly requested. The auxiliary files like sysusers - # config should be installed when any of the programs are built. - if want_remote == 'true' and not (have_deps[0] and have_deps[1]) - error('remote support was requested, but dependencies are not available') - endif - if have_deps[0] or have_deps[1] - conf.set('ENABLE_REMOTE', 1) - endif + have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1, + conf.get('HAVE_LIBCURL', 0) == 1] + # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so + # it's possible to build one without the other. Complain only if + # support was explictly requested. The auxiliary files like sysusers + # config should be installed when any of the programs are built. + if want_remote == 'true' and not (have_deps[0] and have_deps[1]) + error('remote support was requested, but dependencies are not available') + endif + if have_deps[0] or have_deps[1] + conf.set('ENABLE_REMOTE', 1) + endif endif foreach pair : [['utmp', 'HAVE_UTMP'], @@ -952,10 +954,10 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['ima', 'HAVE_IMA'], ] - if get_option(pair[0]) - conf.set(pair[1], 1) - m4_defines += ['-D' + pair[1]] - endif + if get_option(pair[0]) + conf.set(pair[1], 1) + m4_defines += ['-D' + pair[1]] + endif endforeach want_tests = get_option('tests') @@ -965,29 +967,29 @@ tests = [] ##################################################################### if get_option('efi') - efi_arch = host_machine.cpu_family() + efi_arch = host_machine.cpu_family() - if efi_arch == 'ia32' - EFI_MACHINE_TYPE_NAME = 'ia32' - elif efi_arch == 'x86_64' - EFI_MACHINE_TYPE_NAME = 'x64' - elif efi_arch == 'arm' - EFI_MACHINE_TYPE_NAME = 'arm' - elif efi_arch == 'aarch64' - EFI_MACHINE_TYPE_NAME = 'aa64' - else - EFI_MACHINE_TYPE_NAME = '' - endif + if efi_arch == 'ia32' + EFI_MACHINE_TYPE_NAME = 'ia32' + elif efi_arch == 'x86_64' + EFI_MACHINE_TYPE_NAME = 'x64' + elif efi_arch == 'arm' + EFI_MACHINE_TYPE_NAME = 'arm' + elif efi_arch == 'aarch64' + EFI_MACHINE_TYPE_NAME = 'aa64' + else + EFI_MACHINE_TYPE_NAME = '' + endif - conf.set('ENABLE_EFI', 1) - conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) + conf.set('ENABLE_EFI', 1) + conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) endif ##################################################################### config_h = configure_file( - output : 'config.h', - configuration : conf) + output : 'config.h', + configuration : conf) includes = include_directories('src/basic', 'src/shared', @@ -1023,29 +1025,29 @@ subdir('src/journal') subdir('src/login') libjournal_core = static_library( - 'journal-core', - libjournal_core_sources, - journald_gperf_c, - include_directories : includes, - install : false) + 'journal-core', + libjournal_core_sources, + journald_gperf_c, + include_directories : includes, + install : false) libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) libsystemd = shared_library( - 'systemd', - libsystemd_internal_sources, - journal_internal_sources, - version : '0.18.0', - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + libsystemd_sym_path], - link_with : [libbasic], - dependencies : [threads, - librt, - libxz, - liblz4], - link_depends : libsystemd_sym, - install : true, - install_dir : rootlibdir) + 'systemd', + libsystemd_internal_sources, + journal_internal_sources, + version : '0.18.0', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + libsystemd_sym_path], + link_with : [libbasic], + dependencies : [threads, + librt, + libxz, + liblz4], + link_depends : libsystemd_sym, + install : true, + install_dir : rootlibdir) ############################################################ @@ -1083,51 +1085,51 @@ subdir('test') # only static linking apart from libdl, to make sure that the # module is linked to all libraries that it uses. test_dlopen = executable( - 'test-dlopen', - test_dlopen_c, - include_directories : includes, - link_with : [libbasic], - dependencies : [libdl]) + 'test-dlopen', + test_dlopen_c, + include_directories : includes, + link_with : [libbasic], + dependencies : [libdl]) foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], ['systemd', '', []], ['mymachines', 'ENABLE_MACHINED', []], ['resolve', 'ENABLE_RESOLVED', [libdl]]] - condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 - if condition - module = tuple[0] - extra_deps = tuple[2] + condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 + if condition + module = tuple[0] + extra_deps = tuple[2] - sym = 'src/nss-@0@/nss-@0@.sym'.format(module) - version_script_arg = join_paths(meson.current_source_dir(), sym) + sym = 'src/nss-@0@/nss-@0@.sym'.format(module) + version_script_arg = join_paths(meson.current_source_dir(), sym) - nss = shared_library( - 'nss_' + module, - 'src/nss-@0@/nss-@0@.c'.format(module), - version : '2', - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + version_script_arg, - '-Wl,--undefined'], - link_with : [libsystemd_internal, - libbasic], - dependencies : [threads, - librt] + extra_deps, - link_depends : sym, - install : true, - install_dir : rootlibdir) + nss = shared_library( + 'nss_' + module, + 'src/nss-@0@/nss-@0@.c'.format(module), + version : '2', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + version_script_arg, + '-Wl,--undefined'], + link_with : [libsystemd_internal, + libbasic], + dependencies : [threads, + librt] + extra_deps, + link_depends : sym, + install : true, + install_dir : rootlibdir) - # We cannot use shared_module because it does not support version suffix. - # Unfortunately shared_library insists on creating the symlink… - meson.add_install_script('sh', '-c', - 'rm $DESTDIR@0@/libnss_@1@.so' - .format(rootlibdir, module)) + # We cannot use shared_module because it does not support version suffix. + # Unfortunately shared_library insists on creating the symlink… + meson.add_install_script('sh', '-c', + 'rm $DESTDIR@0@/libnss_@1@.so' + .format(rootlibdir, module)) - test('dlopen-nss_' + module, - test_dlopen, - args : [nss.full_path()]) # path to dlopen must include a slash - endif + test('dlopen-nss_' + module, + test_dlopen, + args : [nss.full_path()]) # path to dlopen must include a slash + endif endforeach ############################################################ @@ -1229,161 +1231,161 @@ executable('systemd-fstab-generator', install_dir : systemgeneratordir) if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 - executable('30-systemd-environment-d-generator', - 'src/environment-d-generator/environment-d-generator.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : userenvgeneratordir) + executable('30-systemd-environment-d-generator', + 'src/environment-d-generator/environment-d-generator.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : userenvgeneratordir) - meson.add_install_script(meson_make_symlink, - join_paths(sysconfdir, 'environment'), - join_paths(environmentdir, '99-environment.conf')) + meson.add_install_script(meson_make_symlink, + join_paths(sysconfdir, 'environment'), + join_paths(environmentdir, '99-environment.conf')) endif if conf.get('ENABLE_HIBERNATE', 0) == 1 - executable('systemd-hibernate-resume-generator', - 'src/hibernate-resume/hibernate-resume-generator.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) + executable('systemd-hibernate-resume-generator', + 'src/hibernate-resume/hibernate-resume-generator.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) - executable('systemd-hibernate-resume', - 'src/hibernate-resume/hibernate-resume.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) -endif - -if conf.get('HAVE_BLKID', 0) == 1 - executable('systemd-gpt-auto-generator', - 'src/gpt-auto-generator/gpt-auto-generator.c', - 'src/basic/blkid-util.h', - include_directories : includes, - link_with : [libshared, - libudev], - dependencies : libblkid, - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) - - exe = executable('systemd-dissect', - 'src/dissect/dissect.c', + executable('systemd-hibernate-resume', + 'src/hibernate-resume/hibernate-resume.c', include_directories : includes, link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) - public_programs += [exe] +endif + +if conf.get('HAVE_BLKID', 0) == 1 + executable('systemd-gpt-auto-generator', + 'src/gpt-auto-generator/gpt-auto-generator.c', + 'src/basic/blkid-util.h', + include_directories : includes, + link_with : [libshared, + libudev], + dependencies : libblkid, + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) + + exe = executable('systemd-dissect', + 'src/dissect/dissect.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] endif if conf.get('ENABLE_RESOLVED', 0) == 1 - executable('systemd-resolved', - systemd_resolved_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libm, - libidn], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('systemd-resolve', - systemd_resolve_sources, + executable('systemd-resolved', + systemd_resolved_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, libm, libidn], install_rpath : rootlibexecdir, - install : true) - public_programs += [exe] + install : true, + install_dir : rootlibexecdir) + + exe = executable('systemd-resolve', + systemd_resolve_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libm, + libidn], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_LOGIND', 0) == 1 - executable('systemd-logind', - systemd_logind_sources, - include_directories : includes, - link_with : [liblogind_core, - libshared, - libudev], - dependencies : [threads, - libacl], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('loginctl', - loginctl_sources, + executable('systemd-logind', + systemd_logind_sources, include_directories : includes, - link_with : [libshared, + link_with : [liblogind_core, + libshared, libudev], dependencies : [threads, - liblz4, - libxz], + libacl], install_rpath : rootlibexecdir, install : true, - install_dir : rootbindir) - public_programs += [exe] + install_dir : rootlibexecdir) - exe = executable('systemd-inhibit', - 'src/login/inhibit.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) - public_programs += [exe] + exe = executable('loginctl', + loginctl_sources, + include_directories : includes, + link_with : [libshared, + libudev], + dependencies : [threads, + liblz4, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] - if conf.get('HAVE_PAM', 0) == 1 - version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) - pam_systemd = shared_library( - 'pam_systemd', - pam_systemd_c, - name_prefix : '', - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + version_script_arg], - link_with : [libsystemd_internal, - libshared_static], - dependencies : [threads, - libpam, - libpam_misc], - link_depends : pam_systemd_sym, - install : true, - install_dir : pamlibdir) + exe = executable('systemd-inhibit', + 'src/login/inhibit.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] - test('dlopen-pam_systemd', - test_dlopen, - args : [pam_systemd.full_path()]) # path to dlopen must include a slash - endif + if conf.get('HAVE_PAM', 0) == 1 + version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) + pam_systemd = shared_library( + 'pam_systemd', + pam_systemd_c, + name_prefix : '', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + version_script_arg], + link_with : [libsystemd_internal, + libshared_static], + dependencies : [threads, + libpam, + libpam_misc], + link_depends : pam_systemd_sym, + install : true, + install_dir : pamlibdir) + + test('dlopen-pam_systemd', + test_dlopen, + args : [pam_systemd.full_path()]) # path to dlopen must include a slash + endif endif if conf.get('HAVE_PAM', 0) == 1 - executable('systemd-user-sessions', - 'src/user-sessions/user-sessions.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-user-sessions', + 'src/user-sessions/user-sessions.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1 - exe = executable('bootctl', - 'src/boot/bootctl.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libblkid], - install_rpath : rootlibexecdir, - install : true) - public_programs += [exe] + exe = executable('bootctl', + 'src/boot/bootctl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libblkid], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif exe = executable('systemd-socket-activate', 'src/activate/activate.c', @@ -1408,25 +1410,25 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c', public_programs += [exe] if conf.get('ENABLE_BACKLIGHT', 0) == 1 - executable('systemd-backlight', - 'src/backlight/backlight.c', - include_directories : includes, - link_with : [libshared, - libudev], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-backlight', + 'src/backlight/backlight.c', + include_directories : includes, + link_with : [libshared, + libudev], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif if conf.get('ENABLE_RFKILL', 0) == 1 - executable('systemd-rfkill', - 'src/rfkill/rfkill.c', - include_directories : includes, - link_with : [libshared, - libudev], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-rfkill', + 'src/rfkill/rfkill.c', + include_directories : includes, + link_with : [libshared, + libudev], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif executable('systemd-system-update-generator', @@ -1438,323 +1440,323 @@ executable('systemd-system-update-generator', install_dir : systemgeneratordir) if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 - executable('systemd-cryptsetup', - 'src/cryptsetup/cryptsetup.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libcryptsetup], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-cryptsetup', + 'src/cryptsetup/cryptsetup.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-cryptsetup-generator', - 'src/cryptsetup/cryptsetup-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libcryptsetup], - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) + executable('systemd-cryptsetup-generator', + 'src/cryptsetup/cryptsetup-generator.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) - executable('systemd-veritysetup', - 'src/veritysetup/veritysetup.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libcryptsetup], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-veritysetup', + 'src/veritysetup/veritysetup.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-veritysetup-generator', - 'src/veritysetup/veritysetup-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libcryptsetup], - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) + executable('systemd-veritysetup-generator', + 'src/veritysetup/veritysetup-generator.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcryptsetup], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) endif if conf.get('HAVE_SYSV_COMPAT', 0) == 1 - executable('systemd-sysv-generator', - 'src/sysv-generator/sysv-generator.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) + executable('systemd-sysv-generator', + 'src/sysv-generator/sysv-generator.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) - executable('systemd-rc-local-generator', - 'src/rc-local-generator/rc-local-generator.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : systemgeneratordir) + executable('systemd-rc-local-generator', + 'src/rc-local-generator/rc-local-generator.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) endif if conf.get('ENABLE_HOSTNAMED', 0) == 1 - executable('systemd-hostnamed', - 'src/hostname/hostnamed.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('hostnamectl', - 'src/hostname/hostnamectl.c', + executable('systemd-hostnamed', + 'src/hostname/hostnamed.c', include_directories : includes, link_with : [libshared], install_rpath : rootlibexecdir, - install : true) - public_programs += [exe] + install : true, + install_dir : rootlibexecdir) + + exe = executable('hostnamectl', + 'src/hostname/hostnamectl.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_LOCALED', 0) == 1 - if conf.get('HAVE_XKBCOMMON', 0) == 1 - # logind will load libxkbcommon.so dynamically on its own - deps = [libdl] - else - deps = [] - endif + if conf.get('HAVE_XKBCOMMON', 0) == 1 + # logind will load libxkbcommon.so dynamically on its own + deps = [libdl] + else + deps = [] + endif - executable('systemd-localed', - systemd_localed_sources, - include_directories : includes, - link_with : [libshared], - dependencies : deps, - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('localectl', - localectl_sources, + executable('systemd-localed', + systemd_localed_sources, include_directories : includes, link_with : [libshared], + dependencies : deps, install_rpath : rootlibexecdir, - install : true) - public_programs += [exe] + install : true, + install_dir : rootlibexecdir) + + exe = executable('localectl', + localectl_sources, + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_TIMEDATED', 0) == 1 - executable('systemd-timedated', - 'src/timedate/timedated.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('timedatectl', - 'src/timedate/timedatectl.c', + executable('systemd-timedated', + 'src/timedate/timedated.c', include_directories : includes, - install_rpath : rootlibexecdir, link_with : [libshared], - install : true) - public_programs += [exe] + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + + exe = executable('timedatectl', + 'src/timedate/timedatectl.c', + include_directories : includes, + install_rpath : rootlibexecdir, + link_with : [libshared], + install : true) + public_programs += [exe] endif if conf.get('ENABLE_TIMESYNCD', 0) == 1 - executable('systemd-timesyncd', - systemd_timesyncd_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libm], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-timesyncd', + systemd_timesyncd_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libm], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif if conf.get('ENABLE_MACHINED', 0) == 1 - executable('systemd-machined', - systemd_machined_sources, - include_directories : includes, - link_with : [libmachine_core, - libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('machinectl', - 'src/machine/machinectl.c', + executable('systemd-machined', + systemd_machined_sources, include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libxz, - liblz4], + link_with : [libmachine_core, + libshared], install_rpath : rootlibexecdir, install : true, - install_dir : rootbindir) - public_programs += [exe] + install_dir : rootlibexecdir) + + exe = executable('machinectl', + 'src/machine/machinectl.c', + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_IMPORTD', 0) == 1 - executable('systemd-importd', - systemd_importd_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-importd', + systemd_importd_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - systemd_pull = executable('systemd-pull', - systemd_pull_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz, - libgcrypt], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + systemd_pull = executable('systemd-pull', + systemd_pull_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz, + libgcrypt], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - systemd_import = executable('systemd-import', - systemd_import_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + systemd_import = executable('systemd-import', + systemd_import_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - systemd_export = executable('systemd-export', - systemd_export_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [libcurl, - libz, - libbzip2, - libxz], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - public_programs += [systemd_pull, systemd_import, systemd_export] + systemd_export = executable('systemd-export', + systemd_export_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [libcurl, + libz, + libbzip2, + libxz], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [systemd_pull, systemd_import, systemd_export] endif if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 - exe = executable('systemd-journal-upload', - systemd_journal_upload_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libcurl, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - public_programs += [exe] + exe = executable('systemd-journal-upload', + systemd_journal_upload_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcurl, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] endif if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 - s_j_remote = executable('systemd-journal-remote', - systemd_journal_remote_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libmicrohttpd, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + s_j_remote = executable('systemd-journal-remote', + systemd_journal_remote_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - s_j_gatewayd = executable('systemd-journal-gatewayd', - systemd_journal_gatewayd_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libmicrohttpd, - libgnutls, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - public_programs += [s_j_remote, s_j_gatewayd] + s_j_gatewayd = executable('systemd-journal-gatewayd', + systemd_journal_gatewayd_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libmicrohttpd, + libgnutls, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [s_j_remote, s_j_gatewayd] endif if conf.get('ENABLE_COREDUMP', 0) == 1 - executable('systemd-coredump', - systemd_coredump_sources, - include_directories : includes, - link_with : [libshared], - dependencies : [threads, - libacl, - libdw, - libxz, - liblz4], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) - - exe = executable('coredumpctl', - coredumpctl_sources, + executable('systemd-coredump', + systemd_coredump_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, + libacl, + libdw, libxz, liblz4], install_rpath : rootlibexecdir, - install : true) - public_programs += [exe] + install : true, + install_dir : rootlibexecdir) + + exe = executable('coredumpctl', + coredumpctl_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libxz, + liblz4], + install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] endif if conf.get('ENABLE_BINFMT', 0) == 1 - exe = executable('systemd-binfmt', - 'src/binfmt/binfmt.c', + exe = executable('systemd-binfmt', + 'src/binfmt/binfmt.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + public_programs += [exe] + + meson.add_install_script('sh', '-c', + mkdir_p.format(binfmtdir)) + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) +endif + +if conf.get('ENABLE_VCONSOLE', 0) == 1 + executable('systemd-vconsole-setup', + 'src/vconsole/vconsole-setup.c', include_directories : includes, link_with : [libshared], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) - public_programs += [exe] - - meson.add_install_script('sh', '-c', - mkdir_p.format(binfmtdir)) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) -endif - -if conf.get('ENABLE_VCONSOLE', 0) == 1 - executable('systemd-vconsole-setup', - 'src/vconsole/vconsole-setup.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) endif if conf.get('ENABLE_RANDOMSEED', 0) == 1 - executable('systemd-random-seed', - 'src/random-seed/random-seed.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-random-seed', + 'src/random-seed/random-seed.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif if conf.get('ENABLE_FIRSTBOOT', 0) == 1 - executable('systemd-firstboot', - 'src/firstboot/firstboot.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libcrypt], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) + executable('systemd-firstboot', + 'src/firstboot/firstboot.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libcrypt], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) endif executable('systemd-remount-fs', @@ -1957,48 +1959,48 @@ exe = executable('busctl', public_programs += [exe] if conf.get('ENABLE_SYSUSERS', 0) == 1 - exe = executable('systemd-sysusers', - 'src/sysusers/sysusers.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) - public_programs += [exe] + exe = executable('systemd-sysusers', + 'src/sysusers/sysusers.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_TMPFILES', 0) == 1 - exe = executable('systemd-tmpfiles', - 'src/tmpfiles/tmpfiles.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libacl], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootbindir) - public_programs += [exe] + exe = executable('systemd-tmpfiles', + 'src/tmpfiles/tmpfiles.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libacl], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] endif if conf.get('ENABLE_HWDB', 0) == 1 - exe = executable('systemd-hwdb', - 'src/hwdb/hwdb.c', - 'src/libsystemd/sd-hwdb/hwdb-internal.h', + exe = executable('systemd-hwdb', + 'src/hwdb/hwdb.c', + 'src/libsystemd/sd-hwdb/hwdb-internal.h', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + public_programs += [exe] +endif + +if conf.get('ENABLE_QUOTACHECK', 0) == 1 + executable('systemd-quotacheck', + 'src/quotacheck/quotacheck.c', include_directories : includes, link_with : [libshared], install_rpath : rootlibexecdir, install : true, - install_dir : rootbindir) - public_programs += [exe] -endif - -if conf.get('ENABLE_QUOTACHECK', 0) == 1 - executable('systemd-quotacheck', - 'src/quotacheck/quotacheck.c', - include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + install_dir : rootlibexecdir) endif exe = executable('systemd-socket-proxyd', @@ -2072,19 +2074,19 @@ executable('systemd-update-utmp', install_dir : rootlibexecdir) if conf.get('HAVE_KMOD', 0) == 1 - executable('systemd-modules-load', - 'src/modules-load/modules-load.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libkmod], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-modules-load', + 'src/modules-load/modules-load.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libkmod], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - meson.add_install_script('sh', '-c', - mkdir_p.format(modulesloaddir)) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) + meson.add_install_script('sh', '-c', + mkdir_p.format(modulesloaddir)) + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) endif exe = executable('systemd-nspawn', @@ -2106,26 +2108,26 @@ exe = executable('systemd-nspawn', public_programs += [exe] if conf.get('ENABLE_NETWORKD', 0) == 1 - executable('systemd-networkd', - systemd_networkd_sources, - include_directories : includes, - link_with : [libnetworkd_core, - libfirewall, - libsystemd_network, - libudev_internal, - libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-networkd', + systemd_networkd_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libfirewall, + libsystemd_network, + libudev_internal, + libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) - executable('systemd-networkd-wait-online', - systemd_networkd_wait_online_sources, - include_directories : includes, - link_with : [libnetworkd_core, - libshared], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-networkd-wait-online', + systemd_networkd_wait_online_sources, + include_directories : includes, + link_with : [libnetworkd_core, + libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) endif exe = executable('networkctl', @@ -2141,67 +2143,67 @@ public_programs += [exe] ############################################################ foreach tuple : tests - sources = tuple[0] - link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] - dependencies = tuple[2] - condition = tuple.length() >= 4 ? tuple[3] : '' - type = tuple.length() >= 5 ? tuple[4] : '' - defs = tuple.length() >= 6 ? tuple[5] : [] - incs = tuple.length() >= 7 ? tuple[6] : includes - timeout = 30 + sources = tuple[0] + link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] + dependencies = tuple[2] + condition = tuple.length() >= 4 ? tuple[3] : '' + type = tuple.length() >= 5 ? tuple[4] : '' + defs = tuple.length() >= 6 ? tuple[5] : [] + incs = tuple.length() >= 7 ? tuple[6] : includes + timeout = 30 - name = sources[0].split('/')[-1].split('.')[0] - if type.startswith('timeout=') - timeout = type.split('=')[1].to_int() - type = '' - endif + name = sources[0].split('/')[-1].split('.')[0] + if type.startswith('timeout=') + timeout = type.split('=')[1].to_int() + type = '' + endif - if condition == '' or conf.get(condition, 0) == 1 - install = install_tests and type == '' + if condition == '' or conf.get(condition, 0) == 1 + install = install_tests and type == '' - exe = executable( - name, - sources, - include_directories : incs, - link_with : link_with, - dependencies : dependencies, - c_args : defs, - install_rpath : rootlibexecdir, - install : install, - install_dir : testsdir) + exe = executable( + name, + sources, + include_directories : incs, + link_with : link_with, + dependencies : dependencies, + c_args : defs, + install_rpath : rootlibexecdir, + install : install, + install_dir : testsdir) - if type == 'manual' - message('@0@ is a manual test'.format(name)) - elif type == 'unsafe' and want_tests != 'unsafe' - message('@0@ is an unsafe test'.format(name)) - else - test(name, exe, - env : test_env, - timeout : timeout) - endif - else - message('Not compiling @0@ because @1@ is not true'.format(name, condition)) - endif + if type == 'manual' + message('@0@ is a manual test'.format(name)) + elif type == 'unsafe' and want_tests != 'unsafe' + message('@0@ is an unsafe test'.format(name)) + else + test(name, exe, + env : test_env, + timeout : timeout) + endif + else + message('Not compiling @0@ because @1@ is not true'.format(name, condition)) + endif endforeach test_libsystemd_sym = executable( - 'test-libsystemd-sym', - test_libsystemd_sym_c, - include_directories : includes, - link_with : [libsystemd], - install : install_tests, - install_dir : testsdir) + 'test-libsystemd-sym', + test_libsystemd_sym_c, + include_directories : includes, + link_with : [libsystemd], + install : install_tests, + install_dir : testsdir) test('test-libsystemd-sym', test_libsystemd_sym) test_libudev_sym = executable( - 'test-libudev-sym', - test_libudev_sym_c, - include_directories : includes, - c_args : ['-Wno-deprecated-declarations'], - link_with : [libudev], - install : install_tests, - install_dir : testsdir) + 'test-libudev-sym', + test_libudev_sym_c, + include_directories : includes, + c_args : ['-Wno-deprecated-declarations'], + link_with : [libudev], + install : install_tests, + install_dir : testsdir) test('test-libudev-sym', test_libudev_sym) @@ -2253,33 +2255,33 @@ meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) meson_check_help = find_program('tools/meson-check-help.sh') foreach exec : public_programs - name = exec.full_path().split('/')[-1] - test('check-help-' + name, - meson_check_help, - args : [exec.full_path()]) + name = exec.full_path().split('/')[-1] + test('check-help-' + name, + meson_check_help, + args : [exec.full_path()]) endforeach ############################################################ if git.found() and etags.found() - all_files = run_command( - git, - ['--git-dir=@0@/.git'.format(meson.source_root()), - 'ls-files', - ':/*.[ch]']) - all_files = files(all_files.stdout().split()) + all_files = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'ls-files', + ':/*.[ch]']) + all_files = files(all_files.stdout().split()) - custom_target( - 'TAGS', - output : 'TAGS', - input : all_files, - command : [etags, '-o', '@OUTPUT@'] + all_files) + custom_target( + 'TAGS', + output : 'TAGS', + input : all_files, + command : [etags, '-o', '@OUTPUT@'] + all_files) endif if git.found() - meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') - custom_target( - 'git-contrib', - output : 'git-contrib', - command : [meson_git_contrib_sh]) + meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') + custom_target( + 'git-contrib', + output : 'git-contrib', + command : [meson_git_contrib_sh]) endif diff --git a/network/meson.build b/network/meson.build index 4cca408c7f..f7d73f2db0 100644 --- a/network/meson.build +++ b/network/meson.build @@ -1,13 +1,11 @@ -# -*- mode: meson -*- - if conf.get('ENABLE_NETWORKD', 0) == 1 - install_data('80-container-host0.network', - '80-container-ve.network', - '80-container-vz.network', - install_dir : networkdir) + install_data('80-container-host0.network', + '80-container-ve.network', + '80-container-vz.network', + install_dir : networkdir) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'systemd/network'))) + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'systemd/network'))) endif install_data('99-default.link', diff --git a/po/meson.build b/po/meson.build index c3976b3846..f89291bfc4 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,5 +1,3 @@ -# -*- mode: meson -*- - i18n = import('i18n') i18n.gettext(meson.project_name()) diff --git a/rules/meson.build b/rules/meson.build index 43142ca991..1cd37f3cf3 100644 --- a/rules/meson.build +++ b/rules/meson.build @@ -1,40 +1,38 @@ -# -*- mode: meson -*- - rules = files(''' - 60-block.rules - 60-cdrom_id.rules - 60-drm.rules - 60-evdev.rules - 60-persistent-alsa.rules - 60-persistent-input.rules - 60-persistent-storage.rules - 60-persistent-storage-tape.rules - 60-persistent-v4l.rules - 60-sensor.rules - 60-serial.rules - 64-btrfs.rules - 70-mouse.rules - 70-touchpad.rules - 75-net-description.rules - 75-probe_mtd.rules - 78-sound-card.rules - 80-drivers.rules - 80-net-setup-link.rules + 60-block.rules + 60-cdrom_id.rules + 60-drm.rules + 60-evdev.rules + 60-persistent-alsa.rules + 60-persistent-input.rules + 60-persistent-storage.rules + 60-persistent-storage-tape.rules + 60-persistent-v4l.rules + 60-sensor.rules + 60-serial.rules + 64-btrfs.rules + 70-mouse.rules + 70-touchpad.rules + 75-net-description.rules + 75-probe_mtd.rules + 78-sound-card.rules + 80-drivers.rules + 80-net-setup-link.rules '''.split()) install_data(rules, install_dir : udevrulesdir) rules_in = ''' - 50-udev-default.rules - 99-systemd.rules + 50-udev-default.rules + 99-systemd.rules '''.split() foreach file : rules_in - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - install_data(gen, - install_dir : udevrulesdir) + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + install_data(gen, + install_dir : udevrulesdir) endforeach diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build index 07de1d232a..8c2eada6cb 100644 --- a/shell-completion/bash/meson.build +++ b/shell-completion/bash/meson.build @@ -1,52 +1,50 @@ -# -*- mode: meson -*- - bashcompletiondir = get_option('bashcompletiondir') if bashcompletiondir == '' - bash_completion = dependency('bash-completion', required : false) - if bash_completion.found() - bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') - else - bashcompletiondir = join_paths(datadir, 'bash-completion/completions') - endif + bash_completion = dependency('bash-completion', required : false) + if bash_completion.found() + bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') + else + bashcompletiondir = join_paths(datadir, 'bash-completion/completions') + endif - message('bash completions: @0@'.format(bashcompletiondir)) + message('bash completions: @0@'.format(bashcompletiondir)) endif if bashcompletiondir != 'no' - bash_systemctl = configure_file( - input : 'systemctl.in', - output : 'systemctl', - configuration : substs) + bash_systemctl = configure_file( + input : 'systemctl.in', + output : 'systemctl', + configuration : substs) - items = [['busctl', ''], - ['journalctl', ''], - ['systemd-analyze', ''], - ['systemd-cat', ''], - ['systemd-cgls', ''], - ['systemd-cgtop', ''], - ['systemd-delta', ''], - ['systemd-detect-virt', ''], - ['systemd-nspawn', ''], - ['systemd-path', ''], - ['systemd-run', ''], - ['udevadm', ''], - ['kernel-install', ''], - [bash_systemctl, ''], - ['bootctl', 'ENABLE_EFI'], - ['coredumpctl', 'ENABLE_COREDUMP'], - ['hostnamectl', 'ENABLE_HOSTNAMED'], - ['localectl', 'ENABLE_LOCALED'], - ['loginctl', 'ENABLE_LOGIND'], - ['machinectl', 'ENABLE_MACHINED'], - ['networkctl', 'ENABLE_NETWORKD'], - ['systemd-resolve', 'ENABLE_RESOLVED'], - ['timedatectl', 'ENABLE_TIMEDATED'], - ] + items = [['busctl', ''], + ['journalctl', ''], + ['systemd-analyze', ''], + ['systemd-cat', ''], + ['systemd-cgls', ''], + ['systemd-cgtop', ''], + ['systemd-delta', ''], + ['systemd-detect-virt', ''], + ['systemd-nspawn', ''], + ['systemd-path', ''], + ['systemd-run', ''], + ['udevadm', ''], + ['kernel-install', ''], + [bash_systemctl, ''], + ['bootctl', 'ENABLE_EFI'], + ['coredumpctl', 'ENABLE_COREDUMP'], + ['hostnamectl', 'ENABLE_HOSTNAMED'], + ['localectl', 'ENABLE_LOCALED'], + ['loginctl', 'ENABLE_LOGIND'], + ['machinectl', 'ENABLE_MACHINED'], + ['networkctl', 'ENABLE_NETWORKD'], + ['systemd-resolve', 'ENABLE_RESOLVED'], + ['timedatectl', 'ENABLE_TIMEDATED'], + ] - foreach item : items - if item[1] == '' or conf.get(item[1], 0) == 1 - install_data(item[0], - install_dir : bashcompletiondir) - endif - endforeach + foreach item : items + if item[1] == '' or conf.get(item[1], 0) == 1 + install_data(item[0], + install_dir : bashcompletiondir) + endif + endforeach endif diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build index 0ba4136496..ed1513ed25 100644 --- a/shell-completion/zsh/meson.build +++ b/shell-completion/zsh/meson.build @@ -1,49 +1,47 @@ -# -*- mode: meson -*- - zshcompletiondir = get_option('zshcompletiondir') if zshcompletiondir == '' - zshcompletiondir = join_paths(datadir, 'zsh/site-functions') + zshcompletiondir = join_paths(datadir, 'zsh/site-functions') - message('zsh completions: @0@'.format(zshcompletiondir)) + message('zsh completions: @0@'.format(zshcompletiondir)) endif if zshcompletiondir != 'no' - zsh_systemctl = configure_file( - input : '_systemctl.in', - output : '_systemctl', - configuration : substs) + zsh_systemctl = configure_file( + input : '_systemctl.in', + output : '_systemctl', + configuration : substs) - items = [['_busctl', ''], - ['_journalctl', ''], - ['_systemd-analyze', ''], - ['_systemd-delta', ''], - ['_systemd-nspawn', ''], - ['_systemd', ''], - ['_systemd-run', ''], - ['_udevadm', ''], - ['_kernel-install', ''], - ['_sd_hosts_or_user_at_host', ''], - ['_sd_outputmodes', ''], - ['_sd_unit_files', ''], - ['_sd_machines', ''], - [zsh_systemctl, ''], - ['_bootctl', 'ENABLE_EFI'], - ['_coredumpctl', 'ENABLE_COREDUMP'], - ['_hostnamectl', 'ENABLE_HOSTNAMED'], - ['_localectl', 'ENABLE_LOCALED'], - ['_loginctl', 'ENABLE_LOGIND'], - ['_machinectl', 'ENABLE_MACHINED'], - ['_networkctl', 'ENABLE_NETWORKD'], - ['_systemd-inhibit', 'ENABLE_LOGIND'], - ['_systemd-resolve', 'ENABLE_RESOLVED'], - ['_systemd-tmpfiles', 'ENABLE_TMPFILES'], - ['_timedatectl', 'ENABLE_TIMEDATED'], - ] + items = [['_busctl', ''], + ['_journalctl', ''], + ['_systemd-analyze', ''], + ['_systemd-delta', ''], + ['_systemd-nspawn', ''], + ['_systemd', ''], + ['_systemd-run', ''], + ['_udevadm', ''], + ['_kernel-install', ''], + ['_sd_hosts_or_user_at_host', ''], + ['_sd_outputmodes', ''], + ['_sd_unit_files', ''], + ['_sd_machines', ''], + [zsh_systemctl, ''], + ['_bootctl', 'ENABLE_EFI'], + ['_coredumpctl', 'ENABLE_COREDUMP'], + ['_hostnamectl', 'ENABLE_HOSTNAMED'], + ['_localectl', 'ENABLE_LOCALED'], + ['_loginctl', 'ENABLE_LOGIND'], + ['_machinectl', 'ENABLE_MACHINED'], + ['_networkctl', 'ENABLE_NETWORKD'], + ['_systemd-inhibit', 'ENABLE_LOGIND'], + ['_systemd-resolve', 'ENABLE_RESOLVED'], + ['_systemd-tmpfiles', 'ENABLE_TMPFILES'], + ['_timedatectl', 'ENABLE_TIMEDATED'], + ] - foreach item : items - if item[1] == '' or conf.get(item[1], 0) == 1 - install_data(item[0], - install_dir : zshcompletiondir) - endif - endforeach + foreach item : items + if item[1] == '' or conf.get(item[1], 0) == 1 + install_data(item[0], + install_dir : zshcompletiondir) + endif + endforeach endif diff --git a/src/analyze/meson.build b/src/analyze/meson.build index 1ff6b182d1..fcbd814233 100644 --- a/src/analyze/meson.build +++ b/src/analyze/meson.build @@ -1,7 +1,5 @@ -# -*- mode: meson -*- - systemd_analyze_sources = files(''' - analyze.c - analyze-verify.c - analyze-verify.h + analyze.c + analyze-verify.c + analyze-verify.h '''.split()) diff --git a/src/basic/meson.build b/src/basic/meson.build index 17049481aa..065f0ac4af 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -1,201 +1,199 @@ -# -*- mode: meson -*- - basic_sources_plain = files(''' - af-list.c - af-list.h - alloc-util.c - alloc-util.h - architecture.c - architecture.h - arphrd-list.c - arphrd-list.h - async.c - async.h - audit-util.c - audit-util.h - barrier.c - barrier.h - bitmap.c - bitmap.h - blkid-util.h - btrfs-ctree.h - btrfs-util.c - btrfs-util.h - build.h - bus-label.c - bus-label.h - calendarspec.c - calendarspec.h - capability-util.c - capability-util.h - cap-list.c - cap-list.h - cgroup-util.c - cgroup-util.h - chattr-util.c - chattr-util.h - clock-util.c - clock-util.h - conf-files.c - conf-files.h - copy.c - copy.h - cpu-set-util.c - cpu-set-util.h - def.h - device-nodes.c - device-nodes.h - dirent-util.c - dirent-util.h - env-util.c - env-util.h - errno-list.c - errno-list.h - escape.c - escape.h - ether-addr-util.c - ether-addr-util.h - exec-util.c - exec-util.h - exit-status.c - exit-status.h - extract-word.c - extract-word.h - fd-util.c - fd-util.h - fileio.c - fileio.h - fileio-label.c - fileio-label.h - format-util.h - fs-util.c - fs-util.h - glob-util.c - glob-util.h - gunicode.c - gunicode.h - hash-funcs.c - hash-funcs.h - hashmap.c - hashmap.h - hexdecoct.c - hexdecoct.h - hostname-util.c - hostname-util.h - in-addr-util.c - in-addr-util.h - ioprio.h - io-util.c - io-util.h - journal-importer.c - journal-importer.h - khash.c - khash.h - label.c - label.h - list.h - locale-util.c - locale-util.h - lockfile-util.c - lockfile-util.h - log.c - log.h - login-util.c - login-util.h - macro.h - memfd-util.c - memfd-util.h - mempool.c - mempool.h - missing_syscall.h - mkdir.c - mkdir.h - mkdir-label.c - mount-util.c - mount-util.h - MurmurHash2.c - MurmurHash2.h - nss-util.h - ordered-set.c - ordered-set.h - parse-util.c - parse-util.h - path-util.c - path-util.h - prioq.c - prioq.h - proc-cmdline.c - proc-cmdline.h - process-util.c - process-util.h - random-util.c - random-util.h - ratelimit.c - ratelimit.h - raw-clone.h - refcnt.h - replace-var.c - replace-var.h - rlimit-util.c - rlimit-util.h - rm-rf.c - rm-rf.h - securebits.h - selinux-util.c - selinux-util.h - set.h - sigbus.c - sigbus.h - signal-util.c - signal-util.h - siphash24.c - siphash24.h - smack-util.c - smack-util.h - socket-label.c - socket-util.c - socket-util.h - sparse-endian.h - special.h - stat-util.c - stat-util.h - stdio-util.h - strbuf.c - strbuf.h - string-table.c - string-table.h - string-util.c - string-util.h - strv.c - strv.h - strxcpyx.c - strxcpyx.h - syslog-util.c - syslog-util.h - terminal-util.c - terminal-util.h - time-util.c - time-util.h - umask-util.h - unaligned.h - unit-name.c - unit-name.h - user-util.c - user-util.h - utf8.c - utf8.h - util.c - util.h - verbs.c - verbs.h - virt.c - virt.h - web-util.c - web-util.h - xattr-util.c - xattr-util.h - xml.c - xml.h + af-list.c + af-list.h + alloc-util.c + alloc-util.h + architecture.c + architecture.h + arphrd-list.c + arphrd-list.h + async.c + async.h + audit-util.c + audit-util.h + barrier.c + barrier.h + bitmap.c + bitmap.h + blkid-util.h + btrfs-ctree.h + btrfs-util.c + btrfs-util.h + build.h + bus-label.c + bus-label.h + calendarspec.c + calendarspec.h + capability-util.c + capability-util.h + cap-list.c + cap-list.h + cgroup-util.c + cgroup-util.h + chattr-util.c + chattr-util.h + clock-util.c + clock-util.h + conf-files.c + conf-files.h + copy.c + copy.h + cpu-set-util.c + cpu-set-util.h + def.h + device-nodes.c + device-nodes.h + dirent-util.c + dirent-util.h + env-util.c + env-util.h + errno-list.c + errno-list.h + escape.c + escape.h + ether-addr-util.c + ether-addr-util.h + exec-util.c + exec-util.h + exit-status.c + exit-status.h + extract-word.c + extract-word.h + fd-util.c + fd-util.h + fileio.c + fileio.h + fileio-label.c + fileio-label.h + format-util.h + fs-util.c + fs-util.h + glob-util.c + glob-util.h + gunicode.c + gunicode.h + hash-funcs.c + hash-funcs.h + hashmap.c + hashmap.h + hexdecoct.c + hexdecoct.h + hostname-util.c + hostname-util.h + in-addr-util.c + in-addr-util.h + ioprio.h + io-util.c + io-util.h + journal-importer.c + journal-importer.h + khash.c + khash.h + label.c + label.h + list.h + locale-util.c + locale-util.h + lockfile-util.c + lockfile-util.h + log.c + log.h + login-util.c + login-util.h + macro.h + memfd-util.c + memfd-util.h + mempool.c + mempool.h + missing_syscall.h + mkdir.c + mkdir.h + mkdir-label.c + mount-util.c + mount-util.h + MurmurHash2.c + MurmurHash2.h + nss-util.h + ordered-set.c + ordered-set.h + parse-util.c + parse-util.h + path-util.c + path-util.h + prioq.c + prioq.h + proc-cmdline.c + proc-cmdline.h + process-util.c + process-util.h + random-util.c + random-util.h + ratelimit.c + ratelimit.h + raw-clone.h + refcnt.h + replace-var.c + replace-var.h + rlimit-util.c + rlimit-util.h + rm-rf.c + rm-rf.h + securebits.h + selinux-util.c + selinux-util.h + set.h + sigbus.c + sigbus.h + signal-util.c + signal-util.h + siphash24.c + siphash24.h + smack-util.c + smack-util.h + socket-label.c + socket-util.c + socket-util.h + sparse-endian.h + special.h + stat-util.c + stat-util.h + stdio-util.h + strbuf.c + strbuf.h + string-table.c + string-table.h + string-util.c + string-util.h + strv.c + strv.h + strxcpyx.c + strxcpyx.h + syslog-util.c + syslog-util.h + terminal-util.c + terminal-util.h + time-util.c + time-util.h + umask-util.h + unaligned.h + unit-name.c + unit-name.h + user-util.c + user-util.h + utf8.c + utf8.h + util.c + util.h + verbs.c + verbs.h + virt.c + virt.h + web-util.c + web-util.h + xattr-util.c + xattr-util.h + xml.c + xml.h '''.split()) missing_h = files('missing.h') @@ -204,31 +202,31 @@ generate_gperfs = find_program('generate-gperfs.py') generate_af_list = find_program('generate-af-list.sh') af_list_txt = custom_target( - 'af-list.txt', - output : 'af-list.txt', - command : [generate_af_list, cpp], - capture : true) + 'af-list.txt', + output : 'af-list.txt', + command : [generate_af_list, cpp], + capture : true) generate_arphrd_list = find_program('generate-arphrd-list.sh') arphrd_list_txt = custom_target( - 'arphrd-list.txt', - output : 'arphrd-list.txt', - command : [generate_arphrd_list, cpp], - capture : true) + 'arphrd-list.txt', + output : 'arphrd-list.txt', + command : [generate_arphrd_list, cpp], + capture : true) generate_cap_list = find_program('generate-cap-list.sh') cap_list_txt = custom_target( - 'cap-list.txt', - output : 'cap-list.txt', - command : [generate_cap_list, cpp, config_h, missing_h], - capture : true) + 'cap-list.txt', + output : 'cap-list.txt', + command : [generate_cap_list, cpp, config_h, missing_h], + capture : true) generate_errno_list = find_program('generate-errno-list.sh') errno_list_txt = custom_target( - 'errno-list.txt', - output : 'errno-list.txt', - command : [generate_errno_list, cpp], - capture : true) + 'errno-list.txt', + output : 'errno-list.txt', + command : [generate_errno_list, cpp], + capture : true) generated_gperf_headers = [] foreach item : [['af', af_list_txt, 'af', ''], @@ -236,48 +234,48 @@ foreach item : [['af', af_list_txt, 'af', ''], ['cap', cap_list_txt, 'capability', ''], ['errno', errno_list_txt, 'errno', '']] - fname = '@0@-from-name.gperf'.format(item[0]) - gperf_file = custom_target( - fname, - input : item[1], - output : fname, - command : [generate_gperfs, item[2], item[3], '@INPUT@'], - capture : true) + fname = '@0@-from-name.gperf'.format(item[0]) + gperf_file = custom_target( + fname, + input : item[1], + output : fname, + command : [generate_gperfs, item[2], item[3], '@INPUT@'], + capture : true) - fname = '@0@-from-name.h'.format(item[0]) - target1 = custom_target( - fname, - input : gperf_file, - output : fname, - command : [gperf, - '-L', 'ANSI-C', '-t', '--ignore-case', - '-N', 'lookup_@0@'.format(item[2]), - '-H', 'hash_@0@_name'.format(item[2]), - '-p', '-C', - '@INPUT@'], - capture : true) + fname = '@0@-from-name.h'.format(item[0]) + target1 = custom_target( + fname, + input : gperf_file, + output : fname, + command : [gperf, + '-L', 'ANSI-C', '-t', '--ignore-case', + '-N', 'lookup_@0@'.format(item[2]), + '-H', 'hash_@0@_name'.format(item[2]), + '-p', '-C', + '@INPUT@'], + capture : true) - fname = '@0@-to-name.h'.format(item[0]) - awkscript = '@0@-to-name.awk'.format(item[0]) - target2 = custom_target( - fname, - input : [awkscript, item[1]], - output : fname, - command : [awk, '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + fname = '@0@-to-name.h'.format(item[0]) + awkscript = '@0@-to-name.awk'.format(item[0]) + target2 = custom_target( + fname, + input : [awkscript, item[1]], + output : fname, + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) - generated_gperf_headers += [target1, target2] + generated_gperf_headers += [target1, target2] endforeach basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers libbasic = static_library( - 'basic', - basic_sources, - include_directories : includes, - dependencies : [threads, - libcap, - libblkid, - libselinux, - ], - install : false) + 'basic', + basic_sources, + include_directories : includes, + dependencies : [threads, + libcap, + libblkid, + libselinux, + ], + install : false) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 059cc7be31..bdf54654de 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -1,191 +1,192 @@ efi_headers = files(''' - console.h - disk.h - graphics.h - linux.h - measure.h - pefile.h - splash.h - util.h + console.h + disk.h + graphics.h + linux.h + measure.h + pefile.h + splash.h + util.h '''.split()) common_sources = ''' - disk.c - graphics.c - measure.c - pefile.c - util.c + disk.c + graphics.c + measure.c + pefile.c + util.c '''.split() systemd_boot_sources = ''' - boot.c - console.c + boot.c + console.c '''.split() stub_sources = ''' - linux.c - splash.c - stub.c + linux.c + splash.c + stub.c '''.split() if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'false' - efi_cc = get_option('efi-cc') - efi_ld = get_option('efi-ld') + efi_cc = get_option('efi-cc') + efi_ld = get_option('efi-ld') - efi_incdir = get_option('efi-includedir') - efibind_h = '@0@/@1@/efibind.h'.format(efi_incdir, efi_arch) - have_header = cc.has_header(efibind_h) + efi_incdir = get_option('efi-includedir') + efibind_h = '@0@/@1@/efibind.h'.format(efi_incdir, efi_arch) + have_header = cc.has_header(efibind_h) - if have_header and EFI_MACHINE_TYPE_NAME == '' - error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown') - endif + if have_header and EFI_MACHINE_TYPE_NAME == '' + error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown') + endif - efi_libdir = get_option('efi-libdir') - if efi_libdir == '' - cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc) - ret = run_command('sh', '-c', cmd) - if ret.returncode() == 0 - efi_libdir = ret.stdout().strip() - endif - endif + efi_libdir = get_option('efi-libdir') + if efi_libdir == '' + cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc) + ret = run_command('sh', '-c', cmd) + if ret.returncode() == 0 + efi_libdir = ret.stdout().strip() + endif + endif - have_gnu_efi = have_header and efi_libdir != '' + have_gnu_efi = have_header and efi_libdir != '' else - have_gnu_efi = false + have_gnu_efi = false endif if get_option('gnu-efi') == 'true' and not have_gnu_efi - error('gnu-efi support requested, but headers were not found') + error('gnu-efi support requested, but headers were not found') endif if have_gnu_efi - efi_conf = configuration_data() - efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) - efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) + efi_conf = configuration_data() + efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) + efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) - efi_config_h = configure_file( - output : 'efi_config.h', - configuration : efi_conf) + efi_config_h = configure_file( + output : 'efi_config.h', + configuration : efi_conf) - objcopy = find_program('objcopy') + objcopy = find_program('objcopy') - efi_ldsdir = get_option('efi-ldsdir') - if efi_ldsdir == '' - efi_ldsdir = join_paths(efi_libdir, 'gnuefi') - endif + efi_ldsdir = get_option('efi-ldsdir') + if efi_ldsdir == '' + efi_ldsdir = join_paths(efi_libdir, 'gnuefi') + endif - message('efi-libdir: "@0@"'.format(efi_libdir)) - message('efi-ldsdir: "@0@"'.format(efi_ldsdir)) - message('efi-includedir: "@0@"'.format(efi_incdir)) + message('efi-libdir: "@0@"'.format(efi_libdir)) + message('efi-ldsdir: "@0@"'.format(efi_ldsdir)) + message('efi-includedir: "@0@"'.format(efi_incdir)) - compile_args = ['-Wall', - '-Wextra', - '-std=gnu90', - '-nostdinc', - '-ggdb', '-O0', - '-fpic', - '-fshort-wchar', - '-ffreestanding', - '-fno-strict-aliasing', - '-fno-stack-protector', - '-Wsign-compare', - '-Wno-missing-field-initializers', - '-isystem', efi_incdir, - '-isystem', join_paths(efi_incdir, efi_arch), - '-include', efi_config_h] - if efi_arch == 'x86_64' - compile_args += ['-mno-red-zone', - '-mno-sse', - '-mno-mmx', - '-DEFI_FUNCTION_WRAPPER', - '-DGNU_EFI_USE_MS_ABI'] - elif efi_arch == 'ia32' - compile_args += ['-mno-sse', - '-mno-mmx'] - endif + compile_args = ['-Wall', + '-Wextra', + '-std=gnu90', + '-nostdinc', + '-ggdb', '-O0', + '-fpic', + '-fshort-wchar', + '-ffreestanding', + '-fno-strict-aliasing', + '-fno-stack-protector', + '-Wsign-compare', + '-Wno-missing-field-initializers', + '-isystem', efi_incdir, + '-isystem', join_paths(efi_incdir, efi_arch), + '-include', efi_config_h] + if efi_arch == 'x86_64' + compile_args += ['-mno-red-zone', + '-mno-sse', + '-mno-mmx', + '-DEFI_FUNCTION_WRAPPER', + '-DGNU_EFI_USE_MS_ABI'] + elif efi_arch == 'ia32' + compile_args += ['-mno-sse', + '-mno-mmx'] + endif - efi_ldflags = ['-T', - '@0@/elf_@1@_efi.lds'.format(efi_ldsdir, efi_arch), - '-shared', - '-Bsymbolic', - '-nostdlib', - '-znocombreloc', - '-L', efi_libdir, - '@0@/crt0-efi-@1@.o'.format(efi_ldsdir, efi_arch)] - if efi_arch == 'aarch64' or efi_arch == 'arm' - # Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' - # instead, and add required symbols manually. - efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa'] - efi_format = ['-O', 'binary'] - else - efi_format = ['--target=efi-app-@0@'.format(efi_arch)] - endif + efi_ldflags = ['-T', + '@0@/elf_@1@_efi.lds'.format(efi_ldsdir, efi_arch), + '-shared', + '-Bsymbolic', + '-nostdlib', + '-znocombreloc', + '-L', efi_libdir, + '@0@/crt0-efi-@1@.o'.format(efi_ldsdir, efi_arch)] + if efi_arch == 'aarch64' or efi_arch == 'arm' + # Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' + # instead, and add required symbols manually. + efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa'] + efi_format = ['-O', 'binary'] + else + efi_format = ['--target=efi-app-@0@'.format(efi_arch)] + endif - systemd_boot_objects = [] - stub_objects = [] - foreach file : common_sources + systemd_boot_sources + stub_sources - o_file = custom_target(file + '.o', - input : file, - output : file + '.o', - command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@'] - + compile_args, - depend_files : efi_headers) - if (common_sources + systemd_boot_sources).contains(file) - systemd_boot_objects += [o_file] - endif - if (common_sources + stub_sources).contains(file) - stub_objects += [o_file] - endif - endforeach + systemd_boot_objects = [] + stub_objects = [] + foreach file : common_sources + systemd_boot_sources + stub_sources + o_file = custom_target(file + '.o', + input : file, + output : file + '.o', + command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@'] + + compile_args, + depend_files : efi_headers) + if (common_sources + systemd_boot_sources).contains(file) + systemd_boot_objects += [o_file] + endif + if (common_sources + stub_sources).contains(file) + stub_objects += [o_file] + endif + endforeach - libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip() - systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME) - stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME) - no_undefined_symbols = find_program('no-undefined-symbols.sh') + libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip() + systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME) + stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME) + no_undefined_symbols = find_program('no-undefined-symbols.sh') - foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects], - ['stub.so', stub_efi_name, stub_objects]] - so = custom_target( - tuple[0], - input : tuple[2], - output : tuple[0], - command : [efi_ld, '-o', '@OUTPUT@'] + - efi_ldflags + tuple[2] + - ['-lefi', '-lgnuefi', libgcc_file_name]) + foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects], + ['stub.so', stub_efi_name, stub_objects]] + so = custom_target( + tuple[0], + input : tuple[2], + output : tuple[0], + command : [efi_ld, '-o', '@OUTPUT@'] + + efi_ldflags + tuple[2] + + ['-lefi', '-lgnuefi', libgcc_file_name]) - test('no-undefined-symbols-' + tuple[0], - no_undefined_symbols, - args : [so]) + test('no-undefined-symbols-' + tuple[0], + no_undefined_symbols, + args : [so]) - stub = custom_target( - tuple[1], - input : so, - output : tuple[1], - command : [objcopy, - '-j', '.text', - '-j', '.sdata', - '-j', '.data', - '-j', '.dynamic', - '-j', '.dynsym', - '-j', '.rel', - '-j', '.rela', - '-j', '.reloc'] - + efi_format + - ['@INPUT@', '@OUTPUT@'], - install : true, - install_dir : bootlibdir) + stub = custom_target( + tuple[1], + input : so, + output : tuple[1], + command : [objcopy, + '-j', '.text', + '-j', '.sdata', + '-j', '.data', + '-j', '.dynamic', + '-j', '.dynsym', + '-j', '.rel', + '-j', '.rela', + '-j', '.reloc'] + + efi_format + + ['@INPUT@', '@OUTPUT@'], + install : true, + install_dir : bootlibdir) - set_variable(tuple[0].underscorify(), so) - set_variable(tuple[0].underscorify() + '_stub', stub) - endforeach + set_variable(tuple[0].underscorify(), so) + set_variable(tuple[0].underscorify() + '_stub', stub) + endforeach endif ############################################################ if have_gnu_efi - test_efi_disk_img = custom_target( - 'test-efi-disk.img', - input : [systemd_boot_so, stub_so_stub], - output : 'test-efi-disk.img', - command : [test_efi_create_disk_sh, '@OUTPUT@', '@INPUT0@', '@INPUT1@', splash_bmp]) + test_efi_disk_img = custom_target( + 'test-efi-disk.img', + input : [systemd_boot_so, stub_so_stub], + output : 'test-efi-disk.img', + command : [test_efi_create_disk_sh, '@OUTPUT@', + '@INPUT0@', '@INPUT1@', splash_bmp]) endif diff --git a/src/core/meson.build b/src/core/meson.build index a06c9414d1..e41922bf0a 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -1,191 +1,189 @@ -# -*- mode: meson -*- - libcore_la_sources = ''' - unit.c - unit.h - unit-printf.c - unit-printf.h - job.c - job.h - manager.c - manager.h - transaction.c - transaction.h - load-fragment.c - load-fragment.h - service.c - service.h - socket.c - socket.h - busname.c - busname.h - bus-policy.c - bus-policy.h - target.c - target.h - device.c - device.h - mount.c - mount.h - automount.c - automount.h - swap.c - swap.h - timer.c - timer.h - path.c - path.h - slice.c - slice.h - scope.c - scope.h - load-dropin.c - load-dropin.h - execute.c - execute.h - dynamic-user.c - dynamic-user.h - kill.c - kill.h - dbus.c - dbus.h - dbus-manager.c - dbus-manager.h - dbus-unit.c - dbus-unit.h - dbus-job.c - dbus-job.h - dbus-service.c - dbus-service.h - dbus-socket.c - dbus-socket.h - dbus-busname.c - dbus-busname.h - dbus-target.c - dbus-target.h - dbus-device.c - dbus-device.h - dbus-mount.c - dbus-mount.h - dbus-automount.c - dbus-automount.h - dbus-swap.c - dbus-swap.h - dbus-timer.c - dbus-timer.h - dbus-path.c - dbus-path.h - dbus-slice.c - dbus-slice.h - dbus-scope.c - dbus-scope.h - dbus-execute.c - dbus-execute.h - dbus-kill.c - dbus-kill.h - dbus-cgroup.c - dbus-cgroup.h - cgroup.c - cgroup.h - selinux-access.c - selinux-access.h - selinux-setup.c - selinux-setup.h - smack-setup.c - smack-setup.h - ima-setup.c - ima-setup.h - locale-setup.h - locale-setup.c - hostname-setup.c - hostname-setup.h - machine-id-setup.c - machine-id-setup.h - mount-setup.c - mount-setup.h - kmod-setup.c - kmod-setup.h - loopback-setup.h - loopback-setup.c - namespace.c - namespace.h - killall.h - killall.c - audit-fd.c - audit-fd.h - show-status.c - show-status.h - emergency-action.c - emergency-action.h + unit.c + unit.h + unit-printf.c + unit-printf.h + job.c + job.h + manager.c + manager.h + transaction.c + transaction.h + load-fragment.c + load-fragment.h + service.c + service.h + socket.c + socket.h + busname.c + busname.h + bus-policy.c + bus-policy.h + target.c + target.h + device.c + device.h + mount.c + mount.h + automount.c + automount.h + swap.c + swap.h + timer.c + timer.h + path.c + path.h + slice.c + slice.h + scope.c + scope.h + load-dropin.c + load-dropin.h + execute.c + execute.h + dynamic-user.c + dynamic-user.h + kill.c + kill.h + dbus.c + dbus.h + dbus-manager.c + dbus-manager.h + dbus-unit.c + dbus-unit.h + dbus-job.c + dbus-job.h + dbus-service.c + dbus-service.h + dbus-socket.c + dbus-socket.h + dbus-busname.c + dbus-busname.h + dbus-target.c + dbus-target.h + dbus-device.c + dbus-device.h + dbus-mount.c + dbus-mount.h + dbus-automount.c + dbus-automount.h + dbus-swap.c + dbus-swap.h + dbus-timer.c + dbus-timer.h + dbus-path.c + dbus-path.h + dbus-slice.c + dbus-slice.h + dbus-scope.c + dbus-scope.h + dbus-execute.c + dbus-execute.h + dbus-kill.c + dbus-kill.h + dbus-cgroup.c + dbus-cgroup.h + cgroup.c + cgroup.h + selinux-access.c + selinux-access.h + selinux-setup.c + selinux-setup.h + smack-setup.c + smack-setup.h + ima-setup.c + ima-setup.h + locale-setup.h + locale-setup.c + hostname-setup.c + hostname-setup.h + machine-id-setup.c + machine-id-setup.h + mount-setup.c + mount-setup.h + kmod-setup.c + kmod-setup.h + loopback-setup.h + loopback-setup.c + namespace.c + namespace.h + killall.h + killall.c + audit-fd.c + audit-fd.h + show-status.c + show-status.h + emergency-action.c + emergency-action.h '''.split() load_fragment_gperf_gperf = custom_target( - 'load-fragment-gperf.gperf', - input : 'load-fragment-gperf.gperf.m4', - output: 'load-fragment-gperf.gperf', - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true) + 'load-fragment-gperf.gperf', + input : 'load-fragment-gperf.gperf.m4', + output: 'load-fragment-gperf.gperf', + command : [m4, '-P'] + m4_defines + ['@INPUT@'], + capture : true) load_fragment_gperf_c = custom_target( - 'load-fragment-gperf.c', - input : load_fragment_gperf_gperf, - output : 'load-fragment-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'load-fragment-gperf.c', + input : load_fragment_gperf_gperf, + output : 'load-fragment-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) awkscript = 'load-fragment-gperf-nulstr.awk' load_fragment_gperf_nulstr_c = custom_target( - 'load-fragment-gperf-nulstr.c', - input : [awkscript, load_fragment_gperf_gperf], - output : 'load-fragment-gperf-nulstr.c', - command : [awk, '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + 'load-fragment-gperf-nulstr.c', + input : [awkscript, load_fragment_gperf_gperf], + output : 'load-fragment-gperf-nulstr.c', + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) libcore = static_library( - 'core', - libcore_la_sources, - load_fragment_gperf_c, - load_fragment_gperf_nulstr_c, - include_directories : includes, - link_with : [libshared_static], - dependencies : [threads, - libpam, - libaudit, - libkmod, - libapparmor, - libmount]) + 'core', + libcore_la_sources, + load_fragment_gperf_c, + load_fragment_gperf_nulstr_c, + include_directories : includes, + link_with : [libshared_static], + dependencies : [threads, + libpam, + libaudit, + libkmod, + libapparmor, + libmount]) systemd_sources = files('main.c') systemd_shutdown_sources = files(''' - shutdown.c - umount.c - umount.h - mount-setup.c - mount-setup.h - killall.c - killall.h + shutdown.c + umount.c + umount.h + mount-setup.c + mount-setup.h + killall.c + killall.h '''.split()) -in_files = [['macros.systemd', rpmmacrosdir], - ['triggers.systemd', ''], - ['systemd.pc', pkgconfigdatadir]] +in_files = [['macros.systemd', rpmmacrosdir], + ['triggers.systemd', ''], + ['systemd.pc', pkgconfigdatadir]] foreach item : in_files - file = item[0] - dir = item[1] + file = item[0] + dir = item[1] - # If "no", disable generation completely. - # If "", generate, but do not install. - if dir != 'no' - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - if dir != '' - install_data(gen, - install_dir : dir) - endif - endif + # If 'no', disable generation completely. + # If '', generate, but do not install. + if dir != 'no' + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + if dir != '' + install_data(gen, + install_dir : dir) + endif + endif endforeach install_data('org.freedesktop.systemd1.conf', @@ -194,17 +192,17 @@ install_data('org.freedesktop.systemd1.service', install_dir : dbussystemservicedir) policy_in = configure_file( - input : 'org.freedesktop.systemd1.policy.in.in', - output : 'org.freedesktop.systemd1.policy.in', - configuration : substs) + input : 'org.freedesktop.systemd1.policy.in.in', + output : 'org.freedesktop.systemd1.policy.in', + configuration : substs) custom_target( - 'org.freedesktop.systemd1.policy', - input : policy_in, - output : 'org.freedesktop.systemd1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + 'org.freedesktop.systemd1.policy', + input : policy_in, + output : 'org.freedesktop.systemd1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) # TODO: this might work with meson from git, see # https://github.com/mesonbuild/meson/issues/1441#issuecomment-283585493 diff --git a/src/coredump/meson.build b/src/coredump/meson.build index f70a65f7a7..ab3be6a7de 100644 --- a/src/coredump/meson.build +++ b/src/coredump/meson.build @@ -1,14 +1,12 @@ -# -*- mode: meson -*- - systemd_coredump_sources = files(''' - coredump.c - coredump-vacuum.c - coredump-vacuum.h + coredump.c + coredump-vacuum.c + coredump-vacuum.h '''.split()) if conf.get('HAVE_ELFUTILS', 0) == 1 - systemd_coredump_sources += files(['stacktrace.c', - 'stacktrace.h']) + systemd_coredump_sources += files(['stacktrace.c', + 'stacktrace.h']) endif coredumpctl_sources = files('coredumpctl.c') @@ -17,10 +15,10 @@ install_data('coredump.conf', install_dir : pkgsysconfdir) tests += [ - [['src/coredump/test-coredump-vacuum.c', - 'src/coredump/coredump-vacuum.c', - 'src/coredump/coredump-vacuum.h'], - [], - [], - 'ENABLE_COREDUMP', 'manual'], - ] + [['src/coredump/test-coredump-vacuum.c', + 'src/coredump/coredump-vacuum.c', + 'src/coredump/coredump-vacuum.h'], + [], + [], + 'ENABLE_COREDUMP', 'manual'], +] diff --git a/src/hostname/meson.build b/src/hostname/meson.build index 6985a41910..68275ba8f5 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -1,16 +1,14 @@ -# -*- mode: meson -*- - install_data('org.freedesktop.hostname1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.hostname1.service', install_dir : dbussystemservicedir) if conf.get('ENABLE_HOSTNAMED', 0) == 1 - custom_target( - 'org.freedesktop.hostname1.policy', - input : 'org.freedesktop.hostname1.policy.in', - output : 'org.freedesktop.hostname1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.hostname1.policy', + input : 'org.freedesktop.hostname1.policy.in', + output : 'org.freedesktop.hostname1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) endif diff --git a/src/import/meson.build b/src/import/meson.build index 66f43dd714..f0ed92b4c2 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -1,79 +1,77 @@ -# -*- mode: meson -*- - systemd_importd_sources = files(''' - importd.c + importd.c '''.split()) systemd_pull_sources = files(''' - pull.c - pull-raw.c - pull-raw.h - pull-tar.c - pull-tar.h - pull-job.c - pull-job.h - pull-common.c - pull-common.h - import-common.c - import-common.h - import-compress.c - import-compress.h - curl-util.c - curl-util.h - qcow2-util.c - qcow2-util.h + pull.c + pull-raw.c + pull-raw.h + pull-tar.c + pull-tar.h + pull-job.c + pull-job.h + pull-common.c + pull-common.h + import-common.c + import-common.h + import-compress.c + import-compress.h + curl-util.c + curl-util.h + qcow2-util.c + qcow2-util.h '''.split()) systemd_import_sources = files(''' - import.c - import-raw.c - import-raw.h - import-tar.c - import-tar.h - import-common.c - import-common.h - import-compress.c - import-compress.h - qcow2-util.c - qcow2-util.h + import.c + import-raw.c + import-raw.h + import-tar.c + import-tar.h + import-common.c + import-common.h + import-compress.c + import-compress.h + qcow2-util.c + qcow2-util.h '''.split()) systemd_export_sources = files(''' - export.c - export-tar.c - export-tar.h - export-raw.c - export-raw.h - import-common.c - import-common.h - import-compress.c - import-compress.h + export.c + export-tar.c + export-tar.h + export-raw.c + export-raw.h + import-common.c + import-common.h + import-compress.c + import-compress.h '''.split()) if conf.get('ENABLE_IMPORTD', 0) == 1 - install_data('org.freedesktop.import1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.import1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.import1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.import1.service', + install_dir : dbussystemservicedir) - custom_target( - 'org.freedesktop.import1.policy', - input : 'org.freedesktop.import1.policy.in', - output : 'org.freedesktop.import1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.import1.policy', + input : 'org.freedesktop.import1.policy.in', + output : 'org.freedesktop.import1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) - install_data('import-pubring.gpg', - install_dir : rootlibexecdir) - # TODO: shouldn't this be in pkgdatadir? + install_data('import-pubring.gpg', + install_dir : rootlibexecdir) + # TODO: shouldn't this be in pkgdatadir? endif tests += [ - [['src/import/test-qcow2.c', - 'src/import/qcow2-util.c', - 'src/import/qcow2-util.h'], - [libshared], - [libz], - 'HAVE_ZLIB', 'manual'], - ] + [['src/import/test-qcow2.c', + 'src/import/qcow2-util.c', + 'src/import/qcow2-util.h'], + [libshared], + [libz], + 'HAVE_ZLIB', 'manual'], +] diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index c182e7c477..394be7068c 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -1,44 +1,42 @@ -# -*- mode: meson -*- - systemd_journal_upload_sources = files(''' - journal-upload.h - journal-upload.c - journal-upload-journal.c + journal-upload.h + journal-upload.c + journal-upload-journal.c '''.split()) systemd_journal_remote_sources = files(''' - journal-remote-parse.h - journal-remote-parse.c - journal-remote-write.h - journal-remote-write.c - journal-remote.h - journal-remote.c - microhttpd-util.h - microhttpd-util.c + journal-remote-parse.h + journal-remote-parse.c + journal-remote-write.h + journal-remote-write.c + journal-remote.h + journal-remote.c + microhttpd-util.h + microhttpd-util.c '''.split()) systemd_journal_gatewayd_sources = files(''' - journal-gatewayd.c - microhttpd-util.h - microhttpd-util.c + journal-gatewayd.c + microhttpd-util.h + microhttpd-util.c '''.split()) if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 - journal_upload_conf = configure_file( - input : 'journal-upload.conf.in', - output : 'journal-upload.conf', - configuration : substs) - install_data(journal_upload_conf, - install_dir : pkgsysconfdir) + journal_upload_conf = configure_file( + input : 'journal-upload.conf.in', + output : 'journal-upload.conf', + configuration : substs) + install_data(journal_upload_conf, + install_dir : pkgsysconfdir) endif if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 - journal_remote_conf = configure_file( - input : 'journal-remote.conf.in', - output : 'journal-remote.conf', - configuration : substs) - install_data(journal_remote_conf, - install_dir : pkgsysconfdir) + journal_remote_conf = configure_file( + input : 'journal-remote.conf.in', + output : 'journal-remote.conf', + configuration : substs) + install_data(journal_remote_conf, + install_dir : pkgsysconfdir) endif install_data('browse.html', diff --git a/src/journal/meson.build b/src/journal/meson.build index 2457bc7234..71396af529 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -1,25 +1,23 @@ -# -*- mode: meson -*- - journal_internal_sources = files(''' - audit-type.c - audit-type.h - catalog.c - catalog.h - compress.c - compress.h - journal-def.h - journal-file.c - journal-file.h - journal-send.c - journal-vacuum.c - journal-vacuum.h - journal-verify.c - journal-verify.h - lookup3.c - lookup3.h - mmap-cache.c - mmap-cache.h - sd-journal.c + audit-type.c + audit-type.h + catalog.c + catalog.h + compress.c + compress.h + journal-def.h + journal-file.c + journal-file.h + journal-send.c + journal-vacuum.c + journal-vacuum.h + journal-verify.c + journal-verify.h + lookup3.c + lookup3.h + mmap-cache.c + mmap-cache.h + sd-journal.c '''.split()) ############################################################ @@ -28,82 +26,86 @@ audit_type_includes = [config_h, missing_h, 'linux/audit.h'] if conf.get('HAVE_AUDIT', 0) == 1 - audit_type_includes += 'libaudit.h' + audit_type_includes += 'libaudit.h' endif generate_audit_type_list = find_program('generate-audit_type-list.sh') audit_type_list_txt = custom_target( - 'audit_type-list.txt', - output : 'audit_type-list.txt', - command : [generate_audit_type_list, cpp] + audit_type_includes, - capture : true) + 'audit_type-list.txt', + output : 'audit_type-list.txt', + command : [generate_audit_type_list, cpp] + audit_type_includes, + capture : true) audit_type_to_name = custom_target( - 'audit_type-to-name.h', - input : ['audit_type-to-name.awk', audit_type_list_txt], - output : 'audit_type-to-name.h', - command : [awk, '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + 'audit_type-to-name.h', + input : ['audit_type-to-name.awk', audit_type_list_txt], + output : 'audit_type-to-name.h', + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) journal_internal_sources += [audit_type_to_name] ############################################################ libjournal_core_sources = files(''' - journald-kmsg.c - journald-kmsg.h - journald-syslog.c - journald-syslog.h - journald-stream.c - journald-stream.h - journald-server.c - journald-server.h - journald-console.c - journald-console.h - journald-wall.c - journald-wall.h - journald-native.c - journald-native.h - journald-audit.c - journald-audit.h - journald-rate-limit.c - journald-rate-limit.h - journal-internal.h + journald-kmsg.c + journald-kmsg.h + journald-syslog.c + journald-syslog.h + journald-stream.c + journald-stream.h + journald-server.c + journald-server.h + journald-console.c + journald-console.h + journald-wall.c + journald-wall.h + journald-native.c + journald-native.h + journald-audit.c + journald-audit.h + journald-rate-limit.c + journald-rate-limit.h + journal-internal.h '''.split()) systemd_journald_sources = files(''' - journald.c - journald-server.h + journald.c + journald-server.h '''.split()) journald_gperf_c = custom_target( - 'journald-gperf.c', - input : 'journald-gperf.gperf', - output : 'journald-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'journald-gperf.c', + input : 'journald-gperf.gperf', + output : 'journald-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) systemd_cat_sources = files('cat.c') journalctl_sources = files('journalctl.c') if conf.get('HAVE_QRENCODE', 0) == 1 - journalctl_sources += files('journal-qrcode.c', - 'journal-qrcode.h') + journalctl_sources += files('journal-qrcode.c', + 'journal-qrcode.h') endif install_data('journald.conf', install_dir : pkgsysconfdir) -meson.add_install_script('sh', '-c', - mkdir_p.format('/var/log/journal')) -meson.add_install_script('sh', '-c', - 'chown 0:0 $DESTDIR/var/log/journal && - chmod 755 $DESTDIR/var/log/journal || :') +meson.add_install_script( + 'sh', '-c', + mkdir_p.format('/var/log/journal')) +meson.add_install_script( + 'sh', '-c', + 'chown 0:0 $DESTDIR/var/log/journal && + chmod 755 $DESTDIR/var/log/journal || :') if get_option('adm-group') - meson.add_install_script('sh', '-c', - 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') + meson.add_install_script( + 'sh', '-c', + 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') endif if get_option('wheel-group') - meson.add_install_script('sh', '-c', - 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') + meson.add_install_script( + 'sh', '-c', + 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') endif diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build index 3e2d2e587c..ede3323bab 100644 --- a/src/kernel-install/meson.build +++ b/src/kernel-install/meson.build @@ -1,5 +1,3 @@ -# -*- mode: meson -*- - install_data('kernel-install', install_mode : 'rwxr-xr-x', install_dir : bindir) diff --git a/src/libsystemd-network/meson.build b/src/libsystemd-network/meson.build index 496601dfa7..3285bcaed1 100644 --- a/src/libsystemd-network/meson.build +++ b/src/libsystemd-network/meson.build @@ -1,48 +1,46 @@ -# -*- mode: meson -*- - sources = files(''' - sd-dhcp-client.c - sd-dhcp-server.c - dhcp-network.c - dhcp-option.c - dhcp-packet.c - dhcp-internal.h - dhcp-server-internal.h - dhcp-protocol.h - dhcp-lease-internal.h - sd-dhcp-lease.c - sd-ipv4ll.c - sd-ipv4acd.c - arp-util.h - arp-util.c - network-internal.c - sd-ndisc.c - ndisc-internal.h - ndisc-router.h - ndisc-router.c - icmp6-util.h - icmp6-util.c - sd-dhcp6-client.c - dhcp6-internal.h - dhcp6-protocol.h - dhcp6-network.c - dhcp6-option.c - dhcp6-lease-internal.h - sd-dhcp6-lease.c - dhcp-identifier.h - dhcp-identifier.c - lldp-internal.h - lldp-network.h - lldp-network.c - lldp-neighbor.h - lldp-neighbor.c - sd-lldp.c + sd-dhcp-client.c + sd-dhcp-server.c + dhcp-network.c + dhcp-option.c + dhcp-packet.c + dhcp-internal.h + dhcp-server-internal.h + dhcp-protocol.h + dhcp-lease-internal.h + sd-dhcp-lease.c + sd-ipv4ll.c + sd-ipv4acd.c + arp-util.h + arp-util.c + network-internal.c + sd-ndisc.c + ndisc-internal.h + ndisc-router.h + ndisc-router.c + icmp6-util.h + icmp6-util.c + sd-dhcp6-client.c + dhcp6-internal.h + dhcp6-protocol.h + dhcp6-network.c + dhcp6-option.c + dhcp6-lease-internal.h + sd-dhcp6-lease.c + dhcp-identifier.h + dhcp-identifier.c + lldp-internal.h + lldp-network.h + lldp-network.c + lldp-neighbor.h + lldp-neighbor.c + sd-lldp.c '''.split()) network_internal_h = files('network-internal.h') libsystemd_network = static_library( - 'systemd-network', - sources, - network_internal_h, - include_directories : includes) + 'systemd-network', + sources, + network_internal_h, + include_directories : includes) diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 15e7d77693..ab69afee42 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -1,98 +1,96 @@ -# -*- mode: meson -*- - sd_login_c = files('sd-login/sd-login.c') libsystemd_internal_sources = files(''' - sd-bus/bus-bloom.c - sd-bus/bus-bloom.h - sd-bus/bus-common-errors.c - sd-bus/bus-common-errors.h - sd-bus/bus-container.c - sd-bus/bus-container.h - sd-bus/bus-control.c - sd-bus/bus-control.h - sd-bus/bus-convenience.c - sd-bus/bus-creds.c - sd-bus/bus-creds.h - sd-bus/bus-dump.c - sd-bus/bus-dump.h - sd-bus/bus-error.c - sd-bus/bus-error.h - sd-bus/bus-gvariant.c - sd-bus/bus-gvariant.h - sd-bus/bus-internal.c - sd-bus/bus-internal.h - sd-bus/bus-introspect.c - sd-bus/bus-introspect.h - sd-bus/bus-kernel.c - sd-bus/bus-kernel.h - sd-bus/bus-match.c - sd-bus/bus-match.h - sd-bus/bus-message.c - sd-bus/bus-message.h - sd-bus/bus-objects.c - sd-bus/bus-objects.h - sd-bus/bus-protocol.h - sd-bus/bus-signature.c - sd-bus/bus-signature.h - sd-bus/bus-slot.c - sd-bus/bus-slot.h - sd-bus/bus-socket.c - sd-bus/bus-socket.h - sd-bus/bus-track.c - sd-bus/bus-track.h - sd-bus/bus-type.c - sd-bus/bus-type.h - sd-bus/kdbus.h - sd-bus/sd-bus.c - sd-daemon/sd-daemon.c - sd-device/device-enumerator-private.h - sd-device/device-enumerator.c - sd-device/device-internal.h - sd-device/device-private.c - sd-device/device-private.h - sd-device/device-util.h - sd-device/sd-device.c - sd-event/sd-event.c - sd-hwdb/hwdb-internal.h - sd-hwdb/hwdb-util.h - sd-hwdb/sd-hwdb.c - sd-id128/id128-util.c - sd-id128/id128-util.h - sd-id128/sd-id128.c - sd-netlink/local-addresses.c - sd-netlink/local-addresses.h - sd-netlink/netlink-internal.h - sd-netlink/netlink-message.c - sd-netlink/netlink-socket.c - sd-netlink/netlink-types.c - sd-netlink/netlink-types.h - sd-netlink/netlink-util.c - sd-netlink/netlink-util.h - sd-netlink/rtnl-message.c - sd-netlink/sd-netlink.c - sd-network/network-util.c - sd-network/network-util.h - sd-network/sd-network.c - sd-path/sd-path.c - sd-resolve/sd-resolve.c - sd-utf8/sd-utf8.c + sd-bus/bus-bloom.c + sd-bus/bus-bloom.h + sd-bus/bus-common-errors.c + sd-bus/bus-common-errors.h + sd-bus/bus-container.c + sd-bus/bus-container.h + sd-bus/bus-control.c + sd-bus/bus-control.h + sd-bus/bus-convenience.c + sd-bus/bus-creds.c + sd-bus/bus-creds.h + sd-bus/bus-dump.c + sd-bus/bus-dump.h + sd-bus/bus-error.c + sd-bus/bus-error.h + sd-bus/bus-gvariant.c + sd-bus/bus-gvariant.h + sd-bus/bus-internal.c + sd-bus/bus-internal.h + sd-bus/bus-introspect.c + sd-bus/bus-introspect.h + sd-bus/bus-kernel.c + sd-bus/bus-kernel.h + sd-bus/bus-match.c + sd-bus/bus-match.h + sd-bus/bus-message.c + sd-bus/bus-message.h + sd-bus/bus-objects.c + sd-bus/bus-objects.h + sd-bus/bus-protocol.h + sd-bus/bus-signature.c + sd-bus/bus-signature.h + sd-bus/bus-slot.c + sd-bus/bus-slot.h + sd-bus/bus-socket.c + sd-bus/bus-socket.h + sd-bus/bus-track.c + sd-bus/bus-track.h + sd-bus/bus-type.c + sd-bus/bus-type.h + sd-bus/kdbus.h + sd-bus/sd-bus.c + sd-daemon/sd-daemon.c + sd-device/device-enumerator-private.h + sd-device/device-enumerator.c + sd-device/device-internal.h + sd-device/device-private.c + sd-device/device-private.h + sd-device/device-util.h + sd-device/sd-device.c + sd-event/sd-event.c + sd-hwdb/hwdb-internal.h + sd-hwdb/hwdb-util.h + sd-hwdb/sd-hwdb.c + sd-id128/id128-util.c + sd-id128/id128-util.h + sd-id128/sd-id128.c + sd-netlink/local-addresses.c + sd-netlink/local-addresses.h + sd-netlink/netlink-internal.h + sd-netlink/netlink-message.c + sd-netlink/netlink-socket.c + sd-netlink/netlink-types.c + sd-netlink/netlink-types.h + sd-netlink/netlink-util.c + sd-netlink/netlink-util.h + sd-netlink/rtnl-message.c + sd-netlink/sd-netlink.c + sd-network/network-util.c + sd-network/network-util.h + sd-network/sd-network.c + sd-path/sd-path.c + sd-resolve/sd-resolve.c + sd-utf8/sd-utf8.c '''.split()) + sd_login_c libsystemd_internal = static_library( - 'systemd', - libsystemd_internal_sources, - install : false, - include_directories : includes, - link_with : libbasic, - dependencies : [threads, - librt]) + 'systemd', + libsystemd_internal_sources, + install : false, + include_directories : includes, + link_with : libbasic, + dependencies : [threads, + librt]) libsystemd_sym = 'src/libsystemd/libsystemd.sym' libsystemd_pc = configure_file( - input : 'libsystemd.pc.in', - output : 'libsystemd.pc', - configuration : substs) + input : 'libsystemd.pc.in', + output : 'libsystemd.pc', + configuration : substs) install_data(libsystemd_pc, install_dir : pkgconfiglibdir) diff --git a/src/libudev/meson.build b/src/libudev/meson.build index 6c5ebebb7c..1378f9a251 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -1,17 +1,15 @@ -# -*- mode: meson -*- - libudev_sources = files(''' - libudev-private.h - libudev-device-internal.h - libudev.c - libudev-list.c - libudev-util.c - libudev-device.c - libudev-device-private.c - libudev-enumerate.c - libudev-monitor.c - libudev-queue.c - libudev-hwdb.c + libudev-private.h + libudev-device-internal.h + libudev.c + libudev-list.c + libudev-util.c + libudev-device.c + libudev-device-private.c + libudev-enumerate.c + libudev-monitor.c + libudev-queue.c + libudev-hwdb.c '''.split()) ############################################################ @@ -19,25 +17,25 @@ libudev_sources = files(''' libudev_sym = 'libudev.sym' libudev_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym) libudev = shared_library( - 'udev', - libudev_sources, - version : '1.6.6', - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + libudev_sym_path], - link_with : [libbasic, - libsystemd_internal], - dependencies : [threads], - link_depends : libudev_sym, - install : true, - install_dir : rootlibdir) + 'udev', + libudev_sources, + version : '1.6.6', + include_directories : includes, + link_args : ['-shared', + '-Wl,--version-script=' + libudev_sym_path], + link_with : [libbasic, + libsystemd_internal], + dependencies : [threads], + link_depends : libudev_sym, + install : true, + install_dir : rootlibdir) install_headers('libudev.h') libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir()) libudev_pc = configure_file( - input : 'libudev.pc.in', - output : 'libudev.pc', - configuration : substs) + input : 'libudev.pc.in', + output : 'libudev.pc', + configuration : substs) install_data(libudev_pc, install_dir : pkgconfiglibdir) diff --git a/src/locale/meson.build b/src/locale/meson.build index 8bd22fe321..f722e0ed92 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -1,26 +1,24 @@ -# -*- mode: meson -*- - systemd_localed_sources = files(''' - localed.c - keymap-util.c - keymap-util.h + localed.c + keymap-util.c + keymap-util.h '''.split()) localectl_sources = files('localectl.c') if conf.get('ENABLE_LOCALED', 0) == 1 - install_data('org.freedesktop.locale1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.locale1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.locale1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.locale1.service', + install_dir : dbussystemservicedir) - custom_target( - 'org.freedesktop.locale1.policy', - input : 'org.freedesktop.locale1.policy.in', - output : 'org.freedesktop.locale1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.locale1.policy', + input : 'org.freedesktop.locale1.policy.in', + output : 'org.freedesktop.locale1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) endif # If you know a way that allows the same variables to be used @@ -34,9 +32,9 @@ install_data('kbd-model-map', install_dir : pkgdatadir) tests += [ - [['src/locale/test-keymap-util.c', - 'src/locale/keymap-util.c', - 'src/locale/keymap-util.h'], - [libshared], - [libdl]], - ] + [['src/locale/test-keymap-util.c', + 'src/locale/keymap-util.c', + 'src/locale/keymap-util.h'], + [libshared], + [libdl]], +] diff --git a/src/login/meson.build b/src/login/meson.build index d3e2b73e8b..a518215be8 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -1,106 +1,104 @@ -# -*- mode: meson -*- - systemd_logind_sources = files(''' - logind.c - logind.h + logind.c + logind.h '''.split()) logind_gperf_c = custom_target( - 'logind_gperf.c', - input : 'logind-gperf.gperf', - output : 'logind-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'logind_gperf.c', + input : 'logind-gperf.gperf', + output : 'logind-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) systemd_logind_sources += [logind_gperf_c] liblogind_core_sources = files(''' - logind-core.c - logind-device.c - logind-device.h - logind-button.c - logind-button.h - logind-action.c - logind-action.h - logind-seat.c - logind-seat.h - logind-session.c - logind-session.h - logind-session-device.c - logind-session-device.h - logind-user.c - logind-user.h - logind-inhibit.c - logind-inhibit.h - logind-dbus.c - logind-session-dbus.c - logind-seat-dbus.c - logind-user-dbus.c - logind-utmp.c - logind-acl.h + logind-core.c + logind-device.c + logind-device.h + logind-button.c + logind-button.h + logind-action.c + logind-action.h + logind-seat.c + logind-seat.h + logind-session.c + logind-session.h + logind-session-device.c + logind-session-device.h + logind-user.c + logind-user.h + logind-inhibit.c + logind-inhibit.h + logind-dbus.c + logind-session-dbus.c + logind-seat-dbus.c + logind-user-dbus.c + logind-utmp.c + logind-acl.h '''.split()) logind_acl_c = files('logind-acl.c') if conf.get('HAVE_ACL', 0) == 1 - liblogind_core_sources += logind_acl_c + liblogind_core_sources += logind_acl_c endif liblogind_core = static_library( - 'logind-core', - liblogind_core_sources, - include_directories : includes, - dependencies : [libacl]) + 'logind-core', + liblogind_core_sources, + include_directories : includes, + dependencies : [libacl]) loginctl_sources = files(''' - loginctl.c - sysfs-show.h - sysfs-show.c + loginctl.c + sysfs-show.h + sysfs-show.c '''.split()) if conf.get('ENABLE_LOGIND', 0) == 1 - logind_conf = configure_file( - input : 'logind.conf.in', - output : 'logind.conf', - configuration : substs) - install_data(logind_conf, - install_dir : pkgsysconfdir) + logind_conf = configure_file( + input : 'logind.conf.in', + output : 'logind.conf', + configuration : substs) + install_data(logind_conf, + install_dir : pkgsysconfdir) - pam_systemd_sym = 'src/login/pam_systemd.sym' - pam_systemd_c = files('pam_systemd.c') + pam_systemd_sym = 'src/login/pam_systemd.sym' + pam_systemd_c = files('pam_systemd.c') - install_data('org.freedesktop.login1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.login1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.login1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.login1.service', + install_dir : dbussystemservicedir) - custom_target( - 'org.freedesktop.login1.policy', - input : 'org.freedesktop.login1.policy.in', - output : 'org.freedesktop.login1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.login1.policy', + input : 'org.freedesktop.login1.policy.in', + output : 'org.freedesktop.login1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) - install_data('70-power-switch.rules', - '70-uaccess.rules', - install_dir : udevrulesdir) + install_data('70-power-switch.rules', + '70-uaccess.rules', + install_dir : udevrulesdir) - foreach file : ['71-seat.rules', - '73-seat-late.rules'] - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - install_data(gen, - install_dir : udevrulesdir) - endforeach + foreach file : ['71-seat.rules', + '73-seat-late.rules'] + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + install_data(gen, + install_dir : udevrulesdir) + endforeach - custom_target( - 'systemd-user', - input : 'systemd-user.m4', - output: 'systemd-user', - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true, - install : pamconfdir != 'no', - install_dir : pamconfdir) + custom_target( + 'systemd-user', + input : 'systemd-user.m4', + output: 'systemd-user', + command : [m4, '-P'] + m4_defines + ['@INPUT@'], + capture : true, + install : pamconfdir != 'no', + install_dir : pamconfdir) endif diff --git a/src/machine/meson.build b/src/machine/meson.build index 515defcb6c..4ecb1cdb93 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -1,48 +1,46 @@ -# -*- mode: meson -*- - systemd_machined_sources = files(''' - machined.c - machined.h + machined.c + machined.h '''.split()) libmachine_core_sources = files(''' - machine.c - machine.h - machined-dbus.c - machine-dbus.c - machine-dbus.h - image-dbus.c - image-dbus.h - operation.c - operation.h + machine.c + machine.h + machined-dbus.c + machine-dbus.c + machine-dbus.h + image-dbus.c + image-dbus.h + operation.c + operation.h '''.split()) libmachine_core = static_library( - 'machine-core', - libmachine_core_sources, - include_directories : includes, - dependencies : [threads]) + 'machine-core', + libmachine_core_sources, + include_directories : includes, + dependencies : [threads]) if conf.get('ENABLE_MACHINED', 0) == 1 - install_data('org.freedesktop.machine1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.machine1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.machine1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.machine1.service', + install_dir : dbussystemservicedir) - custom_target( - 'org.freedesktop.machine1.policy', - input : 'org.freedesktop.machine1.policy.in', - output : 'org.freedesktop.machine1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.machine1.policy', + input : 'org.freedesktop.machine1.policy.in', + output : 'org.freedesktop.machine1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) endif tests += [ - [['src/machine/test-machine-tables.c'], - [libmachine_core, - libshared, - libudev], - [threads], - 'ENABLE_MACHINED'], - ] + [['src/machine/test-machine-tables.c'], + [libmachine_core, + libshared, + libudev], + [threads], + 'ENABLE_MACHINED'], +] diff --git a/src/network/meson.build b/src/network/meson.build index 1e8da8cfb7..6bbada397d 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -1,74 +1,72 @@ -# -*- mode: meson -*- - sources = files(''' - netdev/bond.c - netdev/bond.h - netdev/bridge.c - netdev/bridge.h - netdev/dummy.c - netdev/dummy.h - netdev/ipvlan.c - netdev/ipvlan.h - netdev/macvlan.c - netdev/macvlan.h - netdev/netdev.c - netdev/netdev.h - netdev/tunnel.c - netdev/tunnel.h - netdev/tuntap.c - netdev/tuntap.h - netdev/vcan.c - netdev/vcan.h - netdev/veth.c - netdev/veth.h - netdev/vlan.c - netdev/vlan.h - netdev/vrf.c - netdev/vrf.h - netdev/vxlan.c - netdev/vxlan.h - networkd-address-pool.c - networkd-address-pool.h - networkd-address.c - networkd-address.h - networkd-brvlan.c - networkd-brvlan.h - networkd-conf.c - networkd-conf.h - networkd-dhcp4.c - networkd-dhcp6.c - networkd-fdb.c - networkd-fdb.h - networkd-ipv4ll.c - networkd-ipv6-proxy-ndp.c - networkd-ipv6-proxy-ndp.h - networkd-link-bus.c - networkd-link.c - networkd-link.h - networkd-lldp-tx.c - networkd-lldp-tx.h - networkd-manager-bus.c - networkd-manager.c - networkd-manager.h - networkd-ndisc.c - networkd-ndisc.h - networkd-network-bus.c - networkd-network.c - networkd-network.h - networkd-route.c - networkd-route.h - networkd-util.c - networkd-util.h + netdev/bond.c + netdev/bond.h + netdev/bridge.c + netdev/bridge.h + netdev/dummy.c + netdev/dummy.h + netdev/ipvlan.c + netdev/ipvlan.h + netdev/macvlan.c + netdev/macvlan.h + netdev/netdev.c + netdev/netdev.h + netdev/tunnel.c + netdev/tunnel.h + netdev/tuntap.c + netdev/tuntap.h + netdev/vcan.c + netdev/vcan.h + netdev/veth.c + netdev/veth.h + netdev/vlan.c + netdev/vlan.h + netdev/vrf.c + netdev/vrf.h + netdev/vxlan.c + netdev/vxlan.h + networkd-address-pool.c + networkd-address-pool.h + networkd-address.c + networkd-address.h + networkd-brvlan.c + networkd-brvlan.h + networkd-conf.c + networkd-conf.h + networkd-dhcp4.c + networkd-dhcp6.c + networkd-fdb.c + networkd-fdb.h + networkd-ipv4ll.c + networkd-ipv6-proxy-ndp.c + networkd-ipv6-proxy-ndp.h + networkd-link-bus.c + networkd-link.c + networkd-link.h + networkd-lldp-tx.c + networkd-lldp-tx.h + networkd-manager-bus.c + networkd-manager.c + networkd-manager.h + networkd-ndisc.c + networkd-ndisc.h + networkd-network-bus.c + networkd-network.c + networkd-network.h + networkd-route.c + networkd-route.h + networkd-util.c + networkd-util.h '''.split()) systemd_networkd_sources = files('networkd.c') systemd_networkd_wait_online_sources = files(''' - wait-online/link.c - wait-online/link.h - wait-online/manager.c - wait-online/manager.h - wait-online/wait-online.c + wait-online/link.c + wait-online/link.h + wait-online/manager.c + wait-online/manager.h + wait-online/wait-online.c '''.split()) + network_internal_h networkctl_sources = files('networkctl.c') @@ -76,48 +74,48 @@ networkctl_sources = files('networkctl.c') network_include_dir = include_directories('.') if conf.get('ENABLE_NETWORKD', 0) == 1 - networkd_gperf_c = custom_target( - 'networkd-gperf.c', - input : 'networkd-gperf.gperf', - output : 'networkd-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + networkd_gperf_c = custom_target( + 'networkd-gperf.c', + input : 'networkd-gperf.gperf', + output : 'networkd-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) - networkd_network_gperf_c = custom_target( - 'networkd-network-gperf.c', - input : 'networkd-network-gperf.gperf', - output : 'networkd-network-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + networkd_network_gperf_c = custom_target( + 'networkd-network-gperf.c', + input : 'networkd-network-gperf.gperf', + output : 'networkd-network-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) - netdev_gperf_c = custom_target( - 'netdev-gperf.c', - input : 'netdev/netdev-gperf.gperf', - output : 'netdev-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + netdev_gperf_c = custom_target( + 'netdev-gperf.c', + input : 'netdev/netdev-gperf.gperf', + output : 'netdev-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) - libnetworkd_core = static_library( - 'networkd-core', - sources, - network_internal_h, - networkd_gperf_c, - networkd_network_gperf_c, - netdev_gperf_c, - include_directories : includes, - link_with : [libshared]) + libnetworkd_core = static_library( + 'networkd-core', + sources, + network_internal_h, + networkd_gperf_c, + networkd_network_gperf_c, + netdev_gperf_c, + include_directories : includes, + link_with : [libshared]) - install_data('org.freedesktop.network1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.network1.service', - install_dir : dbussystemservicedir) - if install_polkit - install_data('systemd-networkd.rules', - install_dir : polkitrulesdir) - endif - if install_polkit_pkla - install_data('systemd-networkd.pkla', - install_dir : polkitpkladir) - endif + install_data('org.freedesktop.network1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.network1.service', + install_dir : dbussystemservicedir) + if install_polkit + install_data('systemd-networkd.rules', + install_dir : polkitrulesdir) + endif + if install_polkit_pkla + install_data('systemd-networkd.pkla', + install_dir : polkitpkladir) + endif - tests += [ + tests += [ [['src/network/test-networkd-conf.c'], [libnetworkd_core, libsystemd_network, diff --git a/src/nspawn/meson.build b/src/nspawn/meson.build index c231486cfc..b6ac6006ab 100644 --- a/src/nspawn/meson.build +++ b/src/nspawn/meson.build @@ -1,42 +1,40 @@ -# -*- mode: meson -*- - systemd_nspawn_sources = files(''' - nspawn.c - nspawn-settings.c - nspawn-settings.h - nspawn-mount.c - nspawn-mount.h - nspawn-network.c - nspawn-network.h - nspawn-expose-ports.c - nspawn-expose-ports.h - nspawn-cgroup.c - nspawn-cgroup.h - nspawn-seccomp.c - nspawn-seccomp.h - nspawn-register.c - nspawn-register.h - nspawn-setuid.c - nspawn-setuid.h - nspawn-stub-pid1.c - nspawn-stub-pid1.h - nspawn-patch-uid.c - nspawn-patch-uid.h + nspawn.c + nspawn-settings.c + nspawn-settings.h + nspawn-mount.c + nspawn-mount.h + nspawn-network.c + nspawn-network.h + nspawn-expose-ports.c + nspawn-expose-ports.h + nspawn-cgroup.c + nspawn-cgroup.h + nspawn-seccomp.c + nspawn-seccomp.h + nspawn-register.c + nspawn-register.h + nspawn-setuid.c + nspawn-setuid.h + nspawn-stub-pid1.c + nspawn-stub-pid1.h + nspawn-patch-uid.c + nspawn-patch-uid.h '''.split()) nspawn_gperf_c = custom_target( - 'nspawn-gperf.c', - input : 'nspawn-gperf.gperf', - output : 'nspawn-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'nspawn-gperf.c', + input : 'nspawn-gperf.gperf', + output : 'nspawn-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) systemd_nspawn_sources += [nspawn_gperf_c] tests += [ - [['src/nspawn/test-patch-uid.c', - 'src/nspawn/nspawn-patch-uid.c', - 'src/nspawn/nspawn-patch-uid.h'], - [libshared], - [libacl], - '', 'manual'], - ] + [['src/nspawn/test-patch-uid.c', + 'src/nspawn/nspawn-patch-uid.c', + 'src/nspawn/nspawn-patch-uid.h'], + [libshared], + [libacl], + '', 'manual'], +] diff --git a/src/resolve/meson.build b/src/resolve/meson.build index f0bbce49c4..b8feb7bb1b 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -1,64 +1,62 @@ -# -*- mode: meson -*- - basic_dns_sources = files(''' - resolved-dns-dnssec.c - resolved-dns-dnssec.h - resolved-dns-packet.c - resolved-dns-packet.h - resolved-dns-rr.c - resolved-dns-rr.h - resolved-dns-answer.c - resolved-dns-answer.h - resolved-dns-question.c - resolved-dns-question.h - dns-type.c + resolved-dns-dnssec.c + resolved-dns-dnssec.h + resolved-dns-packet.c + resolved-dns-packet.h + resolved-dns-rr.c + resolved-dns-rr.h + resolved-dns-answer.c + resolved-dns-answer.h + resolved-dns-question.c + resolved-dns-question.h + dns-type.c '''.split()) dns_type_h = files('dns-type.h')[0] systemd_resolved_only_sources = files(''' - resolved.c - resolved-manager.c - resolved-manager.h - resolved-conf.c - resolved-conf.h - resolved-resolv-conf.c - resolved-resolv-conf.h - resolved-bus.c - resolved-bus.h - resolved-link.h - resolved-link.c - resolved-link-bus.c - resolved-link-bus.h - resolved-llmnr.h - resolved-llmnr.c - resolved-mdns.h - resolved-mdns.c - resolved-def.h - resolved-dns-query.h - resolved-dns-query.c - resolved-dns-synthesize.h - resolved-dns-synthesize.c - resolved-dns-transaction.h - resolved-dns-transaction.c - resolved-dns-scope.h - resolved-dns-scope.c - resolved-dns-server.h - resolved-dns-server.c - resolved-dns-search-domain.h - resolved-dns-search-domain.c - resolved-dns-cache.h - resolved-dns-cache.c - resolved-dns-zone.h - resolved-dns-zone.c - resolved-dns-stream.h - resolved-dns-stream.c - resolved-dns-trust-anchor.h - resolved-dns-trust-anchor.c - resolved-dns-stub.h - resolved-dns-stub.c - resolved-etc-hosts.h - resolved-etc-hosts.c + resolved.c + resolved-manager.c + resolved-manager.h + resolved-conf.c + resolved-conf.h + resolved-resolv-conf.c + resolved-resolv-conf.h + resolved-bus.c + resolved-bus.h + resolved-link.h + resolved-link.c + resolved-link-bus.c + resolved-link-bus.h + resolved-llmnr.h + resolved-llmnr.c + resolved-mdns.h + resolved-mdns.c + resolved-def.h + resolved-dns-query.h + resolved-dns-query.c + resolved-dns-synthesize.h + resolved-dns-synthesize.c + resolved-dns-transaction.h + resolved-dns-transaction.c + resolved-dns-scope.h + resolved-dns-scope.c + resolved-dns-server.h + resolved-dns-server.c + resolved-dns-search-domain.h + resolved-dns-search-domain.c + resolved-dns-cache.h + resolved-dns-cache.c + resolved-dns-zone.h + resolved-dns-zone.c + resolved-dns-stream.h + resolved-dns-stream.c + resolved-dns-trust-anchor.h + resolved-dns-trust-anchor.c + resolved-dns-stub.h + resolved-dns-stub.c + resolved-etc-hosts.h + resolved-etc-hosts.c '''.split()) systemd_resolve_only_sources = files('resolve-tool.c') @@ -66,114 +64,112 @@ systemd_resolve_only_sources = files('resolve-tool.c') ############################################################ dns_type_list_txt = custom_target( - 'dns_type-list.txt', - input : ['generate-dns_type-list.sed', dns_type_h], - output : 'dns_type-list.txt', - command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + 'dns_type-list.txt', + input : ['generate-dns_type-list.sed', dns_type_h], + output : 'dns_type-list.txt', + command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'], + capture : true) generate_dns_type_gperf = find_program('generate-dns_type-gperf.py') dns_type_headers = [dns_type_h] foreach item : [['dns_type', dns_type_list_txt, 'dns_type', 'DNS_TYPE_']] - fname = '@0@-from-name.gperf'.format(item[0]) - gperf_file = custom_target( - fname, - input : item[1], - output : fname, - command : [generate_dns_type_gperf, item[2], item[3], '@INPUT@'], - capture : true) + fname = '@0@-from-name.gperf'.format(item[0]) + gperf_file = custom_target( + fname, + input : item[1], + output : fname, + command : [generate_dns_type_gperf, item[2], item[3], '@INPUT@'], + capture : true) - fname = '@0@-from-name.h'.format(item[0]) - target1 = custom_target( - fname, - input : gperf_file, - output : fname, - command : [gperf, - '-L', 'ANSI-C', '-t', '--ignore-case', - '-N', 'lookup_@0@'.format(item[2]), - '-H', 'hash_@0@_name'.format(item[2]), - '-p', '-C', - '@INPUT@'], - capture : true) + fname = '@0@-from-name.h'.format(item[0]) + target1 = custom_target( + fname, + input : gperf_file, + output : fname, + command : [gperf, + '-L', 'ANSI-C', '-t', '--ignore-case', + '-N', 'lookup_@0@'.format(item[2]), + '-H', 'hash_@0@_name'.format(item[2]), + '-p', '-C', + '@INPUT@'], + capture : true) - fname = '@0@-to-name.h'.format(item[0]) - awkscript = '@0@-to-name.awk'.format(item[0]) - target2 = custom_target( - fname, - input : [awkscript, item[1]], - output : fname, - command : [awk, '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + fname = '@0@-to-name.h'.format(item[0]) + awkscript = '@0@-to-name.awk'.format(item[0]) + target2 = custom_target( + fname, + input : [awkscript, item[1]], + output : fname, + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) - dns_type_headers += [target1, target2] + dns_type_headers += [target1, target2] endforeach resolved_gperf_c = custom_target( - 'resolved_gperf.c', - input : 'resolved-gperf.gperf', - output : 'resolved-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'resolved_gperf.c', + input : 'resolved-gperf.gperf', + output : 'resolved-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) -systemd_resolved_sources = ( - basic_dns_sources + - [resolved_gperf_c] + - systemd_resolved_only_sources + - dns_type_headers) +systemd_resolved_sources = (basic_dns_sources + + [resolved_gperf_c] + + systemd_resolved_only_sources + + dns_type_headers) -systemd_resolve_sources = ( - basic_dns_sources + - systemd_resolve_only_sources + - dns_type_headers) +systemd_resolve_sources = (basic_dns_sources + + systemd_resolve_only_sources + + dns_type_headers) if conf.get('ENABLE_RESOLVED', 0) == 1 - install_data('org.freedesktop.resolve1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.resolve1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.resolve1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.resolve1.service', + install_dir : dbussystemservicedir) - resolved_conf = configure_file( - input : 'resolved.conf.in', - output : 'resolved.conf', - configuration : substs) - install_data(resolved_conf, - install_dir : pkgsysconfdir) + resolved_conf = configure_file( + input : 'resolved.conf.in', + output : 'resolved.conf', + configuration : substs) + install_data(resolved_conf, + install_dir : pkgsysconfdir) endif install_data('resolv.conf', install_dir : rootlibexecdir) tests += [ - [['src/resolve/test-resolve-tables.c', - basic_dns_sources, - dns_type_headers, - 'src/shared/test-tables.h'], - [], - [libgcrypt, - libm], - 'ENABLE_RESOLVED'], + [['src/resolve/test-resolve-tables.c', + basic_dns_sources, + dns_type_headers, + 'src/shared/test-tables.h'], + [], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], - [['src/resolve/test-dns-packet.c', - basic_dns_sources, - dns_type_headers], - [], - [libgcrypt, - libm], - 'ENABLE_RESOLVED'], + [['src/resolve/test-dns-packet.c', + basic_dns_sources, + dns_type_headers], + [], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], - [['src/resolve/test-dnssec.c', - basic_dns_sources, - dns_type_headers], - [], - [libgcrypt, - libm], - 'ENABLE_RESOLVED'], + [['src/resolve/test-dnssec.c', + basic_dns_sources, + dns_type_headers], + [], + [libgcrypt, + libm], + 'ENABLE_RESOLVED'], - [['src/resolve/test-dnssec-complex.c', - 'src/resolve/dns-type.c', - dns_type_headers], - [], - [], - 'ENABLE_RESOLVED', 'manual'], - ] + [['src/resolve/test-dnssec-complex.c', + 'src/resolve/dns-type.c', + dns_type_headers], + [], + [], + 'ENABLE_RESOLVED', 'manual'], +] diff --git a/src/shared/meson.build b/src/shared/meson.build index 4a51241d44..5f48567817 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -1,173 +1,171 @@ -# -*- mode: meson -*- - shared_sources = ''' - acl-util.h - acpi-fpdt.c - acpi-fpdt.h - apparmor-util.c - apparmor-util.h - ask-password-api.c - ask-password-api.h - base-filesystem.c - base-filesystem.h - boot-timestamps.c - boot-timestamps.h - bus-unit-util.c - bus-unit-util.h - bus-util.c - bus-util.h - cgroup-show.c - cgroup-show.h - clean-ipc.c - clean-ipc.h - condition.c - condition.h - conf-parser.c - conf-parser.h - dev-setup.c - dev-setup.h - dissect-image.c - dissect-image.h - dns-domain.c - dns-domain.h - dropin.c - dropin.h - efivars.c - efivars.h - fdset.c - fdset.h - fstab-util.c - fstab-util.h - gcrypt-util.c - gcrypt-util.h - generator.c - generator.h - gpt.h - ima-util.c - ima-util.h - import-util.c - import-util.h - initreq.h - install.c - install.h - install-printf.c - install-printf.h - journal-util.c - journal-util.h - logs-show.c - logs-show.h - loop-util.c - loop-util.h - machine-image.c - machine-image.h - machine-pool.c - machine-pool.h - nsflags.c - nsflags.h - output-mode.c - output-mode.h - pager.c - pager.h - path-lookup.c - path-lookup.h - ptyfwd.c - ptyfwd.h - resolve-util.c - resolve-util.h - seccomp-util.h - sleep-config.c - sleep-config.h - spawn-ask-password-agent.c - spawn-ask-password-agent.h - spawn-polkit-agent.c - spawn-polkit-agent.h - specifier.c - specifier.h - switch-root.c - switch-root.h - sysctl-util.c - sysctl-util.h - tests.c - tests.h - udev-util.h - uid-range.c - uid-range.h - utmp-wtmp.h - vlan-util.c - vlan-util.h - volatile-util.c - volatile-util.h - watchdog.c - watchdog.h + acl-util.h + acpi-fpdt.c + acpi-fpdt.h + apparmor-util.c + apparmor-util.h + ask-password-api.c + ask-password-api.h + base-filesystem.c + base-filesystem.h + boot-timestamps.c + boot-timestamps.h + bus-unit-util.c + bus-unit-util.h + bus-util.c + bus-util.h + cgroup-show.c + cgroup-show.h + clean-ipc.c + clean-ipc.h + condition.c + condition.h + conf-parser.c + conf-parser.h + dev-setup.c + dev-setup.h + dissect-image.c + dissect-image.h + dns-domain.c + dns-domain.h + dropin.c + dropin.h + efivars.c + efivars.h + fdset.c + fdset.h + fstab-util.c + fstab-util.h + gcrypt-util.c + gcrypt-util.h + generator.c + generator.h + gpt.h + ima-util.c + ima-util.h + import-util.c + import-util.h + initreq.h + install.c + install.h + install-printf.c + install-printf.h + journal-util.c + journal-util.h + logs-show.c + logs-show.h + loop-util.c + loop-util.h + machine-image.c + machine-image.h + machine-pool.c + machine-pool.h + nsflags.c + nsflags.h + output-mode.c + output-mode.h + pager.c + pager.h + path-lookup.c + path-lookup.h + ptyfwd.c + ptyfwd.h + resolve-util.c + resolve-util.h + seccomp-util.h + sleep-config.c + sleep-config.h + spawn-ask-password-agent.c + spawn-ask-password-agent.h + spawn-polkit-agent.c + spawn-polkit-agent.h + specifier.c + specifier.h + switch-root.c + switch-root.h + sysctl-util.c + sysctl-util.h + tests.c + tests.h + udev-util.h + uid-range.c + uid-range.h + utmp-wtmp.h + vlan-util.c + vlan-util.h + volatile-util.c + volatile-util.h + watchdog.c + watchdog.h '''.split() test_tables_h = files('test-tables.h') shared_sources += [test_tables_h] if conf.get('HAVE_ACL', 0) == 1 - shared_sources += ['acl-util.c'] + shared_sources += ['acl-util.c'] endif if conf.get('HAVE_UTMP', 0) == 1 - shared_sources += ['utmp-wtmp.c'] + shared_sources += ['utmp-wtmp.c'] endif if conf.get('HAVE_SECCOMP', 0) == 1 - shared_sources += ['seccomp-util.c'] + shared_sources += ['seccomp-util.c'] endif libshared_name = 'systemd-shared-@0@'.format(meson.project_version()) libshared = shared_library( - libshared_name, - shared_sources, - basic_sources, - journal_internal_sources, - libsystemd_internal_sources, - include_directories : includes, - link_args : ['-shared'], - c_args : ['-fvisibility=default'], - link_with : [libudev], - dependencies : [threads, - librt, - libcap, - libacl, - libcryptsetup, - libiptc, - libseccomp, - libselinux, - libidn, - libxz, - liblz4, - libblkid], - install : true, - install_dir : rootlibexecdir) + libshared_name, + shared_sources, + basic_sources, + journal_internal_sources, + libsystemd_internal_sources, + include_directories : includes, + link_args : ['-shared'], + c_args : ['-fvisibility=default'], + link_with : [libudev], + dependencies : [threads, + librt, + libcap, + libacl, + libcryptsetup, + libiptc, + libseccomp, + libselinux, + libidn, + libxz, + liblz4, + libblkid], + install : true, + install_dir : rootlibexecdir) libshared_static = static_library( - libshared_name, - shared_sources, - basic_sources, - include_directories : includes, - dependencies : [threads, - librt, - libcap, - libacl, - libcryptsetup, - libiptc, - libseccomp, - libselinux, - libidn, - libxz, - liblz4, - libblkid]) + libshared_name, + shared_sources, + basic_sources, + include_directories : includes, + dependencies : [threads, + librt, + libcap, + libacl, + libcryptsetup, + libiptc, + libseccomp, + libselinux, + libidn, + libxz, + liblz4, + libblkid]) if conf.get('HAVE_LIBIPTC', 0) == 1 - libfirewall = static_library( - 'firewall', - 'firewall-util.h', - 'firewall-util.c', - include_directories : includes, - dependencies : [libiptc]) + libfirewall = static_library( + 'firewall', + 'firewall-util.h', + 'firewall-util.c', + include_directories : includes, + dependencies : [libiptc]) else - libfirewall = [] + libfirewall = [] endif diff --git a/src/sulogin-shell/meson.build b/src/sulogin-shell/meson.build index 80ac8c43d0..4ec0d3da1a 100644 --- a/src/sulogin-shell/meson.build +++ b/src/sulogin-shell/meson.build @@ -1,9 +1,7 @@ -# -*- mode: meson -*- - gen = configure_file( - input : 'systemd-sulogin-shell.in', - output : 'systemd-sulogin-shell', - configuration : substs) + input : 'systemd-sulogin-shell.in', + output : 'systemd-sulogin-shell', + configuration : substs) install_data(gen, install_dir : rootlibexecdir) diff --git a/src/systemd/meson.build b/src/systemd/meson.build index f3b969bb2b..0f5a853e2e 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -1,15 +1,13 @@ -# -*- mode: meson -*- - _systemd_headers = ''' - sd-bus.h - sd-bus-protocol.h - sd-bus-vtable.h - sd-daemon.h - sd-event.h - sd-id128.h - sd-journal.h - sd-login.h - sd-messages.h + sd-bus.h + sd-bus-protocol.h + sd-bus-vtable.h + sd-daemon.h + sd-event.h + sd-id128.h + sd-journal.h + sd-login.h + sd-messages.h '''.split() # https://github.com/mesonbuild/meson/issues/1633 @@ -33,9 +31,9 @@ systemd_headers = files(_systemd_headers) # sd-utf8.h install_headers( - systemd_headers, - '_sd-common.h', - subdir : 'systemd') + systemd_headers, + '_sd-common.h', + subdir : 'systemd') ############################################################ @@ -45,12 +43,12 @@ opts = [[], ['-std=iso9899:1990']] foreach header : _systemd_headers - foreach opt : opts - name = ''.join([header] + opt) - test('cc-' + name, - check_compilation_sh, - args : cc.cmd_array() + ['-x', 'c'] + opt + - ['-Werror', '-include', - join_paths(meson.current_source_dir(), header)]) - endforeach + foreach opt : opts + name = ''.join([header] + opt) + test('cc-' + name, + check_compilation_sh, + args : cc.cmd_array() + ['-x', 'c'] + opt + + ['-Werror', '-include', + join_paths(meson.current_source_dir(), header)]) + endforeach endforeach diff --git a/src/test/meson.build b/src/test/meson.build index 0014fed79b..10c3201ab4 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -1,12 +1,10 @@ -# -*- mode: meson -*- - awkscript = 'test-hashmap-ordered.awk' test_hashmap_ordered_c = custom_target( - 'test-hashmap-ordered.c', - input : [awkscript, 'test-hashmap-plain.c'], - output : 'test-hashmap-ordered.c', - command : [awk, '-f', '@INPUT0@', '@INPUT1@'], - capture : true) + 'test-hashmap-ordered.c', + input : [awkscript, 'test-hashmap-plain.c'], + output : 'test-hashmap-ordered.c', + command : [awk, '-f', '@INPUT0@', '@INPUT1@'], + capture : true) test_include_dir = include_directories('.') @@ -22,876 +20,876 @@ test_env.prepend('PATH', meson.build_root()) generate_sym_test_py = find_program('generate-sym-test.py') test_libsystemd_sym_c = custom_target( - 'test-libsystemd-sym.c', - input : [libsystemd_sym_path] + systemd_headers, - output : 'test-libsystemd-sym.c', - command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers, - capture : true) + 'test-libsystemd-sym.c', + input : [libsystemd_sym_path] + systemd_headers, + output : 'test-libsystemd-sym.c', + command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers, + capture : true) test_libudev_sym_c = custom_target( - 'test-libudev-sym.c', - input : [libudev_sym_path, libudev_h_path], - output : 'test-libudev-sym.c', - command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'], - capture : true) + 'test-libudev-sym.c', + input : [libudev_sym_path, libudev_h_path], + output : 'test-libudev-sym.c', + command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'], + capture : true) test_dlopen_c = files('test-dlopen.c') ############################################################ tests += [ - [['src/test/test-device-nodes.c'], - [], - []], - - [['src/test/test-engine.c'], - [libcore, - libudev, - libsystemd_internal], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-job-type.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-ns.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid], - '', 'unsafe'], - - [['src/test/test-loopback.c'], - [libcore, - libshared], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-hostname.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid], - '', 'unsafe'], - - [['src/test/test-dns-domain.c'], - [libcore, - libsystemd_network], - []], - - [['src/test/test-boot-timestamps.c'], - [], - [], - 'ENABLE_EFI'], - - [['src/test/test-unit-name.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-unit-file.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-utf8.c'], - [], - []], - - [['src/test/test-capability.c'], - [], - [libcap]], - - [['src/test/test-async.c'], - [], - []], - - [['src/test/test-locale-util.c'], - [], - []], - - [['src/test/test-copy.c'], - [libshared_static], - []], - - [['src/test/test-sigbus.c'], - [], - []], - - [['src/test/test-condition.c'], - [], - []], - - [['src/test/test-fdset.c'], - [], - []], - - [['src/test/test-fstab-util.c'], - [], - []], - - [['src/test/test-ratelimit.c'], - [], - []], - - [['src/test/test-util.c'], - [], - []], - - [['src/test/test-mount-util.c'], - [], - []], - - [['src/test/test-exec-util.c'], - [], - []], - - [['src/test/test-hexdecoct.c'], - [], - []], - - [['src/test/test-alloc-util.c'], - [], - []], - - [['src/test/test-xattr-util.c'], - [], - []], - - [['src/test/test-io-util.c'], - [], - []], - - [['src/test/test-glob-util.c'], - [], - []], - - [['src/test/test-fs-util.c'], - [], - []], - - [['src/test/test-proc-cmdline.c'], - [], - []], - - [['src/test/test-fd-util.c'], - [], - []], - - [['src/test/test-web-util.c'], - [], - []], - - [['src/test/test-cpu-set-util.c'], - [], - []], - - [['src/test/test-stat-util.c'], - [], - []], - - [['src/test/test-escape.c'], - [], - []], - - [['src/test/test-string-util.c'], - [], - []], - - [['src/test/test-extract-word.c'], - [], - []], - - [['src/test/test-parse-util.c'], - [], - []], - - [['src/test/test-user-util.c'], - [], - []], - - [['src/test/test-hostname-util.c'], - [], - []], - - [['src/test/test-process-util.c'], - [], - []], - - [['src/test/test-terminal-util.c'], - [], - []], - - [['src/test/test-path-lookup.c'], - [], - []], - - [['src/test/test-uid-range.c'], - [], - []], - - [['src/test/test-cap-list.c', - generated_gperf_headers], - [], - [libcap]], - - [['src/test/test-socket-util.c'], - [], - []], - - [['src/test/test-barrier.c'], - [], - []], - - [['src/test/test-tmpfiles.c'], - [], - []], - - [['src/test/test-namespace.c'], - [libcore, - libshared, - libudev], - [threads, - libblkid]], - - [['src/test/test-verbs.c'], - [], - []], - - [['src/test/test-install-root.c'], - [], - []], - - [['src/test/test-acl-util.c'], - [], - [], - 'HAVE_ACL'], - - [['src/test/test-seccomp.c'], - [], - [libseccomp], - 'HAVE_SECCOMP'], - - [['src/test/test-rlimit-util.c'], - [], - []], - - [['src/test/test-ask-password-api.c'], - [], - [], - '', 'manual'], - - [['src/test/test-dissect-image.c'], - [], - [libblkid], - '', 'manual'], - - [['src/test/test-signal-util.c'], - [], - []], - - [['src/test/test-selinux.c'], - [], - []], - - [['src/test/test-sizeof.c'], - [libbasic], - []], - - [['src/test/test-hashmap.c', - 'src/test/test-hashmap-plain.c', - test_hashmap_ordered_c], - [], - [], - '', 'timeout=90'], - - [['src/test/test-set.c'], - [], - []], - - [['src/test/test-bitmap.c'], - [], - []], - - [['src/test/test-xml.c'], - [], - []], - - [['src/test/test-list.c'], - [], - []], - - [['src/test/test-unaligned.c'], - [], - []], - - [['src/test/test-tables.c', - 'src/shared/test-tables.h', - 'src/journal/journald-server.c', - 'src/journal/journald-server.h'], - [libcore, - libjournal_core, - libudev_core, - libudev_internal, - libsystemd_network, - libshared], - [threads, - libseccomp, - libmount, - libxz, - liblz4, - libblkid], - '', '', [], libudev_core_includes], - - [['src/test/test-prioq.c'], - [], - []], - - [['src/test/test-fileio.c'], - [], - []], - - [['src/test/test-time.c'], - [], - []], - - [['src/test/test-clock.c'], - [], - []], - - [['src/test/test-architecture.c'], - [], - []], - - [['src/test/test-log.c'], - [], - []], - - [['src/test/test-ipcrm.c'], - [], - [], - '', 'unsafe'], - - [['src/test/test-btrfs.c'], - [], - [], - '', 'manual'], - - - [['src/test/test-firewall-util.c'], - [libfirewall, - libshared], - [], - 'HAVE_LIBIPTC'], - - [['src/test/test-netlink-manual.c'], - [], - [libkmod], - 'HAVE_KMOD', 'manual'], - - [['src/test/test-ellipsize.c'], - [], - []], - - [['src/test/test-date.c'], - [], - []], - - [['src/test/test-sleep.c'], - [], - []], - - [['src/test/test-replace-var.c'], - [], - []], - - [['src/test/test-calendarspec.c'], - [], - []], - - [['src/test/test-strip-tab-ansi.c'], - [], - []], - - [['src/test/test-daemon.c'], - [], - []], - - [['src/test/test-cgroup.c'], - [], - [], - '', 'manual'], - - - [['src/test/test-cgroup-mask.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-cgroup-util.c'], - [], - []], - - [['src/test/test-env-util.c'], - [], - []], - - [['src/test/test-strbuf.c'], - [], - []], - - [['src/test/test-strv.c'], - [], - []], - - [['src/test/test-path-util.c'], - [], - []], - - [['src/test/test-path.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-execute.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-siphash24.c'], - [], - []], - - [['src/test/test-strxcpyx.c'], - [], - []], - - [['src/test/test-install.c'], - [libcore, - libshared], - [], - '', 'manual'], - - [['src/test/test-watchdog.c'], - [], - []], - - [['src/test/test-sched-prio.c'], - [libcore, - libshared, - libudev], - [threads, - librt, - libseccomp, - libselinux, - libmount, - libblkid]], - - [['src/test/test-conf-files.c'], - [], - []], - - [['src/test/test-conf-parser.c'], - [], - []], - - [['src/test/test-af-list.c', - generated_gperf_headers], - [], - []], - - [['src/test/test-arphrd-list.c', - generated_gperf_headers], - [], - []], - - [['src/test/test-journal-importer.c'], - [], - []], - - [['src/test/test-libudev.c'], - [libshared, - libudev], - []], - - [['src/test/test-udev.c'], - [libudev_core, - libudev_internal, - libsystemd_network, - libshared], - [threads, - librt, - libblkid, - libkmod, - libacl], - '', 'manual'], - - [['src/test/test-id128.c'], - [], - []], - - [['src/test/test-hash.c'], - [], - []], - - [['src/test/test-nss.c'], - [], - [libdl], - '', 'manual'], - ] + [['src/test/test-device-nodes.c'], + [], + []], + + [['src/test/test-engine.c'], + [libcore, + libudev, + libsystemd_internal], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-job-type.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-ns.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid], + '', 'unsafe'], + + [['src/test/test-loopback.c'], + [libcore, + libshared], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-hostname.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid], + '', 'unsafe'], + + [['src/test/test-dns-domain.c'], + [libcore, + libsystemd_network], + []], + + [['src/test/test-boot-timestamps.c'], + [], + [], + 'ENABLE_EFI'], + + [['src/test/test-unit-name.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-unit-file.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-utf8.c'], + [], + []], + + [['src/test/test-capability.c'], + [], + [libcap]], + + [['src/test/test-async.c'], + [], + []], + + [['src/test/test-locale-util.c'], + [], + []], + + [['src/test/test-copy.c'], + [libshared_static], + []], + + [['src/test/test-sigbus.c'], + [], + []], + + [['src/test/test-condition.c'], + [], + []], + + [['src/test/test-fdset.c'], + [], + []], + + [['src/test/test-fstab-util.c'], + [], + []], + + [['src/test/test-ratelimit.c'], + [], + []], + + [['src/test/test-util.c'], + [], + []], + + [['src/test/test-mount-util.c'], + [], + []], + + [['src/test/test-exec-util.c'], + [], + []], + + [['src/test/test-hexdecoct.c'], + [], + []], + + [['src/test/test-alloc-util.c'], + [], + []], + + [['src/test/test-xattr-util.c'], + [], + []], + + [['src/test/test-io-util.c'], + [], + []], + + [['src/test/test-glob-util.c'], + [], + []], + + [['src/test/test-fs-util.c'], + [], + []], + + [['src/test/test-proc-cmdline.c'], + [], + []], + + [['src/test/test-fd-util.c'], + [], + []], + + [['src/test/test-web-util.c'], + [], + []], + + [['src/test/test-cpu-set-util.c'], + [], + []], + + [['src/test/test-stat-util.c'], + [], + []], + + [['src/test/test-escape.c'], + [], + []], + + [['src/test/test-string-util.c'], + [], + []], + + [['src/test/test-extract-word.c'], + [], + []], + + [['src/test/test-parse-util.c'], + [], + []], + + [['src/test/test-user-util.c'], + [], + []], + + [['src/test/test-hostname-util.c'], + [], + []], + + [['src/test/test-process-util.c'], + [], + []], + + [['src/test/test-terminal-util.c'], + [], + []], + + [['src/test/test-path-lookup.c'], + [], + []], + + [['src/test/test-uid-range.c'], + [], + []], + + [['src/test/test-cap-list.c', + generated_gperf_headers], + [], + [libcap]], + + [['src/test/test-socket-util.c'], + [], + []], + + [['src/test/test-barrier.c'], + [], + []], + + [['src/test/test-tmpfiles.c'], + [], + []], + + [['src/test/test-namespace.c'], + [libcore, + libshared, + libudev], + [threads, + libblkid]], + + [['src/test/test-verbs.c'], + [], + []], + + [['src/test/test-install-root.c'], + [], + []], + + [['src/test/test-acl-util.c'], + [], + [], + 'HAVE_ACL'], + + [['src/test/test-seccomp.c'], + [], + [libseccomp], + 'HAVE_SECCOMP'], + + [['src/test/test-rlimit-util.c'], + [], + []], + + [['src/test/test-ask-password-api.c'], + [], + [], + '', 'manual'], + + [['src/test/test-dissect-image.c'], + [], + [libblkid], + '', 'manual'], + + [['src/test/test-signal-util.c'], + [], + []], + + [['src/test/test-selinux.c'], + [], + []], + + [['src/test/test-sizeof.c'], + [libbasic], + []], + + [['src/test/test-hashmap.c', + 'src/test/test-hashmap-plain.c', + test_hashmap_ordered_c], + [], + [], + '', 'timeout=90'], + + [['src/test/test-set.c'], + [], + []], + + [['src/test/test-bitmap.c'], + [], + []], + + [['src/test/test-xml.c'], + [], + []], + + [['src/test/test-list.c'], + [], + []], + + [['src/test/test-unaligned.c'], + [], + []], + + [['src/test/test-tables.c', + 'src/shared/test-tables.h', + 'src/journal/journald-server.c', + 'src/journal/journald-server.h'], + [libcore, + libjournal_core, + libudev_core, + libudev_internal, + libsystemd_network, + libshared], + [threads, + libseccomp, + libmount, + libxz, + liblz4, + libblkid], + '', '', [], libudev_core_includes], + + [['src/test/test-prioq.c'], + [], + []], + + [['src/test/test-fileio.c'], + [], + []], + + [['src/test/test-time.c'], + [], + []], + + [['src/test/test-clock.c'], + [], + []], + + [['src/test/test-architecture.c'], + [], + []], + + [['src/test/test-log.c'], + [], + []], + + [['src/test/test-ipcrm.c'], + [], + [], + '', 'unsafe'], + + [['src/test/test-btrfs.c'], + [], + [], + '', 'manual'], + + + [['src/test/test-firewall-util.c'], + [libfirewall, + libshared], + [], + 'HAVE_LIBIPTC'], + + [['src/test/test-netlink-manual.c'], + [], + [libkmod], + 'HAVE_KMOD', 'manual'], + + [['src/test/test-ellipsize.c'], + [], + []], + + [['src/test/test-date.c'], + [], + []], + + [['src/test/test-sleep.c'], + [], + []], + + [['src/test/test-replace-var.c'], + [], + []], + + [['src/test/test-calendarspec.c'], + [], + []], + + [['src/test/test-strip-tab-ansi.c'], + [], + []], + + [['src/test/test-daemon.c'], + [], + []], + + [['src/test/test-cgroup.c'], + [], + [], + '', 'manual'], + + + [['src/test/test-cgroup-mask.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-cgroup-util.c'], + [], + []], + + [['src/test/test-env-util.c'], + [], + []], + + [['src/test/test-strbuf.c'], + [], + []], + + [['src/test/test-strv.c'], + [], + []], + + [['src/test/test-path-util.c'], + [], + []], + + [['src/test/test-path.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-execute.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-siphash24.c'], + [], + []], + + [['src/test/test-strxcpyx.c'], + [], + []], + + [['src/test/test-install.c'], + [libcore, + libshared], + [], + '', 'manual'], + + [['src/test/test-watchdog.c'], + [], + []], + + [['src/test/test-sched-prio.c'], + [libcore, + libshared, + libudev], + [threads, + librt, + libseccomp, + libselinux, + libmount, + libblkid]], + + [['src/test/test-conf-files.c'], + [], + []], + + [['src/test/test-conf-parser.c'], + [], + []], + + [['src/test/test-af-list.c', + generated_gperf_headers], + [], + []], + + [['src/test/test-arphrd-list.c', + generated_gperf_headers], + [], + []], + + [['src/test/test-journal-importer.c'], + [], + []], + + [['src/test/test-libudev.c'], + [libshared, + libudev], + []], + + [['src/test/test-udev.c'], + [libudev_core, + libudev_internal, + libsystemd_network, + libshared], + [threads, + librt, + libblkid, + libkmod, + libacl], + '', 'manual'], + + [['src/test/test-id128.c'], + [], + []], + + [['src/test/test-hash.c'], + [], + []], + + [['src/test/test-nss.c'], + [], + [libdl], + '', 'manual'], +] ############################################################ # define some tests here, because the link_with deps were not defined earlier tests += [ - [['src/journal/test-journal.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-send.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-send.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-syslog.c'], - [libjournal_core, - libshared, - libudev], - [threads, - libxz, - liblz4, - libselinux]], + [['src/journal/test-journal-syslog.c'], + [libjournal_core, + libshared, + libudev], + [threads, + libxz, + liblz4, + libselinux]], - [['src/journal/test-journal-match.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-match.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-enum.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-enum.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-stream.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-stream.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-flush.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-flush.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-init.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-init.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-verify.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-verify.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-journal-interleaving.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-journal-interleaving.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-mmap-cache.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4]], + [['src/journal/test-mmap-cache.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4]], - [['src/journal/test-catalog.c'], - [libjournal_core, - libshared], - [threads, - libxz, - liblz4], - '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)], + [['src/journal/test-catalog.c'], + [libjournal_core, + libshared], + [threads, + libxz, + liblz4], + '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)], - [['src/journal/test-compress.c'], - [libjournal_core, - libshared], - [liblz4, - libxz]], + [['src/journal/test-compress.c'], + [libjournal_core, + libshared], + [liblz4, + libxz]], - [['src/journal/test-compress-benchmark.c'], - [libjournal_core, - libshared], - [liblz4, - libxz], - '', 'timeout=90'], + [['src/journal/test-compress-benchmark.c'], + [libjournal_core, + libshared], + [liblz4, + libxz], + '', 'timeout=90'], - [['src/journal/test-audit-type.c'], - [libjournal_core, - libshared], - [liblz4, - libxz]], - ] - -############################################################ - -tests += [ - [['src/libsystemd/sd-bus/test-bus-marshal.c'], - [], - [threads, - libglib, - libgobject, - libgio, - libdbus]], - - [['src/libsystemd/sd-bus/test-bus-signature.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-chat.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-cleanup.c'], - [], - [threads, - libseccomp]], - - [['src/libsystemd/sd-bus/test-bus-error.c'], - [libshared_static, - libsystemd_internal], - []], - - [['src/libsystemd/sd-bus/test-bus-track.c'], - [], - [libseccomp]], - - [['src/libsystemd/sd-bus/test-bus-server.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-objects.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-gvariant.c'], - [], - [libglib, - libgobject, - libgio]], - - [['src/libsystemd/sd-bus/test-bus-creds.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-match.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-kernel.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-benchmark.c'], - [], - [threads]], - - [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], - [], - []], - - [['src/libsystemd/sd-bus/test-bus-introspect.c'], - [], - []], - - [['src/libsystemd/sd-event/test-event.c'], - [], - []], - - [['src/libsystemd/sd-netlink/test-netlink.c'], - [], - []], - - [['src/libsystemd/sd-netlink/test-local-addresses.c'], - [], - []], - - [['src/libsystemd/sd-resolve/test-resolve.c'], - [], - [threads]], - - [['src/libsystemd/sd-login/test-login.c'], - [], - [], - '', 'manual'], + [['src/journal/test-audit-type.c'], + [libjournal_core, + libshared], + [liblz4, + libxz]], ] ############################################################ tests += [ - [['src/libsystemd-network/test-dhcp-option.c', - 'src/libsystemd-network/dhcp-protocol.h', - 'src/libsystemd-network/dhcp-internal.h'], - [libshared, - libsystemd_network], - []], + [['src/libsystemd/sd-bus/test-bus-marshal.c'], + [], + [threads, + libglib, + libgobject, + libgio, + libdbus]], - [['src/libsystemd-network/test-dhcp-client.c', - 'src/libsystemd-network/dhcp-protocol.h', - 'src/libsystemd-network/dhcp-internal.h', - 'src/systemd/sd-dhcp-client.h'], - [libshared, - libsystemd_network, - libudev], - []], + [['src/libsystemd/sd-bus/test-bus-signature.c'], + [], + [threads]], - [['src/libsystemd-network/test-dhcp-server.c'], - [libshared, - libsystemd_network], - []], + [['src/libsystemd/sd-bus/test-bus-chat.c'], + [], + [threads]], - [['src/libsystemd-network/test-ipv4ll.c', - 'src/libsystemd-network/arp-util.h', - 'src/systemd/sd-ipv4ll.h'], - [libshared, - libsystemd_network], - []], + [['src/libsystemd/sd-bus/test-bus-cleanup.c'], + [], + [threads, + libseccomp]], - [['src/libsystemd-network/test-ipv4ll-manual.c', - 'src/systemd/sd-ipv4ll.h'], - [libshared, - libsystemd_network], - [], - '', 'manual'], + [['src/libsystemd/sd-bus/test-bus-error.c'], + [libshared_static, + libsystemd_internal], + []], - [['src/libsystemd-network/test-acd.c', - 'src/systemd/sd-ipv4acd.h'], - [libshared, - libsystemd_network], - [], - '', 'manual'], + [['src/libsystemd/sd-bus/test-bus-track.c'], + [], + [libseccomp]], - [['src/libsystemd-network/test-ndisc-rs.c', - 'src/libsystemd-network/dhcp-identifier.h', - 'src/libsystemd-network/dhcp-identifier.c', - 'src/libsystemd-network/icmp6-util.h', - 'src/systemd/sd-dhcp6-client.h', - 'src/systemd/sd-ndisc.h'], - [libshared, - libsystemd_network, - libudev], - []], + [['src/libsystemd/sd-bus/test-bus-server.c'], + [], + [threads]], - [['src/libsystemd-network/test-dhcp6-client.c', - 'src/libsystemd-network/dhcp-identifier.h', - 'src/libsystemd-network/dhcp-identifier.c', - 'src/libsystemd-network/dhcp6-internal.h', - 'src/systemd/sd-dhcp6-client.h'], - [libshared, - libsystemd_network, - libudev], - []], + [['src/libsystemd/sd-bus/test-bus-objects.c'], + [], + [threads]], - [['src/libsystemd-network/test-lldp.c'], - [libshared, - libsystemd_network], - []], - ] + [['src/libsystemd/sd-bus/test-bus-gvariant.c'], + [], + [libglib, + libgobject, + libgio]], + + [['src/libsystemd/sd-bus/test-bus-creds.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-match.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-benchmark.c'], + [], + [threads]], + + [['src/libsystemd/sd-bus/test-bus-zero-copy.c'], + [], + []], + + [['src/libsystemd/sd-bus/test-bus-introspect.c'], + [], + []], + + [['src/libsystemd/sd-event/test-event.c'], + [], + []], + + [['src/libsystemd/sd-netlink/test-netlink.c'], + [], + []], + + [['src/libsystemd/sd-netlink/test-local-addresses.c'], + [], + []], + + [['src/libsystemd/sd-resolve/test-resolve.c'], + [], + [threads]], + + [['src/libsystemd/sd-login/test-login.c'], + [], + [], + '', 'manual'], +] ############################################################ tests += [ - [['src/login/test-login-shared.c'], - [], - []], + [['src/libsystemd-network/test-dhcp-option.c', + 'src/libsystemd-network/dhcp-protocol.h', + 'src/libsystemd-network/dhcp-internal.h'], + [libshared, + libsystemd_network], + []], - [['src/login/test-inhibit.c'], - [], - [], - '', 'manual'], + [['src/libsystemd-network/test-dhcp-client.c', + 'src/libsystemd-network/dhcp-protocol.h', + 'src/libsystemd-network/dhcp-internal.h', + 'src/systemd/sd-dhcp-client.h'], + [libshared, + libsystemd_network, + libudev], + []], - [['src/login/test-login-tables.c'], - [liblogind_core, - libshared, - libudev], - [threads]], - ] + [['src/libsystemd-network/test-dhcp-server.c'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-ipv4ll.c', + 'src/libsystemd-network/arp-util.h', + 'src/systemd/sd-ipv4ll.h'], + [libshared, + libsystemd_network], + []], + + [['src/libsystemd-network/test-ipv4ll-manual.c', + 'src/systemd/sd-ipv4ll.h'], + [libshared, + libsystemd_network], + [], + '', 'manual'], + + [['src/libsystemd-network/test-acd.c', + 'src/systemd/sd-ipv4acd.h'], + [libshared, + libsystemd_network], + [], + '', 'manual'], + + [['src/libsystemd-network/test-ndisc-rs.c', + 'src/libsystemd-network/dhcp-identifier.h', + 'src/libsystemd-network/dhcp-identifier.c', + 'src/libsystemd-network/icmp6-util.h', + 'src/systemd/sd-dhcp6-client.h', + 'src/systemd/sd-ndisc.h'], + [libshared, + libsystemd_network, + libudev], + []], + + [['src/libsystemd-network/test-dhcp6-client.c', + 'src/libsystemd-network/dhcp-identifier.h', + 'src/libsystemd-network/dhcp-identifier.c', + 'src/libsystemd-network/dhcp6-internal.h', + 'src/systemd/sd-dhcp6-client.h'], + [libshared, + libsystemd_network, + libudev], + []], + + [['src/libsystemd-network/test-lldp.c'], + [libshared, + libsystemd_network], + []], +] + +############################################################ + +tests += [ + [['src/login/test-login-shared.c'], + [], + []], + + [['src/login/test-inhibit.c'], + [], + [], + '', 'manual'], + + [['src/login/test-login-tables.c'], + [liblogind_core, + libshared, + libudev], + [threads]], +] diff --git a/src/timedate/meson.build b/src/timedate/meson.build index 52518a87e4..2e74245f66 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -1,16 +1,14 @@ -# -*- mode: meson -*- - if conf.get('ENABLE_TIMEDATED', 0) == 1 - install_data('org.freedesktop.timedate1.conf', - install_dir : dbuspolicydir) - install_data('org.freedesktop.timedate1.service', - install_dir : dbussystemservicedir) + install_data('org.freedesktop.timedate1.conf', + install_dir : dbuspolicydir) + install_data('org.freedesktop.timedate1.service', + install_dir : dbussystemservicedir) - custom_target( - 'org.freedesktop.timedate1.policy', - input : 'org.freedesktop.timedate1.policy.in', - output : 'org.freedesktop.timedate1.policy', - command : intltool_command, - install : install_polkit, - install_dir : polkitpolicydir) + custom_target( + 'org.freedesktop.timedate1.policy', + input : 'org.freedesktop.timedate1.policy.in', + output : 'org.freedesktop.timedate1.policy', + command : intltool_command, + install : install_polkit, + install_dir : polkitpolicydir) endif diff --git a/src/timesync/meson.build b/src/timesync/meson.build index 0d0381305f..dece39ea10 100644 --- a/src/timesync/meson.build +++ b/src/timesync/meson.build @@ -1,28 +1,26 @@ -# -*- mode: meson -*- - systemd_timesyncd_sources = files(''' - timesyncd.c - timesyncd-manager.c - timesyncd-manager.h - timesyncd-conf.c - timesyncd-conf.h - timesyncd-server.c - timesyncd-server.h + timesyncd.c + timesyncd-manager.c + timesyncd-manager.h + timesyncd-conf.c + timesyncd-conf.h + timesyncd-server.c + timesyncd-server.h '''.split()) timesyncd_gperf_c = custom_target( - 'timesyncd-gperf.c', - input : 'timesyncd-gperf.gperf', - output : 'timesyncd-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'timesyncd-gperf.c', + input : 'timesyncd-gperf.gperf', + output : 'timesyncd-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) systemd_timesyncd_sources += [timesyncd_gperf_c] if conf.get('ENABLE_TIMESYNCD', 0) == 1 - timesyncd_conf = configure_file( - input : 'timesyncd.conf.in', - output : 'timesyncd.conf', - configuration : substs) - install_data(timesyncd_conf, - install_dir : pkgsysconfdir) + timesyncd_conf = configure_file( + input : 'timesyncd.conf.in', + output : 'timesyncd.conf', + configuration : substs) + install_data(timesyncd_conf, + install_dir : pkgsysconfdir) endif diff --git a/src/udev/meson.build b/src/udev/meson.build index 1eac8754eb..e3d3fa2462 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -1,120 +1,118 @@ -# -*- mode: meson -*- - udevadm_sources = files(''' - udevadm.c - udevadm-info.c - udevadm-control.c - udevadm-monitor.c - udevadm-hwdb.c - udevadm-settle.c - udevadm-trigger.c - udevadm-test.c - udevadm-test-builtin.c - udevadm-util.c - udevadm-util.h + udevadm.c + udevadm-info.c + udevadm-control.c + udevadm-monitor.c + udevadm-hwdb.c + udevadm-settle.c + udevadm-trigger.c + udevadm-test.c + udevadm-test-builtin.c + udevadm-util.c + udevadm-util.h '''.split()) systemd_udevd_sources = files('udevd.c') libudev_core_sources = ''' - udev.h - udev-event.c - udev-watch.c - udev-node.c - udev-rules.c - udev-ctrl.c - udev-builtin.c - udev-builtin-btrfs.c - udev-builtin-hwdb.c - udev-builtin-input_id.c - udev-builtin-keyboard.c - udev-builtin-net_id.c - udev-builtin-net_setup_link.c - udev-builtin-path_id.c - udev-builtin-usb_id.c - net/link-config.c - net/link-config.h - net/ethtool-util.c - net/ethtool-util.h + udev.h + udev-event.c + udev-watch.c + udev-node.c + udev-rules.c + udev-ctrl.c + udev-builtin.c + udev-builtin-btrfs.c + udev-builtin-hwdb.c + udev-builtin-input_id.c + udev-builtin-keyboard.c + udev-builtin-net_id.c + udev-builtin-net_setup_link.c + udev-builtin-path_id.c + udev-builtin-usb_id.c + net/link-config.c + net/link-config.h + net/ethtool-util.c + net/ethtool-util.h '''.split() if conf.get('HAVE_KMOD', 0) == 1 - libudev_core_sources += ['udev-builtin-kmod.c'] + libudev_core_sources += ['udev-builtin-kmod.c'] endif if conf.get('HAVE_BLKID', 0) == 1 - libudev_core_sources += ['udev-builtin-blkid.c'] + libudev_core_sources += ['udev-builtin-blkid.c'] endif if conf.get('HAVE_ACL', 0) == 1 - libudev_core_sources += ['udev-builtin-uaccess.c', - logind_acl_c, - sd_login_c] + libudev_core_sources += ['udev-builtin-uaccess.c', + logind_acl_c, + sd_login_c] endif ############################################################ generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh') keyboard_keys_list_txt = custom_target( - 'keyboard-keys-list.txt', - output : 'keyboard-keys-list.txt', - command : [generate_keyboard_keys_list, cpp], - capture : true) + 'keyboard-keys-list.txt', + output : 'keyboard-keys-list.txt', + command : [generate_keyboard_keys_list, cpp], + capture : true) fname = 'keyboard-keys-from-name.gperf' gperf_file = custom_target( - fname, - input : keyboard_keys_list_txt, - output : fname, - command : [generate_gperfs, 'key', '', '@INPUT@'], - capture : true) + fname, + input : keyboard_keys_list_txt, + output : fname, + command : [generate_gperfs, 'key', '', '@INPUT@'], + capture : true) fname = 'keyboard-keys-from-name.h' keyboard_keys_from_name_h = custom_target( - fname, - input : gperf_file, - output : fname, - command : [gperf, - '-L', 'ANSI-C', '-t', '--ignore-case', - '-N', 'keyboard_lookup_key', - '-H', 'hash_key_name', - '-p', '-C', - '@INPUT@'], - capture : true) + fname, + input : gperf_file, + output : fname, + command : [gperf, + '-L', 'ANSI-C', '-t', '--ignore-case', + '-N', 'keyboard_lookup_key', + '-H', 'hash_key_name', + '-p', '-C', + '@INPUT@'], + capture : true) ############################################################ link_config_gperf_c = custom_target( - 'link-config-gperf.c', - input : 'net/link-config-gperf.gperf', - output : 'link-config-gperf.c', - command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) + 'link-config-gperf.c', + input : 'net/link-config-gperf.gperf', + output : 'link-config-gperf.c', + command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) ############################################################ if get_option('link-udev-shared') - libudev_link_with = [libshared] - rpath = rootlibexecdir + libudev_link_with = [libshared] + rpath = rootlibexecdir else - libudev_link_with = [libshared_static, - libsystemd_internal] - rpath = '' + libudev_link_with = [libshared_static, + libsystemd_internal] + rpath = '' endif libudev_internal = static_library( - 'udev', - libudev_sources, - include_directories : includes, - link_with : libudev_link_with) + 'udev', + libudev_sources, + include_directories : includes, + link_with : libudev_link_with) libudev_core_includes = [includes, include_directories('net')] libudev_core = static_library( - 'udev-core', - libudev_core_sources, - link_config_gperf_c, - keyboard_keys_from_name_h, - include_directories : libudev_core_includes, - link_with : libudev_link_with) + 'udev-core', + libudev_core_sources, + link_config_gperf_c, + keyboard_keys_from_name_h, + include_directories : libudev_core_includes, + link_with : libudev_link_with) foreach prog : [['ata_id/ata_id.c'], ['cdrom_id/cdrom_id.c'], @@ -128,22 +126,22 @@ foreach prog : [['ata_id/ata_id.c'], 'mtd_probe/mtd_probe.h', 'mtd_probe/probe_smartmedia.c']] - executable(prog[0].split('/')[0], - prog, - include_directories : includes, - link_with : [libudev_internal], - install_rpath : rpath, - install : true, - install_dir : udevlibexecdir) + executable(prog[0].split('/')[0], + prog, + include_directories : includes, + link_with : [libudev_internal], + install_rpath : rpath, + install : true, + install_dir : udevlibexecdir) endforeach install_data('udev.conf', install_dir : join_paths(sysconfdir, 'udev')) udev_pc = configure_file( - input : 'udev.pc.in', - output : 'udev.pc', - configuration : substs) + input : 'udev.pc.in', + output : 'udev.pc', + configuration : substs) install_data(udev_pc, install_dir : pkgconfigdatadir) diff --git a/src/vconsole/meson.build b/src/vconsole/meson.build index f2aa6daf88..ac382e3daa 100644 --- a/src/vconsole/meson.build +++ b/src/vconsole/meson.build @@ -1,10 +1,8 @@ -# -*- mode: meson -*- - if conf.get('ENABLE_VCONSOLE', 0) == 1 - vconsole_rules = configure_file( - input : '90-vconsole.rules.in', - output : '90-vconsole.rules', - configuration : substs) - install_data(vconsole_rules, - install_dir : udevrulesdir) + vconsole_rules = configure_file( + input : '90-vconsole.rules.in', + output : '90-vconsole.rules', + configuration : substs) + install_data(vconsole_rules, + install_dir : udevrulesdir) endif diff --git a/sysctl.d/meson.build b/sysctl.d/meson.build index 826542debc..1205c3a122 100644 --- a/sysctl.d/meson.build +++ b/sysctl.d/meson.build @@ -1,22 +1,20 @@ -# -*- mode: meson -*- - install_data( - '50-default.conf', - install_dir : sysctldir) + '50-default.conf', + install_dir : sysctldir) in_files = [] if conf.get('ENABLE_COREDUMP', 0) == 1 - in_files += ['50-coredump.conf'] + in_files += ['50-coredump.conf'] endif foreach file : in_files - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - install_data(gen, - install_dir : sysctldir) + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + install_data(gen, + install_dir : sysctldir) endforeach meson.add_install_script('sh', '-c', diff --git a/sysusers.d/meson.build b/sysusers.d/meson.build index 92b4128f8b..8e126f289a 100644 --- a/sysusers.d/meson.build +++ b/sysusers.d/meson.build @@ -1,33 +1,31 @@ -# -*- mode: meson -*- - in_files = ['basic.conf'] enable_sysusers = conf.get('ENABLE_SYSUSERS', 0) == 1 foreach file : in_files - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - if enable_sysusers - install_data(gen, - install_dir : sysusersdir) - endif + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + if enable_sysusers + install_data(gen, + install_dir : sysusersdir) + endif endforeach m4_files = ['systemd.conf'] if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 - m4_files += ['systemd-remote.conf'] + m4_files += ['systemd-remote.conf'] endif foreach file : m4_files - custom_target( - 'sysusers.d/' + file, - input : file + '.m4', - output: file, - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true, - install : enable_sysusers, - install_dir : sysusersdir) + custom_target( + 'sysusers.d/' + file, + input : file + '.m4', + output: file, + command : [m4, '-P'] + m4_defines + ['@INPUT@'], + capture : true, + install : enable_sysusers, + install_dir : sysusersdir) endforeach diff --git a/test/meson.build b/test/meson.build index 79446d0dad..5823976d10 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,166 +1,166 @@ test_data_files = ''' - a.service - basic.target - b.service - c.service - daughter.service - d.service - end.service - e.service - f.service - grandchild.service - g.service - hello-after-sleep.target - hello.service - h.service - parent-deep.slice - parent.slice - sched_idle_bad.service - sched_idle_ok.service - sched_rr_bad.service - sched_rr_change.service - sched_rr_ok.service - shutdown.target - sleep.service - sockets.target - son.service - sysinit.target - testsuite.target - timers.target - unstoppable.service - test-path/paths.target - test-path/basic.target - test-path/sysinit.target - test-path/path-changed.service - test-path/path-directorynotempty.service - test-path/path-existsglob.service - test-path/path-exists.service - test-path/path-makedirectory.service - test-path/path-modified.service - test-path/path-mycustomunit.service - test-path/path-service.service - test-path/path-changed.path - test-path/path-directorynotempty.path - test-path/path-existsglob.path - test-path/path-exists.path - test-path/path-makedirectory.path - test-path/path-modified.path - test-path/path-unit.path - test-execute/exec-environment-empty.service - test-execute/exec-environment-multiple.service - test-execute/exec-environment.service - test-execute/exec-passenvironment-absent.service - test-execute/exec-passenvironment-empty.service - test-execute/exec-passenvironment-repeated.service - test-execute/exec-passenvironment.service - test-execute/exec-group.service - test-execute/exec-group-nfsnobody.service - test-execute/exec-supplementarygroups.service - test-execute/exec-supplementarygroups-single-group.service - test-execute/exec-supplementarygroups-single-group-user.service - test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service - test-execute/exec-supplementarygroups-multiple-groups-withgid.service - test-execute/exec-supplementarygroups-multiple-groups-withuid.service - test-execute/exec-dynamicuser-fixeduser.service - test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service - test-execute/exec-dynamicuser-supplementarygroups.service - test-execute/exec-ignoresigpipe-no.service - test-execute/exec-ignoresigpipe-yes.service - test-execute/exec-personality-x86-64.service - test-execute/exec-personality-x86.service - test-execute/exec-personality-s390.service - test-execute/exec-personality-ppc64.service - test-execute/exec-personality-ppc64le.service - test-execute/exec-personality-aarch64.service - test-execute/exec-privatedevices-no.service - test-execute/exec-privatedevices-yes.service - test-execute/exec-privatedevices-no-capability-mknod.service - test-execute/exec-privatedevices-yes-capability-mknod.service - test-execute/exec-protectkernelmodules-no-capabilities.service - test-execute/exec-protectkernelmodules-yes-capabilities.service - test-execute/exec-protectkernelmodules-yes-mount-propagation.service - test-execute/exec-privatetmp-no.service - test-execute/exec-privatetmp-yes.service - test-execute/exec-readonlypaths.service - test-execute/exec-readonlypaths-mount-propagation.service - test-execute/exec-readwritepaths-mount-propagation.service - test-execute/exec-inaccessiblepaths-mount-propagation.service - test-execute/exec-spec-interpolation.service - test-execute/exec-systemcallerrornumber.service - test-execute/exec-systemcallfilter-failing2.service - test-execute/exec-systemcallfilter-failing.service - test-execute/exec-systemcallfilter-not-failing2.service - test-execute/exec-systemcallfilter-not-failing.service - test-execute/exec-systemcallfilter-system-user.service - test-execute/exec-systemcallfilter-system-user-nfsnobody.service - test-execute/exec-user.service - test-execute/exec-user-nfsnobody.service - test-execute/exec-workingdirectory.service - test-execute/exec-umask-0177.service - test-execute/exec-umask-default.service - test-execute/exec-privatenetwork-yes.service - test-execute/exec-environmentfile.service - test-execute/exec-oomscoreadjust-positive.service - test-execute/exec-oomscoreadjust-negative.service - test-execute/exec-ioschedulingclass-best-effort.service - test-execute/exec-ioschedulingclass-idle.service - test-execute/exec-ioschedulingclass-none.service - test-execute/exec-ioschedulingclass-realtime.service - test-execute/exec-capabilityboundingset-invert.service - test-execute/exec-capabilityboundingset-merge.service - test-execute/exec-capabilityboundingset-reset.service - test-execute/exec-capabilityboundingset-simple.service - test-execute/exec-capabilityambientset.service - test-execute/exec-capabilityambientset-nfsnobody.service - test-execute/exec-capabilityambientset-merge.service - test-execute/exec-capabilityambientset-merge-nfsnobody.service - test-execute/exec-runtimedirectory.service - test-execute/exec-runtimedirectory-mode.service - test-execute/exec-runtimedirectory-owner.service - test-execute/exec-runtimedirectory-owner-nfsnobody.service - test-execute/exec-restrict-namespaces-no.service - test-execute/exec-restrict-namespaces-yes.service - test-execute/exec-restrict-namespaces-mnt.service - test-execute/exec-restrict-namespaces-mnt-blacklist.service - test-execute/exec-read-only-path-succeed.service - test-execute/exec-privatedevices-yes-capability-sys-rawio.service - test-execute/exec-privatedevices-no-capability-sys-rawio.service - bus-policy/hello.conf - bus-policy/methods.conf - bus-policy/ownerships.conf - bus-policy/signals.conf - bus-policy/check-own-rules.conf - bus-policy/many-rules.conf - bus-policy/test.conf - hwdb/10-bad.hwdb - journal-data/journal-1.txt - journal-data/journal-2.txt + a.service + basic.target + b.service + c.service + daughter.service + d.service + end.service + e.service + f.service + grandchild.service + g.service + hello-after-sleep.target + hello.service + h.service + parent-deep.slice + parent.slice + sched_idle_bad.service + sched_idle_ok.service + sched_rr_bad.service + sched_rr_change.service + sched_rr_ok.service + shutdown.target + sleep.service + sockets.target + son.service + sysinit.target + testsuite.target + timers.target + unstoppable.service + test-path/paths.target + test-path/basic.target + test-path/sysinit.target + test-path/path-changed.service + test-path/path-directorynotempty.service + test-path/path-existsglob.service + test-path/path-exists.service + test-path/path-makedirectory.service + test-path/path-modified.service + test-path/path-mycustomunit.service + test-path/path-service.service + test-path/path-changed.path + test-path/path-directorynotempty.path + test-path/path-existsglob.path + test-path/path-exists.path + test-path/path-makedirectory.path + test-path/path-modified.path + test-path/path-unit.path + test-execute/exec-environment-empty.service + test-execute/exec-environment-multiple.service + test-execute/exec-environment.service + test-execute/exec-passenvironment-absent.service + test-execute/exec-passenvironment-empty.service + test-execute/exec-passenvironment-repeated.service + test-execute/exec-passenvironment.service + test-execute/exec-group.service + test-execute/exec-group-nfsnobody.service + test-execute/exec-supplementarygroups.service + test-execute/exec-supplementarygroups-single-group.service + test-execute/exec-supplementarygroups-single-group-user.service + test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service + test-execute/exec-supplementarygroups-multiple-groups-withgid.service + test-execute/exec-supplementarygroups-multiple-groups-withuid.service + test-execute/exec-dynamicuser-fixeduser.service + test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service + test-execute/exec-dynamicuser-supplementarygroups.service + test-execute/exec-ignoresigpipe-no.service + test-execute/exec-ignoresigpipe-yes.service + test-execute/exec-personality-x86-64.service + test-execute/exec-personality-x86.service + test-execute/exec-personality-s390.service + test-execute/exec-personality-ppc64.service + test-execute/exec-personality-ppc64le.service + test-execute/exec-personality-aarch64.service + test-execute/exec-privatedevices-no.service + test-execute/exec-privatedevices-yes.service + test-execute/exec-privatedevices-no-capability-mknod.service + test-execute/exec-privatedevices-yes-capability-mknod.service + test-execute/exec-protectkernelmodules-no-capabilities.service + test-execute/exec-protectkernelmodules-yes-capabilities.service + test-execute/exec-protectkernelmodules-yes-mount-propagation.service + test-execute/exec-privatetmp-no.service + test-execute/exec-privatetmp-yes.service + test-execute/exec-readonlypaths.service + test-execute/exec-readonlypaths-mount-propagation.service + test-execute/exec-readwritepaths-mount-propagation.service + test-execute/exec-inaccessiblepaths-mount-propagation.service + test-execute/exec-spec-interpolation.service + test-execute/exec-systemcallerrornumber.service + test-execute/exec-systemcallfilter-failing2.service + test-execute/exec-systemcallfilter-failing.service + test-execute/exec-systemcallfilter-not-failing2.service + test-execute/exec-systemcallfilter-not-failing.service + test-execute/exec-systemcallfilter-system-user.service + test-execute/exec-systemcallfilter-system-user-nfsnobody.service + test-execute/exec-user.service + test-execute/exec-user-nfsnobody.service + test-execute/exec-workingdirectory.service + test-execute/exec-umask-0177.service + test-execute/exec-umask-default.service + test-execute/exec-privatenetwork-yes.service + test-execute/exec-environmentfile.service + test-execute/exec-oomscoreadjust-positive.service + test-execute/exec-oomscoreadjust-negative.service + test-execute/exec-ioschedulingclass-best-effort.service + test-execute/exec-ioschedulingclass-idle.service + test-execute/exec-ioschedulingclass-none.service + test-execute/exec-ioschedulingclass-realtime.service + test-execute/exec-capabilityboundingset-invert.service + test-execute/exec-capabilityboundingset-merge.service + test-execute/exec-capabilityboundingset-reset.service + test-execute/exec-capabilityboundingset-simple.service + test-execute/exec-capabilityambientset.service + test-execute/exec-capabilityambientset-nfsnobody.service + test-execute/exec-capabilityambientset-merge.service + test-execute/exec-capabilityambientset-merge-nfsnobody.service + test-execute/exec-runtimedirectory.service + test-execute/exec-runtimedirectory-mode.service + test-execute/exec-runtimedirectory-owner.service + test-execute/exec-runtimedirectory-owner-nfsnobody.service + test-execute/exec-restrict-namespaces-no.service + test-execute/exec-restrict-namespaces-yes.service + test-execute/exec-restrict-namespaces-mnt.service + test-execute/exec-restrict-namespaces-mnt-blacklist.service + test-execute/exec-read-only-path-succeed.service + test-execute/exec-privatedevices-yes-capability-sys-rawio.service + test-execute/exec-privatedevices-no-capability-sys-rawio.service + bus-policy/hello.conf + bus-policy/methods.conf + bus-policy/ownerships.conf + bus-policy/signals.conf + bus-policy/check-own-rules.conf + bus-policy/many-rules.conf + bus-policy/test.conf + hwdb/10-bad.hwdb + journal-data/journal-1.txt + journal-data/journal-2.txt '''.split() if conf.get('ENABLE_RESOLVED', 0) == 1 - test_data_files += ''' - test-resolve/_openpgpkey.fedoraproject.org.pkts - test-resolve/fedoraproject.org.pkts - test-resolve/gandi.net.pkts - test-resolve/google.com.pkts - test-resolve/root.pkts - test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts - test-resolve/teamits.com.pkts - test-resolve/zbyszek@fedoraproject.org.pkts - test-resolve/_443._tcp.fedoraproject.org.pkts - test-resolve/kyhwana.org.pkts - test-resolve/fake-caa.pkts - '''.split() + test_data_files += ''' + test-resolve/_openpgpkey.fedoraproject.org.pkts + test-resolve/fedoraproject.org.pkts + test-resolve/gandi.net.pkts + test-resolve/google.com.pkts + test-resolve/root.pkts + test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts + test-resolve/teamits.com.pkts + test-resolve/zbyszek@fedoraproject.org.pkts + test-resolve/_443._tcp.fedoraproject.org.pkts + test-resolve/kyhwana.org.pkts + test-resolve/fake-caa.pkts + '''.split() endif if install_tests - foreach file : test_data_files - subdir = file.split('/')[0] - if subdir == file - subdir = '' - endif + foreach file : test_data_files + subdir = file.split('/')[0] + if subdir == file + subdir = '' + endif - install_data(file, - install_dir : testsdir + '/testdata/' + subdir) - endforeach + install_data(file, + install_dir : testsdir + '/testdata/' + subdir) + endforeach endif diff --git a/tmpfiles.d/meson.build b/tmpfiles.d/meson.build index eebdbb9501..dfbe04a976 100644 --- a/tmpfiles.d/meson.build +++ b/tmpfiles.d/meson.build @@ -1,5 +1,3 @@ -# -*- mode: meson -*- - enable_tmpfiles = conf.get('ENABLE_TMPFILES', 0) == 1 tmpfiles = [['home.conf', ''], @@ -14,31 +12,32 @@ tmpfiles = [['home.conf', ''], ] foreach pair : tmpfiles - if not enable_tmpfiles - # do nothing - elif pair[1] == '' or conf.get(pair[1], 0) == 1 - install_data(pair[0], install_dir : tmpfilesdir) - else - message('Not installing tmpfiles.d/@0@ because @1@ is @2@'.format( - pair[0], pair[1], conf.get(pair[1], 0))) - endif + if not enable_tmpfiles + # do nothing + elif pair[1] == '' or conf.get(pair[1], 0) == 1 + install_data(pair[0], install_dir : tmpfilesdir) + else + message('Not installing tmpfiles.d/@0@ because @1@ is @2@' + .format(pair[0], pair[1], conf.get(pair[1], 0))) + endif endforeach m4_files = ['etc.conf', 'systemd.conf'] foreach file : m4_files - custom_target( - 'tmpfiles.d/' + file, - input : file + '.m4', - output: file, - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true, - install : enable_tmpfiles, - install_dir : tmpfilesdir) + custom_target( + 'tmpfiles.d/' + file, + input : file + '.m4', + output: file, + command : [m4, '-P'] + m4_defines + ['@INPUT@'], + capture : true, + install : enable_tmpfiles, + install_dir : tmpfilesdir) endforeach if enable_tmpfiles - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) + meson.add_install_script( + 'sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) endif diff --git a/units/meson.build b/units/meson.build index 37903e45c0..58d9e2b28f 100644 --- a/units/meson.build +++ b/units/meson.build @@ -1,313 +1,312 @@ -# -*- mode: meson -*- - units = [ - ['basic.target', ''], - ['bluetooth.target', ''], - ['cryptsetup-pre.target', 'HAVE_LIBCRYPTSETUP'], - ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP', - 'sysinit.target.wants/'], - ['dev-hugepages.mount', '', - 'sysinit.target.wants/'], - ['dev-mqueue.mount', '', - 'sysinit.target.wants/'], - ['emergency.target', ''], - ['exit.target', ''], - ['final.target', ''], - ['getty.target', '', - 'multi-user.target.wants/'], - ['graphical.target', '', - 'runlevel5.target default.target'], - ['halt.target', ''], - ['hibernate.target', 'ENABLE_HIBERNATE'], - ['hybrid-sleep.target', 'ENABLE_HIBERNATE'], - ['initrd-fs.target', ''], - ['initrd-root-device.target', ''], - ['initrd-root-fs.target', ''], - ['initrd-switch-root.target', ''], - ['initrd.target', ''], - ['kexec.target', ''], - ['ldconfig.service', 'ENABLE_LDCONFIG', - 'sysinit.target.wants/'], - ['local-fs-pre.target', ''], - ['local-fs.target', ''], - ['machine.slice', 'ENABLE_MACHINED'], - ['machines.target', 'ENABLE_MACHINED', - join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], - ['multi-user.target', '', - 'runlevel2.target runlevel3.target runlevel4.target'], - ['network-online.target', ''], - ['network-pre.target', ''], - ['network.target', ''], - ['nss-lookup.target', ''], - ['nss-user-lookup.target', ''], - ['paths.target', ''], - ['poweroff.target', '', - 'runlevel0.target'], - ['printer.target', ''], - ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT', - 'sysinit.target.wants/'], - ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], - ['reboot.target', '', - 'runlevel6.target ctrl-alt-del.target'], - ['remote-fs-pre.target', ''], - ['remote-fs.target', '', - join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], - ['rescue.target', '', - 'runlevel1.target'], - ['rpcbind.target', ''], - ['shutdown.target', ''], - ['sigpwr.target', ''], - ['sleep.target', ''], - ['slices.target', ''], - ['smartcard.target', ''], - ['sockets.target', ''], - ['sound.target', ''], - ['suspend.target', ''], - ['swap.target', ''], - ['sys-fs-fuse-connections.mount', '', - 'sysinit.target.wants/'], - ['sys-kernel-config.mount', '', - 'sysinit.target.wants/'], - ['sys-kernel-debug.mount', '', - 'sysinit.target.wants/'], - ['sysinit.target', ''], - ['syslog.socket', ''], - ['system-update.target', ''], - ['system.slice', ''], - ['systemd-ask-password-console.path', '', - 'sysinit.target.wants/'], - ['systemd-ask-password-wall.path', '', - 'multi-user.target.wants/'], - ['systemd-coredump.socket', 'ENABLE_COREDUMP', - 'sockets.target.wants/'], - ['systemd-initctl.socket', '', - 'sockets.target.wants/'], - ['systemd-journal-gatewayd.socket', ''], - ['systemd-journal-remote.socket', ''], - ['systemd-journald-audit.socket', '', - 'sockets.target.wants/'], - ['systemd-journald-dev-log.socket', '', - 'sockets.target.wants/'], - ['systemd-journald.socket', '', - 'sockets.target.wants/'], - ['systemd-networkd.socket', '', - join_paths(pkgsysconfdir, 'system/sockets.target.wants/')], - ['systemd-rfkill.socket', 'ENABLE_RFKILL'], - ['systemd-tmpfiles-clean.timer', '', - 'timers.target.wants/'], - ['systemd-udevd-control.socket', '', - 'sockets.target.wants/'], - ['systemd-udevd-kernel.socket', '', - 'sockets.target.wants/'], - ['time-sync.target', ''], - ['timers.target', ''], - ['umount.target', ''], - ['user.slice', ''], - ['var-lib-machines.mount', '', - 'local-fs.target.wants/'], + ['basic.target', ''], + ['bluetooth.target', ''], + ['cryptsetup-pre.target', 'HAVE_LIBCRYPTSETUP'], + ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP', + 'sysinit.target.wants/'], + ['dev-hugepages.mount', '', + 'sysinit.target.wants/'], + ['dev-mqueue.mount', '', + 'sysinit.target.wants/'], + ['emergency.target', ''], + ['exit.target', ''], + ['final.target', ''], + ['getty.target', '', + 'multi-user.target.wants/'], + ['graphical.target', '', + 'runlevel5.target default.target'], + ['halt.target', ''], + ['hibernate.target', 'ENABLE_HIBERNATE'], + ['hybrid-sleep.target', 'ENABLE_HIBERNATE'], + ['initrd-fs.target', ''], + ['initrd-root-device.target', ''], + ['initrd-root-fs.target', ''], + ['initrd-switch-root.target', ''], + ['initrd.target', ''], + ['kexec.target', ''], + ['ldconfig.service', 'ENABLE_LDCONFIG', + 'sysinit.target.wants/'], + ['local-fs-pre.target', ''], + ['local-fs.target', ''], + ['machine.slice', 'ENABLE_MACHINED'], + ['machines.target', 'ENABLE_MACHINED', + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], + ['multi-user.target', '', + 'runlevel2.target runlevel3.target runlevel4.target'], + ['network-online.target', ''], + ['network-pre.target', ''], + ['network.target', ''], + ['nss-lookup.target', ''], + ['nss-user-lookup.target', ''], + ['paths.target', ''], + ['poweroff.target', '', + 'runlevel0.target'], + ['printer.target', ''], + ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT', + 'sysinit.target.wants/'], + ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], + ['reboot.target', '', + 'runlevel6.target ctrl-alt-del.target'], + ['remote-fs-pre.target', ''], + ['remote-fs.target', '', + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], + ['rescue.target', '', + 'runlevel1.target'], + ['rpcbind.target', ''], + ['shutdown.target', ''], + ['sigpwr.target', ''], + ['sleep.target', ''], + ['slices.target', ''], + ['smartcard.target', ''], + ['sockets.target', ''], + ['sound.target', ''], + ['suspend.target', ''], + ['swap.target', ''], + ['sys-fs-fuse-connections.mount', '', + 'sysinit.target.wants/'], + ['sys-kernel-config.mount', '', + 'sysinit.target.wants/'], + ['sys-kernel-debug.mount', '', + 'sysinit.target.wants/'], + ['sysinit.target', ''], + ['syslog.socket', ''], + ['system-update.target', ''], + ['system.slice', ''], + ['systemd-ask-password-console.path', '', + 'sysinit.target.wants/'], + ['systemd-ask-password-wall.path', '', + 'multi-user.target.wants/'], + ['systemd-coredump.socket', 'ENABLE_COREDUMP', + 'sockets.target.wants/'], + ['systemd-initctl.socket', '', + 'sockets.target.wants/'], + ['systemd-journal-gatewayd.socket', ''], + ['systemd-journal-remote.socket', ''], + ['systemd-journald-audit.socket', '', + 'sockets.target.wants/'], + ['systemd-journald-dev-log.socket', '', + 'sockets.target.wants/'], + ['systemd-journald.socket', '', + 'sockets.target.wants/'], + ['systemd-networkd.socket', '', + join_paths(pkgsysconfdir, 'system/sockets.target.wants/')], + ['systemd-rfkill.socket', 'ENABLE_RFKILL'], + ['systemd-tmpfiles-clean.timer', '', + 'timers.target.wants/'], + ['systemd-udevd-control.socket', '', + 'sockets.target.wants/'], + ['systemd-udevd-kernel.socket', '', + 'sockets.target.wants/'], + ['time-sync.target', ''], + ['timers.target', ''], + ['umount.target', ''], + ['user.slice', ''], + ['var-lib-machines.mount', '', + 'local-fs.target.wants/'], ] in_units = [ - ['debug-shell.service', ''], - ['emergency.service', ''], - ['halt-local.service', 'HAVE_SYSV_COMPAT'], - ['initrd-cleanup.service', ''], - ['initrd-parse-etc.service', ''], - ['initrd-switch-root.service', ''], - ['initrd-udevadm-cleanup-db.service', ''], - ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES', - 'sysinit.target.wants/'], - ['quotaon.service', 'ENABLE_QUOTACHECK'], - ['rc-local.service', 'HAVE_SYSV_COMPAT'], - ['rescue.service', ''], - ['system-update-cleanup.service', ''], - ['systemd-ask-password-console.service', ''], - ['systemd-ask-password-wall.service', ''], - ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], - ['systemd-binfmt.service', 'ENABLE_BINFMT', - 'sysinit.target.wants/'], - ['systemd-coredump@.service', 'ENABLE_COREDUMP'], - ['systemd-exit.service', ''], - ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT', - 'sysinit.target.wants/'], - ['systemd-fsck-root.service', ''], - ['systemd-fsck@.service', ''], - ['systemd-halt.service', ''], - ['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'], - ['systemd-hibernate.service', 'ENABLE_HIBERNATE'], - ['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'], - ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED', - 'dbus-org.freedesktop.hostname1.service'], - ['systemd-hwdb-update.service', 'ENABLE_HWDB', - 'sysinit.target.wants/'], - ['systemd-importd.service', 'ENABLE_IMPORTD', - 'dbus-org.freedesktop.import1.service'], - ['systemd-initctl.service', ''], - ['systemd-journal-catalog-update.service', '', - 'sysinit.target.wants/'], - ['systemd-journal-flush.service', '', - 'sysinit.target.wants/'], - ['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], - ['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], - ['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'], - ['systemd-journald.service', '', - 'sysinit.target.wants/'], - ['systemd-kexec.service', ''], - ['systemd-localed.service', 'ENABLE_LOCALED', - 'dbus-org.freedesktop.locale1.service'], - ['systemd-logind.service', 'ENABLE_LOGIND', - 'multi-user.target.wants/ dbus-org.freedesktop.login1.service'], - ['systemd-machine-id-commit.service', '', - 'sysinit.target.wants/'], - ['systemd-machined.service', 'ENABLE_MACHINED', - 'dbus-org.freedesktop.machine1.service'], - ['systemd-modules-load.service', 'HAVE_KMOD', - 'sysinit.target.wants/'], - ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD', - join_paths(pkgsysconfdir, 'system/network-online.target.wants/')], - ['systemd-nspawn@.service', ''], - ['systemd-poweroff.service', ''], - ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'], - ['systemd-random-seed.service', 'ENABLE_RANDOMSEED', - 'sysinit.target.wants/'], - ['systemd-reboot.service', ''], - ['systemd-remount-fs.service', '', - 'local-fs.target.wants/'], - ['systemd-rfkill.service', 'ENABLE_RFKILL'], - ['systemd-suspend.service', ''], - ['systemd-sysctl.service', '', - 'sysinit.target.wants/'], - ['systemd-sysusers.service', 'ENABLE_SYSUSERS', - 'sysinit.target.wants/'], - ['systemd-timedated.service', 'ENABLE_TIMEDATED', - 'dbus-org.freedesktop.timedate1.service'], - ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD', - join_paths(pkgsysconfdir, 'system/sysinit.target.wants/')], - ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'], - ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES', - 'sysinit.target.wants/'], - ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES', - 'sysinit.target.wants/'], - ['systemd-udev-settle.service', ''], - ['systemd-udev-trigger.service', '', - 'sysinit.target.wants/'], - ['systemd-udevd.service', '', - 'sysinit.target.wants/'], - ['systemd-update-done.service', '', - 'sysinit.target.wants/'], - ['systemd-update-utmp-runlevel.service', 'HAVE_UTMP HAVE_SYSV_COMPAT', - 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'], - ['systemd-update-utmp.service', 'HAVE_UTMP', - 'sysinit.target.wants/'], - ['systemd-user-sessions.service', '', - 'multi-user.target.wants/'], - ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'], - ['systemd-volatile-root.service', ''], + ['debug-shell.service', ''], + ['emergency.service', ''], + ['halt-local.service', 'HAVE_SYSV_COMPAT'], + ['initrd-cleanup.service', ''], + ['initrd-parse-etc.service', ''], + ['initrd-switch-root.service', ''], + ['initrd-udevadm-cleanup-db.service', ''], + ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES', + 'sysinit.target.wants/'], + ['quotaon.service', 'ENABLE_QUOTACHECK'], + ['rc-local.service', 'HAVE_SYSV_COMPAT'], + ['rescue.service', ''], + ['system-update-cleanup.service', ''], + ['systemd-ask-password-console.service', ''], + ['systemd-ask-password-wall.service', ''], + ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], + ['systemd-binfmt.service', 'ENABLE_BINFMT', + 'sysinit.target.wants/'], + ['systemd-coredump@.service', 'ENABLE_COREDUMP'], + ['systemd-exit.service', ''], + ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT', + 'sysinit.target.wants/'], + ['systemd-fsck-root.service', ''], + ['systemd-fsck@.service', ''], + ['systemd-halt.service', ''], + ['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'], + ['systemd-hibernate.service', 'ENABLE_HIBERNATE'], + ['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'], + ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED', + 'dbus-org.freedesktop.hostname1.service'], + ['systemd-hwdb-update.service', 'ENABLE_HWDB', + 'sysinit.target.wants/'], + ['systemd-importd.service', 'ENABLE_IMPORTD', + 'dbus-org.freedesktop.import1.service'], + ['systemd-initctl.service', ''], + ['systemd-journal-catalog-update.service', '', + 'sysinit.target.wants/'], + ['systemd-journal-flush.service', '', + 'sysinit.target.wants/'], + ['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], + ['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'], + ['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'], + ['systemd-journald.service', '', + 'sysinit.target.wants/'], + ['systemd-kexec.service', ''], + ['systemd-localed.service', 'ENABLE_LOCALED', + 'dbus-org.freedesktop.locale1.service'], + ['systemd-logind.service', 'ENABLE_LOGIND', + 'multi-user.target.wants/ dbus-org.freedesktop.login1.service'], + ['systemd-machine-id-commit.service', '', + 'sysinit.target.wants/'], + ['systemd-machined.service', 'ENABLE_MACHINED', + 'dbus-org.freedesktop.machine1.service'], + ['systemd-modules-load.service', 'HAVE_KMOD', + 'sysinit.target.wants/'], + ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD', + join_paths(pkgsysconfdir, 'system/network-online.target.wants/')], + ['systemd-nspawn@.service', ''], + ['systemd-poweroff.service', ''], + ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'], + ['systemd-random-seed.service', 'ENABLE_RANDOMSEED', + 'sysinit.target.wants/'], + ['systemd-reboot.service', ''], + ['systemd-remount-fs.service', '', + 'local-fs.target.wants/'], + ['systemd-rfkill.service', 'ENABLE_RFKILL'], + ['systemd-suspend.service', ''], + ['systemd-sysctl.service', '', + 'sysinit.target.wants/'], + ['systemd-sysusers.service', 'ENABLE_SYSUSERS', + 'sysinit.target.wants/'], + ['systemd-timedated.service', 'ENABLE_TIMEDATED', + 'dbus-org.freedesktop.timedate1.service'], + ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD', + join_paths(pkgsysconfdir, 'system/sysinit.target.wants/')], + ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'], + ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES', + 'sysinit.target.wants/'], + ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES', + 'sysinit.target.wants/'], + ['systemd-udev-settle.service', ''], + ['systemd-udev-trigger.service', '', + 'sysinit.target.wants/'], + ['systemd-udevd.service', '', + 'sysinit.target.wants/'], + ['systemd-update-done.service', '', + 'sysinit.target.wants/'], + ['systemd-update-utmp-runlevel.service', 'HAVE_UTMP HAVE_SYSV_COMPAT', + 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'], + ['systemd-update-utmp.service', 'HAVE_UTMP', + 'sysinit.target.wants/'], + ['systemd-user-sessions.service', '', + 'multi-user.target.wants/'], + ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'], + ['systemd-volatile-root.service', ''], ] m4_units = [ - ['getty@.service', '', - 'autovt@.service ' + - join_paths(pkgsysconfdir, 'system/getty.target.wants/getty@tty1.service')], - ['serial-getty@.service', ''], - ['tmp.mount', '', - 'local-fs.target.wants/'], + ['getty@.service', '', + 'autovt@.service ' + + join_paths(pkgsysconfdir, 'system/getty.target.wants/getty@tty1.service')], + ['serial-getty@.service', ''], + ['tmp.mount', '', + 'local-fs.target.wants/'], ] m4_in_units = [ - ['console-getty.service', ''], - ['container-getty@.service', ''], - ['systemd-networkd.service', 'ENABLE_NETWORKD', - 'dbus-org.freedesktop.network1.service ' + - join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], - ['systemd-resolved.service', 'ENABLE_RESOLVED', - 'dbus-org.freedesktop.resolve1.service ' + - join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], - ['user@.service', ''], + ['console-getty.service', ''], + ['container-getty@.service', ''], + ['systemd-networkd.service', 'ENABLE_NETWORKD', + 'dbus-org.freedesktop.network1.service ' + + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], + ['systemd-resolved.service', 'ENABLE_RESOLVED', + 'dbus-org.freedesktop.resolve1.service ' + + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], + ['user@.service', ''], ] foreach tuple : m4_in_units - file = tuple[0] + file = tuple[0] - gen = configure_file( - input : file + '.m4.in', - output : file + '.m4', - configuration : substs) + gen = configure_file( + input : file + '.m4.in', + output : file + '.m4', + configuration : substs) - m4_units += [[file, tuple.get(1, ''), tuple.get(2, ''), gen]] + m4_units += [[file, tuple.get(1, ''), tuple.get(2, ''), gen]] endforeach foreach tuple : in_units - file = tuple[0] + file = tuple[0] - # we do this here because install_data does not accept custom_target output - conds = tuple[1].split(' ') - install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and - (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) + # we do this here because install_data does not accept custom_target output + conds = tuple[1].split(' ') + install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and + (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) - gen1 = configure_file( - input : file + '.in', - output : file + '.tmp', - configuration : substs) - gen2 = custom_target( - file, - input : gen1, - output : file, - command : [sed, '/^## /d', '@INPUT@'], - capture : true, - install : install, - install_dir : systemunitdir) + gen1 = configure_file( + input : file + '.in', + output : file + '.tmp', + configuration : substs) + gen2 = custom_target( + file, + input : gen1, + output : file, + command : [sed, '/^## /d', '@INPUT@'], + capture : true, + install : install, + install_dir : systemunitdir) - if install and tuple.length() > 2 - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach - endif + if install and tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endforeach foreach tuple : m4_units - file = tuple[0] - input = tuple.get(3, file + '.m4') + file = tuple[0] + input = tuple.get(3, file + '.m4') - # we do this here because install_data does not accept custom_target output - conds = tuple[1].split(' ') - install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and - (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) + # we do this here because install_data does not accept custom_target output + conds = tuple[1].split(' ') + install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and + (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) - custom_target( - file, - input : input, - output: file, - command : [m4, '-P'] + m4_defines + ['@INPUT@'], - capture : true, - install : install, - install_dir : systemunitdir) + custom_target( + file, + input : input, + output: file, + command : [m4, '-P'] + m4_defines + ['@INPUT@'], + capture : true, + install : install, + install_dir : systemunitdir) - if tuple.length() > 2 and install - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach - endif + if tuple.length() > 2 and install + foreach target : tuple[2].split() + meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif endforeach foreach tuple : units - file = tuple[0] - input = tuple.get(3, file) + file = tuple[0] + input = tuple.get(3, file) - conds = tuple[1].split(' ') - install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and - (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) + conds = tuple[1].split(' ') + install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and + (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1)) - if install - install_data(input, - install_dir : systemunitdir) + if install + install_data(input, + install_dir : systemunitdir) - if tuple.length() > 2 - foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) - endforeach - endif - endif + if tuple.length() > 2 + foreach target : tuple[2].split() + meson.add_install_script( + 'meson-add-wants.sh', systemunitdir, target, file) + endforeach + endif + endif endforeach ############################################################ @@ -319,11 +318,12 @@ meson.add_install_script(meson_make_symlink, join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'), join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service')) if conf.get('HAVE_SYSV_COMPAT', 0) == 1 - foreach i : [1, 2, 3, 4, 5] - meson.add_install_script('sh', '-c', - mkdir_p - .format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i)))) - endforeach + foreach i : [1, 2, 3, 4, 5] + meson.add_install_script( + 'sh', '-c', + mkdir_p + .format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i)))) + endforeach endif subdir('user') diff --git a/units/user/meson.build b/units/user/meson.build index f9c73a359a..b507144c05 100644 --- a/units/user/meson.build +++ b/units/user/meson.build @@ -1,36 +1,33 @@ -# -*- mode: meson -*- - units = [ - 'basic.target', - 'bluetooth.target', - 'default.target', - 'exit.target', - 'graphical-session-pre.target', - 'graphical-session.target', - 'paths.target', - 'printer.target', - 'shutdown.target', - 'smartcard.target', - 'sockets.target', - 'sound.target', - 'timers.target', - ] + 'basic.target', + 'bluetooth.target', + 'default.target', + 'exit.target', + 'graphical-session-pre.target', + 'graphical-session.target', + 'paths.target', + 'printer.target', + 'shutdown.target', + 'smartcard.target', + 'sockets.target', + 'sound.target', + 'timers.target', +] foreach file : units - install_data(file, - install_dir : userunitdir) + install_data(file, + install_dir : userunitdir) endforeach - in_units = [ - 'systemd-exit.service', - ] + 'systemd-exit.service', +] foreach file : in_units - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - install_data(gen, - install_dir : userunitdir) + gen = configure_file( + input : file + '.in', + output : file, + configuration : substs) + install_data(gen, + install_dir : userunitdir) endforeach From 1aec3ed90d553482918b283e52b82918d7f5a388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Apr 2017 19:33:10 -0400 Subject: [PATCH 58/82] meson: add libblkid as libudev-core dep to fix include dir Follow-up for 6b5cf3ea62. v2: - also link udevadm and systemd-udev statically if requested v3: - fix install_rpath for udevadm (Michael Biebl) --- meson.build | 10 ++++------ src/udev/meson.build | 17 +++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index a9011e50d2..b1deb32144 100644 --- a/meson.build +++ b/meson.build @@ -2017,15 +2017,14 @@ exe = executable('systemd-udevd', systemd_udevd_sources, include_directories : includes, link_with : [libudev_core, - libudev_internal, libsystemd_network, - libshared], + libudev_internal], dependencies : [threads, libkmod, libidn, libacl, libblkid], - install_rpath : rootlibexecdir, + install_rpath : udev_rpath, install : true, install_dir : rootlibexecdir) public_programs += [exe] @@ -2034,15 +2033,14 @@ exe = executable('udevadm', udevadm_sources, include_directories : includes, link_with : [libudev_core, - libudev_internal, libsystemd_network, - libshared], + libudev_internal], dependencies : [threads, libkmod, libidn, libacl, libblkid], - install_rpath : rootlibexecdir, + install_rpath : udev_rpath, install : true, install_dir : rootbindir) public_programs += [exe] diff --git a/src/udev/meson.build b/src/udev/meson.build index e3d3fa2462..495e9d3c54 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -91,19 +91,19 @@ link_config_gperf_c = custom_target( ############################################################ if get_option('link-udev-shared') - libudev_link_with = [libshared] - rpath = rootlibexecdir + udev_link_with = [libshared] + udev_rpath = rootlibexecdir else - libudev_link_with = [libshared_static, - libsystemd_internal] - rpath = '' + udev_link_with = [libshared_static, + libsystemd_internal] + udev_rpath = '' endif libudev_internal = static_library( 'udev', libudev_sources, include_directories : includes, - link_with : libudev_link_with) + link_with : udev_link_with) libudev_core_includes = [includes, include_directories('net')] libudev_core = static_library( @@ -112,7 +112,8 @@ libudev_core = static_library( link_config_gperf_c, keyboard_keys_from_name_h, include_directories : libudev_core_includes, - link_with : libudev_link_with) + link_with : udev_link_with, + dependencies : [libblkid]) foreach prog : [['ata_id/ata_id.c'], ['cdrom_id/cdrom_id.c'], @@ -130,7 +131,7 @@ foreach prog : [['ata_id/ata_id.c'], prog, include_directories : includes, link_with : [libudev_internal], - install_rpath : rpath, + install_rpath : udev_rpath, install : true, install_dir : udevlibexecdir) endforeach From a923e085af00dfd47eafbbd6964398a10e5a4f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Apr 2017 19:48:20 -0400 Subject: [PATCH 59/82] meson: use run_target instead of custom_target where appropriate This way a fake output does not need to be specified. --- hwdb/meson.build | 3 +-- man/meson.build | 39 ++++++++++++++++++++------------------- meson.build | 3 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/hwdb/meson.build b/hwdb/meson.build index b9fc5ab594..d6e858311a 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -31,7 +31,6 @@ endif ############################################################ -custom_target( +run_target( 'update', - output : 'update', command : [hwdb_update_sh, meson.current_source_dir()]) diff --git a/man/meson.build b/man/meson.build index 1c1dbd86b7..79d7710d11 100644 --- a/man/meson.build +++ b/man/meson.build @@ -130,24 +130,25 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], html_pages += [p2] endforeach -man = custom_target('man', - depends : man_pages, - output : 'man', - command : ['echo']) +man = run_target( + 'man', + depends : man_pages, + command : ['echo']) -html = custom_target('html', - depends : html_pages, - output : 'html', - command : ['echo']) +html = run_target( + 'html', + depends : html_pages, + output : 'html', + command : ['echo']) -custom_target('doc-sync', - depends : [man, html], - output : ['doc-sync'], - command : ['rsync', '-rlv', - '--delete-excluded', - '--include=man', - '--include=*.html', - '--exclude=*', - '--omit-dir-times', - meson.current_build_dir(), - get_option('www-target')]) +run_target( + 'doc-sync', + depends : man_pages + html_pages, + command : ['rsync', '-rlv', + '--delete-excluded', + '--include=man', + '--include=*.html', + '--exclude=*', + '--omit-dir-times', + meson.current_build_dir(), + get_option('www-target')]) diff --git a/meson.build b/meson.build index b1deb32144..4690619e54 100644 --- a/meson.build +++ b/meson.build @@ -2278,8 +2278,7 @@ endif if git.found() meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') - custom_target( + run_target( 'git-contrib', - output : 'git-contrib', command : [meson_git_contrib_sh]) endif From 86b3ca7a667baef407ccfa28166638ed0e64c26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Apr 2017 17:14:48 -0400 Subject: [PATCH 60/82] meson: use "sh -eu" and make .sh +x, .py -x Shell scripts should be executable so that meson reports their invocation succinctly (does not print 'sh' '-e'). Python scripts should not be executable so that meson does the detection of the right python binary itself. Add -u everywhere to catch potential errors. --- src/basic/generate-af-list.sh | 2 +- src/basic/generate-arphrd-list.sh | 2 +- src/basic/generate-cap-list.sh | 2 +- src/basic/generate-errno-list.sh | 2 +- src/boot/efi/no-undefined-symbols.sh | 2 +- src/journal/generate-audit_type-list.sh | 2 +- src/test/generate-sym-test.py | 0 src/udev/generate-keyboard-keys-list.sh | 2 +- tools/meson-check-compilation.sh | 2 +- tools/meson-check-help.sh | 2 +- tools/meson-git-contrib.sh | 2 +- tools/meson-hwdb-update.sh | 2 +- tools/meson-make-symlink.sh | 2 +- units/meson-add-wants.sh | 2 +- 14 files changed, 13 insertions(+), 13 deletions(-) mode change 100644 => 100755 src/basic/generate-af-list.sh mode change 100644 => 100755 src/basic/generate-arphrd-list.sh mode change 100644 => 100755 src/basic/generate-cap-list.sh mode change 100644 => 100755 src/basic/generate-errno-list.sh mode change 100644 => 100755 src/boot/efi/no-undefined-symbols.sh mode change 100644 => 100755 src/journal/generate-audit_type-list.sh mode change 100755 => 100644 src/test/generate-sym-test.py mode change 100644 => 100755 src/udev/generate-keyboard-keys-list.sh mode change 100644 => 100755 tools/meson-check-compilation.sh mode change 100644 => 100755 tools/meson-git-contrib.sh mode change 100644 => 100755 tools/meson-make-symlink.sh mode change 100644 => 100755 units/meson-add-wants.sh diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh old mode 100644 new mode 100755 index 3fdfe2ea60..733cf59dd0 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -eu $1 -E -dM -include sys/socket.h - Date: Tue, 18 Apr 2017 19:11:54 -0400 Subject: [PATCH 61/82] meson: add ln --relative check --- meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 4690619e54..65cb3889fd 100644 --- a/meson.build +++ b/meson.build @@ -441,8 +441,9 @@ foreach prog : progs substs.set(name, path) endforeach -# TODO: add ln --relative check -# AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])]) +if run_command('ln', '--relative', '--help').returncode() != 0 + error('ln does not support --relative') +endif ############################################################ From 18af8932e8f74f776a591caba4dacfea4c6d62bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Apr 2017 21:00:46 -0400 Subject: [PATCH 62/82] meson: add rule to regenerate man/rules/meson.build --- man/meson.build | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/man/meson.build b/man/meson.build index 79d7710d11..b71bc20509 100644 --- a/man/meson.build +++ b/man/meson.build @@ -1,9 +1,6 @@ # This is lame, I know, but meson has no other include mechanism subdir('rules') -# TODO: add regeneration rule: -# python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build - want_man = get_option('man') want_html = get_option('html') xsltproc = find_program('xsltproc', @@ -152,3 +149,18 @@ run_target( '--omit-dir-times', meson.current_build_dir(), get_option('www-target')]) + +############################################################ + +if git.found() + run_target( + 'update-man-rules', + # slightly strange syntax because of + # https://github.com/mesonbuild/meson/issues/1643 + # and https://github.com/mesonbuild/meson/issues/1512 + command : ['sh', '-c', + 'cd @0@ && '.format(meson.build_root()) + + 'python3 @0@/tools/make-man-rules.py --meson `git ls-files ":/man/*.xml"` >t && '.format(meson.source_root()) + + 'mv t @0@/rules/meson.build'.format(meson.current_source_dir())], + depend_files : custom_entities_ent) +endif From 3e609a8ad369301488da9d9947034f343dcf47b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Apr 2017 21:52:30 -0400 Subject: [PATCH 63/82] README: update with meson instructions v2: - call the project ninja-build and the executable ninja. (/usr/bin/ninja-build is a fedora-ism, hopefully gone soon.) --- README | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/README b/README index 260668c8db..d7477510a9 100644 --- a/README +++ b/README @@ -156,21 +156,47 @@ REQUIREMENTS: dracut (optional) PolicyKit (optional) - When building from git, the following tools are needed: + Two build systems are supported: meson + ninja-build and autools + make. + + The following tools are needed with both systems: pkg-config - docbook-xsl - xsltproc + gperf >= 3.1 + docbook-xsl (optional, required for documentation) + xsltproc (optional, required for documentation) + python-lxml (optional, required to build the indices) + + When building with meson, python and ninja-build are required. + + To build in directory build/: + meson build/ && ninja -C build + + Any configuration options can be specfied as -Darg=value... arguments + to meson. After the build directory is initially configured, meson will + refuse to run again, and options must be changed with: + mesonconf -Darg=value... + mesonconf without any arguments will print out available options and + their current values. + + Useful commands: + ninja -v some/target + ninja test + sudo ninja install + DESTDIR=... ninja install + + When building with autotools, the following tools are needed: + automake autoconf libtool intltool - gperf >= 3.1 python (optional) - python-lxml (optional, but required to build the indices) - The build system is initialized with ./autogen.sh. A tar ball - can be created with: + The build system is initialized with ./autogen.sh and the usual + ./configure && make + should be used. + + A tar ball can be created with: git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz When systemd-hostnamed is used, it is strongly recommended to From 08936cea45e032d99bf718a9a1255e1ae79b9964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 19 Apr 2017 10:32:42 -0400 Subject: [PATCH 64/82] meson: install the dbus aliases for resolve1 and network1 in /etc This way when the units are disabled, their dbus activation is also disabled. v2: - fix the symlink location --- units/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/units/meson.build b/units/meson.build index 58d9e2b28f..0cc5f8861a 100644 --- a/units/meson.build +++ b/units/meson.build @@ -216,10 +216,10 @@ m4_in_units = [ ['console-getty.service', ''], ['container-getty@.service', ''], ['systemd-networkd.service', 'ENABLE_NETWORKD', - 'dbus-org.freedesktop.network1.service ' + + join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.network1.service') + ' ' + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['systemd-resolved.service', 'ENABLE_RESOLVED', - 'dbus-org.freedesktop.resolve1.service ' + + join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.resolve1.service') + ' ' + join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')], ['user@.service', ''], ] From 9c84bb784d44bdb58fe4992619a8f96d1229900c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 19 Apr 2017 11:30:32 -0400 Subject: [PATCH 65/82] meson: fix 'clean' --- man/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/meson.build b/man/meson.build index b71bc20509..9cdb560c4c 100644 --- a/man/meson.build +++ b/man/meson.build @@ -127,8 +127,10 @@ foreach tuple : [['systemd.directives', '7', systemd_directives_xml], html_pages += [p2] endforeach -man = run_target( +# cannot use run_target until https://github.com/mesonbuild/meson/issues/1644 is resolved +man = custom_target( 'man', + output : 'man', depends : man_pages, command : ['echo']) From 38f1ae0f99b84589c1418e30559cd1c2beba20ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 19 Apr 2017 16:14:16 -0400 Subject: [PATCH 66/82] meson: check string.h not strings.h for explicit_bzero I used strings.h because that's what explicit_bzero(3) says. But glibc defines it in string.h. There are no other available implementations atm (musl does not define it, bionic aliases it to memset in openbsd-compat.h, yikes). We also include just string.h from the code. So just look for the function in string.h, and if it ever appears in other places, we can change the detection and includes. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 65cb3889fd..52ef13dee7 100644 --- a/meson.build +++ b/meson.build @@ -388,7 +388,7 @@ foreach ident : [ #include '''], ['copy_file_range', '''#include #include '''], - ['explicit_bzero' , '''#include '''], + ['explicit_bzero' , '''#include '''], ] have = cc.has_function(ident[0], prefix : ident[1]) From 4984c8be739dffe4cf9ff3ab905eb3b2ee3ca826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 19 Apr 2017 21:20:54 -0400 Subject: [PATCH 67/82] meson: detect getrandom in sys/random.h, fall back to linux/random.h This is analogous to commit e84397d95c3da2b9722ff265843ad4a8874643d8. --- meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 52ef13dee7..df08545159 100644 --- a/meson.build +++ b/meson.build @@ -381,7 +381,6 @@ foreach ident : [ #include '''], ['setns', '''#define _GNU_SOURCE #include '''], - ['getrandom', '''#include '''], ['renameat2', '''#include '''], ['kcmp', '''#include '''], ['keyctl', '''#include @@ -395,6 +394,14 @@ foreach ident : [ conf.set10('HAVE_DECL_' + ident[0].to_upper(), have) endforeach +if cc.has_function('getrandom', prefix : '''#include ''') + conf.set('USE_SYS_RANDOM_H', 1) + conf.set10('HAVE_DECL_GETRANDOM', 1) +else + have = cc.has_function('getrandom', prefix : '''#include ''') + conf.set10('HAVE_DECL_GETRANDOM', have) +endif + ##################################################################### sed = find_program('sed') From 6800fe7f0678c2a3875005bdef147e10eac67428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 19 Apr 2017 22:57:52 -0400 Subject: [PATCH 68/82] meson: define gnu_efi_arch for the arch efi name, fix ldsdir detection This fixes ldsdir detection under Debian. v2: - define gnu_efi_arch for the arch efi include directory name In the autotools naming convention, efi_arch and this directory always had the same name. But meson.cpu_family() uses a slightly different convention, so those two don't always match. --- meson.build | 7 ++++++- src/boot/efi/meson.build | 21 +++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index df08545159..97fff496e1 100644 --- a/meson.build +++ b/meson.build @@ -977,16 +977,21 @@ tests = [] if get_option('efi') efi_arch = host_machine.cpu_family() - if efi_arch == 'ia32' + if efi_arch == 'x86' EFI_MACHINE_TYPE_NAME = 'ia32' + gnu_efi_arch = 'ia32' elif efi_arch == 'x86_64' EFI_MACHINE_TYPE_NAME = 'x64' + gnu_efi_arch = 'x86_64' elif efi_arch == 'arm' EFI_MACHINE_TYPE_NAME = 'arm' + gnu_efi_arch = 'arm' elif efi_arch == 'aarch64' EFI_MACHINE_TYPE_NAME = 'aa64' + gnu_efi_arch = 'aarch64' else EFI_MACHINE_TYPE_NAME = '' + gnu_efi_arch = '' endif conf.set('ENABLE_EFI', 1) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index bdf54654de..6c5c856d8c 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -33,8 +33,8 @@ if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'false' efi_ld = get_option('efi-ld') efi_incdir = get_option('efi-includedir') - efibind_h = '@0@/@1@/efibind.h'.format(efi_incdir, efi_arch) - have_header = cc.has_header(efibind_h) + have_header = (gnu_efi_arch != '' and + cc.has_header('@0@/@1@/efibind.h'.format(efi_incdir, gnu_efi_arch))) if have_header and EFI_MACHINE_TYPE_NAME == '' error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown') @@ -70,8 +70,17 @@ if have_gnu_efi objcopy = find_program('objcopy') efi_ldsdir = get_option('efi-ldsdir') + arch_lds = 'elf_@0@_efi.lds'.format(gnu_efi_arch) if efi_ldsdir == '' efi_ldsdir = join_paths(efi_libdir, 'gnuefi') + cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds)) + if cmd.returncode() != 0 + efi_ldsdir = efi_libdir + cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds)) + if cmd.returncode() != 0 + error('Cannot find @0@'.format(arch_lds)) + endif + endif endif message('efi-libdir: "@0@"'.format(efi_libdir)) @@ -91,7 +100,7 @@ if have_gnu_efi '-Wsign-compare', '-Wno-missing-field-initializers', '-isystem', efi_incdir, - '-isystem', join_paths(efi_incdir, efi_arch), + '-isystem', join_paths(efi_incdir, gnu_efi_arch), '-include', efi_config_h] if efi_arch == 'x86_64' compile_args += ['-mno-red-zone', @@ -105,20 +114,20 @@ if have_gnu_efi endif efi_ldflags = ['-T', - '@0@/elf_@1@_efi.lds'.format(efi_ldsdir, efi_arch), + join_paths(efi_ldsdir, arch_lds), '-shared', '-Bsymbolic', '-nostdlib', '-znocombreloc', '-L', efi_libdir, - '@0@/crt0-efi-@1@.o'.format(efi_ldsdir, efi_arch)] + join_paths(efi_ldsdir, 'crt0-efi-@0@.o'.format(gnu_efi_arch))] if efi_arch == 'aarch64' or efi_arch == 'arm' # Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' # instead, and add required symbols manually. efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa'] efi_format = ['-O', 'binary'] else - efi_format = ['--target=efi-app-@0@'.format(efi_arch)] + efi_format = ['--target=efi-app-@0@'.format(gnu_efi_arch)] endif systemd_boot_objects = [] From dc25d2adb5ed252c2f702f0075ad74fee684d78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Apr 2017 12:06:14 -0400 Subject: [PATCH 69/82] meson: $DESTDIR might be undefined This causes an error with -u. Just add an empty fallback. --- tools/meson-make-symlink.sh | 6 +++--- units/meson-add-wants.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 69eab9ba73..360ff92ebb 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -3,9 +3,9 @@ # this is needed mostly because $DESTDIR is provided as a variable, # and we need to create the target directory... -mkdir -vp "$(dirname "${DESTDIR}$2")" +mkdir -vp "$(dirname "${DESTDIR:-}$2")" if [ "$(dirname $1)" = . ]; then - ln -vfs -T "$1" "${DESTDIR}$2" + ln -vfs -T "$1" "${DESTDIR:-}$2" else - ln -vfs -T --relative "${DESTDIR}$1" "${DESTDIR}$2" + ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" fi diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh index 7fbf5ed6fc..e2f5a355bc 100755 --- a/units/meson-add-wants.sh +++ b/units/meson-add-wants.sh @@ -6,14 +6,14 @@ unit="$3" case "$target" in */?*) # a path, but not just a slash at the end - dir="${DESTDIR}${target}" + dir="${DESTDIR:-}${target}" ;; *) - dir="${DESTDIR}${unitdir}/${target}" + dir="${DESTDIR:-}${unitdir}/${target}" ;; esac -unitpath="${DESTDIR}${unitdir}/${unit}" +unitpath="${DESTDIR:-}${unitdir}/${unit}" case "$target" in */) From 36f0387efc0d7d3a72a7b0e3c94e513b14505d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 21 Apr 2017 13:53:59 -0400 Subject: [PATCH 70/82] meson: add option to disable libacl support --- meson.build | 17 +++++++++++------ meson_options.txt | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 97fff496e1..4515c0098d 100644 --- a/meson.build +++ b/meson.build @@ -660,6 +660,17 @@ if want_polkit != 'false' endif endif +want_acl = get_option('acl') +if want_acl != 'false' + libacl = cc.find_library('acl', required : want_acl == 'true') + if libacl.found() + conf.set('HAVE_ACL', 1) + m4_defines += ['-DHAVE_ACL'] + endif +else + libacl = [] +endif + want_audit = get_option('audit') if want_audit != 'false' libaudit = dependency('audit', required : want_audit == 'true') @@ -845,12 +856,6 @@ else liblz4 = [] endif -libacl = cc.find_library('acl', required : false) -if libacl.found() - conf.set('HAVE_ACL', 1) - m4_defines += ['-DHAVE_ACL'] -endif - want_glib = get_option('glib') if want_glib != 'false' libglib = dependency('glib-2.0', diff --git a/meson_options.txt b/meson_options.txt index 132c05ab56..790119cd1f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -175,6 +175,8 @@ option('polkit', type : 'combo', choices : ['auto', 'true', 'false'], option('ima', type : 'boolean', description : 'IMA support') +option('acl', type : 'combo', choices : ['auto', 'true', 'false'], + description : 'libacl support') option('audit', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libaudit support') option('blkid', type : 'combo', choices : ['auto', 'true', 'false'], From 76c8741060bd0f5f64d9c05fd6b402e4e6e4eb66 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 21 Apr 2017 23:45:54 +0200 Subject: [PATCH 71/82] meson: fix gcrypt config option Also detect libgpg-error. Require both to be present for HAVE_CRYPT, even though libgpg-error is only used in src/resolve. If one is available, the other should be too, so it doesn't seem worth the trouble to make two separate conditions. --- meson.build | 26 ++++++++++++++++++++------ meson_options.txt | 4 ++-- src/journal/meson.build | 11 +++++++++++ src/resolve/meson.build | 3 +++ src/shared/meson.build | 1 + 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 4515c0098d..c808a8fc43 100644 --- a/meson.build +++ b/meson.build @@ -899,14 +899,21 @@ else libdbus = [] endif -want_libgcrypt = get_option('libgcrypt') -if want_libgcrypt != 'false' - libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true') - if libgcrypt.found() - conf.set('HAVE_LIBGCRYPT', 1) +want_gcrypt = get_option('gcrypt') +if want_gcrypt != 'false' + libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true') + libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true') + + if libgcrypt.found() and libgpg_error.found() + conf.set('HAVE_GCRYPT', 1) + else + # link to neither of the libs if one is not found + libgcrypt = [] + libgpg_error = [] endif else libgcrypt = [] + libgpg_error = [] endif want_importd = get_option('importd') @@ -915,7 +922,7 @@ if want_importd != 'false' conf.get('HAVE_ZLIB', 0) == 1 and conf.get('HAVE_BZIP2', 0) == 1 and conf.get('HAVE_XZ', 0) == 1 and - conf.get('HAVE_LIBGCRYPT', 0) == 1) + conf.get('HAVE_GCRYPT', 0) == 1) if have_deps conf.set('ENABLE_IMPORTD', 1) elif want_importd == 'true' @@ -1060,6 +1067,7 @@ libsystemd = shared_library( '-Wl,--version-script=' + libsystemd_sym_path], link_with : [libbasic], dependencies : [threads, + libgcrypt, librt, libxz, liblz4], @@ -1305,9 +1313,12 @@ endif if conf.get('ENABLE_RESOLVED', 0) == 1 executable('systemd-resolved', systemd_resolved_sources, + gcrypt_util_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, + libgcrypt, + libgpg_error, libm, libidn], install_rpath : rootlibexecdir, @@ -1316,9 +1327,12 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 exe = executable('systemd-resolve', systemd_resolve_sources, + gcrypt_util_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, + libgcrypt, + libgpg_error, libm, libidn], install_rpath : rootlibexecdir, diff --git a/meson_options.txt b/meson_options.txt index 790119cd1f..d9f2f4be33 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -197,8 +197,8 @@ option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libiptc support') option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libqrencode support') -option('libgcrypt', type : 'combo', choices : ['auto', 'true', 'false'], - description : 'libgcrypt support') +option('gcrypt', type : 'combo', choices : ['auto', 'true', 'false'], + description : 'gcrypt support') option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'], description : 'gnutls support') option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'], diff --git a/src/journal/meson.build b/src/journal/meson.build index 71396af529..37ec559e41 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -20,6 +20,17 @@ journal_internal_sources = files(''' sd-journal.c '''.split()) +if conf.get('HAVE_GCRYPT', 0) == 1 + journal_internal_sources += files(''' + journal-authenticate.c + journal-authenticate.h + fsprg.c + fsprg.h + '''.split()) + + journal_internal_sources += gcrypt_util_sources +endif + ############################################################ audit_type_includes = [config_h, diff --git a/src/resolve/meson.build b/src/resolve/meson.build index b8feb7bb1b..46a417e766 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -147,6 +147,7 @@ tests += [ 'src/shared/test-tables.h'], [], [libgcrypt, + libgpg_error, libm], 'ENABLE_RESOLVED'], @@ -155,6 +156,7 @@ tests += [ dns_type_headers], [], [libgcrypt, + libgpg_error, libm], 'ENABLE_RESOLVED'], @@ -163,6 +165,7 @@ tests += [ dns_type_headers], [], [libgcrypt, + libgpg_error, libm], 'ENABLE_RESOLVED'], diff --git a/src/shared/meson.build b/src/shared/meson.build index 5f48567817..8968127d3f 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -131,6 +131,7 @@ libshared = shared_library( libcap, libacl, libcryptsetup, + libgcrypt, libiptc, libseccomp, libselinux, From 26bd4b7f9c9bf1f789a57978ffd082784412d4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 23 Apr 2017 21:36:29 -0400 Subject: [PATCH 72/82] meson: add forgotten parse_hwdb.py test --- hwdb/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hwdb/meson.build b/hwdb/meson.build index d6e858311a..68a23e0afe 100644 --- a/hwdb/meson.build +++ b/hwdb/meson.build @@ -31,6 +31,12 @@ endif ############################################################ +parse_hwdb_py = find_program('parse_hwdb.py') +test('parse-hwdb', + parse_hwdb_py) + +############################################################ + run_target( 'update', command : [hwdb_update_sh, meson.current_source_dir()]) From 0da6f396198d4977215945beea41f52a4c4dc3fb Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 21 Apr 2017 18:32:14 +0200 Subject: [PATCH 73/82] meson: allow static linking of systemd-hwdb Various distros split udev and its helpers into a separate binary package. In case of Debian this also includes systemd-hwdb. In Debian, the udev package is not supposed to depend on systemd, so a dependency on libsystemd-shared.so is not desired. Allow the systemd-hwdb binary to be linked statically if link-udev-shared is set to false. Follow-up for 3a30f21ff8ddbef5eae61d6e4305ec1cd2e4e041. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c808a8fc43..a4c93de21a 100644 --- a/meson.build +++ b/meson.build @@ -2018,8 +2018,8 @@ if conf.get('ENABLE_HWDB', 0) == 1 'src/hwdb/hwdb.c', 'src/libsystemd/sd-hwdb/hwdb-internal.h', include_directories : includes, - link_with : [libshared], - install_rpath : rootlibexecdir, + link_with : [libudev_internal], + install_rpath : udev_rpath, install : true, install_dir : rootbindir) public_programs += [exe] From 41afb5eb7214727301132aedc381831fbfc78e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:28:04 -0400 Subject: [PATCH 74/82] meson: use -f{function,data}-sections for optimized builds --- meson.build | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meson.build b/meson.build index a4c93de21a..949f63611b 100644 --- a/meson.build +++ b/meson.build @@ -303,6 +303,21 @@ foreach arg : ['-Wl,-z,relro', endif endforeach +if get_option('buildtype') != 'debug' + foreach arg : ['-ffunction-sections', + '-fdata-sections'] + if cc.has_argument(arg) + add_project_arguments(arg, language : 'c') + endif + endforeach + + foreach arg : ['-Wl,--gc-sections'] + if cc.has_argument(arg) + add_project_link_arguments(arg, language : 'c') + endif + endforeach +endif + cpp = ' '.join(cc.cmd_array()) + ' -E' ##################################################################### From 80c6fce81cd1256cbc65bf567aaaa42b6cd60691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:28:04 -0400 Subject: [PATCH 75/82] meson: add forgotten tpm support --- meson.build | 3 +++ meson_options.txt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/meson.build b/meson.build index 949f63611b..ae577660cd 100644 --- a/meson.build +++ b/meson.build @@ -986,6 +986,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['rfkill', 'ENABLE_RFKILL'], ['ldconfig', 'ENABLE_LDCONFIG'], ['efi', 'ENABLE_EFI'], + ['tpm', 'SD_BOOT_LOG_TPM'], ['ima', 'HAVE_IMA'], ] @@ -1023,6 +1024,8 @@ if get_option('efi') conf.set('ENABLE_EFI', 1) conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) + + conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int()) endif ##################################################################### diff --git a/meson_options.txt b/meson_options.txt index d9f2f4be33..350be3cc88 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,6 +45,8 @@ option('resolve', type : 'boolean', description : 'systemd-resolved stack') option('efi', type : 'boolean', description : 'enable systemd-boot and bootctl') +option('tpm', type : 'boolean', value : false, + description : 'TPM should be used to log events and extend the registers') option('environment-d', type : 'boolean', description : 'support for environment.d') option('binfmt', type : 'boolean', @@ -230,6 +232,8 @@ option('efi-ldsdir', type : 'string', description : 'path to the EFI lds directory') option('efi-includedir', type : 'string', value : '/usr/include/efi', description : 'path to the EFI header directory') +option('tpm-pcrindex', type : 'string', value : '8', + description : 'TPM PCR register number to use') option('bashcompletiondir', type : 'string', description : 'directory for bash completion scripts ["no" disables]') From 5464ec8a8e7a84341d192e7614ad55c159652751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:28:04 -0400 Subject: [PATCH 76/82] meson: there is no smack library Detection would always fail, so this was broken. Treat this as a binary enable/disable option. --- meson.build | 13 +------------ meson_options.txt | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index ae577660cd..59318a9a5d 100644 --- a/meson.build +++ b/meson.build @@ -642,18 +642,6 @@ else libapparmor = [] endif -want_smack = get_option('smack') -if want_smack != 'false' - libsmack = dependency('libsmack', - required : want_smack == 'true') - if libsmack.found() - conf.set('HAVE_SMACK', 1) - m4_defines += ['-DHAVE_SMACK'] - endif -else - libsmack = [] -endif - smack_run_label = get_option('smack-run-label') if smack_run_label != '' conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) @@ -988,6 +976,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['efi', 'ENABLE_EFI'], ['tpm', 'SD_BOOT_LOG_TPM'], ['ima', 'HAVE_IMA'], + ['smack', 'HAVE_SMACK'], ] if get_option(pair[0]) diff --git a/meson_options.txt b/meson_options.txt index 350be3cc88..6d40c3f806 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -168,7 +168,7 @@ option('selinux', type : 'combo', choices : ['auto', 'true', 'false'], description : 'SELinux support') option('apparmor', type : 'combo', choices : ['auto', 'true', 'false'], description : 'AppArmor support') -option('smack', type : 'combo', choices : ['auto', 'true', 'false'], +option('smack', type : 'boolean', description : 'SMACK support') option('smack-run-label', type : 'string', description : 'run systemd --system itself with a specific SMACK label') From ad68714d5cc6a5b68a7ae0fcacfbef5f621c45b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:28:05 -0400 Subject: [PATCH 77/82] meson: test-ns is manual, not just unsafe --- src/test/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/meson.build b/src/test/meson.build index 10c3201ab4..6c0fd4dca9 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -74,7 +74,7 @@ tests += [ libselinux, libmount, libblkid], - '', 'unsafe'], + '', 'manual'], [['src/test/test-loopback.c'], [libcore, From dd6ab3df749172e0b85de00338b485d8f4e24fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:28:05 -0400 Subject: [PATCH 78/82] meson: add git-snapshot target The output is systemd-.tar.gz in source root. --- meson.build | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/meson.build b/meson.build index 59318a9a5d..991836a976 100644 --- a/meson.build +++ b/meson.build @@ -2321,3 +2321,22 @@ if git.found() 'git-contrib', command : [meson_git_contrib_sh]) endif + +if git.found() + git_head = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'rev-parse', 'HEAD']).stdout().strip() + git_head_short = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'rev-parse', '--short=7', 'HEAD']).stdout().strip() + + run_target( + 'git-snapshot', + command : ['git', 'archive', + '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(), + git_head_short), + '--prefix', 'systemd-@0@/'.format(git_head), + 'HEAD']) +endif From b884196cc1565eaf1b97141fbfa0667ee348e463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:40:02 -0400 Subject: [PATCH 79/82] meson: also indent scripts with 8 spaces --- .dir-locals.el | 5 ++++- src/basic/af-to-name.awk | 10 +++++++--- src/basic/arphrd-to-name.awk | 10 +++++++--- src/basic/cap-to-name.awk | 10 +++++++--- src/basic/errno-to-name.awk | 11 ++++++++--- src/basic/generate-af-list.sh | 4 ++-- src/basic/generate-arphrd-list.sh | 4 ++-- src/basic/generate-cap-list.sh | 4 ++-- src/basic/generate-errno-list.sh | 2 +- src/boot/efi/no-undefined-symbols.sh | 4 ++-- src/core/load-fragment-gperf-nulstr.awk | 14 ++++++++------ src/journal/audit_type-to-name.awk | 8 ++++++-- src/journal/generate-audit_type-list.sh | 8 ++++---- src/resolve/dns_type-to-name.awk | 14 +++++++++----- src/test/test-hashmap-ordered.awk | 14 +++++++------- src/udev/generate-keyboard-keys-list.sh | 2 +- test/test-efi-create-disk.sh | 14 +++++++------- tools/meson-check-help.sh | 14 +++++++------- tools/meson-git-contrib.sh | 8 ++++---- tools/meson-make-symlink.sh | 4 ++-- units/meson-add-wants.sh | 24 ++++++++++++------------ 21 files changed, 109 insertions(+), 79 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 9dfdbe3fe2..5ef7e11634 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -21,4 +21,7 @@ (eval . (c-set-offset 'arglist-close 0)))) (nxml-mode . ((nxml-child-indent . 2) (fill-column . 119))) - (meson-mode . ((meson-indent-basic . 8)))) + (meson-mode . ((meson-indent-basic . 8))) + (sh-mode . ((sh-basic-offset . 8) + (sh-indentation . 8))) + (awk-mode . ((c-basic-offset . 8)))) diff --git a/src/basic/af-to-name.awk b/src/basic/af-to-name.awk index e20830487f..18d0a89728 100644 --- a/src/basic/af-to-name.awk +++ b/src/basic/af-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const af_names[] = { "} +BEGIN{ + print "static const char* const af_names[] = { " +} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { - printf " [%s] = \"%s\",\n", $1, $1 + printf " [%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk index 57e4680f17..5a35673e2c 100644 --- a/src/basic/arphrd-to-name.awk +++ b/src/basic/arphrd-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const arphrd_names[] = { "} +BEGIN{ + print "static const char* const arphrd_names[] = { " +} !/CISCO/ { - printf " [ARPHRD_%s] = \"%s\",\n", $1, $1 + printf " [ARPHRD_%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/cap-to-name.awk b/src/basic/cap-to-name.awk index d252291851..402a782024 100644 --- a/src/basic/cap-to-name.awk +++ b/src/basic/cap-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const capability_names[] = { "} +BEGIN{ + print "static const char* const capability_names[] = { " +} { - printf " [%s] = \"%s\",\n", $1, tolower($1) + printf " [%s] = \"%s\",\n", $1, tolower($1) +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/errno-to-name.awk b/src/basic/errno-to-name.awk index c48c8f93ab..0878abacbd 100644 --- a/src/basic/errno-to-name.awk +++ b/src/basic/errno-to-name.awk @@ -1,4 +1,9 @@ -BEGIN{ print "static const char* const errno_names[] = { " } +BEGIN{ + print "static const char* const errno_names[] = { " +} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { - printf " [%s] = \"%s\",\n", $1, $1 } -END{ print "};" } + printf " [%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" +} diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh index 733cf59dd0..8d9cdd1836 100755 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -1,5 +1,5 @@ #!/bin/sh -eu $1 -E -dM -include sys/socket.h - mnt/cmdline.txt objcopy \ - --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ - --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \ - --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \ - --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \ - --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \ - "$boot_stub" mnt/EFI/Linux/linux-test.efi + --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ + --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \ + --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \ + --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \ + --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \ + "$boot_stub" mnt/EFI/Linux/linux-test.efi # install entries mkdir -p mnt/loader/entries diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh index 7102866a5c..47a5099a04 100755 --- a/tools/meson-check-help.sh +++ b/tools/meson-check-help.sh @@ -2,19 +2,19 @@ # output width if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then - echo "$(basename "$1") --help output is too wide:" - "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}' - exit 1 + echo "$(basename "$1") --help output is too wide:" + "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}' + exit 1 fi # no --help output to stdout if "$1" --help 2>&1 1>/dev/null | grep .; then - echo "$(basename "$1") --help prints to stderr" - exit 2 + echo "$(basename "$1") --help prints to stderr" + exit 2 fi # error output to stderr if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then - echo "$(basename "$1") with an unknown parameter does not print to stderr" - exit 3 + echo "$(basename "$1") with an unknown parameter does not print to stderr" + exit 3 fi diff --git a/tools/meson-git-contrib.sh b/tools/meson-git-contrib.sh index ac031638e0..1c614ef511 100755 --- a/tools/meson-git-contrib.sh +++ b/tools/meson-git-contrib.sh @@ -1,7 +1,7 @@ #!/bin/sh -eu git shortlog -s `git describe --abbrev=0`.. | \ - cut -c8- | \ - sed 's/ / /g' | \ - awk '{ print $$0 "," }' | \ - sort -u + cut -c8- | \ + sed 's/ / /g' | \ + awk '{ print $$0 "," }' | \ + sort -u diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 360ff92ebb..47a5e70ae5 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -5,7 +5,7 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")" if [ "$(dirname $1)" = . ]; then - ln -vfs -T "$1" "${DESTDIR:-}$2" + ln -vfs -T "$1" "${DESTDIR:-}$2" else - ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" + ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" fi diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh index e2f5a355bc..dfd287e172 100755 --- a/units/meson-add-wants.sh +++ b/units/meson-add-wants.sh @@ -5,23 +5,23 @@ target="$2" unit="$3" case "$target" in - */?*) # a path, but not just a slash at the end - dir="${DESTDIR:-}${target}" - ;; - *) - dir="${DESTDIR:-}${unitdir}/${target}" - ;; + */?*) # a path, but not just a slash at the end + dir="${DESTDIR:-}${target}" + ;; + *) + dir="${DESTDIR:-}${unitdir}/${target}" + ;; esac unitpath="${DESTDIR:-}${unitdir}/${unit}" case "$target" in - */) - mkdir -p -m 0755 "$dir" - ;; - *) - mkdir -p -m 0755 "$(basename "$dir")" - ;; + */) + mkdir -p -m 0755 "$dir" + ;; + *) + mkdir -p -m 0755 "$(basename "$dir")" + ;; esac ln -vfs --relative "$unitpath" "$dir" From 6e2afb1cab76ef31a31c7e4123b9d8ec34a3e824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 21:03:35 -0400 Subject: [PATCH 80/82] meson: fix checking of linker args Previous checks did nothing, because cc.has_argument only does compilation, without any linking. Unfortunately cc.links() cannot be used, because it does not accept any options. Providing the test file as a static source is easiest, even if not every elegant. https://github.com/mesonbuild/meson/issues/1676 --- meson.build | 17 ++++++++++++++--- src/systemd/meson.build | 2 +- tools/meson-check-compilation.sh | 2 +- tools/meson-link-test.c | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 tools/meson-link-test.c diff --git a/meson.build b/meson.build index 991836a976..778fe636fb 100644 --- a/meson.build +++ b/meson.build @@ -222,6 +222,7 @@ substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-l cc = meson.get_compiler('c') pkgconfig = import('pkgconfig') +check_compilation_sh = find_program('tools/meson-check-compilation.sh') foreach arg : ['-Wundef', '-Wlogical-op', @@ -291,6 +292,8 @@ if cc.get_id() == 'clang' endforeach endif +link_test_c = files('tools/meson-link-test.c') + # --as-needed and --no-undefined are provided by meson by default, # run mesonconf to see what is enabled foreach arg : ['-Wl,-z,relro', @@ -298,7 +301,12 @@ foreach arg : ['-Wl,-z,relro', '-pie', '-Wl,-fuse-ld=gold', ] - if cc.has_argument(arg) + + have = run_command(check_compilation_sh, + cc.cmd_array(), '-x', 'c', arg, + '-include', link_test_c).returncode() == 0 + message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) + if have add_project_link_arguments(arg, language : 'c') endif endforeach @@ -312,7 +320,11 @@ if get_option('buildtype') != 'debug' endforeach foreach arg : ['-Wl,--gc-sections'] - if cc.has_argument(arg) + have = run_command(check_compilation_sh, + cc.cmd_array(), '-x', 'c', arg, + '-include', link_test_c).returncode() == 0 + message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) + if have add_project_link_arguments(arg, language : 'c') endif endforeach @@ -429,7 +441,6 @@ etags = find_program('etags', required : false) meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' mkdir_p = 'mkdir -p $DESTDIR/@0@' -check_compilation_sh = find_program('tools/meson-check-compilation.sh') test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh') splash_bmp = files('test/splash.bmp') diff --git a/src/systemd/meson.build b/src/systemd/meson.build index 0f5a853e2e..43fd0130b9 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -47,7 +47,7 @@ foreach header : _systemd_headers name = ''.join([header] + opt) test('cc-' + name, check_compilation_sh, - args : cc.cmd_array() + ['-x', 'c'] + opt + + args : cc.cmd_array() + ['-x', 'c', '-c'] + opt + ['-Werror', '-include', join_paths(meson.current_source_dir(), header)]) endforeach diff --git a/tools/meson-check-compilation.sh b/tools/meson-check-compilation.sh index e24194247e..d3b2a312fd 100755 --- a/tools/meson-check-compilation.sh +++ b/tools/meson-check-compilation.sh @@ -1,3 +1,3 @@ #!/bin/sh -eu -"$@" '-' '-c' -o/dev/null Date: Mon, 24 Apr 2017 21:46:40 -0400 Subject: [PATCH 81/82] meson: use name arg so check result is reported --- meson.build | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 778fe636fb..06cb3baefc 100644 --- a/meson.build +++ b/meson.build @@ -277,8 +277,7 @@ if cc.compiles(' struct timespec now; return 0; } -') - # TODO: message? +', name : '-Werror=shadow with local shadowing') add_project_arguments('-Werror=shadow', language : 'c') endif @@ -286,7 +285,8 @@ if cc.get_id() == 'clang' foreach arg : ['-Wno-typedef-redefinition', '-Wno-gnu-variable-sized-type-not-at-end', ] - if cc.has_argument(arg) + if cc.has_argument(arg, + name : '@0@ is supported'.format(arg)) add_project_arguments(arg, language : 'c') endif endforeach @@ -314,7 +314,8 @@ endforeach if get_option('buildtype') != 'debug' foreach arg : ['-ffunction-sections', '-fdata-sections'] - if cc.has_argument(arg) + if cc.has_argument(arg, + name : '@0@ is supported'.format(arg)) add_project_arguments(arg, language : 'c') endif endforeach @@ -553,7 +554,7 @@ endif system_uid_max = system_uid_max.to_int() conf.set('SYSTEM_UID_MAX', system_uid_max) substs.set('systemuidmax', system_uid_max) -message('Maximum system UID is @0@'.format(system_uid_max)) +message('maximum system UID is @0@'.format(system_uid_max)) conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user')) conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group')) @@ -568,7 +569,7 @@ endif system_gid_max = system_gid_max.to_int() conf.set('SYSTEM_GID_MAX', system_gid_max) substs.set('systemgidmax', system_gid_max) -message('Maximum system GID is @0@'.format(system_gid_max)) +message('maximum system GID is @0@'.format(system_gid_max)) tty_gid = get_option('tty-gid') conf.set('TTY_GID', tty_gid) From d730e2d16452d522d3b130071847b75198f42c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 25 Apr 2017 08:49:58 -0400 Subject: [PATCH 82/82] meson: require newest meson and revert m4 patch This reverts 78b68dcb55. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 06cb3baefc..71cc431157 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project('systemd', 'c', 'sysconfdir=/etc', 'localstatedir=/var', ], - meson_version : '>= 0.39.1', + meson_version : '>= 0.40', ) # We need the same data in three different formats, ugh! @@ -435,7 +435,7 @@ endif sed = find_program('sed') grep = find_program('grep') awk = find_program('awk') -m4 = find_program('/usr/bin/m4') +m4 = find_program('m4') stat = find_program('stat') git = find_program('git', required : false) etags = find_program('etags', required : false)