/[ascend]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 391 - (show annotations) (download)
Thu Mar 30 07:19:05 2006 UTC (14 years, 2 months ago) by johnpye
File size: 2928 byte(s)
A little bit of progress on getting the windows build to work
1 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 opts.Add(EnumOption(
18 'PACKAGE_LINKING'
19 , 'Style of linking for external libraries'
20 , 'DYNAMIC_PACKAGES'
21 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
22 ))
23
24 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 opts.Add(BoolOption(
31 'WITHOUT_PYTHON'
32 ,"Set to True if you don't want to build Python wrappers."
33 , False
34 ))
35
36 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 with_tcltk_gui = (env['WITHOUT_TCLTK_GUI']==False)
44
45 with_python = (env['WITHOUT_PYTHON']==False)
46
47 #------------------------------------------------------
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 # Tcl/Tk
70 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 if platform.system()=="Windows":
83 conf.env.Append(LIBPATH='c:\Python24\libs')
84 conf.env.Append(CPPPATH='c:\Python24\include')
85 python_header='Python.h'
86 python_lib='python24'
87 python_libpath='c:\\Python24\\libs'
88 else:
89 python_header='python2.4/Python.h'
90 python_lib='python2.4'
91 python_libpath='/usr/include/python2.4'
92
93 # Python
94 if not conf.CheckLibWithHeader(python_lib,python_header,'C'):
95 print "Didn't find Python 2.4 ("+python_lib+")"
96 with_python = False
97 else:
98 env.Append(PYTHON_LIBPATH=[python_libpath])
99 env.Append(PYTHON_LIB=python_lib)
100
101 # TODO: -D_HPUX_SOURCE is needed
102
103 # TODO: check size of void*
104
105 #------------------------------------------------------
106 # SUBDIRECTORIES....
107
108 env.Append(CPPPATH=['..'])
109
110 env.SConscript(['base/generic/general/SConscript'],'env')
111
112 env.SConscript(['base/generic/utilities/SConscript'],'env')
113
114 env.SConscript(['base/generic/compiler/SConscript'],'env')
115
116 env.SConscript(['base/generic/solver/SConscript'],'env')
117
118 env.SConscript(['base/generic/packages/SConscript'],'env')
119
120 if with_tcltk_gui:
121 env.SConscript(['tcltk98/generic/interface/SConscript'],'env')
122 else:
123 print "Skipping... Tcl/Tk GUI isn't being built"
124
125 if with_python:
126 env.SConscript(['pygtk/interface/SConscript'],'env')
127 else:
128 print "Skipping... Python GUI isn't being built"
129

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