• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python conf.find_program函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中waflib.Configure.conf.find_program函数的典型用法代码示例。如果您正苦于以下问题:Python find_program函数的具体用法?Python find_program怎么用?Python find_program使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了find_program函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: mkspec_gxx_configure

def mkspec_gxx_configure(conf, major, minor, prefix=None, minimum=False):
    """
    :param major:   The major version number of the compiler, e.g. 4
    :param minor:   The minor version number of the compiler, e.g. 6
    :param prefix:  Prefix to the compiler name, e.g. 'arm-linux-androideabi'
    :param minimum: Only check for a minimum compiler version, if true
    """
    # Where to look for the compiler
    paths = conf.mkspec_get_toolchain_paths()

    # Find g++ first
    gxx_names = conf.mkspec_get_gnu_binary_name('g++', major, minor, prefix)
    if minimum:
        gxx_names = 'g++'
    cxx = conf.find_program(gxx_names, path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cxx, major, minor)
    else:
        conf.mkspec_check_cc_version(cxx, major, minor)

    # Also find gcc
    gcc_names = conf.mkspec_get_gnu_binary_name('gcc', major, minor, prefix)
    if minimum:
        gcc_names = 'gcc'
    cc = conf.find_program(gcc_names, path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cc, major, minor)
    else:
        conf.mkspec_check_cc_version(cc, major, minor)

    # Find the archiver
    ar = conf.mkspec_get_ar_binary_name(prefix)
    conf.find_program(ar, path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.mkspec_set_gxx_cxxflags()
    # Add our own cc flags
    conf.mkspec_set_gcc_ccflags()
开发者ID:GOPRO1955,项目名称:external-waf-tools,代码行数:60,代码来源:gxx_common.py


示例2: configure

def configure(conf):
    conf.find_ifort()
    conf.find_program("xiar", var="AR")
    conf.env.ARFLAGS = "rcs"
    conf.fc_flags()
    conf.fc_add_flags()
    conf.ifort_modifier_platform()
开发者ID:eriser,项目名称:alta,代码行数:7,代码来源:ifort.py


示例3: configure

def configure(conf):
	conf.find_ifort()
	conf.find_program('xiar', var='AR')
	conf.env.ARFLAGS = 'rcs'
	conf.fc_flags()
	conf.fc_add_flags()
	conf.ifort_modifier_platform()
开发者ID:Anastasia1302,项目名称:code-pile,代码行数:7,代码来源:ifort.py


示例4: configure

def configure(conf):
	conf.find_sxc()
	conf.find_program('sxar',VAR='AR')
	conf.sxc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
开发者ID:AleemDev,项目名称:waf,代码行数:7,代码来源:c_nec.py


示例5: find_git_win32

def find_git_win32(conf):
	path=find_in_winreg()
	if path:
		path_list=[path,os.path.join(path,'bin')]
		conf.find_program('git',path_list=path_list)
	else:
		conf.find_program('git')
开发者ID:peymanphl,项目名称:correlation,代码行数:7,代码来源:wurf_git.py


示例6: find_dmd

def find_dmd(conf):
	conf.find_program(['dmd','dmd2','ldc'],var='D')
	out=conf.cmd_and_log([conf.env.D,'--help'])
	if out.find("D Compiler v")==-1:
		out=conf.cmd_and_log([conf.env.D,'-version'])
		if out.find("based on DMD v1.")==-1:
			conf.fatal("detected compiler is not dmd/ldc")
开发者ID:AkiraShirase,项目名称:audacity,代码行数:7,代码来源:dmd.py


示例7: configure

def configure(conf):
	"""
	Detects the Intel Fortran compilers
	"""
	if Utils.is_win32:
		compiler, version, path, includes, libdirs, arch = conf.detect_ifort()
		v = conf.env
		v.DEST_CPU = arch
		v.PATH = path
		v.INCLUDES = includes
		v.LIBPATH = libdirs
		v.MSVC_COMPILER = compiler
		try:
			v.MSVC_VERSION = float(version)
		except ValueError:
			v.MSVC_VERSION = float(version[:-3])

		conf.find_ifort_win32()
		conf.ifort_modifier_win32()
	else:
		conf.find_ifort()
		conf.find_program('xiar', var='AR')
		conf.find_ar()
		conf.fc_flags()
		conf.fc_add_flags()
		conf.ifort_modifier_platform()
开发者ID:afeldman,项目名称:waf,代码行数:26,代码来源:ifort.py


示例8: configure

def configure(conf):
	"""
	Detect the python interpreter
	"""
	v = conf.env
	if getattr(Options.options, 'pythondir', None):
		v.PYTHONDIR = Options.options.pythondir
	if getattr(Options.options, 'pythonarchdir', None):
		v.PYTHONARCHDIR = Options.options.pythonarchdir
	if getattr(Options.options, 'nopycache', None):
		v.NOPYCACHE=Options.options.nopycache

	if not v.PYTHON:
		v.PYTHON = [getattr(Options.options, 'python', None) or sys.executable]
	v.PYTHON = Utils.to_list(v.PYTHON)
	conf.find_program('python', var='PYTHON')

	v.PYFLAGS = ''
	v.PYFLAGS_OPT = '-O'

	v.PYC = getattr(Options.options, 'pyc', 1)
	v.PYO = getattr(Options.options, 'pyo', 1)

	try:
		v.PYTAG = conf.cmd_and_log(conf.env.PYTHON + ['-c', "import imp;print(imp.get_tag())"]).strip()
	except Errors.WafError:
		pass
开发者ID:blablack,项目名称:ams-lv2,代码行数:27,代码来源:python.py


示例9: configure

def configure(conf):
    v = conf.env
    v.TI_CGT_DIR = getattr(Options.options, "ti-cgt-dir", "")
    v.TI_DSPLINK_DIR = getattr(Options.options, "ti-dsplink-dir", "")
    v.TI_BIOSUTILS_DIR = getattr(Options.options, "ti-biosutils-dir", "")
    v.TI_DSPBIOS_DIR = getattr(Options.options, "ti-dspbios-dir", "")
    v.TI_XDCTOOLS_DIR = getattr(Options.options, "ti-xdctools-dir", "")
    conf.find_ticc()
    conf.find_tiar()
    conf.find_tild()
    conf.ticc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
    conf.find_program(["tconf"], var="TCONF", path_list=v.TI_XDCTOOLS_DIR)

    conf.env.TCONF_INCLUDES += [opj(conf.env.TI_DSPBIOS_DIR, "packages")]

    conf.env.INCLUDES += [opj(conf.env.TI_CGT_DIR, "include")]

    conf.env.LIBPATH += [opj(conf.env.TI_CGT_DIR, "lib")]

    conf.env.INCLUDES_DSPBIOS += [opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "include")]

    conf.env.LIBPATH_DSPBIOS += [opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "lib")]

    conf.env.INCLUDES_DSPLINK += [opj(conf.env.TI_DSPLINK_DIR, "dsplink", "dsp", "inc")]
开发者ID:ArduPilot,项目名称:waf,代码行数:27,代码来源:ticgt.py


示例10: find_msvc

def find_msvc(conf):
	if sys.platform=='cygwin':
		conf.fatal('MSVC module does not work under cygwin Python!')
	v=conf.env
	path=v['PATH']
	compiler=v['MSVC_COMPILER']
	version=v['MSVC_VERSION']
	compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
	v.MSVC_MANIFEST=(compiler=='msvc'and version>=8)or(compiler=='wsdk'and version>=6)or(compiler=='intel'and version>=11)
	cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
	env=dict(conf.environ)
	if path:env.update(PATH=';'.join(path))
	if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
		conf.fatal('the msvc compiler could not be identified')
	v['CC']=v['CXX']=cxx
	v['CC_NAME']=v['CXX_NAME']='msvc'
	if not v['LINK_CXX']:
		link=conf.find_program(linker_name,path_list=path)
		if link:v['LINK_CXX']=link
		else:conf.fatal('%s was not found (linker)'%linker_name)
		v['LINK']=link
	if not v['LINK_CC']:
		v['LINK_CC']=v['LINK_CXX']
	if not v['AR']:
		stliblink=conf.find_program(lib_name,path_list=path,var='AR')
		if not stliblink:return
		v['ARFLAGS']=['/NOLOGO']
	if v.MSVC_MANIFEST:
		conf.find_program('MT',path_list=path,var='MT')
		v['MTFLAGS']=['/NOLOGO']
	try:
		conf.load('winres')
	except Errors.WafError:
		warn('Resource compiler not found. Compiling resource file is disabled')
开发者ID:guysherman,项目名称:basic-cpp-template,代码行数:34,代码来源:msvc.py


示例11: configure

def configure(conf):
	"""
	Find a C# compiler, set the variable MCS for the compiler and CS_NAME (mono or csc)
	"""
	csc = getattr(Options.options, 'cscbinary', None)
	if csc:
		conf.env.MCS = csc
	conf.find_program(['csc', 'dmcs', 'gmcs', 'mcs'], var='MCS')
	conf.env.ASS_ST = '/r:%s'
	conf.env.RES_ST = '/resource:%s'

	conf.env.CS_NAME = 'csc'
	if str(conf.env.MCS).lower().find('mcs') > -1:
		conf.env.CS_NAME = 'mono'

	conf.env.package_dep_lib = getattr(Options.options, 'package_dep_lib', False)

	# new variable that allow the sdk version to be specified at the command line.
	sdk_version = getattr(Options.options, 'sdk_version', None)
	if sdk_version:
		self.env.append_value('CSFLAGS', '/sdk:%s' % sdk_version)

	debug = getattr(Options.options, 'debug', None)
	if debug:
		conf.env.append_value('CSFLAGS', '/define:DEBUG')
		conf.env.CSDEBUG = debug;
开发者ID:SjB,项目名称:waftools,代码行数:26,代码来源:cs.py


示例12: find_msvc

def find_msvc(conf):
	if sys.platform=='cygwin':
		conf.fatal('MSVC module does not work under cygwin Python!')
	v=conf.env
	path=v.PATH
	compiler=v.MSVC_COMPILER
	version=v.MSVC_VERSION
	compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
	v.MSVC_MANIFEST=(compiler=='msvc'and version>=8)or(compiler=='wsdk'and version>=6)or(compiler=='intel'and version>=11)
	cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
	env=dict(conf.environ)
	if path:env.update(PATH=';'.join(path))
	if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
		conf.fatal('the msvc compiler could not be identified')
	v.CC=v.CXX=cxx
	v.CC_NAME=v.CXX_NAME='msvc'
	if not v.LINK_CXX:
		v.LINK_CXX=conf.find_program(linker_name,path_list=path,errmsg='%s was not found (linker)'%linker_name)
	if not v.LINK_CC:
		v.LINK_CC=v.LINK_CXX
	if not v.AR:
		stliblink=conf.find_program(lib_name,path_list=path,var='AR')
		if not stliblink:
			return
		v.ARFLAGS=['/nologo']
	if v.MSVC_MANIFEST:
		conf.find_program('MT',path_list=path,var='MT')
		v.MTFLAGS=['/nologo']
	try:
		conf.load('winres')
	except Errors.ConfigurationError:
		Logs.warn('Resource compiler not found. Compiling resource file is disabled')
开发者ID:allencubie,项目名称:lib,代码行数:32,代码来源:msvc.py


示例13: find_intltool_merge

def find_intltool_merge(conf):
	"""
	Detects intltool-merge
	"""
	if not conf.env.PERL:
		conf.find_program('perl', var='PERL')
	conf.env.INTLCACHE_ST = '--cache=%s'
	conf.env.INTLFLAGS_DEFAULT = ['-q', '-u']
	conf.find_program('intltool-merge', interpreter='PERL', var='INTLTOOL')
开发者ID:JodyGoldberg,项目名称:waf,代码行数:9,代码来源:intltool.py


示例14: configure

def configure(conf):
	conf.find_nfort()
	conf.find_program('nar',var='AR')
	conf.add_os_flags('ARFLAGS')
	if not conf.env.ARFLAGS:
		conf.env.ARFLAGS=['rcs']
	conf.fc_flags()
	conf.fc_add_flags()
	conf.nfort_flags()
开发者ID:afeldman,项目名称:waf,代码行数:9,代码来源:fc_nfort.py


示例15: find_ldc2

def find_ldc2(conf):
	"""
	Finds the program *ldc2* and set the variable *D*
	"""
	conf.find_program(['ldc2'], var='D')

	out = conf.cmd_and_log(conf.env.D + ['-version'])
	if out.find("based on DMD v2.") == -1:
		conf.fatal("detected compiler is not ldc2")
开发者ID:ArduPilot,项目名称:waf,代码行数:9,代码来源:ldc2.py


示例16: configure

def configure(conf):
	conf.find_clang()
	conf.find_program(['ar'], var='AR')
	conf.find_ar()
	conf.gcc_common_flags()
	conf.gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
开发者ID:bugengine,项目名称:BugEngine,代码行数:9,代码来源:clang.py


示例17: find_emscripten

def find_emscripten(conf):
	cc = conf.find_program(['emcc'], var='CC')
	conf.get_emscripten_version(cc)
	conf.env.CC = cc
	conf.env.CC_NAME = 'emscripten'
	cxx = conf.find_program(['em++'], var='CXX')
	conf.env.CXX = cxx
	conf.env.CXX_NAME = 'emscripten'
	conf.find_program(['emar'], var='AR')
开发者ID:michaelkilchenmann,项目名称:Quantitative_Economic_History,代码行数:9,代码来源:c_emscripten.py


示例18: configure

def configure(conf):
	conf.find_clangxx()
	conf.find_program(['llvm-ar', 'ar'], var='AR')
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
开发者ID:afeldman,项目名称:waf,代码行数:9,代码来源:clangxx.py


示例19: find_gdc

def find_gdc(conf):
	"""
	Finds the program gdc and set the variable *D*
	"""
	conf.find_program('gdc', var='D')

	out = conf.cmd_and_log(conf.env.D + ['--version'])
	if out.find("gdc") == -1:
		conf.fatal("detected compiler is not gdc")
开发者ID:afeldman,项目名称:waf,代码行数:9,代码来源:gdc.py


示例20: find_msvc

def find_msvc(conf):
	"""Due to path format limitations, limit operation only to native Win32. Yeah it sucks."""
	if sys.platform == 'cygwin':
		conf.fatal('MSVC module does not work under cygwin Python!')

	# the autodetection is supposed to be performed before entering in this method
	v = conf.env
	path = v['PATH']
	compiler = v['MSVC_COMPILER']
	version = v['MSVC_VERSION']

	compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler)
	v.MSVC_MANIFEST = (compiler == 'msvc' and version >= 8) or (compiler == 'wsdk' and version >= 6) or (compiler == 'intel' and version >= 11)

	# compiler
	cxx = None
	if v['CXX']: cxx = v['CXX']
	elif 'CXX' in conf.environ: cxx = conf.environ['CXX']
	cxx = conf.find_program(compiler_name, var='CXX', path_list=path)
	cxx = conf.cmd_to_list(cxx)

	# before setting anything, check if the compiler is really msvc
	env = dict(conf.environ)
	if path: env.update(PATH = ';'.join(path))
	if not conf.cmd_and_log(cxx + ['/nologo', '/help'], env=env):
		conf.fatal('the msvc compiler could not be identified')

	# c/c++ compiler
	v['CC'] = v['CXX'] = cxx
	v['CC_NAME'] = v['CXX_NAME'] = 'msvc'

	# linker
	if not v['LINK_CXX']:
		link = conf.find_program(linker_name, path_list=path)
		if link: v['LINK_CXX'] = link
		else: conf.fatal('%s was not found (linker)' % linker_name)
		v['LINK'] = link

	if not v['LINK_CC']:
		v['LINK_CC'] = v['LINK_CXX']

	# staticlib linker
	if not v['AR']:
		stliblink = conf.find_program(lib_name, path_list=path, var='AR')
		if not stliblink: return
		v['ARFLAGS'] = ['/NOLOGO']

	# manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later
	if v.MSVC_MANIFEST:
		conf.find_program('MT', path_list=path, var='MT')
		v['MTFLAGS'] = ['/NOLOGO']

	try:
		conf.load('winres')
	except Errors.WafError:
		warn('Resource compiler not found. Compiling resource file is disabled')
开发者ID:anthonyrisinger,项目名称:zippy,代码行数:56,代码来源:msvc.py



注:本文中的waflib.Configure.conf.find_program函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python conf.gcc_common_flags函数代码示例发布时间:2022-05-26
下一篇:
Python conf.find_ar函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap