Changeset c101fe1


Ignore:
Timestamp:
Nov 13, 2013, 1:00:56 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

waf, waflib: update to 1.7.13

Files:
23 edited

Legend:

Unmodified
Added
Removed
  • waf

    r54e74f0 rc101fe1  
    3333import os, sys
    3434
    35 VERSION="1.7.9"
    36 REVISION="b503f38d25464d88953a601c8cd0ace6"
     35VERSION="1.7.13"
     36REVISION="5a064c2686fe54de4e11018d22148cfc"
    3737INSTALL=''
    38 C1='#='
    39 C2='#+'
     38C1='#('
     39C2='#$'
    4040cwd = os.getcwd()
    4141join = os.path.join
     
    109109                fixpy2.fixdir(dir)
    110110
    111         os.unlink(tmp)
     111        os.remove(tmp)
    112112        os.chdir(cwd)
    113113
  • waflib/Build.py

    r54e74f0 rc101fe1  
    133133                        for t in env['tools']:
    134134                                self.setup(**t)
    135                 f=None
    136                 try:
    137                         dbfn=os.path.join(self.variant_dir,Context.DBFILE)
     135                dbfn=os.path.join(self.variant_dir,Context.DBFILE)
     136                try:
     137                        data=Utils.readf(dbfn,'rb')
     138                except(IOError,EOFError):
     139                        Logs.debug('build: Could not load the build cache %s (missing)'%dbfn)
     140                else:
    138141                        try:
    139                                 f=open(dbfn,'rb')
    140                         except(IOError,EOFError):
    141                                 Logs.debug('build: Could not load the build cache %s (missing)'%dbfn)
    142                         else:
     142                                waflib.Node.pickle_lock.acquire()
     143                                waflib.Node.Nod3=self.node_class
    143144                                try:
    144                                         waflib.Node.pickle_lock.acquire()
    145                                         waflib.Node.Nod3=self.node_class
    146                                         try:
    147                                                 data=cPickle.load(f)
    148                                         except Exception ,e:
    149                                                 Logs.debug('build: Could not pickle the build cache %s: %r'%(dbfn,e))
    150                                         else:
    151                                                 for x in SAVED_ATTRS:
    152                                                         setattr(self,x,data[x])
    153                                 finally:
    154                                         waflib.Node.pickle_lock.release()
    155                 finally:
    156                         if f:
    157                                 f.close()
     145                                        data=cPickle.loads(data)
     146                                except Exception ,e:
     147                                        Logs.debug('build: Could not pickle the build cache %s: %r'%(dbfn,e))
     148                                else:
     149                                        for x in SAVED_ATTRS:
     150                                                setattr(self,x,data[x])
     151                        finally:
     152                                waflib.Node.pickle_lock.release()
    158153                self.init_dirs()
    159154        def store(self):
     
    165160                        waflib.Node.pickle_lock.acquire()
    166161                        waflib.Node.Nod3=self.node_class
    167                         f=None
    168                         try:
    169                                 f=open(db+'.tmp','wb')
    170                                 cPickle.dump(data,f,-1)
    171                         finally:
    172                                 if f:
    173                                         f.close()
     162                        x=cPickle.dumps(data,-1)
    174163                finally:
    175164                        waflib.Node.pickle_lock.release()
     165                Utils.writef(db+'.tmp',x,m='wb')
    176166                try:
    177167                        st=os.stat(db)
    178                         os.unlink(db)
     168                        os.remove(db)
    179169                        if not Utils.is_win32:
    180170                                os.chown(db+'.tmp',st.st_uid,st.st_gid)
     
    482472                        if self.relative_trick:
    483473                                destfile=os.path.join(destpath,y.path_from(self.path))
    484                                 Utils.check_dir(os.path.dirname(destfile))
    485474                        else:
    486475                                destfile=os.path.join(destpath,y.name)
     
    625614                try:
    626615                        if not self.progress_bar:
    627                                 Logs.info('- unlink %s'%tgt)
     616                                Logs.info('- remove %s'%tgt)
    628617                        os.remove(tgt)
    629618                except OSError:
  • waflib/ConfigSet.py

    r54e74f0 rc101fe1  
    121121                except OSError:
    122122                        pass
    123                 f=None
     123                buf=[]
     124                merged_table=self.get_merged_dict()
     125                keys=list(merged_table.keys())
     126                keys.sort()
    124127                try:
    125                         f=open(filename,'w')
    126                         merged_table=self.get_merged_dict()
    127                         keys=list(merged_table.keys())
    128                         keys.sort()
    129                         for k in keys:
    130                                 if k!='undo_stack':
    131                                         f.write('%s = %r\n'%(k,merged_table[k]))
    132                 finally:
    133                         if f:
    134                                 f.close()
     128                        fun=ascii
     129                except NameError:
     130                        fun=repr
     131                for k in keys:
     132                        if k!='undo_stack':
     133                                buf.append('%s = %s\n'%(k,fun(merged_table[k])))
     134                Utils.writef(filename,''.join(buf))
    135135        def load(self,filename):
    136136                tbl=self.table
  • waflib/Context.py

    r54e74f0 rc101fe1  
    66from waflib import Utils,Errors,Logs
    77import waflib.Node
    8 HEXVERSION=0x1070900
    9 WAFVERSION="1.7.9"
    10 WAFREVISION="9e92489dbc008e4abae9c147b1d63b48296797c2"
     8HEXVERSION=0x1070d00
     9WAFVERSION="1.7.13"
     10WAFREVISION="daa91dba4b881d86bc25eec90a3745ebaeece835"
    1111ABI=98
    1212DBFILE='.wafpickle-%s-%d-%d'%(sys.platform,sys.hexversion,ABI)
  • waflib/Logs.py

    r54e74f0 rc101fe1  
    44
    55import os,re,traceback,sys
     6_nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
     7try:
     8        if not _nocolor:
     9                import waflib.ansiterm
     10except ImportError:
     11        pass
    612try:
    713        import threading
    814except ImportError:
    9         pass
     15        if not'JOBS'in os.environ:
     16                os.environ['JOBS']='1'
    1017else:
    1118        wlock=threading.Lock()
     
    2734                def isatty(self):
    2835                        return self.stream.isatty()
    29         _nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
    30         try:
    31                 if not _nocolor:
    32                         import waflib.ansiterm
    33         except ImportError:
    34                 pass
    3536        if not os.environ.get('NOSYNC',False):
    3637                if id(sys.stdout)==id(sys.__stdout__):
  • waflib/Node.py

    r54e74f0 rc101fe1  
    3434**/_darcs
    3535**/_darcs/**
     36**/.intlcache
    3637**/.DS_Store'''
    3738def split_path(path):
     
    9091        def delete(self):
    9192                try:
    92                         if getattr(self,'children',None):
     93                        if hasattr(self,'children'):
    9394                                shutil.rmtree(self.abspath())
    9495                        else:
    95                                 os.unlink(self.abspath())
     96                                os.remove(self.abspath())
    9697                except OSError:
    9798                        pass
     
    328329                                nacc=[]
    329330                        return[nacc,nrej]
    330                 ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=25,dir=dir,src=src,remove=kw.get('remove',True))]
     331                ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=kw.get('maxdepth',25),dir=dir,src=src,remove=kw.get('remove',True))]
    331332                if kw.get('flat',False):
    332333                        return' '.join([x.path_from(self)for x in ret])
  • waflib/Scripting.py

    r54e74f0 rc101fe1  
    165165                                fname=root+os.sep+f
    166166                                try:
    167                                         os.unlink(fname)
     167                                        os.remove(fname)
    168168                                except OSError:
    169169                                        Logs.warn('Could not remove %r'%fname)
    170170        for x in[Context.DBFILE,'config.log']:
    171171                try:
    172                         os.unlink(x)
     172                        os.remove(x)
    173173                except OSError:
    174174                        pass
     
    326326                        cfg=[x for x in sys.argv if x.startswith('-')]
    327327                instdir=tempfile.mkdtemp('.inst',self.get_base_name())
    328                 ret=Utils.subprocess.Popen([sys.argv[0],'configure','install','uninstall','--destdir='+instdir]+cfg,cwd=self.get_base_name()).wait()
     328                ret=Utils.subprocess.Popen([sys.executable,sys.argv[0],'configure','install','uninstall','--destdir='+instdir]+cfg,cwd=self.get_base_name()).wait()
    329329                if ret:
    330330                        raise Errors.WafError('distcheck failed with code %i'%ret)
  • waflib/TaskGen.py

    r54e74f0 rc101fe1  
    306306                        if getattr(self.generator,'chmod',None):
    307307                                os.chmod(self.outputs[0].abspath(),self.generator.chmod)
    308                         return
     308                        return None
     309                if getattr(self.generator,'fun',None):
     310                        self.generator.fun(self)
    309311                code=self.inputs[0].read(encoding=getattr(self.generator,'encoding','ISO8859-1'))
    310312                if getattr(self.generator,'subst_fun',None):
     
    340342                env=self.env
    341343                upd=self.m.update
     344                if getattr(self.generator,'fun',None):
     345                        upd(Utils.h_fun(self.generator.fun))
    342346                if getattr(self.generator,'subst_fun',None):
    343347                        upd(Utils.h_fun(self.generator.subst_fun))
  • waflib/Tools/c_config.py

    r54e74f0 rc101fe1  
    600600                if out.find('__INTEL_COMPILER')>=0:
    601601                        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:
    603603                        conf.fatal('Could not determine the compiler type')
    604604        if icc and out.find('__INTEL_COMPILER')<0:
     
    630630                if isD('__ELF__'):
    631631                        conf.env.DEST_BINFMT='elf'
    632                 elif isD('__WINNT__')or isD('__CYGWIN__'):
     632                elif isD('__WINNT__')or isD('__CYGWIN__')or isD('_WIN32'):
    633633                        conf.env.DEST_BINFMT='pe'
    634                         conf.env.LIBDIR=conf.env['PREFIX']+'/bin'
     634                        conf.env.LIBDIR=conf.env.BINDIR
    635635                elif isD('__APPLE__'):
    636636                        conf.env.DEST_BINFMT='mac-o'
     
    667667        else:
    668668                conf.fatal('Could not determine the XLC version.')
     669@conf
     670def 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.')
    669685@conf
    670686def add_as_needed(self):
  • waflib/Tools/c_preproc.py

    r54e74f0 rc101fe1  
    2222re_pragma_once=re.compile('^\s*once\s*',re.IGNORECASE)
    2323re_nl=re.compile('\\\\\r*\n',re.MULTILINE)
    24 re_cpp=re.compile(r"""(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)""",re.MULTILINE)
     24re_cpp=re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',re.DOTALL|re.MULTILINE)
    2525trig_def=[('??'+a,b)for a,b in zip("=-/!'()<>",r'#~\|^[]{}')]
    2626chr_esc={'0':0,'a':7,'b':8,'t':9,'n':10,'f':11,'v':12,'r':13,'\\':92,"'":39}
     
    3838skipped='s'
    3939def repl(m):
    40         s=m.group(1)
    41         if s:
     40        s=m.group(0)
     41        if s.startswith('/'):
    4242                return' '
    43         return m.group(3)or''
     43        return s
    4444def filter_comments(filename):
    4545        code=Utils.readf(filename)
     
    476476                                break
    477477                        found=self.cached_find_resource(n,filename)
    478                 if found:
     478                if found and not found in self.ban_includes:
    479479                        self.nodes.append(found)
    480480                        if filename[-4:]!='.moc':
     
    519519                        bld.parse_cache={}
    520520                        self.parse_cache=bld.parse_cache
     521                self.current_file=node
    521522                self.addlines(node)
    522523                if env['DEFINES']:
     
    558559                                elif token=='include'or token=='import':
    559560                                        (kind,inc)=extract_include(line,self.defs)
    560                                         if inc in self.ban_includes:
    561                                                 continue
    562                                         if token=='import':self.ban_includes.add(inc)
    563561                                        if ve:debug('preproc: include found %s    (%s) ',inc,kind)
    564562                                        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)
    566566                                elif token=='elif':
    567567                                        if state[-1]==accepted:
     
    584584                                elif token=='pragma':
    585585                                        if re_pragma_once.match(line.lower()):
    586                                                 self.ban_includes.add(self.curfile)
     586                                                self.ban_includes.add(self.current_file)
    587587                        except Exception ,e:
    588588                                if Logs.verbose:
  • waflib/Tools/ccroot.py

    r54e74f0 rc101fe1  
    33# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
    44
    5 import os
     5import os,re
    66from waflib import Task,Utils,Node,Errors
    77from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension
     
    7171                                pattern='%s'
    7272                        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])
    7679                        tmp=folder+os.sep+pattern%name
    7780                        target=self.generator.path.find_or_declare(tmp)
     
    198201                if getattr(y,'export_includes',None):
    199202                        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))
    200205        for x in names:
    201206                try:
     
    274279                return
    275280        self.implib_install_task=self.bld.install_as('${LIBDIR}/%s'%implib.name,implib,self.env)
     281re_vnum=re.compile('^([1-9]\\d*|0)[.]([1-9]\\d*|0)[.]([1-9]\\d*|0)$')
    276282@feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')
    277283@after_method('apply_link','propagate_uselib_vars')
     
    280286                return
    281287        link=self.link_task
     288        if not re_vnum.match(self.vnum):
     289                raise Errors.WafError('Invalid version %r for %r'%(self.vnum,self))
    282290        nums=self.vnum.split('.')
    283291        node=link.outputs[0]
     
    292300                v=self.env.SONAME_ST%name2
    293301                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)])
    295304        if getattr(self,'install_task',None):
    296305                self.install_task.hasrun=Task.SKIP_ME
    297306                bld=self.bld
    298307                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)
    303317        if'-dynamiclib'in self.env['LINKFLAGS']:
    304318                try:
     
    342356                return Task.SKIP_ME
    343357@conf
    344 def read_shlib(self,name,paths=[]):
    345         return self(name=name,features='fake_lib',lib_paths=paths,lib_type='shlib')
     358def 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)
    346360@conf
    347 def read_stlib(self,name,paths=[]):
    348         return self(name=name,features='fake_lib',lib_paths=paths,lib_type='stlib')
     361def 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)
    349363lib_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'],}
    350364@feature('fake_lib')
  • waflib/Tools/cs.py

    r54e74f0 rc101fe1  
    104104                        for x in('/r:','/reference:','/resource:','/lib:','/out:'):
    105105                                if flag.startswith(x):
    106                                         flag='%s"%s"'%(x,flag[len(x):])
     106                                        flag='%s"%s"'%(x,'","'.join(flag[len(x):].split(',')))
    107107                                        break
    108108                        else:
  • waflib/Tools/fc_config.py

    r54e74f0 rc101fe1  
    5252def fortran_modifier_darwin(conf):
    5353        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']
    5656        v['fcshlib_PATTERN']='lib%s.dylib'
    5757        v['FRAMEWORKPATH_ST']='-F%s'
  • waflib/Tools/gcc.py

    r54e74f0 rc101fe1  
    33# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
    44
    5 import os,sys
    6 from waflib import Configure,Options,Utils
    75from waflib.Tools import ccroot,ar
    86from waflib.Configure import conf
     
    6058def gcc_modifier_darwin(conf):
    6159        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']
    6462        v['cshlib_PATTERN']='lib%s.dylib'
    6563        v['FRAMEWORKPATH_ST']='-F%s'
     
    8482        v['cshlib_PATTERN']='lib%s.sl'
    8583@conf
     84def gcc_modifier_openbsd(conf):
     85        conf.env.SONAME_ST=[]
     86@conf
    8687def gcc_modifier_platform(conf):
    8788        gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None)
  • waflib/Tools/gxx.py

    r54e74f0 rc101fe1  
    33# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
    44
    5 import os,sys
    6 from waflib import Configure,Options,Utils
    75from waflib.Tools import ccroot,ar
    86from waflib.Configure import conf
     
    6058def gxx_modifier_darwin(conf):
    6159        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']
    6462        v['cxxshlib_PATTERN']='lib%s.dylib'
    6563        v['FRAMEWORKPATH_ST']='-F%s'
     
    8482        v['cxxshlib_PATTERN']='lib%s.sl'
    8583@conf
     84def gxx_modifier_openbsd(conf):
     85        conf.env.SONAME_ST=[]
     86@conf
    8687def gxx_modifier_platform(conf):
    8788        gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None)
  • waflib/Tools/javaw.py

    r54e74f0 rc101fe1  
    203203                finally:
    204204                        if tmp:
    205                                 os.unlink(tmp)
     205                                os.remove(tmp)
    206206                return ret
    207207        def post_run(self):
     
    271271        shutil.rmtree(javatestdir,True)
    272272        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)
    276274        self.exec_command(self.env['JAVAC']+[os.path.join(javatestdir,'Test.java')],shell=False)
    277275        cmd=self.env['JAVA']+['-cp',classpath,'Test',classname]
  • waflib/Tools/msvc.py

    r54e74f0 rc101fe1  
    44
    55import os,sys,re,tempfile
    6 from waflib import Utils,Task,Logs,Options
     6from waflib import Utils,Task,Logs,Options,Errors
    77from waflib.Logs import debug,warn
    88from waflib.TaskGen import after_method,feature
     
    2929wintrust wldap32 wmiutils wow32 ws2_32 wsnmp32 wsock32 wst wtsapi32 xaswitch xolehlp
    3030'''.split()
    31 all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64')]
     31all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64'),('x86_arm','arm')]
    3232all_wince_platforms=[('armv4','arm'),('armv4i','arm'),('mipsii','mips'),('mipsii_fp','mips'),('mipsiv','mips'),('mipsiv_fp','mips'),('sh4','sh'),('x86','cex86')]
    3333all_icl_platforms=[('intel64','amd64'),('em64t','amd64'),('ia32','x86'),('Itanium','ia64')]
     
    6767echo PATH=%%PATH%%
    6868echo INCLUDE=%%INCLUDE%%
    69 echo LIB=%%LIB%%
     69echo LIB=%%LIB%%;%%LIBPATH%%
    7070"""%(vcvars,target))
    7171        sout=conf.cmd_and_log(['cmd','/E:on','/V:on','/C',batfile.abspath()])
     
    7373        if not lines[0]:
    7474                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                                 break
    83                 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)')
    8675        MSVC_PATH=MSVC_INCDIR=MSVC_LIBDIR=None
    8776        for line in lines:
     
    233222                except conf.errors.ConfigurationError:
    234223                        pass
    235         versions.append(('msvc '+version,targets))
     224        if targets:
     225                versions.append(('msvc '+version,targets))
    236226@conf
    237227def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platforms):
     
    254244                        versions.append((device+' '+version,cetargets))
    255245@conf
     246def 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
    256256def gather_msvc_versions(conf,versions):
    257257        vc_paths=[]
     
    272272                if wince_supported_platforms and os.path.isfile(vsvars):
    273273                        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)
    274277        for version,vc_path in vc_paths:
    275278                vs_path=os.path.dirname(vc_path)
     
    370373                                        patch_url='http://software.intel.com/en-us/forums/topic/328487'
    371374                                        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))
    376381                        except WindowsError:
    377382                                pass
     
    545550                conf.find_program('MT',path_list=path,var='MT')
    546551                v['MTFLAGS']=['/NOLOGO']
    547         conf.load('winres')
    548         if not conf.env['WINRC']:
     552        try:
     553                conf.load('winres')
     554        except Errors.WafError:
    549555                warn('Resource compiler not found. Compiling resource file is disabled')
    550556@conf
     
    564570        v['CC_SRC_F']=''
    565571        v['CC_TGT_F']=['/c','/Fo']
    566         if v['MSVC_VERSION']>=8:
    567                 v['CC_TGT_F']=['/FC']+v['CC_TGT_F']
    568572        v['CXX_SRC_F']=''
    569573        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']
    571576                v['CXX_TGT_F']=['/FC']+v['CXX_TGT_F']
    572577        v['CPPPATH_ST']='/I%s'
     
    682687        return ret
    683688def exec_command_msvc(self,*k,**kw):
    684         assert self.env['CC_NAME']=='msvc'
    685689        if isinstance(k[0],list):
    686690                lst=[]
     
    725729for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split():
    726730        wrap_class(k)
     731def 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')
     741def 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')
     748def make_windows_app(self):
     749        make_winapp(self,'WINAPI_FAMILY_DESKTOP_APP')
  • waflib/Tools/python.py

    r54e74f0 rc101fe1  
    171171        conf.parse_flags(all_flags,'PYEXT')
    172172        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('.','')):
    174174                if not result and env['LIBPATH_PYEMBED']:
    175175                        path=env['LIBPATH_PYEMBED']
     
    231231        except conf.errors.ConfigurationError:
    232232                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])
    234236                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])
    236239                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')
    237240@conf
  • waflib/Tools/qt4.py

    r54e74f0 rc101fe1  
    2121EXT_UI=['.ui']
    2222EXT_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):
     23QT4_LIBS="QtCore QtGui QtUiTools QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtXmlPatterns QtWebKit Qt3Support QtHelp QtScript QtDeclarative QtDesigner"
     24class qxx(Task.classes['cxx']):
    2525        def __init__(self,*k,**kw):
    2626                Task.Task.__init__(self,*k,**kw)
     
    2828        def scan(self):
    2929                (nodes,names)=c_preproc.scan(self)
     30                lst=[]
    3031                for x in nodes:
    3132                        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)
    3539        def runnable_status(self):
    3640                if self.moc_done:
     
    4246                        self.add_moc_tasks()
    4347                        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
    4463        def add_moc_tasks(self):
    4564                node=self.inputs[0]
     
    91110                                raise Errors.WafError('no header found for %r which is a moc file'%d)
    92111                        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)
    99113                        moctasks.append(task)
    100114                tmp_lst=bld.raw_deps[self.uid()]=mocfiles
     
    103117                        name=d.name
    104118                        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)
    111120                                moctasks.append(task)
    112121                self.run_after.update(set(moctasks))
     
    176185                        else:
    177186                                lst.append(flag)
    178         self.env['MOC_FLAGS']=lst
     187        self.env.append_value('MOC_FLAGS',lst)
    179188@extension(*EXT_QT4)
    180189def cxx_hook(self,node):
     
    225234        self.find_qt4_binaries()
    226235        self.set_qt4_libs_to_check()
     236        self.set_qt4_defines()
    227237        self.find_qt4_libraries()
    228238        self.add_qt4_rpath()
     
    406416def add_qt4_rpath(self):
    407417        env=self.env
    408         if Options.options.want_rpath:
     418        if getattr(Options.options,'want_rpath',False):
    409419                def process_rpath(vars_,coreval):
    410420                        for d in vars_:
     
    430440                self.qt4_vars_debug=[a+'_debug'for a in self.qt4_vars]
    431441        self.qt4_vars_debug=Utils.to_list(self.qt4_vars_debug)
     442@conf
     443def 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)
    432450def options(opt):
    433451        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  
    2222        v['CC']=cc
    2323        v['CC_NAME']='sun'
     24        conf.get_suncc_version(cc)
    2425@conf
    2526def scc_common_flags(conf):
  • waflib/Tools/suncxx.py

    r54e74f0 rc101fe1  
    2323        v['CXX']=cc
    2424        v['CXX_NAME']='sun'
     25        conf.get_suncc_version(cc)
    2526@conf
    2627def sxx_common_flags(conf):
  • waflib/Tools/tex.py

    r54e74f0 rc101fe1  
    7979                                                        Logs.debug('tex: trying %s%s'%(path,k))
    8080                                                        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:
    8285                                                                nodes.append(found)
    8386                                                                add_name=False
     
    97100                        raise Errors.WafError("%r command exit status %r"%(msg,retcode))
    98101        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:
    102104                                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):
    110109                                Logs.warn('calling bibtex')
    111110                                self.env.env={}
    112111                                self.env.env.update(os.environ)
    113112                                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]
    115114                                self.check_status('error when calling bibtex',self.bibtex_fun())
    116115        def bibunits(self):
     
    139138                        self.env.env={}
    140139                        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')
    141144        def run(self):
    142145                env=self.env
     
    159162                self.aux_nodes=self.scan_aux(node.change_ext('.aux'))
    160163                self.idx_node=node.change_ext('.idx')
     164                self.bibtopic()
    161165                self.bibfile()
    162166                self.bibunits()
     
    230234                        except KeyError:
    231235                                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
    232239                if self.type=='latex':
    233240                        if'ps'in outs:
    234241                                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)
    236243                        if'pdf'in outs:
    237244                                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)
    239246                elif self.type=='pdflatex':
    240247                        if'ps'in outs:
  • waflib/Tools/waf_unit_test.py

    r54e74f0 rc101fe1  
    3737                                for tg in g:
    3838                                        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)
    4042                        def add_path(dct,path,var):
    4143                                dct[var]=os.pathsep.join(Utils.to_list(path)+[os.environ.get(var,'')])
Note: See TracChangeset for help on using the changeset viewer.