summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAge
* logind: change user-runtime-dir to query runtime dir size from logind via ↵Lennart Poettering2018-10-29
| | | | | | | | | | | | | | | | | | the bus I think this is a slightly cleaner approach than parsing the configuration file at multiple places, as this way there's only a single reload cycle for logind.conf, and that's systemd-logind.service's runtime. This means that logind and dbus become a requirement of user-runtime-dir, but given that XDG_RUNTIME_DIR is not set anyway without logind and dbus around this isn't really any limitation. This also simplifies linking a bit as this means user-runtime-dir doesn't have to link against any code of logind itself. (cherry picked from commit 07ee5adb356b9fde500c8a5226f24a314789832b)
* meson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'Yu Watanabe2018-10-29
| | | | | | Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88. (cherry picked from commit be44b572f3543e589e381f8a0a04ade71c4c2e03)
* mempool: only enable mempool use when linked to libsystemd-shared.soZbigniew Jędrzejewski-Szmek2018-10-29
| | | | | | | | | | | | | Mempool use is enabled or disabled based on the mempool_use_allowed symbol that is linked in. Should fix assert crashes in external programs caused by #9792. Replaces #10286. v2: - use two different source files instead of a gcc constructor (cherry picked from commit a5d8835c78112206bbf0812dd4cb471f803bfe88)
* meson: remove old commentZbigniew Jędrzejewski-Szmek2018-10-29
| | | | | | | | The linked page is gone, and I can't quite remember what the warning was about. Something about recursive copying... Everything seems to work. (cherry picked from commit c42c98192484f48342c2c032ea3d00022bd20e92)
* meson: drop workaroundZbigniew Jędrzejewski-Szmek2018-10-29
| | | | | | It was added way back, and seems to work fine now without it. (cherry picked from commit 5dbf13fa6c2d5311a9fc236a0a95c1babcc11937)
* meson: include more build settings in status outputLennart Poettering2018-10-29
| | | | (cherry picked from commit 19d8c9c9b7b3507eb2fdcf668a85456a4ae0dbeb)
* Make bzip2 an optional dependency for systemd-importdThiago Macieira2018-10-29
| | | | | | | | Yes, there are still a lot of users of bzip2, but it's fallen out of favour after LZMA/xz, which can compress a lot more and often decompresses faster than bzip2 too. (cherry picked from commit 044c2c7a2b322b6561d7e3cc5a48a548fee887f9)
* build-sys: disable -Wmaybe-uninitializedFilipe Brandenburger2018-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiler flag -Wmaybe-uninitialized is quite noisy and produces many false positives, especially when optimization flags are enabled (tested gcc 8.2.1), so let's just disable it in systemd build. For example, with CFLAGS=-O2, the build produces 11 such warnings and the default CFLAGS of Fedora's rpmbuild warns about it in 176 places. A look at a sample of those shows that most are false positives, where the compiler just can't figure it out correctly. (While fixing those would be nice, I'm not sure it's a good use of our time.) The noisy [-Wmaybe-uninitialized] warnings are not just an annoyance, since they make it harder to spot warnings that indicate actual problems (such as variable declared but not used.) Silencing those is beneficial, so that contributors would see warnings where there are actually actionable problems, so there's a better chance of having those issues addressed before a PR is pushed. Tested: $ CFLAGS='-O2 -Wp,-D_FORTIFY_SOURCE=2' meson build/ $ ninja -C build/ (NOTE: -Wp,-D_FORTIFY_SOURCE=2 prevents [-Wstringop-truncation] warnings.) With the commands above, the build will not produce any [-Wmaybe-uninitialized] warnings (or any other warnings), which is not really the case before this commit. Also tested with rpmbuild on Fedora, after this commit there are no warnings produced in the build step. (cherry picked from commit 8794164fed5f0142c34358613f92f4f761af4edd)
* Do not apply uaccess tag for /dev/kvm if mode is 0666Michael Biebl2018-10-29
| | | | (cherry picked from commit ace5e3111c0b8d8bfd84b32f2c689b0a4d92c061)
* check nobody user/group validity only when not cross compilingChen Qi2018-10-29
| | | | | | | | | | | | | Using `getent' and `id' command in case of cross compiling does not make much sense. This is because it is the host files that are checked. Besides, in some restricted cross compilation environment, these two command may not even be available. This is to avoid host comtamination. So we should only check the validity using getent and id when not cross compiling. (cherry picked from commit 2484bff32bc5af4af811381393df1090d6e4586f)
* meson: rename -Ddebug to -Ddebug-extraZbigniew Jędrzejewski-Szmek2018-10-29
| | | | | | | | | Meson added -Doptimization and -Ddebug options, which obviously causes a conflict with our -Ddebug options. Let's rename it. Fixes #9883. (cherry picked from commit 8f6b442a78d0b485f044742ad90b2e8271b4e68e)
* meson: unify linux/stat.h check with other checks and use _GNU_SOURCEZbigniew Jędrzejewski-Szmek2018-10-29
| | | | | | | | Using _GNU_SOURCE is better because that's how we include the headers in the actual build, and some headers define different stuff when it is defined. sys/stat.h for example defines 'struct statx' conditionally. (cherry picked from commit 9c869d08d82c73f62ab3527567858ce4b0cf1257)
* build-sys: Detect whether struct statx is defined in sys/stat.hFilipe Brandenburger2018-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a definition for struct statx, in which case include file linux/stat.h should be avoided, in order to prevent a duplicate definition. In file included from ../src/basic/missing.h:18, from ../src/basic/util.h:28, from ../src/basic/hashmap.h:10, from ../src/shared/bus-util.h:12, from ../src/libsystemd/sd-bus/bus-creds.c:11: /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’ struct statx { ^~~~~ In file included from /usr/include/sys/stat.h:446, from ../src/basic/util.h:19, from ../src/basic/hashmap.h:10, from ../src/shared/bus-util.h:12, from ../src/libsystemd/sd-bus/bus-creds.c:11: /usr/include/bits/statx.h:36:8: note: originally defined here struct statx ^~~~~ Extend our meson.build to look for struct statx when only sys/stat.h is included and, in that case, do not include linux/stat.h anymore. Tested that systemd builds correctly when using a glibc version that includes a definition for struct statx. glibc Fedora RPM update: https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae glibc upstream commit: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd (cherry picked from commit 75720bff62a84896e9a0654afc7cf9408cf89a38)
* Update Version to 239.1Sven Eden2018-10-17
|
* Prep v239: Fix an issue with program_invocation[_short]_name :Sven Eden2018-10-16
| | | | | | | | | | | | | | The old implementation was done assuming that only glibc provides both program_invocation_name and program_invocation_short_name. This worked well for users using musl-libc with the library having been built without -D_GNU_SOURCE. However, alternative libc implementations that actually do provide these variables, could cause elogind to crash. To be on the safe side, we now actually check whether both these variables are present by letting meson check whether a code snippet accessing these compiles and links.
* Support system_bus_socket to be found in /var/run/dbus as well as /run/dbus.Christoph Willing2018-09-26
| | | | | | | | | | | | | | | | Currently the path to system_bus_socket is hardcoded to /run/dbus/system_bus_socket which works everywhere for systemd. However, distributions which do no symlink /var/run on /run will have it only accessible via /run/dbus/system_bus_socket which should be supported by elogind, too. Closes #77 Signed-off-by: Christoph Willing <chris.willing@linux.com> Sigend-off-by: Sven Eden <sven.eden@prydeworx.com>
* Enhance the dealing with glibc-2.28Sven Eden2018-09-26
| | | | | | | It appears that the necessary bits were already there, but commented out. When meson checked for 'struct statx', the inclusion of both sys/stat.h and linux/stat.h where commented out. Uncommenting them should be enough.
* meson: rename -Ddebug to -Ddebug-extraZbigniew Jędrzejewski-Szmek2018-09-26
| | | | | | | Meson added -Doptimization and -Ddebug options, which obviously causes a conflict with our -Ddebug options. Let's rename it. Fixes #76.
* Deal with glibc-2.28Christoph Willing2018-09-25
| | | | | | Closes: https://github.com/elogind/elogind/issues/74 Signed-off-by: Christoph Willing <chris.willing@linux.com> Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
* Prep v239: meson.build: Enabled listing of now supported options.Sven Eden2018-08-28
|
* Prep v239: Sync libelogind_version with upstream libsystemd_versionSven Eden2018-08-28
|
* Prep v239: A few cosmetic upgradesSven Eden2018-08-27
|
* Prep v239: Unmask Valgrind options and checks in meson files.Sven Eden2018-08-24
| | | | Doesn't hurt to leave that possibility open.
* Build system: Fix various issues that came from errornous migration.Sven Eden2018-08-24
| | | | | | | No matter how much advanced check_tree.pl is, there are plenty possibilities where upstream changes can be transported wrong. Mainly adding something we then have to mask out. But at the end of the day this is actually wanted, so we do not miss important changes.
* meson: bump package and library versionLennart Poettering2018-08-24
|
* meson: make DNS-over-TLS support optionalYu Watanabe2018-08-24
| | | | | This adds dns-over-tls option to meson. If set to 'false', systemd-resolved is not linked with libgnutls.
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-08-24
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* resolve: rename PrivateDNS to DNSOverTLSIwan Timmer2018-08-24
| | | | PrivateDNS is not considered a good name for this option, so rename it to DNSOverTLS
* resolved: support for DNS-over-TLSIwan Timmer2018-08-24
| | | | Add support for DNS-over-TLS using GnuTLS. To reduce latency also TLS False Start and TLS session resumption is supported.
* meson: also reject shifts that change the sign bitZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | ../src/test/test-sizeof.c: In function ‘main’: ../src/test/test-sizeof.c:70:24: error: result of ‘1 << 31’ requires 33 bits to represent, but ‘int’ only has 32 bits [-Werror=shift-overflow=] X = (1 << 31), ^~ cc1: some warnings being treated as errors Follow-up for b05ecb8cadd8c32d31b1aabcff4e507bd89b5465.
* meson: do not allow bit-shift overflowsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | | The primary motivation is to catch enum values created through a shift that is too big: ../src/test/test-sizeof.c:26:29: error: left shift count >= width of type [-Werror=shift-count-overflow] enum_with_shift = 1 << 32, ^~ cc1: some warnings being treated as errors The compiler will now reject those. This is an alternative to #9224.
* CODING_STYLE: allow c99-style mixed code and declarationsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | We already allowed variables to be declared in the middle of a function (whenever a new scope was opened), so this isn't such a big change. Sometimes we would open a scope just to work around this prohibition. But sometimes the code can be much clearer if the variable is declared somewhere in the middle of a scope, in particular if the declaration is combined with initialization or acquisition of some resources. So let's allow this, but keep things in the old style, unless there's a good reason to move the variable declaration to a different place.
* build-sys: Add option to link systemctl staticallyFelipe Sateler2018-08-24
| | | | | | | | | | | | | | | | | Systemctl is special because it is required for many tasks that may need to be performed when the system is not fully configured and/or partially broken: 1. Installing/Uninstalling services during OS installs and upgrades 2. Shutting down the system Therefore reduce the number of dependencies that systemctl pulls in, by not linking to systemd-shared. This brings a bit of resilience to systemctl (and its aliases shutdown, reboot, etc), by linking against less external libraries. Because this extra resilience comes at a cost of approximately 580 KB extra space, this is done behind a meson build option.
* fuzz-journal-remote: a fuzzer for journal-remote over-the-wire inputZbigniew Jędrzejewski-Szmek2018-08-24
|
* journal-remote: split out µhttpd support and main() into a separate fileZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | This is in preparation to reusing the RemoteServer in other concepts. I tried to keep changes to minimum: - arg_* global variables are now passed as state in RemoteServer - exported functions get the "journal_remote_" prefix - some variables are renamed In particular, there is an ugly global RemoveServer* variable. It was originally added because µhttpd did not allow state to be passed to the callbacks. I'm not sure if this has been remediated in µhttpd, but either way, this is not changed here, the global variable is only renamed for clarity.
* meson: use a convenience static library for nspawn coreZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | This makes it easier to link the nspawn implementation to the tests. Right now this just means that nspawn-patch-uid.c is not compiled twice, which is nice, but results in test-patch-uid being slightly bigger, which is not nice. But in general, we should use convenience libs to compile everything just once, as far as possible. Otherwise, once we start compiling a few files here twice, and a few file there thrice, we soon end up in a state where we are doing hundreds of extra compilations. So let's do the "right" thing, even if is might not be more efficient.
* add new portable service frameworkLennart Poettering2018-08-24
| | | | | | | | | | | This adds a small service "systemd-portabled" and a matching client "portablectl", which implement the "portable service" concept. The daemon implements the actual operations, is PolicyKit-enabled and is activated on demand with exit-on-idle. Both the daemon and the client are an optional build artifact, enabled by default rhough.
* rpm: add macros for common configuration dirsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | %_environmnentdir /usr/lib/environment.d %_modulesloaddir /usr/lib/modules-load.d %_modprobedir /usr/lib/modprobe.d This makes installing files there more convenient because people don't need to construct the path from %_prefix/lib/… . See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
* rpm: add macros for common configuration dirsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | %_environmnentdir /usr/lib/environment.d %_modulesloaddir /usr/lib/modules-load.d %_modprobedir /usr/lib/modprobe.d This makes installing files there more convenient because people don't need to construct the path from %_prefix/lib/… . See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
* meson: use run_target for generating tags with ctagsEvegeny Vereshchagin2018-08-24
| | | | | | | | | | In https://github.com/systemd/systemd/pull/6561, `run_target` was changed to `custom_target`, which inadvertently caused relative paths to be passed to ctags due to https://github.com/mesonbuild/meson/issues/3589. The switch to `run_target` causes absolute paths to be passed again and makes it easier to jump from file to file, hopefully delaying the need to exit Vim :-)
* Turn VALGRIND variable into a meson configuration switchZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Configuration through environment variable is inconvenient with meson, because they cannot be convieniently changed and/or are not preserved during reconfiguration (https://github.com/mesonbuild/meson/issues/1503). This adds -Dvalgrind=true/false, which has the advantage that it can be set at any time with meson configure -Dvalgrind=... and ninja will rebuild targets as necessary. Additional minor advantages are better consistency with the options for hashmap debugging, and typo avoidance with '#if' instead of '#ifdef'.
* meson: use array type optionYu Watanabe2018-08-24
| | | | Array type option is supported since 0.44.0.
* meson: use warning() methodYu Watanabe2018-08-24
| | | | | This bumps the required minimum version of meson to 0.44, as `warning()` method is supported since 0.44.
* meson: use get_supported_arguments()Yu Watanabe2018-08-24
| | | | | This bumps the required minimum version of meson to 0.43, as `get_supported_arguments()` is supported since meson-0.43.
* meson: recompile all sources for install_libudev_static and ↵Zbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | install_libsystemd_static This means that when those targets are built, all the sources are built again, instead of reusing the work done to create libbasic.a and other convenience static libraries. It would be nice to not do this, but there seems to be no support in our toolchain for joining multiple static libraries into one. When linking a static library, any -l arguments are simply ignored by ar/gcc-ar, and .a libraries given as positional arguments are copied verbatim into the archive so they objects in them cannot be accessed. https://stackoverflow.com/questions/2157629/linking-static-libraries-to-other-static-libraries suggests either unzipping all the archives and putting them back togather, or using a linker script. Unzipping and zipping back together seems ugly. The other option is not very nice. The linker script language does not allow "+" to appear in the filenames, and filenames that meson generates use that, so files would have to be renamed before a linker script was used. And we would have to generate the linker script on the fly. Either way, this doesn't seem attractive. Since those static libraries are a niche use case, it seems reasonable to just go with the easiest and safest solution and recompile all the source files. Thanks to ccache, this is probably almost as cheap as actually reusing the convenience .a libraries. test-libsystemd-sym.c and test-libudev-sym.c compile fine with the generated static libs, so it seems that they indeed provide all the symbols they should.
* meson: only build test-lib{systemd,udev}-static-sym for picDavide Cavalca2018-08-24
|
* meson: add test-lib{systemd,udev}-static-symZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | This is the same as test-lib{systemd,udev}-sym, but linked to the static variants of those libraries.
* meson: add support for building static libsystemd and libudevDavide Cavalca2018-08-24
|
* meson: generate m4 preprocessor from config.h (#8914)Yu Watanabe2018-08-24
|