components/python/python27/patches/02-setup.patch
author John Beck <John.Beck@Oracle.COM>
Sat, 04 Oct 2014 14:50:43 -0700
branchs11-update
changeset 3367 ed5024e47b53
parent 885 2af25a1da825
child 3565 2d729d36ded7
permissions -rw-r--r--
PSARC 2014/183 Python 2.7.6 18251953 update Python 2.7 line to version 2.7.6 19004605 update Python 2.7 line to version 2.7.7 19308541 update Python 2.7 line to version 2.7.8 19284990 python 2.7.7 segfaults while under memory stress 17431625 64-bit python should use long rather than int for os.sysconf() return value 19164544 Python 2.7 test_tcl fails 19030238 Python 2.7 test_sysconfig fails - no module named _osx_support 19030198 Python 2.7 tests fail - import name error 19032456 more Python 2.7 tests failing with import errors 19022543 Python 2.7 test_lib2to3 fails
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     1
This patch modifies the setup script to support Solaris.
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     2
As it is Solaris-specific, it is not suitable for upstream.
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     3
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     4
--- Python-2.7.8/setup.py.~1~	2014-06-29 19:05:48.000000000 -0700
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     5
+++ Python-2.7.8/setup.py	2014-07-17 20:37:57.419011542 -0700
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     6
@@ -437,9 +437,9 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     7
 
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     8
     def detect_modules(self):
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     9
         # Ensure that /usr/local is always used
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    10
-        if not cross_compiling:
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    11
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    12
-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    13
+        # if not cross_compiling:
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    14
+        #   add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    15
+        #   add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    16
         if cross_compiling:
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    17
             self.add_gcc_paths()
885
2af25a1da825 7177355 python 2.7.1 should be updated to the latest 2.7.X release
Rich Burridge <rich.burridge@oracle.com>
parents: 458
diff changeset
    18
         self.add_multiarch_paths()
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    19
@@ -763,6 +763,13 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    20
                                                      ['/usr/lib/termcap'],
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    21
                                                      'termcap'):
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    22
                 readline_libs.append('termcap')
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    23
+
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    24
+	    if host_platform == 'sunos5':
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    25
+		# insert '-zrecord' before the readline libraries that we
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    26
+		# want to link with to avoid rl_insert() elimination
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    27
+		readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses')
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    28
+		readline_libs = ()
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    29
+
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    30
             exts.append( Extension('readline', ['readline.c'],
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    31
                                    library_dirs=['/usr/lib/termcap'],
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    32
                                    extra_link_args=readline_extra_link_args,
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    33
@@ -784,7 +791,7 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    34
         # socket(2)
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    35
         exts.append( Extension('_socket', ['socketmodule.c', 'timemodule.c'],
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    36
                                depends=['socketmodule.h'],
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    37
-                               libraries=math_libs) )
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    38
+                               libraries=math_libs + ['socket', 'nsl']) )
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    39
         # Detect SSL support for the socket module (via _ssl)
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    40
         search_for_ssl_incs_in = [
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    41
                               '/usr/local/ssl/include',
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    42
@@ -1585,9 +1592,14 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    43
                 sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    44
                 multiprocessing_srcs.append('_multiprocessing/semaphore.c')
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    45
 
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    46
+	multiproc_libs = []
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    47
+	if host_platform == 'sunos5':
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    48
+	    multiproc_libs = [ "xnet" ]
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    49
+
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    50
         if sysconfig.get_config_var('WITH_THREAD'):
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    51
             exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    52
                                     define_macros=macros.items(),
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    53
+                                    libraries=multiproc_libs,
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    54
                                     include_dirs=["Modules/_multiprocessing"]))
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    55
         else:
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    56
             missing.append('_multiprocessing')
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    57
@@ -2081,7 +2088,8 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    58
             # this option. If you want to compile ctypes with the Sun
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    59
             # compiler, please research a proper solution, instead of
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    60
             # finding some -z option for the Sun compiler.
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    61
-            extra_link_args.append('-mimpure-text')
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    62
+            #extra_link_args.append('-mimpure-text')
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    63
+            pass
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    64
 
3367
ed5024e47b53 PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    65
         elif host_platform.startswith('hp-ux'):
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    66
             extra_link_args.append('-fPIC')