Makefile.am 7.54 KB
Newer Older
1

2
dbusdatadir=$(datadir)/dbus-1
3

Simon McVittie's avatar
Simon McVittie committed
4
AM_CPPFLAGS = \
5
	$(CODE_COVERAGE_CPPFLAGS) \
Simon McVittie's avatar
Simon McVittie committed
6 7
	-I$(top_builddir) \
	-I$(top_srcdir) \
8
	$(DBUS_STATIC_BUILD_CPPFLAGS) \
9
	$(SYSTEMD_CFLAGS) \
10
	$(VALGRIND_CFLAGS) \
11 12
	-DDBUS_COMPILATION \
	-DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
13 14
	-DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \
	-DDBUS_SESSION_CONFIG_FILE=\""$(dbusdatadir)/session.conf"\" \
15
	-DDBUS_RUNSTATEDIR=\""$(runstatedir)"\" \
Simon McVittie's avatar
Simon McVittie committed
16
	$(NULL)
17

18 19 20
AM_CFLAGS = \
	$(CODE_COVERAGE_CFLAGS) \
	$(NULL)
21 22 23 24 25 26 27 28 29 30 31

if HAVE_VISIBILITY
if !DBUS_WIN
AM_CFLAGS += $(CFLAG_VISIBILITY)
AM_CPPFLAGS += \
	-DDBUS_EXPORT='__attribute__((__visibility__("default")))' \
	-DDBUS_PRIVATE_EXPORT='__attribute__((__visibility__("default")))' \
	$(NULL)
endif
endif

32 33 34
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@

35
dbusincludedir=$(includedir)/dbus-1.0/dbus
36
dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
37 38 39

lib_LTLIBRARIES=libdbus-1.la

40 41 42
# Initialize to empty so that we can append later
nodist_libdbus_1_la_SOURCES =

43 44 45 46
#
# Deal with W32 .def and version-info.rc stuff
#
if DBUS_WIN
47

48
SUFFIXES = .rc
49

50 51
.rc.lo:
	$(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $< -o $@
52 53 54 55 56 57 58 59 60 61

endif


#
# Platform-dependent sources:
#
if DBUS_WIN
DBUS_LIB_arch_sources = 			\
	dbus-server-win.c 			\
62
	dbus-server-win.h			\
63 64 65 66
	$(NULL)

nodist_libdbus_1_la_SOURCES += \
	versioninfo.rc \
67
	$(NULL)
68

69 70 71
if DBUS_WINCE
wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
else
72
wince_source =
73 74
endif

75
DBUS_SHARED_arch_sources = 			\
76
	$(wince_source)				\
77
	dbus-file-win.c 			\
78
	dbus-pipe-win.c 			\
79
	dbus-sockets-win.h			\
80 81 82 83 84 85 86 87 88 89
	dbus-sysdeps-win.c 			\
	dbus-sysdeps-win.h			\
	dbus-sysdeps-thread-win.c		\
	dbus-transport-win.c			\
	dbus-transport-win.h

DBUS_UTIL_arch_sources =			\
	dbus-sysdeps-util-win.c			\
	dbus-spawn-win.c
else
Benjamin Reed's avatar
Benjamin Reed committed
90 91 92 93 94 95 96

if DBUS_ENABLE_LAUNCHD
launchd_source = dbus-server-launchd.h dbus-server-launchd.c
else
launchd_source =
endif

97
DBUS_LIB_arch_sources = 			\
98 99
	dbus-uuidgen.c				\
	dbus-uuidgen.h				\
100 101 102 103
	dbus-server-unix.c 			\
	dbus-server-unix.h

DBUS_SHARED_arch_sources = 			\
Benjamin Reed's avatar
Benjamin Reed committed
104
	$(launchd_source)			\
105
	dbus-file-unix.c 			\
106
	dbus-pipe-unix.c 			\
107 108 109 110 111 112
	dbus-sysdeps-unix.c 			\
	dbus-sysdeps-unix.h			\
	dbus-sysdeps-pthread.c			\
	dbus-transport-unix.c			\
	dbus-transport-unix.h			\
	dbus-userdb.c				\
113
	dbus-userdb.h 				\
114
	$(NULL)
115 116 117 118 119 120 121

DBUS_UTIL_arch_sources = 			\
	dbus-sysdeps-util-unix.c		\
	dbus-userdb-util.c			\
	dbus-spawn.c
endif

122 123 124 125
if HAVE_LINUX_EPOLL
DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
endif

126
dbusinclude_HEADERS=				\
127
	dbus.h					\
128
	dbus-address.h				\
129
	dbus-bus.h				\
130
	dbus-connection.h			\
131
	dbus-errors.h				\
132
	dbus-macros.h				\
133
	dbus-memory.h				\
134
	dbus-message.h				\
135
	dbus-misc.h				\
136
	dbus-pending-call.h			\
137
	dbus-protocol.h				\
138
	dbus-server.h				\
139
	dbus-shared.h				\
140
	dbus-signature.h			\
Simon McVittie's avatar
Simon McVittie committed
141
	dbus-syntax.h				\
142
	dbus-threads.h				\
John Palmieri's avatar
John Palmieri committed
143
	dbus-types.h
Thiago Macieira's avatar
Thiago Macieira committed
144

145

146
nodist_dbusarchinclude_HEADERS=			\
147 148
	dbus-arch-deps.h

149 150 151
### source code that goes in the installed client library
### and is specific to library functionality
DBUS_LIB_SOURCES=				\
152
	dbus-address.c				\
153 154
	dbus-auth.c				\
	dbus-auth.h				\
155
	dbus-bus.c				\
156 157
	dbus-connection.c			\
	dbus-connection-internal.h		\
158 159
	dbus-credentials.c			\
	dbus-credentials.h			\
160
	dbus-errors.c				\
161 162
	dbus-keyring.c				\
	dbus-keyring.h				\
163 164
	dbus-marshal-header.c			\
	dbus-marshal-header.h			\
165 166
	dbus-marshal-byteswap.c			\
	dbus-marshal-byteswap.h			\
167 168 169 170
	dbus-marshal-recursive.c		\
	dbus-marshal-recursive.h		\
	dbus-marshal-validate.c			\
	dbus-marshal-validate.h			\
171 172
	dbus-message.c				\
	dbus-message-internal.h			\
173
	dbus-message-private.h			\
174
	dbus-misc.c				\
175
	dbus-nonce.h				\
176
	dbus-nonce.c				\
177 178
	dbus-object-tree.c			\
	dbus-object-tree.h			\
179
	dbus-pending-call.c			\
180
	dbus-pending-call-internal.h		\
181 182
	dbus-resources.c			\
	dbus-resources.h			\
183
	dbus-server.c				\
184 185
	dbus-server-debug-pipe.c		\
	dbus-server-debug-pipe.h		\
186
	dbus-server-protected.h			\
187 188
	dbus-server-socket.c			\
	dbus-server-socket.h			\
189
	$(DBUS_LIB_arch_sources)		\
190 191
	dbus-sha.c				\
	dbus-sha.h				\
192
	dbus-signature.c			\
Simon McVittie's avatar
Simon McVittie committed
193
	dbus-syntax.c				\
194 195
	dbus-timeout.c				\
	dbus-timeout.h				\
196
	dbus-threads-internal.h			\
197
	dbus-threads.c				\
198 199 200
	dbus-transport.c			\
	dbus-transport.h			\
	dbus-transport-protected.h		\
201 202
	dbus-transport-socket.c			\
	dbus-transport-socket.h			\
203 204 205
	dbus-watch.c				\
	dbus-watch.h

206
### source code that goes in the installed client library
207 208
### AND is generic utility functionality used by the
### daemon or test programs (all symbols in here should
209 210
### be underscore-prefixed)
DBUS_SHARED_SOURCES=				\
211 212
	dbus-dataslot.c				\
	dbus-dataslot.h				\
213 214
	dbus-file.c                 \
	dbus-file.h                 \
215
	dbus-hash.c				\
216 217
	dbus-hash.h				\
	dbus-internals.c			\
218 219
	dbus-internals.h			\
	dbus-list.c				\
220
	dbus-list.h				\
221 222
	dbus-marshal-basic.c			\
	dbus-marshal-basic.h			\
223
	dbus-memory.c				\
224 225
	dbus-mempool.c				\
	dbus-mempool.h				\
226 227
	dbus-pipe.c                 \
	dbus-pipe.h                 \
228 229
	dbus-string.c				\
	dbus-string.h				\
230
	dbus-string-private.h			\
231
	$(DBUS_SHARED_arch_sources)		\
232
	dbus-sysdeps.c				\
233 234
	dbus-sysdeps.h				\
	dbus-valgrind-internal.h
235

236 237
### source code that is generic utility functionality used
### by the bus daemon or test apps, but is NOT included
238 239
### in the D-Bus client library (all symbols in here
### should be underscore-prefixed but don't really need
240 241
### to be unless they move to DBUS_SHARED_SOURCES later)
DBUS_UTIL_SOURCES=				\
242 243
	dbus-asv-util.c				\
	dbus-asv-util.h				\
244 245
	dbus-auth-script.c			\
	dbus-auth-script.h			\
246
	dbus-auth-util.c			\
247
	dbus-credentials-util.c			\
248
	dbus-mainloop.c				\
249
	dbus-mainloop.h				\
250
	dbus-marshal-byteswap-util.c		\
251
	dbus-marshal-recursive-util.c		\
252
	dbus-marshal-validate-util.c		\
253 254
	dbus-message-factory.c			\
	dbus-message-factory.h			\
255
	dbus-message-util.c			\
256 257
	dbus-shell.c				\
	dbus-shell.h				\
258
	$(DBUS_UTIL_arch_sources)		\
259 260 261
	dbus-socket-set.h			\
	dbus-socket-set.c			\
	dbus-socket-set-poll.c			\
262
	dbus-spawn.h				\
263
	dbus-string-util.c			\
264 265
	dbus-sysdeps-util.c			\
	dbus-test.c				\
266
	dbus-test.h
267

268 269 270 271
if DBUS_ENABLE_EMBEDDED_TESTS
DBUS_UTIL_SOURCES += dbus-spawn-test.c
endif

272
libdbus_1_la_SOURCES=				\
273 274
	$(DBUS_LIB_SOURCES)			\
	$(DBUS_SHARED_SOURCES)
275

276
libdbus_internal_la_SOURCES=			\
277
	$(DBUS_UTIL_SOURCES)
278

279
BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
280
EXTRA_DIST=dbus-arch-deps.h.in
281

282
noinst_LTLIBRARIES=libdbus-internal.la
283

Simon McVittie's avatar
Simon McVittie committed
284 285 286 287
libdbus_1_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-Ddbus_1_EXPORTS \
	$(NULL)
288 289 290 291 292 293 294

if HAVE_LD_VERSION_SCRIPT
SYMBOL_EXPORT_LDFLAGS=-Wl,--version-script=Version
else
SYMBOL_EXPORT_LDFLAGS=
endif

295
libdbus_1_la_LIBADD= $(LIBDBUS_LIBS)
296 297 298
libdbus_1_la_LDFLAGS = \
	$(AM_LDFLAGS) \
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
299
	$(SYMBOL_EXPORT_LDFLAGS) \
300 301
	-no-undefined \
	$(NULL)
302

303
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) libdbus-1.la
304

305
if DBUS_WIN
306 307 308 309
AM_CXXFLAGS = \
	$(CODE_COVERAGE_CXXFLAGS) \
	$(NULL)

310 311 312 313 314 315 316 317 318
# This must be a separate convenience library, otherwise libtool notices
# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
# even on Unix where in fact it doesn't contain any C++. For Windows, where
# this code is used, we don't actually need libstdc++.
noinst_LTLIBRARIES += libdbus-init-win.la
libdbus_init_win_la_SOURCES = dbus-init-win.cpp
libdbus_1_la_LIBADD += libdbus-init-win.la
endif

319 320
noinst_PROGRAMS =

321
if DBUS_ENABLE_EMBEDDED_TESTS
322
# We can't actually run this til we've reached test/
323
noinst_PROGRAMS += test-dbus
324 325
endif

326
test_dbus_SOURCES=				\
327
	dbus-test-main.c
328

329
test_dbus_LDADD = libdbus-internal.la
330

331
# Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
332
include $(top_srcdir)/aminclude_static.am
333 334 335

clean-local:
	$(AM_V_at)rm -fr ./.dbus-keyrings