From 01ea756b774c7ae2eacf705a132427e3b84c7803 Mon Sep 17 00:00:00 2001
From: jeremyd2019 <github@jdrake.com>
Date: Mon, 22 Nov 2021 16:04:41 -0800
Subject: [PATCH 067/N] handle ncursesw pkg-config when cross-compiling

strip extra args from pkg-config --cflags-only-I, setup.py is only expecting a single path.

Use pkg-config ncursesw include dir even if cross-compiling (PKG_CONFIG_PATH should be set in that case).
---
 configure.ac | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4c757d8..ec3962e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6929,7 +6929,7 @@ AS_VAR_IF([have_panel], [no], [
 ])
 
 if test -n "$PKG_CONFIG"; then
-    NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
+    NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ .*$//'`"
 else
     NCURSESW_INCLUDEDIR=""
 fi
@@ -6937,9 +6937,7 @@ AC_SUBST(NCURSESW_INCLUDEDIR)
 
 # first curses header check
 ac_save_cppflags="$CPPFLAGS"
-if test "$cross_compiling" = no; then
-  CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
-fi
+CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
 
 # On Solaris, term.h requires curses.h
 AC_CHECK_HEADERS([term.h], [], [], [
