aboutsummaryrefslogtreecommitdiff
path: root/meson.build
AgeCommit message (Collapse)Author
2024-07-20Generate pkg-config files directlyMatt Jolly
- Remove 'pkgconfig' subdir - use meson 'pkgconfig' module to generate and install appropriate .pc files when required. - add `rc_path` variable to installed pkgconfig files Signed-off-by: Matt Jolly <kangie@gentoo.org>
2024-04-01version 0.54William Hubbs
2024-03-31Trivial curses/termcap removalOskari Pirhonen
Remove the curses code and make the HAVE_TERMCAP-gated "fallbacks" always present. This makes an ANSI terminal required for colors. X-Gentoo-Bug: https://bugs.gentoo.org/904277 Closes: https://github.com/OpenRC/openrc/issues/619
2024-03-25meson: drop broken split-usr handlingSam James
Two issues here: * The 'split-usr' meson option wasn't doing anything, it tried to check if /bin was a symlink, but nothing acted on this information. * The actual rootprefix default was decided based on whether /bin was a symlink which is flaky if e.g. building on a merged-usr system for use on a non-merged-usr system. People can set -Drootprefix=/usr if they wish. There's no real advantage to installing to /usr over / as the compat. symlinks are really here to stay. If someone really does care about this, they can bring it back and do it properly, but it doesn't seem worth it to me at all. Bug: https://bugs.gentoo.org/927776 Fixes: cc0037e9caaee05af0fdedafc5798c2a7aa9bdb8 Fixes: f2362cc277023550b2482215b4a1cd7142639427 Fixes: #696
2024-01-12version 0.53William Hubbs
2023-10-10version 0.51William Hubbs
2023-09-19version 0.50William Hubbs
2023-09-12misc: add syscall fallback for close_range for musl libcNatanael Copa
Add fallback for the close_range syscall wrapper. This is needed for musl libc, which currently does not have a close_range wrapper. Also set errno on errors.
2023-09-12start-stop-daemon: set fds to CLOEXEC instead of closingNatanael Copa
Set file descriptors to CLOEXEC instead of closing them before exec, similar to what we do in supervise-daemon. Use the share cloexec_fds_from() helper for this. closefrom() is no longer used so remove the test.
2023-09-12supervise-daemon: rename HAVE_CLOSE_RANGE_EXEC to HAVE_CLOSE_RANGENatanael Copa
Use HAVE_CLOSE_RANGE to tell if system provides a close_range(2) wrapper, which better explains the purpose. Add a compat inline which returns -1 if close_range is unavailable.
2023-08-31version 0.49William Hubbs
2023-08-29Don't re-define strlcpy/strlcat with >=glibc-2.38Sam James
`>=glibc-2.38` implements strlcpy, strlcat, etc so check for those functions with Meson and don't provide conflicting prototypes. Technically, it doesn't need _GNU_SOURCE, but it's easier because it's not clear right now what glibc wants to guard it with. Note that these are in POSIX next anyway. Fixes: https://github.com/OpenRC/openrc/issues/643 Signed-off-by: Sam James <sam@gentoo.org>
2023-07-05version 0.48William Hubbs
2023-04-19meson.build: add -Werror=... for modern C issuesSam James
Clang 16 makes these warnings fatal and GCC 14 is likely to as well.
2023-04-18version 0.47William Hubbs
2023-01-20start-stop-daemon, supervise-daemon: use closefrom()/close_range()Matt Whitlock
On systems with a very large RLIMIT_NOFILE, calling close() in a loop from 3 to getdtablesize() effects an enormous number of system calls. There are better alternatives. Both BSD and Linux have the closefrom() system call that closes all file descriptors with indices not less than a specified minimum. Have start-stop-daemon call closefrom() on systems where it's implemented, falling back to the old loop elsewhere. Likewise, calling fcntl(i, F_SETFD, FD_CLOEXEC) in a loop from 3 to getdtablesize() raises a similar performance concern. Linux 5.11 and onward has a close_range() system call with a CLOSE_RANGE_CLOEXEC flag that sets the FD_CLOEXEC flag on all file descriptors in a specified range. Have supervise-daemon utilize this feature on systems where it's implemented, falling back to the old loop elsewhere.
2023-01-05version 0.46William Hubbs
2022-12-08build: fix run_command warningNikolaos Chatzikonstantinou
The default behavior of check: false is going to change to true in the future, see <https://github.com/mesonbuild/meson/issues/9300>. Thus we are explicit about the desired behavior. The error in uname is important but with test we check ourselves using returncode(). This fixes #556.
2022-06-10restore the init symlink for sysvinit modeWilliam Hubbs
This symlink got lost in the transition to meson. X-Gentoo-Bug: 850754 X-Gentoo-Bug-URL: https://bugs.gentoo.org/850754
2022-06-07version 0.45William Hubbs
2022-05-08librc: mark stringlist functions as mallocsSam James
This gives a hint to the compiler that allocations (return values) from this function should be paired with a corresponding dealloc/free function In this case, it means that every rc_stringlist that rc_stringlist_new() returns should eventually be freed by calling rc_stringlist_free(ptr) where ptr is the relevant rc_stringlist. We have to add a test for this into the build system because only GCC supports this for now. In future, we might be able to use meson's has_function_attribute (it does support 'malloc', just not AFAICT 'malloc with arguments'). Signed-off-by: Sam James <sam@gentoo.org>
2022-04-16rewrite tests (#515)William Hubbs
* rewrite tests to work with meson This ports our tests to meson and makes them able to be run in parallel. * add tests to ci * rewrite test/check-trailing-newlines in bash This test was using a GNU sed command which does not work on Alpine Linux.
2022-04-06migrate fully to meson build systemWilliam Hubbs
- drop old build system - move shared include and source files to common directory - drop "rc-" prefix from shared include and source files - move executable-specific code to individual directories under src - adjust top-level .gitignore file for new build system This closes #489.
2022-03-05Fix indentation in the meson.build fileLinkTed
2021-12-31define the pam directory at the top levelWilliam Hubbs
2021-12-31remove a tabWilliam Hubbs
2021-12-30fix libkvm dependency for *bsdWilliam Hubbs
2021-12-30build: always add subdirsWilliam Hubbs
2021-12-29remove separate pam directoryWilliam Hubbs
2021-12-29build: rename sh_dir variable to rc_shdirWilliam Hubbs
2021-12-23capabilities: Add support for Linux capabilities(7)LinkTed
This adds capabilities for start-stop-daemon by adding --capabilities option. As a result, the user can specify the inheritable, ambient and bounding set by define capabilities in the service script. This fixes #314.
2021-11-28build: set rootprefix_default to /usr if on a /usr merged systemWilliam Hubbs
This requires at leaste meson 0.53.0 since it uses the fs module. This is for #474.
2021-11-27meson: fallback to libcrypt detection outside of pkg-configSam James
Much like PAM, not all implementations of libcrypt provide a pkg-config file, and hence we can't find it using the old logic. Let's fall back to the standard AC_SEARCH_LIBS-style check if the pkg-config-style detection fails. This fixes finding e.g. musl's libcrypt. X-Gentoo-Bug: 827074 X-Gentoo-Bug-URL: https://bugs.gentoo.org/827074
2021-11-27meson: only find libcrypt if SELinux and no PAMSam James
We only need libcrypt if we're building _with_ SELinux and _without_ PAM. We don't use libcrypt for general SELinux with PAM. This is mostly a correctness change as libcrypt should generally be available (as opposed to the previous change which fixed some real-world cases). Fixes: f3f0fde861b438c80f99afdd49fe175e9d0a68ca Fixes: #478
2021-11-20meson: link against libcrypt for SELinux if no PAMSam James
We use libcrypt's crypt() if we're _not_ using PAM in the SELinux code (rc-selinux, specifically). X-Gentoo-Bug: 824954 X-Gentoo-Bug-URL: https://bugs.gentoo.org/824954 Fixes: https://github.com/openrc/openrc/pull/477
2021-11-20meson: fix pam_misc_dep definitionSam James
X-Gentoo-Bug: 824954 X-Gentoo-Bug-URL: https://bugs.gentoo.org/824954 Fixes: https://github.com/OpenRC/openrc/issues/470 Fixes: https://github.com/OpenRC/openrc/pull/477
2021-11-06build: pam fixWilliam Hubbs
Set the HAVE_PAM option if the dependency is found *and* pam is requested. X-Gentoo-Bug: 821211 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=821211
2021-10-08fix bug in pam build testsWilliam Hubbs
2021-10-08support older pam versionsWilliam Hubbs
Some distros are still using versions of pam which do not create *.pc files, so we need fallback logic for that situation.
2021-10-02build: fix pam and pam_misc dependenciesWilliam Hubbs
Pam generates pkgconfig files now, so meson can use them to find the pam dependencies.
2021-09-21move rc_bindir and rc_sbindir definitions to the top levelWilliam Hubbs
2021-09-21build: fix rootprefixWilliam Hubbs
This fixes #438.
2021-09-08build: install pam filesWilliam Hubbs
2021-09-08build: fix symlinksWilliam Hubbs
2021-09-07version 0.44William Hubbs
2021-09-07build: install bash and zsh completionsWilliam Hubbs
2021-09-06build: fix libexecdirWilliam Hubbs
2021-09-06build: typo fixWilliam Hubbs
2021-09-06build: add split-usr optionWilliam Hubbs
2021-09-06build: change root_prefix to rootprefixWilliam Hubbs