1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# qt5base 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunQT5BASE_VERSION = 2ffb7ad8a1079a0444b9c72affe3d19b089b60de 8*4882a593SmuzhiyunQT5BASE_SITE = $(QT5_SITE)/qtbase/-/archive/$(QT5BASE_VERSION) 9*4882a593SmuzhiyunQT5BASE_SOURCE = qtbase-$(QT5BASE_VERSION).tar.bz2 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunQT5BASE_DEPENDENCIES = host-pkgconf pcre2 zlib 12*4882a593SmuzhiyunQT5BASE_INSTALL_STAGING = YES 13*4882a593SmuzhiyunQT5BASE_SYNC_QT_HEADERS = YES 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun# From commits: 16*4882a593Smuzhiyun# 4ce7053a59 "Avoid processing-intensive painting of high number of tiny dashes" 17*4882a593Smuzhiyun# e7ea2ed27c "Improve fix for avoiding huge number of tiny dashes" 18*4882a593SmuzhiyunQT5BASE_IGNORE_CVES += CVE-2021-38593 19*4882a593Smuzhiyun# From commit 2766b2cba6ca4b1c430304df5437e2a6c874b107 "QProcess/Unix: ensure we don't accidentally execute something from CWD" 20*4882a593SmuzhiyunQT5BASE_IGNORE_CVES += CVE-2022-25255 21*4882a593Smuzhiyun# From commit e68ca8e51375d963b2391715f70b42707992dbd8 "Windows: use QSystemLibrary instead of LoadLibrary directly" 22*4882a593SmuzhiyunQT5BASE_IGNORE_CVES += CVE-2022-25634 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun# A few comments: 25*4882a593Smuzhiyun# * -no-pch to workaround the issue described at 26*4882a593Smuzhiyun# http://comments.gmane.org/gmane.comp.lib.qt.devel/5933. 27*4882a593Smuzhiyun# * -system-zlib because zlib is mandatory for Qt build, and we 28*4882a593Smuzhiyun# want to use the Buildroot packaged zlib 29*4882a593Smuzhiyun# * -system-pcre because pcre is mandatory to build Qt, and we 30*4882a593Smuzhiyun# want to use the one packaged in Buildroot 31*4882a593Smuzhiyun# * -no-feature-relocatable to work around path mismatch 32*4882a593Smuzhiyun# while searching qml files and buildroot BR2_ROOTFS_MERGED_USR 33*4882a593Smuzhiyun# feature enabled 34*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += \ 35*4882a593Smuzhiyun -optimized-qmake \ 36*4882a593Smuzhiyun -no-iconv \ 37*4882a593Smuzhiyun -system-zlib \ 38*4882a593Smuzhiyun -system-pcre \ 39*4882a593Smuzhiyun -no-pch \ 40*4882a593Smuzhiyun -shared \ 41*4882a593Smuzhiyun -no-feature-relocatable 42*4882a593Smuzhiyun 43*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_BINUTILS_ENABLE_GOLD),y) 44*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += \ 45*4882a593Smuzhiyun -linker gold 46*4882a593Smuzhiyunendif 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun# starting from version 5.9.0, -optimize-debug is enabled by default 49*4882a593Smuzhiyun# for debug builds and it overrides -O* with -Og which is not what we 50*4882a593Smuzhiyun# want. 51*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-optimize-debug 52*4882a593Smuzhiyun 53*4882a593SmuzhiyunQT5BASE_CFLAGS = $(TARGET_CFLAGS) 54*4882a593SmuzhiyunQT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS) 55*4882a593Smuzhiyun 56*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y) 57*4882a593SmuzhiyunQT5BASE_CFLAGS += -O0 58*4882a593SmuzhiyunQT5BASE_CXXFLAGS += -O0 59*4882a593Smuzhiyunendif 60*4882a593Smuzhiyun 61*4882a593Smuzhiyunifeq ($(BR2_ARM_CPU_HAS_NEON),y) 62*4882a593SmuzhiyunQT5BASE_CFLAGS += -mfpu=neon 63*4882a593Smuzhiyunendif 64*4882a593Smuzhiyun 65*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE2),) 66*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sse2 67*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_SSE3),) 68*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sse3 69*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_SSSE3),) 70*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-ssse3 71*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_SSE4),) 72*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sse4.1 73*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_SSE42),) 74*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sse4.2 75*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_AVX),) 76*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-avx 77*4882a593Smuzhiyunelse ifeq ($(BR2_X86_CPU_HAS_AVX2),) 78*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-avx2 79*4882a593Smuzhiyunelse 80*4882a593Smuzhiyun# no buildroot BR2_X86_CPU_HAS_AVX512 option yet for qt configure 81*4882a593Smuzhiyun# option '-no-avx512' 82*4882a593Smuzhiyunendif 83*4882a593Smuzhiyun 84*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBDRM),y) 85*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -kms 86*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libdrm 87*4882a593Smuzhiyunelse 88*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-kms 89*4882a593Smuzhiyunendif 90*4882a593Smuzhiyun 91*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_HAS_LIBGBM),y) 92*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -gbm 93*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libgbm 94*4882a593Smuzhiyunelse 95*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-gbm 96*4882a593Smuzhiyunendif 97*4882a593Smuzhiyun 98*4882a593Smuzhiyunifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y) 99*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -debug 100*4882a593Smuzhiyunelse 101*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -release 102*4882a593Smuzhiyunendif 103*4882a593Smuzhiyun 104*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -opensource -confirm-license 105*4882a593SmuzhiyunQT5BASE_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception(tools), GFDL-1.3 (docs) 106*4882a593SmuzhiyunQT5BASE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT LICENSE.LGPLv3 LICENSE.FDL 107*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y) 108*4882a593SmuzhiyunQT5BASE_LICENSE += , BSD-3-Clause (examples) 109*4882a593Smuzhiyunendif 110*4882a593Smuzhiyun 111*4882a593SmuzhiyunQT5BASE_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT5BASE_CONFIG_FILE)) 112*4882a593Smuzhiyun 113*4882a593Smuzhiyunifneq ($(QT5BASE_CONFIG_FILE),) 114*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -qconfig buildroot 115*4882a593Smuzhiyunendif 116*4882a593Smuzhiyun 117*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_HAS_UDEV),y) 118*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += udev 119*4882a593Smuzhiyunendif 120*4882a593Smuzhiyun 121*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_CUPS), y) 122*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += cups 123*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -cups 124*4882a593Smuzhiyunelse 125*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-cups 126*4882a593Smuzhiyunendif 127*4882a593Smuzhiyun 128*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZSTD),y) 129*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += zstd 130*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -zstd 131*4882a593Smuzhiyunelse 132*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-zstd 133*4882a593Smuzhiyunendif 134*4882a593Smuzhiyun 135*4882a593Smuzhiyun# Qt5 SQL Plugins 136*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_SQL),y) 137*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_MYSQL),y) 138*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -plugin-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config 139*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += mysql 140*4882a593Smuzhiyunelse 141*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sql-mysql 142*4882a593Smuzhiyunendif 143*4882a593Smuzhiyun 144*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_PSQL),y) 145*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -plugin-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config 146*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += postgresql 147*4882a593Smuzhiyunelse 148*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-sql-psql 149*4882a593Smuzhiyunendif 150*4882a593Smuzhiyun 151*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_QT),-plugin-sql-sqlite) 152*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),-system-sqlite) 153*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),sqlite) 154*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_NONE),-no-sql-sqlite) 155*4882a593Smuzhiyunendif 156*4882a593Smuzhiyun 157*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_GUI),y) 158*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -gui -system-freetype 159*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += freetype 160*4882a593Smuzhiyunelse 161*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-gui -no-freetype 162*4882a593Smuzhiyunendif 163*4882a593Smuzhiyun 164*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_HARFBUZZ),y) 165*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y) 166*4882a593Smuzhiyun# system harfbuzz in case __sync for 4 bytes is supported 167*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -system-harfbuzz 168*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += harfbuzz 169*4882a593Smuzhiyunelse 170*4882a593Smuzhiyun# qt harfbuzz otherwise (using QAtomic instead) 171*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -qt-harfbuzz 172*4882a593SmuzhiyunQT5BASE_LICENSE += , MIT (harfbuzz) 173*4882a593SmuzhiyunQT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING 174*4882a593Smuzhiyunendif 175*4882a593Smuzhiyunelse 176*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-harfbuzz 177*4882a593Smuzhiyunendif 178*4882a593Smuzhiyun 179*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets) 180*4882a593Smuzhiyun# We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb 181*4882a593Smuzhiyun# is to add a link against the "inuxfb" library. 182*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb) 183*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb) 184*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),directfb) 185*4882a593Smuzhiyun 186*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBXKBCOMMON),y) 187*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -xkbcommon 188*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libxkbcommon 189*4882a593Smuzhiyunendif 190*4882a593Smuzhiyun 191*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_XCB),y) 192*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -xcb 193*4882a593Smuzhiyun 194*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += \ 195*4882a593Smuzhiyun libxcb \ 196*4882a593Smuzhiyun xcb-util-wm \ 197*4882a593Smuzhiyun xcb-util-image \ 198*4882a593Smuzhiyun xcb-util-keysyms \ 199*4882a593Smuzhiyun xcb-util-renderutil \ 200*4882a593Smuzhiyun xlib_libX11 201*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y) 202*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += xlib_libXext 203*4882a593Smuzhiyunendif 204*4882a593Smuzhiyunelse 205*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-xcb 206*4882a593Smuzhiyunendif 207*4882a593Smuzhiyun 208*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_DESKTOP),y) 209*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -opengl desktop 210*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libgl 211*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_ES2),y) 212*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -opengl es2 213*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libgles 214*4882a593Smuzhiyunelse 215*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-opengl 216*4882a593Smuzhiyunendif 217*4882a593Smuzhiyun 218*4882a593SmuzhiyunQT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA)) 219*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA)) 220*4882a593Smuzhiyun 221*4882a593Smuzhiyunifeq ($(BR2_arc),y) 222*4882a593Smuzhiyun# In case of -Os (which is default in BR) gcc will use millicode implementation 223*4882a593Smuzhiyun# from libgcc. That along with performance degradation may lead to issues during 224*4882a593Smuzhiyun# linkage stage. In case of QtWebkit exactly that happens - millicode functions 225*4882a593Smuzhiyun# get put way too far from caller functions and so linker fails. 226*4882a593Smuzhiyun# To solve that problem we explicitly disable millicode call generation for Qt. 227*4882a593Smuzhiyun# Also due to some Qt5 libs being really huge (the best example is QtWebKit) 228*4882a593Smuzhiyun# it's good to firce compiler to not assume short or even medium-length calls 229*4882a593Smuzhiyun# could be used. I.e. always use long jump instaructions. 230*4882a593Smuzhiyun# Otherwise there's a high risk of hitting link-time failures. 231*4882a593SmuzhiyunQT5BASE_CFLAGS += -mno-millicode -mlong-calls 232*4882a593Smuzhiyunendif 233*4882a593Smuzhiyun 234*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y) 235*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -eglfs 236*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libegl 237*4882a593Smuzhiyun 238*4882a593Smuzhiyun# Avoid conflict with Rockchip BSP kernel's logo. 239*4882a593Smuzhiyundefine QT5BASE_INSTALL_TARGET_ENV 240*4882a593Smuzhiyun echo "export QT_QPA_EGLFS_ALWAYS_SET_MODE=1" > $(@D)/qt_eglfs.sh 241*4882a593Smuzhiyun $(INSTALL) -D -m 0644 $(@D)/qt_eglfs.sh \ 242*4882a593Smuzhiyun $(TARGET_DIR)/etc/profile.d/qt_eglfs.sh 243*4882a593Smuzhiyunendef 244*4882a593SmuzhiyunQT5BASE_POST_INSTALL_TARGET_HOOKS += QT5BASE_INSTALL_TARGET_ENV 245*4882a593Smuzhiyun 246*4882a593Smuzhiyunelse 247*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-eglfs 248*4882a593Smuzhiyunendif 249*4882a593Smuzhiyun 250*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBOPENSSL),-openssl,-no-openssl) 251*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBOPENSSL),openssl) 252*4882a593Smuzhiyun 253*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),-fontconfig,-no-fontconfig) 254*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),fontconfig) 255*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GIF),,-no-gif) 256*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_JPEG),-system-libjpeg,-no-libjpeg) 257*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_JPEG),jpeg) 258*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_PNG),-system-libpng,-no-libpng) 259*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_PNG),libpng) 260*4882a593Smuzhiyun 261*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DBUS),-dbus,-no-dbus) 262*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DBUS),dbus) 263*4882a593Smuzhiyun 264*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),-tslib,-no-tslib) 265*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),tslib) 266*4882a593Smuzhiyun 267*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBGLIB2),-glib,-no-glib) 268*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBGLIB2),libglib2) 269*4882a593Smuzhiyun 270*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBKRB5),libkrb5) 271*4882a593Smuzhiyun 272*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_ICU),-icu,-no-icu) 273*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu) 274*4882a593Smuzhiyun 275*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples 276*4882a593Smuzhiyun 277*4882a593Smuzhiyun# see qt5base-5.15.2/src/corelib/global/qlogging.cpp:110 - __has_include(<execinfo.h>) 278*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBEXECINFO),y) 279*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libexecinfo 280*4882a593Smuzhiyundefine QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO 281*4882a593Smuzhiyun printf '!host_build { \n LIBS += -lexecinfo\n }' >$(QT5BASE_ARCH_CONFIG_FILE) 282*4882a593Smuzhiyunendef 283*4882a593Smuzhiyunendif 284*4882a593Smuzhiyun 285*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBINPUT),y) 286*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -libinput 287*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libinput 288*4882a593Smuzhiyunelse 289*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-libinput 290*4882a593Smuzhiyunendif 291*4882a593Smuzhiyun 292*4882a593Smuzhiyun# only enable gtk support if libgtk3 X11 backend is enabled 293*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_LIBGTK3_X11),yy) 294*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -gtk 295*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += libgtk3 296*4882a593Smuzhiyunelse 297*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-gtk 298*4882a593Smuzhiyunendif 299*4882a593Smuzhiyun 300*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SYSTEMD),y) 301*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -journald 302*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += systemd 303*4882a593Smuzhiyunelse 304*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-journald 305*4882a593Smuzhiyunendif 306*4882a593Smuzhiyun 307*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_USE_RGA),y) 308*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += \ 309*4882a593Smuzhiyun QMAKE_CXXFLAGS+=-DQT_USE_RGA QMAKE_LFLAGS+=-lrga 310*4882a593SmuzhiyunQT5BASE_DEPENDENCIES += rockchip-rga 311*4882a593Smuzhiyunendif 312*4882a593Smuzhiyun 313*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_LINUXFB_RGB565),y) 314*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += QMAKE_CXXFLAGS+=-DQT_FB_DRM_RGB565 315*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_QT5BASE_LINUXFB_RGB32),y) 316*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += QMAKE_CXXFLAGS+=-DQT_FB_DRM_RGB32 317*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_QT5BASE_LINUXFB_ARGB32),y) 318*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += QMAKE_CXXFLAGS+=-DQT_FB_DRM_ARGB32 319*4882a593Smuzhiyunendif 320*4882a593Smuzhiyun 321*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_LINUXFB_DIRECT_PAINTING),y) 322*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += QMAKE_CXXFLAGS+=-DQT_FB_DIRECT_PAINTING 323*4882a593Smuzhiyunendif 324*4882a593Smuzhiyun 325*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_QT5BASE_SYSLOG),y) 326*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -syslog 327*4882a593Smuzhiyunelse 328*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -no-syslog 329*4882a593Smuzhiyunendif 330*4882a593Smuzhiyun 331*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y) 332*4882a593Smuzhiyun# use vivante backend 333*4882a593SmuzhiyunQT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv 334*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_SUNXI_MALI_UTGARD),y) 335*4882a593Smuzhiyun# use mali backend 336*4882a593SmuzhiyunQT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_mali 337*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_ROCKCHIP_MALI),y) 338*4882a593Smuzhiyun# use kms backend 339*4882a593SmuzhiyunQT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_kms 340*4882a593Smuzhiyunendif 341*4882a593Smuzhiyun 342*4882a593Smuzhiyunifneq ($(QT5BASE_CONFIG_FILE),) 343*4882a593Smuzhiyundefine QT5BASE_CONFIGURE_CONFIG_FILE 344*4882a593Smuzhiyun cp $(QT5BASE_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h 345*4882a593Smuzhiyunendef 346*4882a593Smuzhiyunendif 347*4882a593Smuzhiyun 348*4882a593SmuzhiyunQT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf 349*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) 350*4882a593Smuzhiyun# Qt 5.8 needs atomics, which on various architectures are in -latomic 351*4882a593Smuzhiyundefine QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC 352*4882a593Smuzhiyun printf '!host_build { \n LIBS += -latomic\n }' >$(QT5BASE_ARCH_CONFIG_FILE) 353*4882a593Smuzhiyunendef 354*4882a593Smuzhiyunendif 355*4882a593Smuzhiyun 356*4882a593Smuzhiyun# This allows to use ccache when available 357*4882a593Smuzhiyunifeq ($(BR2_CCACHE),y) 358*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += -ccache 359*4882a593Smuzhiyunendif 360*4882a593Smuzhiyun 361*4882a593Smuzhiyun# Ensure HOSTCC/CXX is used 362*4882a593Smuzhiyundefine QT5BASE_CONFIGURE_HOSTCC 363*4882a593Smuzhiyun $(SED) 's,^QMAKE_CC\s*=.*,QMAKE_CC = $(HOSTCC_NOCCACHE),' $(@D)/mkspecs/common/g++-base.conf 364*4882a593Smuzhiyun $(SED) 's,^QMAKE_CXX\s*=.*,QMAKE_CXX = $(HOSTCXX_NOCCACHE),' $(@D)/mkspecs/common/g++-base.conf 365*4882a593Smuzhiyunendef 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun# Must be last so can override all options set by Buildroot 368*4882a593SmuzhiyunQT5BASE_CONFIGURE_OPTS += $(call qstrip,$(BR2_PACKAGE_QT5BASE_CUSTOM_CONF_OPTS)) 369*4882a593Smuzhiyun 370*4882a593Smuzhiyundefine QT5BASE_CONFIGURE_CMDS 371*4882a593Smuzhiyun mkdir -p $(@D)/mkspecs/devices/linux-buildroot-g++/ 372*4882a593Smuzhiyun sed 's/@EGLFS_DEVICE@/$(QT5BASE_EGLFS_DEVICE)/g' \ 373*4882a593Smuzhiyun $(QT5BASE_PKGDIR)/qmake.conf.in > \ 374*4882a593Smuzhiyun $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf 375*4882a593Smuzhiyun $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \ 376*4882a593Smuzhiyun $(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h 377*4882a593Smuzhiyun $(QT5BASE_CONFIGURE_CONFIG_FILE) 378*4882a593Smuzhiyun touch $(QT5BASE_ARCH_CONFIG_FILE) 379*4882a593Smuzhiyun $(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC) 380*4882a593Smuzhiyun $(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO) 381*4882a593Smuzhiyun $(QT5BASE_CONFIGURE_HOSTCC) 382*4882a593Smuzhiyun (cd $(@D); \ 383*4882a593Smuzhiyun $(TARGET_MAKE_ENV) \ 384*4882a593Smuzhiyun PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ 385*4882a593Smuzhiyun MAKEFLAGS="-j$(PARALLEL_JOBS) $(MAKEFLAGS)" \ 386*4882a593Smuzhiyun ./configure \ 387*4882a593Smuzhiyun -v \ 388*4882a593Smuzhiyun -prefix /usr \ 389*4882a593Smuzhiyun -hostprefix $(HOST_DIR) \ 390*4882a593Smuzhiyun -headerdir /usr/include/qt5 \ 391*4882a593Smuzhiyun -sysroot $(STAGING_DIR) \ 392*4882a593Smuzhiyun -plugindir /usr/lib/qt/plugins \ 393*4882a593Smuzhiyun -examplesdir /usr/lib/qt/examples \ 394*4882a593Smuzhiyun -no-rpath \ 395*4882a593Smuzhiyun -nomake tests \ 396*4882a593Smuzhiyun -device buildroot \ 397*4882a593Smuzhiyun -device-option CROSS_COMPILE="$(TARGET_CROSS)" \ 398*4882a593Smuzhiyun -device-option BR_COMPILER_CFLAGS="$(QT5BASE_CFLAGS)" \ 399*4882a593Smuzhiyun -device-option BR_COMPILER_CXXFLAGS="$(QT5BASE_CXXFLAGS)" \ 400*4882a593Smuzhiyun $(QT5BASE_CONFIGURE_OPTS) \ 401*4882a593Smuzhiyun ) 402*4882a593Smuzhiyunendef 403*4882a593Smuzhiyun 404*4882a593SmuzhiyunQT5BASE_POST_INSTALL_STAGING_HOOKS += QT5_INSTALL_QT_CONF 405*4882a593Smuzhiyun 406*4882a593Smuzhiyun$(eval $(qmake-package)) 407