Define dbus_1_EXPORTS when appropriate.
[platform/upstream/dbus.git] / dbus / Makefile.am
1
2 configdir=$(sysconfdir)/dbus-1
3
4 INCLUDES=-I$(top_builddir) -I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) @PIC_CFLAGS@ -DDBUS_COMPILATION        \
5         -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\"             \
6         -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\"                        \
7         -DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\"
8
9 dbusincludedir=$(includedir)/dbus-1.0/dbus
10 dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
11
12 lib_LTLIBRARIES=libdbus-1.la
13
14 #
15 # Deal with W32 .def and version-info.rc stuff
16 #
17 if DBUS_WIN
18
19 built_sources_sys = dbus-1.def dbus-convenience.def
20
21 # Note that -P suppresses line markers.
22 PREPROCESS = $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -P
23 dbus-1.def: $(srcdir)/dbus-1.def.pre
24         $(PREPROCESS) - < $< > $@
25
26 dbus-convenience.def: $(srcdir)/dbus-convenience.def.pre
27         $(PREPROCESS) - < $< > $@
28
29 SUFFIXES = rc pre
30
31 .rc.o:
32         $(WINDRES) $< -o $@
33
34 dbus_res = versioninfo.o
35 dbus_res_ldflag = -Wl,$(dbus_res)
36 no_undefined = -no-undefined
37
38
39 ### FIXME use the .def.in files depending on the current config 
40 ### or combine them in a single .def file as done in the cmake build
41 export_symbols = -export-symbols dbus-1.def
42 export_symbols_convenience = -export-symbols dbus-convenience.def
43
44 install-def-file:
45         test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
46         $(INSTALL) dbus-1.def $(DESTDIR)$(libdir)/dbus-1.def
47
48 uninstall-def-file:
49         -rm $(DESTDIR)$(libdir)/dbus-1.def
50
51 libdbus_1_la_DEPENDENCIES = $(dbus_res) dbus-1.def
52 intllibs =
53
54 else
55 built_sources_sys =
56 dbus_res =
57 dbus_res_ldflag =
58 no_undefined =
59 ## don't export symbols that start with "_" (we use this
60 ## convention for internal symbols)
61 export_symbols = -export-symbols-regex "^[^_].*"
62 export_symbols_convenience =
63 install-def-file:
64 uninstall-def-file:
65
66 intllibs = @LTLIBINTL@
67
68 endif
69
70
71 #
72 # Platform-dependent sources:
73 #
74 if DBUS_WIN
75 DBUS_LIB_arch_sources =                         \
76         dbus-server-win.c                       \
77         dbus-server-win.h
78
79 DBUS_SHARED_arch_sources =                      \
80         dbus-file-win.c                         \
81         dbus-pipe-win.c                         \
82         dbus-sockets-win.h                      \
83         dbus-sysdeps-win.c                      \
84         dbus-sysdeps-win.h                      \
85         dbus-sysdeps-thread-win.c               \
86         dbus-transport-win.c                    \
87         dbus-transport-win.h
88
89 DBUS_UTIL_arch_sources =                        \
90         dbus-sysdeps-util-win.c                 \
91         dbus-spawn-win.c
92 else
93 DBUS_LIB_arch_sources =                         \
94         dbus-uuidgen.c                          \
95         dbus-uuidgen.h                          \
96         dbus-server-unix.c                      \
97         dbus-server-unix.h
98
99 DBUS_SHARED_arch_sources =                      \
100         dbus-file-unix.c                        \
101         dbus-pipe-unix.c                        \
102         dbus-sysdeps-unix.c                     \
103         dbus-sysdeps-unix.h                     \
104         dbus-sysdeps-pthread.c                  \
105         dbus-transport-unix.c                   \
106         dbus-transport-unix.h                   \
107         dbus-userdb.c                           \
108         dbus-userdb.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 dbusinclude_HEADERS=                            \
117         dbus.h                                  \
118         dbus-address.h                          \
119         dbus-bus.h                              \
120         dbus-connection.h                       \
121         dbus-errors.h                           \
122         dbus-macros.h                           \
123         dbus-memory.h                           \
124         dbus-message.h                          \
125         dbus-misc.h                             \
126         dbus-pending-call.h                     \
127         dbus-protocol.h                         \
128         dbus-server.h                           \
129         dbus-shared.h                           \
130         dbus-signature.h                        \
131         dbus-threads.h                          \
132         dbus-types.h
133
134
135 dbusarchinclude_HEADERS=                        \
136         dbus-arch-deps.h
137
138 ### source code that goes in the installed client library
139 ### and is specific to library functionality
140 DBUS_LIB_SOURCES=                               \
141         dbus-address.c                          \
142         dbus-auth.c                             \
143         dbus-auth.h                             \
144         dbus-auth-script.c                      \
145         dbus-auth-script.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 ##      dbus-md5.c                              \
197 ##      dbus-md5.h                              \
198
199 ### source code that goes in the installed client library
200 ### AND is generic utility functionality used by the 
201 ### daemon or test programs (all symbols in here should 
202 ### be underscore-prefixed)
203 DBUS_SHARED_SOURCES=                            \
204         dbus-dataslot.c                         \
205         dbus-dataslot.h                         \
206         dbus-file.c                 \
207         dbus-file.h                 \
208         dbus-hash.c                             \
209         dbus-hash.h                             \
210         dbus-internals.c                        \
211         dbus-internals.h                        \
212         dbus-list.c                             \
213         dbus-list.h                             \
214         dbus-marshal-basic.c                    \
215         dbus-marshal-basic.h                    \
216         dbus-memory.c                           \
217         dbus-mempool.c                          \
218         dbus-mempool.h                          \
219         dbus-pipe.c                 \
220         dbus-pipe.h                 \
221         dbus-string.c                           \
222         dbus-string.h                           \
223         dbus-string-private.h                   \
224         $(DBUS_SHARED_arch_sources)             \
225         dbus-sysdeps.c                          \
226         dbus-sysdeps.h
227
228 ### source code that is generic utility functionality used
229 ### by the bus daemon or test apps, but is NOT included
230 ### in the D-Bus client library (all symbols in here 
231 ### should be underscore-prefixed but don't really need 
232 ### to be unless they move to DBUS_SHARED_SOURCES later)
233 DBUS_UTIL_SOURCES=                              \
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-spawn.h                            \
248         dbus-string-util.c                      \
249         dbus-sysdeps-util.c                     \
250         dbus-test.c                             \
251         dbus-test.h
252
253 libdbus_1_la_SOURCES=                           \
254         $(DBUS_LIB_SOURCES)                     \
255         $(DBUS_SHARED_SOURCES)
256
257 libdbus_convenience_la_SOURCES=                 \
258         $(DBUS_LIB_SOURCES)                     \
259         $(DBUS_SHARED_SOURCES)                  \
260         $(DBUS_UTIL_SOURCES)
261
262 symbol_defs = dbus-1.def.pre dbus-1-symbols.def.in dbus-1-testsymbols.def.in dbus-1-verbosesymbols.def.in \
263         dbus-convenience.def.pre dbus-internal-symbols.def.in dbus-internal-testsymbols.def.in
264
265 BUILT_SOURCES=$(dbusarchinclude_HEADERS) $(built_sources_sys)
266 EXTRA_DIST=dbus-arch-deps.h.in $(symbol_defs)
267
268
269 ## this library is the same as libdbus, but exports all the symbols
270 ## and is only used for static linking within the dbus package.
271 noinst_LTLIBRARIES=libdbus-convenience.la
272
273 libdbus_1_la_CPPFLAGS= -Ddbus_1_EXPORTS
274 libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS)
275 libdbus_1_la_LDFLAGS= $(export_symbols) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined @R_DYNAMIC_LDFLAG@ @PIC_LDFLAGS@
276
277 libdbus_convenience_la_LIBADD=$(DBUS_CLIENT_LIBS)
278 libdbus_convenience_la_LDFLAGS=$(export_symbols_convenience) @R_DYNAMIC_LDFLAG@
279
280 ## note that TESTS has special meaning (stuff to use in make check)
281 ## so if adding tests not to be run in make check, don't add them to 
282 ## TESTS
283 if DBUS_BUILD_TESTS
284 TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus
285 TESTS=dbus-test
286 else
287 TESTS=
288 endif
289
290 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build 
291 ## even when not doing "make check"
292 noinst_PROGRAMS=$(TESTS)
293
294 dbus_test_SOURCES=                              \
295         dbus-test-main.c
296
297 dbus_test_LDADD=libdbus-convenience.la $(DBUS_TEST_LIBS)
298 dbus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
299
300 install-data-local: install-def-file
301
302 uninstall-local: uninstall-def-file
303
304 ## mop up the gcov files
305 clean-local:
306         /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true