(compiler)
Do any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
Do any platform-specific customization of a CCompiler instance.
Do any platform - specific customization of a CCompiler instance .
def customize_compiler(compiler):
    """Do any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    """
    if compiler.compiler_type == "unix":
        if sys.platform == "darwin":
            # Perform first-time customization of compiler-related
            # config vars on OS X now that we know we need a compiler.
            # This is primarily to support Pythons from binary
            # installers.  The kind and paths to build tools on
            # the user system may vary significantly from the system
            # that Python itself was built on.  Also the user OS
            # version and build tools may not support the same set
            # of CPU architectures for universal builds.
            if not _config_vars.get('CUSTOMIZED_OSX_COMPILER'):
                import _osx_support
                _osx_support.customize_compiler(_config_vars)
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'

        (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
            get_config_vars('CC', 'CXX', 'CFLAGS',
                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')

        if 'CC' in os.environ:
            newcc = os.environ['CC']
            if (sys.platform == 'darwin'
                    and 'LDSHARED' not in os.environ
                    and ldshared.startswith(cc)):
                # On OS X, if CC is overridden, use that as the default
                #       command for LDSHARED as well
                ldshared = newcc + ldshared[len(cc):]
            cc = newcc
        if 'CXX' in os.environ:
            cxx = os.environ['CXX']
        if 'LDSHARED' in os.environ:
            ldshared = os.environ['LDSHARED']
        if 'CPP' in os.environ:
            cpp = os.environ['CPP']
        else:
            cpp = cc + " -E"           # not always
        if 'LDFLAGS' in os.environ:
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
        if 'CFLAGS' in os.environ:
            cflags = cflags + ' ' + os.environ['CFLAGS']
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
        if 'CPPFLAGS' in os.environ:
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
        if 'AR' in os.environ:
            ar = os.environ['AR']
        if 'ARFLAGS' in os.environ:
            archiver = ar + ' ' + os.environ['ARFLAGS']
        else:
            archiver = ar + ' ' + ar_flags

        cc_cmd = cc + ' ' + cflags
        compiler.set_executables(
            preprocessor=cpp,
            compiler=cc_cmd,
            compiler_so=cc_cmd + ' ' + ccshared,
            compiler_cxx=cxx,
            linker_so=ldshared,
            linker_exe=cc,
            archiver=archiver)

        compiler.shared_lib_extension = shlib_suffix
def customize_compiler ( compiler ) : if compiler . compiler_type == "unix" : if sys . platform == "darwin" : # Perform first-time customization of compiler-related # config vars on OS X now that we know we need a compiler. # This is primarily to support Pythons from binary # installers.  The kind and paths to build tools on # the user system may vary significantly from the system # that Python itself was built on.  Also the user OS # version and build tools may not support the same set # of CPU architectures for universal builds. if not _config_vars . get ( 'CUSTOMIZED_OSX_COMPILER' ) : import _osx_support _osx_support . customize_compiler ( _config_vars ) _config_vars [ 'CUSTOMIZED_OSX_COMPILER' ] = 'True' ( cc , cxx , cflags , ccshared , ldshared , shlib_suffix , ar , ar_flags ) = get_config_vars ( 'CC' , 'CXX' , 'CFLAGS' , 'CCSHARED' , 'LDSHARED' , 'SHLIB_SUFFIX' , 'AR' , 'ARFLAGS' ) if 'CC' in os . environ : newcc = os . environ [ 'CC' ] if ( sys . platform == 'darwin' and 'LDSHARED' not in os . environ and ldshared . startswith ( cc ) ) : # On OS X, if CC is overridden, use that as the default #       command for LDSHARED as well ldshared = newcc + ldshared [ len ( cc ) : ] cc = newcc if 'CXX' in os . environ : cxx = os . environ [ 'CXX' ] if 'LDSHARED' in os . environ : ldshared = os . environ [ 'LDSHARED' ] if 'CPP' in os . environ : cpp = os . environ [ 'CPP' ] else : cpp = cc + " -E" # not always if 'LDFLAGS' in os . environ : ldshared = ldshared + ' ' + os . environ [ 'LDFLAGS' ] if 'CFLAGS' in os . environ : cflags = cflags + ' ' + os . environ [ 'CFLAGS' ] ldshared = ldshared + ' ' + os . environ [ 'CFLAGS' ] if 'CPPFLAGS' in os . environ : cpp = cpp + ' ' + os . environ [ 'CPPFLAGS' ] cflags = cflags + ' ' + os . environ [ 'CPPFLAGS' ] ldshared = ldshared + ' ' + os . environ [ 'CPPFLAGS' ] if 'AR' in os . environ : ar = os . environ [ 'AR' ] if 'ARFLAGS' in os . environ : archiver = ar + ' ' + os . environ [ 'ARFLAGS' ] else : archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags compiler . set_executables ( preprocessor = cpp , compiler = cc_cmd , compiler_so = cc_cmd + ' ' + ccshared , compiler_cxx = cxx , linker_so = ldshared , linker_exe = cc , archiver = archiver ) compiler . shared_lib_extension = shlib_suffix