[Python-checkins] CVS: python/dist/src setup.py,1.16,1.17

M.-A. Lemburg lemburg@users.sourceforge.net
Fri, 26 Jan 2001 10:03:26 -0800


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv21125

Modified Files:
	setup.py 
Log Message:
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



Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** setup.py	2001/01/24 17:18:21	1.16
--- setup.py	2001/01/26 18:03:24	1.17
***************
*** 4,7 ****
--- 4,8 ----
  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
***************
*** 100,103 ****
--- 101,112 ----
          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
***************
*** 236,239 ****
--- 245,249 ----
          if (self.compiler.find_library_file(lib_dirs, 'readline')):
              exts.append( Extension('readline', ['readline.c'],
+                                    library_dirs=['/usr/lib/termcap'],
                                     libraries=['readline', 'termcap']) )