/[ascend]/trunk/SConstruct
ViewVC logotype

Annotation of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 646 - (hide annotations) (download)
Mon May 29 13:19:54 2006 UTC (14 years, 3 months ago) by johnpye
File size: 29506 byte(s)
Minor changes to bison/yacc detection, hoping this will make MSVC happier...
1 johnpye 393 import os, commands, platform, distutils.sysconfig, os.path
2 johnpye 385
3 johnpye 627 version = "0.9.5.92"
4 johnpye 439
5 johnpye 385 #------------------------------------------------------
6     # OPTIONS
7 johnpye 392 #
8     # Note that if you set the options via the command line, they will be
9     # remembered in the file 'options.cache'. It's a feature ;-)
10 johnpye 385
11     opts = Options(['options.cache', 'config.py'])
12 johnpye 464 #print "PLATFORM = ",platform.system()
13 johnpye 385
14 johnpye 464 if platform.system()=="Windows":
15 johnpye 631 default_tcl_lib = "tcl84"
16     default_tk_lib = "tk84"
17 johnpye 464 default_tktable_lib = "Tktable28"
18 johnpye 499 default_install_assets = "glade/"
19     icon_extension = '.png'
20 johnpye 521 default_tcl = "c:\\Tcl"
21 johnpye 643 if os.environ.get('MSYSTEM')=="MINGW32":
22 johnpye 642 default_tcl_libpath="$TCL\\bin"
23     else:
24     default_tcl_libpath="$TCL\\lib"
25 johnpye 627 default_rel_distdir = '.'
26 johnpye 628 default_absolute_paths = False
27 johnpye 464 else:
28 johnpye 521 default_tcl_lib = "tcl8.3"
29     default_tk_lib = "tk8.3"
30 johnpye 464 default_tktable_lib = "Tktable2.8"
31 johnpye 628 default_install_assets = "$INSTALL_ASCDATA/glade/"
32 johnpye 499 icon_extension = '.svg'
33 johnpye 521 default_tcl = os.path.expanduser("~/activetcl")
34 johnpye 541 default_tcl_libpath = "$TCL/lib"
35 johnpye 627 default_rel_distdir = '../share/ascend'
36 johnpye 628 default_absolute_paths = True
37 johnpye 463
38 johnpye 551 if not os.path.isdir(default_tcl):
39     default_tcl = '/usr'
40    
41 johnpye 562 opts.Add(
42     'CC'
43     ,'C Compiler command'
44     ,None
45     )
46    
47     opts.Add(
48     'CXX'
49     ,'C++ Compiler command'
50     ,None
51     )
52    
53 johnpye 591 opts.Add(BoolOption(
54     'GCOV'
55 johnpye 593 , 'Whether to enable coverage testing in object code'
56     , False
57 johnpye 591 ))
58    
59 johnpye 385 # Package linking option
60 johnpye 386 opts.Add(EnumOption(
61     'PACKAGE_LINKING'
62 johnpye 385 , 'Style of linking for external libraries'
63     , 'DYNAMIC_PACKAGES'
64 johnpye 386 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
65     ))
66 johnpye 385
67 johnpye 526 opts.Add(BoolOption(
68     'WITH_GCCVISIBILITY'
69     ,"Whether to use GCC Visibility features (only applicable if available)"
70     ,True
71     ))
72    
73 johnpye 392 # You can turn off building of Tcl/Tk interface
74 johnpye 386 opts.Add(BoolOption(
75 johnpye 542 'WITH_TCLTK'
76 johnpye 386 ,"Set to True if you don't want to build the original Tcl/Tk GUI."
77 johnpye 542 , True
78 johnpye 386 ))
79    
80 johnpye 392 # You can turn off the building of the Python interface
81 johnpye 387 opts.Add(BoolOption(
82 johnpye 542 'WITH_PYTHON'
83 johnpye 387 ,"Set to True if you don't want to build Python wrappers."
84 johnpye 542 , True
85 johnpye 387 ))
86    
87 johnpye 392 # Which solvers will we allow?
88     opts.Add(ListOption(
89     'WITH_SOLVERS'
90 johnpye 393 ,"List of the solvers you want to build. The default is the minimum that"
91     +" works."
92 johnpye 392 ,["QRSLV","CMSLV"]
93     ,['QRSLV','MPS','SLV','OPTSQP'
94     ,'NGSLV','CMSLV','LRSLV','MINOS','CONOPT'
95     ,'LSOD','OPTSQP'
96     ]
97     ))
98    
99 johnpye 393 # Where will the local copy of the help files be kept?
100     opts.Add(PackageOption(
101     'WITH_LOCAL_HELP'
102     , "Directory containing the local copy of the help files (optional)"
103     , "no"
104     ))
105    
106     # Will bintoken support be enabled?
107     opts.Add(BoolOption(
108     'WITH_BINTOKEN'
109     ,"Enable bintoken support? This means compiling models as C-code before"
110     +" running them, to increase solving speed for large models."
111     ,False
112     ))
113    
114 johnpye 398 # What should the default ASCENDLIBRARY path be?
115     # Note: users can change it by editing their ~/.ascend.ini
116 johnpye 393 opts.Add(
117     'DEFAULT_ASCENDLIBRARY'
118     ,"Set the default value of the ASCENDLIBRARY -- the location where"
119     +" ASCEND will look for models when running ASCEND"
120 johnpye 628 ,"$INSTALL_ASCDATA/models"
121 johnpye 393 )
122    
123 johnpye 398 # Where is SWIG?
124     opts.Add(
125     'SWIG'
126     ,"SWIG location, probably only required for MinGW and MSVC users."
127     +" Enter the location as a Windows-style path, for example"
128 johnpye 404 +" 'c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe'."
129 johnpye 398 )
130    
131 johnpye 400 # Build the test suite?
132     opts.Add(BoolOption(
133 johnpye 593 'WITH_CUNIT'
134 johnpye 400 ,"Whether to build the CUnit tests. Default is off. If set to on,"
135     +" you must have CUnit installed somewhere that SCons can"
136 johnpye 463 +" find it, or else use the CUNIT_* options to specify."
137 johnpye 400 ,False
138     ))
139 johnpye 393
140 johnpye 400 # Where are the CUnit includes?
141     opts.Add(PackageOption(
142     'CUNIT_CPPPATH'
143     ,"Where are your CUnit include files?"
144 johnpye 459 ,'off'
145 johnpye 400 ))
146 johnpye 392
147 johnpye 404 # Where are the CUnit libraries?
148 johnpye 400 opts.Add(PackageOption(
149     'CUNIT_LIBPATH'
150 johnpye 404 ,"Where are your CUnit libraries?"
151 johnpye 459 ,'off'
152 johnpye 400 ))
153    
154 johnpye 521
155 johnpye 534 opts.Add(
156 johnpye 521 'TCL'
157     ,'Base of Tcl distribution'
158     ,default_tcl
159 johnpye 534 )
160 johnpye 521
161 johnpye 404 # Where are the Tcl includes?
162 johnpye 534 opts.Add(
163 johnpye 404 'TCL_CPPPATH'
164     ,"Where are your Tcl include files?"
165 johnpye 521 ,"$TCL/include"
166 johnpye 534 )
167 johnpye 404
168     # Where are the Tcl libs?
169 johnpye 534 opts.Add(
170 johnpye 404 'TCL_LIBPATH'
171     ,"Where are your Tcl libraries?"
172 johnpye 541 ,default_tcl_libpath
173 johnpye 534 )
174 johnpye 404
175 johnpye 428 # What is the name of the Tcl lib?
176     opts.Add(
177     'TCL_LIB'
178 johnpye 561 ,"Name of Tcl lib (eg 'tcl' or 'tcl83'), for full path to static library (if STATIC_TCLTK is set)"
179 johnpye 464 ,default_tcl_lib
180 johnpye 428 )
181    
182 johnpye 405 # Where are the Tk includes?
183 johnpye 534 opts.Add(
184 johnpye 405 'TK_CPPPATH'
185     ,"Where are your Tk include files?"
186 johnpye 464 ,'$TCL_CPPPATH'
187 johnpye 534 )
188 johnpye 404
189 johnpye 405 # Where are the Tk libs?
190 johnpye 534 opts.Add(
191 johnpye 405 'TK_LIBPATH'
192     ,"Where are your Tk libraries?"
193 johnpye 464 ,'$TCL_LIBPATH'
194 johnpye 534 )
195 johnpye 405
196 johnpye 428 # What is the name of the Tk lib?
197     opts.Add(
198     'TK_LIB'
199 johnpye 521 ,"Name of Tk lib (eg 'tk' or 'tk83'), or full path to static library"
200 johnpye 464 ,default_tk_lib
201 johnpye 435 )
202    
203 johnpye 460 # Static linking to TkTable
204    
205     opts.Add(BoolOption(
206 johnpye 521 'STATIC_TCLTK'
207 johnpye 554 ,'Set true for static linking for Tcl/Tk and TkTable. EXPERIMENTAL'
208 johnpye 460 ,False
209     ))
210    
211 johnpye 464 opts.Add(
212 johnpye 460 'TKTABLE_LIBPATH'
213     ,'Location of TkTable static library'
214 johnpye 464 ,'$TCL_LIBPATH/Tktable2.8'
215     )
216 johnpye 460
217 johnpye 435 opts.Add(
218 johnpye 460 'TKTABLE_LIB'
219 johnpye 521 ,'Stem name of TkTable (eg tktable2.8, no ".so" or "lib") shared library, or full path of static tktable (/usr/lib/...)'
220 johnpye 464 ,default_tktable_lib
221 johnpye 460 )
222    
223     opts.Add(
224 johnpye 521 'TKTABLE_CPPPATH'
225     ,'Location of TkTable header file'
226     ,'$TCL_CPPPATH'
227     )
228    
229     opts.Add(
230     'X11'
231 johnpye 554 ,'Base X11 directory. Only used when STATIC_TCLTK is turned on. EXPERIMENTAL'
232 johnpye 521 ,'/usr/X11R6'
233     )
234    
235     opts.Add(
236     'X11_LIBPATH'
237 johnpye 554 ,'Location of X11 lib. EXPERIMENTAL'
238 johnpye 521 ,'$X11/lib'
239     )
240    
241     opts.Add(
242     'X11_CPPPATH'
243 johnpye 554 ,'Location of X11 includes. EXPERIMENTAL'
244 johnpye 521 ,'$X11/include'
245     )
246    
247     opts.Add(
248     'X11_LIB'
249 johnpye 554 ,'Name of X11 lib. EXPERIMENTAL'
250 johnpye 521 ,'X11'
251     )
252    
253     opts.Add(
254 johnpye 435 'INSTALL_PREFIX'
255     ,'Root location for installed files'
256 johnpye 449 ,'/usr/local'
257 johnpye 428 )
258    
259 johnpye 435 opts.Add(
260     'INSTALL_BIN'
261     ,'Location to put binaries during installation'
262     ,"$INSTALL_PREFIX/bin"
263     )
264    
265     opts.Add(
266 johnpye 463 'INSTALL_LIB'
267     ,'Location to put binaries during installation'
268     ,"$INSTALL_PREFIX/lib"
269     )
270    
271     opts.Add(
272 ben.allan 624 'INSTALL_SHARE'
273 johnpye 628 ,'Common shared-file location on this system'
274     ,"$INSTALL_PREFIX/share"
275 johnpye 435 )
276    
277 johnpye 628
278 johnpye 435 opts.Add(
279 johnpye 628 'INSTALL_ASCDATA'
280     ,"Location of ASCEND shared data (TK, python, models etc)"
281     ,"$INSTALL_SHARE/ascend"
282     )
283    
284     opts.Add(
285 johnpye 435 'INSTALL_INCLUDE'
286     ,'Location to put header files during installation'
287     ,"$INSTALL_PREFIX/include"
288     )
289    
290 johnpye 448 opts.Add(
291 johnpye 455 'PYGTK_ASSETS'
292 johnpye 532 ,'Default location for Glade assets (placed in pygtk/config.py)'
293 johnpye 455 ,default_install_assets
294     )
295    
296 johnpye 508 opts.Add(BoolOption(
297     'DEBUG'
298     ,"Compile source with debugger symbols, eg for use with 'gdb'"
299     ,False
300     ))
301    
302 johnpye 597 opts.Add(BoolOption(
303     'MALLOC_DEBUG'
304     ,"Compile with debugging version of MALLOC. Required for full CUnit testing"
305     ,False
306     ))
307    
308 johnpye 455 opts.Add(
309 johnpye 448 'INSTALL_ROOT'
310     ,'For use by RPM only: location of %{buildroot} during rpmbuild'
311     ,""
312     )
313    
314 johnpye 563 opts.Add(
315     'DISTTAR_NAME'
316     ,"Stem name of the tarball created by 'scons dist'. So for 'ascend-aaa.tar.bz2', set this to 'ascend-aaa'."
317     ,"ascend-"+version
318     )
319    
320 johnpye 605 opts.Add(BoolOption(
321 johnpye 628 'ABSOLUTE_PATHS'
322 johnpye 605 ,"Whether to use absolute or relative paths in the installed Tcl/Tk interface. If you want to build an RPM, set this to false."
323 johnpye 628 ,default_absolute_paths
324 johnpye 605 ))
325    
326 johnpye 578 opts.Add(
327     'WIN_INSTALLER_NAME'
328     ,"Name of the installer .exe to create under Windows (minus the '.exe')"
329     ,"ascend-"+version
330     )
331    
332 johnpye 594 opts.Add(BoolOption(
333     'WITH_XTERM_COLORS'
334     ,"Set to 0 if you don't want xterm colour codes in the console output"
335     ,True
336     ))
337    
338 johnpye 546 if platform.system()!="Windows":
339     opts.Add(BoolOption(
340     'WITH_GCCVISIBILITY'
341     , 'Whether to use GCC Visibility extensions when building with GCC 4.0'
342     , True
343     ))
344    
345 johnpye 392 # TODO: OTHER OPTIONS?
346     # TODO: flags for optimisation
347 johnpye 393 # TODO: turning on/off bintoken functionality
348 johnpye 427 # TODO: Where will the 'Makefile.bt' file be installed?
349 johnpye 393
350 johnpye 498 # Import the outside environment
351    
352 johnpye 569 if os.environ.get('OSTYPE')=='msys':
353 johnpye 552 env = Environment(
354     ENV=os.environ
355 johnpye 578 , tools=['mingw','lex','yacc','fortran','swig','disttar','nsis']
356 johnpye 552 , toolpath=['scons']
357     )
358 johnpye 529 env['IS_MINGW']=True
359 johnpye 498 else:
360 johnpye 552 env = Environment(
361     ENV=os.environ
362 johnpye 578 ,tools=['default','lex','yacc','fortran','swig','disttar','nsis']
363 johnpye 552 , toolpath=['scons']
364     )
365 johnpye 498
366     if platform.system()=='Windows' and env.has_key('MSVS'):
367     print "INCLUDE =",env['ENV']['INCLUDE']
368     print "LIB =",env['ENV']['LIB']
369 johnpye 506 print "PATH =",env['ENV']['PATH']
370 johnpye 498 env.Append(CPPPATH=env['ENV']['INCLUDE'])
371     env.Append(LIBPATH=env['ENV']['LIB'])
372 johnpye 637 env.Append(CPPDEFINES=['_CRT_SECURE_NO_DEPRECATE'])
373 johnpye 498
374 johnpye 385 opts.Update(env)
375     opts.Save('options.cache',env)
376    
377     Help(opts.GenerateHelpText(env))
378    
379 johnpye 551 with_tcltk = env.get('WITH_TCLTK')
380 johnpye 427 without_tcltk_reason = "disabled by options/config.py"
381 johnpye 386
382 johnpye 551 with_python = env.get('WITH_PYTHON')
383 johnpye 427 without_python_reason = "disabled by options/config.py"
384 johnpye 387
385 johnpye 593 with_cunit = env.get('WITH_CUNIT')
386 johnpye 427 without_cunit_reason = "not requested"
387 johnpye 400
388 johnpye 631 if platform.system()=="Windows":
389     with_installer=1
390     else:
391     with_installer=0
392     without_installer_reason = "only possible under Windows"
393    
394 johnpye 464 #print "SOLVERS:",env['WITH_SOLVERS']
395     #print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
396     #print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
397 johnpye 393
398 johnpye 463 can_install = True
399     if platform.system()=='Windows':
400     can_install = False
401    
402     env['CAN_INSTALL']=can_install
403    
404 johnpye 521 print "TCL_CPPPATH =",env['TCL_CPPPATH']
405     print "TCL_LIBPATH =",env['TCL_LIBPATH']
406     print "TCL_LIB =",env['TCL_LIB']
407 johnpye 562 print "CC =",env['CC']
408     print "CXX =",env['CXX']
409 johnpye 393
410 johnpye 628 print "ABSOLUTE PATHS =",env['ABSOLUTE_PATHS']
411 johnpye 385 #------------------------------------------------------
412 johnpye 398 # SPECIAL CONFIGURATION TESTS
413    
414 johnpye 463 need_fortran = False
415    
416 johnpye 400 #----------------
417     # SWIG
418    
419 johnpye 398 import os,re
420    
421 johnpye 413 def get_swig_version(env):
422 johnpye 403 cmd = env['SWIG']+' -version'
423 johnpye 427 (cin,coutcerr) = os.popen4(cmd)
424 johnpye 403 output = coutcerr.read()
425 johnpye 398
426 johnpye 403 restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
427     expr = re.compile(restr,re.M);
428 johnpye 398 m = expr.search(output);
429     if not m:
430 johnpye 413 return None
431 johnpye 398 maj = int(m.group('maj'))
432     min = int(m.group('min'))
433     pat = int(m.group('pat'))
434 johnpye 413
435     return (maj,min,pat)
436 johnpye 398
437 johnpye 413
438     def CheckSwigVersion(context):
439    
440     try:
441     context.Message("Checking version of SWIG... ")
442     maj,min,pat = get_swig_version(context.env)
443     except:
444     context.Result("Failed to detect version, or failed to run SWIG")
445     return 0;
446    
447 johnpye 478 context.env['SWIGVERSION']=tuple([maj,min,pat])
448    
449 johnpye 398 if maj == 1 and (
450 johnpye 400 min > 3
451     or (min == 3 and pat >= 24)
452 johnpye 398 ):
453     context.Result("ok, %d.%d.%d" % (maj,min,pat))
454     return 1;
455 johnpye 401 else:
456     context.Result("too old, %d.%d.%d" % (maj,min,pat))
457     return 0;
458 johnpye 398
459 johnpye 400 #----------------
460     # General purpose library-and-header test
461    
462 johnpye 404 class KeepContext:
463 johnpye 521 def __init__(self,context,varprefix,static=False):
464 johnpye 404 self.keep = {}
465 johnpye 521 for k in ['LIBS','LIBPATH','CPPPATH','LINKFLAGS']:
466 johnpye 404 if context.env.has_key(k):
467     self.keep[k] = context.env[k]
468 johnpye 463 else:
469     self.keep[k] = None
470 johnpye 404
471     if context.env.has_key(varprefix+'_CPPPATH'):
472 johnpye 521 context.env.Append(CPPPATH=[env[varprefix+'_CPPPATH']])
473 johnpye 428 #print "Adding '"+str(cpppath_add)+"' to cpp path"
474    
475 johnpye 521 if static:
476     staticlib=env[varprefix+'_LIB']
477     #print "STATIC LIB = ",staticlib
478     context.env.Append(
479     LINKFLAGS=[staticlib]
480     )
481     else:
482     if context.env.has_key(varprefix+'_LIBPATH'):
483     context.env.Append(LIBPATH=[env[varprefix+'_LIBPATH']])
484     #print "Adding '"+str(libpath_add)+"' to lib path"
485 johnpye 428
486 johnpye 521 if context.env.has_key(varprefix+'_LIB'):
487     context.env.Append(LIBS=[env[varprefix+'_LIB']])
488     #print "Adding '"+str(libs_add)+"' to libs"
489 johnpye 404
490     def restore(self,context):
491 johnpye 464 #print "RESTORING CONTEXT"
492     #print self.keep
493     #print "..."
494 johnpye 404 for k in self.keep:
495 johnpye 463 if self.keep[k]==None:
496 johnpye 521 if context.env.has_key(k):
497     #print "Clearing "+str(k)
498     del context.env[k];
499 johnpye 463 else:
500 johnpye 464 #print "Restoring "+str(k)+" to '"+self.keep[k]+"'"
501 johnpye 463 context.env[k]=self.keep[k];
502 johnpye 404
503 johnpye 521 def CheckExtLib(context,libname,text,ext='.c',varprefix=None,static=False):
504 johnpye 400 """This method will check for variables LIBNAME_LIBPATH
505     and LIBNAME_CPPPATH and try to compile and link the
506     file with the provided text, linking with the
507     library libname."""
508    
509 johnpye 521 if static:
510     context.Message( 'Checking for static '+libname+'... ' )
511     else:
512     context.Message( 'Checking for '+libname+'... ' )
513    
514 johnpye 400 if varprefix==None:
515     varprefix = libname.upper()
516    
517 johnpye 521 keep = KeepContext(context,varprefix,static)
518 johnpye 400
519 johnpye 428 if not context.env.has_key(varprefix+'_LIB'):
520 johnpye 463 # if varprefix_LIB were in env, KeepContext would
521     # have appended it already
522 johnpye 451 context.env.Append(LIBS=libname)
523 johnpye 428
524 johnpye 404 is_ok = context.TryLink(text,ext)
525 johnpye 428
526 johnpye 521 #print "Link success? ",(is_ok != 0)
527 johnpye 400
528 johnpye 405 keep.restore(context)
529 johnpye 400
530 johnpye 428 # print "Restored CPPPATH="+str(context.env['CPPPATH'])
531     # print "Restored LIBS="+libname
532     # print "Restored LIBPATH="+str(context.env['LIBPATH'])
533    
534 johnpye 404 context.Result(is_ok)
535     return is_ok
536    
537     #----------------
538 johnpye 502 # GCC
539    
540     gcc_test_text = """
541     #ifndef __GNUC__
542     # error "Not using GCC"
543     #endif
544    
545     int main(void){
546     return __GNUC__;
547     }
548     """
549    
550     def CheckGcc(context):
551     context.Message("Checking for GCC... ")
552     is_ok = context.TryCompile(gcc_test_text,".c")
553     context.Result(is_ok)
554     return is_ok
555    
556     #----------------
557 johnpye 500 # GCC VISIBILITY feature
558    
559     gccvisibility_test_text = """
560     #if __GNUC__ < 4
561     # error "Require GCC version 4 or newer"
562     #endif
563    
564     __attribute__ ((visibility("default"))) int x;
565    
566     int main(void){
567     extern int x;
568     x = 4;
569     }
570     """
571    
572     def CheckGccVisibility(context):
573     context.Message("Checking for GCC 'visibility' capability... ")
574 johnpye 546 if not context.env.has_key('WITH_GCCVISIBILITY') or not env['WITH_GCCVISIBILITY']:
575     context.Result("disabled")
576     return 0
577 johnpye 500 is_ok = context.TryCompile(gccvisibility_test_text,".c")
578     context.Result(is_ok)
579     return is_ok
580 johnpye 502
581 johnpye 500 #----------------
582 johnpye 502 # YACC
583    
584     yacc_test_text = """
585 johnpye 646 %{
586     #include <stdio.h>
587     %}
588     %token MSG
589 johnpye 502 %start ROOT
590 johnpye 646 %%
591     ROOT:
592     MSG { printf("HELLO"); }
593     ;
594     %%
595 johnpye 502 """
596    
597     def CheckYacc(context):
598 johnpye 644 context.Message("Checking for Yacc ('%s')... " % context.env.get('YACC'))
599 johnpye 502 is_ok = context.TryCompile(yacc_test_text,".y")
600     context.Result(is_ok)
601     return is_ok
602    
603     #----------------
604 johnpye 404 # CUnit test
605    
606 johnpye 400 cunit_test_text = """
607 johnpye 451 #include <CUnit/CUnit.h>
608 johnpye 400 int maxi(int i1, int i2){
609     return (i1 > i2) ? i1 : i2;
610     }
611    
612     void test_maxi(void){
613     CU_ASSERT(maxi(0,2) == 2);
614     CU_ASSERT(maxi(0,-2) == 0);
615     CU_ASSERT(maxi(2,2) == 2);
616    
617     }
618     int main(void){
619     /* CU_initialize_registry() */
620 johnpye 404 return 0;
621 johnpye 400 }
622     """
623    
624     def CheckCUnit(context):
625 johnpye 451 return CheckExtLib(context,'cunit',cunit_test_text)
626 johnpye 400
627 johnpye 404 #----------------
628 johnpye 405 # Tcl test
629 johnpye 404
630 johnpye 561 # TCL and TK required version 8.1, 8.2, 8.3, or 8.4:
631     tcltk_minor_newest_acceptable = 4
632     tcltk_major_required = 8
633    
634 johnpye 404 tcl_check_text = r"""
635     #include <tcl.h>
636     #include <stdio.h>
637     int main(void){
638     printf("%s",TCL_PATCH_LEVEL);
639     return 0;
640     }
641     """
642    
643     def CheckTcl(context):
644 johnpye 521 return CheckExtLib(context,'tcl',tcl_check_text,static=env['STATIC_TCLTK'])
645 johnpye 405
646     def CheckTclVersion(context):
647 johnpye 521 keep = KeepContext(context,'TCL',static=env['STATIC_TCLTK'])
648 johnpye 405 context.Message("Checking Tcl version... ")
649     (is_ok,output) = context.TryRun(tcl_check_text,'.c')
650 johnpye 404 keep.restore(context)
651     if not is_ok:
652 johnpye 405 context.Result("failed to run check")
653 johnpye 404 return 0
654 johnpye 405
655 wangym 511 major,minor,patch = tuple([int(i) for i in output.split(".")])
656 johnpye 561 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
657 johnpye 428 context.Result(output+" (bad version)")
658 johnpye 405 # bad version
659     return 0
660    
661     # good version
662 johnpye 552 context.Result(output+", good")
663 johnpye 404 return 1
664    
665 johnpye 405 #----------------
666 johnpye 463 # Tk test
667 johnpye 405
668     tk_check_text = r"""
669     #include <tk.h>
670     #include <stdio.h>
671     int main(void){
672     printf("%s",TK_PATCH_LEVEL);
673     return 0;
674     }
675     """
676     def CheckTk(context):
677 johnpye 521 return CheckExtLib(context,'tk',tcl_check_text,static=env['STATIC_TCLTK'])
678 johnpye 405
679 johnpye 428
680 johnpye 405 def CheckTkVersion(context):
681 johnpye 521 keep = KeepContext(context,'TK',static=context.env['STATIC_TCLTK'])
682 johnpye 405 context.Message("Checking Tk version... ")
683 johnpye 521 #print "LINKFLAGS =",context.env['LINKFLAGS']
684 johnpye 405 (is_ok,output) = context.TryRun(tk_check_text,'.c')
685 johnpye 404 keep.restore(context)
686     if not is_ok:
687     context.Result("failed to run check")
688     return 0
689    
690 wangym 511 major,minor,patch = tuple([int(i) for i in output.split(".")])
691 johnpye 561 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
692 johnpye 404 # bad version
693 johnpye 561 context.Result(output+" (bad version)")
694 johnpye 404 return 0
695 johnpye 400
696 johnpye 404 # good version
697 johnpye 561 context.Result(output+" (good)")
698 johnpye 404 return 1
699 johnpye 485
700     #----------------
701 johnpye 521 # Tktable test
702    
703     tktable_check_text = r"""
704     #include <tkTable.h>
705     #include <stdio.h>
706     int main(void){
707     Table mytable;
708     return 0;
709     }
710     """
711    
712     def CheckTkTable(context):
713     return CheckExtLib(context,'tktable',tktable_check_text,static=env['STATIC_TCLTK'])
714    
715     #---------------
716     # X11 test
717    
718     x11_check_text = r"""
719     #include <X11/Xlib.h>
720     #include <X11/IntrinsicP.h>
721     #include <X11/Intrinsic.h>
722     #include <X11/ObjectP.h>
723     #include <X11/Object.h>
724     int main(void){
725     Object mything;
726     return 0;
727     }
728     """
729    
730     def CheckX11(context):
731     return CheckExtLib(context,'X11',x11_check_text)
732    
733     #----------------
734 johnpye 485 # GCC Version sniffing
735    
736     # TODO FIXME
737    
738     gcc_version4 = False
739    
740 johnpye 398 #------------------------------------------------------
741 johnpye 385 # CONFIGURATION
742    
743     conf = Configure(env
744     , custom_tests = {
745 johnpye 398 'CheckSwigVersion' : CheckSwigVersion
746 johnpye 400 , 'CheckCUnit' : CheckCUnit
747 johnpye 404 , 'CheckTcl' : CheckTcl
748     , 'CheckTclVersion' : CheckTclVersion
749 johnpye 405 , 'CheckTk' : CheckTk
750     , 'CheckTkVersion' : CheckTkVersion
751 johnpye 502 , 'CheckGcc' : CheckGcc
752 johnpye 500 , 'CheckGccVisibility' : CheckGccVisibility
753 johnpye 502 , 'CheckYacc' : CheckYacc
754 johnpye 521 , 'CheckTkTable' : CheckTkTable
755     , 'CheckX11' : CheckX11
756 johnpye 400 # , 'CheckIsNan' : CheckIsNan
757     # , 'CheckCppUnitConfig' : CheckCppUnitConfig
758 johnpye 385 }
759 johnpye 459 # , config_h = "config.h"
760 johnpye 385 )
761    
762 johnpye 398
763 johnpye 385 # Math library
764    
765 johnpye 427 #if not conf.CheckFunc('sinh') and not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
766     # print 'Did not find math library, exiting!'
767     # Exit(1)
768    
769 johnpye 385 # Where is 'isnan'?
770    
771     if not conf.CheckFunc('isnan'):
772     print "Didn't find isnan"
773 johnpye 414 # Exit(1)
774 johnpye 385
775 johnpye 500 # GCC visibility
776    
777 johnpye 502 if conf.CheckGcc():
778     conf.env['HAVE_GCC']=True;
779 johnpye 526 if env['WITH_GCCVISIBILITY'] and conf.CheckGccVisibility():
780 johnpye 509 conf.env['HAVE_GCCVISIBILITY']=True;
781     conf.env.Append(CCFLAGS=['-fvisibility=hidden'])
782     conf.env.Append(CPPDEFINES=['HAVE_GCCVISIBILITY'])
783 johnpye 500
784 johnpye 502 # YACC
785    
786 johnpye 506 if not conf.CheckYacc():
787     print "YACC NOT FOUND OR NOT WORKING"
788     else:
789 johnpye 502 conf.env['HAVE_YACC']=True
790    
791     conf.env['HAVE_LEX']=True
792    
793 johnpye 387 # Tcl/Tk
794 johnpye 386
795 johnpye 586 if with_tcltk:
796     if conf.CheckTcl():
797     if conf.CheckTclVersion():
798     if conf.CheckTk():
799     if with_tcltk and conf.CheckTkVersion():
800     if env['STATIC_TCLTK']:
801     if conf.CheckTkTable():
802     pass
803     else:
804     without_tcltk_reason = "TkTable not found"
805     with_tcltk = False
806     else:
807     without_tcltk_reason = "Require Tk version <= 8.4. See 'scons -h'"
808     with_tcltk = False
809 johnpye 521 else:
810 johnpye 586 without_tcltk_reason = "Tk not found."
811 johnpye 551 with_tcltk = False
812 johnpye 428 else:
813 johnpye 586 without_tcltk_reason = "Require Tcl <= 8.4 Tcl."
814 johnpye 551 with_tcltk = False
815 johnpye 586
816 johnpye 428 else:
817 johnpye 586 without_tcltk_reason = "Tcl not found."
818 johnpye 551 with_tcltk = False
819 johnpye 386
820 johnpye 521 if env['STATIC_TCLTK']:
821     conf.CheckX11()
822    
823 johnpye 395 # Python... obviously we're already running python, so we just need to
824     # check that we can link to the python library OK:
825    
826 johnpye 391 if platform.system()=="Windows":
827 johnpye 395 python_lib='python24'
828 johnpye 391 else:
829 johnpye 395 python_lib='python2.4'
830 johnpye 391
831 johnpye 395 # SWIG version
832    
833 johnpye 413 if not conf.CheckSwigVersion():
834     without_python_reason = 'SWIG >= 1.3.24 is required'
835     with_python = False
836    
837 johnpye 400 # CUnit
838    
839 johnpye 593 if with_cunit:
840 johnpye 404 if not conf.CheckCUnit():
841 johnpye 427 without_cunit_reason = 'CUnit not found'
842    
843     # BLAS
844    
845 johnpye 459 need_blas=False
846 johnpye 551 if with_tcltk:
847 johnpye 459 need_blas=True
848     if need_blas:
849     if conf.CheckLib('blas'):
850     with_local_blas = False
851     without_local_blas_reason = "Found BLAS installed on system"
852     else:
853     with_local_blas = True
854     need_fortran = True
855 johnpye 427
856     # FORTRAN
857    
858     if need_fortran:
859 johnpye 629 conf.env.Tool('fortran')
860     detect_fortran = conf.env.Detect(['g77','f77','gfortran'])
861 johnpye 427 if detect_fortran:
862     # For some reason, g77 doesn't get detected properly on MinGW
863     if not env.has_key('F77'):
864     conf.env.Replace(F77=detect_fortran)
865     conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
866     conf.env.Replace(F77FLAGS='')
867 johnpye 428 #print "F77:",conf.env['F77']
868     #print "F77COM:",conf.env['F77COM']
869     #print "F77FLAGS:",conf.env['F77FLAGS']
870 johnpye 427 fortran_builder = Builder(
871     action='$F77COM'
872     , suffix='.o'
873     , src_suffix='.f'
874     )
875     conf.env.Append(BUILDERS={'Fortran':fortran_builder})
876     else:
877 johnpye 629 with_tcltk=False;
878     without_tcltk_reason="FORTRAN-77 required but not found"
879    
880 johnpye 464 #else:
881     # print "FORTRAN not required"
882 johnpye 400
883 johnpye 385 # TODO: -D_HPUX_SOURCE is needed
884    
885     # TODO: check size of void*
886    
887 johnpye 393 # TODO: detect if dynamic libraries are possible or not
888    
889 johnpye 427 if platform.system()=="Windows" and env.has_key('MSVS'):
890     if not conf.CheckHeader('windows.h') and env['PACKAGE_LINKING']=='DYNAMIC_PACKAGES':
891     print "Reverting to STATIC_PACKAGES since windows.h is not available. Probably you "\
892     +"need to install the Microsoft Windows Server 2003 Platform SDK, or similar."
893     env['PACKAGE_LINKING']='STATIC_PACKAGES'
894    
895 johnpye 534 if with_python and not conf.CheckHeader(['basetsd.h','BaseTsd.h']):
896 johnpye 427 with_python = 0;
897     without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
898    
899     conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
900    
901 johnpye 395 conf.Finish()
902    
903     env.Append(PYTHON_LIBPATH=[distutils.sysconfig.PREFIX+"/libs"])
904     env.Append(PYTHON_LIB=[python_lib])
905     env.Append(PYTHON_CPPPATH=[distutils.sysconfig.get_python_inc()])
906    
907 johnpye 507 #---------------------------------------
908     # SUBSTITUTION DICTIONARY for .in files
909    
910     subst_dict = {
911     '@DEFAULT_ASCENDLIBRARY@':env['DEFAULT_ASCENDLIBRARY']
912     , '@GLADE_FILE@':'ascend.glade'
913     , '@HELP_ROOT@':''
914     , '@ICON_EXTENSION@':icon_extension
915 johnpye 628 , '@INSTALL_ASCDATA@':env['INSTALL_ASCDATA']
916 johnpye 507 , '@INSTALL_BIN@':env['INSTALL_BIN']
917     , '@INSTALL_INCLUDE@':env['INSTALL_INCLUDE']
918     , '@PYGTK_ASSETS@':env['PYGTK_ASSETS']
919     , '@VERSION@':version
920 johnpye 563 , '@DISTTAR_NAME@':env['DISTTAR_NAME']
921 johnpye 507 , '@WEBHELPROOT@':'http://pye.dyndns.org/ascend/manual/'
922 johnpye 508 , '@ASC_SHLIBSUFFIX@':env['SHLIBSUFFIX']
923     , '@ASC_SHLIBPREFIX@':env['SHLIBPREFIX']
924 johnpye 589 , '@ASC_ENV_TK_DEFAULT@' : '$$ASCENDDIST/tcltk'
925 johnpye 627 , '@ASC_DISTDIR_REL_BIN@' : default_rel_distdir
926 johnpye 507 }
927    
928 johnpye 594 if env.get('WITH_LOCAL_HELP'):
929 johnpye 507 print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
930     subst_dict['@HELP_ROOT@']=env['WITH_LOCAL_HELP']
931    
932 johnpye 597 # bool options...
933 johnpye 605 for k,v in { \
934 johnpye 628 'ABSOLUTE_PATHS' : 'ASC_ABSOLUTE_PATHS', \
935 johnpye 605 'WITH_XTERM_COLORS' : 'ASC_XTERM_COLORS', \
936     'MALLOC_DEBUG' : 'MALLOC_DEBUG' \
937     }.iteritems():
938 johnpye 597 if env.get(k):
939     subst_dict['ifdef '+v]="if 1"
940 johnpye 594
941 johnpye 507 if with_python:
942     subst_dict['@ASCXX_USE_PYTHON@']="1"
943    
944     if env.has_key('HAVE_GCCVISIBILITY'):
945     subst_dict['@HAVE_GCCVISIBILITY@'] = "1"
946    
947     env.Append(SUBST_DICT=subst_dict)
948    
949 johnpye 385 #------------------------------------------------------
950 johnpye 558 # RECIPE: SWIG scanner
951    
952     import SCons.Script
953    
954     SWIGScanner = SCons.Scanner.ClassicCPP(
955     "SWIGScan"
956     , ".i"
957     , "CPPPATH"
958     , '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
959     )
960    
961     env.Append(SCANNERS=[SWIGScanner])
962    
963     #------------------------------------------------------
964 johnpye 393 # RECIPE: 'SubstInFile', used in pygtk SConscript
965    
966     import re
967 johnpye 395 from SCons.Script import * # the usual scons stuff you get in a SConscript
968 johnpye 393
969 johnpye 395 def TOOL_SUBST(env):
970     """Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
971     from the source to the target.
972     The values of SUBST_DICT first have any construction variables expanded
973     (its keys are not expanded).
974     If a value of SUBST_DICT is a python callable function, it is called and
975     the result is expanded as the value.
976     If there's more than one source and more than one target, each target gets
977     substituted from the corresponding source.
978 johnpye 393 """
979 johnpye 395 env.Append(TOOLS = 'SUBST')
980     def do_subst_in_file(targetfile, sourcefile, dict):
981     """Replace all instances of the keys of dict with their values.
982     For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
983     then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
984     """
985     try:
986     f = open(sourcefile, 'rb')
987     contents = f.read()
988     f.close()
989     except:
990     raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
991     for (k,v) in dict.items():
992     contents = re.sub(k, v, contents)
993     try:
994     f = open(targetfile, 'wb')
995     f.write(contents)
996     f.close()
997     except:
998     raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
999     return 0 # success
1000 johnpye 393
1001 johnpye 395 def subst_in_file(target, source, env):
1002     if not env.has_key('SUBST_DICT'):
1003     raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
1004     d = dict(env['SUBST_DICT']) # copy it
1005     for (k,v) in d.items():
1006     if callable(v):
1007     d[k] = env.subst(v())
1008     elif SCons.Util.is_String(v):
1009     d[k]=env.subst(v)
1010     else:
1011     raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
1012     for (t,s) in zip(target, source):
1013     return do_subst_in_file(str(t), str(s), d)
1014 johnpye 393
1015 johnpye 395 def subst_in_file_string(target, source, env):
1016     """This is what gets printed on the console."""
1017     return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
1018     for (t,s) in zip(target, source)])
1019 johnpye 393
1020 johnpye 395 def subst_emitter(target, source, env):
1021     """Add dependency from substituted SUBST_DICT to target.
1022     Returns original target, source tuple unchanged.
1023     """
1024     d = env['SUBST_DICT'].copy() # copy it
1025     for (k,v) in d.items():
1026     if callable(v):
1027     d[k] = env.subst(v())
1028     elif SCons.Util.is_String(v):
1029     d[k]=env.subst(v)
1030     Depends(target, SCons.Node.Python.Value(d))
1031     return target, source
1032 johnpye 393
1033 johnpye 395 subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string)
1034     env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
1035    
1036     TOOL_SUBST(env)
1037    
1038 johnpye 393 #------------------------------------------------------
1039 johnpye 463 # Recipe for 'CHMOD' ACTION
1040 johnpye 439
1041     import SCons
1042     from SCons.Script.SConscript import SConsEnvironment
1043     SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod,
1044     lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode))
1045    
1046     def InstallPerm(env, dest, files, perm):
1047     obj = env.Install(dest, files)
1048     for i in obj:
1049     env.AddPostAction(i, env.Chmod(str(i), perm))
1050    
1051     SConsEnvironment.InstallPerm = InstallPerm
1052    
1053     # define wrappers
1054     SConsEnvironment.InstallProgram = lambda env, dest, files: InstallPerm(env, dest, files, 0755)
1055 johnpye 578 SConsEnvironment.InstallHeader = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1056 johnpye 629 SConsEnvironment.InstallShared = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1057 johnpye 463
1058 johnpye 439 #------------------------------------------------------
1059 johnpye 463 # BUILD...
1060 johnpye 385
1061 johnpye 463 # so that #include <modulename/headername.h> works across all modules...
1062     env.Append(CPPPATH=['#base/generic'])
1063 johnpye 385
1064 johnpye 485 if gcc_version4:
1065     env.Append(CCFLAGS=['-fvisibility=hidden'])
1066    
1067 johnpye 508 if env['DEBUG']:
1068     env.Append(CCFLAGS=['-g'])
1069    
1070 johnpye 591 if env['GCOV']:
1071     env.Append(
1072     CPPFLAGS=['-g','-fprofile-arcs','-ftest-coverage']
1073     , LIBS=['gcov']
1074     , LINKFLAGS=['-fprofile-arcs','-ftest-coverage']
1075     )
1076    
1077 johnpye 463 #-------------
1078     # TCL/TK GUI
1079 johnpye 385
1080 johnpye 551 if with_tcltk:
1081 johnpye 463 if with_local_blas:
1082     env.SConscript(['blas/SConscript'],'env')
1083     else:
1084     print "Skipping... BLAS won't be build:", without_local_blas_reason
1085 johnpye 385
1086 johnpye 463 env.SConscript(['lsod/SConscript'],'env')
1087 johnpye 385
1088 johnpye 463 env.SConscript(['linpack/SConscript'],'env')
1089 johnpye 569 env.SConscript(['tcltk/generic/interface/SConscript'],'env')
1090 johnpye 391 else:
1091 johnpye 405 print "Skipping... Tcl/Tk GUI isn't being built:",without_tcltk_reason
1092 johnpye 386
1093 johnpye 463 #-------------
1094     # PYTHON INTERFACE
1095    
1096 johnpye 387 if with_python:
1097 johnpye 532 env.SConscript(['pygtk/SConscript'],'env')
1098 johnpye 391 else:
1099 johnpye 413 print "Skipping... Python GUI isn't being built:",without_python_reason
1100 johnpye 400
1101 johnpye 463 #------------
1102     # BASE/GENERIC SUBDIRECTORIES
1103    
1104     dirs = ['general','utilities','compiler','solver','packages']
1105    
1106     srcs = []
1107     for d in dirs:
1108     heresrcs = env.SConscript('base/generic/'+d+'/SConscript','env')
1109     srcs += heresrcs
1110    
1111     #-------------
1112     # LIBASCEND -- all base/generic functionality
1113    
1114     libascend = env.SharedLibrary('ascend',srcs)
1115    
1116     #-------------
1117     # UNIT TESTS
1118    
1119 johnpye 593 if with_cunit:
1120 johnpye 400 testdirs = ['general','solver','utilities']
1121 johnpye 593 testsrcs = []
1122 johnpye 400 for testdir in testdirs:
1123     path = 'base/generic/'+testdir+'/test/'
1124     env.SConscript([path+'SConscript'],'env')
1125 johnpye 593 testsrcs += [i.path for i in env['TESTSRCS_'+testdir.upper()]]
1126    
1127     #print "TESTSRCS =",testsrcs
1128    
1129 johnpye 400 env.SConscript(['test/SConscript'],'env')
1130     env.SConscript(['base/generic/test/SConscript'],'env')
1131 johnpye 593
1132     env.Alias('test',[env.Dir('test'),env.Dir('base/generic/test')])
1133 johnpye 400
1134     else:
1135 johnpye 427 print "Skipping... CUnit tests aren't being built:",without_cunit_reason
1136 johnpye 400
1137 johnpye 463 #------------------------------------------------------
1138     # INSTALLATION
1139 johnpye 427
1140 johnpye 552 if env.get('CAN_INSTALL'):
1141 johnpye 463 # the models directory only needs to be processed for installation, no other processing required.
1142     env.SConscript(['models/SConscript'],'env')
1143 johnpye 427
1144 johnpye 628 dirs = ['INSTALL_BIN','INSTALL_ASCDATA','INSTALL_LIB']
1145 johnpye 463 install_dirs = [env['INSTALL_ROOT']+env[d] for d in dirs]
1146 johnpye 449
1147 johnpye 463 # TODO: add install options
1148     env.Alias('install',install_dirs)
1149 johnpye 400
1150 johnpye 629 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_LIB'],libascend)
1151 johnpye 435
1152 johnpye 438 #------------------------------------------------------
1153 johnpye 631 # WINDOWS INSTALLER
1154     # For the windows installer, please see pygtk/SConscript
1155    
1156     if with_installer:
1157     pass
1158     else:
1159     print "Skipping... Windows installer isn't being built:",without_installer_reason
1160    
1161     #------------------------------------------------------
1162 johnpye 438 # CREATE the SPEC file for generation of RPM packages
1163    
1164 johnpye 463 if platform.system()=="Linux":
1165     env.SubstInFile('ascend.spec.in')
1166 johnpye 552
1167     #------------------------------------------------------
1168     # DISTRIBUTION TAR FILE
1169    
1170 johnpye 554 env['DISTTAR_FORMAT']='bz2'
1171 johnpye 556 env.Append(
1172 johnpye 566 DISTTAR_EXCLUDEEXTS=['.o','.os','.so','.a','.dll','.cc','.cache','.pyc','.cvsignore','.dblite','.log','.pl']
1173 johnpye 561 , DISTTAR_EXCLUDEDIRS=['CVS','.svn','.sconf_temp', 'dist']
1174 johnpye 556 )
1175 johnpye 554
1176 johnpye 563 tar = env.DistTar("dist/"+env['DISTTAR_NAME']
1177 johnpye 556 , [env.Dir('#')]
1178 johnpye 554 )
1179    
1180     #------------------------------------------------------
1181     # RPM BUILD
1182    
1183     #if platform.system()=="Linux":
1184     # pass
1185    
1186     #------------------------------------------------------
1187     # DEFAULT TARGETS
1188    
1189 johnpye 629 default_targets =[]
1190     if with_tcltk:
1191     default_targets.append('tcltk')
1192     if with_python:
1193     default_targets.append('pygtk')
1194 johnpye 631 if with_installer:
1195     default_targets.append('installer')
1196 johnpye 554
1197 johnpye 629 env.Default(default_targets)
1198    
1199     print "Building targets:"," ".join([str(i) for i in BUILD_TARGETS])
1200    

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