c44fe6a7848453f8089e7de285ecd9e33467a54f
[platform/upstream/dbus.git] / bus / Makefile.am
1
2 configdir=$(sysconfdir)/dbus-1
3
4 INCLUDES=-I$(top_srcdir) $(DBUS_BUS_CFLAGS) @PIE_CFLAGS@                \
5         -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\"        \
6         -DDBUS_COMPILATION
7
8 EFENCE=
9
10 CONFIG_IN_FILES=                                \
11         session.conf.in                         \
12         system.conf.in
13
14 config_DATA=                                    \
15         session.conf                            \
16         system.conf
17
18 if DBUS_USE_LIBXML
19 XML_SOURCES=config-loader-libxml.c
20 endif
21 if DBUS_USE_EXPAT
22 XML_SOURCES=config-loader-expat.c
23 endif
24
25 if DBUS_BUS_ENABLE_KQUEUE
26 DIR_WATCH_SOURCE=dir-watch-kqueue.c
27 else
28 if DBUS_BUS_ENABLE_INOTIFY
29 DIR_WATCH_SOURCE=dir-watch-inotify.c
30 else
31 if DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
32 DIR_WATCH_SOURCE=dir-watch-dnotify.c
33 else
34 DIR_WATCH_SOURCE=dir-watch-default.c
35 endif
36 endif
37 endif
38
39 BUS_SOURCES=                                    \
40         activation.c                            \
41         activation.h                            \
42         activation-exit-codes.h                 \
43         bus.c                                   \
44         bus.h                                   \
45         config-parser.c                         \
46         config-parser.h                         \
47         config-parser-common.c                  \
48         config-parser-common.h                  \
49         connection.c                            \
50         connection.h                            \
51         desktop-file.c                          \
52         desktop-file.h                          \
53         $(DIR_WATCH_SOURCE)                     \
54         dir-watch.h                             \
55         dispatch.c                              \
56         dispatch.h                              \
57         driver.c                                \
58         driver.h                                \
59         expirelist.c                            \
60         expirelist.h                            \
61         policy.c                                \
62         policy.h                                \
63         selinux.h                               \
64         selinux.c                               \
65         services.c                              \
66         services.h                              \
67         signals.c                               \
68         signals.h                               \
69         test.c                                  \
70         test.h                                  \
71         utils.c                                 \
72         utils.h                                 \
73         $(XML_SOURCES)
74
75 dbus_daemon_SOURCES=                            \
76         $(BUS_SOURCES)                          \
77         main.c                                  
78
79 dbus_daemon_LDADD=                                      \
80         $(top_builddir)/dbus/libdbus-convenience.la     \
81         $(EFENCE)                                       \
82         $(DBUS_BUS_LIBS)
83
84 dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @PIE_LDFLAGS@
85
86 LAUNCH_HELPER_SOURCES=                          \
87         $(XML_SOURCES)                          \
88         config-parser-common.c                  \
89         config-parser-common.h                  \
90         config-parser-trivial.c                 \
91         config-parser-trivial.h                 \
92         desktop-file.c                          \
93         desktop-file.h                          \
94         utils.c                                 \
95         utils.h                                 \
96         activation-exit-codes.h                 \
97         activation-helper.h                     \
98         activation-helper.c
99
100 ## This is the installed launch helper with the setuid checks
101 dbus_daemon_launch_helper_SOURCES=              \
102         activation-helper-bin.c                 \
103         $(LAUNCH_HELPER_SOURCES)
104
105 dbus_daemon_launch_helper_LDADD=                \
106         $(top_builddir)/dbus/libdbus-convenience.la \
107         $(DBUS_LAUNCHER_LIBS)
108
109 dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
110
111 ## we build another binary so we can do the launch testing without root privs.
112 ## DO NOT INSTALL THIS FILE
113 dbus_daemon_launch_helper_test_SOURCES=         \
114         activation-helper-bin.c                 \
115         $(LAUNCH_HELPER_SOURCES)
116
117 dbus_daemon_launch_helper_test_LDADD=           \
118         $(top_builddir)/dbus/libdbus-convenience.la \
119         $(DBUS_LAUNCHER_LIBS)
120
121 dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
122 dbus_daemon_launch_helper_test_CPPFLAGS=        \
123         -DACTIVATION_LAUNCHER_TEST
124
125 ## we build yet another binary so we can do the OOM tests
126 ## DO NOT INSTALL THIS FILE
127 bus_test_launch_helper_SOURCES=         \
128         test-launch-helper.c            \
129         $(LAUNCH_HELPER_SOURCES)
130
131 bus_test_launch_helper_LDADD=           \
132         $(top_builddir)/dbus/libdbus-convenience.la \
133         $(DBUS_LAUNCHER_LIBS)
134
135 bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
136 bus_test_launch_helper_CPPFLAGS=        \
137         -DACTIVATION_LAUNCHER_TEST      \
138         -DACTIVATION_LAUNCHER_DO_OOM
139
140 extra_tests=
141 extra_noinst_programs=
142 extra_inst_programs=
143 if DBUS_UNIX
144 extra_tests+=bus-test-launch-helper
145 extra_noinst_programs+=dbus-daemon-launch-helper dbus-daemon-launch-helper-test dbus-daemon
146 endif
147 if DBUS_WIN
148 extra_inst_programs+=dbus-daemon
149 endif
150
151 ## note that TESTS has special meaning (stuff to use in make check)
152 ## so if adding tests not to be run in make check, don't add them to 
153 ## TESTS
154 if DBUS_BUILD_TESTS
155 TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus DBUS_FATAL_WARNINGS=1 DBUS_BLOCK_ON_ABORT=1
156 TESTS=bus-test bus-test-system $(extra_tests)
157 else
158 TESTS=
159 endif
160
161 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build 
162 ## even when not doing "make check"
163 noinst_PROGRAMS=$(TESTS) $(extra_noinst_programs)
164 bin_PROGRAMS=$(extra_inst_programs)
165
166 bus_test_system_SOURCES=                        \
167         $(XML_SOURCES)                          \
168         config-parser-common.c                  \
169         config-parser-common.h                  \
170         config-parser-trivial.c                 \
171         config-parser-trivial.h                 \
172         utils.c                                 \
173         utils.h                                 \
174         test-system.c
175
176 bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_BUS_LIBS)
177 bus_test_system_LDFLAGS=@R_DYNAMIC_LDFLAG@
178
179 bus_test_SOURCES=                               \
180         $(BUS_SOURCES)                          \
181         test-main.c
182
183 bus_test_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_BUS_LIBS)
184 bus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
185
186 ## mop up the gcov files
187 clean-local:
188         /bin/rm *.bb *.bbg *.da *.gcov || true
189
190 uninstall-hook:
191         rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT)
192         rm -f $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT)
193
194 install-data-hook:
195         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
196         $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
197         $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
198         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
199         $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
200 if DBUS_UNIX
201         if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
202                 $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
203                 chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
204         fi
205         $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
206         $(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
207         if test -f dbus-daemin-launch-helper$(EXEEXT) ; then \
208         $(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
209         if test `id -u` -eq 0; then \
210                 chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
211                 chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
212         else \
213                 echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
214                 echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
215         fi \
216         fi
217 endif
218
219 #### Init scripts fun
220 SCRIPT_IN_FILES=messagebus.in \
221                 rc.messagebus.in
222
223 ## Red Hat start
224 if DBUS_INIT_SCRIPTS_RED_HAT
225
226 initddir=$(sysconfdir)/rc.d/init.d
227
228 initd_SCRIPTS=  \
229         messagebus
230
231 endif
232  ## Red Hat end
233
234 ## Slackware start
235 if DBUS_INIT_SCRIPTS_SLACKWARE
236
237 initddir=$(sysconfdir)/rc.d/
238
239 initd_SCRIPTS=  \
240         rc.messagebus
241
242 endif
243 ## Slackware end
244
245 MAN_IN_FILES=dbus-daemon.1.in
246 man_MANS = dbus-daemon.1
247
248 #### Extra dist 
249
250 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES)