Makefile.am 6.71 KB
Newer Older
1
configdir=$(sysconfdir)/dbus-1
2
dbus_daemon_execdir = $(DBUS_DAEMONDIR)
3

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

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

18 19
AM_CPPFLAGS = \
	-I$(top_srcdir) \
20
	$(XML_CFLAGS) \
21
	-DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
22 23 24
	-DDBUS_COMPILATION \
	-DDBUS_STATIC_BUILD \
	$(NULL)
25

26 27 28
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@

29
EFENCE=
30

31 32
CONFIG_IN_FILES=				\
	session.conf.in				\
Benjamin Reed's avatar
Benjamin Reed committed
33 34
	system.conf.in				\
	org.freedesktop.dbus-session.plist.in
35

36
config_DATA=					\
37 38
	session.conf				\
	system.conf
39

Benjamin Reed's avatar
Benjamin Reed committed
40 41 42 43 44
if DBUS_ENABLE_LAUNCHD
agentdir=$(LAUNCHD_AGENT_DIR)
agent_DATA=org.freedesktop.dbus-session.plist
endif

45 46 47
if DBUS_USE_LIBXML
XML_SOURCES=config-loader-libxml.c
endif
48 49 50
if DBUS_USE_EXPAT
XML_SOURCES=config-loader-expat.c
endif
51

52
if DBUS_BUS_ENABLE_KQUEUE
John Palmieri's avatar
John Palmieri committed
53 54
DIR_WATCH_SOURCE=dir-watch-kqueue.c
else
55 56 57
if DBUS_BUS_ENABLE_INOTIFY
DIR_WATCH_SOURCE=dir-watch-inotify.c
else
John Palmieri's avatar
John Palmieri committed
58 59 60 61 62 63
if DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
DIR_WATCH_SOURCE=dir-watch-dnotify.c
else
DIR_WATCH_SOURCE=dir-watch-default.c
endif
endif
64
endif
John Palmieri's avatar
John Palmieri committed
65

66
BUS_SOURCES=					\
67 68
	activation.c				\
	activation.h				\
69
	activation-exit-codes.h			\
70 71
	bus.c					\
	bus.h					\
72 73
	config-parser.c				\
	config-parser.h				\
74 75
	config-parser-common.c			\
	config-parser-common.h			\
76 77
	connection.c				\
	connection.h				\
78 79
	desktop-file.c				\
	desktop-file.h				\
John Palmieri's avatar
John Palmieri committed
80
	$(DIR_WATCH_SOURCE)			\
81
	dir-watch.h				\
82 83
	dispatch.c				\
	dispatch.h				\
84 85
	driver.c				\
	driver.h				\
86 87
	expirelist.c				\
	expirelist.h				\
88 89
	policy.c				\
	policy.h				\
90 91
	selinux.h				\
	selinux.c				\
92
	services.c				\
93
	services.h				\
94 95
	signals.c				\
	signals.h				\
96 97
	stats.c					\
	stats.h					\
98 99
	test.c					\
	test.h					\
100
	utils.c					\
101 102
	utils.h					\
	$(XML_SOURCES)
103

104
dbus_daemon_SOURCES=				\
105
	$(BUS_SOURCES)				\
106
	main.c
107

108
dbus_daemon_LDADD=					\
109
	$(top_builddir)/dbus/libdbus-internal.la	\
110
	$(EFENCE)					\
111
	$(DBUS_BUS_LIBS)
112

113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
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=		\
133
	$(top_builddir)/dbus/libdbus-internal.la \
134
	$(DBUS_LAUNCHER_LIBS)
135 136 137 138 139 140 141 142

## 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=		\
143
	$(top_builddir)/dbus/libdbus-internal.la \
144
	$(DBUS_LAUNCHER_LIBS)
145

146 147
dbus_daemon_launch_helper_test_CPPFLAGS = \
	$(AM_CPPFLAGS) \
148 149 150 151 152 153 154 155 156
	-DACTIVATION_LAUNCHER_TEST

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

bus_test_launch_helper_LDADD=		\
157
	$(top_builddir)/dbus/libdbus-internal.la \
158
	$(DBUS_LAUNCHER_LIBS)
159

160 161
bus_test_launch_helper_CPPFLAGS = \
	$(AM_CPPFLAGS) \
162 163
	-DACTIVATION_LAUNCHER_TEST	\
	-DACTIVATION_LAUNCHER_DO_OOM
164

Simon McVittie's avatar
Simon McVittie committed
165
noinst_PROGRAMS =
166
dbus_daemon_exec_PROGRAMS = dbus-daemon
167
if DBUS_UNIX
168
libexec_PROGRAMS = dbus-daemon-launch-helper
169
endif DBUS_UNIX
170

Simon McVittie's avatar
Simon McVittie committed
171 172 173 174
## 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.
175

176
if DBUS_BUILD_TESTS
Simon McVittie's avatar
Simon McVittie committed
177 178 179 180 181
## 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
noinst_PROGRAMS += bus-test bus-test-system
182

183
if DBUS_UNIX
Simon McVittie's avatar
Simon McVittie committed
184 185
# run as a test by test/Makefile.am
noinst_PROGRAMS += bus-test-launch-helper
186 187 188 189 190
# this is used by the tests but is not,itself, a test
noinst_PROGRAMS += dbus-daemon-launch-helper-test
endif DBUS_UNIX

endif DBUS_BUILD_TESTS
191 192 193 194 195 196 197 198 199 200 201

bus_test_system_SOURCES=			\
	$(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

202
bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
203 204

bus_test_SOURCES=				\
205
	$(BUS_SOURCES)				\
206 207
	test-main.c

208
bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
209 210 211 212

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

install-data-hook:
215 216
	$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
	$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
217
	$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
218
	$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
219
	$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
220
if HAVE_SYSTEMD
221 222 223
# 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.
224
	$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
225
	ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
226 227
# Unconditionally enable D-Bus on systemd installations
	$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
228
	ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
229
	$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
230
	ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
231
endif
232

233 234 235 236 237 238 239 240 241 242 243
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

244
#### Init scripts fun
245
SCRIPT_IN_FILES=messagebus.in \
246
		messagebus-config.in \
247
		rc.messagebus.in
248 249 250 251

## Red Hat start
if DBUS_INIT_SCRIPTS_RED_HAT

252
initddir=$(sysconfdir)/rc.d/init.d
253 254 255 256 257 258

initd_SCRIPTS= 	\
	messagebus

endif
 ## Red Hat end
259

260 261 262 263 264 265 266 267 268 269
## Slackware start
if DBUS_INIT_SCRIPTS_SLACKWARE

initddir=$(sysconfdir)/rc.d/

initd_SCRIPTS= 	\
	rc.messagebus

endif
## Slackware end
270

271 272 273 274 275 276 277 278 279
## Cygwin start
if DBUS_INIT_SCRIPTS_CYGWIN

bin_SCRIPTS= 	\
	messagebus-config

endif
## Cygwin end

280 281 282 283 284 285 286 287 288 289 290
if HAVE_SYSTEMD
SCRIPT_IN_FILES += \
	dbus.service.in \
	dbus.socket.in

systemdsystemunit_DATA = \
	dbus.service \
	dbus.socket
endif

#### Extra dist
291

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