qt5base: fix plugin loading
[feed/video.git] / frameworks / qt5base / Makefile
index eb6d247f2b85277926045330e771f5efb5a0b62f..0a70ee04d4498d2c4d8096dc2c3fcfd297a237c2 100644 (file)
@@ -6,7 +6,6 @@
 #
 
 # TODO / known bugs:
-# - plugins don't work when sstrip is used for stripping
 # - only framebuffer (linuxfb) support for now, XBC/DirectFB to come - thus no GL thus no qtquick2 / QML2, as it has a hard dependency on GL
 # - host_build functionality seems to be broken - qmake doesn't switch to the host toolchain (linux-g++) when host_build gets invoked
 
@@ -31,6 +30,31 @@ include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 include ./files/qmake.mk
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_qt5base-plugin-sqldrivers-sqlite \
+       CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg \
+       CONFIG_PACKAGE_qt5base-network \
+       CONFIG_PACKAGE_qt5base-gui \
+       CONFIG_PACKAGE_qt5base-plugin-imageformats-gif \
+       CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb \
+       CONFIG_PACKAGE_qt5base-plugin-platforms-minimal
+
+# Do not use sstrip for QT5. When sstrip is used the QT5 plugin loading does
+# not work, because of QT''s internal elf parser, see
+# https://bugreports.qt.io/browse/QTBUG-52567
+# Use the code from the gcc package to use strip instaed.
+ifneq ($(CONFIG_USE_SSTRIP),)
+  STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
+  RSTRIP:= \
+    export CROSS="$(TARGET_CROSS)" \
+               $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
+               $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
+    NM="$(TARGET_CROSS)nm" \
+    STRIP="$(STRIP)" \
+    STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \
+    $(SCRIPT_DIR)/rstrip.sh
+endif
+
 define Package/qt5base/Default
   SECTION:=video-frameworks
   CATEGORY:=Video
@@ -56,7 +80,7 @@ endef
 define Package/qt5base-core
   $(call Package/qt5base/Default)
   TITLE+=core
-  DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +librt
+  DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +librt $(ICONV_DEPENDS)
 endef
 
 define Package/qt5base-gui
@@ -250,8 +274,17 @@ define Build/Configure
                        -shared \
                        -largefile \
                        -accessibility \
-                       -system-sqlite \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-sqldrivers-sqlite),-system-sqlite,-no-sql-sqlite) \
+                       -no-sql-db2 \
+                       -no-sql-ibase \
+                       -no-sql-mysql \
+                       -no-sql-oci \
+                       -no-sql-odbc \
+                       -no-sql-psql \
+                       -no-sql-sqlite2 \
+                       -no-sql-tds \
                        -no-qml-debug \
+                       -no-nis \
                        -no-sse2 \
                        -no-sse3 \
                        -no-ssse3 \
@@ -259,17 +292,17 @@ define Build/Configure
                        -no-sse4.2 \
                        -no-avx \
                        -no-avx2 \
-                       -no-mips_dsp \
-                       -no-mips_dspr2 \
+                       $(if $(findstring -mdsp,$(TARGET_CFLAGS)),,-no-mips_dsp)\
+                       $(if $(findstring -mdspr2,$(TARGET_CFLAGS)),,-no-mips_dspr2)\
                        -force-pkg-config \
                        -system-zlib \
                        -mtdev \
                        -no-journald \
-                       -system-libpng \
-                       -system-libjpeg \
+                       $(if $(CONFIG_PACKAGE_qt5base-gui),-system-libpng,-no-libpng) \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg),-system-libjpeg,-no-libjpeg) \
                        -system-freetype \
                        -no-harfbuzz \
-                       -openssl-linked \
+                       $(if $(CONFIG_PACKAGE_qt5base-network),-openssl-linked,-no-openssl) \
                        -system-pcre \
                        -system-xcb \
                        -system-xkbcommon \
@@ -277,15 +310,16 @@ define Build/Configure
                        -no-xcb-xlib \
                        -no-glib \
                        -no-pulseaudio \
-                       -alsa \
+                       -no-alsa \
                        -no-gtkstyle \
                        -nomake tools \
-                       -make examples \
-                       -gui \
-                       -widgets \
+                       $(if $(CONFIG_PACKAGE_qt5base-examples),-make examples,-nomake examples) \
+                       $(if $(CONFIG_PACKAGE_qt5base-gui),-gui,-no-gui) \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-gif),,-no-gif) \
+                       $(if $(CONFIG_PACKAGE_qt5base-widgets),-widgets,-no-widgets) \
                        -no-optimized-qmake \
                        -no-cups \
-                       -iconv \
+                       $(if $(CONFIG_BUILD_NLS),-iconv,-no-iconv) \
                        -evdev \
                        -no-icu \
                        -fontconfig \
@@ -297,9 +331,9 @@ define Build/Configure
                        -no-xcb \
                        -no-eglfs \
                        -no-directfb \
-                       -linuxfb \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb),-linuxfb,-no-linuxfb) \
                        -no-kms \
-                       -qpa minimal \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-minimal),,-qpa minimal) \
                        -xplatform linux-openwrt-g++ \
                        -no-opengl \
                        -no-system-proxies \