diff --git a/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb b/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
index e2cc901d5e..315e1a6e49 100644
--- a/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
+++ b/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
@@ -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.
