package/xfont_font-cronyx-cyrillic: add hash file
[buildroot-gz.git] / package / qt / qt.mk
blobd56fe7e2e83916a234f4b4b3c2c022bb58868bc2
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 QT_DEPENDENCIES = host-pkgconf
19 QT_INSTALL_STAGING = YES
21 QT_LICENSE := LGPLv2.1 with exceptions or GPLv3
22 ifneq ($(BR2_PACKAGE_QT_LICENSE_APPROVED),y)
23 QT_LICENSE := $(QT_LICENSE) or Digia Qt Commercial license
24 endif
25 QT_LICENSE_FILES = LICENSE.LGPL LGPL_EXCEPTION.txt LICENSE.GPL3
27 ifeq ($(BR2_PACKAGE_QT_LICENSE_APPROVED),y)
28 QT_CONFIGURE_OPTS += -opensource -confirm-license
29 endif
31 QT_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT_CONFIG_FILE))
33 ifneq ($(QT_CONFIG_FILE),)
34 QT_CONFIGURE_OPTS += -qconfig buildroot
35 endif
37 QT_CFLAGS = $(TARGET_CFLAGS)
38 QT_CXXFLAGS = $(TARGET_CXXFLAGS)
39 QT_LDFLAGS = $(TARGET_LDFLAGS)
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
49 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
50 QT_CONFIGURE_OPTS += -qt3support
51 else
52 QT_CONFIGURE_OPTS += -no-qt3support
53 endif
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
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
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
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
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
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
194 ifeq ($(BR2_PACKAGE_QT_DEBUG),y)
195 QT_CONFIGURE_OPTS += -debug
196 else
197 QT_CONFIGURE_OPTS += -release
198 endif
200 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
201 QT_CONFIGURE_OPTS += -shared
202 else
203 QT_CONFIGURE_OPTS += -static
204 endif
206 ifeq ($(BR2_STATIC_LIBS),y)
207 QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
208 endif
210 ifeq ($(BR2_ENDIAN),"LITTLE")
211 QT_CONFIGURE_OPTS += -little-endian
212 else
213 QT_CONFIGURE_OPTS += -big-endian
214 endif
216 ifeq ($(BR2_arm)$(BR2_armeb),y)
217 QT_EMB_PLATFORM = arm
218 else ifeq ($(BR2_i386),y)
219 QT_EMB_PLATFORM = x86
220 else ifeq ($(BR2_x86_64),y)
221 QT_EMB_PLATFORM = x86_64
222 else ifeq ($(BR2_mips)$(BR2_mipsel),y)
223 QT_EMB_PLATFORM = mips
224 else ifeq ($(BR2_powerpc),y)
225 QT_EMB_PLATFORM = powerpc
226 else ifeq ($(BR2_sh4)$(BR2_sh4eb)$(BR2_sh4a)$(BR2_sh4aeb),y)
227 QT_EMB_PLATFORM = sh
228 else
229 QT_EMB_PLATFORM = generic
230 endif
232 ifeq ($(BR2_PACKAGE_QT_X11),y)
233 QT_DEPENDENCIES += fontconfig xlib_libXi xlib_libX11 xlib_libXrender \
234 xlib_libXcursor xlib_libXrandr xlib_libXext xlib_libXv
235 # Using pkg-config avoids us some logic to redefine and sed again mkspecs files
236 # to add X11 include path and link options
237 QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
238 QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
239 QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs x11 xext`
240 QT_CONFIGURE_OPTS += -arch $(QT_EMB_PLATFORM) \
241 -xplatform qws/linux-$(QT_EMB_PLATFORM)-g++ -x11 -no-gtkstyle -no-sm \
242 -no-openvg
243 else # if BR2_PACKAGE_QT_EMBEDDED
244 QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
245 endif
247 ifneq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
248 QT_CONFIGURE_OPTS += -no-gui
249 endif
251 ifneq ($(BR2_PACKAGE_QT_GIF),y)
252 QT_CONFIGURE_OPTS += -no-gif
253 endif
255 ifeq ($(BR2_PACKAGE_QT_LIBMNG),y)
256 QT_CONFIGURE_OPTS += -qt-libmng
257 else
258 QT_CONFIGURE_OPTS += -no-libmng
259 endif
261 ifeq ($(BR2_PACKAGE_QT_QTZLIB),y)
262 QT_CONFIGURE_OPTS += -qt-zlib
263 else
264 ifeq ($(BR2_PACKAGE_QT_SYSTEMZLIB),y)
265 QT_CONFIGURE_OPTS += -system-zlib
266 QT_DEPENDENCIES += zlib
267 endif
268 endif
270 ifeq ($(BR2_PACKAGE_QT_QTJPEG),y)
271 QT_CONFIGURE_OPTS += -qt-libjpeg
272 else
273 ifeq ($(BR2_PACKAGE_QT_SYSTEMJPEG),y)
274 QT_CONFIGURE_OPTS += -system-libjpeg
275 QT_DEPENDENCIES += jpeg
276 else
277 QT_CONFIGURE_OPTS += -no-libjpeg
278 endif
279 endif
281 ifeq ($(BR2_PACKAGE_QT_QTPNG),y)
282 QT_CONFIGURE_OPTS += -qt-libpng
283 else
284 ifeq ($(BR2_PACKAGE_QT_SYSTEMPNG),y)
285 QT_CONFIGURE_OPTS += -system-libpng
286 QT_DEPENDENCIES += libpng
287 else
288 QT_CONFIGURE_OPTS += -no-libpng
289 endif
290 endif
292 ifeq ($(BR2_PACKAGE_QT_QTTIFF),y)
293 QT_CONFIGURE_OPTS += -qt-libtiff
294 else
295 ifeq ($(BR2_PACKAGE_QT_SYSTEMTIFF),y)
296 QT_CONFIGURE_OPTS += -system-libtiff
297 QT_DEPENDENCIES += tiff
298 else
299 QT_CONFIGURE_OPTS += -no-libtiff
300 endif
301 endif
303 QT_FONTS = $(addprefix $(STAGING_DIR)/usr/lib/fonts/, $(addsuffix *.qpf, \
304 $(if $(BR2_PACKAGE_QT_FONT_MICRO),micro) \
305 $(if $(BR2_PACKAGE_QT_FONT_FIXED),fixed) \
306 $(if $(BR2_PACKAGE_QT_FONT_HELVETICA),helvetica) \
307 $(if $(BR2_PACKAGE_QT_FONT_JAPANESE),japanese) \
308 $(if $(BR2_PACKAGE_QT_FONT_UNIFONT),unifont)))
310 ifeq ($(BR2_PACKAGE_QT_QTFREETYPE),y)
311 QT_CONFIGURE_OPTS += -qt-freetype
312 else
313 ifeq ($(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
314 QT_CONFIGURE_OPTS += -system-freetype
315 QT_CONFIGURE_OPTS += -I $(STAGING_DIR)/usr/include/freetype2/
316 QT_DEPENDENCIES += freetype
317 else
318 QT_CONFIGURE_OPTS += -no-freetype
319 endif
320 endif
322 ifeq ($(BR2_PACKAGE_QT_DBUS),y)
323 QT_DEPENDENCIES += dbus
324 endif
326 ifeq ($(BR2_PACKAGE_QT_OPENSSL),y)
327 QT_CONFIGURE_OPTS += -openssl
328 QT_DEPENDENCIES += openssl
329 else
330 QT_CONFIGURE_OPTS += -no-openssl
331 endif
333 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
334 QT_CONFIGURE_OPTS += -opengl es2 -egl
335 QT_DEPENDENCIES += libgles libegl
336 QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
337 QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
338 QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs egl`
339 else ifeq ($(BR2_PACKAGE_QT_OPENGL_GL_DESKTOP),y)
340 QT_CONFIGURE_OPTS += -opengl desktop
341 QT_DEPENDENCIES += libgl
342 else
343 QT_CONFIGURE_OPTS += -no-opengl
344 endif
346 # Qt SQL Drivers
347 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
348 ifeq ($(BR2_PACKAGE_QT_IBASE),y)
349 QT_CONFIGURE_OPTS += -qt-sql-ibase
350 endif
351 ifeq ($(BR2_PACKAGE_QT_MYSQL),y)
352 QT_CONFIGURE_OPTS += -qt-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
353 QT_DEPENDENCIES += mysql
354 endif
355 ifeq ($(BR2_PACKAGE_QT_ODBC),y)
356 QT_CONFIGURE_OPTS += -qt-sql-odbc
357 QT_DEPENDENCIES += unixodbc
358 endif
359 ifeq ($(BR2_PACKAGE_QT_PSQL),y)
360 QT_CONFIGURE_OPTS += -qt-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
361 QT_DEPENDENCIES += postgresql
362 endif
363 ifeq ($(BR2_PACKAGE_QT_SQLITE_QT),y)
364 QT_CONFIGURE_OPTS += -qt-sql-sqlite
365 else
366 ifeq ($(BR2_PACKAGE_QT_SQLITE_SYSTEM),y)
367 QT_CONFIGURE_OPTS += -system-sqlite
368 QT_DEPENDENCIES += sqlite
369 else
370 QT_CONFIGURE_OPTS += -no-sql-sqlite
371 endif
372 endif
373 ifeq ($(BR2_PACKAGE_QT_SQLITE2),y)
374 QT_CONFIGURE_OPTS += -qt-sql-sqlite2
375 endif
376 else
377 # By default, no SQL driver is turned on by configure.
378 # but it seems sqlite isn't disabled despite what says
379 # configure --help
380 QT_CONFIGURE_OPTS += -no-sql-sqlite
381 endif
383 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
384 QT_CONFIGURE_OPTS += -xmlpatterns -exceptions
385 else
386 QT_CONFIGURE_OPTS += -no-xmlpatterns
387 endif
389 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
390 QT_CONFIGURE_OPTS += -multimedia
391 else
392 QT_CONFIGURE_OPTS += -no-multimedia
393 endif
395 ifeq ($(BR2_PACKAGE_QT_AUDIO_BACKEND),y)
396 QT_CONFIGURE_OPTS += -audio-backend
397 QT_DEPENDENCIES += alsa-lib
398 else
399 QT_CONFIGURE_OPTS += -no-audio-backend
400 endif
402 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
403 QT_CONFIGURE_OPTS += -phonon
404 QT_DEPENDENCIES += gstreamer gst-plugins-base
405 else
406 QT_CONFIGURE_OPTS += -no-phonon
407 endif
409 ifeq ($(BR2_PACKAGE_QT_PHONON_BACKEND),y)
410 QT_CONFIGURE_OPTS += -phonon-backend
411 else
412 QT_CONFIGURE_OPTS += -no-phonon-backend
413 endif
415 ifeq ($(BR2_PACKAGE_QT_SVG),y)
416 QT_CONFIGURE_OPTS += -svg
417 else
418 QT_CONFIGURE_OPTS += -no-svg
419 endif
421 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
422 QT_CONFIGURE_OPTS += -webkit
423 else
424 QT_CONFIGURE_OPTS += -no-webkit
425 endif
427 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
428 QT_CONFIGURE_OPTS += -script
429 else
430 QT_CONFIGURE_OPTS += -no-script
431 endif
433 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
434 QT_CONFIGURE_OPTS += -scripttools
435 else
436 QT_CONFIGURE_OPTS += -no-scripttools
437 endif
439 ifeq ($(BR2_PACKAGE_QT_STL),y)
440 QT_CONFIGURE_OPTS += -stl
441 else
442 QT_CONFIGURE_OPTS += -no-stl
443 endif
445 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
446 QT_CONFIGURE_OPTS += -declarative
447 else
448 QT_CONFIGURE_OPTS += -no-declarative
449 endif
451 # -no-pch is needed to workaround the issue described at
452 # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
453 # In addition, ccache and precompiled headers don't play well together
454 QT_CONFIGURE_OPTS += -no-pch
456 # x86x86fix
457 # Workaround Qt Embedded bug when crosscompiling for x86 under x86 with linux
458 # host. It's unclear if this would happen on other hosts.
459 ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
460 ifneq ($(findstring x86,$(QT_EMB_PLATFORM)),)
461 QT_CONFIGURE_OPTS += -platform linux-g++
462 endif
463 endif
464 # End of workaround.
466 # Variable for other Qt applications to use
467 QT_QMAKE = $(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
469 ################################################################################
470 # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
471 # the qmake.conf file. Will remove existing variable declaration if
472 # available.
474 # Argument 1 is the variable name
475 # Argument 2 is the value to set variable to
476 # Argument 3 is the base source directory of Qt
478 # E.G. use like this:
479 # $(call QT_QMAKE_SET,variable,value,directory)
480 ################################################################################
481 define QT_QMAKE_SET
482 $(SED) '/$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
483 $(SED) "/include.*qws.conf/a$(1) = $(2)" $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
484 endef
486 ifneq ($(QT_CONFIG_FILE),)
487 define QT_CONFIGURE_CONFIG_FILE
488 cp $(QT_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
489 endef
490 endif
492 define QT_CONFIGURE_CMDS
493 -[ -f $(@D)/Makefile ] && $(MAKE) -C $(@D) confclean
494 $(QT_CONFIGURE_IPV6)
495 $(QT_CONFIGURE_CONFIG_FILE)
496 # Fix compiler path
497 $(call QT_QMAKE_SET,QMAKE_CC,$(TARGET_CC),$(@D))
498 $(call QT_QMAKE_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
499 $(call QT_QMAKE_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
500 $(call QT_QMAKE_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
501 $(call QT_QMAKE_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
502 $(call QT_QMAKE_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
503 $(call QT_QMAKE_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
504 $(call QT_QMAKE_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
505 $(call QT_QMAKE_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
506 $(call QT_QMAKE_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
507 $(call QT_QMAKE_SET,QMAKE_LFLAGS,$(QT_LDFLAGS),$(@D))
508 $(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/usr/bin/pkg-config,$(@D))
509 # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
510 # instead of the host then. So set PKG_CONFIG* manually.
511 (cd $(@D); \
512 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
513 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
514 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
515 $(QT_CONFIGURE_ENV) \
516 MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" ./configure \
517 $(if $(VERBOSE),-verbose,-silent) \
518 -force-pkg-config \
519 $(QT_CONFIGURE_OPTS) \
520 -no-xinerama \
521 -no-cups \
522 -no-nis \
523 -no-accessibility \
524 -no-separate-debug-info \
525 -prefix /usr \
526 -plugindir /usr/lib/qt/plugins \
527 -importdir /usr/lib/qt/imports \
528 -translationdir /usr/share/qt/translations \
529 -hostprefix $(STAGING_DIR) \
530 -fast \
531 -no-rpath \
533 endef
535 define QT_BUILD_CMDS
536 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
537 endef
540 # Build the list of libraries and plugins to install to the target
542 QT_INSTALL_LIBS += QtCore
543 QT_HOST_PROGRAMS += moc rcc qmake lrelease
545 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
546 QT_INSTALL_LIBS += QtGui
547 QT_HOST_PROGRAMS += uic
548 endif
549 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
550 QT_INSTALL_LIBS += QtSql
551 endif
552 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
553 QT_INSTALL_LIBS += QtMultimedia
554 endif
555 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
556 QT_INSTALL_LIBS += phonon
557 endif
558 ifeq ($(BR2_PACKAGE_QT_SVG),y)
559 QT_INSTALL_LIBS += QtSvg
560 endif
561 ifeq ($(BR2_PACKAGE_QT_NETWORK),y)
562 QT_INSTALL_LIBS += QtNetwork
563 endif
564 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
565 QT_INSTALL_LIBS += QtWebKit
566 endif
567 ifeq ($(BR2_PACKAGE_QT_XML),y)
568 QT_INSTALL_LIBS += QtXml
569 endif
570 ifeq ($(BR2_PACKAGE_QT_DBUS),y)
571 QT_INSTALL_LIBS += QtDBus
572 endif
573 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
574 QT_INSTALL_LIBS += QtXmlPatterns
575 endif
576 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
577 QT_INSTALL_LIBS += QtScript
578 endif
579 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
580 QT_INSTALL_LIBS += QtScriptTools
581 endif
582 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
583 QT_INSTALL_LIBS += QtDeclarative
584 endif
585 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
586 QT_INSTALL_LIBS += Qt3Support
587 endif
588 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
589 QT_INSTALL_LIBS += QtOpenGL
590 endif
591 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
592 QT_INSTALL_LIBS += pvrQWSWSEGL
593 endif
594 ifeq ($(BR2_PACKAGE_QT_TEST),y)
595 QT_INSTALL_LIBS += QtTest
596 endif
598 QT_CONF_FILE = $(HOST_DIR)/usr/bin/qt.conf
600 # Since host programs and spec files have been moved to $(HOST_DIR),
601 # we need to tell qmake the new location of the various elements,
602 # through a qt.conf file.
603 define QT_INSTALL_QT_CONF
604 mkdir -p $(dir $(QT_CONF_FILE))
605 echo "[Paths]" > $(QT_CONF_FILE)
606 echo "Prefix=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
607 echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
608 echo "Libraries=$(STAGING_DIR)/usr/lib" >> $(QT_CONF_FILE)
609 echo "Data=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
610 echo "Binaries=$(HOST_DIR)/usr/bin" >> $(QT_CONF_FILE)
611 endef
613 # After running Qt normal installation process (which installs
614 # everything in the STAGING_DIR), we move host programs such as qmake,
615 # rcc or uic to the HOST_DIR so that they are available at the usual
616 # location. A qt.conf file is generated to make sure that all host
617 # programs still find all files they need. The .pc files are tuned to
618 # remove the sysroot path from them, since pkg-config already adds it
619 # automatically.
620 define QT_INSTALL_STAGING_CMDS
621 $(MAKE) -C $(@D) install
622 mkdir -p $(HOST_DIR)/usr/bin
623 mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
624 ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
625 $(QT_INSTALL_QT_CONF)
626 for i in moc uic rcc lupdate lrelease ; do \
627 $(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/usr/bin/$${i}," \
628 $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
629 done
630 $(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
631 endef
633 # Library installation
634 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
635 define QT_INSTALL_TARGET_LIBS
636 mkdir -p $(TARGET_DIR)/usr/lib
637 for lib in $(QT_INSTALL_LIBS); do \
638 cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib ; \
639 done
640 endef
641 endif
643 # Plugin installation
644 define QT_INSTALL_TARGET_PLUGINS
645 if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
646 mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
647 cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
649 endef
651 # Import installation
652 define QT_INSTALL_TARGET_IMPORTS
653 if [ -d $(STAGING_DIR)/usr/lib/qt/imports/ ] ; then \
654 mkdir -p $(TARGET_DIR)/usr/lib/qt/imports ; \
655 cp -dpfr $(STAGING_DIR)/usr/lib/qt/imports/* $(TARGET_DIR)/usr/lib/qt/imports ; \
657 endef
659 # Fonts installation
660 ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
661 ifneq ($(QT_FONTS),)
662 define QT_INSTALL_TARGET_FONTS
663 mkdir -p $(TARGET_DIR)/usr/lib/fonts
664 cp -dpf $(QT_FONTS) $(TARGET_DIR)/usr/lib/fonts
665 endef
666 ifneq ($(BR2_PACKAGE_QT_FONT_MICRO)$(BR2_PACKAGE_QT_FONT_FIXED),)
667 # as stated in the font source src/3rdparty/fonts/micro.bdf
668 # source src/3rdparty/fonts/5x7.bdf and source src/3rdparty/fonts/6x13.bdf
669 QT_LICENSE := $(QT_LICENSE), Public Domain (Micro/Fixed font)
670 endif
671 ifneq ($(BR2_PACKAGE_QT_FONT_HELVETICA)$(BR2_PACKAGE_QT_FONT_JAPANESE),)
672 QT_LICENSE := $(QT_LICENSE), Adobe Helvetica license (Helvetica/Japanese fonts)
673 QT_LICENSE_FILES += src/3rdparty/fonts/COPYING.Helvetica
674 endif
675 ifeq ($(BR2_PACKAGE_QT_FONT_UNIFONT),y)
676 QT_LICENSE := $(QT_LICENSE), Freeware (Unifont font)
677 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.Unifont
678 endif
679 endif # QT_FONTS
681 ifeq ($(BR2_PACKAGE_QT_QTFREETYPE)$(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
682 define QT_INSTALL_TARGET_FONTS_TTF
683 mkdir -p $(TARGET_DIR)/usr/lib/fonts
684 cp -dpf $(STAGING_DIR)/usr/lib/fonts/*.ttf $(TARGET_DIR)/usr/lib/fonts
685 endef
686 QT_LICENSE := $(QT_LICENSE), Bitstream license (DejaVu/Vera TrueType fonts)
687 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.DejaVu \
688 src/3rdparty/fonts/README.DejaVu \
689 src/3rdparty/fonts/COPYRIGHT.Vera
690 endif
691 endif # BR2_PACKAGE_QT_EMBEDDED
693 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
694 define QT_INSTALL_TARGET_POWERVR
695 # Note: this overwrites the default powervr.ini provided by the ti-gfx
696 # package.
697 $(INSTALL) -D -m 0644 package/qt/powervr.ini \
698 $(TARGET_DIR)/etc/powervr.ini
699 endef
700 endif
702 ifeq ($(BR2_PACKAGE_QT_TRANSLATION_FILES),y)
703 define QT_INSTALL_TARGET_TRANSLATIONS
704 if [ -d $(STAGING_DIR)/usr/share/qt/translations/ ] ; then \
705 mkdir -p $(TARGET_DIR)/usr/share/qt/translations ; \
706 cp -dpfr $(STAGING_DIR)/usr/share/qt/translations/* $(TARGET_DIR)/usr/share/qt/translations ; \
708 endef
709 endif
711 define QT_INSTALL_TARGET_CMDS
712 $(QT_INSTALL_TARGET_LIBS)
713 $(QT_INSTALL_TARGET_PLUGINS)
714 $(QT_INSTALL_TARGET_IMPORTS)
715 $(QT_INSTALL_TARGET_FONTS)
716 $(QT_INSTALL_TARGET_FONTS_TTF)
717 $(QT_INSTALL_TARGET_POWERVR)
718 $(QT_INSTALL_TARGET_TRANSLATIONS)
719 endef
721 $(eval $(generic-package))