aboutsummaryrefslogtreecommitdiff
path: root/examples/python2.7/patches/ncursesw-incdir.diff
blob: 1ce0b573f26117b60df1215ac5ade169ec59e2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 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 <curses.h>
 #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)