Esempio n. 1
0
    task.inputs = [node]
    task.outputs = [node.change_ext(obj_ext)]
    self.compiled_tasks.append(task)
    self.meths.append('asm_incflags')


def asm_incflags(self):
    if self.env['ASINCFLAGS']: self.env['_ASINCFLAGS'] = self.env['ASINCFLAGS']
    if 'cxx' in self.features:
        self.env['_ASINCFLAGS'] = self.env['_CXXINCFLAGS']
    else:
        self.env['_ASINCFLAGS'] = self.env['_CCINCFLAGS']


def detect(conf):
    comp = conf.environ.get('AS', '')
    if not comp: comp = conf.env['AS']
    if not comp: comp = conf.find_program('as', var='AS')
    if not comp: comp = conf.find_program('gas', var='AS')
    if not comp: comp = conf.env['CC']
    if not comp: return
    v = conf.env
    v['ASFLAGS'] = ''


extension(EXT_ASM)(asm_hook)
taskgen(asm_incflags)
after('apply_obj_vars_cc')(asm_incflags)
after('apply_obj_vars_cxx')(asm_incflags)
before('apply_link')(asm_incflags)
Esempio n. 2
0
File: osx.py Progetto: henokyen/EOH
    return 0


def plist_build(task):
    env = task.env
    f = open(task.outputs[0].abspath(env), "w")
    f.write(task.mac_plist)
    f.close()
    return 0


Task.task_type_from_func("macapp", vars=[], func=app_build, after="cxx_link cc_link static_link")
Task.task_type_from_func("macplist", vars=[], func=plist_build, after="cxx_link cc_link static_link")

feature("cc", "cxx")(set_macosx_deployment_target)
before("apply_lib_vars")(set_macosx_deployment_target)
feature("cc", "cxx")(apply_framework)
after("apply_lib_vars")(apply_framework)
taskgen(create_bundle_dirs)
taskgen(create_task_macapp)
after("apply_link")(create_task_macapp)
feature("cprogram")(create_task_macapp)
after("apply_link")(create_task_macplist)
feature("cprogram")(create_task_macplist)
after("apply_link")(apply_link_osx)
feature("cshlib")(apply_link_osx)
before("apply_link", "apply_lib_vars")(apply_bundle)
feature("cc", "cxx")(apply_bundle)
after("apply_link")(apply_bundle_remove_dynamiclib)
feature("cshlib")(apply_bundle_remove_dynamiclib)
Esempio n. 3
0
        txt = Utils.readf(file)
    except (OSError, IOError):
        conf.fatal('could not read %s' % file)
    txt = txt.replace('\\\n', '\n')
    fu = re.compile('#(.*)\n')
    txt = fu.sub('', txt)
    setregexp = re.compile('([sS][eE][tT]\s*\()\s*([^\s]+)\s+\"([^"]+)\"\)')
    found = setregexp.findall(txt)
    for (_, key, val) in found:
        conf.env[key] = val
    conf.env['LIB_KDECORE'] = 'kdecore'
    conf.env['LIB_KDEUI'] = 'kdeui'
    conf.env['LIB_KIO'] = 'kio'
    conf.env['LIB_KHTML'] = 'khtml'
    conf.env['LIB_KPARTS'] = 'kparts'
    conf.env['LIBPATH_KDECORE'] = conf.env['KDE4_LIB_INSTALL_DIR']
    conf.env['CPPPATH_KDECORE'] = conf.env['KDE4_INCLUDE_INSTALL_DIR']
    conf.env.append_value('CPPPATH_KDECORE',
                          conf.env['KDE4_INCLUDE_INSTALL_DIR'] + "/KDE")
    conf.env['MSGFMT'] = conf.find_program('msgfmt')


Task.simple_task_type('msgfmt',
                      '${MSGFMT} ${SRC} -o ${TGT}',
                      color='BLUE',
                      shell=False)

feature('msgfmt')(init_msgfmt)
feature('msgfmt')(apply_msgfmt)
after('init_msgfmt')(apply_msgfmt)
Esempio n. 4
0
    return task


cxx_str = '${CXX} ${CXXFLAGS} ${CPPFLAGS} ${_CXXINCFLAGS} ${_CXXDEFFLAGS} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT}'
cls = Task.simple_task_type('cxx',
                            cxx_str,
                            color='GREEN',
                            ext_out='.o',
                            ext_in='.cxx',
                            shell=False)
cls.scan = ccroot.scan
cls.vars.append('CXXDEPS')
link_str = '${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT[0].abspath(env)} ${LINKFLAGS}'
cls = Task.simple_task_type('cxx_link',
                            link_str,
                            color='YELLOW',
                            ext_in='.o',
                            ext_out='.bin',
                            shell=False)
cls.maxjobs = 1
cls.install = Utils.nada

feature('cxx')(init_cxx)
before('apply_type_vars')(init_cxx)
after('default_cc')(init_cxx)
feature('cxx')(apply_obj_vars_cxx)
after('apply_incpaths')(apply_obj_vars_cxx)
feature('cxx')(apply_defines_cxx)
after('apply_lib_vars')(apply_defines_cxx)
extension(EXT_CXX)(cxx_hook)
Esempio n. 5
0
    v = conf.env
    binfmt = v.DEST_BINFMT or Utils.unversioned_sys_platform_to_binary_format(
        v.DEST_OS or Utils.unversioned_sys_platform())
    if binfmt == 'pe':
        v['D_program_PATTERN'] = '%s.exe'
        v['D_shlib_PATTERN'] = 'lib%s.dll'
        v['D_staticlib_PATTERN'] = 'lib%s.a'
    else:
        v['D_program_PATTERN'] = '%s'
        v['D_shlib_PATTERN'] = 'lib%s.so'
        v['D_staticlib_PATTERN'] = 'lib%s.a'


feature('d')(init_d)
before('apply_type_vars')(init_d)
feature('d')(init_d)
before('apply_d_libs')(init_d)
feature('d')(apply_d_libs)
after('apply_d_link', 'init_d')(apply_d_libs)
before('apply_vnum')(apply_d_libs)
feature('dprogram', 'dshlib', 'dstaticlib')(apply_d_link)
after('apply_core')(apply_d_link)
feature('d')(apply_d_vars)
after('apply_core')(apply_d_vars)
feature('dshlib')(add_shlib_d_flags)
after('apply_d_vars')(add_shlib_d_flags)
extension(EXT_D)(d_hook)
taskgen(generate_header)
before('apply_core')(process_header)
conftest(d_platform_flags)
Esempio n. 6
0
			fail=True
			ret=''+str(e)
		else:
			pass
		stats=getattr(self.generator.bld,'utest_results',[])
		stats.append((filename,fail,ret))
		self.generator.bld.utest_results=stats
	finally:
		testlock.release()
cls=Task.task_type_from_func('utest',func=exec_test,color='RED',ext_in='.bin')
old=cls.runnable_status
def test_status(self):
	if getattr(Options.options,'all_tests',False):
		return RUN_ME
	return old(self)
cls.runnable_status=test_status
cls.quiet=1
def summary(bld):
	lst=getattr(bld,'utest_results',[])
	if lst:
		Utils.pprint('CYAN','execution summary')
		for(f,fail,ret)in lst:
			col=fail and'RED'or'GREEN'
			Utils.pprint(col,(fail and'FAIL'or'ok')+" "+f)
			if fail:Utils.pprint('NORMAL',ret.replace('\\n','\n'))
def set_options(opt):
	opt.add_option('--alltests',action='store_true',default=False,help='Exec all unit tests',dest='all_tests')

feature('test')(make_test)
after('apply_link','vars_target_cprogram')(make_test)
Esempio n. 7
0
		try:
			os.symlink(self.outputs[0].name,self.outputs[1].bldpath(self.env))
		except:
			return 1

feature('cc','cxx')(default_cc)
before('apply_core')(default_cc)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(apply_verif)
feature('cprogram','dprogram')(vars_target_cprogram)
before('apply_core')(vars_target_cprogram)
feature('cstaticlib','dstaticlib')(vars_target_cstaticlib)
before('apply_core')(vars_target_cstaticlib)
feature('cshlib','dshlib')(vars_target_cshlib)
before('apply_core')(vars_target_cshlib)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(install_target_cstaticlib)
after('apply_objdeps','apply_link')(install_target_cstaticlib)
feature('cshlib','dshlib')(install_target_cshlib)
after('apply_link')(install_target_cshlib)
feature('cc','cxx')(apply_incpaths)
after('apply_type_vars','apply_lib_vars','apply_core')(apply_incpaths)
feature('cc','cxx')(apply_type_vars)
after('init_cc','init_cxx')(apply_type_vars)
before('apply_lib_vars')(apply_type_vars)
feature('cprogram','cshlib','cstaticlib')(apply_link)
after('apply_core')(apply_link)
feature('cc','cxx')(apply_lib_vars)
after('apply_link','init_cc','init_cxx')(apply_lib_vars)
feature('cprogram','cstaticlib','cshlib')(apply_objdeps)
after('apply_obj_vars','apply_vnum','apply_implib','apply_link')(apply_objdeps)
feature('cprogram','cshlib','cstaticlib')(apply_obj_vars)
after('apply_lib_vars')(apply_obj_vars)
Esempio n. 8
0
					value=env['LIBPATH_'+var]
					if value:
						core=env[coreval]
						accu=[]
						for lib in value:
							if var!='QTCORE':
								if lib in core:
									continue
							accu.append('-Wl,--rpath='+lib)
						env['RPATH_'+var]=accu
			process_rpath(vars,'LIBPATH_QTCORE')
			process_rpath(vars_debug,'LIBPATH_QTCORE_DEBUG')
	env['QTLOCALE']=str(env['PREFIX'])+'/share/locale'
def detect(conf):
	detect_qt4(conf)
def set_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('--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('apply_link')(apply_qt4)
extension(EXT_QT4)(cxx_hook)
Esempio n. 9
0
    self.env['_ASSEMBLIES'] += assemblies_flags
    for i in self.to_list(self.resources):
        self.env['_RESOURCES'].append('/resource:' + i)
    self.env['_FLAGS'] += self.to_list(self.flags) + self.env['FLAGS']
    curnode = self.path
    nodes = []
    for i in self.to_list(self.source):
        nodes.append(curnode.find_resource(i))
    task = self.create_task('mcs')
    task.inputs = nodes
    task.set_outputs(self.path.find_or_declare(self.target))


Task.simple_task_type(
    'mcs',
    '${MCS} ${SRC} /out:${TGT} ${_FLAGS} ${_ASSEMBLIES} ${_RESOURCES}',
    color='YELLOW')


def detect(conf):
    mcs = conf.find_program('mcs', var='MCS')
    if not mcs: mcs = conf.find_program('gmcs', var='MCS')


feature('cs')(init_cs)
feature('cs')(apply_uselib_cs)
after('init_cs')(apply_uselib_cs)
feature('cs')(apply_cs)
after('apply_uselib_cs')(apply_cs)
before('apply_core')(apply_cs)
Esempio n. 10
0
    binfmt = v.DEST_BINFMT or Utils.unversioned_sys_platform_to_binary_format(
        v.DEST_OS or Utils.unversioned_sys_platform()
    )
    if binfmt == "pe":
        v["D_program_PATTERN"] = "%s.exe"
        v["D_shlib_PATTERN"] = "lib%s.dll"
        v["D_staticlib_PATTERN"] = "lib%s.a"
    else:
        v["D_program_PATTERN"] = "%s"
        v["D_shlib_PATTERN"] = "lib%s.so"
        v["D_staticlib_PATTERN"] = "lib%s.a"


feature("d")(init_d)
before("apply_type_vars")(init_d)
feature("d")(init_d)
before("apply_d_libs")(init_d)
feature("d")(apply_d_libs)
after("apply_d_link", "init_d")(apply_d_libs)
before("apply_vnum")(apply_d_libs)
feature("dprogram", "dshlib", "dstaticlib")(apply_d_link)
after("apply_core")(apply_d_link)
feature("d")(apply_d_vars)
after("apply_core")(apply_d_vars)
feature("dshlib")(add_shlib_d_flags)
after("apply_d_vars")(add_shlib_d_flags)
extension(EXT_D)(d_hook)
taskgen(generate_header)
before("apply_core")(process_header)
conftest(d_platform_flags)
Esempio n. 11
0
	v['shlib_LINKFLAGS']=['/DLL']
	v['shlib_PATTERN']='%s.dll'
	v['implib_PATTERN']='%s.lib'
	v['IMPLIB_ST']='/IMPLIB:%s'
	v['staticlib_LINKFLAGS']=['']
	v['staticlib_PATTERN']='lib%s.lib'
	v['program_PATTERN']='%s.exe'

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)
feature('cprogram','cshlib','cstaticlib')(apply_obj_vars_msvc)
after('apply_lib_vars')(apply_obj_vars_msvc)
before('apply_obj_vars')(apply_obj_vars_msvc)
feature('cprogram','cshlib','cstaticlib')(apply_link_msvc)
before('apply_link')(apply_link_msvc)
feature('cc','cxx')(init_msvc)
after('init_cc','init_cxx')(init_msvc)
before('apply_type_vars','apply_core')(init_msvc)
conftest(no_autodetect)
conftest(autodetect)
conftest(find_msvc)
conftest(msvc_common_flags)
Esempio n. 12
0
        assert dep is not self
        dep.post()
        for dep_task in dep.tasks:
            task.set_run_after(dep_task)
    if not task.inputs:
        task.runnable_status = type(Task.TaskBase.run)(runnable_status, task, task.__class__)
        task.post_run = type(Task.TaskBase.run)(post_run, task, task.__class__)


def post_run(self):
    for x in self.outputs:
        h = Utils.h_file(x.abspath(self.env))
        self.generator.bld.node_sigs[self.env.variant()][x.id] = h


def runnable_status(self):
    return Constants.RUN_ME


Task.task_type_from_func("copy", vars=[], func=action_process_file_func)
TaskGen.task_gen.classes["command-output"] = cmd_output_taskgen

feature("cmd")(apply_cmd)
feature("copy")(apply_copy)
before("apply_core")(apply_copy)
feature("subst")(apply_subst)
before("apply_core")(apply_subst)
feature("command-output")(init_cmd_output)
feature("command-output")(apply_cmd_output)
after("init_cmd_output")(apply_cmd_output)
Esempio n. 13
0
File: osx.py Progetto: johnsen/jack2
	path=self.install_path
	libname=task.outputs[0].name
	name3=libname.replace('.dylib','.%s.dylib'%task.vnum)
	name2=libname.replace('.dylib','.%s.dylib'%nums[0])
	name1=libname
	filename=task.outputs[0].abspath(task.env)
	bld=Build.bld
	bld.install_as(path+name3,filename,env=task.env)
	bld.symlink_as(path+name2,name3)
	bld.symlink_as(path+name1,name3)
def install_target_osx_cshlib(self):
	if not Options.is_install:return
	if getattr(self,'vnum','')and sys.platform!='win32':
		self.link_task.install=install_shlib
Task.task_type_from_func('macapp',vars=[],func=app_build,after="cxx_link cc_link ar_link_static")

taskgen(create_task_macapp)
taskgen(apply_link_osx)
after('apply_link')(apply_link_osx)
feature('cc','cxx')(apply_link_osx)
taskgen(apply_bundle)
before('apply_link')(apply_bundle)
before('apply_lib_vars')(apply_bundle)
feature('cc','cxx')(apply_bundle)
taskgen(apply_bundle_remove_dynamiclib)
after('apply_link')(apply_bundle_remove_dynamiclib)
feature('cc','cxx')(apply_bundle_remove_dynamiclib)
taskgen(install_target_osx_cshlib)
feature('osx')(install_target_osx_cshlib)
after('install_target_cshlib')(install_target_osx_cshlib)
Esempio n. 14
0

def asm_incflags(self):
    if self.env["ASINCFLAGS"]:
        self.env["_ASINCFLAGS"] = self.env["ASINCFLAGS"]
    if "cxx" in self.features:
        self.env["_ASINCFLAGS"] = self.env["_CXXINCFLAGS"]
    else:
        self.env["_ASINCFLAGS"] = self.env["_CCINCFLAGS"]


def detect(conf):
    comp = os.environ.get("AS", "")
    if not comp:
        comp = conf.find_program("as", var="AS")
    if not comp:
        comp = conf.find_program("gas", var="AS")
    if not comp:
        comp = conf.env["CC"]
    if not comp:
        return
    v = conf.env
    v["ASFLAGS"] = ""


extension(EXT_ASM)(asm_hook)
taskgen(asm_incflags)
after("apply_obj_vars_cc")(asm_incflags)
after("apply_obj_vars_cxx")(asm_incflags)
before("apply_link")(asm_incflags)
Esempio n. 15
0
	for x in self.__dict__.keys():
		y=x.lower()
		if y[-1]=='s':
			y=y[:-1]
		if c_attrs.get(y,None):
			self.env.append_unique(c_attrs[y],getattr(self,x))

feature('cc','cxx')(default_cc)
before('init_cc','init_cxx')(default_cc)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(apply_verif)
feature('cprogram','dprogram')(vars_target_cprogram)
before('apply_core')(vars_target_cprogram)
feature('cstaticlib','dstaticlib','cshlib','dshlib')(vars_target_cstaticlib)
before('apply_core')(vars_target_cstaticlib)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(install_target_cstaticlib)
after('apply_objdeps','apply_link')(install_target_cstaticlib)
feature('cshlib','dshlib')(install_target_cshlib)
after('apply_objdeps','apply_link')(install_target_cshlib)
feature('cc','cxx')(apply_incpaths)
after('apply_type_vars')(apply_incpaths)
feature('cc','cxx')(apply_type_vars)
taskgen(apply_link)
feature('cprogram','cshlib','cstaticlib')(apply_link)
after('apply_core')(apply_link)
feature('cc','cxx')(apply_lib_vars)
after('apply_vnum')(apply_lib_vars)
feature('objects')(apply_objdeps)
after('apply_obj_vars','apply_vnum')(apply_objdeps)
feature('cprogram','cshlib','cstaticlib')(apply_obj_vars)
after('apply_lib_vars')(apply_obj_vars)
feature('cprogram','cshlib','cstaticlib')(apply_vnum)
Esempio n. 16
0
                               color='CYAN')
cls.quiet = 1


def add_as_needed(conf):
    if conf.env.DEST_BINFMT == 'elf' and 'gcc' in (conf.env.CXX_NAME,
                                                   conf.env.CC_NAME):
        conf.env.append_unique('LINKFLAGS', '--as-needed')


feature('cc', 'cxx')(default_cc)
before('apply_core')(default_cc)
feature('cprogram', 'dprogram', 'cstaticlib', 'dstaticlib', 'cshlib',
        'dshlib')(apply_verif)
feature('cprogram', 'dprogram')(vars_target_cprogram)
after('default_cc')(vars_target_cprogram)
before('apply_core')(vars_target_cprogram)
after('default_cc')(vars_target_cshlib)
feature('cshlib', 'dshlib')(vars_target_cshlib)
before('apply_core')(vars_target_cshlib)
feature('cprogram', 'dprogram', 'cstaticlib', 'dstaticlib', 'cshlib',
        'dshlib')(default_link_install)
after('apply_link', 'vars_target_cprogram',
      'vars_target_cshlib')(default_link_install)
feature('cc', 'cxx')(apply_incpaths)
after('apply_type_vars', 'apply_lib_vars', 'apply_core')(apply_incpaths)
feature('cc', 'cxx')(apply_type_vars)
after('init_cc', 'init_cxx')(apply_type_vars)
before('apply_lib_vars')(apply_type_vars)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_link)
after('apply_core')(apply_link)
Esempio n. 17
0
		debug_level=Options.options.debug_level.upper()
	except AttributeError:
		debug_level=ccroot.DEBUG_LEVELS.CUSTOM
	v['CCFLAGS']+=v['CCFLAGS_'+debug_level]
	v['CXXFLAGS']+=v['CXXFLAGS_'+debug_level]
	v['LINKFLAGS']+=v['LINKFLAGS_'+debug_level]
	v['shlib_CCFLAGS']=['']
	v['shlib_CXXFLAGS']=['']
	v['shlib_LINKFLAGS']=['/DLL']
	v['shlib_PATTERN']='%s.dll'
	v['staticlib_LINKFLAGS']=['']
	v['staticlib_PATTERN']='%s.lib'
	v['program_PATTERN']='%s.exe'
def set_options(opt):
	opt.add_option('-d','--debug-level',action='store',default=ccroot.DEBUG_LEVELS.DEBUG,help="Specify the debug level, does nothing if CFLAGS is set in the environment. [Allowed Values: '%s']"%"', '".join(ccroot.DEBUG_LEVELS.ALL),choices=ccroot.DEBUG_LEVELS.ALL,dest='debug_level')

taskgen(apply_msvc_obj_vars)
feature('cc','cxx')(apply_msvc_obj_vars)
after('apply_obj_vars_cc')(apply_msvc_obj_vars)
after('apply_obj_vars_cxx')(apply_msvc_obj_vars)
taskgen(apply_link_msvc)
feature('cc','cxx')(apply_link_msvc)
after('apply_core')(apply_link_msvc)
before('apply_obj_vars_cc')(apply_link_msvc)
before('apply_obj_vars_cxx')(apply_link_msvc)
taskgen(init_msvc)
feature('cc','cxx')(init_msvc)
before('apply_core')(init_msvc)
conftest(find_msvc)
conftest(msvc_common_flags)
		env=dict(os.environ)
		env.update(PATH=';'.join(self.env['PATH']))
		kw['env']=env
	return self.generator.bld.exec_command(*k,**kw)
for k in'cc cxx winrc cc_link cxx_link static_link'.split():
	cls=Task.TaskBase.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)
conftest(no_autodetect)
conftest(autodetect)
conftest(find_msvc)
conftest(msvc_common_flags)
after('apply_link')(apply_flags_msvc)
feature('cc','cxx')(apply_flags_msvc)
feature('cprogram','cshlib','cstaticlib')(apply_obj_vars_msvc)
after('apply_lib_vars')(apply_obj_vars_msvc)
before('apply_obj_vars')(apply_obj_vars_msvc)
feature('cprogram','cshlib')(apply_manifest)
after('apply_link')(apply_manifest)
Esempio n. 19
0
            return 1


feature('cc', 'cxx')(default_cc)
before('apply_core')(default_cc)
feature('cprogram', 'dprogram', 'cstaticlib', 'dstaticlib', 'cshlib',
        'dshlib')(apply_verif)
feature('cprogram', 'dprogram')(vars_target_cprogram)
before('apply_core')(vars_target_cprogram)
feature('cstaticlib', 'dstaticlib')(vars_target_cstaticlib)
before('apply_core')(vars_target_cstaticlib)
feature('cshlib', 'dshlib')(vars_target_cshlib)
before('apply_core')(vars_target_cshlib)
feature('cprogram', 'dprogram', 'cstaticlib', 'dstaticlib', 'cshlib',
        'dshlib')(install_target_cstaticlib)
after('apply_objdeps', 'apply_link')(install_target_cstaticlib)
feature('cshlib', 'dshlib')(install_target_cshlib)
after('apply_link')(install_target_cshlib)
feature('cc', 'cxx')(apply_incpaths)
after('apply_type_vars', 'apply_lib_vars', 'apply_core')(apply_incpaths)
feature('cc', 'cxx')(apply_type_vars)
after('init_cc', 'init_cxx')(apply_type_vars)
before('apply_lib_vars')(apply_type_vars)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_link)
after('apply_core')(apply_link)
feature('cc', 'cxx')(apply_lib_vars)
after('apply_link', 'init_cc', 'init_cxx')(apply_lib_vars)
feature('cprogram', 'cstaticlib', 'cshlib')(apply_objdeps)
after('apply_obj_vars', 'apply_vnum', 'apply_implib',
      'apply_link')(apply_objdeps)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_obj_vars)
Esempio n. 20
0
	task.outputs=[node.change_ext(obj_ext)]
	try:
		self.compiled_tasks.append(task)
	except AttributeError:
		raise Utils.WafError('Have you forgotten to set the feature "cxx" on %s?'%str(self))
	return task
cxx_str='${CXX} ${CXXFLAGS} ${CPPFLAGS} ${_CXXINCFLAGS} ${_CXXDEFFLAGS} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT}'
cls=Task.simple_task_type('cxx',cxx_str,color='GREEN',ext_out='.o',ext_in='.cxx',shell=False)
cls.scan=ccroot.scan
cls.vars.append('CXXDEPS')
link_str='${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT} ${LINKFLAGS}'
cls=Task.simple_task_type('cxx_link',link_str,color='YELLOW',ext_in='.o',shell=False)
cls.maxjobs=1
cls2=Task.task_type_from_func('vnum_cxx_link',ccroot.link_vnum,cls.vars,color='CYAN',ext_in='.o')
cls2.maxjobs=1
link_str='${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT[0].abspath(env)} ${LINKFLAGS}'
cls=Task.simple_task_type('dll_cxx_link',link_str,color='YELLOW',ext_in='.o',shell=False)
cls.maxjobs=1
old=cls.run
def run(self):return old(self)or ccroot.post_dll_link(self)
cls.run=run

feature('cxx')(init_cxx)
before('apply_type_vars')(init_cxx)
after('default_cc')(init_cxx)
feature('cxx')(apply_obj_vars_cxx)
after('apply_incpaths')(apply_obj_vars_cxx)
feature('cxx')(apply_defines_cxx)
after('apply_lib_vars')(apply_defines_cxx)
extension(EXT_CXX)(cxx_hook)
Esempio n. 21
0
File: kde4.py Progetto: NKSG/ns3
	try:os.stat(file)
	except OSError:
		file='%s/share/kde4/apps/cmake/modules/KDELibsDependencies.cmake'%prefix
		try:os.stat(file)
		except OSError:conf.fatal('could not open %s'%file)
	try:
		txt=Utils.readf(file)
	except(OSError,IOError):
		conf.fatal('could not read %s'%file)
	txt=txt.replace('\\\n','\n')
	fu=re.compile('#(.*)\n')
	txt=fu.sub('',txt)
	setregexp=re.compile('([sS][eE][tT]\s*\()\s*([^\s]+)\s+\"([^"]+)\"\)')
	found=setregexp.findall(txt)
	for(_,key,val)in found:
		conf.env[key]=val
	conf.env['LIB_KDECORE']='kdecore'
	conf.env['LIB_KDEUI']='kdeui'
	conf.env['LIB_KIO']='kio'
	conf.env['LIB_KHTML']='khtml'
	conf.env['LIB_KPARTS']='kparts'
	conf.env['LIBPATH_KDECORE']=conf.env['KDE4_LIB_INSTALL_DIR']
	conf.env['CPPPATH_KDECORE']=conf.env['KDE4_INCLUDE_INSTALL_DIR']
	conf.env.append_value('CPPPATH_KDECORE',conf.env['KDE4_INCLUDE_INSTALL_DIR']+"/KDE")
	conf.env['MSGFMT']=conf.find_program('msgfmt')
Task.simple_task_type('msgfmt','${MSGFMT} ${SRC} -o ${TGT}',color='BLUE',shell=False)

feature('msgfmt')(init_msgfmt)
feature('msgfmt')(apply_msgfmt)
after('init_msgfmt')(apply_msgfmt)
Esempio n. 22
0
        dep.post()
        for dep_task in dep.tasks:
            task.set_run_after(dep_task)
    if not task.inputs:
        task.runnable_status = type(Task.TaskBase.run)(runnable_status, task,
                                                       task.__class__)
        task.post_run = type(Task.TaskBase.run)(post_run, task, task.__class__)


def post_run(self):
    for x in self.outputs:
        h = Utils.h_file(x.abspath(self.env))
        self.generator.bld.node_sigs[self.env.variant()][x.id] = h


def runnable_status(self):
    return Constants.RUN_ME


Task.task_type_from_func('copy', vars=[], func=action_process_file_func)
TaskGen.task_gen.classes['command-output'] = cmd_output_taskgen

feature('cmd')(apply_cmd)
feature('copy')(apply_copy)
before('apply_core')(apply_copy)
feature('subst')(apply_subst)
before('apply_core')(apply_subst)
feature('command-output')(init_cmd_output)
feature('command-output')(apply_cmd_output)
after('init_cmd_output')(apply_cmd_output)
Esempio n. 23
0
                   type='int',
                   default=1,
                   dest='want_rpath',
                   help='set rpath to 1 or 0 [Default 1]')
    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('apply_link')(apply_qt4)
extension(EXT_QT4)(cxx_hook)
Esempio n. 24
0
        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')


before('apply_incpaths', 'apply_lib_vars', 'apply_type_vars')(init_pyext)
feature('pyext')(init_pyext)
before('apply_bundle')(init_pyext)
before('apply_link', 'apply_lib_vars', 'apply_type_vars')(pyext_shlib_ext)
after('apply_bundle')(pyext_shlib_ext)
feature('pyext')(pyext_shlib_ext)
before('apply_incpaths', 'apply_lib_vars', 'apply_type_vars')(init_pyembed)
feature('pyembed')(init_pyembed)
extension(EXT_PY)(process_py)
feature('py')(byte_compile_py)
before('apply_core')(init_py)
after('vars_target_cprogram', 'vars_target_cstaticlib')(init_py)
feature('py')(init_py)
conf(check_python_headers)
conf(check_python_version)
conf(check_python_module)
    ltf = libtool_config(args[0])
    if options.debug:
        print(ltf)
    if options.atleast_version:
        if ltf >= options.atleast_version: return 0
        sys.exit(1)
    if options.exact_version:
        if ltf == options.exact_version: return 0
        sys.exit(1)
    if options.max_version:
        if ltf <= options.max_version: return 0
        sys.exit(1)

    def p(x):
        print(" ".join(x))

    if options.libs: p(ltf.get_libs())
    elif options.libs_only_l: p(ltf.get_libs_only_l())
    elif options.libs_only_L: p(ltf.get_libs_only_L())
    elif options.libs_only_other: p(ltf.get_libs_only_other())
    return 0


if __name__ == '__main__':
    useCmdLine()

feature("libtool")(apply_link_libtool)
after('apply_link')(apply_link_libtool)
feature("libtool")(apply_libtool)
before('apply_core')(apply_libtool)
Esempio n. 26
0
File: qt4.py Progetto: henokyen/EOH
def detect(conf):
    detect_qt4(conf)


def set_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(
        "--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("apply_link")(apply_qt4)
extension(EXT_QT4)(cxx_hook)
Esempio n. 27
0
File: ruby.py Progetto: NKSG/ns3
	conf.env.CCFLAGS_RUBYEXT=read_config("CCDLFLAGS")
	conf.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:]
	conf.env.LINKFLAGS_RUBYEXT=flags
	conf.env.LINKFLAGS_RUBYEXT+=read_config("LIBS")
	conf.env.LINKFLAGS_RUBYEXT+=read_config("LIBRUBYARG_SHARED")
	if Options.options.rubyarchdir:
		conf.env.ARCHDIR_RUBY=Options.options.rubyarchdir
	else:
		conf.env.ARCHDIR_RUBY=read_config('sitearchdir')[0]
	if Options.options.rubylibdir:
		conf.env.LIBDIR_RUBY=Options.options.rubylibdir
	else:
		conf.env.LIBDIR_RUBY=read_config('sitelibdir')[0]
def set_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_type_vars','apply_lib_vars','apply_bundle')(init_rubyext)
after('default_cc','vars_target_cshlib')(init_rubyext)
feature('rubyext')(apply_ruby_so_name)
before('apply_link')(apply_ruby_so_name)
conf(check_ruby_version)
conf(check_ruby_ext_devel)
	try:
		os.remove(self.outputs[0].abspath())
	except OSError,e:
		pass
	try:
		os.symlink(self.inputs[0].name,self.outputs[0].abspath(self.env))
	except Exception,e:
		return 1
cls=Task.task_type_from_func('vnum',func=exec_vnum_link,ext_in='.bin',color='CYAN')
cls.quiet=1

feature('cc','cxx')(default_cc)
before('apply_core')(default_cc)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(apply_verif)
feature('cprogram','dprogram')(vars_target_cprogram)
after('default_cc')(vars_target_cprogram)
before('apply_core')(vars_target_cprogram)
after('default_cc')(vars_target_cshlib)
feature('cshlib','dshlib')(vars_target_cshlib)
before('apply_core')(vars_target_cshlib)
feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(default_link_install)
after('apply_link','vars_target_cprogram','vars_target_cshlib')(default_link_install)
feature('cc','cxx')(apply_incpaths)
after('apply_type_vars','apply_lib_vars','apply_core')(apply_incpaths)
feature('cc','cxx')(apply_type_vars)
after('init_cc','init_cxx')(apply_type_vars)
before('apply_lib_vars')(apply_type_vars)
feature('cprogram','cshlib','cstaticlib')(apply_link)
after('apply_core')(apply_link)
feature('cc','cxx')(apply_lib_vars)
after('apply_link','init_cc','init_cxx')(apply_lib_vars)
Esempio n. 29
0
			val=self.env[v+'_'+var]
			if val:self.env.append_value(v,val)
def apply_cs(self):
	try:self.meths.remove('apply_core')
	except ValueError:pass
	assemblies_flags=[]
	for i in self.to_list(self.assemblies)+self.env['ASSEMBLIES']:
		assemblies_flags+='/r:'+i
	self.env['_ASSEMBLIES']+=assemblies_flags
	for i in self.to_list(self.resources):
		self.env['_RESOURCES'].append('/resource:'+i)
	self.env['_FLAGS']+=self.to_list(self.flags)+self.env['FLAGS']
	curnode=self.path
	nodes=[]
	for i in self.to_list(self.source):
		nodes.append(curnode.find_resource(i))
	task=self.create_task('mcs')
	task.inputs=nodes
	task.set_outputs(self.path.find_or_declare(self.target))
Task.simple_task_type('mcs','${MCS} ${SRC} /out:${TGT} ${_FLAGS} ${_ASSEMBLIES} ${_RESOURCES}',color='YELLOW')
def detect(conf):
	mcs=conf.find_program('mcs',var='MCS')
	if not mcs:mcs=conf.find_program('gmcs',var='MCS')

feature('cs')(init_cs)
feature('cs')(apply_uselib_cs)
after('init_cs')(apply_uselib_cs)
feature('cs')(apply_cs)
after('apply_uselib_cs')(apply_cs)
before('apply_core')(apply_cs)
Esempio n. 30
0
	conf.define('ENABLE_NLS',1)
	conf.define('HAVE_BIND_TEXTDOMAIN_CODESET',1)
	conf.define('HAVE_DCGETTEXT',1)
	conf.check(header_name='dlfcn.h',define_name='HAVE_DLFCN_H')
	conf.define('HAVE_GETTEXT',1)
	conf.check(header_name='inttypes.h',define_name='HAVE_INTTYPES_H')
	conf.check(header_name='locale.h',define_name='HAVE_LOCALE_H')
	conf.check(header_name='memory.h',define_name='HAVE_MEMORY_H')
	conf.check(header_name='stdint.h',define_name='HAVE_STDINT_H')
	conf.check(header_name='stdlib.h',define_name='HAVE_STDLIB_H')
	conf.check(header_name='strings.h',define_name='HAVE_STRINGS_H')
	conf.check(header_name='string.h',define_name='HAVE_STRING_H')
	conf.check(header_name='sys/stat.h',define_name='HAVE_SYS_STAT_H')
	conf.check(header_name='sys/types.h',define_name='HAVE_SYS_TYPES_H')
	conf.check(header_name='unistd.h',define_name='HAVE_UNISTD_H')
def set_options(opt):
	opt.add_option('--want-rpath',type='int',default=1,dest='want_rpath',help='set rpath to 1 or 0 [Default 1]')

taskgen(init_gnome_doc)
feature('gmome_doc')(init_gnome_doc)
taskgen(apply_gnome_doc)
feature('gnome_doc')(apply_gnome_doc)
after('init_gnome_doc')(apply_gnome_doc)
taskgen(init_xml_to)
feature('xml_to')(init_xml_to)
taskgen(apply_xml_to)
feature('xml_to')(apply_xml_to)
after('init_xml_to')(apply_xml_to)
taskgen(apply_gnome_sgml2man)
feature('gnome_sgml2man')(apply_gnome_sgml2man)
Esempio n. 31
0
        "--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",
    )


before("apply_incpaths", "apply_lib_vars", "apply_type_vars")(init_pyext)
feature("pyext")(init_pyext)
before("apply_bundle")(init_pyext)
before("apply_link", "apply_lib_vars", "apply_type_vars")(pyext_shlib_ext)
after("apply_bundle")(pyext_shlib_ext)
feature("pyext")(pyext_shlib_ext)
before("apply_incpaths", "apply_lib_vars", "apply_type_vars")(init_pyembed)
feature("pyembed")(init_pyembed)
extension(EXT_PY)(process_py)
before("apply_core")(init_py)
after("vars_target_cprogram", "vars_target_cshlib")(init_py)
feature("py")(init_py)
conf(check_python_headers)
conf(check_python_version)
conf(check_python_module)
Esempio n. 32
0
	nums=task.vnum.split('.')
	path=self.install_path
	libname=task.outputs[0].name
	name3=libname.replace('.dylib','.%s.dylib'%task.vnum)
	name2=libname.replace('.dylib','.%s.dylib'%nums[0])
	name1=libname
	filename=task.outputs[0].abspath(task.env)
	bld=task.outputs[0].__class__.bld
	bld.install_as(path+name3,filename,env=task.env)
	bld.symlink_as(path+name2,name3)
	bld.symlink_as(path+name1,name3)
def install_target_osx_cshlib(self):
	if not self.bld.is_install:return
	if getattr(self,'vnum','')and sys.platform!='win32':
		self.link_task.install=install_shlib
Task.task_type_from_func('macapp',vars=[],func=app_build,after="cxx_link cc_link ar_link_static")

feature('cc','cxx')(set_macosx_deployment_target)
before('apply_lib_vars')(set_macosx_deployment_target)
feature('cc','cxx')(apply_framework)
after('apply_lib_vars')(apply_framework)
taskgen(create_task_macapp)
after('apply_link')(apply_link_osx)
feature('cc','cxx')(apply_link_osx)
before('apply_link','apply_lib_vars')(apply_bundle)
feature('cc','cxx')(apply_bundle)
after('apply_link')(apply_bundle_remove_dynamiclib)
feature('cshlib')(apply_bundle_remove_dynamiclib)
feature('osx')(install_target_osx_cshlib)
after('install_target_cshlib')(install_target_osx_cshlib)
Esempio n. 33
0
		parser.error("incorrect number of arguments")
	if options.versionNumber:
		print("libtool-config version %s"%REVISION)
		return 0
	ltf=libtool_config(args[0])
	if options.debug:
		print(ltf)
	if options.atleast_version:
		if ltf>=options.atleast_version:return 0
		sys.exit(1)
	if options.exact_version:
		if ltf==options.exact_version:return 0
		sys.exit(1)
	if options.max_version:
		if ltf<=options.max_version:return 0
		sys.exit(1)
	def p(x):
		print(" ".join(x))
	if options.libs:p(ltf.get_libs())
	elif options.libs_only_l:p(ltf.get_libs_only_l())
	elif options.libs_only_L:p(ltf.get_libs_only_L())
	elif options.libs_only_other:p(ltf.get_libs_only_other())
	return 0
if __name__=='__main__':
	useCmdLine()

feature("libtool")(apply_link_libtool)
after('apply_link')(apply_link_libtool)
feature("libtool")(apply_libtool)
before('apply_core')(apply_libtool)
Esempio n. 34
0
File: d.py Progetto: NKSG/ns3
Task.simple_task_type('d_header',d_header_str,color='BLUE',shell=False)
def d_platform_flags(conf):
	v=conf.env
	binfmt=v.DEST_BINFMT or Utils.unversioned_sys_platform_to_binary_format(v.DEST_OS or Utils.unversioned_sys_platform())
	if binfmt=='pe':
		v['D_program_PATTERN']='%s.exe'
		v['D_shlib_PATTERN']='lib%s.dll'
		v['D_staticlib_PATTERN']='lib%s.a'
	else:
		v['D_program_PATTERN']='%s'
		v['D_shlib_PATTERN']='lib%s.so'
		v['D_staticlib_PATTERN']='lib%s.a'

feature('d')(init_d)
before('apply_type_vars')(init_d)
feature('d')(init_d)
before('apply_d_libs')(init_d)
feature('d')(apply_d_libs)
after('apply_d_link','init_d')(apply_d_libs)
before('apply_vnum')(apply_d_libs)
feature('dprogram','dshlib','dstaticlib')(apply_d_link)
after('apply_core')(apply_d_link)
feature('d')(apply_d_vars)
after('apply_core')(apply_d_vars)
feature('dshlib')(add_shlib_d_flags)
after('apply_d_vars')(add_shlib_d_flags)
extension(EXT_D)(d_hook)
taskgen(generate_header)
before('apply_core')(process_header)
conftest(d_platform_flags)
	Utils.copy_attrs(self,task,'before after ext_in ext_out',only_if_set=True)
	self.tasks.append(task)
	task.inputs=inputs
	task.outputs=outputs
	task.dep_vars=self.to_list(self.dep_vars)
	for dep in self.dependencies:
		assert dep is not self
		dep.post()
		for dep_task in dep.tasks:
			task.set_run_after(dep_task)
	if not task.inputs:
		task.runnable_status=type(Task.TaskBase.run)(runnable_status,task,task.__class__)
		task.post_run=type(Task.TaskBase.run)(post_run,task,task.__class__)
def post_run(self):
	for x in self.outputs:
		h=Utils.h_file(x.abspath(self.env))
		self.generator.bld.node_sigs[self.env.variant()][x.id]=h
def runnable_status(self):
	return Constants.RUN_ME
Task.task_type_from_func('copy',vars=[],func=action_process_file_func)
TaskGen.task_gen.classes['command-output']=cmd_output_taskgen

feature('cmd')(apply_cmd)
feature('copy')(apply_copy)
before('apply_core')(apply_copy)
feature('subst')(apply_subst)
before('apply_core')(apply_subst)
feature('command-output')(init_cmd_output)
feature('command-output')(apply_cmd_output)
after('init_cmd_output')(apply_cmd_output)
            os.stat(file)
        except OSError:
            conf.fatal("could not open %s" % file)
    try:
        txt = Utils.readf(file)
    except (OSError, IOError):
        conf.fatal("could not read %s" % file)
    txt = txt.replace("\\\n", "\n")
    fu = re.compile("#(.*)\n")
    txt = fu.sub("", txt)
    setregexp = re.compile('([sS][eE][tT]\s*\()\s*([^\s]+)\s+"([^"]+)"\)')
    found = setregexp.findall(txt)
    for (_, key, val) in found:
        conf.env[key] = val
    conf.env["LIB_KDECORE"] = "kdecore"
    conf.env["LIB_KDEUI"] = "kdeui"
    conf.env["LIB_KIO"] = "kio"
    conf.env["LIB_KHTML"] = "khtml"
    conf.env["LIB_KPARTS"] = "kparts"
    conf.env["LIBPATH_KDECORE"] = conf.env["KDE4_LIB_INSTALL_DIR"]
    conf.env["CPPPATH_KDECORE"] = conf.env["KDE4_INCLUDE_INSTALL_DIR"]
    conf.env.append_value("CPPPATH_KDECORE", conf.env["KDE4_INCLUDE_INSTALL_DIR"] + "/KDE")
    conf.env["MSGFMT"] = conf.find_program("msgfmt")


Task.simple_task_type("msgfmt", "${MSGFMT} ${SRC} -o ${TGT}", color="BLUE", shell=False)

feature("msgfmt")(init_msgfmt)
feature("msgfmt")(apply_msgfmt)
after("init_msgfmt")(apply_msgfmt)
Esempio n. 37
0
    def getstr(varname):
        return getattr(Options.options, varname, '')

    conf.define('GNOMELOCALEDIR', os.path.join(conf.env['DATADIR'], 'locale'))
    xml2po = conf.find_program('xml2po', var='XML2PO')
    xsltproc2po = conf.find_program('xsltproc', var='XSLTPROC2PO')
    conf.env['XML2POFLAGS'] = '-e -p'
    conf.env['SCROLLKEEPER_DATADIR'] = Utils.cmd_output(
        "scrollkeeper-config --pkgdatadir", silent=1).strip()
    conf.env['DB2OMF'] = Utils.cmd_output(
        "/usr/bin/pkg-config --variable db2omf gnome-doc-utils",
        silent=1).strip()


def set_options(opt):
    opt.add_option('--want-rpath',
                   type='int',
                   default=1,
                   dest='want_rpath',
                   help='set rpath to 1 or 0 [Default 1]')


feature('gnome_doc')(init_gnome_doc)
feature('gnome_doc')(apply_gnome_doc)
after('init_gnome_doc')(apply_gnome_doc)
feature('xml_to')(init_xml_to)
feature('xml_to')(apply_xml_to)
after('init_xml_to')(apply_xml_to)
feature('gnome_sgml2man')(apply_gnome_sgml2man)
Esempio n. 38
0
        )
    conf.env['OCAMLC'] = occ
    conf.env['OCAMLOPT'] = opt
    conf.env['OCAMLLEX'] = conf.find_program('ocamllex', var='OCAMLLEX')
    conf.env['OCAMLYACC'] = conf.find_program('ocamlyacc', var='OCAMLYACC')
    conf.env['OCAMLFLAGS'] = ''
    conf.env['OCAMLLIB'] = Utils.cmd_output(conf.env['OCAMLC'] +
                                            ' -where').strip() + os.sep
    conf.env['LIBPATH_OCAML'] = Utils.cmd_output(conf.env['OCAMLC'] +
                                                 ' -where').strip() + os.sep
    conf.env['CPPPATH_OCAML'] = Utils.cmd_output(conf.env['OCAMLC'] +
                                                 ' -where').strip() + os.sep
    conf.env['LIB_OCAML'] = 'camlrun'


feature('ocaml')(init_ml)
feature('ocaml')(init_envs_ml)
after('init_ml')(init_envs_ml)
feature('ocaml')(apply_incpaths_ml)
before('apply_vars_ml')(apply_incpaths_ml)
after('init_envs_ml')(apply_incpaths_ml)
feature('ocaml')(apply_vars_ml)
before('apply_core')(apply_vars_ml)
feature('ocaml')(apply_link_ml)
after('apply_core')(apply_link_ml)
extension(EXT_MLL)(mll_hook)
extension(EXT_MLY)(mly_hook)
extension(EXT_MLI)(mli_hook)
extension(EXT_MLC)(mlc_hook)
extension(EXT_ML)(ml_hook)
Esempio n. 39
0
#! /usr/bin/env python
# encoding: utf-8

import os,sys
import Task
from TaskGen import extension,taskgen,after,before
EXT_ASM=['.s','.S','.asm','.ASM','.spp','.SPP']
as_str='${AS} ${ASFLAGS} ${_ASINCFLAGS} ${SRC} -o ${TGT}'
Task.simple_task_type('asm',as_str,'PINK',ext_out='.o',shell=False)
def asm_hook(self,node):
	try:obj_ext=self.obj_ext
	except AttributeError:obj_ext='_%d.o'%self.idx
	task=self.create_task('asm',node,node.change_ext(obj_ext))
	self.compiled_tasks.append(task)
	self.meths.append('asm_incflags')
def asm_incflags(self):
	if self.env['ASINCFLAGS']:self.env['_ASINCFLAGS']=self.env['ASINCFLAGS']
	if'cxx'in self.features:self.env['_ASINCFLAGS']=self.env['_CXXINCFLAGS']
	else:self.env['_ASINCFLAGS']=self.env['_CCINCFLAGS']
def detect(conf):
	conf.find_program(['gas','as'],var='AS')
	if not conf.env.AS:conf.env.AS=conf.env.CC

extension(EXT_ASM)(asm_hook)
taskgen(asm_incflags)
after('apply_obj_vars_cc')(asm_incflags)
after('apply_obj_vars_cxx')(asm_incflags)
before('apply_link')(asm_incflags)
Esempio n. 40
0
File: cc.py Progetto: johnsen/jack2
	libs=self.to_list(self.uselib)
	for l in libs:
		val=self.env['CCDEFINES_'+l]
		if val:milst+=val
	self.env['DEFLINES']=["%s %s"%(x[0],Utils.trimquotes('='.join(x[1:])))for x in[y.split('=')for y in milst]]
	y=self.env['CCDEFINES_ST']
	self.env['_CCDEFFLAGS']=[y%x for x in milst]
def c_hook(self,node):
	task=self.create_task('cc')
	try:obj_ext=self.obj_ext
	except AttributeError:obj_ext='_%d.o'%self.idx
	task.defines=self.scanner_defines
	task.inputs=[node]
	task.outputs=[node.change_ext(obj_ext)]
	self.compiled_tasks.append(task)
cc_str='${CC} ${CCFLAGS} ${CPPFLAGS} ${_CCINCFLAGS} ${_CCDEFFLAGS} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}'
link_str='${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS}'
cls=Task.simple_task_type('cc',cc_str,'GREEN',ext_out='.o',ext_in='.c')
cls.scan=ccroot.scan
cls.vars.append('CCDEPS')
cls=Task.simple_task_type('cc_link',link_str,color='YELLOW',ext_in='.o')
cls.maxjobs=1
TaskGen.declare_order('apply_incpaths','apply_defines_cc','apply_core','apply_lib_vars','apply_obj_vars_cc','apply_obj_vars')

feature('cc')(init_cc)
before('apply_type_vars')(init_cc)
after('default_cc')(init_cc)
feature('cc')(apply_obj_vars_cc)
feature('cc')(apply_defines_cc)
extension(EXT_CC)(c_hook)
Esempio n. 41
0
app_dirs=['Contents','Contents/MacOS','Contents/Resources']
def app_build(task):
	env=task.env
	shutil.copy2(task.inputs[0].srcpath(env),task.outputs[0].abspath(env))
	return 0
def plist_build(task):
	env=task.env
	f=open(task.outputs[0].abspath(env),"w")
	f.write(task.mac_plist)
	f.close()
	return 0
Task.task_type_from_func('macapp',vars=[],func=app_build,after="cxx_link cc_link static_link")
Task.task_type_from_func('macplist',vars=[],func=plist_build,after="cxx_link cc_link static_link")

feature('cc','cxx')(set_macosx_deployment_target)
before('apply_lib_vars')(set_macosx_deployment_target)
feature('cc','cxx')(apply_framework)
after('apply_lib_vars')(apply_framework)
taskgen(create_bundle_dirs)
taskgen(create_task_macapp)
after('apply_link')(create_task_macapp)
feature('cprogram')(create_task_macapp)
after('apply_link')(create_task_macplist)
feature('cprogram')(create_task_macplist)
after('apply_link')(apply_link_osx)
feature('cshlib')(apply_link_osx)
before('apply_link','apply_lib_vars')(apply_bundle)
feature('cc','cxx')(apply_bundle)
after('apply_link')(apply_bundle_remove_dynamiclib)
feature('cshlib')(apply_bundle_remove_dynamiclib)
Esempio n. 42
0
    v['shlib_PATTERN'] = '%s.dll'
    v['implib_PATTERN'] = '%s.lib'
    v['IMPLIB_ST'] = '/IMPLIB:%s'
    v['staticlib_LINKFLAGS'] = ['']
    v['staticlib_PATTERN'] = 'lib%s.lib'
    v['program_PATTERN'] = '%s.exe'


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)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_obj_vars_msvc)
after('apply_lib_vars')(apply_obj_vars_msvc)
before('apply_obj_vars')(apply_obj_vars_msvc)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_link_msvc)
before('apply_link')(apply_link_msvc)
feature('cc', 'cxx')(init_msvc)
after('init_cc', 'init_cxx')(init_msvc)
before('apply_type_vars', 'apply_core')(init_msvc)
conftest(no_autodetect)
conftest(autodetect)
conftest(find_msvc)
conftest(msvc_common_flags)
Esempio n. 43
0
    if Options.options.rubylibdir:
        conf.env.LIBDIR_RUBY = Options.options.rubylibdir
    else:
        conf.env.LIBDIR_RUBY = read_config('sitelibdir')[0]


def set_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_type_vars', 'apply_lib_vars',
       'apply_bundle')(init_rubyext)
after('default_cc', 'vars_target_cshlib')(init_rubyext)
feature('rubyext')(apply_ruby_so_name)
before('apply_link')(apply_ruby_so_name)
conf(check_ruby_version)
conf(check_ruby_ext_devel)
Esempio n. 44
0
	if not conf.env.PYTHON:
		conf.env.PYTHON=sys.executable
	python=conf.find_program('python',var='PYTHON')
	if not python:
		conf.fatal('Could not find the path of the python 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 set_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')

before('apply_incpaths','apply_lib_vars','apply_type_vars')(init_pyext)
feature('pyext')(init_pyext)
before('apply_bundle')(init_pyext)
before('apply_link','apply_lib_vars','apply_type_vars')(pyext_shlib_ext)
after('apply_bundle')(pyext_shlib_ext)
feature('pyext')(pyext_shlib_ext)
before('apply_incpaths','apply_lib_vars','apply_type_vars')(init_pyembed)
feature('pyembed')(init_pyembed)
extension(EXT_PY)(process_py)
before('apply_core')(init_py)
after('vars_target_cprogram','vars_target_cshlib')(init_py)
feature('py')(init_py)
conf(check_python_headers)
conf(check_python_version)
conf(check_python_module)
Esempio n. 45
0
def detect(conf):
	opt=conf.find_program('ocamlopt',var='OCAMLOPT')
	occ=conf.find_program('ocamlc',var='OCAMLC')
	if(not opt)or(not occ):
		conf.fatal('The objective caml compiler was not found:\ninstall it or make it available in your PATH')
	conf.env['OCAMLC']=occ
	conf.env['OCAMLOPT']=opt
	conf.env['OCAMLLEX']=conf.find_program('ocamllex',var='OCAMLLEX')
	conf.env['OCAMLYACC']=conf.find_program('ocamlyacc',var='OCAMLYACC')
	conf.env['OCAMLFLAGS']=''
	conf.env['OCAMLLIB']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep
	conf.env['LIBPATH_OCAML']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep
	conf.env['CPPPATH_OCAML']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep
	conf.env['LIB_OCAML']='camlrun'

feature('ocaml')(init_ml)
feature('ocaml')(init_envs_ml)
after('init_ml')(init_envs_ml)
feature('ocaml')(apply_incpaths_ml)
before('apply_vars_ml')(apply_incpaths_ml)
after('init_envs_ml')(apply_incpaths_ml)
feature('ocaml')(apply_vars_ml)
before('apply_core')(apply_vars_ml)
feature('ocaml')(apply_link_ml)
after('apply_core')(apply_link_ml)
extension(EXT_MLL)(mll_hook)
extension(EXT_MLY)(mly_hook)
extension(EXT_MLI)(mli_hook)
extension(EXT_MLC)(mlc_hook)
extension(EXT_ML)(ml_hook)
Esempio n. 46
0
        kw['env'] = env
    return self.generator.bld.exec_command(*k, **kw)


for k in 'cc cxx winrc cc_link cxx_link static_link qxx'.split():
    cls = Task.TaskBase.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)
conftest(no_autodetect)
conftest(autodetect)
conftest(find_msvc)
conftest(msvc_common_flags)
after('apply_link')(apply_flags_msvc)
feature('cc', 'cxx')(apply_flags_msvc)
feature('cprogram', 'cshlib', 'cstaticlib')(apply_obj_vars_msvc)
after('apply_lib_vars')(apply_obj_vars_msvc)
before('apply_obj_vars')(apply_obj_vars_msvc)
feature('cprogram', 'cshlib')(apply_manifest)
after('apply_link')(apply_manifest)
Esempio n. 47
0
    name1 = libname
    filename = task.outputs[0].abspath(task.env)
    bld = task.outputs[0].__class__.bld
    bld.install_as(path + name3, filename, env=task.env)
    bld.symlink_as(path + name2, name3)
    bld.symlink_as(path + name1, name3)


def install_target_osx_cshlib(self):
    if not self.bld.is_install:
        return
    if getattr(self, "vnum", "") and sys.platform != "win32":
        self.link_task.install = install_shlib


Task.task_type_from_func("macapp", vars=[], func=app_build, after="cxx_link cc_link ar_link_static")

feature("cc", "cxx")(set_macosx_deployment_target)
before("apply_lib_vars")(set_macosx_deployment_target)
feature("cc", "cxx")(apply_framework)
after("apply_lib_vars")(apply_framework)
taskgen(create_task_macapp)
after("apply_link")(apply_link_osx)
feature("cc", "cxx")(apply_link_osx)
before("apply_link", "apply_lib_vars")(apply_bundle)
feature("cc", "cxx")(apply_bundle)
after("apply_link")(apply_bundle_remove_dynamiclib)
feature("cshlib")(apply_bundle_remove_dynamiclib)
feature("osx")(install_target_osx_cshlib)
after("install_target_cshlib")(install_target_osx_cshlib)