c3bd3a98bca16c805022fdcc009146e69f187d12
[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 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 -I$(PKG_BUILD_DIR)/include"
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 -plugin-sql-sqlite \
244 -plugin-sql-mysql \
245 -no-decoration-styled \
246 -no-decoration-windows \
247 -no-decoration-default \
248 -verbose \
249 -no-multimedia \
250 -no-audio-backend \
251 -phonon \
252 -no-phonon-backend \
253 -svg \
254 -webkit \
255 -no-javascript-jit \
256 -script \
257 -scripttools \
258 -no-accessibility \
259 -declarative \
260 -no-openssl \
261 -no-nis \
262 -no-cups \
263 -no-iconv \
264 -dbus \
265 -no-gtkstyle \
266 -no-nas-sound \
267 -no-opengl \
268 -no-openvg \
269 -no-sm \
270 -no-xshape \
271 -no-xsync \
272 -no-xinerama \
273 -no-xcursor \
274 -no-xfixes \
275 -no-xrandr \
276 -no-xrender \
277 -no-mitshm \
278 -no-fontconfig \
279 -no-xinput \
280 -no-xkb \
281 -no-glib \
282 -qt3support \
283 -qt-gfx-directfb \
284 -qt-gfx-linuxfb \
285 -no-gfx-multiscreen \
286 )
287 endef
288
289 define Build/Compile
290 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
291 $(MAKE) -C $(PKG_BUILD_DIR)
292 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
293 $(MAKE) -C $(PKG_BUILD_DIR) install
294 endef
295
296 define Build/InstallDev
297 $(INSTALL_DIR) \
298 $(1)/usr/share/mkspecs \
299 $(1)/usr/lib/pkgconfig \
300 $(1)/usr/lib \
301 $(1)/usr/include \
302 $(1)/usr/lib/Qt/plugins
303
304 $(CP) \
305 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
306 $(1)/usr/share/mkspecs/
307
308 $(INSTALL_DATA) \
309 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
310 $(1)/usr/lib/pkgconfig/
311
312 $(CP) \
313 $(PKG_INSTALL_DIR)/usr/include/* \
314 $(1)/usr/include/
315
316 $(CP) \
317 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
318 $(1)/usr/lib/
319
320 #$(CP) \
321 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
322 # $(1)/usr/lib/Qt/plugins/
323 endef
324
325 define Package/qt4/install
326 $(INSTALL_DIR) \
327 $(1)/usr/lib \
328 $(1)/usr/lib/Qt/plugins
329
330 $(CP) \
331 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
332 $(1)/usr/lib/
333
334 #$(CP) \
335 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
336 # $(1)/usr/lib/Qt/plugins/codecs/
337 endef
338
339 define Package/qt4-gui/install
340 $(INSTALL_DIR) \
341 $(1)/usr/lib \
342 $(1)/usr/lib/Qt/plugins
343
344 $(CP) \
345 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
346 $(1)/usr/lib/
347
348 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
349 ln -s \
350 /usr/share/fonts/ttf-dejavu \
351 $(1)/usr/lib/fonts
352
353 # we use the dejavue font package instead
354 #$(INSTALL_DATA) \
355 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
356 # $(1)/usr/lib/fonts/
357
358 #$(CP) \
359 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
360 # $(1)/usr/lib/Qt/plugins/
361
362 #$(CP) \
363 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
364 # $(1)/usr/lib/Qt/plugins/
365
366 #$(CP) \
367 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
368 # $(1)/usr/lib/Qt/plugins/
369 endef
370
371 define Package/qt4-demos/install
372 $(INSTALL_DIR) \
373 $(1)/usr/share/Qt
374
375 $(CP) \
376 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
377 $(1)/usr/share/Qt/
378
379 $(FIND) \
380 $(1) \
381 -name "*.cpp" -o \
382 -name "*.h" -o \
383 -name "*.pro" \
384 | $(XARGS) rm
385 endef
386
387 define Package/qt4-examples/install
388 $(INSTALL_DIR) \
389 $(1)/usr/share/Qt
390
391 $(CP) \
392 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
393 $(1)/usr/share/Qt/
394
395 $(FIND) \
396 $(1) \
397 -name "*.cpp" -o \
398 -name "*.h" -o \
399 -name "*.pro" \
400 | $(XARGS) rm
401 endef
402
403 define Package/qt4-network/install
404 $(INSTALL_DIR) \
405 $(1)/usr/lib
406
407 $(CP) \
408 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
409 $(1)/usr/lib/
410 endef
411
412 define Package/qt4-sqlite/install
413 $(INSTALL_DIR) \
414 $(1)/usr/lib/Qt/plugins/sqldrivers
415
416 $(CP) \
417 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
418 $(1)/usr/lib/
419
420 $(CP) \
421 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
422 $(1)/usr/lib/Qt/plugins/sqldrivers/
423 endef
424
425 define Package/qt4-mysql/install
426 $(INSTALL_DIR) \
427 $(1)/usr/lib/Qt/plugins/sqldrivers
428
429 $(CP) \
430 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
431 $(1)/usr/lib/
432
433 $(CP) \
434 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
435 $(1)/usr/lib/Qt/plugins/sqldrivers/
436 endef
437
438 #define Package/qt4-multimedia/install
439 # $(INSTALL_DIR) \
440 # $(1)/usr/bin
441 #
442 # $(CP) \
443 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
444 # $(1)/usr/bin/
445 #endef
446
447 define Package/qt4-phonon/install
448 $(INSTALL_DIR) \
449 $(1)/usr/lib
450
451 $(CP) \
452 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
453 $(1)/usr/lib/
454 endef
455
456 define Package/qt4-svg/install
457 $(INSTALL_DIR) \
458 $(1)/usr/lib \
459 $(1)/usr/lib/Qt/plugins
460
461 $(CP) \
462 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
463 $(1)/usr/lib/
464
465 #$(CP) \
466 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
467 # $(1)/usr/lib/Qt/plugins/
468
469 #$(CP) \
470 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
471 # $(1)/usr/lib/Qt/plugins/
472 endef
473
474 define Package/qt4-webkit/install
475 $(INSTALL_DIR) \
476 $(1)/usr/lib \
477 $(1)/usr/lib/Qt/plugins
478
479 $(CP) \
480 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
481 $(1)/usr/lib/
482
483 #$(CP) \
484 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
485 # $(1)/usr/lib/Qt/plugins/
486 endef
487
488 define Package/qt4-script/install
489 $(INSTALL_DIR) \
490 $(1)/usr/lib \
491 $(1)/usr/lib/Qt/plugins
492
493 $(CP) \
494 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
495 $(1)/usr/lib/
496
497 #$(CP) \
498 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
499 # $(1)/usr/lib/Qt/plugins/
500 endef
501
502 define Package/qt4-scripttools/install
503 $(INSTALL_DIR) \
504 $(1)/usr/lib
505
506 $(CP) \
507 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
508 $(1)/usr/lib/
509 endef
510
511 define Package/qt4-dbus/install
512 $(INSTALL_DIR) \
513 $(1)/usr/lib
514
515 $(CP) \
516 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
517 $(1)/usr/lib/
518
519 #$(CP) \
520 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
521 # $(1)/usr/bin/
522 endef
523
524 define Package/qt4-qt3-support/install
525 $(INSTALL_DIR) \
526 $(1)/usr/lib \
527 $(1)/usr/lib/Qt/plugins
528
529 $(CP) \
530 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
531 $(1)/usr/lib/
532
533 #$(CP) \
534 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
535 # $(1)/usr/lib/Qt/plugins/
536 endef
537
538 define Package/qt4-declarative/install
539 $(INSTALL_DIR) \
540 $(1)/usr/lib
541
542 $(CP) \
543 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
544 $(1)/usr/lib/
545 endef
546
547 $(eval $(call BuildPackage,qt4))
548 $(eval $(call BuildPackage,qt4-gui))
549 $(eval $(call BuildPackage,qt4-demos))
550 $(eval $(call BuildPackage,qt4-examples))
551 $(eval $(call BuildPackage,qt4-network))
552 $(eval $(call BuildPackage,qt4-sqlite))
553 $(eval $(call BuildPackage,qt4-mysql))
554 #$(eval $(call BuildPackage,qt4-multimedia))
555 #$(eval $(call BuildPackage,qt4-audio-backend))
556 $(eval $(call BuildPackage,qt4-phonon))
557 #$(eval $(call BuildPackage,qt4-phonon-backend))
558 $(eval $(call BuildPackage,qt4-svg))
559 $(eval $(call BuildPackage,qt4-webkit))
560 $(eval $(call BuildPackage,qt4-script))
561 $(eval $(call BuildPackage,qt4-scripttools))
562 #$(eval $(call BuildPackage,qt4-accessibility))
563 #$(eval $(call BuildPackage,qt4-javascript-jit))
564 #$(eval $(call BuildPackage,qt4-cups))
565 $(eval $(call BuildPackage,qt4-dbus))
566 #$(eval $(call BuildPackage,qt4-gtkstyle))
567 #$(eval $(call BuildPackage,qt4-glib))
568 $(eval $(call BuildPackage,qt4-qt3support))
569 $(eval $(call BuildPackage,qt4-declarative))