From b47f3fc7cbc0b38087c19f5fe8bd3d34f0570458 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 2 Feb 2017 18:35:45 -0800 Subject: python: Disable PYMALLOC --- pkg/python/gen.rc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'pkg/python/gen.rc') 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 -- cgit v1.2.3