components/python/python26/patches/Python26-01-solaris-lib-dirs.patch
branchs11u3-sru
changeset 7811 9126e6f58cd8
parent 7792 ee802f9b5132
child 7816 79ee06fdecc5
equal deleted inserted replaced
7792:ee802f9b5132 7811:9126e6f58cd8
     1 diff --git Python-2.6.4/Modules/_multiprocessing/multiprocessing.h Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
       
     2 --- Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
       
     3 +++ Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
       
     4 @@ -3,6 +3,10 @@
       
     5  
       
     6  #define PY_SSIZE_T_CLEAN
       
     7  
       
     8 +/* needed on Solaris for the definition of CMSG_SPACE and friends */
       
     9 +#define _XOPEN_SOURCE
       
    10 +#define _XOPEN_SOURCE_EXTENDED 1
       
    11 +
       
    12  #include "Python.h"
       
    13  #include "structmember.h"
       
    14  #include "pythread.h"
       
    15 diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
       
    16 --- Python-2.6.4/setup.py
       
    17 +++ Python-2.6.4/setup.py
       
    18 @@ -355,10 +355,10 @@
       
    19          return sys.platform
       
    20  
       
    21      def detect_modules(self):
       
    22 -        # Ensure that /usr/local is always used
       
    23 -        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
       
    24 -        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
       
    25 -
       
    26 +        if sys.platform != 'sunos5':
       
    27 +            # Ensure that /usr/local is always used
       
    28 +            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
       
    29 +            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
       
    30          # Add paths specified in the environment variables LDFLAGS and
       
    31          # CPPFLAGS for header and library files.
       
    32          # We must get the values from the Makefile and not the environment
       
    33 @@ -687,11 +687,22 @@
       
    34          exts.append( Extension('_csv', ['_csv.c']) )
       
    35  
       
    36          # socket(2)
       
    37 +        socket_libs = []
       
    38 +        if self.compiler.find_library_file(lib_dirs,
       
    39 +                                           'socket'):
       
    40 +            socket_libs.append('socket')
       
    41 +        if self.compiler.find_library_file(lib_dirs,
       
    42 +                                           'nsl'):
       
    43 +            socket_libs.append('nsl')
       
    44 +        if self.compiler.find_library_file(lib_dirs,
       
    45 +                                           'resolv'):
       
    46 +            socket_libs.append('resolv')
       
    47          exts.append( Extension('_socket', ['socketmodule.c'],
       
    48 -                               depends = ['socketmodule.h']) )
       
    49 +                               depends = ['socketmodule.h'],
       
    50 +                               libraries = socket_libs) )
       
    51          # Detect SSL support for the socket module (via _ssl)
       
    52          search_for_ssl_incs_in = [
       
    53 -                              '/usr/local/ssl/include',
       
    54 +                              '/usr/sfw/include',
       
    55                                '/usr/contrib/ssl/include/'
       
    56                               ]
       
    57          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
       
    58 @@ -702,8 +713,12 @@
       
    59                                 ['/usr/kerberos/include'])
       
    60              if krb5_h:
       
    61                  ssl_incs += krb5_h
       
    62 +        if sys.maxint == 2147483647L:
       
    63 +            sfw_libdir = '/usr/sfw/lib';
       
    64 +        else:
       
    65 +            sfw_libdir = '/usr/sfw/lib/64';
       
    66          ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
       
    67 -                                     ['/usr/local/ssl/lib',
       
    68 +                                     [sfw_libdir,
       
    69                                        '/usr/contrib/ssl/lib/'
       
    70                                       ] )
       
    71  
       
    72 @@ -712,6 +727,7 @@
       
    73              exts.append( Extension('_ssl', ['_ssl.c'],
       
    74                                     include_dirs = ssl_incs,
       
    75                                     library_dirs = ssl_libs,
       
    76 +				   runtime_library_dirs = ssl_libs,
       
    77                                     libraries = ['ssl', 'crypto'],
       
    78                                     depends = ['socketmodule.h']), )
       
    79          else:
       
    80 @@ -1191,16 +1207,34 @@
       
    81  
       
    82          # Curses support, requiring the System V version of curses, often
       
    83          # provided by the ncurses library.
       
    84 +        curses_lib_dirs = []
       
    85 +        curses_inc_dirs = []
       
    86 +        if platform == 'sunos5':
       
    87 +            # look for ncurses in /usr/gnu on Solaris
       
    88 +            curses_inc_dirs.append('/usr/include/ncurses')
       
    89 +            curses_lib_dirs.append('/usr/gnu/lib')
       
    90 +            if os.path.exists('/usr/gnu/lib/sparcv9'):
       
    91 +                curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
       
    92 +            else:
       
    93 +                curses_lib_dirs.append('/usr/gnu/lib/amd64')
       
    94          panel_library = 'panel'
       
    95 -        if curses_library.startswith('ncurses'):
       
    96 -            if curses_library == 'ncursesw':
       
    97 -                # Bug 1464056: If _curses.so links with ncursesw,
       
    98 -                # _curses_panel.so must link with panelw.
       
    99 -                panel_library = 'panelw'
       
   100 -            curses_libs = [curses_library]
       
   101 +        if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
       
   102 +            curses_libs = ['ncursesw']
       
   103 +            # Bug 1464056: If _curses.so links with ncursesw,
       
   104 +            # _curses_panel.so must link with panelw.
       
   105 +            panel_library = 'panelw'
       
   106              exts.append( Extension('_curses', ['_cursesmodule.c'],
       
   107                                     libraries = curses_libs) )
       
   108 -        elif curses_library == 'curses' and platform != 'darwin':
       
   109 +        elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
       
   110 +            curses_libs = ['ncurses']
       
   111 +            exts.append( Extension('_curses', ['_cursesmodule.c'],
       
   112 +                                   libraries = curses_libs,
       
   113 +                                   library_dirs = curses_lib_dirs,
       
   114 +                                   runtime_library_dirs = curses_lib_dirs,
       
   115 +                                   include_dirs = curses_inc_dirs ) )
       
   116 +
       
   117 +        elif (self.compiler.find_library_file(lib_dirs, 'curses')
       
   118 +              and platform != 'darwin'):
       
   119                  # OSX has an old Berkeley curses, not good enough for
       
   120                  # the _curses module.
       
   121              if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
       
   122 @@ -1217,9 +1251,12 @@
       
   123  
       
   124          # If the curses module is enabled, check for the panel module
       
   125          if (module_enabled(exts, '_curses') and
       
   126 -            self.compiler.find_library_file(lib_dirs, panel_library)):
       
   127 +            self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
       
   128              exts.append( Extension('_curses_panel', ['_curses_panel.c'],
       
   129 -                                   libraries = [panel_library] + curses_libs) )
       
   130 +                                   libraries = [panel_library] + curses_libs,
       
   131 +                                   include_dirs = curses_inc_dirs,
       
   132 +                                   library_dirs = curses_lib_dirs,
       
   133 +                                   runtime_library_dirs = curses_lib_dirs ) )
       
   134          else:
       
   135              missing.append('_curses_panel')
       
   136  
       
   137 @@ -1432,9 +1469,14 @@
       
   138              if macros.get('HAVE_SEM_OPEN', False):
       
   139                  multiprocessing_srcs.append('_multiprocessing/semaphore.c')
       
   140  
       
   141 +        multiproc_libs = []
       
   142 +        if platform == 'sunos5':
       
   143 +            multiproc_libs = [ "xnet" ]
       
   144 +
       
   145          if sysconfig.get_config_var('WITH_THREAD'):
       
   146              exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
       
   147                                      define_macros=macros.items(),
       
   148 +                                    libraries=multiproc_libs,
       
   149                                      include_dirs=["Modules/_multiprocessing"]))
       
   150          else:
       
   151              missing.append('_multiprocessing')
       
   152 @@ -1674,12 +1716,23 @@
       
   153          # Assume we haven't found any of the libraries or include files
       
   154          # The versions with dots are used on Unix, and the versions without
       
   155          # dots on Windows, for detection by cygwin.
       
   156 +        added_lib_dirs = []
       
   157 +        tcl_tk_lib_dirs = ['/usr/sfw/lib']
       
   158 +        tcl_tk_inc_dirs = ['/usr/sfw/include']
       
   159          tcllib = tklib = tcl_includes = tk_includes = None
       
   160          for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
       
   161                          '82', '8.1', '81', '8.0', '80']:
       
   162 -            tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
       
   163 -            tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
       
   164 +            tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
       
   165 +            tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
       
   166 +            if tklib and tcllib:
       
   167 +                # Exit the loop when we've found the Tcl/Tk libraries
       
   168 +                break
       
   169 +
       
   170 +            tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
       
   171 +            tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
       
   172              if tklib and tcllib:
       
   173 +                # found the libs in a non-standard dir
       
   174 +                added_lib_dirs.append(os.path.dirname(tcllib))
       
   175                  # Exit the loop when we've found the Tcl/Tk libraries
       
   176                  break
       
   177  
       
   178 @@ -1697,6 +1750,7 @@
       
   179              for dir in inc_dirs:
       
   180                  tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
       
   181                  tk_include_sub += [dir + os.sep + "tk" + dotversion]
       
   182 +            tcl_include_sub += tcl_tk_inc_dirs
       
   183              tk_include_sub += tcl_include_sub
       
   184              tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
       
   185              tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
       
   186 @@ -1761,6 +1815,7 @@
       
   187                          include_dirs = include_dirs,
       
   188                          libraries = libs,
       
   189                          library_dirs = added_lib_dirs,
       
   190 +                        runtime_library_dirs = added_lib_dirs
       
   191                          )
       
   192          self.extensions.append(ext)
       
   193  
       
   194 diff --git Python-2.6.4/Lib/site-packages/vendor-packages.pth Python2.6.4/Lib/site-packages/vendor-packages.pth
       
   195 --- /dev/null	Sat Feb 12 00:21:26 2011
       
   196 +++ Python-2.6.4/Lib/site-packages/vendor-packages.pth	Sat Feb 12 00:47:05 2011
       
   197 @@ -0,0 +1,1 @@
       
   198 +import site; site.addsitedir('/usr/lib/python2.6/vendor-packages')