From 7c6fcda7bfe45a3b075f6434ebb65055ab4d7537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Fri, 26 Jan 2001 18:03:24 +0000 Subject: [PATCH] Fixed setup.py to allow: 1. skipping of extensions which cause an error (a warning message is written to stdout, but the build process no longer fails completely) 2. the readline extension to compile on SuSE Linux (and probably other platforms too) by adding /usr/lib/termcap to the library search path --- setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.py b/setup.py index fc68172758b..e6bc676461e 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ import sys, os, string, getopt from distutils import sysconfig +from distutils.errors import * from distutils.core import Extension, setup from distutils.command.build_ext import build_ext @@ -99,6 +100,14 @@ class PyBuildExt(build_ext): build_ext.build_extensions(self) + def build_extension(self, ext): + + try: + build_ext.build_extension(self, ext) + except (CCompilerError, DistutilsError), why: + self.announce('WARNING: building of extension "%s" failed: %s' % + (ext.name, sys.exc_info()[1])) + def get_platform (self): # Get value of sys.platform platform = sys.platform @@ -235,6 +244,7 @@ class PyBuildExt(build_ext): # readline if (self.compiler.find_library_file(lib_dirs, 'readline')): exts.append( Extension('readline', ['readline.c'], + library_dirs=['/usr/lib/termcap'], libraries=['readline', 'termcap']) ) # The crypt module is now disabled by default because it breaks builds