-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
1,043 additions
and
965 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
from distutils import sysconfig | ||
import os.path | ||
import os | ||
import sys | ||
import glob | ||
from pprint import pprint | ||
from glob import glob | ||
pj = os.path.join | ||
|
||
pyver = sysconfig.get_config_var('VERSION') | ||
getvar = sysconfig.get_config_var | ||
LIB_KEYS = ('LIBDEST', 'LIBDIR', 'LIBPL') | ||
|
||
libname = "python" + pyver | ||
if sys.platform == "darwin": | ||
so_ext = "dylib" | ||
elif sys.platform.startswith("linux"): | ||
so_ext = "so" | ||
else: | ||
so_ext = "dll" | ||
|
||
for libvar in ('LIBDIR', 'LIBPL'): | ||
for ext in ('so', 'dylib', 'dll'): | ||
match = pj(getvar(libvar), "*" + libname + "*." + ext) | ||
lib = glob.glob(match) | ||
if lib: | ||
assert len(lib) == 1 | ||
sys.stdout.write(lib[0]) | ||
raise SystemExit | ||
config = sysconfig.get_config_vars() | ||
|
||
library = "*python%s*%s" % (sysconfig.get_python_version(), so_ext) | ||
for libpath in LIB_KEYS: | ||
p = pj(config[libpath], library) | ||
cand = glob(p) | ||
if cand and len(cand) == 1: | ||
sys.stdout.write(cand[0]) | ||
raise SystemExit | ||
|
||
pprint("no library found, dumping library pattern, config, and directory contents:") | ||
pprint(library) | ||
pprint(config) | ||
|
||
for libpath in LIB_KEYS: | ||
pprint(libpath) | ||
p = config[libpath] | ||
if os.path.exists(p): | ||
pprint(os.listdir(p)) | ||
|
||
raise SystemExit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import sys | ||
from distutils import sysconfig | ||
|
||
s = "using python : {version} : {prefix} : {inc} ;\n".format( | ||
version=sysconfig.get_python_version(), | ||
prefix=sysconfig.get_config_var("prefix"), | ||
inc=sysconfig.get_python_inc()) | ||
|
||
sys.stdout.write(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.