Commit graph

6429 commits

Author SHA1 Message Date
Alex Richardson
d35554c111 cmake: Only add warning flags if the compiler supports them
I am compiling for FreeBSD where the compiler is Clang and doesn't accept
all the GCC warning flags. This breaks the -Werror build:
```
error: unknown warning option '-Wduplicated-branches' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wduplicated-cond' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wjump-misses-init' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wrestrict' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option]
```

With this change we use check_{c,cxx}_compiler_flag to check if the flag
is supported before adding it. In the future this will allow adding
clang-specific warning flags to the list of warnings as well since they
will be ignored for GCC.
2022-03-29 12:21:46 +00:00
Simon McVittie
0a22950288 Merge branch 'bug834725' into 'master'
sysdeps-unix: check fd before calling _dbus_fd_set_close_on_exec()

See merge request dbus/dbus!285
2022-03-29 12:19:58 +00:00
Mike Gilbert
769a0462be sysdeps-unix: check fd before calling _dbus_fd_set_close_on_exec()
If /proc/self/oom_score_adj does not exist, fd will invalid (-1).
Attempting to set the CLOEXEC flag will obviously fail, and we lose the
original errno value from open().

Bug: https://bugs.gentoo.org/834725
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2022-03-29 11:52:32 +00:00
Ralf Habacker
b56cad123c Merge branch 'cross-compile-session-socket' into 'master'
cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling

See merge request dbus/dbus!279
2022-03-29 11:49:56 +00:00
Alex Richardson
e827309976 cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling
Inferring it from the environment is not correct, since the host system
could have a different temporary directory defined. Instead of guessing
based on the host, require the user to pass an explicit directory when
cross-compiling. This is helpful for me since I am cross-compiling for
FreeBSD from macOS and on my host TMPDIR is set to
/var/folders/<random characters>/T/ instead of the expected /tmp.
2022-03-29 11:40:15 +00:00
Ralf Habacker
302f85d45d Merge branch 'fix-fetching-mingw-packages' into 'master'
tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes

Closes #388

See merge request dbus/dbus!286
2022-03-29 11:39:45 +00:00
Ralf Habacker
c6b35bc0f4 .gitignore: Ignore downloaded and installed mingw packages used on debian|ubuntu
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-29 10:30:51 +02:00
Ralf Habacker
c4d69fe95e tools/ci-install.sh: clean up the previously used installation prefix and the downloaded mingw packages
This is necessary to have a clean initial state when running the script
locally.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-29 10:29:18 +02:00
Ralf Habacker
99c1de5180 tools/ci-install.sh: Use partially qualified versions with mingw package names
Fixes dbus/dbus#388

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-29 10:29:18 +02:00
Ralf Habacker
a7fb199f22 tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes
Instead of having to specify an exact version that needs to be adjusted
with each repository update, it is now possible to specify package names
without version or partially qualified versions, which reduces the
frequency of necessary adjustments.

This is achieved by searching for the package names in a previously
downloaded list of available packages.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-29 10:29:18 +02:00
Ralf Habacker
2fb2491ad0 Merge branch 'cmake-fix-export-dynamic' into 'master'
cmake: Only pass -Wl,--export-dynamic when linking

See merge request dbus/dbus!278
2022-03-24 22:13:55 +00:00
Alex Richardson
c7f6d07252 cmake: Use -Wl,-export_dynamic when building for macOS
The macOS linker does not accept --export-dynamic, so use this
alternate spelling.
2022-03-24 22:00:06 +00:00
Alex Richardson
1a8fd7a382 cmake: Only pass -Wl,--export-dynamic when linking
Otherwise we get the following warnings when building .o files with Clang:
clang-13: warning: -Wl,--export-dynamic: 'linker' input unused [-Wunused-command-line-argument]

This is required to allow the -Werror build to pass on FreeBSD.
2022-03-24 22:00:06 +00:00
Ralf Habacker
8757c7d8d8 Merge branch 'cmake-unnecessary-include-dir' into 'master'
cmake: Drop an unnecessary include directory

See merge request dbus/dbus!282
2022-03-24 14:36:15 +00:00
Alex Richardson
be5da7305e cmake: Drop an unnecessary include directory
There should be no need to include the directory above the DBus sources,
if that is actually required users can always pass -I flags to CMake.
I noticed this because CLion started indexing all my cloned projects when
I opened DBus due to this include path.
2022-03-24 14:26:42 +00:00
Ralf Habacker
453905de32 Merge branch 'detect-backtrace-freebsd' into 'master'
cmake: Detect backtrace() support on platforms such as FreeBSD

See merge request dbus/dbus!281
2022-03-24 13:56:13 +00:00
Alex Richardson
3f5bdf0c2d cmake: Detect backtrace() support on platforms such as FreeBSD
On FreeBSD use of backtrace requires linking libexecinfo. The current
check_symbol_exists() will fail due to that missing library. Fortunately,
CMake ships with a FindBacktrace module (at least since 3.0) that can
be used to correctly handle platforms such as FreeBSD (and OpenBSD
according to the FindBacktrace source).
2022-03-24 13:41:19 +00:00
Ralf Habacker
1312fd5f81 Merge branch 'fix-freebsd-environ' into 'master'
Revert "Fix gcc compile error: redundant redeclaration of ‘environ’ [-Werror=redundant-decls]"

See merge request dbus/dbus!277
2022-03-24 13:40:44 +00:00
Alex Richardson
d4dbde9fc5 Revert "Fix gcc compile error: redundant redeclaration of ‘environ’ [-Werror=redundant-decls]"
Breaks the build on FreeBSD which doens't have an environ declaration.
The CMake check_symbol_exists call sets `HAVE_DECL_ENVIRON` to an empty
variable (which means if(DEFINED) suceeds). This normalization should not
be necessary as it will be handled correctly by `#cmakedefine01`. If not,
all the other HAVE_* defines would also be wrong.

This reverts commit e8b34b419e.
2022-03-19 14:50:31 +00:00
Ralf Habacker
25c0aff7e8 Merge branch 'issue-templates' into 'master'
Add bug and feature template for issue tracker

See merge request dbus/dbus!270
2022-03-18 07:47:10 +00:00
Ralf Habacker
46e8904e2b Add feature template 2022-03-18 08:36:35 +01:00
Ralf Habacker
ae0bc8462f Add bug template 2022-03-18 08:36:35 +01:00
Simon McVittie
4d6a568cce Merge branch 'memcmp' into 'master'
sysdeps: Implement _DBUS_DOUBLES_BITWISE_EQUAL with memcmp

See merge request dbus/dbus!274
2022-03-16 15:58:11 +00:00
Simon McVittie
e1273eb115 sysdeps: Implement _DBUS_DOUBLES_BITWISE_EQUAL with memcmp
memcmp is the Standard C way to compare arbitrary regions of memory
bit-by-bit, so let's use it, instead of reinventing it in a way that
violates Standard C aliasing rules.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-16 14:54:55 +00:00
Ralf Habacker
251bb0be7f tools/ci-build.sh: Define and use variable builddir
Reviewed-by: Simon McVittie <smcv@collabora.com>
2022-03-16 14:19:32 +00:00
Ralf Habacker
721b5429c3 .gitignore: Add sub directory ci-build*
Reviewed-by: Simon McVittie <smcv@collabora.com>
2022-03-16 14:18:18 +00:00
Simon McVittie
65fc23b4f7 Merge branch 'ci-job-names' into 'master'
CI: Adjust job names

See merge request dbus/dbus!262
2022-03-16 14:03:22 +00:00
Ralf Habacker
c692921781 CI: Adjust job names
Job names now provide more information about platform, build environment,
system and configuration, which makes it easier to read.

The names for the build environments has been shorted to commonly known
names e.g. 'mingw64' for 'x86_64-w64-mingw32'.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-09 07:38:24 +00:00
Ralf Habacker
0249d1f5a5 Merge branch 'fix-issue-381' into 'master'
cmake: Fix race condition on creating docbook based files

Closes #381

See merge request dbus/dbus!268
2022-03-08 15:07:13 +00:00
Ralf Habacker
f74fdf06ad cmake: Fix race condition on creating docbook based files
With the previous implementation, race conditions could arise because a
generated intermediate file was used by multiple targets.

To fix the mentioned problem, the macro 'generate_docbook_file' has been
integrated into a in a new macro 'add_docbook' to simplify the dependency
chain and make it easier to use.

When using an xml template with the 'TEMPLATE' parameter, a separate
intermediate xml file is used for each generated output file to avoid
overwriting each other, which was the main cause of the described problem.

Due to the adaptation of the calling conventions it was necessary to
introduce the parameter 'MAN_CATEGORY'.

Fixes #381

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-04 09:18:01 +00:00
Ralf Habacker
5c14cfbf0e Merge branch 'fix-issue-375-1' into 'master'
cmake: fix setting DBUS_*_CONFIG_FILE on non win32 platform

See merge request dbus/dbus!267
2022-03-04 07:26:15 +00:00
Ralf Habacker
6c21072a1e cmake: Set DBUS_*_CONFIG_FILE to be in datadir on Unix
The files were installed to the datadir (usually /usr/share) since
commit 70950325, but the macros used to implement dbus-daemon --system
and dbus-daemon --session still looked for them in the sysconfdir
(usually /etc).

Fixes: 70950325 "Adjust cmake build to match autoconf installation locations"
2022-03-04 08:14:44 +01:00
Ralf Habacker
a0040b9cef Merge branch 'fix-issue-375' into 'master'
cmake: setup variable WORDS_BIGENDIAN correctly

Closes #375

See merge request dbus/dbus!266
2022-03-03 11:45:09 +00:00
Ralf Habacker
d74fee2727 cmake: setup variable WORDS_BIGENDIAN correctly
Since version 3.0 cmake provides the macro test_big_endian for
that purpose.

fixes #375

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-02 14:35:54 +01:00
Ralf Habacker
9b426c7916 Add api doc to _dbus_platform_c|rmutex_new()
The documentation has been added to the header to avoid duplication as
these functions are implemented platform specific.

Cherry-picked from merge request dbus/dbus!243

Reviewed-by: @smcv

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-03-02 09:03:40 +01:00
Simon McVittie
20f623c79b Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-01 18:44:30 +00:00
Simon McVittie
e3cb728ee6 Merge branch 'configure_with-x_option' into 'master'
build: Fix logic for --with-x configure option

See merge request dbus/dbus!263
2022-03-01 18:28:06 +00:00
Lars Wendler
c71f013a64
Convert "if" calls to AS_IF macro for the block that handles X11 2022-03-01 19:02:22 +01:00
Lars Wendler
bf3cb42c6d
Add have_x11=no if --without-x was given to make later checks happy 2022-03-01 19:02:15 +01:00
Lars Wendler
17c88a8944
Emit an error when --with-x was given but no X11 libs were found 2022-03-01 19:01:17 +01:00
Lars Wendler
51e468d828
Move DBUS_X_* definitions into PKG_CHECK_MODULES block 2022-03-01 19:01:07 +01:00
Lars Wendler
99cc28e0eb
build: Treat --with-x[=yes] the same as --with-x=auto
Previously, --with-x would disable the check for X11 libraries, which
was not intended.
2022-03-01 18:59:00 +01:00
Simon McVittie
b6880eb675 Merge branch 'bus-inotify-error-handling' into 'master'
bus: Fix error handling for inotify_init()

See merge request dbus/dbus!235
2022-02-28 23:00:58 +00:00
Simon McVittie
25e22b2540 bus: Show the errno if inotify cannot be initialized
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 22:50:26 +00:00
Simon McVittie
7e61e0b53b bus: Correct check for inotify_init() failure
fd 0 is a valid fd - although if we are using stdin as our inotify fd,
something is weird somewhere.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 22:50:26 +00:00
Simon McVittie
f0df311466 Revert "spec: Go back to v0.38"
This reverts commit 428f60e8b2.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 18:20:17 +00:00
Simon McVittie
d0cdd94a3e Post-release version bump for 1.15.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 18:20:08 +00:00
Simon McVittie
6fd1509ba3 Prepare v1.14.0
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/350
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:43:32 +00:00
Simon McVittie
428f60e8b2 spec: Go back to v0.38
Nothing changed in v0.39 yet, and it would be confusing to have the
version uploaded alongside dbus 1.14.0 say "not yet finalized".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:23:39 +00:00
Simon McVittie
fce6a676d9 Revert "Disable MSVC CI by default for now"
This reverts commit 254b17977e.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:22:35 +00:00