xref: /OK3568_Linux_fs/buildroot/package/util-linux/util-linux.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# util-linux
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# When making changes to this file, please check if
8*4882a593Smuzhiyun# util-linux-libs/util-linux-libs.mk needs to be updated accordingly as well.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunUTIL_LINUX_VERSION_MAJOR = 2.37
11*4882a593SmuzhiyunUTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).2
12*4882a593SmuzhiyunUTIL_LINUX_SOURCE = util-linux-$(UTIL_LINUX_VERSION).tar.xz
13*4882a593SmuzhiyunUTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERSION_MAJOR)
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# README.licensing claims that some files are GPL-2.0 only, but this is not
16*4882a593Smuzhiyun# true. Some files are GPL-3.0+ but only in tests and optionally in hwclock
17*4882a593Smuzhiyun# (but we disable that option). rfkill uses an ISC-style license.
18*4882a593SmuzhiyunUTIL_LINUX_LICENSE = GPL-2.0+, BSD-4-Clause, LGPL-2.1+ (libblkid, libfdisk, libmount), BSD-3-Clause (libuuid), ISC (rfkill)
19*4882a593SmuzhiyunUTIL_LINUX_LICENSE_FILES = README.licensing \
20*4882a593Smuzhiyun	Documentation/licenses/COPYING.BSD-3-Clause \
21*4882a593Smuzhiyun	Documentation/licenses/COPYING.BSD-4-Clause-UC \
22*4882a593Smuzhiyun	Documentation/licenses/COPYING.GPL-2.0-or-later \
23*4882a593Smuzhiyun	Documentation/licenses/COPYING.ISC \
24*4882a593Smuzhiyun	Documentation/licenses/COPYING.LGPL-2.1-or-later
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunUTIL_LINUX_CPE_ID_VENDOR = kernel
27*4882a593SmuzhiyunUTIL_LINUX_INSTALL_STAGING = YES
28*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES = \
29*4882a593Smuzhiyun	host-pkgconf \
30*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBS),util-linux-libs) \
31*4882a593Smuzhiyun	$(TARGET_NLS_DEPENDENCIES)
32*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += \
33*4882a593Smuzhiyun	--disable-rpath \
34*4882a593Smuzhiyun	--disable-makeinstall-chown
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunUTIL_LINUX_LINK_LIBS = $(TARGET_NLS_LIBS)
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunHOST_UTIL_LINUX_DEPENDENCIES = host-pkgconf
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun# We also don't want the host-python dependency
41*4882a593SmuzhiyunHOST_UTIL_LINUX_CONF_OPTS = \
42*4882a593Smuzhiyun	--without-systemd \
43*4882a593Smuzhiyun	--with-systemdsystemunitdir=no \
44*4882a593Smuzhiyun	--without-python
45*4882a593Smuzhiyun
46*4882a593Smuzhiyunifneq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_CRAMFS)$(BR2_PACKAGE_UTIL_LINUX_FSCK)$(BR2_PACKAGE_UTIL_LINUX_LOSETUP),)
47*4882a593SmuzhiyunUTIL_LINUX_SELINUX_MODULES = fstools
48*4882a593Smuzhiyunendif
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun# Prevent the installation from attempting to move shared libraries from
51*4882a593Smuzhiyun# ${usrlib_execdir} (/usr/lib) to ${libdir} (/lib), since both paths are
52*4882a593Smuzhiyun# the same when merged usr is in use.
53*4882a593Smuzhiyunifeq ($(BR2_ROOTFS_MERGED_USR),y)
54*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib
55*4882a593Smuzhiyunendif
56*4882a593Smuzhiyun
57*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SYSTEMD),y)
58*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-systemd --with-systemdsystemunitdir=/usr/lib/systemd/system
59*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += systemd
60*4882a593Smuzhiyunelse
61*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-systemd --with-systemdsystemunitdir=no
62*4882a593Smuzhiyunendif
63*4882a593Smuzhiyun
64*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_HAS_UDEV),y)
65*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-udev
66*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += udev
67*4882a593Smuzhiyunelse
68*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-udev
69*4882a593Smuzhiyunendif
70*4882a593Smuzhiyun
71*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NCURSES),y)
72*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += ncurses
73*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
74*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-ncursesw
75*4882a593SmuzhiyunUTIL_LINUX_CONF_ENV += NCURSESW6_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
76*4882a593Smuzhiyunelse
77*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-ncursesw --with-ncurses --disable-widechar
78*4882a593SmuzhiyunUTIL_LINUX_CONF_ENV += NCURSES6_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
79*4882a593Smuzhiyunendif
80*4882a593Smuzhiyunelse
81*4882a593Smuzhiyunifeq ($(BR2_USE_WCHAR),y)
82*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --enable-widechar
83*4882a593Smuzhiyunelse
84*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --disable-widechar
85*4882a593Smuzhiyunendif
86*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-ncursesw --without-ncurses
87*4882a593Smuzhiyunendif
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun# Unfortunately, the util-linux does LIBS="" at the end of its
90*4882a593Smuzhiyun# configure script. So we have to pass the proper LIBS value when
91*4882a593Smuzhiyun# calling the configure script to make configure tests pass properly,
92*4882a593Smuzhiyun# and then pass it again at build time.
93*4882a593SmuzhiyunUTIL_LINUX_CONF_ENV += LIBS="$(UTIL_LINUX_LINK_LIBS)"
94*4882a593SmuzhiyunUTIL_LINUX_MAKE_OPTS += LIBS="$(UTIL_LINUX_LINK_LIBS)"
95*4882a593Smuzhiyun
96*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBSELINUX),y)
97*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += libselinux
98*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-selinux
99*4882a593Smuzhiyunelse
100*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-selinux
101*4882a593Smuzhiyundefine UTIL_LINUX_SELINUX_PAMFILES_TWEAK
102*4882a593Smuzhiyun	$(foreach f,su su-l,
103*4882a593Smuzhiyun		$(SED) '/^.*pam_selinux.so.*$$/d' \
104*4882a593Smuzhiyun			$(TARGET_DIR)/etc/pam.d/$(f)
105*4882a593Smuzhiyun	)
106*4882a593Smuzhiyunendef
107*4882a593Smuzhiyunendif
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun# Used by setpriv
110*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBCAP_NG),libcap-ng)
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun# Used by cramfs utils
113*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun# Used by login-utils
116*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun# Used by hardlink
119*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_PCRE2),pcre2)
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun# Disable/Enable utilities
122*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += \
123*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_BINARIES),--enable-all-programs,--disable-all-programs) \
124*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
125*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
126*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
127*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
128*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_CHMEM),--enable-chmem,--disable-chmem) \
129*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
130*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
131*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
132*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
133*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
134*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_HARDLINK),--enable-hardlink,--disable-hardlink) \
135*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock --disable-hwclock-gplv3,--disable-hwclock) \
136*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
137*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
138*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
139*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
140*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
141*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBFDISK),--enable-libfdisk,--disable-libfdisk) \
142*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),--enable-libmount,--disable-libmount) \
143*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS),--enable-libsmartcols,--disable-libsmartcols) \
144*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
145*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
146*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
147*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN),--enable-login,--disable-login) \
148*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
149*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
150*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LSMEM),--enable-lsmem,--disable-lsmem) \
151*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
152*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
153*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
154*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNT),--enable-mount,--disable-mount) \
155*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT),--enable-mountpoint,--disable-mountpoint) \
156*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_NEWGRP),--enable-newgrp,--disable-newgrp) \
157*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
158*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
159*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
160*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
161*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
162*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
163*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
164*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_RFKILL),--enable-rfkill,--disable-rfkill) \
165*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_RUNUSER),--enable-runuser,--disable-runuser) \
166*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS),--enable-schedutils,--disable-schedutils) \
167*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SETPRIV),--enable-setpriv,--disable-setpriv) \
168*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SETTERM),--enable-setterm,--disable-setterm) \
169*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SU),--enable-su,--disable-su) \
170*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SULOGIN),--enable-sulogin,--disable-sulogin) \
171*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT),--enable-switch_root,--disable-switch_root) \
172*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_TUNELP),--enable-tunelp,--disable-tunelp) \
173*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_UL),--enable-ul,--disable-ul) \
174*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_UNSHARE),--enable-unshare,--disable-unshare) \
175*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP),--enable-utmpdump,--disable-utmpdump) \
176*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_UUIDD),--enable-uuidd,--disable-uuidd) \
177*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_VIPW),--enable-vipw,--disable-vipw) \
178*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_WALL),--enable-wall,--disable-wall) \
179*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
180*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_WIPEFS),--enable-wipefs,--disable-wipefs) \
181*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
182*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun# In the host version of util-linux, we only require libuuid and
185*4882a593Smuzhiyun# libmount (plus libblkid as an indirect dependency of libmount).
186*4882a593Smuzhiyun# So disable all of the programs, unless BR2_PACKAGE_HOST_UTIL_LINUX is set
187*4882a593Smuzhiyun
188*4882a593SmuzhiyunHOST_UTIL_LINUX_CONF_OPTS += \
189*4882a593Smuzhiyun	--enable-libblkid \
190*4882a593Smuzhiyun	--enable-libmount \
191*4882a593Smuzhiyun	--enable-libuuid \
192*4882a593Smuzhiyun	--without-libmagic \
193*4882a593Smuzhiyun	--without-ncurses \
194*4882a593Smuzhiyun	--without-ncursesw \
195*4882a593Smuzhiyun	--without-tinfo
196*4882a593Smuzhiyun
197*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_HOST_UTIL_LINUX),y)
198*4882a593SmuzhiyunHOST_UTIL_LINUX_CONF_OPTS += --disable-makeinstall-chown
199*4882a593Smuzhiyun# disable commands that have ncurses dependency, as well as
200*4882a593Smuzhiyun# other ones that are useless on the host
201*4882a593SmuzhiyunHOST_UTIL_LINUX_CONF_OPTS += \
202*4882a593Smuzhiyun	--disable-agetty \
203*4882a593Smuzhiyun	--disable-chfn-chsh \
204*4882a593Smuzhiyun	--disable-chmem \
205*4882a593Smuzhiyun	--disable-login \
206*4882a593Smuzhiyun	--disable-lslogins \
207*4882a593Smuzhiyun	--disable-mesg \
208*4882a593Smuzhiyun	--disable-more \
209*4882a593Smuzhiyun	--disable-newgrp \
210*4882a593Smuzhiyun	--disable-nologin \
211*4882a593Smuzhiyun	--disable-nsenter \
212*4882a593Smuzhiyun	--disable-pg \
213*4882a593Smuzhiyun	--disable-rfkill \
214*4882a593Smuzhiyun	--disable-runuser \
215*4882a593Smuzhiyun	--disable-schedutils \
216*4882a593Smuzhiyun	--disable-setpriv \
217*4882a593Smuzhiyun	--disable-setterm \
218*4882a593Smuzhiyun	--disable-su \
219*4882a593Smuzhiyun	--disable-sulogin \
220*4882a593Smuzhiyun	--disable-tunelp \
221*4882a593Smuzhiyun	--disable-ul \
222*4882a593Smuzhiyun	--disable-unshare \
223*4882a593Smuzhiyun	--disable-uuidd \
224*4882a593Smuzhiyun	--disable-vipw \
225*4882a593Smuzhiyun	--disable-wall \
226*4882a593Smuzhiyun	--disable-wdctl \
227*4882a593Smuzhiyun	--disable-write \
228*4882a593Smuzhiyun	--disable-zramctl
229*4882a593Smuzhiyun# Used by cramfs utils
230*4882a593SmuzhiyunHOST_UTIL_LINUX_DEPENDENCIES += host-zlib
231*4882a593Smuzhiyunelse
232*4882a593SmuzhiyunHOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
233*4882a593Smuzhiyunendif
234*4882a593Smuzhiyun
235*4882a593Smuzhiyun# Install libmount Python bindings
236*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
237*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-python
238*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3)
239*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
240*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --enable-pylibmount
241*4882a593Smuzhiyunelse
242*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --disable-pylibmount
243*4882a593Smuzhiyunendif
244*4882a593Smuzhiyunelse
245*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-python
246*4882a593Smuzhiyunendif
247*4882a593Smuzhiyun
248*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_READLINE),y)
249*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-readline
250*4882a593SmuzhiyunUTIL_LINUX_LINK_LIBS += $(if $(BR2_STATIC_LIBS),-lcurses)
251*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += readline
252*4882a593Smuzhiyunelse
253*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-readline
254*4882a593Smuzhiyunendif
255*4882a593Smuzhiyun
256*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_AUDIT),y)
257*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-audit
258*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += audit
259*4882a593Smuzhiyunelse
260*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-audit
261*4882a593Smuzhiyunendif
262*4882a593Smuzhiyun
263*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FILE),y)
264*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --with-libmagic
265*4882a593SmuzhiyunUTIL_LINUX_DEPENDENCIES += file
266*4882a593Smuzhiyunelse
267*4882a593SmuzhiyunUTIL_LINUX_CONF_OPTS += --without-libmagic
268*4882a593Smuzhiyunendif
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun# Install PAM configuration files
271*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_UTIL_LINUX_SU)$(BR2_PACKAGE_LINUX_PAM),yy)
272*4882a593Smuzhiyundefine UTIL_LINUX_INSTALL_PAMFILES
273*4882a593Smuzhiyun	$(INSTALL) -D -m 0644 package/util-linux/su.pam \
274*4882a593Smuzhiyun		$(TARGET_DIR)/etc/pam.d/su
275*4882a593Smuzhiyun	$(INSTALL) -D -m 0644 package/util-linux/su.pam \
276*4882a593Smuzhiyun		$(TARGET_DIR)/etc/pam.d/su-l
277*4882a593Smuzhiyun	$(UTIL_LINUX_SELINUX_PAMFILES_TWEAK)
278*4882a593Smuzhiyunendef
279*4882a593SmuzhiyunUTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
280*4882a593Smuzhiyunendif
281*4882a593Smuzhiyun
282*4882a593Smuzhiyun# Install agetty->getty symlink to avoid breakage when there's no busybox
283*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
284*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_BUSYBOX),)
285*4882a593Smuzhiyundefine UTIL_LINUX_GETTY_SYMLINK
286*4882a593Smuzhiyun	ln -sf agetty $(TARGET_DIR)/sbin/getty
287*4882a593Smuzhiyunendef
288*4882a593Smuzhiyunendif
289*4882a593Smuzhiyunendif
290*4882a593Smuzhiyun
291*4882a593SmuzhiyunUTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun$(eval $(autotools-package))
294*4882a593Smuzhiyun$(eval $(host-autotools-package))
295*4882a593Smuzhiyun
296*4882a593Smuzhiyun# Must be included after the autotools-package call, to make sure all variables
297*4882a593Smuzhiyun# are available
298*4882a593Smuzhiyuninclude package/util-linux/util-linux-libs/util-linux-libs.mk
299