/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 396 by johnpye, Fri Mar 31 06:24:11 2006 UTC revision 398 by johnpye, Fri Mar 31 07:55:11 2006 UTC
# Line 61  opts.Add(BoolOption( Line 61  opts.Add(BoolOption(
61      ,False      ,False
62  ))  ))
63    
64    # What should the default ASCENDLIBRARY path be?
65    # Note: users can change it by editing their ~/.ascend.ini
66  opts.Add(  opts.Add(
67      'DEFAULT_ASCENDLIBRARY'      'DEFAULT_ASCENDLIBRARY'
68      ,"Set the default value of the ASCENDLIBRARY -- the location where"      ,"Set the default value of the ASCENDLIBRARY -- the location where"
# Line 68  opts.Add( Line 70  opts.Add(
70      ,os.path.expanduser("~/src/ascend/trunk/models")      ,os.path.expanduser("~/src/ascend/trunk/models")
71  )  )
72    
73    # Where is SWIG?
74    opts.Add(
75        'SWIG'
76        ,"SWIG location, probably only required for MinGW and MSVC users."
77            +" Enter the location as a Windows-style path, for example"
78            +" 'c:\msys\1.0\home\john\swigwin-1.3.29\swig.exe'."
79    )
80    
81  # Where will the 'Makefile.bt' file be installed  # Where will the 'Makefile.bt' file be installed
82    
83  # TODO: add install options  # TODO: add install options
# Line 109  if env['WITH_LOCAL_HELP']: Line 119  if env['WITH_LOCAL_HELP']:
119  env.Append(SUBST_DICT=subst_dict)  env.Append(SUBST_DICT=subst_dict)
120    
121  #------------------------------------------------------  #------------------------------------------------------
122    # SPECIAL CONFIGURATION TESTS
123    
124    import os,re
125    
126    def CheckSwigVersion(context):
127        context.Message("Checking version of SWIG")
128        (cin,cout,cerr) = os.popen3(env['SWIG']+' -version');
129        output = cout.read()
130        err = cerr.read()
131        if err:
132            context.Result("Error running -version cmd:"+err)
133            return 0
134        
135        expr = re.compile("^SWIG Version (?P<maj>[0-9]+)\.(?P<min>[0-9]+)\.(?P<pat>[0-9]+)$",re.M);
136        m = expr.search(output);
137        if not m:
138            context.Result("Couldn't detect version")
139            return 0
140        maj = int(m.group('maj'))
141        min = int(m.group('min'))
142        pat = int(m.group('pat'))
143        
144        if maj == 1 and (
145                min > 1
146                or (min == 1 and pat >= 24)
147            ):
148            context.Result("ok, %d.%d.%d" % (maj,min,pat))
149            return 1;
150        context.Result("ok, %d.%d.%d" % (maj,min,pat))
151        return 0;
152    
153    #------------------------------------------------------
154  # CONFIGURATION  # CONFIGURATION
155    
156  conf = Configure(env  conf = Configure(env
157      , custom_tests = {      , custom_tests = {
158  #       'CheckIsNan' : CheckIsNan  #       'CheckIsNan' : CheckIsNan
159  #       ,'CheckCppUnitConfig' : CheckCppUnitConfig  #       ,'CheckCppUnitConfig' : CheckCppUnitConfig
160            'CheckSwigVersion' : CheckSwigVersion
161      }      }
162      , config_h = "config.h"      , config_h = "config.h"
163  )  )
164    
165    if not conf.CheckSwigVersion():
166        print 'SWIG version is not OK'
167        Exit(1)
168    
169  # Math library  # Math library
170  if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):  if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
171      print 'Did not find libm.a or m.lib, exiting!'      print 'Did not find libm.a or m.lib, exiting!'
# Line 172  else: Line 219  else:
219  # SWIG version  # SWIG version
220    
221  if platform.system()=="Windows":  if platform.system()=="Windows":
222      env['SWIG']=['c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe']      #env['SWIG']=['c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe']
223      env['ENV']['SWIGFEATURES']='-O'      env['ENV']['SWIGFEATURES']='-O'
224  else:  else:
225      env['ENV']['SWIGFEATURES']='-O'      env['ENV']['SWIGFEATURES']='-O'
# Line 295  if with_python: Line 342  if with_python:
342      env.SConscript(['pygtk/interface/SConscript'],'env')      env.SConscript(['pygtk/interface/SConscript'],'env')
343  else:  else:
344      print "Skipping... Python GUI isn't being built"      print "Skipping... Python GUI isn't being built"
   
   

Legend:
Removed from v.396  
changed lines
  Added in v.398

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