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("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)
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)
color='YELLOW' 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('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)
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)
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)
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('propagate_uselib_vars','process_source')(apply_incpaths) feature('c','cxx','d','go','fc','asm')(apply_link) after('process_source')(apply_link) taskgen_method(use_rec) feature('c','cxx','d','use','fc')(process_use) before('apply_incpaths','propagate_uselib_vars')(process_use) after('apply_link','process_source')(process_use) taskgen_method(get_uselib_vars) feature('c','cxx','d','fc','javac','cs','uselib')(propagate_uselib_vars) after('process_use')(propagate_uselib_vars) feature('cshlib','cxxshlib')(apply_implib) after('apply_link')(apply_implib) feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')(apply_vnum) after('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
app_dirs = ["Contents", "Contents/MacOS", "Contents/Resources"] class macapp(Task.Task): color = "PINK" def run(self): shutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath()) class macplist(Task.Task): color = "PINK" ext_in = [".bin"] def run(self): self.outputs[0].write(self.mac_plist) feature("c", "cxx")(set_macosx_deployment_target) taskgen_method(create_bundle_dirs) feature("cprogram", "cxxprogram")(create_task_macapp) after("apply_link")(create_task_macapp) feature("cprogram", "cxxprogram")(create_task_macplist) after("apply_link")(create_task_macplist) feature("c", "cxx")(apply_bundle) before("apply_link", "propagate_uselib_vars")(apply_bundle) feature("cshlib", "cxxshlib")(apply_bundle_remove_dynamiclib) after("apply_link")(apply_bundle_remove_dynamiclib)
Task.task_factory( "intltool", "${INTLTOOL} ${INTLFLAGS} ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}", color="BLUE", ext_in=".bin" ) def configure(conf): conf.find_program("msgfmt", var="MSGFMT") conf.find_perl_program("intltool-merge", var="INTLTOOL") def getstr(varname): return getattr(Options.options, varname, "") prefix = conf.env["PREFIX"] datadir = getstr("datadir") if not datadir: datadir = os.path.join(prefix, "share") conf.define("LOCALEDIR", os.path.join(datadir, "locale")) conf.define("DATADIR", datadir) if conf.env["CC"] or conf.env["CXX"]: conf.check(header_name="locale.h") def options(opt): opt.add_option("--want-rpath", type="int", default=1, dest="want_rpath", help="set rpath to 1 or 0 [Default 1]") opt.add_option("--datadir", type="string", default="", dest="datadir", help="read-only application data") before("process_source")(iapply_intltool_in_f) feature("intltool_in")(iapply_intltool_in_f) feature("intltool_po")(apply_intltool_po)
conf.end_msg(False) conf.fatal('Could not find the python module %r'%module_name) conf.end_msg(True) def configure(conf): 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)) 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('propagate_uselib_vars','apply_link')(init_pyext) before('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)
def getstr(varname): return getattr(Options.options, varname, getattr(conf.env, varname, '')) gsettingsschemadir = getstr('GSETTINGSSCHEMADIR') if not gsettingsschemadir: datadir = getstr('DATADIR') if not datadir: prefix = conf.env['PREFIX'] datadir = os.path.join(prefix, 'share') gsettingsschemadir = os.path.join(datadir, 'glib-2.0', 'schemas') conf.env['GSETTINGSSCHEMADIR'] = gsettingsschemadir def options(opt): opt.add_option( '--gsettingsschemadir', help='GSettings schema location [Default: ${datadir}/glib-2.0/schemas]', default='', dest='GSETTINGSSCHEMADIR') taskgen_method(add_marshal_file) before('process_source')(process_marshal) taskgen_method(add_enums_from_template) taskgen_method(add_enums) before('process_source')(process_enums) taskgen_method(add_settings_schemas) taskgen_method(add_settings_enums) feature('glib2')(process_settings)
os.pathsep + self.path.get_bld().abspath() } if 'pdf' in outs: tsk = self.create_task('dvipdf', task.outputs, node.change_ext('.pdf')) tsk.env.env = { 'TEXINPUTS': node.parent.abspath() + os.pathsep + self.path.abspath() + os.pathsep + self.path.get_bld().abspath() } elif self.type == 'pdflatex': if 'ps' in outs: self.create_task('pdf2ps', task.outputs, node.change_ext('.ps')) self.source = [] def configure(self): v = self.env for p in 'tex latex pdflatex xelatex bibtex dvips dvipdf ps2pdf makeindex pdf2ps'.split( ): try: self.find_program(p, var=p.upper()) except self.errors.ConfigurationError: pass v['DVIPSFLAGS'] = '-Ppdf' feature('tex')(apply_tex) before('process_source')(apply_tex)
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('propagate_uselib_vars', 'process_source')(apply_incpaths) feature('c', 'cxx', 'd', 'go', 'fc')(apply_link) after('process_source')(apply_link) taskgen_method(use_rec) feature('c', 'cxx', 'd', 'use', 'fc')(process_use) before('apply_incpaths', 'propagate_uselib_vars')(process_use) after('apply_link', 'process_source')(process_use) taskgen_method(get_uselib_vars) feature('c', 'cxx', 'd', 'fc', 'javac', 'cs', 'uselib')(propagate_uselib_vars) after('process_use')(propagate_uselib_vars) feature('cshlib', 'cxxshlib')(apply_implib) after('apply_link')(apply_implib) before('apply_lib_vars', 'apply_objdeps')(apply_implib) feature('cshlib', 'cxxshlib', 'dshlib', 'fcshlib', 'vnum')(apply_vnum) after('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
if re_linguas.match(lang): node=self.path.find_resource(os.path.join(podir,re_linguas.match(lang).group()+'.po')) task=self.create_task('po',node,node.change_ext('.mo')) if inst: filename=task.outputs[0].name (langname,ext)=os.path.splitext(filename) inst_file=inst+os.sep+langname+os.sep+'LC_MESSAGES'+os.sep+appname+'.mo' self.bld.install_as(inst_file,task.outputs[0],chmod=getattr(self,'chmod',Utils.O644),env=task.env) else: Logs.pprint('RED',"Error no LINGUAS file found in po directory") class po(Task.Task): run_str='${MSGFMT} -o ${TGT} ${SRC}' color='BLUE' class intltool(Task.Task): run_str='${INTLTOOL} ${INTLFLAGS} ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}' color='BLUE' def configure(conf): conf.find_program('msgfmt',var='MSGFMT') conf.find_perl_program('intltool-merge',var='INTLTOOL') prefix=conf.env.PREFIX datadir=conf.env.DATADIR if not datadir: datadir=os.path.join(prefix,'share') conf.define('LOCALEDIR',os.path.join(datadir,'locale')) conf.define('DATADIR',datadir) if conf.env.CC or conf.env.CXX: conf.check(header_name='locale.h') before('process_source')(apply_intltool_in_f) feature('intltool_in')(apply_intltool_in_f) feature('intltool_po')(apply_intltool_po)
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('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('propagate_uselib_vars', 'process_source')(apply_incpaths) feature('c', 'cxx', 'd', 'go', 'fc', 'asm')(apply_link) after('process_source')(apply_link) taskgen_method(use_rec) feature('c', 'cxx', 'd', 'use', 'fc')(process_use) before('apply_incpaths', 'propagate_uselib_vars')(process_use) after('apply_link', 'process_source')(process_use) taskgen_method(get_uselib_vars) feature('c', 'cxx', 'd', 'fc', 'javac', 'cs', 'uselib')(propagate_uselib_vars) after('process_use')(propagate_uselib_vars) feature('cshlib', 'cxxshlib')(apply_implib) after('apply_link')(apply_implib) feature('cshlib', 'cxxshlib', 'dshlib', 'fcshlib', 'vnum')(apply_vnum) after('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
except KeyError: tree.node_deps[task.uid()]=deps_lst if self.type=='latex': if'ps'in outs: tsk=self.create_task('dvips',task.outputs,node.change_ext('.ps')) tsk.env.env={'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()} if'pdf'in outs: tsk=self.create_task('dvipdf',task.outputs,node.change_ext('.pdf')) tsk.env.env={'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()} elif self.type=='pdflatex': if'ps'in outs: self.create_task('pdf2ps',task.outputs,node.change_ext('.ps')) self.source=[] def configure(self): v=self.env for p in'tex latex pdflatex bibtex dvips dvipdf ps2pdf makeindex pdf2ps'.split(): try: self.find_program(p,var=p.upper()) except self.errors.ConfigurationError: pass v['DVIPSFLAGS']='-Ppdf' b=Task.task_factory b('dvips','${DVIPS} ${DVIPSFLAGS} ${SRC} -o ${TGT}',color='BLUE',after=["latex","pdflatex","tex","bibtex"],shell=False) b('dvipdf','${DVIPDF} ${DVIPDFFLAGS} ${SRC} ${TGT}',color='BLUE',after=["latex","pdflatex","tex","bibtex"],shell=False) b('pdf2ps','${PDF2PS} ${PDF2PSFLAGS} ${SRC} ${TGT}',color='BLUE',after=["dvipdf","pdflatex"],shell=False) b('latex',latex_build,vars=latex_vardeps,scan=scan) b('pdflatex',pdflatex_build,vars=pdflatex_vardeps,scan=scan) feature('tex')(apply_tex) before('process_source')(apply_tex)
if not hasattr(self.bld,'_compile_schemas_registered'): self.bld.add_post_fun(compile_schemas_callback) self.bld._compile_schemas_registered=True Task.task_factory('glib_genmarshal',func=genmarshal_func,vars=['GLIB_GENMARSHAL_PREFIX','GLIB_GENMARSHAL'],color='BLUE',ext_out=['.h']) Task.task_factory('glib_mkenums','${GLIB_MKENUMS} ${GLIB_MKENUMS_OPTIONS} ${GLIB_MKENUMS_SOURCE} > ${GLIB_MKENUMS_TARGET}',color='PINK',ext_out=['.h']) Task.task_factory('glib_validate_schema','rm -f ${GLIB_VALIDATE_SCHEMA_OUTPUT} && ${GLIB_COMPILE_SCHEMAS} --dry-run ${GLIB_COMPILE_SCHEMAS_OPTIONS} && touch ${GLIB_VALIDATE_SCHEMA_OUTPUT}',color='PINK') def configure(conf): conf.find_program('glib-genmarshal',var='GLIB_GENMARSHAL') conf.find_perl_program('glib-mkenums',var='GLIB_MKENUMS') conf.find_program('glib-compile-schemas',var='GLIB_COMPILE_SCHEMAS',mandatory=False) def getstr(varname): return getattr(Options.options,varname,getattr(conf.env,varname,'')) gsettingsschemadir=getstr('GSETTINGSSCHEMADIR') if not gsettingsschemadir: datadir=getstr('DATADIR') if not datadir: prefix=conf.env['PREFIX'] datadir=os.path.join(prefix,'share') gsettingsschemadir=os.path.join(datadir,'glib-2.0','schemas') conf.env['GSETTINGSSCHEMADIR']=gsettingsschemadir def options(opt): opt.add_option('--gsettingsschemadir',help='GSettings schema location [Default: ${datadir}/glib-2.0/schemas]',default='',dest='GSETTINGSSCHEMADIR') taskgen_method(add_marshal_file) before('process_source')(process_marshal) taskgen_method(add_enums_from_template) taskgen_method(add_enums) before('process_source')(process_enums) taskgen_method(add_settings_schemas) taskgen_method(add_settings_enums) feature('glib2')(process_settings)
app_dirs = ['Contents', 'Contents/MacOS', 'Contents/Resources'] class macapp(Task.Task): color = 'PINK' def run(self): shutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath(self.env)) class macplist(Task.Task): color = 'PINK' ext_in = ['.bin'] def run(self): self.outputs[0].write(self.mac_plist) feature('c', 'cxx')(set_macosx_deployment_target) before('apply_lib_vars')(set_macosx_deployment_target) taskgen_method(create_bundle_dirs) feature('cprogram', 'cxxprogram')(create_task_macapp) after('apply_link')(create_task_macapp) feature('cprogram', 'cxxprogram')(create_task_macplist) after('apply_link')(create_task_macplist) feature('c', 'cxx')(apply_bundle) before('apply_link', 'propagate_uselib_vars')(apply_bundle) feature('cshlib', 'cxxshlib')(apply_bundle_remove_dynamiclib) after('apply_link')(apply_bundle_remove_dynamiclib)
pass app_dirs = ['Contents', 'Contents/MacOS', 'Contents/Resources'] class macapp(Task.Task): color = 'PINK' def run(self): shutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath()) class macplist(Task.Task): color = 'PINK' ext_in = ['.bin'] def run(self): self.outputs[0].write(self.mac_plist) feature('c', 'cxx')(set_macosx_deployment_target) taskgen_method(create_bundle_dirs) feature('cprogram', 'cxxprogram')(create_task_macapp) after('apply_link')(create_task_macapp) feature('cprogram', 'cxxprogram')(create_task_macplist) after('apply_link')(create_task_macplist) feature('c', 'cxx')(apply_bundle) before('apply_link', 'propagate_uselib_vars')(apply_bundle) feature('cshlib', 'cxxshlib')(apply_bundle_remove_dynamiclib) after('apply_link')(apply_bundle_remove_dynamiclib)
kw['execute']=True 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('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file)
if not 'process_dbus' in self.meths: self.meths.append('process_dbus') self.dbus_lst.append([filename, prefix, mode]) def process_dbus(self): for filename, prefix, mode in getattr(self, 'dbus_lst', []): node = self.path.find_resource(filename) if not node: raise Errors.WafError('file not found ' + filename) tsk = self.create_task('dbus_binding_tool', node, node.change_ext('.h')) tsk.env.DBUS_BINDING_TOOL_PREFIX = prefix tsk.env.DBUS_BINDING_TOOL_MODE = mode class dbus_binding_tool(Task.Task): color = 'BLUE' ext_out = ['.h'] run_str = '${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}' shell = True def configure(conf): dbus_binding_tool = conf.find_program('dbus-binding-tool', var='DBUS_BINDING_TOOL') taskgen_method(add_dbus_file) before('apply_core')(process_dbus)
conf.find_program('msgfmt', var='MSGFMT') conf.find_perl_program('intltool-merge', var='INTLTOOL') def getstr(varname): return getattr(Options.options, varname, '') prefix = conf.env['PREFIX'] datadir = getstr('datadir') if not datadir: datadir = os.path.join(prefix, 'share') conf.define('LOCALEDIR', os.path.join(datadir, 'locale')) conf.define('DATADIR', datadir) if conf.env['CC'] or conf.env['CXX']: conf.check(header_name='locale.h') def options(opt): opt.add_option('--want-rpath', type='int', default=1, dest='want_rpath', help='set rpath to 1 or 0 [Default 1]') opt.add_option('--datadir', type='string', default='', dest='datadir', help='read-only application data') before('process_source')(iapply_intltool_in_f) feature('intltool_in')(iapply_intltool_in_f) feature('intltool_po')(apply_intltool_po)
self.start_msg('Getting fortran mangling scheme') 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(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('process_source')(link_main_routines_tg_method) conf(check_fortran_mangling) feature('pyext')(set_lib_pat) before('propagate_uselib_vars','apply_link')(set_lib_pat)
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(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('process_source')(link_main_routines_tg_method) conf(check_fortran_mangling) feature('pyext')(set_lib_pat) before('propagate_uselib_vars', 'apply_link')(set_lib_pat)
if not'MACBUNDLE'in uselib: uselib.append('MACBUNDLE') def apply_bundle_remove_dynamiclib(self): if self.env['MACBUNDLE']or getattr(self,'mac_bundle',False): if not getattr(self,'vnum',None): try: self.env['LINKFLAGS'].remove('-dynamiclib') except ValueError: pass app_dirs=['Contents','Contents/MacOS','Contents/Resources'] class macapp(Task.Task): color='PINK' def run(self): shutil.copy2(self.inputs[0].srcpath(),self.outputs[0].abspath(self.env)) class macplist(Task.Task): color='PINK' ext_in=['.bin'] def run(self): self.outputs[0].write(self.mac_plist) feature('c','cxx')(set_macosx_deployment_target) before('apply_lib_vars')(set_macosx_deployment_target) taskgen_method(create_bundle_dirs) feature('cprogram','cxxprogram')(create_task_macapp) after('apply_link')(create_task_macapp) feature('cprogram','cxxprogram')(create_task_macplist) after('apply_link')(create_task_macplist) feature('c','cxx')(apply_bundle) before('apply_link','propagate_uselib_vars')(apply_bundle) feature('cshlib','cxxshlib')(apply_bundle_remove_dynamiclib) after('apply_link')(apply_bundle_remove_dynamiclib)
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('propagate_uselib_vars','process_source')(apply_incpaths) feature('c','cxx','d','go','fc')(apply_link) after('process_source')(apply_link) taskgen_method(use_rec) feature('c','cxx','d','use','fc')(process_use) before('apply_incpaths','propagate_uselib_vars')(process_use) after('apply_link','process_source')(process_use) taskgen_method(get_uselib_vars) feature('c','cxx','d','fc','cs','uselib')(propagate_uselib_vars) after('process_use')(propagate_uselib_vars) feature('cshlib','cxxshlib')(apply_implib) after('apply_link')(apply_implib) before('apply_lib_vars','apply_objdeps')(apply_implib) feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')(apply_vnum) after('apply_link')(apply_vnum) conf(read_shlib) conf(read_stlib) feature('fake_lib')(process_lib)
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)
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('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)
#! /usr/bin/env python # encoding: utf-8 # WARNING! All changes made to this file will be lost! from waflib import Task,Errors from waflib.TaskGen import taskgen_method,before def add_dbus_file(self,filename,prefix,mode): if not hasattr(self,'dbus_lst'): self.dbus_lst=[] if not'process_dbus'in self.meths: self.meths.append('process_dbus') self.dbus_lst.append([filename,prefix,mode]) def process_dbus(self): for filename,prefix,mode in getattr(self,'dbus_lst',[]): node=self.path.find_resource(filename) if not node: raise Errors.WafError('file not found '+filename) tsk=self.create_task('dbus_binding_tool',node,node.change_ext('.h')) tsk.env.DBUS_BINDING_TOOL_PREFIX=prefix tsk.env.DBUS_BINDING_TOOL_MODE=mode class dbus_binding_tool(Task.Task): color='BLUE' ext_out=['.h'] run_str='${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}' shell=True def configure(conf): dbus_binding_tool=conf.find_program('dbus-binding-tool',var='DBUS_BINDING_TOOL') taskgen_method(add_dbus_file) before('apply_core')(process_dbus)
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('process_source')(link_lib_test_fun) conf(check_library) conf(check_inline) conf(check_large_file)