/[escript]/trunk/escript/SConstruct
ViewVC logotype

Annotation of /trunk/escript/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 325 - (hide annotations)
Wed Dec 7 02:08:17 2005 UTC (13 years, 9 months ago) by jgs
File size: 3803 byte(s)
now determine hostname via socket.gethostname() as HOSTNAME
environment variable is apparently not set on all platforms

1 jgs 214 # Scons configuration file for escript
2    
3     import os
4 jgs 217 import sys
5 jgs 214
6     #
7     # ensure correct versions of python and scons
8    
9     EnsurePythonVersion(2,3)
10     EnsureSConsVersion(0,96)
11    
12     #
13     # set appropriate defaults for configuration variables
14    
15     esysroot = Dir('#..')
16 jgs 192 libinstall = None
17 jgs 268 pyinstall = None
18 jgs 214 dodebug = 0
19     usegcc = 0
20 jgs 246 options = None
21 jgs 190
22 jgs 214 #
23     # import configuration variables passed in from
24     # calling SConscript (if any)
25    
26 jgs 190 Import('*')
27    
28 jgs 214 #
29     # retreive command-line arguments if any
30 jgs 190
31 jgs 214 if ARGUMENTS.get('libinstall',0):
32     libinstall = ARGUMENTS.get('libinstall',0)
33 jgs 192 Export(["libinstall"])
34    
35 jgs 268 if ARGUMENTS.get('pyinstall',0):
36     pyinstall = ARGUMENTS.get('pyinstall',0)
37     Export(["pyinstall"])
38    
39 jgs 214 if ARGUMENTS.get('debug',0):
40     dodebug = 1
41    
42     if ARGUMENTS.get('usegcc',0):
43     usegcc = 1
44    
45 jgs 246 if ARGUMENTS.get('options',0):
46     options = ARGUMENTS.get('options',0)
47    
48 jgs 214 #
49     # determine platform
50    
51     env = Environment(ENV = os.environ)
52     platform = env['PLATFORM']
53    
54     #
55     # determine hostname
56    
57 jgs 325 import socket
58     hostname = socket.gethostname()
59 jgs 214
60     #
61     # export esysroot
62    
63     Export(["esysroot"])
64    
65     #
66 jgs 309 # set and export library directories
67 jgs 214
68 jgs 190 libdir = Dir(str(esysroot) + '/escript/lib')
69 jgs 181 Export(["libdir"])
70 jgs 288 libdir2 = Dir(str(esysroot) + '/lib')
71     Export(["libdir2"])
72 jgs 181
73 jgs 214 #
74 jgs 309 # set and export python directories
75 jgs 268
76     pydir = Dir(str(esysroot) + '/escript/lib/py_src')
77     Export(["pydir"])
78 jgs 288 pydir2 = Dir(str(esysroot) + '/esys/escript')
79     Export(["pydir2"])
80 jgs 268
81     #
82 jgs 214 # load and export configuration settings
83    
84 jgs 216 options_dir = str(esysroot) + '/scons'
85     sys.path.append(options_dir)
86 jgs 191
87 jgs 309 from default_options import *
88    
89 jgs 224 if hostname=='ess':
90 jgs 216 from ess_options import *
91 jgs 214
92 jgs 241 if usegcc==1:
93     from gcc_options import *
94    
95 jgs 246 if options!=None:
96     exec "from " + options + " import *"
97    
98 jgs 224 if dodebug==1:
99     cxx_flags=cxx_flags_debug
100    
101 jgs 191 Export(["python_path"])
102     Export(["boost_path"])
103 jgs 223 Export(["cxx"])
104 jgs 214 Export(["cxx_flags"])
105 jgs 277 Export(["boost_lib_path"])
106     Export(["boost_lib"])
107     Export(["sys_libs"])
108 jgs 191
109 jgs 214 #
110     # print out build configuration for this module
111 jgs 191
112 jgs 214 print "Build configuration for module: escript"
113     print " dodebug: ", dodebug
114     print " usegcc: ", usegcc
115 jgs 223 print " cxx: ", cxx
116 jgs 214 print " platform: ", platform
117     print " hostname: ", hostname
118     print " libinstall: ", libinstall
119 jgs 268 print " pyinstall: ", pyinstall
120 jgs 191
121 jgs 214 #
122     # call the SConscript to do the actual build
123    
124 jgs 268 SConscript(dirs=['src/Data'], build_dir='obj/Data', duplicate=0)
125     SConscript(dirs=['py_src'], build_dir='obj/py_src', duplicate=0)
126 jgs 288 SConscript(dirs=['test/Data'], build_dir='obj/test/Data', duplicate=0)
127     SConscript(dirs=['test/DataAlgorithmAdapter'], build_dir='obj/test/DataAlgorithmAdapter', duplicate=0)
128     SConscript(dirs=['test/DataArray'], build_dir='obj/test/DataArray', duplicate=0)
129     SConscript(dirs=['test/DataArrayView'], build_dir='obj/test/DataArrayView', duplicate=0)
130     SConscript(dirs=['test/DataBlocks2D'], build_dir='obj/test/DataBlocks2D', duplicate=0)
131     SConscript(dirs=['test/DataC'], build_dir='obj/test/DataC', duplicate=0)
132     SConscript(dirs=['test/DataCached'], build_dir='obj/test/DataCached', duplicate=0)
133     SConscript(dirs=['test/DataConstant'], build_dir='obj/test/DataConstant', duplicate=0)
134     SConscript(dirs=['test/DataEmpty'], build_dir='obj/test/DataEmpty', duplicate=0)
135     SConscript(dirs=['test/DataExpanded'], build_dir='obj/test/DataExpanded', duplicate=0)
136     SConscript(dirs=['test/DataFactory'], build_dir='obj/test/DataFactory', duplicate=0)
137     SConscript(dirs=['test/DataProf'], build_dir='obj/test/DataProf', duplicate=0)
138     SConscript(dirs=['test/DataTagged'], build_dir='obj/test/DataTagged', duplicate=0)
139     SConscript(dirs=['test/DataVariable'], build_dir='obj/test/DataVariable', duplicate=0)
140     SConscript(dirs=['test/DataVector'], build_dir='obj/test/DataVector', duplicate=0)
141     SConscript(dirs=['test/FunctionSpace'], build_dir='obj/test/FunctionSpace', duplicate=0)
142     SConscript(dirs=['test/Taipan'], build_dir='obj/test/Taipan', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26