summaryrefslogtreecommitdiff
path: root/pkg/python
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/python')
-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