Example #1
0
    def set_cc_from_distutils():
        if len(env['cc_opt_path']) > 0:
            debug('Setting cc_opt_path from distutils (%s).' % env['cc_opt_path'])
            cc = pjoin(env["cc_opt_path"], env["cc_opt"])
        else:
            debug('Setting wo cc_opt_path')
            cc = env["cc_opt"]

        if built_with_mstools(env):
            info('Detecting ms build.')
            name = "msvc"
            # We need msvs tool too (before customization !)
            env.Tool('msvs')
        else:
            name = get_cc_type(env, cc)
            if name == 'gcc' and sys.platform == 'win32':
                name = 'mingw'
                debug('Changing cc => mingw')

            info('Detected CC type: %s' % name)
            try:
                env.Tool(name)
                env['CC'] = env['cc_opt']
            except ImportError:
                raise UnknownCompiler(env['cc_opt'])

        return name
Example #2
0
    def set_cc_from_distutils():
        if len(env['cc_opt_path']) > 0:
            debug('Setting cc_opt_path from distutils (%s).' %
                  env['cc_opt_path'])
            cc = pjoin(env["cc_opt_path"], env["cc_opt"])
        else:
            debug('Setting wo cc_opt_path')
            cc = env["cc_opt"]

        if built_with_mstools(env):
            info('Detecting ms build.')
            name = "msvc"
            # We need msvs tool too (before customization !)
            env.Tool('msvs')
        else:
            name = get_cc_type(env, cc)
            if name == 'gcc' and sys.platform == 'win32':
                name = 'mingw'
                debug('Changing cc => mingw')

            info('Detected CC type: %s' % name)
            try:
                env.Tool(name)
                env['CC'] = env['cc_opt']
            except ImportError:
                raise UnknownCompiler(env['cc_opt'])

        return name
Example #3
0
    def set_f77_from_distutils():
        if len(env['f77_opt']) > 0:
            debug('Setting F77 from distutils: %s' % env['f77_opt'])
            if len(env['f77_opt_path']) > 0:
                f77 = pjoin(env['f77_opt_path'], env['f77_opt'])
            else:
                f77 = env['f77_opt']

            name = get_f77_type(env, f77)
            info('Detecting F77 type: %s' % name)
            env.Tool(name)
        else:
            debug('Setting F77 from default list')
            name =  FindTool(DEF_FORTRAN_COMPILERS, env)
            debug('Found: %s' % name)
            if name:
                env.Tool(name)

        return name
Example #4
0
    def set_f77_from_distutils():
        if len(env['f77_opt']) > 0:
            debug('Setting F77 from distutils: %s' % env['f77_opt'])
            if len(env['f77_opt_path']) > 0:
                f77 = pjoin(env['f77_opt_path'], env['f77_opt'])
            else:
                f77 = env['f77_opt']

            name = get_f77_type(env, f77)
            info('Detecting F77 type: %s' % name)
            env.Tool(name)
        else:
            debug('Setting F77 from default list')
            name = FindTool(DEF_FORTRAN_COMPILERS, env)
            debug('Found: %s' % name)
            if name:
                env.Tool(name)

        return name
Example #5
0
    def set_cxx_from_distutils():
        if len(env['cxx_opt']) > 0:
            if len(env['cxx_opt_path']) > 0:
                cxx = pjoin(env['cxx_opt_path'], env['cxx_opt'])
            else:
                cxx = env['cxx_opt']

            if built_with_mstools(env):
                name = "msvc"
                env.Tool(name)
            else:
                name = get_cxx_type(env, cxx)
            info("Detected CXX type: %s" % name)
            env.Tool(name)
        else:
            name =  FindTool(DEF_CXX_COMPILERS, env)
            info("Detected CXX type: %s" % name)
            if name:
                env.Tool(name)
        return name
Example #6
0
    def set_cxx_from_distutils():
        if len(env['cxx_opt']) > 0:
            if len(env['cxx_opt_path']) > 0:
                cxx = pjoin(env['cxx_opt_path'], env['cxx_opt'])
            else:
                cxx = env['cxx_opt']

            if built_with_mstools(env):
                name = "msvc"
                env.Tool(name)
            else:
                name = get_cxx_type(env, cxx)
            info("Detected CXX type: %s" % name)
            env.Tool(name)
        else:
            name = FindTool(DEF_CXX_COMPILERS, env)
            info("Detected CXX type: %s" % name)
            if name:
                env.Tool(name)
        return name