[daemon-fix] Fixed sending daemon match rules for kdbus broadcasts
[platform/upstream/dbus.git] / bus / Makefile.am
1 configdir=$(sysconfdir)/dbus-1
2 dbus_daemon_execdir = $(DBUS_DAEMONDIR)
3
4 DBUS_BUS_LIBS = \
5         $(XML_LIBS) \
6         $(SELINUX_LIBS) \
7         $(THREAD_LIBS) \
8         $(ADT_LIBS) \
9         $(NETWORK_libs) \
10         $(NULL)
11
12 DBUS_LAUNCHER_LIBS = \
13         $(XML_LIBS) \
14         $(THREAD_LIBS) \
15         $(NETWORK_libs) \
16         $(NULL)
17
18 AM_CPPFLAGS = \
19         -I$(top_srcdir) \
20         $(XML_CFLAGS) \
21         -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
22         -DDBUS_COMPILATION \
23         -DDBUS_STATIC_BUILD \
24         $(NULL)
25
26 # if assertions are enabled, improve backtraces
27 AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
28
29 EFENCE=
30
31 CONFIG_IN_FILES=                                \
32         session.conf.in                         \
33         system.conf.in                          \
34         org.freedesktop.dbus-session.plist.in
35
36 config_DATA=                                    \
37         session.conf                            \
38         system.conf
39
40 if DBUS_ENABLE_LAUNCHD
41 agentdir=$(LAUNCHD_AGENT_DIR)
42 agent_DATA=org.freedesktop.dbus-session.plist
43 endif
44
45 XML_SOURCES=config-loader-expat.c
46
47 if DBUS_BUS_ENABLE_KQUEUE
48 DIR_WATCH_SOURCE=dir-watch-kqueue.c
49 else
50 if DBUS_BUS_ENABLE_INOTIFY
51 DIR_WATCH_SOURCE=dir-watch-inotify.c
52 else
53 DIR_WATCH_SOURCE=dir-watch-default.c
54 endif
55 endif
56
57 BUS_SOURCES=                                    \
58         activation.c                            \
59         activation.h                            \
60         activation-exit-codes.h                 \
61         bus.c                                   \
62         bus.h                                   \
63         config-parser.c                         \
64         config-parser.h                         \
65         config-parser-common.c                  \
66         config-parser-common.h                  \
67         connection.c                            \
68         connection.h                            \
69         desktop-file.c                          \
70         desktop-file.h                          \
71         $(DIR_WATCH_SOURCE)                     \
72         dir-watch.h                             \
73         dispatch.c                              \
74         dispatch.h                              \
75         driver.c                                \
76         driver.h                                \
77         expirelist.c                            \
78         expirelist.h                            \
79         policy.c                                \
80         policy.h                                \
81         selinux.h                               \
82         selinux.c                               \
83         services.c                              \
84         services.h                              \
85         signals.c                               \
86         signals.h                               \
87         stats.c                                 \
88         stats.h                                 \
89         test.c                                  \
90         test.h                                  \
91         utils.c                                 \
92         utils.h                                 \
93         $(XML_SOURCES)
94
95 if ENABLE_KDBUS_TRANSPORT
96 BUS_SOURCES+=                           \
97         kdbus-d.c                               \
98         kdbus-d.h
99 endif
100
101
102 dbus_daemon_SOURCES=                            \
103         $(BUS_SOURCES)                          \
104         main.c
105
106 dbus_daemon_LDADD=                                      \
107         $(top_builddir)/dbus/libdbus-internal.la        \
108         $(EFENCE)                                       \
109         $(DBUS_BUS_LIBS)
110
111 LAUNCH_HELPER_SOURCES=                          \
112         $(XML_SOURCES)                          \
113         config-parser-common.c                  \
114         config-parser-common.h                  \
115         config-parser-trivial.c                 \
116         config-parser-trivial.h                 \
117         desktop-file.c                          \
118         desktop-file.h                          \
119         utils.c                                 \
120         utils.h                                 \
121         activation-exit-codes.h                 \
122         activation-helper.h                     \
123         activation-helper.c
124
125 ## This is the installed launch helper with the setuid checks
126 dbus_daemon_launch_helper_SOURCES=              \
127         activation-helper-bin.c                 \
128         $(LAUNCH_HELPER_SOURCES)
129
130 dbus_daemon_launch_helper_LDADD=                \
131         $(top_builddir)/dbus/libdbus-internal.la \
132         $(DBUS_LAUNCHER_LIBS)
133
134 ## we build another binary so we can do the launch testing without root privs.
135 ## DO NOT INSTALL THIS FILE
136 dbus_daemon_launch_helper_test_SOURCES=         \
137         activation-helper-bin.c                 \
138         $(LAUNCH_HELPER_SOURCES)
139
140 dbus_daemon_launch_helper_test_LDADD=           \
141         $(top_builddir)/dbus/libdbus-internal.la \
142         $(DBUS_LAUNCHER_LIBS)
143
144 dbus_daemon_launch_helper_test_CPPFLAGS = \
145         $(AM_CPPFLAGS) \
146         -DACTIVATION_LAUNCHER_TEST
147
148 ## we build yet another binary so we can do the OOM tests
149 ## DO NOT INSTALL THIS FILE
150 bus_test_launch_helper_SOURCES=         \
151         test-launch-helper.c            \
152         $(LAUNCH_HELPER_SOURCES)
153
154 bus_test_launch_helper_LDADD=           \
155         $(top_builddir)/dbus/libdbus-internal.la \
156         $(DBUS_LAUNCHER_LIBS)
157
158 bus_test_launch_helper_CPPFLAGS = \
159         $(AM_CPPFLAGS) \
160         -DACTIVATION_LAUNCHER_TEST      \
161         -DACTIVATION_LAUNCHER_DO_OOM
162
163 noinst_PROGRAMS =
164 dbus_daemon_exec_PROGRAMS = dbus-daemon
165 if DBUS_UNIX
166 libexec_PROGRAMS = dbus-daemon-launch-helper
167 endif DBUS_UNIX
168
169 ## Note that TESTS has special meaning (stuff to use in make check).
170 ## We don't actually want to run any of these tests until test/ has been
171 ## compiled, so we don't put them in TESTS here; we run them in test/
172 ## instead.
173
174 if DBUS_ENABLE_EMBEDDED_TESTS
175 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build
176 ## even when not doing "make check"
177
178 # run as a test by test/Makefile.am
179 noinst_PROGRAMS += bus-test bus-test-system
180
181 if DBUS_UNIX
182 # run as a test by test/Makefile.am
183 noinst_PROGRAMS += bus-test-launch-helper
184 # this is used by the tests but is not,itself, a test
185 noinst_PROGRAMS += dbus-daemon-launch-helper-test
186 endif DBUS_UNIX
187
188 endif DBUS_ENABLE_EMBEDDED_TESTS
189
190 bus_test_system_SOURCES=                        \
191         $(XML_SOURCES)                          \
192         config-parser-common.c                  \
193         config-parser-common.h                  \
194         config-parser-trivial.c                 \
195         config-parser-trivial.h                 \
196         utils.c                                 \
197         utils.h                                 \
198         test-system.c
199
200 bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
201
202 bus_test_SOURCES=                               \
203         $(BUS_SOURCES)                          \
204         test-main.c
205
206 bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
207
208 ## mop up the gcov files
209 clean-local:
210         /bin/rm *.bb *.bbg *.da *.gcov || true
211
212 install-data-hook:
213         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
214         $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
215         $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
216         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
217         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
218 if HAVE_SYSTEMD
219 # Install dbus.socket as default implementation of a D-Bus stack.
220 # Deliberately not using $(LN_S) here: ln -fs is not universally portable,
221 # but neither is systemd, so it's OK to assume here that ln complies with SUS.
222         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
223         ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
224 # Unconditionally enable D-Bus on systemd installations
225         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
226         ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
227         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
228         ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
229 endif
230
231 if DBUS_UNIX
232 install-exec-hook:
233         if test `id -u` -eq 0; then \
234                 chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
235                 chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
236         else \
237                 echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
238                 echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
239         fi
240 endif
241
242 #### Init scripts fun
243 SCRIPT_IN_FILES=messagebus.in \
244                 messagebus-config.in \
245                 rc.messagebus.in
246
247 ## Red Hat start
248 if DBUS_INIT_SCRIPTS_RED_HAT
249
250 initddir=$(sysconfdir)/rc.d/init.d
251
252 initd_SCRIPTS=  \
253         messagebus
254
255 endif
256  ## Red Hat end
257
258 ## Slackware start
259 if DBUS_INIT_SCRIPTS_SLACKWARE
260
261 initddir=$(sysconfdir)/rc.d/
262
263 initd_SCRIPTS=  \
264         rc.messagebus
265
266 endif
267 ## Slackware end
268
269 ## Cygwin start
270 if DBUS_INIT_SCRIPTS_CYGWIN
271
272 bin_SCRIPTS=    \
273         messagebus-config
274
275 endif
276 ## Cygwin end
277
278 if HAVE_SYSTEMD
279 SCRIPT_IN_FILES += \
280         dbus.service.in \
281         dbus.socket.in
282
283 systemdsystemunit_DATA = \
284         dbus.service \
285         dbus.socket
286 endif
287
288 #### Extra dist
289
290 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)