components/python/python27/patches/02-setup.patch
branchs11-update
changeset 3367 ed5024e47b53
parent 885 2af25a1da825
child 3565 2d729d36ded7
equal deleted inserted replaced
3366:dba288608e69 3367:ed5024e47b53
     1 --- Python-2.7.1/setup.py.~1~	Sun Oct 31 11:40:21 2010
     1 This patch modifies the setup script to support Solaris.
     2 +++ Python-2.7.1/setup.py	Fri Jul 15 15:04:56 2011
     2 As it is Solaris-specific, it is not suitable for upstream.
     3 @@ -369,8 +369,8 @@
     3 
       
     4 --- Python-2.7.8/setup.py.~1~	2014-06-29 19:05:48.000000000 -0700
       
     5 +++ Python-2.7.8/setup.py	2014-07-17 20:37:57.419011542 -0700
       
     6 @@ -437,9 +437,9 @@
     4  
     7  
     5      def detect_modules(self):
     8      def detect_modules(self):
     6          # Ensure that /usr/local is always used
     9          # Ensure that /usr/local is always used
     7 -        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
    10 -        if not cross_compiling:
     8 -        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
    11 -            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
     9 +        #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
    12 -            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
    10 +        #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
    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 cross_compiling:
       
    17              self.add_gcc_paths()
    11          self.add_multiarch_paths()
    18          self.add_multiarch_paths()
    12  
    19 @@ -763,6 +763,13 @@
    13          # Add paths specified in the environment variables LDFLAGS and
       
    14 @@ -657,6 +657,13 @@
       
    15                                                       ['/usr/lib/termcap'],
    20                                                       ['/usr/lib/termcap'],
    16                                                       'termcap'):
    21                                                       'termcap'):
    17                  readline_libs.append('termcap')
    22                  readline_libs.append('termcap')
    18 +
    23 +
    19 +	    if platform == 'sunos5':
    24 +	    if host_platform == 'sunos5':
    20 +		# insert '-zrecord' before the readline libraries that we
    25 +		# insert '-zrecord' before the readline libraries that we
    21 +		# want to link with to avoid rl_insert() elimination
    26 +		# want to link with to avoid rl_insert() elimination
    22 +		readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses')
    27 +		readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses')
    23 +		readline_libs = ()
    28 +		readline_libs = ()
    24 +
    29 +
    25              exts.append( Extension('readline', ['readline.c'],
    30              exts.append( Extension('readline', ['readline.c'],
    26                                     library_dirs=['/usr/lib/termcap'],
    31                                     library_dirs=['/usr/lib/termcap'],
    27                                     extra_link_args=readline_extra_link_args,
    32                                     extra_link_args=readline_extra_link_args,
    28 @@ -677,6 +684,7 @@
    33 @@ -784,7 +791,7 @@
    29  
       
    30          # socket(2)
    34          # socket(2)
    31          exts.append( Extension('_socket', ['socketmodule.c'],
    35          exts.append( Extension('_socket', ['socketmodule.c', 'timemodule.c'],
    32 +                               libraries = ['socket', 'nsl'],
    36                                 depends=['socketmodule.h'],
    33                                 depends = ['socketmodule.h']) )
    37 -                               libraries=math_libs) )
       
    38 +                               libraries=math_libs + ['socket', 'nsl']) )
    34          # Detect SSL support for the socket module (via _ssl)
    39          # Detect SSL support for the socket module (via _ssl)
    35          search_for_ssl_incs_in = [
    40          search_for_ssl_incs_in = [
    36 @@ -1443,9 +1451,14 @@
    41                                '/usr/local/ssl/include',
       
    42 @@ -1585,9 +1592,14 @@
    37                  sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
    43                  sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
    38                  multiprocessing_srcs.append('_multiprocessing/semaphore.c')
    44                  multiprocessing_srcs.append('_multiprocessing/semaphore.c')
    39  
    45  
    40 +	multiproc_libs = []
    46 +	multiproc_libs = []
    41 +	if platform == 'sunos5':
    47 +	if host_platform == 'sunos5':
    42 +	    multiproc_libs = [ "xnet" ]
    48 +	    multiproc_libs = [ "xnet" ]
    43 +
    49 +
    44          if sysconfig.get_config_var('WITH_THREAD'):
    50          if sysconfig.get_config_var('WITH_THREAD'):
    45              exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
    51              exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
    46                                      define_macros=macros.items(),
    52                                      define_macros=macros.items(),
    47 +                                    libraries=multiproc_libs,
    53 +                                    libraries=multiproc_libs,
    48                                      include_dirs=["Modules/_multiprocessing"]))
    54                                      include_dirs=["Modules/_multiprocessing"]))
    49          else:
    55          else:
    50              missing.append('_multiprocessing')
    56              missing.append('_multiprocessing')
    51 @@ -1896,7 +1909,8 @@
    57 @@ -2081,7 +2088,8 @@
    52              # this option. If you want to compile ctypes with the Sun
    58              # this option. If you want to compile ctypes with the Sun
    53              # compiler, please research a proper solution, instead of
    59              # compiler, please research a proper solution, instead of
    54              # finding some -z option for the Sun compiler.
    60              # finding some -z option for the Sun compiler.
    55 -            extra_link_args.append('-mimpure-text')
    61 -            extra_link_args.append('-mimpure-text')
    56 +            #extra_link_args.append('-mimpure-text')
    62 +            #extra_link_args.append('-mimpure-text')
    57 +            pass
    63 +            pass
    58  
    64  
    59          elif sys.platform.startswith('hp-ux'):
    65          elif host_platform.startswith('hp-ux'):
    60              extra_link_args.append('-fPIC')
    66              extra_link_args.append('-fPIC')