harfbuzz: security bump to version 1.4.4
[buildroot-gz.git] / package / qt / qt.mk
blob29dcc46b7b793d530dfdbd5ba4dc70140d5d9d19
1 ################################################################################
3 # Qt Embedded for Linux
5 # This makefile was originally composed by Thomas Lundquist <thomasez@zelow.no>
6 # Later heavily modified by buildroot developers
8 # BTW, this uses alot of FPU calls and it's pretty slow if you use
9 # the kernels FPU emulation so it's better to choose soft float in the
10 # buildroot config (and uClibc.config of course, if you have your own.)
12 ################################################################################
14 QT_VERSION_MAJOR = 4.8
15 QT_VERSION = $(QT_VERSION_MAJOR).7
16 QT_SOURCE = qt-everywhere-opensource-src-$(QT_VERSION).tar.gz
17 QT_SITE = http://download.qt-project.org/official_releases/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION)
18 # Patch fixing ALSA detection. Taken from Qt5, but applies fine to
19 # Qt4.
20 QT_PATCH = https://github.com/qtproject/qtbase/commit/b8f98d956501dfa4ce03a137f15d404930a56066.patch
21 QT_DEPENDENCIES = host-pkgconf
22 QT_INSTALL_STAGING = YES
24 QT_LICENSE := LGPLv2.1 with exceptions or GPLv3
25 ifneq ($(BR2_PACKAGE_QT_LICENSE_APPROVED),y)
26 QT_LICENSE := $(QT_LICENSE) or Digia Qt Commercial license
27 endif
28 QT_LICENSE_FILES = LICENSE.LGPL LGPL_EXCEPTION.txt LICENSE.GPL3
30 ifeq ($(BR2_PACKAGE_QT_LICENSE_APPROVED),y)
31 QT_CONFIGURE_OPTS += -opensource -confirm-license
32 endif
34 QT_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT_CONFIG_FILE))
36 ifneq ($(QT_CONFIG_FILE),)
37 QT_CONFIGURE_OPTS += -qconfig buildroot
38 endif
40 QT_CFLAGS = $(TARGET_CFLAGS)
41 QT_CXXFLAGS = $(TARGET_CXXFLAGS)
42 QT_LDFLAGS = $(TARGET_LDFLAGS)
44 # Qt WebKit build fails when gcc-6 is used for build, because
45 # 'std::auto_ptr' is deprecated starting from gcc 6.x. So, we have to
46 # use an older c++ standard to prevent build failure
47 QT_CXXFLAGS += -std=gnu++98
49 # Qt has some assembly function that are not present in thumb1 mode:
50 # Error: selected processor does not support Thumb mode `swp r3,r7,[r4]'
51 # so, we desactivate thumb mode
52 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
53 QT_CFLAGS += -marm
54 QT_CXXFLAGS += -marm
55 endif
57 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
58 QT_CONFIGURE_OPTS += -qt3support
59 else
60 QT_CONFIGURE_OPTS += -no-qt3support
61 endif
63 ifeq ($(BR2_PACKAGE_QT_DEMOS),y)
64 QT_CONFIGURE_OPTS += -demosdir $(TARGET_DIR)/usr/share/qt/demos
65 else
66 QT_CONFIGURE_OPTS += -nomake demos
67 endif
68 ifeq ($(BR2_PACKAGE_QT_EXAMPLES),y)
69 QT_CONFIGURE_OPTS += -examplesdir $(TARGET_DIR)/usr/share/qt/examples
70 else
71 QT_CONFIGURE_OPTS += -nomake examples
72 endif
74 # ensure glib is built first if enabled for Qt's glib support
75 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
76 QT_CONFIGURE_OPTS += -glib
77 QT_DEPENDENCIES += libglib2
78 else
79 QT_CONFIGURE_OPTS += -no-glib
80 endif
83 ### Pixel depths
84 QT_PIXEL_DEPTHS = # empty
85 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_1),y)
86 QT_PIXEL_DEPTHS += 1
87 endif
88 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_4),y)
89 QT_PIXEL_DEPTHS += 4
90 endif
91 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_8),y)
92 QT_PIXEL_DEPTHS += 8
93 endif
94 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_12),y)
95 QT_PIXEL_DEPTHS += 12
96 endif
97 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_15),y)
98 QT_PIXEL_DEPTHS += 15
99 endif
100 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_16),y)
101 QT_PIXEL_DEPTHS += 16
102 endif
103 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_18),y)
104 QT_PIXEL_DEPTHS += 18
105 endif
106 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_24),y)
107 QT_PIXEL_DEPTHS += 24
108 endif
109 ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_32),y)
110 QT_PIXEL_DEPTHS += 32
111 endif
112 ifneq ($(QT_PIXEL_DEPTHS),)
113 QT_CONFIGURE_OPTS += -depths $(subst $(space),$(comma),$(strip $(QT_PIXEL_DEPTHS)))
114 endif
116 ### Display drivers
117 ifeq ($(BR2_PACKAGE_QT_GFX_LINUXFB),y)
118 QT_CONFIGURE_OPTS += -qt-gfx-linuxfb
119 else
120 QT_CONFIGURE_OPTS += -no-gfx-linuxfb
121 endif
122 ifeq ($(BR2_PACKAGE_QT_GFX_TRANSFORMED),y)
123 QT_CONFIGURE_OPTS += -qt-gfx-transformed
124 else
125 QT_CONFIGURE_OPTS += -no-gfx-transformed
126 endif
127 ifeq ($(BR2_PACKAGE_QT_GFX_QVFB),y)
128 QT_CONFIGURE_OPTS += -qt-gfx-qvfb
129 else
130 QT_CONFIGURE_OPTS += -no-gfx-qvfb
131 endif
132 ifeq ($(BR2_PACKAGE_QT_GFX_VNC),y)
133 QT_CONFIGURE_OPTS += -qt-gfx-vnc
134 else
135 QT_CONFIGURE_OPTS += -no-gfx-vnc
136 endif
137 ifeq ($(BR2_PACKAGE_QT_GFX_MULTISCREEN),y)
138 QT_CONFIGURE_OPTS += -qt-gfx-multiscreen
139 else
140 QT_CONFIGURE_OPTS += -no-gfx-multiscreen
141 endif
142 ifeq ($(BR2_PACKAGE_QT_GFX_DIRECTFB),y)
143 QT_CONFIGURE_OPTS += -qt-gfx-directfb
144 QT_DEPENDENCIES += directfb
145 else
146 QT_CONFIGURE_OPTS += -no-gfx-directfb
147 endif
148 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
149 QT_CONFIGURE_OPTS += \
150 -plugin-gfx-powervr -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT
151 QT_DEPENDENCIES += powervr
152 endif
154 ### Mouse drivers
155 ifeq ($(BR2_PACKAGE_QT_MOUSE_PC),y)
156 QT_CONFIGURE_OPTS += -qt-mouse-pc
157 else
158 QT_CONFIGURE_OPTS += -no-mouse-pc
159 endif
160 ifeq ($(BR2_PACKAGE_QT_MOUSE_LINUXTP),y)
161 QT_CONFIGURE_OPTS += -qt-mouse-linuxtp
162 else
163 QT_CONFIGURE_OPTS += -no-mouse-linuxtp
164 endif
165 ifeq ($(BR2_PACKAGE_QT_MOUSE_LINUXINPUT),y)
166 QT_CONFIGURE_OPTS += -qt-mouse-linuxinput
167 else
168 QT_CONFIGURE_OPTS += -no-mouse-linuxinput
169 endif
170 ifeq ($(BR2_PACKAGE_QT_MOUSE_TSLIB),y)
171 QT_CONFIGURE_OPTS += -qt-mouse-tslib
172 QT_DEPENDENCIES += tslib
173 else
174 QT_CONFIGURE_OPTS += -no-mouse-tslib
175 endif
176 ifeq ($(BR2_PACKAGE_QT_MOUSE_QVFB),y)
177 QT_CONFIGURE_OPTS += -qt-mouse-qvfb
178 else
179 QT_CONFIGURE_OPTS += -no-mouse-qvfb
180 endif
181 ifeq ($(BR2_PACKAGE_QT_MOUSE_NO_QWS_CURSOR),y)
182 QT_CONFIGURE_OPTS += -D QT_NO_QWS_CURSOR
183 endif
185 ### Keyboard drivers
186 ifeq ($(BR2_PACKAGE_QT_KEYBOARD_TTY),y)
187 QT_CONFIGURE_OPTS += -qt-kbd-tty
188 else
189 QT_CONFIGURE_OPTS += -no-kbd-tty
190 endif
191 ifeq ($(BR2_PACKAGE_QT_KEYBOARD_LINUXINPUT),y)
192 QT_CONFIGURE_OPTS += -qt-kbd-linuxinput
193 else
194 QT_CONFIGURE_OPTS += -no-kbd-linuxinput
195 endif
196 ifeq ($(BR2_PACKAGE_QT_KEYBOARD_QVFB),y)
197 QT_CONFIGURE_OPTS += -qt-kbd-qvfb
198 else
199 QT_CONFIGURE_OPTS += -no-kbd-qvfb
200 endif
202 ifeq ($(BR2_PACKAGE_QT_DEBUG),y)
203 QT_CONFIGURE_OPTS += -debug
204 else
205 QT_CONFIGURE_OPTS += -release
206 endif
208 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
209 QT_CONFIGURE_OPTS += -shared
210 else
211 QT_CONFIGURE_OPTS += -static
212 endif
214 ifeq ($(BR2_STATIC_LIBS),y)
215 QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
216 endif
218 ifeq ($(BR2_ENDIAN),"LITTLE")
219 QT_CONFIGURE_OPTS += -little-endian
220 else
221 QT_CONFIGURE_OPTS += -big-endian
222 endif
224 ifeq ($(BR2_arm)$(BR2_armeb),y)
225 QT_EMB_PLATFORM = arm
226 else ifeq ($(BR2_i386),y)
227 QT_EMB_PLATFORM = x86
228 else ifeq ($(BR2_x86_64),y)
229 QT_EMB_PLATFORM = x86_64
230 else ifeq ($(BR2_mips)$(BR2_mipsel),y)
231 QT_EMB_PLATFORM = mips
232 else ifeq ($(BR2_powerpc),y)
233 QT_EMB_PLATFORM = powerpc
234 else ifeq ($(BR2_sh4)$(BR2_sh4eb)$(BR2_sh4a)$(BR2_sh4aeb),y)
235 QT_EMB_PLATFORM = sh
236 else
237 QT_EMB_PLATFORM = generic
238 endif
240 ifeq ($(BR2_PACKAGE_QT_X11),y)
241 QT_DEPENDENCIES += fontconfig xlib_libXi xlib_libX11 xlib_libXrender \
242 xlib_libXcursor xlib_libXrandr xlib_libXext xlib_libXv
243 # Using pkg-config avoids us some logic to redefine and sed again mkspecs files
244 # to add X11 include path and link options
245 QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
246 QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
247 QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs x11 xext`
248 QT_CONFIGURE_OPTS += -arch $(QT_EMB_PLATFORM) \
249 -xplatform qws/linux-$(QT_EMB_PLATFORM)-g++ -x11 -no-gtkstyle -no-sm \
250 -no-openvg
251 else # if BR2_PACKAGE_QT_EMBEDDED
252 QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
253 endif
255 ifneq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
256 QT_CONFIGURE_OPTS += -no-gui
257 endif
259 ifneq ($(BR2_PACKAGE_QT_GIF),y)
260 QT_CONFIGURE_OPTS += -no-gif
261 endif
263 ifeq ($(BR2_PACKAGE_QT_LIBMNG),y)
264 QT_CONFIGURE_OPTS += -qt-libmng
265 else
266 QT_CONFIGURE_OPTS += -no-libmng
267 endif
269 ifeq ($(BR2_PACKAGE_QT_ACCESSIBILITY),y)
270 QT_CONFIGURE_OPTS += -accessibility
271 else
272 QT_CONFIGURE_OPTS += -no-accessibility
273 endif
275 ifeq ($(BR2_PACKAGE_QT_QTZLIB),y)
276 QT_CONFIGURE_OPTS += -qt-zlib
277 else
278 ifeq ($(BR2_PACKAGE_QT_SYSTEMZLIB),y)
279 QT_CONFIGURE_OPTS += -system-zlib
280 QT_DEPENDENCIES += zlib
281 endif
282 endif
284 ifeq ($(BR2_PACKAGE_QT_QTJPEG),y)
285 QT_CONFIGURE_OPTS += -qt-libjpeg
286 else
287 ifeq ($(BR2_PACKAGE_QT_SYSTEMJPEG),y)
288 QT_CONFIGURE_OPTS += -system-libjpeg
289 QT_DEPENDENCIES += jpeg
290 else
291 QT_CONFIGURE_OPTS += -no-libjpeg
292 endif
293 endif
295 ifeq ($(BR2_PACKAGE_QT_QTPNG),y)
296 QT_CONFIGURE_OPTS += -qt-libpng
297 else
298 ifeq ($(BR2_PACKAGE_QT_SYSTEMPNG),y)
299 QT_CONFIGURE_OPTS += -system-libpng
300 QT_DEPENDENCIES += libpng
301 else
302 QT_CONFIGURE_OPTS += -no-libpng
303 endif
304 endif
306 ifeq ($(BR2_PACKAGE_QT_QTTIFF),y)
307 QT_CONFIGURE_OPTS += -qt-libtiff
308 else
309 ifeq ($(BR2_PACKAGE_QT_SYSTEMTIFF),y)
310 QT_CONFIGURE_OPTS += -system-libtiff
311 QT_DEPENDENCIES += tiff
312 else
313 QT_CONFIGURE_OPTS += -no-libtiff
314 endif
315 endif
317 QT_FONTS = $(addprefix $(STAGING_DIR)/usr/lib/fonts/, $(addsuffix *.qpf, \
318 $(if $(BR2_PACKAGE_QT_FONT_MICRO),micro) \
319 $(if $(BR2_PACKAGE_QT_FONT_FIXED),fixed) \
320 $(if $(BR2_PACKAGE_QT_FONT_HELVETICA),helvetica) \
321 $(if $(BR2_PACKAGE_QT_FONT_JAPANESE),japanese) \
322 $(if $(BR2_PACKAGE_QT_FONT_UNIFONT),unifont)))
324 ifeq ($(BR2_PACKAGE_QT_QTFREETYPE),y)
325 QT_CONFIGURE_OPTS += -qt-freetype
326 else
327 ifeq ($(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
328 QT_CONFIGURE_OPTS += -system-freetype
329 QT_CONFIGURE_OPTS += -I $(STAGING_DIR)/usr/include/freetype2/
330 QT_DEPENDENCIES += freetype
331 else
332 QT_CONFIGURE_OPTS += -no-freetype
333 endif
334 endif
336 ifeq ($(BR2_PACKAGE_QT_DBUS),y)
337 QT_DEPENDENCIES += dbus
338 endif
340 ifeq ($(BR2_PACKAGE_QT_OPENSSL),y)
341 QT_CONFIGURE_OPTS += -openssl
342 QT_DEPENDENCIES += openssl
343 else
344 QT_CONFIGURE_OPTS += -no-openssl
345 endif
347 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
348 QT_CONFIGURE_OPTS += -opengl es2 -egl
349 QT_DEPENDENCIES += libgles libegl
350 QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
351 QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
352 QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs egl`
353 else ifeq ($(BR2_PACKAGE_QT_OPENGL_GL_DESKTOP),y)
354 QT_CONFIGURE_OPTS += -opengl desktop
355 QT_DEPENDENCIES += libgl
356 else
357 QT_CONFIGURE_OPTS += -no-opengl
358 endif
360 # Qt SQL Drivers
361 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
362 ifeq ($(BR2_PACKAGE_QT_IBASE),y)
363 QT_CONFIGURE_OPTS += -qt-sql-ibase
364 endif
365 ifeq ($(BR2_PACKAGE_QT_MYSQL),y)
366 QT_CONFIGURE_OPTS += -qt-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
367 QT_DEPENDENCIES += mysql
368 endif
369 ifeq ($(BR2_PACKAGE_QT_ODBC),y)
370 QT_CONFIGURE_OPTS += -qt-sql-odbc
371 QT_DEPENDENCIES += unixodbc
372 endif
373 ifeq ($(BR2_PACKAGE_QT_PSQL),y)
374 QT_CONFIGURE_OPTS += -qt-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
375 QT_DEPENDENCIES += postgresql
376 endif
377 ifeq ($(BR2_PACKAGE_QT_SQLITE_QT),y)
378 QT_CONFIGURE_OPTS += -qt-sql-sqlite
379 else
380 ifeq ($(BR2_PACKAGE_QT_SQLITE_SYSTEM),y)
381 QT_CONFIGURE_OPTS += -system-sqlite
382 QT_DEPENDENCIES += sqlite
383 else
384 QT_CONFIGURE_OPTS += -no-sql-sqlite
385 endif
386 endif
387 ifeq ($(BR2_PACKAGE_QT_SQLITE2),y)
388 QT_CONFIGURE_OPTS += -qt-sql-sqlite2
389 endif
390 else
391 # By default, no SQL driver is turned on by configure.
392 # but it seems sqlite isn't disabled despite what says
393 # configure --help
394 QT_CONFIGURE_OPTS += -no-sql-sqlite
395 endif
397 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
398 QT_CONFIGURE_OPTS += -xmlpatterns -exceptions
399 else
400 QT_CONFIGURE_OPTS += -no-xmlpatterns
401 endif
403 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
404 QT_CONFIGURE_OPTS += -multimedia
405 else
406 QT_CONFIGURE_OPTS += -no-multimedia
407 endif
409 ifeq ($(BR2_PACKAGE_QT_AUDIO_BACKEND),y)
410 QT_CONFIGURE_OPTS += -audio-backend
411 QT_DEPENDENCIES += alsa-lib
412 else
413 QT_CONFIGURE_OPTS += -no-audio-backend
414 endif
416 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
417 QT_CONFIGURE_OPTS += -phonon
418 QT_DEPENDENCIES += gstreamer gst-plugins-base
419 else
420 QT_CONFIGURE_OPTS += -no-phonon
421 endif
423 ifeq ($(BR2_PACKAGE_QT_PHONON_BACKEND),y)
424 QT_CONFIGURE_OPTS += -phonon-backend
425 else
426 QT_CONFIGURE_OPTS += -no-phonon-backend
427 endif
429 ifeq ($(BR2_PACKAGE_QT_SVG),y)
430 QT_CONFIGURE_OPTS += -svg
431 else
432 QT_CONFIGURE_OPTS += -no-svg
433 endif
435 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
436 QT_CONFIGURE_OPTS += -webkit
437 QT_DEPENDENCIES += gstreamer gst-plugins-base
438 else
439 QT_CONFIGURE_OPTS += -no-webkit
440 endif
442 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
443 QT_CONFIGURE_OPTS += -script
444 else
445 QT_CONFIGURE_OPTS += -no-script
446 endif
448 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
449 QT_CONFIGURE_OPTS += -scripttools
450 else
451 QT_CONFIGURE_OPTS += -no-scripttools
452 endif
454 ifeq ($(BR2_PACKAGE_QT_STL),y)
455 QT_CONFIGURE_OPTS += -stl
456 else
457 QT_CONFIGURE_OPTS += -no-stl
458 endif
460 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
461 QT_CONFIGURE_OPTS += -declarative
462 else
463 QT_CONFIGURE_OPTS += -no-declarative
464 endif
466 # -no-pch is needed to workaround the issue described at
467 # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
468 # In addition, ccache and precompiled headers don't play well together
469 QT_CONFIGURE_OPTS += -no-pch
471 # x86x86fix
472 # Workaround Qt Embedded bug when crosscompiling for x86 under x86 with linux
473 # host. It's unclear if this would happen on other hosts.
474 ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
475 ifneq ($(findstring x86,$(QT_EMB_PLATFORM)),)
476 QT_CONFIGURE_OPTS += -platform linux-g++
477 endif
478 endif
479 # End of workaround.
481 # Variable for other Qt applications to use
482 QT_QMAKE = $(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
484 ################################################################################
485 # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
486 # the qmake.conf file. Will remove existing variable declaration if
487 # available.
489 # Argument 1 is the variable name
490 # Argument 2 is the value to set variable to
491 # Argument 3 is the base source directory of Qt
493 # E.G. use like this:
494 # $(call QT_QMAKE_SET,variable,value,directory)
495 ################################################################################
496 define QT_QMAKE_SET
497 $(SED) '/$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
498 $(SED) "/include.*qws.conf/a$(1) = $(2)" $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
499 endef
501 ifneq ($(QT_CONFIG_FILE),)
502 define QT_CONFIGURE_CONFIG_FILE
503 cp $(QT_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
504 endef
505 endif
507 define QT_CONFIGURE_CMDS
508 -[ -f $(@D)/Makefile ] && $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) confclean
509 $(QT_CONFIGURE_IPV6)
510 $(QT_CONFIGURE_CONFIG_FILE)
511 # Fix compiler path
512 $(call QT_QMAKE_SET,QMAKE_CC,$(TARGET_CC),$(@D))
513 $(call QT_QMAKE_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
514 $(call QT_QMAKE_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
515 $(call QT_QMAKE_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
516 $(call QT_QMAKE_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
517 $(call QT_QMAKE_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
518 $(call QT_QMAKE_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
519 $(call QT_QMAKE_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
520 $(call QT_QMAKE_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
521 $(call QT_QMAKE_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
522 $(call QT_QMAKE_SET,QMAKE_LFLAGS,$(QT_LDFLAGS),$(@D))
523 $(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/usr/bin/pkg-config,$(@D))
524 # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
525 # instead of the host then. So set PKG_CONFIG* manually.
526 (cd $(@D); \
527 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
528 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
529 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
530 $(TARGET_MAKE_ENV) \
531 MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" ./configure \
532 $(if $(VERBOSE),-verbose,-silent) \
533 -force-pkg-config \
534 $(QT_CONFIGURE_OPTS) \
535 -no-xinerama \
536 -no-cups \
537 -no-nis \
538 -no-separate-debug-info \
539 -prefix /usr \
540 -plugindir /usr/lib/qt/plugins \
541 -importdir /usr/lib/qt/imports \
542 -translationdir /usr/share/qt/translations \
543 -hostprefix $(STAGING_DIR) \
544 -fast \
545 -no-rpath \
547 endef
549 define QT_BUILD_CMDS
550 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
551 endef
554 # Build the list of libraries and plugins to install to the target
556 QT_INSTALL_LIBS += QtCore
557 QT_HOST_PROGRAMS += moc rcc qmake lrelease
559 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
560 QT_INSTALL_LIBS += QtGui
561 QT_HOST_PROGRAMS += uic
562 endif
563 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
564 QT_INSTALL_LIBS += QtSql
565 endif
566 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
567 QT_INSTALL_LIBS += QtMultimedia
568 endif
569 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
570 QT_INSTALL_LIBS += phonon
571 endif
572 ifeq ($(BR2_PACKAGE_QT_SVG),y)
573 QT_INSTALL_LIBS += QtSvg
574 endif
575 ifeq ($(BR2_PACKAGE_QT_NETWORK),y)
576 QT_INSTALL_LIBS += QtNetwork
577 endif
578 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
579 QT_INSTALL_LIBS += QtWebKit
580 endif
581 ifeq ($(BR2_PACKAGE_QT_XML),y)
582 QT_INSTALL_LIBS += QtXml
583 endif
584 ifeq ($(BR2_PACKAGE_QT_DBUS),y)
585 QT_INSTALL_LIBS += QtDBus
586 endif
587 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
588 QT_INSTALL_LIBS += QtXmlPatterns
589 endif
590 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
591 QT_INSTALL_LIBS += QtScript
592 endif
593 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
594 QT_INSTALL_LIBS += QtScriptTools
595 endif
596 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
597 QT_INSTALL_LIBS += QtDeclarative
598 endif
599 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
600 QT_INSTALL_LIBS += Qt3Support
601 endif
602 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
603 QT_INSTALL_LIBS += QtOpenGL
604 endif
605 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
606 QT_INSTALL_LIBS += pvrQWSWSEGL
607 endif
608 ifeq ($(BR2_PACKAGE_QT_TEST),y)
609 QT_INSTALL_LIBS += QtTest
610 endif
612 QT_CONF_FILE = $(HOST_DIR)/usr/bin/qt.conf
614 # Since host programs and spec files have been moved to $(HOST_DIR),
615 # we need to tell qmake the new location of the various elements,
616 # through a qt.conf file.
617 define QT_INSTALL_QT_CONF
618 mkdir -p $(dir $(QT_CONF_FILE))
619 echo "[Paths]" > $(QT_CONF_FILE)
620 echo "Prefix=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
621 echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
622 echo "Libraries=$(STAGING_DIR)/usr/lib" >> $(QT_CONF_FILE)
623 echo "Data=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
624 echo "Binaries=$(HOST_DIR)/usr/bin" >> $(QT_CONF_FILE)
625 endef
627 # After running Qt normal installation process (which installs
628 # everything in the STAGING_DIR), we move host programs such as qmake,
629 # rcc or uic to the HOST_DIR so that they are available at the usual
630 # location. A qt.conf file is generated to make sure that all host
631 # programs still find all files they need. The .pc files are tuned to
632 # remove the sysroot path from them, since pkg-config already adds it
633 # automatically.
634 define QT_INSTALL_STAGING_CMDS
635 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
636 mkdir -p $(HOST_DIR)/usr/bin
637 mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
638 ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
639 $(QT_INSTALL_QT_CONF)
640 for i in moc uic rcc lupdate lrelease ; do \
641 $(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/usr/bin/$${i}," \
642 $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
643 done
644 $(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
645 endef
647 # Library installation
648 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
649 define QT_INSTALL_TARGET_LIBS
650 mkdir -p $(TARGET_DIR)/usr/lib
651 for lib in $(QT_INSTALL_LIBS); do \
652 cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib ; \
653 done
654 endef
655 endif
657 # Plugin installation
658 define QT_INSTALL_TARGET_PLUGINS
659 if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
660 mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
661 cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
663 endef
665 # Import installation
666 define QT_INSTALL_TARGET_IMPORTS
667 if [ -d $(STAGING_DIR)/usr/lib/qt/imports/ ] ; then \
668 mkdir -p $(TARGET_DIR)/usr/lib/qt/imports ; \
669 cp -dpfr $(STAGING_DIR)/usr/lib/qt/imports/* $(TARGET_DIR)/usr/lib/qt/imports ; \
671 endef
673 # Fonts installation
674 ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
675 ifneq ($(QT_FONTS),)
676 define QT_INSTALL_TARGET_FONTS
677 mkdir -p $(TARGET_DIR)/usr/lib/fonts
678 cp -dpf $(QT_FONTS) $(TARGET_DIR)/usr/lib/fonts
679 endef
680 ifneq ($(BR2_PACKAGE_QT_FONT_MICRO)$(BR2_PACKAGE_QT_FONT_FIXED),)
681 # as stated in the font source src/3rdparty/fonts/micro.bdf
682 # source src/3rdparty/fonts/5x7.bdf and source src/3rdparty/fonts/6x13.bdf
683 QT_LICENSE := $(QT_LICENSE), Public Domain (Micro/Fixed font)
684 endif
685 ifneq ($(BR2_PACKAGE_QT_FONT_HELVETICA)$(BR2_PACKAGE_QT_FONT_JAPANESE),)
686 QT_LICENSE := $(QT_LICENSE), Adobe Helvetica license (Helvetica/Japanese fonts)
687 QT_LICENSE_FILES += src/3rdparty/fonts/COPYING.Helvetica
688 endif
689 ifeq ($(BR2_PACKAGE_QT_FONT_UNIFONT),y)
690 QT_LICENSE := $(QT_LICENSE), Freeware (Unifont font)
691 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.Unifont
692 endif
693 endif # QT_FONTS
695 ifeq ($(BR2_PACKAGE_QT_QTFREETYPE)$(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
696 define QT_INSTALL_TARGET_FONTS_TTF
697 mkdir -p $(TARGET_DIR)/usr/lib/fonts
698 cp -dpf $(STAGING_DIR)/usr/lib/fonts/*.ttf $(TARGET_DIR)/usr/lib/fonts
699 endef
700 QT_LICENSE := $(QT_LICENSE), Bitstream license (DejaVu/Vera TrueType fonts)
701 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.DejaVu \
702 src/3rdparty/fonts/README.DejaVu \
703 src/3rdparty/fonts/COPYRIGHT.Vera
704 endif
705 endif # BR2_PACKAGE_QT_EMBEDDED
707 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
708 define QT_INSTALL_TARGET_POWERVR
709 # Note: this overwrites the default powervr.ini provided by the ti-gfx
710 # package.
711 $(INSTALL) -D -m 0644 package/qt/powervr.ini \
712 $(TARGET_DIR)/etc/powervr.ini
713 endef
714 endif
716 ifeq ($(BR2_PACKAGE_QT_TRANSLATION_FILES),y)
717 define QT_INSTALL_TARGET_TRANSLATIONS
718 if [ -d $(STAGING_DIR)/usr/share/qt/translations/ ] ; then \
719 mkdir -p $(TARGET_DIR)/usr/share/qt/translations ; \
720 cp -dpfr $(STAGING_DIR)/usr/share/qt/translations/* $(TARGET_DIR)/usr/share/qt/translations ; \
722 endef
723 endif
725 define QT_INSTALL_TARGET_CMDS
726 $(QT_INSTALL_TARGET_LIBS)
727 $(QT_INSTALL_TARGET_PLUGINS)
728 $(QT_INSTALL_TARGET_IMPORTS)
729 $(QT_INSTALL_TARGET_FONTS)
730 $(QT_INSTALL_TARGET_FONTS_TTF)
731 $(QT_INSTALL_TARGET_POWERVR)
732 $(QT_INSTALL_TARGET_TRANSLATIONS)
733 endef
735 $(eval $(generic-package))