summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* fuzzers: use -fsanitizer=fuzzer if clang supports itEvgeny Vereshchagin2019-05-141-2/+17
| | | | Closes https://github.com/systemd/systemd/issues/10645
* Merge pull request #11887 from evverx/fuzzbuzzLennart Poettering2019-05-081-32/+41
|\ | | | | tests: hook up fuzz targets to FuzzBuzz
| * tests: hook up fuzz targets to FuzzBuzzEvgeny Vereshchagin2019-05-071-32/+41
| |
* | shared/utmp-wtmp: silence gcc warning about strncpy truncationZbigniew Jędrzejewski-Szmek2019-05-071-0/+3
|/ | | | | | | | | Unfortunately the warning must be known, or otherwise the pragma generates a warning or an error. So let's do a meson check for it. Is it worth doing this to silence the warning? I think so, because apparently the warning was already emitted by gcc-8.1, and with the recent push in gcc to catch more such cases, we'll most likely only get more of those.
* Merge pull request #12218 from keszybz/use-libmount-moreLennart Poettering2019-04-301-0/+1
|\ | | | | Use libmount more
| * mount-tool: use libmount to parse /proc/self/mountinfoZbigniew Jędrzejewski-Szmek2019-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | Same motivation as in other places: let's use a single logic to parse this. Use path_equal() to compare the path. A bug in error handling is fixed: if we failed after the GREEDY_REALLOC but before the line that sets the last item to NULL, we would jump to _cleanup_strv_free_ with the strv unterminated. Let's use GREEDY_REALLOC0 to avoid the issue.
* | codespell: fix spelling errorsBen Boeckel2019-04-291-1/+1
|/
* tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0Yu Watanabe2019-04-111-93/+0
|
* meson: drop misplaced -Wl,--undefined argumentJussi Pakkanen2019-04-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ld's man page says the following: -u symbol --undefined=symbol Force symbol to be entered in the output file as an undefined symbol. Doing this may, for example, trigger linking of additional modules from standard libraries. -u may be repeated with different option arguments to enter additional undefined symbols. This option is equivalent to the "EXTERN" linker script command. If this option is being used to force additional modules to be pulled into the link, and if it is an error for the symbol to remain undefined, then the option --require-defined should be used instead. This would imply that it always requires an argument, which this does not pass. Thus it will grab the next argument on the command line as its argument. Before it took one of the many -lrt args (presumably) and now it grabs something other random linker argument and things break. [zj: this line was added in the first version of the meson configuration back in 5c23128daba7236a6080383b2a5649033cfef85c. AFAICT, this was a mistake. No such flag appeared in Makefile.am at the time.] https://github.com/mesonbuild/meson/issues/5113
* build-sys: bump package versionv242-rc2Zbigniew Jędrzejewski-Szmek2019-04-031-1/+1
|
* Merge pull request #12121 from poettering/contribv242-rc1Zbigniew Jędrzejewski-Szmek2019-04-031-2/+2
|\
| * meson: bump so versionsLennart Poettering2019-04-021-2/+2
| | | | | | | | | | Since we aren't quite ready for release v242 yet, let's not bump the package version yet, but let's already bump the soversion.
* | Revert "build: install /etc/systemd/{system,user}-generators"Lennart Poettering2019-04-021-2/+0
|/ | | | This reverts commit 509276f2b7d44d472b66e79cbfa531c1de4c3801.
* build: install /etc/systemd/{system,user}-generatorsTopi Miettinen2019-04-021-0/+2
| | | | | Manual page systemd.generators refers to /etc/systemd/{system,user}-generators, but the paths do not exist, so let's install them.
* meson: disable warnings about unused variables for NDEBUG buildsZbigniew Jędrzejewski-Szmek2019-03-281-0/+10
| | | | | | With assertions disabled, we'd get a bunch of warnings that really bring no value. With this change, a default meson build with -Db_ndebug=true generates no warnings.
* systemctl: split out some SysV compat stuff into its own C fileLennart Poettering2019-03-251-1/+4
| | | | | systemctl.c is way to large already. Let's split out some stuff out that is easy to split out.
* meson: add libseccomp as a nspawn dep (#12067)Franck Bui2019-03-221-1/+2
| | | | | | | | | Due to this specific change: d0b6a10#diff-0203416587516c224c8fcfe8129e7caeR8, systemd-nspawn uses libseccomp now if it is available. We we need to pass -I/usr/include /libseccomp (or wherever seccomp.h is located) when compiling systemd-nspawn because nspawn-settings.h does #include <seccomp.h>. Fixes: #12060
* Re-add uaccess tag for /dev/dri/renderD*Michael Biebl2019-03-141-1/+3
| | | | | | | | | | | Setting an access mode != 0666 is explicitly supported via -Dgroup-render-mode In such a case, re-add the uaccess tag. This is basically the same change that was done for /dev/kvm in commit fa53e24130af3a389573acb9585eadbf7192955f and ace5e3111c0b8d8bfd84b32f2c689b0a4d92c061 and partially reverts the changes from 4e15a7343cb389e97f3eb4f49699161862d8b8b2
* meson: scope more git invocations with current_source_dir()Davide Cavalca2019-03-121-15/+19
|
* build-sys: disable -Wstring-plus-intZbigniew Jędrzejewski-Szmek2019-03-071-1/+2
| | | | | clang-8 warns about constructs like "foobar"+3 (to get "bar"). We like to use patterns like this, so let's just disable the warning.
* Merge pull request #11898 from keszybz/meson-conv-libLennart Poettering2019-03-061-18/+10
|\ | | | | Use a convenience library for the sources shared between core/ and shutdown/
| * meson: use a convenience library for the sources shared between core/ and ↵Zbigniew Jędrzejewski-Szmek2019-03-051-18/+10
| | | | | | | | | | | | | | | | | | | | | | the outside This avoids double compilation. Those files are tiny, so it doesn't save time, but we avoid repeated warnings and errors, and it's generally cleaner to it this way. The number of commands in 'ninja -C build clean && ninja -C build' drops from 1462 to 1455 for me.
* | pkgconfig: avoid double slash with split-usr configurationZbigniew Jędrzejewski-Szmek2019-03-051-1/+3
|/ | | | | | | | | | | | | | | By defining rootprefix= we avoid a double slash in $systemdsystemunitdir and other variables. This fixes a regression introduced in 1c2c7c6cb3d92315624f3711114e86b0acfbce63 where the variables using rootprefix=/ would start with a double slash. This should be interpreted the same, but is certainly ugly. The rootprefix variable was added to systemd.pc in 1c2c7c6cb3d92315624f3711114e86b0acfbce63, so there is no question of backwards compatiblity. If people try to "override" the prefix and specify --define-variable=rootprefix=/, they will get a double slash, which should be OK, and is the same as --define-variable=rootprefix=/something/, which also results in a double slash somewhere in the strings.
* shutdown: rearrange shutdown sources in source treeLennart Poettering2019-03-051-0/+6
| | | | | | | | | | Let's move the shutdown binary into its own subdirectory in src/shutdown, after all it is relatively isolated from the normal PID 1 sources, being a different binary and all. Unfortunately it's not possible to move some of the code, since it is shared with PID 1, that I wished we could move, but I still think it's worth it.
* Merge pull request #11827 from keszybz/pkgconfig-variablesLennart Poettering2019-02-261-1/+2
|\ | | | | Allow overriding pkgconfig prefixes
| * pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}Zbigniew Jędrzejewski-Szmek2018-11-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #4549. People want to be able to redefine the prefixes relative to which the other variables are defined. Something like pkgconf --define-variable=prefix=/home/user/installpath --variable=systemdsystemunitdir systemd I'm not convinced that this entirely useful, because the installed systemd will not look at those paths, but maybe it's OK as an alternative type of $DESTDIR. This has been requested a few times over the years, so let's just provide this. I thought this would be more complicated, since we allow all kinds of directories to be overrides in the compilation configuration. But it turns out that all the directories defined in systemd.pc are relative to three prefixes: $prefix, $rootprefix, and $sysconfdir. So this patch adds $rootprefix and $sysconfdir to the .pc file and then changes the subsequent definitions in the .pc file to use them. In the end we define each path twice using the same rules: once in meson.build and once in the .pc file. Without overrides: $ for i in $(pkgconf --with-path=build/src/core systemd --print-variables); do echo -n "$i = "; pkgconf --with-path=$PWD/build/src/core --variable=$i systemd done containeruidbasemax = 1878982656 containeruidbasemin = 524288 dynamicuidmax = 65519 dynamicuidmin = 61184 systemgidmax = 999 systemuidmax = 999 catalogdir = /usr/lib/systemd/catalog modulesloaddir = /usr/lib/modules-load.d binfmtdir = /usr/lib/binfmt.d sysctldir = /usr/lib/sysctl.d sysusersdir = /usr/lib/sysusers.d tmpfilesdir = /usr/lib/tmpfiles.d systemdshutdowndir = /usr/lib/systemd/system-shutdown systemdsleepdir = /usr/lib/systemd/system-sleep systemdusergeneratordir = /usr/lib/systemd/user-generators systemdsystemgeneratordir = /usr/lib/systemd/system-generators systemduserunitpath = /etc/systemd/user:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:/usr/lib/systemd/user:/usr/lib/systemd/user:/usr/share/systemd/user systemdsystemunitpath = /etc/systemd/system:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:/usr/lib/systemd/system:/usr/lib/systemd/system:/lib/systemd/system systemduserconfdir = /etc/systemd/user systemdsystemconfdir = /etc/systemd/system systemduserpresetdir = /usr/lib/systemd/user-preset systemduserunitdir = /usr/lib/systemd/user systemdsystempresetdir = /usr/lib/systemd/system-preset systemdsystemunitdir = /usr/lib/systemd/system systemdutildir = /usr/lib/systemd sysconfdir = /etc rootprefix = /usr prefix = /usr pcfiledir = /usr/share/pkgconfig With overrides: $ for i in $(pkgconf --with-path=build/src/core systemd --print-variables); do echo -n "$i = "; pkgconf --with-path=$PWD/build/src/core \ --define-variable=prefix=/PREFIX \ --define-variable=rootprefix=/ROOTPREFIX \ --define-variable=sysconfdir=/SYSCONF --variable=$i systemd done containeruidbasemax = 1878982656 containeruidbasemin = 524288 dynamicuidmax = 65519 dynamicuidmin = 61184 systemgidmax = 999 systemuidmax = 999 catalogdir = /PREFIX/lib/systemd/catalog modulesloaddir = /PREFIX/lib/modules-load.d binfmtdir = /PREFIX/lib/binfmt.d sysctldir = /PREFIX/lib/sysctl.d sysusersdir = /PREFIX/lib/sysusers.d tmpfilesdir = /PREFIX/lib/tmpfiles.d systemdshutdowndir = /ROOTPREFIX/lib/systemd/system-shutdown systemdsleepdir = /ROOTPREFIX/lib/systemd/system-sleep systemdusergeneratordir = /PREFIX/lib/systemd/user-generators systemdsystemgeneratordir = /ROOTPREFIX/lib/systemd/system-generators systemduserunitpath = /SYSCONF/systemd/user:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:/PREFIX/lib/systemd/user:/usr/lib/systemd/user:/usr/share/systemd/user systemdsystemunitpath = /SYSCONF/systemd/system:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:/ROOTPREFIX/lib/systemd/system:/usr/lib/systemd/system:/lib/systemd/system systemduserconfdir = /SYSCONF/systemd/user systemdsystemconfdir = /SYSCONF/systemd/system systemduserpresetdir = /PREFIX/lib/systemd/user-preset systemduserunitdir = /PREFIX/lib/systemd/user systemdsystempresetdir = /ROOTPREFIX/lib/systemd/system-preset systemdsystemunitdir = /ROOTPREFIX/lib/systemd/system systemdutildir = /usr/lib/systemd sysconfdir = /SYSCONF rootprefix = /ROOTPREFIX prefix = /PREFIX pcfiledir = /usr/share/pkgconfig (pkgconf doesn't provide a way to print all variables together with their definitions, according to the man page. Disappointing.)
* | meson: declare version.h as dependency for systemdMichael Olbrich2019-02-251-1/+2
| | | | | | | | | | This is a followup to #11815 and adds the last missing dependency. With this #11565 is hopefully really fixed.
* | Merge pull request #11798 from keszybz/mem-sanitizer-fixLennart Poettering2019-02-251-0/+1
|\ \ | | | | | | meson: make sure preprocesor warnings are not treated as errors
| * | meson: make sure preprocesor warnings are not treated as errorsZbigniew Jędrzejewski-Szmek2019-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Clang includes -W#warning in -Werror, so the #warning used for msan would be an error. v2: - use -Wno-error=... so that the warning is still emitted, but not as an error.
* | | meson: declare version.h as dep for various targets that include build.hZbigniew Jędrzejewski-Szmek2019-02-251-6/+13
|/ / | | | | | | Should fix #11565.
* | Merge pull request #10408 from keszybz/analyze-cat-presetsLennart Poettering2019-02-181-1/+0
|\ \ | | | | | | systemd-analyze cat-presets
| * | meson: drop unused "udevhomedir"Zbigniew Jędrzejewski-Szmek2019-02-181-1/+0
| | |
* | | meson: drop unused HAVE_STRUCT_FIB_RULE_{UID,PORT}_RANGEYu Watanabe2019-02-181-4/+0
|/ /
* | build-sys: bump package/library versionsv241-rc1Zbigniew Jędrzejewski-Szmek2019-01-261-3/+3
| | | | | | | | We added sd_bus_close_unref().
* | meson: make version a dependency and use it in libbasicLouis Taylor2019-01-221-0/+7
| | | | | | | | | | | | | | This should hopefully ensure it gets generated before basic build happens. Fixes #11483.
* | missing_if_link.h: add IFLA_BOND_MODEFabrice Fontaine2019-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | systemd fails to build on kernel without IFLA_BOND_MODE (< 3.13) since https://github.com/systemd/systemd/commit/9714c020fc4cda1823c2a77e3fd08aefa7d78b25 So put back IFLA_BOND_MODE definition Fixes: - http://autobuild.buildroot.org/results/699c078aa078240c6741da4dbd0871450ceeca92 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* | meson: stop setting -fPIE globallyMichael Biebl2019-01-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting -fPIE globally can lead to miscompilations on certain architectures. This is caused by both -fPIE and -fPIC options being added to various compilation commands. Only -fPIC is being recorded in the LTO options section of the object. The gcc-8 LTO plugin merges -fPIC + -fPIE to nothing. So, the compilations done by the plugin are not position-independent and fail to link with -pie. The simplest solution is to stop setting -fPIE globally and instead using meson's b_pie=true option. This requires meson 0.49 or later. Since we don't set this option in meson.build but leave it up to the distro maintainer to set this option, do not bump the meson version requirement. Fixes: #10548
* | Merge pull request #11337 from keszybz/build-version-hLennart Poettering2019-01-061-3/+2
|\ \ | | | | | | meson: declare version.h as dep for libbasic
| * | Revert "meson: declare version.h as dep for fuzzers"Zbigniew Jędrzejewski-Szmek2019-01-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0c2e93b863f8ec164e7e9e119ab127a752cb1331. This should not be necessary anymore after previous commit. I don't quite remember what sequence of steps was failing, but right now "meson build -Dslow-tests=true && ninja -C build fuzzers" work fine.
* | | Disable tools/choose-default-locale.sh when cross compilingJames Hilliard2019-01-061-2/+6
|/ /
* | Merge pull request #11317 from filbranden/docs1Zbigniew Jędrzejewski-Szmek2019-01-031-4/+0
|\ \ | | | | | | Improvements to systemd.io generation
| * | docs: generate index.md in JekyllFilipe Brandenburger2019-01-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a {% for %} loop in Jekyll to render the page, from the "title" information in the Front Matter of the actual page files. This also makes `make-index-md` build rule unnecessary, since generation is done by the template engine itself. Tested this by running Jekyll locally.
* | | sleep: install default sleep.confYu Watanabe2019-01-031-0/+3
| | | | | | | | | | | | Closes #11310.
* | | Merge pull request #11230 from keszybz/version-string-altYu Watanabe2019-01-031-6/+11
|\ \ \ | |/ / |/| | Generate version string from git describe (alternative approach)
| * | meson: declare version.h as dep for fuzzersZbigniew Jędrzejewski-Szmek2018-12-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is supposed an error when building fuzzers for sanitization (that is a nested build with the sanitization options): In file included from ../../../../src/basic/util.c:21:0: ../../../../src/basic/build.h:4:21: fatal error: version.h: No such file or directory #include "version.h" ^ compilation terminated. Internally we do 'ninja -C test/fuzz/sanitize-address-fuzzers fuzzers'. I'm not quite sure why version.h is not built in this case. But declaring version_h as the dependency forces it to be built and solves the issue. It would be better to define the dependency on individual exe's, but this doesn't work: meson.build:2884:8: ERROR: Argument is of an unacceptable type 'CustomTarget'. Must be either an external dependency (returned by find_library() or dependency()) or an internal dependency (returned by declare_dependency()). Let's treat this a hack for another hack, which the nested build is.
| * | meson: allow setting the version string during configurationZbigniew Jędrzejewski-Szmek2018-12-211-0/+1
| | | | | | | | | | | | | | | | | | This will be useful when building distro packages, because we can set the version string to the rpm/dpkg/whatever version string, and getter reports from end users.
| * | meson-vcs-tag: add work-around for git bugZbigniew Jędrzejewski-Szmek2018-12-211-1/+1
| | |
| * | meson: generate version tag from gitZbigniew Jędrzejewski-Szmek2018-12-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ build/systemctl --version systemd 239-3555-g6178cbb5b5 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid $ git tag v240 -m 'v240' $ ninja -C build ninja: Entering directory `build' [76/76] Linking target fuzz-unit-file. $ build/systemctl --version systemd 240 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid This is very useful during development, because a precise version string is embedded in the build product and displayed during boot, so we don't have to guess answers for questions like "did I just boot the latest version or the one from before?". This change creates an overhead for "noop" builds. On my laptop, 'ninja -C build' that does nothing goes from 0.1 to 0.5 s. It would be nice to avoid this, but I think that <1 s is still acceptable. Fixes #7183. PACKAGE_VERSION is renamed to GIT_VERSION, to make it obvious that this is the more dynamically changing version string. Why save to a file? It would be easy to generate the version tag using run_command(), but we want to go through a file so that stuff gets rebuilt when this file changes. If we just defined an variable in meson, ninja wouldn't know it needs to rebuild things.
| * | meson: define PROJECT_VERSION as the "bare" project versionZbigniew Jędrzejewski-Szmek2018-12-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's not use atoi() if we can simply provide the project version as a number. In C code, this is the numerical project version. In substitutions in other files, this is just the bare substitution. The "PACKAGE_" prefix is from autotools, and is strange. We call systemd a "project", and "package" is something that distros build. Let's rename. PACKAGE_URL is renamed to PROJECT_URL for the same reasons and for consistency. (This leave PACKAGE_VERSION as the stringified define for C code.)
| * | Remove use of PACKAGE_STRINGZbigniew Jędrzejewski-Szmek2018-12-191-1/+0
| | | | | | | | | | | | | | | | | | | | | PACKAGE_VERSION is more explicit, and also, we don't pretend that changing the project name in meson.build has any real effect. "systemd" is embedded in a thousand different places, so let's just use the hardcoded string consistently. This is mostly in preparation for future changes.