[gtk-osx] Support multiple SDK directories



commit 9aa62927d5ead3978930282b1a25f80c4fdeb53b
Author: John Ralls <jralls ceridwen us>
Date:   Tue Dec 31 16:51:16 2013 -0800

    Support multiple SDK directories
    
    Via the SDKPATH, which is like every other PATH variable.
    Also raises an EnvironmentError if it can’t find the designated
    SDK.

 jhbuildrc-gtk-osx |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index ee1ad50..b749f25 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -181,6 +181,18 @@ def get_sdkdir(sdk_name, xcodepath, xcodeversion):
         sdkdir = os.path.join(xcodepath, "SDKs", sdk_name)
     else:
         sdkdir = os.path.join("/Developer", "SDKs", sdk_name)
+
+    if not os.path.exists(sdkdir):
+        sdkdir = ''
+        if 'SDKPATH' in os.environ:
+            try:
+                sdkdir = [os.path.join(path, sdk_name) for path
+                          in os.environ['SDKPATH'].split(':')
+                          if os.path.exists(os.path.join(path, sdk_name))][0]
+            except IndexError:
+                pass
+        if not sdkdir:
+            raise EnvironmentError("%s not found" % sdk_name)
     return sdkdir
 
 #We call osx_ver() here so that we can set up _default_arch for setup_sdk:


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