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