diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2011-02-14 15:01:54 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-02-15 04:55:02 +0200 |
commit | 138df361fa85bdb418656474a474c490110ba7e2 (patch) | |
tree | 0e7defd95939c191881ac51296e1c9e4236e4483 /python/makefile.mk | |
parent | Make debugging the Python interpreter simpler (diff) | |
download | core-138df361fa85bdb418656474a474c490110ba7e2.tar.gz core-138df361fa85bdb418656474a474c490110ba7e2.zip |
Py_DEBUG mangling for Windows
Diffstat (limited to 'python/makefile.mk')
-rw-r--r-- | python/makefile.mk | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/makefile.mk b/python/makefile.mk index d401785892c1..00f79cee8741 100644 --- a/python/makefile.mk +++ b/python/makefile.mk @@ -161,6 +161,17 @@ $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG) $(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h -rm -f $@ cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@ +# We know that the only thing guarded with #ifdef _DEBUG in PC/pyconfig.h is +# the line defining Py_DEBUG. +.IF "$(debug)"!="" +# If Python is built with debugging, then the modules we build need to be built with +# Py_DEBUG defined too because of the Py_InitModule4 redefining magic in modsupport.h + sed -e 's/^#ifdef _DEBUG$/#if 1/' <$@ >$@.new && mv $@.new $@ +.ELSE +# Correspondingly, if Python is not built with debugging, it won't use the Py_InitModule4 redefining +# magic, so our Python modules should not be built to provide that either. + sed -e 's/^#ifdef _DEBUG$/#if 0/' <$@ >$@.new && mv $@.new $@ +.ENDIF .ENDIF .ENDIF |