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