issue 329: setup.py: better support for C_INCLUDE_PATH, LD_RUN_PATH, etc.

Fix to support colon separated path list, and also support INCLUDE and LIB
environment variable used by MSVC.
This commit is contained in:
nu774 2013-09-27 20:19:04 +09:00
parent 6d8c6f582a
commit 2b8225615b

View File

@ -203,10 +203,15 @@ class pil_build_ext(build_ext):
# FIXME: check /opt/stuff directories here? # FIXME: check /opt/stuff directories here?
# include, rpath, if set as environment variables: # include, rpath, if set as environment variables:
if os.environ.get('C_INCLUDE_PATH'): for k in 'C_INCLUDE_PATH INCLUDE'.split():
_add_directory(include_dirs, os.environ.get('C_INCLUDE_PATH')) if k in os.environ:
if os.environ.get('LD_RUN_PATH'): for d in os.environ[k].split(os.path.pathsep):
_add_directory(library_dirs, os.environ.get('LD_RUN_PATH')) _add_directory(include_dirs, d)
for k in 'LD_RUN_PATH LIBRARY_PATH LIB'.split():
if k in os.environ:
for d in os.environ[k].split(os.path.pathsep):
_add_directory(library_dirs, d)
prefix = sysconfig.get_config_var("prefix") prefix = sysconfig.get_config_var("prefix")
if prefix: if prefix: