• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1configdir=$(sysconfdir)/dbus-1
2dbus_daemon_execdir = $(DBUS_DAEMONDIR)
3
4DBUS_BUS_LIBS = \
5	$(XML_LIBS) \
6	$(SELINUX_LIBS) \
7	$(THREAD_LIBS) \
8	$(ADT_LIBS) \
9	$(NETWORK_libs) \
10	$(NULL)
11
12DBUS_LAUNCHER_LIBS = \
13	$(XML_LIBS) \
14	$(THREAD_LIBS) \
15	$(NETWORK_libs) \
16	$(NULL)
17
18AM_CPPFLAGS = \
19	-I$(top_srcdir) \
20	$(XML_CFLAGS) \
21	-DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
22	-DDBUS_COMPILATION \
23	-DDBUS_STATIC_BUILD \
24	$(NULL)
25
26# if assertions are enabled, improve backtraces
27AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
28
29EFENCE=
30
31CONFIG_IN_FILES=				\
32	session.conf.in				\
33	system.conf.in				\
34	org.freedesktop.dbus-session.plist.in
35
36config_DATA=					\
37	session.conf				\
38	system.conf
39
40if DBUS_ENABLE_LAUNCHD
41agentdir=$(LAUNCHD_AGENT_DIR)
42agent_DATA=org.freedesktop.dbus-session.plist
43endif
44
45if DBUS_USE_LIBXML
46XML_SOURCES=config-loader-libxml.c
47endif
48if DBUS_USE_EXPAT
49XML_SOURCES=config-loader-expat.c
50endif
51
52if DBUS_BUS_ENABLE_KQUEUE
53DIR_WATCH_SOURCE=dir-watch-kqueue.c
54else
55if DBUS_BUS_ENABLE_INOTIFY
56DIR_WATCH_SOURCE=dir-watch-inotify.c
57else
58if DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
59DIR_WATCH_SOURCE=dir-watch-dnotify.c
60else
61DIR_WATCH_SOURCE=dir-watch-default.c
62endif
63endif
64endif
65
66BUS_SOURCES=					\
67	activation.c				\
68	activation.h				\
69	activation-exit-codes.h			\
70	bus.c					\
71	bus.h					\
72	config-parser.c				\
73	config-parser.h				\
74	config-parser-common.c			\
75	config-parser-common.h			\
76	connection.c				\
77	connection.h				\
78	desktop-file.c				\
79	desktop-file.h				\
80	$(DIR_WATCH_SOURCE)			\
81	dir-watch.h				\
82	dispatch.c				\
83	dispatch.h				\
84	driver.c				\
85	driver.h				\
86	expirelist.c				\
87	expirelist.h				\
88	policy.c				\
89	policy.h				\
90	selinux.h				\
91	selinux.c				\
92	services.c				\
93	services.h				\
94	signals.c				\
95	signals.h				\
96	stats.c					\
97	stats.h					\
98	test.c					\
99	test.h					\
100	utils.c					\
101	utils.h					\
102	$(XML_SOURCES)
103
104dbus_daemon_SOURCES=				\
105	$(BUS_SOURCES)				\
106	main.c
107
108dbus_daemon_LDADD=					\
109	$(top_builddir)/dbus/libdbus-internal.la	\
110	$(EFENCE)					\
111	$(DBUS_BUS_LIBS)
112
113LAUNCH_HELPER_SOURCES=				\
114	$(XML_SOURCES)				\
115	config-parser-common.c			\
116	config-parser-common.h			\
117	config-parser-trivial.c			\
118	config-parser-trivial.h			\
119	desktop-file.c				\
120	desktop-file.h				\
121	utils.c					\
122	utils.h					\
123	activation-exit-codes.h			\
124	activation-helper.h	  		\
125	activation-helper.c
126
127## This is the installed launch helper with the setuid checks
128dbus_daemon_launch_helper_SOURCES=		\
129	activation-helper-bin.c			\
130	$(LAUNCH_HELPER_SOURCES)
131
132dbus_daemon_launch_helper_LDADD=		\
133	$(top_builddir)/dbus/libdbus-internal.la \
134	$(DBUS_LAUNCHER_LIBS)
135
136## we build another binary so we can do the launch testing without root privs.
137## DO NOT INSTALL THIS FILE
138dbus_daemon_launch_helper_test_SOURCES=		\
139	activation-helper-bin.c			\
140	$(LAUNCH_HELPER_SOURCES)
141
142dbus_daemon_launch_helper_test_LDADD=		\
143	$(top_builddir)/dbus/libdbus-internal.la \
144	$(DBUS_LAUNCHER_LIBS)
145
146dbus_daemon_launch_helper_test_CPPFLAGS = \
147	$(AM_CPPFLAGS) \
148	-DACTIVATION_LAUNCHER_TEST
149
150## we build yet another binary so we can do the OOM tests
151## DO NOT INSTALL THIS FILE
152bus_test_launch_helper_SOURCES=		\
153	test-launch-helper.c   		\
154	$(LAUNCH_HELPER_SOURCES)
155
156bus_test_launch_helper_LDADD=		\
157	$(top_builddir)/dbus/libdbus-internal.la \
158	$(DBUS_LAUNCHER_LIBS)
159
160bus_test_launch_helper_CPPFLAGS = \
161	$(AM_CPPFLAGS) \
162	-DACTIVATION_LAUNCHER_TEST	\
163	-DACTIVATION_LAUNCHER_DO_OOM
164
165noinst_PROGRAMS =
166dbus_daemon_exec_PROGRAMS = dbus-daemon
167if DBUS_UNIX
168libexec_PROGRAMS = dbus-daemon-launch-helper
169endif DBUS_UNIX
170
171## Note that TESTS has special meaning (stuff to use in make check).
172## We don't actually want to run any of these tests until test/ has been
173## compiled, so we don't put them in TESTS here; we run them in test/
174## instead.
175
176if DBUS_BUILD_TESTS
177## we use noinst_PROGRAMS not check_PROGRAMS so that we build
178## even when not doing "make check"
179
180# run as a test by test/Makefile.am
181noinst_PROGRAMS += bus-test bus-test-system
182
183if DBUS_UNIX
184# run as a test by test/Makefile.am
185noinst_PROGRAMS += bus-test-launch-helper
186# this is used by the tests but is not,itself, a test
187noinst_PROGRAMS += dbus-daemon-launch-helper-test
188endif DBUS_UNIX
189
190endif DBUS_BUILD_TESTS
191
192bus_test_system_SOURCES=			\
193	$(XML_SOURCES)				\
194	config-parser-common.c			\
195	config-parser-common.h			\
196	config-parser-trivial.c			\
197	config-parser-trivial.h			\
198	utils.c					\
199	utils.h					\
200	test-system.c
201
202bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
203
204bus_test_SOURCES=				\
205	$(BUS_SOURCES)				\
206	test-main.c
207
208bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
209
210## mop up the gcov files
211clean-local:
212	/bin/rm *.bb *.bbg *.da *.gcov || true
213
214install-data-hook:
215	$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
216	$(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
220if HAVE_SYSTEMD
221# Install dbus.socket as default implementation of a D-Bus stack.
222# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
223# 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# Unconditionally enable D-Bus on systemd installations
227	$(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
231endif
232
233if DBUS_UNIX
234install-exec-hook:
235	if test `id -u` -eq 0; then \
236		chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
237		chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
238	else \
239		echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
240		echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
241	fi
242endif
243
244#### Init scripts fun
245SCRIPT_IN_FILES=messagebus.in \
246		messagebus-config.in \
247		rc.messagebus.in
248
249## Red Hat start
250if DBUS_INIT_SCRIPTS_RED_HAT
251
252initddir=$(sysconfdir)/rc.d/init.d
253
254initd_SCRIPTS= 	\
255	messagebus
256
257endif
258 ## Red Hat end
259
260## Slackware start
261if DBUS_INIT_SCRIPTS_SLACKWARE
262
263initddir=$(sysconfdir)/rc.d/
264
265initd_SCRIPTS= 	\
266	rc.messagebus
267
268endif
269## Slackware end
270
271## Cygwin start
272if DBUS_INIT_SCRIPTS_CYGWIN
273
274bin_SCRIPTS= 	\
275	messagebus-config
276
277endif
278## Cygwin end
279
280if HAVE_SYSTEMD
281SCRIPT_IN_FILES += \
282	dbus.service.in \
283	dbus.socket.in
284
285systemdsystemunit_DATA = \
286	dbus.service \
287	dbus.socket
288endif
289
290#### Extra dist
291
292EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
293