/[ascend]/trunk/SConstruct
ViewVC logotype

Annotation of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 388 - (hide annotations) (download)
Thu Mar 30 05:52:06 2006 UTC (14 years, 7 months ago) by johnpye
File size: 2489 byte(s)
Successful build of the PyGTK interface with SCons on Linux (FC4)
1 johnpye 385 import os, commands, platform
2    
3     #------------------------------------------------------
4     # OPTIONS
5    
6     env = Environment(ENV=os.environ)
7     opts = Options(['options.cache', 'config.py'])
8     print "PLATFORM = ",platform.system()
9    
10     # TODO: add install options
11    
12     # TODO: OTHER OPTIONS?
13    
14     # TODO: flags for optimisation
15    
16     # Package linking option
17 johnpye 386 opts.Add(EnumOption(
18     'PACKAGE_LINKING'
19 johnpye 385 , 'Style of linking for external libraries'
20     , 'DYNAMIC_PACKAGES'
21 johnpye 386 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
22     ))
23 johnpye 385
24 johnpye 386 opts.Add(BoolOption(
25     'WITHOUT_TCLTK_GUI'
26     ,"Set to True if you don't want to build the original Tcl/Tk GUI."
27     , False
28     ))
29    
30 johnpye 387 opts.Add(BoolOption(
31     'WITHOUT_PYTHON'
32     ,"Set to True if you don't want to build Python wrappers."
33     , False
34     ))
35    
36 johnpye 385 opts.Update(env)
37     opts.Save('options.cache',env)
38    
39     Help(opts.GenerateHelpText(env))
40    
41     env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
42    
43 johnpye 386 with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)
44    
45 johnpye 387 with_python = (env['WITHOUT_PYTHON']==False)
46    
47 johnpye 385 #------------------------------------------------------
48     # CONFIGURATION
49    
50     conf = Configure(env
51     , custom_tests = {
52     # 'CheckIsNan' : CheckIsNan
53     # ,'CheckCppUnitConfig' : CheckCppUnitConfig
54     }
55     , config_h = "config.h"
56     )
57    
58     # Math library
59     if not conf.CheckLibWithHeader(['m','c','libc'], 'math.h', 'C'):
60     print 'Did not find libm.a or m.lib, exiting!'
61     Exit(1)
62    
63     # Where is 'isnan'?
64    
65     if not conf.CheckFunc('isnan'):
66     print "Didn't find isnan"
67     Exit(1)
68    
69 johnpye 387 # Tcl/Tk
70 johnpye 386 if not conf.CheckHeader('tcl.h'):
71     with_tcltk_gui = False
72    
73     if not conf.CheckHeader('tk.h'):
74     with_tcltk_gui = False
75    
76     if not conf.CheckLib('tcl'):
77     with_tcltk_gui = False
78    
79     if not conf.CheckLib('tk'):
80     with_tcktk_gui = False
81    
82 johnpye 387 # Python
83 johnpye 388 if not conf.CheckLibWithHeader('python2.4','python2.4/Python.h','C'):
84 johnpye 387 print "Didn't find Python 2.4"
85     with_python = False
86     else:
87     env.Append(CPPPATH=['/usr/include/python2.4'])
88 johnpye 388 env.Append(PYTHONLIB='python2.4')
89 johnpye 387
90 johnpye 385 # TODO: -D_HPUX_SOURCE is needed
91    
92     # TODO: check size of void*
93    
94     #------------------------------------------------------
95     # SUBDIRECTORIES....
96    
97     env.Append(CPPPATH=['..'])
98    
99     env.SConscript(['base/generic/general/SConscript'],'env')
100    
101     env.SConscript(['base/generic/utilities/SConscript'],'env')
102    
103     env.SConscript(['base/generic/compiler/SConscript'],'env')
104    
105     env.SConscript(['base/generic/solver/SConscript'],'env')
106    
107     env.SConscript(['base/generic/packages/SConscript'],'env')
108 johnpye 386
109     if with_tcltk_gui:
110     env.SConscript(['tcltk98/generic/interface/SConscript'],'env')
111    
112 johnpye 387 if with_python:
113     env.SConscript(['pygtk/interface/SConscript'],'env')

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