components/python/python27/patches/02-setup.patch
changeset 1914 00e8dbcb9b1e
parent 885 2af25a1da825
child 1954 32663e59626d
--- a/components/python/python27/patches/02-setup.patch	Tue May 20 21:56:15 2014 -0700
+++ b/components/python/python27/patches/02-setup.patch	Thu May 22 14:36:47 2014 -0700
@@ -1,22 +1,24 @@
---- Python-2.7.1/setup.py.~1~	Sun Oct 31 11:40:21 2010
-+++ Python-2.7.1/setup.py	Fri Jul 15 15:04:56 2011
-@@ -369,8 +369,8 @@
+--- Python-2.7.6/setup.py.~1~	2013-11-09 23:36:41.000000000 -0800
++++ Python-2.7.6/setup.py	2014-05-14 12:46:04.859407465 -0700
+@@ -437,9 +437,9 @@
  
      def detect_modules(self):
          # Ensure that /usr/local is always used
--        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
--        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-+        #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+        #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++        # if not cross_compiling:
++        #   add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++        #   add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         if cross_compiling:
+             self.add_gcc_paths()
          self.add_multiarch_paths()
- 
-         # Add paths specified in the environment variables LDFLAGS and
-@@ -657,6 +657,13 @@
+@@ -761,6 +761,13 @@
                                                       ['/usr/lib/termcap'],
                                                       'termcap'):
                  readline_libs.append('termcap')
 +
-+	    if platform == 'sunos5':
++	    if host_platform == 'sunos5':
 +		# insert '-zrecord' before the readline libraries that we
 +		# want to link with to avoid rl_insert() elimination
 +		readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses')
@@ -25,30 +27,7 @@
              exts.append( Extension('readline', ['readline.c'],
                                     library_dirs=['/usr/lib/termcap'],
                                     extra_link_args=readline_extra_link_args,
-@@ -677,6 +684,7 @@
- 
-         # socket(2)
-         exts.append( Extension('_socket', ['socketmodule.c'],
-+                               libraries = ['socket', 'nsl'],
-                                depends = ['socketmodule.h']) )
-         # Detect SSL support for the socket module (via _ssl)
-         search_for_ssl_incs_in = [
-@@ -1443,9 +1451,14 @@
-                 sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
-                 multiprocessing_srcs.append('_multiprocessing/semaphore.c')
- 
-+	multiproc_libs = []
-+	if platform == 'sunos5':
-+	    multiproc_libs = [ "xnet" ]
-+
-         if sysconfig.get_config_var('WITH_THREAD'):
-             exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
-                                     define_macros=macros.items(),
-+                                    libraries=multiproc_libs,
-                                     include_dirs=["Modules/_multiprocessing"]))
-         else:
-             missing.append('_multiprocessing')
-@@ -1896,7 +1909,8 @@
+@@ -2075,7 +2082,8 @@
              # this option. If you want to compile ctypes with the Sun
              # compiler, please research a proper solution, instead of
              # finding some -z option for the Sun compiler.
@@ -56,5 +35,5 @@
 +            #extra_link_args.append('-mimpure-text')
 +            pass
  
-         elif sys.platform.startswith('hp-ux'):
+         elif host_platform.startswith('hp-ux'):
              extra_link_args.append('-fPIC')