Changeset c101fe1 for waflib/Tools
- Timestamp:
- Nov 13, 2013, 1:00:56 PM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- d3066e2
- Parents:
- 54e74f0
- Location:
- waflib/Tools
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
waflib/Tools/c_config.py
r54e74f0 rc101fe1 600 600 if out.find('__INTEL_COMPILER')>=0: 601 601 conf.fatal('The intel compiler pretends to be gcc') 602 if out.find('__GNUC__')<0 :602 if out.find('__GNUC__')<0 and out.find('__clang__')<0: 603 603 conf.fatal('Could not determine the compiler type') 604 604 if icc and out.find('__INTEL_COMPILER')<0: … … 630 630 if isD('__ELF__'): 631 631 conf.env.DEST_BINFMT='elf' 632 elif isD('__WINNT__')or isD('__CYGWIN__') :632 elif isD('__WINNT__')or isD('__CYGWIN__')or isD('_WIN32'): 633 633 conf.env.DEST_BINFMT='pe' 634 conf.env.LIBDIR=conf.env ['PREFIX']+'/bin'634 conf.env.LIBDIR=conf.env.BINDIR 635 635 elif isD('__APPLE__'): 636 636 conf.env.DEST_BINFMT='mac-o' … … 667 667 else: 668 668 conf.fatal('Could not determine the XLC version.') 669 @conf 670 def get_suncc_version(conf,cc): 671 cmd=cc+['-V'] 672 try: 673 out,err=conf.cmd_and_log(cmd,output=0) 674 except Errors.WafError: 675 conf.fatal('Could not find suncc %r'%cmd) 676 version=(out or err) 677 version=version.split('\n')[0] 678 version_re=re.compile(r'cc:\s+sun\s+(c\+\+|c)\s+(?P<major>\d*)\.(?P<minor>\d*)',re.I).search 679 match=version_re(version) 680 if match: 681 k=match.groupdict() 682 conf.env['CC_VERSION']=(k['major'],k['minor']) 683 else: 684 conf.fatal('Could not determine the suncc version.') 669 685 @conf 670 686 def add_as_needed(self): -
waflib/Tools/c_preproc.py
r54e74f0 rc101fe1 22 22 re_pragma_once=re.compile('^\s*once\s*',re.IGNORECASE) 23 23 re_nl=re.compile('\\\\\r*\n',re.MULTILINE) 24 re_cpp=re.compile(r """(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)""",re.MULTILINE)24 re_cpp=re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',re.DOTALL|re.MULTILINE) 25 25 trig_def=[('??'+a,b)for a,b in zip("=-/!'()<>",r'#~\|^[]{}')] 26 26 chr_esc={'0':0,'a':7,'b':8,'t':9,'n':10,'f':11,'v':12,'r':13,'\\':92,"'":39} … … 38 38 skipped='s' 39 39 def repl(m): 40 s=m.group( 1)41 if s :40 s=m.group(0) 41 if s.startswith('/'): 42 42 return' ' 43 return m.group(3)or''43 return s 44 44 def filter_comments(filename): 45 45 code=Utils.readf(filename) … … 476 476 break 477 477 found=self.cached_find_resource(n,filename) 478 if found :478 if found and not found in self.ban_includes: 479 479 self.nodes.append(found) 480 480 if filename[-4:]!='.moc': … … 519 519 bld.parse_cache={} 520 520 self.parse_cache=bld.parse_cache 521 self.current_file=node 521 522 self.addlines(node) 522 523 if env['DEFINES']: … … 558 559 elif token=='include'or token=='import': 559 560 (kind,inc)=extract_include(line,self.defs) 560 if inc in self.ban_includes:561 continue562 if token=='import':self.ban_includes.add(inc)563 561 if ve:debug('preproc: include found %s (%s) ',inc,kind) 564 562 if kind=='"'or not strict_quotes: 565 self.tryfind(inc) 563 self.current_file=self.tryfind(inc) 564 if token=='import': 565 self.ban_includes.add(self.current_file) 566 566 elif token=='elif': 567 567 if state[-1]==accepted: … … 584 584 elif token=='pragma': 585 585 if re_pragma_once.match(line.lower()): 586 self.ban_includes.add(self.cur file)586 self.ban_includes.add(self.current_file) 587 587 except Exception ,e: 588 588 if Logs.verbose: -
waflib/Tools/ccroot.py
r54e74f0 rc101fe1 3 3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file 4 4 5 import os 5 import os,re 6 6 from waflib import Task,Utils,Node,Errors 7 7 from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension … … 71 71 pattern='%s' 72 72 folder,name=os.path.split(target) 73 if self.__class__.__name__.find('shlib')>0: 74 if self.env.DEST_BINFMT=='pe'and getattr(self.generator,'vnum',None): 75 name=name+'-'+self.generator.vnum.split('.')[0] 73 if self.__class__.__name__.find('shlib')>0 and getattr(self.generator,'vnum',None): 74 nums=self.generator.vnum.split('.') 75 if self.env.DEST_BINFMT=='pe': 76 name=name+'-'+nums[0] 77 elif self.env.DEST_OS=='openbsd': 78 pattern='%s.%s.%s'%(pattern,nums[0],nums[1]) 76 79 tmp=folder+os.sep+pattern%name 77 80 target=self.generator.path.find_or_declare(tmp) … … 198 201 if getattr(y,'export_includes',None): 199 202 self.includes.extend(y.to_incnodes(y.export_includes)) 203 if getattr(y,'export_defines',None): 204 self.env.append_value('DEFINES',self.to_list(y.export_defines)) 200 205 for x in names: 201 206 try: … … 274 279 return 275 280 self.implib_install_task=self.bld.install_as('${LIBDIR}/%s'%implib.name,implib,self.env) 281 re_vnum=re.compile('^([1-9]\\d*|0)[.]([1-9]\\d*|0)[.]([1-9]\\d*|0)$') 276 282 @feature('cshlib','cxxshlib','dshlib','fcshlib','vnum') 277 283 @after_method('apply_link','propagate_uselib_vars') … … 280 286 return 281 287 link=self.link_task 288 if not re_vnum.match(self.vnum): 289 raise Errors.WafError('Invalid version %r for %r'%(self.vnum,self)) 282 290 nums=self.vnum.split('.') 283 291 node=link.outputs[0] … … 292 300 v=self.env.SONAME_ST%name2 293 301 self.env.append_value('LINKFLAGS',v.split()) 294 self.create_task('vnum',node,[node.parent.find_or_declare(name2),node.parent.find_or_declare(name3)]) 302 if self.env.DEST_OS!='openbsd': 303 self.create_task('vnum',node,[node.parent.find_or_declare(name2),node.parent.find_or_declare(name3)]) 295 304 if getattr(self,'install_task',None): 296 305 self.install_task.hasrun=Task.SKIP_ME 297 306 bld=self.bld 298 307 path=self.install_task.dest 299 t1=bld.install_as(path+os.sep+name3,node,env=self.env,chmod=self.link_task.chmod) 300 t2=bld.symlink_as(path+os.sep+name2,name3) 301 t3=bld.symlink_as(path+os.sep+libname,name3) 302 self.vnum_install_task=(t1,t2,t3) 308 if self.env.DEST_OS=='openbsd': 309 libname=self.link_task.outputs[0].name 310 t1=bld.install_as('%s%s%s'%(path,os.sep,libname),node,env=self.env,chmod=self.link_task.chmod) 311 self.vnum_install_task=(t1,) 312 else: 313 t1=bld.install_as(path+os.sep+name3,node,env=self.env,chmod=self.link_task.chmod) 314 t2=bld.symlink_as(path+os.sep+name2,name3) 315 t3=bld.symlink_as(path+os.sep+libname,name3) 316 self.vnum_install_task=(t1,t2,t3) 303 317 if'-dynamiclib'in self.env['LINKFLAGS']: 304 318 try: … … 342 356 return Task.SKIP_ME 343 357 @conf 344 def read_shlib(self,name,paths=[] ):345 return self(name=name,features='fake_lib',lib_paths=paths,lib_type='shlib' )358 def read_shlib(self,name,paths=[],export_includes=[],export_defines=[]): 359 return self(name=name,features='fake_lib',lib_paths=paths,lib_type='shlib',export_includes=export_includes,export_defines=export_defines) 346 360 @conf 347 def read_stlib(self,name,paths=[] ):348 return self(name=name,features='fake_lib',lib_paths=paths,lib_type='stlib' )361 def read_stlib(self,name,paths=[],export_includes=[],export_defines=[]): 362 return self(name=name,features='fake_lib',lib_paths=paths,lib_type='stlib',export_includes=export_includes,export_defines=export_defines) 349 363 lib_patterns={'shlib':['lib%s.so','%s.so','lib%s.dylib','lib%s.dll','%s.dll'],'stlib':['lib%s.a','%s.a','lib%s.dll','%s.dll','lib%s.lib','%s.lib'],} 350 364 @feature('fake_lib') -
waflib/Tools/cs.py
r54e74f0 rc101fe1 104 104 for x in('/r:','/reference:','/resource:','/lib:','/out:'): 105 105 if flag.startswith(x): 106 flag='%s"%s"'%(x, flag[len(x):])106 flag='%s"%s"'%(x,'","'.join(flag[len(x):].split(','))) 107 107 break 108 108 else: -
waflib/Tools/fc_config.py
r54e74f0 rc101fe1 52 52 def fortran_modifier_darwin(conf): 53 53 v=conf.env 54 v['FCFLAGS_fcshlib']=['-fPIC' ,'-compatibility_version','1','-current_version','1']55 v['LINKFLAGS_fcshlib']=['-dynamiclib' ]54 v['FCFLAGS_fcshlib']=['-fPIC'] 55 v['LINKFLAGS_fcshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1'] 56 56 v['fcshlib_PATTERN']='lib%s.dylib' 57 57 v['FRAMEWORKPATH_ST']='-F%s' -
waflib/Tools/gcc.py
r54e74f0 rc101fe1 3 3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file 4 4 5 import os,sys6 from waflib import Configure,Options,Utils7 5 from waflib.Tools import ccroot,ar 8 6 from waflib.Configure import conf … … 60 58 def gcc_modifier_darwin(conf): 61 59 v=conf.env 62 v['CFLAGS_cshlib']=['-fPIC' ,'-compatibility_version','1','-current_version','1']63 v['LINKFLAGS_cshlib']=['-dynamiclib' ]60 v['CFLAGS_cshlib']=['-fPIC'] 61 v['LINKFLAGS_cshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1'] 64 62 v['cshlib_PATTERN']='lib%s.dylib' 65 63 v['FRAMEWORKPATH_ST']='-F%s' … … 84 82 v['cshlib_PATTERN']='lib%s.sl' 85 83 @conf 84 def gcc_modifier_openbsd(conf): 85 conf.env.SONAME_ST=[] 86 @conf 86 87 def gcc_modifier_platform(conf): 87 88 gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None) -
waflib/Tools/gxx.py
r54e74f0 rc101fe1 3 3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file 4 4 5 import os,sys6 from waflib import Configure,Options,Utils7 5 from waflib.Tools import ccroot,ar 8 6 from waflib.Configure import conf … … 60 58 def gxx_modifier_darwin(conf): 61 59 v=conf.env 62 v['CXXFLAGS_cxxshlib']=['-fPIC' ,'-compatibility_version','1','-current_version','1']63 v['LINKFLAGS_cxxshlib']=['-dynamiclib' ]60 v['CXXFLAGS_cxxshlib']=['-fPIC'] 61 v['LINKFLAGS_cxxshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1'] 64 62 v['cxxshlib_PATTERN']='lib%s.dylib' 65 63 v['FRAMEWORKPATH_ST']='-F%s' … … 84 82 v['cxxshlib_PATTERN']='lib%s.sl' 85 83 @conf 84 def gxx_modifier_openbsd(conf): 85 conf.env.SONAME_ST=[] 86 @conf 86 87 def gxx_modifier_platform(conf): 87 88 gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None) -
waflib/Tools/javaw.py
r54e74f0 rc101fe1 203 203 finally: 204 204 if tmp: 205 os. unlink(tmp)205 os.remove(tmp) 206 206 return ret 207 207 def post_run(self): … … 271 271 shutil.rmtree(javatestdir,True) 272 272 os.mkdir(javatestdir) 273 java_file=open(os.path.join(javatestdir,'Test.java'),'w') 274 java_file.write(class_check_source) 275 java_file.close() 273 Utils.writef(os.path.join(javatestdir,'Test.java'),class_check_source) 276 274 self.exec_command(self.env['JAVAC']+[os.path.join(javatestdir,'Test.java')],shell=False) 277 275 cmd=self.env['JAVA']+['-cp',classpath,'Test',classname] -
waflib/Tools/msvc.py
r54e74f0 rc101fe1 4 4 5 5 import os,sys,re,tempfile 6 from waflib import Utils,Task,Logs,Options 6 from waflib import Utils,Task,Logs,Options,Errors 7 7 from waflib.Logs import debug,warn 8 8 from waflib.TaskGen import after_method,feature … … 29 29 wintrust wldap32 wmiutils wow32 ws2_32 wsnmp32 wsock32 wst wtsapi32 xaswitch xolehlp 30 30 '''.split() 31 all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64') ]31 all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64'),('x86_arm','arm')] 32 32 all_wince_platforms=[('armv4','arm'),('armv4i','arm'),('mipsii','mips'),('mipsii_fp','mips'),('mipsiv','mips'),('mipsiv_fp','mips'),('sh4','sh'),('x86','cex86')] 33 33 all_icl_platforms=[('intel64','amd64'),('em64t','amd64'),('ia32','x86'),('Itanium','ia64')] … … 67 67 echo PATH=%%PATH%% 68 68 echo INCLUDE=%%INCLUDE%% 69 echo LIB=%%LIB%% 69 echo LIB=%%LIB%%;%%LIBPATH%% 70 70 """%(vcvars,target)) 71 71 sout=conf.cmd_and_log(['cmd','/E:on','/V:on','/C',batfile.abspath()]) … … 73 73 if not lines[0]: 74 74 lines.pop(0) 75 if version=='11.0':76 if lines[0].startswith('Error'):77 conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_1)')78 else:79 for x in('Setting environment','Setting SDK environment','Intel(R) C++ Compiler','Intel Parallel Studio','Intel(R) Parallel Studio','Intel(R) Composer','Intel Corporation. All rights reserved.'):80 if lines[0].find(x)>-1:81 lines.pop(0)82 break83 else:84 debug('msvc: get_msvc_version: %r %r %r -> not found',compiler,version,target)85 conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_2)')86 75 MSVC_PATH=MSVC_INCDIR=MSVC_LIBDIR=None 87 76 for line in lines: … … 233 222 except conf.errors.ConfigurationError: 234 223 pass 235 versions.append(('msvc '+version,targets)) 224 if targets: 225 versions.append(('msvc '+version,targets)) 236 226 @conf 237 227 def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platforms): … … 254 244 versions.append((device+' '+version,cetargets)) 255 245 @conf 246 def gather_winphone_targets(conf,versions,version,vc_path,vsvars): 247 targets=[] 248 for target,realtarget in all_msvc_platforms[::-1]: 249 try: 250 targets.append((target,(realtarget,conf.get_msvc_version('winphone',version,target,vsvars)))) 251 except conf.errors.ConfigurationError ,e: 252 pass 253 if targets: 254 versions.append(('winphone '+version,targets)) 255 @conf 256 256 def gather_msvc_versions(conf,versions): 257 257 vc_paths=[] … … 272 272 if wince_supported_platforms and os.path.isfile(vsvars): 273 273 conf.gather_wince_targets(versions,version,vc_path,vsvars,wince_supported_platforms) 274 vsvars=os.path.join(vs_path,'VC','WPSDK','WP80','vcvarsphoneall.bat') 275 if os.path.isfile(vsvars): 276 conf.gather_winphone_targets(versions,'8.0',vc_path,vsvars) 274 277 for version,vc_path in vc_paths: 275 278 vs_path=os.path.dirname(vc_path) … … 370 373 patch_url='http://software.intel.com/en-us/forums/topic/328487' 371 374 compilervars_arch=os.path.join(path,'bin','compilervars_arch.bat') 372 vs_express_path=os.environ['VS110COMNTOOLS']+r'..\IDE\VSWinExpress.exe' 373 dev_env_path=os.environ['VS110COMNTOOLS']+r'..\IDE\devenv.exe' 374 if(r'if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"'in Utils.readf(compilervars_arch)and not os.path.exists(vs_express_path)and not os.path.exists(dev_env_path)): 375 Logs.warn(('The Intel compilervar_arch.bat only checks for one Visual Studio SKU ''(VSWinExpress.exe) but it does not seem to be installed at %r. ''The intel command line set up will fail to configure unless the file %r''is patched. See: %s')%(vs_express_path,compilervars_arch,patch_url)) 375 for vscomntool in['VS110COMNTOOLS','VS100COMNTOOLS']: 376 if vscomntool in os.environ: 377 vs_express_path=os.environ[vscomntool]+r'..\IDE\VSWinExpress.exe' 378 dev_env_path=os.environ[vscomntool]+r'..\IDE\devenv.exe' 379 if(r'if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"'in Utils.readf(compilervars_arch)and not os.path.exists(vs_express_path)and not os.path.exists(dev_env_path)): 380 Logs.warn(('The Intel compilervar_arch.bat only checks for one Visual Studio SKU ''(VSWinExpress.exe) but it does not seem to be installed at %r. ''The intel command line set up will fail to configure unless the file %r''is patched. See: %s')%(vs_express_path,compilervars_arch,patch_url)) 376 381 except WindowsError: 377 382 pass … … 545 550 conf.find_program('MT',path_list=path,var='MT') 546 551 v['MTFLAGS']=['/NOLOGO'] 547 conf.load('winres') 548 if not conf.env['WINRC']: 552 try: 553 conf.load('winres') 554 except Errors.WafError: 549 555 warn('Resource compiler not found. Compiling resource file is disabled') 550 556 @conf … … 564 570 v['CC_SRC_F']='' 565 571 v['CC_TGT_F']=['/c','/Fo'] 566 if v['MSVC_VERSION']>=8:567 v['CC_TGT_F']=['/FC']+v['CC_TGT_F']568 572 v['CXX_SRC_F']='' 569 573 v['CXX_TGT_F']=['/c','/Fo'] 570 if v['MSVC_VERSION']>=8: 574 if(v.MSVC_COMPILER=='msvc'and v.MSVC_VERSION>=8)or(v.MSVC_COMPILER=='wsdk'and v.MSVC_VERSION>=6): 575 v['CC_TGT_F']=['/FC']+v['CC_TGT_F'] 571 576 v['CXX_TGT_F']=['/FC']+v['CXX_TGT_F'] 572 577 v['CPPPATH_ST']='/I%s' … … 682 687 return ret 683 688 def exec_command_msvc(self,*k,**kw): 684 assert self.env['CC_NAME']=='msvc'685 689 if isinstance(k[0],list): 686 690 lst=[] … … 725 729 for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split(): 726 730 wrap_class(k) 731 def make_winapp(self,family): 732 append=self.env.append_unique 733 append('DEFINES','WINAPI_FAMILY=%s'%family) 734 append('CXXFLAGS','/ZW') 735 append('CXXFLAGS','/TP') 736 for lib_path in self.env.LIBPATH: 737 append('CXXFLAGS','/AI%s'%lib_path) 738 @feature('winphoneapp') 739 @after_method('process_use') 740 @after_method('propagate_uselib_vars') 741 def make_winphone_app(self): 742 make_winapp(self,'WINAPI_FAMILY_PHONE_APP') 743 conf.env.append_unique('LINKFLAGS','/NODEFAULTLIB:ole32.lib') 744 conf.env.append_unique('LINKFLAGS','PhoneAppModelHost.lib') 745 @feature('winapp') 746 @after_method('process_use') 747 @after_method('propagate_uselib_vars') 748 def make_windows_app(self): 749 make_winapp(self,'WINAPI_FAMILY_DESKTOP_APP') -
waflib/Tools/python.py
r54e74f0 rc101fe1 171 171 conf.parse_flags(all_flags,'PYEXT') 172 172 result=None 173 for name in('python'+env['PYTHON_VERSION'],'python'+env['PYTHON_VERSION'] .replace('.','')):173 for name in('python'+env['PYTHON_VERSION'],'python'+env['PYTHON_VERSION']+'m','python'+env['PYTHON_VERSION'].replace('.','')): 174 174 if not result and env['LIBPATH_PYEMBED']: 175 175 path=env['LIBPATH_PYEMBED'] … … 231 231 except conf.errors.ConfigurationError: 232 232 xx=conf.env.CXX_NAME and'cxx'or'c' 233 conf.check_cfg(msg='Asking python-config for the flags (pyembed)',path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEMBED',args=['--cflags','--libs','--ldflags']) 233 flags=['--cflags','--libs','--ldflags'] 234 for f in flags: 235 conf.check_cfg(msg='Asking python-config for pyembed %s flags'%f,path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEMBED',args=[f]) 234 236 conf.check(header_name='Python.h',define_name='HAVE_PYTHON_H',msg='Getting pyembed flags from python-config',fragment=FRAG,errmsg='Could not build a python embedded interpreter',features='%s %sprogram pyembed'%(xx,xx)) 235 conf.check_cfg(msg='Asking python-config for the flags (pyext)',path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEXT',args=['--cflags','--libs','--ldflags']) 237 for f in flags: 238 conf.check_cfg(msg='Asking python-config for pyext %s flags'%f,path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEXT',args=[f]) 236 239 conf.check(header_name='Python.h',define_name='HAVE_PYTHON_H',msg='Getting pyext flags from python-config',features='%s %sshlib pyext'%(xx,xx),fragment=FRAG,errmsg='Could not build python extensions') 237 240 @conf -
waflib/Tools/qt4.py
r54e74f0 rc101fe1 21 21 EXT_UI=['.ui'] 22 22 EXT_QT4=['.cpp','.cc','.cxx','.C'] 23 QT4_LIBS="QtCore QtGui QtUiTools QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtXmlPatterns QtWebKit Qt3Support QtHelp QtScript QtDeclarative "24 class qxx( cxx.cxx):23 QT4_LIBS="QtCore QtGui QtUiTools QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtXmlPatterns QtWebKit Qt3Support QtHelp QtScript QtDeclarative QtDesigner" 24 class qxx(Task.classes['cxx']): 25 25 def __init__(self,*k,**kw): 26 26 Task.Task.__init__(self,*k,**kw) … … 28 28 def scan(self): 29 29 (nodes,names)=c_preproc.scan(self) 30 lst=[] 30 31 for x in nodes: 31 32 if x.name.endswith('.moc'): 32 nodes.remove(x) 33 names.append(x.path_from(self.inputs[0].parent.get_bld())) 34 return(nodes,names) 33 s=x.path_from(self.inputs[0].parent.get_bld()) 34 if s not in names: 35 names.append(s) 36 else: 37 lst.append(x) 38 return(lst,names) 35 39 def runnable_status(self): 36 40 if self.moc_done: … … 42 46 self.add_moc_tasks() 43 47 return Task.Task.runnable_status(self) 48 def create_moc_task(self,h_node,m_node): 49 try: 50 moc_cache=self.generator.bld.moc_cache 51 except AttributeError: 52 moc_cache=self.generator.bld.moc_cache={} 53 try: 54 return moc_cache[h_node] 55 except KeyError: 56 tsk=moc_cache[h_node]=Task.classes['moc'](env=self.env,generator=self.generator) 57 tsk.set_inputs(h_node) 58 tsk.set_outputs(m_node) 59 gen=self.generator.bld.producer 60 gen.outstanding.insert(0,tsk) 61 gen.total+=1 62 return tsk 44 63 def add_moc_tasks(self): 45 64 node=self.inputs[0] … … 91 110 raise Errors.WafError('no header found for %r which is a moc file'%d) 92 111 bld.node_deps[(self.inputs[0].parent.abspath(),m_node.name)]=h_node 93 task=Task.classes['moc'](env=self.env,generator=self.generator) 94 task.set_inputs(h_node) 95 task.set_outputs(m_node) 96 gen=bld.producer 97 gen.outstanding.insert(0,task) 98 gen.total+=1 112 task=self.create_moc_task(h_node,m_node) 99 113 moctasks.append(task) 100 114 tmp_lst=bld.raw_deps[self.uid()]=mocfiles … … 103 117 name=d.name 104 118 if name.endswith('.moc'): 105 task=Task.classes['moc'](env=self.env,generator=self.generator) 106 task.set_inputs(bld.node_deps[(self.inputs[0].parent.abspath(),name)]) 107 task.set_outputs(d) 108 gen=bld.producer 109 gen.outstanding.insert(0,task) 110 gen.total+=1 119 task=self.create_moc_task(bld.node_deps[(self.inputs[0].parent.abspath(),name)],d) 111 120 moctasks.append(task) 112 121 self.run_after.update(set(moctasks)) … … 176 185 else: 177 186 lst.append(flag) 178 self.env ['MOC_FLAGS']=lst187 self.env.append_value('MOC_FLAGS',lst) 179 188 @extension(*EXT_QT4) 180 189 def cxx_hook(self,node): … … 225 234 self.find_qt4_binaries() 226 235 self.set_qt4_libs_to_check() 236 self.set_qt4_defines() 227 237 self.find_qt4_libraries() 228 238 self.add_qt4_rpath() … … 406 416 def add_qt4_rpath(self): 407 417 env=self.env 408 if Options.options.want_rpath:418 if getattr(Options.options,'want_rpath',False): 409 419 def process_rpath(vars_,coreval): 410 420 for d in vars_: … … 430 440 self.qt4_vars_debug=[a+'_debug'for a in self.qt4_vars] 431 441 self.qt4_vars_debug=Utils.to_list(self.qt4_vars_debug) 442 @conf 443 def set_qt4_defines(self): 444 if sys.platform!='win32': 445 return 446 for x in self.qt4_vars: 447 y=x[2:].upper() 448 self.env.append_unique('DEFINES_%s'%x.upper(),'QT_%s_LIB'%y) 449 self.env.append_unique('DEFINES_%s_DEBUG'%x.upper(),'QT_%s_LIB'%y) 432 450 def options(opt): 433 451 opt.add_option('--want-rpath',action='store_true',default=False,dest='want_rpath',help='enable the rpath for qt libraries') -
waflib/Tools/suncc.py
r54e74f0 rc101fe1 22 22 v['CC']=cc 23 23 v['CC_NAME']='sun' 24 conf.get_suncc_version(cc) 24 25 @conf 25 26 def scc_common_flags(conf): -
waflib/Tools/suncxx.py
r54e74f0 rc101fe1 23 23 v['CXX']=cc 24 24 v['CXX_NAME']='sun' 25 conf.get_suncc_version(cc) 25 26 @conf 26 27 def sxx_common_flags(conf): -
waflib/Tools/tex.py
r54e74f0 rc101fe1 79 79 Logs.debug('tex: trying %s%s'%(path,k)) 80 80 found=node.parent.find_resource(path+k) 81 if found and not found in self.outputs: 81 for tsk in self.generator.tasks: 82 if not found or found in tsk.outputs: 83 break 84 else: 82 85 nodes.append(found) 83 86 add_name=False … … 97 100 raise Errors.WafError("%r command exit status %r"%(msg,retcode)) 98 101 def bibfile(self): 99 need_bibtex=False 100 try: 101 for aux_node in self.aux_nodes: 102 for aux_node in self.aux_nodes: 103 try: 102 104 ct=aux_node.read() 103 if g_bibtex_re.findall(ct): 104 need_bibtex=True 105 break 106 except(OSError,IOError): 107 Logs.error('error bibtex scan') 108 else: 109 if need_bibtex: 105 except(OSError,IOError): 106 Logs.error('Error reading %s: %r'%aux_node.abspath()) 107 continue 108 if g_bibtex_re.findall(ct): 110 109 Logs.warn('calling bibtex') 111 110 self.env.env={} 112 111 self.env.env.update(os.environ) 113 112 self.env.env.update({'BIBINPUTS':self.TEXINPUTS,'BSTINPUTS':self.TEXINPUTS}) 114 self.env.SRCFILE= self.aux_nodes[0].name[:-4]113 self.env.SRCFILE=aux_node.name[:-4] 115 114 self.check_status('error when calling bibtex',self.bibtex_fun()) 116 115 def bibunits(self): … … 139 138 self.env.env={} 140 139 self.check_status('error when calling makeindex %s'%idx_path,self.makeindex_fun()) 140 def bibtopic(self): 141 p=self.inputs[0].parent.get_bld() 142 if os.path.exists(os.path.join(p.abspath(),'btaux.aux')): 143 self.aux_nodes+=p.ant_glob('*[0-9].aux') 141 144 def run(self): 142 145 env=self.env … … 159 162 self.aux_nodes=self.scan_aux(node.change_ext('.aux')) 160 163 self.idx_node=node.change_ext('.idx') 164 self.bibtopic() 161 165 self.bibfile() 162 166 self.bibunits() … … 230 234 except KeyError: 231 235 tree.node_deps[task.uid()]=deps_lst 236 v=dict(os.environ) 237 p=node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()+os.pathsep+v.get('TEXINPUTS','')+os.pathsep 238 v['TEXINPUTS']=p 232 239 if self.type=='latex': 233 240 if'ps'in outs: 234 241 tsk=self.create_task('dvips',task.outputs,node.change_ext('.ps')) 235 tsk.env.env= {'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()}242 tsk.env.env=dict(v) 236 243 if'pdf'in outs: 237 244 tsk=self.create_task('dvipdf',task.outputs,node.change_ext('.pdf')) 238 tsk.env.env= {'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()}245 tsk.env.env=dict(v) 239 246 elif self.type=='pdflatex': 240 247 if'ps'in outs: -
waflib/Tools/waf_unit_test.py
r54e74f0 rc101fe1 37 37 for tg in g: 38 38 if getattr(tg,'link_task',None): 39 lst.append(tg.link_task.outputs[0].parent.abspath()) 39 s=tg.link_task.outputs[0].parent.abspath() 40 if s not in lst: 41 lst.append(s) 40 42 def add_path(dct,path,var): 41 43 dct[var]=os.pathsep.join(Utils.to_list(path)+[os.environ.get(var,'')])
Note: See TracChangeset
for help on using the changeset viewer.