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