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