Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 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_CPPFLAGS = -DDBUS_STATIC_BUILD |
| 80 | dbus_daemon_LDADD= \ |
| 81 | $(top_builddir)/dbus/libdbus-internal.la \ |
| 82 | $(EFENCE) \ |
| 83 | $(DBUS_BUS_LIBS) |
| 84 | |
| 85 | dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @PIE_LDFLAGS@ |
| 86 | |
| 87 | LAUNCH_HELPER_SOURCES= \ |
| 88 | $(XML_SOURCES) \ |
| 89 | config-parser-common.c \ |
| 90 | config-parser-common.h \ |
| 91 | config-parser-trivial.c \ |
| 92 | config-parser-trivial.h \ |
| 93 | desktop-file.c \ |
| 94 | desktop-file.h \ |
| 95 | utils.c \ |
| 96 | utils.h \ |
| 97 | activation-exit-codes.h \ |
| 98 | activation-helper.h \ |
| 99 | activation-helper.c |
| 100 | |
| 101 | ## This is the installed launch helper with the setuid checks |
| 102 | dbus_daemon_launch_helper_SOURCES= \ |
| 103 | activation-helper-bin.c \ |
| 104 | $(LAUNCH_HELPER_SOURCES) |
| 105 | |
| 106 | dbus_daemon_launch_helper_CPPFLAGS = -DDBUS_STATIC_BUILD |
| 107 | dbus_daemon_launch_helper_LDADD= \ |
| 108 | $(top_builddir)/dbus/libdbus-internal.la \ |
| 109 | $(DBUS_LAUNCHER_LIBS) |
| 110 | |
| 111 | dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ |
| 112 | |
| 113 | ## we build another binary so we can do the launch testing without root privs. |
| 114 | ## DO NOT INSTALL THIS FILE |
| 115 | dbus_daemon_launch_helper_test_SOURCES= \ |
| 116 | activation-helper-bin.c \ |
| 117 | $(LAUNCH_HELPER_SOURCES) |
| 118 | |
| 119 | dbus_daemon_launch_helper_test_LDADD= \ |
| 120 | $(top_builddir)/dbus/libdbus-internal.la \ |
| 121 | $(DBUS_LAUNCHER_LIBS) |
| 122 | |
| 123 | dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ |
| 124 | dbus_daemon_launch_helper_test_CPPFLAGS= -DDBUS_STATIC_BUILD \ |
| 125 | -DACTIVATION_LAUNCHER_TEST |
| 126 | |
| 127 | ## we build yet another binary so we can do the OOM tests |
| 128 | ## DO NOT INSTALL THIS FILE |
| 129 | bus_test_launch_helper_SOURCES= \ |
| 130 | test-launch-helper.c \ |
| 131 | $(LAUNCH_HELPER_SOURCES) |
| 132 | |
| 133 | bus_test_launch_helper_LDADD= \ |
| 134 | $(top_builddir)/dbus/libdbus-internal.la \ |
| 135 | $(DBUS_LAUNCHER_LIBS) |
| 136 | |
| 137 | bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ |
| 138 | bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \ |
| 139 | -DACTIVATION_LAUNCHER_TEST \ |
| 140 | -DACTIVATION_LAUNCHER_DO_OOM |
| 141 | |
| 142 | extra_tests= |
| 143 | extra_noinst_programs= |
| 144 | extra_inst_programs= |
| 145 | if DBUS_UNIX |
| 146 | extra_tests+=bus-test-launch-helper |
| 147 | extra_noinst_programs+=dbus-daemon-launch-helper dbus-daemon-launch-helper-test dbus-daemon |
| 148 | endif |
| 149 | if DBUS_WIN |
| 150 | extra_inst_programs+=dbus-daemon |
| 151 | endif |
| 152 | |
| 153 | ## note that TESTS has special meaning (stuff to use in make check) |
| 154 | ## so if adding tests not to be run in make check, don't add them to |
| 155 | ## TESTS |
| 156 | if DBUS_BUILD_TESTS |
| 157 | TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus DBUS_FATAL_WARNINGS=1 DBUS_BLOCK_ON_ABORT=1 |
| 158 | TESTS=bus-test bus-test-system $(extra_tests) |
| 159 | else |
| 160 | TESTS= |
| 161 | endif |
| 162 | |
| 163 | ## we use noinst_PROGRAMS not check_PROGRAMS so that we build |
| 164 | ## even when not doing "make check" |
| 165 | noinst_PROGRAMS=$(TESTS) $(extra_noinst_programs) |
| 166 | bin_PROGRAMS=$(extra_inst_programs) |
| 167 | |
| 168 | bus_test_system_SOURCES= \ |
| 169 | $(XML_SOURCES) \ |
| 170 | config-parser-common.c \ |
| 171 | config-parser-common.h \ |
| 172 | config-parser-trivial.c \ |
| 173 | config-parser-trivial.h \ |
| 174 | utils.c \ |
| 175 | utils.h \ |
| 176 | test-system.c |
| 177 | |
| 178 | bus_test_system_CPPFLAGS = -DDBUS_STATIC_BUILD |
| 179 | bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) |
| 180 | bus_test_system_LDFLAGS=@R_DYNAMIC_LDFLAG@ |
| 181 | |
| 182 | bus_test_SOURCES= \ |
| 183 | $(BUS_SOURCES) \ |
| 184 | test-main.c |
| 185 | |
| 186 | bus_test_CPPFLAGS = -DDBUS_STATIC_BUILD |
| 187 | bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) |
| 188 | bus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ |
| 189 | |
| 190 | ## mop up the gcov files |
| 191 | clean-local: |
| 192 | /bin/rm *.bb *.bbg *.da *.gcov || true |
| 193 | |
| 194 | uninstall-hook: |
| 195 | rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) |
| 196 | rm -f $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT) |
| 197 | |
| 198 | install-data-hook: |
| 199 | $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus |
| 200 | $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d |
| 201 | $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d |
| 202 | $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services |
| 203 | $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services |
| 204 | if DBUS_UNIX |
| 205 | if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \ |
| 206 | $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \ |
| 207 | chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \ |
| 208 | fi |
| 209 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR) |
| 210 | $(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1 |
| 211 | if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \ |
| 212 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \ |
| 213 | if test `id -u` -eq 0; then \ |
| 214 | chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \ |
| 215 | chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \ |
| 216 | else \ |
| 217 | echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \ |
| 218 | echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \ |
| 219 | fi \ |
| 220 | fi |
| 221 | endif |
| 222 | if HAVE_SYSTEMD |
| 223 | # Install dbus.socket as default implementation of a D-Bus stack |
| 224 | $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants |
| 225 | $(LN_S) ../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_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket |
| 229 | $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants |
| 230 | $(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service |
| 231 | endif |
| 232 | |
| 233 | #### Init scripts fun |
| 234 | SCRIPT_IN_FILES=messagebus.in \ |
| 235 | messagebus-config.in \ |
| 236 | rc.messagebus.in |
| 237 | |
| 238 | ## Red Hat start |
| 239 | if DBUS_INIT_SCRIPTS_RED_HAT |
| 240 | |
| 241 | initddir=$(sysconfdir)/rc.d/init.d |
| 242 | |
| 243 | initd_SCRIPTS= \ |
| 244 | messagebus |
| 245 | |
| 246 | endif |
| 247 | ## Red Hat end |
| 248 | |
| 249 | ## Slackware start |
| 250 | if DBUS_INIT_SCRIPTS_SLACKWARE |
| 251 | |
| 252 | initddir=$(sysconfdir)/rc.d/ |
| 253 | |
| 254 | initd_SCRIPTS= \ |
| 255 | rc.messagebus |
| 256 | |
| 257 | endif |
| 258 | ## Slackware end |
| 259 | |
| 260 | ## Cygwin start |
| 261 | if DBUS_INIT_SCRIPTS_CYGWIN |
| 262 | |
| 263 | bin_SCRIPTS= \ |
| 264 | messagebus-config |
| 265 | |
| 266 | endif |
| 267 | ## Cygwin end |
| 268 | |
| 269 | if HAVE_SYSTEMD |
| 270 | SCRIPT_IN_FILES += \ |
| 271 | dbus.service.in \ |
| 272 | dbus.socket.in |
| 273 | |
| 274 | systemdsystemunit_DATA = \ |
| 275 | dbus.service \ |
| 276 | dbus.socket |
| 277 | endif |
| 278 | |
| 279 | MAN_IN_FILES=dbus-daemon.1.in |
| 280 | man_MANS = dbus-daemon.1 |
| 281 | |
| 282 | #### Extra dist |
| 283 | |
| 284 | EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES) |