package/logrotate: update upstream site in Config.in help
[buildroot-gz.git] / package / qt / qt.mk
blobe82bdfe801f4d195b9bdc10d53105d2365aa97ef
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_MYSQL),y)
363 QT_CONFIGURE_OPTS += -qt-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
364 QT_DEPENDENCIES += mysql
365 endif
366 ifeq ($(BR2_PACKAGE_QT_ODBC),y)
367 QT_CONFIGURE_OPTS += -qt-sql-odbc
368 QT_DEPENDENCIES += unixodbc
369 endif
370 ifeq ($(BR2_PACKAGE_QT_PSQL),y)
371 QT_CONFIGURE_OPTS += -qt-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
372 QT_DEPENDENCIES += postgresql
373 endif
374 ifeq ($(BR2_PACKAGE_QT_SQLITE_QT),y)
375 QT_CONFIGURE_OPTS += -qt-sql-sqlite
376 else
377 ifeq ($(BR2_PACKAGE_QT_SQLITE_SYSTEM),y)
378 QT_CONFIGURE_OPTS += -system-sqlite
379 QT_DEPENDENCIES += sqlite
380 else
381 QT_CONFIGURE_OPTS += -no-sql-sqlite
382 endif
383 endif
384 ifeq ($(BR2_PACKAGE_QT_SQLITE2),y)
385 QT_CONFIGURE_OPTS += -qt-sql-sqlite2
386 endif
387 else
388 # By default, no SQL driver is turned on by configure.
389 # but it seems sqlite isn't disabled despite what says
390 # configure --help
391 QT_CONFIGURE_OPTS += -no-sql-sqlite
392 endif
394 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
395 QT_CONFIGURE_OPTS += -xmlpatterns -exceptions
396 else
397 QT_CONFIGURE_OPTS += -no-xmlpatterns
398 endif
400 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
401 QT_CONFIGURE_OPTS += -multimedia
402 else
403 QT_CONFIGURE_OPTS += -no-multimedia
404 endif
406 ifeq ($(BR2_PACKAGE_QT_AUDIO_BACKEND),y)
407 QT_CONFIGURE_OPTS += -audio-backend
408 QT_DEPENDENCIES += alsa-lib
409 else
410 QT_CONFIGURE_OPTS += -no-audio-backend
411 endif
413 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
414 QT_CONFIGURE_OPTS += -phonon
415 QT_DEPENDENCIES += gstreamer gst-plugins-base
416 else
417 QT_CONFIGURE_OPTS += -no-phonon
418 endif
420 ifeq ($(BR2_PACKAGE_QT_PHONON_BACKEND),y)
421 QT_CONFIGURE_OPTS += -phonon-backend
422 else
423 QT_CONFIGURE_OPTS += -no-phonon-backend
424 endif
426 ifeq ($(BR2_PACKAGE_QT_SVG),y)
427 QT_CONFIGURE_OPTS += -svg
428 else
429 QT_CONFIGURE_OPTS += -no-svg
430 endif
432 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
433 QT_CONFIGURE_OPTS += -webkit
434 QT_DEPENDENCIES += gstreamer gst-plugins-base
435 else
436 QT_CONFIGURE_OPTS += -no-webkit
437 endif
439 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
440 QT_CONFIGURE_OPTS += -script
441 else
442 QT_CONFIGURE_OPTS += -no-script
443 endif
445 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
446 QT_CONFIGURE_OPTS += -scripttools
447 else
448 QT_CONFIGURE_OPTS += -no-scripttools
449 endif
451 ifeq ($(BR2_PACKAGE_QT_STL),y)
452 QT_CONFIGURE_OPTS += -stl
453 else
454 QT_CONFIGURE_OPTS += -no-stl
455 endif
457 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
458 QT_CONFIGURE_OPTS += -declarative
459 else
460 QT_CONFIGURE_OPTS += -no-declarative
461 endif
463 # -no-pch is needed to workaround the issue described at
464 # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
465 # In addition, ccache and precompiled headers don't play well together
466 QT_CONFIGURE_OPTS += -no-pch
468 # x86x86fix
469 # Workaround Qt Embedded bug when crosscompiling for x86 under x86 with linux
470 # host. It's unclear if this would happen on other hosts.
471 ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
472 ifneq ($(findstring x86,$(QT_EMB_PLATFORM)),)
473 QT_CONFIGURE_OPTS += -platform linux-g++
474 endif
475 endif
476 # End of workaround.
478 # Variable for other Qt applications to use
479 QT_QMAKE = $(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
481 ################################################################################
482 # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
483 # the qmake.conf file. Will remove existing variable declaration if
484 # available.
486 # Argument 1 is the variable name
487 # Argument 2 is the value to set variable to
488 # Argument 3 is the base source directory of Qt
490 # E.G. use like this:
491 # $(call QT_QMAKE_SET,variable,value,directory)
492 ################################################################################
493 define QT_QMAKE_SET
494 $(SED) '/$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
495 $(SED) "/include.*qws.conf/a$(1) = $(2)" $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
496 endef
498 ifneq ($(QT_CONFIG_FILE),)
499 define QT_CONFIGURE_CONFIG_FILE
500 cp $(QT_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
501 endef
502 endif
504 define QT_CONFIGURE_CMDS
505 -[ -f $(@D)/Makefile ] && $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) confclean
506 $(QT_CONFIGURE_IPV6)
507 $(QT_CONFIGURE_CONFIG_FILE)
508 # Fix compiler path
509 $(call QT_QMAKE_SET,QMAKE_CC,$(TARGET_CC),$(@D))
510 $(call QT_QMAKE_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
511 $(call QT_QMAKE_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
512 $(call QT_QMAKE_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
513 $(call QT_QMAKE_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
514 $(call QT_QMAKE_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
515 $(call QT_QMAKE_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
516 $(call QT_QMAKE_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
517 $(call QT_QMAKE_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
518 $(call QT_QMAKE_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
519 $(call QT_QMAKE_SET,QMAKE_LFLAGS,$(QT_LDFLAGS),$(@D))
520 $(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/usr/bin/pkg-config,$(@D))
521 # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
522 # instead of the host then. So set PKG_CONFIG* manually.
523 (cd $(@D); \
524 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
525 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
526 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
527 $(TARGET_MAKE_ENV) \
528 MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" ./configure \
529 $(if $(VERBOSE),-verbose,-silent) \
530 -force-pkg-config \
531 $(QT_CONFIGURE_OPTS) \
532 -no-xinerama \
533 -no-cups \
534 -no-nis \
535 -no-separate-debug-info \
536 -prefix /usr \
537 -plugindir /usr/lib/qt/plugins \
538 -importdir /usr/lib/qt/imports \
539 -translationdir /usr/share/qt/translations \
540 -hostprefix $(STAGING_DIR) \
541 -fast \
542 -no-rpath \
544 endef
546 define QT_BUILD_CMDS
547 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
548 endef
551 # Build the list of libraries and plugins to install to the target
553 QT_INSTALL_LIBS += QtCore
554 QT_HOST_PROGRAMS += moc rcc qmake lrelease
556 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
557 QT_INSTALL_LIBS += QtGui
558 QT_HOST_PROGRAMS += uic
559 endif
560 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
561 QT_INSTALL_LIBS += QtSql
562 endif
563 ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
564 QT_INSTALL_LIBS += QtMultimedia
565 endif
566 ifeq ($(BR2_PACKAGE_QT_PHONON),y)
567 QT_INSTALL_LIBS += phonon
568 endif
569 ifeq ($(BR2_PACKAGE_QT_SVG),y)
570 QT_INSTALL_LIBS += QtSvg
571 endif
572 ifeq ($(BR2_PACKAGE_QT_NETWORK),y)
573 QT_INSTALL_LIBS += QtNetwork
574 endif
575 ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
576 QT_INSTALL_LIBS += QtWebKit
577 endif
578 ifeq ($(BR2_PACKAGE_QT_XML),y)
579 QT_INSTALL_LIBS += QtXml
580 endif
581 ifeq ($(BR2_PACKAGE_QT_DBUS),y)
582 QT_INSTALL_LIBS += QtDBus
583 endif
584 ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
585 QT_INSTALL_LIBS += QtXmlPatterns
586 endif
587 ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
588 QT_INSTALL_LIBS += QtScript
589 endif
590 ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
591 QT_INSTALL_LIBS += QtScriptTools
592 endif
593 ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
594 QT_INSTALL_LIBS += QtDeclarative
595 endif
596 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
597 QT_INSTALL_LIBS += Qt3Support
598 endif
599 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
600 QT_INSTALL_LIBS += QtOpenGL
601 endif
602 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
603 QT_INSTALL_LIBS += pvrQWSWSEGL
604 endif
605 ifeq ($(BR2_PACKAGE_QT_TEST),y)
606 QT_INSTALL_LIBS += QtTest
607 endif
609 QT_CONF_FILE = $(HOST_DIR)/usr/bin/qt.conf
611 # Since host programs and spec files have been moved to $(HOST_DIR),
612 # we need to tell qmake the new location of the various elements,
613 # through a qt.conf file.
614 define QT_INSTALL_QT_CONF
615 mkdir -p $(dir $(QT_CONF_FILE))
616 echo "[Paths]" > $(QT_CONF_FILE)
617 echo "Prefix=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
618 echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
619 echo "Libraries=$(STAGING_DIR)/usr/lib" >> $(QT_CONF_FILE)
620 echo "Data=$(HOST_DIR)/usr" >> $(QT_CONF_FILE)
621 echo "Binaries=$(HOST_DIR)/usr/bin" >> $(QT_CONF_FILE)
622 endef
624 # After running Qt normal installation process (which installs
625 # everything in the STAGING_DIR), we move host programs such as qmake,
626 # rcc or uic to the HOST_DIR so that they are available at the usual
627 # location. A qt.conf file is generated to make sure that all host
628 # programs still find all files they need. The .pc files are tuned to
629 # remove the sysroot path from them, since pkg-config already adds it
630 # automatically.
631 define QT_INSTALL_STAGING_CMDS
632 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
633 mkdir -p $(HOST_DIR)/usr/bin
634 mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
635 ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
636 $(QT_INSTALL_QT_CONF)
637 for i in moc uic rcc lupdate lrelease ; do \
638 $(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/usr/bin/$${i}," \
639 $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
640 done
641 $(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
642 endef
644 # Library installation
645 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
646 define QT_INSTALL_TARGET_LIBS
647 mkdir -p $(TARGET_DIR)/usr/lib
648 for lib in $(QT_INSTALL_LIBS); do \
649 cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib ; \
650 done
651 endef
652 endif
654 # Plugin installation
655 define QT_INSTALL_TARGET_PLUGINS
656 if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
657 mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
658 cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
660 endef
662 # Import installation
663 define QT_INSTALL_TARGET_IMPORTS
664 if [ -d $(STAGING_DIR)/usr/lib/qt/imports/ ] ; then \
665 mkdir -p $(TARGET_DIR)/usr/lib/qt/imports ; \
666 cp -dpfr $(STAGING_DIR)/usr/lib/qt/imports/* $(TARGET_DIR)/usr/lib/qt/imports ; \
668 endef
670 # Fonts installation
671 ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
672 ifneq ($(QT_FONTS),)
673 define QT_INSTALL_TARGET_FONTS
674 mkdir -p $(TARGET_DIR)/usr/lib/fonts
675 cp -dpf $(QT_FONTS) $(TARGET_DIR)/usr/lib/fonts
676 endef
677 ifneq ($(BR2_PACKAGE_QT_FONT_MICRO)$(BR2_PACKAGE_QT_FONT_FIXED),)
678 # as stated in the font source src/3rdparty/fonts/micro.bdf
679 # source src/3rdparty/fonts/5x7.bdf and source src/3rdparty/fonts/6x13.bdf
680 QT_LICENSE := $(QT_LICENSE), Public Domain (Micro/Fixed font)
681 endif
682 ifneq ($(BR2_PACKAGE_QT_FONT_HELVETICA)$(BR2_PACKAGE_QT_FONT_JAPANESE),)
683 QT_LICENSE := $(QT_LICENSE), Adobe Helvetica license (Helvetica/Japanese fonts)
684 QT_LICENSE_FILES += src/3rdparty/fonts/COPYING.Helvetica
685 endif
686 ifeq ($(BR2_PACKAGE_QT_FONT_UNIFONT),y)
687 QT_LICENSE := $(QT_LICENSE), Freeware (Unifont font)
688 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.Unifont
689 endif
690 endif # QT_FONTS
692 ifeq ($(BR2_PACKAGE_QT_QTFREETYPE)$(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
693 define QT_INSTALL_TARGET_FONTS_TTF
694 mkdir -p $(TARGET_DIR)/usr/lib/fonts
695 cp -dpf $(STAGING_DIR)/usr/lib/fonts/*.ttf $(TARGET_DIR)/usr/lib/fonts
696 endef
697 QT_LICENSE := $(QT_LICENSE), Bitstream license (DejaVu/Vera TrueType fonts)
698 QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.DejaVu \
699 src/3rdparty/fonts/README.DejaVu \
700 src/3rdparty/fonts/COPYRIGHT.Vera
701 endif
702 endif # BR2_PACKAGE_QT_EMBEDDED
704 ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
705 define QT_INSTALL_TARGET_POWERVR
706 # Note: this overwrites the default powervr.ini provided by the ti-gfx
707 # package.
708 $(INSTALL) -D -m 0644 package/qt/powervr.ini \
709 $(TARGET_DIR)/etc/powervr.ini
710 endef
711 endif
713 ifeq ($(BR2_PACKAGE_QT_TRANSLATION_FILES),y)
714 define QT_INSTALL_TARGET_TRANSLATIONS
715 if [ -d $(STAGING_DIR)/usr/share/qt/translations/ ] ; then \
716 mkdir -p $(TARGET_DIR)/usr/share/qt/translations ; \
717 cp -dpfr $(STAGING_DIR)/usr/share/qt/translations/* $(TARGET_DIR)/usr/share/qt/translations ; \
719 endef
720 endif
722 define QT_INSTALL_TARGET_CMDS
723 $(QT_INSTALL_TARGET_LIBS)
724 $(QT_INSTALL_TARGET_PLUGINS)
725 $(QT_INSTALL_TARGET_IMPORTS)
726 $(QT_INSTALL_TARGET_FONTS)
727 $(QT_INSTALL_TARGET_FONTS_TTF)
728 $(QT_INSTALL_TARGET_POWERVR)
729 $(QT_INSTALL_TARGET_TRANSLATIONS)
730 endef
732 $(eval $(generic-package))