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