Skip to content

Commit a27e104

Browse files
Alexpuxlazka
authored andcommitted
build: Fix ncursesw include lookup
Mirror what is already done for libffi; Look it up via pkg-config and use the exported path via sysconfig in setup.py
1 parent bac123a commit a27e104

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ IO_OBJS= \
355355
##########################################################################
356356

357357
LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
358+
NCURSESW_INCLUDEDIR= @NCURSESW_INCLUDEDIR@
358359

359360
##########################################################################
360361
# Parser

configure.ac

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6410,10 +6410,17 @@ then
64106410
[Define if you have struct stat.st_mtimensec])
64116411
fi
64126412

6413+
if test -n "$PKG_CONFIG"; then
6414+
NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
6415+
else
6416+
NCURSESW_INCLUDEDIR=""
6417+
fi
6418+
AC_SUBST(NCURSESW_INCLUDEDIR)
6419+
64136420
# first curses header check
64146421
ac_save_cppflags="$CPPFLAGS"
64156422
if test "$cross_compiling" = no; then
6416-
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
6423+
CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
64176424
fi
64186425

64196426
AC_CHECK_HEADERS(curses.h ncurses.h)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ def detect_readline_curses(self):
11451145
if curses_library == 'ncursesw':
11461146
curses_defines.append(('HAVE_NCURSESW', '1'))
11471147
if not CROSS_COMPILING:
1148-
curses_includes.append('/usr/include/ncursesw')
1148+
curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR"))
11491149
# Bug 1464056: If _curses.so links with ncursesw,
11501150
# _curses_panel.so must link with panelw.
11511151
panel_library = 'panelw'

0 commit comments

Comments
 (0)