4912
|
1 |
This patch modifies the setup script to support Solaris.
|
|
2 |
As it is Solaris-specific, it is not suitable for upstream.
|
|
3 |
|
|
4 |
--- Python-3.5.0a4/setup.py.~2~ 2015-04-20 13:10:20.522357068 -0700
|
|
5 |
+++ Python-3.5.0a4/setup.py 2015-04-20 13:10:20.553743713 -0700
|
|
6 |
@@ -465,12 +465,15 @@
|
|
7 |
os.unlink(tmpfile)
|
|
8 |
|
|
9 |
def detect_modules(self):
|
|
10 |
- # Ensure that /usr/local is always used, but the local build
|
|
11 |
- # directories (i.e. '.' and 'Include') must be first. See issue
|
|
12 |
- # 10520.
|
|
13 |
if not cross_compiling:
|
|
14 |
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
|
15 |
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
|
16 |
+ if host_platform != 'sunos5':
|
|
17 |
+ # Upstream notes the following for source builds:
|
|
18 |
+ # Ensure that /usr/local is always used, but the local build
|
|
19 |
+ # directories (i.e. '.' and 'Include') must be first. See
|
|
20 |
+ # issue 10520.
|
|
21 |
+ # But we skip that for Solaris system builds.
|
|
22 |
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
|
23 |
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
|
24 |
# only change this for cross builds for 3.3, issues on Mageia
|
|
25 |
if cross_compiling:
|
|
26 |
self.add_gcc_paths()
|
|
27 |
@@ -756,6 +759,13 @@
|
|
28 |
['/usr/lib/termcap'],
|
|
29 |
'termcap'):
|
|
30 |
readline_libs.append('termcap')
|
|
31 |
+
|
|
32 |
+ if host_platform == 'sunos5':
|
|
33 |
+ # insert '-zrecord' before the readline libraries that we
|
|
34 |
+ # want to link with to avoid rl_insert() elimination
|
|
35 |
+ readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses')
|
|
36 |
+ readline_libs = ()
|
|
37 |
+
|
|
38 |
exts.append( Extension('readline', ['readline.c'],
|
|
39 |
library_dirs=['/usr/lib/termcap'],
|
|
40 |
extra_link_args=readline_extra_link_args,
|
|
41 |
@@ -1315,6 +1325,8 @@
|
|
42 |
curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1'))
|
|
43 |
|
|
44 |
if curses_library.startswith('ncurses'):
|
|
45 |
+ if host_platform == 'sunos5':
|
|
46 |
+ curses_includes.append('/usr/include/ncurses')
|
|
47 |
curses_libs = [curses_library]
|
|
48 |
exts.append( Extension('_curses', ['_cursesmodule.c'],
|
|
49 |
include_dirs=curses_includes,
|
|
50 |
@@ -1339,10 +1351,32 @@
|
|
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 |
+ panel_lib_dirs = []
|
|
55 |
+ if host_platform == 'sunos5':
|
|
56 |
+ # Look for libpanel under /usr/gnu/lib on Solaris.
|
|
57 |
+ # os.uname() does not include the processor. platform.uname()
|
|
58 |
+ # does, but the platform module is not available in setup.
|
|
59 |
+ # Work around this by parsing os.system('uname -p') output.
|
|
60 |
+ tmpfile = os.path.join(self.build_temp, 'processor')
|
|
61 |
+ if not os.path.exists(self.build_temp):
|
|
62 |
+ os.makedirs(self.build_temp)
|
|
63 |
+ os.system('/usr/bin/uname -p > %s 2> /dev/null' %tmpfile)
|
|
64 |
+ processor = ''
|
|
65 |
+ try:
|
|
66 |
+ with open(tmpfile) as fp:
|
|
67 |
+ processor = fp.readline().strip()
|
|
68 |
+ finally:
|
|
69 |
+ os.unlink(tmpfile)
|
|
70 |
+ if processor == 'sparc':
|
|
71 |
+ panel_lib_dirs.append('/usr/gnu/lib/sparcv9')
|
|
72 |
+ else:
|
|
73 |
+ panel_lib_dirs.append('/usr/gnu/lib/amd64')
|
|
74 |
exts.append( Extension('_curses_panel', ['_curses_panel.c'],
|
|
75 |
include_dirs=curses_includes,
|
|
76 |
define_macros=curses_defines,
|
|
77 |
- libraries = [panel_library] + curses_libs) )
|
|
78 |
+ libraries = [panel_library] + curses_libs,
|
|
79 |
+ library_dirs = panel_lib_dirs,
|
|
80 |
+ runtime_library_dirs = panel_lib_dirs) )
|
|
81 |
else:
|
|
82 |
missing.append('_curses_panel')
|
|
83 |
|
|
84 |
@@ -1938,7 +1972,7 @@
|
|
85 |
# this option. If you want to compile ctypes with the Sun
|
|
86 |
# compiler, please research a proper solution, instead of
|
|
87 |
# finding some -z option for the Sun compiler.
|
|
88 |
- extra_link_args.append('-mimpure-text')
|
|
89 |
+ pass
|
|
90 |
|
|
91 |
elif host_platform.startswith('hp-ux'):
|
|
92 |
extra_link_args.append('-fPIC')
|