components/python/python27/patches/02-setup.patch
author Norm Jacobs <Norm.Jacobs@Oracle.COM>
Thu, 04 Aug 2011 19:59:04 -0700
changeset 458 2edc011b559e
child 885 2af25a1da825
permissions -rw-r--r--
7004671 Add Python 2.7.1

--- 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
@@ -347,8 +347,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')
 
         # Add paths specified in the environment variables LDFLAGS and
         # CPPFLAGS for header and library files.
@@ -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')