From 24ceae4fbf8f1373a16c1e59edcdccc980c29a4b Mon Sep 17 00:00:00 2001 From: Brian Granger Date: Mon, 31 Dec 2007 11:53:07 -0800 Subject: [PATCH] MACOSX_DEPLOYMENT_TARGET fix for OS X 10.5 --- Cython/Mac/DarwinSystem.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Cython/Mac/DarwinSystem.py b/Cython/Mac/DarwinSystem.py index 0b1a655c..f35ec023 100644 --- a/Cython/Mac/DarwinSystem.py +++ b/Cython/Mac/DarwinSystem.py @@ -18,7 +18,19 @@ py_include_dirs = [ "/Library/Frameworks/Python.framework/Versions/%s/Headers" % version_string ] -os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.3" +# MACOSX_DEPLOYMENT_TARGET can be set to 10.3 in most cases. +# But for the built-in Python 2.5.1 on Leopard, it needs to be set for 10.5. +# This looks like a bug that will be fixed in 2.5.2. If Apple updates their +# Python to 2.5.2, this fix should be OK. +import distutils.sysconfig as sc +python_prefix = sc.get_config_var('prefix') +leopard_python_prefix = +'/System/Library/Frameworks/Python.framework/Versions/2.5' +full_version = "%s.%s.%s" % sys.version_info[:3] +if python_prefix == leopard_python_prefix and full_version == '2.5.1': + os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.5" +else: + os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.3" compilers = ["gcc", "g++"] compiler_options = \ -- 2.26.2