[Libreoffice-commits] .: python/makefile.mk
Tor Lillqvist
tml at kemper.freedesktop.org
Mon Feb 14 18:57:20 PST 2011
python/makefile.mk | 11 +++++++++++
1 file changed, 11 insertions(+)
New commits:
commit 59f242f496e16c63ea158f7547342dd6566cc9f3
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Mon Feb 14 15:01:54 2011 +0200
Py_DEBUG mangling for Windows
diff --git a/python/makefile.mk b/python/makefile.mk
index d401785..00f79ce 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
More information about the Libreoffice-commits
mailing list