[daemon-dev][lib-fix] Start of daemon with kdbus and fix in match rules in libdbus
[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         kdbus-d.c                                       \
80         kdbus-d.h                                       \       
81         policy.c                                \
82         policy.h                                \
83         selinux.h                               \
84         selinux.c                               \
85         services.c                              \
86         services.h                              \
87         signals.c                               \
88         signals.h                               \
89         stats.c                                 \
90         stats.h                                 \
91         test.c                                  \
92         test.h                                  \
93         utils.c                                 \
94         utils.h                                 \
95         $(XML_SOURCES)
96
97 dbus_daemon_SOURCES=                            \
98         $(BUS_SOURCES)                          \
99         main.c
100
101 dbus_daemon_LDADD=                                      \
102         $(top_builddir)/dbus/libdbus-internal.la        \
103         $(EFENCE)                                       \
104         $(DBUS_BUS_LIBS)
105
106 LAUNCH_HELPER_SOURCES=                          \
107         $(XML_SOURCES)                          \
108         config-parser-common.c                  \
109         config-parser-common.h                  \
110         config-parser-trivial.c                 \
111         config-parser-trivial.h                 \
112         desktop-file.c                          \
113         desktop-file.h                          \
114         utils.c                                 \
115         utils.h                                 \
116         activation-exit-codes.h                 \
117         activation-helper.h                     \
118         activation-helper.c
119
120 ## This is the installed launch helper with the setuid checks
121 dbus_daemon_launch_helper_SOURCES=              \
122         activation-helper-bin.c                 \
123         $(LAUNCH_HELPER_SOURCES)
124
125 dbus_daemon_launch_helper_LDADD=                \
126         $(top_builddir)/dbus/libdbus-internal.la \
127         $(DBUS_LAUNCHER_LIBS)
128
129 ## we build another binary so we can do the launch testing without root privs.
130 ## DO NOT INSTALL THIS FILE
131 dbus_daemon_launch_helper_test_SOURCES=         \
132         activation-helper-bin.c                 \
133         $(LAUNCH_HELPER_SOURCES)
134
135 dbus_daemon_launch_helper_test_LDADD=           \
136         $(top_builddir)/dbus/libdbus-internal.la \
137         $(DBUS_LAUNCHER_LIBS)
138
139 dbus_daemon_launch_helper_test_CPPFLAGS = \
140         $(AM_CPPFLAGS) \
141         -DACTIVATION_LAUNCHER_TEST
142
143 ## we build yet another binary so we can do the OOM tests
144 ## DO NOT INSTALL THIS FILE
145 bus_test_launch_helper_SOURCES=         \
146         test-launch-helper.c            \
147         $(LAUNCH_HELPER_SOURCES)
148
149 bus_test_launch_helper_LDADD=           \
150         $(top_builddir)/dbus/libdbus-internal.la \
151         $(DBUS_LAUNCHER_LIBS)
152
153 bus_test_launch_helper_CPPFLAGS = \
154         $(AM_CPPFLAGS) \
155         -DACTIVATION_LAUNCHER_TEST      \
156         -DACTIVATION_LAUNCHER_DO_OOM
157
158 noinst_PROGRAMS =
159 dbus_daemon_exec_PROGRAMS = dbus-daemon
160 if DBUS_UNIX
161 libexec_PROGRAMS = dbus-daemon-launch-helper
162 endif DBUS_UNIX
163
164 ## Note that TESTS has special meaning (stuff to use in make check).
165 ## We don't actually want to run any of these tests until test/ has been
166 ## compiled, so we don't put them in TESTS here; we run them in test/
167 ## instead.
168
169 if DBUS_ENABLE_EMBEDDED_TESTS
170 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build
171 ## even when not doing "make check"
172
173 # run as a test by test/Makefile.am
174 noinst_PROGRAMS += bus-test bus-test-system
175
176 if DBUS_UNIX
177 # run as a test by test/Makefile.am
178 noinst_PROGRAMS += bus-test-launch-helper
179 # this is used by the tests but is not,itself, a test
180 noinst_PROGRAMS += dbus-daemon-launch-helper-test
181 endif DBUS_UNIX
182
183 endif DBUS_ENABLE_EMBEDDED_TESTS
184
185 bus_test_system_SOURCES=                        \
186         $(XML_SOURCES)                          \
187         config-parser-common.c                  \
188         config-parser-common.h                  \
189         config-parser-trivial.c                 \
190         config-parser-trivial.h                 \
191         utils.c                                 \
192         utils.h                                 \
193         test-system.c
194
195 bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
196
197 bus_test_SOURCES=                               \
198         $(BUS_SOURCES)                          \
199         test-main.c
200
201 bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
202
203 ## mop up the gcov files
204 clean-local:
205         /bin/rm *.bb *.bbg *.da *.gcov || true
206
207 install-data-hook:
208         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
209         $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
210         $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
211         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
212         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
213 if HAVE_SYSTEMD
214 # Install dbus.socket as default implementation of a D-Bus stack.
215 # Deliberately not using $(LN_S) here: ln -fs is not universally portable,
216 # but neither is systemd, so it's OK to assume here that ln complies with SUS.
217         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
218         ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
219 # Unconditionally enable D-Bus on systemd installations
220         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
221         ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
222         $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
223         ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
224 endif
225
226 if DBUS_UNIX
227 install-exec-hook:
228         if test `id -u` -eq 0; then \
229                 chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
230                 chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
231         else \
232                 echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
233                 echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
234         fi
235 endif
236
237 #### Init scripts fun
238 SCRIPT_IN_FILES=messagebus.in \
239                 messagebus-config.in \
240                 rc.messagebus.in
241
242 ## Red Hat start
243 if DBUS_INIT_SCRIPTS_RED_HAT
244
245 initddir=$(sysconfdir)/rc.d/init.d
246
247 initd_SCRIPTS=  \
248         messagebus
249
250 endif
251  ## Red Hat end
252
253 ## Slackware start
254 if DBUS_INIT_SCRIPTS_SLACKWARE
255
256 initddir=$(sysconfdir)/rc.d/
257
258 initd_SCRIPTS=  \
259         rc.messagebus
260
261 endif
262 ## Slackware end
263
264 ## Cygwin start
265 if DBUS_INIT_SCRIPTS_CYGWIN
266
267 bin_SCRIPTS=    \
268         messagebus-config
269
270 endif
271 ## Cygwin end
272
273 if HAVE_SYSTEMD
274 SCRIPT_IN_FILES += \
275         dbus.service.in \
276         dbus.socket.in
277
278 systemdsystemunit_DATA = \
279         dbus.service \
280         dbus.socket
281 endif
282
283 #### Extra dist
284
285 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)