iptables: bump to version 1.6.1
[buildroot-gz.git] / package / systemd / systemd.mk
blob278c8e93cc17d95bb0643b41797283e4ac8c2ae1
1 ################################################################################
3 # systemd
5 ################################################################################
7 SYSTEMD_VERSION = 232
8 SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
9 SYSTEMD_LICENSE = LGPLv2.1+, GPLv2+ (udev), Public Domain (few source files, see README)
10 SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
11 SYSTEMD_INSTALL_STAGING = YES
12 SYSTEMD_DEPENDENCIES = \
13 host-intltool \
14 libcap \
15 util-linux \
16 kmod \
17 host-gperf
19 SYSTEMD_PROVIDES = udev
20 SYSTEMD_AUTORECONF = YES
22 # Make sure that systemd will always be built after busybox so that we have
23 # a consistent init setup between two builds
24 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
25 SYSTEMD_DEPENDENCIES += busybox
26 endif
28 SYSTEMD_CONF_OPTS += \
29 --with-rootprefix= \
30 --enable-blkid \
31 --enable-static=no \
32 --disable-manpages \
33 --disable-pam \
34 --disable-ima \
35 --disable-libcryptsetup \
36 --disable-efi \
37 --disable-gnuefi \
38 --disable-ldconfig \
39 --disable-tests \
40 --disable-coverage \
41 --with-default-dnssec=no \
42 --without-python
44 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
46 # Override path to kmod, used in kmod-static-nodes.service
47 SYSTEMD_CONF_ENV = \
48 CFLAGS="$(SYSTEMD_CFLAGS)" \
49 ac_cv_path_KMOD=/usr/bin/kmod
51 define SYSTEMD_RUN_INTLTOOLIZE
52 cd $(@D) && $(HOST_DIR)/usr/bin/intltoolize --force --automake
53 endef
54 SYSTEMD_PRE_CONFIGURE_HOOKS += SYSTEMD_RUN_INTLTOOLIZE
56 ifeq ($(BR2_PACKAGE_ACL),y)
57 SYSTEMD_CONF_OPTS += --enable-acl
58 SYSTEMD_DEPENDENCIES += acl
59 else
60 SYSTEMD_CONF_OPTS += --disable-acl
61 endif
63 ifeq ($(BR2_PACKAGE_AUDIT),y)
64 SYSTEMD_CONF_OPTS += --enable-audit
65 SYSTEMD_DEPENDENCIES += audit
66 else
67 SYSTEMD_CONF_OPTS += --disable-audit
68 endif
70 ifeq ($(BR2_PACKAGE_LIBIDN),y)
71 SYSTEMD_CONF_OPTS += --enable-libidn
72 SYSTEMD_DEPENDENCIES += libidn
73 else
74 SYSTEMD_CONF_OPTS += --disable-libidn
75 endif
77 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
78 SYSTEMD_CONF_OPTS += --enable-seccomp
79 SYSTEMD_DEPENDENCIES += libseccomp
80 else
81 SYSTEMD_CONF_OPTS += --disable-seccomp
82 endif
84 ifeq ($(BR2_PACKAGE_LIBXKBCOMMON),y)
85 SYSTEMD_CONF_OPTS += --enable-xkbcommon
86 SYSTEMD_DEPENDENCIES += libxkbcommon
87 else
88 SYSTEMD_CONF_OPTS += --disable-xkbcommon
89 endif
91 ifeq ($(BR2_PACKAGE_SYSTEMD_KDBUS),y)
92 SYSTEMD_CONF_OPTS += --enable-kdbus
93 else
94 SYSTEMD_CONF_OPTS += --disable-kdbus
95 endif
97 ifeq ($(BR2_PACKAGE_BZIP2),y)
98 SYSTEMD_DEPENDENCIES += bzip2
99 SYSTEMD_CONF_OPTS += --enable-bzip2
100 else
101 SYSTEMD_CONF_OPTS += --disable-bzip2
102 endif
104 ifeq ($(BR2_PACKAGE_LZ4),y)
105 SYSTEMD_DEPENDENCIES += lz4
106 SYSTEMD_CONF_OPTS += --enable-lz4
107 else
108 SYSTEMD_CONF_OPTS += --disable-lz4
109 endif
111 ifeq ($(BR2_PACKAGE_XZ),y)
112 SYSTEMD_DEPENDENCIES += xz
113 SYSTEMD_CONF_OPTS += --enable-xz
114 else
115 SYSTEMD_CONF_OPTS += --disable-xz
116 endif
118 ifeq ($(BR2_PACKAGE_ZLIB),y)
119 SYSTEMD_DEPENDENCIES += zlib
120 SYSTEMD_CONF_OPTS += --enable-zlib
121 else
122 SYSTEMD_CONF_OPTS += --disable-zlib
123 endif
125 ifeq ($(BR2_PACKAGE_LIBCURL),y)
126 SYSTEMD_DEPENDENCIES += libcurl
127 SYSTEMD_CONF_OPTS += --enable-libcurl
128 else
129 SYSTEMD_CONF_OPTS += --disable-libcurl
130 endif
132 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
133 SYSTEMD_DEPENDENCIES += libgcrypt
134 SYSTEMD_CONF_OPTS += \
135 --enable-gcrypt \
136 --with-libgcrypt-prefix=$(STAGING_DIR)/usr \
137 --with-libgpg-error-prefix=$(STAGING_DIR)/usr
138 else
139 SYSTEMD_CONF_OPTS += --disable-gcrypt
140 endif
142 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
143 SYSTEMD_DEPENDENCIES += libmicrohttpd
144 SYSTEMD_CONF_OPTS += --enable-microhttpd
145 ifeq ($(BR2_PACKAGE_LIBQRENCODE),y)
146 SYSTEMD_CONF_OPTS += --enable-qrencode
147 SYSTEMD_DEPENDENCIES += libqrencode
148 else
149 SYSTEMD_CONF_OPTS += --disable-qrencode
150 endif
151 else
152 SYSTEMD_CONF_OPTS += --disable-microhttpd --disable-qrencode
153 endif
155 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
156 SYSTEMD_DEPENDENCIES += libselinux
157 SYSTEMD_CONF_OPTS += --enable-selinux
158 else
159 SYSTEMD_CONF_OPTS += --disable-selinux
160 endif
162 ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
163 SYSTEMD_CONF_OPTS += --enable-hwdb
164 else
165 SYSTEMD_CONF_OPTS += --disable-hwdb
166 endif
168 ifeq ($(BR2_PACKAGE_SYSTEMD_BINFMT),y)
169 SYSTEMD_CONF_OPTS += --enable-binfmt
170 else
171 SYSTEMD_CONF_OPTS += --disable-binfmt
172 endif
174 ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y)
175 SYSTEMD_CONF_OPTS += --enable-vconsole
176 else
177 SYSTEMD_CONF_OPTS += --disable-vconsole
178 endif
180 ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y)
181 SYSTEMD_CONF_OPTS += --enable-quotacheck
182 else
183 SYSTEMD_CONF_OPTS += --disable-quotacheck
184 endif
186 ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
187 SYSTEMD_CONF_OPTS += --enable-tmpfiles
188 else
189 SYSTEMD_CONF_OPTS += --disable-tmpfiles
190 endif
192 ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y)
193 SYSTEMD_CONF_OPTS += --enable-sysusers
194 else
195 SYSTEMD_CONF_OPTS += --disable-sysusers
196 endif
198 ifeq ($(BR2_PACKAGE_SYSTEMD_FIRSTBOOT),y)
199 SYSTEMD_CONF_OPTS += --enable-firstboot
200 else
201 SYSTEMD_CONF_OPTS += --disable-firstboot
202 endif
204 ifeq ($(BR2_PACKAGE_SYSTEMD_RANDOMSEED),y)
205 SYSTEMD_CONF_OPTS += --enable-randomseed
206 else
207 SYSTEMD_CONF_OPTS += --disable-randomseed
208 endif
210 ifeq ($(BR2_PACKAGE_SYSTEMD_BACKLIGHT),y)
211 SYSTEMD_CONF_OPTS += --enable-backlight
212 else
213 SYSTEMD_CONF_OPTS += --disable-backlight
214 endif
216 ifeq ($(BR2_PACKAGE_SYSTEMD_RFKILL),y)
217 SYSTEMD_CONF_OPTS += --enable-rfkill
218 else
219 SYSTEMD_CONF_OPTS += --disable-rfkill
220 endif
222 ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
223 SYSTEMD_CONF_OPTS += --enable-logind
224 else
225 SYSTEMD_CONF_OPTS += --disable-logind
226 endif
228 ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y)
229 SYSTEMD_CONF_OPTS += --enable-machined
230 else
231 SYSTEMD_CONF_OPTS += --disable-machined
232 endif
234 ifeq ($(BR2_PACKAGE_SYSTEMD_IMPORTD),y)
235 SYSTEMD_CONF_OPTS += --enable-importd
236 else
237 SYSTEMD_CONF_OPTS += --disable-importd
238 endif
240 ifeq ($(BR2_PACKAGE_SYSTEMD_HOSTNAMED),y)
241 SYSTEMD_CONF_OPTS += --enable-hostnamed
242 else
243 SYSTEMD_CONF_OPTS += --disable-hostnamed
244 endif
246 ifeq ($(BR2_PACKAGE_SYSTEMD_MYHOSTNAME),y)
247 SYSTEMD_CONF_OPTS += --enable-myhostname
248 else
249 SYSTEMD_CONF_OPTS += --disable-myhostname
250 endif
252 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMEDATED),y)
253 SYSTEMD_CONF_OPTS += --enable-timedated
254 else
255 SYSTEMD_CONF_OPTS += --disable-timedated
256 endif
258 ifeq ($(BR2_PACKAGE_SYSTEMD_LOCALED),y)
259 SYSTEMD_CONF_OPTS += --enable-localed
260 else
261 SYSTEMD_CONF_OPTS += --disable-localed
262 endif
264 ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y)
265 SYSTEMD_CONF_OPTS += --enable-coredump
266 SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * /var/lib/systemd/coredump - - Core Dumper
267 else
268 SYSTEMD_CONF_OPTS += --disable-coredump
269 endif
271 ifeq ($(BR2_PACKAGE_SYSTEMD_POLKIT),y)
272 SYSTEMD_CONF_OPTS += --enable-polkit
273 else
274 SYSTEMD_CONF_OPTS += --disable-polkit
275 endif
277 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
278 SYSTEMD_CONF_OPTS += --enable-networkd
279 SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - Network Manager
280 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
281 ln -sf ../run/systemd/resolve/resolv.conf \
282 $(TARGET_DIR)/etc/resolv.conf
283 endef
284 else
285 SYSTEMD_CONF_OPTS += --disable-networkd
286 define SYSTEMD_INSTALL_SERVICE_NETWORK
287 $(INSTALL) -D -m 644 package/systemd/network.service \
288 $(TARGET_DIR)/etc/systemd/system/network.service
289 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
290 ln -fs ../network.service \
291 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
292 endef
293 endif
295 ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
296 SYSTEMD_CONF_OPTS += --enable-resolved
297 SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
298 else
299 SYSTEMD_CONF_OPTS += --disable-resolved
300 endif
302 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
303 SYSTEMD_CONF_OPTS += --enable-timesyncd
304 SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
305 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
306 mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
307 ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
308 $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
309 endef
310 else
311 SYSTEMD_CONF_OPTS += --disable-timesyncd
312 endif
314 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
315 SYSTEMD_CONF_OPTS += --enable-smack
316 else
317 SYSTEMD_CONF_OPTS += --disable-smack
318 endif
320 ifeq ($(BR2_PACKAGE_SYSTEMD_HIBERNATE),y)
321 SYSTEMD_CONF_OPTS += --enable-hibernate
322 else
323 SYSTEMD_CONF_OPTS += --disable-hibernate
324 endif
326 define SYSTEMD_INSTALL_INIT_HOOK
327 ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
328 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
329 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
330 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
332 ln -fs ../../../lib/systemd/system/multi-user.target \
333 $(TARGET_DIR)/etc/systemd/system/default.target
334 endef
336 define SYSTEMD_INSTALL_MACHINEID_HOOK
337 touch $(TARGET_DIR)/etc/machine-id
338 endef
340 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
341 SYSTEMD_INSTALL_INIT_HOOK \
342 SYSTEMD_INSTALL_MACHINEID_HOOK \
343 SYSTEMD_INSTALL_RESOLVCONF_HOOK
345 define SYSTEMD_USERS
346 - - input -1 * - - - Input device group
347 - - systemd-journal -1 * - - - Journal
348 systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
349 systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
350 systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
351 systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
352 $(SYSTEMD_COREDUMP_USER)
353 $(SYSTEMD_NETWORKD_USER)
354 $(SYSTEMD_RESOLVED_USER)
355 $(SYSTEMD_TIMESYNCD_USER)
356 endef
358 define SYSTEMD_DISABLE_SERVICE_TTY1
359 rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
360 endef
362 ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
363 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
364 # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
365 define SYSTEMD_INSTALL_SERVICE_TTY
366 if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
367 then \
368 SERVICE="getty"; \
369 else \
370 SERVICE="serial-getty"; \
371 fi; \
372 ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
373 $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
374 if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
375 then \
376 $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
378 endef
379 endif
381 define SYSTEMD_INSTALL_INIT_SYSTEMD
382 $(SYSTEMD_DISABLE_SERVICE_TTY1)
383 $(SYSTEMD_INSTALL_SERVICE_TTY)
384 $(SYSTEMD_INSTALL_SERVICE_NETWORK)
385 $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
386 endef
388 $(eval $(autotools-package))