qt4: do not compile parts which require nptl support when no nptl support is availabl...
[openwrt/svn-archive/archive.git] / Xorg / lib / qt4 / Makefile
1 #
2 # Copyright (C) 2008-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # TODO:
9 # - handle software which uses qmake in a more generic way (move functionality / generic qmake-config into buildroot)
10 # - use generic qmake, moc, etc. executables since building them within the qt stack will get redundant and annyoing when other sw will need them as well
11 # - test/add X11/xcb support
12 # - handle plugins in a granular way (find out which packages should provide which plugins)
13
14 include $(TOPDIR)/rules.mk
15
16 PKG_NAME:=qt4
17 PKG_VERSION:=4.7.0-beta2
18 PKG_RELEASE:=1
19
20 PKG_SOURCE:=qt-everywhere-opensource-src-$(PKG_VERSION).tar.gz
21 PKG_SOURCE_URL:=ftp://ftp.qt.nokia.com/qt/source
22 PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/package.mk
25
26 # this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
27 ifeq ($(CONFIG_USE_GLIBC),y)
28 NPTL:=y
29 endif
30 ifeq ($(CONFIG_USE_EGLIBC),y)
31 NPTL:=y
32 endif
33 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
34 NPTL:=y
35 endif
36
37 define Package/qt4/Default
38 SECTION:=xorg-framework
39 CATEGORY:=Xorg
40 SUBMENU:=framework
41 TITLE:=qt4
42 DEPENDS:=qt4
43 URL:=http://qt.nokia.com/
44 endef
45
46 define Package/qt4
47 $(call Package/qt4/Default)
48 DEPENDS:=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb +zlib +libstdcpp +libsqlite3 # require directfb for now, as other systems (libX11, xcb) are untested
49 endef
50
51 define Package/qt4-gui
52 $(call Package/qt4/Default)
53 #DEPENDS+=+FEATURE_drawing-backend_DirectFB:directfb +libpng +libtiff +libjpeg +libfreetype
54 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network
55 TITLE+=(gui)
56 endef
57
58 define Package/qt4-demos
59 $(call Package/qt4/Default)
60 TITLE+=(demos)
61 DEPENDS+=+qt4-gui
62 endef
63
64 define Package/qt4-examples
65 $(call Package/qt4/Default)
66 TITLE+=(examples)
67 DEPENDS+=+qt4-gui
68 endef
69
70 define Package/qt4-network
71 $(call Package/qt4/Default)
72 TITLE+=(network)
73 endef
74
75 define Package/qt4-sqlite
76 $(call Package/qt4/Default)
77 TITLE+=(sqlite)
78 DEPENDS+=+libsqlite3
79 endef
80
81 define Package/qt4-mysql
82 $(call Package/qt4/Default)
83 TITLE+=(mysql)
84 DEPENDS+=+libmysqlclient
85 endef
86
87 #define Package/qt4-multimedia
88 # $(call Package/qt4/Default)
89 # TITLE+=(multimedia)
90 #endef
91
92 #define Package/qt4-audio-backend
93 # $(call Package/qt4/Default)
94 # TITLE+=(audio-backend)
95 #endef
96
97 define Package/qt4-phonon
98 $(call Package/qt4/Default)
99 TITLE+=(phonon)
100 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
101 endef
102
103 #define Package/qt4-phonon-backend
104 # $(call Package/qt4/Default)
105 # TITLE+=(phonon-backend)
106 #endef
107
108 define Package/qt4-svg
109 $(call Package/qt4/Default)
110 TITLE+=(svg)
111 #DEPENDS+=+qt4-gui @BROKEN
112 DEPENDS+=+qt4-gui +qt4-network
113 endef
114
115 define Package/qt4-webkit
116 $(call Package/qt4/Default)
117 TITLE+=(webkit)
118 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 +libsqlite3 +qt4-phonon +qt4-dbus +qt4-xml +qt4-gui +qt4-network # versions of uclibc prior 0.9.32 do not have nptl support
119 endef
120
121 define Package/qt4-script
122 $(call Package/qt4/Default)
123 TITLE+=(script)
124 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
125 endef
126
127 define Package/qt4-scripttools
128 $(call Package/qt4/Default)
129 TITLE+=(scripttools)
130 DEPENDS+=+qt4-script +qt4-gui +qt4-network
131 endef
132
133 #define Package/qt4-accessibility
134 # $(call Package/qt4/Default)
135 # TITLE+=(accessibility)
136 #endef
137
138 #define Package/qt4-javascript-jit
139 # $(call Package/qt4/Default)
140 # TITLE+=(javascript-jit)
141 #endef
142
143 #define Package/qt4-cups
144 # $(call Package/qt4/Default)
145 # TITLE+=(cups)
146 #endef
147
148 define Package/qt4-dbus
149 $(call Package/qt4/Default)
150 TITLE+=(dbus)
151 DEPENDS+=+libdbus +qt4-xml
152 endef
153
154 #define Package/qt4-gtkstyle
155 # $(call Package/qt4/Default)
156 # TITLE+=(gtkstyle)
157 #endef
158
159 #define Package/qt4-glib
160 # $(call Package/qt4/Default)
161 # TITLE+=(glib)
162 #endef
163
164 define Package/qt4-qt3support
165 $(call Package/qt4/Default)
166 TITLE+=(qt3support)
167 DEPENDS+=+qt4-gui +qt4-xml
168 endef
169
170 define Package/qt4-declarative
171 $(call Package/qt4/Default)
172 TITLE+=(declarative)
173 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
174 endef
175
176 define Package/qt4-xml
177 $(call Package/qt4/Default)
178 TITLE+=(xml)
179 endef
180
181 TARGET_CFLAGS+="-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include"
182
183 define Build/Configure
184 # NOTES:
185 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
186 # svg: always compile in svg-support, as once qt is built without, strange include errors occur when we're going to compile qt4-svg afterwards
187 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
188 # do not use fontconfig as it doesn't work anyway for qte
189 # bindir: bindir is where the host tools (qmake, moc, rcc, uic) will get installed into - they are just used on the host and not goig to be packaged
190 ( \
191 cd $(PKG_BUILD_DIR); \
192 QPATH='mkspecs/qws/linux-openwrt-g++' ; \
193 mkdir $$$$QPATH ; \
194 echo '#include "../../linux-g++/qplatformdefs.h"' \
195 >> $$$$QPATH/qplatformdefs.h ; \
196 echo 'include(../../common/g++.conf)' \
197 >> $$$$QPATH/qmake.conf ; \
198 echo 'include(../../common/linux.conf)' \
199 >> $$$$QPATH/qmake.conf ; \
200 echo 'include(../../common/qws.conf)' \
201 >> $$$$QPATH/qmake.conf ; \
202 echo "QMAKE_CC = $(TARGET_CC)" \
203 >> $$$$QPATH/qmake.conf ; \
204 echo "QMAKE_CXX = $(TARGET_CXX)" \
205 >> $$$$QPATH/qmake.conf ; \
206 echo "QMAKE_AR = $(TARGET_CROSS)ar cqs" \
207 >> $$$$QPATH/qmake.conf ; \
208 echo "QMAKE_OBJCOPY = $(TARGET_CROSS)objcopy" \
209 >> $$$$QPATH/qmake.conf ; \
210 echo "QMAKE_RANLIB = $(TARGET_CROSS)ranlib" \
211 >> $$$$QPATH/qmake.conf ; \
212 echo "QMAKE_CFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
213 >> $$$$QPATH/qmake.conf ; \
214 echo "QMAKE_CXXFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
215 >> $$$$QPATH/qmake.conf ; \
216 echo "QMAKE_LINK = $(TARGET_CXX)" \
217 >> $$$$QPATH/qmake.conf ; \
218 echo "QMAKE_LINK_SHLIB = $(TARGET_CXX)" \
219 >> $$$$QPATH/qmake.conf ; \
220 echo "QMAKE_LINK_C = $(TARGET_CC)" \
221 >> $$$$QPATH/qmake.conf ; \
222 echo "QMAKE_LINK_C_SHLIB = $(TARGET_CC)" \
223 >> $$$$QPATH/qmake.conf ; \
224 echo "QMAKE_LFLAGS = -L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \
225 >> $$$$QPATH/qmake.conf ; \
226 echo "QMAKE_STRIP = : " \
227 >> $$$$QPATH/qmake.conf ; \
228 echo "QMAKE_STRIPFLAGS_LIB = " \
229 >> $$$$QPATH/qmake.conf ; \
230 echo 'load(qt_config)' \
231 >> $$$$QPATH/qmake.conf ; \
232 echo yes | ./configure \
233 -prefix $(CONFIGURE_PREFIX) \
234 -bindir $(CONFIGURE_PREFIX)/bin \
235 -libdir $(CONFIGURE_PREFIX)/lib \
236 -datadir $(CONFIGURE_PREFIX)/share/Qt \
237 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
238 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
239 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
240 -sysconfdir /etc/Qt \
241 -no-rpath \
242 -force-pkg-config \
243 -nomake tools \
244 -make demos \
245 -make examples \
246 -nomake docs \
247 -nomake translations \
248 -embedded openwrt \
249 -platform linux-g++ \
250 -release \
251 -opensource \
252 -no-mmx \
253 -no-3dnow \
254 -no-sse \
255 -no-sse2 \
256 -system-zlib \
257 -system-libtiff \
258 -system-libpng \
259 -system-libjpeg \
260 -system-freetype \
261 -system-sqlite \
262 -plugin-sql-sqlite \
263 -plugin-sql-mysql \
264 -no-decoration-styled \
265 -no-decoration-windows \
266 -no-decoration-default \
267 -verbose \
268 -no-multimedia \
269 -no-audio-backend \
270 -phonon \
271 -no-phonon-backend \
272 -svg \
273 -$(if $(NPTL),webkit,-no-webkit) \
274 -no-javascript-jit \
275 -$(if $(NPTL),script,-no-script) \
276 -$(if $(NPTL),scripttools,-no-scripttools) \
277 -no-accessibility \
278 -$(if $(NPTL),declarative,-no-declarative) \
279 -no-openssl \
280 -no-nis \
281 -no-cups \
282 -no-iconv \
283 -dbus \
284 -no-gtkstyle \
285 -no-nas-sound \
286 -no-opengl \
287 -no-openvg \
288 -no-sm \
289 -no-xshape \
290 -no-xsync \
291 -no-xinerama \
292 -no-xcursor \
293 -no-xfixes \
294 -no-xrandr \
295 -no-xrender \
296 -no-mitshm \
297 -no-fontconfig \
298 -no-xinput \
299 -no-xkb \
300 -no-glib \
301 -qt3support \
302 -qt-gfx-directfb \
303 -qt-gfx-linuxfb \
304 -no-gfx-multiscreen \
305 )
306 endef
307
308 define Build/Compile
309 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
310 $(MAKE) -C $(PKG_BUILD_DIR)
311 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
312 $(MAKE) -C $(PKG_BUILD_DIR) install
313 endef
314
315 define Build/InstallDev
316 $(INSTALL_DIR) \
317 $(STAGING_DIR_HOST)/bin
318
319 # host tools (qmake, moc, rcc, uic)
320 $(CP) \
321 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
322 $(STAGING_DIR_HOST)/bin/
323
324 $(INSTALL_DIR) \
325 $(1)/usr/share/mkspecs \
326 $(1)/usr/lib/pkgconfig \
327 $(1)/usr/lib \
328 $(1)/usr/include \
329 $(1)/usr/lib/Qt/plugins
330
331 $(CP) \
332 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
333 $(1)/usr/share/mkspecs/
334
335 $(INSTALL_DATA) \
336 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
337 $(1)/usr/lib/pkgconfig/
338
339 $(CP) \
340 $(PKG_INSTALL_DIR)/usr/include/* \
341 $(1)/usr/include/
342
343 $(CP) \
344 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
345 $(1)/usr/lib/
346
347 #$(CP) \
348 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
349 # $(1)/usr/lib/Qt/plugins/
350 endef
351
352 define Package/qt4/install
353 $(INSTALL_DIR) \
354 $(1)/usr/lib \
355 $(1)/usr/lib/Qt/plugins
356
357 $(CP) \
358 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
359 $(1)/usr/lib/
360
361 #$(CP) \
362 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
363 # $(1)/usr/lib/Qt/plugins/codecs/
364 endef
365
366 define Package/qt4-gui/install
367 $(INSTALL_DIR) \
368 $(1)/usr/lib \
369 $(1)/usr/lib/Qt/plugins
370
371 $(CP) \
372 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
373 $(1)/usr/lib/
374
375 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
376 ln -s \
377 /usr/share/fonts/ttf-dejavu \
378 $(1)/usr/lib/fonts
379
380 # we use the dejavue font package instead
381 #$(INSTALL_DATA) \
382 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
383 # $(1)/usr/lib/fonts/
384
385 #$(CP) \
386 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
387 # $(1)/usr/lib/Qt/plugins/
388
389 #$(CP) \
390 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
391 # $(1)/usr/lib/Qt/plugins/
392
393 #$(CP) \
394 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
395 # $(1)/usr/lib/Qt/plugins/
396 endef
397
398 define Package/qt4-demos/install
399 $(INSTALL_DIR) \
400 $(1)/usr/share/Qt
401
402 $(CP) \
403 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
404 $(1)/usr/share/Qt/
405
406 $(FIND) \
407 $(1) \
408 -name "*.cpp" -o \
409 -name "*.h" -o \
410 -name "*.pro" \
411 | $(XARGS) rm
412 endef
413
414 define Package/qt4-examples/install
415 $(INSTALL_DIR) \
416 $(1)/usr/share/Qt
417
418 $(CP) \
419 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
420 $(1)/usr/share/Qt/
421
422 $(FIND) \
423 $(1) \
424 -name "*.cpp" -o \
425 -name "*.h" -o \
426 -name "*.pro" \
427 | $(XARGS) rm
428 endef
429
430 define Package/qt4-network/install
431 $(INSTALL_DIR) \
432 $(1)/usr/lib
433
434 $(CP) \
435 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
436 $(1)/usr/lib/
437 endef
438
439 define Package/qt4-sqlite/install
440 $(INSTALL_DIR) \
441 $(1)/usr/lib/Qt/plugins/sqldrivers
442
443 $(CP) \
444 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
445 $(1)/usr/lib/
446
447 $(CP) \
448 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
449 $(1)/usr/lib/Qt/plugins/sqldrivers/
450 endef
451
452 define Package/qt4-mysql/install
453 $(INSTALL_DIR) \
454 $(1)/usr/lib/Qt/plugins/sqldrivers
455
456 $(CP) \
457 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
458 $(1)/usr/lib/
459
460 $(CP) \
461 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
462 $(1)/usr/lib/Qt/plugins/sqldrivers/
463 endef
464
465 #define Package/qt4-multimedia/install
466 # $(INSTALL_DIR) \
467 # $(1)/usr/bin
468 #
469 # $(CP) \
470 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
471 # $(1)/usr/bin/
472 #endef
473
474 define Package/qt4-phonon/install
475 $(INSTALL_DIR) \
476 $(1)/usr/lib
477
478 $(CP) \
479 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
480 $(1)/usr/lib/
481 endef
482
483 define Package/qt4-svg/install
484 $(INSTALL_DIR) \
485 $(1)/usr/lib \
486 $(1)/usr/lib/Qt/plugins
487
488 $(CP) \
489 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
490 $(1)/usr/lib/
491
492 #$(CP) \
493 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
494 # $(1)/usr/lib/Qt/plugins/
495
496 #$(CP) \
497 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
498 # $(1)/usr/lib/Qt/plugins/
499 endef
500
501 define Package/qt4-webkit/install
502 $(INSTALL_DIR) \
503 $(1)/usr/lib \
504 $(1)/usr/lib/Qt/plugins
505
506 $(CP) \
507 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
508 $(1)/usr/lib/
509
510 #$(CP) \
511 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
512 # $(1)/usr/lib/Qt/plugins/
513 endef
514
515 define Package/qt4-script/install
516 $(INSTALL_DIR) \
517 $(1)/usr/lib \
518 $(1)/usr/lib/Qt/plugins
519
520 $(CP) \
521 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
522 $(1)/usr/lib/
523
524 #$(CP) \
525 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
526 # $(1)/usr/lib/Qt/plugins/
527 endef
528
529 define Package/qt4-scripttools/install
530 $(INSTALL_DIR) \
531 $(1)/usr/lib
532
533 $(CP) \
534 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
535 $(1)/usr/lib/
536 endef
537
538 define Package/qt4-dbus/install
539 $(INSTALL_DIR) \
540 $(1)/usr/lib
541
542 $(CP) \
543 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
544 $(1)/usr/lib/
545
546 #$(CP) \
547 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
548 # $(1)/usr/bin/
549 endef
550
551 define Package/qt4-qt3-support/install
552 $(INSTALL_DIR) \
553 $(1)/usr/lib \
554 $(1)/usr/lib/Qt/plugins
555
556 $(CP) \
557 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
558 $(1)/usr/lib/
559
560 #$(CP) \
561 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
562 # $(1)/usr/lib/Qt/plugins/
563 endef
564
565 define Package/qt4-declarative/install
566 $(INSTALL_DIR) \
567 $(1)/usr/lib
568
569 $(CP) \
570 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
571 $(1)/usr/lib/
572 endef
573
574 define Package/qt4-xml/install
575 $(INSTALL_DIR) \
576 $(1)/usr/lib
577
578 $(CP) \
579 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
580 $(1)/usr/lib/
581 endef
582
583
584 $(eval $(call BuildPackage,qt4))
585 $(eval $(call BuildPackage,qt4-gui))
586 $(eval $(call BuildPackage,qt4-demos))
587 $(eval $(call BuildPackage,qt4-examples))
588 $(eval $(call BuildPackage,qt4-network))
589 $(eval $(call BuildPackage,qt4-sqlite))
590 $(eval $(call BuildPackage,qt4-mysql))
591 #$(eval $(call BuildPackage,qt4-multimedia))
592 #$(eval $(call BuildPackage,qt4-audio-backend))
593 $(eval $(call BuildPackage,qt4-phonon))
594 #$(eval $(call BuildPackage,qt4-phonon-backend))
595 $(eval $(call BuildPackage,qt4-svg))
596 $(eval $(call BuildPackage,qt4-webkit))
597 $(eval $(call BuildPackage,qt4-script))
598 $(eval $(call BuildPackage,qt4-scripttools))
599 #$(eval $(call BuildPackage,qt4-accessibility))
600 #$(eval $(call BuildPackage,qt4-javascript-jit))
601 #$(eval $(call BuildPackage,qt4-cups))
602 $(eval $(call BuildPackage,qt4-dbus))
603 #$(eval $(call BuildPackage,qt4-gtkstyle))
604 #$(eval $(call BuildPackage,qt4-glib))
605 $(eval $(call BuildPackage,qt4-qt3support))
606 $(eval $(call BuildPackage,qt4-declarative))
607 $(eval $(call BuildPackage,qt4-xml))