README
1 Sections in this file describe:
2 - introduction and overview
3 - low-level vs. high-level API
4 - version numbers
5 - options to the configure script
6 - ABI stability policy
7
8 Introduction
9 ===
10
11 D-Bus is a simple system for interprocess communication and coordination.
12
13 The "and coordination" part is important; D-Bus provides a bus daemon that does things like:
14 - notify applications when other apps exit
15 - start services on demand
16 - support single-instance applications
17
18 See http://www.freedesktop.org/software/dbus/ for lots of documentation,
19 mailing lists, etc.
20
21 See also the file HACKING for notes of interest to developers working on D-Bus.
22
23 If you're considering D-Bus for use in a project, you should be aware
24 that D-Bus was designed for a couple of specific use cases, a "system
25 bus" and a "desktop session bus." These are documented in more detail
26 in the D-Bus specification and FAQ available on the web site.
27
28 If your use-case isn't one of these, D-Bus may still be useful, but
29 only by accident; so you should evaluate carefully whether D-Bus makes
30 sense for your project.
31
32 Note: low-level API vs. high-level binding APIs
33 ===
34
35 A core concept of the D-Bus implementation is that "libdbus" is
36 intended to be a low-level API. Most programmers are intended to use
37 the bindings to GLib, Qt, Python, Mono, Java, or whatever. These
38 bindings have varying levels of completeness and are maintained as
39 separate projects from the main D-Bus package. The main D-Bus package
40 contains the low-level libdbus, the bus daemon, and a few command-line
41 tools such as dbus-launch.
42
43 If you use the low-level API directly, you're signing up for some
44 pain. Think of the low-level API as analogous to Xlib or GDI, and the
45 high-level API as analogous to Qt/GTK+/HTML.
46
47 Version numbers
48 ===
49
50 D-Bus uses the common "Linux kernel" versioning system, where
51 even-numbered minor versions are stable and odd-numbered minor
52 versions are development snapshots.
53
54 So for example, development snapshots: 1.1.1, 1.1.2, 1.1.3, 1.3.4
55 Stable versions: 1.0, 1.0.1, 1.0.2, 1.2.1, 1.2.3
56
57 All pre-1.0 versions were development snapshots.
58
59 Development snapshots make no ABI stability guarantees for new ABI
60 introduced since the last stable release. Development snapshots are
61 likely to have more bugs than stable releases, obviously.
62
63 Configuration
64 ===
65
66 dbus could be build by using autotools or cmake.
67
68 When using autotools the configure step is initiated by running ./configure
69 with or without additional configuration flags.
70
71 When using cmake the configure step is initiated by running the cmake
72 program with or without additional configuration flags.
73
74 Configuration flags
75 ===
76
77 When using autotools, run "./configure --help" to see the possible
78 configuration options and environment variables.
79
80 When using cmake, inspect README.cmake to see the possible
81 configuration options and environment variables.
82
83 API/ABI Policy
84 ===
85
86 Now that D-Bus has reached version 1.0, the objective is that all
87 applications dynamically linked to libdbus will continue working
88 indefinitely with the most recent system and session bus daemons.
89
90 - The protocol will never be broken again; any message bus should
91 work with any client forever. However, extensions are possible
92 where the protocol is extensible.
93
94 - If the library API is modified incompatibly, we will rename it
95 as in http://ometer.com/parallel.html - in other words,
96 it will always be possible to compile against and use the older
97 API, and apps will always get the API they expect.
98
99 Interfaces can and probably will be _added_. This means both new
100 functions and types in libdbus, and new methods exported to
101 applications by the bus daemon.
102
103 The above policy is intended to make D-Bus as API-stable as other
104 widely-used libraries (such as GTK+, Qt, Xlib, or your favorite
105 example). If you have questions or concerns they are very welcome on
106 the D-Bus mailing list.
107
108 NOTE ABOUT DEVELOPMENT SNAPSHOTS AND VERSIONING
109
110 Odd-numbered minor releases (1.1.x, 1.3.x, 2.1.x, etc. -
111 major.minor.micro) are devel snapshots for testing, and any new ABI
112 they introduce relative to the last stable version is subject to
113 change during the development cycle.
114
115 Any ABI found in a stable release, however, is frozen.
116
117 ABI will not be added in a stable series if we can help it. i.e. the
118 ABI of 1.2.0 and 1.2.5 you can expect to be the same, while the ABI of
119 1.4.x may add more stuff not found in 1.2.x.
120
121 NOTE ABOUT STATIC LINKING
122
123 We are not yet firmly freezing all runtime dependencies of the libdbus
124 library. For example, the library may read certain files as part of
125 its implementation, and these files may move around between versions.
126
127 As a result, we don't yet recommend statically linking to
128 libdbus. Also, reimplementations of the protocol from scratch might
129 have to work to stay in sync with how libdbus behaves.
130
131 To lock things down and declare static linking and reimplementation to
132 be safe, we'd like to see all the internal dependencies of libdbus
133 (for example, files read) well-documented in the specification, and
134 we'd like to have a high degree of confidence that these dependencies
135 are supportable over the long term and extensible where required.
136
137 NOTE ABOUT HIGH-LEVEL BINDINGS
138
139 Note that the high-level bindings are _separate projects_ from the
140 main D-Bus package, and have their own release cycles, levels of
141 maturity, and ABI stability policies. Please consult the documentation
142 for your binding.
143
144 Bootstrapping D-Bus on new platforms
145 ===
146
147 A full build of D-Bus, with all regression tests enabled and run, has some
148 dependencies which themselves depend on D-Bus, either for compilation or
149 for some of *their* regression tests: GLib, dbus-glib and dbus-python are
150 currently affected.
151
152 To avoid circular dependencies, when bootstrapping D-Bus for the first time
153 on a new OS or CPU architecture, you can either cross-compile some of
154 those components, or choose the build order and options carefully:
155
156 * build and install D-Bus without tests
157 - do not use the --enable-modular-tests=yes configure option
158 - do not use the --enable-tests=yes configure option
159 * build and install GLib, again without tests
160 * use those versions of libdbus and GLib to build and install dbus-glib
161 * ... and use those to install dbus-python
162 * rebuild libdbus; this time you can run all of the tests
163 * rebuild GLib; this time you can run all of the tests
164
README.cmake
1 This file describes how to compile dbus using the cmake build system
2
3 Requirements
4 ------------
5 - cmake version >= 2.4.4 see http://www.cmake.org
6 - installed libexpat see http://sourceforge.net/projects/expat/
7 unsupported RelWithDebInfo builds could be fetched
8 from http://sourceforge.net/projects/kde-windows/files/expat/
9
10 Building
11 --------
12
13 Win32 MinGW-w64|32
14 1. install mingw-w64 from http://sourceforge.net/projects/mingw-w64/
15 2. install cmake and libexpat
16 3. get dbus sources
17 4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
18 5. mkdir dbus-build
19 6. cd dbus-build
20 7. run
21 cmake -G "MinGW Makefiles" [<options, see below>] <dbus-src-root>/cmake
22 mingw32-make
23 mingw32-make install
24
25 Win32 Microsoft nmake
26 1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
27 2. install cmake and libexpat
28 3. get dbus sources
29 4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
30 5. mkdir dbus-build
31 6. cd dbus-build
32 7. run
33 cmake -G "NMake Makefiles" [<options, see below>] <dbus-src-root>/cmake
34 nmake
35 nmake install
36
37 Win32 Visual Studio 2010 Express IDE
38 1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
39 2. install cmake and libexpat
40 3. get dbus sources
41 4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
42 5. mkdir dbus-build
43 6. cd dbus-build
44 7. run
45 cmake -G "Visual Studio 10" [<options, see below>] <dbus-src-root>/cmake
46 8a. open IDE with
47 vcexpress dbus.sln
48 8b. for immediate build run
49 vcexpress dbus.sln /build
50
51 Win32 Visual Studio 2010 Professional IDE
52 1. install MSVC 2010 Professional Version
53 2. install cmake and libexpat
54 3. get dbus sources
55 4. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
56 5. mkdir dbus-build
57 6. cd dbus-build
58 7. run
59 cmake -G "Visual Studio 10" [<options, see below>] <dbus-src-root>/cmake
60 8a. open IDE with
61 devenv dbus.sln
62 8b. for immediate build run
63 devenv dbus.sln /build
64
65 Linux
66 1. install cmake and libexpat
67 2. get dbus sources
68 3. unpack dbus sources into a sub directory (referred as <dbus-src-root> later)
69 4. mkdir dbus-build
70 5. cd dbus-build
71 6. run
72 cmake -G "<for available targets, see cmake --help for a list>" [<options, see below>] <dbus-src-root>/cmake
73 make
74 make install
75
76 For other compilers see cmake --help in the Generators section
77
78 Configuration flags
79 -------------------
80
81 When using the cmake build system the dbus-specific configuration flags that can be given
82 to the cmake program are these (use -D<key>=<value> on command line). The listed values
83 are the defaults.
84
85 // Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
86 // CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
87 CMAKE_BUILD_TYPE:STRING=Debug
88
89 // Include path for 3rdparty packages
90 CMAKE_INCLUDE_PATH:PATH=
91
92 // Library path for 3rdparty packages
93 CMAKE_LIBRARY_PATH:PATH=
94
95 // Install path prefix, prepended onto install directories.
96 CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/dbus
97
98
99 // enable unit test code
100 DBUS_BUILD_TESTS:BOOL=ON
101
102 // The name of the dbus daemon executable
103 DBUS_DAEMON_NAME:STRING=dbus-daemon
104
105 // Disable assertion checking
106 DBUS_DISABLE_ASSERTS:BOOL=OFF
107
108 // Disable public API sanity checking
109 DBUS_DISABLE_CHECKS:BOOL=OFF
110
111 // enable -ansi -pedantic gcc flags
112 DBUS_ENABLE_ANSI:BOOL=OFF
113
114 // build DOXYGEN documentation (requires Doxygen)
115 DBUS_ENABLE_DOXYGEN_DOCS:BOOL=OFF
116
117 // enable bus daemon usage statistics
118 DBUS_ENABLE_STATS:BOOL=OFF
119
120 // support verbose debug mode
121 DBUS_ENABLE_VERBOSE_MODE:BOOL=ON
122
123 // build XML documentation (requires xmlto or meinproc4)
124 DBUS_ENABLE_XML_DOCS:BOOL=ON
125
126 // Some atomic integer implementation present
127 DBUS_HAVE_ATOMIC_INT:BOOL=OFF
128
129 // install required system libraries
130 DBUS_INSTALL_SYSTEM_LIBS:BOOL=OFF
131
132 // session bus default address
133 DBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp:
134
135 // system bus default address
136 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp:
137
138 // Use atomic integer implementation for 486
139 DBUS_USE_ATOMIC_INT_486:BOOL=OFF
140
141 // Use expat (== ON) or libxml2 (==OFF)
142 DBUS_USE_EXPAT:BOOL=ON
143
144 win32 only:
145 // enable win32 debug port for message output
146 DBUS_USE_OUTPUT_DEBUG_STRING:BOOL=OFF
147
148 gcc only:
149 // compile with coverage profiling instrumentation
150 DBUS_GCOV_ENABLED:BOOL=OFF
151
152 linux only:
153 // build with dnotify support
154 DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX:BOOL=ON
155
156 solaris only:
157 // enable console owner file
158 HAVE_CONSOLE_OWNER_FILE:BOOL=ON
159
160 // Directory to check for console ownership
161 DBUS_CONSOLE_OWNER_FILE:STRING=/dev/console
162
163 x11 only:
164 // Build with X11 auto launch support
165 DBUS_BUILD_X11:BOOL=ON
166
167
168 Note: The above mentioned options could be extracted after
169 configuring from the output of running "<maketool> help-options"
170 in the build directory. The related entries start with
171 CMAKE_ or DBUS_.
172
README.cygwin
README.launchd
1 Launchd[1,2] replaces init, inetd and cron on Mac OS X since 10.4 "Tiger".
2 dbus uses this service to provide a common session bus address for each user
3 and so deprecates the X11 enabled dbus-launcher.
4
5 [1] http://developer.apple.com/MacOsX/launchd.html
6 [2] http://launchd.macosforge.org/
7
8
9 Setup
10 ===
11
12 Configure with --enable-launchd and --without-x (X11 should not harm but it's
13 simply not necessary any more)
14 After installation, to prevent a reboot, load the dbus session starter into
15 launchd by executing:
16 $ launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
17
18 You can change the launch agent dir via configure, but it's not recommended.
19 Make sure to execute the above line as the actual user for which you want to
20 use a session bus since launchd manages its agents on a per user basis.
21
22
23 How it works
24 ===
25
26 Launchd allocates a socket and provides the unix path to it via the variable
27 DBUS_LAUNCHD_SESSION_BUS_SOCKET in launchd's environment. Every process
28 spawned by launchd (or dbus-daemon, if stared by launchd) can access it through
29 its own environment. Other processes can query launchd for it by executing:
30 $ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
31 However, this is normally done by the dbus client lib for you.
32
33 If launchd start dbus-daemon with a config file containing a "launchd:env=FOO"
34 address, as the default session config does with env=DBUS_LAUNCHD_SESSION_BUS_SOCKET,
35 the daemon will get the file descriptor from launchd and start listening on it.
36 The environment variable is used to get the actual socket path which is passed
37 to every service spawned by dbus-daemon as a result from autolaunch messages.
38 Please note that it's not possible to start dbus-daemon manually when using a
39 "launchd:" address. Only child processes of launchd can access the above
40 mentioned file descriptor!
41
42 To create custom buses just set up an other launch agent. As a quick start copy
43 /Library/LaunchAgents/org.freedesktop.dbus-session.plist, change the label
44 to i.e. "org.freedesktop.dbus-foo" and change the SecureSocketWithKey value,
45 i.e. to "DBUS_LAUNCHD_FOO_BUS_SOCKET". This environment variable has to be set
46 in the config file for your new bus in the <listen> element (see session.config).
47 Then edit your /Library/LaunchAgents/org.freedesktop.dbus-foo.plist to start
48 dbus-daemon with "--config-file=/opt/local/etc/dbus-1/foo.conf" instead of
49 "--session". Now load the new plist onto launchd as described in the setup
50 section of this document.
51 Executing "launchctl export" should now give you two sockets, one in
52 DBUS_LAUNCHD_SESSION_BUS_SOCKET and the new DBUS_LAUNCHD_FOO_BUS_SOCKET.
53 To connect to this new bus use "launchd:env=DBUS_LAUNCHD_FOO_BUS_SOCKET".
54
55 Since Mac OS X 10.5 "Leopard" you can also configure launchd to start
56 dbus-daemon on demand as soon as some process connects to the socket. Since
57 it's broken on 10.4 this feature is disabled per default. Look at
58 /Library/LaunchAgents/org.freedesktop.dbus-session.plist to change it.
59
60 On the client side, the envvar DBUS_SESSION_BUS_ADDRESS can be normally used
61 but if it's not set, launchd is queried for the session bus socket.
62
README.win
1 -----------------------------------------
2 Windows port of the freedesktop.org D-Bus
3 -----------------------------------------
4
5 Features and completeness
6 -------------------------
7 The windows port of dbus provides the dbus-1 library and mostly
8 applications which are already available on unix. These applications
9 are: dbus-daemon, dbus-launch, dbus-monitor and dbus-send.
10 DBus comes with a test suite which is used on unix to guarantate
11 production quality and this test suite runs mostly. There are some
12 test not running yet and there is help needed to get them running.
13
14 Supported compilers
15 -------------------
16 On windows Microsoft Visual Studio 2010 (Express and professional variants)
17 and mingw-w64|32 are known to work.
18
19 Building
20 --------
21 DBus can be built on windows using automake or cmake. See the
22 file README for more information.
23 Special cmake build instructions can be found in cmake/readme-cmake.txt
24
25
26 windbus and dbus4win Ports
27 --------------------------
28 The Windows ports from the windbus and dbus4win projects has been merged
29 into the freedesktop git master branch, as applicable. The spec has been
30 updated with windows specific stuff.
31
32
33 Tests
34 -----
35 - dbus library check
36 bin\dbus-test.exe <build-root>\test\data
37
38 - bus daemon check
39 bin\bus-test.exe <build-root>\test\data
40
41 - check available names
42 bin\test_names.exe
43
44 - check if dbus-daemon is accessable
45 bin\dbus-send.exe --session --type=method_call --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames method return sender=org.freedesktop.DBus -> dest=:1.4 array [ string "org.freedesktop.DBus"string ":1.4"]
46
47 - start session dbus-daemon
48 either by running
49 bin\dbus-launch
50 or
51 start bin\dbus-daemon --session
52
53 Before running these commands you may execute
54 set DBUS_VERBOSE=1
55 for getting debug infos
56
57
58 - call function registerd in dbus
59 bin\dbus-send.exe --dest=org.freedesktop.DBus --print-reply --type=method_call / org.freedesktop.DBus.StartServiceByName string:org.freedesktop.DBus.TestSuiteEchoService uint32:455 method return sender=org.freedesktop.DBus -> dest=:1.8 uint32 2
60
61 note: When building with the Visual C++ IDE the *.exe files are in
62 the bin/Debug and bin/Release folder, not in the bin folder.
63
64
65 FAQ
66 ---
67
68 - How far is WinDBus from being usable for production ?
69
70 dbus comes with a test suite which is used on unix to guarantate
71 production quality and this test suite runs mostly. There are some
72 test not running and we need help to get them running.
73 In the pratice I and some other people are using dbus for at least more
74 than four years in conjunction with kde on windows without any problems.
75
76 - On UNIX D-Bus uses UNIX sockets to communicate (correct me if I'm wrong).
77 What is used on Windows ?
78
79 tcp sockets, there are some efforts to get named pipe running, but some
80 design problems of the win32 api, we are not able to solve without
81 bigger changes to the dbus code base let us stop this effort.
82
83 - Do you have any clue if dbus-win32 can run in a Windows CE environment?
84
85 dbus has been ported to wince, see README.wince for more information
86
87 - Do you know if the C++ binding made by OpenWengo will be easily portable to Windows?
88
89 The OpenWengo dbus-c++ binding has been ported to windows see in WinDBus svn
90 (http://sf.net/projects/windbus)
91 The related test applicationa are running well.
92
93
94 TODO
95 ----
96
97 Oktober 2010:
98
99 - the code wrapped with DBUS_WIN_FIXME should be inspected if it required for windows
100
101 - create a dbus setup installer
102
103 - implement system bus and system bus service starter
104 see http://windbus.svn.sourceforge.net/viewvc/windbus/trunk/bus/bus-service-win.c
105 for a starting point
106
107 - implement a real login session bus
108 The scope parameter of the autolaunch meta protocol could be extended to support user
109 specific session busses (like already done with the amarok bundled dbus which use a
110 shared memory area named "DBusDaemonAddressInfo:<username>".
111 Also the dbus installer should start a session bus on user login.
112
README.wince
1 DBus Daemon for Windows CE/Windows Mobile 6.5
2 =============================================
3
4 Bugs in upstream for any window version:
5 * MoveFileExA < 0 result check bug
6 * double dbus_free somewhere I forgot where (check in -ugly)
7 * alignment issue
8 * CreateProcess process information handle leak
9 * _dbus_getsid NULL vs INVALID_HANDLE_VALUE
10 * win_account_to_sid
11
12 Customisation
13 =============
14
15 1) At installation, the following registry value should be set to the
16 installation directory of the dbus installation (the directory
17 containing the bin, etc, share folders):
18
19 HKLM\Software\freedesktop\DBus\Install Directory
20
21 2) Instead of environment variable DBUS_VERBOSE, use
22 HKLM\Software\freedesktop\DBus\Verbose
23
24 2) The keyring directory is MYDOCUMENTS\dbus-keyrings, not
25 HOMEPATH\.dbus-keyrings.
26
27
28 Compilation
29 ===========
30
31 ./configure --host=arm-mingw32ce CPPFLAGS=-I/path/to/expat/include LDFLAGS=-L/path/to/expat/lib
32
33 A recent version of libtool is required, with this change:
34
35 2010-02-28 Pierre Ossman <ossman (a] ossman.lkpg.cendio.se> (tiny change)
36 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de>
37
38 Fix deplibs check fallback for 64-bit Windows and Windows CE.
39 * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
40 'pe-arm-wince' and 'pe-x86-64'. Add note about consistency with ...
41 * libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
42 pattern here; sync pattern from the former.
43 * tests/deplibs-mingw.at (deplibs without file command): New
44 file, new test.
45 * Makefile.am (TESTSUITE_AT): Update.
46 * NEWS: Update.
47
48
49 MB vs WCHAR
50 ===========
51
52 Windows CE only supports the Unicode interface, while DBus Daemon uses
53 the Multi-Byte interface on Windows by default. The glue code does
54 not support multibyte in all cases. In particular, the _mbsrchr
55 function is not correctly implemented. It could be correctly
56 implemented, or dbus daemon could use the wchar interface more
57 consistently on all Windows targets. For now, the Windows CE port
58 will only work for filesystems without some weird characters in file
59 names. Is this a serious limitation?
60
61
62 Known Issues
63 ============
64
65 Autolaunch is broken so far.
66
67 Environment variables are faked. Some are punted to the registry, but
68 in any case they can not be used reliably for IPC.
69
70 The test suite is not ported yet.
71
72 dbus-pipe.c:
73 * Uses libc file descriptors. Needed for --print-address and
74 --print-pid which probably don't work yet.
75
76 dbus-sysdeps-win.c:
77 * Backtraces have been disabled.
78 * _dbus_fd_set_close_on_exec Not supported, maybe we should disable
79 the warning.
80 * SearchPathA: Uses HKLM\\Software\\freedesktop\\DBus\\Install Directory
81 to locate binaries.
82