pkg_args = { 'package': 'gthread-2.0', 'uselib_store': 'GTHREAD', 'args': '--cflags --libs' } if getattr(Options.options, 'vala_target_glib', None): pkg_args['atleast_version'] = Options.options.vala_target_glib self.check_cfg(**pkg_args) def configure(self): self.load('gnu_dirs') self.check_vala_deps() self.check_vala() def options(opt): opt.load('gnu_dirs') valaopts = opt.add_option_group('Vala Compiler Options') valaopts.add_option( '--vala-target-glib', default=None, dest='vala_target_glib', metavar='MAJOR.MINOR', help='Target version of glib for Vala GObject code generation') extension('.vala', '.gs')(vala_file) conf(find_valac) conf(check_vala) conf(check_vala_deps)
kw['cwd']=bld.cwd except AttributeError: bld.cwd=kw['cwd']=bld.variant_dir ret=self.exec_response_command(k[0],**kw) if not ret and getattr(self,'do_manifest',None): ret=self.exec_mf() return ret for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split(): cls=Task.classes.get(k,None) if cls: cls.exec_command=exec_command_msvc cls.exec_response_command=exec_response_command cls.quote_response_command=quote_response_command cls.exec_mf=exec_mf conf(get_msvc_version) conf(gather_wsdk_versions) conf(gather_msvc_targets) conf(gather_wince_targets) conf(gather_msvc_versions) conf(gather_icl_versions) conf(get_msvc_versions) conf(print_all_msvc_detected) conf(detect_msvc) conf(find_lt_names_msvc) conf(libname_msvc) conf(check_lib_msvc) conf(check_libs_msvc) conf(no_autodetect) conf(autodetect) conf(find_msvc)
self.env.INCLUDES_RUBYEXT=cpppath self.env.CFLAGS_RUBYEXT=read_config('CCDLFLAGS') self.env.rubyext_PATTERN='%s.'+read_config('DLEXT')[0] flags=read_config('LDSHARED') while flags and flags[0][0]!='-': flags=flags[1:] if len(flags)>1 and flags[1]=="ppc": flags=flags[2:] self.env.LINKFLAGS_RUBYEXT=flags self.env.LINKFLAGS_RUBYEXT+=read_config('LIBS') self.env.LINKFLAGS_RUBYEXT+=read_config('LIBRUBYARG_SHARED') if Options.options.rubyarchdir: self.env.ARCHDIR_RUBY=Options.options.rubyarchdir else: self.env.ARCHDIR_RUBY=read_config('sitearchdir')[0] if Options.options.rubylibdir: self.env.LIBDIR_RUBY=Options.options.rubylibdir else: self.env.LIBDIR_RUBY=read_config('sitelibdir')[0] def options(opt): opt.add_option('--with-ruby-archdir',type='string',dest='rubyarchdir',help='Specify directory where to install arch specific files') opt.add_option('--with-ruby-libdir',type='string',dest='rubylibdir',help='Specify alternate ruby library path') opt.add_option('--with-ruby-binary',type='string',dest='rubybinary',help='Specify alternate ruby binary') feature('rubyext')(init_rubyext) before('apply_incpaths','apply_lib_vars','apply_bundle','apply_link')(init_rubyext) after('vars_target_cshlib')(init_rubyext) feature('rubyext')(apply_ruby_so_name) before('apply_link','propagate_uselib')(apply_ruby_so_name) conf(check_ruby_version) conf(check_ruby_ext_devel)
run_str='${MCS} ${CSTYPE} ${CSFLAGS} ${ASS_ST:ASSEMBLIES} ${RES_ST:RESOURCES} ${OUT} ${SRC}' def configure(conf): csc=getattr(Options.options,'cscbinary',None) if csc: conf.env.MCS=csc conf.find_program(['csc','mcs','gmcs'],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' def options(opt): opt.add_option('--with-csc-binary',type='string',dest='cscbinary') class fake_csshlib(Task.Task): color='YELLOW' inst_to=None def runnable_status(self): for x in self.outputs: x.sig=Utils.h_file(x.abspath()) return Task.SKIP_ME def read_csshlib(self,name,paths=[]): return self(name=name,features='fake_lib',lib_paths=paths,lib_type='csshlib') feature('cs')(apply_cs) before_method('process_source')(apply_cs) feature('cs')(use_cs) after_method('apply_cs')(use_cs) feature('cs')(debug_cs) after_method('apply_cs','use_cs')(debug_cs) conf(read_csshlib)
for(u,du,c)in mangling_schemes(): try: self.check_cc(compile_filename=[],features='link_main_routines_func',msg='nomsg',errmsg='nomsg',mandatory=True,dummy_func_nounder=mangle_name(u,du,c,"foobar"),dummy_func_under=mangle_name(u,du,c,"foo_bar"),main_func_name=self.env.FC_MAIN) except self.errors.ConfigurationError: pass else: self.end_msg("ok ('%s', '%s', '%s-case')"%(u,du,c)) self.env.FORTRAN_MANGLING=(u,du,c) break else: self.end_msg(False) self.fatal('mangler not found') return(u,du,c) def set_lib_pat(self): self.env['fcshlib_PATTERN']=self.env['pyext_PATTERN'] conf(fc_flags) conf(check_fortran) conf(check_fc) conf(fortran_modifier_darwin) conf(fortran_modifier_win32) conf(fortran_modifier_cygwin) conf(check_fortran_dummy_main) conf(is_link_verbose) conf(check_fortran_verbose_flag) conf(check_fortran_clib) feature('link_main_routines_func')(link_main_routines_tg_method) before_method('process_source')(link_main_routines_tg_method) conf(check_fortran_mangling) feature('pyext')(set_lib_pat) before_method('propagate_uselib_vars','apply_link')(set_lib_pat)
self.end_msg(False) return None self.end_msg(r or True) return r def check_perl_ext_devel(self): env=self.env perl=env.PERL if not perl: self.fatal('find perl first') def read_out(cmd): return Utils.to_list(self.cmd_and_log(perl+cmd)) env['LINKFLAGS_PERLEXT']=read_out(" -MConfig -e'print $Config{lddlflags}'") env['INCLUDES_PERLEXT']=read_out(" -MConfig -e'print \"$Config{archlib}/CORE\"'") env['CFLAGS_PERLEXT']=read_out(" -MConfig -e'print \"$Config{ccflags} $Config{cccdlflags}\"'") env['XSUBPP']=read_out(" -MConfig -e'print \"$Config{privlib}/ExtUtils/xsubpp$Config{exe_ext}\"'") env['EXTUTILS_TYPEMAP']=read_out(" -MConfig -e'print \"$Config{privlib}/ExtUtils/typemap\"'") if not getattr(Options.options,'perlarchdir',None): env['ARCHDIR_PERL']=self.cmd_and_log(perl+" -MConfig -e'print $Config{sitearch}'") else: env['ARCHDIR_PERL']=getattr(Options.options,'perlarchdir') env['perlext_PATTERN']='%s.'+self.cmd_and_log(perl+" -MConfig -e'print $Config{dlext}'") def options(opt): opt.add_option('--with-perl-binary',type='string',dest='perlbinary',help='Specify alternate perl binary',default=None) opt.add_option('--with-perl-archdir',type='string',dest='perlarchdir',help='Specify directory where to install arch specific files',default=None) before_method('apply_incpaths','apply_link','propagate_uselib_vars')(init_perlext) feature('perlext')(init_perlext) extension('.xs')(xsubpp_file) conf(check_perl_version) conf(check_perl_module) conf(check_perl_ext_devel)
if'd'in exts: feats.append('d') if'java'in exts: feats.append('java') if'java'in exts: return'java' if type in['program','shlib','stlib']: for x in feats: if x in['cxx','d','c']: feats.append(x+type) return feats def set_features(kw,_type): kw['_type']=_type kw['features']=Utils.to_list(kw.get('features',[]))+Utils.to_list(sniff_features(**kw)) def program(bld,*k,**kw): set_features(kw,'program') return bld(*k,**kw) def shlib(bld,*k,**kw): set_features(kw,'shlib') return bld(*k,**kw) def stlib(bld,*k,**kw): set_features(kw,'stlib') return bld(*k,**kw) def objects(bld,*k,**kw): set_features(kw,'objects') return bld(*k,**kw) conf(program) conf(shlib) conf(stlib) conf(objects)
import sys from waflib.Tools import ar,d from waflib.Configure import conf def find_gdc(conf): conf.find_program('gdc',var='D') def common_flags_gdc(conf): v=conf.env v['DFLAGS']=[] v['D_SRC_F']=['-c'] v['D_TGT_F']='-o%s' v['D_LINKER']=v['D'] v['DLNK_SRC_F']='' v['DLNK_TGT_F']='-o%s' v['DINC_ST']='-I%s' v['DSHLIB_MARKER']=v['DSTLIB_MARKER']='' v['DSTLIB_ST']=v['DSHLIB_ST']='-l%s' v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L%s' v['LINKFLAGS_dshlib']=['-shared'] v['DHEADER_ext']='.di' v.DFLAGS_d_with_header='-fintfc' v['D_HDR_F']='-fintfc-file=%s' def configure(conf): conf.find_gdc() conf.load('ar') conf.load('d') conf.common_flags_gdc() conf.d_platform_flags() conf(find_gdc) conf(common_flags_gdc)
out,err=fc_config.getoutput(conf,cmd,stdin=True) if out.find('__GNUC__')<0: conf.fatal('Could not determine the compiler type') k={} out=out.split('\n') import shlex for line in out: lst=shlex.split(line) if len(lst)>2: key=lst[1] val=lst[2] k[key]=val def isD(var): return var in k def isT(var): return var in k and k[var]!='0' conf.env['FC_VERSION']=(k['__GNUC__'],k['__GNUC_MINOR__'],k['__GNUC_PATCHLEVEL__']) def configure(conf): conf.find_gfortran() conf.find_ar() conf.fc_flags() conf.gfortran_flags() conf.gfortran_modifier_platform() conf(find_gfortran) conf(gfortran_flags) conf(gfortran_modifier_win32) conf(gfortran_modifier_cygwin) conf(gfortran_modifier_darwin) conf(gfortran_modifier_platform) conf(get_gfortran_version)
return 0; } } else { version(Tango) { import tango.stdc.stdio; int main() { printf("tango"); return 0; } } else { import std.stdio; int main() { writefln("phobos1"); return 0; } } } ''' def check_dlibrary(self): ret = self.check_cc(features='d dprogram', fragment=DLIB, compile_filename='test.d', execute=True, define_ret=True) self.env.DLIBRARY = ret.strip() conf(d_platform_flags) conf(check_dlibrary)
except: target_triple = 'unknown-notfound-none' else: target_triple = t.target_triple( bld, platform) or 'unknown-notfound-none' version = 'x.x.x' finally: bld.setenv('') return "/".join(x for x in (target_triple, version, suffix, '') if x is not None) # register get_name_prefix function with configuration/build context conf(toolchain.get_name_prefix) @conf def configure_toolchain(conf, name): global toolchain try: func = toolchain.toolchains[name] except KeyError: raise conf.errors.ConfigurationError('Unknown toolchain %s' % name) func(conf) @conf def select_toolchain(ctx, name):
try: if not kw.get('cwd',None): kw['cwd']=bld.cwd except AttributeError: bld.cwd=kw['cwd']=bld.variant_dir ret=self.generator.bld.exec_command(*k,**kw) if ret:return ret if getattr(self,'do_manifest',None): ret=exec_mf(self) return ret for k in'c cxx winrc cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib qxx'.split(): cls=Task.classes.get(k,None) if cls: cls.exec_command=exec_command_msvc conf(get_msvc_version) conf(gather_wsdk_versions) conf(gather_msvc_versions) conf(gather_icl_versions) conf(get_msvc_versions) conf(print_all_msvc_detected) conf(find_lt_names_msvc) conf(libname_msvc) conf(check_lib_msvc) conf(check_libs_msvc) conf(no_autodetect) conf(autodetect) conf(find_msvc) conf(msvc_common_flags) after('apply_link')(apply_flags_msvc) feature('c','cxx')(apply_flags_msvc)
self.exec_command(cmd) @feature('avr-gcc') @after_method('apply_link') def avr_objcopy_tskgen(tgen): if not hasattr(tgen, 'link_task') or not tgen.link_task: return [] #tgen.env.fatal("There must be a link task to process") if not tgen.link_task.outputs[0].name.endswith('.elf'): return [] #tgen.env.fatal("Link task must end with .elf") out = tgen.link_task.outputs[0].change_ext('.eep') tsk = tgen.create_task('makeEEP', tgen.link_task.outputs[0], out) outhex = tgen.link_task.outputs[0].change_ext('.hex') tskHex = tgen.create_task('makeHex', tgen.link_task.outputs[0], outhex) return [tsk, tskHex] conf(find_avr_gcc) conf(avr_gcc_common_flags) conf(avr_gcc_modifier_win32) conf(avr_gcc_modifier_cygwin) conf(avr_gcc_modifier_darwin) conf(avr_gcc_modifier_aix) conf(avr_gcc_modifier_hpux) conf(avr_gcc_modifier_platform)
for d in libDirs: try: conf.check(header_name='jni.h', define_name='HAVE_JNI_H', lib='jvm', libpath=d, includes=incDirs, uselib_store='JAVA', uselib='JAVA') except: pass else: break else: conf.fatal('could not find lib jvm in %r (see config.log)' % libDirs) feature('javac')(apply_java) before_method('process_source')(apply_java) feature('javac')(use_javac_files) after_method('apply_java')(use_javac_files) feature('javac')(set_classpath) after_method('apply_java', 'propagate_uselib_vars', 'use_javac_files')(set_classpath) feature('jar')(jar_files) after_method('apply_java', 'use_javac_files')(jar_files) before_method('process_source')(jar_files) feature('jar')(use_jar_files) after_method('jar_files')(use_jar_files) conf(check_java_class) conf(check_jni_headers)
v['CXXLNK_TGT_F'] = ['-o', ''] v['CPPPATH_ST'] = '-I%s' v['DEFINES_ST'] = '-D%s' v['LIB_ST'] = '-l%s' v['LIBPATH_ST'] = '-L%s' v['STLIB_ST'] = '-l%s' v['STLIBPATH_ST'] = '-L%s' v['RPATH_ST'] = '-Wl,-rpath,%s' v['SONAME_ST'] = '' v['SHLIB_MARKER'] = '' v['STLIB_MARKER'] = '' v['LINKFLAGS_cxxprogram'] = ['-Wl,-brtl'] v['cxxprogram_PATTERN'] = '%s' v['CXXFLAGS_cxxshlib'] = ['-fPIC'] v['LINKFLAGS_cxxshlib'] = ['-G', '-Wl,-brtl,-bexpfull'] v['cxxshlib_PATTERN'] = 'lib%s.so' v['LINKFLAGS_cxxstlib'] = '' v['cxxstlib_PATTERN'] = 'lib%s.a' configure = ''' find_xlcxx find_ar xlcxx_common_flags cxx_load_tools cxx_add_flags link_add_flags ''' conf(find_xlcxx) conf(xlcxx_common_flags)
def options(opt): opt.add_option('--with-csc-binary', type='string', dest='cscbinary') class fake_csshlib(Task.Task): color = 'YELLOW' inst_to = None def runnable_status(self): for x in self.outputs: x.sig = Utils.h_file(x.abspath()) return Task.SKIP_ME def read_csshlib(self, name, paths=[]): return self(name=name, features='fake_lib', lib_paths=paths, lib_type='csshlib') feature('cs')(apply_cs) before('process_source')(apply_cs) feature('cs')(use_cs) after('apply_cs')(use_cs) feature('cs')(debug_cs) after('apply_cs', 'use_cs')(debug_cs) conf(read_csshlib)
node.sig=Utils.h_file(node.abspath()) break else: continue break else: raise Errors.WafError('could not find library %r'%self.name) self.link_task=self.create_task('fake_%s'%self.lib_type,[],[node]) self.target=self.name taskgen_method(create_compiled_task) taskgen_method(to_incnodes) feature('c','cxx','d','go','asm','fc','includes')(apply_incpaths) after_method('propagate_uselib_vars','process_source')(apply_incpaths) feature('c','cxx','d','go','fc','asm')(apply_link) after_method('process_source')(apply_link) taskgen_method(use_rec) feature('c','cxx','d','use','fc')(process_use) before_method('apply_incpaths','propagate_uselib_vars')(process_use) after_method('apply_link','process_source')(process_use) taskgen_method(add_objects_from_tgen) taskgen_method(get_uselib_vars) feature('c','cxx','d','fc','javac','cs','uselib')(propagate_uselib_vars) after_method('process_use')(propagate_uselib_vars) feature('cshlib','cxxshlib','fcshlib')(apply_implib) after_method('apply_link')(apply_implib) feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')(apply_vnum) after_method('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
v['PYC'] = getattr(Options.options, 'pyc', 1) v['PYO'] = getattr(Options.options, 'pyo', 1) def options(opt): opt.add_option( '--nopyc', action='store_false', default=1, help= 'Do not install bytecode compiled .pyc files (configuration) [Default:install]', dest='pyc') opt.add_option( '--nopyo', action='store_false', default=1, help= 'Do not install optimised compiled .pyo files (configuration) [Default:install]', dest='pyo') extension('.py')(process_py) feature('py')(feature_py) feature('pyext')(init_pyext) before_method('propagate_uselib_vars', 'apply_link')(init_pyext) before_method('propagate_uselib_vars')(init_pyembed) feature('pyembed')(init_pyembed) conf(get_python_variables) conf(check_python_headers) conf(check_python_version) conf(check_python_module)
del self.env['LIBPATH_%s'%var] for cxxflags in(['/MD','/EHsc'],[]): self.env.stash() self.env["CXXFLAGS_%s"%var]+=cxxflags try: try_link() self.end_msg("ok: winning cxxflags combination: %s"%(self.env["CXXFLAGS_%s"%var])) e=None break except Errors.ConfigurationError as exc: self.env.revert() e=exc if e is not None: self.fatal("Could not auto-detect boost linking flags combination, you may report it to boost.py author",ex=e) else: self.fatal("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain") else: self.start_msg('Checking for boost linkage') try: try_link() except Errors.ConfigurationError ,e: self.fatal("Could not link against boost libraries using supplied options") self.end_msg('ok') conf(__boost_get_version_file) conf(boost_get_version) conf(boost_get_includes) conf(boost_get_toolset) conf(__boost_get_libs_path) conf(boost_get_libs) conf(check_boost)
if not 'features' in kw: if self.env.CXX: kw['features'] = ['cxx', 'cxxprogram'] else: kw['features'] = ['c', 'cprogram'] kw['fragment'] = LARGE_FRAGMENT kw['msg'] = 'Checking for large file support' try: if self.env.DEST_BINFMT != 'pe': self.check(**kw) except self.errors.ConfigurationError: pass else: return True kw['msg'] = 'Checking for -D_FILE_OFFSET_BITS=64' kw['defines'] = ['_FILE_OFFSET_BITS=64'] try: self.check(**kw) except self.errors.ConfigurationError: pass else: self.define('_FILE_OFFSET_BITS', 64) return True self.fatal('There is no support for large files') feature('link_lib_test')(link_lib_test_fun) before_method('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file)
def find_icpc(conf): if sys.platform == "cygwin": conf.fatal("The Intel compiler does not work on Cygwin") v = conf.env cxx = None if v["CXX"]: cxx = v["CXX"] elif "CXX" in conf.environ: cxx = conf.environ["CXX"] if not cxx: cxx = conf.find_program("icpc", var="CXX") if not cxx: conf.fatal("Intel C++ Compiler (icpc) was not found") cxx = conf.cmd_to_list(cxx) conf.get_cc_version(cxx, icc=True) v["CXX"] = cxx v["CXX_NAME"] = "icc" configure = """ find_icpc find_ar gxx_common_flags gxx_modifier_platform cxx_load_tools cxx_add_flags link_add_flags """ conf(find_icpc)
v['CC_TGT_F']=['-c','-o'] if not v['LINK_CC']:v['LINK_CC']=v['CC'] v['CCLNK_SRC_F']=[] v['CCLNK_TGT_F']=['-o'] v['CPPPATH_ST']='-I%s' v['DEFINES_ST']='-D%s' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STLIB_ST']='-l%s' v['STLIBPATH_ST']='-L%s' v['RPATH_ST']='-Wl,-rpath,%s' v['SONAME_ST']=[] v['SHLIB_MARKER']=[] v['STLIB_MARKER']=[] v['LINKFLAGS_cprogram']=['-Wl,-brtl'] v['cprogram_PATTERN']='%s' v['CFLAGS_cshlib']=['-fPIC'] v['LINKFLAGS_cshlib']=['-G','-Wl,-brtl,-bexpfull'] v['cshlib_PATTERN']='lib%s.so' v['LINKFLAGS_cstlib']=[] v['cstlib_PATTERN']='lib%s.a' def configure(conf): conf.find_xlc() conf.find_ar() conf.xlc_common_flags() conf.cc_load_tools() conf.cc_add_flags() conf.link_add_flags() conf(find_xlc) conf(xlc_common_flags)
except: conf.fatal('%r -version could not be executed'%cc) v['CC']=cc v['CC_NAME']='irix' def irixcc_common_flags(conf): v=conf.env v['CC_SRC_F']='' v['CC_TGT_F']=['-c','-o'] v['CPPPATH_ST']='-I%s' v['DEFINES_ST']='-D%s' if not v['LINK_CC']:v['LINK_CC']=v['CC'] v['CCLNK_SRC_F']='' v['CCLNK_TGT_F']=['-o'] v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STLIB_ST']='-l%s' v['STLIBPATH_ST']='-L%s' v['cprogram_PATTERN']='%s' v['cshlib_PATTERN']='lib%s.so' v['cstlib_PATTERN']='lib%s.a' def configure(conf): conf.find_irixcc() conf.find_cpp() conf.find_ar() conf.irixcc_common_flags() conf.cc_load_tools() conf.cc_add_flags() conf.link_add_flags() conf(find_irixcc) conf(irixcc_common_flags)
def options(opt): opt.add_option('--want-rpath', action='store_true', default=False, dest='want_rpath', help='enable the rpath for qt libraries') opt.add_option('--header-ext', type='string', default='', help='header extension for moc files', dest='qt_header_ext') for i in 'qtdir qtbin qtlibs'.split(): opt.add_option('--' + i, type='string', default='', dest=i) opt.add_option('--translate', action="store_true", help="collect translation strings", dest="trans_qt4", default=False) extension(*EXT_RCC)(create_rcc_task) extension(*EXT_UI)(create_uic_task) extension('.ts')(add_lang) feature('qt4')(apply_qt4) after_method('apply_link')(apply_qt4) extension(*EXT_QT4)(cxx_hook) conf(find_qt4_binaries) conf(find_qt4_libraries) conf(simplify_qt4_libs) conf(add_qt4_rpath) conf(set_qt4_libs_to_check)
fc_config.fortran_modifier_darwin(conf) def ifort_modifier_platform(conf): dest_os=conf.env['DEST_OS']or Utils.unversioned_sys_platform() ifort_modifier_func=getattr(conf,'ifort_modifier_'+dest_os,None) if ifort_modifier_func: ifort_modifier_func() def get_ifort_version(conf,fc): version_re=re.compile(r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search cmd=fc+['--version'] out,err=fc_config.getoutput(conf,cmd,stdin=False) if out: match=version_re(out) else: match=version_re(err) if not match: conf.fatal('cannot determine ifort version.') k=match.groupdict() conf.env['FC_VERSION']=(k['major'],k['minor']) def configure(conf): conf.find_ifort() conf.find_program('xiar',var='AR') conf.env.ARFLAGS='rcs' conf.fc_flags() conf.ifort_modifier_platform() conf(find_ifort) conf(ifort_modifier_cygwin) conf(ifort_modifier_win32) conf(ifort_modifier_darwin) conf(ifort_modifier_platform) conf(get_ifort_version)
class run_ruby(Task.Task): run_str = '${RUBY} ${RBFLAGS} -I ${SRC[0].parent.abspath()} ${SRC}' def options(opt): opt.add_option( '--with-ruby-archdir', type='string', dest='rubyarchdir', help='Specify directory where to install arch specific files') opt.add_option('--with-ruby-libdir', type='string', dest='rubylibdir', help='Specify alternate ruby library path') opt.add_option('--with-ruby-binary', type='string', dest='rubybinary', help='Specify alternate ruby binary') feature('rubyext')(init_rubyext) before_method('apply_incpaths', 'apply_lib_vars', 'apply_bundle', 'apply_link')(init_rubyext) feature('rubyext')(apply_ruby_so_name) before_method('apply_link', 'propagate_uselib')(apply_ruby_so_name) conf(check_ruby_version) conf(check_ruby_ext_devel) conf(check_ruby_module) extension('.rb')(process)
def check_jni_headers(conf): if not conf.env.CC_NAME and not conf.env.CXX_NAME: conf.fatal('load a compiler first (gcc, g++, ..)') if not conf.env.JAVA_HOME: conf.fatal('set JAVA_HOME in the system environment') javaHome=conf.env['JAVA_HOME'][0] dir=conf.root.find_dir(conf.env.JAVA_HOME[0]+'/include') f=dir.ant_glob('**/(jni|jni_md).h') incDirs=[x.parent.abspath()for x in f] dir=conf.root.find_dir(conf.env.JAVA_HOME[0]) f=dir.ant_glob('**/*jvm.(so|dll)') libDirs=[x.parent.abspath()for x in f]or[javaHome] for i,d in enumerate(libDirs): if conf.check(header_name='jni.h',define_name='HAVE_JNI_H',lib='jvm',libpath=d,includes=incDirs,uselib_store='JAVA',uselib='JAVA'): break else: conf.fatal('could not find lib jvm in %r (see config.log)'%libDirs) feature('javac')(apply_java) before('process_source')(apply_java) feature('javac')(use_javac_files) after('apply_java')(use_javac_files) feature('javac')(set_classpath) after('apply_java','propagate_uselib_vars','use_javac_files')(set_classpath) feature('jar')(jar_files) after('apply_java','use_javac_files')(jar_files) before('process_source')(jar_files) feature('jar')(use_jar_files) after('jar_files')(use_jar_files) conf(check_java_class) conf(check_jni_headers)
v=conf.env v['CC_SRC_F']=[] v['CC_TGT_F']=['-c','-o'] if not v['LINK_CC']:v['LINK_CC']=v['CC'] v['CCLNK_SRC_F']='' v['CCLNK_TGT_F']=['-o'] v['CPPPATH_ST']='-I%s' v['DEFINES_ST']='-D%s' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STLIB_ST']='-l%s' v['STLIBPATH_ST']='-L%s' v['SONAME_ST']='-Wl,-h,%s' v['SHLIB_MARKER']='-Bdynamic' v['STLIB_MARKER']='-Bstatic' v['cprogram_PATTERN']='%s' v['CFLAGS_cshlib']=['-Kpic','-DPIC'] v['LINKFLAGS_cshlib']=['-G'] v['cshlib_PATTERN']='lib%s.so' v['LINKFLAGS_cstlib']=['-Bstatic'] v['cstlib_PATTERN']='lib%s.a' def configure(conf): conf.find_scc() conf.find_ar() conf.scc_common_flags() conf.cc_load_tools() conf.cc_add_flags() conf.link_add_flags() conf(find_scc) conf(scc_common_flags)
v['dshlib_PATTERN']='lib%s.so' v['dstlib_PATTERN']='lib%s.a' DLIB=''' version(D_Version2) { import std.stdio; int main() { writefln("phobos2"); return 0; } } else { version(Tango) { import tango.stdc.stdio; int main() { printf("tango"); return 0; } } else { import std.stdio; int main() { writefln("phobos1"); return 0; } } } ''' def check_dlibrary(self): ret=self.check_cc(features='d dprogram',fragment=DLIB,compile_filename='test.d',execute=True,define_ret=True) self.env.DLIBRARY=ret.strip() conf(d_platform_flags) conf(check_dlibrary)
ifort_modifier_func = getattr(conf, 'ifort_modifier_' + dest_os, None) if ifort_modifier_func: ifort_modifier_func() def get_ifort_version(conf, fc): version_re = re.compile( r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search cmd = fc + ['--version'] out, err = fc_config.getoutput(conf, cmd, stdin=False) if out: match = version_re(out) else: match = version_re(err) if not match: conf.fatal('cannot determine ifort version.') k = match.groupdict() conf.env['FC_VERSION'] = (k['major'], k['minor']) def configure(conf): conf.find_ifort() conf.find_ar() conf.fc_flags() conf.ifort_modifier_platform() conf(find_ifort) conf(ifort_modifier_cygwin) conf(ifort_modifier_platform) conf(get_ifort_version)
def irixcc_common_flags(conf): v = conf.env v['CC_SRC_F'] = '' v['CC_TGT_F'] = ['-c', '-o'] v['CPPPATH_ST'] = '-I%s' v['DEFINES_ST'] = '-D%s' if not v['LINK_CC']: v['LINK_CC'] = v['CC'] v['CCLNK_SRC_F'] = '' v['CCLNK_TGT_F'] = ['-o'] v['LIB_ST'] = '-l%s' v['LIBPATH_ST'] = '-L%s' v['STLIB_ST'] = '-l%s' v['STLIBPATH_ST'] = '-L%s' v['cprogram_PATTERN'] = '%s' v['cshlib_PATTERN'] = 'lib%s.so' v['cstlib_PATTERN'] = 'lib%s.a' def configure(conf): conf.find_irixcc() conf.find_cpp() conf.find_ar() conf.irixcc_common_flags() conf.cc_load_tools() conf.cc_add_flags() conf.link_add_flags() conf(find_irixcc) conf(irixcc_common_flags)
if not v['LINK_CXX']:v['LINK_CXX']=v['CXX'] v['CXXLNK_SRC_F']='' v['CXXLNK_TGT_F']=['-o',''] v['CPPPATH_ST']='-I%s' v['DEFINES_ST']='-D%s' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STLIB_ST']='-l%s' v['STLIBPATH_ST']='-L%s' v['RPATH_ST']='-Wl,-rpath,%s' v['SONAME_ST']='' v['SHLIB_MARKER']='' v['STLIB_MARKER']='' v['LINKFLAGS_cxxprogram']=['-Wl,-brtl'] v['cxxprogram_PATTERN']='%s' v['CXXFLAGS_cxxshlib']=['-fPIC'] v['LINKFLAGS_cxxshlib']=['-G','-Wl,-brtl,-bexpfull'] v['cxxshlib_PATTERN']='lib%s.so' v['LINKFLAGS_cxxstlib']='' v['cxxstlib_PATTERN']='lib%s.a' configure=''' find_xlcxx find_ar xlcxx_common_flags cxx_load_tools cxx_add_flags link_add_flags ''' conf(find_xlcxx) conf(xlcxx_common_flags)
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib.Configure import conf def find_ar(conf): conf.load('ar') def configure(conf): conf.find_program('ar', var='AR') conf.env.ARFLAGS = 'rcs' conf(find_ar)
if self.env.CXX: kw['features']=['cxx','cxxprogram'] else: kw['features']=['c','cprogram'] kw['fragment']=LARGE_FRAGMENT kw['msg']='Checking for large file support' ret=True try: if self.env.DEST_BINFMT!='pe': ret=self.check(**kw) except self.errors.ConfigurationError: pass else: if ret: return True kw['msg']='Checking for -D_FILE_OFFSET_BITS=64' kw['defines']=['_FILE_OFFSET_BITS=64'] try: ret=self.check(**kw) except self.errors.ConfigurationError: pass else: self.define('_FILE_OFFSET_BITS',64) return ret self.fatal('There is no support for large files') feature('link_lib_test')(link_lib_test_fun) before_method('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file)
p = Runner.Parallel(bld, Options.options.jobs) p.biter = it() p.start() for x in tasks: x.logger.memhandler.flush() for x in tasks: if x.hasrun != Task.SUCCESS: self.end_msg(kw.get('errmsg', 'no'), color='YELLOW') self.fatal( kw.get('fatalmsg', None) or 'One of the tests has failed, see the config.log for more information' ) self.end_msg('ok') conf(parse_flags) conf(ret_msg) conf(validate_cfg) conf(exec_cfg) conf(check_cfg) conf(validate_c) conf(post_check) conf(check) feature('test_exec')(test_exec_fun) after_method('apply_link')(test_exec_fun) conf(run_c_code) conf(check_cxx) conf(check_cc) conf(define) conf(undefine) conf(define_cond)
v['LINKFLAGS']=[] v['DFLAGS_dshlib']=['-relocation-model=pic'] def common_flags_dmd(conf): v=conf.env v['D_SRC_F']=['-c'] v['D_TGT_F']='-of%s' v['D_LINKER']=v['D'] v['DLNK_SRC_F']='' v['DLNK_TGT_F']='-of%s' v['DINC_ST']='-I%s' v['DSHLIB_MARKER']=v['DSTLIB_MARKER']='' v['DSTLIB_ST']=v['DSHLIB_ST']='-L-l%s' v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L-L%s' v['LINKFLAGS_dprogram']=['-quiet'] v['DFLAGS_dshlib']=['-fPIC'] v['LINKFLAGS_dshlib']=['-L-shared'] v['DHEADER_ext']='.di' v.DFLAGS_d_with_header=['-H','-Hf'] v['D_HDR_F']='%s' def configure(conf): conf.find_dmd() conf.load('ar') conf.load('d') conf.common_flags_dmd() conf.d_platform_flags() if str(conf.env.D).find('ldc')>-1: conf.common_flags_ldc() conf(find_dmd) conf(common_flags_ldc) conf(common_flags_dmd)
def set_features(kw, _type): kw['_type'] = _type kw['features'] = Utils.to_list(kw.get('features', [])) + Utils.to_list( sniff_features(**kw)) def program(bld, *k, **kw): set_features(kw, 'program') return bld(*k, **kw) def shlib(bld, *k, **kw): set_features(kw, 'shlib') return bld(*k, **kw) def stlib(bld, *k, **kw): set_features(kw, 'stlib') return bld(*k, **kw) def objects(bld, *k, **kw): set_features(kw, 'objects') return bld(*k, **kw) conf(program) conf(shlib) conf(stlib) conf(objects)
try: conf.find_program('python',var='PYTHON') except conf.errors.ConfigurationError: warn("could not find a python executable, setting to sys.executable '%s'"%sys.executable) conf.env.PYTHON=sys.executable if conf.env.PYTHON!=sys.executable: warn("python executable '%s' different from sys.executable '%s'"%(conf.env.PYTHON,sys.executable)) 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) def options(opt): opt.add_option('--nopyc',action='store_false',default=1,help='Do not install bytecode compiled .pyc files (configuration) [Default:install]',dest='pyc') opt.add_option('--nopyo',action='store_false',default=1,help='Do not install optimised compiled .pyo files (configuration) [Default:install]',dest='pyo') extension('.py')(process_py) feature('py')(feature_py) feature('pyext')(init_pyext) before_method('propagate_uselib_vars','apply_link')(init_pyext) after_method('apply_bundle')(init_pyext) feature('pyext')(set_bundle) before_method('apply_link','apply_bundle')(set_bundle) before_method('propagate_uselib_vars')(init_pyembed) feature('pyembed')(init_pyembed) conf(get_python_variables) conf(check_python_headers) conf(check_python_version) conf(check_python_module)
env['EXTUTILS_TYPEMAP'] = read_out( " -MConfig -e'print \"$Config{privlib}/ExtUtils/typemap\"'") if not getattr(Options.options, 'perlarchdir', None): env['ARCHDIR_PERL'] = self.cmd_and_log( perl + " -MConfig -e'print $Config{sitearch}'") else: env['ARCHDIR_PERL'] = getattr(Options.options, 'perlarchdir') env['perlext_PATTERN'] = '%s.' + self.cmd_and_log( perl + " -MConfig -e'print $Config{dlext}'") def options(opt): opt.add_option('--with-perl-binary', type='string', dest='perlbinary', help='Specify alternate perl binary', default=None) opt.add_option( '--with-perl-archdir', type='string', dest='perlarchdir', help='Specify directory where to install arch specific files', default=None) before('apply_incpaths', 'apply_link', 'propagate_uselib_vars')(init_perlext) feature('perlext')(init_perlext) extension('.xs')(xsubpp_file) conf(check_perl_version) conf(check_perl_module) conf(check_perl_ext_devel)
# WARNING! All changes made to this file will be lost! import os,sys from waflib.Tools import ccroot,ar,gcc from waflib.Configure import conf def find_icc(conf): if sys.platform=='cygwin': conf.fatal('The Intel compiler does not work on Cygwin') v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in conf.environ:cc=conf.environ['CC'] if not cc:cc=conf.find_program('icc',var='CC') if not cc:cc=conf.find_program('ICL',var='CC') if not cc:conf.fatal('Intel C Compiler (icc) was not found') cc=conf.cmd_to_list(cc) conf.get_cc_version(cc,icc=True) v['CC']=cc v['CC_NAME']='icc' configure=''' find_icc find_ar gcc_common_flags gcc_modifier_platform cc_load_tools cc_add_flags link_add_flags ''' conf(find_icc)
return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; ''' class grep_for_endianness(Task.Task): color='PINK' def run(self): txt=self.inputs[0].read(flags='rb').decode('iso8859-1') if txt.find('LiTTleEnDian')>-1: self.generator.tmp.append('little') elif txt.find('BIGenDianSyS')>-1: self.generator.tmp.append('big') else: return-1 def grep_for_endianness_fun(self): self.create_task('grep_for_endianness',self.compiled_tasks[0].outputs[0]) def check_endianness(self): tmp=[] def check_msg(self): return tmp[0] self.check(fragment=ENDIAN_FRAGMENT,features='c grep_for_endianness',msg="Checking for endianness",define='ENDIANNESS',tmp=tmp,okmsg=check_msg) return tmp[0] feature('link_lib_test')(link_lib_test_fun) before_method('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file) feature('grep_for_endianness')(grep_for_endianness_fun) after_method('process_source')(grep_for_endianness_fun) conf(check_endianness)
def gcc_modifier_aix(conf): v=conf.env v['LINKFLAGS_cprogram']=['-Wl,-brtl'] v['LINKFLAGS_cshlib']=['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER']=[] def glang_modifier_hpux(conf): v=conf.env v['SHLIB_MARKER']=[] v['CFLAGS_cshlib']=['-fPIC','-DPIC'] v['cshlib_PATTERN']='lib%s.sl' def gcc_modifier_platform(conf): gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None) if gcc_modifier_func: gcc_modifier_func() def configure(conf): conf.find_gcc() conf.find_ar() conf.gcc_common_flags() conf.gcc_modifier_platform() conf.cc_load_tools() conf.cc_add_flags() conf.link_add_flags() conf(find_gcc) conf(gcc_common_flags) conf(gcc_modifier_win32) conf(gcc_modifier_cygwin) conf(gcc_modifier_darwin) conf(gcc_modifier_aix) conf(glang_modifier_hpux) conf(gcc_modifier_platform)
v['DLNK_TGT_F'] = '-of%s' v['DINC_ST'] = '-I%s' v['DSHLIB_MARKER'] = v['DSTLIB_MARKER'] = '' v['DSTLIB_ST'] = v['DSHLIB_ST'] = '-L-l%s' v['DSTLIBPATH_ST'] = v['DLIBPATH_ST'] = '-L-L%s' v['LINKFLAGS_dprogram'] = ['-quiet'] v['DFLAGS_dshlib'] = ['-fPIC'] v['LINKFLAGS_dshlib'] = ['-L-shared'] v['DHEADER_ext'] = '.di' v.DFLAGS_d_with_header = ['-H', '-Hf'] v['D_HDR_F'] = '%s' def configure(conf): conf.find_dmd() if sys.platform == 'win32': out = conf.cmd_and_log([conf.env.D, '--help']) if out.find("D Compiler v2.") > -1: conf.fatal( 'dmd2 on Windows is not supported, use gdc or ldc instead') conf.load('ar') conf.load('d') conf.common_flags_dmd() conf.d_platform_flags() if str(conf.env.D).find('ldc') > -1: conf.common_flags_ldc() conf(find_dmd) conf(common_flags_ldc) conf(common_flags_dmd)
def gxx_modifier_aix(conf): v=conf.env v['LINKFLAGS_cxxprogram']=['-Wl,-brtl'] v['LINKFLAGS_cxxshlib']=['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER']=[] def gxx_modifier_hpux(conf): v=conf.env v['SHLIB_MARKER']=[] v['CFLAGS_cxxshlib']=['-fPIC','-DPIC'] v['cxxshlib_PATTERN']='lib%s.sl' def gxx_modifier_platform(conf): gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None) if gxx_modifier_func: gxx_modifier_func() def configure(conf): conf.find_gxx() conf.find_ar() conf.gxx_common_flags() conf.gxx_modifier_platform() conf.cxx_load_tools() conf.cxx_add_flags() conf.link_add_flags() conf(find_gxx) conf(gxx_common_flags) conf(gxx_modifier_win32) conf(gxx_modifier_cygwin) conf(gxx_modifier_darwin) conf(gxx_modifier_aix) conf(gxx_modifier_hpux) conf(gxx_modifier_platform)
v=conf.env v['CXX_SRC_F']=[] v['CXX_TGT_F']=['-c','-o'] if not v['LINK_CXX']:v['LINK_CXX']=v['CXX'] v['CXXLNK_SRC_F']=[] v['CXXLNK_TGT_F']=['-o'] v['CPPPATH_ST']='-I%s' v['DEFINES_ST']='-D%s' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STLIB_ST']='-l%s' v['STLIBPATH_ST']='-L%s' v['SONAME_ST']='-Wl,-h,%s' v['SHLIB_MARKER']='-Bdynamic' v['STLIB_MARKER']='-Bstatic' v['cxxprogram_PATTERN']='%s' v['CXXFLAGS_cxxshlib']=['-Kpic','-DPIC'] v['LINKFLAGS_cxxshlib']=['-G'] v['cxxshlib_PATTERN']='lib%s.so' v['LINKFLAGS_cxxstlib']=['-Bstatic'] v['cxxstlib_PATTERN']='lib%s.a' def configure(conf): conf.find_sxx() conf.find_ar() conf.sxx_common_flags() conf.cxx_load_tools() conf.cxx_add_flags() conf.link_add_flags() conf(find_sxx) conf(sxx_common_flags)
except self.errors.ConfigurationError: pass else: self.end_msg("ok ('%s', '%s', '%s-case')" % (u, du, c)) self.env.FORTRAN_MANGLING = (u, du, c) break else: self.end_msg(False) self.fatal('mangler not found') return (u, du, c) def set_lib_pat(self): self.env['fcshlib_PATTERN'] = self.env['pyext_PATTERN'] conf(fc_flags) conf(check_fortran) conf(check_fc) conf(fortran_modifier_darwin) conf(fortran_modifier_win32) conf(fortran_modifier_cygwin) conf(check_fortran_dummy_main) conf(is_link_verbose) conf(check_fortran_verbose_flag) conf(check_fortran_clib) feature('link_main_routines_func')(link_main_routines_tg_method) before_method('process_source')(link_main_routines_tg_method) conf(check_fortran_mangling) feature('pyext')(set_lib_pat) before_method('propagate_uselib_vars', 'apply_link')(set_lib_pat)
class fcprogram_test(fcprogram): def can_retrieve_cache(self): return False def runnable_status(self): ret=super(fcprogram_test,self).runnable_status() if ret==Task.SKIP_ME: ret=Task.RUN_ME return ret def exec_command(self,cmd,**kw): bld=self.generator.bld kw['shell']=isinstance(cmd,str) kw['stdout']=kw['stderr']=Utils.subprocess.PIPE kw['cwd']=bld.variant_dir bld.out=bld.err='' bld.to_log('command: %s\n'%cmd) kw['output']=0 try: (bld.out,bld.err)=bld.cmd_and_log(cmd,**kw) except Exception ,e: return-1 if bld.out: bld.to_log("out: %s\n"%bld.out) if bld.err: bld.to_log("err: %s\n"%bld.err) class fcstlib(ccroot.stlink_task): pass feature('fcprogram','fcshlib','fcstlib','fcprogram_test')(dummy) extension('.f','.f90','.F','.F90','.for','.FOR')(fc_hook) conf(modfile)
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib.Tools import ccroot,ar,gxx from waflib.Configure import conf def find_icpc(conf): if sys.platform=='cygwin': conf.fatal('The Intel compiler does not work on Cygwin') v=conf.env cxx=None if v['CXX']:cxx=v['CXX'] elif'CXX'in conf.environ:cxx=conf.environ['CXX'] if not cxx:cxx=conf.find_program('icpc',var='CXX') if not cxx:conf.fatal('Intel C++ Compiler (icpc) was not found') cxx=conf.cmd_to_list(cxx) conf.get_cc_version(cxx,icc=True) v['CXX']=cxx v['CXX_NAME']='icc' def configure(conf): conf.find_icpc() conf.find_ar() conf.gxx_common_flags() conf.gxx_modifier_platform() conf.cxx_load_tools() conf.cxx_add_flags() conf.link_add_flags() conf(find_icpc)
if node: node.sig=Utils.h_file(node.abspath()) break else: continue break else: raise Errors.WafError('could not find library %r'%self.name) self.link_task=self.create_task('fake_%s'%self.lib_type,[],[node]) self.target=self.name taskgen_method(create_compiled_task) taskgen_method(to_incnodes) feature('c','cxx','d','go','asm','fc','includes')(apply_incpaths) after_method('propagate_uselib_vars','process_source')(apply_incpaths) feature('c','cxx','d','go','fc','asm')(apply_link) after_method('process_source')(apply_link) taskgen_method(use_rec) feature('c','cxx','d','use','fc')(process_use) before_method('apply_incpaths','propagate_uselib_vars')(process_use) after_method('apply_link','process_source')(process_use) taskgen_method(get_uselib_vars) feature('c','cxx','d','fc','javac','cs','uselib')(propagate_uselib_vars) after_method('process_use')(propagate_uselib_vars) feature('cshlib','cxxshlib')(apply_implib) after_method('apply_link')(apply_implib) feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')(apply_vnum) after_method('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
) opt.add_option( "--header-ext", type="string", default="", help="header extension for moc files", dest="qt_header_ext" ) for i in "qtdir qtbin qtlibs".split(): opt.add_option("--" + i, type="string", default="", dest=i) if sys.platform == "darwin": opt.add_option( "--no-qt4-framework", action="store_false", help="do not use the framework version of Qt4 in OS X", dest="use_qt4_osxframework", default=True, ) opt.add_option( "--translate", action="store_true", help="collect translation strings", dest="trans_qt4", default=False ) extension(*EXT_RCC)(create_rcc_task) extension(*EXT_UI)(create_uic_task) extension(".ts")(add_lang) feature("qt4")(apply_qt4) after_method("apply_link")(apply_qt4) extension(*EXT_QT4)(cxx_hook) conf(find_qt4_binaries) conf(find_qt4_libraries) conf(simplify_qt4_libs) conf(add_qt4_rpath) conf(set_qt4_libs_to_check)
v['SHLIB_MARKER']='' v['STLIB_MARKER']='' v['SONAME_ST']='' def gxx_modifier_aix(conf): v=conf.env v['LINKFLAGS_cxxprogram']=['-Wl,-brtl'] v['LINKFLAGS_cxxshlib']=['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER']='' def gxx_modifier_hpux(conf): conf.env.cxxshlib_PATTERN='lib%s.sl' def gxx_modifier_platform(conf): gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None) if gxx_modifier_func: gxx_modifier_func() def configure(conf): conf.find_gxx() conf.find_ar() conf.gxx_common_flags() conf.gxx_modifier_platform() conf.cxx_load_tools() conf.cxx_add_flags() conf.link_add_flags() conf(find_gxx) conf(gxx_common_flags) conf(gxx_modifier_win32) conf(gxx_modifier_cygwin) conf(gxx_modifier_darwin) conf(gxx_modifier_aix) conf(gxx_modifier_hpux) conf(gxx_modifier_platform)
kw['cwd']=bld.cwd except AttributeError: bld.cwd=kw['cwd']=bld.variant_dir ret=self.exec_response_command(k[0],**kw) if not ret and getattr(self,'do_manifest',None): ret=self.exec_mf() return ret for k in'c cxx winrc cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib qxx'.split(): cls=Task.classes.get(k,None) if cls: cls.exec_command=exec_command_msvc cls.exec_response_command=exec_response_command cls.quote_response_command=quote_response_command cls.exec_mf=exec_mf conf(get_msvc_version) conf(gather_wsdk_versions) conf(gather_msvc_versions) conf(gather_icl_versions) conf(get_msvc_versions) conf(print_all_msvc_detected) conf(find_lt_names_msvc) conf(libname_msvc) conf(check_lib_msvc) conf(check_libs_msvc) conf(no_autodetect) conf(autodetect) conf(find_msvc) conf(msvc_common_flags) after('apply_link')(apply_flags_msvc) feature('c','cxx')(apply_flags_msvc)
ret = super(fcprogram_test, self).runnable_status() if ret == Task.SKIP_ME: ret = Task.RUN_ME return ret def exec_command(self, cmd, **kw): bld = self.generator.bld kw['shell'] = isinstance(cmd, str) kw['stdout'] = kw['stderr'] = Utils.subprocess.PIPE kw['cwd'] = bld.variant_dir bld.out = bld.err = '' bld.to_log('command: %s\n' % cmd) kw['output'] = 0 try: (bld.out, bld.err) = bld.cmd_and_log(cmd, **kw) except Exception, e: return -1 if bld.out: bld.to_log("out: %s\n" % bld.out) if bld.err: bld.to_log("err: %s\n" % bld.err) class fcstlib(ccroot.stlink_task): pass feature('fcprogram', 'fcshlib', 'fcstlib', 'fcprogram_test')(dummy) extension('.f', '.f90', '.F', '.F90', '.for', '.FOR')(fc_hook) conf(modfile)
def it(): yield tasks while 1: yield[] p=Runner.Parallel(bld,Options.options.jobs) p.biter=it() p.start() for x in tasks: x.logger.memhandler.flush() for x in tasks: if x.hasrun!=Task.SUCCESS: self.end_msg(kw.get('errmsg','no'),color='YELLOW') self.fatal(kw.get('fatalmsg',None)or'One of the tests has failed, see the config.log for more information') self.end_msg('ok') conf(parse_flags) conf(ret_msg) conf(validate_cfg) conf(exec_cfg) conf(check_cfg) conf(validate_c) conf(post_check) conf(check) feature('test_exec')(test_exec_fun) after('apply_link')(test_exec_fun) conf(run_c_code) conf(check_cxx) conf(check_cc) conf(define) conf(undefine) conf(define_cond)
if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX'] v['CXXLNK_SRC_F'] = [] v['CXXLNK_TGT_F'] = ['-o'] v['CPPPATH_ST'] = '-I%s' v['DEFINES_ST'] = '-D%s' v['LIB_ST'] = '-l%s' v['LIBPATH_ST'] = '-L%s' v['STLIB_ST'] = '-l%s' v['STLIBPATH_ST'] = '-L%s' v['SONAME_ST'] = '-Wl,-h,%s' v['SHLIB_MARKER'] = '-Bdynamic' v['STLIB_MARKER'] = '-Bstatic' v['cxxprogram_PATTERN'] = '%s' v['CXXFLAGS_cxxshlib'] = ['-Kpic', '-DPIC'] v['LINKFLAGS_cxxshlib'] = ['-G'] v['cxxshlib_PATTERN'] = 'lib%s.so' v['LINKFLAGS_cxxstlib'] = ['-Bstatic'] v['cxxstlib_PATTERN'] = 'lib%s.a' def configure(conf): conf.find_sxx() conf.find_ar() conf.sxx_common_flags() conf.cxx_load_tools() conf.cxx_add_flags() conf.link_add_flags() conf(find_sxx) conf(sxx_common_flags)
def check_vala(self,min_version=(0,8,0),branch=None): if not branch: branch=min_version[:2] try: find_valac(self,'valac-%d.%d'%(branch[0],branch[1]),min_version) except self.errors.ConfigurationError: find_valac(self,'valac',min_version) def check_vala_deps(self): if not self.env['HAVE_GOBJECT']: pkg_args={'package':'gobject-2.0','uselib_store':'GOBJECT','args':'--cflags --libs'} if getattr(Options.options,'vala_target_glib',None): pkg_args['atleast_version']=Options.options.vala_target_glib self.check_cfg(**pkg_args) if not self.env['HAVE_GTHREAD']: pkg_args={'package':'gthread-2.0','uselib_store':'GTHREAD','args':'--cflags --libs'} if getattr(Options.options,'vala_target_glib',None): pkg_args['atleast_version']=Options.options.vala_target_glib self.check_cfg(**pkg_args) def configure(self): self.load('gnu_dirs') self.check_vala_deps() self.check_vala() def options(opt): opt.load('gnu_dirs') valaopts=opt.add_option_group('Vala Compiler Options') valaopts.add_option('--vala-target-glib',default=None,dest='vala_target_glib',metavar='MAJOR.MINOR',help='Target version of glib for Vala GObject code generation') extension('.vala','.gs')(vala_file) conf(find_valac) conf(check_vala) conf(check_vala_deps)
else: return -1 def grep_for_endianness_fun(self): self.create_task('grep_for_endianness', self.compiled_tasks[0].outputs[0]) def check_endianness(self): tmp = [] def check_msg(self): return tmp[0] self.check(fragment=ENDIAN_FRAGMENT, features='c grep_for_endianness', msg="Checking for endianness", define='ENDIANNESS', tmp=tmp, okmsg=check_msg) return tmp[0] feature('link_lib_test')(link_lib_test_fun) before_method('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file) feature('grep_for_endianness')(grep_for_endianness_fun) after_method('process_source')(grep_for_endianness_fun) conf(check_endianness)