diff Makefile @ 60:4a2bf3c9eb24

FIX: Apply byte-compilation in the "main" Makefile because of MAKE variable issues and allow configuration of byte-compilation in build options
author Franz Glasner <hg@dom66.de>
date Wed, 10 Jan 2024 17:57:02 +0100
parents e25be229d3b6
children 87850df999db
line wrap: on
line diff
--- a/Makefile	Wed Jan 10 15:18:16 2024 +0100
+++ b/Makefile	Wed Jan 10 17:57:02 2024 +0100
@@ -141,6 +141,17 @@
 .else
 	${FIND} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/lib_pypy/ -name '*.so' | ${XARGS} ${STRIP_CMD}
 .endif
+.if ${PORT_OPTIONS:MFORPYIMPL39} || ${PORT_OPTIONS:MFORPYIMPL310}
+.if ${PORT_OPTIONS:MBYTECOMPILE}
+	@echo Byte-compile the Python standard library for optimization levels 0, 1 and 2 with invalidation mode ${COMPILEALL_INVALIDATIONMODE}
+	(cd ${STAGEDIR}${PREFIX}/${PYPY_DIR} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC}/pypy/goal \
+		${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} -B -I -m compileall --invalidation-mode=${COMPILEALL_INVALIDATIONMODE} -q -x '/tests?/' -o 0 -o 1 -o 2 -d "${PREFIX}/${PYPY_DIR}/lib" lib)
+.else
+	@echo Distribution of byte-compiled standard library files is deactivated
+.endif
+.else
+	@echo Byte-compilation of standard library files is not yet supported
+.endif
 
 do-test:
 	# See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386