diff --git a/meta/classes-recipe/python_setuptools_build_meta.bbclass b/meta/classes-recipe/python_setuptools_build_meta.bbclass
index 4c84d1e8d0b..3fd42cc9845 100644
--- a/meta/classes-recipe/python_setuptools_build_meta.bbclass
+++ b/meta/classes-recipe/python_setuptools_build_meta.bbclass
@@ -7,3 +7,17 @@
 inherit setuptools3-base python_pep517
 
 DEPENDS += "python3-setuptools-native python3-wheel-native"
+
+B = "${WORKDIR}/build"
+do_configure[cleandirs] += "${B}"
+
+do_compile:prepend() {
+    # Write an extra config file to build in parallel
+    export DIST_EXTRA_CONFIG=${WORKDIR}/setuptools-extra.cfg
+    cat <<EOF >$DIST_EXTRA_CONFIG
+[build]
+build_base = ${B}
+[build_ext]
+parallel = ${@oe.utils.parallel_make(d)}
+EOF
+}
diff --git a/meta/classes-recipe/setuptools3.bbclass b/meta/classes-recipe/setuptools3.bbclass
index 64a78e9a367..be260093b47 100644
--- a/meta/classes-recipe/setuptools3.bbclass
+++ b/meta/classes-recipe/setuptools3.bbclass
@@ -12,6 +12,8 @@ SETUPTOOLS_BUILD_ARGS ?= ""
 
 SETUPTOOLS_SETUP_PATH ?= "${S}"
 
+B = "${WORKDIR}/build"
+
 python do_check_backend() {
     import re
     filename = d.expand("${SETUPTOOLS_SETUP_PATH}/pyproject.toml")
@@ -29,8 +31,18 @@ addtask check_backend after do_patch before do_configure
 setuptools3_do_configure() {
     :
 }
+do_configure[cleandirs] += "${B}"
 
 setuptools3_do_compile() {
+        # Write an extra config file to build in parallel
+        export DIST_EXTRA_CONFIG=${WORKDIR}/setuptools-extra.cfg
+        cat <<EOF >$DIST_EXTRA_CONFIG
+[build]
+build_base = ${B}
+[build_ext]
+parallel = ${@oe.utils.parallel_make(d)}
+EOF
+
         cd ${SETUPTOOLS_SETUP_PATH}
         NO_FETCH_BUILD=1 \
         STAGING_INCDIR=${STAGING_INCDIR} \
