From ca97b86d1658eb4a0c236c2721c2ab0f9ae42844 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Jan 2017 11:42:10 +0530 Subject: [PATCH] A more robust derivation of the python dll --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 70206c19c..f79835d57 100755 --- a/setup.py +++ b/setup.py @@ -70,7 +70,11 @@ def init_env(debug=False, asan=False): ldflags.append('-pthread') ldflags.append('-shared') cflags.append('-I' + sysconfig.get_config_var('CONFINCLUDEPY')) - lib = sysconfig.get_config_var('LDLIBRARY')[3:-3] + lib = sysconfig.get_config_var('LDLIBRARY') + if lib.startswith('lib'): + lib = lib[3:] + if lib.endswith('.so'): + lib = lib[:-3] ldpaths = ['-L' + sysconfig.get_config_var('LIBDIR'), '-l' + lib] + \ pkg_config('glew', '--libs') + pkg_config('freetype2', '--libs') + pkg_config('glfw3', '--libs')