qt.mk 20 KB

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