aboutsummaryrefslogtreecommitdiff
Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
looking for headers and libraries.

--- Python-2.7.10/setup.py	2015-10-07 18:33:18.125153186 +0200
+++ Python-2.7.10/setup.py	2015-10-07 18:33:47.497347552 +0200
@@ -526,6 +526,14 @@ class PyBuildExt(build_ext):
             inc_dirs += ['/system/include', '/atheos/autolnk/include']
             inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
 
+        # Always honor these variables.
+        if not cross_compiling:
+            lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
+            inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+        else:
+            lib_dirs = os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep)
+            inc_dirs = os.getenv('CROSS_CPATH', '').split(os.pathsep)
+
         # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
         if host_platform in ['osf1', 'unixware7', 'openunix8']:
             lib_dirs += ['/usr/ccs/lib']