/[escript]/trunk/escript/src/SConscript
ViewVC logotype

Diff of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/escript/src/Data/SConscript revision 392 by gross, Tue Dec 20 05:39:30 2005 UTC trunk/escript/src/SConscript revision 682 by robwdcock, Mon Mar 27 02:43:09 2006 UTC
# Line 1  Line 1 
 libinstall = None  
   
1  Import('*')  Import('*')
2    
3    local_env=env.Copy()
4    py_wrapper_local_env=env.Copy()
5    # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
6    del py_wrapper_local_env['SHLIBPREFIX']
7    
8    lib_name = 'escript'
9    py_wrapper_name = lib_name+'cpp'
10    py_wrapper_source = py_wrapper_name+'.cpp'
11    py_wrapper_lib_name = py_wrapper_name
12    
13    src_dir = local_env.Dir('.').srcnode().abspath
14    
15  import os  import os
16  import string  filenames = os.listdir(src_dir)
17    sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
18    headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
19    # Filter out sources that should not be in the list automatically
20    sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
21    
22    
23    local_env.Append(LIBS = [boost_lib, 'esysUtils', sys_libs ])
24    py_wrapper_local_env.Append(LIBS = [boost_lib, lib_name, 'esysUtils', sys_libs ])
25    
26    lib = local_env.SharedLibrary(lib_name, sources)
27    py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
28    
29    include_path = Dir(lib_name, incinstall)
30    
31  libname = 'escriptcpp'  local_env.Install(include_path, headers )
32    local_env.Install(libinstall, lib)
33    py_wrapper_local_env.Install(pyinstall+'/escript', py_wrapper_lib)
34    
35  escript_path = str(esysroot) + '/escript/inc'  # export the lib target since tests will depend on it
36  esysUtils_path = str(esysroot) + '/esysUtils/inc'  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
37    # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
38    dep_lib = [libinstall+'/'+str(x) for x in lib]
39    Export('dep_lib')
40    
41  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  # Call the python sconscript
42    env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
43    
44  esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'  # Call the unit tests SConscript
45    local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
 cpp_path = [escript_path,  
             esysUtils_path,  
             python_path,  
             boost_path]  
   
 sources = ['AbstractContinuousDomain.cpp',  
            'AbstractDomain.cpp',  
            'AbstractSystemMatrix.cpp',  
            'DataAbstract.cpp',  
            'DataArray.cpp',  
            'DataArrayView.cpp',  
            'DataBlocks2D.cpp',  
            'DataCached.cpp',  
            'DataC.cpp',  
            'DataConstant.cpp',  
            'Data.cpp',  
            'DataEmpty.cpp',  
            'DataExpanded.cpp',  
            'DataFactory.cpp',  
            'DataProf.cpp',  
            'DataTagged.cpp',  
            'DataVariable.cpp',  
            'DataVector.cpp',  
            'FunctionSpace.cpp',  
            'FunctionSpaceFactory.cpp',  
            'NullDomain.cpp',  
            'Taipan.cpp',  
            'Utils.cpp',  
            'escriptcpp.cpp']  
   
 lib_path = [esysUtils_lib_path,  
             boost_lib_path]  
   
 libs = ['esysUtils',  
         str(boost_lib)]  
   
 libs.extend(sys_libs)  
   
 escript_env = Environment(ENV = os.environ)  
   
 escript_env.Replace(CXX = cxx)  
 escript_env.Replace(SHOBJSUFFIX = '.lo')  
 escript_env.Replace(CXXFLAGS = cxx_flags)  
 escript_env.Replace(CPPPATH = cpp_path)  
 escript_env.Replace(LIBPATH = lib_path)  
 escript_env.Replace(LIBS = libs)  
   
 escript_lib = escript_env.SharedLibrary(libname, sources)  
   
 Depends(escript_lib, esysUtils_lib)  
   
 Default(escript_env.Install(libdir, escript_lib))  
 Default(escript_env.Install(libdir2, escript_lib))  
 if libinstall != None:  
   Default(escript_env.Install(libinstall, escript_lib))  

Legend:
Removed from v.392  
changed lines
  Added in v.682

  ViewVC Help
Powered by ViewVC 1.1.26