components/python/python27/patches/02-setup.patch
author John Beck <John.Beck@Oracle.COM>
Thu, 18 Dec 2014 16:14:01 -0800
branchs11u2-sru
changeset 3611 e09fa6c4472b
parent 3379 e99da14b537a
child 3978 adf3ab1a234a
permissions -rw-r--r--
20230129 update Python 2.7 line to version 2.7.9 20207552 problem in UTILITY/PYTHON
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3379
e99da14b537a 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.
e99da14b537a 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.
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
     3
3611
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
     4
--- Python-2.7.9/setup.py.~1~	2014-12-10 08:00:01.000000000 -0800
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
     5
+++ Python-2.7.9/setup.py	2014-12-17 11:39:50.963351605 -0800
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
     6
@@ -439,9 +439,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
3379
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    10
-        if not cross_compiling:
e99da14b537a 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')
e99da14b537a 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')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    13
+        # if not cross_compiling:
e99da14b537a 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')
e99da14b537a 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')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    16
         if cross_compiling:
e99da14b537a 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()
3611
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
    19
@@ -765,6 +765,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
+
3379
e99da14b537a 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,
3611
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
    33
@@ -786,7 +793,7 @@
458
2edc011b559e 7004671 Add Python 2.7.1
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    34
         # socket(2)
3379
e99da14b537a 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'],
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    36
                                depends=['socketmodule.h'],
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    37
-                               libraries=math_libs) )
e99da14b537a 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 = [
3379
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents: 885
diff changeset
    41
                               '/usr/local/ssl/include',
3611
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
    42
@@ -1587,9 +1594,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 = []
3379
e99da14b537a 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')
3611
e09fa6c4472b 20230129 update Python 2.7 line to version 2.7.9
John Beck <John.Beck@Oracle.COM>
parents: 3379
diff changeset
    57
@@ -2083,7 +2095,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
 
3379
e99da14b537a 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')