summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-25 15:52:11 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-25 15:52:11 (GMT)
commit8608d91e07868f14f71be9784149f813ef1b0a74 (patch)
tree1b8ef51dc4edfbb36ffbe2c8b9bd32072cd622fd
parent543cabc84290972872f596c5c5a6660ad8aade15 (diff)
downloadcpython-8608d91e07868f14f71be9784149f813ef1b0a74.zip
cpython-8608d91e07868f14f71be9784149f813ef1b0a74.tar.gz
cpython-8608d91e07868f14f71be9784149f813ef1b0a74.tar.bz2
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
-rw-r--r--setup.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index c13c4cf..8b850c5 100644
--- a/setup.py
+++ b/setup.py
@@ -4,6 +4,7 @@
__version__ = "$Revision$"
import sys, os, imp, re, optparse
+from glob import glob
from distutils import log
from distutils import sysconfig
@@ -142,12 +143,20 @@ class PyBuildExt(build_ext):
self.distribution.scripts = [os.path.join(srcdir, filename)
for filename in self.distribution.scripts]
+ # Python header files
+ headers = glob("Include/*.h") + ["pyconfig.h"]
+
for ext in self.extensions[:]:
ext.sources = [ find_module_file(filename, moddirlist)
for filename in ext.sources ]
if ext.depends is not None:
ext.depends = [find_module_file(filename, alldirlist)
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
for incdir in incdirlist:
ext.include_dirs.append( os.path.join(srcdir, incdir) )