author | John Beck <John.Beck@Oracle.COM> |
Thu, 18 Feb 2016 08:19:13 -0800 | |
changeset 5476 | f1df93f6aff1 |
parent 4964 | 30f7741bb742 |
child 6447 | 56a2f066191a |
permissions | -rw-r--r-- |
4912 | 1 |
This patch modifies the setup script to support Solaris. |
2 |
As it is Solaris-specific, it is not suitable for upstream. |
|
3 |
||
4964
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
4 |
--- Python-3.5.0/setup.py.~2~ 2015-04-20 13:10:20.522357068 -0700 |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
5 |
+++ Python-3.5.0/setup.py 2015-04-20 13:10:20.553743713 -0700 |
4912 | 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, |
|
4964
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
41 |
@@ -779,7 +789,8 @@ |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
42 |
|
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
43 |
# socket(2) |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
44 |
exts.append( Extension('_socket', ['socketmodule.c'], |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
45 |
- depends = ['socketmodule.h']) ) |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
46 |
+ depends = ['socketmodule.h'], |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
47 |
+ libraries = ['socket', 'nsl']) ) |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
48 |
# Detect SSL support for the socket module (via _ssl) |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
49 |
search_for_ssl_incs_in = [ |
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
50 |
'/usr/local/ssl/include', |
5476
f1df93f6aff1
22661864 py3 curses get_wch() returns char in int, upstream returns it in str
John Beck <John.Beck@Oracle.COM>
parents:
4964
diff
changeset
|
51 |
@@ -1315,6 +1326,10 @@ |
4912 | 52 |
curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1')) |
53 |
||
54 |
if curses_library.startswith('ncurses'): |
|
55 |
+ if host_platform == 'sunos5': |
|
5476
f1df93f6aff1
22661864 py3 curses get_wch() returns char in int, upstream returns it in str
John Beck <John.Beck@Oracle.COM>
parents:
4964
diff
changeset
|
56 |
+ curses_defines.append(('HAVE_NCURSESW', '1')) |
f1df93f6aff1
22661864 py3 curses get_wch() returns char in int, upstream returns it in str
John Beck <John.Beck@Oracle.COM>
parents:
4964
diff
changeset
|
57 |
+ curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1')) |
4912 | 58 |
+ curses_includes.append('/usr/include/ncurses') |
59 |
curses_libs = [curses_library] |
|
60 |
exts.append( Extension('_curses', ['_cursesmodule.c'], |
|
61 |
include_dirs=curses_includes, |
|
4964
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
62 |
@@ -1339,10 +1352,32 @@ |
4912 | 63 |
# If the curses module is enabled, check for the panel module |
64 |
if (module_enabled(exts, '_curses') and |
|
65 |
self.compiler.find_library_file(lib_dirs, panel_library)): |
|
66 |
+ panel_lib_dirs = [] |
|
67 |
+ if host_platform == 'sunos5': |
|
68 |
+ # Look for libpanel under /usr/gnu/lib on Solaris. |
|
69 |
+ # os.uname() does not include the processor. platform.uname() |
|
70 |
+ # does, but the platform module is not available in setup. |
|
71 |
+ # Work around this by parsing os.system('uname -p') output. |
|
72 |
+ tmpfile = os.path.join(self.build_temp, 'processor') |
|
73 |
+ if not os.path.exists(self.build_temp): |
|
74 |
+ os.makedirs(self.build_temp) |
|
75 |
+ os.system('/usr/bin/uname -p > %s 2> /dev/null' %tmpfile) |
|
76 |
+ processor = '' |
|
77 |
+ try: |
|
78 |
+ with open(tmpfile) as fp: |
|
79 |
+ processor = fp.readline().strip() |
|
80 |
+ finally: |
|
81 |
+ os.unlink(tmpfile) |
|
82 |
+ if processor == 'sparc': |
|
83 |
+ panel_lib_dirs.append('/usr/gnu/lib/sparcv9') |
|
84 |
+ else: |
|
85 |
+ panel_lib_dirs.append('/usr/gnu/lib/amd64') |
|
86 |
exts.append( Extension('_curses_panel', ['_curses_panel.c'], |
|
87 |
include_dirs=curses_includes, |
|
88 |
define_macros=curses_defines, |
|
89 |
- libraries = [panel_library] + curses_libs) ) |
|
90 |
+ libraries = [panel_library] + curses_libs, |
|
91 |
+ library_dirs = panel_lib_dirs, |
|
92 |
+ runtime_library_dirs = panel_lib_dirs) ) |
|
93 |
else: |
|
94 |
missing.append('_curses_panel') |
|
95 |
||
4964
30f7741bb742
21959680 libsocket tweak needed for python{27,34,35}
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
96 |
@@ -1938,7 +1973,7 @@ |
4912 | 97 |
# this option. If you want to compile ctypes with the Sun |
98 |
# compiler, please research a proper solution, instead of |
|
99 |
# finding some -z option for the Sun compiler. |
|
100 |
- extra_link_args.append('-mimpure-text') |
|
101 |
+ pass |
|
102 |
||
103 |
elif host_platform.startswith('hp-ux'): |
|
104 |
extra_link_args.append('-fPIC') |