/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 402 by johnpye, Fri Mar 31 15:46:35 2006 UTC revision 403 by johnpye, Sat Apr 1 00:46:46 2006 UTC
# Line 152  import os,re Line 152  import os,re
152    
153  def CheckSwigVersion(context):  def CheckSwigVersion(context):
154      context.Message("Checking version of SWIG")      context.Message("Checking version of SWIG")
155      (cin,cout,cerr) = os.popen3(env['SWIG']+' -version');      cmd = env['SWIG']+' -version'
156      output = cout.read()      (cin,coutcerr) = os.popen4(cmd);
157      err = cerr.read()      output = coutcerr.read()
     if err:  
         context.Result("Error running -version cmd:\n-----\n"+err+"\n----\n")  
         return 0  
158            
159      expr = re.compile("^SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$",re.M);      restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
160        expr = re.compile(restr,re.M);
161      m = expr.search(output);      m = expr.search(output);
162      if not m:      if not m:
163          context.Result("Couldn't detect version")          context.Result("error running SWIG or detecting SWIG version")
164          return 0          return 0
165      maj = int(m.group('maj'))      maj = int(m.group('maj'))
166      min = int(m.group('min'))      min = int(m.group('min'))

Legend:
Removed from v.402  
changed lines
  Added in v.403

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22