Changeset 3545
- Timestamp:
- Sep 7, 2006, 2:52:51 PM (18 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
SConstruct
r3544 r3545 30 30 return None 31 31 32 # Create the builders 33 pyc_builder = Builder(action = build_pyc, 34 suffix = '.pyc', 35 src_suffix = '.py') 36 pyo_builder = Builder(action = build_pyo, 37 suffix = '.pyo', 38 src_suffix = '.py') 39 32 40 # Read in build options 33 41 opts = Options('build_options.py') … … 37 45 opts.Add('OPTIMISATION_LEVEL', 'Optimisation level for the building of .pyo files. Must be 1 or 2') 38 46 39 # Create the .pyc builder 40 pyc_builder = Builder(action = build_pyc, 41 suffix = '.pyc', 42 src_suffix = '.py') 43 # Create the .pyo builder 44 pyo_builder = Builder(action = build_pyo, 45 suffix = '.pyo', 46 src_suffix = '.py') 47 # Windows' site packages are in a different location to those on Linux 48 if sys.platform == 'win32': 49 opts.Add(PathOption('PREFIX', 50 'Location to install compiled sources', 51 os.path.join(sys.exec_prefix, 'lib', 'site-packages'))) 52 else: 53 opts.Add(PathOption('PREFIX', 54 'Location to install compiled sources'. 55 os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3], 'site-packages'))) 56 57 opts.Add(BoolOption('INSTALL_PYTHON_SOURCE', 58 'Install the .py files as well as the .pyc/.pyo files', 59 0)) 47 60 48 61 env = Environment(options = opts) … … 55 68 raise ValueError, "OPTIMISATION_LEVEL must be between 1 and 2 inclusive" 56 69 57 # Find the path for Python.h and then share it to other SConscripts later on58 70 # Where to find the Python.h 59 71 if sys.platform == 'win32': … … 69 81 env.Append(LIBS=[python_libname]) 70 82 else: 71 python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'), 72 'python' + sys.version[:3]) 83 python_include = os.path.join(sys.exec_prefix, 'include', 'python' + sys.version[:3]) 73 84 74 85 # Check existence of Python.h … … 98 109 dirs = ['anuga_core'] 99 110 while(dirs != []): 100 dirs += filter(os.path.isdir, map(lambda x : dirs[0] + os.sep + x, os.listdir(dirs[0])))101 files += filter(lambda x : x[-3:] == '.py', map(lambda x : dirs[0] + os.sep + x, os.listdir(dirs[0])))111 dirs += filter(os.path.isdir, map(lambda x : os.path.join(dirs[0], x), os.listdir(dirs[0]))) 112 files += filter(lambda x : x[-3:] == '.py', map(lambda x : os.path.join(dirs[0], x), os.listdir(dirs[0]))) 102 113 dirs = dirs[1:] 103 114 for x in files: 104 115 env.Pyc(x + 'c', x) 105 116 env.Pyo(x + 'o', x) 117 instdir = os.path.join(env['PREFIX'], os.path.split(x)[0]) 118 env.Install(instdir, x + 'c') 119 env.Install(instdir, x + 'o') 120 if env['INSTALL_PYTHON_SOURCE']: 121 env.Install(instdir, x) 106 122 123 env.Alias('install', '${PREFIX}') 124 107 125 SConscript(['anuga_core/source/anuga/SConscript']) -
anuga_core/source/anuga/mesh_engine/SConscript
r3327 r3545 5 5 env2.SharedLibrary('triang', ['triangle.c', 'triang.c']) 6 6 env2.SharedLibrary('triangle', ['triangle.c']) 7 8 9 -
build_options.py
r3544 r3545 12 12 # Optimisation level used when building the .pyo files 13 13 OPTIMISATION_LEVEL = 1 14 15 # Where to install the compiled files. Defaults vary based on OS. 16 # Uncommenting this and leaving it as the empty string will cause the 17 # build to fail. 18 PREFIX = 'c:\\pyanuga_temp' 19 20 # Install .py files as well as the binaries? Yes/No option 21 INSTALL_PYTHON_SOURCE = 'Yes'
Note: See TracChangeset
for help on using the changeset viewer.