def add_those_o_files(self, node):
    tsk = self.create_task("fake_o", [], node)
    try:
        self.compiled_tasks.append(tsk)
    except AttributeError:
        self.compiled_tasks = [tsk]


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)
extension(".o", ".obj")(add_those_o_files)
Esempio n. 2
0
    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_method('process_source')(process_marshal)
taskgen_method(add_enums_from_template)
taskgen_method(add_enums)
before_method('process_source')(process_enums)
taskgen_method(add_settings_schemas)
taskgen_method(add_settings_enums)
feature('glib2')(process_settings)
Esempio n. 3
0
    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_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)
Esempio n. 4
0
	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)
Esempio n. 5
0
MKPROM_TSKS = list()


def make_prom(self):
    """Create mkprom task"""
    elf = self.target
    if hasattr(self, 'promflags'):
        promflags = Utils.to_list(self.promflags)
    if hasattr(self, 'prom'):
        promname = self.prom
    elif elf.endswith(".sparc"):
        (head, sep, tail) = elf.rpartition(".sparc")
        promname = head + ".prom" + tail
    else:
        promname = elf + ".prom"

    taskgroup = self.bld(name=promname, target=promname)
    taskgroup.env['_MKPROMFLAGS'] = taskgroup.env['MKPROMFLAGS'] + promflags
    task = taskgroup.create_task('MKPROM',
                                 src=[self.path.find_resource(elf)],
                                 tgt=[self.path.find_or_declare(promname)])
    if MKPROM_TSKS and len(MKPROM_TSKS) > 0:
        task.set_inputs(MKPROM_TSKS[-1].outputs[0])
    MKPROM_TSKS.append(task)
    taskgroup.post()


feature('prom')(make_prom)
after_method('apply_link')(make_prom)
before_method('make_systest')(make_prom)
Esempio n. 6
0
	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_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)
Esempio n. 7
0
File: dbus.py Progetto: sky4D/mavsim
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file

from waflib import Task,Errors
from waflib.TaskGen import taskgen_method,before_method
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_method('apply_core')(process_dbus)
Esempio n. 8
0
    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').replace('\\', '\\\\'))
    conf.define('DATADIR', datadir.replace('\\', '\\\\'))
    if conf.env.CC or conf.env.CXX:
        conf.check(header_name='locale.h')


before_method('process_source')(apply_intltool_in_f)
feature('intltool_in')(apply_intltool_in_f)
feature('intltool_po')(apply_intltool_po)
Esempio n. 9
0
			if not hasattr(self.bld,'_compile_schemas_registered'):
				self.bld.add_post_fun(compile_schemas_callback)
				self.bld._compile_schemas_registered=True
class glib_validate_schema(Task.Task):
	run_str='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_method('process_source')(process_marshal)
taskgen_method(add_enums_from_template)
taskgen_method(add_enums)
before_method('process_source')(process_enums)
taskgen_method(add_settings_schemas)
taskgen_method(add_settings_enums)
feature('glib2')(process_settings)
Esempio n. 10
0
    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)
Esempio n. 11
0
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)
Esempio n. 12
0
MKPROM_TSKS = list()

def make_prom(self):
    """Create mkprom task"""
    elf = self.target
    if hasattr(self, 'promflags'):
        promflags = Utils.to_list(self.promflags)
    if hasattr(self, 'prom'):
        promname = self.prom
    elif elf.endswith(".sparc"):
        (head, sep, tail) = elf.rpartition(".sparc")
        promname = head + ".prom" + tail
    else:
        promname = elf + ".prom"

    taskgroup = self.bld(name=promname, target=promname)
    taskgroup.env['_MKPROMFLAGS'] = taskgroup.env['MKPROMFLAGS'] + promflags
    task = taskgroup.create_task('MKPROM', 
        src=[self.path.find_resource(elf)],
        tgt=[self.path.find_or_declare(promname)]
    )
    if MKPROM_TSKS and len(MKPROM_TSKS)>0:
        task.set_inputs(MKPROM_TSKS[-1].outputs[0])
    MKPROM_TSKS.append(task)
    taskgroup.post()

feature('prom')(make_prom)
after_method('apply_link')(make_prom)
before_method('make_systest')(make_prom)
Esempio n. 13
0

class macapp(Task.Task):
    color = "PINK"

    def run(self):
        self.outputs[0].parent.mkdir()
        shutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath())


class macplist(Task.Task):
    color = "PINK"
    ext_in = [".bin"]

    def run(self):
        if getattr(self, "code", None):
            txt = self.code
        else:
            txt = self.inputs[0].read()
        self.outputs[0].write(txt)


feature("c", "cxx")(set_macosx_deployment_target)
taskgen_method(create_bundle_dirs)
feature("cprogram", "cxxprogram")(create_task_macapp)
after_method("apply_link")(create_task_macapp)
feature("cprogram", "cxxprogram")(create_task_macplist)
after_method("apply_link")(create_task_macplist)
feature("cshlib", "cxxshlib")(apply_bundle)
before_method("apply_link", "propagate_uselib_vars")(apply_bundle)
Esempio n. 14
0
        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)
Esempio n. 15
0
                          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_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)
Esempio n. 16
0
    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_method("process_source")(process_marshal)
taskgen_method(add_enums_from_template)
taskgen_method(add_enums)
before_method("process_source")(process_enums)
taskgen_method(add_settings_schemas)
taskgen_method(add_settings_enums)
feature("glib2")(process_settings)
Esempio n. 17
0
	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)
Esempio n. 18
0
        " -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)
Esempio n. 19
0
    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)
Esempio n. 20
0
			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').replace('\\','\\\\'))
	conf.define('DATADIR',datadir.replace('\\','\\\\'))
	if conf.env.CC or conf.env.CXX:
		conf.check(header_name='locale.h')

before_method('process_source')(apply_intltool_in_f)
feature('intltool_in')(apply_intltool_in_f)
feature('intltool_po')(apply_intltool_po)
Esempio n. 21
0
	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|dylib)')
	libDirs=[x.parent.abspath()for x in f]or[javaHome]
	f=dir.ant_glob('**/*jvm.(lib)')
	if f:
		libDirs=[[x,y.parent.abspath()]for x in libDirs for y in f]
	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)
		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)
Esempio n. 23
0
		plisttask.set_outputs([n1])
		plisttask.mac_plist=self.mac_plist
		plisttask.install_path=os.path.join(self.install_path,name,'Contents')
		self.plisttask=plisttask
def apply_bundle(self):
	if self.env['MACBUNDLE']or getattr(self,'mac_bundle',False):
		self.env['LINKFLAGS_cshlib']=self.env['LINKFLAGS_cxxshlib']=[]
		self.env['cshlib_PATTERN']=self.env['cxxshlib_PATTERN']=self.env['macbundle_PATTERN']
		use=self.use=self.to_list(getattr(self,'use',[]))
		if not'MACBUNDLE'in use:
			use.append('MACBUNDLE')
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_method('apply_link')(create_task_macapp)
feature('cprogram','cxxprogram')(create_task_macplist)
after_method('apply_link')(create_task_macplist)
feature('cshlib','cxxshlib')(apply_bundle)
before_method('apply_link','propagate_uselib_vars')(apply_bundle)
Esempio n. 24
0
File: ruby.py Progetto: sky4D/mavsim
	self.env.LIBPATH_RUBYEXT+=archdir
	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_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)
Esempio n. 25
0
			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)
Esempio n. 26
0
        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)
Esempio n. 27
0

class macapp(Task.Task):
    color = 'PINK'

    def run(self):
        self.outputs[0].parent.mkdir()
        shutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath())


class macplist(Task.Task):
    color = 'PINK'
    ext_in = ['.bin']

    def run(self):
        if getattr(self, 'code', None):
            txt = self.code
        else:
            txt = self.inputs[0].read()
        self.outputs[0].write(txt)


feature('c', 'cxx')(set_macosx_deployment_target)
taskgen_method(create_bundle_dirs)
feature('cprogram', 'cxxprogram')(create_task_macapp)
after_method('apply_link')(create_task_macapp)
feature('cprogram', 'cxxprogram')(create_task_macplist)
after_method('apply_link')(create_task_macplist)
feature('cshlib', 'cxxshlib')(apply_bundle)
before_method('apply_link', 'propagate_uselib_vars')(apply_bundle)
Esempio n. 28
0
		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)
Esempio n. 29
0
                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)
Esempio n. 30
0
                    + 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_method("process_source")(apply_tex)