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