Commit bca9594e authored by Christian Heimes's avatar Christian Heimes

Added the Python core headers Include/*.h and pyconfig.h as dependencies for...

Added the Python core headers Include/*.h and pyconfig.h as dependencies for the extensions in Modules/
It forces a rebuild of all extensions when a header files has been modified
parent bddba057
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
__version__ = "$Revision$" __version__ = "$Revision$"
import sys, os, imp, re, optparse import sys, os, imp, re, optparse
from glob import glob
from distutils import log from distutils import log
from distutils import sysconfig from distutils import sysconfig
...@@ -142,12 +143,20 @@ class PyBuildExt(build_ext): ...@@ -142,12 +143,20 @@ class PyBuildExt(build_ext):
self.distribution.scripts = [os.path.join(srcdir, filename) self.distribution.scripts = [os.path.join(srcdir, filename)
for filename in self.distribution.scripts] for filename in self.distribution.scripts]
# Python header files
headers = glob("Include/*.h") + ["pyconfig.h"]
for ext in self.extensions[:]: for ext in self.extensions[:]:
ext.sources = [ find_module_file(filename, moddirlist) ext.sources = [ find_module_file(filename, moddirlist)
for filename in ext.sources ] for filename in ext.sources ]
if ext.depends is not None: if ext.depends is not None:
ext.depends = [find_module_file(filename, alldirlist) ext.depends = [find_module_file(filename, alldirlist)
for filename in ext.depends] for filename in ext.depends]
else:
ext.depends = []
# re-compile extensions if a header file has been changed
ext.depends.extend(headers)
ext.include_dirs.append( '.' ) # to get config.h ext.include_dirs.append( '.' ) # to get config.h
for incdir in incdirlist: for incdir in incdirlist:
ext.include_dirs.append( os.path.join(srcdir, incdir) ) ext.include_dirs.append( os.path.join(srcdir, incdir) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment