From 991cbd5348887ea1f10654a0c8a62e9f72aca786 Mon Sep 17 00:00:00 2001 From: jeremyd2019 Date: Mon, 22 Nov 2021 16:04:41 -0800 Subject: [PATCH 127/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 | 8 +++----- setup.py | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 06e93ab..5d8586e 100644 --- a/configure.ac +++ b/configure.ac @@ -3403,7 +3403,7 @@ else fi if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then - LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`" + LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ .*$//'`" else LIBFFI_INCLUDEDIR="" fi @@ -5596,7 +5596,7 @@ then fi 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 @@ -5604,9 +5604,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" AC_CHECK_HEADERS(curses.h ncurses.h) diff --git a/setup.py b/setup.py index 6b0e709..43e5ee0 100644 --- a/setup.py +++ b/setup.py @@ -1119,8 +1119,7 @@ class PyBuildExt(build_ext): panel_library = 'panel' if curses_library == 'ncursesw': curses_defines.append(('HAVE_NCURSESW', '1')) - if not CROSS_COMPILING: - curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR")) + curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR")) # Bug 1464056: If _curses.so links with ncursesw, # _curses_panel.so must link with panelw. panel_library = 'panelw' -- 2.35.1