Commit Graph

77 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek d1bf56759b meson: add -Didn=yes|no option 2017-06-16 09:21:15 -04:00
Zbigniew Jędrzejewski-Szmek 341b892ba2 meson: output TAGS file in source not build directory
The TAGS file was generated in build/ following what autotools did.
Nevertheless, it's more convenient to put in the source dir.
(It doesn't get deleted by mistake, and it's easier to find for the
editor.)
2017-05-30 21:36:27 -04:00
Zbigniew Jędrzejewski-Szmek 94e2523b70 tests,meson: add test-bus-vtable, compiled as C and C++
This test is mostly a compilation test that checks that various defines in
sd-bus-vtable.h are valid C++. The code is executed, but the results are not
checked (apart from sd-bus functions not returning an error). test-bus-objects
contains pretty extensive tests for this functionality.

The C++ version is only added to meson, since it's simpler there.
Because of the .cc extension, meson will compile the executable with c++.

This test is necessary to properly check the macros in sd-bus-vtable.h. Just
running the headers through g++ is not enough, because the macros are not
exercised.

Follow-up for #5941.
2017-05-13 15:50:44 -04:00
Lennart Poettering 6e4177315f Merge pull request #5432 from keszybz/udev-logging
udev logging separation
2017-05-12 15:22:46 +02:00
Zbigniew Jędrzejewski-Szmek 5486a31d28 nss-resolve: drop the internal fallback to libnss_dns (#5945)
If we could not communicate with systemd-resolved, we would call into
libnss_dns. libnss_dns would return NOTFOUND for stuff like "localhost" and
other names resolved by nss-myhostname, which we would fall under the !UNAVAIL=
condition and cause resolution to fail. So the following recommended
configuration in nsswitch.conf would not work:

   hosts: resolve [!UNAVAIL=return] dns myhostname

Remove the internal fallback code completely so that the fallback logic
can be configured in nsswitch.conf.

Tested with
   hosts: resolve [!UNAVAIL=return] myhostname
and
   hosts: resolve [!UNAVAIL=return] dns myhostname

Fixes #5742.
2017-05-12 14:31:46 +02:00
Lennart Poettering 3823da25cf Merge pull request #5928 from keszybz/libidn2
Use idn2 instead of idn
2017-05-12 12:01:40 +02:00
Zbigniew Jędrzejewski-Szmek 87057e244b resolved: support libidn2 in addition to libidn
libidn2 2.0.0 supports IDNA2008, in contrast to libidn which supports IDNA2003.

https://bugzilla.redhat.com/show_bug.cgi?id=1449145
From that bug report:

Internationalized domain names exist for quite some time (IDNA2003), although
the protocols describing them have evolved in an incompatible way (IDNA2008).
These incompatibilities will prevent applications written for IDNA2003 to
access certain problematic domain names defined with IDNA2008, e.g., faß.de is
translated to domain xn--fa-hia.de with IDNA2008, while in IDNA2003 it is
translated to fass.de domain. That not only causes incompatibility problems,
but may be used as an attack vector to redirect users to different web sites.

v2:
- keep libidn support
- require libidn2 >= 2.0.0
v3:
- keep dns_name_apply_idna caller dumb, and keep the #ifdefs inside of the
  function.
- use both ±IDN and ±IDN2 in the version string
2017-05-11 14:25:01 -04:00
Franck Bui b14e1b4394 sysusers: make group shadow support configurable
Some distros (openSUSE) don't have group shadow support enabled. This can lead
to the following error:

  # systemd-sysusers
  Creating group foofoo with gid 478.
  # systemd-sysusers
  # groupdel foofoo
  # systemd-sysusers
  Creating group foofoo with gid 478.
  Failed to write files: File exists

This patch adds --disable-gshadow option to configure. If used,
systemd-sysvusers won't consider /etc/gshadow.
2017-05-10 10:19:37 +02:00
Zbigniew Jędrzejewski-Szmek 5c72049f91 udev: use LOG_REALM_UDEV in all udev code
Any call to set/query/use the log level in the code with LOG_REALM=LOG_REALM_UDEV
refers to log_max_level[1]. In particular this means that systemd code using
the libudev library uses does not set the log level for log calls done in libudev.

Fixes #4525.

v2:
- also update meson's meson.build
2017-05-07 22:49:12 -04:00
Zbigniew Jędrzejewski-Szmek 2c201c2140 meson: use booleans for conf.set and drop unecessary conditionals
Using conf.set() with a boolean argument does the right thing:
either #ifdef or #undef. This means that conf.set can be used unconditionally.

Previously I used '1' as the placeholder value, and that needs to be changed to
'true' for consistency (under meson 1 cannot be used in boolean context). All
checks need to be adjusted.
2017-05-02 16:29:11 -04:00
Zbigniew Jędrzejewski-Szmek 829257d135 meson: add status report
This is similar to what ./configure prints. Instead of a long list of yes/no lines,
I added two lines at the end with "enabled features" and "disabled features".
This is what the mplayer/mencoder ./configure script did back in the day.
The advantage is that it's easy to look at the list of disabled features
and check for any unexpected entries.
2017-05-02 16:29:11 -04:00
Zbigniew Jędrzejewski-Szmek 671677dad1 meson: add forgotten debug options
v2:
-rename -Dextra-debug to -Ddebug to match ./configure --debug
2017-05-02 16:28:40 -04:00
Martin Pitt b13586206b Merge pull request #5827 from keszybz/meson-libcap
meson: fixes to allow meson builds on Ubuntu Trusty
2017-04-27 22:12:28 +02:00
Zbigniew Jędrzejewski-Szmek 0bc9115251 Merge branch 'master' into meson-no-libudev 2017-04-27 13:39:54 -04:00
Zbigniew Jędrzejewski-Szmek 2c5434ad3c meson: fix detection of "-Wno-" options 2017-04-27 10:05:41 -04:00
Zbigniew Jędrzejewski-Szmek 9f0e9c0119 meson: add version check for libseccomp
Compilation fails because of the missing arm64 bits with old seccomp versions.
2017-04-27 10:05:18 -04:00
Zbigniew Jędrzejewski-Szmek 1800cc8546 meson: also search for libcap directly 2017-04-27 01:30:30 -04:00
Michael Biebl c3045943c4 meson: get rid of libfirewall 2017-04-26 22:14:23 +02:00
Michael Biebl 34ce0a52c7 meson: drop implicit libudev link dependencies
Executables which link against libshared do not need an explicit
dependency on libudev, as libshared will make sure that those symbols
are available.
2017-04-26 17:28:48 +02:00
Susant Sahani 9dfed8dd92 meson: add geneve to build system
```
[107/1793] Compiling c object 'src/basic/basic@sta/log.c.o'
In file included from ../src/basic/log.c:44:0:
../src/basic/missing.h:762:6: warning: "HAVE_DECL_IFLA_GENEVE_LABEL" is not defined, evaluates to 0 [-Wundef]
^~~~~~~~~~~~~~~~~~~~~~~~~~~
[108/1793] Compiling c object 'src/basic/basic@sta/path-util.c.o'
In file included from ../src/basic/path-util.c:40:0:
../src/basic/missing.h:762:6: warning: "HAVE_DECL_IFLA_GENEVE_LABEL" is not defined, evaluates to 0 [-Wundef]
^~~~~~~~~~~~~~~~~~~~~~~~~~~

```
2017-04-25 20:30:34 +05:30
Zbigniew Jędrzejewski-Szmek d730e2d164 meson: require newest meson and revert m4 patch
This reverts 78b68dcb55.
2017-04-25 08:49:58 -04:00
Zbigniew Jędrzejewski-Szmek 7572aa805c meson: use name arg so check result is reported 2017-04-25 08:49:16 -04:00
Zbigniew Jędrzejewski-Szmek 6e2afb1cab 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
2017-04-25 08:49:16 -04:00
Zbigniew Jędrzejewski-Szmek dd6ab3df74 meson: add git-snapshot target
The output is systemd-<sha1abbrev>.tar.gz in source root.
2017-04-24 19:28:05 -04:00
Zbigniew Jędrzejewski-Szmek 5464ec8a8e meson: there is no smack library
Detection would always fail, so this was broken.
Treat this as a binary enable/disable option.
2017-04-24 19:28:04 -04:00
Zbigniew Jędrzejewski-Szmek 80c6fce81c meson: add forgotten tpm support 2017-04-24 19:28:04 -04:00
Zbigniew Jędrzejewski-Szmek 41afb5eb72 meson: use -f{function,data}-sections for optimized builds 2017-04-24 19:28:04 -04:00
Michael Biebl 0da6f39619 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 3a30f21ff8.
2017-04-24 19:25:33 -04:00
Michael Biebl 76c8741060 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.
2017-04-24 19:25:33 -04:00
Zbigniew Jędrzejewski-Szmek 36f0387efc meson: add option to disable libacl support 2017-04-24 19:25:33 -04:00
Zbigniew Jędrzejewski-Szmek 6800fe7f06 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.
2017-04-24 19:24:36 -04:00
Zbigniew Jędrzejewski-Szmek 4984c8be73 meson: detect getrandom in sys/random.h, fall back to linux/random.h
This is analogous to commit e84397d95c3da2b9722ff265843ad4a8874643d8.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 38f1ae0f99 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.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 1276a9f63a meson: add ln --relative check 2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek a923e085af meson: use run_target instead of custom_target where appropriate
This way a fake output does not need to be specified.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 1aec3ed90d 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)
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 37efbbd821 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.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 3a30f21ff8 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.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek d83f4f506d 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.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek fdd147a88e 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.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek abba22c51c meson: add hwdb/update target 2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 177929c236 meson: add git-contrib target 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 83b6af36d1 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.)
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek aac2605820 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.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek ab916f2e81 meson: add rootprefix option (for Gentoo) 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 4ff3f251b9 meson: install test data
v2:
- do not install test-data if instal-tests=no
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 4390be305b 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.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek b184e8feb9 meson: skip index generation when lxml is not available 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 2895c8ee9f meson: ima support 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 1eeb43f5af meson: libxkbcommon support 2017-04-23 21:47:28 -04:00