qt.mk 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. ################################################################################
  2. #
  3. # qt
  4. #
  5. ################################################################################
  6. QT_VERSION_MAJOR = 4.8
  7. QT_VERSION = $(QT_VERSION_MAJOR).7
  8. QT_SOURCE = qt-everywhere-opensource-src-$(QT_VERSION).tar.gz
  9. QT_SITE = http://download.qt-project.org/official_releases/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION)
  10. QT_DEPENDENCIES = host-pkgconf
  11. QT_INSTALL_STAGING = YES
  12. QT_LICENSE := LGPL-2.1 with exceptions or GPL-3.0
  13. QT_LICENSE_FILES = LICENSE.LGPL LGPL_EXCEPTION.txt LICENSE.GPL3
  14. # Opensource licenses are the only one we catter about
  15. QT_CONFIGURE_OPTS += -opensource -confirm-license
  16. QT_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT_CONFIG_FILE))
  17. ifneq ($(QT_CONFIG_FILE),)
  18. QT_CONFIGURE_OPTS += -qconfig buildroot
  19. endif
  20. QT_CFLAGS = $(TARGET_CFLAGS)
  21. QT_CXXFLAGS = $(TARGET_CXXFLAGS)
  22. QT_LDFLAGS = $(TARGET_LDFLAGS)
  23. # Qt WebKit build fails when gcc-6 is used for build, because
  24. # 'std::auto_ptr' is deprecated starting from gcc 6.x. So, we have to
  25. # use an older c++ standard to prevent build failure
  26. QT_CXXFLAGS += -std=gnu++98
  27. # Qt has some assembly function that are not present in thumb1 mode:
  28. # Error: selected processor does not support Thumb mode `swp r3,r7,[r4]'
  29. # so, we desactivate thumb mode
  30. ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
  31. QT_CFLAGS += -marm
  32. QT_CXXFLAGS += -marm
  33. endif
  34. ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
  35. QT_CONFIGURE_OPTS += -qt3support
  36. else
  37. QT_CONFIGURE_OPTS += -no-qt3support
  38. endif
  39. ifeq ($(BR2_PACKAGE_QT_DEMOS),y)
  40. QT_CONFIGURE_OPTS += -demosdir $(TARGET_DIR)/usr/share/qt/demos
  41. else
  42. QT_CONFIGURE_OPTS += -nomake demos
  43. endif
  44. ifeq ($(BR2_PACKAGE_QT_EXAMPLES),y)
  45. QT_CONFIGURE_OPTS += -examplesdir $(TARGET_DIR)/usr/share/qt/examples
  46. else
  47. QT_CONFIGURE_OPTS += -nomake examples
  48. endif
  49. # ensure glib is built first if enabled for Qt's glib support
  50. ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
  51. QT_CONFIGURE_OPTS += -glib
  52. QT_DEPENDENCIES += libglib2
  53. else
  54. QT_CONFIGURE_OPTS += -no-glib
  55. endif
  56. ### Pixel depths
  57. QT_PIXEL_DEPTHS = # empty
  58. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_1),y)
  59. QT_PIXEL_DEPTHS += 1
  60. endif
  61. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_4),y)
  62. QT_PIXEL_DEPTHS += 4
  63. endif
  64. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_8),y)
  65. QT_PIXEL_DEPTHS += 8
  66. endif
  67. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_12),y)
  68. QT_PIXEL_DEPTHS += 12
  69. endif
  70. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_15),y)
  71. QT_PIXEL_DEPTHS += 15
  72. endif
  73. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_16),y)
  74. QT_PIXEL_DEPTHS += 16
  75. endif
  76. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_18),y)
  77. QT_PIXEL_DEPTHS += 18
  78. endif
  79. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_24),y)
  80. QT_PIXEL_DEPTHS += 24
  81. endif
  82. ifeq ($(BR2_PACKAGE_QT_PIXEL_DEPTH_32),y)
  83. QT_PIXEL_DEPTHS += 32
  84. endif
  85. ifneq ($(QT_PIXEL_DEPTHS),)
  86. QT_CONFIGURE_OPTS += -depths $(subst $(space),$(comma),$(strip $(QT_PIXEL_DEPTHS)))
  87. endif
  88. ### Display drivers
  89. ifeq ($(BR2_PACKAGE_QT_GFX_LINUXFB),y)
  90. QT_CONFIGURE_OPTS += -qt-gfx-linuxfb
  91. else
  92. QT_CONFIGURE_OPTS += -no-gfx-linuxfb
  93. endif
  94. ifeq ($(BR2_PACKAGE_QT_GFX_TRANSFORMED),y)
  95. QT_CONFIGURE_OPTS += -qt-gfx-transformed
  96. else
  97. QT_CONFIGURE_OPTS += -no-gfx-transformed
  98. endif
  99. ifeq ($(BR2_PACKAGE_QT_GFX_QVFB),y)
  100. QT_CONFIGURE_OPTS += -qt-gfx-qvfb
  101. else
  102. QT_CONFIGURE_OPTS += -no-gfx-qvfb
  103. endif
  104. ifeq ($(BR2_PACKAGE_QT_GFX_VNC),y)
  105. QT_CONFIGURE_OPTS += -qt-gfx-vnc
  106. else
  107. QT_CONFIGURE_OPTS += -no-gfx-vnc
  108. endif
  109. ifeq ($(BR2_PACKAGE_QT_GFX_MULTISCREEN),y)
  110. QT_CONFIGURE_OPTS += -qt-gfx-multiscreen
  111. else
  112. QT_CONFIGURE_OPTS += -no-gfx-multiscreen
  113. endif
  114. ifeq ($(BR2_PACKAGE_QT_GFX_DIRECTFB),y)
  115. QT_CONFIGURE_OPTS += -qt-gfx-directfb
  116. QT_DEPENDENCIES += directfb
  117. else
  118. QT_CONFIGURE_OPTS += -no-gfx-directfb
  119. endif
  120. ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
  121. QT_CONFIGURE_OPTS += \
  122. -plugin-gfx-powervr -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT
  123. QT_DEPENDENCIES += powervr
  124. endif
  125. ### Mouse drivers
  126. ifeq ($(BR2_PACKAGE_QT_MOUSE_PC),y)
  127. QT_CONFIGURE_OPTS += -qt-mouse-pc
  128. else
  129. QT_CONFIGURE_OPTS += -no-mouse-pc
  130. endif
  131. ifeq ($(BR2_PACKAGE_QT_MOUSE_LINUXTP),y)
  132. QT_CONFIGURE_OPTS += -qt-mouse-linuxtp
  133. else
  134. QT_CONFIGURE_OPTS += -no-mouse-linuxtp
  135. endif
  136. ifeq ($(BR2_PACKAGE_QT_MOUSE_LINUXINPUT),y)
  137. QT_CONFIGURE_OPTS += -qt-mouse-linuxinput
  138. else
  139. QT_CONFIGURE_OPTS += -no-mouse-linuxinput
  140. endif
  141. ifeq ($(BR2_PACKAGE_QT_MOUSE_TSLIB),y)
  142. QT_CONFIGURE_OPTS += -qt-mouse-tslib
  143. QT_DEPENDENCIES += tslib
  144. else
  145. QT_CONFIGURE_OPTS += -no-mouse-tslib
  146. endif
  147. ifeq ($(BR2_PACKAGE_QT_MOUSE_QVFB),y)
  148. QT_CONFIGURE_OPTS += -qt-mouse-qvfb
  149. else
  150. QT_CONFIGURE_OPTS += -no-mouse-qvfb
  151. endif
  152. ifeq ($(BR2_PACKAGE_QT_MOUSE_NO_QWS_CURSOR),y)
  153. QT_CONFIGURE_OPTS += -D QT_NO_QWS_CURSOR
  154. endif
  155. ### Keyboard drivers
  156. ifeq ($(BR2_PACKAGE_QT_KEYBOARD_TTY),y)
  157. QT_CONFIGURE_OPTS += -qt-kbd-tty
  158. else
  159. QT_CONFIGURE_OPTS += -no-kbd-tty
  160. endif
  161. ifeq ($(BR2_PACKAGE_QT_KEYBOARD_LINUXINPUT),y)
  162. QT_CONFIGURE_OPTS += -qt-kbd-linuxinput
  163. else
  164. QT_CONFIGURE_OPTS += -no-kbd-linuxinput
  165. endif
  166. ifeq ($(BR2_PACKAGE_QT_KEYBOARD_QVFB),y)
  167. QT_CONFIGURE_OPTS += -qt-kbd-qvfb
  168. else
  169. QT_CONFIGURE_OPTS += -no-kbd-qvfb
  170. endif
  171. ifeq ($(BR2_PACKAGE_QT_DEBUG),y)
  172. QT_CONFIGURE_OPTS += -debug
  173. else
  174. QT_CONFIGURE_OPTS += -release
  175. endif
  176. ifeq ($(BR2_PACKAGE_QT_SHARED),y)
  177. QT_CONFIGURE_OPTS += -shared
  178. else
  179. QT_CONFIGURE_OPTS += -static
  180. endif
  181. ifeq ($(BR2_STATIC_LIBS),y)
  182. QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
  183. endif
  184. ifeq ($(BR2_ENDIAN),"LITTLE")
  185. QT_CONFIGURE_OPTS += -little-endian
  186. else
  187. QT_CONFIGURE_OPTS += -big-endian
  188. endif
  189. ifeq ($(BR2_arm)$(BR2_armeb),y)
  190. QT_EMB_PLATFORM = arm
  191. else ifeq ($(BR2_i386),y)
  192. QT_EMB_PLATFORM = x86
  193. else ifeq ($(BR2_x86_64),y)
  194. QT_EMB_PLATFORM = x86_64
  195. else ifeq ($(BR2_mips)$(BR2_mipsel),y)
  196. QT_EMB_PLATFORM = mips
  197. else ifeq ($(BR2_powerpc),y)
  198. QT_EMB_PLATFORM = powerpc
  199. else ifeq ($(BR2_sh4)$(BR2_sh4eb)$(BR2_sh4a)$(BR2_sh4aeb),y)
  200. QT_EMB_PLATFORM = sh
  201. else
  202. QT_EMB_PLATFORM = generic
  203. endif
  204. ifeq ($(BR2_PACKAGE_QT_X11),y)
  205. QT_DEPENDENCIES += fontconfig xlib_libXi xlib_libX11 xlib_libXrender \
  206. xlib_libXcursor xlib_libXrandr xlib_libXext xlib_libXv
  207. # Using pkg-config avoids us some logic to redefine and sed again mkspecs files
  208. # to add X11 include path and link options
  209. QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
  210. QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags x11`
  211. QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs x11 xext`
  212. QT_CONFIGURE_OPTS += -arch $(QT_EMB_PLATFORM) \
  213. -xplatform qws/linux-$(QT_EMB_PLATFORM)-g++ -x11 -no-gtkstyle -no-sm \
  214. -no-openvg
  215. else # if BR2_PACKAGE_QT_EMBEDDED
  216. QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
  217. endif
  218. ifneq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
  219. QT_CONFIGURE_OPTS += -no-gui
  220. endif
  221. ifneq ($(BR2_PACKAGE_QT_GIF),y)
  222. QT_CONFIGURE_OPTS += -no-gif
  223. endif
  224. ifeq ($(BR2_PACKAGE_QT_LIBMNG),y)
  225. QT_CONFIGURE_OPTS += -qt-libmng
  226. else
  227. QT_CONFIGURE_OPTS += -no-libmng
  228. endif
  229. ifeq ($(BR2_PACKAGE_QT_ACCESSIBILITY),y)
  230. QT_CONFIGURE_OPTS += -accessibility
  231. else
  232. QT_CONFIGURE_OPTS += -no-accessibility
  233. endif
  234. ifeq ($(BR2_PACKAGE_QT_QTZLIB),y)
  235. QT_CONFIGURE_OPTS += -qt-zlib
  236. else
  237. ifeq ($(BR2_PACKAGE_QT_SYSTEMZLIB),y)
  238. QT_CONFIGURE_OPTS += -system-zlib
  239. QT_DEPENDENCIES += zlib
  240. endif
  241. endif
  242. ifeq ($(BR2_PACKAGE_QT_QTJPEG),y)
  243. QT_CONFIGURE_OPTS += -qt-libjpeg
  244. else
  245. ifeq ($(BR2_PACKAGE_QT_SYSTEMJPEG),y)
  246. QT_CONFIGURE_OPTS += -system-libjpeg
  247. QT_DEPENDENCIES += jpeg
  248. else
  249. QT_CONFIGURE_OPTS += -no-libjpeg
  250. endif
  251. endif
  252. ifeq ($(BR2_PACKAGE_QT_QTPNG),y)
  253. QT_CONFIGURE_OPTS += -qt-libpng
  254. else
  255. ifeq ($(BR2_PACKAGE_QT_SYSTEMPNG),y)
  256. QT_CONFIGURE_OPTS += -system-libpng
  257. QT_DEPENDENCIES += libpng
  258. else
  259. QT_CONFIGURE_OPTS += -no-libpng
  260. endif
  261. endif
  262. ifeq ($(BR2_PACKAGE_QT_QTTIFF),y)
  263. QT_CONFIGURE_OPTS += -qt-libtiff
  264. else
  265. ifeq ($(BR2_PACKAGE_QT_SYSTEMTIFF),y)
  266. QT_CONFIGURE_OPTS += -system-libtiff
  267. QT_DEPENDENCIES += tiff
  268. else
  269. QT_CONFIGURE_OPTS += -no-libtiff
  270. endif
  271. endif
  272. QT_FONTS = $(addprefix $(STAGING_DIR)/usr/lib/fonts/, $(addsuffix *.qpf, \
  273. $(if $(BR2_PACKAGE_QT_FONT_MICRO),micro) \
  274. $(if $(BR2_PACKAGE_QT_FONT_FIXED),fixed) \
  275. $(if $(BR2_PACKAGE_QT_FONT_HELVETICA),helvetica) \
  276. $(if $(BR2_PACKAGE_QT_FONT_JAPANESE),japanese) \
  277. $(if $(BR2_PACKAGE_QT_FONT_UNIFONT),unifont)))
  278. ifeq ($(BR2_PACKAGE_QT_QTFREETYPE),y)
  279. QT_CONFIGURE_OPTS += -qt-freetype
  280. else
  281. ifeq ($(BR2_PACKAGE_QT_SYSTEMFREETYPE),y)
  282. QT_CONFIGURE_OPTS += -system-freetype
  283. QT_CONFIGURE_OPTS += -I $(STAGING_DIR)/usr/include/freetype2/
  284. QT_DEPENDENCIES += freetype
  285. else
  286. QT_CONFIGURE_OPTS += -no-freetype
  287. endif
  288. endif
  289. ifeq ($(BR2_PACKAGE_QT_DBUS),y)
  290. QT_DEPENDENCIES += dbus
  291. endif
  292. ifeq ($(BR2_PACKAGE_QT_OPENSSL),y)
  293. QT_CONFIGURE_OPTS += -openssl
  294. QT_DEPENDENCIES += openssl
  295. else
  296. QT_CONFIGURE_OPTS += -no-openssl
  297. endif
  298. ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
  299. QT_CONFIGURE_OPTS += -opengl es2 -egl
  300. QT_DEPENDENCIES += libgles libegl
  301. QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
  302. QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
  303. QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs egl`
  304. else ifeq ($(BR2_PACKAGE_QT_OPENGL_GL_DESKTOP),y)
  305. QT_CONFIGURE_OPTS += -opengl desktop
  306. QT_DEPENDENCIES += libgl
  307. else
  308. QT_CONFIGURE_OPTS += -no-opengl
  309. endif
  310. # Qt SQL Drivers
  311. ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
  312. ifeq ($(BR2_PACKAGE_QT_MYSQL),y)
  313. QT_CONFIGURE_OPTS += -qt-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
  314. QT_DEPENDENCIES += mysql
  315. endif
  316. ifeq ($(BR2_PACKAGE_QT_ODBC),y)
  317. QT_CONFIGURE_OPTS += -qt-sql-odbc
  318. QT_DEPENDENCIES += unixodbc
  319. endif
  320. ifeq ($(BR2_PACKAGE_QT_PSQL),y)
  321. QT_CONFIGURE_OPTS += -qt-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
  322. QT_DEPENDENCIES += postgresql
  323. endif
  324. ifeq ($(BR2_PACKAGE_QT_SQLITE_QT),y)
  325. QT_CONFIGURE_OPTS += -qt-sql-sqlite
  326. else
  327. ifeq ($(BR2_PACKAGE_QT_SQLITE_SYSTEM),y)
  328. QT_CONFIGURE_OPTS += -system-sqlite
  329. QT_DEPENDENCIES += sqlite
  330. else
  331. QT_CONFIGURE_OPTS += -no-sql-sqlite
  332. endif
  333. endif
  334. ifeq ($(BR2_PACKAGE_QT_SQLITE2),y)
  335. QT_CONFIGURE_OPTS += -qt-sql-sqlite2
  336. endif
  337. else
  338. # By default, no SQL driver is turned on by configure.
  339. # but it seems sqlite isn't disabled despite what says
  340. # configure --help
  341. QT_CONFIGURE_OPTS += -no-sql-sqlite
  342. endif
  343. ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
  344. QT_CONFIGURE_OPTS += -xmlpatterns -exceptions
  345. else
  346. QT_CONFIGURE_OPTS += -no-xmlpatterns
  347. endif
  348. ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
  349. QT_CONFIGURE_OPTS += -multimedia
  350. else
  351. QT_CONFIGURE_OPTS += -no-multimedia
  352. endif
  353. ifeq ($(BR2_PACKAGE_QT_AUDIO_BACKEND),y)
  354. QT_CONFIGURE_OPTS += -audio-backend
  355. QT_DEPENDENCIES += alsa-lib
  356. else
  357. QT_CONFIGURE_OPTS += -no-audio-backend
  358. endif
  359. ifeq ($(BR2_PACKAGE_QT_PHONON),y)
  360. QT_CONFIGURE_OPTS += -phonon
  361. QT_DEPENDENCIES += gstreamer gst-plugins-base
  362. else
  363. QT_CONFIGURE_OPTS += -no-phonon
  364. endif
  365. ifeq ($(BR2_PACKAGE_QT_PHONON_BACKEND),y)
  366. QT_CONFIGURE_OPTS += -phonon-backend
  367. else
  368. QT_CONFIGURE_OPTS += -no-phonon-backend
  369. endif
  370. ifeq ($(BR2_PACKAGE_QT_SVG),y)
  371. QT_CONFIGURE_OPTS += -svg
  372. else
  373. QT_CONFIGURE_OPTS += -no-svg
  374. endif
  375. ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
  376. QT_CONFIGURE_OPTS += -webkit
  377. QT_DEPENDENCIES += gstreamer gst-plugins-base
  378. else
  379. QT_CONFIGURE_OPTS += -no-webkit
  380. endif
  381. ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
  382. QT_CONFIGURE_OPTS += -script
  383. else
  384. QT_CONFIGURE_OPTS += -no-script
  385. endif
  386. ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
  387. QT_CONFIGURE_OPTS += -scripttools
  388. else
  389. QT_CONFIGURE_OPTS += -no-scripttools
  390. endif
  391. ifeq ($(BR2_PACKAGE_QT_STL),y)
  392. QT_CONFIGURE_OPTS += -stl
  393. else
  394. QT_CONFIGURE_OPTS += -no-stl
  395. endif
  396. ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
  397. QT_CONFIGURE_OPTS += -declarative
  398. else
  399. QT_CONFIGURE_OPTS += -no-declarative
  400. endif
  401. # -no-pch is needed to workaround the issue described at
  402. # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
  403. # In addition, ccache and precompiled headers don't play well together
  404. QT_CONFIGURE_OPTS += -no-pch
  405. # x86x86fix
  406. # Workaround Qt Embedded bug when crosscompiling for x86 under x86 with linux
  407. # host. It's unclear if this would happen on other hosts.
  408. ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
  409. ifneq ($(findstring x86,$(QT_EMB_PLATFORM)),)
  410. QT_CONFIGURE_OPTS += -platform linux-g++
  411. endif
  412. endif
  413. # End of workaround.
  414. # Variable for other Qt applications to use
  415. QT_QMAKE = $(HOST_DIR)/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
  416. ################################################################################
  417. # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
  418. # the qmake.conf file. Will remove existing variable declaration if
  419. # available.
  420. #
  421. # Argument 1 is the variable name
  422. # Argument 2 is the value to set variable to
  423. # Argument 3 is the base source directory of Qt
  424. #
  425. # E.G. use like this:
  426. # $(call QT_QMAKE_SET,variable,value,directory)
  427. ################################################################################
  428. define QT_QMAKE_SET
  429. $(SED) '/$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
  430. $(SED) "/include.*qws.conf/a$(1) = $(2)" $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
  431. endef
  432. ifneq ($(QT_CONFIG_FILE),)
  433. define QT_CONFIGURE_CONFIG_FILE
  434. cp $(QT_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
  435. endef
  436. endif
  437. define QT_CONFIGURE_CMDS
  438. -[ -f $(@D)/Makefile ] && $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) confclean
  439. $(QT_CONFIGURE_IPV6)
  440. $(QT_CONFIGURE_CONFIG_FILE)
  441. # Fix compiler path
  442. $(call QT_QMAKE_SET,QMAKE_CC,$(TARGET_CC),$(@D))
  443. $(call QT_QMAKE_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
  444. $(call QT_QMAKE_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
  445. $(call QT_QMAKE_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
  446. $(call QT_QMAKE_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
  447. $(call QT_QMAKE_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
  448. $(call QT_QMAKE_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
  449. $(call QT_QMAKE_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
  450. $(call QT_QMAKE_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
  451. $(call QT_QMAKE_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
  452. $(call QT_QMAKE_SET,QMAKE_LFLAGS,$(QT_LDFLAGS),$(@D))
  453. $(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/bin/pkg-config,$(@D))
  454. # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
  455. # instead of the host then. So set PKG_CONFIG* manually.
  456. (cd $(@D); \
  457. PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
  458. PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
  459. PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
  460. $(TARGET_MAKE_ENV) \
  461. MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" ./configure \
  462. $(if $(VERBOSE),-verbose,-silent) \
  463. -force-pkg-config \
  464. $(QT_CONFIGURE_OPTS) \
  465. -no-xinerama \
  466. -no-cups \
  467. -no-nis \
  468. -no-separate-debug-info \
  469. -prefix /usr \
  470. -plugindir /usr/lib/qt/plugins \
  471. -importdir /usr/lib/qt/imports \
  472. -translationdir /usr/share/qt/translations \
  473. -hostprefix $(STAGING_DIR) \
  474. -fast \
  475. -no-rpath \
  476. )
  477. endef
  478. define QT_BUILD_CMDS
  479. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
  480. endef
  481. # Build the list of libraries and plugins to install to the target
  482. QT_INSTALL_LIBS += QtCore
  483. QT_HOST_PROGRAMS += moc rcc qmake lrelease
  484. ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
  485. QT_INSTALL_LIBS += QtGui
  486. QT_HOST_PROGRAMS += uic
  487. endif
  488. ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
  489. QT_INSTALL_LIBS += QtSql
  490. endif
  491. ifeq ($(BR2_PACKAGE_QT_MULTIMEDIA),y)
  492. QT_INSTALL_LIBS += QtMultimedia
  493. endif
  494. ifeq ($(BR2_PACKAGE_QT_PHONON),y)
  495. QT_INSTALL_LIBS += phonon
  496. endif
  497. ifeq ($(BR2_PACKAGE_QT_SVG),y)
  498. QT_INSTALL_LIBS += QtSvg
  499. endif
  500. ifeq ($(BR2_PACKAGE_QT_NETWORK),y)
  501. QT_INSTALL_LIBS += QtNetwork
  502. endif
  503. ifeq ($(BR2_PACKAGE_QT_WEBKIT),y)
  504. QT_INSTALL_LIBS += QtWebKit
  505. endif
  506. ifeq ($(BR2_PACKAGE_QT_XML),y)
  507. QT_INSTALL_LIBS += QtXml
  508. endif
  509. ifeq ($(BR2_PACKAGE_QT_DBUS),y)
  510. QT_INSTALL_LIBS += QtDBus
  511. endif
  512. ifeq ($(BR2_PACKAGE_QT_XMLPATTERNS),y)
  513. QT_INSTALL_LIBS += QtXmlPatterns
  514. endif
  515. ifeq ($(BR2_PACKAGE_QT_SCRIPT),y)
  516. QT_INSTALL_LIBS += QtScript
  517. endif
  518. ifeq ($(BR2_PACKAGE_QT_SCRIPTTOOLS),y)
  519. QT_INSTALL_LIBS += QtScriptTools
  520. endif
  521. ifeq ($(BR2_PACKAGE_QT_DECLARATIVE),y)
  522. QT_INSTALL_LIBS += QtDeclarative
  523. endif
  524. ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
  525. QT_INSTALL_LIBS += Qt3Support
  526. endif
  527. ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
  528. QT_INSTALL_LIBS += QtOpenGL
  529. endif
  530. ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
  531. QT_INSTALL_LIBS += pvrQWSWSEGL
  532. endif
  533. ifeq ($(BR2_PACKAGE_QT_TEST),y)
  534. QT_INSTALL_LIBS += QtTest
  535. endif
  536. QT_CONF_FILE = $(HOST_DIR)/bin/qt.conf
  537. # Since host programs and spec files have been moved to $(HOST_DIR),
  538. # we need to tell qmake the new location of the various elements,
  539. # through a qt.conf file.
  540. define QT_INSTALL_QT_CONF
  541. mkdir -p $(dir $(QT_CONF_FILE))
  542. echo "[Paths]" > $(QT_CONF_FILE)
  543. echo "Prefix=$(HOST_DIR)" >> $(QT_CONF_FILE)
  544. echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
  545. echo "Libraries=$(STAGING_DIR)/usr/lib" >> $(QT_CONF_FILE)
  546. echo "Data=$(HOST_DIR)" >> $(QT_CONF_FILE)
  547. echo "Binaries=$(HOST_DIR)/bin" >> $(QT_CONF_FILE)
  548. endef
  549. # After running Qt normal installation process (which installs
  550. # everything in the STAGING_DIR), we move host programs such as qmake,
  551. # rcc or uic to the HOST_DIR so that they are available at the usual
  552. # location. A qt.conf file is generated to make sure that all host
  553. # programs still find all files they need. The .pc files are tuned to
  554. # remove the sysroot path from them, since pkg-config already adds it
  555. # automatically.
  556. define QT_INSTALL_STAGING_CMDS
  557. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
  558. mkdir -p $(HOST_DIR)/bin
  559. mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/bin
  560. ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/mkspecs
  561. $(QT_INSTALL_QT_CONF)
  562. for i in moc uic rcc lupdate lrelease ; do \
  563. $(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/bin/$${i}," \
  564. $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
  565. done
  566. $(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
  567. endef
  568. # Library installation
  569. ifeq ($(BR2_PACKAGE_QT_SHARED),y)
  570. define QT_INSTALL_TARGET_LIBS
  571. mkdir -p $(TARGET_DIR)/usr/lib
  572. for lib in $(QT_INSTALL_LIBS); do \
  573. cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib ; \
  574. done
  575. endef
  576. endif
  577. # Plugin installation
  578. define QT_INSTALL_TARGET_PLUGINS
  579. if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
  580. mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
  581. cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
  582. fi
  583. endef
  584. # Import installation
  585. define QT_INSTALL_TARGET_IMPORTS
  586. if [ -d $(STAGING_DIR)/usr/lib/qt/imports/ ] ; then \
  587. mkdir -p $(TARGET_DIR)/usr/lib/qt/imports ; \
  588. cp -dpfr $(STAGING_DIR)/usr/lib/qt/imports/* $(TARGET_DIR)/usr/lib/qt/imports ; \
  589. fi
  590. endef
  591. # Fonts installation
  592. ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
  593. ifneq ($(QT_FONTS),)
  594. define QT_INSTALL_TARGET_FONTS
  595. mkdir -p $(TARGET_DIR)/usr/lib/fonts
  596. cp -dpf $(QT_FONTS) $(TARGET_DIR)/usr/lib/fonts
  597. endef
  598. ifneq ($(BR2_PACKAGE_QT_FONT_MICRO)$(BR2_PACKAGE_QT_FONT_FIXED),)
  599. # as stated in the font source src/3rdparty/fonts/micro.bdf
  600. # source src/3rdparty/fonts/5x7.bdf and source src/3rdparty/fonts/6x13.bdf
  601. QT_LICENSE := $(QT_LICENSE), Public Domain (Micro/Fixed font)
  602. endif
  603. ifneq ($(BR2_PACKAGE_QT_FONT_HELVETICA)$(BR2_PACKAGE_QT_FONT_JAPANESE),)
  604. QT_LICENSE := $(QT_LICENSE), Adobe Helvetica license (Helvetica/Japanese fonts)
  605. QT_LICENSE_FILES += src/3rdparty/fonts/COPYING.Helvetica
  606. endif
  607. ifeq ($(BR2_PACKAGE_QT_FONT_UNIFONT),y)
  608. QT_LICENSE := $(QT_LICENSE), Freeware (Unifont font)
  609. QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.Unifont
  610. endif
  611. endif # QT_FONTS
  612. ifeq ($(BR2_PACKAGE_QT_FONT_TRUETYPE),y)
  613. define QT_INSTALL_TARGET_FONTS_TTF
  614. mkdir -p $(TARGET_DIR)/usr/lib/fonts
  615. cp -dpf $(STAGING_DIR)/usr/lib/fonts/*.ttf $(TARGET_DIR)/usr/lib/fonts
  616. endef
  617. QT_LICENSE := $(QT_LICENSE), Bitstream license (DejaVu/Vera TrueType fonts)
  618. QT_LICENSE_FILES += src/3rdparty/fonts/COPYRIGHT.DejaVu \
  619. src/3rdparty/fonts/README.DejaVu \
  620. src/3rdparty/fonts/COPYRIGHT.Vera
  621. endif
  622. endif # BR2_PACKAGE_QT_EMBEDDED
  623. ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
  624. define QT_INSTALL_TARGET_POWERVR
  625. # Note: this overwrites the default powervr.ini provided by the ti-gfx
  626. # package.
  627. $(INSTALL) -D -m 0644 package/qt/powervr.ini \
  628. $(TARGET_DIR)/etc/powervr.ini
  629. endef
  630. endif
  631. ifeq ($(BR2_PACKAGE_QT_TRANSLATION_FILES),y)
  632. define QT_INSTALL_TARGET_TRANSLATIONS
  633. if [ -d $(STAGING_DIR)/usr/share/qt/translations/ ] ; then \
  634. mkdir -p $(TARGET_DIR)/usr/share/qt/translations ; \
  635. cp -dpfr $(STAGING_DIR)/usr/share/qt/translations/* $(TARGET_DIR)/usr/share/qt/translations ; \
  636. fi
  637. endef
  638. endif
  639. define QT_INSTALL_TARGET_CMDS
  640. $(QT_INSTALL_TARGET_LIBS)
  641. $(QT_INSTALL_TARGET_PLUGINS)
  642. $(QT_INSTALL_TARGET_IMPORTS)
  643. $(QT_INSTALL_TARGET_FONTS)
  644. $(QT_INSTALL_TARGET_FONTS_TTF)
  645. $(QT_INSTALL_TARGET_POWERVR)
  646. $(QT_INSTALL_TARGET_TRANSLATIONS)
  647. endef
  648. $(eval $(generic-package))