From fde84bf076045e638e1a72a36e87331dd70a0d75 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Sat, 13 Jun 2020 11:45:44 -0700 Subject: [PATCH] cffi: call distutils.sysconfig.customize_compiler() Closes #103. --- NEWS.rst | 12 ++++++++++-- make_cffi.py | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 0900266e..d9f7f0b1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -76,14 +76,22 @@ Other Actions Not Blocking Release 0.14.0 (not yet released) ========================= +Bug Fixes +--------- + +* Some internal fields of C structs are now explicitly initialized. + (Possible fix for #105.) +* The ``make_cffi.py`` script used to build the CFFI bindings now + calls ``distutils.sysconfig.customize_compiler()`` so compiler + customizations (such as honoring the ``CC`` environment variable) + are performed. Patch by @Arfrever. (#103) + Changes ------- * Bundled zstandard library upgraded from 1.4.4 to 1.4.5. * ``setup.py`` is now executable. * Python code reformatted with black using 80 character line lengths. -* Some internal fields of C structs are now explicitly initialized. - (Possible fix for #105.) 0.13.0 (released 2019-12-28) ============================ diff --git a/make_cffi.py b/make_cffi.py index cf7b5085..3e2d951f 100644 --- a/make_cffi.py +++ b/make_cffi.py @@ -8,6 +8,7 @@ import cffi import distutils.ccompiler +import distutils.sysconfig import os import re import subprocess @@ -76,6 +77,10 @@ if hasattr(compiler, "initialize"): compiler.initialize() +# This performs platform specific customizations, including honoring +# environment variables like CC. +distutils.sysconfig.customize_compiler(compiler) + # Distutils doesn't set compiler.preprocessor, so invoke the preprocessor # manually. if compiler.compiler_type == "unix":