/[ascend]/trunk/SConstruct
ViewVC logotype

Annotation of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 428 - (hide annotations) (download)
Tue Apr 4 06:41:25 2006 UTC (13 years, 8 months ago) by johnpye
File size: 17426 byte(s)
Much progress on the MinGW build of the Tcl/Tk interface. Builds and links now,
just having some problems getting the DLLs for Tcl/Tk to resolve at runtime.
1 johnpye 393 import os, commands, platform, distutils.sysconfig, os.path
2 johnpye 385
3     #------------------------------------------------------
4     # OPTIONS
5 johnpye 392 #
6     # Note that if you set the options via the command line, they will be
7     # remembered in the file 'options.cache'. It's a feature ;-)
8 johnpye 385
9     opts = Options(['options.cache', 'config.py'])
10     print "PLATFORM = ",platform.system()
11    
12 johnpye 392 # Import the outside environment
13     env = Environment(ENV=os.environ)
14 johnpye 385
15 johnpye 415 if platform.system()=='Windows' and env.has_key('MSVS'):
16 johnpye 414 print "INCLUDE =",env['ENV']['INCLUDE']
17 johnpye 416 print "LIB =",env['ENV']['LIB']
18     print "LINK =",env['LINK']
19     print "LINKCOM =",env['LINKCOM']
20     print "AR =",env['AR']
21     print "ARCOM =",env['ARCOM']
22 johnpye 427 #env['AR']='link /lib'
23 johnpye 414 env.Append(CPPPATH=env['ENV']['INCLUDE'])
24     env.Append(LIBPATH=env['ENV']['LIB'])
25 johnpye 427 env.Append(CPPDEFINES=['_CRT_SECURE_NO_DEPRECATED','_CRT_SECURE_NO_DEPRECATE'])
26 johnpye 414
27 johnpye 385 # Package linking option
28 johnpye 386 opts.Add(EnumOption(
29     'PACKAGE_LINKING'
30 johnpye 385 , 'Style of linking for external libraries'
31     , 'DYNAMIC_PACKAGES'
32 johnpye 386 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
33     ))
34 johnpye 385
35 johnpye 392 # You can turn off building of Tcl/Tk interface
36 johnpye 386 opts.Add(BoolOption(
37     'WITHOUT_TCLTK_GUI'
38     ,"Set to True if you don't want to build the original Tcl/Tk GUI."
39     , False
40     ))
41    
42 johnpye 392 # You can turn off the building of the Python interface
43 johnpye 387 opts.Add(BoolOption(
44     'WITHOUT_PYTHON'
45     ,"Set to True if you don't want to build Python wrappers."
46     , False
47     ))
48    
49 johnpye 392 # Which solvers will we allow?
50     opts.Add(ListOption(
51     'WITH_SOLVERS'
52 johnpye 393 ,"List of the solvers you want to build. The default is the minimum that"
53     +" works."
54 johnpye 392 ,["QRSLV","CMSLV"]
55     ,['QRSLV','MPS','SLV','OPTSQP'
56     ,'NGSLV','CMSLV','LRSLV','MINOS','CONOPT'
57     ,'LSOD','OPTSQP'
58     ]
59     ))
60    
61 johnpye 393 # Where will the local copy of the help files be kept?
62     opts.Add(PackageOption(
63     'WITH_LOCAL_HELP'
64     , "Directory containing the local copy of the help files (optional)"
65     , "no"
66     ))
67    
68     # Will bintoken support be enabled?
69     opts.Add(BoolOption(
70     'WITH_BINTOKEN'
71     ,"Enable bintoken support? This means compiling models as C-code before"
72     +" running them, to increase solving speed for large models."
73     ,False
74     ))
75    
76 johnpye 398 # What should the default ASCENDLIBRARY path be?
77     # Note: users can change it by editing their ~/.ascend.ini
78 johnpye 393 opts.Add(
79     'DEFAULT_ASCENDLIBRARY'
80     ,"Set the default value of the ASCENDLIBRARY -- the location where"
81     +" ASCEND will look for models when running ASCEND"
82     ,os.path.expanduser("~/src/ascend/trunk/models")
83     )
84    
85 johnpye 398 # Where is SWIG?
86     opts.Add(
87     'SWIG'
88     ,"SWIG location, probably only required for MinGW and MSVC users."
89     +" Enter the location as a Windows-style path, for example"
90 johnpye 404 +" 'c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe'."
91 johnpye 398 )
92    
93 johnpye 400 # Build the test suite?
94     opts.Add(BoolOption(
95     'WITH_CUNIT_TESTS'
96     ,"Whether to build the CUnit tests. Default is off. If set to on,"
97     +" you must have CUnit installed somewhere that SCons can"
98     +" find it."
99     ,False
100     ))
101 johnpye 393
102 johnpye 400 # Where are the CUnit includes?
103     opts.Add(PackageOption(
104     'CUNIT_CPPPATH'
105     ,"Where are your CUnit include files?"
106     ,"off"
107     ))
108 johnpye 392
109 johnpye 404 # Where are the CUnit libraries?
110 johnpye 400 opts.Add(PackageOption(
111     'CUNIT_LIBPATH'
112 johnpye 404 ,"Where are your CUnit libraries?"
113 johnpye 400 ,"off"
114     ))
115    
116 johnpye 404 # Where are the Tcl includes?
117     opts.Add(PackageOption(
118     'TCL_CPPPATH'
119     ,"Where are your Tcl include files?"
120     ,None
121     ))
122    
123     # Where are the Tcl libs?
124     opts.Add(PackageOption(
125     'TCL_LIBPATH'
126     ,"Where are your Tcl libraries?"
127     ,None
128     ))
129    
130 johnpye 428 # What is the name of the Tcl lib?
131     opts.Add(
132     'TCL_LIB'
133     ,"Name of Tcl lib (eg 'tcl' or 'tcl83')"
134     ,'tcl'
135     )
136    
137 johnpye 405 # Where are the Tk includes?
138     opts.Add(PackageOption(
139     'TK_CPPPATH'
140     ,"Where are your Tk include files?"
141     ,None
142     ))
143 johnpye 404
144 johnpye 405 # Where are the Tk libs?
145     opts.Add(PackageOption(
146     'TK_LIBPATH'
147     ,"Where are your Tk libraries?"
148     ,None
149     ))
150    
151 johnpye 428 # What is the name of the Tk lib?
152     opts.Add(
153     'TK_LIB'
154     ,"Name of Tk lib (eg 'tk' or 'tk83')"
155     ,'tk'
156     )
157    
158 johnpye 392 # TODO: OTHER OPTIONS?
159     # TODO: flags for optimisation
160 johnpye 393 # TODO: turning on/off bintoken functionality
161 johnpye 427 # TODO: Where will the 'Makefile.bt' file be installed?
162 johnpye 393
163 johnpye 385 opts.Update(env)
164     opts.Save('options.cache',env)
165    
166     Help(opts.GenerateHelpText(env))
167    
168 johnpye 386 with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)
169 johnpye 427 without_tcltk_reason = "disabled by options/config.py"
170 johnpye 386
171 johnpye 387 with_python = (env['WITHOUT_PYTHON']==False)
172 johnpye 427 without_python_reason = "disabled by options/config.py"
173 johnpye 387
174 johnpye 400 with_cunit_tests = env['WITH_CUNIT_TESTS']
175 johnpye 427 without_cunit_reason = "not requested"
176 johnpye 400
177 johnpye 392 print "SOLVERS:",env['WITH_SOLVERS']
178 johnpye 393 print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
179     print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
180     print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
181    
182     subst_dict = {
183     '@WEBHELPROOT@':'http://pye.dyndns.org/ascend/manual/'
184     , '@GLADE_FILE@':'glade/ascend.glade'
185     , '@DEFAULT_ASCENDLIBRARY@':env['DEFAULT_ASCENDLIBRARY']
186     , '@ASCEND_ICON@':'glade/ascend.png'
187     , '@HELP_ROOT@':''
188     }
189    
190     if env['WITH_LOCAL_HELP']:
191     subst_dict['@HELP_ROOT@']=env['WITH_LOCAL_HELP']
192    
193     env.Append(SUBST_DICT=subst_dict)
194    
195 johnpye 385 #------------------------------------------------------
196 johnpye 398 # SPECIAL CONFIGURATION TESTS
197    
198 johnpye 400 #----------------
199     # SWIG
200    
201 johnpye 398 import os,re
202    
203 johnpye 427 need_fortran = False
204    
205 johnpye 413 def get_swig_version(env):
206 johnpye 403 cmd = env['SWIG']+' -version'
207 johnpye 427 (cin,coutcerr) = os.popen4(cmd)
208 johnpye 403 output = coutcerr.read()
209 johnpye 398
210 johnpye 403 restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
211     expr = re.compile(restr,re.M);
212 johnpye 398 m = expr.search(output);
213     if not m:
214 johnpye 413 return None
215 johnpye 398 maj = int(m.group('maj'))
216     min = int(m.group('min'))
217     pat = int(m.group('pat'))
218 johnpye 413
219     return (maj,min,pat)
220 johnpye 398
221 johnpye 413
222     def CheckSwigVersion(context):
223    
224     try:
225     context.Message("Checking version of SWIG... ")
226     maj,min,pat = get_swig_version(context.env)
227     except:
228     context.Result("Failed to detect version, or failed to run SWIG")
229     return 0;
230    
231 johnpye 398 if maj == 1 and (
232 johnpye 400 min > 3
233     or (min == 3 and pat >= 24)
234 johnpye 398 ):
235     context.Result("ok, %d.%d.%d" % (maj,min,pat))
236     return 1;
237 johnpye 401 else:
238     context.Result("too old, %d.%d.%d" % (maj,min,pat))
239     return 0;
240 johnpye 398
241 johnpye 400 #----------------
242     # General purpose library-and-header test
243    
244 johnpye 404 class KeepContext:
245     def __init__(self,context,varprefix):
246     self.keep = {}
247     for k in ['LIBS','LIBPATH','CPPPATH']:
248     if context.env.has_key(k):
249     self.keep[k] = context.env[k]
250    
251     libpath_add = []
252     if context.env.has_key(varprefix+'_LIBPATH'):
253     libpath_add = [env[varprefix+'_LIBPATH']]
254 johnpye 428 #print "Adding '"+str(libpath_add)+"' to lib path"
255 johnpye 400
256 johnpye 404 cpppath_add = []
257     if context.env.has_key(varprefix+'_CPPPATH'):
258     cpppath_add = [env[varprefix+'_CPPPATH']]
259 johnpye 428 #print "Adding '"+str(cpppath_add)+"' to cpp path"
260    
261     libs_add = []
262     if context.env.has_key(varprefix+'_LIB'):
263     libs_add = [env[varprefix+'_LIB']]
264     #print "Adding '"+str(libs_add)+"' to libs"
265    
266 johnpye 405 context.env.Append(
267     LIBPATH = libpath_add
268     , CPPPATH = cpppath_add
269 johnpye 428 , LIBS = libs_add
270 johnpye 405 )
271 johnpye 404
272     def restore(self,context):
273     for k in self.keep:
274     context.env[k]=self.keep[k];
275    
276 johnpye 400 def CheckExtLib(context,libname,text,ext='.c',varprefix=None):
277     """This method will check for variables LIBNAME_LIBPATH
278     and LIBNAME_CPPPATH and try to compile and link the
279     file with the provided text, linking with the
280     library libname."""
281    
282 johnpye 405 context.Message( 'Checking for '+libname+'... ' )
283 johnpye 400
284     if varprefix==None:
285     varprefix = libname.upper()
286    
287 johnpye 404 keep = KeepContext(context,varprefix)
288 johnpye 400
289 johnpye 428 # print "TryLink with CPPPATH="+str(context.env['CPPPATH'])
290     # print "TryLink with LIBS="+str(context.env['LIBS'])
291     # print "TryLink with LIBPATH="+str(context.env['LIBPATH'])
292 johnpye 405
293 johnpye 428 if not context.env.has_key(varprefix+'_LIB'):
294     context.env.AppendUnique(LIBS=libname)
295    
296 johnpye 404 is_ok = context.TryLink(text,ext)
297 johnpye 428
298     # print "Link success? ",(is_ok != 0)
299 johnpye 400
300 johnpye 405 keep.restore(context)
301 johnpye 400
302 johnpye 428 # print "Restored CPPPATH="+str(context.env['CPPPATH'])
303     # print "Restored LIBS="+libname
304     # print "Restored LIBPATH="+str(context.env['LIBPATH'])
305    
306 johnpye 404 context.Result(is_ok)
307     return is_ok
308    
309     #----------------
310     # CUnit test
311    
312 johnpye 400 cunit_test_text = """
313     #include <CUnit/Cunit.h>
314     int maxi(int i1, int i2){
315     return (i1 > i2) ? i1 : i2;
316     }
317    
318     void test_maxi(void){
319     CU_ASSERT(maxi(0,2) == 2);
320     CU_ASSERT(maxi(0,-2) == 0);
321     CU_ASSERT(maxi(2,2) == 2);
322    
323     }
324     int main(void){
325     /* CU_initialize_registry() */
326 johnpye 404 return 0;
327 johnpye 400 }
328     """
329    
330     def CheckCUnit(context):
331 johnpye 412 return context.CheckExtLib(context
332 johnpye 400 ,'cunit'
333     ,cunit_test_text
334     )
335    
336 johnpye 404 #----------------
337 johnpye 405 # Tcl test
338 johnpye 404
339     tcl_check_text = r"""
340     #include <tcl.h>
341     #include <stdio.h>
342     int main(void){
343     printf("%s",TCL_PATCH_LEVEL);
344     return 0;
345     }
346     """
347    
348     def CheckTcl(context):
349 johnpye 405 return CheckExtLib(context,'tcl',tcl_check_text)
350    
351     def CheckTclVersion(context):
352 johnpye 404 keep = KeepContext(context,'TCL')
353 johnpye 405 context.Message("Checking Tcl version... ")
354     (is_ok,output) = context.TryRun(tcl_check_text,'.c')
355 johnpye 404 keep.restore(context)
356     if not is_ok:
357 johnpye 405 context.Result("failed to run check")
358 johnpye 404 return 0
359 johnpye 405
360     major,minor,patch = tuple(int(i) for i in output.split("."))
361     if major != 8 or minor > 3:
362 johnpye 428 context.Result(output+" (bad version)")
363 johnpye 405 # bad version
364     return 0
365    
366     # good version
367 johnpye 428 context.Result(output+" (good)")
368 johnpye 404 return 1
369    
370 johnpye 405 #----------------
371     # Tcl test
372    
373     tk_check_text = r"""
374     #include <tk.h>
375     #include <stdio.h>
376     int main(void){
377     printf("%s",TK_PATCH_LEVEL);
378     return 0;
379     }
380     """
381     def CheckTk(context):
382 johnpye 428 return CheckExtLib(context,'tk',tcl_check_text)
383 johnpye 405
384 johnpye 428
385 johnpye 405 def CheckTkVersion(context):
386     keep = KeepContext(context,'TK')
387     context.Message("Checking Tk version... ")
388     (is_ok,output) = context.TryRun(tk_check_text,'.c')
389 johnpye 404 keep.restore(context)
390     if not is_ok:
391     context.Result("failed to run check")
392     return 0
393     context.Result(output)
394    
395     major,minor,patch = tuple(int(i) for i in output.split("."))
396     if major != 8 or minor > 3:
397     # bad version
398     return 0
399 johnpye 400
400 johnpye 404 # good version
401     return 1
402    
403 johnpye 398 #------------------------------------------------------
404 johnpye 385 # CONFIGURATION
405    
406     conf = Configure(env
407     , custom_tests = {
408 johnpye 398 'CheckSwigVersion' : CheckSwigVersion
409 johnpye 400 , 'CheckCUnit' : CheckCUnit
410 johnpye 404 , 'CheckTcl' : CheckTcl
411     , 'CheckTclVersion' : CheckTclVersion
412 johnpye 405 , 'CheckTk' : CheckTk
413     , 'CheckTkVersion' : CheckTkVersion
414 johnpye 400 # , 'CheckIsNan' : CheckIsNan
415     # , 'CheckCppUnitConfig' : CheckCppUnitConfig
416 johnpye 385 }
417     , config_h = "config.h"
418     )
419    
420 johnpye 398
421 johnpye 385 # Math library
422    
423 johnpye 427 #if not conf.CheckFunc('sinh') and not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
424     # print 'Did not find math library, exiting!'
425     # Exit(1)
426    
427 johnpye 385 # Where is 'isnan'?
428    
429     if not conf.CheckFunc('isnan'):
430     print "Didn't find isnan"
431 johnpye 414 # Exit(1)
432 johnpye 385
433 johnpye 387 # Tcl/Tk
434 johnpye 386
435 johnpye 428 if conf.CheckTcl():
436     if with_tcltk_gui and conf.CheckTclVersion():
437     if conf.CheckTk():
438     if with_tcltk_gui and not conf.CheckTkVersion():
439     without_tcltk_reason = "Require Tk version <= 8.3. See 'scons -h'"
440     with_tcltk_gui = False
441     else:
442     without_tcltk_reason = "Tk not found."
443     with_tcltk_gui = False
444     else:
445 johnpye 405 without_tcltk_reason = "Require Tcl <= 8.3 Tcl."
446 johnpye 404 with_tcltk_gui = False
447 johnpye 386
448 johnpye 405 else:
449 johnpye 428 without_tcltk_reason = "Tcl not found."
450 johnpye 412 with_tcltk_gui = False
451    
452 johnpye 395 # Python... obviously we're already running python, so we just need to
453     # check that we can link to the python library OK:
454    
455 johnpye 391 if platform.system()=="Windows":
456 johnpye 395 python_lib='python24'
457 johnpye 391 else:
458 johnpye 395 python_lib='python2.4'
459 johnpye 391
460 johnpye 395 # SWIG version
461    
462 johnpye 396 if platform.system()=="Windows":
463     env['ENV']['SWIGFEATURES']='-O'
464     else:
465     env['ENV']['SWIGFEATURES']='-O'
466 johnpye 395
467 johnpye 413
468     if not conf.CheckSwigVersion():
469     without_python_reason = 'SWIG >= 1.3.24 is required'
470     with_python = False
471    
472 johnpye 400 # CUnit
473    
474     if with_cunit_tests:
475 johnpye 404 if not conf.CheckCUnit():
476 johnpye 427 without_cunit_reason = 'CUnit not found'
477    
478     # BLAS
479    
480     if conf.CheckLib('blas'):
481     print "FOUND BLAS"
482     with_local_blas = False
483     without_local_blas_reason = "Found BLAS installed on system"
484     else:
485     print "DIDN'T FIND BLAS"
486     with_local_blas = True
487     need_fortran = True
488    
489     # FORTRAN
490    
491     if need_fortran:
492     conf.env.Tool('f77')
493     detect_fortran = conf.env.Detect(['g77','f77'])
494     if detect_fortran:
495     # For some reason, g77 doesn't get detected properly on MinGW
496     if not env.has_key('F77'):
497     conf.env.Replace(F77=detect_fortran)
498     conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
499     conf.env.Replace(F77FLAGS='')
500 johnpye 428 #print "F77:",conf.env['F77']
501     #print "F77COM:",conf.env['F77COM']
502     #print "F77FLAGS:",conf.env['F77FLAGS']
503 johnpye 427 fortran_builder = Builder(
504     action='$F77COM'
505     , suffix='.o'
506     , src_suffix='.f'
507     )
508     conf.env.Append(BUILDERS={'Fortran':fortran_builder})
509     else:
510     print "FORTRAN-77 required but not found"
511 johnpye 404 Exit(1)
512 johnpye 427 else:
513     print "FORTRAN not required"
514 johnpye 400
515 johnpye 385 # TODO: -D_HPUX_SOURCE is needed
516    
517     # TODO: check size of void*
518    
519 johnpye 393 # TODO: detect if dynamic libraries are possible or not
520    
521 johnpye 427 if platform.system()=="Windows" and env.has_key('MSVS'):
522     if not conf.CheckHeader('windows.h') and env['PACKAGE_LINKING']=='DYNAMIC_PACKAGES':
523     print "Reverting to STATIC_PACKAGES since windows.h is not available. Probably you "\
524     +"need to install the Microsoft Windows Server 2003 Platform SDK, or similar."
525     env['PACKAGE_LINKING']='STATIC_PACKAGES'
526    
527     if with_python and not conf.CheckHeader('basetsd.h'):
528     with_python = 0;
529     without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
530    
531     conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
532    
533 johnpye 395 conf.Finish()
534    
535     env.Append(PYTHON_LIBPATH=[distutils.sysconfig.PREFIX+"/libs"])
536     env.Append(PYTHON_LIB=[python_lib])
537     env.Append(PYTHON_CPPPATH=[distutils.sysconfig.get_python_inc()])
538    
539 johnpye 385 #------------------------------------------------------
540 johnpye 393 # RECIPE: 'SubstInFile', used in pygtk SConscript
541    
542     import re
543 johnpye 395 from SCons.Script import * # the usual scons stuff you get in a SConscript
544 johnpye 393
545 johnpye 395 def TOOL_SUBST(env):
546     """Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
547     from the source to the target.
548     The values of SUBST_DICT first have any construction variables expanded
549     (its keys are not expanded).
550     If a value of SUBST_DICT is a python callable function, it is called and
551     the result is expanded as the value.
552     If there's more than one source and more than one target, each target gets
553     substituted from the corresponding source.
554 johnpye 393 """
555 johnpye 395 env.Append(TOOLS = 'SUBST')
556     def do_subst_in_file(targetfile, sourcefile, dict):
557     """Replace all instances of the keys of dict with their values.
558     For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
559     then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
560     """
561     try:
562     f = open(sourcefile, 'rb')
563     contents = f.read()
564     f.close()
565     except:
566     raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
567     for (k,v) in dict.items():
568     contents = re.sub(k, v, contents)
569     try:
570     f = open(targetfile, 'wb')
571     f.write(contents)
572     f.close()
573     except:
574     raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
575     return 0 # success
576 johnpye 393
577 johnpye 395 def subst_in_file(target, source, env):
578     if not env.has_key('SUBST_DICT'):
579     raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
580     d = dict(env['SUBST_DICT']) # copy it
581     for (k,v) in d.items():
582     if callable(v):
583     d[k] = env.subst(v())
584     elif SCons.Util.is_String(v):
585     d[k]=env.subst(v)
586     else:
587     raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
588     for (t,s) in zip(target, source):
589     return do_subst_in_file(str(t), str(s), d)
590 johnpye 393
591 johnpye 395 def subst_in_file_string(target, source, env):
592     """This is what gets printed on the console."""
593     return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
594     for (t,s) in zip(target, source)])
595 johnpye 393
596 johnpye 395 def subst_emitter(target, source, env):
597     """Add dependency from substituted SUBST_DICT to target.
598     Returns original target, source tuple unchanged.
599     """
600     d = env['SUBST_DICT'].copy() # copy it
601     for (k,v) in d.items():
602     if callable(v):
603     d[k] = env.subst(v())
604     elif SCons.Util.is_String(v):
605     d[k]=env.subst(v)
606     Depends(target, SCons.Node.Python.Value(d))
607     return target, source
608 johnpye 393
609 johnpye 395 subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string)
610     env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
611    
612     TOOL_SUBST(env)
613    
614 johnpye 393 #------------------------------------------------------
615 johnpye 385 # SUBDIRECTORIES....
616    
617 johnpye 393
618 johnpye 385 env.Append(CPPPATH=['..'])
619    
620     env.SConscript(['base/generic/general/SConscript'],'env')
621    
622     env.SConscript(['base/generic/utilities/SConscript'],'env')
623    
624     env.SConscript(['base/generic/compiler/SConscript'],'env')
625    
626     env.SConscript(['base/generic/solver/SConscript'],'env')
627    
628     env.SConscript(['base/generic/packages/SConscript'],'env')
629 johnpye 386
630     if with_tcltk_gui:
631     env.SConscript(['tcltk98/generic/interface/SConscript'],'env')
632 johnpye 391 else:
633 johnpye 405 print "Skipping... Tcl/Tk GUI isn't being built:",without_tcltk_reason
634 johnpye 386
635 johnpye 387 if with_python:
636     env.SConscript(['pygtk/interface/SConscript'],'env')
637 johnpye 391 else:
638 johnpye 413 print "Skipping... Python GUI isn't being built:",without_python_reason
639 johnpye 400
640     if with_cunit_tests:
641     testdirs = ['general','solver','utilities']
642     for testdir in testdirs:
643     path = 'base/generic/'+testdir+'/test/'
644     env.SConscript([path+'SConscript'],'env')
645     env.SConscript(['test/SConscript'],'env')
646     env.SConscript(['base/generic/test/SConscript'],'env')
647    
648    
649     else:
650 johnpye 427 print "Skipping... CUnit tests aren't being built:",without_cunit_reason
651 johnpye 400
652 johnpye 427 #if with_tcltk_gui:
653     if with_local_blas:
654     env.SConscript(['blas/SConscript'],'env')
655     else:
656     print "Skipping... BLAS won't be build:", without_local_blas_reason
657    
658     env.SConscript(['lsod/SConscript'],'env')
659    
660     env.SConscript(['linpack/SConscript'],'env')
661    
662 johnpye 400 #------------------------------------------------------
663     # INSTALLATION
664    
665     # TODO: add install options

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