Commit Graph

121 Commits

Author SHA1 Message Date
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 671677dad1 meson: add forgotten debug options
v2:
-rename -Dextra-debug to -Ddebug to match ./configure --debug
2017-05-02 16:28:40 -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
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 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 f75d75eb66 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.
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 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 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
Zbigniew Jędrzejewski-Szmek 2a4c156d64 meson: fix a bunch of substitutions
This makes the diff -r output on autotools and meson installations
empty, except for binary files and ## comments.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 3ca0cb7363 meson: properly conditionalize polkit installation
... including pkla installation on Debian.

v2:
- fix polkit-gobject-1 pkgconfig name
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek b710072da4 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.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 8191c5948b 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.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 3131bfe302 meson: add a few forgotten substitutions
v2:
- a few more
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 572baca1d4 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.
2017-04-23 21:47:26 -04:00
Zbigniew Jędrzejewski-Szmek 69e96427a2 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
2017-04-23 21:47:26 -04:00
Zbigniew Jędrzejewski-Szmek 527d43d701 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
2017-04-23 21:47:26 -04:00
Zbigniew Jędrzejewski-Szmek 5c23128dab 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
2017-04-23 21:47:26 -04:00