summaryrefslogtreecommitdiffstats
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-10 12:13:06 +0100
commit7d04ae16f63d45467ee0154725d2ba6e8244f2d4 (patch)
tree9a196f9a4bc8f4e68d59a1d5219a7aefdc72a77e
parentc687dcb312e055c64ca8a17e492f3ca5f0236ece (diff)
downloadpoky-7d04ae16f63d45467ee0154725d2ba6e8244f2d4.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. (From OE-Core rev: d2b5bf97eedc67f77d87a44bab86ab086176b8db) 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() {
95 autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi 95 autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
96} 96}
97 97
98run_make() {
99 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
100 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
101 STAGING_LIBDIR=${STAGING_LIBDIR} \
102 STAGING_INCDIR=${STAGING_INCDIR} \
103 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
104 LIB=${baselib} \
105 ARCH=${TARGET_ARCH} \
106 OPT="${CFLAGS}" \
107 "$@"
108}
109
98do_compile() { 110do_compile() {
99 # regenerate platform specific files, because they depend on system headers 111 # regenerate platform specific files, because they depend on system headers
100 cd ${S}/Lib/plat-linux* 112 cd ${S}/Lib/plat-linux*
@@ -125,14 +137,7 @@ do_compile() {
125 # then call do_install twice we get Makefile.orig == Makefile.sysroot 137 # then call do_install twice we get Makefile.orig == Makefile.sysroot
126 install -m 0644 Makefile Makefile.sysroot 138 install -m 0644 Makefile Makefile.sysroot
127 139
128 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ 140 run_make profile-opt
129 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
130 STAGING_LIBDIR=${STAGING_LIBDIR} \
131 STAGING_INCDIR=${STAGING_INCDIR} \
132 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
133 LIB=${baselib} \
134 ARCH=${TARGET_ARCH} \
135 OPT="${CFLAGS}" profile-opt
136 141
137 if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then 142 if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
138 qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}" 143 qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
@@ -145,14 +150,7 @@ EOF
145 ./pgo-image-qemuwrapper ${B}/python ${PYTHON3_PROFILE_TASK} || true 150 ./pgo-image-qemuwrapper ${B}/python ${PYTHON3_PROFILE_TASK} || true
146 fi 151 fi
147 152
148 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ 153 run_make clean_and_use_profile
149 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
150 STAGING_LIBDIR=${STAGING_LIBDIR} \
151 STAGING_INCDIR=${STAGING_INCDIR} \
152 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
153 LIB=${baselib} \
154 ARCH=${TARGET_ARCH} \
155 OPT="${CFLAGS}" clean_and_use_profile
156} 154}
157 155
158do_install() { 156do_install() {
@@ -165,23 +163,9 @@ do_install() {
165 163
166 # rerun the build once again with original makefile this time 164 # rerun the build once again with original makefile this time
167 # run install in a separate step to avoid compile/install race 165 # run install in a separate step to avoid compile/install race
168 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ 166 run_make DESTDIR=${D} LIBDIR=${libdir} build_all_use_profile
169 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
170 STAGING_LIBDIR=${STAGING_LIBDIR} \
171 STAGING_INCDIR=${STAGING_INCDIR} \
172 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
173 LIB=${baselib} \
174 ARCH=${TARGET_ARCH} \
175 DESTDIR=${D} LIBDIR=${libdir} build_all_use_profile
176 167
177 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ 168 run_make DESTDIR=${D} LIBDIR=${libdir} install
178 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
179 STAGING_LIBDIR=${STAGING_LIBDIR} \
180 STAGING_INCDIR=${STAGING_INCDIR} \
181 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
182 LIB=${baselib} \
183 ARCH=${TARGET_ARCH} \
184 DESTDIR=${D} LIBDIR=${libdir} install
185 169
186 # avoid conflict with 2to3 from Python 2 170 # avoid conflict with 2to3 from Python 2
187 rm -f ${D}/${bindir}/2to3 171 rm -f ${D}/${bindir}/2to3