Skip to content

Commit 81ae235

Browse files
committed
If the readline library is found try and determine whether it's the broken
MacOSX 10.4 readline, and don't build the readline module in that case.
1 parent de540e2 commit 81ae235

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,14 @@ def detect_modules(self):
447447
exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
448448

449449
# readline
450-
if self.compiler.find_library_file(lib_dirs, 'readline'):
450+
do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
451+
if platform == 'darwin':
452+
# MacOSX 10.4 has a broken readline. Don't try to build
453+
# the readline module unless the user has installed a fixed
454+
# readline package
455+
if not find_file('readline/rlconf.h', inc_dirs, []):
456+
do_readline = False
457+
if do_readline:
451458
readline_libs = ['readline']
452459
if self.compiler.find_library_file(lib_dirs,
453460
'ncursesw'):

0 commit comments

Comments
 (0)