parameters: (compiler, dst_dir)
docstring: Returns the full path to the 'libear' library.
docstring_summary: Returns the full path to the 'libear' library.
docstring_tokens: Returns the full path to the libear library .
function: def build_libear(compiler, dst_dir):
      """ Returns the full path to the 'libear' library. """
  
      try:
          src_dir = os.path.dirname(os.path.realpath(__file__))
          toolset = make_toolset(src_dir)
          toolset.set_compiler(compiler)
          toolset.set_language_standard('c99')
          toolset.add_definitions(['-D_GNU_SOURCE'])
  
          configure = do_configure(toolset)
          configure.check_function_exists('execve', 'HAVE_EXECVE')
          configure.check_function_exists('execv', 'HAVE_EXECV')
          configure.check_function_exists('execvpe', 'HAVE_EXECVPE')
          configure.check_function_exists('execvp', 'HAVE_EXECVP')
          configure.check_function_exists('execvP', 'HAVE_EXECVP2')
          configure.check_function_exists('exect', 'HAVE_EXECT')
          configure.check_function_exists('execl', 'HAVE_EXECL')
          configure.check_function_exists('execlp', 'HAVE_EXECLP')
          configure.check_function_exists('execle', 'HAVE_EXECLE')
          configure.check_function_exists('posix_spawn', 'HAVE_POSIX_SPAWN')
          configure.check_function_exists('posix_spawnp', 'HAVE_POSIX_SPAWNP')
          configure.check_symbol_exists('_NSGetEnviron', 'crt_externs.h',
                                        'HAVE_NSGETENVIRON')
          configure.write_by_template(
              os.path.join(src_dir, 'config.h.in'),
              os.path.join(dst_dir, 'config.h'))
  
          target = create_shared_library('ear', toolset)
          target.add_include(dst_dir)
          target.add_sources('ear.c')
          target.link_against(toolset.dl_libraries())
          target.link_against(['pthread'])
          target.build_release(dst_dir)
  
          return os.path.join(dst_dir, target.name)
  
      except Exception:
          logging.info("Could not build interception library.", exc_info=True)
          return None
function_tokens: def build_libear ( compiler , dst_dir ) : try : src_dir = os . path . dirname ( os . path . realpath ( __file__ ) ) toolset = make_toolset ( src_dir ) toolset . set_compiler ( compiler ) toolset . set_language_standard ( 'c99' ) toolset . add_definitions ( [ '-D_GNU_SOURCE' ] ) configure = do_configure ( toolset ) configure . check_function_exists ( 'execve' , 'HAVE_EXECVE' ) configure . check_function_exists ( 'execv' , 'HAVE_EXECV' ) configure . check_function_exists ( 'execvpe' , 'HAVE_EXECVPE' ) configure . check_function_exists ( 'execvp' , 'HAVE_EXECVP' ) configure . check_function_exists ( 'execvP' , 'HAVE_EXECVP2' ) configure . check_function_exists ( 'exect' , 'HAVE_EXECT' ) configure . check_function_exists ( 'execl' , 'HAVE_EXECL' ) configure . check_function_exists ( 'execlp' , 'HAVE_EXECLP' ) configure . check_function_exists ( 'execle' , 'HAVE_EXECLE' ) configure . check_function_exists ( 'posix_spawn' , 'HAVE_POSIX_SPAWN' ) configure . check_function_exists ( 'posix_spawnp' , 'HAVE_POSIX_SPAWNP' ) configure . check_symbol_exists ( '_NSGetEnviron' , 'crt_externs.h' , 'HAVE_NSGETENVIRON' ) configure . write_by_template ( os . path . join ( src_dir , 'config.h.in' ) , os . path . join ( dst_dir , 'config.h' ) ) target = create_shared_library ( 'ear' , toolset ) target . add_include ( dst_dir ) target . add_sources ( 'ear.c' ) target . link_against ( toolset . dl_libraries ( ) ) target . link_against ( [ 'pthread' ] ) target . build_release ( dst_dir ) return os . path . join ( dst_dir , target . name ) except Exception : logging . info ( "Could not build interception library." , exc_info = True ) return None