summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* Support /proc in _dbus_file_get_contentLuca Boccassi2023-05-151-0/+9
| | | | | | | | | procfs has special semantics: most files are 0 size, only one read can be done on a file, and they are not larger than 4MB. Enhance _dbus_file_get_content() so that we can read files from /proc with it. Signed-off-by: Luca Boccassi <bluca@debian.org>
* Start 1.15.6Simon McVittie2023-02-081-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Prepare v1.15.4dbus-1.15.4Simon McVittie2023-02-081-3/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Use list for dbus_static_flagsDaniel Wagner2023-02-061-1/+1
| | | | | | | | Meson complains that it is only allowed to concatenate list to lists and not strings. Signed-off-by: Daniel Wagner <dwagner@suse.de> Origin: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/388
* meson: Use -fvisibility=hidden on Unix if supportedSimon McVittie2023-01-091-0/+21
| | | | | | | | | | This avoids accidentally exporting all of our private symbols as part of the LIBDBUS_PRIVATE_x.y.z verdef, including ones that don't need to be visible outside the shared library even when testing internals (_dbus_watch_set_handler is a good example). Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/437 Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Introduce message_bus and tools command line optionDaniel Wagner2023-01-041-17/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | To make the consume libdbus via Meson's subproject use case more useful, introduce message_bus and tools command line options which control if the D-Bus daemon and/or the tools are build. The idea here is that depending projects are interested only in the library. The strong recommendation is only to build libdbus as static library: libdbus_dep = dependency( 'dbus-1', required: get_option('libdbus'), fallback: ['dbus', 'libdbus_dep'], default_options: [ 'default_library=static', 'embedded_tests=false', 'message_bus=false', 'modular_tests=disabled', 'tools=false', ], ) This ensures that any installed D-Bus infrastructure on the target system is not overwritten. Signed-off-by: Daniel Wagner <dwagner@suse.de>
* build: Put system bus socket in runstatedir by defaultIssam E. Maghni2022-10-111-6/+1
| | | | | | | | | | | | | | | | | | | | | | This lets OS distributors configure --runstatedir=/run if they want to, although for interoperability, they should only do this if they can guarantee that their /run and /var/run are equivalent. A previous commit adds a warning if we are using the default path on a system where /run and /var/run are not synoymous, mitigating the compatibility impact of this change. For CMake, this requires version 3.9, released in 2017. For Meson, this is currently controlled by the runtime_dir option, which defaults to /run if the prefix is /usr. The rationale for this is that /run is correct for modern Unix systems, and distributors who switch from Autotools or CMake to Meson need to review all their build options at that time, which is an ideal opportunity to check that they are doing the right thing around /run. Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/180 Co-authored-by: Simon McVittie <smcv@collabora.com>
* build: Show a warning if the system bus socket is not interoperableSimon McVittie2022-10-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | We would like to start using ${runstatedir}/dbus/system_bus_socket, so that distributors who make /var/run a symbolic link to /run will usually get their dbus-daemon listening on /run/dbus/system_bus_socket, which has some advantages in corner cases, such as when /var is mediated by an automounter or is unmounted during system shutdown. Unfortunately, the interoperable path in the D-Bus Specification is /var/run/dbus/system_bus_socket for historical reasons (D-Bus is older than /run), and older versions of Slackware are known to have had /run and /var/run as distinct directories. Do a check during configuration to catch systems configured like this and show a warning. When cross-compiling, this assumes that the system where dbus is built (the build system in Autotools/Meson, or the "host" in CMake terminology) has its /var/run and /run set up in a way that is compatible with the system where dbus will run (the host system in Autotools/Meson, or the "target" in CMake terminology). This is not 100% correct, but seems good enough for a warning that will hopefully only trigger for misguided OS distributors. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Check for more symbols before defining HAVE_CLOCK_MONOTONIC in MesonJordan Williams2022-10-061-1/+3
| | | | | | | | | MacOS has limited support for monotonic clock in its pthread implementation. When building with Meson, `HAVE_MONOTONIC_CLOCK` is defined despite this. This PR checks for the existence of the missing function `pthread_condattr_setclock`. To match parity with AutoTools, it also checks for `clock_getres`. Fixes #419.
* Post-release version bumpSimon McVittie2022-10-051-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Prepare v1.15.2dbus-1.15.2Simon McVittie2022-10-051-3/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Post-release version bumpSimon McVittie2022-09-221-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Prepare v1.15.0 (development-branch release)Simon McVittie2022-09-221-3/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* dbus-message.c: skip 1.10 layout compatibility test on new architecturesAlex Richardson2022-09-211-0/+3
| | | | | | | These static assertions fail on CHERI-enabled architectures such as Arm Morello, where pointers are 128 bits. Architectures with 128-bit pointers were not supported in DBus 1.10, so we can skip the checks for DBus 1.10 structure layout compatibility for architectures with pointer size > 64 bit.
* meson: define DBUS_TEST_SOCKET_DIR in the config headerAlex Richardson2022-09-151-0/+1
| | | | This matches autotools
* dbus-sysdeps-util-unix.c: Avoid including sys/syslimits.hAlex Richardson2022-08-101-1/+0
| | | | | | | This header is GCC specific header that on my system just contains `#include_next <limits.h>`. FreeBSD also provides this header but it contains a `#warning` that it should not be used. Replace the one use with `#include <limit.h>` and drop the configure checks.
* meson: Only require C++ compiler when building for WindowsSimon McVittie2022-07-261-8/+31
| | | | | | | | | | dbus is generally a C-only project, but the Windows side has a tiny amount of C++ to initialize global locks (because Windows doesn't have a direct equivalent of PTHREAD_MUTEX_INITIALIZER). We don't need a C++ compiler when building for a non-Windows OS, so there's no need to find it or check which options it supports. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Assume stdint.h is providedSimon McVittie2022-07-191-1/+0
| | | | | | | We now require a (mostly-)C99 compiler, meaning we can rely on having Standard C stdint.h. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Remove fallback implementation of strtoll(), strtoull()Simon McVittie2022-07-191-2/+0
| | | | | | | We now require a (mostly-)C99 compiler, which guarantees the presence of these functions. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Remove emulation of va_copy() in non-C99 compilersSimon McVittie2022-07-191-50/+0
| | | | | | | dbus now requires a (mostly-)C99 compiler, which guarantees the presence of Standard C va_copy(). Signed-off-by: Simon McVittie <smcv@collabora.com>
* build-sys: check for afunix.hMarc-André Lureau2022-07-151-0/+1
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* meson: Enable more compiler warningsSimon McVittie2022-07-151-0/+39
| | | | | | | This provides parity with what we did in Autotools (most of it via AX_COMPILER_FLAGS_CFLAGS). Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Pass project-wide compile arguments to has_header_symbol, etc.Simon McVittie2022-07-151-23/+58
| | | | | | | Otherwise, we'll miss symbols that only appear when _GNU_SOURCE is defined, like environ in Linux unistd.h. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Comment why we disable certain compiler warningsSimon McVittie2022-07-151-0/+6
| | | | | | | This knowledge shouldn't be lost when we delete the Autotools build system. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Build with -fno-common if supportedSimon McVittie2022-07-151-0/+5
| | | | | | | | | This turns off a poorly-supported feature of older compilers. Even when using an older compiler, we want to behave more strictly. The Autotools build already did this. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Build with -fno-strict-aliasing if supportedSimon McVittie2022-07-151-0/+5
| | | | | | | We know that dbus is not fully strict-aliasing-compliant. In Autotools we got this from AX_COMPILER_FLAGS_CFLAGS. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Set up functionally necessary compiler arguments separatelySimon McVittie2022-07-151-30/+47
| | | | | | | | | | | | | | We have to set up feature-flag options like _GNU_SOURCE before we do compiler checks like cc.has_header_symbol, otherwise we'll miss symbols that are guarded by a feature-flag test, like environ in Linux unistd.h. However, we don't want to pass flags for extra compiler warnings when doing these checks, because that can cause false negatives: in particular, Meson's check programs nearly always trigger -Wunused. So the warnings need to be in a separate list. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Don't use cc.has_function to check for va_copySimon McVittie2022-07-131-2/+29
| | | | | | | | va_copy is not an ordinary function (an extern symbol), so we can't treat it as one. Instead, use the same compilation/linking check as in the Autotools build system. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: add missing header checksMarc-André Lureau2022-07-131-0/+2
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* meson: add windows_output_debug_string optionMarc-André Lureau2022-07-131-0/+3
| | | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [smcv: Rename to avoid using "Win32" to refer to both 32- and 64-bit] Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Allow disabling Valgrind instrumentationSimon McVittie2022-07-131-1/+5
| | | | | | | | | | | | This would currently result in a hard dependency on Valgrind headers when linking dependent projects to libdbus (see https://github.com/mesonbuild/meson/pull/10544 for an attempt to avoid this), so distributions likely don't want to enable this feature in their main builds of valgrind (although they could enable it in special debug builds like the one in Debian's dbus-tests package if desired). Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Add GLib version macrosSimon McVittie2022-07-131-0/+3
| | | | | | This helps to avoid unintended dependencies on newer versions of GLib. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Define HAVE_GIO_UNIXSimon McVittie2022-07-131-1/+3
| | | | | | Some of the tests check for this. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Check for LOG_PERRORSimon McVittie2022-07-131-0/+3
| | | | | | We use this when writing to the system log. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Check for environ declarationSimon McVittie2022-07-131-0/+1
| | | | | | We use this in various places. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Replicate Autotools check for __sync_sub_and_fetchSimon McVittie2022-07-131-2/+13
| | | | | | | The built-in atomic intrinsics are not exactly functions, so it's incorrect to use has_function to check for them. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Always define HAVE_DECL_MSG_NOSIGNAL to 1 or 0Simon McVittie2022-07-131-2/+2
| | | | | | This is consistent with Autotools AC_CHECK_DECLS. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Don't check for dirfdSimon McVittie2022-07-131-1/+0
| | | | | | We never actually look at HAVE_DIRFD. Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Don't define DBUS_ENABLE_ASSERTSSimon McVittie2022-07-131-2/+0
| | | | | | | The other build systems don't define this, and it's too confusing to have both DBUS_ENABLE_ASSERTS and DBUS_ENABLE_ASSERT. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Change how we create empty directories from MesonSimon McVittie2022-07-131-2/+12
| | | | | | | | | Use install_emptydir() in Meson versions that support it, or a script with similar invocation in versions that do not. This will make it straightforward to migrate to install_emptydir() when we drop support for Meson versions older than 0.60.0. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Change how we create symlinks from MesonSimon McVittie2022-07-131-7/+27
| | | | | | | | | | | | Use install_symlink() in Meson versions that support it, or a script with similar invocation in versions that do not. This will make it straightforward to migrate to install_symlink() when we drop support for Meson versions older than 0.61.0. Based on an implementation in the game-data-packager package, which used a shell script. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Define x11 to an empty dependency if X11 autolaunch is disabledSimon McVittie2022-07-131-0/+1
| | | | | | | Otherwise, we can't build successfully for Windows with X11 autolaunch explicitly disabled. Signed-off-by: Simon McVittie <smcv@collabora.com>
* subprojects: Allow expat and GLib to be built as subprojectsSimon McVittie2022-07-131-2/+14
| | | | | | | This should let us build everything with a mingw-w64 toolchain, without having to use prebuilt dependencies from MSYS. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Make update-authors convenience target runnable from MesonSimon McVittie2022-07-131-0/+7
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Remove a misleading commentSimon McVittie2022-07-131-1/+0
| | | | | | | It's fine to define DBUS_COMPILATION for anything that is being compiled as part of dbus. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Implement a runtime_dir optionSimon McVittie2022-07-131-3/+15
| | | | | | | | | | | | | | If the prefix is /usr, then this defaults to /run, similar to the special cases for /var and /etc built into Meson. This is correct for typical modern Linux distributions implementing FHS 3.0. This is intentionally not consistent with Autotools and CMake: if distributions are transitioning to a different way to build dbus, then that's a good time to re-evaluate their build options. Otherwise, this defaults to LOCALSTATEDIR/run, consistent with Autotools and CMake. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Propagate some comments from Autotools build into MesonSimon McVittie2022-07-131-1/+14
| | | | | | | Comments like these represent hard-won knowledge which we should not discard. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Make the DBUS_MACHINE_UUID_FILE correctly absoluteSimon McVittie2022-07-131-1/+1
| | | | | | get_option('localstatedir') might be relative. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Resolve localstatedir, sysconfdir relative to prefixSimon McVittie2022-07-131-4/+8
| | | | | | | | | | | | If the prefix is something like /opt/dbus, then --localstatedir=var should result in using /opt/dbus/var, and so on. However, if configured with --localstatedir=/var, then the prefix is ignored. Meson special-cases these to default to /var and /etc (respectively), as absolute paths, if the prefix is /usr; so distribution builds will typically still end up using /var and /etc. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Require yelp-build for ducktype docs, not Doxygen docsSimon McVittie2022-07-131-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>