# DP: use the correct include directory when linking with ncursesw. --- a/setup.py +++ b/setup.py @@ -1251,13 +1251,17 @@ # Curses support, requiring the System V version of curses, often # provided by the ncurses library. panel_library = 'panel' + curses_incs = None if curses_library.startswith('ncurses'): if curses_library == 'ncursesw': # Bug 1464056: If _curses.so links with ncursesw, # _curses_panel.so must link with panelw. panel_library = 'panelw' curses_libs = [curses_library] + curses_incs = find_file('curses.h', inc_dirs, + [os.path.join(d, 'ncursesw') for d in inc_dirs]) exts.append( Extension('_curses', ['_cursesmodule.c'], + include_dirs = curses_incs, libraries = curses_libs) ) elif curses_library == 'curses' and platform != 'darwin': # OSX has an old Berkeley curses, not good enough for @@ -1278,6 +1282,7 @@ if (module_enabled(exts, '_curses') and self.compiler.find_library_file(lib_dirs, panel_library)): exts.append( Extension('_curses_panel', ['_curses_panel.c'], + include_dirs = curses_incs, libraries = [panel_library] + curses_libs) ) else: missing.append('_curses_panel') --- a/configure.ac +++ b/configure.ac @@ -1374,6 +1374,8 @@ # checks for header files AC_HEADER_STDC +ac_save_cppflags="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ @@ -1395,6 +1397,7 @@ #include #endif ]) +CPPFLAGS=$ac_save_cppflags # On Linux, netlink.h requires asm/types.h AC_CHECK_HEADERS(linux/netlink.h,,,[ @@ -4123,6 +4126,8 @@ [Define if you have struct stat.st_mtimensec]) fi +ac_save_cppflags="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" # On HP/UX 11.0, mvwdelch is a block with a return statement AC_MSG_CHECKING(whether mvwdelch is an expression) AC_CACHE_VAL(ac_cv_mvwdelch_is_expression, @@ -4177,6 +4182,7 @@ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)] ) +CPPFLAGS=$ac_save_cppflags AC_MSG_CHECKING(for /dev/ptmx)