This commit is contained in:
Vitor Santos Costa
2017-12-11 03:36:21 +00:00
parent 9a5681b2cb
commit d348e8c563
5 changed files with 64 additions and 38 deletions

View File

@@ -6,20 +6,26 @@ import os.path
import platform
import sys
# global yap_lib_path
#yap_lib_path = os.path.dirname(__file__)
global yap_lib_path
yap_lib_path = os.path.dirname(__file__)
# if platform.system() == 'Windows':
# def load( dll ):
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
# dll = os.path.abspath(dll)
# ctypes.WinDLL(dll)
# else:
# def load( l0 ):
# for i in ["@libdir@",""]:
# dll = os.path.concat(i,l0)
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
# dll = os.path.abspath(dll)
# ctypes.CDLL(dll)
# # load('libYap*')
# # load('libPy4YAP*')
if platform.system() == 'Windows':
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.WinDLL(dll)
elseif platform.system() == 'Apple':
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.CDLL(dll)
load('libYap.dylib')
load('libPy4YAP.dylib')
else:
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.CDLL(dll)
load('libYap.so')
load('libPy4YAP.so')