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