summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-02-02 18:35:45 -0800
committerMichael Forney <mforney@mforney.org>2017-02-07 14:36:26 -0800
commitb47f3fc7cbc0b38087c19f5fe8bd3d34f0570458 (patch)
tree31f9f87c5f96ed800bfebda2d90202a3d638f102
parent1fa2eca8bed8145bcfb877f688be334b3867c3eb (diff)
python: Disable PYMALLOC
-rw-r--r--pkg/python/gen.rc15
-rw-r--r--pkg/python/pyconfig.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/pkg/python/gen.rc b/pkg/python/gen.rc
index 56d02ea8..1052891a 100644
--- a/pkg/python/gen.rc
+++ b/pkg/python/gen.rc
@@ -161,8 +161,15 @@ cc Modules/getpath.c ; defs='-D '''^(\
'VPATH='""\
)^'''' with cflags '$cflags '$"defs
-cc Python/getplatform.c ; with cflags '$cflags -D PLATFORM=''"linux"'''
-cc Python/sysmodule.c ; with cflags '$cflags -D ABIFLAGS=''"m"'''
+platform=linux
+abiflags=''
+if(grep -q '^#define WITH_PYMALLOC 1' pyconfig.h)
+ abiflags=$abiflags^m
+if(grep -q '^#define Py_DEBUG 1' pyconfig.h)
+ abiflags=$abiflags^d
+
+cc Python/getplatform.c ; with cflags '$cflags -D PLATFORM=''"'$platform'"'''
+cc Python/sysmodule.c ; with cflags '$cflags -D ABIFLAGS=''"'$abiflags'"'''
phony deps $deps
lib libpython.a -d '$dir'/deps $srcs
@@ -175,9 +182,9 @@ pylibs=`{grep -v '^#' pylibs.txt}
checkstatus
for(f in $pylibs)
file lib/python3.5/$f '$srcdir'/Lib/$f 644
-file lib/python3.5/_sysconfigdata_m_linux_.py '$dir'/lib/_sysconfigdata.py 644
+file lib/python3.5/_sysconfigdata_$abiflags^_$platform^_.py '$dir'/lib/_sysconfigdata.py 644
file lib/python3.5/Makefile '$dir'/lib/Makefile 644
dir lib/python3.5/lib-dynload 755
-gen_inputs='$dir'/^(Setup modules.awk)
+gen_inputs='$dir'/^(Setup modules.awk pyconfig.h)
fetch curl
diff --git a/pkg/python/pyconfig.h b/pkg/python/pyconfig.h
index 35d66e32..af7c53a6 100644
--- a/pkg/python/pyconfig.h
+++ b/pkg/python/pyconfig.h
@@ -266,7 +266,7 @@
/* #undef WITH_DYLD */
/* #undef WITH_LIBINTL */
/* #undef WITH_NEXT_FRAMEWORK */
-#define WITH_PYMALLOC 1
+/* #undef WITH_PYMALLOC */
#define WITH_THREAD 1
/* #undef WITH_VALGRIND */
#if defined AC_APPLE_UNIVERSAL_BUILD