patches/Python26-18-readline.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 17126 ab01a33ed216
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

--- Python-2.6.2/setup.py.readline	2009-12-02 01:06:23.106365511 +1300
+++ Python-2.6.2/setup.py	2009-12-02 14:10:21.572167660 +1300
@@ -572,6 +572,14 @@
                 # This way a staticly linked custom readline gets picked up
                 # before the (broken) dynamic library in /usr/lib.
                 readline_extra_link_args = ('-Wl,-search_paths_first',)
+            elif sys.platform == 'sunos5':
+                if sys.maxint != 9223372036854775807L:
+                    readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib,-R/usr/gnu/lib,-lreadline,-lncurses',)
+                else:
+                    if os.path.exists('/usr/gnu/lib/sparcv9'):
+                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/sparcv9,-R/usr/gnu/lib/sparcv9,-lreadline,-lncurses',)
+                    else:
+                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/amd64,-R/usr/gnu/lib/amd64,-lreadline,-lncurses',)
             else:
                 readline_extra_link_args = ()
 
@@ -588,6 +596,12 @@
                                                ['/usr/lib/termcap'],
                                                'termcap'):
                 readline_libs.append('termcap')
+
+            if sys.platform == 'sunos5':
+                # ugly hack to make the build respect -zrecord set in
+                # readline_extra_link_args above
+                readline_libs = []
+
             exts.append( Extension('readline', ['readline.c'],
                                    library_dirs=['/usr/lib/termcap'],
                                    extra_link_args=readline_extra_link_args,