From a4d1aa4f9d68e41d66d3e0ae61c1f24c575954c9 Mon Sep 17 00:00:00 2001
From: Alexandre Janniaux <ajanni@videolabs.io>
Date: Tue, 30 Aug 2022 15:56:24 +0200
Subject: [PATCH] configure.ac: add support for static Qt plugins

It currently only supports the platforms that were already supported by
the previous contrib system patching. QT_STATIC is checked from the
qconfig.h file.
---
 configure.ac | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/configure.ac b/configure.ac
index d9b8353f0877..9b29d622355d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3882,6 +3882,29 @@ AS_IF([test "${enable_qt}" != "no"], [
       AS_IF([test "${QMLCACHE}" = "no"], [
           AC_MSG_WARN([qmlcachegen not found])
       ])
+
+      VLC_SAVE_FLAGS
+      CPPFLAGS="${CPPFLAGS} ${QT_CFLAGS}"
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[#include <qconfig.h>]],[[QT_STATIC]])],
+        [have_qt_static=yes],[have_qt_static=no])
+      VLC_RESTORE_FLAGS
+
+      AS_IF([test "${have_qt_static}" = "yes"],[
+        PKG_CHECK_MODULES([QT5_PLUGINS], [
+          qtgraphicaleffectsplugin qtquick2plugin qtquickcontrols2plugin
+          qtquicktemplates2plugin qquicklayoutsplugin windowplugin
+          qmlshapesplugin qmlplugin modelsplugin qsvg qsvgicon
+          qtgraphicaleffectsprivate qjpeg ])
+
+        AS_IF([test "${SYS}" = "mingw32"], [
+          PKG_CHECK_MODULES([QT5_PLATFORM_PLUGINS], [qwindows qwindowsvistastyle])
+        ])
+
+        AS_IF([test "${SYS}" = "darwin" -a "${HAVE_OSX}" = 1], [
+          PKG_CHECK_MODULES([QT5_PLATFORM_PLUGINS], [qcocoa])
+        ])
+      ])
     ], [
       AS_IF([test -n "${enable_qt}"],[
         AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
-- 
GitLab