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