configure.ac |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9fbcf60c51f9bc553c6e6e0204fac975a87ebf13
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 10 15:12:36 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Feb 10 21:16:34 2023 +0000

    qt6 configure: Add moc version check
    
    This way, it is determined at configure time
    if the moc meant to be used for Qt 6 is actually a Qt 5
    one, as happened e.g. on Arch Linux without
    upcoming Change-Id Iefca23e6391a952eb79108260ae1417fc75ad0ef
    ("qt6 configure: Search for Qt 6 moc in more locations").
    
    Fail at configure rather than build time in such cases.
    
    Change-Id: I2ada2045f41f08bf339920d043226f9b36c335b4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146780
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/configure.ac b/configure.ac
index ed0e05d6a7b3..3dd1a3df366a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13120,6 +13120,12 @@ then
     if test "$MOC6" = "no"; then
         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
 the root of your Qt installation by exporting QT6DIR before running 
"configure".])
+    else
+        moc6_test_ver="`$MOC6 -v 2>&1 | $SED -n -e 's/^moc \(6.*\)/\1/p'`"
+        if test -z "$moc6_test_ver"; then
+            AC_MSG_ERROR([Wrong moc for Qt6 found.])
+        fi
+        AC_MSG_NOTICE([Detected moc version: $moc_test_ver])
     fi
 fi
 AC_SUBST(QT6_CFLAGS)

Reply via email to