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