aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-09-06 12:15:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-06 23:43:34 +0100
commitd2b5bf97eedc67f77d87a44bab86ab086176b8db (patch)
treed359a9049a31be4b755f13e1c6e90f05908bd2e7
parent50b2187ed8b54317e953882034ba5648e0a4b764 (diff)
downloadopenembedded-core-contrib-d2b5bf97eedc67f77d87a44bab86ab086176b8db.tar.gz
python3: generalise make commands
We're repeating the same make invocation over and over, twice without setting OPT=${CFLAGS} which doesn't seem right. Centralise the make invocation to clean up the tasks. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/python/python3_3.5.5.bb48
1 files changed, 16 insertions, 32 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
index 9e31fa6f29..8e94e38a2d 100644
--- a/meta/recipes-devtools/python/python3_3.5.5.bb
+++ b/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -95,6 +95,18 @@ do_configure_append() {
autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
}
+run_make() {
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}" \
+ "$@"
+}
+
do_compile() {
# regenerate platform specific files, because they depend on system headers
cd ${S}/Lib/plat-linux*
@@ -125,14 +137,7 @@ do_compile() {
# then call do_install twice we get Makefile.orig == Makefile.sysroot
install -m 0644 Makefile Makefile.sysroot
- oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
- HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
- STAGING_LIBDIR=${STAGING_LIBDIR} \
- STAGING_INCDIR=${STAGING_INCDIR} \
- STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
- LIB=${baselib} \
- ARCH=${TARGET_ARCH} \
- OPT="${CFLAGS}" profile-opt
+ run_make profile-opt
if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
@@ -145,14 +150,7 @@ EOF
./pgo-image-qemuwrapper ${B}/python ${PYTHON3_PROFILE_TASK} || true
fi
- oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
- HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
- STAGING_LIBDIR=${STAGING_LIBDIR} \
- STAGING_INCDIR=${STAGING_INCDIR} \
- STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
- LIB=${baselib} \
- ARCH=${TARGET_ARCH} \
- OPT="${CFLAGS}" clean_and_use_profile
+ run_make clean_and_use_profile
}
do_install() {
@@ -165,23 +163,9 @@ do_install() {
# rerun the build once again with original makefile this time
# run install in a separate step to avoid compile/install race
- oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
- HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
- STAGING_LIBDIR=${STAGING_LIBDIR} \
- STAGING_INCDIR=${STAGING_INCDIR} \
- STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
- LIB=${baselib} \
- ARCH=${TARGET_ARCH} \
- DESTDIR=${D} LIBDIR=${libdir} build_all_use_profile
+ run_make DESTDIR=${D} LIBDIR=${libdir} build_all_use_profile
- oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
- HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
- STAGING_LIBDIR=${STAGING_LIBDIR} \
- STAGING_INCDIR=${STAGING_INCDIR} \
- STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
- LIB=${baselib} \
- ARCH=${TARGET_ARCH} \
- DESTDIR=${D} LIBDIR=${libdir} install
+ run_make DESTDIR=${D} LIBDIR=${libdir} install
# avoid conflict with 2to3 from Python 2
rm -f ${D}/${bindir}/2to3