@@ -17,7 +17,14 @@ SRC_URI[sha256sum] = "9631d6e3e2859c85913d8b8724f61fbebb9e932e9e50aa0493a4e02766
S = "${UNPACKDIR}/Curses-${PV}"
-EXTRA_CPANFLAGS = "INC=-I${STAGING_INCDIR} LIBS=-L${STAGING_LIBDIR} TEST_SYMS_OPTS=-v"
+EXTRA_CPANFLAGS = "TEST_SYMS_OPTS=-v"
+
+# Tell Makefile.PL which library to link, instead of letting it look in
+# the host /usr/include
+CURSES_LIBTYPE = "${@'ncursesw' if bb.utils.to_boolean((d.getVar('ENABLE_WIDEC') or 'True')) else 'ncurses'}"
+export CURSES_LIBTYPE
+export CURSES_CFLAGS = "-I${STAGING_INCDIR}"
+export CURSES_LDFLAGS = "-L${STAGING_LIBDIR} -l${CURSES_LIBTYPE}"
# enable NCURSES_WIDECHAR=1 only if ENABLE_WIDEC has not been explicitly disabled (e.g. by the distro config).
# When compiling against the ncurses library, NCURSES_WIDECHAR needs to explicitly set to 0 in this case.
LIBS=-L${STAGING_LIBDIR} in EXTRA_CPANFLAGS replaces the libraries that Makefile.PL picks, so Curses.so is not linked against ncurses and fails to load on target: Curses.so: undefined symbol: curscr Makefile.PL also picks the library by looking at the host's /usr/include. Set CURSES_LIBTYPE, CURSES_CFLAGS and CURSES_LDFLAGS instead, which Makefile.PL reads, using ncursesw unless ENABLE_WIDEC is disabled, as the musl CFLAGS already do. AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)