1 diff -wpruN '--exclude=*.orig' a~/setup.py a/setup.py
2 --- a~/setup.py 1970-01-01 00:00:00
3 +++ a/setup.py 1970-01-01 00:00:00
4 @@ -64,6 +64,7 @@ MS_WINDOWS = (HOST_PLATFORM == 'win32')
5 CYGWIN = (HOST_PLATFORM == 'cygwin')
6 MACOS = (HOST_PLATFORM == 'darwin')
7 AIX = (HOST_PLATFORM.startswith('aix'))
8 +ILLUMOS = (HOST_PLATFORM == 'sunos5')
9 VXWORKS = ('vxworks' in HOST_PLATFORM)
12 @@ -731,7 +732,7 @@ class PyBuildExt(build_ext):
13 # Ensure that /usr/local is always used, but the local build
14 # directories (i.e. '.' and 'Include') must be first. See issue
16 - if not CROSS_COMPILING:
17 + if not ILLUMOS and not CROSS_COMPILING:
18 add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
19 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
20 # only change this for cross builds for 3.3, issues on Mageia
21 @@ -1045,6 +1046,14 @@ class PyBuildExt(build_ext):
24 readline_libs.append('termcap')
27 + # insert '-zrecord' before the readline libraries that we
28 + # want to link with to avoid rl_insert() elimination
29 + readline_extra_link_args = ('-Wl,-zrecord','-lreadline',
33 self.add(Extension('readline', ['readline.c'],
34 library_dirs=['/usr/lib/termcap'],
35 extra_link_args=readline_extra_link_args,
36 @@ -1079,6 +1088,12 @@ class PyBuildExt(build_ext):
39 if curses_library.startswith('ncurses'):
42 + curses_defines.append(('HAVE_NCURSESW', '1'))
43 + curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1'))
44 + curses_includes.append('/usr/include/ncurses')
46 curses_libs = [curses_library]
47 self.add(Extension('_curses', ['_cursesmodule.c'],
48 include_dirs=curses_includes,
49 @@ -1106,10 +1121,15 @@ class PyBuildExt(build_ext):
50 skip_curses_panel = True if AIX else False
51 if (curses_enabled and not skip_curses_panel and
52 self.compiler.find_library_file(self.lib_dirs, panel_library)):
55 + panel_lib_dirs.append('/usr/gnu/lib/amd64')
56 self.add(Extension('_curses_panel', ['_curses_panel.c'],
57 include_dirs=curses_includes,
58 define_macros=curses_defines,
59 - libraries=[panel_library, *curses_libs]))
60 + libraries=[panel_library, *curses_libs],
61 + library_dirs = panel_lib_dirs,
62 + runtime_library_dirs = panel_lib_dirs))
63 elif not skip_curses_panel:
64 self.missing.append('_curses_panel')