atop: use wide ncurses pkg-config cflags so waddwstr is declared

atop calls the wide-character ncurses function waddwstr(), which
needs NCURSES_WIDECHAR defined; get that (and the right include path)
from the ncursesw pkg-config module's own Cflags instead of hardcoding
plain ncurses flags.

AI-Generated: Uses Claude Code

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-09-29 09:57:23 -07:00
1 parent 804d00b5ba
commit 41bb6138a8
2 files changed
+30

No files matched your search

@@ -0,0 +1,29 @@
From: Khem Raj <khem.raj@oss.qualcomm.com>
Date: Tue, 29 Sep 2026 01:56:24 +0000
Subject: [PATCH] Makefile: pull in ncursesw cflags via pkg-config
atop links against libncursesw and calls wide-character curses
functions such as waddwstr(), which ncurses only declares in
curses.h when NCURSES_WIDECHAR is defined (normally via the
`-DNCURSES_WIDECHAR` cflag reported by `pkg-config --cflags
ncursesw`). The Makefile only queried pkg-config for glib-2.0 cflags
and never queried it for ncursesw, so on distros shipping a unified
curses.h (as this OE ncurses recipe does) waddwstr() is left
undeclared and the build fails under -Werror=implicit-function-declaration.
Upstream-Status: Pending
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
diff --git a/Makefile b/Makefile
index 3a73bd2..7d1a3c4 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@
PKG_CONFIG ?= pkg-config
-override CFLAGS := -O2 -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT # -DHTTPSTATS
+override CFLAGS := -O2 -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) $(shell $(PKG_CONFIG) --cflags ncursesw) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT # -DHTTPSTATS
CC_CHECK := $(shell echo | $(CC) -dM -E - | grep -q __clang__ && echo clang || echo gcc)
ifeq ($(CC_CHECK),gcc)
@@ -21,6 +21,7 @@ SRC_URI = "http://www.atoptool.nl/download/${BP}.tar.gz \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://volatiles.atop.conf', 'file://volatiles.99_atop', d)} \
file://fix-permissions.patch \
file://sysvinit-implement-status.patch \
file://ncursesw-pkgconfig-cflags.patch \
"
SRC_URI[sha256sum] = "ea182f84c9f52ca922e5af4f17dff97ff424400a4f2f92393317a6af66e6a874"