/[escript]/branches/postrelease-csirofixes/site_scons/site_init.py
ViewVC logotype

Diff of /branches/postrelease-csirofixes/site_scons/site_init.py

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

revision 3580 by gross, Tue Sep 6 00:31:35 2011 UTC revision 4154 by jfenwick, Tue Jan 22 09:30:23 2013 UTC
# Line 1  Line 1 
1    
2  ########################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2010 by University of Queensland  # Copyright (c) 2003-2013 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # http://www.uq.edu.au
 # http://www.uq.edu.au/esscc  
6  #  #
7  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
8  # Licensed under the Open Software License version 3.0  # Licensed under the Open Software License version 3.0
9  # http://www.opensource.org/licenses/osl-3.0.php  # http://www.opensource.org/licenses/osl-3.0.php
10  #  #
11  ########################################################  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    # Development since 2012 by School of Earth Sciences
13    #
14    ##############################################################################
15    
16  __copyright__="""Copyright (c) 2003-2010 by University of Queensland  __copyright__="""Copyright (c) 2003-2013 by University of Queensland
17  Earth Systems Science Computational Center (ESSCC)  http://www.uq.edu.au
 http://www.uq.edu.au/esscc  
18  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
19  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
20  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
21  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
22    
23  import sys, os, time, glob, fnmatch, types, py_compile, re  import sys, os, time, py_compile, re, subprocess
24    
25  def findLibWithHeader(env, libs, header, paths, lang='c'):  def findLibWithHeader(env, libs, header, paths, lang='c'):
26      from SCons.Script.SConscript import Configure      from SCons.Script.SConscript import Configure
# Line 69  def findLibWithHeader(env, libs, header, Line 70  def findLibWithHeader(env, libs, header,
70      conf.Finish()      conf.Finish()
71      return inc_path, lib_path      return inc_path, lib_path
72    
73    def detectModule(env, module):
74        if env['pythoncmd']=='python':
75            try:
76                __import__(module)
77            except ImportError:
78                return False
79        else:
80            p=subprocess.call([env['pythoncmd'],'-c','import %s'%module])
81            if p!=0:
82                return False
83        return True
84    
85  # Code to build .pyc from .py  # Code to build .pyc from .py
86  def build_py(target, source, env):  def build_py(target, source, env):
87      try:      try:
88         py_compile.compile(str(source[0]), str(target[0]), doraise=True)         py_compile.compile(str(source[0]), str(target[0]), doraise=True)
89         return 0         return 0
90      except py_compile.PyCompileError as e:      except py_compile.PyCompileError, e:
91         print e         print e
92         return 1         return 1
93                

Legend:
Removed from v.3580  
changed lines
  Added in v.4154

  ViewVC Help
Powered by ViewVC 1.1.26