1 --- Python-2.7.8/setup.py.~7~ 2014-07-09 10:01:47.977524330 +0400
2 +++ Python-2.7.8/setup.py 2014-07-09 10:06:22.690906040 +0400
3 @@ -1349,20 +1349,37 @@
5 # Curses support, requiring the System V version of curses, often
6 # provided by the ncurses library.
10 + if host_platform == 'sunos5':
11 + # look for ncurses in /usr/gnu on Solaris
12 + curses_inc_dirs.append('/usr/include/ncurses')
13 + curses_lib_dirs.append('/usr/gnu/lib')
14 + if os.path.exists('/usr/gnu/lib/sparcv9'):
15 + curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
17 + curses_lib_dirs.append('/usr/gnu/lib/amd64')
18 panel_library = 'panel'
20 - if curses_library.startswith('ncurses'):
21 - if curses_library == 'ncursesw':
22 - # Bug 1464056: If _curses.so links with ncursesw,
23 - # _curses_panel.so must link with panelw.
24 - panel_library = 'panelw'
25 - curses_libs = [curses_library]
26 + if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
27 + curses_libs = ['ncursesw']
28 + # Bug 1464056: If _curses.so links with ncursesw,
29 + # _curses_panel.so must link with panelw.
30 + panel_library = 'panelw'
31 curses_incs = find_file('curses.h', inc_dirs,
32 [os.path.join(d, 'ncursesw') for d in inc_dirs])
33 exts.append( Extension('_curses', ['_cursesmodule.c'],
34 include_dirs = curses_incs,
35 libraries = curses_libs) )
36 - elif curses_library == 'curses' and host_platform != 'darwin':
37 + elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
38 + curses_libs = ['ncurses']
39 + exts.append( Extension('_curses', ['_cursesmodule.c'],
40 + libraries = curses_libs,
41 + library_dirs = curses_lib_dirs,
42 + runtime_library_dirs = curses_lib_dirs,
43 + include_dirs = curses_inc_dirs ) )
44 + elif (self.compiler.find_library_file(lib_dirs, 'curses')
45 + and host_platform != 'darwin'):
46 # OSX has an old Berkeley curses, not good enough for
48 if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
49 @@ -1379,10 +1396,12 @@
51 # If the curses module is enabled, check for the panel module
52 if (module_enabled(exts, '_curses') and
53 - self.compiler.find_library_file(lib_dirs, panel_library)):
54 + self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
55 exts.append( Extension('_curses_panel', ['_curses_panel.c'],
56 include_dirs = curses_incs,
57 - libraries = [panel_library] + curses_libs) )
58 + libraries = [panel_library] + curses_libs,
59 + library_dirs = curses_lib_dirs,
60 + runtime_library_dirs = curses_lib_dirs ) )
62 missing.append('_curses_panel')