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

Python conf.cmd_to_list函数代码示例

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

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



在下文中一共展示了cmd_to_list函数的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: find_android_gxx

def find_android_gxx(conf):
	exeDir = os.path.join(conf.options.ndk, "toolchains", "arm-linux-androideabi-4.6", "prebuilt", "windows-x86_64", "bin")
	cxx=conf.find_program(['arm-linux-androideabi-g++'], var = "CXX", path_list=[exeDir])
	cxx=conf.cmd_to_list(cxx)
	conf.get_cc_version(cxx,gcc=True)
	conf.env.CXX_NAME='gcc'
	conf.env.CXX=cxx
开发者ID:pixpil,项目名称:gii,代码行数:7,代码来源:android-gxx.py


示例3: check_cython_version

def check_cython_version(conf, minver):
    conf.start_msg("Checking cython version")
    minver = tuple(minver)
    import re
    version_re = re.compile(r'cython\s*version\s*(?P<major>\d*)\.(?P<minor>\d*)(?:\.(?P<micro>\d*))?', re.I).search
    cmd = conf.cmd_to_list(conf.env['CYTHON'])
    cmd = cmd + ['--version']
    from waflib.Tools import fc_config
    stdout, stderr = fc_config.getoutput(conf, cmd)
    if stdout:
        match = version_re(stdout)
    else:
        match = version_re(stderr)
    if not match:
        conf.fatal("cannot determine the Cython version")
    cy_ver = [match.group('major'), match.group('minor')]
    if match.group('micro'):
        cy_ver.append(match.group('micro'))
    else:
        cy_ver.append('0')
    cy_ver = tuple([int(x) for x in cy_ver])
    if cy_ver < minver:
        conf.end_msg(False)
        conf.fatal("cython version %s < %s" % (cy_ver, minver))
    conf.end_msg(str(cy_ver))
开发者ID:dagss,项目名称:distarray-old,代码行数:25,代码来源:cython.py


示例4: find_solstudio

def find_solstudio(conf):
	"""Find the Solaris Studio compiler (will look in the environment variable 'FC')"""

	fc = conf.find_program(['sunf95', 'f95', 'sunf90', 'f90'], var='FC')
	fc = conf.cmd_to_list(fc)
	conf.get_solstudio_version(fc)
	conf.env.FC_NAME = 'SOL'
开发者ID:Anastasia1302,项目名称:code-pile,代码行数:7,代码来源:fc_solstudio.py


示例5: find_openf95

def find_openf95(conf):
	"""Find the Open64 Fortran Compiler (will look in the environment variable 'FC')"""

	fc = conf.find_program(['openf95', 'openf90'], var='FC')
	fc = conf.cmd_to_list(fc)
	conf.get_open64_version(fc)
	conf.env.FC_NAME='OPEN64'
开发者ID:jrossi,项目名称:waf,代码行数:7,代码来源:fc_open64.py


示例6: find_gfortran

def find_gfortran(conf):
    """Find the gfortran program (will look in the environment variable 'FC')"""
    fc = conf.find_program(["gfortran", "g77"], var="FC")
    # (fallback to g77 for systems, where no gfortran is available)
    fc = conf.cmd_to_list(fc)
    conf.get_gfortran_version(fc)
    conf.env.FC_NAME = "GFORTRAN"
开发者ID:RedHatter,项目名称:diodon-plugins,代码行数:7,代码来源:gfortran.py


示例7: find_crayftn

def find_crayftn(conf):
	"""Find the Cray fortran compiler (will look in the environment variable 'FC')"""
	fc = conf.find_program(['crayftn'], var='FC')
	fc = conf.cmd_to_list(fc)
	conf.get_crayftn_version(fc)
	conf.env.FC_NAME = 'CRAY'
	conf.env.FC_MOD_CAPITALIZATION = 'UPPER.mod'
开发者ID:Dzshiftt,项目名称:Gnomescroll,代码行数:7,代码来源:fc_cray.py


示例8: find_xlf

def find_xlf(conf):
	"""Find the xlf program (will look in the environment variable 'FC')"""

	fc = conf.find_program(['xlf2003_r', 'xlf2003', 'xlf95_r', 'xlf95', 'xlf90_r', 'xlf90', 'xlf_r', 'xlf'], var='FC')
	fc = conf.cmd_to_list(fc)
	conf.get_xlf_version(fc)
	conf.env.FC_NAME='XLF'
开发者ID:jrossi,项目名称:waf,代码行数:7,代码来源:fc_xlf.py


示例9: find_xlc

def find_xlc(conf):
	"""
	Detect the Aix C compiler
	"""
	cc = conf.find_program(['xlc_r', 'xlc'], var='CC')
	cc = conf.cmd_to_list(cc)
	conf.env.CC_NAME = 'xlc'
	conf.env.CC      = cc
开发者ID:ita1024,项目名称:node,代码行数:8,代码来源:xlc.py


示例10: find_nag

def find_nag(conf):
	"""Find the NAG Fortran Compiler (will look in the environment variable 'FC')"""

	fc = conf.find_program(['nagfor'], var='FC')
	fc = conf.cmd_to_list(fc)
	conf.get_nag_version(fc)
	conf.env.FC_NAME = 'NAG'
	conf.env.FC_MOD_CAPITALIZATION = 'lower'
开发者ID:aeberspaecher,项目名称:waf,代码行数:8,代码来源:fc_nag.py


示例11: find_xlcxx

def find_xlcxx(conf):
	"""
	Detect the Aix C++ compiler
	"""
	cxx = conf.find_program(['xlc++_r', 'xlc++'], var='CXX')
	cxx = conf.cmd_to_list(cxx)
	conf.env.CXX_NAME = 'xlc++'
	conf.env.CXX      = cxx
开发者ID:jrossi,项目名称:waf,代码行数:8,代码来源:xlcxx.py


示例12: find_xlcxx

def find_xlcxx(conf):
    """
	Detect the Aix C++ compiler
	"""
    cxx = conf.find_program(["xlc++_r", "xlc++"], var="CXX")
    cxx = conf.cmd_to_list(cxx)
    conf.env.CXX_NAME = "xlc++"
    conf.env.CXX = cxx
开发者ID:ita1024,项目名称:node,代码行数:8,代码来源:xlcxx.py


示例13: find_gxx

def find_gxx(conf):
    """
	Find the program g++, and if present, try to detect its version number
	"""
    cxx = conf.find_program(["g++", "c++"], var="CXX")
    cxx = conf.cmd_to_list(cxx)
    conf.get_cc_version(cxx, gcc=True)
    conf.env.CXX_NAME = "gcc"
    conf.env.CXX = cxx
开发者ID:jrossi,项目名称:waf,代码行数:9,代码来源:gxx.py


示例14: find_gcc

def find_gcc(conf):
	"""
	Find the program gcc, and if present, try to detect its version number
	"""
	cc = conf.find_program(['gcc', 'cc'], var='CC')
	cc = conf.cmd_to_list(cc)
	conf.get_cc_version(cc, gcc=True)
	conf.env.CC_NAME = 'gcc'
	conf.env.CC      = cc
开发者ID:anthonyrisinger,项目名称:zippy,代码行数:9,代码来源:gcc.py


示例15: find_arm_gcc

def find_arm_gcc(conf):
	"""
	Find the program gcc, and if present, try to detect its version number
	"""
	cc = conf.find_program(['arm-none-eabi-gcc', 'arm-none-linux-gnueabi-gcc'], var='CC')
	cc = conf.cmd_to_list(cc)
	conf.get_cc_version(cc, gcc=True)
	conf.env.CC_NAME = 'arm-gcc'
	conf.env.CC      = cc
开发者ID:imanaskari,项目名称:swiftler-bones,代码行数:9,代码来源:arm_gcc.py


示例16: find_gxx

def find_gxx(conf):
	"""
	Find the program g++, and if present, try to detect its version number
	"""
	cxx = conf.find_program(['g++', 'c++'], var='CXX')
	cxx = conf.cmd_to_list(cxx)
	conf.get_cc_version(cxx, gcc=True)
	conf.env.CXX_NAME = 'gcc'
	conf.env.CXX      = cxx
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:9,代码来源:gxx.py


示例17: 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


示例18: get_msvc_version

def get_msvc_version(conf, compiler, version, target, vcvars):
	debug('msvc: get_msvc_version: %r %r %r', compiler, version, target)
	batfile = conf.bldnode.make_node('waf-print-msvc.bat')
	batfile.write("""@echo off
set INCLUDE=
set LIB=
call "%s" %s
echo PATH=%%PATH%%
echo INCLUDE=%%INCLUDE%%
echo LIB=%%LIB%%
""" % (vcvars,target))
	sout = conf.cmd_and_log(['cmd', '/E:on', '/V:on', '/C', batfile.abspath()])
	lines = sout.splitlines()

	for x in ('Setting environment', 'Setting SDK environment', 'Intel(R) C++ Compiler'):
		if lines[0].find(x) != -1:
			break
	else:
		debug('msvc: get_msvc_version: %r %r %r -> not found', compiler, version, target)
		conf.fatal('msvc: Impossible to find a valid architecture for building (in get_msvc_version)')

	for line in lines[1:]:
		if line.startswith('PATH='):
			path = line[5:]
			MSVC_PATH = path.split(';')
		elif line.startswith('INCLUDE='):
			MSVC_INCDIR = [i for i in line[8:].split(';') if i]
		elif line.startswith('LIB='):
			MSVC_LIBDIR = [i for i in line[4:].split(';') if i]

	# Check if the compiler is usable at all.
	# The detection may return 64-bit versions even on 32-bit systems, and these would fail to run.
	env = {}
	env.update(os.environ)
	env.update(PATH = path)
	compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler)
	cxx = conf.find_program(compiler_name, path_list=MSVC_PATH)
	cxx = conf.cmd_to_list(cxx)

	# delete CL if exists. because it could contain parameters wich can change cl's behaviour rather catastrophically.
	if 'CL' in env:
		del(env['CL'])

	try:
		try:
			conf.cmd_and_log(cxx + ['/help'], env=env)
		except Exception as e:
			debug('msvc: get_msvc_version: %r %r %r -> failure' % (compiler, version, target))
			debug(str(e))
			conf.fatal('msvc: cannot run the compiler (in get_msvc_version)')
		else:
			debug('msvc: get_msvc_version: %r %r %r -> OK', compiler, version, target)
	finally:
		conf.env[compiler_name] = ''

	return (MSVC_PATH, MSVC_INCDIR, MSVC_LIBDIR)
开发者ID:SjB,项目名称:waf,代码行数:56,代码来源:msvc.py


示例19: get_msvc_version

def get_msvc_version(conf,compiler,version,target,vcvars):
	debug('msvc: get_msvc_version: %r %r %r',compiler,version,target)
	batfile=conf.bldnode.make_node('waf-print-msvc.bat')
	batfile.write("""@echo off
set INCLUDE=
set LIB=
call "%s" %s
echo PATH=%%PATH%%
echo INCLUDE=%%INCLUDE%%
echo LIB=%%LIB%%
"""%(vcvars,target))
	sout=conf.cmd_and_log(['cmd','/E:on','/V:on','/C',batfile.abspath()])
	lines=sout.splitlines()
	if not lines[0]:
		lines.pop(0)
	if version=='11.0':
		if lines[0].startswith('Error'):
			conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_1)')
	else:
		for x in('Setting environment','Setting SDK environment','Intel(R) C++ Compiler','Intel Parallel Studio'):
			if lines[0].find(x)>-1:
				lines.pop(0)
				break
		else:
			debug('msvc: get_msvc_version: %r %r %r -> not found',compiler,version,target)
			conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_2)')
	MSVC_PATH=MSVC_INCDIR=MSVC_LIBDIR=None
	for line in lines:
		if line.startswith('PATH='):
			path=line[5:]
			MSVC_PATH=path.split(';')
		elif line.startswith('INCLUDE='):
			MSVC_INCDIR=[i for i in line[8:].split(';')if i]
		elif line.startswith('LIB='):
			MSVC_LIBDIR=[i for i in line[4:].split(';')if i]
	if None in(MSVC_PATH,MSVC_INCDIR,MSVC_LIBDIR):
		conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_3)')
	env=dict(os.environ)
	env.update(PATH=path)
	compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
	cxx=conf.find_program(compiler_name,path_list=MSVC_PATH)
	cxx=conf.cmd_to_list(cxx)
	if'CL'in env:
		del(env['CL'])
	try:
		try:
			conf.cmd_and_log(cxx+['/help'],env=env)
		except Exception as e:
			debug('msvc: get_msvc_version: %r %r %r -> failure'%(compiler,version,target))
			debug(str(e))
			conf.fatal('msvc: cannot run the compiler (in get_msvc_version)')
		else:
			debug('msvc: get_msvc_version: %r %r %r -> OK',compiler,version,target)
	finally:
		conf.env[compiler_name]=''
	return(MSVC_PATH,MSVC_INCDIR,MSVC_LIBDIR)
开发者ID:RONNCC,项目名称:pysoy,代码行数:56,代码来源:msvc.py


示例20: configure

def configure(conf):
	conf.env.PYTHON=sys.executable
	# Add expected bin directory to path
	os.environ['PATH'] = sys.prefix + '/bin:' + os.environ['PATH']
	conf.env.PYTHON=conf.cmd_to_list(conf.env.PYTHON)
	v=conf.env
	v['PYCMD']='"import sys, py_compile;py_compile.compile(sys.argv[1], sys.argv[2])"'
	v['PYFLAGS']=''
	v['PYFLAGS_OPT']='-O'
	v['PYC']=getattr(Options.options,'pyc',1)
	v['PYO']=getattr(Options.options,'pyo',1)
开发者ID:JamesMakela-NOAA,项目名称:mpl-osx-binaries,代码行数:11,代码来源:mypython.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python conf.cxx_add_flags函数代码示例发布时间:2022-05-26
下一篇:
Python conf.cmd_and_log函数代码示例发布时间: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