Merge branch 'socket-set-33337'
[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 if HAVE_LINUX_EPOLL
115 DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
116 endif
117
118 dbusinclude_HEADERS=                            \
119         dbus.h                                  \
120         dbus-address.h                          \
121         dbus-bus.h                              \
122         dbus-connection.h                       \
123         dbus-errors.h                           \
124         dbus-macros.h                           \
125         dbus-memory.h                           \
126         dbus-message.h                          \
127         dbus-misc.h                             \
128         dbus-pending-call.h                     \
129         dbus-protocol.h                         \
130         dbus-server.h                           \
131         dbus-shared.h                           \
132         dbus-signature.h                        \
133         dbus-threads.h                          \
134         dbus-types.h
135
136
137 nodist_dbusarchinclude_HEADERS=                 \
138         dbus-arch-deps.h
139
140 ### source code that goes in the installed client library
141 ### and is specific to library functionality
142 DBUS_LIB_SOURCES=                               \
143         dbus-address.c                          \
144         dbus-auth.c                             \
145         dbus-auth.h                             \
146         dbus-bus.c                              \
147         dbus-connection.c                       \
148         dbus-connection-internal.h              \
149         dbus-credentials.c                      \
150         dbus-credentials.h                      \
151         dbus-errors.c                           \
152         dbus-keyring.c                          \
153         dbus-keyring.h                          \
154         dbus-marshal-header.c                   \
155         dbus-marshal-header.h                   \
156         dbus-marshal-byteswap.c                 \
157         dbus-marshal-byteswap.h                 \
158         dbus-marshal-recursive.c                \
159         dbus-marshal-recursive.h                \
160         dbus-marshal-validate.c                 \
161         dbus-marshal-validate.h                 \
162         dbus-message.c                          \
163         dbus-message-internal.h                 \
164         dbus-message-private.h                  \
165         dbus-misc.c                             \
166         dbus-nonce.h                            \
167         dbus-nonce.c                            \
168         dbus-object-tree.c                      \
169         dbus-object-tree.h                      \
170         dbus-pending-call.c                     \
171         dbus-pending-call-internal.h            \
172         dbus-resources.c                        \
173         dbus-resources.h                        \
174         dbus-server.c                           \
175         dbus-server-debug-pipe.c                \
176         dbus-server-debug-pipe.h                \
177         dbus-server-protected.h                 \
178         dbus-server-socket.c                    \
179         dbus-server-socket.h                    \
180         $(DBUS_LIB_arch_sources)                \
181         dbus-sha.c                              \
182         dbus-sha.h                              \
183         dbus-signature.c                        \
184         dbus-timeout.c                          \
185         dbus-timeout.h                          \
186         dbus-threads-internal.h                 \
187         dbus-threads.c                          \
188         dbus-transport.c                        \
189         dbus-transport.h                        \
190         dbus-transport-protected.h              \
191         dbus-transport-socket.c                 \
192         dbus-transport-socket.h                 \
193         dbus-watch.c                            \
194         dbus-watch.h
195
196 ### source code that goes in the installed client library
197 ### AND is generic utility functionality used by the
198 ### daemon or test programs (all symbols in here should
199 ### be underscore-prefixed)
200 DBUS_SHARED_SOURCES=                            \
201         dbus-dataslot.c                         \
202         dbus-dataslot.h                         \
203         dbus-file.c                 \
204         dbus-file.h                 \
205         dbus-hash.c                             \
206         dbus-hash.h                             \
207         dbus-internals.c                        \
208         dbus-internals.h                        \
209         dbus-list.c                             \
210         dbus-list.h                             \
211         dbus-marshal-basic.c                    \
212         dbus-marshal-basic.h                    \
213         dbus-memory.c                           \
214         dbus-mempool.c                          \
215         dbus-mempool.h                          \
216         dbus-pipe.c                 \
217         dbus-pipe.h                 \
218         dbus-string.c                           \
219         dbus-string.h                           \
220         dbus-string-private.h                   \
221         $(DBUS_SHARED_arch_sources)             \
222         dbus-sysdeps.c                          \
223         dbus-sysdeps.h
224
225 ### source code that is generic utility functionality used
226 ### by the bus daemon or test apps, but is NOT included
227 ### in the D-Bus client library (all symbols in here
228 ### should be underscore-prefixed but don't really need
229 ### to be unless they move to DBUS_SHARED_SOURCES later)
230 DBUS_UTIL_SOURCES=                              \
231         dbus-auth-script.c                      \
232         dbus-auth-script.h                      \
233         dbus-auth-util.c                        \
234         dbus-credentials-util.c                 \
235         dbus-mainloop.c                         \
236         dbus-mainloop.h                         \
237         dbus-marshal-byteswap-util.c            \
238         dbus-marshal-recursive-util.c           \
239         dbus-marshal-validate-util.c            \
240         dbus-message-factory.c                  \
241         dbus-message-factory.h                  \
242         dbus-message-util.c                     \
243         dbus-shell.c                            \
244         dbus-shell.h                            \
245         $(DBUS_UTIL_arch_sources)               \
246         dbus-socket-set.h                       \
247         dbus-socket-set.c                       \
248         dbus-socket-set-poll.c                  \
249         dbus-spawn.h                            \
250         dbus-string-util.c                      \
251         dbus-sysdeps-util.c                     \
252         dbus-test.c                             \
253         dbus-test.h
254
255 libdbus_1_la_SOURCES=                           \
256         $(DBUS_LIB_SOURCES)                     \
257         $(DBUS_SHARED_SOURCES)
258
259 libdbus_internal_la_SOURCES=                    \
260         $(DBUS_LIB_SOURCES)                     \
261         $(DBUS_SHARED_SOURCES)                  \
262         $(DBUS_UTIL_SOURCES)
263
264 BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
265 EXTRA_DIST=dbus-arch-deps.h.in
266
267 ## this library is the same as libdbus, but exports all the symbols
268 ## and is only used for static linking within the dbus package.
269 noinst_LTLIBRARIES=libdbus-internal.la
270
271 libdbus_1_la_CPPFLAGS = \
272         $(AM_CPPFLAGS) \
273         -Ddbus_1_EXPORTS \
274         $(NULL)
275 libdbus_1_la_LIBADD= $(LIBDBUS_LIBS)
276 libdbus_1_la_LDFLAGS = \
277         $(AM_LDFLAGS) \
278         $(export_symbols) \
279         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
280         -no-undefined \
281         $(NULL)
282
283 libdbus_internal_la_CPPFLAGS = \
284         $(AM_CPPFLAGS) \
285         -DDBUS_STATIC_BUILD \
286         $(NULL)
287 libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS)
288
289 noinst_PROGRAMS =
290
291 if DBUS_BUILD_TESTS
292 # We can't actually run this til we've reached test/
293 noinst_PROGRAMS += dbus-test
294 endif
295
296 dbus_test_SOURCES=                              \
297         dbus-test-main.c
298
299 dbus_test_LDADD = libdbus-internal.la
300
301 ## mop up the gcov files
302 clean-local:
303         /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
304
305 update-systemd:
306         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
307         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h