Skip to content

Commit 716cb91

Browse files
jeremyd2019lazka
authored andcommitted
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).
1 parent 3972f70 commit 716cb91

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

configure.ac

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,7 +3872,7 @@ else
38723872
fi
38733873

38743874
if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
3875-
LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
3875+
LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ .*$//'`"
38763876
else
38773877
LIBFFI_INCLUDEDIR=""
38783878
fi
@@ -6443,17 +6443,15 @@ then
64436443
fi
64446444

64456445
if test -n "$PKG_CONFIG"; then
6446-
NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
6446+
NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ .*$//'`"
64476447
else
64486448
NCURSESW_INCLUDEDIR=""
64496449
fi
64506450
AC_SUBST(NCURSESW_INCLUDEDIR)
64516451

64526452
# first curses header check
64536453
ac_save_cppflags="$CPPFLAGS"
6454-
if test "$cross_compiling" = no; then
6455-
CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
6456-
fi
6454+
CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
64576455

64586456
AC_CHECK_HEADERS(curses.h ncurses.h)
64596457

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,7 @@ def detect_readline_curses(self):
11551155
panel_library = 'panel'
11561156
if curses_library == 'ncursesw':
11571157
curses_defines.append(('HAVE_NCURSESW', '1'))
1158-
if not CROSS_COMPILING:
1159-
curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR"))
1158+
curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR"))
11601159
# Bug 1464056: If _curses.so links with ncursesw,
11611160
# _curses_panel.so must link with panelw.
11621161
panel_library = 'panelw'

0 commit comments

Comments
 (0)