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