def find_msvc(conf): if sys.platform != 'win32': conf.fatal( 'MSVC module only works under native Win32 Python! cygwin is not supported yet' ) v = conf.env compiler, version, path, includes, libdirs = detect_msvc(conf) compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) has_msvc_manifest = (compiler == 'msvc' and float(version) >= 8) or ( compiler == 'wsdk' and float(version) >= 6) or (compiler == 'intel' and float(version) >= 11) cxx = None if v.CXX: cxx = v.CXX elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path, mandatory=True) cxx = conf.cmd_to_list(cxx) env = dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') link = v.LINK_CXX if not link: link = conf.find_program(linker_name, path_list=path, mandatory=True) ar = v.AR if not ar: ar = conf.find_program(lib_name, path_list=path, mandatory=True) mt = v.MT if has_msvc_manifest: mt = conf.find_program('MT', path_list=path, mandatory=True) v.MSVC_MANIFEST = has_msvc_manifest v.PATH = path v.CPPPATH = includes v.LIBPATH = libdirs v.CC = v.CXX = cxx v.CC_NAME = v.CXX_NAME = 'msvc' v.LINK = v.LINK_CXX = link if not v.LINK_CC: v.LINK_CC = v.LINK_CXX v.AR = ar v.MT = mt v.MTFLAGS = v.ARFLAGS = ['/NOLOGO'] conf.check_tool('winres') if not conf.env.WINRC: warn( 'Resource compiler not found. Compiling resource file is disabled') try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass
def find_msvc(conf): if sys.platform != 'win32': conf.fatal( 'MSVC module only works under native Win32 Python! cygwin is not supported yet' ) v = conf.env compiler, path, includes, libdirs = detect_msvc(conf) v['PATH'] = path v['CPPPATH'] = includes v['LIBPATH'] = libdirs compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) cxx = None if v['CXX']: cxx = v['CXX'] elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path) if not cxx: conf.fatal('%s was not found (compiler)' % compiler_name) cxx = conf.cmd_to_list(cxx) env = dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') v['CC'] = v['CXX'] = cxx v['CC_NAME'] = v['CXX_NAME'] = 'msvc' try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass 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) if not stliblink: return v['AR'] = stliblink v['ARFLAGS'] = ['/NOLOGO'] manifesttool = conf.find_program('MT', path_list=path) if manifesttool: v['MT'] = manifesttool v['MTFLAGS'] = ['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn( 'Resource compiler not found. Compiling resource file is disabled')
def detect(conf): java_path=conf.environ['PATH'].split(os.pathsep) v=conf.env if'JAVA_HOME'in conf.environ: java_path=[os.path.join(conf.environ['JAVA_HOME'],'bin')]+java_path conf.env['JAVA_HOME']=[conf.environ['JAVA_HOME']] for x in'javac java jar'.split(): conf.find_program(x,var=x.upper(),path_list=java_path) conf.env[x.upper()]=conf.cmd_to_list(conf.env[x.upper()]) v['JAVA_EXT']=['.java'] if'CLASSPATH'in conf.environ: v['CLASSPATH']=conf.environ['CLASSPATH'] if not v['JAR']:conf.fatal('jar is required for making java packages') if not v['JAVAC']:conf.fatal('javac is required for compiling java classes') v['JARCREATE']='cf'
def find_msvc(conf): if sys.platform!='win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v=conf.env compiler,version,path,includes,libdirs=detect_msvc(conf) compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler) has_msvc_manifest=(compiler=='msvc'and float(version)>=8)or(compiler=='wsdk'and float(version)>=6)or(compiler=='intel'and float(version)>=11) cxx=None if v.CXX:cxx=v.CXX elif'CXX'in conf.environ:cxx=conf.environ['CXX'] if not cxx:cxx=conf.find_program(compiler_name,var='CXX',path_list=path,mandatory=True) cxx=conf.cmd_to_list(cxx) env=dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx,'/nologo','/?'],silent=True,env=env): conf.fatal('the msvc compiler could not be identified') link=v.LINK_CXX if not link: link=conf.find_program(linker_name,path_list=path,mandatory=True) ar=v.AR if not ar: ar=conf.find_program(lib_name,path_list=path,mandatory=True) mt=v.MT if has_msvc_manifest: mt=conf.find_program('MT',path_list=path,mandatory=True) v.MSVC_MANIFEST=has_msvc_manifest v.PATH=path v.CPPPATH=includes v.LIBPATH=libdirs v.CC=v.CXX=cxx v.CC_NAME=v.CXX_NAME='msvc' v.LINK=v.LINK_CXX=link if not v.LINK_CC: v.LINK_CC=v.LINK_CXX v.AR=ar v.MT=mt v.MTFLAGS=v.ARFLAGS=['/NOLOGO'] conf.check_tool('winres') if not conf.env.WINRC: warn('Resource compiler not found. Compiling resource file is disabled') try:v.prepend_value('CPPPATH',conf.environ['INCLUDE']) except KeyError:pass try:v.prepend_value('LIBPATH',conf.environ['LIB']) except KeyError:pass
def find_msvc(conf): if sys.platform!='win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v=conf.env compiler,path,includes,libdirs=detect_msvc(conf) v['PATH']=path v['CPPPATH']=includes v['LIBPATH']=libdirs compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler) cxx=None if v['CXX']:cxx=v['CXX'] elif'CXX'in conf.environ:cxx=conf.environ['CXX'] if not cxx:cxx=conf.find_program(compiler_name,var='CXX',path_list=path) if not cxx:conf.fatal('%s was not found (compiler)'%compiler_name) cxx=conf.cmd_to_list(cxx) env=dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx,'/nologo','/?'],silent=True,env=env): conf.fatal('the msvc compiler could not be identified') v['CC']=v['CXX']=cxx v['CC_NAME']=v['CXX_NAME']='msvc' try:v.prepend_value('CPPPATH',conf.environ['INCLUDE']) except KeyError:pass try:v.prepend_value('LIBPATH',conf.environ['LIB']) except KeyError:pass 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) if not stliblink:return v['AR']=stliblink v['ARFLAGS']=['/NOLOGO'] manifesttool=conf.find_program('MT',path_list=path) if manifesttool: v['MT']=manifesttool v['MTFLAGS']=['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn('Resource compiler not found. Compiling resource file is disabled')
def detect(conf): # If JAVA_PATH is set, we prepend it to the path list java_path = conf.environ["PATH"].split(os.pathsep) v = conf.env if "JAVA_HOME" in conf.environ: java_path = [os.path.join(conf.environ["JAVA_HOME"], "bin")] + java_path conf.env["JAVA_HOME"] = [conf.environ["JAVA_HOME"]] for x in "javac java jar".split(): conf.find_program(x, var=x.upper(), path_list=java_path) conf.env[x.upper()] = conf.cmd_to_list(conf.env[x.upper()]) v["JAVA_EXT"] = [".java"] if "CLASSPATH" in conf.environ: v["CLASSPATH"] = conf.environ["CLASSPATH"] if not v["JAR"]: conf.fatal("jar is required for making java packages") if not v["JAVAC"]: conf.fatal("javac is required for compiling java classes") v["JARCREATE"] = "cf" # can use cvf
def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal( 'MSVC module only works under native Win32 Python! cygwin is not supported yet' ) v = conf.env compiler, version, path, includes, libdirs = detect_msvc(conf) compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) has_msvc_manifest = (compiler == 'msvc' and float(version) >= 8) or ( compiler == 'wsdk' and float(version) >= 6) or (compiler == 'intel' and float(version) >= 11) # compiler cxx = None if v.CXX: cxx = v.CXX elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path, mandatory=True) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') link = v.LINK_CXX if not link: link = conf.find_program(linker_name, path_list=path, mandatory=True) ar = v.AR if not ar: ar = conf.find_program(lib_name, path_list=path, mandatory=True) # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later mt = v.MT if has_msvc_manifest: mt = conf.find_program('MT', path_list=path, mandatory=True) # no more possibility of failure means the data state will be consistent # we may store the data safely now v.MSVC_MANIFEST = has_msvc_manifest v.PATH = path v.CPPPATH = includes v.LIBPATH = libdirs # c/c++ compiler v.CC = v.CXX = cxx v.CC_NAME = v.CXX_NAME = 'msvc' v.LINK = v.LINK_CXX = link if not v.LINK_CC: v.LINK_CC = v.LINK_CXX v.AR = ar v.MT = mt v.MTFLAGS = v.ARFLAGS = ['/NOLOGO'] conf.check_tool('winres') if not conf.env.WINRC: warn( 'Resource compiler not found. Compiling resource file is disabled') # environment flags try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass
def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v = conf.env compiler, version, path, includes, libdirs = detect_msvc(conf) compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) has_msvc_manifest = (compiler == 'msvc' and float(version) >= 8) or (compiler == 'wsdk' and float(version) >= 6) or (compiler == 'intel' and float(version) >= 11) # compiler cxx = None if v.CXX: cxx = v.CXX elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path, mandatory=True) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH = ';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') link = v.LINK_CXX if not link: link = conf.find_program(linker_name, path_list=path, mandatory=True) ar = v.AR if not ar: ar = conf.find_program(lib_name, path_list=path, mandatory=True) # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later mt = v.MT if has_msvc_manifest: mt = conf.find_program('MT', path_list=path, mandatory=True) # no more possibility of failure means the data state will be consistent # we may store the data safely now v.MSVC_MANIFEST = has_msvc_manifest v.PATH = path v.CPPPATH = includes v.LIBPATH = libdirs # c/c++ compiler v.CC = v.CXX = cxx v.CC_NAME = v.CXX_NAME = 'msvc' v.LINK = v.LINK_CXX = link if not v.LINK_CC: v.LINK_CC = v.LINK_CXX v.AR = ar v.MT = mt v.MTFLAGS = v.ARFLAGS = ['/NOLOGO'] conf.check_tool('winres') if not conf.env.WINRC: warn('Resource compiler not found. Compiling resource file is disabled') # environment flags try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass
def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal( 'MSVC module only works under native Win32 Python! cygwin is not supported yet' ) v = conf.env compiler, path, includes, libdirs = detect_msvc(conf) v['PATH'] = path v['CPPPATH'] = includes v['LIBPATH'] = libdirs compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) # compiler cxx = None if v['CXX']: cxx = v['CXX'] elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path) if not cxx: conf.fatal('%s was not found (compiler)' % compiler_name) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH=';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, 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' # environment flags try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass # 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) if not stliblink: return v['AR'] = stliblink v['ARFLAGS'] = ['/NOLOGO'] # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later manifesttool = conf.find_program('MT', path_list=path) if manifesttool: v['MT'] = manifesttool v['MTFLAGS'] = ['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn( 'Resource compiler not found. Compiling resource file is disabled')
def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != "win32": conf.fatal("MSVC module only works under native Win32 Python! cygwin is not supported yet") v = conf.env compiler, path, includes, libdirs = detect_msvc(conf) v["PATH"] = path v["CPPPATH"] = includes v["LIBPATH"] = libdirs compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) # compiler cxx = None if v["CXX"]: cxx = v["CXX"] elif "CXX" in conf.environ: cxx = conf.environ["CXX"] if not cxx: cxx = conf.find_program(compiler_name, var="CXX", path_list=path) if not cxx: conf.fatal("%s was not found (compiler)" % compiler_name) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH=";".join(path)) if not Utils.cmd_output([cxx, "/nologo", "/?"], silent=True, 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" # environment flags try: v.prepend_value("CPPPATH", conf.environ["INCLUDE"]) except KeyError: pass try: v.prepend_value("LIBPATH", conf.environ["LIB"]) except KeyError: pass # 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) if not stliblink: return v["AR"] = stliblink v["ARFLAGS"] = ["/NOLOGO"] # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later manifesttool = conf.find_program("MT", path_list=path) if manifesttool: v["MT"] = manifesttool v["MTFLAGS"] = ["/NOLOGO"] conf.check_tool("winres") if not conf.env["WINRC"]: warn("Resource compiler not found. Compiling resource file is disabled")
def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v = conf.env compiler, path, includes, libdirs = detect_msvc(conf) v['PATH'] = path v['CPPPATH'] = includes v['LIBPATH'] = libdirs compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler) # compiler cxx = None if v['CXX']: cxx = v['CXX'] elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path) if not cxx: conf.fatal('%s was not found (compiler)' % compiler_name) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH = ';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, 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' # environment flags try: v.prepend_value('CPPPATH', conf.environ['INCLUDE']) except KeyError: pass try: v.prepend_value('LIBPATH', conf.environ['LIB']) except KeyError: pass # 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) if not stliblink: return v['AR'] = stliblink v['ARFLAGS'] = ['/NOLOGO'] # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later manifesttool = conf.find_program('MT', path_list=path) if manifesttool: v['MT'] = manifesttool v['MTFLAGS'] = ['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn('Resource compiler not found. Compiling resource file is disabled')