Makefile.am 7.76 KB
Newer Older
1

2 3
configdir=$(sysconfdir)/dbus-1

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

15 16 17 18
# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
# results in an otherwise unnecessary dependency on librt. Disable it.
AM_CPPFLAGS += -DSD_DAEMON_DISABLE_MQ

19 20 21
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@

22
dbusincludedir=$(includedir)/dbus-1.0/dbus
23
dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
24 25 26

lib_LTLIBRARIES=libdbus-1.la

27 28 29 30
#
# Deal with W32 .def and version-info.rc stuff
#
if DBUS_WIN
31

32
SUFFIXES = rc
33 34

.rc.o:
35
	$(WINDRES) $< -o $@
36 37 38 39

dbus_res = versioninfo.o
dbus_res_ldflag = -Wl,$(dbus_res)
no_undefined = -no-undefined
40
export_symbols =
41

42
EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
43 44 45 46 47 48
intllibs =

else
dbus_res =
dbus_res_ldflag =
no_undefined =
49 50 51
## don't export symbols that start with "_" (we use this
## convention for internal symbols)
export_symbols = -export-symbols-regex "^[^_].*"
52 53 54 55 56 57 58 59 60 61 62 63 64 65

intllibs = @LTLIBINTL@

endif


#
# Platform-dependent sources:
#
if DBUS_WIN
DBUS_LIB_arch_sources = 			\
	dbus-server-win.c 			\
	dbus-server-win.h

66 67 68
if DBUS_WINCE
wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
else
69
wince_source =
70 71
endif

72
DBUS_SHARED_arch_sources = 			\
73
	$(wince_source)				\
74
	dbus-file-win.c 			\
75
	dbus-pipe-win.c 			\
76
	dbus-sockets-win.h			\
77 78 79 80 81 82 83 84 85 86
	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
87 88 89 90 91 92 93

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

94
DBUS_LIB_arch_sources = 			\
95 96
	dbus-uuidgen.c				\
	dbus-uuidgen.h				\
97 98 99 100
	dbus-server-unix.c 			\
	dbus-server-unix.h

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

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

120 121 122 123
if HAVE_LINUX_EPOLL
DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
endif

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

143

144
nodist_dbusarchinclude_HEADERS=			\
145 146
	dbus-arch-deps.h

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

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

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

266
libdbus_1_la_SOURCES=				\
267 268
	$(DBUS_LIB_SOURCES)			\
	$(DBUS_SHARED_SOURCES)
269

270
libdbus_internal_la_SOURCES=			\
271 272 273
	$(DBUS_LIB_SOURCES)			\
	$(DBUS_SHARED_SOURCES)			\
	$(DBUS_UTIL_SOURCES)
274

275
BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
276
EXTRA_DIST=dbus-arch-deps.h.in
277

278 279
## this library is the same as libdbus, but exports all the symbols
## and is only used for static linking within the dbus package.
280
noinst_LTLIBRARIES=libdbus-internal.la
281

Simon McVittie's avatar
Simon McVittie committed
282 283 284 285
libdbus_1_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-Ddbus_1_EXPORTS \
	$(NULL)
286
libdbus_1_la_LIBADD= $(LIBDBUS_LIBS)
287 288 289 290 291 292
libdbus_1_la_LDFLAGS = \
	$(AM_LDFLAGS) \
	$(export_symbols) \
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
	-no-undefined \
	$(NULL)
293

Simon McVittie's avatar
Simon McVittie committed
294 295 296 297
libdbus_internal_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-DDBUS_STATIC_BUILD \
	$(NULL)
298
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
299

300 301 302 303 304 305 306 307 308 309 310
if DBUS_WIN
# 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
libdbus_internal_la_LIBADD += libdbus-init-win.la
endif

311 312
noinst_PROGRAMS =

313
if DBUS_ENABLE_EMBEDDED_TESTS
314
# We can't actually run this til we've reached test/
315
noinst_PROGRAMS += test-dbus
316 317
endif

318
test_dbus_SOURCES=				\
319
	dbus-test-main.c
320

321
test_dbus_LDADD = libdbus-internal.la
322 323 324

## mop up the gcov files
clean-local:
325
	/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
326 327

update-systemd:
328 329
	curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
	curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h