diff --git a/configure b/configure
index dddb40f4851d1ad5ae6424123fcf84b03c365f07..19802a367c399cc646de60d870ff144635342814 100755
--- a/configure
+++ b/configure
@@ -6763,6 +6763,8 @@ QT_PATCH_VERSION = $QT_PATCH_VERSION
 QT_LIBINFIX = $QT_LIBINFIX
 QT_NAMESPACE = $QT_NAMESPACE
 
+QT_EDITION = $Edition
+
 EOF
 
 if [ "$CFG_SHARED" = "no" ]; then
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 08ec94356381b684e9b6ab052825be232f31eaf0..4d1ce3d11326f393dfc98ece3f001329fedb7dfd 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3460,6 +3460,9 @@ void Configure::generateQConfigPri()
                      << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
                      << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
 
+        configStream << endl
+                     << "QT_EDITION = " << dictionary["EDITION"] << endl;
+
         if (!dictionary["CFG_SYSROOT"].isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
             configStream << endl
                          << "# sysroot" << endl