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

Contents of /trunk/escript/test/DataC/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 246 - (show annotations)
Tue Nov 29 04:27:00 2005 UTC (13 years, 8 months ago) by jgs
File size: 2695 byte(s)
allow compile options to be loaded from a config
file specified on the command line to scons

1 # Scons configuration file for DataC unit tests
2
3 import os
4 import sys
5
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 usegcc = 0
17 options = None
18
19 #
20 # retreive command-line arguments if any
21
22 if ARGUMENTS.get('usegcc',0):
23 usegcc = 1
24
25 if ARGUMENTS.get('options',0):
26 options = ARGUMENTS.get('options',0)
27
28 #
29 # determine platform
30
31 env = Environment(ENV = os.environ)
32 platform = env['PLATFORM']
33
34 #
35 # determine hostname
36
37 hostname = os.environ['HOSTNAME']
38
39 #
40 # load configuration settings
41
42 options_dir = str(esysroot) + '/scons'
43 sys.path.append(options_dir)
44
45 if hostname=='ess':
46 from ess_options import *
47
48 if usegcc==1:
49 from gcc_options import *
50
51 if options!=None:
52 exec "from " + options + " import *"
53
54 cc_flags=cc_flags_debug
55 cxx_flags=cxx_flags_debug
56
57 #
58 # print out build configuration for this module
59
60 print "####################################################"
61 print "Build configuration for module: DataC unit tests"
62 print " dodebug: 1"
63 print " usegcc: ", usegcc
64 print " cc: ", cc
65 print " cxx: ", cxx
66 print " platform: ", platform
67 print " hostname: ", hostname
68 print "####################################################"
69
70 #
71 # do the actual build
72
73 datac_test_path = str(esysroot) + '/escript/test/DataC'
74 escript_path = str(esysroot) + '/escript/inc'
75 esysUtils_path = str(esysroot) + '/esysUtils/inc'
76 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
77
78 esys_lib_path = str(esysroot) + '/lib'
79 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
80 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
81
82 cpp_path = [datac_test_path,
83 escript_path,
84 esysUtils_path,
85 CppUnitTest_path,
86 python_path,
87 boost_path]
88
89 lib_path = [esys_lib_path,
90 esysUtils_lib_path,
91 CppUnitTest_lib_path,
92 python_lib_path,
93 boost_lib_path]
94
95 libs = ['escriptcpp',
96 'esysUtils',
97 'CppUnitTest',
98 str(python_lib),
99 str(boost_lib),
100 'dl',
101 'util',
102 'guide',
103 'irc']
104
105 sources = ['DataCTestCase.cpp',
106 'DataCTest.cpp',
107 'compareCCall.c',
108 'CompareFuncs.c']
109
110 target = 'DataCTest.exe'
111
112 datac_env = Environment(ENV = os.environ)
113
114 datac_env.Replace(CXX = cxx)
115 datac_env.Replace(CC = cc)
116 datac_env.Replace(CXXFLAGS = cxx_flags)
117 datac_env.Replace(CCFLAGS = cc_flags)
118 datac_env.Replace(CPPPATH = cpp_path)
119 datac_env.Replace(LIBPATH = lib_path)
120 datac_env.Replace(LIBS = libs)
121
122 datac_test_exe = datac_env.Program(target, sources)

  ViewVC Help
Powered by ViewVC 1.1.26