qt6base.mk 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. ################################################################################
  2. #
  3. # qt6base
  4. #
  5. ################################################################################
  6. QT6BASE_VERSION = $(QT6_VERSION)
  7. QT6BASE_SITE = $(QT6_SITE)
  8. QT6BASE_SOURCE = qtbase-$(QT6_SOURCE_TARBALL_PREFIX)-$(QT6BASE_VERSION).tar.xz
  9. QT6BASE_CPE_ID_VENDOR = qt
  10. QT6BASE_CPE_ID_PRODUCT = qt
  11. QT6BASE_CMAKE_BACKEND = ninja
  12. QT6BASE_LICENSE = \
  13. GPL-2.0+ or LGPL-3.0, \
  14. GPL-3.0 with exception (tools), \
  15. GFDL-1.3 (docs), \
  16. Apache-2.0, \
  17. BSD-3-Clause, \
  18. BSL-1.0, \
  19. MIT
  20. QT6BASE_LICENSE_FILES = \
  21. LICENSES/Apache-2.0.txt \
  22. LICENSES/BSD-3-Clause.txt \
  23. LICENSES/BSL-1.0.txt \
  24. LICENSES/GFDL-1.3-no-invariants-only.txt \
  25. LICENSES/GPL-2.0-only.txt \
  26. LICENSES/GPL-3.0-only.txt \
  27. LICENSES/LGPL-3.0-only.txt \
  28. LICENSES/MIT.txt \
  29. LICENSES/Qt-GPL-exception-1.0.txt
  30. QT6BASE_DEPENDENCIES = \
  31. host-qt6base \
  32. double-conversion \
  33. libb2 \
  34. pcre2 \
  35. zlib
  36. QT6BASE_INSTALL_STAGING = YES
  37. QT6BASE_CONF_OPTS = \
  38. -DQT_HOST_PATH=$(HOST_DIR) \
  39. -DINSTALL_ARCHDATADIR=lib/qt6 \
  40. -DFEATURE_xml=OFF \
  41. -DFEATURE_sql=OFF \
  42. -DFEATURE_testlib=OFF \
  43. -DFEATURE_network=OFF \
  44. -DFEATURE_dbus=OFF \
  45. -DFEATURE_icu=OFF \
  46. -DFEATURE_glib=OFF \
  47. -DFEATURE_system_doubleconversion=ON \
  48. -DFEATURE_system_pcre2=ON \
  49. -DFEATURE_system_zlib=ON \
  50. -DFEATURE_system_libb2=ON
  51. # x86 optimization options. While we have a BR2_X86_CPU_HAS_AVX512, it
  52. # is not clear yet how it maps to all the avx512* options of Qt, so we
  53. # for now keeps them disabled.
  54. QT6BASE_CONF_OPTS += \
  55. -DFEATURE_sse2=$(if $(BR2_X86_CPU_HAS_SSE2),ON,OFF) \
  56. -DFEATURE_sse3=$(if $(BR2_X86_CPU_HAS_SSE3),ON,OFF) \
  57. -DFEATURE_sse4_1=$(if $(BR2_X86_CPU_HAS_SSE4),ON,OFF) \
  58. -DFEATURE_sse4_2=$(if $(BR2_X86_CPU_HAS_SSE42),ON,OFF) \
  59. -DFEATURE_ssse3=$(if $(BR2_X86_CPU_HAS_SSSE3),ON,OFF) \
  60. -DFEATURE_avx=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
  61. -DFEATURE_avx2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
  62. -DFEATURE_avx512bw=OFF \
  63. -DFEATURE_avx512cd=OFF \
  64. -DFEATURE_avx512dq=OFF \
  65. -DFEATURE_avx512er=OFF \
  66. -DFEATURE_avx512f=OFF \
  67. -DFEATURE_avx512ifma=OFF \
  68. -DFEATURE_avx512pf=OFF \
  69. -DFEATURE_avx512vbmi=OFF \
  70. -DFEATURE_avx512vbmi2=OFF \
  71. -DFEATURE_avx512vl=OFF \
  72. -DFEATURE_vaes=OFF
  73. HOST_QT6BASE_DEPENDENCIES = \
  74. host-double-conversion \
  75. host-libb2 \
  76. host-pcre2 \
  77. host-zlib
  78. HOST_QT6BASE_CONF_OPTS = \
  79. -DFEATURE_concurrent=OFF \
  80. -DFEATURE_xml=ON \
  81. -DFEATURE_dbus=OFF \
  82. -DFEATURE_icu=OFF \
  83. -DFEATURE_glib=OFF \
  84. -DFEATURE_system_doubleconversion=ON \
  85. -DFEATURE_system_libb2=ON \
  86. -DFEATURE_system_pcre2=ON \
  87. -DFEATURE_system_zlib=ON
  88. # We need host-qt6base with Gui support when building host-qt6shadertools,
  89. # otherwise the build is skipped and no qsb host tool is generated.
  90. # qt6shadertools fail to build if qsb is not available.
  91. ifeq ($(BR2_PACKAGE_HOST_QT6BASE_GUI),y)
  92. HOST_QT6BASE_CONF_OPTS += \
  93. -DFEATURE_gui=ON \
  94. -DFEATURE_freetype=OFF \
  95. -DFEATURE_vulkan=OFF \
  96. -DFEATURE_linuxfb=ON \
  97. -DFEATURE_xcb=OFF \
  98. -DFEATURE_opengl=OFF -DINPUT_opengl=no \
  99. -DFEATURE_harfbuzz=OFF \
  100. -DFEATURE_png=OFF \
  101. -DFEATURE_gif=OFF \
  102. -DFEATURE_jpeg=OFF \
  103. -DFEATURE_printsupport=OFF \
  104. -DFEATURE_kms=OFF \
  105. -DFEATURE_fontconfig=OFF \
  106. -DFEATURE_widgets=OFF \
  107. -DFEATURE_libinput=OFF \
  108. -DFEATURE_tslib=OFF \
  109. -DFEATURE_eglfs=OFF
  110. else
  111. HOST_QT6BASE_CONF_OPTS += -DFEATURE_gui=OFF
  112. endif
  113. # The Network module is explicitly required by qt6tools.
  114. ifeq ($(BR2_PACKAGE_HOST_QT6BASE_NETWORK),y)
  115. HOST_QT6BASE_CONF_OPTS += -DFEATURE_network=ON
  116. else
  117. HOST_QT6BASE_CONF_OPTS += -DFEATURE_network=OFF
  118. endif
  119. # We need host qt6base with Sql support for host-qt6tools to generate the
  120. # qhelpgenerator host tool. qt6tools will fail to build if qhelpgenerator is not
  121. # available.
  122. ifeq ($(BR2_PACKAGE_HOST_QT6BASE_SQL),y)
  123. HOST_QT6BASE_CONF_OPTS += -DFEATURE_sql=ON
  124. else
  125. HOST_QT6BASE_CONF_OPTS += -DFEATURE_sql=OFF
  126. endif
  127. # We need host-qt6base with Testlib support when building host-qt6declarative
  128. # with QuickTest support. QuickTest support is further required for building the
  129. # qmltestrunner host tool. qt6declarative will fail to build if qmltestrunner is
  130. # not available.
  131. ifeq ($(BR2_PACKAGE_HOST_QT6BASE_TEST),y)
  132. HOST_QT6BASE_CONF_OPTS += -DFEATURE_testlib=ON
  133. else
  134. HOST_QT6BASE_CONF_OPTS += -DFEATURE_testlib=OFF
  135. endif
  136. # Conditional blocks below are ordered by alphabetic ordering of the
  137. # BR2_PACKAGE_* option.
  138. ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
  139. QT6BASE_CONF_OPTS += -DFEATURE_libudev=ON
  140. QT6BASE_DEPENDENCIES += udev
  141. else
  142. QT6BASE_CONF_OPTS += -DFEATURE_libudev=OFF
  143. endif
  144. ifeq ($(BR2_PACKAGE_ICU),y)
  145. QT6BASE_CONF_OPTS += -DFEATURE_icu=ON
  146. QT6BASE_DEPENDENCIES += icu
  147. else
  148. QT6BASE_CONF_OPTS += -DFEATURE_icu=OFF
  149. endif
  150. ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
  151. QT6BASE_CONF_OPTS += -DFEATURE_glib=ON
  152. QT6BASE_DEPENDENCIES += libglib2
  153. else
  154. QT6BASE_CONF_OPTS += -DFEATURE_glib=OFF
  155. endif
  156. ifeq ($(BR2_PACKAGE_QT6BASE_GUI),y)
  157. QT6BASE_CONF_OPTS += \
  158. -DFEATURE_gui=ON \
  159. -DFEATURE_freetype=ON \
  160. -DFEATURE_vulkan=OFF
  161. QT6BASE_DEPENDENCIES += freetype
  162. ifeq ($(BR2_PACKAGE_QT6BASE_VULKAN),y)
  163. QT6BASE_DEPENDENCIES += vulkan-headers vulkan-loader
  164. QT6BASE_CONFIGURE_OPTS += -DFEATURE_vulkan=ON
  165. else
  166. QT6BASE_CONFIGURE_OPTS += -DFEATURE_vulkan=OFF
  167. endif
  168. ifeq ($(BR2_PACKAGE_QT6BASE_LINUXFB),y)
  169. QT6BASE_CONF_OPTS += -DFEATURE_linuxfb=ON
  170. else
  171. QT6BASE_CONF_OPTS += -DFEATURE_linuxfb=OFF
  172. endif
  173. ifeq ($(BR2_PACKAGE_QT6BASE_XCB),y)
  174. QT6BASE_CONF_OPTS += \
  175. -DFEATURE_xcb=ON \
  176. -DFEATURE_xcb_xlib=ON \
  177. -DFEATURE_xkbcommon=ON \
  178. -DFEATURE_xkbcommon_x11=ON
  179. QT6BASE_DEPENDENCIES += \
  180. libxcb \
  181. libxkbcommon \
  182. xcb-util-wm \
  183. xcb-util-image \
  184. xcb-util-keysyms \
  185. xcb-util-renderutil \
  186. xlib_libX11
  187. else
  188. QT6BASE_CONF_OPTS += -DFEATURE_xcb=OFF
  189. endif
  190. ifeq ($(BR2_PACKAGE_QT6BASE_HARFBUZZ),y)
  191. QT6BASE_CONF_OPTS += -DFEATURE_harfbuzz=ON
  192. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y)
  193. # system harfbuzz in case __sync for 4 bytes is supported
  194. QT6BASE_CONF_OPTS += -DQT_USE_BUNDLED_BundledHarfbuzz=OFF
  195. QT6BASE_DEPENDENCIES += harfbuzz
  196. else #BR2_TOOLCHAIN_HAS_SYNC_4
  197. # qt harfbuzz otherwise (using QAtomic instead)
  198. QT6BASE_CONF_OPTS += -DQT_USE_BUNDLED_BundledHarfbuzz=ON
  199. QT6BASE_LICENSE += , MIT (harfbuzz)
  200. QT6BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
  201. endif
  202. else
  203. QT6BASE_CONF_OPTS += -DFEATURE_harfbuzz=OFF
  204. endif
  205. ifeq ($(BR2_PACKAGE_QT6BASE_PNG),y)
  206. QT6BASE_CONF_OPTS += -DFEATURE_png=ON -DFEATURE_system_png=ON
  207. QT6BASE_DEPENDENCIES += libpng
  208. else
  209. QT6BASE_CONF_OPTS += -DFEATURE_png=OFF
  210. endif
  211. ifeq ($(BR2_PACKAGE_QT6BASE_GIF),y)
  212. QT6BASE_CONF_OPTS += -DFEATURE_gif=ON
  213. else
  214. QT6BASE_CONF_OPTS += -DFEATURE_gif=OFF
  215. endif
  216. ifeq ($(BR2_PACKAGE_QT6BASE_JPEG),y)
  217. QT6BASE_CONF_OPTS += -DFEATURE_jpeg=ON
  218. QT6BASE_DEPENDENCIES += jpeg
  219. else
  220. QT6BASE_CONF_OPTS += -DFEATURE_jpeg=OFF
  221. endif
  222. ifeq ($(BR2_PACKAGE_QT6BASE_PRINTSUPPORT),y)
  223. QT6BASE_CONF_OPTS += -DFEATURE_printsupport=ON
  224. ifeq ($(BR2_PACKAGE_CUPS),y)
  225. QT6BASE_CONF_OPTS += -DFEATURE_cups=ON
  226. QT6BASE_DEPENDENCIES += cups
  227. else
  228. QT6BASE_CONF_OPTS += -DFEATURE_cups=OFF
  229. endif
  230. else
  231. QT6BASE_CONF_OPTS += -DFEATURE_printsupport=OFF
  232. endif
  233. ifeq ($(BR2_PACKAGE_LIBDRM),y)
  234. QT6BASE_CONF_OPTS += -DFEATURE_kms=ON
  235. QT6BASE_DEPENDENCIES += libdrm
  236. else
  237. QT6BASE_CONF_OPTS += -DFEATURE_kms=OFF
  238. endif
  239. ifeq ($(BR2_PACKAGE_QT6BASE_FONTCONFIG),y)
  240. QT6BASE_CONF_OPTS += -DFEATURE_fontconfig=ON
  241. QT6BASE_DEPENDENCIES += fontconfig
  242. else
  243. QT6BASE_CONF_OPTS += -DFEATURE_fontconfig=OFF
  244. endif
  245. ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS),y)
  246. QT6BASE_CONF_OPTS += -DFEATURE_widgets=ON
  247. # only enable gtk support if libgtk3 X11 backend is enabled
  248. ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_LIBGTK3_X11),yy)
  249. QT6BASE_CONF_OPTS += -DFEATURE_gtk3=ON
  250. QT6BASE_DEPENDENCIES += libgtk3
  251. else
  252. QT6BASE_CONF_OPTS += -DFEATURE_gtk3=OFF
  253. endif
  254. else
  255. QT6BASE_CONF_OPTS += -DFEATURE_widgets=OFF
  256. endif
  257. ifeq ($(BR2_PACKAGE_LIBINPUT),y)
  258. QT6BASE_CONF_OPTS += -DFEATURE_libinput=ON
  259. QT6BASE_DEPENDENCIES += libinput
  260. else
  261. QT6BASE_CONF_OPTS += -DFEATURE_libinput=OFF
  262. endif
  263. ifeq ($(BR2_PACKAGE_QT6BASE_TSLIB),y)
  264. QT6BASE_CONF_OPTS += -DFEATURE_tslib=ON
  265. QT6BASE_DEPENDENCIES += tslib
  266. else
  267. QT6BASE_CONF_OPTS += -DFEATURE_tslib=OFF
  268. endif
  269. ifeq ($(BR2_PACKAGE_QT6BASE_EGLFS),y)
  270. QT6BASE_CONF_OPTS += -DFEATURE_egl=ON -DFEATURE_eglfs=ON
  271. QT6BASE_DEPENDENCIES += libegl libgbm
  272. else
  273. QT6BASE_CONF_OPTS += -DFEATURE_eglfs=OFF
  274. endif
  275. ifeq ($(BR2_PACKAGE_QT6BASE_OPENGL_DESKTOP),y)
  276. QT6BASE_CONF_OPTS += \
  277. -DFEATURE_opengl=ON \
  278. -DFEATURE_opengl_desktop=ON
  279. QT6BASE_DEPENDENCIES += libgl
  280. else ifeq ($(BR2_PACKAGE_QT6BASE_OPENGL_ES2),y)
  281. QT6BASE_CONF_OPTS += \
  282. -DFEATURE_opengl=ON \
  283. -DFEATURE_opengles2=ON \
  284. -DFEATURE_opengl_desktop=OFF
  285. QT6BASE_DEPENDENCIES += libgles
  286. else
  287. QT6BASE_CONF_OPTS += -DFEATURE_opengl=OFF -DINPUT_opengl=no
  288. endif
  289. else
  290. QT6BASE_CONF_OPTS += -DFEATURE_gui=OFF
  291. endif
  292. QT6BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT6BASE_DEFAULT_QPA))
  293. QT6BASE_CONF_OPTS += $(if $(QT6BASE_DEFAULT_QPA),-DQT_QPA_DEFAULT_PLATFORM=$(QT6BASE_DEFAULT_QPA))
  294. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  295. QT6BASE_CONF_OPTS += -DINPUT_openssl=yes
  296. QT6BASE_DEPENDENCIES += openssl
  297. else
  298. QT6BASE_CONF_OPTS += -DINPUT_openssl=no
  299. endif
  300. ifeq ($(BR2_PACKAGE_QT6BASE_CONCURRENT),y)
  301. QT6BASE_CONF_OPTS += -DFEATURE_concurrent=ON
  302. else
  303. QT6BASE_CONF_OPTS += -DFEATURE_concurrent=OFF
  304. endif
  305. # We need host-qt6base with D-Bus support, otherwise: "the tool
  306. # "Qt6::qdbuscpp2xml" was not found in the Qt6DBusTools package."
  307. ifeq ($(BR2_PACKAGE_QT6BASE_DBUS),y)
  308. QT6BASE_CONF_OPTS += -DFEATURE_dbus=ON -DINPUT_dbus=linked
  309. QT6BASE_DEPENDENCIES += dbus
  310. HOST_QT6BASE_CONF_OPTS += -DFEATURE_dbus=ON
  311. HOST_QT6BASE_DEPENDENCIES += host-dbus
  312. else
  313. QT6BASE_CONF_OPTS += -DFEATURE_dbus=OFF
  314. HOST_QT6BASE_CONF_OPTS += -DFEATURE_dbus=OFF
  315. endif
  316. ifeq ($(BR2_PACKAGE_QT6BASE_NETWORK),y)
  317. QT6BASE_CONF_OPTS += -DFEATURE_network=ON
  318. else
  319. QT6BASE_CONF_OPTS += -DFEATURE_network=OFF
  320. endif
  321. # Qt6 SQL Plugins
  322. ifeq ($(BR2_PACKAGE_QT6BASE_SQL),y)
  323. QT6BASE_CONF_OPTS += -DFEATURE_sql=ON
  324. QT6BASE_CONF_OPTS += -DFEATURE_sql_db2=OFF -DFEATURE_sql_ibase=OFF -DFEATURE_sql_oci=OFF -DFEATURE_sql_odbc=OFF
  325. ifeq ($(BR2_PACKAGE_QT6BASE_MYSQL),y)
  326. QT6BASE_CONF_OPTS += -DFEATURE_sql_mysql=ON
  327. QT6BASE_DEPENDENCIES += mariadb
  328. else
  329. QT6BASE_CONF_OPTS += -DFEATURE_sql_mysql=OFF
  330. endif
  331. ifeq ($(BR2_PACKAGE_QT6BASE_PSQL),y)
  332. QT6BASE_CONF_OPTS += -DFEATURE_sql_psql=ON
  333. QT6BASE_DEPENDENCIES += postgresql
  334. else
  335. QT6BASE_CONF_OPTS += -DFEATURE_sql_psql=OFF
  336. endif
  337. ifeq ($(BR2_PACKAGE_QT6BASE_SQLITE),y)
  338. QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=ON
  339. QT6BASE_DEPENDENCIES += sqlite
  340. else
  341. QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=OFF
  342. endif
  343. else
  344. QT6BASE_CONF_OPTS += -DFEATURE_sql=OFF
  345. endif
  346. ifeq ($(BR2_PACKAGE_QT6BASE_SYSLOG),y)
  347. QT6BASE_CONF_OPTS += -DFEATURE_syslog=ON
  348. else
  349. QT6BASE_CONF_OPTS += -DFEATURE_syslog=OFF
  350. endif
  351. ifeq ($(BR2_PACKAGE_SYSTEMD),y)
  352. QT6BASE_CONF_OPTS += -DFEATURE_journald=ON
  353. QT6BASE_DEPENDENCIES += systemd
  354. else
  355. QT6BASE_CONF_OPTS += -DFEATURE_journald=OFF
  356. endif
  357. ifeq ($(BR2_PACKAGE_QT6BASE_TEST),y)
  358. QT6BASE_CONF_OPTS += -DFEATURE_testlib=ON
  359. else
  360. QT6BASE_CONF_OPTS += -DFEATURE_testlib=OFF
  361. endif
  362. ifeq ($(BR2_PACKAGE_QT6BASE_XML),y)
  363. QT6BASE_CONF_OPTS += -DFEATURE_xml=ON
  364. else
  365. QT6BASE_CONF_OPTS += -DFEATURE_xml=OFF
  366. endif
  367. ifeq ($(BR2_PACKAGE_ZSTD),y)
  368. QT6BASE_CONF_OPTS += -DFEATURE_zstd=ON
  369. QT6BASE_DEPENDENCIES += zstd
  370. else
  371. QT6BASE_CONF_OPTS += -DFEATURE_zstd=OFF
  372. endif
  373. define QT6BASE_RM_USR_MKSPECS
  374. $(Q)rm -rf $(TARGET_DIR)/usr/mkspecs
  375. endef
  376. QT6BASE_TARGET_FINALIZE_HOOKS += QT6BASE_RM_USR_MKSPECS
  377. $(eval $(cmake-package))
  378. $(eval $(host-cmake-package))