Makefile.am 7.63 KB
Newer Older
1 2
dbusdatadir=$(datadir)/dbus-1
legacydbusdatadir=$(sysconfdir)/dbus-1
3
dbus_daemon_execdir = $(DBUS_DAEMONDIR)
4

5 6 7
DBUS_BUS_LIBS = \
	$(XML_LIBS) \
	$(SELINUX_LIBS) \
8
	$(APPARMOR_LIBS) \
9 10 11 12 13 14 15 16 17 18 19
	$(THREAD_LIBS) \
	$(ADT_LIBS) \
	$(NETWORK_libs) \
	$(NULL)

DBUS_LAUNCHER_LIBS = \
	$(XML_LIBS) \
	$(THREAD_LIBS) \
	$(NETWORK_libs) \
	$(NULL)

20 21
AM_CPPFLAGS = \
	-I$(top_srcdir) \
22
	$(DBUS_STATIC_BUILD_CPPFLAGS) \
23
	$(XML_CFLAGS) \
24
	$(APPARMOR_CFLAGS) \
25
	-DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \
26 27
	-DDBUS_COMPILATION \
	$(NULL)
28

29 30 31
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@

32
EFENCE=
33

34 35
CONFIG_IN_FILES=				\
	session.conf.in				\
Benjamin Reed's avatar
Benjamin Reed committed
36
	system.conf.in				\
37 38
	legacy-config/session.conf.in		\
	legacy-config/system.conf.in		\
39 40 41 42
	org.freedesktop.dbus-session.plist.in	\
	example-system-enable-stats.conf.in	\
	example-session-disable-stats.conf.in	\
	$(NULL)
43

44 45
dbusdata_DATA = session.conf
legacydbusdata_DATA = legacy-config/session.conf
46 47

if DBUS_UNIX
48 49
dbusdata_DATA += system.conf
legacydbusdata_DATA += legacy-config/system.conf
50
endif
51

52 53 54 55 56 57
examplesdir = ${docdir}/examples
examples_DATA = \
	example-system-enable-stats.conf	\
	example-session-disable-stats.conf	\
	$(NULL)

Benjamin Reed's avatar
Benjamin Reed committed
58 59 60 61 62
if DBUS_ENABLE_LAUNCHD
agentdir=$(LAUNCHD_AGENT_DIR)
agent_DATA=org.freedesktop.dbus-session.plist
endif

63
XML_SOURCES=config-loader-expat.c
64

65
if DBUS_BUS_ENABLE_KQUEUE
John Palmieri's avatar
John Palmieri committed
66 67
DIR_WATCH_SOURCE=dir-watch-kqueue.c
else
68 69 70
if DBUS_BUS_ENABLE_INOTIFY
DIR_WATCH_SOURCE=dir-watch-inotify.c
else
John Palmieri's avatar
John Palmieri committed
71 72 73 74
DIR_WATCH_SOURCE=dir-watch-default.c
endif
endif

75
BUS_SOURCES=					\
76 77
	activation.c				\
	activation.h				\
78
	activation-exit-codes.h			\
79 80
	apparmor.c				\
	apparmor.h				\
81 82
	audit.c					\
	audit.h					\
83 84
	bus.c					\
	bus.h					\
85 86
	config-parser.c				\
	config-parser.h				\
87 88
	config-parser-common.c			\
	config-parser-common.h			\
89 90
	connection.c				\
	connection.h				\
91 92
	desktop-file.c				\
	desktop-file.h				\
John Palmieri's avatar
John Palmieri committed
93
	$(DIR_WATCH_SOURCE)			\
94
	dir-watch.h				\
95 96
	dispatch.c				\
	dispatch.h				\
97 98
	driver.c				\
	driver.h				\
99 100
	expirelist.c				\
	expirelist.h				\
101 102
	policy.c				\
	policy.h				\
103 104
	selinux.h				\
	selinux.c				\
105
	services.c				\
106
	services.h				\
107 108
	signals.c				\
	signals.h				\
109 110
	stats.c					\
	stats.h					\
111 112
	test.c					\
	test.h					\
113
	utils.c					\
114 115
	utils.h					\
	$(XML_SOURCES)
116

117
dbus_daemon_SOURCES=				\
118
	$(BUS_SOURCES)				\
119
	main.c
120

121
dbus_daemon_LDADD=					\
122
	$(top_builddir)/dbus/libdbus-1.la	\
123
	$(top_builddir)/dbus/libdbus-internal.la	\
124
	$(EFENCE)					\
125
	$(DBUS_BUS_LIBS)
126

127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
LAUNCH_HELPER_SOURCES=				\
	$(XML_SOURCES)				\
	config-parser-common.c			\
	config-parser-common.h			\
	config-parser-trivial.c			\
	config-parser-trivial.h			\
	desktop-file.c				\
	desktop-file.h				\
	utils.c					\
	utils.h					\
	activation-exit-codes.h			\
	activation-helper.h	  		\
	activation-helper.c

## This is the installed launch helper with the setuid checks
dbus_daemon_launch_helper_SOURCES=		\
	activation-helper-bin.c			\
	$(LAUNCH_HELPER_SOURCES)

dbus_daemon_launch_helper_LDADD=		\
147 148
	$(top_builddir)/dbus/libdbus-1.la \
	$(top_builddir)/dbus/libdbus-internal.la	\
149
	$(DBUS_LAUNCHER_LIBS)
150 151 152 153 154 155 156 157

## we build another binary so we can do the launch testing without root privs.
## DO NOT INSTALL THIS FILE
dbus_daemon_launch_helper_test_SOURCES=		\
	activation-helper-bin.c			\
	$(LAUNCH_HELPER_SOURCES)

dbus_daemon_launch_helper_test_LDADD=		\
158
	$(top_builddir)/dbus/libdbus-1.la \
159
	$(top_builddir)/dbus/libdbus-internal.la \
160
	$(DBUS_LAUNCHER_LIBS)
161

162 163
dbus_daemon_launch_helper_test_CPPFLAGS = \
	$(AM_CPPFLAGS) \
164 165 166 167
	-DACTIVATION_LAUNCHER_TEST

## we build yet another binary so we can do the OOM tests
## DO NOT INSTALL THIS FILE
168
test_bus_launch_helper_SOURCES=		\
169 170 171
	test-launch-helper.c   		\
	$(LAUNCH_HELPER_SOURCES)

172
test_bus_launch_helper_LDADD=		\
173
	$(top_builddir)/dbus/libdbus-1.la \
174
	$(top_builddir)/dbus/libdbus-internal.la \
175
	$(DBUS_LAUNCHER_LIBS)
176
	$(NULL)
177

178
test_bus_launch_helper_CPPFLAGS = \
179
	$(AM_CPPFLAGS) \
180 181
	-DACTIVATION_LAUNCHER_TEST	\
	-DACTIVATION_LAUNCHER_DO_OOM
182

Simon McVittie's avatar
Simon McVittie committed
183
noinst_PROGRAMS =
184
dbus_daemon_exec_PROGRAMS = dbus-daemon
185
if DBUS_UNIX
186
libexec_PROGRAMS = dbus-daemon-launch-helper
187
endif DBUS_UNIX
188

Simon McVittie's avatar
Simon McVittie committed
189 190 191 192
## Note that TESTS has special meaning (stuff to use in make check).
## We don't actually want to run any of these tests until test/ has been
## compiled, so we don't put them in TESTS here; we run them in test/
## instead.
193

194
if DBUS_ENABLE_EMBEDDED_TESTS
Simon McVittie's avatar
Simon McVittie committed
195 196 197 198
## we use noinst_PROGRAMS not check_PROGRAMS so that we build
## even when not doing "make check"

# run as a test by test/Makefile.am
199
noinst_PROGRAMS += test-bus
200

201
if DBUS_UNIX
Simon McVittie's avatar
Simon McVittie committed
202
# run as a test by test/Makefile.am
203
noinst_PROGRAMS += test-bus-launch-helper test-bus-system
204 205 206 207
# this is used by the tests but is not,itself, a test
noinst_PROGRAMS += dbus-daemon-launch-helper-test
endif DBUS_UNIX

208
endif DBUS_ENABLE_EMBEDDED_TESTS
209

210
test_bus_system_SOURCES=			\
211 212 213 214 215 216 217 218 219
	$(XML_SOURCES)				\
	config-parser-common.c			\
	config-parser-common.h			\
	config-parser-trivial.c			\
	config-parser-trivial.h			\
	utils.c					\
	utils.h					\
	test-system.c

220 221 222 223 224
test_bus_system_LDADD = \
	$(top_builddir)/dbus/libdbus-1.la \
	$(top_builddir)/dbus/libdbus-internal.la \
	$(DBUS_BUS_LIBS) \
	$(NULL)
225

226
test_bus_SOURCES=				\
227
	$(BUS_SOURCES)				\
228 229
	test-main.c

230 231 232 233 234
test_bus_LDADD = \
	$(top_builddir)/dbus/libdbus-1.la \
	$(top_builddir)/dbus/libdbus-internal.la \
	$(DBUS_BUS_LIBS) \
	$(NULL)
235 236 237 238

## mop up the gcov files
clean-local:
	/bin/rm *.bb *.bbg *.da *.gcov || true
239 240

install-data-hook:
241 242
	$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/session.d
	$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/services
243 244
if DBUS_UNIX
	$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
245 246
	$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/system.d
	$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/system-services
247
endif
248
if HAVE_SYSTEMD
249 250 251
# Install dbus.socket as default implementation of a D-Bus stack.
# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
# but neither is systemd, so it's OK to assume here that ln complies with SUS.
252 253
# Unconditionally enable D-Bus on systemd installations
	$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
254
	ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
255
	$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
256
	ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
257
endif
258 259 260 261
if DBUS_ENABLE_USER_SESSION
	$(mkinstalldirs) $(DESTDIR)$(systemduserunitdir)/sockets.target.wants
	ln -fs ../dbus.socket $(DESTDIR)$(systemduserunitdir)/sockets.target.wants/dbus.socket
endif
262

263 264 265 266 267 268 269 270 271 272 273
if DBUS_UNIX
install-exec-hook:
	if test `id -u` -eq 0; then \
		chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
		chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
	else \
		echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
		echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
	fi
endif

274
#### Init scripts fun
275
SCRIPT_IN_FILES=messagebus.in \
276
		messagebus-config.in \
277
		rc.messagebus.in
278 279 280 281

## Red Hat start
if DBUS_INIT_SCRIPTS_RED_HAT

282
initddir=$(sysconfdir)/rc.d/init.d
283 284 285 286 287 288

initd_SCRIPTS= 	\
	messagebus

endif
 ## Red Hat end
289

290 291 292 293 294 295 296 297 298 299
## Slackware start
if DBUS_INIT_SCRIPTS_SLACKWARE

initddir=$(sysconfdir)/rc.d/

initd_SCRIPTS= 	\
	rc.messagebus

endif
## Slackware end
300

301 302 303 304 305 306 307 308 309
## Cygwin start
if DBUS_INIT_SCRIPTS_CYGWIN

bin_SCRIPTS= 	\
	messagebus-config

endif
## Cygwin end

310 311 312
if HAVE_SYSTEMD
SCRIPT_IN_FILES += \
	dbus.service.in \
313 314 315 316
	dbus.socket.in \
	systemd-user/dbus.service.in \
	systemd-user/dbus.socket.in \
	$(NULL)
317 318 319 320 321 322

systemdsystemunit_DATA = \
	dbus.service \
	dbus.socket
endif

323 324 325 326 327 328 329
if DBUS_ENABLE_USER_SESSION
systemduserunit_DATA = \
	systemd-user/dbus.service \
	systemd-user/dbus.socket \
	$(NULL)
endif

330
#### Extra dist
331

Will Thompson's avatar
Will Thompson committed
332
EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)