summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure7
-rw-r--r--mkspecs/features/default_pre.prf15
-rw-r--r--qtbase.pro5
-rw-r--r--tools/configure/configureapp.cpp5
-rw-r--r--tools/configure/tools.cpp2
5 files changed, 33 insertions, 1 deletions
diff --git a/configure b/configure
index db4abf977b..234ddc6971 100755
--- a/configure
+++ b/configure
@@ -6776,9 +6776,14 @@ QT_LIBINFIX = $QT_LIBINFIX
QT_NAMESPACE = $QT_NAMESPACE
QT_EDITION = $Edition
-
EOF
+if [ "$Edition" != "OpenSource" ] && [ "$Edition" != "Preview" ]; then
+ echo "QT_LICHECK = $Licheck" >> "$QTCONFIG.tmp"
+ echo "QT_RELEASE_DATE = $ReleaseDate" >> "$QTCONFIG.tmp"
+fi
+echo >> "$QTCONFIG.tmp"
+
if [ "$CFG_SHARED" = "no" ]; then
echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
echo >> "$QTCONFIG.tmp"
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index b06b9d6cfc..eb3281ea1d 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -7,3 +7,18 @@ CONFIG = \
lex yacc debug exceptions depend_includepath \
testcase_targets import_plugins import_qpa_plugin \
$$CONFIG
+
+!build_pass:defined(QT_EDITION, var):!equals(QT_EDITION, "OpenSource"):!equals(QT_EDITION, "Preview") {
+ #
+ # call license checker (but cache result for one day)
+ #
+ today = $$section(_DATE_, " ", 0, 2)
+ !isEqual(QMAKE_LICHECK_TIMESTAMP, $$today) {
+ !system("$$system_quote($$system_path($$[QT_HOST_BINS/src]/$$QT_LICHECK)) check" \
+ "$$QT_RELEASE_DATE $$[QMAKE_SPEC] $$[QMAKE_XSPEC]"): \
+ error("License check failed! Giving up ...")
+
+ cache(QMAKE_LICHECK_TIMESTAMP, set stash, today)
+ }
+ unset(today)
+}
diff --git a/qtbase.pro b/qtbase.pro
index bae2641404..51e8fb8760 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -46,6 +46,11 @@ equals(QMAKE_HOST.os, Windows) {
}
INSTALLS += qmake
+#licheck
+licheck.path = $$[QT_HOST_BINS]
+licheck.files = $$PWD/bin/$$QT_LICHECK
+exists($$licheck.files): INSTALLS += licheck
+
#syncqt
syncqt.path = $$[QT_HOST_BINS]
syncqt.files = $$PWD/bin/syncqt.pl
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 4d1ce3d113..6bf0646378 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3463,6 +3463,11 @@ void Configure::generateQConfigPri()
configStream << endl
<< "QT_EDITION = " << dictionary["EDITION"] << endl;
+ if (dictionary["EDITION"] != "OpenSource" && dictionary["EDITION"] != "Preview") {
+ configStream << "QT_LICHECK = " << dictionary["LICHECK"] << endl;
+ configStream << "QT_RELEASE_DATE = " << dictionary["RELEASEDATE"] << endl;
+ }
+
if (!dictionary["CFG_SYSROOT"].isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
configStream << endl
<< "# sysroot" << endl
diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp
index 83d969ce16..095e798332 100644
--- a/tools/configure/tools.cpp
+++ b/tools/configure/tools.cpp
@@ -54,6 +54,8 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary,
return;
}
+ dictionary["LICHECK"] = "licheck.exe";
+
const QString licenseChecker =
QDir::toNativeSeparators(sourcePath + "/bin/licheck.exe");