From 6b827cbf7562f158c68154db0ff857369b278036 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 6 Aug 2013 12:40:06 -0400 Subject: [PATCH] Fix PyCXX check -- if import passes, we should assume that including it will also --- setupext.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/setupext.py b/setupext.py index a79585da5250..24544ad7fecf 100644 --- a/setupext.py +++ b/setupext.py @@ -695,17 +695,12 @@ def check(self): return self._check_for_pkg_config( 'PyCXX', 'CXX/Extensions.hxx', min_version='6.2.4') except CheckFailed as e: - # Since there is no .pc file for PyCXX upstream, many - # distros don't package it either. We don't necessarily - # need to fall back to a local build in that scenario if - # the header files can be found. - base_include_dirs = [ - os.path.join(x, 'include') for x in get_base_dirs()] - if has_include_file(base_include_dirs, 'CXX/Extensions.hxx'): - return 'Using system CXX (version unknown, no pkg-config info)' - else: - self.__class__.found_external = False - return str(e) + ' Using local copy.' + # It's ok to just proceed here, since the `import CXX` + # worked above, and PyCXX (at least upstream) ensures that + # its header files are on the default distutils include + # path (either in a standard C place such as /usr/include, + # or in /usr/include/pythonX.Y. + return 'Using system CXX (version unknown, no pkg-config info)' def add_flags(self, ext): if self.found_external and not 'sdist' in sys.argv: