Debian Codegraph @

INSTALL

raw
1 DBus Installation
2 =================
3
4 Quick start
5 ===========
6
7 This branch of dbus can be built by using Meson or CMake.
8 The Meson build system is the recommended build system since version 1.16.0,
9 except when building on Windows, for which CMake is recommended (this
10 recommendation might change to Meson in future).
11
12 Meson only supports out-of-tree builds, and must be passed a directory to put
13 built and generated sources into. We'll call that directory "build" here. It's
14 recommended to create a separate build directory for each configuration you
15 might want to use.
16
17 Basic configuration is done with:
18
19 ``` sh
20 meson build/
21 ```
22
23 This will create the build directory. If any dependencies are missing, you can
24 install them, or try to remove the dependency with a Meson configuration option
25 (see below).
26
27 Older versions of dbus required Autotools or CMake, with Autotools
28 recommended for Unix systems and CMake recommended for Windows systems.
29
30 Configuration flags
31 ===================
32
33 When using Meson, to review the options which Meson chose, run:
34
35 ``` sh
36 meson configure build/
37 ```
38
39 With additional arguments meson configure can be used to change options for a
40 previously configured build directory. All options passed to this command are in
41 the form `-D "option"="value"`. For example:
42
43 ``` sh
44 meson configure build/ -Dprefix=/tmp/install
45 ```
46
47 See `meson_options.txt` for details of dbus-specific options, and
48 <https://mesonbuild.com/Builtin-options.html> for details of generic
49 Meson options.
50
51 When using CMake, inspect README.cmake to see the possible
52 configuration options and environment variables.
53
54 Building
55 ========
56
57 To build with meson, here is a quick guide:
58
59 ``` sh
60 cd dbus
61 meson setup build/ && cd build/
62 meson compile
63 meson test
64 ```
65
66 Full build instructions can be found on mesonbuild website:
67 https://mesonbuild.com/Running-Meson.html
68
69 Building with CMake
70 -------------------
71
72 The CMake equivalent is:
73
74 ``` sh
75 cd <dbus-src-root>
76 cmake -G <makefile-generator-name> [-D<option>] -B dbus-build-dir
77 cmake --build <dbus-build-dir>
78 cmake --build <dbus-build-dir> -t check
79 ```
80
81 The installation of the build with CMake is performed with:
82
83 ``` sh
84 cmake --build <dbus-build-dir> -t install [DESTDIR=<install-dir>]
85 ```
86
87 When using makefile generator `-t install/fast` can also be used,
88 which prevents rebuilding.
89
90 CMake will automatically determine whether to build some features
91 based on what tools and/or libraries are installed on the host system.
92 The default build behaviour can be overridden using the
93 -DENABLE_<XXX> arguments to cmake.
94 A typical scenario in which it is desirable to override automatic
95 detection, is during packaging of binary builds, where a predictable
96 dependancy chain is required. For more details on cmake installation,
97 consult http://www.cmake.org/cmake/help/help.html.
98
99 Building as a subproject
100 ========================
101
102 libdbus can be built as a Meson subproject, allowing larger projects that
103 require it to default to a system copy if available but fall back to a
104 vendored or downloaded copy if necessary. When doing this, it is usually
105 best to disable the shared library, dbus-daemon, tools and tests, leaving
106 only a static library: please see test/use-as-subproject/meson.build for
107 sample code and suggested build options.
108
109 External software dependencies
110 ==============================
111
112 Usually required:
113
114 - expat (not required if dbus-daemon is not built)
115
116 Optional:
117
118 - libapparmor (for AppArmor LSM integration on Linux)
119 - libaudit (for AppArmor/SELinux audit logging on Linux)
120 - libcap-ng (for capabilities management on Linux)
121 - libselinux (for SELinux LSM integration on Linux)
122 - libsystemd (for logging, socket activation and session tracking on Linux)
123 - libX11 (for X11 autolaunching on Unix platforms)
124 - doxygen (for API documentation)
125 - xsltproc (for Spec & other XML documentation)
126 - Docbook XSL stylesheets (for Spec & other XML documentation)
127 - ducktype (for additional documentation)
128 - qhelpgenerator (for additional documentation)
129 - yelp-build (for additional documentation)
130 - GLib (for improved test coverage)
131 - Python 3 (for improved test coverage)