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