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