|
|
c6247fd |
diff -up Python-2.7rc2/configure.in.debug-build Python-2.7rc2/configure.in
|
|
|
c6247fd |
--- Python-2.7rc2/configure.in.debug-build 2010-06-24 12:59:28.166319997 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/configure.in 2010-06-24 12:59:28.179376823 -0400
|
|
|
c6247fd |
@@ -641,7 +641,7 @@ AC_SUBST(LIBRARY)
|
|
|
f020abd |
AC_MSG_CHECKING(LIBRARY)
|
|
|
f020abd |
if test -z "$LIBRARY"
|
|
|
f020abd |
then
|
|
|
f020abd |
- LIBRARY='libpython$(VERSION).a'
|
|
|
f020abd |
+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
|
|
|
f020abd |
fi
|
|
|
f020abd |
AC_MSG_RESULT($LIBRARY)
|
|
|
f020abd |
|
|
|
c6247fd |
@@ -786,8 +786,8 @@ if test $enable_shared = "yes"; then
|
|
|
f020abd |
INSTSONAME="$LDLIBRARY".$SOVERSION
|
|
|
f020abd |
;;
|
|
|
f020abd |
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
|
|
|
f020abd |
- LDLIBRARY='libpython$(VERSION).so'
|
|
|
f020abd |
- BLDLIBRARY='-L. -lpython$(VERSION)'
|
|
|
f020abd |
+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
|
|
|
f020abd |
+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
|
|
|
f020abd |
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|
|
f020abd |
case $ac_sys_system in
|
|
|
f020abd |
FreeBSD*)
|
|
|
c6247fd |
@@ -892,6 +892,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
|
|
|
f020abd |
fi],
|
|
|
f020abd |
[AC_MSG_RESULT(no)])
|
|
|
f020abd |
|
|
|
f020abd |
+if test "$Py_DEBUG" = 'true'
|
|
|
f020abd |
+then
|
|
|
f020abd |
+ DEBUG_EXT=_d
|
|
|
f020abd |
+ DEBUG_SUFFIX=-debug
|
|
|
f020abd |
+fi
|
|
|
f020abd |
+AC_SUBST(DEBUG_EXT)
|
|
|
f020abd |
+AC_SUBST(DEBUG_SUFFIX)
|
|
|
f020abd |
+
|
|
|
f020abd |
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
|
|
|
f020abd |
# merged with this chunk of code?
|
|
|
f020abd |
|
|
|
c6247fd |
diff -up Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build Python-2.7rc2/Lib/distutils/command/build_ext.py
|
|
|
c6247fd |
--- Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build 2010-04-01 14:17:09.000000000 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Lib/distutils/command/build_ext.py 2010-06-24 12:59:28.179376823 -0400
|
|
|
f020abd |
@@ -677,7 +677,10 @@ class build_ext (Command):
|
|
|
f020abd |
so_ext = get_config_var('SO')
|
|
|
f020abd |
if os.name == 'nt' and self.debug:
|
|
|
c6247fd |
return os.path.join(*ext_path) + '_d' + so_ext
|
|
|
f020abd |
- return os.path.join(*ext_path) + so_ext
|
|
|
f020abd |
+
|
|
|
f020abd |
+ # Similarly, extensions in debug mode are named 'module_d.so', to
|
|
|
f020abd |
+ # avoid adding the _d to the SO config variable:
|
|
|
f020abd |
+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or "") + so_ext
|
|
|
f020abd |
|
|
|
f020abd |
def get_export_symbols (self, ext):
|
|
|
f020abd |
"""Return the list of symbols that a shared extension has to
|
|
|
f020abd |
@@ -760,6 +763,8 @@ class build_ext (Command):
|
|
|
f020abd |
template = "python%d.%d"
|
|
|
f020abd |
pythonlib = (template %
|
|
|
f020abd |
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
|
|
|
f020abd |
+ if sys.pydebug:
|
|
|
f020abd |
+ pythonlib += '_d'
|
|
|
f020abd |
return ext.libraries + [pythonlib]
|
|
|
f020abd |
else:
|
|
|
f020abd |
return ext.libraries
|
|
|
c6247fd |
diff -up Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build Python-2.7rc2/Lib/distutils/sysconfig.py
|
|
|
c6247fd |
--- Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build 2010-06-24 12:59:28.145319202 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Lib/distutils/sysconfig.py 2010-06-24 12:59:28.180381519 -0400
|
|
|
c6247fd |
@@ -85,7 +85,8 @@ def get_python_inc(plat_specific=0, pref
|
|
|
c6247fd |
# Include is located in the srcdir
|
|
|
c6247fd |
inc_dir = os.path.join(srcdir, "Include")
|
|
|
f020abd |
return inc_dir
|
|
|
f020abd |
- return os.path.join(prefix, "include", "python" + get_python_version())
|
|
|
f020abd |
+ return os.path.join(prefix, "include",
|
|
|
f020abd |
+ "python" + get_python_version() + (sys.pydebug and '-debug' or ''))
|
|
|
f020abd |
elif os.name == "nt":
|
|
|
f020abd |
return os.path.join(prefix, "include")
|
|
|
c6247fd |
elif os.name == "os2":
|
|
|
c6247fd |
@@ -211,7 +212,7 @@ def get_makefile_filename():
|
|
|
f020abd |
if python_build:
|
|
|
f020abd |
return os.path.join(os.path.dirname(sys.executable), "Makefile")
|
|
|
f020abd |
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
|
|
|
f020abd |
- return os.path.join(lib_dir, "config", "Makefile")
|
|
|
f020abd |
+ return os.path.join(lib_dir, "config" + (sys.pydebug and "-debug" or ""), "Makefile")
|
|
|
f020abd |
|
|
|
f020abd |
|
|
|
f020abd |
def parse_config_h(fp, g=None):
|
|
|
c6247fd |
diff -up Python-2.7rc2/Makefile.pre.in.debug-build Python-2.7rc2/Makefile.pre.in
|
|
|
c6247fd |
--- Python-2.7rc2/Makefile.pre.in.debug-build 2010-06-24 12:59:28.175377249 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Makefile.pre.in 2010-06-24 13:01:24.559945307 -0400
|
|
|
c6247fd |
@@ -99,8 +99,8 @@ SCRIPTDIR= $(prefix)/lib64
|
|
|
f020abd |
# Detailed destination directories
|
|
|
f020abd |
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
|
|
f020abd |
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
|
|
f020abd |
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
|
|
|
f020abd |
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
|
|
|
f020abd |
+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
|
|
|
f020abd |
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
|
|
|
f020abd |
LIBP= $(LIBDIR)/python$(VERSION)
|
|
|
f020abd |
|
|
|
f020abd |
# Symbols used for using shared libraries
|
|
|
c6247fd |
@@ -114,6 +114,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
|
|
|
f020abd |
EXE= @EXEEXT@
|
|
|
f020abd |
BUILDEXE= @BUILDEXEEXT@
|
|
|
f020abd |
|
|
|
f020abd |
+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a debug build
|
|
|
f020abd |
+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug build
|
|
|
f020abd |
+# Both will be empty in an optimized build
|
|
|
f020abd |
+DEBUG_EXT= @DEBUG_EXT@
|
|
|
f020abd |
+DEBUG_SUFFIX= @DEBUG_SUFFIX@
|
|
|
f020abd |
+
|
|
|
f020abd |
# Short name and location for Mac OS X Python framework
|
|
|
f020abd |
UNIVERSALSDK=@UNIVERSALSDK@
|
|
|
f020abd |
PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
|
|
|
c6247fd |
@@ -177,8 +183,8 @@ LIBOBJDIR= Python/
|
|
|
f020abd |
LIBOBJS= @LIBOBJS@
|
|
|
f020abd |
UNICODE_OBJS= @UNICODE_OBJS@
|
|
|
f020abd |
|
|
|
f020abd |
-PYTHON= python$(EXE)
|
|
|
f020abd |
-BUILDPYTHON= python$(BUILDEXE)
|
|
|
f020abd |
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
|
|
|
f020abd |
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
|
|
|
f020abd |
|
|
|
f020abd |
# The task to run while instrument when building the profile-opt target
|
|
|
f020abd |
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
|
|
|
c6247fd |
@@ -409,7 +415,7 @@ sharedmods: $(BUILDPYTHON)
|
|
|
c6247fd |
*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
|
|
|
f020abd |
esac
|
|
|
f020abd |
|
|
|
f020abd |
-libpython$(VERSION).so: $(LIBRARY_OBJS)
|
|
|
f020abd |
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
|
|
|
f020abd |
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
|
|
f020abd |
$(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
|
|
f020abd |
$(LN) -f $(INSTSONAME) $@; \
|
|
|
c6247fd |
@@ -788,9 +794,9 @@ bininstall: altbininstall
|
|
|
f020abd |
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
|
|
|
f020abd |
else true; \
|
|
|
f020abd |
fi
|
|
|
f020abd |
- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
|
|
|
f020abd |
- -rm -f $(DESTDIR)$(BINDIR)/python-config
|
|
|
f020abd |
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
|
|
|
f020abd |
+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
|
|
|
f020abd |
+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
|
|
|
f020abd |
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config python$(DEBUG_SUFFIX)-config)
|
|
|
c6247fd |
-test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
|
|
|
c6247fd |
-rm -f $(DESTDIR)$(LIBPC)/python.pc
|
|
|
c6247fd |
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
|
|
|
c6247fd |
@@ -806,7 +812,7 @@ altbininstall: $(BUILDPYTHON)
|
|
|
f020abd |
else true; \
|
|
|
f020abd |
fi; \
|
|
|
f020abd |
done
|
|
|
f020abd |
- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
|
|
|
f020abd |
+ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
|
|
|
f020abd |
if test -f $(LDLIBRARY); then \
|
|
|
f020abd |
if test -n "$(DLLLIBRARY)" ; then \
|
|
|
f020abd |
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
|
|
c6247fd |
@@ -951,10 +957,11 @@ $(srcdir)/Lib/$(PLATDIR):
|
|
|
c6247fd |
export EXE; EXE="$(BUILDEXE)"; \
|
|
|
c6247fd |
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
|
|
|
c6247fd |
|
|
|
c6247fd |
-python-config: $(srcdir)/Misc/python-config.in
|
|
|
c6247fd |
+python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
|
|
|
c6247fd |
# Substitution happens here, as the completely-expanded BINDIR
|
|
|
c6247fd |
# is not available in configure
|
|
|
c6247fd |
- sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
|
|
|
c6247fd |
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," < $(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
|
|
|
c6247fd |
+
|
|
|
c6247fd |
|
|
|
c6247fd |
# Install the include files
|
|
|
c6247fd |
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
|
|
c6247fd |
@@ -975,13 +982,13 @@ inclinstall:
|
|
|
f020abd |
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
|
|
|
f020abd |
|
|
|
f020abd |
# Install the library and miscellaneous stuff needed for extending/embedding
|
|
|
f020abd |
-# This goes into $(exec_prefix)
|
|
|
f020abd |
-LIBPL= $(LIBP)/config
|
|
|
f020abd |
+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
|
|
|
f020abd |
+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
|
|
|
c6247fd |
|
|
|
c6247fd |
# pkgconfig directory
|
|
|
c6247fd |
LIBPC= $(LIBDIR)/pkgconfig
|
|
|
c6247fd |
|
|
|
c6247fd |
-libainstall: all python-config
|
|
|
c6247fd |
+libainstall: all python$(DEBUG_SUFFIX)-config
|
|
|
c6247fd |
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
|
|
|
f020abd |
do \
|
|
|
c6247fd |
if test ! -d $(DESTDIR)$$i; then \
|
|
|
c6247fd |
@@ -1000,8 +1007,7 @@ libainstall: all python-config
|
|
|
c6247fd |
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
|
|
c6247fd |
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
|
|
f020abd |
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
|
|
f020abd |
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
|
|
|
f020abd |
- rm python-config
|
|
|
f020abd |
+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
|
|
|
f020abd |
@if [ -s Modules/python.exp -a \
|
|
|
f020abd |
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
|
|
f020abd |
echo; echo "Installing support files for building shared extension modules on AIX:"; \
|
|
|
c6247fd |
diff -up Python-2.7rc2/Misc/python-config.in.debug-build Python-2.7rc2/Misc/python-config.in
|
|
|
c6247fd |
--- Python-2.7rc2/Misc/python-config.in.debug-build 2010-03-18 20:08:44.000000000 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Misc/python-config.in 2010-06-24 12:59:28.182375371 -0400
|
|
|
c6247fd |
@@ -45,7 +45,7 @@ for opt in opt_flags:
|
|
|
c6247fd |
|
|
|
c6247fd |
elif opt in ('--libs', '--ldflags'):
|
|
|
c6247fd |
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
|
|
|
c6247fd |
- libs.append('-lpython'+pyver)
|
|
|
c6247fd |
+ libs.append('-lpython' + pyver + (sys.pydebug and "_d" or ""))
|
|
|
c6247fd |
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
|
|
c6247fd |
# shared library in prefix/lib/.
|
|
|
c6247fd |
if opt == '--ldflags':
|
|
|
c6247fd |
diff -up Python-2.7rc2/Modules/makesetup.debug-build Python-2.7rc2/Modules/makesetup
|
|
|
c6247fd |
--- Python-2.7rc2/Modules/makesetup.debug-build 2007-09-05 07:47:34.000000000 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Modules/makesetup 2010-06-24 12:59:28.182375371 -0400
|
|
|
f020abd |
@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
|
|
f020abd |
*$mod.o*) base=$mod;;
|
|
|
f020abd |
*) base=${mod}module;;
|
|
|
f020abd |
esac
|
|
|
f020abd |
- file="$srcdir/$base\$(SO)"
|
|
|
f020abd |
+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
|
|
|
f020abd |
case $doconfig in
|
|
|
f020abd |
no) SHAREDMODS="$SHAREDMODS $file";;
|
|
|
f020abd |
esac
|
|
|
c6247fd |
diff -up Python-2.7rc2/Python/dynload_shlib.c.debug-build Python-2.7rc2/Python/dynload_shlib.c
|
|
|
c6247fd |
--- Python-2.7rc2/Python/dynload_shlib.c.debug-build 2010-05-09 10:46:46.000000000 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Python/dynload_shlib.c 2010-06-24 12:59:28.183377733 -0400
|
|
|
f020abd |
@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
|
|
|
c6247fd |
{"module.exe", "rb", C_EXTENSION},
|
|
|
c6247fd |
{"MODULE.EXE", "rb", C_EXTENSION},
|
|
|
f020abd |
#else
|
|
|
f020abd |
+#ifdef Py_DEBUG
|
|
|
c6247fd |
+ {"_d.so", "rb", C_EXTENSION},
|
|
|
c6247fd |
+ {"module_d.so", "rb", C_EXTENSION},
|
|
|
f020abd |
+#else
|
|
|
c6247fd |
{".so", "rb", C_EXTENSION},
|
|
|
c6247fd |
{"module.so", "rb", C_EXTENSION},
|
|
|
f020abd |
-#endif
|
|
|
f020abd |
-#endif
|
|
|
f020abd |
-#endif
|
|
|
f020abd |
+#endif /* Py_DEBUG */
|
|
|
f020abd |
+#endif /* __VMS */
|
|
|
f020abd |
+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
|
|
|
f020abd |
+#endif /* __CYGWIN__ */
|
|
|
c6247fd |
{0, 0}
|
|
|
f020abd |
};
|
|
|
f020abd |
|
|
|
c6247fd |
diff -up Python-2.7rc2/Python/sysmodule.c.debug-build Python-2.7rc2/Python/sysmodule.c
|
|
|
c6247fd |
--- Python-2.7rc2/Python/sysmodule.c.debug-build 2010-05-21 13:12:38.000000000 -0400
|
|
|
c6247fd |
+++ Python-2.7rc2/Python/sysmodule.c 2010-06-24 12:59:28.184375034 -0400
|
|
|
c6247fd |
@@ -1557,6 +1557,12 @@ _PySys_Init(void)
|
|
|
c6247fd |
PyString_FromString("legacy"));
|
|
|
c6247fd |
#endif
|
|
|
f020abd |
|
|
|
f020abd |
+#ifdef Py_DEBUG
|
|
|
f020abd |
+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
|
|
|
f020abd |
+#else
|
|
|
f020abd |
+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
|
|
|
f020abd |
+#endif
|
|
|
f020abd |
+
|
|
|
f020abd |
#undef SET_SYS_FROM_STRING
|
|
|
c6247fd |
if (PyErr_Occurred())
|
|
|
c6247fd |
return NULL;
|