components/python/python27/patches/02-setup.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 885 2af25a1da825
child 1914 00e8dbcb9b1e
child 3367 ed5024e47b53
permissions -rw-r--r--
Close of build 10.
--- 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 @@
 
     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')
         self.add_multiarch_paths()
 
         # Add paths specified in the environment variables LDFLAGS and
@@ -657,6 +657,13 @@
                                                      ['/usr/lib/termcap'],
                                                      'termcap'):
                 readline_libs.append('termcap')
+
+	    if 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')
+		readline_libs = ()
+
             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 @@
             # 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.
-            extra_link_args.append('-mimpure-text')
+            #extra_link_args.append('-mimpure-text')
+            pass
 
         elif sys.platform.startswith('hp-ux'):
             extra_link_args.append('-fPIC')