]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Be extra careful with linking against libtermcap. This is now only done
authorMarc-André Lemburg <mal@egenix.com>
Fri, 26 Jan 2001 18:23:02 +0000 (18:23 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Fri, 26 Jan 2001 18:23:02 +0000 (18:23 +0000)
if we can find the libtermcap in the usual places. Some platforms don't
have libtermcap, e.g. MacOSX.

setup.py

index e6bc676461e88477e0cf3d9649a4fecf33f47dda..371036cb10a28c940d89a4f653219a7cff661e18 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -242,10 +242,15 @@ class PyBuildExt(build_ext):
             exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
 
         # readline
-        if (self.compiler.find_library_file(lib_dirs, 'readline')):
+        if self.compiler.find_library_file(lib_dirs, 'readline'):
+            readline_libs = ['readline']
+            if self.compiler.find_library_file(lib_dirs +
+                                               ['/usr/lib/termcap'],
+                                               'termcap'):
+                readline_libs.append('termcap')
             exts.append( Extension('readline', ['readline.c'],
                                    library_dirs=['/usr/lib/termcap'],
-                                   libraries=['readline', 'termcap']) )
+                                   libraries=readline_libs) )
 
         # The crypt module is now disabled by default because it breaks builds
         # on many systems (where -lcrypt is needed), e.g. Linux (I believe).