Exemplo n.º 1
0
def get_library_extension():
   if system.os() == 'windows':
      return ".dll"
   elif system.os() == 'linux':
      return ".so"
   elif system.os() == 'darwin':
      return ".dylib"
   else:
      return ""
Exemplo n.º 2
0
def reset_library_path(env):
   if env.has_key('PREVIOUS_LIBRARY_PATH'):
      if system.os() == 'windows':
         var_name = 'PATH'
      elif system.os() == 'darwin':
         var_name = 'DYLD_LIBRARY_PATH'
      else:
         var_name = 'LD_LIBRARY_PATH'
      os.environ[var_name] = env['PREVIOUS_LIBRARY_PATH']
Exemplo n.º 3
0
def set_library_path(env):
   if system.os() == 'windows':
      var_name = 'PATH'
   elif system.os() == 'darwin':
      var_name = 'DYLD_LIBRARY_PATH'
   else:
      var_name = 'LD_LIBRARY_PATH'

   env['PREVIOUS_LIBRARY_PATH'] = ''
   if os.environ.has_key(var_name):
      env['PREVIOUS_LIBRARY_PATH'] = os.environ[var_name]
   os.environ[var_name] = env['ENV'][var_name]
Exemplo n.º 4
0
def add_to_library_path(env, new_path):
   if system.os() == 'windows':
      var_name = 'PATH'
   elif system.os() == 'darwin':
      var_name = 'DYLD_LIBRARY_PATH'
   else:
      var_name = 'LD_LIBRARY_PATH'
      
   if env['ENV'].has_key(var_name):
      env['ENV'][var_name] = '%s%s%s' % (new_path, os.pathsep, env['ENV'][var_name])
   else:
      env['ENV'][var_name] = new_path
Exemplo n.º 5
0
def process_return_code(retcode):
   if retcode == 0:
      status = 'OK'
   else:
      if system.os() == 'windows':
         if retcode < 0:
            status = 'CRASHED'
         else:
            status = 'FAILED'
      else:
         if retcode > 128:
            status = 'CRASHED'
         else:
            status = 'FAILED'
   return status      
Exemplo n.º 6
0
def get_executable_extension():
   if system.os() == 'windows':
      return ".exe"
   else:
      return ""         
Exemplo n.º 7
0
def get_escaped_path(path):
   if system.os() == 'windows':
      return path.replace("\\", "\\\\")
   else:
      return path