buildrootschalter/package/util-linux/util-linux.mk

149 lines
6.4 KiB
Makefile
Raw Normal View History

################################################################################
#
# util-linux
#
################################################################################
UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).1
UTIL_LINUX_VERSION_MAJOR = 2.25
UTIL_LINUX_SOURCE = util-linux-$(UTIL_LINUX_VERSION).tar.xz
UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERSION_MAJOR)
# README.licensing claims that some files are GPLv2-only, but this is not true.
# Some files are GPLv3+ but only in tests.
UTIL_LINUX_LICENSE = GPLv2+, BSD-4c, libblkid and libmount LGPLv2.1+, libuuid BSD-3c
UTIL_LINUX_LICENSE_FILES = README.licensing Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.UCB Documentation/licenses/COPYING.LGPLv2.1 Documentation/licenses/COPYING.BSD-3
UTIL_LINUX_AUTORECONF = YES
UTIL_LINUX_INSTALL_STAGING = YES
UTIL_LINUX_DEPENDENCIES = host-pkgconf
UTIL_LINUX_CONF_ENV = scanf_cv_type_modifier=no
UTIL_LINUX_CONF_OPT += \
--disable-rpath \
--disable-makeinstall-chown \
--disable-bash-completion \
--without-python
2009-03-03 09:52:56 +01:00
# We don't want the host-busybox dependency to be added automatically
HOST_UTIL_LINUX_DEPENDENCIES = host-pkgconf
# We also don't want the host-python dependency
HOST_UTIL_LINUX_CONF_OPT = --without-python
# If both util-linux and busybox are selected, make certain util-linux
# wins the fight over who gets to have their utils actually installed
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
UTIL_LINUX_DEPENDENCIES += busybox
endif
ifeq ($(BR2_PACKAGE_NCURSES),y)
UTIL_LINUX_DEPENDENCIES += ncurses
else
UTIL_LINUX_CONF_OPT += --without-ncurses
endif
ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
UTIL_LINUX_DEPENDENCIES += gettext
UTIL_LINUX_MAKE_OPT += LIBS=-lintl
endif
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
UTIL_LINUX_DEPENDENCIES += libcap-ng
endif
# Used by cramfs utils
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
# Used by login-utils
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
# Disable/Enable utilities
UTIL_LINUX_CONF_OPT += \
$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
$(if $(BR2_PACKAGE_UTIL_LINUX_ARCH),--enable-arch,--disable-arch) \
$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
$(if $(BR2_PACKAGE_UTIL_LINUX_DDATE),--enable-ddate,--disable-ddate) \
$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),--enable-libmount,--disable-libmount) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-su --enable-sulogin,--disable-last --disable-login --disable-su --disable-sulogin) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNT),--enable-mount,--disable-mount) \
$(if $(BR2_PACKAGE_UTIL_LINUX_NEWGRP),--enable-newgrp,--disable-newgrp) \
$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RESET),--enable-reset,--disable-reset) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS),--enable-schedutils,--disable-schedutils) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT),--enable-switch_root,--disable-switch_root) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UNSHARE),--enable-unshare,--disable-unshare) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP),--enable-utmpdump,--disable-utmpdump) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UUIDD),--enable-uuidd,--disable-uuidd) \
$(if $(BR2_PACKAGE_UTIL_LINUX_VIPW),--enable-vipw,--disable-vipw) \
$(if $(BR2_PACKAGE_UTIL_LINUX_WALL),--enable-wall,--disable-wall) \
$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write)
# In the host version of util-linux, we so far only require libuuid,
# and none of the util-linux utilities, so we disable all of them.
HOST_UTIL_LINUX_CONF_OPT += \
--enable-libuuid \
--disable-agetty --disable-cramfs --disable-fallocate \
--disable-fsck --disable-libblkid --disable-libmount \
util-linux: disable more command for host build Fixes the following compile error (in case neither curses or ncurses development files are installed on the build host): text-utils/more.c: In function ‘screen’: text-utils/more.c:692:4: warning: implicit declaration of function ‘my_putstring’ [-Wimplicit-function-declaration] text-utils/more.c:692:4: warning: nested extern declaration of ‘my_putstring’ [-Wnested-externs] text-utils/more.c: In function ‘initterm’: text-utils/more.c:1798:3: warning: implicit declaration of function ‘my_setupterm’ [-Wimplicit-function-declaration] text-utils/more.c:1798:3: warning: nested extern declaration of ‘my_setupterm’ [-Wnested-externs] text-utils/more.c:1806:5: warning: implicit declaration of function ‘my_tgetnum’ [-Wimplicit-function-declaration] text-utils/more.c:1806:5: warning: nested extern declaration of ‘my_tgetnum’ [-Wnested-externs] text-utils/more.c:1806:22: error: ‘TERM_LINES’ undeclared (first use in this function) text-utils/more.c:1806:22: note: each undeclared identifier is reported only once for each function it appears in text-utils/more.c:1807:23: error: ‘TERM_COLS’ undeclared (first use in this function) text-utils/more.c:1816:4: warning: implicit declaration of function ‘my_tgetflag’ [-Wimplicit-function-declaration] text-utils/more.c:1816:4: warning: nested extern declaration of ‘my_tgetflag’ [-Wnested-externs] text-utils/more.c:1816:34: error: ‘TERM_HARD_COPY’ undeclared (first use in this function) text-utils/more.c:1821:20: error: ‘TERM_EAT_NEW_LINE’ undeclared (first use in this function) text-utils/more.c:1827:23: error: ‘TERM_AUTO_RIGHT_MARGIN’ undeclared (first use in this function) text-utils/more.c:1828:25: error: ‘TERM_CEOL’ undeclared (first use in this function) text-utils/more.c:1829:4: warning: implicit declaration of function ‘my_tgetstr’ [-Wimplicit-function-declaration] text-utils/more.c:1829:4: warning: nested extern declaration of ‘my_tgetstr’ [-Wnested-externs] text-utils/more.c:1829:25: error: ‘TERM_CLEAR_TO_LINE_END’ undeclared (first use in this function) text-utils/more.c:1830:23: error: ‘TERM_CLEAR’ undeclared (first use in this function) text-utils/more.c:1831:24: error: ‘TERM_STANDARD_MODE’ undeclared (first use in this function) text-utils/more.c:1832:23: error: ‘TERM_EXIT_STANDARD_MODE’ undeclared (first use in this function) text-utils/more.c:1833:31: error: ‘TERM_STD_MODE_GLITCH’ undeclared (first use in this function) text-utils/more.c:1842:20: error: ‘TERM_UNDERLINE’ undeclared (first use in this function) text-utils/more.c:1843:23: error: ‘TERM_OVER_STRIKE’ undeclared (first use in this function) text-utils/more.c:1845:27: error: ‘TERM_UNDERLINE_CHAR’ undeclared (first use in this function) text-utils/more.c:1848:21: error: ‘TERM_ENTER_UNDERLINE’ undeclared (first use in this function) text-utils/more.c:1850:17: error: ‘TERM_EXIT_UNDERLINE’ undeclared (first use in this function) text-utils/more.c:1862:29: error: ‘TERM_PAD_CHAR’ undeclared (first use in this function) text-utils/more.c:1864:22: error: ‘TERM_HOME’ undeclared (first use in this function) text-utils/more.c:1867:21: error: ‘TERM_CURSOR_ADDRESS’ undeclared (first use in this function) text-utils/more.c:1869:10: warning: implicit declaration of function ‘my_tgoto’ [-Wimplicit-function-declaration] text-utils/more.c:1869:10: warning: nested extern declaration of ‘my_tgoto’ [-Wnested-externs] text-utils/more.c:1869:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] text-utils/more.c:1876:24: error: ‘TERM_CLEAR_TO_SCREEN_END’ undeclared (first use in this function) text-utils/more.c:1877:27: error: ‘TERM_LINE_DOWN’ undeclared (first use in this function) text-utils/more.c: In function ‘reset_tty’: text-utils/more.c:2142:3: warning: implicit declaration of function ‘tputs’ [-Wimplicit-function-declaration] text-utils/more.c:2142:3: warning: nested extern declaration of ‘tputs’ [-Wnested-externs] make[4]: *** [text-utils/more-more.o] Error 1 Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-09-22 22:54:50 +02:00
--disable-login --disable-mount --disable-more --disable-partx \
--disable-pivot_root --disable-rename --disable-schedutils \
--disable-su --disable-switch_root --disable-unshare \
--disable-uuidd --disable-wall --without-ncurses
# Avoid building the tools if they are disabled since we can't install on
# a per-directory basis.
ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
define UTIL_LINUX_DISABLE_TOOLS
$(SED) '/schedutils/d' -e '/text-utils/d' -e '/term-utils/d' \
-e '/login-utils/d' -e '/mount-deprecated/d' \
-e '/sys-utils/d' -e '/misc-utils/d' -e '/disk-utils/d' \
-e '/fdisks/d' $(@D)/Makefile.am
endef
UTIL_LINUX_PRE_PATCH_HOOKS += UTIL_LINUX_DISABLE_TOOLS
endif
# Install PAM configuration files
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),y)
define UTIL_LINUX_INSTALL_PAMFILES
$(INSTALL) -m 0644 package/util-linux/login.pam \
$(TARGET_DIR)/etc/pam.d/login
$(INSTALL) -m 0644 package/util-linux/su.pam \
$(TARGET_DIR)/etc/pam.d/su
$(INSTALL) -m 0644 package/util-linux/su.pam \
$(TARGET_DIR)/etc/pam.d/su-l
endef
endif
UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
# Install agetty->getty symlink to avoid breakage when there's no busybox
ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
ifeq ($(BR2_PACKAGE_BUSYBOX),)
define UTIL_LINUX_GETTY_SYMLINK
ln -sf agetty $(TARGET_DIR)/sbin/getty
endef
endif
endif
UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK
$(eval $(autotools-package))
$(eval $(host-autotools-package))
# MKINSTALLDIRS comes from tweaked m4/nls.m4, but autoreconf uses staging
# one, so it disappears
UTIL_LINUX_INSTALL_STAGING_OPT += MKINSTALLDIRS=$(@D)/config/mkinstalldirs
UTIL_LINUX_INSTALL_TARGET_OPT += MKINSTALLDIRS=$(@D)/config/mkinstalldirs
HOST_UTIL_LINUX_INSTALL_OPT += MKINSTALLDIRS=$(@D)/config/mkinstalldirs