Index: waf
===================================================================
--- waf	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waf	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -33,9 +33,9 @@
 import os, sys
 
-VERSION="1.7.13"
-REVISION="5a064c2686fe54de4e11018d22148cfc"
+VERSION="1.7.15"
+REVISION="de1cb53b86321cda764be4b3c38c3d20"
 INSTALL=''
-C1='#('
-C2='#$'
+C1='#+'
+C2='#&'
 cwd = os.getcwd()
 join = os.path.join
Index: waflib/Configure.py
===================================================================
--- waflib/Configure.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Configure.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -196,5 +196,5 @@
 	def post_recurse(self,node):
 		super(ConfigurationContext,self).post_recurse(node)
-		self.hash=hash((self.hash,node.read('rb')))
+		self.hash=Utils.h_list((self.hash,node.read('rb')))
 		self.files.append(node.abspath())
 	def eval_rules(self,rules):
Index: waflib/Context.py
===================================================================
--- waflib/Context.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Context.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -6,7 +6,7 @@
 from waflib import Utils,Errors,Logs
 import waflib.Node
-HEXVERSION=0x1070d00
-WAFVERSION="1.7.13"
-WAFREVISION="daa91dba4b881d86bc25eec90a3745ebaeece835"
+HEXVERSION=0x1070f00
+WAFVERSION="1.7.15"
+WAFREVISION="f63ac9793de2d4eaae884e55d4ff70a761dcbab2"
 ABI=98
 DBFILE='.wafpickle-%s-%d-%d'%(sys.platform,sys.hexversion,ABI)
@@ -61,9 +61,6 @@
 			global run_dir
 			rd=run_dir
-		class node_class(waflib.Node.Node):
-			pass
-		self.node_class=node_class
+		self.node_class=type("Nod3",(waflib.Node.Node,),{})
 		self.node_class.__module__="waflib.Node"
-		self.node_class.__name__="Nod3"
 		self.node_class.ctx=self
 		self.root=self.node_class('',None)
Index: waflib/Scripting.py
===================================================================
--- waflib/Scripting.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Scripting.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -203,6 +203,8 @@
 					if e.errno!=errno.ENOENT:
 						Logs.warn('file %r cannot be removed'%f)
-		if f.startswith('.waf')and not Options.commands:
-			shutil.rmtree(f,ignore_errors=True)
+		if not Options.commands:
+			for x in'.waf-1. waf-1. .waf3-1. waf3-1.'.split():
+				if f.startswith(x):
+					shutil.rmtree(f,ignore_errors=True)
 class Dist(Context.Context):
 	'''creates an archive containing the project source code'''
@@ -363,5 +365,5 @@
 				h=0
 				for f in env['files']:
-					h=hash((h,Utils.readf(f,'rb')))
+					h=Utils.h_list((h,Utils.readf(f,'rb')))
 				do_config=h!=env.hash
 		if do_config:
Index: waflib/Task.py
===================================================================
--- waflib/Task.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Task.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -664,7 +664,13 @@
 			if prev_sig==self.signature():
 				for x in self.outputs:
+					if not x.is_child_of(bld.bldnode):
+						x.sig=Utils.h_file(x.abspath())
 					if not x.sig or bld.task_sigs[x.abspath()]!=self.uid():
 						return RUN_ME
 				return SKIP_ME
+		except OSError:
+			pass
+		except IOError:
+			pass
 		except KeyError:
 			pass
Index: waflib/TaskGen.py
===================================================================
--- waflib/TaskGen.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/TaskGen.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -323,5 +323,6 @@
 				return"%%(%s)s"%g(1)
 			return''
-		code=re_m4.sub(repl,code)
+		global re_m4
+		code=getattr(self.generator,'re_m4',re_m4).sub(repl,code)
 		try:
 			d=self.generator.dct
Index: waflib/Tools/c_config.py
===================================================================
--- waflib/Tools/c_config.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Tools/c_config.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -163,4 +163,11 @@
 	for key,val in defi.items():
 		lst.append('--define-variable=%s=%s'%(key,val))
+	static=False
+	if'args'in kw:
+		args=Utils.to_list(kw['args'])
+		if'--static'in args or'--static-libs'in args:
+			static=True
+		lst+=args
+	lst.extend(Utils.to_list(kw['package']))
 	if'variables'in kw:
 		env=kw.get('env',self.env)
@@ -174,11 +181,4 @@
 			kw['okmsg']='yes'
 		return
-	static=False
-	if'args'in kw:
-		args=Utils.to_list(kw['args'])
-		if'--static'in args or'--static-libs'in args:
-			static=True
-		lst+=args
-	lst.extend(Utils.to_list(kw['package']))
 	ret=self.cmd_and_log(lst)
 	if not'okmsg'in kw:
@@ -328,5 +328,6 @@
 	if'define_name'in kw:
 		self.undefine(kw['define_name'])
-	assert'msg'in kw,'invalid parameters, read http://freehackers.org/~tnagy/wafbook/single.html#config_helpers_c'
+	if not'msg'in kw:
+		self.fatal('missing "msg" in conf.check(...)')
 @conf
 def post_check(self,*k,**kw):
@@ -359,11 +360,9 @@
 		for k in _vars:
 			lk=k.lower()
-			if k=='INCLUDES':lk='includes'
-			if k=='DEFINES':lk='defines'
 			if lk in kw:
 				val=kw[lk]
 				if isinstance(val,str):
 					val=val.rstrip(os.path.sep)
-				self.env.append_unique(k+'_'+kw['uselib_store'],val)
+				self.env.append_unique(k+'_'+kw['uselib_store'],Utils.to_list(val))
 	return is_success
 @conf
@@ -672,6 +671,9 @@
 	try:
 		out,err=conf.cmd_and_log(cmd,output=0)
-	except Errors.WafError:
-		conf.fatal('Could not find suncc %r'%cmd)
+	except Errors.WafError ,e:
+		if not(hasattr(e,'returncode')and hasattr(e,'stdout')and hasattr(e,'stderr')):
+			conf.fatal('Could not find suncc %r'%cmd)
+		out=e.stdout
+		err=e.stderr
 	version=(out or err)
 	version=version.split('\n')[0]
Index: waflib/Tools/c_preproc.py
===================================================================
--- waflib/Tools/c_preproc.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Tools/c_preproc.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -247,5 +247,5 @@
 							break
 						elif v2==',':
-							if not one_param:raise PreprocError("empty param in funcall %s"%p)
+							if not one_param:raise PreprocError("empty param in funcall %s"%v)
 							args.append(one_param)
 							one_param=[]
@@ -363,5 +363,8 @@
 	else:
 		(p,v)=t[0]
-		return(v,[[],t[1:]])
+		if len(t)>1:
+			return(v,[[],t[1:]])
+		else:
+			return(v,[[],[('T','')]])
 re_include=re.compile('^\s*(<(?P<a>.*)>|"(?P<b>.*)")')
 def extract_include(txt,defs):
Index: waflib/Tools/fc_scan.py
===================================================================
--- waflib/Tools/fc_scan.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Tools/fc_scan.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -7,5 +7,5 @@
 from waflib.TaskGen import feature,before_method,after_method,extension
 from waflib.Configure import conf
-INC_REGEX="""(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
+INC_REGEX="""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
 USE_REGEX="""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
 MOD_REGEX="""(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
Index: waflib/Tools/nasm.py
===================================================================
--- waflib/Tools/nasm.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Tools/nasm.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -3,4 +3,5 @@
 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
 
+import os
 import waflib.Tools.asm
 from waflib.TaskGen import feature
@@ -13,2 +14,3 @@
 	conf.env.ASLNK_TGT_F=['-o']
 	conf.load('asm')
+	conf.env.ASMPATH_ST='-I%s'+os.sep
Index: waflib/Utils.py
===================================================================
--- waflib/Utils.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/Utils.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -109,5 +109,5 @@
 		f.close()
 	return m.digest()
-if hasattr(os,'O_NOINHERIT'):
+if hasattr(os,'O_NOINHERIT')and sys.hexversion<0x3040000:
 	def readf_win32(f,m='r',encoding='ISO8859-1'):
 		flags=os.O_NOINHERIT|os.O_RDONLY
Index: waflib/ansiterm.py
===================================================================
--- waflib/ansiterm.py	(revision db21ca464535c001c6b1ad52e6806d7ee891feb7)
+++ waflib/ansiterm.py	(revision 1a31baf977fc30945946af012270051e3504aa41)
@@ -7,5 +7,5 @@
 	if not(sys.stderr.isatty()and sys.stdout.isatty()):
 		raise ValueError('not a tty')
-	from ctypes import*
+	from ctypes import Structure,windll,c_short,c_ushort,c_ulong,c_int,byref,POINTER,c_long,c_char
 	class COORD(Structure):
 		_fields_=[("X",c_short),("Y",c_short)]
@@ -16,4 +16,18 @@
 	class CONSOLE_CURSOR_INFO(Structure):
 		_fields_=[('dwSize',c_ulong),('bVisible',c_int)]
+	windll.kernel32.GetStdHandle.argtypes=[c_ulong]
+	windll.kernel32.GetStdHandle.restype=c_ulong
+	windll.kernel32.GetConsoleScreenBufferInfo.argtypes=[c_ulong,POINTER(CONSOLE_SCREEN_BUFFER_INFO)]
+	windll.kernel32.GetConsoleScreenBufferInfo.restype=c_long
+	windll.kernel32.SetConsoleTextAttribute.argtypes=[c_ulong,c_ushort]
+	windll.kernel32.SetConsoleTextAttribute.restype=c_long
+	windll.kernel32.FillConsoleOutputCharacterA.argtypes=[c_ulong,c_char,c_ulong,POINTER(COORD),POINTER(c_ulong)]
+	windll.kernel32.FillConsoleOutputCharacterA.restype=c_long
+	windll.kernel32.FillConsoleOutputAttribute.argtypes=[c_ulong,c_ushort,c_ulong,POINTER(COORD),POINTER(c_ulong)]
+	windll.kernel32.FillConsoleOutputAttribute.restype=c_long
+	windll.kernel32.SetConsoleCursorPosition.argtypes=[c_ulong,POINTER(COORD)]
+	windll.kernel32.SetConsoleCursorPosition.restype=c_long
+	windll.kernel32.SetConsoleCursorInfo.argtypes=[c_ulong,POINTER(CONSOLE_CURSOR_INFO)]
+	windll.kernel32.SetConsoleCursorInfo.restype=c_long
 	sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
 	csinfo=CONSOLE_CURSOR_INFO()
@@ -60,6 +74,6 @@
 				line_start=sbinfo.CursorPosition
 				line_length=sbinfo.Size.X-sbinfo.CursorPosition.X
-			chars_written=c_int()
-			windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),line_length,line_start,byref(chars_written))
+			chars_written=c_ulong()
+			windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_char(' '),line_length,line_start,byref(chars_written))
 			windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,line_length,line_start,byref(chars_written))
 		def clear_screen(self,param):
@@ -76,6 +90,6 @@
 				clear_start=sbinfo.CursorPosition
 				clear_length=((sbinfo.Size.X-sbinfo.CursorPosition.X)+sbinfo.Size.X*(sbinfo.Size.Y-sbinfo.CursorPosition.Y))
-			chars_written=c_int()
-			windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),clear_length,clear_start,byref(chars_written))
+			chars_written=c_ulong()
+			windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_char(' '),clear_length,clear_start,byref(chars_written))
 			windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,clear_length,clear_start,byref(chars_written))
 		def push_cursor(self,param):
@@ -128,7 +142,7 @@
 				else:
 					c=to_int(c,0)
-				if c in range(30,38):
+				if 29<c<38:
 					attr=(attr&0xfff0)|self.rgb2bgr(c-30)
-				elif c in range(40,48):
+				elif 39<c<48:
 					attr=(attr&0xff0f)|(self.rgb2bgr(c-40)<<4)
 				elif c==0:
