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