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