1 #===- common.py - Python LLVM Bindings -----------------------*- python -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 from ctypes import POINTER
11 from ctypes import c_void_p
12 from ctypes import cdll
22 LLVMObject = POINTER(c_void_p)
25 # FIXME should probably have build system define absolute path of shared
26 # library at install time.
27 for lib in ['LLVM-3.1svn', 'LLVM']:
28 result = ctypes.util.find_library(lib)
32 # FIXME This is a local hack to ease development.
33 return "/usr/local/llvm/lib/libLLVM-3.1svn.so"
36 """Obtain a reference to the llvm library."""
39 raise Exception('LLVM shared library not found!')
41 return cdll.LoadLibrary(lib)