~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to debian/patches/debug-build.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
2
 
 
3
 
# DP: Change the interpreter to build and install python extensions
4
 
# DP: built with the python-dbg interpreter with a different name into
5
 
# DP: the same path (by appending `_d' to the extension name).
6
 
 
7
 
dir=
8
 
if [ $# -eq 3 -a "$2" = '-d' ]; then
9
 
    pdir="-d $3"
10
 
    dir="$3/"
11
 
elif [ $# -ne 1 ]; then
12
 
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
13
 
    exit 1
14
 
fi
15
 
case "$1" in
16
 
    -patch)
17
 
        patch $pdir -f --no-backup-if-mismatch -p1 < $0
18
 
        autoconf
19
 
        ;;
20
 
    -unpatch)
21
 
        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
22
 
        rm -f configure
23
 
        ;;
24
 
    *)
25
 
        echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
26
 
        exit 1
27
 
esac
28
 
exit 0
29
 
 
30
 
--- ./Python/sysmodule.c.orig   2009-05-28 11:24:38.000000000 +0200
31
 
+++ ./Python/sysmodule.c        2009-06-21 22:52:05.000000000 +0200
32
 
@@ -1436,6 +1436,12 @@
33
 
                            PyUnicode_FromString("legacy"));
34
 
 #endif
35
 
 
36
 
+#ifdef Py_DEBUG
37
 
+       PyDict_SetItemString(sysdict, "pydebug", Py_True);
38
 
+#else
39
 
+       PyDict_SetItemString(sysdict, "pydebug", Py_False);
40
 
+#endif
41
 
+
42
 
 #undef SET_SYS_FROM_STRING
43
 
        if (PyErr_Occurred())
44
 
                return NULL;
45
 
--- ./Python/dynload_shlib.c.orig       2008-06-14 08:18:10.000000000 +0200
46
 
+++ ./Python/dynload_shlib.c    2009-06-21 22:52:05.000000000 +0200
47
 
@@ -46,6 +46,10 @@
48
 
         {"module.exe", "rb", C_EXTENSION},
49
 
         {"MODULE.EXE", "rb", C_EXTENSION},
50
 
 #else
51
 
+#ifdef Py_DEBUG
52
 
+       {"_d.so", "rb", C_EXTENSION},
53
 
+       {"module_d.so", "rb", C_EXTENSION},
54
 
+#endif
55
 
        {".so", "rb", C_EXTENSION},
56
 
        {"module.so", "rb", C_EXTENSION},
57
 
 #endif
58
 
--- ./Lib/distutils/command/build.py.orig       2008-05-29 15:43:16.000000000 +0200
59
 
+++ ./Lib/distutils/command/build.py    2009-06-21 22:52:05.000000000 +0200
60
 
@@ -92,7 +92,8 @@
61
 
         # 'lib.<plat>' under the base build directory.  We only use one of
62
 
         # them for a given distribution, though --
63
 
         if self.build_purelib is None:
64
 
-            self.build_purelib = os.path.join(self.build_base, 'lib')
65
 
+            self.build_purelib = os.path.join(self.build_base,
66
 
+                                              'lib' + plat_specifier)
67
 
         if self.build_platlib is None:
68
 
             self.build_platlib = os.path.join(self.build_base,
69
 
                                               'lib' + plat_specifier)
70
 
--- ./Lib/distutils/sysconfig.py.orig   2009-06-21 22:50:28.000000000 +0200
71
 
+++ ./Lib/distutils/sysconfig.py        2009-06-21 22:52:05.000000000 +0200
72
 
@@ -83,7 +83,8 @@
73
 
             else:
74
 
                 incdir = os.path.join(get_config_var('srcdir'), 'Include')
75
 
                 return os.path.normpath(incdir)
76
 
-        return os.path.join(prefix, "include", "python" + get_python_version())
77
 
+        return os.path.join(prefix, "include",
78
 
+                            "python" + get_python_version() + (sys.pydebug and '_d' or ''))
79
 
     elif os.name == "nt":
80
 
         return os.path.join(prefix, "include")
81
 
     elif os.name == "mac":
82
 
@@ -231,7 +232,7 @@
83
 
     if python_build:
84
 
         return os.path.join(os.path.dirname(sys.executable), "Makefile")
85
 
     lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
86
 
-    return os.path.join(lib_dir, "config", "Makefile")
87
 
+    return os.path.join(lib_dir, "config" + (sys.pydebug and "_d" or ""), "Makefile")
88
 
 
89
 
 
90
 
 def parse_config_h(fp, g=None):
91
 
--- ./Makefile.pre.in.orig      2009-06-14 19:29:12.000000000 +0200
92
 
+++ ./Makefile.pre.in   2009-06-21 22:53:14.000000000 +0200
93
 
@@ -99,8 +99,8 @@
94
 
 # Detailed destination directories
95
 
 BINLIBDEST=    $(LIBDIR)/python$(VERSION)
96
 
 LIBDEST=       $(SCRIPTDIR)/python$(VERSION)
97
 
-INCLUDEPY=     $(INCLUDEDIR)/python$(VERSION)
98
 
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
99
 
+INCLUDEPY=     $(INCLUDEDIR)/python$(VERSION)$(DEBUG_EXT)
100
 
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_EXT)
101
 
 LIBP=          $(LIBDIR)/python$(VERSION)
102
 
 
103
 
 # Symbols used for using shared libraries
104
 
@@ -113,6 +113,8 @@
105
 
 EXE=           @EXEEXT@
106
 
 BUILDEXE=      @BUILDEXEEXT@
107
 
 
108
 
+DEBUG_EXT=     @DEBUG_EXT@
109
 
+
110
 
 # Short name and location for Mac OS X Python framework
111
 
 UNIVERSALSDK=@UNIVERSALSDK@
112
 
 PYTHONFRAMEWORK=       @PYTHONFRAMEWORK@
113
 
@@ -433,7 +435,7 @@
114
 
        $(AR) $(ARFLAGS) $@ $(MODOBJS)
115
 
        $(RANLIB) $@
116
 
 
117
 
-libpython$(VERSION).so: $(LIBRARY_OBJS)
118
 
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
119
 
        if test $(INSTSONAME) != $(LDLIBRARY); then \
120
 
                $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
121
 
                $(LN) -f $(INSTSONAME) $@; \
122
 
@@ -957,8 +959,8 @@
123
 
        $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
124
 
 
125
 
 # Install the library and miscellaneous stuff needed for extending/embedding
126
 
-# This goes into $(exec_prefix)
127
 
-LIBPL=         $(LIBP)/config
128
 
+# This goes into $(exec_prefix)$(DEBUG_EXT)
129
 
+LIBPL=         $(LIBP)/config$(DEBUG_EXT)
130
 
 
131
 
 # pkgconfig directory
132
 
 LIBPC=         $(LIBDIR)/pkgconfig
133
 
--- ./configure.in.orig 2009-06-21 22:50:28.000000000 +0200
134
 
+++ ./configure.in      2009-06-21 22:52:05.000000000 +0200
135
 
@@ -547,7 +547,7 @@
136
 
 AC_MSG_CHECKING(LIBRARY)
137
 
 if test -z "$LIBRARY"
138
 
 then
139
 
-       LIBRARY='libpython$(VERSION).a'
140
 
+       LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
141
 
 fi
142
 
 AC_MSG_RESULT($LIBRARY)
143
 
 
144
 
@@ -691,8 +691,8 @@
145
 
          INSTSONAME="$LDLIBRARY".$SOVERSION
146
 
           ;;
147
 
     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
148
 
-         LDLIBRARY='libpython$(VERSION).so'
149
 
-         BLDLIBRARY='-L. -lpython$(VERSION)'
150
 
+         LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
151
 
+         BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
152
 
          RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
153
 
          case $ac_sys_system in
154
 
              FreeBSD*)
155
 
@@ -796,6 +796,12 @@
156
 
 fi],
157
 
 [AC_MSG_RESULT(no)])
158
 
 
159
 
+if test "$Py_DEBUG" = 'true'
160
 
+then
161
 
+       DEBUG_EXT=_d
162
 
+fi
163
 
+AC_SUBST(DEBUG_EXT)
164
 
+
165
 
 # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
166
 
 # merged with this chunk of code?
167
 
 
168
 
@@ -1563,7 +1569,7 @@
169
 
                esac
170
 
                ;;
171
 
        CYGWIN*)   SO=.dll;;
172
 
-       *)         SO=.so;;
173
 
+       *)         SO=$DEBUG_EXT.so;;
174
 
        esac
175
 
 else
176
 
        # this might also be a termcap variable, see #610332
177
 
--- ./Misc/python-config.in.orig        2008-05-29 15:42:59.000000000 +0200
178
 
+++ ./Misc/python-config.in     2009-06-21 22:52:05.000000000 +0200
179
 
@@ -44,7 +44,7 @@
180
 
 
181
 
 elif opt in ('--libs', '--ldflags'):
182
 
     libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
183
 
-    libs.append('-lpython'+pyver)
184
 
+    libs.append('-lpython' + pyver + (sys.pydebug and "_d" or ""))
185
 
     # add the prefix/lib/pythonX.Y/config dir, but only if there is no
186
 
     # shared library in prefix/lib/.
187
 
     if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):