/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 412 by johnpye, Mon Apr 3 03:31:30 2006 UTC revision 413 by johnpye, Mon Apr 3 03:57:09 2006 UTC
# Line 149  env.Append(CPPDEFINES=env['PACKAGE_LINKI Line 149  env.Append(CPPDEFINES=env['PACKAGE_LINKI
149  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)  with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)
150    
151  with_python = (env['WITHOUT_PYTHON']==False)  with_python = (env['WITHOUT_PYTHON']==False)
152    without_python_reason = None
153    
154  with_cunit_tests = env['WITH_CUNIT_TESTS']  with_cunit_tests = env['WITH_CUNIT_TESTS']
155    
# Line 179  env.Append(SUBST_DICT=subst_dict) Line 180  env.Append(SUBST_DICT=subst_dict)
180    
181  import os,re  import os,re
182    
183  def CheckSwigVersion(context):  def get_swig_version(env):
     context.Message("Checking version of SWIG... ")  
184      cmd = env['SWIG']+' -version'      cmd = env['SWIG']+' -version'
185      (cin,coutcerr) = os.popen4(cmd);      (cin,coutcerr) = os.popen4(cmd);
186      output = coutcerr.read()      output = coutcerr.read()
# Line 189  def CheckSwigVersion(context): Line 189  def CheckSwigVersion(context):
189      expr = re.compile(restr,re.M);      expr = re.compile(restr,re.M);
190      m = expr.search(output);      m = expr.search(output);
191      if not m:      if not m:
192          context.Result("error running SWIG or detecting SWIG version")          return None
         return 0  
193      maj = int(m.group('maj'))      maj = int(m.group('maj'))
194      min = int(m.group('min'))      min = int(m.group('min'))
195      pat = int(m.group('pat'))      pat = int(m.group('pat'))
196    
197        return (maj,min,pat)
198        
199    
200    def CheckSwigVersion(context):
201        
202        try:
203            context.Message("Checking version of SWIG... ")
204            maj,min,pat = get_swig_version(context.env)
205        except:
206            context.Result("Failed to detect version, or failed to run SWIG")
207            return 0;
208            
209      if maj == 1 and (      if maj == 1 and (
210              min > 3              min > 3
# Line 363  conf = Configure(env Line 374  conf = Configure(env
374      , config_h = "config.h"      , config_h = "config.h"
375  )  )
376    
 if not conf.CheckSwigVersion():  
     print 'SWIG version is not OK'  
     Exit(1)  
377    
378  # Math library  # Math library
379  #if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):  #if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
# Line 403  else: Line 411  else:
411  # SWIG version  # SWIG version
412    
413  if platform.system()=="Windows":  if platform.system()=="Windows":
     #env['SWIG']=['c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe']  
414      env['ENV']['SWIGFEATURES']='-O'      env['ENV']['SWIGFEATURES']='-O'
415  else:  else:
416      env['ENV']['SWIGFEATURES']='-O'      env['ENV']['SWIGFEATURES']='-O'
417    
418    
419    if not conf.CheckSwigVersion():
420        without_python_reason = 'SWIG >= 1.3.24 is required'
421        with_python = False
422    
423  # CUnit  # CUnit
424    
425  if with_cunit_tests:  if with_cunit_tests:
# Line 427  env.Append(PYTHON_LIBPATH=[distutils.sys Line 439  env.Append(PYTHON_LIBPATH=[distutils.sys
439  env.Append(PYTHON_LIB=[python_lib])  env.Append(PYTHON_LIB=[python_lib])
440  env.Append(PYTHON_CPPPATH=[distutils.sysconfig.get_python_inc()])  env.Append(PYTHON_CPPPATH=[distutils.sysconfig.get_python_inc()])
441    
 if not with_python:  
     print "Can't build python interface"  
     Exit(1)  
   
442  #------------------------------------------------------  #------------------------------------------------------
443  # RECIPE: 'SubstInFile', used in pygtk SConscript  # RECIPE: 'SubstInFile', used in pygtk SConscript
444    
# Line 530  else: Line 538  else:
538  if with_python:  if with_python:
539      env.SConscript(['pygtk/interface/SConscript'],'env')      env.SConscript(['pygtk/interface/SConscript'],'env')
540  else:  else:
541      print "Skipping... Python GUI isn't being built"      print "Skipping... Python GUI isn't being built:",without_python_reason
542    
543  if with_cunit_tests:  if with_cunit_tests:
544      testdirs = ['general','solver','utilities']      testdirs = ['general','solver','utilities']

Legend:
Removed from v.412  
changed lines
  Added in v.413

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