]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 years agomeson: require newest meson and revert m4 patch 5704/head
Zbigniew Jędrzejewski-Szmek [Tue, 25 Apr 2017 12:49:58 +0000 (08:49 -0400)] 
meson: require newest meson and revert m4 patch

This reverts 78b68dcb55.

7 years agomeson: use name arg so check result is reported
Zbigniew Jędrzejewski-Szmek [Tue, 25 Apr 2017 01:46:40 +0000 (21:46 -0400)] 
meson: use name arg so check result is reported

7 years agomeson: fix checking of linker args
Zbigniew Jędrzejewski-Szmek [Tue, 25 Apr 2017 01:03:35 +0000 (21:03 -0400)] 
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

7 years agomeson: also indent scripts with 8 spaces
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:40:02 +0000 (19:40 -0400)] 
meson: also indent scripts with 8 spaces

7 years agomeson: add git-snapshot target
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:28:05 +0000 (19:28 -0400)] 
meson: add git-snapshot target

The output is systemd-<sha1abbrev>.tar.gz in source root.

7 years agomeson: test-ns is manual, not just unsafe
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:28:05 +0000 (19:28 -0400)] 
meson: test-ns is manual, not just unsafe

7 years agomeson: there is no smack library
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:28:04 +0000 (19:28 -0400)] 
meson: there is no smack library

Detection would always fail, so this was broken.
Treat this as a binary enable/disable option.

7 years agomeson: add forgotten tpm support
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:28:04 +0000 (19:28 -0400)] 
meson: add forgotten tpm support

7 years agomeson: use -f{function,data}-sections for optimized builds
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 23:28:04 +0000 (19:28 -0400)] 
meson: use -f{function,data}-sections for optimized builds

7 years agomeson: allow static linking of systemd-hwdb
Michael Biebl [Fri, 21 Apr 2017 16:32:14 +0000 (18:32 +0200)] 
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.

7 years agomeson: add forgotten parse_hwdb.py test
Zbigniew Jędrzejewski-Szmek [Mon, 24 Apr 2017 01:36:29 +0000 (21:36 -0400)] 
meson: add forgotten parse_hwdb.py test

7 years agomeson: fix gcrypt config option
Michael Biebl [Fri, 21 Apr 2017 21:45:54 +0000 (23:45 +0200)] 
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.

7 years agomeson: add option to disable libacl support
Zbigniew Jędrzejewski-Szmek [Fri, 21 Apr 2017 17:53:59 +0000 (13:53 -0400)] 
meson: add option to disable libacl support

7 years agomeson: $DESTDIR might be undefined
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 16:06:14 +0000 (12:06 -0400)] 
meson: $DESTDIR might be undefined

This causes an error with -u. Just add an empty fallback.

7 years agomeson: define gnu_efi_arch for the arch efi name, fix ldsdir detection
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 02:57:52 +0000 (22:57 -0400)] 
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.

7 years agomeson: detect getrandom in sys/random.h, fall back to linux/random.h
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 01:20:54 +0000 (21:20 -0400)] 
meson: detect getrandom in sys/random.h, fall back to linux/random.h

This is analogous to commit e84397d95c3da2b9722ff265843ad4a8874643d8.

7 years agomeson: check string.h not strings.h for explicit_bzero
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:14:16 +0000 (16:14 -0400)] 
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.

7 years agomeson: fix 'clean'
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 15:30:32 +0000 (11:30 -0400)] 
meson: fix 'clean'

7 years agomeson: install the dbus aliases for resolve1 and network1 in /etc
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 14:32:42 +0000 (10:32 -0400)] 
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

7 years agoREADME: update with meson instructions
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 01:52:30 +0000 (21:52 -0400)] 
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.)

7 years agomeson: add rule to regenerate man/rules/meson.build
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 01:00:46 +0000 (21:00 -0400)] 
meson: add rule to regenerate man/rules/meson.build

7 years agomeson: add ln --relative check
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:11:54 +0000 (19:11 -0400)] 
meson: add ln --relative check

7 years agomeson: use "sh -eu" and make .sh +x, .py -x
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 21:14:48 +0000 (17:14 -0400)] 
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.

7 years agomeson: use run_target instead of custom_target where appropriate
Zbigniew Jędrzejewski-Szmek [Mon, 17 Apr 2017 23:48:20 +0000 (19:48 -0400)] 
meson: use run_target instead of custom_target where appropriate

This way a fake output does not need to be specified.

7 years agomeson: add libblkid as libudev-core dep to fix include dir
Zbigniew Jędrzejewski-Szmek [Mon, 17 Apr 2017 23:33:10 +0000 (19:33 -0400)] 
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)

7 years agomeson: reindent all files with 8 spaces
Zbigniew Jędrzejewski-Szmek [Mon, 17 Apr 2017 23:25:00 +0000 (19:25 -0400)] 
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.

7 years agomeson: use efi-includedir to look for header
Zbigniew Jędrzejewski-Szmek [Mon, 17 Apr 2017 17:22:28 +0000 (13:22 -0400)] 
meson: use efi-includedir to look for header

This change mirrors cba49f2deab481045408d5452ac8c84fc03bccd5.

7 years agomeson: allow optional static linking of shared code in udev helpers
Zbigniew Jędrzejewski-Szmek [Mon, 17 Apr 2017 16:07:12 +0000 (12:07 -0400)] 
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.

7 years agotest-efi-create-disk.sh: allow running from separate build dir, hook up to meson
Zbigniew Jędrzejewski-Szmek [Sun, 16 Apr 2017 16:04:46 +0000 (12:04 -0400)] 
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.

7 years agomeson: add dist-check-includes replacement
Zbigniew Jędrzejewski-Szmek [Sun, 16 Apr 2017 02:50:56 +0000 (22:50 -0400)] 
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.

7 years agohwdb: use curl instead of wget, and regenerate patch after successful update
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 21:28:14 +0000 (17:28 -0400)] 
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.)

7 years agomeson: add journal-install and hwdb-update hooks
Zbigniew Jędrzejewski-Szmek [Sat, 15 Apr 2017 04:56:05 +0000 (00:56 -0400)] 
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

7 years agomeson: add hwdb/update target
Zbigniew Jędrzejewski-Szmek [Sat, 15 Apr 2017 04:40:59 +0000 (00:40 -0400)] 
meson: add hwdb/update target

7 years agomeson: add git-contrib target
Zbigniew Jędrzejewski-Szmek [Sat, 15 Apr 2017 04:16:23 +0000 (00:16 -0400)] 
meson: add git-contrib target

7 years agomeson: add man/doc-sync target
Zbigniew Jędrzejewski-Szmek [Sat, 15 Apr 2017 04:07:57 +0000 (00:07 -0400)] 
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.

7 years agomeson: add test-dlopen
Zbigniew Jędrzejewski-Szmek [Sat, 15 Apr 2017 00:10:28 +0000 (20:10 -0400)] 
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.)

7 years agotest-nss: fix loading of modules under meson
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 23:49:15 +0000 (19:49 -0400)] 
test-nss: fix loading of modules under meson

There is no .libs dirs under meson. Just try both paths.

7 years agomeson: eliminate libsystemd_journal_internal and use libsystemd_internal less
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 22:49:47 +0000 (18:49 -0400)] 
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.

7 years agomeson: add rootprefix option (for Gentoo)
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 02:15:01 +0000 (22:15 -0400)] 
meson: add rootprefix option (for Gentoo)

7 years agomeson: install test data
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 00:47:20 +0000 (20:47 -0400)] 
meson: install test data

v2:
- do not install test-data if instal-tests=no

7 years agomeson: replace yes/no/auto with true/false/auto
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 00:30:07 +0000 (20:30 -0400)] 
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.

7 years agomeson: fix condition for installation of .in units, 99-default.link
Zbigniew Jędrzejewski-Szmek [Fri, 14 Apr 2017 00:17:04 +0000 (20:17 -0400)] 
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.

7 years agomeson: skip index generation when lxml is not available
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 23:59:21 +0000 (19:59 -0400)] 
meson: skip index generation when lxml is not available

7 years agomeson: ima support
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 23:45:05 +0000 (19:45 -0400)] 
meson: ima support

7 years agomeson: libxkbcommon support
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 23:37:14 +0000 (19:37 -0400)] 
meson: libxkbcommon support

7 years agomeson: recreate dist-check-help
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 15:52:05 +0000 (11:52 -0400)] 
meson: recreate dist-check-help

7 years agomeson: use join_paths consistently
Michael Biebl [Thu, 13 Apr 2017 14:30:56 +0000 (10:30 -0400)] 
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.

7 years agomeson: rework processing of unit files
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 00:58:55 +0000 (20:58 -0400)] 
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.

7 years agomeson: support (the removal of) lines with ##
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 00:05:33 +0000 (20:05 -0400)] 
meson: support (the removal of) lines with ##

7 years agomeson: fix a bunch of substitutions
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:54:33 +0000 (19:54 -0400)] 
meson: fix a bunch of substitutions

This makes the diff -r output on autotools and meson installations
empty, except for binary files and ## comments.

7 years agomeson: properly conditionalize polkit installation
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:09:26 +0000 (19:09 -0400)] 
meson: properly conditionalize polkit installation

... including pkla installation on Debian.

v2:
- fix polkit-gobject-1 pkgconfig name

7 years agomeson: add support for building efi modules
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 19:05:55 +0000 (15:05 -0400)] 
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.

7 years agomeson: specify a timeout of 90 s for tests which take a bit longer
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 17:08:47 +0000 (13:08 -0400)] 
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.

7 years agomeson: disable bootctl without libblkid
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:36:20 +0000 (12:36 -0400)] 
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.

7 years agomeson: fix compilation with -Dnetworkd=false, -Dkmod=no, -Dlibgcrypt=no
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:14:30 +0000 (12:14 -0400)] 
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.

7 years agomeson: replace $ORIGIN with rootlibdir everywhere
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:02:30 +0000 (12:02 -0400)] 
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.

7 years agomeson: make cpp invocations cross-compilation friendly
Zbigniew Jędrzejewski-Szmek [Tue, 11 Apr 2017 14:25:34 +0000 (10:25 -0400)] 
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.

7 years agomeson: add a few forgotten substitutions
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 23:06:45 +0000 (19:06 -0400)] 
meson: add a few forgotten substitutions

v2:
- a few more

7 years agomeson: specify rpath on all executables linking to libshared
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 22:13:00 +0000 (18:13 -0400)] 
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.

7 years agomeson: link test-lib{systemd,udev}-sym in the usual way
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:35:55 +0000 (17:35 -0400)] 
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).

7 years agomeson: fix compilation of libsystemd
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:35:21 +0000 (17:35 -0400)] 
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.

7 years agomeson: update linking for fixed meson linking
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:11:10 +0000 (17:11 -0400)] 
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.

7 years agomeson: add test-libudev-sym
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 19:20:42 +0000 (15:20 -0400)] 
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.

7 years agomeson: add test-libsystemd-sym, fix linking of libsystemd
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 18:13:40 +0000 (14:13 -0400)] 
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.

7 years agomeson: install systemd-sulogin-shell too
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:37:52 +0000 (12:37 -0400)] 
meson: install systemd-sulogin-shell too

7 years agomeson: remove libnss_*.so symlinks after install
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:26:39 +0000 (12:26 -0400)] 
meson: remove libnss_*.so symlinks after install

7 years agomeson: create /var/log/journal/remote
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:20:03 +0000 (12:20 -0400)] 
meson: create /var/log/journal/remote

C.f. https://github.com/mesonbuild/meson/issues/1604.

7 years agomeson: create various symlinks
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:55:50 +0000 (23:55 -0400)] 
meson: create various symlinks

v2:
- remove bashisms

7 years agomeson: create dirs and touch /usr
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:55:05 +0000 (23:55 -0400)] 
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

7 years agomeson: add unit installation symlinks
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:43:53 +0000 (23:43 -0400)] 
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

7 years agomeson: create a static version of libshared and link libcore and some tests to it
Zbigniew Jędrzejewski-Szmek [Sun, 9 Apr 2017 18:08:53 +0000 (14:08 -0400)] 
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

7 years agomeson: include the library symbol version list in link_depends
Zbigniew Jędrzejewski-Szmek [Sun, 9 Apr 2017 17:11:49 +0000 (13:11 -0400)] 
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.

7 years agomeson: add option to install tests
Zbigniew Jędrzejewski-Szmek [Sat, 8 Apr 2017 05:55:38 +0000 (01:55 -0400)] 
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.

7 years agomeson: define tests
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 04:19:09 +0000 (00:19 -0400)] 
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

7 years agomeson: add TAGS target
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 18:33:27 +0000 (14:33 -0400)] 
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/

7 years agomeson: add custom targets man/man and man/html
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 02:46:03 +0000 (22:46 -0400)] 
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

7 years agomeson: add rule to generate custom-entities.ent
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 23:44:41 +0000 (19:44 -0400)] 
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.

7 years agomeson: avoid detecting m4 dir as a program
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 04:40:21 +0000 (00:40 -0400)] 
meson: avoid detecting m4 dir as a program

This is a bug in meson, already fixed upstream.
For now, just specify the full path.

7 years agomake-man-rules: add support for generating the list in meson.build format
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 03:21:04 +0000 (23:21 -0400)] 
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

7 years agomeson: build systemd using meson
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 03:03:47 +0000 (23:03 -0400)] 
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

7 years agojournal/fsprg: set -Wno-pointer-arithm only for that file
Zbigniew Jędrzejewski-Szmek [Sat, 22 Apr 2017 22:49:49 +0000 (18:49 -0400)] 
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.

7 years agogitignore: ignore all build* subdirs in main directory
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 15:24:46 +0000 (11:24 -0400)] 
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.

7 years agoMerge pull request #5774 from keszybz/printf-annotations
Djalal Harouni [Sat, 22 Apr 2017 23:03:42 +0000 (01:03 +0200)] 
Merge pull request #5774 from keszybz/printf-annotations

Printf annotation improvements

7 years agoMerge pull request #5756 from keszybz/make-cleanups
Martin Pitt [Fri, 21 Apr 2017 19:36:56 +0000 (21:36 +0200)] 
Merge pull request #5756 from keszybz/make-cleanups

Various meson-independent cleanups from the meson patchset

7 years agokernel-install: remove unneeded modules.* files created by depmod (#5766)
Yu Watanabe [Fri, 21 Apr 2017 18:03:17 +0000 (03:03 +0900)] 
kernel-install: remove unneeded modules.* files created by depmod (#5766)

Fixes #5765.

7 years agocoredump: fix non-literal string used in printf 5774/head
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:28:19 +0000 (14:28 -0400)] 
coredump: fix non-literal string used in printf

This was exposed by the previous commit. This could be potentially
unpleasant, but we are saved by the fact that this code path was only
taken for journald crashes, where we control COMM and know that it doesn't
contain any special characters. Use log_dispatch which does not do any
format processing to push the message out.

7 years agobasic/log: expose log_dispatch
Zbigniew Jędrzejewski-Szmek [Fri, 21 Apr 2017 16:52:54 +0000 (12:52 -0400)] 
basic/log: expose log_dispatch

This is useful when we want to avoid printf formatting on the message.
It's nicer than using log_struct with "%s" as the format, because printf
is slow and with a large message (like from a backtrace) this would require
extra unnecessary memory.

I'm not exposing all the fields in the wrapper: only level and errno.
Those are the most likely to be useful.

7 years agotree-wide: mark log_struct with _printf_ and fix fallout
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:15:28 +0000 (14:15 -0400)] 
tree-wide: mark log_struct with _printf_ and fix fallout

log_struct takes multiple format strings, each one followed by arguments.
The _printf_ annotation is not sufficiently flexible to express this,
but we can still annotate the first format string, though not its
arguments (because their number is unknown).

With the annotation, the places which specified the message id or similar
as the first pattern cause a warning from -Wformat-nonliteral. This can
be trivially fixed by putting the MESSAGE= first.

This change will help find issues where a non-literal is erroneously used
as the pattern.

7 years agoµhttpd-util: use #pragma to silence warning about nonliteral pattern
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:45:30 +0000 (14:45 -0400)] 
µhttpd-util: use #pragma to silence warning about nonliteral pattern

This is safe, because we're taking a pattern which was already marked with
_printf_ and appending a literal string.

7 years agobus: include sd-{bus,messages}.h the same as other systemd headers 5756/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 22:50:13 +0000 (18:50 -0400)] 
bus: include sd-{bus,messages}.h the same as other systemd headers

This is our own header, we should include use the local-include syntax
("" not <>), to make it clear we are including the one from the build tree.
All other includes of files from src/systemd/ use this scheme.

7 years agomicrohttpd-util: silence warnings about deprecated options
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:37:24 +0000 (16:37 -0400)] 
microhttpd-util: silence warnings about deprecated options

C.f. 21b6ff368438bd3e809c2fabe73038eb305df296.

7 years agotest-exec-util: drop duplicate const
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:32:52 +0000 (16:32 -0400)] 
test-exec-util: drop duplicate const

gcc-7 warns about this with -Wduplicate-decl-specifier.

7 years agobasic/random-util: add new header for getrandom()
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:13:27 +0000 (16:13 -0400)] 
basic/random-util: add new header for getrandom()

There's some confusion: older man pages specify that linux/random.h
contains getrandom, but newer glibc has it in sys/random.h. Detect if
the newer header is available and include it. We still need the older
header for the flags.

7 years agolibshared: fix compilation without libblkid
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:05:05 +0000 (19:05 -0400)] 
libshared: fix compilation without libblkid

This reverts a75e27eba75e27eb fixed the case of libcryptsetup=no, libblkid=yes,
but broke the case of libcryptsetup=no, libblkid=yes. Instead of trying to define
the function only when used, which would result in too much ifdeffery, just silence
the warning.

7 years agobasic/missing.h: drop inclusion of macro.h
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:04:15 +0000 (19:04 -0400)] 
basic/missing.h: drop inclusion of macro.h

It's not necessary for anything.

7 years agoMakefile.am: remove duplicated rules for efi
Zbigniew Jędrzejewski-Szmek [Tue, 11 Apr 2017 03:27:55 +0000 (23:27 -0400)] 
Makefile.am: remove duplicated rules for efi

Specifying the same rule with a slightly different dep list was not useful,
since make cannot distinguish rules with the same input / output. (It possibly
could have two rules with different dependency list, but here all dependencies
that are different between the two rules are always present, so the two rules
are effectively the same.)

7 years agoman: fix small typo (#5778)
AsciiWolf [Fri, 21 Apr 2017 13:01:09 +0000 (15:01 +0200)] 
man: fix small typo (#5778)

7 years agonetworkd: route - support 'onlink' routes (#5734)
Susant Sahani [Fri, 21 Apr 2017 09:22:30 +0000 (14:52 +0530)] 
networkd: route - support 'onlink' routes (#5734)

This work based on Tom's original patch
teg@1312172

By setting GatewayOnlink=yes, the kernel will assume that the gateway is onlink
even if there is no route to it.

Resolves issue #1283.

7 years agounits: systemd-resolved should start before network-online.target and nss-lookup...
Yu Watanabe [Fri, 21 Apr 2017 09:21:17 +0000 (18:21 +0900)] 
units: systemd-resolved should start before network-online.target and nss-lookup.target (#5691)

systemd-resolved provides
1. local API via NSS and D-Bus
2. kind of a local "DNS proxy" through its stub listener
The 1st item should be started before nss-lookup.target.
The 2nd item should be started before network-online.target,
because if the networking works in general, then DNS (and DNS proxy) should too.

Fixes #5650

7 years agonetworkd: vlan add GVRP support (#5761)
Susant Sahani [Fri, 21 Apr 2017 09:01:59 +0000 (14:31 +0530)] 
networkd: vlan add GVRP support (#5761)

Add support to configure GVRP.

Closes #5760