Skip to content

Commit e15d5cf

Browse files
nehebPolynomialDivision
authored andcommitted
tools/util-linux: build with meson
Simplifies Makefile by quite a bit. Added an upstream backport fixing compilation with older OS. Added a curses patch so -Dauto_features=disabled can work properly. Signed-off-by: Rosen Penev <[email protected]> Link: openwrt/openwrt#19598 Signed-off-by: Nick Hainke <[email protected]>
1 parent fd123d6 commit e15d5cf

File tree

4 files changed

+55
-59
lines changed

4 files changed

+55
-59
lines changed

tools/util-linux/Makefile

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,14 @@ PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.41
1414
PKG_HASH:=be9ad9a276f4305ab7dd2f5225c8be1ff54352f565ff4dede9628c1aaa7dec57
1515
PKG_CPE_ID:=cpe:/a:kernel:util-linux
1616

17-
PKG_FIXUP:=autoreconf
18-
19-
HOST_BUILD_PARALLEL:=1
20-
2117
include $(INCLUDE_DIR)/host-build.mk
22-
23-
HOST_CONFIGURE_ARGS += \
24-
--with-pic \
25-
--disable-shared \
26-
--disable-nls \
27-
--disable-all-programs \
28-
--enable-hexdump \
29-
--enable-libuuid \
30-
--without-util \
31-
--without-selinux \
32-
--without-audit \
33-
--without-udev \
34-
--without-ncursesw \
35-
--without-ncurses \
36-
--without-slang \
37-
--without-tinfo \
38-
--without-readline \
39-
--without-utempter \
40-
--without-cap-ng \
41-
--without-libz \
42-
--without-libmagic \
43-
--without-user \
44-
--without-btrfs \
45-
--without-systemd \
46-
--without-smack \
47-
--without-econf \
48-
--without-python \
49-
--without-cryptsetup
50-
51-
define Host/Uninstall
52-
-$(call Host/Compile/Default,uninstall)
53-
endef
18+
include $(INCLUDE_DIR)/meson.mk
19+
20+
MESON_HOST_ARGS += \
21+
-Dauto_features=disabled \
22+
-Dbuild-hexdump=enabled \
23+
-Dbuild-libuuid=enabled \
24+
-Dncurses=enabled \
25+
-Dprogram-tests=false
5426

5527
$(eval $(call HostBuild))
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From c1ca5ec4a5c6a0e4acbdcc6ff4e4fa2109c1ec24 Mon Sep 17 00:00:00 2001
2+
From: Rosen Penev <[email protected]>
3+
Date: Wed, 30 Jul 2025 14:13:07 -0700
4+
Subject: [PATCH] meson: use curses for the non wide version
5+
6+
The curses dependency in meson in special in that it uses a combination
7+
of pkg-config, config-tool, and various system lookups to find it.
8+
9+
Signed-off-by: Rosen Penev <[email protected]>
10+
---
11+
meson.build | 2 +-
12+
1 file changed, 1 insertion(+), 1 deletion(-)
13+
14+
--- a/meson.build
15+
+++ b/meson.build
16+
@@ -289,7 +289,7 @@ if lib_ncursesw.found()
17+
lib_ncurses = disabler()
18+
else
19+
lib_ncurses = dependency(
20+
- 'ncurses',
21+
+ 'curses',
22+
disabler : true,
23+
required : get_option('ncurses'))
24+
headers += ['ncurses.h',
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
From 946c0b9c6f6481ed9370b8bd0f54a622a0c4a574 Mon Sep 17 00:00:00 2001
2+
From: Martin Valgur <[email protected]>
3+
Date: Tue, 15 Apr 2025 16:19:21 +0300
4+
Subject: [PATCH] meson: fix a bug in posixipc_libs configuration
5+
6+
Should append instead of assigning. Otherwise fails with
7+
8+
meson.build:1482:22: ERROR: Object <[ExternalLibraryHolder] holds [ExternalLibrary]: <ExternalLibrary rt: True>> of type ExternalLibrary does not support the `+` operator.
9+
---
10+
meson.build | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
--- a/meson.build
14+
+++ b/meson.build
15+
@@ -1473,7 +1473,7 @@ has_seminfo_type = cc.has_type('struct s
16+
17+
posixipc_libs = []
18+
if not cc.has_function('shm_open') and conf.get('HAVE_SYS_MMAN_H').to_string() == '1'
19+
- posixipc_libs = cc.find_library('rt', required : true)
20+
+ posixipc_libs += cc.find_library('rt', required : true)
21+
endif
22+
23+
if not cc.has_function('sem_close') and conf.get('HAVE_SEMAPHORE_H').to_string() == '1'

tools/util-linux/patches/110-move-libpthread-to-libs.patch

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)