afadf9f66916fd333b280fea0e0215a650de877d
[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.6.2
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 # until we do not have nptl-support within uclibc javascriptcore will fail to link against uclibc
108 endef
109
110 define Package/qt4-script
111 $(call Package/qt4/Default)
112 TITLE+=(script)
113 DEPENDS+=@USE_GLIBC||@USE_EGLIBC # until we do not have nptl-support within uclibc, javascriptcore will fail to link against uclibc
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 TARGET_CFLAGS+="-I$(STAGING_DIR)/usr/include/freetype2"
159
160 define Build/Configure
161 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
162 # 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
163 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
164 # do not use fontconfig as it doesn't work anyway for qte
165 ( \
166 cd $(PKG_BUILD_DIR); \
167 QPATH='mkspecs/qws/linux-openwrt-g++' ; \
168 mkdir $$$$QPATH ; \
169 echo '#include "../../linux-g++/qplatformdefs.h"' \
170 >> $$$$QPATH/qplatformdefs.h ; \
171 echo 'include(../../common/g++.conf)' \
172 >> $$$$QPATH/qmake.conf ; \
173 echo 'include(../../common/linux.conf)' \
174 >> $$$$QPATH/qmake.conf ; \
175 echo 'include(../../common/qws.conf)' \
176 >> $$$$QPATH/qmake.conf ; \
177 echo "QMAKE_CC = $(TARGET_CC)" \
178 >> $$$$QPATH/qmake.conf ; \
179 echo "QMAKE_CXX = $(TARGET_CXX)" \
180 >> $$$$QPATH/qmake.conf ; \
181 echo "QMAKE_AR = $(TARGET_CROSS)ar cqs" \
182 >> $$$$QPATH/qmake.conf ; \
183 echo "QMAKE_OBJCOPY = $(TARGET_CROSS)objcopy" \
184 >> $$$$QPATH/qmake.conf ; \
185 echo "QMAKE_RANLIB = $(TARGET_CROSS)ranlib" \
186 >> $$$$QPATH/qmake.conf ; \
187 echo "QMAKE_CFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
188 >> $$$$QPATH/qmake.conf ; \
189 echo "QMAKE_CXXFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
190 >> $$$$QPATH/qmake.conf ; \
191 echo "QMAKE_LINK = $(TARGET_CXX)" \
192 >> $$$$QPATH/qmake.conf ; \
193 echo "QMAKE_LINK_SHLIB = $(TARGET_CXX)" \
194 >> $$$$QPATH/qmake.conf ; \
195 echo "QMAKE_LINK_C = $(TARGET_CC)" \
196 >> $$$$QPATH/qmake.conf ; \
197 echo "QMAKE_LINK_C_SHLIB = $(TARGET_CC)" \
198 >> $$$$QPATH/qmake.conf ; \
199 echo "QMAKE_LFLAGS = -L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \
200 >> $$$$QPATH/qmake.conf ; \
201 echo "QMAKE_STRIP = : " \
202 >> $$$$QPATH/qmake.conf ; \
203 echo "QMAKE_STRIPFLAGS_LIB = " \
204 >> $$$$QPATH/qmake.conf ; \
205 echo 'load(qt_config)' \
206 >> $$$$QPATH/qmake.conf ; \
207 echo yes | ./configure \
208 -prefix $(CONFIGURE_PREFIX) \
209 -bindir $(CONFIGURE_PREFIX)/bin \
210 -libdir $(CONFIGURE_PREFIX)/lib \
211 -datadir $(CONFIGURE_PREFIX)/share/Qt \
212 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
213 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
214 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
215 -sysconfdir /etc/Qt \
216 -no-rpath \
217 -force-pkg-config \
218 -nomake tools \
219 -$(if $(CONFIG_PACKAGE_qt4-demos),make demos,nomake demos) \
220 -$(if $(CONFIG_PACKAGE_qt4-examples),make examples,nomake examples) \
221 -nomake docs \
222 -nomake translations \
223 -embedded openwrt \
224 -platform linux-g++ \
225 -release \
226 -opensource \
227 -no-mmx \
228 -no-3dnow \
229 -no-sse \
230 -no-sse2 \
231 -system-zlib \
232 -system-libtiff \
233 -system-libpng \
234 -system-libjpeg \
235 -system-freetype \
236 -system-sqlite \
237 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite,) \
238 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql,) \
239 -no-decoration-styled \
240 -no-decoration-windows \
241 -no-decoration-default \
242 -verbose \
243 -$(if $(CONFIG_PACKAGE_qt4-multimedia),multimedia,no-multimedia) \
244 -$(if $(CONFIG_PACKAGE_qt4-audio-backend),audio-backend,no-audio-backend) \
245 -$(if $(CONFIG_PACKAGE_qt4-phonon),phonon,no-phonon) \
246 -$(if $(CONFIG_PACKAGE_qt4-phonon-backend),phonon-backend,no-phonon-backend) \
247 -svg \
248 -$(if $(CONFIG_PACKAGE_qt4-webkit),webkit,no-webkit) \
249 -$(if $(CONFIG_PACKAGE_qt4-javascript-jit),javascript-jit,no-javascript-jit) \
250 -$(if $(CONFIG_PACKAGE_qt4-script),script,no-script) \
251 -$(if $(CONFIG_PACKAGE_qt4-scripttools),scripttools,no-scripttools) \
252 -$(if $(CONFIG_PACKAGE_qt4-accessibility),accessibility,no-accessibility) \
253 -no-declarative \
254 -no-openssl \
255 -no-nis \
256 -$(if $(CONFIG_PACKAGE_qt4-cups),cups,no-cups) \
257 -no-iconv \
258 -$(if $(CONFIG_PACKAGE_qt4-dbus),dbus,no-dbus) \
259 -$(if $(CONFIG_PACKAGE_qt4-gtkstyle),gtkstyle,no-gtkstyle) \
260 -no-nas-sound \
261 -no-opengl \
262 -no-openvg \
263 -no-sm \
264 -no-xshape \
265 -no-xsync \
266 -no-xinerama \
267 -no-xcursor \
268 -no-xfixes \
269 -no-xrandr \
270 -no-xrender \
271 -no-mitshm \
272 -no-fontconfig \
273 -no-xinput \
274 -no-xkb \
275 -$(if $(CONFIG_PACKAGE_qt4-glib),glib,no-glib) \
276 -$(if $(CONFIG_PACKAGE_qt4-qt3support),qt3support,no-qt3support) \
277 -$(if $(CONFIG_FEATURE_drawing-backend_DirectFB),qt-gfx-directfb,) \
278 -qt-gfx-linuxfb \
279 -no-gfx-multiscreen \
280 )
281 endef
282
283 define Build/Compile
284 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
285 $(MAKE) -C $(PKG_BUILD_DIR) install
286 endef
287
288 define Build/InstallDev
289 $(INSTALL_DIR) \
290 $(1)/usr/share/mkspecs \
291 $(1)/usr/lib/pkgconfig \
292 $(1)/usr/lib \
293 $(1)/usr/include \
294 $(1)/usr/lib/Qt/plugins
295
296 $(CP) \
297 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
298 $(1)/usr/share/mkspecs/
299
300 $(INSTALL_DATA) \
301 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
302 $(1)/usr/lib/pkgconfig/
303
304 $(CP) \
305 $(PKG_INSTALL_DIR)/usr/include/* \
306 $(1)/usr/include/
307
308 $(CP) \
309 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
310 $(1)/usr/lib/
311
312 #$(CP) \
313 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
314 # $(1)/usr/lib/Qt/plugins/
315 endef
316
317 define Package/qt4/install
318 $(INSTALL_DIR) \
319 $(1)/usr/lib \
320 $(1)/usr/lib/Qt/plugins
321
322 $(CP) \
323 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
324 $(1)/usr/lib/
325
326 #$(CP) \
327 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
328 # $(1)/usr/lib/Qt/plugins/codecs/
329 endef
330
331 define Package/qt4-gui/install
332 $(INSTALL_DIR) \
333 $(1)/usr/lib \
334 $(1)/usr/lib/Qt/plugins
335
336 $(CP) \
337 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
338 $(1)/usr/lib/
339
340 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
341 ln -s \
342 /usr/share/fonts/ttf-dejavu \
343 $(1)/usr/lib/fonts
344
345 # we use the dejavue font package instead
346 #$(INSTALL_DATA) \
347 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
348 # $(1)/usr/lib/fonts/
349
350 #$(CP) \
351 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
352 # $(1)/usr/lib/Qt/plugins/
353
354 #$(CP) \
355 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
356 # $(1)/usr/lib/Qt/plugins/
357
358 #$(CP) \
359 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
360 # $(1)/usr/lib/Qt/plugins/
361 endef
362
363 define Package/qt4-demos/install
364 $(INSTALL_DIR) \
365 $(1)/usr/share/Qt
366
367 $(CP) \
368 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
369 $(1)/usr/share/Qt/
370
371 $(FIND) \
372 $(1) \
373 -name "*.cpp" -o \
374 -name "*.h" -o \
375 -name "*.pro" \
376 | $(XARGS) rm
377 endef
378
379 define Package/qt4-examples/install
380 $(INSTALL_DIR) \
381 $(1)/usr/share/Qt
382
383 $(CP) \
384 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
385 $(1)/usr/share/Qt/
386
387 $(FIND) \
388 $(1) \
389 -name "*.cpp" -o \
390 -name "*.h" -o \
391 -name "*.pro" \
392 | $(XARGS) rm
393 endef
394
395 define Package/qt4-network/install
396 $(INSTALL_DIR) \
397 $(1)/usr/lib
398
399 $(CP) \
400 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
401 $(1)/usr/lib/
402 endef
403
404 define Package/qt4-sqlite/install
405 $(INSTALL_DIR) \
406 $(1)/usr/lib/Qt/plugins/sqldrivers
407
408 $(CP) \
409 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
410 $(1)/usr/lib/
411
412 $(CP) \
413 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
414 $(1)/usr/lib/Qt/plugins/sqldrivers/
415 endef
416
417 define Package/qt4-mysql/install
418 $(INSTALL_DIR) \
419 $(1)/usr/lib/Qt/plugins/sqldrivers
420
421 $(CP) \
422 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
423 $(1)/usr/lib/
424
425 $(CP) \
426 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
427 $(1)/usr/lib/Qt/plugins/sqldrivers/
428 endef
429
430 #define Package/qt4-multimedia/install
431 # $(INSTALL_DIR) \
432 # $(1)/usr/bin
433 #
434 # $(CP) \
435 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
436 # $(1)/usr/bin/
437 #endef
438
439 define Package/qt4-phonon/install
440 $(INSTALL_DIR) \
441 $(1)/usr/lib
442
443 $(CP) \
444 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
445 $(1)/usr/lib/
446 endef
447
448 define Package/qt4-svg/install
449 $(INSTALL_DIR) \
450 $(1)/usr/lib \
451 $(1)/usr/lib/Qt/plugins
452
453 $(CP) \
454 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
455 $(1)/usr/lib/
456
457 #$(CP) \
458 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
459 # $(1)/usr/lib/Qt/plugins/
460
461 #$(CP) \
462 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
463 # $(1)/usr/lib/Qt/plugins/
464 endef
465
466 define Package/qt4-webkit/install
467 $(INSTALL_DIR) \
468 $(1)/usr/lib \
469 $(1)/usr/lib/Qt/plugins
470
471 $(CP) \
472 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
473 $(1)/usr/lib/
474
475 #$(CP) \
476 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
477 # $(1)/usr/lib/Qt/plugins/
478 endef
479
480 define Package/qt4-script/install
481 $(INSTALL_DIR) \
482 $(1)/usr/lib \
483 $(1)/usr/lib/Qt/plugins
484
485 $(CP) \
486 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
487 $(1)/usr/lib/
488
489 #$(CP) \
490 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
491 # $(1)/usr/lib/Qt/plugins/
492 endef
493
494 define Package/qt4-scripttools/install
495 $(INSTALL_DIR) \
496 $(1)/usr/lib
497
498 $(CP) \
499 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
500 $(1)/usr/lib/
501 endef
502
503 define Package/qt4-dbus/install
504 $(INSTALL_DIR) \
505 $(1)/usr/lib
506
507 $(CP) \
508 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
509 $(1)/usr/lib/
510
511 #$(CP) \
512 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
513 # $(1)/usr/bin/
514 endef
515
516 define Package/qt4-qt3-support/install
517 $(INSTALL_DIR) \
518 $(1)/usr/lib \
519 $(1)/usr/lib/Qt/plugins
520
521 $(CP) \
522 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
523 $(1)/usr/lib/
524
525 #$(CP) \
526 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
527 # $(1)/usr/lib/Qt/plugins/
528 endef
529
530 $(eval $(call BuildPackage,qt4))
531 $(eval $(call BuildPackage,qt4-gui))
532 $(eval $(call BuildPackage,qt4-demos))
533 $(eval $(call BuildPackage,qt4-examples))
534 $(eval $(call BuildPackage,qt4-network))
535 $(eval $(call BuildPackage,qt4-sqlite))
536 $(eval $(call BuildPackage,qt4-mysql))
537 #$(eval $(call BuildPackage,qt4-multimedia))
538 #$(eval $(call BuildPackage,qt4-audio-backend))
539 $(eval $(call BuildPackage,qt4-phonon))
540 #$(eval $(call BuildPackage,qt4-phonon-backend))
541 $(eval $(call BuildPackage,qt4-svg))
542 $(eval $(call BuildPackage,qt4-webkit))
543 $(eval $(call BuildPackage,qt4-script))
544 $(eval $(call BuildPackage,qt4-scripttools))
545 #$(eval $(call BuildPackage,qt4-accessibility))
546 #$(eval $(call BuildPackage,qt4-javascript-jit))
547 #$(eval $(call BuildPackage,qt4-cups))
548 $(eval $(call BuildPackage,qt4-dbus))
549 #$(eval $(call BuildPackage,qt4-gtkstyle))
550 #$(eval $(call BuildPackage,qt4-glib))
551 $(eval $(call BuildPackage,qt4-qt3support))