Commit graph

494 commits

Author SHA1 Message Date
Simon McVittie
9d60676ae0 Disable the Containers interface
We've had a request for a 1.14.x stable-branch, but the Containers
interface is only partially implemented, not yet described in the
D-Bus Specification, and not ready to be part of our API guarantees.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-12-10 16:48:51 +00:00
Ralf Habacker
667b153dce cmake: Make gcc builds use similar compiler warnings to autotools
Fixes #356
2021-12-10 13:36:28 +00:00
Ralf Habacker
a2ccc6773b cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS variable from related cmake target
This allows cmake to construct the resulting (relocatable) runtime paths.

Fixes dbus/dbus#346
2021-11-18 13:51:11 +00:00
Julien Schueller
1b8d560649 CMake: Set IMPORTED_IMPLIB property
Setting this property allows to fix linking to the imported target with MinGW.
This only happens when dbus is built using autotools, when cmake is used the DBus1Config.variant.in
is configured and the automatically exported target by cmake is fine.
2021-11-18 13:20:08 +00:00
Ralf Habacker
85e6d21a0f Add HAVE_DECL_xxx checks to cmake build system
The first two definitions are required to fix cmake build error when
compiling with -Werror=undef on Windows.

The last one completes having HAVE_DECL_xxx definitions.
2021-11-18 12:52:22 +00:00
Ralf Habacker
6b41f053c5 Move _GNU_SOURCE to config.h.cmake 2021-11-18 12:52:22 +00:00
Ralf Habacker
541dbab907 Move DBUS_BUILT_R_DYNAMIC to config.h.cmake 2021-11-18 12:52:22 +00:00
Ralf Habacker
946515aead Fix definition of HAVE_SOCKLEN_T 2021-11-18 12:52:22 +00:00
Ralf Habacker
0590b44a8f Add configure checks for vsnprintf and vasprintf to cmake build system 2021-11-18 12:52:22 +00:00
Ralf Habacker
dccd628321 cmake: fix find_package related naming mismatch for GLIB2
The package name passed to `find_package_handle_standard_args` (GLIB2) did not match the name of the calling package (GLib2).
This could lead to problems when calling code that expects `find_package`.
result variables (e.g. `_FOUND`) expect to follow a certain pattern.

fixes #319
2021-11-10 00:49:21 +01:00
Ralf Habacker
b76c46437e cmake: add macro add_unit_test to reduce code duplication
This macro is now used by add_test_executable and
add_session_test_executable.
2020-11-26 10:46:34 +01:00
Ralf Habacker
5b1870a5bd cmake: make support for traditional activation optional
Traditional activation is enabled/disabled with the cmake configure
parameter -DENABLE_TRADITIONAL_ACTIVATION, which is enabled by default.

This was added to the Autotools build system as part of dbus/dbus!107
but until now was not possible to disable when building with CMake.
2020-09-23 17:21:40 +02:00
Ralf Habacker
97bdefd4e2 cmake: Add support for systemd integration on Linux operating systems
Previously, only the Autotools build system could do this. This commit
includes most of the same features as in the Autotools build, although
not the user-session semantics, which will be added separately.

Systemd support is controlled by the cmake variable ENABLE_SYSTEMD, which can
have the values OFF, ON and AUTO, the latter enabling support by default if
the required libraries are available.

With WITH_SYSTEMD_SYSTEMUNITDIR a custom installation location can be specified.
If it is not specified, the related install path is determined from the installed
systemd package, if present.
2020-06-10 18:13:47 +00:00
Ralf Habacker
eb6d4a1439 cmake: Add macro check_auto_option() as an addition to add_auto_option()
check_auto_option() checks the values given to an auto-option and prints
a fatal error in case of invalid combinations.
2020-06-10 18:13:47 +00:00
Ralf Habacker
ab404c5ffb cmake: rename tristateoption() to add_auto_option() and make signature compatible to option() 2020-06-10 18:13:47 +00:00
Ralf Habacker
08eb885be6 cmake: build and install dbus-cleanup-sockets on non Windows platforms 2020-04-29 17:35:08 +00:00
Ralf Habacker
6e8d75834e Add support to generate the api documentation in Qt help format
Qt help files are used by Qt Creator and KDevelop, for example, to support
the development of Qt-based applications and libraries.

Generating api documentation in Qt help format is controlled by two
user specific options named --enable-qt-help and --with-qchdir (autotools)
and -DENABLE_QT_HELP and -DINSTALL_QCH_DIR (cmake).
2020-04-29 15:23:23 +00:00
Simon McVittie
1530582863 Merge branch 'fix-poll-header' into 'master'
sysdeps: use POSIX poll.h instead of sys/poll.h

See merge request dbus/dbus!148
2020-04-01 14:17:52 +00:00
Natanael Copa
3509748dce sysdeps: use POSIX poll.h instead of sys/poll.h
POSIX.1-2001 and POSIX.1-2008 specifies include <poll.h> so use that
rather than the non-standard/legacy include <sys/poll.h>.

This fixes the following warnings when building with musl libc:

    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 18:17:22 +01:00
Natanael Copa
6d92e8e983 _dbus_generate_random_bytes: use getrandom(2)
Use getrandom(2) and fall back to /dev/urandom if it is missing or if it
fails some any reason.

This solves problem where dbus-uuidgen is called from a chroot which
lacks /dev/urandom.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 16:56:59 +01:00
Simon McVittie
3197cbe369 Merge branch 'non-posix-getwpnam-r' into 'master'
Remove support for non-POSIX getpwnam_r()

See merge request dbus/dbus!11
2020-03-11 14:15:29 +00:00
Ralf Habacker
8ffe1b949c cmake: Fix attribute 'original file name' in shared dbus library file info on Windows
The 'original filename' attribute was 'libdbus-1-3}.dll' with an unwanted
curly bracket.
2020-02-19 23:41:08 +01:00
Clemens Lang
3525cc045d cmake: Avoid overwriting PKG_CONFIG_PATH env var
The CMake config file installed by DBus will run in the context of other
projects. Consequently, changing the value of the PKG_CONFIG_DIR,
PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR environment variables will affect
any further calls to pkg-config made by such projects, which can cause
problems.

A common case of this happening are pkg-config files installed in
usr/share/pkgconfig for .pc files that are architecture-independent, as
for example systemd does.

Avoid clobbering the environment variables by saving and restoring their
values. Note that for some of the variables, setting them to an empty
string is different from not setting them at all.

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
2019-03-14 11:07:49 +01:00
Ralf Habacker
904fa97a1b Remove obsolete parameter in end... cmake keywords 2019-01-24 09:07:27 +01:00
Ralf Habacker
81df96d103 Adjust indents of cmake build system files always to 4 spaces 2019-01-23 21:34:24 +01:00
Ralf Habacker
54800ede4e Remove obsolete parameter in end... cmake keywords 2019-01-23 21:34:24 +01:00
Ralf Habacker
382857a265 Remove spaces between cmake command and opening bracket 2019-01-23 21:34:24 +01:00
Ralf Habacker
592251948c Use lower case cmake keywords 2019-01-23 21:34:24 +01:00
Ralf Habacker
781afd86a3 Replace tabs by 4 spaces in cmake build system files 2019-01-23 21:34:24 +01:00
Ralf Habacker
58b3d6ff20 Remove trailing spaces in cmake related files 2019-01-23 21:34:24 +01:00
Ralf Habacker
a8e5e5c552 Add cmake macros add_executable_version_info and add_library_version_info
This helps to reduce duplicated code.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:58:27 +01:00
Ralf Habacker
d9fa5aee84 Generate documentation html index file from doc/index.html.in for autotools and cmake
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:57:57 +01:00
Ralf Habacker
3bf97922bd Move cmake related build system to top level
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:57:40 +01:00
Simon McVittie
cccb35dfef test: Move sysdeps tests here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:05 +00:00
Simon McVittie
b1cfd892fc test: Move string tests (most of dbus-string-util.c) here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:21:43 +00:00
Simon McVittie
8ead2011ac test: Move marshalling tests into test/
dbus-marshal-recursive-util.c contains utility functions used by the
other two, as well as tests. The others are purely test code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:21:16 +00:00
Simon McVittie
f1f5294276 test: Move dbus-message-factory and most of dbus-message-util into test/
As with previous moves, I've tried to extract the possible copyright
holders from the git history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:20:39 +00:00
Simon McVittie
9feeeaea9a test: Move auth, credentials tests from libdbus-internal into test/
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:20:22 +00:00
Simon McVittie
24a1f3406a test: Split slow parts of the former test-dbus into their own executables
This makes it easier for a developer to run just the fast parts while
debugging some issue reproduced by the faster tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:20:04 +00:00
Simon McVittie
b7f11c17d1 _dbus_test_main: Move to test-utils
Now that there is no code outside test/ that calls into this, we can
move it into test/, reducing the size of libdbus.

dbus-test-tap.[ch] still need to stay in dbus/ as long as there is
code in dbus/ or bus/ relying on them, and also need to be linked into
libdbus as long as there is other code in libdbus relying on them,
so they stay where they are for now. Similarly, dbus-tests.h lists
the tests that are still embedded in libdbus, and must stay where
it is for the moment.

With this move, various tests now need to be linked to the dbus-testutils
convenience library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:19:36 +00:00
Simon McVittie
e23bba929a test: Move dbus-daemon-launch-helper-test here, and rename
The -test suffix does not indicate that this is a test, but rather that
it is for tests (similar to the -unix and -win suffixes on modules like
dbus-sysdeps). This seems unnecessarily confusing, so rename it to end
with -for-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:18:46 +00:00
Simon McVittie
b28e0886ed test: Move libdbus embedded tests from dbus/ to test/
This groups them with the rest of the tests, and enables parts of
the test code to be unembedded from libdbus and moved to test/ too.

Rename the executable to test-misc-internals, not test-dbus. The name
test-dbus made some sense as "the executable that contains the code in
dbus/", but makes a lot less sense in test/: dbus is the name of the
entire project, so this test has no particular special claim to that
name. test-libdbus doesn't seem right either, because all the tests
exercise libdbus one way or another.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:18:18 +00:00
Simon McVittie
3b512610c0 test: Break out the slow parts of test-bus into their own executables
This makes it more convenient to re-run the rest of test-bus as
required when debugging.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:17:36 +00:00
Simon McVittie
a15839da9b test: Move dbus-daemon and d-d-launch-helper tests from bus/
This groups them with the other tests, and avoids having them influence
the test coverage stats in bus/.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:16:51 +00:00
Simon McVittie
037d19a328 Convert spawn test into a standalone test executable
This test is sufficiently well-separated that there's no real need
to embed it in libdbus. Move it into the test directory instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:15:16 +00:00
Simon McVittie
d7644b7d4f build: Compile most bus/ files into static libraries
This means we can share them between tests without having to compile
the same file repeatedly, and makes them easier to share between
directories when we move test executables into test/.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:14:29 +00:00
Ralf Habacker
7f9eb9cea8 Make sure ctest on Windows uses the currently built dbus library
The ctest application is usually not installed in the dbus build
directory. If an older dbus library is contained in this path, it will
be used instead of the currently built one, which can lead to runtime
errors (e.g.: c0000139) if the internal dbus API differs.
2019-01-10 20:19:04 +01:00
Ralf Habacker
4573c15ebb Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files
Because the implementation of DBusSocketSet already supports non-socket
pollables like pipes and inotify fd on Unix, DBusPollableSet is a better
name.
2019-01-09 15:20:19 +01:00
Ralf Habacker
fb799c6fd3 In cmake use variables provided from GNUInstallDirs consequently
This is required to support a custom installation layout, e.g. the
KDE binary factory.
2018-12-21 19:55:07 +01:00
Simon McVittie
6b71e92fd6 Merge branch 'test-main-boilerplate' into 'master'
Consolidate boilerplate from embedded tests' main()

See merge request dbus/dbus!73

Reviewed-by: Ralf Habacker
2018-12-20 13:27:42 +00:00