[jhbuild/wip/path-env: 6/6] config: set LDFLAGS, C include path for /usr/local



commit 48fbcd2efb54bb23b592239480c6466f7f3425d7
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Mar 10 02:17:10 2014 -0400

    config: set LDFLAGS, C include path for /usr/local
    
    If we detect a configuration that has /usr/local/lib in the library
    path, set the LDFLAGS and C{,PLUS}_INCLUDE_PATH environment variables to
    include /usr/local/lib and /usr/local/include.
    
    This is pretty ugly.  Maybe we should have a separate variable to
    control this?

 jhbuild/config.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/config.py b/jhbuild/config.py
index b5e357e..4be3748 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -438,6 +438,10 @@ class Config:
         # scripts to find modules that do not use pkg-config (such as guile
         # looking for gmp, or wireless-tools for NetworkManager)
         # (see bug #377724 and bug #545018)
+        if '/usr/local/lib' in self.system_libdirs:
+            os.environ['LDFLAGS'] = '-L/usr/local/lib ' + os.environ.get('LDFLAGS', '')
+            addpath('C_INCLUDE_PATH', '/usr/local/include')
+            addpath('CPLUS_INCLUDE_PATH', '/usr/local/include')
 
         # This path doesn't always get passed to addpath so we fix it here
         if sys.platform.startswith('win'):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]