1 diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
   2 --- Python-2.6.4/setup.py
   3 +++ Python-2.6.4/setup.py
   4 @@ -572,6 +572,14 @@
   5                  # This way a staticly linked custom readline gets picked up
   6                  # before the (broken) dynamic library in /usr/lib.
   7                  readline_extra_link_args = ('-Wl,-search_paths_first',)
   8 +            elif sys.platform == 'sunos5':
   9 +                if sys.maxint != 9223372036854775807L:
  10 +                    readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib,-R/usr/gnu/lib,-lreadline,-lncurses',)
  11 +                else:
  12 +                    if os.path.exists('/usr/gnu/lib/sparcv9'):
  13 +                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/sparcv9,-R/usr/gnu/lib/sparcv9,-lreadline,-lncurses',)
  14 +                    else:
  15 +                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/amd64,-R/usr/gnu/lib/amd64,-lreadline,-lncurses',)
  16              else:
  17                  readline_extra_link_args = ()
  18  
  19 @@ -588,6 +596,12 @@
  20                                                 ['/usr/lib/termcap'],
  21                                                 'termcap'):
  22                  readline_libs.append('termcap')
  23 +
  24 +            if sys.platform == 'sunos5':
  25 +                # ugly hack to make the build respect -zrecord set in
  26 +                # readline_extra_link_args above
  27 +                readline_libs = []
  28 +
  29              exts.append( Extension('readline', ['readline.c'],
  30                                     library_dirs=['/usr/lib/termcap'],
  31                                     extra_link_args=readline_extra_link_args,