Add support for inserting (a subset of) Valgrind client requests
[platform/upstream/dbus.git] / dbus / Makefile.am
1
2 configdir=$(sysconfdir)/dbus-1
3
4 AM_CPPFLAGS = \
5         -I$(top_builddir) \
6         -I$(top_srcdir) \
7         $(SYSTEMD_CFLAGS) \
8         $(VALGRIND_CFLAGS) \
9         -DDBUS_COMPILATION \
10         -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
11         -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
12         -DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
13         $(NULL)
14
15 # if assertions are enabled, improve backtraces
16 AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
17
18 dbusincludedir=$(includedir)/dbus-1.0/dbus
19 dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
20
21 lib_LTLIBRARIES=libdbus-1.la
22
23 #
24 # Deal with W32 .def and version-info.rc stuff
25 #
26 if DBUS_WIN
27
28 SUFFIXES = rc
29
30 .rc.o:
31         $(WINDRES) $< -o $@
32
33 dbus_res = versioninfo.o
34 dbus_res_ldflag = -Wl,$(dbus_res)
35 no_undefined = -no-undefined
36 export_symbols =
37
38 libdbus_1_la_DEPENDENCIES = $(dbus_res)
39 intllibs =
40
41 else
42 dbus_res =
43 dbus_res_ldflag =
44 no_undefined =
45 ## don't export symbols that start with "_" (we use this
46 ## convention for internal symbols)
47 export_symbols = -export-symbols-regex "^[^_].*"
48
49 intllibs = @LTLIBINTL@
50
51 endif
52
53
54 #
55 # Platform-dependent sources:
56 #
57 if DBUS_WIN
58 DBUS_LIB_arch_sources =                         \
59         dbus-server-win.c                       \
60         dbus-server-win.h
61
62 if DBUS_WINCE
63 wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
64 else
65 wince_source =
66 endif
67
68 DBUS_SHARED_arch_sources =                      \
69         $(wince_source)                         \
70         dbus-file-win.c                         \
71         dbus-pipe-win.c                         \
72         dbus-sockets-win.h                      \
73         dbus-sysdeps-win.c                      \
74         dbus-sysdeps-win.h                      \
75         dbus-sysdeps-thread-win.c               \
76         dbus-transport-win.c                    \
77         dbus-transport-win.h
78
79 DBUS_UTIL_arch_sources =                        \
80         dbus-sysdeps-util-win.c                 \
81         dbus-spawn-win.c
82 else
83
84 if DBUS_ENABLE_LAUNCHD
85 launchd_source = dbus-server-launchd.h dbus-server-launchd.c
86 else
87 launchd_source =
88 endif
89
90 DBUS_LIB_arch_sources =                         \
91         dbus-uuidgen.c                          \
92         dbus-uuidgen.h                          \
93         dbus-server-unix.c                      \
94         dbus-server-unix.h
95
96 DBUS_SHARED_arch_sources =                      \
97         $(launchd_source)                       \
98         dbus-file-unix.c                        \
99         dbus-pipe-unix.c                        \
100         dbus-sysdeps-unix.c                     \
101         dbus-sysdeps-unix.h                     \
102         dbus-sysdeps-pthread.c                  \
103         dbus-transport-unix.c                   \
104         dbus-transport-unix.h                   \
105         dbus-userdb.c                           \
106         dbus-userdb.h                           \
107         sd-daemon.c                             \
108         sd-daemon.h
109
110 DBUS_UTIL_arch_sources =                        \
111         dbus-sysdeps-util-unix.c                \
112         dbus-userdb-util.c                      \
113         dbus-spawn.c
114 endif
115
116 if HAVE_LINUX_EPOLL
117 DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
118 endif
119
120 dbusinclude_HEADERS=                            \
121         dbus.h                                  \
122         dbus-address.h                          \
123         dbus-bus.h                              \
124         dbus-connection.h                       \
125         dbus-errors.h                           \
126         dbus-macros.h                           \
127         dbus-memory.h                           \
128         dbus-message.h                          \
129         dbus-misc.h                             \
130         dbus-pending-call.h                     \
131         dbus-protocol.h                         \
132         dbus-server.h                           \
133         dbus-shared.h                           \
134         dbus-signature.h                        \
135         dbus-threads.h                          \
136         dbus-types.h
137
138
139 nodist_dbusarchinclude_HEADERS=                 \
140         dbus-arch-deps.h
141
142 ### source code that goes in the installed client library
143 ### and is specific to library functionality
144 DBUS_LIB_SOURCES=                               \
145         dbus-address.c                          \
146         dbus-auth.c                             \
147         dbus-auth.h                             \
148         dbus-bus.c                              \
149         dbus-connection.c                       \
150         dbus-connection-internal.h              \
151         dbus-credentials.c                      \
152         dbus-credentials.h                      \
153         dbus-errors.c                           \
154         dbus-keyring.c                          \
155         dbus-keyring.h                          \
156         dbus-marshal-header.c                   \
157         dbus-marshal-header.h                   \
158         dbus-marshal-byteswap.c                 \
159         dbus-marshal-byteswap.h                 \
160         dbus-marshal-recursive.c                \
161         dbus-marshal-recursive.h                \
162         dbus-marshal-validate.c                 \
163         dbus-marshal-validate.h                 \
164         dbus-message.c                          \
165         dbus-message-internal.h                 \
166         dbus-message-private.h                  \
167         dbus-misc.c                             \
168         dbus-nonce.h                            \
169         dbus-nonce.c                            \
170         dbus-object-tree.c                      \
171         dbus-object-tree.h                      \
172         dbus-pending-call.c                     \
173         dbus-pending-call-internal.h            \
174         dbus-resources.c                        \
175         dbus-resources.h                        \
176         dbus-server.c                           \
177         dbus-server-debug-pipe.c                \
178         dbus-server-debug-pipe.h                \
179         dbus-server-protected.h                 \
180         dbus-server-socket.c                    \
181         dbus-server-socket.h                    \
182         $(DBUS_LIB_arch_sources)                \
183         dbus-sha.c                              \
184         dbus-sha.h                              \
185         dbus-signature.c                        \
186         dbus-timeout.c                          \
187         dbus-timeout.h                          \
188         dbus-threads-internal.h                 \
189         dbus-threads.c                          \
190         dbus-transport.c                        \
191         dbus-transport.h                        \
192         dbus-transport-protected.h              \
193         dbus-transport-socket.c                 \
194         dbus-transport-socket.h                 \
195         dbus-watch.c                            \
196         dbus-watch.h
197
198 ### source code that goes in the installed client library
199 ### AND is generic utility functionality used by the
200 ### daemon or test programs (all symbols in here should
201 ### be underscore-prefixed)
202 DBUS_SHARED_SOURCES=                            \
203         dbus-dataslot.c                         \
204         dbus-dataslot.h                         \
205         dbus-file.c                 \
206         dbus-file.h                 \
207         dbus-hash.c                             \
208         dbus-hash.h                             \
209         dbus-internals.c                        \
210         dbus-internals.h                        \
211         dbus-list.c                             \
212         dbus-list.h                             \
213         dbus-marshal-basic.c                    \
214         dbus-marshal-basic.h                    \
215         dbus-memory.c                           \
216         dbus-mempool.c                          \
217         dbus-mempool.h                          \
218         dbus-pipe.c                 \
219         dbus-pipe.h                 \
220         dbus-string.c                           \
221         dbus-string.h                           \
222         dbus-string-private.h                   \
223         $(DBUS_SHARED_arch_sources)             \
224         dbus-sysdeps.c                          \
225         dbus-sysdeps.h                          \
226         dbus-valgrind-internal.h
227
228 ### source code that is generic utility functionality used
229 ### by the bus daemon or test apps, but is NOT included
230 ### in the D-Bus client library (all symbols in here
231 ### should be underscore-prefixed but don't really need
232 ### to be unless they move to DBUS_SHARED_SOURCES later)
233 DBUS_UTIL_SOURCES=                              \
234         dbus-auth-script.c                      \
235         dbus-auth-script.h                      \
236         dbus-auth-util.c                        \
237         dbus-credentials-util.c                 \
238         dbus-mainloop.c                         \
239         dbus-mainloop.h                         \
240         dbus-marshal-byteswap-util.c            \
241         dbus-marshal-recursive-util.c           \
242         dbus-marshal-validate-util.c            \
243         dbus-message-factory.c                  \
244         dbus-message-factory.h                  \
245         dbus-message-util.c                     \
246         dbus-shell.c                            \
247         dbus-shell.h                            \
248         $(DBUS_UTIL_arch_sources)               \
249         dbus-socket-set.h                       \
250         dbus-socket-set.c                       \
251         dbus-socket-set-poll.c                  \
252         dbus-spawn.h                            \
253         dbus-string-util.c                      \
254         dbus-sysdeps-util.c                     \
255         dbus-test.c                             \
256         dbus-test.h
257
258 libdbus_1_la_SOURCES=                           \
259         $(DBUS_LIB_SOURCES)                     \
260         $(DBUS_SHARED_SOURCES)
261
262 libdbus_internal_la_SOURCES=                    \
263         $(DBUS_LIB_SOURCES)                     \
264         $(DBUS_SHARED_SOURCES)                  \
265         $(DBUS_UTIL_SOURCES)
266
267 BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
268 EXTRA_DIST=dbus-arch-deps.h.in
269
270 ## this library is the same as libdbus, but exports all the symbols
271 ## and is only used for static linking within the dbus package.
272 noinst_LTLIBRARIES=libdbus-internal.la
273
274 libdbus_1_la_CPPFLAGS = \
275         $(AM_CPPFLAGS) \
276         -Ddbus_1_EXPORTS \
277         $(NULL)
278 libdbus_1_la_LIBADD= $(LIBDBUS_LIBS)
279 libdbus_1_la_LDFLAGS = \
280         $(AM_LDFLAGS) \
281         $(export_symbols) \
282         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
283         -no-undefined \
284         $(NULL)
285
286 libdbus_internal_la_CPPFLAGS = \
287         $(AM_CPPFLAGS) \
288         -DDBUS_STATIC_BUILD \
289         $(NULL)
290 libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
291
292 noinst_PROGRAMS =
293
294 if DBUS_BUILD_TESTS
295 # We can't actually run this til we've reached test/
296 noinst_PROGRAMS += dbus-test
297 endif
298
299 dbus_test_SOURCES=                              \
300         dbus-test-main.c
301
302 dbus_test_LDADD = libdbus-internal.la
303
304 ## mop up the gcov files
305 clean-local:
306         /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
307
308 update-systemd:
309         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
310         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h