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