@@ -37,12 +37,14 @@ def get_geos_install_prefix():
37
37
candidates = [os .path .expanduser ("~/local" ), os .path .expanduser ("~" ),
38
38
"/usr/local" , "/usr" , "/opt/local" , "/opt" , "/sw" ]
39
39
40
+ # Prepare filename pattern to find the GEOS library.
41
+ extensions = {"win32" : "dll" , "cygwin" : "dll" , "darwin" : "dylib" }
42
+ libext = extensions .get (sys .platform , "so*" )
43
+ libname = "*geos_c*.{0}" .format (libext )
44
+ libdirs = ["bin" , "lib" , "lib/x86_64-linux-gnu" , "lib64" ]
45
+
40
46
for prefix in candidates :
41
47
libfiles = []
42
- libdirs = ["bin" , "lib" , "lib/x86_64-linux-gnu" , "lib64" ]
43
- libext = "dll" if os .name == "nt" else "so"
44
- libcode = "{0}geos_c" .format ("" if os .name == "nt" else "lib" )
45
- libname = "{0}*.{1}*" .format (libcode , libext )
46
48
for libdir in libdirs :
47
49
libfiles .extend (glob .glob (os .path .join (prefix , libdir , libname )))
48
50
hfile = os .path .join (prefix , "include" , "geos_c.h" )
@@ -111,7 +113,7 @@ def run(self):
111
113
# `distutils` bug (http://bugs.python.org/issue2437).
112
114
library_dirs .append (os .path .join (geos_install_prefix , "bin" ))
113
115
runtime_library_dirs = []
114
- dlls = glob .glob (os .path .join (geos_install_prefix , "*" , "geos_c.dll" ))
116
+ dlls = glob .glob (os .path .join (geos_install_prefix , "*" , "* geos_c.dll" ))
115
117
if dlls :
116
118
data_files .append (("../.." , sorted (dlls )))
117
119
0 commit comments