Skip to content

Commit e1b2793

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 d66edd9 commit e1b2793

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
@@ -6414,10 +6414,17 @@ then
64146414
[Define if you have struct stat.st_mtimensec])
64156415
fi
64166416

6417+
if test -n "$PKG_CONFIG"; then
6418+
NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
6419+
else
6420+
NCURSESW_INCLUDEDIR=""
6421+
fi
6422+
AC_SUBST(NCURSESW_INCLUDEDIR)
6423+
64176424
# first curses header check
64186425
ac_save_cppflags="$CPPFLAGS"
64196426
if test "$cross_compiling" = no; then
6420-
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
6427+
CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
64216428
fi
64226429

64236430
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)