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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 252 - (show annotations)
Tue Nov 29 05:58:03 2005 UTC (13 years, 4 months ago) by jgs
File size: 2794 byte(s)
pass in platform specific libraries via options files now

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

  ViewVC Help
Powered by ViewVC 1.1.26