Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2efc323

Browse files
committed
Be extra careful with linking against libtermcap. This is now only done
if we can find the libtermcap in the usual places. Some platforms don't have libtermcap, e.g. MacOSX.
1 parent 7c6fcda commit 2efc323

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,15 @@ def detect_modules(self):
242242
exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
243243

244244
# readline
245-
if (self.compiler.find_library_file(lib_dirs, 'readline')):
245+
if self.compiler.find_library_file(lib_dirs, 'readline'):
246+
readline_libs = ['readline']
247+
if self.compiler.find_library_file(lib_dirs +
248+
['/usr/lib/termcap'],
249+
'termcap'):
250+
readline_libs.append('termcap')
246251
exts.append( Extension('readline', ['readline.c'],
247252
library_dirs=['/usr/lib/termcap'],
248-
libraries=['readline', 'termcap']) )
253+
libraries=readline_libs) )
249254

250255
# The crypt module is now disabled by default because it breaks builds
251256
# on many systems (where -lcrypt is needed), e.g. Linux (I believe).

0 commit comments

Comments
 (0)