(self, ext)
Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows and OS/2, we add the Python library (eg. python20.dll).
Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows and OS/2, we add the Python library (eg. python20.dll).
Return the list of libraries to link against when building a shared extension . On most platforms this is just ext . libraries ; on Windows and OS / 2 we add the Python library ( eg . python20 . dll ) .
def get_libraries (self, ext):
        """Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows and OS/2, we add the Python library (eg. python20.dll).
        """
        # The python library is always needed on Windows.  For MSVC, this
        # is redundant, since the library is mentioned in a pragma in
        # pyconfig.h that MSVC groks.  The other Windows compilers all seem
        # to need it mentioned explicitly, though, so that's what we do.
        # Append '_d' to the python import library on debug builds.
        if sys.platform == "win32":
            from distutils.msvccompiler import MSVCCompiler
            if not isinstance(self.compiler, MSVCCompiler):
                template = "python%d%d"
                if self.debug:
                    template = template + '_d'
                pythonlib = (template %
                       (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
                # don't extend ext.libraries, it may be shared with other
                # extensions, it is a reference to the original list
                return ext.libraries + [pythonlib]
            else:
                return ext.libraries
        elif sys.platform == "os2emx":
            # EMX/GCC requires the python library explicitly, and I
            # believe VACPP does as well (though not confirmed) - AIM Apr01
            template = "python%d%d"
            # debug versions of the main DLL aren't supported, at least
            # not at this time - AIM Apr01
            #if self.debug:
            #    template = template + '_d'
            pythonlib = (template %
                   (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
            # don't extend ext.libraries, it may be shared with other
            # extensions, it is a reference to the original list
            return ext.libraries + [pythonlib]
        elif sys.platform[:6] == "cygwin":
            template = "python%d.%d"
            pythonlib = (template %
                   (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
            # don't extend ext.libraries, it may be shared with other
            # extensions, it is a reference to the original list
            return ext.libraries + [pythonlib]
        elif sys.platform[:6] == "atheos":
            from distutils import sysconfig

            template = "python%d.%d"
            pythonlib = (template %
                   (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
            # Get SHLIBS from Makefile
            extra = []
            for lib in sysconfig.get_config_var('SHLIBS').split():
                if lib.startswith('-l'):
                    extra.append(lib[2:])
                else:
                    extra.append(lib)
            # don't extend ext.libraries, it may be shared with other
            # extensions, it is a reference to the original list
            return ext.libraries + [pythonlib, "m"] + extra

        elif sys.platform == 'darwin':
            # Don't use the default code below
            return ext.libraries
        elif sys.platform[:3] == 'aix':
            # Don't use the default code below
            return ext.libraries
        else:
            from distutils import sysconfig
            if sysconfig.get_config_var('Py_ENABLE_SHARED'):
                template = "python%d.%d"
                pythonlib = (template %
                             (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
                return ext.libraries + [pythonlib]
            else:
                return ext.libraries
def get_libraries ( self , ext ) : # The python library is always needed on Windows.  For MSVC, this # is redundant, since the library is mentioned in a pragma in # pyconfig.h that MSVC groks.  The other Windows compilers all seem # to need it mentioned explicitly, though, so that's what we do. # Append '_d' to the python import library on debug builds. if sys . platform == "win32" : from distutils . msvccompiler import MSVCCompiler if not isinstance ( self . compiler , MSVCCompiler ) : template = "python%d%d" if self . debug : template = template + '_d' pythonlib = ( template % ( sys . hexversion >> 24 , ( sys . hexversion >> 16 ) & 0xff ) ) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext . libraries + [ pythonlib ] else : return ext . libraries elif sys . platform == "os2emx" : # EMX/GCC requires the python library explicitly, and I # believe VACPP does as well (though not confirmed) - AIM Apr01 template = "python%d%d" # debug versions of the main DLL aren't supported, at least # not at this time - AIM Apr01 #if self.debug: #    template = template + '_d' pythonlib = ( template % ( sys . hexversion >> 24 , ( sys . hexversion >> 16 ) & 0xff ) ) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext . libraries + [ pythonlib ] elif sys . platform [ : 6 ] == "cygwin" : template = "python%d.%d" pythonlib = ( template % ( sys . hexversion >> 24 , ( sys . hexversion >> 16 ) & 0xff ) ) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext . libraries + [ pythonlib ] elif sys . platform [ : 6 ] == "atheos" : from distutils import sysconfig template = "python%d.%d" pythonlib = ( template % ( sys . hexversion >> 24 , ( sys . hexversion >> 16 ) & 0xff ) ) # Get SHLIBS from Makefile extra = [ ] for lib in sysconfig . get_config_var ( 'SHLIBS' ) . split ( ) : if lib . startswith ( '-l' ) : extra . append ( lib [ 2 : ] ) else : extra . append ( lib ) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext . libraries + [ pythonlib , "m" ] + extra elif sys . platform == 'darwin' : # Don't use the default code below return ext . libraries elif sys . platform [ : 3 ] == 'aix' : # Don't use the default code below return ext . libraries else : from distutils import sysconfig if sysconfig . get_config_var ( 'Py_ENABLE_SHARED' ) : template = "python%d.%d" pythonlib = ( template % ( sys . hexversion >> 24 , ( sys . hexversion >> 16 ) & 0xff ) ) return ext . libraries + [ pythonlib ] else : return ext . libraries