kumquat-buildroot/package/systemd/systemd.mk
Thomas Petazzoni 55ad3cfd3f systemd: fix build with uClibc toolchains
Currently, the build of systemd is broken with the internal toolchain
backend, because we have uClibc patches that add support for
execvpe(), but we also have a patch for systemd that adds execvpe(),
which was added when the internal uClibc didn't support execvpe().

However, simply dropping the patch is not a solution, as it would
break the build of systemd with any other uClibc than the ones built
with Buildroot. For example, a Crosstool-NG uClibc toolchain would
fail.

Beyond this execvpe() problem, there are also other problems that
prevented systemd from being built with unpatched uClibc.

This patch does the following:

 * Add sequence numbers of systemd patches.
 * Regenerate them to avoid fuzz.
 * Improve the uClibc compatibility patch so that it:
   - Detects whether execvpe() is available or not, and if not
     available provide an implementation.
   - Detects if dup3() is available or not, and if not available
     provide an implementation.
   - Detects if MSG_CMSG_CLOEXEC is defined or not, and if not, define
     it to the appropriate value.

This has been tested with uClibc internal toolchain, uClibc external
toolchain built with Buildroot, uClibc external toolchain built with
Crosstool-NG, and glibc external toolchain.

Fixes bug #6776.

Fixes:

  http://autobuild.buildroot.org/results/591/591c6055430da334bd1e46e7d01497add45da837/build-end.log
  http://autobuild.buildroot.org/results/e58/e5851939d2837d4e35a4c1d9ca6df3c93ed5a34b/build-end.log
  http://autobuild.buildroot.org/results/92e/92e4c40c69a3feb4046b2fe5a0d8c69d5a44a157/build-end.log

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-13 21:51:08 +01:00

81 lines
2.3 KiB
Makefile

################################################################################
#
# systemd
#
################################################################################
SYSTEMD_VERSION = 44
SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.xz
SYSTEMD_LICENSE = GPLv2+
SYSTEMD_LICENSE_FILES = LICENSE
SYSTEMD_INSTALL_STAGING = YES
SYSTEMD_DEPENDENCIES = \
host-intltool \
libcap \
udev \
dbus
# Make sure that systemd will always be built after busybox so that we have
# a consistent init setup between two builds
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
SYSTEMD_DEPENDENCIES += busybox
endif
SYSTEMD_AUTORECONF = YES
SYSTEMD_CONF_OPT += \
--with-distro=other \
--disable-selinux \
--disable-pam \
--disable-libcryptsetup \
--disable-gtk \
--disable-plymouth \
--with-rootdir=/ \
--with-dbuspolicydir=/etc/dbus-1/system.d \
--with-dbussessionservicedir=/usr/share/dbus-1/services \
--with-dbussystemservicedir=/usr/share/dbus-1/system-services \
--with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
--with-udevrulesdir=/etc/udev/rules.d \
--with-sysvinit-path=/etc/init.d/ \
--without-sysvrcd-path \
--enable-split-usr
ifeq ($(BR2_PACKAGE_ACL),y)
SYSTEMD_CONF_OPT += --enable-acl
SYSTEMD_DEPENDENCIES += acl
else
SYSTEMD_CONF_OPT += --disable-acl
endif
ifneq ($(BR2_LARGEFILE),y)
SYSTEMD_CONF_OPT += --disable-largefile
endif
# mq_getattr needs -lrt
SYSTEMD_MAKE_OPT += LIBS=-lrt
SYSTEMD_MAKE_OPT += LDFLAGS+=-ldl
ifeq ($(BR2_INIT_SYSTEMD),y)
define SYSTEMD_INSTALL_INIT_HOOK
ln -fs ../usr/lib/systemd/systemd $(TARGET_DIR)/sbin/init
ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/halt
ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/poweroff
ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/reboot
ln -fs ../../../usr/lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
endef
SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
SYSTEMD_INSTALL_INIT_HOOK
endif
define SYSTEMD_INSTALL_TTY_HOOK
rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
ln -fs ../../../../usr/lib/systemd/system/serial-getty@.service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
endef
SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
SYSTEMD_INSTALL_TTY_HOOK \
$(eval $(autotools-package))