waf, waflib: update to 1.7.13
authorPaul Brossier <piem@piem.org>
Wed, 13 Nov 2013 12:00:56 +0000 (13:00 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 13 Nov 2013 12:00:56 +0000 (13:00 +0100)
23 files changed:
waf
waflib/Build.py
waflib/ConfigSet.py
waflib/Context.py
waflib/Logs.py
waflib/Node.py
waflib/Scripting.py
waflib/TaskGen.py
waflib/Tools/c_config.py
waflib/Tools/c_preproc.py
waflib/Tools/ccroot.py
waflib/Tools/cs.py
waflib/Tools/fc_config.py
waflib/Tools/gcc.py
waflib/Tools/gxx.py
waflib/Tools/javaw.py
waflib/Tools/msvc.py
waflib/Tools/python.py
waflib/Tools/qt4.py
waflib/Tools/suncc.py
waflib/Tools/suncxx.py
waflib/Tools/tex.py
waflib/Tools/waf_unit_test.py

diff --git a/waf b/waf
index 69987d0..4ba08d8 100755 (executable)
--- a/waf
+++ b/waf
@@ -32,11 +32,11 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys
 
-VERSION="1.7.9"
-REVISION="b503f38d25464d88953a601c8cd0ace6"
+VERSION="1.7.13"
+REVISION="5a064c2686fe54de4e11018d22148cfc"
 INSTALL=''
-C1='#='
-C2='#+'
+C1='#('
+C2='#$'
 cwd = os.getcwd()
 join = os.path.join
 
@@ -108,7 +108,7 @@ def unpack_wafdir(dir):
                import fixpy2
                fixpy2.fixdir(dir)
 
-       os.unlink(tmp)
+       os.remove(tmp)
        os.chdir(cwd)
 
        try: dir = unicode(dir, 'mbcs')
index 70330ef..f76933a 100644 (file)
@@ -132,29 +132,24 @@ class BuildContext(Context.Context):
                                raise Errors.WafError('Version mismatch! reconfigure the project')
                        for t in env['tools']:
                                self.setup(**t)
-               f=None
+               dbfn=os.path.join(self.variant_dir,Context.DBFILE)
                try:
-                       dbfn=os.path.join(self.variant_dir,Context.DBFILE)
+                       data=Utils.readf(dbfn,'rb')
+               except(IOError,EOFError):
+                       Logs.debug('build: Could not load the build cache %s (missing)'%dbfn)
+               else:
                        try:
-                               f=open(dbfn,'rb')
-                       except(IOError,EOFError):
-                               Logs.debug('build: Could not load the build cache %s (missing)'%dbfn)
-                       else:
+                               waflib.Node.pickle_lock.acquire()
+                               waflib.Node.Nod3=self.node_class
                                try:
-                                       waflib.Node.pickle_lock.acquire()
-                                       waflib.Node.Nod3=self.node_class
-                                       try:
-                                               data=cPickle.load(f)
-                                       except Exception ,e:
-                                               Logs.debug('build: Could not pickle the build cache %s: %r'%(dbfn,e))
-                                       else:
-                                               for x in SAVED_ATTRS:
-                                                       setattr(self,x,data[x])
-                               finally:
-                                       waflib.Node.pickle_lock.release()
-               finally:
-                       if f:
-                               f.close()
+                                       data=cPickle.loads(data)
+                               except Exception ,e:
+                                       Logs.debug('build: Could not pickle the build cache %s: %r'%(dbfn,e))
+                               else:
+                                       for x in SAVED_ATTRS:
+                                               setattr(self,x,data[x])
+                       finally:
+                               waflib.Node.pickle_lock.release()
                self.init_dirs()
        def store(self):
                data={}
@@ -164,18 +159,13 @@ class BuildContext(Context.Context):
                try:
                        waflib.Node.pickle_lock.acquire()
                        waflib.Node.Nod3=self.node_class
-                       f=None
-                       try:
-                               f=open(db+'.tmp','wb')
-                               cPickle.dump(data,f,-1)
-                       finally:
-                               if f:
-                                       f.close()
+                       x=cPickle.dumps(data,-1)
                finally:
                        waflib.Node.pickle_lock.release()
+               Utils.writef(db+'.tmp',x,m='wb')
                try:
                        st=os.stat(db)
-                       os.unlink(db)
+                       os.remove(db)
                        if not Utils.is_win32:
                                os.chown(db+'.tmp',st.st_uid,st.st_gid)
                except(AttributeError,OSError):
@@ -481,7 +471,6 @@ class inst(Task.Task):
                for x,y in zip(self.source,self.inputs):
                        if self.relative_trick:
                                destfile=os.path.join(destpath,y.path_from(self.path))
-                               Utils.check_dir(os.path.dirname(destfile))
                        else:
                                destfile=os.path.join(destpath,y.name)
                        self.generator.bld.do_install(y.abspath(),destfile,self.chmod)
@@ -624,7 +613,7 @@ class UninstallContext(InstallContext):
        def do_link(self,src,tgt):
                try:
                        if not self.progress_bar:
-                               Logs.info('- unlink %s'%tgt)
+                               Logs.info('- remove %s'%tgt)
                        os.remove(tgt)
                except OSError:
                        pass
index 42ecde3..f9fdcc7 100644 (file)
@@ -120,18 +120,18 @@ class ConfigSet(object):
                        os.makedirs(os.path.split(filename)[0])
                except OSError:
                        pass
-               f=None
+               buf=[]
+               merged_table=self.get_merged_dict()
+               keys=list(merged_table.keys())
+               keys.sort()
                try:
-                       f=open(filename,'w')
-                       merged_table=self.get_merged_dict()
-                       keys=list(merged_table.keys())
-                       keys.sort()
-                       for k in keys:
-                               if k!='undo_stack':
-                                       f.write('%s = %r\n'%(k,merged_table[k]))
-               finally:
-                       if f:
-                               f.close()
+                       fun=ascii
+               except NameError:
+                       fun=repr
+               for k in keys:
+                       if k!='undo_stack':
+                               buf.append('%s = %s\n'%(k,fun(merged_table[k])))
+               Utils.writef(filename,''.join(buf))
        def load(self,filename):
                tbl=self.table
                code=Utils.readf(filename,m='rU')
index 494ece2..c789c48 100644 (file)
@@ -5,9 +5,9 @@
 import os,imp,sys
 from waflib import Utils,Errors,Logs
 import waflib.Node
-HEXVERSION=0x1070900
-WAFVERSION="1.7.9"
-WAFREVISION="9e92489dbc008e4abae9c147b1d63b48296797c2"
+HEXVERSION=0x1070d00
+WAFVERSION="1.7.13"
+WAFREVISION="daa91dba4b881d86bc25eec90a3745ebaeece835"
 ABI=98
 DBFILE='.wafpickle-%s-%d-%d'%(sys.platform,sys.hexversion,ABI)
 APPNAME='APPNAME'
index d6d4ddd..ef62452 100644 (file)
@@ -3,10 +3,17 @@
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
 import os,re,traceback,sys
+_nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
 try:
-       import threading
+       if not _nocolor:
+               import waflib.ansiterm
 except ImportError:
        pass
+try:
+       import threading
+except ImportError:
+       if not'JOBS'in os.environ:
+               os.environ['JOBS']='1'
 else:
        wlock=threading.Lock()
        class sync_stream(object):
@@ -26,12 +33,6 @@ else:
                        self.stream.flush()
                def isatty(self):
                        return self.stream.isatty()
-       _nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
-       try:
-               if not _nocolor:
-                       import waflib.ansiterm
-       except ImportError:
-               pass
        if not os.environ.get('NOSYNC',False):
                if id(sys.stdout)==id(sys.__stdout__):
                        sys.stdout=sync_stream(sys.stdout)
index 79d6bbf..7729613 100644 (file)
@@ -33,6 +33,7 @@ exclude_regs='''
 **/{arch}
 **/_darcs
 **/_darcs/**
+**/.intlcache
 **/.DS_Store'''
 def split_path(path):
        return path.split('/')
@@ -89,10 +90,10 @@ class Node(object):
                os.chmod(self.abspath(),val)
        def delete(self):
                try:
-                       if getattr(self,'children',None):
+                       if hasattr(self,'children'):
                                shutil.rmtree(self.abspath())
                        else:
-                               os.unlink(self.abspath())
+                               os.remove(self.abspath())
                except OSError:
                        pass
                self.evict()
@@ -327,7 +328,7 @@ class Node(object):
                        if[]in nrej:
                                nacc=[]
                        return[nacc,nrej]
-               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))]
+               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))]
                if kw.get('flat',False):
                        return' '.join([x.path_from(self)for x in ret])
                return ret
index c33ab32..fe5c30c 100644 (file)
@@ -164,12 +164,12 @@ def distclean_dir(dirname):
                        if _can_distclean(f):
                                fname=root+os.sep+f
                                try:
-                                       os.unlink(fname)
+                                       os.remove(fname)
                                except OSError:
                                        Logs.warn('Could not remove %r'%fname)
        for x in[Context.DBFILE,'config.log']:
                try:
-                       os.unlink(x)
+                       os.remove(x)
                except OSError:
                        pass
        try:
@@ -325,7 +325,7 @@ class DistCheck(Dist):
                else:
                        cfg=[x for x in sys.argv if x.startswith('-')]
                instdir=tempfile.mkdtemp('.inst',self.get_base_name())
-               ret=Utils.subprocess.Popen([sys.argv[0],'configure','install','uninstall','--destdir='+instdir]+cfg,cwd=self.get_base_name()).wait()
+               ret=Utils.subprocess.Popen([sys.executable,sys.argv[0],'configure','install','uninstall','--destdir='+instdir]+cfg,cwd=self.get_base_name()).wait()
                if ret:
                        raise Errors.WafError('distcheck failed with code %i'%ret)
                if os.path.exists(instdir):
index acd5166..4e04239 100644 (file)
@@ -305,7 +305,9 @@ class subst_pc(Task.Task):
                        self.outputs[0].write(self.inputs[0].read('rb'),'wb')
                        if getattr(self.generator,'chmod',None):
                                os.chmod(self.outputs[0].abspath(),self.generator.chmod)
-                       return
+                       return None
+               if getattr(self.generator,'fun',None):
+                       self.generator.fun(self)
                code=self.inputs[0].read(encoding=getattr(self.generator,'encoding','ISO8859-1'))
                if getattr(self.generator,'subst_fun',None):
                        code=self.generator.subst_fun(self,code)
@@ -339,6 +341,8 @@ class subst_pc(Task.Task):
                bld=self.generator.bld
                env=self.env
                upd=self.m.update
+               if getattr(self.generator,'fun',None):
+                       upd(Utils.h_fun(self.generator.fun))
                if getattr(self.generator,'subst_fun',None):
                        upd(Utils.h_fun(self.generator.subst_fun))
                vars=self.generator.bld.raw_deps.get(self.uid(),[])
index e6d3b5d..9f29b49 100755 (executable)
@@ -599,7 +599,7 @@ def get_cc_version(conf,cc,gcc=False,icc=False):
        if gcc:
                if out.find('__INTEL_COMPILER')>=0:
                        conf.fatal('The intel compiler pretends to be gcc')
-               if out.find('__GNUC__')<0:
+               if out.find('__GNUC__')<0 and out.find('__clang__')<0:
                        conf.fatal('Could not determine the compiler type')
        if icc and out.find('__INTEL_COMPILER')<0:
                conf.fatal('Not icc/icpc')
@@ -629,9 +629,9 @@ def get_cc_version(conf,cc,gcc=False,icc=False):
                                conf.env.DEST_OS='generic'
                if isD('__ELF__'):
                        conf.env.DEST_BINFMT='elf'
-               elif isD('__WINNT__')or isD('__CYGWIN__'):
+               elif isD('__WINNT__')or isD('__CYGWIN__')or isD('_WIN32'):
                        conf.env.DEST_BINFMT='pe'
-                       conf.env.LIBDIR=conf.env['PREFIX']+'/bin'
+                       conf.env.LIBDIR=conf.env.BINDIR
                elif isD('__APPLE__'):
                        conf.env.DEST_BINFMT='mac-o'
                if not conf.env.DEST_BINFMT:
@@ -667,6 +667,22 @@ def get_xlc_version(conf,cc):
        else:
                conf.fatal('Could not determine the XLC version.')
 @conf
+def get_suncc_version(conf,cc):
+       cmd=cc+['-V']
+       try:
+               out,err=conf.cmd_and_log(cmd,output=0)
+       except Errors.WafError:
+               conf.fatal('Could not find suncc %r'%cmd)
+       version=(out or err)
+       version=version.split('\n')[0]
+       version_re=re.compile(r'cc:\s+sun\s+(c\+\+|c)\s+(?P<major>\d*)\.(?P<minor>\d*)',re.I).search
+       match=version_re(version)
+       if match:
+               k=match.groupdict()
+               conf.env['CC_VERSION']=(k['major'],k['minor'])
+       else:
+               conf.fatal('Could not determine the suncc version.')
+@conf
 def add_as_needed(self):
        if self.env.DEST_BINFMT=='elf'and'gcc'in(self.env.CXX_NAME,self.env.CC_NAME):
                self.env.append_unique('LINKFLAGS','--as-needed')
index 9dfd8ca..dc6453b 100644 (file)
@@ -21,7 +21,7 @@ re_mac=re.compile("^[a-zA-Z_]\w*")
 re_fun=re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]')
 re_pragma_once=re.compile('^\s*once\s*',re.IGNORECASE)
 re_nl=re.compile('\\\\\r*\n',re.MULTILINE)
-re_cpp=re.compile(r"""(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)""",re.MULTILINE)
+re_cpp=re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',re.DOTALL|re.MULTILINE)
 trig_def=[('??'+a,b)for a,b in zip("=-/!'()<>",r'#~\|^[]{}')]
 chr_esc={'0':0,'a':7,'b':8,'t':9,'n':10,'f':11,'v':12,'r':13,'\\':92,"'":39}
 NUM='i'
@@ -37,10 +37,10 @@ ignored='i'
 undefined='u'
 skipped='s'
 def repl(m):
-       s=m.group(1)
-       if s:
+       s=m.group(0)
+       if s.startswith('/'):
                return' '
-       return m.group(3)or''
+       return s
 def filter_comments(filename):
        code=Utils.readf(filename)
        if use_trigraphs:
@@ -475,7 +475,7 @@ class c_parser(object):
                        if found:
                                break
                        found=self.cached_find_resource(n,filename)
-               if found:
+               if found and not found in self.ban_includes:
                        self.nodes.append(found)
                        if filename[-4:]!='.moc':
                                self.addlines(found)
@@ -518,6 +518,7 @@ class c_parser(object):
                except AttributeError:
                        bld.parse_cache={}
                        self.parse_cache=bld.parse_cache
+               self.current_file=node
                self.addlines(node)
                if env['DEFINES']:
                        try:
@@ -557,12 +558,11 @@ class c_parser(object):
                                        else:state[-1]=accepted
                                elif token=='include'or token=='import':
                                        (kind,inc)=extract_include(line,self.defs)
-                                       if inc in self.ban_includes:
-                                               continue
-                                       if token=='import':self.ban_includes.add(inc)
                                        if ve:debug('preproc: include found %s    (%s) ',inc,kind)
                                        if kind=='"'or not strict_quotes:
-                                               self.tryfind(inc)
+                                               self.current_file=self.tryfind(inc)
+                                               if token=='import':
+                                                       self.ban_includes.add(self.current_file)
                                elif token=='elif':
                                        if state[-1]==accepted:
                                                state[-1]=skipped
@@ -583,7 +583,7 @@ class c_parser(object):
                                                self.defs.__delitem__(m.group(0))
                                elif token=='pragma':
                                        if re_pragma_once.match(line.lower()):
-                                               self.ban_includes.add(self.curfile)
+                                               self.ban_includes.add(self.current_file)
                        except Exception ,e:
                                if Logs.verbose:
                                        debug('preproc: line parsing failed (%s): %s %s',e,line,Utils.ex_stack())
index 18c57ce..6a94573 100644 (file)
@@ -2,7 +2,7 @@
 # encoding: utf-8
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
-import os
+import os,re
 from waflib import Task,Utils,Node,Errors
 from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension
 from waflib.Tools import c_aliases,c_preproc,c_config,c_osx,c_tests
@@ -70,9 +70,12 @@ class link_task(Task.Task):
                        if not pattern:
                                pattern='%s'
                        folder,name=os.path.split(target)
-                       if self.__class__.__name__.find('shlib')>0:
-                               if self.env.DEST_BINFMT=='pe'and getattr(self.generator,'vnum',None):
-                                       name=name+'-'+self.generator.vnum.split('.')[0]
+                       if self.__class__.__name__.find('shlib')>0 and getattr(self.generator,'vnum',None):
+                               nums=self.generator.vnum.split('.')
+                               if self.env.DEST_BINFMT=='pe':
+                                       name=name+'-'+nums[0]
+                               elif self.env.DEST_OS=='openbsd':
+                                       pattern='%s.%s.%s'%(pattern,nums[0],nums[1])
                        tmp=folder+os.sep+pattern%name
                        target=self.generator.path.find_or_declare(tmp)
                self.set_outputs(target)
@@ -197,6 +200,8 @@ def process_use(self):
                                self.add_objects_from_tgen(y)
                if getattr(y,'export_includes',None):
                        self.includes.extend(y.to_incnodes(y.export_includes))
+               if getattr(y,'export_defines',None):
+                       self.env.append_value('DEFINES',self.to_list(y.export_defines))
        for x in names:
                try:
                        y=self.bld.get_tgen_by_name(x)
@@ -273,12 +278,15 @@ def apply_implib(self):
        if not inst_to:
                return
        self.implib_install_task=self.bld.install_as('${LIBDIR}/%s'%implib.name,implib,self.env)
+re_vnum=re.compile('^([1-9]\\d*|0)[.]([1-9]\\d*|0)[.]([1-9]\\d*|0)$')
 @feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')
 @after_method('apply_link','propagate_uselib_vars')
 def apply_vnum(self):
        if not getattr(self,'vnum','')or os.name!='posix'or self.env.DEST_BINFMT not in('elf','mac-o'):
                return
        link=self.link_task
+       if not re_vnum.match(self.vnum):
+               raise Errors.WafError('Invalid version %r for %r'%(self.vnum,self))
        nums=self.vnum.split('.')
        node=link.outputs[0]
        libname=node.name
@@ -291,15 +299,21 @@ def apply_vnum(self):
        if self.env.SONAME_ST:
                v=self.env.SONAME_ST%name2
                self.env.append_value('LINKFLAGS',v.split())
-       self.create_task('vnum',node,[node.parent.find_or_declare(name2),node.parent.find_or_declare(name3)])
+       if self.env.DEST_OS!='openbsd':
+               self.create_task('vnum',node,[node.parent.find_or_declare(name2),node.parent.find_or_declare(name3)])
        if getattr(self,'install_task',None):
                self.install_task.hasrun=Task.SKIP_ME
                bld=self.bld
                path=self.install_task.dest
-               t1=bld.install_as(path+os.sep+name3,node,env=self.env,chmod=self.link_task.chmod)
-               t2=bld.symlink_as(path+os.sep+name2,name3)
-               t3=bld.symlink_as(path+os.sep+libname,name3)
-               self.vnum_install_task=(t1,t2,t3)
+               if self.env.DEST_OS=='openbsd':
+                       libname=self.link_task.outputs[0].name
+                       t1=bld.install_as('%s%s%s'%(path,os.sep,libname),node,env=self.env,chmod=self.link_task.chmod)
+                       self.vnum_install_task=(t1,)
+               else:
+                       t1=bld.install_as(path+os.sep+name3,node,env=self.env,chmod=self.link_task.chmod)
+                       t2=bld.symlink_as(path+os.sep+name2,name3)
+                       t3=bld.symlink_as(path+os.sep+libname,name3)
+                       self.vnum_install_task=(t1,t2,t3)
        if'-dynamiclib'in self.env['LINKFLAGS']:
                try:
                        inst_to=self.install_path
@@ -341,11 +355,11 @@ class fake_stlib(stlink_task):
                        x.sig=Utils.h_file(x.abspath())
                return Task.SKIP_ME
 @conf
-def read_shlib(self,name,paths=[]):
-       return self(name=name,features='fake_lib',lib_paths=paths,lib_type='shlib')
+def read_shlib(self,name,paths=[],export_includes=[],export_defines=[]):
+       return self(name=name,features='fake_lib',lib_paths=paths,lib_type='shlib',export_includes=export_includes,export_defines=export_defines)
 @conf
-def read_stlib(self,name,paths=[]):
-       return self(name=name,features='fake_lib',lib_paths=paths,lib_type='stlib')
+def read_stlib(self,name,paths=[],export_includes=[],export_defines=[]):
+       return self(name=name,features='fake_lib',lib_paths=paths,lib_type='stlib',export_includes=export_includes,export_defines=export_defines)
 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'],}
 @feature('fake_lib')
 def process_lib(self):
index ee4d319..a78e138 100644 (file)
@@ -103,7 +103,7 @@ class mcs(Task.Task):
                if flag.find(' ')>-1:
                        for x in('/r:','/reference:','/resource:','/lib:','/out:'):
                                if flag.startswith(x):
-                                       flag='%s"%s"'%(x,flag[len(x):])
+                                       flag='%s"%s"'%(x,'","'.join(flag[len(x):].split(',')))
                                        break
                        else:
                                flag='"%s"'%flag
index 0130a57..580eac7 100644 (file)
@@ -51,8 +51,8 @@ def check_fc(self,*k,**kw):
 @conf
 def fortran_modifier_darwin(conf):
        v=conf.env
-       v['FCFLAGS_fcshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
-       v['LINKFLAGS_fcshlib']=['-dynamiclib']
+       v['FCFLAGS_fcshlib']=['-fPIC']
+       v['LINKFLAGS_fcshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1']
        v['fcshlib_PATTERN']='lib%s.dylib'
        v['FRAMEWORKPATH_ST']='-F%s'
        v['FRAMEWORK_ST']='-framework %s'
index adf11da..aca49ca 100644 (file)
@@ -2,8 +2,6 @@
 # encoding: utf-8
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
-import os,sys
-from waflib import Configure,Options,Utils
 from waflib.Tools import ccroot,ar
 from waflib.Configure import conf
 @conf
@@ -59,8 +57,8 @@ def gcc_modifier_cygwin(conf):
 @conf
 def gcc_modifier_darwin(conf):
        v=conf.env
-       v['CFLAGS_cshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
-       v['LINKFLAGS_cshlib']=['-dynamiclib']
+       v['CFLAGS_cshlib']=['-fPIC']
+       v['LINKFLAGS_cshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1']
        v['cshlib_PATTERN']='lib%s.dylib'
        v['FRAMEWORKPATH_ST']='-F%s'
        v['FRAMEWORK_ST']=['-framework']
@@ -83,6 +81,9 @@ def gcc_modifier_hpux(conf):
        v['CFLAGS_cshlib']=['-fPIC','-DPIC']
        v['cshlib_PATTERN']='lib%s.sl'
 @conf
+def gcc_modifier_openbsd(conf):
+       conf.env.SONAME_ST=[]
+@conf
 def gcc_modifier_platform(conf):
        gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None)
        if gcc_modifier_func:
index 8257017..475f7fd 100644 (file)
@@ -2,8 +2,6 @@
 # encoding: utf-8
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
-import os,sys
-from waflib import Configure,Options,Utils
 from waflib.Tools import ccroot,ar
 from waflib.Configure import conf
 @conf
@@ -59,8 +57,8 @@ def gxx_modifier_cygwin(conf):
 @conf
 def gxx_modifier_darwin(conf):
        v=conf.env
-       v['CXXFLAGS_cxxshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
-       v['LINKFLAGS_cxxshlib']=['-dynamiclib']
+       v['CXXFLAGS_cxxshlib']=['-fPIC']
+       v['LINKFLAGS_cxxshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1']
        v['cxxshlib_PATTERN']='lib%s.dylib'
        v['FRAMEWORKPATH_ST']='-F%s'
        v['FRAMEWORK_ST']=['-framework']
@@ -83,6 +81,9 @@ def gxx_modifier_hpux(conf):
        v['CFLAGS_cxxshlib']=['-fPIC','-DPIC']
        v['cxxshlib_PATTERN']='lib%s.sl'
 @conf
+def gxx_modifier_openbsd(conf):
+       conf.env.SONAME_ST=[]
+@conf
 def gxx_modifier_platform(conf):
        gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None)
        if gxx_modifier_func:
index 5750f40..15f128c 100644 (file)
@@ -202,7 +202,7 @@ class javac(Task.Task):
                        ret=self.exec_command(cmd,cwd=wd,env=env.env or None)
                finally:
                        if tmp:
-                               os.unlink(tmp)
+                               os.remove(tmp)
                return ret
        def post_run(self):
                for n in self.generator.outdir.ant_glob('**/*.class'):
@@ -270,9 +270,7 @@ def check_java_class(self,classname,with_classpath=None):
                classpath+=os.pathsep+with_classpath
        shutil.rmtree(javatestdir,True)
        os.mkdir(javatestdir)
-       java_file=open(os.path.join(javatestdir,'Test.java'),'w')
-       java_file.write(class_check_source)
-       java_file.close()
+       Utils.writef(os.path.join(javatestdir,'Test.java'),class_check_source)
        self.exec_command(self.env['JAVAC']+[os.path.join(javatestdir,'Test.java')],shell=False)
        cmd=self.env['JAVA']+['-cp',classpath,'Test',classname]
        self.to_log("%s\n"%str(cmd))
index 289cd47..dd62e40 100644 (file)
@@ -3,7 +3,7 @@
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
 import os,sys,re,tempfile
-from waflib import Utils,Task,Logs,Options
+from waflib import Utils,Task,Logs,Options,Errors
 from waflib.Logs import debug,warn
 from waflib.TaskGen import after_method,feature
 from waflib.Configure import conf
@@ -28,7 +28,7 @@ traffic unicows url urlmon user32 userenv usp10 uuid uxtheme vcomp vcompd vdmdbg
 version vfw32 wbemuuid  webpost wiaguid wininet winmm winscard winspool winstrm
 wintrust wldap32 wmiutils wow32 ws2_32 wsnmp32 wsock32 wst wtsapi32 xaswitch xolehlp
 '''.split()
-all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64')]
+all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64'),('x86_arm','arm')]
 all_wince_platforms=[('armv4','arm'),('armv4i','arm'),('mipsii','mips'),('mipsii_fp','mips'),('mipsiv','mips'),('mipsiv_fp','mips'),('sh4','sh'),('x86','cex86')]
 all_icl_platforms=[('intel64','amd64'),('em64t','amd64'),('ia32','x86'),('Itanium','ia64')]
 def options(opt):
@@ -66,23 +66,12 @@ set LIB=
 call "%s" %s
 echo PATH=%%PATH%%
 echo INCLUDE=%%INCLUDE%%
-echo LIB=%%LIB%%
+echo LIB=%%LIB%%;%%LIBPATH%%
 """%(vcvars,target))
        sout=conf.cmd_and_log(['cmd','/E:on','/V:on','/C',batfile.abspath()])
        lines=sout.splitlines()
        if not lines[0]:
                lines.pop(0)
-       if version=='11.0':
-               if lines[0].startswith('Error'):
-                       conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_1)')
-       else:
-               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.'):
-                       if lines[0].find(x)>-1:
-                               lines.pop(0)
-                               break
-               else:
-                       debug('msvc: get_msvc_version: %r %r %r -> not found',compiler,version,target)
-                       conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_2)')
        MSVC_PATH=MSVC_INCDIR=MSVC_LIBDIR=None
        for line in lines:
                if line.startswith('PATH='):
@@ -232,7 +221,8 @@ def gather_msvc_targets(conf,versions,version,vc_path):
                        targets.append(('x86',('x86',conf.get_msvc_version('msvc',version,'',os.path.join(vc_path,'Bin','vcvars32.bat')))))
                except conf.errors.ConfigurationError:
                        pass
-       versions.append(('msvc '+version,targets))
+       if targets:
+               versions.append(('msvc '+version,targets))
 @conf
 def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platforms):
        for device,platforms in supported_platforms:
@@ -253,6 +243,16 @@ def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platform
                if cetargets:
                        versions.append((device+' '+version,cetargets))
 @conf
+def gather_winphone_targets(conf,versions,version,vc_path,vsvars):
+       targets=[]
+       for target,realtarget in all_msvc_platforms[::-1]:
+               try:
+                       targets.append((target,(realtarget,conf.get_msvc_version('winphone',version,target,vsvars))))
+               except conf.errors.ConfigurationError ,e:
+                       pass
+       if targets:
+               versions.append(('winphone '+version,targets))
+@conf
 def gather_msvc_versions(conf,versions):
        vc_paths=[]
        for(v,version,reg)in gather_msvc_detected_versions():
@@ -271,6 +271,9 @@ def gather_msvc_versions(conf,versions):
                vsvars=os.path.join(vs_path,'Common7','Tools','vsvars32.bat')
                if wince_supported_platforms and os.path.isfile(vsvars):
                        conf.gather_wince_targets(versions,version,vc_path,vsvars,wince_supported_platforms)
+               vsvars=os.path.join(vs_path,'VC','WPSDK','WP80','vcvarsphoneall.bat')
+               if os.path.isfile(vsvars):
+                       conf.gather_winphone_targets(versions,'8.0',vc_path,vsvars)
        for version,vc_path in vc_paths:
                vs_path=os.path.dirname(vc_path)
                conf.gather_msvc_targets(versions,version,vc_path)
@@ -369,10 +372,12 @@ def gather_intel_composer_versions(conf,versions):
                                        setattr(conf,compilervars_warning_attr,False)
                                        patch_url='http://software.intel.com/en-us/forums/topic/328487'
                                        compilervars_arch=os.path.join(path,'bin','compilervars_arch.bat')
-                                       vs_express_path=os.environ['VS110COMNTOOLS']+r'..\IDE\VSWinExpress.exe'
-                                       dev_env_path=os.environ['VS110COMNTOOLS']+r'..\IDE\devenv.exe'
-                                       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)):
-                                               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))
+                                       for vscomntool in['VS110COMNTOOLS','VS100COMNTOOLS']:
+                                               if vscomntool in os.environ:
+                                                       vs_express_path=os.environ[vscomntool]+r'..\IDE\VSWinExpress.exe'
+                                                       dev_env_path=os.environ[vscomntool]+r'..\IDE\devenv.exe'
+                                                       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)):
+                                                               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))
                        except WindowsError:
                                pass
                major=version[0:2]
@@ -544,8 +549,9 @@ def find_msvc(conf):
        if v.MSVC_MANIFEST:
                conf.find_program('MT',path_list=path,var='MT')
                v['MTFLAGS']=['/NOLOGO']
-       conf.load('winres')
-       if not conf.env['WINRC']:
+       try:
+               conf.load('winres')
+       except Errors.WafError:
                warn('Resource compiler not found. Compiling resource file is disabled')
 @conf
 def visual_studio_add_flags(self):
@@ -563,11 +569,10 @@ def msvc_common_flags(conf):
        v['DEFINES_ST']='/D%s'
        v['CC_SRC_F']=''
        v['CC_TGT_F']=['/c','/Fo']
-       if v['MSVC_VERSION']>=8:
-               v['CC_TGT_F']=['/FC']+v['CC_TGT_F']
        v['CXX_SRC_F']=''
        v['CXX_TGT_F']=['/c','/Fo']
-       if v['MSVC_VERSION']>=8:
+       if(v.MSVC_COMPILER=='msvc'and v.MSVC_VERSION>=8)or(v.MSVC_COMPILER=='wsdk'and v.MSVC_VERSION>=6):
+               v['CC_TGT_F']=['/FC']+v['CC_TGT_F']
                v['CXX_TGT_F']=['/FC']+v['CXX_TGT_F']
        v['CPPPATH_ST']='/I%s'
        v['AR_TGT_F']=v['CCLNK_TGT_F']=v['CXXLNK_TGT_F']='/OUT:'
@@ -681,7 +686,6 @@ def exec_response_command(self,cmd,**kw):
                                pass
        return ret
 def exec_command_msvc(self,*k,**kw):
-       assert self.env['CC_NAME']=='msvc'
        if isinstance(k[0],list):
                lst=[]
                carry=''
@@ -724,3 +728,22 @@ def wrap_class(class_name):
        return derived_class
 for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split():
        wrap_class(k)
+def make_winapp(self,family):
+       append=self.env.append_unique
+       append('DEFINES','WINAPI_FAMILY=%s'%family)
+       append('CXXFLAGS','/ZW')
+       append('CXXFLAGS','/TP')
+       for lib_path in self.env.LIBPATH:
+               append('CXXFLAGS','/AI%s'%lib_path)
+@feature('winphoneapp')
+@after_method('process_use')
+@after_method('propagate_uselib_vars')
+def make_winphone_app(self):
+       make_winapp(self,'WINAPI_FAMILY_PHONE_APP')
+       conf.env.append_unique('LINKFLAGS','/NODEFAULTLIB:ole32.lib')
+       conf.env.append_unique('LINKFLAGS','PhoneAppModelHost.lib')
+@feature('winapp')
+@after_method('process_use')
+@after_method('propagate_uselib_vars')
+def make_windows_app(self):
+       make_winapp(self,'WINAPI_FAMILY_DESKTOP_APP')
index 4bb911e..56c0d7d 100644 (file)
@@ -170,7 +170,7 @@ def check_python_headers(conf):
        all_flags=dct['LDFLAGS']+' '+dct['LDSHARED']+' '+dct['CFLAGS']
        conf.parse_flags(all_flags,'PYEXT')
        result=None
-       for name in('python'+env['PYTHON_VERSION'],'python'+env['PYTHON_VERSION'].replace('.','')):
+       for name in('python'+env['PYTHON_VERSION'],'python'+env['PYTHON_VERSION']+'m','python'+env['PYTHON_VERSION'].replace('.','')):
                if not result and env['LIBPATH_PYEMBED']:
                        path=env['LIBPATH_PYEMBED']
                        conf.to_log("\n\n# Trying default LIBPATH_PYEMBED: %r\n"%path)
@@ -230,9 +230,12 @@ def check_python_headers(conf):
                conf.check(header_name='Python.h',define_name='HAVE_PYTHON_H',uselib='PYEMBED',fragment=FRAG,errmsg=':-(')
        except conf.errors.ConfigurationError:
                xx=conf.env.CXX_NAME and'cxx'or'c'
-               conf.check_cfg(msg='Asking python-config for the flags (pyembed)',path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEMBED',args=['--cflags','--libs','--ldflags'])
+               flags=['--cflags','--libs','--ldflags']
+               for f in flags:
+                       conf.check_cfg(msg='Asking python-config for pyembed %s flags'%f,path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEMBED',args=[f])
                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))
-               conf.check_cfg(msg='Asking python-config for the flags (pyext)',path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEXT',args=['--cflags','--libs','--ldflags'])
+               for f in flags:
+                       conf.check_cfg(msg='Asking python-config for pyext %s flags'%f,path=conf.env.PYTHON_CONFIG,package='',uselib_store='PYEXT',args=[f])
                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')
 @conf
 def check_python_version(conf,minver=None):
index 4300a57..b4328e7 100644 (file)
@@ -20,18 +20,22 @@ MOC_H=['.h','.hpp','.hxx','.hh']
 EXT_RCC=['.qrc']
 EXT_UI=['.ui']
 EXT_QT4=['.cpp','.cc','.cxx','.C']
-QT4_LIBS="QtCore QtGui QtUiTools QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtXmlPatterns QtWebKit Qt3Support QtHelp QtScript QtDeclarative"
-class qxx(cxx.cxx):
+QT4_LIBS="QtCore QtGui QtUiTools QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtXmlPatterns QtWebKit Qt3Support QtHelp QtScript QtDeclarative QtDesigner"
+class qxx(Task.classes['cxx']):
        def __init__(self,*k,**kw):
                Task.Task.__init__(self,*k,**kw)
                self.moc_done=0
        def scan(self):
                (nodes,names)=c_preproc.scan(self)
+               lst=[]
                for x in nodes:
                        if x.name.endswith('.moc'):
-                               nodes.remove(x)
-                               names.append(x.path_from(self.inputs[0].parent.get_bld()))
-               return(nodes,names)
+                               s=x.path_from(self.inputs[0].parent.get_bld())
+                               if s not in names:
+                                       names.append(s)
+                       else:
+                               lst.append(x)
+               return(lst,names)
        def runnable_status(self):
                if self.moc_done:
                        return Task.Task.runnable_status(self)
@@ -41,6 +45,21 @@ class qxx(cxx.cxx):
                                        return Task.ASK_LATER
                        self.add_moc_tasks()
                        return Task.Task.runnable_status(self)
+       def create_moc_task(self,h_node,m_node):
+               try:
+                       moc_cache=self.generator.bld.moc_cache
+               except AttributeError:
+                       moc_cache=self.generator.bld.moc_cache={}
+               try:
+                       return moc_cache[h_node]
+               except KeyError:
+                       tsk=moc_cache[h_node]=Task.classes['moc'](env=self.env,generator=self.generator)
+                       tsk.set_inputs(h_node)
+                       tsk.set_outputs(m_node)
+                       gen=self.generator.bld.producer
+                       gen.outstanding.insert(0,tsk)
+                       gen.total+=1
+                       return tsk
        def add_moc_tasks(self):
                node=self.inputs[0]
                bld=self.generator.bld
@@ -90,24 +109,14 @@ class qxx(cxx.cxx):
                        if not h_node:
                                raise Errors.WafError('no header found for %r which is a moc file'%d)
                        bld.node_deps[(self.inputs[0].parent.abspath(),m_node.name)]=h_node
-                       task=Task.classes['moc'](env=self.env,generator=self.generator)
-                       task.set_inputs(h_node)
-                       task.set_outputs(m_node)
-                       gen=bld.producer
-                       gen.outstanding.insert(0,task)
-                       gen.total+=1
+                       task=self.create_moc_task(h_node,m_node)
                        moctasks.append(task)
                tmp_lst=bld.raw_deps[self.uid()]=mocfiles
                lst=bld.node_deps.get(self.uid(),())
                for d in lst:
                        name=d.name
                        if name.endswith('.moc'):
-                               task=Task.classes['moc'](env=self.env,generator=self.generator)
-                               task.set_inputs(bld.node_deps[(self.inputs[0].parent.abspath(),name)])
-                               task.set_outputs(d)
-                               gen=bld.producer
-                               gen.outstanding.insert(0,task)
-                               gen.total+=1
+                               task=self.create_moc_task(bld.node_deps[(self.inputs[0].parent.abspath(),name)],d)
                                moctasks.append(task)
                self.run_after.update(set(moctasks))
                self.moc_done=1
@@ -175,7 +184,7 @@ def apply_qt4(self):
                                lst.append('-'+flag[1:])
                        else:
                                lst.append(flag)
-       self.env['MOC_FLAGS']=lst
+       self.env.append_value('MOC_FLAGS',lst)
 @extension(*EXT_QT4)
 def cxx_hook(self,node):
        return self.create_compiled_task('qxx',node)
@@ -224,6 +233,7 @@ class qm2rcc(Task.Task):
 def configure(self):
        self.find_qt4_binaries()
        self.set_qt4_libs_to_check()
+       self.set_qt4_defines()
        self.find_qt4_libraries()
        self.add_qt4_rpath()
        self.simplify_qt4_libs()
@@ -405,7 +415,7 @@ def simplify_qt4_libs(self):
 @conf
 def add_qt4_rpath(self):
        env=self.env
-       if Options.options.want_rpath:
+       if getattr(Options.options,'want_rpath',False):
                def process_rpath(vars_,coreval):
                        for d in vars_:
                                var=d.upper()
@@ -429,6 +439,14 @@ def set_qt4_libs_to_check(self):
        if not hasattr(self,'qt4_vars_debug'):
                self.qt4_vars_debug=[a+'_debug'for a in self.qt4_vars]
        self.qt4_vars_debug=Utils.to_list(self.qt4_vars_debug)
+@conf
+def set_qt4_defines(self):
+       if sys.platform!='win32':
+               return
+       for x in self.qt4_vars:
+               y=x[2:].upper()
+               self.env.append_unique('DEFINES_%s'%x.upper(),'QT_%s_LIB'%y)
+               self.env.append_unique('DEFINES_%s_DEBUG'%x.upper(),'QT_%s_LIB'%y)
 def options(opt):
        opt.add_option('--want-rpath',action='store_true',default=False,dest='want_rpath',help='enable the rpath for qt libraries')
        opt.add_option('--header-ext',type='string',default='',help='header extension for moc files',dest='qt_header_ext')
index edd24cd..48f4943 100644 (file)
@@ -21,6 +21,7 @@ def find_scc(conf):
                conf.fatal('%r is not a Sun compiler'%cc)
        v['CC']=cc
        v['CC_NAME']='sun'
+       conf.get_suncc_version(cc)
 @conf
 def scc_common_flags(conf):
        v=conf.env
index 4b8b931..1736c2d 100644 (file)
@@ -22,6 +22,7 @@ def find_sxx(conf):
                conf.fatal('%r is not a Sun compiler'%cc)
        v['CXX']=cc
        v['CXX_NAME']='sun'
+       conf.get_suncc_version(cc)
 @conf
 def sxx_common_flags(conf):
        v=conf.env
index 4448381..6813022 100644 (file)
@@ -78,7 +78,10 @@ class tex(Task.Task):
                                                for k in exts_deps_tex:
                                                        Logs.debug('tex: trying %s%s'%(path,k))
                                                        found=node.parent.find_resource(path+k)
-                                                       if found and not found in self.outputs:
+                                                       for tsk in self.generator.tasks:
+                                                               if not found or found in tsk.outputs:
+                                                                       break
+                                                       else:
                                                                nodes.append(found)
                                                                add_name=False
                                                                for ext in exts_tex:
@@ -96,22 +99,18 @@ class tex(Task.Task):
                if retcode!=0:
                        raise Errors.WafError("%r command exit status %r"%(msg,retcode))
        def bibfile(self):
-               need_bibtex=False
-               try:
-                       for aux_node in self.aux_nodes:
+               for aux_node in self.aux_nodes:
+                       try:
                                ct=aux_node.read()
-                               if g_bibtex_re.findall(ct):
-                                       need_bibtex=True
-                                       break
-               except(OSError,IOError):
-                       Logs.error('error bibtex scan')
-               else:
-                       if need_bibtex:
+                       except(OSError,IOError):
+                               Logs.error('Error reading %s: %r'%aux_node.abspath())
+                               continue
+                       if g_bibtex_re.findall(ct):
                                Logs.warn('calling bibtex')
                                self.env.env={}
                                self.env.env.update(os.environ)
                                self.env.env.update({'BIBINPUTS':self.TEXINPUTS,'BSTINPUTS':self.TEXINPUTS})
-                               self.env.SRCFILE=self.aux_nodes[0].name[:-4]
+                               self.env.SRCFILE=aux_node.name[:-4]
                                self.check_status('error when calling bibtex',self.bibtex_fun())
        def bibunits(self):
                try:
@@ -138,6 +137,10 @@ class tex(Task.Task):
                        self.env.SRCFILE=self.idx_node.name
                        self.env.env={}
                        self.check_status('error when calling makeindex %s'%idx_path,self.makeindex_fun())
+       def bibtopic(self):
+               p=self.inputs[0].parent.get_bld()
+               if os.path.exists(os.path.join(p.abspath(),'btaux.aux')):
+                       self.aux_nodes+=p.ant_glob('*[0-9].aux')
        def run(self):
                env=self.env
                if not env['PROMPT_LATEX']:
@@ -158,6 +161,7 @@ class tex(Task.Task):
                self.check_status('error when calling latex',fun())
                self.aux_nodes=self.scan_aux(node.change_ext('.aux'))
                self.idx_node=node.change_ext('.idx')
+               self.bibtopic()
                self.bibfile()
                self.bibunits()
                self.makeindex()
@@ -229,13 +233,16 @@ def apply_tex(self):
                                                lst.append(n)
                        except KeyError:
                                tree.node_deps[task.uid()]=deps_lst
+               v=dict(os.environ)
+               p=node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()+os.pathsep+v.get('TEXINPUTS','')+os.pathsep
+               v['TEXINPUTS']=p
                if self.type=='latex':
                        if'ps'in outs:
                                tsk=self.create_task('dvips',task.outputs,node.change_ext('.ps'))
-                               tsk.env.env={'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()}
+                               tsk.env.env=dict(v)
                        if'pdf'in outs:
                                tsk=self.create_task('dvipdf',task.outputs,node.change_ext('.pdf'))
-                               tsk.env.env={'TEXINPUTS':node.parent.abspath()+os.pathsep+self.path.abspath()+os.pathsep+self.path.get_bld().abspath()}
+                               tsk.env.env=dict(v)
                elif self.type=='pdflatex':
                        if'ps'in outs:
                                self.create_task('pdf2ps',task.outputs,node.change_ext('.ps'))
index f461be1..3363172 100644 (file)
@@ -36,7 +36,9 @@ class utest(Task.Task):
                        for g in self.generator.bld.groups:
                                for tg in g:
                                        if getattr(tg,'link_task',None):
-                                               lst.append(tg.link_task.outputs[0].parent.abspath())
+                                               s=tg.link_task.outputs[0].parent.abspath()
+                                               if s not in lst:
+                                                       lst.append(s)
                        def add_path(dct,path,var):
                                dct[var]=os.pathsep.join(Utils.to_list(path)+[os.environ.get(var,'')])
                        if Utils.is_win32: