issue-sl-setup OS X Installer: readline module broken Changes for Issue6877 to enable the readline module to use the native OS X editline library instead of GNU readline introduce a problem for OS X installer builds or other builds using MACOSX_DEPLOYMENT_TARGET. The test in setup.py to determine whether to search for a non-system library is based solely on the OS level of the build system and not the minimum deployment target level. Without this patch to setup.py, 10.3- or 10.4-targeted installer builds on 10.5 or 10.6 will fail to search for the installer-supplied GNU readline *and* will be dynamically linked with the crippled 10.4u SDK version of editline, thereby causing the readline module to crash on all levels of OS X. The patch also corrects a incorrect version test in setup.py that causes builds on 10.6 to be flooded with OS X deprecation warnings. APPLIES py3k, trunk, 2.6 NOTE issue-sl-setup-py3k.txt py3k issue-sl-setup-trunk.txt trunk issue-sl-setup-26.txt (this file) 2.6 diff -r a0d63f5d2c9a setup.py --- setup.py Thu Mar 04 17:01:40 2010 -0800 +++ setup.py Thu Mar 04 20:45:23 2010 -0800 @@ -558,6 +558,9 @@ do_readline = self.compiler.find_library_file(lib_dirs, 'readline') if platform == 'darwin': os_release = int(os.uname()[2].split('.')[0]) + dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + if dep_target and dep_target.split('.') < ['10', '5']: + os_release = 8 if os_release < 9: # MacOSX 10.4 has a broken readline. Don't try to build # the readline module unless the user has installed a fixed @@ -1366,7 +1380,7 @@ if platform == 'darwin' and ("--disable-toolbox-glue" not in sysconfig.get_config_var("CONFIG_ARGS")): - if os.uname()[2] > '8.': + if int(os.uname()[2].split('.')[0]) >= 8: # We're on Mac OS X 10.4 or later, the compiler should # support '-Wno-deprecated-declarations'. This will # surpress deprecation warnings for the Carbon extensions,