本文整理汇总了Python中waflib.Configure.conf函数的典型用法代码示例。如果您正苦于以下问题:Python conf函数的具体用法?Python conf怎么用?Python conf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了conf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extension
)
opt.add_option(
"--header-ext", type="string", default="", help="header extension for moc files", dest="qt_header_ext"
)
for i in "qtdir qtbin qtlibs".split():
opt.add_option("--" + i, type="string", default="", dest=i)
if sys.platform == "darwin":
opt.add_option(
"--no-qt4-framework",
action="store_false",
help="do not use the framework version of Qt4 in OS X",
dest="use_qt4_osxframework",
default=True,
)
opt.add_option(
"--translate", action="store_true", help="collect translation strings", dest="trans_qt4", default=False
)
extension(*EXT_RCC)(create_rcc_task)
extension(*EXT_UI)(create_uic_task)
extension(".ts")(add_lang)
feature("qt4")(apply_qt4)
after_method("apply_link")(apply_qt4)
extension(*EXT_QT4)(cxx_hook)
conf(find_qt4_binaries)
conf(find_qt4_libraries)
conf(simplify_qt4_libs)
conf(add_qt4_rpath)
conf(set_qt4_libs_to_check)
示例2: len
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)
示例3: version
v['dshlib_PATTERN']='lib%s.so'
v['dstlib_PATTERN']='lib%s.a'
DLIB='''
version(D_Version2) {
import std.stdio;
int main() {
writefln("phobos2");
return 0;
}
} else {
version(Tango) {
import tango.stdc.stdio;
int main() {
printf("tango");
return 0;
}
} else {
import std.stdio;
int main() {
writefln("phobos1");
return 0;
}
}
}
'''
def check_dlibrary(self):
ret=self.check_cc(features='d dprogram',fragment=DLIB,compile_filename='test.d',execute=True,define_ret=True)
self.env.DLIBRARY=ret.strip()
conf(d_platform_flags)
conf(check_dlibrary)
示例4: getattr
kw['cwd']=bld.cwd
except AttributeError:
bld.cwd=kw['cwd']=bld.variant_dir
ret=self.exec_response_command(k[0],**kw)
if not ret and getattr(self,'do_manifest',None):
ret=self.exec_mf()
return ret
for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split():
cls=Task.classes.get(k,None)
if cls:
cls.exec_command=exec_command_msvc
cls.exec_response_command=exec_response_command
cls.quote_response_command=quote_response_command
cls.exec_mf=exec_mf
conf(get_msvc_version)
conf(gather_wsdk_versions)
conf(gather_msvc_targets)
conf(gather_wince_targets)
conf(gather_msvc_versions)
conf(gather_icl_versions)
conf(get_msvc_versions)
conf(print_all_msvc_detected)
conf(detect_msvc)
conf(find_lt_names_msvc)
conf(libname_msvc)
conf(check_lib_msvc)
conf(check_libs_msvc)
conf(no_autodetect)
conf(autodetect)
conf(find_msvc)
示例5: check_jni_headers
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)
示例6: return
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)
示例7: ifort_modifier_platform
fc_config.fortran_modifier_darwin(conf)
def ifort_modifier_platform(conf):
dest_os=conf.env['DEST_OS']or Utils.unversioned_sys_platform()
ifort_modifier_func=getattr(conf,'ifort_modifier_'+dest_os,None)
if ifort_modifier_func:
ifort_modifier_func()
def get_ifort_version(conf,fc):
version_re=re.compile(r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search
cmd=fc+['--version']
out,err=fc_config.getoutput(conf,cmd,stdin=False)
if out:
match=version_re(out)
else:
match=version_re(err)
if not match:
conf.fatal('cannot determine ifort version.')
k=match.groupdict()
conf.env['FC_VERSION']=(k['major'],k['minor'])
def configure(conf):
conf.find_ifort()
conf.find_program('xiar',var='AR')
conf.env.ARFLAGS='rcs'
conf.fc_flags()
conf.ifort_modifier_platform()
conf(find_ifort)
conf(ifort_modifier_cygwin)
conf(ifort_modifier_win32)
conf(ifort_modifier_darwin)
conf(ifort_modifier_platform)
conf(get_ifort_version)
示例8: common_flags_dmd
v['LINKFLAGS']=[]
v['DFLAGS_dshlib']=['-relocation-model=pic']
def common_flags_dmd(conf):
v=conf.env
v['D_SRC_F']=['-c']
v['D_TGT_F']='-of%s'
v['D_LINKER']=v['D']
v['DLNK_SRC_F']=''
v['DLNK_TGT_F']='-of%s'
v['DINC_ST']='-I%s'
v['DSHLIB_MARKER']=v['DSTLIB_MARKER']=''
v['DSTLIB_ST']=v['DSHLIB_ST']='-L-l%s'
v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L-L%s'
v['LINKFLAGS_dprogram']=['-quiet']
v['DFLAGS_dshlib']=['-fPIC']
v['LINKFLAGS_dshlib']=['-L-shared']
v['DHEADER_ext']='.di'
v.DFLAGS_d_with_header=['-H','-Hf']
v['D_HDR_F']='%s'
def configure(conf):
conf.find_dmd()
conf.load('ar')
conf.load('d')
conf.common_flags_dmd()
conf.d_platform_flags()
if str(conf.env.D).find('ldc')>-1:
conf.common_flags_ldc()
conf(find_dmd)
conf(common_flags_ldc)
conf(common_flags_dmd)
示例9: in
del self.env['LIBPATH_%s'%var]
for cxxflags in(['/MD','/EHsc'],[]):
self.env.stash()
self.env["CXXFLAGS_%s"%var]+=cxxflags
try:
try_link()
self.end_msg("ok: winning cxxflags combination: %s"%(self.env["CXXFLAGS_%s"%var]))
e=None
break
except Errors.ConfigurationError as exc:
self.env.revert()
e=exc
if e is not None:
self.fatal("Could not auto-detect boost linking flags combination, you may report it to boost.py author",ex=e)
else:
self.fatal("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain")
else:
self.start_msg('Checking for boost linkage')
try:
try_link()
except Errors.ConfigurationError ,e:
self.fatal("Could not link against boost libraries using supplied options")
self.end_msg('ok')
conf(__boost_get_version_file)
conf(boost_get_version)
conf(boost_get_includes)
conf(boost_get_toolset)
conf(__boost_get_libs_path)
conf(boost_get_libs)
conf(check_boost)
示例10: feature
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)
示例11: check_perl_ext_devel
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)
示例12: conf
if not v['LINK_CXX']:v['LINK_CXX']=v['CXX']
v['CXXLNK_SRC_F']=''
v['CXXLNK_TGT_F']=['-o','']
v['CPPPATH_ST']='-I%s'
v['DEFINES_ST']='-D%s'
v['LIB_ST']='-l%s'
v['LIBPATH_ST']='-L%s'
v['STLIB_ST']='-l%s'
v['STLIBPATH_ST']='-L%s'
v['RPATH_ST']='-Wl,-rpath,%s'
v['SONAME_ST']=''
v['SHLIB_MARKER']=''
v['STLIB_MARKER']=''
v['LINKFLAGS_cxxprogram']=['-Wl,-brtl']
v['cxxprogram_PATTERN']='%s'
v['CXXFLAGS_cxxshlib']=['-fPIC']
v['LINKFLAGS_cxxshlib']=['-G','-Wl,-brtl,-bexpfull']
v['cxxshlib_PATTERN']='lib%s.so'
v['LINKFLAGS_cxxstlib']=''
v['cxxstlib_PATTERN']='lib%s.a'
configure='''
find_xlcxx
find_ar
xlcxx_common_flags
cxx_load_tools
cxx_add_flags
link_add_flags
'''
conf(find_xlcxx)
conf(xlcxx_common_flags)
示例13: len
out,err=fc_config.getoutput(conf,cmd,stdin=True)
if out.find('__GNUC__')<0:
conf.fatal('Could not determine the compiler type')
k={}
out=out.split('\n')
import shlex
for line in out:
lst=shlex.split(line)
if len(lst)>2:
key=lst[1]
val=lst[2]
k[key]=val
def isD(var):
return var in k
def isT(var):
return var in k and k[var]!='0'
conf.env['FC_VERSION']=(k['__GNUC__'],k['__GNUC_MINOR__'],k['__GNUC_PATCHLEVEL__'])
def configure(conf):
conf.find_gfortran()
conf.find_ar()
conf.fc_flags()
conf.gfortran_flags()
conf.gfortran_modifier_platform()
conf(find_gfortran)
conf(gfortran_flags)
conf(gfortran_modifier_win32)
conf(gfortran_modifier_cygwin)
conf(gfortran_modifier_darwin)
conf(gfortran_modifier_platform)
conf(get_gfortran_version)
示例14: gxx_modifier_aix
v['SHLIB_MARKER']=''
v['STLIB_MARKER']=''
v['SONAME_ST']=''
def gxx_modifier_aix(conf):
v=conf.env
v['LINKFLAGS_cxxprogram']=['-Wl,-brtl']
v['LINKFLAGS_cxxshlib']=['-shared','-Wl,-brtl,-bexpfull']
v['SHLIB_MARKER']=''
def gxx_modifier_hpux(conf):
conf.env.cxxshlib_PATTERN='lib%s.sl'
def gxx_modifier_platform(conf):
gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None)
if gxx_modifier_func:
gxx_modifier_func()
def configure(conf):
conf.find_gxx()
conf.find_ar()
conf.gxx_common_flags()
conf.gxx_modifier_platform()
conf.cxx_load_tools()
conf.cxx_add_flags()
conf.link_add_flags()
conf(find_gxx)
conf(gxx_common_flags)
conf(gxx_modifier_win32)
conf(gxx_modifier_cygwin)
conf(gxx_modifier_darwin)
conf(gxx_modifier_aix)
conf(gxx_modifier_hpux)
conf(gxx_modifier_platform)
示例15: irixcc_common_flags
except:
conf.fatal('%r -version could not be executed'%cc)
v['CC']=cc
v['CC_NAME']='irix'
def irixcc_common_flags(conf):
v=conf.env
v['CC_SRC_F']=''
v['CC_TGT_F']=['-c','-o']
v['CPPPATH_ST']='-I%s'
v['DEFINES_ST']='-D%s'
if not v['LINK_CC']:v['LINK_CC']=v['CC']
v['CCLNK_SRC_F']=''
v['CCLNK_TGT_F']=['-o']
v['LIB_ST']='-l%s'
v['LIBPATH_ST']='-L%s'
v['STLIB_ST']='-l%s'
v['STLIBPATH_ST']='-L%s'
v['cprogram_PATTERN']='%s'
v['cshlib_PATTERN']='lib%s.so'
v['cstlib_PATTERN']='lib%s.a'
def configure(conf):
conf.find_irixcc()
conf.find_cpp()
conf.find_ar()
conf.irixcc_common_flags()
conf.cc_load_tools()
conf.cc_add_flags()
conf.link_add_flags()
conf(find_irixcc)
conf(irixcc_common_flags)