mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
util-linux: fix ncurses/wchar handling
Since commit 006a328ad6bed214ec3c4d92120510ea37329dd1 ("util-linux: fix build with ncurses"), we have a build failure that occurs with musl toolchains when wide-char support is not enabled in ncurses. The problem comes from the fact that musl provides wchar support (so it defines wchar_t). But when ncursesw is not available, we currently pass --disable-widechar which tells util-linux that wchar support is not available at all (not only in ncurses). When this gets passed to util-linux configure script, then it defines its own wchar_t, which conflicts with the musl definition. So, we should not pass --disable-widechar when BR2_USE_WCHAR=y, which is what this commit does: it moves the BR2_USE_WCHAR logic outside of the ncurses logic, and passes --enable-widechar/--disable-widechar as appropriate. However, there's a gotcha: util-linux really wants the ncursesw variant of ncurses when the system has wchar support enabled. We take this into account by: - Enabling ncursesw when BR2_PACKAGE_NCURSES_WCHAR=y. In this case, we have ncurses and we have BR2_USE_WCHAR=y, so everything is fine. - Otherwise, enabling ncurses when BR2_PACKAGE_NCURSES=y but BR2_USE_WCHAR is disabled. To make sure that the existing util-linux programs that need ncurses support still build fine, we adjust the Config.in to select BR2_PACKAGE_NCURSES_WCHAR on BR2_USE_WCHAR=y configurations. Fixes: http://autobuild.buildroot.net/results/19de2a0b12380ddc86dbba0dae3a3877b25f83ff/ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
3b2c814aeb
commit
5a18eabdf0
@ -207,6 +207,7 @@ config BR2_PACKAGE_UTIL_LINUX_MORE
|
|||||||
bool "more"
|
bool "more"
|
||||||
depends on BR2_USE_MMU # fork()
|
depends on BR2_USE_MMU # fork()
|
||||||
select BR2_PACKAGE_NCURSES
|
select BR2_PACKAGE_NCURSES
|
||||||
|
select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR
|
||||||
help
|
help
|
||||||
File perusal filter for crt viewing
|
File perusal filter for crt viewing
|
||||||
|
|
||||||
@ -252,6 +253,7 @@ config BR2_PACKAGE_UTIL_LINUX_PG
|
|||||||
bool "pg"
|
bool "pg"
|
||||||
depends on BR2_USE_MMU # fork()
|
depends on BR2_USE_MMU # fork()
|
||||||
select BR2_PACKAGE_NCURSES
|
select BR2_PACKAGE_NCURSES
|
||||||
|
select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR
|
||||||
help
|
help
|
||||||
Browse pagewise through text files
|
Browse pagewise through text files
|
||||||
|
|
||||||
@ -298,6 +300,7 @@ config BR2_PACKAGE_UTIL_LINUX_SETPRIV
|
|||||||
config BR2_PACKAGE_UTIL_LINUX_SETTERM
|
config BR2_PACKAGE_UTIL_LINUX_SETTERM
|
||||||
bool "setterm"
|
bool "setterm"
|
||||||
select BR2_PACKAGE_NCURSES
|
select BR2_PACKAGE_NCURSES
|
||||||
|
select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR
|
||||||
help
|
help
|
||||||
Set terminal attributes
|
Set terminal attributes
|
||||||
|
|
||||||
@ -310,12 +313,14 @@ config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
|
|||||||
config BR2_PACKAGE_UTIL_LINUX_TUNELP
|
config BR2_PACKAGE_UTIL_LINUX_TUNELP
|
||||||
bool "tunelp"
|
bool "tunelp"
|
||||||
select BR2_PACKAGE_NCURSES
|
select BR2_PACKAGE_NCURSES
|
||||||
|
select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR
|
||||||
help
|
help
|
||||||
Set various parameters for the lp device
|
Set various parameters for the lp device
|
||||||
|
|
||||||
config BR2_PACKAGE_UTIL_LINUX_UL
|
config BR2_PACKAGE_UTIL_LINUX_UL
|
||||||
bool "ul"
|
bool "ul"
|
||||||
select BR2_PACKAGE_NCURSES
|
select BR2_PACKAGE_NCURSES
|
||||||
|
select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR
|
||||||
help
|
help
|
||||||
Do underlining
|
Do underlining
|
||||||
|
|
||||||
|
@ -45,21 +45,21 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
|
|||||||
UTIL_LINUX_DEPENDENCIES += busybox
|
UTIL_LINUX_DEPENDENCIES += busybox
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
|
||||||
UTIL_LINUX_DEPENDENCIES += ncurses
|
|
||||||
ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
|
|
||||||
UTIL_LINUX_CONF_OPTS += --with-ncursesw
|
|
||||||
UTIL_LINUX_CONF_ENV += NCURSESW5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
|
|
||||||
else
|
|
||||||
UTIL_LINUX_CONF_OPTS += --without-ncursesw --with-ncurses --disable-widechar
|
|
||||||
UTIL_LINUX_CONF_ENV += NCURSES5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
ifeq ($(BR2_USE_WCHAR),y)
|
ifeq ($(BR2_USE_WCHAR),y)
|
||||||
UTIL_LINUX_CONF_OPTS += --enable-widechar
|
UTIL_LINUX_CONF_OPTS += --enable-widechar
|
||||||
else
|
else
|
||||||
UTIL_LINUX_CONF_OPTS += --disable-widechar
|
UTIL_LINUX_CONF_OPTS += --disable-widechar
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
|
||||||
|
UTIL_LINUX_DEPENDENCIES += ncurses
|
||||||
|
UTIL_LINUX_CONF_OPTS += --with-ncursesw
|
||||||
|
UTIL_LINUX_CONF_ENV += NCURSESW5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
|
||||||
|
else ifeq ($(BR2_PACKAGE_NCURSES):$(BR2_USE_WCHAR),y:)
|
||||||
|
UTIL_LINUX_DEPENDENCIES += ncurses
|
||||||
|
UTIL_LINUX_CONF_OPTS += --without-ncursesw --with-ncurses
|
||||||
|
UTIL_LINUX_CONF_ENV += NCURSES5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
|
||||||
|
else
|
||||||
UTIL_LINUX_CONF_OPTS += --without-ncursesw --without-ncurses
|
UTIL_LINUX_CONF_OPTS += --without-ncursesw --without-ncurses
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user