/[ascend]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1335 - (show annotations) (download)
Fri Mar 9 02:54:03 2007 UTC (16 years, 2 months ago) by jpye
File size: 51518 byte(s)
Fixed problem with logrel instances in PyGTK GUI.
Removed faulty INSTALL_DOC directory -- docs just go to INSTALL_ASCDATA for now.
1 import sys, os, commands, platform, distutils.sysconfig, os.path, re
2
3 version = "0.9.5.107"
4
5 #------------------------------------------------------
6 # OPTIONS
7 #
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
11 opts = Options(['options.cache', 'config.py'])
12 #print "PLATFORM = ",platform.system()
13
14 if platform.system()=="Windows":
15 default_tcl_lib = "tcl84"
16 default_tk_lib = "tk84"
17 default_tktable_lib = "Tktable28"
18 default_install_assets = "glade/"
19 icon_extension = '.png'
20 default_tcl = "c:\\Tcl"
21 if os.environ.get('MSYSTEM')=="MINGW32":
22 default_tcl_libpath="$TCL\\bin"
23 else:
24 default_tcl_libpath="$TCL\\lib"
25 default_rel_distdir = '.'
26 default_absolute_paths = False
27
28 default_ida_prefix = "c:\\MinGW"
29 if not os.path.exists(default_ida_prefix):
30 default_ida_prefix = None
31
32 default_conopt_prefix = "c:\\Program Files\\CONOPT"
33 default_conopt_libpath="$CONOPT_PREFIX"
34 default_conopt_cpppath="$CONOPT_PREFIX"
35 default_conopt_lib="conopt3"
36 default_conopt_envvar="CONOPT_PATH"
37
38 default_prefix="c:\\MinGW"
39 default_libpath="$DEFAULT_PREFIX\\lib"
40 default_cpppath="$DEFAULT_PREFIX\\include"
41
42 if not os.path.exists(default_conopt_prefix):
43 default_conopt_prefix = None
44
45 need_libm = False
46 python_exe = "c:\\Python24\\python.exe"
47 default_with_scrollkeeper=False
48 else:
49 default_tcl_lib = "tcl8.4"
50 default_tk_lib = "tk8.4"
51 default_tktable_lib = "Tktable2.8"
52 default_install_assets = "$INSTALL_ASCDATA/glade/"
53 icon_extension = '.svg'
54 default_tcl = '/usr'
55 default_tcl_libpath = "$TCL/lib"
56 default_rel_distdir = '../share/ascend'
57 default_absolute_paths = True
58 default_ida_prefix="/usr/local"
59 default_conopt_prefix="/usr"
60 default_conopt_libpath="$CONOPT_PREFIX/lib"
61 default_conopt_cpppath="$CONOPT_PREFIX/include"
62 default_conopt_lib="consub3"
63 default_conopt_envvar="CONOPT_PATH"
64
65 default_prefix="/usr"
66 default_libpath="$DEFAULT_PREFIX/lib"
67 default_cpppath="$DEFAULT_PREFIX/include"
68
69 need_libm = True
70 if not os.path.isdir(default_tcl):
71 default_tcl = '/usr'
72 python_exe = distutils.sysconfig.EXEC_PREFIX+"/bin/python"
73 default_with_scrollkeeper=False
74
75 opts.Add(
76 'CC'
77 ,'C Compiler command'
78 ,None
79 )
80
81 opts.Add(
82 'CXX'
83 ,'C++ Compiler command'
84 ,None
85 )
86
87 opts.Add(BoolOption(
88 'GCOV'
89 , 'Whether to enable coverage testing in object code'
90 , False
91 ))
92
93 # Package linking option
94 opts.Add(EnumOption(
95 'PACKAGE_LINKING'
96 , 'Style of linking for external libraries'
97 , 'DYNAMIC_PACKAGES'
98 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
99 ))
100
101 opts.Add(BoolOption(
102 'WITH_GCCVISIBILITY'
103 ,"Whether to use GCC Visibility features (only applicable if available)"
104 ,True
105 ))
106
107 opts.Add(BoolOption(
108 'WITH_SIGNALS'
109 ,"Whether to permit use of signals for flow control in the C-level code"
110 ,True
111 ))
112
113 # You can turn off building of Tcl/Tk interface
114 opts.Add(BoolOption(
115 'WITH_TCLTK'
116 ,"Set to False if you don't want to build the original Tcl/Tk GUI."
117 , True
118 ))
119
120 # You can turn off the building of the Python interface
121 opts.Add(BoolOption(
122 'WITH_PYTHON'
123 ,"Set to False if you don't want to build Python wrappers."
124 , True
125 ))
126
127 # Which solvers will we allow?
128 opts.Add(ListOption(
129 'WITH_SOLVERS'
130 ,"List of the solvers you want to build. The default is the minimum that"
131 +" works."
132 ,["QRSLV","CMSLV","LSOD","IDA","CONOPT","LRSLV"]
133 ,['QRSLV','MPS','SLV','OPTSQP'
134 ,'NGSLV','CMSLV','LRSLV','MINOS','CONOPT'
135 ,'LSOD','OPTSQP',"IDA"
136 ]
137 ))
138
139 # Where will the local copy of the help files be kept?
140 opts.Add(PackageOption(
141 'WITH_LOCAL_HELP'
142 , "Directory containing the local copy of the help files (optional)"
143 , "no"
144 ))
145
146 # Will bintoken support be enabled?
147 opts.Add(BoolOption(
148 'WITH_BINTOKEN'
149 ,"Enable bintoken support? This means compiling models as C-code before"
150 +" running them, to increase solving speed for large models."
151 ,False
152 ))
153
154 # What should the default ASCENDLIBRARY path be?
155 # Note: users can change it by editing their ~/.ascend.ini
156 opts.Add(
157 'DEFAULT_ASCENDLIBRARY'
158 ,"Set the default value of the ASCENDLIBRARY -- the location where"
159 +" ASCEND will look for models when running ASCEND"
160 ,"$INSTALL_ASCDATA/models"
161 )
162
163 # Where is SWIG?
164 opts.Add(
165 'SWIG'
166 ,"SWIG location, probably only required for MinGW and MSVC users."
167 +" Enter the location as a Windows-style path, for example"
168 +" 'c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe'."
169 )
170
171 # Build the test suite?
172 opts.Add(BoolOption(
173 'WITH_CUNIT'
174 ,"You can disable CUnit tests with this option. This will basically stop"
175 +" SCons from parsing the SConscript files relating to the 'test'"
176 +" target, which just might make things marginally faster. Probably"
177 +" you can just ignore this option though. SCons will sniff for Cunit"
178 +" but build the tests only if you specify the 'test' target."
179 ,True
180 ))
181
182 # Build with MMIO matrix export support?
183 opts.Add(BoolOption(
184 'WITH_MMIO'
185 ,"Include support for exporting matrices in Matrix Market format"
186 ,True
187 ))
188
189
190 opts.Add(BoolOption(
191 'IDA_NEW_ANALYSE'
192 ,"Build with new IDA 'analyse' function? (see base/generic/solver/ida.c)"
193 ,True
194 ))
195
196 #----- default paths -----
197 opts.Add(PackageOption(
198 'DEFAULT_PREFIX'
199 ,"Where are most of the shared libraries located on your system?"
200 ,default_prefix
201 ))
202
203 #------ install location for python extensions ------
204
205 # (removed for the moment)
206
207 #------ cunit --------
208 # Where was CUNIT installed?
209 opts.Add(PackageOption(
210 'CUNIT_PREFIX'
211 ,"Where are your CUnit files?"
212 ,"$DEFAULT_PREFIX"
213 ))
214
215 # Where are the CUnit includes?
216 opts.Add(PackageOption(
217 'CUNIT_CPPPATH'
218 ,"Where are your CUnit include files?"
219 ,"$CUNIT_PREFIX/include"
220 ))
221
222 # Where are the CUnit libraries?
223 opts.Add(PackageOption(
224 'CUNIT_LIBPATH'
225 ,"Where are your CUnit libraries?"
226 ,"$CUNIT_PREFIX/lib"
227 ))
228
229 #-------- ida -------
230
231 opts.Add(PackageOption(
232 "IDA_PREFIX"
233 ,"Prefix for your IDA install (IDA ./configure --prefix)"
234 ,default_ida_prefix
235 ))
236
237 opts.Add(
238 "IDA_LIB"
239 ,"Libraries linked to for IDA"
240 ,['sundials_nvecserial','sundials_ida','m']
241 )
242
243 opts.Add(
244 'IDA_CPPPATH'
245 ,"Where is your ida.h?"
246 ,"$IDA_PREFIX/include"
247 )
248
249 opts.Add(
250 'IDA_LIBPATH'
251 ,"Where are your SUNDIALS libraries installed?"
252 ,"$IDA_PREFIX/lib"
253 )
254
255 # ----- conopt-----
256
257 opts.Add(PackageOption(
258 "CONOPT_PREFIX"
259 ,"Prefix for your CONOPT install (CONOPT ./configure --prefix)"
260 ,default_conopt_prefix
261 ))
262
263 opts.Add(
264 "CONOPT_LIB"
265 ,"Library linked to for CONOPT"
266 ,default_conopt_lib
267 )
268
269 opts.Add(
270 'CONOPT_CPPPATH'
271 ,"Where is your conopt.h?"
272 ,default_conopt_cpppath
273 )
274
275 opts.Add(
276 'CONOPT_LIBPATH'
277 ,"Where is your CONOPT libraries installed?"
278 ,default_conopt_libpath
279 )
280
281 opts.Add(
282 'CONOPT_ENVVAR'
283 ,"What environment variable should be used at runtime to override the default search location for CONOPT DLL/SO?"
284 ,default_conopt_envvar
285 )
286
287 #-------- f2c ------
288
289 opts.Add(
290 "F2C_LIB"
291 ,"F2C library (eg. g2c, gfortran, f2c)"
292 ,"g2c"
293 )
294
295 opts.Add(PackageOption(
296 "F2C_LIBPATH"
297 ,"Directory containing F2C library (i.e. g2c, gfortran, f2c, etc.), if not already accessible"
298 ,"off"
299 ))
300
301 #------- tcl/tk --------
302
303 opts.Add(
304 'TCL'
305 ,'Base of Tcl distribution'
306 ,default_tcl
307 )
308
309 # Where are the Tcl includes?
310 opts.Add(
311 'TCL_CPPPATH'
312 ,"Where are your Tcl include files?"
313 ,"$TCL/include"
314 )
315
316 # Where are the Tcl libs?
317 opts.Add(
318 'TCL_LIBPATH'
319 ,"Where are your Tcl libraries?"
320 ,default_tcl_libpath
321 )
322
323 # What is the name of the Tcl lib?
324 opts.Add(
325 'TCL_LIB'
326 ,"Name of Tcl lib (eg 'tcl' or 'tcl83'), for full path to static library (if STATIC_TCLTK is set)"
327 ,default_tcl_lib
328 )
329
330 # Where are the Tk includes?
331 opts.Add(
332 'TK_CPPPATH'
333 ,"Where are your Tk include files?"
334 ,'$TCL_CPPPATH'
335 )
336
337 # Where are the Tk libs?
338 opts.Add(
339 'TK_LIBPATH'
340 ,"Where are your Tk libraries?"
341 ,'$TCL_LIBPATH'
342 )
343
344 # What is the name of the Tk lib?
345 opts.Add(
346 'TK_LIB'
347 ,"Name of Tk lib (eg 'tk' or 'tk83'), or full path to static library"
348 ,default_tk_lib
349 )
350
351 # Static linking to TkTable
352
353 opts.Add(BoolOption(
354 'STATIC_TCLTK'
355 ,'Set true for static linking for Tcl/Tk and TkTable. EXPERIMENTAL'
356 ,False
357 ))
358
359 opts.Add(
360 'TKTABLE_LIBPATH'
361 ,'Location of TkTable static library'
362 ,'$TCL_LIBPATH/Tktable2.8'
363 )
364
365 opts.Add(
366 'TKTABLE_LIB'
367 ,'Stem name of TkTable (eg tktable2.8, no ".so" or "lib") shared library, or full path of static tktable (/usr/lib/...)'
368 ,default_tktable_lib
369 )
370
371 opts.Add(
372 'TKTABLE_CPPPATH'
373 ,'Location of TkTable header file'
374 ,'$TCL_CPPPATH'
375 )
376
377 opts.Add(
378 'X11'
379 ,'Base X11 directory. Only used when STATIC_TCLTK is turned on. EXPERIMENTAL'
380 ,'/usr/X11R6'
381 )
382
383 opts.Add(
384 'X11_LIBPATH'
385 ,'Location of X11 lib. EXPERIMENTAL'
386 ,'$X11/lib'
387 )
388
389 opts.Add(
390 'X11_CPPPATH'
391 ,'Location of X11 includes. EXPERIMENTAL'
392 ,'$X11/include'
393 )
394
395 opts.Add(
396 'X11_LIB'
397 ,'Name of X11 lib. EXPERIMENTAL'
398 ,'X11'
399 )
400
401 #----- installed file locations (for 'scons install') -----
402
403 opts.Add(
404 'INSTALL_PREFIX'
405 ,'Root location for installed files'
406 ,'/usr/local'
407 )
408
409 opts.Add(
410 'INSTALL_BIN'
411 ,'Location to put binaries during installation'
412 ,"$INSTALL_PREFIX/bin"
413 )
414
415 opts.Add(
416 'INSTALL_LIB'
417 ,'Location to put libraries during installation'
418 ,"$INSTALL_PREFIX/lib"
419 )
420
421 opts.Add(
422 'INSTALL_SHARE'
423 ,'Common shared-file location on this system'
424 ,"$INSTALL_PREFIX/share"
425 )
426
427 opts.Add(
428 'INSTALL_ASCDATA'
429 ,"Location of ASCEND shared data (TK, python, models etc)"
430 ,"$INSTALL_SHARE/ascend"
431 )
432
433 opts.Add(
434 'INSTALL_INCLUDE'
435 ,'Location to put header files during installation'
436 ,"$INSTALL_PREFIX/include"
437 )
438
439
440 opts.Add(
441 'INSTALL_ROOT'
442 ,'For use by RPM only: location of %{buildroot} during rpmbuild'
443 ,""
444 )
445
446 #----------------------
447
448 opts.Add(
449 'PYGTK_ASSETS'
450 ,'Default location for Glade assets (placed in pygtk/config.py)'
451 ,default_install_assets
452 )
453
454 opts.Add(BoolOption(
455 'DEBUG'
456 ,"Compile source with debugger symbols, eg for use with 'gdb'"
457 ,False
458 ))
459
460 opts.Add(BoolOption(
461 'MALLOC_DEBUG'
462 ,"Compile with debugging version of MALLOC. Required for full CUnit testing"
463 ,False
464 ))
465
466 #------ dmalloc --------
467 opts.Add(PackageOption(
468 'DMALLOC_PREFIX'
469 ,"Where are your dmalloc files?"
470 ,default_prefix
471 ))
472
473 opts.Add(PackageOption(
474 'DMALLOC_CPPPATH'
475 ,"Where are your dmalloc include files?"
476 ,default_cpppath
477 ))
478
479 opts.Add(PackageOption(
480 'DMALLOC_LIBPATH'
481 ,"Where are your dmalloc libraries?"
482 ,default_libpath
483 ))
484
485 opts.Add(BoolOption(
486 'WITH_DMALLOC'
487 ,"Link to the DMALLOC library (if available) for debugging of memory usage."
488 ,False
489 ))
490
491 #------ f --------
492 opts.Add(PackageOption(
493 'MFGRAPH_PREFIX'
494 ,"Where are your MFGRAPH files?"
495 ,default_prefix
496 ))
497
498 opts.Add(PackageOption(
499 'MFGRAPH_CPPPATH'
500 ,"Where are your MFGRAPH include files?"
501 ,default_cpppath
502 ))
503
504 opts.Add(PackageOption(
505 'MFGRAPH_LIBPATH'
506 ,"Where are your MFGRAPH libraries?"
507 ,default_libpath
508 ))
509
510 opts.Add(BoolOption(
511 'WITH_MFGRAPH'
512 ,"Link to the MFGRAPH library (if available, for generating incidence graphs)"
513 ,True
514 ))
515
516
517 #------ ufsparse --------
518 opts.Add(PackageOption(
519 'UFSPARSE_PREFIX'
520 ,"Where are your UFSPARSE files?"
521 ,default_prefix
522 ))
523
524 opts.Add(PackageOption(
525 'UFSPARSE_CPPPATH'
526 ,"Where are your UFSPARSE include files?"
527 ,default_cpppath
528 ))
529
530 opts.Add(PackageOption(
531 'UFSPARSE_LIBPATH'
532 ,"Where are your UFSPARSE libraries?"
533 ,default_libpath
534 ))
535
536 opts.Add(BoolOption(
537 'WITH_UFSPARSE'
538 ,"Link to the UFSPARSE library (if available, for additional sparse matrix routines)"
539 ,True
540 ))
541
542 #-----------------------
543
544 opts.Add(
545 'DISTTAR_NAME'
546 ,"Stem name of the tarball created by 'scons dist'. So for 'ascend-aaa.tar.bz2', set this to 'ascend-aaa'."
547 ,"ascend-"+version
548 )
549
550 opts.Add(
551 'RELEASE'
552 ,"Release number for use in RPM spec file. This should always start with a zero for releases made by the ASCEND group, in order that third parties can make 'patch' releases of higher version numbers."
553 ,"0"
554 )
555
556 opts.Add(BoolOption(
557 'ABSOLUTE_PATHS'
558 ,"Whether to use absolute or relative paths in the installed Tcl/Tk interface. If you want to build an RPM, set this to false."
559 ,default_absolute_paths
560 ))
561
562 opts.Add(
563 'WIN_INSTALLER_NAME'
564 ,"Name of the installer .exe to create under Windows (minus the '.exe')"
565 ,"ascend-"+version
566 )
567
568 opts.Add(BoolOption(
569 'WITH_XTERM_COLORS'
570 ,"Set to 0 if you don't want xterm colour codes in the console output"
571 ,True
572 ))
573
574 opts.Add(BoolOption(
575 'WITH_EXTFNS'
576 ,"Set to 0 if you don't want to attempt to build external modules bundled"
577 + " with ASCEND."
578 ,True
579 ))
580
581 opts.Add(BoolOption(
582 'WITH_SCROLLKEEPER'
583 ,"Set to to 1 if you want to install an OMF file that can be read by scrollkeeper (eg Yelp on GNOME)"
584 ,default_with_scrollkeeper
585 ))
586
587 if platform.system()!="Windows":
588 opts.Add(BoolOption(
589 'WITH_GCCVISIBILITY'
590 , 'Whether to use GCC Visibility extensions when building with GCC 4.0'
591 , True
592 ))
593
594
595
596 # TODO: OTHER OPTIONS?
597 # TODO: flags for optimisation
598 # TODO: turning on/off bintoken functionality
599 # TODO: Where will the 'Makefile.bt' file be installed?
600
601 # Import the outside environment
602
603 def c_escape(str):
604 return re.sub("\\\\","/",str)
605
606 envadditional={}
607
608 if platform.system()=="Windows":
609 if os.environ.get('OSTYPE')=='msys' or os.environ.get('MSYSTEM'):
610 envenv = os.environ;
611 tools = ['mingw','lex','yacc','fortran','swig','disttar','nsis']
612 #TODO removed 'doxygen' for SCons 0.96.93
613 envadditional['IS_MINGW']=True
614 else:
615 print "Assuming VC++ build environment (Note: MinGW is preferred)"
616 envenv = {
617 'PATH':os.environ['PATH']
618 ,'INCLUDE':os.environ['INCLUDE']
619 ,'LIB':os.environ['LIB']
620 ,'MSVS_IGNORE_IDE_PATHS':1
621 }
622 tools=['default','lex','yacc','fortran','swig','disttar','nsis']
623 #TODO removed 'doxygen' for SCons 0.96.93
624 envadditional['CPPDEFINES']=['_CRT_SECURE_NO_DEPRECATE']
625 else:
626 if os.environ.get('TARGET')=='mingw':
627 envenv = os.environ
628 tools=['crossmingw','lex','yacc','disttar','nsis','doxygen']
629 envadditional['CPPPATH']=['/usr/local/lib/gcc/i386-mingw32/3.4.5/include','/usr/include']
630 else:
631 envenv = os.environ
632 tools=['default','lex','yacc','fortran','swig','disttar','nsis']
633 #TODO removed 'doxygen' for SCons 0.96.93
634
635
636 env = Environment(
637 ENV=envenv
638 , toolpath=['scons']
639 , tools=tools
640 , **envadditional
641 )
642
643 opts.Update(env)
644 opts.Save('options.cache',env)
645
646 Help(opts.GenerateHelpText(env))
647
648 with_tcltk = env.get('WITH_TCLTK')
649 without_tcltk_reason = "disabled by options/config.py"
650
651 with_python = env.get('WITH_PYTHON')
652 without_python_reason = "disabled by options/config.py"
653
654 with_cunit = env.get('WITH_CUNIT')
655 without_cunit_reason = "not requested"
656
657 with_extfns = env.get('WITH_EXTFNS')
658 without_extfn_reason = "disabled by options/config.py"
659
660 with_scrollkeeper = env.get('WITH_SCROLLKEEPER')
661 without_scrollkeeper_reason = "disabled by options/config.py"
662
663 with_dmalloc = env.get('WITH_DMALLOC')
664 without_dmalloc_reason = "disabled by options/config.py"
665
666 with_mfgraph = env.get('WITH_MFGRAPH')
667 without_mfgraph_reason = "disabled by options/config.py"
668
669 with_ufsparse = env.get('WITH_UFSPARSE')
670 without_ufsparse_reason = "disabled by options/config.py"
671
672 with_mmio = env.get('WITH_MMIO')
673 without_mmio_reason = "disabled by options/config.py"
674
675 with_signals = env.get('WITH_SIGNALS')
676 without_signals_reason = "disabled by options/config.py"
677
678 if platform.system()=="Windows":
679 with_installer=1
680 else:
681 with_installer=0
682 without_installer_reason = "only possible under Windows"
683
684 if 'LSOD' in env['WITH_SOLVERS']:
685 with_lsode=True
686 else:
687 with_lsode=False
688 without_lsode_reason = "not requested (WITH_SOLVERS)"
689
690 if 'IDA' in env['WITH_SOLVERS']:
691 with_ida=True
692 else:
693 with_ida=False
694 without_ida_reason = "not requested (WITH_SOLVERS)"
695
696
697 if 'CONOPT' in env['WITH_SOLVERS']:
698 with_conopt=True
699 else:
700 with_conopt=False
701 without_conopt_reason = "not requested (WITH_SOLVERS)"
702
703
704 #print "SOLVERS:",env['WITH_SOLVERS']
705 #print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
706 #print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
707
708 can_install = True
709 if platform.system()=='Windows':
710 can_install = False
711
712 env['CAN_INSTALL']=can_install
713 env['INSTALL_MODELS']=env['INSTALL_ASCDATA']+"/models/"
714
715 print "TCL_CPPPATH =",env['TCL_CPPPATH']
716 print "TCL_LIBPATH =",env['TCL_LIBPATH']
717 print "TCL_LIB =",env['TCL_LIB']
718 print "CC =",env['CC']
719 print "CXX =",env['CXX']
720 print "FORTRAN=",env.get('FORTRAN')
721
722 print "ABSOLUTE PATHS =",env['ABSOLUTE_PATHS']
723 #------------------------------------------------------
724 # SPECIAL CONFIGURATION TESTS
725
726 need_fortran = False
727
728 #----------------
729 # SWIG
730
731 import os,re
732
733 def get_swig_version(env):
734 cmd = env['SWIG']+' -version'
735 (cin,coutcerr) = os.popen4(cmd)
736 output = coutcerr.read()
737
738 restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
739 expr = re.compile(restr,re.M);
740 m = expr.search(output);
741 if not m:
742 return None
743 maj = int(m.group('maj'))
744 min = int(m.group('min'))
745 pat = int(m.group('pat'))
746
747 return (maj,min,pat)
748
749
750 def CheckSwigVersion(context):
751
752 try:
753 context.Message("Checking version of SWIG... ")
754 maj,min,pat = get_swig_version(context.env)
755 except:
756 context.Result("Failed to detect version, or failed to run SWIG")
757 return 0;
758
759 context.env['SWIGVERSION']=tuple([maj,min,pat])
760
761 if maj == 1 and (
762 min > 3
763 or (min == 3 and pat >= 24)
764 ):
765 context.Result("ok, %d.%d.%d" % (maj,min,pat))
766 return 1;
767 else:
768 context.Result("too old, %d.%d.%d" % (maj,min,pat))
769 return 0;
770
771 #----------------
772 # Scrollkeeper (Linux documentation system)
773
774 def get_scrollkeeper_omfdir(env):
775 cmd = 'scrollkeeper-config --omfdir'
776 (cin,coutcerr) = os.popen4(cmd)
777 output = coutcerr.read()
778 return output.strip()
779
780 def CheckScrollkeeperConfig(context):
781 try:
782 context.Message("Checking for scrollkeeper...")
783 dir=get_scrollkeeper_omfdir(context.env)
784 except:
785 context.Result("Failed to run 'scrollkeeper-config'")
786 return 0
787 context.env['OMFDIR']=dir
788 context.Result("OK, %s" % dir)
789 return 1
790
791 #----------------
792 # General purpose library-and-header test
793
794 class KeepContext:
795 def __init__(self,context,varprefix,static=False):
796 self.keep = {}
797 for k in ['LIBS','LIBPATH','CPPPATH','LINKFLAGS']:
798 #print "Keeping env %s = %s" % (k,context.env.get(k))
799 self.keep[k]=context.env.get(k)
800
801 if context.env.has_key(varprefix+'_CPPPATH'):
802 context.env.AppendUnique(CPPPATH=[env[varprefix+'_CPPPATH']])
803 #print "Adding '"+str(env[varprefix+'_CPPPATH'])+"' to cpp path"
804
805 if static:
806 staticlib=env[varprefix+'_LIB']
807 #print "STATIC LIB = ",staticlib
808 context.env.Append(
809 LINKFLAGS=[staticlib]
810 )
811 else:
812 if context.env.has_key(varprefix+'_LIBPATH'):
813 context.env.Append(LIBPATH=[env[varprefix+'_LIBPATH']])
814 #print "Adding '"+str(env[varprefix+'_LIBPATH'])+"' to lib path"
815
816 if context.env.has_key(varprefix+'_LIB'):
817 context.env.Append(LIBS=[env[varprefix+'_LIB']])
818 #print "Adding '"+str(env[varprefix+'_LIB'])+"' to libs"
819
820 def restore(self,context):
821 #print "RESTORING CONTEXT"
822 #print self.keep
823 #print "..."
824 for k in self.keep:
825 if self.keep[k]==None:
826 if context.env.has_key(k):
827 #print "Clearing "+str(k)
828 del context.env[k];
829 else:
830 #print "Restoring %s to '%s'" %(k,self.keep.get(k))
831 context.env[k]=self.keep[k];
832
833 def CheckExtLib(context,libname,text,ext='.c',varprefix=None,static=False):
834 """This method will check for variables LIBNAME_LIBPATH
835 and LIBNAME_CPPPATH and try to compile and link the
836 file with the provided text, linking with the
837 library libname."""
838
839 if static:
840 context.Message( 'Checking for static '+libname+'... ' )
841 else:
842 context.Message( 'Checking for '+libname+'... ' )
843
844 if varprefix==None:
845 varprefix = libname.upper()
846
847 #print "LIBS is currently:",context.env.get('LIBS')
848 keep = KeepContext(context,varprefix,static)
849
850 if not context.env.has_key(varprefix+'_LIB'):
851 # if varprefix_LIB were in env, KeepContext would
852 # have appended it already
853 context.env.Append(LIBS=[libname])
854
855 is_ok = context.TryLink(text,ext)
856
857 #print "Link success? ",(is_ok != 0)
858
859 keep.restore(context)
860
861 # print "Restored CPPPATH="+str(context.env['CPPPATH'])
862 # print "Restored LIBS="+str(context.env['LIBS'])
863 # print "Restored LIBPATH="+str(context.env['LIBPATH'])
864
865 context.Result(is_ok)
866 return is_ok
867
868 #----------------
869 # GCC
870
871 gcc_test_text = """
872 #ifndef __GNUC__
873 # error "Not using GCC"
874 #endif
875
876 int main(void){
877 return __GNUC__;
878 }
879 """
880
881 def CheckGcc(context):
882 context.Message("Checking for GCC... ")
883 is_ok = context.TryCompile(gcc_test_text,".c")
884 context.Result(is_ok)
885 return is_ok
886
887 #----------------
888 # GCC VISIBILITY feature
889
890 gccvisibility_test_text = """
891 #if __GNUC__ < 4
892 # error "Require GCC version 4 or newer"
893 #endif
894
895 __attribute__ ((visibility("default"))) int x;
896
897 int main(void){
898 extern int x;
899 x = 4;
900 }
901 """
902
903 def CheckGccVisibility(context):
904 context.Message("Checking for GCC 'visibility' capability... ")
905 if not context.env.has_key('WITH_GCCVISIBILITY') or not env['WITH_GCCVISIBILITY']:
906 context.Result("disabled")
907 return 0
908 is_ok = context.TryCompile(gccvisibility_test_text,".c")
909 context.Result(is_ok)
910 return is_ok
911
912 #----------------
913 # YACC
914
915 yacc_test_text = """
916 %{
917 #include <stdio.h>
918
919 /* MSVC++ needs this before it can swallow Bison output */
920 #ifdef _MSC_VER
921 # define __STDC__
922 #endif
923 %}
924 %token MSG
925 %start ROOT
926 %%
927 ROOT:
928 MSG { printf("HELLO"); }
929 ;
930 %%
931 """
932
933 def CheckYacc(context):
934 context.Message("Checking for Yacc ('%s')... " % context.env.get('YACC'))
935 is_ok = context.TryCompile(yacc_test_text,".y")
936 context.Result(is_ok)
937 return is_ok
938
939 #----------------
940 # LEX
941
942 lex_test_text = """
943 %{
944 #include <stdio.h>
945 %}
946 DIGIT [0-9]
947 ID [a-z][a-z0-9]*
948 %%
949 {DIGIT}+ {
950 printf("A digit: %s\\n",yytext);
951 }
952
953 [ \\t\\n]+ /* ignore */
954
955 . {
956 printf("Unrecognized guff");
957 }
958 %%
959 main(){
960 yylex();
961 }
962 """
963
964 def CheckLex(context):
965 context.Message("Checking for Lex ('%s')... " % context.env.get('LEX'))
966 is_ok = context.TryCompile(lex_test_text,".l")
967 context.Result(is_ok)
968 return is_ok
969
970 #----------------
971 # CUnit test
972
973 cunit_test_text = """
974 #include <CUnit/CUnit.h>
975 int maxi(int i1, int i2){
976 return (i1 > i2) ? i1 : i2;
977 }
978
979 void test_maxi(void){
980 CU_ASSERT(maxi(0,2) == 2);
981 CU_ASSERT(maxi(0,-2) == 0);
982 CU_ASSERT(maxi(2,2) == 2);
983
984 }
985 int main(void){
986 /* CU_initialize_registry() */
987 return 0;
988 }
989 """
990
991 def CheckCUnit(context):
992 return CheckExtLib(context,'cunit',cunit_test_text)
993
994 #----------------
995 # dmalloc test
996
997 dmalloc_test_text = """
998 #include <stdlib.h>
999 #include <dmalloc.h>
1000
1001 int main(void){
1002 char *c;
1003 c = malloc(100*sizeof(char));
1004 free(c);
1005 return 0;
1006 }
1007 """
1008
1009 def CheckDMalloc(context):
1010 return CheckExtLib(context,'dmalloc',dmalloc_test_text)
1011
1012 #----------------
1013 # mfgraph test
1014
1015 mfgraph_test_text = """
1016 #include <mfgraph/mfg_draw_graph.h>
1017 int main(void){
1018 using namespace mfg;
1019 DrawGraph g;
1020 return 0;
1021 }
1022 """
1023
1024 def CheckMFGraph(context):
1025 return CheckExtLib(context,'mfgraph',mfgraph_test_text,ext=".cpp")
1026
1027 #----------------
1028 # ufsparse test
1029
1030 ufsparse_test_text = """
1031 #include <ufsparse/cs.h>
1032 int main(void){
1033 cs *A,*B,*C;
1034 C = cs_multiply(A,B);
1035 return 0;
1036 }
1037 """
1038
1039 def CheckUFSparse(context):
1040 return CheckExtLib(context
1041 ,libname='cxsparse'
1042 ,varprefix='ufsparse'
1043 ,text=ufsparse_test_text
1044 ,ext=".c"
1045 )
1046
1047 #----------------
1048 # MATH test
1049
1050 math_test_text = """
1051 #ifndef _ALL_SOURCE
1052 # define _ALL_SOURCE
1053 #endif
1054 #ifndef _XOPEN_SOURCE
1055 # define _XOPEN_SOURCE
1056 #endif
1057 #ifndef _XOPEN_SOURCE_EXTENDED
1058 # define _XOPEN_SOURCE_EXTENDED 1
1059 #endif
1060 #include <math.h>
1061 int main(void){
1062 double x = 1.0; double y = 1.0; int i = 1;
1063 acosh(x); asinh(x); atanh(x); cbrt(x); expm1(x); erf(x); erfc(x); isnan(x);
1064 j0(x); j1(x); jn(i,x); ilogb(x); logb(x); log1p(x); rint(x);
1065 y0(x); y1(x); yn(i,x);
1066 #ifdef _THREAD_SAFE
1067 gamma_r(x,&i);
1068 lgamma_r(x,&i);
1069 #else
1070 gamma(x);
1071 lgamma(x);
1072 #endif
1073 hypot(x,y); nextafter(x,y); remainder(x,y); scalb(x,y);
1074 return 0;
1075 }
1076 """
1077
1078 def CheckMath(context):
1079 context.Message('Checking for IEEE math library... ')
1080 libsave=context.env.get('LIBS');
1081 context.env.AppendUnique(LIBS=['m'])
1082 is_ok=context.TryLink(math_test_text,".c")
1083 context.Result(is_ok)
1084 if not is_ok:
1085 context.env['LIBS']=libsave
1086 return is_ok
1087
1088 #----------------
1089 # libpython test
1090
1091 libpython_test_text = """
1092 #include <Python.h>
1093 int main(void){
1094 PyObject *p;
1095 p = Py_None;
1096 return 0;
1097 }
1098 """
1099
1100 def CheckPythonLib(context):
1101 context.Message('Checking for libpython... ')
1102
1103 if platform.system()=="Windows":
1104 python_lib='python%d%d'
1105 else:
1106 python_lib='python%d.%d'
1107 python_libs = [python_lib % (sys.version_info[0],sys.version_info[1])]
1108
1109 python_cpppath = [distutils.sysconfig.get_python_inc()]
1110 cfig = distutils.sysconfig.get_config_vars()
1111
1112 lastLIBS = context.env.get('LIBS')
1113 lastLIBPATH = context.env.get('LIBPATH')
1114 lastCPPPATH = context.env.get('CPPPATH')
1115 lastLINKFLAGS = context.env.get('LINKFLAGS')
1116
1117 python_libpath = []
1118 python_linkflags = []
1119 if platform.system()=="Windows":
1120 python_libpath+=[cfig['prefix']]
1121 else:
1122 # checked on Linux and SunOS
1123 if cfig['LDLIBRARY']==cfig['LIBRARY']:
1124 sys.stdout.write("(static)")
1125 python_libpath += [cfig['LIBPL']]
1126 python_linkflags += cfig['LIBS'].split(' ')
1127
1128 context.env.AppendUnique(LIBS=python_libs)
1129 context.env.AppendUnique(LIBPATH=python_libpath)
1130 context.env.AppendUnique(CPPPATH=python_cpppath)
1131 context.env.AppendUnique(LINKFLAGS=python_linkflags)
1132 result = context.TryLink(libpython_test_text,".c");
1133
1134 context.Result(result)
1135
1136 if(result):
1137 context.env['PYTHON_LIBPATH']=python_libpath
1138 context.env['PYTHON_LIB']=python_libs
1139 context.env['PYTHON_CPPPATH']=python_cpppath
1140 context.env['PYTHON_LINKFLAGS']=python_linkflags
1141
1142 context.env['LIBS'] = lastLIBS
1143 context.env['LIBPATH'] = lastLIBPATH
1144 context.env['CPPPATH'] = lastCPPPATH
1145 context.env['LINKFLAGS'] = lastLINKFLAGS
1146
1147 return result
1148
1149 #----------------
1150 # IDA test
1151
1152 sundials_version_major_required = 2
1153 sundials_version_minor_min = 2
1154 sundials_version_minor_max = 3
1155
1156 sundials_version_text = """
1157 #include <sundials/sundials_config.h>
1158 #include <stdio.h>
1159 int main(){
1160 printf("%s",SUNDIALS_PACKAGE_VERSION);
1161 return 0;
1162 }
1163 """
1164
1165 ida_test_text = """
1166 # include <ida/ida.h>
1167 # include <nvector/nvector_serial.h>
1168 # include <ida/ida_spgmr.h>
1169 int main(){
1170 void *ida_mem;
1171 ida_mem = IDACreate();
1172 return 0;
1173 }
1174 """
1175
1176 def CheckIDA(context):
1177 context.Message( 'Checking for IDA (SUNDIALS)... ' )
1178
1179 keep = KeepContext(context,"IDA")
1180
1181 is_ok = context.TryLink(ida_test_text,".c")
1182 context.Result(is_ok)
1183
1184 keep.restore(context)
1185
1186 return is_ok
1187
1188 # slightly changed calling convention (IDACalcID) in newer versions of SUNDIALS,
1189 # so detect the version and act accordingly.
1190 def CheckIDAVersion(context):
1191 keep = KeepContext(context,'IDA')
1192 context.Message("Checking SUNDIALS version... ")
1193 (is_ok,output) = context.TryRun(sundials_version_text,'.c')
1194 keep.restore(context)
1195 if not is_ok:
1196 context.Result("failed to run check")
1197 return 0
1198
1199 major,minor,patch = tuple([int(i) for i in output.split(".")])
1200 context.env['SUNDIALS_VERSION_MAJOR'] = major
1201 context.env['SUNDIALS_VERSION_MINOR'] = minor
1202 if major != sundials_version_major_required \
1203 or minor < sundials_version_minor_min \
1204 or minor > sundials_version_minor_max:
1205 context.Result(output+" (bad version)")
1206 # bad version
1207 return 0
1208
1209 # good version
1210 context.Result("%d.%d.%d, good" % (major,minor,patch))
1211 return 1
1212
1213 #----------------
1214 # CONOPT test
1215
1216 conopt_test_text = """
1217 #if !defined(_WIN32)
1218 # define FNAME_LCASE_DECOR
1219 #endif
1220
1221 #include <conopt.h>
1222 #include <stdlib.h>
1223 int main(){
1224 int s, *v, e;
1225 s = COIDEF_Size();
1226 v = (int *)malloc(s*sizeof(int));
1227 e = COIDEF_Ini(v);
1228 return e;
1229 }
1230 """
1231
1232 def CheckCONOPT(context):
1233 context.Message( 'Checking for CONOPT... ' )
1234
1235 keep = KeepContext(context,"CONOPT")
1236
1237 is_ok = context.TryLink(conopt_test_text,".c")
1238 context.Result(is_ok)
1239
1240 keep.restore(context)
1241
1242 return is_ok
1243
1244 #----------------
1245 # Tcl test
1246
1247 # TCL and TK required version 8.1, 8.2, 8.3, or 8.4:
1248 tcltk_minor_newest_acceptable = 4
1249 tcltk_major_required = 8
1250
1251 tcl_check_text = r"""
1252 #include <tcl.h>
1253 #include <stdio.h>
1254 int main(void){
1255 printf("%s",TCL_PATCH_LEVEL);
1256 return 0;
1257 }
1258 """
1259
1260 def CheckTcl(context):
1261 return CheckExtLib(context,'tcl',tcl_check_text,static=env['STATIC_TCLTK'])
1262
1263 def CheckTclVersion(context):
1264 keep = KeepContext(context,'TCL',static=env['STATIC_TCLTK'])
1265 context.Message("Checking Tcl version... ")
1266 (is_ok,output) = context.TryRun(tcl_check_text,'.c')
1267 keep.restore(context)
1268 if not is_ok:
1269 context.Result("failed to run check")
1270 return 0
1271
1272 major,minor,patch = tuple([int(i) for i in output.split(".")])
1273 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1274 context.Result(output+" (bad version)")
1275 # bad version
1276 return 0
1277
1278 # good version
1279 context.Result(output+", good")
1280 return 1
1281
1282 #----------------
1283 # Tk test
1284
1285 tk_check_text = r"""
1286 #include <tk.h>
1287 #include <stdio.h>
1288 int main(void){
1289 printf("%s",TK_PATCH_LEVEL);
1290 return 0;
1291 }
1292 """
1293 def CheckTk(context):
1294 return CheckExtLib(context,'tk',tk_check_text,static=env['STATIC_TCLTK'])
1295
1296
1297 def CheckTkVersion(context):
1298 keep = KeepContext(context,'TK',static=context.env['STATIC_TCLTK'])
1299 context.Message("Checking Tk version... ")
1300 #print "LINKFLAGS =",context.env['LINKFLAGS']
1301 (is_ok,output) = context.TryRun(tk_check_text,'.c')
1302 keep.restore(context)
1303 if not is_ok:
1304 context.Result("failed to run check")
1305 return 0
1306
1307 major,minor,patch = tuple([int(i) for i in output.split(".")])
1308 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1309 # bad version
1310 context.Result(output+" (bad version)")
1311 return 0
1312
1313 # good version
1314 context.Result(output+" (good)")
1315 return 1
1316
1317 #----------------
1318 # Tktable test
1319
1320 tktable_check_text = r"""
1321 #include <tkTable.h>
1322 #include <stdio.h>
1323 int main(void){
1324 Table mytable;
1325 return 0;
1326 }
1327 """
1328
1329 def CheckTkTable(context):
1330 return CheckExtLib(context,'tktable',tktable_check_text,static=env['STATIC_TCLTK'])
1331
1332 #---------------
1333 # X11 test
1334
1335 x11_check_text = r"""
1336 #include <X11/Xlib.h>
1337 #include <X11/IntrinsicP.h>
1338 #include <X11/Intrinsic.h>
1339 #include <X11/ObjectP.h>
1340 #include <X11/Object.h>
1341 int main(void){
1342 Object mything;
1343 return 0;
1344 }
1345 """
1346
1347 def CheckX11(context):
1348 return CheckExtLib(context,'X11',x11_check_text)
1349
1350 #----------------
1351 # Check that we can raise and catch sigint
1352
1353 sigint_test_text = r"""
1354 #include <signal.h>
1355 #include <setjmp.h>
1356 #include <stdlib.h>
1357 static jmp_buf g_jmpenv;
1358 void sighandler(int sig){
1359 longjmp(g_jmpenv,sig);
1360 }
1361 void testsigint(){
1362 raise(SIGINT);
1363 }
1364 int main(void){
1365 signal(SIGINT,&sighandler);
1366 switch(setjmp(g_jmpenv)){
1367 case 0:
1368 testsigint();
1369 exit(1);
1370 case SIGINT:
1371 exit(0);
1372 default:
1373 exit(2);
1374 }
1375 }
1376 """
1377
1378 def CheckSIGINT(context):
1379 context.Message("Checking SIGINT is catchable... ")
1380 (is_ok,output)=context.TryRun(sigint_test_text,".c")
1381 context.Result(is_ok)
1382 return is_ok
1383
1384 #----------------
1385 # Check that we're able to catch floating point errors
1386
1387 sigfpe_test_text = r"""
1388 #include <signal.h>
1389 #include <setjmp.h>
1390 #include <stdlib.h>
1391 #include <fenv.h>
1392 static jmp_buf g_jmpenv;
1393 void fpehandler(int sig){
1394 longjmp(g_jmpenv,sig);
1395 }
1396 int main(void){
1397 fenv_t myfenv;
1398 fegetenv(&myfenv);
1399 fesetenv(&myfenv);
1400 feenableexcept(FE_ALL_EXCEPT);
1401 signal(SIGFPE,&fpehandler);
1402 double x;
1403 switch(setjmp(g_jmpenv)){
1404 case 0:
1405 x = 1.0 / 0.0;
1406 /* failed to catch */
1407 exit(1);
1408 case SIGFPE:
1409 exit(0);
1410 }
1411 }
1412 """
1413
1414 def CheckFPE(context):
1415 context.Message("Checking C99 FPE behaviour... ")
1416 (is_ok,output) = context.TryRun(sigfpe_test_text,'.c')
1417 context.Result(is_ok)
1418 return is_ok
1419
1420 #----------------
1421 # signal reset needed?
1422
1423 sigreset_test_text = r"""
1424 #include <signal.h>
1425 #include <setjmp.h>
1426 #include <stdlib.h>
1427 #include <stdio.h>
1428 typedef void SigHandlerFn(int);
1429 static jmp_buf g_jmpenv;
1430 void sighandler(int sig){
1431 longjmp(g_jmpenv,sig);
1432 }
1433 void testsigint(){
1434 /* fprintf(stderr,"Raising SIGINT\n"); */
1435 raise(SIGINT);
1436 }
1437 int main(void){
1438 SigHandlerFn *last,*saved;
1439 saved = signal(SIGINT,&sighandler);
1440 if(saved!=SIG_DFL){
1441 fprintf(stderr,"Default handler (%p) was not correctly set\n",SIG_DFL);
1442 exit(3);
1443 }
1444 switch(setjmp(g_jmpenv)){
1445 case 0:
1446 testsigint();
1447 fprintf(stderr,"Back from SIGINT\n");
1448 exit(1);
1449 case SIGINT:
1450 break;
1451 default:
1452 exit(2);
1453 };
1454 last = signal(SIGINT,SIG_DFL);
1455 if(last!=&sighandler){
1456 printf("1");
1457 exit(0);
1458 }
1459 printf("0");
1460 exit(0);
1461 }
1462 """
1463
1464 def CheckSigReset(context):
1465 context.Message("Checking signal handler reset... ")
1466 (is_ok,output) = context.TryRun(sigreset_test_text,'.c')
1467 if not is_ok:
1468 context.Result("ERROR")
1469 return False
1470 if int(output)==1:
1471 context.Result("required");
1472 context.env['ASC_RESETNEEDED'] = True
1473 else:
1474 context.Result("not required");
1475 context.env['ASC_RESETNEEDED'] = False
1476 return is_ok
1477
1478 #----------------
1479 # GCC Version sniffing
1480
1481 # TODO FIXME
1482
1483 gcc_version4 = False
1484
1485 #------------------------------------------------------
1486 # CONFIGURATION
1487
1488 conf = Configure(env
1489 , custom_tests = {
1490 'CheckMath' : CheckMath
1491 , 'CheckSwigVersion' : CheckSwigVersion
1492 , 'CheckPythonLib' : CheckPythonLib
1493 , 'CheckCUnit' : CheckCUnit
1494 , 'CheckDMalloc' : CheckDMalloc
1495 , 'CheckMFGraph' : CheckMFGraph
1496 , 'CheckUFSparse' : CheckUFSparse
1497 , 'CheckTcl' : CheckTcl
1498 , 'CheckTclVersion' : CheckTclVersion
1499 , 'CheckTk' : CheckTk
1500 , 'CheckTkVersion' : CheckTkVersion
1501 , 'CheckGcc' : CheckGcc
1502 , 'CheckGccVisibility' : CheckGccVisibility
1503 , 'CheckYacc' : CheckYacc
1504 , 'CheckLex' : CheckLex
1505 , 'CheckTkTable' : CheckTkTable
1506 , 'CheckX11' : CheckX11
1507 , 'CheckIDA' : CheckIDA
1508 , 'CheckIDAVersion' : CheckIDAVersion
1509 , 'CheckCONOPT' : CheckCONOPT
1510 , 'CheckScrollkeeperConfig' : CheckScrollkeeperConfig
1511 , 'CheckFPE' : CheckFPE
1512 , 'CheckSIGINT' : CheckSIGINT
1513 , 'CheckSigReset' : CheckSigReset
1514 # , 'CheckIsNan' : CheckIsNan
1515 # , 'CheckCppUnitConfig' : CheckCppUnitConfig
1516 }
1517 # , config_h = "config.h"
1518 )
1519
1520 # stdio -- just to check that compiler is behaving
1521
1522 if not conf.CheckHeader('stdio.h'):
1523 print "CPPPATH =",env.get('CPPPATH')
1524 print "Did not find 'stdio.h'! Check your compiler configuration."
1525 print ""
1526 print "You environment is printed here:"
1527 for k,v in os.environ.iteritems():
1528 print "%-30s%s" % ("%s :" % k, v)
1529 Exit(1)
1530
1531 if not conf.CheckFunc('snprintf'):
1532 print "Didn't find snprintf";
1533 exit(1)
1534
1535 # Math library
1536
1537 conf.env['HAVE_IEEE']=True
1538
1539 if need_libm and not conf.CheckMath():
1540 conf.env['HAVE_IEEE']=False
1541 print 'Did not find math library, exiting!'
1542 Exit(1)
1543
1544 # Where is 'isnan'?
1545
1546 if not conf.CheckFunc('isnan') and not conf.CheckFunc('_isnan'):
1547 print "Didn't find isnan"
1548 # Exit(1)
1549
1550 # GCC visibility
1551
1552 if conf.CheckGcc():
1553 conf.env['HAVE_GCC']=True;
1554 if env['WITH_GCCVISIBILITY'] and conf.CheckGccVisibility():
1555 conf.env['HAVE_GCCVISIBILITY']=True;
1556 conf.env.Append(CCFLAGS=['-fvisibility=hidden'])
1557 conf.env.Append(CPPDEFINES=['HAVE_GCCVISIBILITY'])
1558 conf.env.Append(CCFLAGS=['-Wall'])
1559
1560 # Catching SIGINT
1561
1562 if env['WITH_SIGNALS']:
1563 if not conf.CheckSIGINT():
1564 with_signals = False
1565 without_signals_reason = "SIGINT uncatchable"
1566
1567 # Catching SIGFPE
1568
1569 if conf.CheckFPE():
1570 conf.env['HAVE_C99FPE']=True
1571 else:
1572 conf.env['HAVE_C99FPE']=False
1573
1574 # Checking for signal reset requirement
1575
1576 if not conf.CheckSigReset():
1577 print "Unable to determine if signal reset is required"
1578 Exit(1)
1579
1580 # YACC
1581
1582 if not conf.CheckYacc():
1583 print "YACC NOT FOUND OR NOT WORKING"
1584 else:
1585 conf.env['HAVE_YACC']=True
1586
1587 if not conf.CheckLex():
1588 print "YACC NOT FOUND OR NOT WORKING"
1589 else:
1590 conf.env['HAVE_LEX']=True
1591
1592 # Tcl/Tk
1593
1594 if with_tcltk:
1595 if conf.CheckTcl():
1596 if conf.CheckTclVersion():
1597 if conf.CheckTk():
1598 if with_tcltk and conf.CheckTkVersion():
1599 if env['STATIC_TCLTK']:
1600 if conf.CheckTkTable():
1601 pass
1602 else:
1603 without_tcltk_reason = "TkTable not found"
1604 with_tcltk = False
1605 else:
1606 without_tcltk_reason = "Require Tk version <= 8.4. See 'scons -h'"
1607 with_tcltk = False
1608 else:
1609 without_tcltk_reason = "Tk not found."
1610 with_tcltk = False
1611 else:
1612 without_tcltk_reason = "Require Tcl <= 8.4 Tcl."
1613 with_tcltk = False
1614
1615 else:
1616 without_tcltk_reason = "Tcl not found."
1617 with_tcltk = False
1618
1619 if env['STATIC_TCLTK']:
1620 conf.CheckX11()
1621
1622 # Python... obviously we're already running python, so we just need to
1623 # check that we can link to the python library OK:
1624
1625 if not conf.CheckPythonLib():
1626 without_python_reason = 'libpython2.x not found or not linkable'
1627 with_python = False
1628 env['WITH_PYTHON']=False
1629
1630 # SWIG version
1631
1632 if with_python and not conf.CheckSwigVersion():
1633 without_python_reason = 'SWIG >= 1.3.24 is required'
1634 with_python = False
1635 env['WITH_PYTHON']=False
1636
1637 # CUnit
1638
1639 if with_cunit:
1640 if not conf.CheckCUnit():
1641 without_cunit_reason = 'CUnit not found'
1642 with_cunit = False
1643 #print "CUNIT NOT FOUND, LIBS=",conf.env.get('LIBS')
1644
1645 # DMALLOC
1646
1647 if with_dmalloc:
1648 if not conf.CheckDMalloc():
1649 without_dmalloc_reason = 'dmalloc not found'
1650 with_dmalloc = False
1651
1652 # MFGRAPH
1653
1654 if with_mfgraph:
1655 if not conf.CheckMFGraph():
1656 without_mfgraph_reason = 'mfgraph not found'
1657 with_mfgraph = False
1658 env['WITH_MFGRAPH'] = False
1659
1660 # UFSPARSE
1661
1662 if with_ufsparse:
1663 if not conf.CheckUFSparse():
1664 without_ufsparse_reason = 'mfgraph not found'
1665 with_ufsparse = False
1666 env['WITH_UFSPARSE'] = False
1667
1668 # IDA
1669
1670 if not with_ida:
1671 without_ida_reason = "Not selected (see config option WITH_SOLVERS)"
1672 elif not conf.CheckIDA():
1673 with_ida = False
1674 without_ida_reason = "IDA not found"
1675 elif not conf.CheckIDAVersion():
1676 with_ida = False
1677 without_ida_reason = "Unsupported (or undetected) SUNDIALS version"
1678
1679 # CONOPT
1680
1681 if not with_conopt:
1682 without_conopt_reason = "Not selected (see config option WITH_SOLVERS)"
1683 elif not conf.CheckCONOPT():
1684 with_conopt = False
1685 without_conpt_reason = "CONOPT not found"
1686
1687 # BLAS
1688
1689 need_blas=False
1690
1691 if with_lsode:
1692 need_fortran = True
1693 need_blas=True
1694
1695 if need_blas:
1696 if conf.CheckLib('blas'):
1697 with_local_blas = False
1698 without_local_blas_reason = "Found BLAS installed on system"
1699 else:
1700 with_local_blas = True
1701 need_fortran = True
1702 else:
1703 with_local_blas= False;
1704 without_local_blas_reason = "BLAS not required"
1705
1706 # FORTRAN
1707
1708 if need_fortran:
1709 conf.env.Tool('fortran')
1710 detect_fortran = conf.env.Detect(['g77','f77','gfortran'])
1711 if detect_fortran:
1712 # For some reason, g77 doesn't get detected properly on MinGW
1713 if not env.has_key('F77') and not env.has_key('FORTRAN'):
1714 conf.env.Replace(F77=detect_fortran)
1715 conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
1716 conf.env.Replace(F77FLAGS='')
1717 #print "F77:",conf.env['F77']
1718 #print "F77COM:",conf.env['F77COM']
1719 #print "F77FLAGS:",conf.env['F77FLAGS']
1720 fortran_builder = Builder(
1721 action='$F77COM'
1722 , suffix='.o'
1723 , src_suffix='.f'
1724 )
1725 conf.env.Append(BUILDERS={'Fortran':fortran_builder})
1726 if platform.system()=="Linux":
1727 conf.env.Append(SHFORTRANFLAGS=['-fPIC'])
1728 else:
1729 with_lsode=False;
1730 without_lsode_reason="FORTRAN-77 required but not found"
1731
1732 #else:
1733 # print "FORTRAN not required"
1734
1735 # F2C
1736
1737 if need_fortran:
1738 if platform.system()=="Windows":
1739 conf.env.Append(LIBPATH='c:\mingw\lib')
1740
1741 # scrollkeeper
1742
1743 if with_scrollkeeper:
1744 if not conf.CheckScrollkeeperConfig():
1745 with_scrollkeeper=False
1746 without_scrollkeeper_reason="unable to detect scrollkeeper-config"
1747
1748 # TODO: -D_HPUX_SOURCE is needed
1749
1750 # TODO: check size of void*
1751
1752 # TODO: detect if dynamic libraries are possible or not
1753
1754 if platform.system()=="Windows" and env.has_key('MSVS'):
1755 _found_windows_h = conf.CheckHeader('Windows.h')
1756
1757 if not _found_windows_h:
1758 print "Could not locate 'Windows.h' in CPPPATH. Check your configuration."
1759 Exit(1)
1760
1761 if with_python and not conf.CheckHeader(['basetsd.h','BaseTsd.h']):
1762 with_python = 0;
1763 without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
1764
1765 conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
1766
1767 conf.Finish()
1768
1769 #---------------------------------------
1770 # SUBSTITUTION DICTIONARY for .in files
1771
1772 release = env.get('RELEASE')
1773 if release=="0.":
1774 release="0"
1775
1776 #print "SUBSTITUTED CONOPT_LIBPATH:",c_escape(env.subst("$CONOPT_LIBPATH"))
1777
1778 subst_dict = {
1779 '@DEFAULT_ASCENDLIBRARY@':env['DEFAULT_ASCENDLIBRARY']
1780 , '@GLADE_FILE@':'ascend.glade'
1781 , '@HELP_ROOT@':''
1782 , '@ICON_EXTENSION@':icon_extension
1783 , '@INSTALL_ASCDATA@':env['INSTALL_ASCDATA']
1784 , '@INSTALL_BIN@':env['INSTALL_BIN']
1785 , '@INSTALL_INCLUDE@':env['INSTALL_INCLUDE']
1786 , '@INSTALL_LIB@':env['INSTALL_LIB']
1787 , '@INSTALL_MODELS@':env['INSTALL_MODELS']
1788 , '@PYGTK_ASSETS@':env['PYGTK_ASSETS']
1789 , '@VERSION@':version
1790 , '@RELEASE@':release
1791 , '@DISTTAR_NAME@':env['DISTTAR_NAME']
1792 , '@WEBHELPROOT@':'http://pye.dyndns.org/ascend/manual/'
1793 , '@SHLIBSUFFIX@':env['SHLIBSUFFIX']
1794 , '@SHLIBPREFIX@':env['SHLIBPREFIX']
1795 , '@ASC_ENV_TK_DEFAULT@' : '$$ASCENDDIST/tcltk'
1796 , '@ASC_DISTDIR_REL_BIN@' : default_rel_distdir
1797 , '@PYTHON@' : python_exe
1798 , '@ASC_CONOPT_LIB@':env.get('CONOPT_LIB')
1799 , '@ASC_CONOPT_ENVVAR@':env.get('CONOPT_ENVVAR')
1800 , '@ASC_CONOPT_DLPATH@':c_escape(env.subst("$CONOPT_LIBPATH"))
1801 , '@SOURCE_ROOT@':c_escape(os.path.abspath(str(env.Dir("#"))))
1802 }
1803
1804 if env.get('WITH_LOCAL_HELP'):
1805 print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
1806 subst_dict['@HELP_ROOT@']=env['WITH_LOCAL_HELP']
1807
1808 # bool options...
1809 for k,v in {
1810 'ASC_WITH_IDA':with_ida
1811 ,'ASC_WITH_DMALLOC':with_dmalloc
1812 ,'ASC_WITH_MFGRAPH':with_mfgraph
1813 ,'ASC_WITH_UFSPARSE':with_ufsparse
1814 ,'ASC_WITH_CONOPT':with_conopt
1815 ,'ASC_WITH_LSODE':with_lsode
1816 ,'ASC_WITH_MMIO':with_mmio
1817 ,'ASC_SIGNAL_TRAPS':with_signals
1818 ,'ASC_RESETNEEDED':env.get('ASC_RESETNEEDED')
1819 ,'HAVE_C99FPE':env.get('HAVE_C99FPE')
1820 ,'HAVE_IEEE':env.get('HAVE_IEEE')
1821 ,'ASC_ABSOLUTE_PATHS':env.get('ASC_ABSOLUTE_PATHS')
1822 ,'ASC_XTERM_COLORS':env.get('WITH_XTERM_COLORS')
1823 ,'MALLOC_DEBUG':env.get('MALLOC_DEBUG')
1824 ,'ASC_IDA_NEW_ANALYSE':env.get('IDA_NEW_ANALYSE')
1825 }.iteritems():
1826
1827 if v: subst_dict["/\\* #define %s @%s@ \\*/" % (k,k)]='# define %s 1 ' % k
1828
1829 if with_python:
1830 subst_dict['@ASCXX_USE_PYTHON@']="1"
1831 env['WITH_PYTHON']=1;
1832
1833 if env.has_key('HAVE_GCCVISIBILITY'):
1834 subst_dict['@HAVE_GCCVISIBILITY@'] = "1"
1835
1836 env.Append(SUBST_DICT=subst_dict)
1837
1838 #for k,v in subst_dict.iteritems():
1839 # print "%-50s%s" % ("'%s'"%k,v)
1840
1841 # REMOVED: long command-line support on Win2k
1842
1843 #------------------------------------------------------
1844 # RECIPE: SWIG scanner
1845
1846 import SCons.Script
1847
1848 SWIGScanner = SCons.Scanner.ClassicCPP(
1849 "SWIGScan"
1850 , ".i"
1851 , "CPPPATH"
1852 , '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
1853 )
1854
1855 env.Append(SCANNERS=[SWIGScanner])
1856
1857 #------------------------------------------------------
1858 # RECIPE: 'SubstInFile', used in pygtk SConscript
1859
1860 import re
1861 from SCons.Script import * # the usual scons stuff you get in a SConscript
1862
1863 def TOOL_SUBST(env):
1864 """Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
1865 from the source to the target.
1866 The values of SUBST_DICT first have any construction variables expanded
1867 (its keys are not expanded).
1868 If a value of SUBST_DICT is a python callable function, it is called and
1869 the result is expanded as the value.
1870 If there's more than one source and more than one target, each target gets
1871 substituted from the corresponding source.
1872 """
1873 env.Append(TOOLS = 'SUBST')
1874 def do_subst_in_file(targetfile, sourcefile, dict):
1875 """Replace all instances of the keys of dict with their values.
1876 For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
1877 then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
1878 """
1879 try:
1880 f = open(sourcefile, 'rb')
1881 contents = f.read()
1882 f.close()
1883 except:
1884 raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
1885 for (k,v) in dict.items():
1886 try:
1887 #print "%s ---> %s" % (k,v)
1888 contents = re.sub(k, v, contents)
1889 except Exception,e:
1890 sys.stderr.write("Failed to substute '%s' with '%s': %s\n" % (k,v,e))
1891
1892 try:
1893 f = open(targetfile, 'wb')
1894 f.write(contents)
1895 f.close()
1896 except:
1897 raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
1898 return 0 # success
1899
1900 def subst_in_file(target, source, env):
1901 if not env.has_key('SUBST_DICT'):
1902 raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
1903 d = dict(env['SUBST_DICT']) # copy it
1904 for (k,v) in d.items():
1905 if callable(v):
1906 d[k] = env.subst(v())
1907 elif SCons.Util.is_String(v):
1908 d[k]=env.subst(v)
1909 else:
1910 raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
1911 for (t,s) in zip(target, source):
1912 return do_subst_in_file(str(t), str(s), d)
1913
1914 def subst_in_file_string(target, source, env):
1915 """This is what gets printed on the console."""
1916 return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
1917 for (t,s) in zip(target, source)])
1918
1919 def subst_emitter(target, source, env):
1920 """Add dependency from substituted SUBST_DICT to target.
1921 Returns original target, source tuple unchanged.
1922 """
1923 d = env['SUBST_DICT'].copy() # copy it
1924 for (k,v) in d.items():
1925 if callable(v):
1926 d[k] = env.subst(v())
1927 elif SCons.Util.is_String(v):
1928 d[k]=env.subst(v)
1929 Depends(target, SCons.Node.Python.Value(d))
1930 return target, source
1931
1932 subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string)
1933 env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
1934
1935 TOOL_SUBST(env)
1936
1937 #------------------------------------------------------
1938 # Recipe for 'CHMOD' ACTION
1939
1940 import SCons
1941 from SCons.Script.SConscript import SConsEnvironment
1942 SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod,
1943 lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode))
1944
1945 def InstallPerm(env, dest, files, perm):
1946 obj = env.Install(dest, files)
1947 for i in obj:
1948 env.AddPostAction(i, env.Chmod(str(i), perm))
1949
1950 SConsEnvironment.InstallPerm = InstallPerm
1951
1952 # define wrappers
1953 SConsEnvironment.InstallProgram = lambda env, dest, files: InstallPerm(env, dest, files, 0755)
1954 SConsEnvironment.InstallHeader = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1955 SConsEnvironment.InstallShared = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1956
1957 #------------------------------------------------------
1958 # BUILD...
1959
1960 # so that #include <modulename/headername.h> works across all modules...
1961 env.AppendUnique(CPPPATH=['#base/generic'])
1962
1963 if env['DEBUG']:
1964 env.Append(CCFLAGS=['-g'])
1965
1966 if env['GCOV']:
1967 env.Append(
1968 CPPFLAGS=['-g','-fprofile-arcs','-ftest-coverage']
1969 , LIBS=['gcov']
1970 , LINKFLAGS=['-fprofile-arcs','-ftest-coverage']
1971 )
1972
1973 if with_ida:
1974 env.Append(WITH_IDA=1)
1975
1976 if with_conopt:
1977 env.Append(WITH_CONOPT=1)
1978
1979 #-------------
1980 # TCL/TK GUI
1981
1982 if with_tcltk:
1983 env.SConscript(['tcltk/generic/interface/SConscript'],'env')
1984 else:
1985 print "Skipping... Tcl/Tk bindings aren't being built:",without_tcltk_reason
1986
1987 #-------------
1988 # PYTHON INTERFACE
1989
1990 if with_python:
1991 env.SConscript(['pygtk/SConscript'],'env')
1992 else:
1993 print "Skipping... Python bindings aren't being built:",without_python_reason
1994
1995 #------------
1996 # BASE/GENERIC SUBDIRECTORIES
1997
1998 libascend_env = env.Copy()
1999
2000 dirs = ['general','utilities','compiler','system','solver','integrator','packages','linear']
2001
2002 srcs = []
2003 for d in dirs:
2004 heresrcs = libascend_env.SConscript('base/generic/'+d+'/SConscript','libascend_env')
2005 srcs += heresrcs
2006
2007 #-------------
2008 # IMPORTED CODE: LSODE, BLAS, etc
2009
2010 if with_lsode:
2011 srcs += env.SConscript(['lsod/SConscript'],'env')
2012 srcs += env.SConscript(['linpack/SConscript'],'env')
2013 else:
2014 print "Skipping... LSODE won't be built:", without_lsode_reason
2015
2016 if with_local_blas:
2017 srcs += env.SConscript(['blas/SConscript'],'env')
2018 else:
2019 print "Skipping... BLAS won't be built:", without_local_blas_reason
2020
2021 if not with_ida:
2022 print "Skipping... IDA won't be built:", without_ida_reason
2023
2024 if with_mmio:
2025 srcs += env.SConscript(['mmio/SConscript'],'env')
2026 else:
2027 print "Skipping... MMIO export won't be built:", without_mmio_reason
2028 #-------------
2029 # LIBASCEND -- all base/generic functionality
2030
2031 if with_dmalloc:
2032 libascend_env.Append(LIBS=['dmalloc'])
2033
2034 if with_ufsparse:
2035 libascend_env.Append(LIBS=['cxsparse'])
2036
2037 libascend = libascend_env.SharedLibrary('ascend',srcs)
2038
2039 env.Alias('libascend',libascend)
2040
2041 #-------------
2042 # UNIT TESTS (C CODE)
2043
2044 if with_cunit:
2045 testdirs = ['general','solver','utilities','linear']
2046 testsrcs = []
2047 for testdir in testdirs:
2048 path = 'base/generic/'+testdir+'/test/'
2049 env.SConscript([path+'SConscript'],'env')
2050 testsrcs += [i.path for i in env['TESTSRCS_'+testdir.upper()]]
2051
2052 #print "TESTSRCS =",testsrcs
2053
2054 env.SConscript(['test/SConscript'],'env')
2055 env.SConscript(['base/generic/test/SConscript'],'env')
2056
2057 env.Alias('test',[env.Dir('test'),env.Dir('base/generic/test')])
2058
2059 else:
2060 print "Skipping... CUnit tests aren't being built:",without_cunit_reason
2061
2062 #-------------
2063 # EXTERNAL FUNCTIONS
2064
2065 env['extfns']=[]
2066 modeldirs = env.SConscript(['models/SConscript'],'env')
2067
2068 if not with_extfns:
2069 print "Skipping... External modules aren't being built:",without_extfns_reason
2070
2071 env.Alias('extfns',env['extfns'])
2072
2073 #------------------------------------------------------
2074 # CREATE ASCEND-CONFIG scriptlet
2075
2076 ascendconfig = env.SubstInFile('ascend-config.in')
2077
2078 #------------------------------------------------------
2079 # INSTALLATION
2080
2081 if env.get('CAN_INSTALL'):
2082
2083 dirs = ['INSTALL_BIN','INSTALL_ASCDATA','INSTALL_LIB', 'INSTALL_INCLUDE']
2084 install_dirs = [env.Entry(env['INSTALL_ROOT']+env[d]) for d in dirs]
2085 install_dirs += modeldirs
2086
2087 # TODO: add install options
2088 env.Alias('install',install_dirs)
2089
2090 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_LIB'],libascend)
2091
2092 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendconfig)
2093
2094 #------------------------------------------------------
2095 # WINDOWS INSTALLER
2096 # For the windows installer, please see pygtk/SConscript
2097
2098 if with_installer:
2099 pass
2100 else:
2101 print "Skipping... Windows installer isn't being built:",without_installer_reason
2102
2103 #------------------------------------------------------
2104 # PROJECT FILE for MSVC
2105
2106 env.SConscript(['base/msvc/SConscript'],['env','libascend']);
2107
2108 #------------------------------------------------------
2109 # CREATE the SPEC file for generation of RPM packages
2110
2111 if platform.system()=="Linux":
2112 env.SubstInFile('ascend.spec.in')
2113
2114 #------------------------------------------------------
2115 # CREATE OMF FILE FOR USE WITH SCROLLKEEPER
2116
2117 if with_scrollkeeper:
2118 env.SubstInFile('#/pygtk/gnome/ascend.omf.in')
2119 env.InstallShared(env['INSTALL_ROOT']+env['OMFDIR'],"#/pygtk/gnome/ascend.omf")
2120
2121 #------------------------------------------------------
2122 # DISTRIBUTION TAR FILE
2123
2124 env['DISTTAR_FORMAT']='bz2'
2125 env.Append(
2126 DISTTAR_EXCLUDEEXTS=['.o','.os','.so','.a','.dll','.cc','.cache','.pyc','.cvsignore','.dblite','.log','.pl','.out']
2127 , DISTTAR_EXCLUDEDIRS=['CVS','.svn','.sconf_temp', 'dist']
2128 )
2129
2130 tar = env.DistTar("dist/"+env['DISTTAR_NAME']
2131 , [env.Dir('#')]
2132 )
2133
2134 env.Depends(tar,'ascend.spec')
2135
2136 Alias('dist',tar)
2137
2138 #------------------------------------------------------
2139 # USER'S MANUAL
2140
2141 env.SConscript('doc/SConscript',['env'])
2142
2143 #------------------------------------------------------
2144 # LIBASCEND DOXYGEN DOCUMENTATION
2145
2146 env.SConscript('base/doc/SConscript',['env'])
2147
2148 #------------------------------------------------------
2149 # RPM BUILD
2150
2151 # for RPM builds, 'scons dist' then 'rpmbuild -ta dist/ascend-*.tar.bz2'
2152 # (check * for the version number used to create the tarball)
2153
2154 #------------------------------------------------------
2155 # DEFAULT TARGETS
2156
2157 default_targets =['libascend']
2158 if with_tcltk:
2159 default_targets.append('tcltk')
2160 if with_python:
2161 default_targets.append('pygtk')
2162 if with_installer:
2163 default_targets.append('installer')
2164 if with_extfns:
2165 default_targets.append('extfns')
2166
2167 env.Default(default_targets)
2168
2169 print "Building targets:"," ".join([str(i) for i in BUILD_TARGETS])
2170
2171 # vim: set syntax=python:
2172

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