]> git.saurik.com Git - wxWidgets.git/blobdiff - build/tools/build-wxwidgets.py
Minor fixes to wxDateTime documentation.
[wxWidgets.git] / build / tools / build-wxwidgets.py
index a3d370d20a9ee0a2966f02bc20ecf84b8ceede79..a0866e4b2cc02f4547cb546c64a5be4c7ad13caa 100755 (executable)
@@ -55,6 +55,12 @@ def numCPUs():
     return 1 # Default
 
 
+def getXcodePath():
+    p = subprocess.Popen("xcode-select -print-path", shell=True, stdout=subprocess.PIPE)
+    output = p.stdout.read()
+    return output.strip()
+
+
 def exitIfError(code, msg):
     if code != 0:
         print msg
@@ -260,13 +266,21 @@ def main(scriptName, args):
         # developer.  TODO: there should be a command line option to set
         # the SDK...
         if sys.platform.startswith("darwin"):
+            xcodePath = getXcodePath()
+            sdks = [
+                xcodePath+"/SDKs/MacOSX10.5.sdk",
+                xcodePath+"/SDKs/MacOSX10.6.sdk",
+                xcodePath+"/SDKs/MacOSX10.7.sdk",
+            ]
             if not options.osx_cocoa:
-                wxpy_configure_opts.append(
-                    "--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk")
-            else:
-                wxpy_configure_opts.append(
-                    "--with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk")
-
+                sdks.insert(0, xcodePath+"/SDKs/MacOSX10.4u.sdk")
+            
+            # use the lowest available sdk
+            for sdk in sdks:
+                if os.path.exists(sdk):
+                    wxpy_configure_opts.append(
+                        "--with-macosx-sdk=%s" % sdk)
+                    break
 
         if not options.mac_framework:
             if installDir and not prefixDir:
@@ -585,7 +599,7 @@ def main(scriptName, args):
         os.makedirs(packagedir)
         basename = os.path.basename(prefixDir.split(".")[0])
         packageName = basename + "-" + getWxRelease()
-        packageMakerPath = "/Developer/usr/bin/packagemaker "
+        packageMakerPath = getXcodePath()+"/usr/bin/packagemaker "
         args = []
         args.append("--root %s" % options.installdir)
         args.append("--id org.wxwidgets.%s" % basename.lower())