qt5base.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. ################################################################################
  2. #
  3. # qt5base
  4. #
  5. ################################################################################
  6. QT5BASE_VERSION = $(QT5_VERSION)
  7. QT5BASE_SITE = $(QT5_SITE)
  8. QT5BASE_SOURCE = qtbase-$(QT5_SOURCE_TARBALL_PREFIX)-$(QT5BASE_VERSION).tar.xz
  9. QT5BASE_DEPENDENCIES = host-pkgconf zlib
  10. QT5BASE_INSTALL_STAGING = YES
  11. # A few comments:
  12. # * -no-pch to workaround the issue described at
  13. # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
  14. # * -system-zlib because zlib is mandatory for Qt build, and we
  15. # want to use the Buildroot packaged zlib
  16. # * -system-pcre because pcre is mandatory to build Qt, and we
  17. # want to use the one packaged in Buildroot
  18. QT5BASE_CONFIGURE_OPTS += \
  19. -optimized-qmake \
  20. -no-cups \
  21. -no-iconv \
  22. -system-zlib \
  23. -system-pcre \
  24. -no-pch \
  25. -shared
  26. # starting from version 5.9.0, -optimize-debug is enabled by default
  27. # for debug builds and it overrides -O* with -Og which is not what we
  28. # want.
  29. ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
  30. QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
  31. endif
  32. QT5BASE_CFLAGS = $(TARGET_CFLAGS)
  33. QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
  34. ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
  35. QT5BASE_CFLAGS += -O0
  36. QT5BASE_CXXFLAGS += -O0
  37. endif
  38. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  39. QT5BASE_DEPENDENCIES += pcre
  40. else
  41. QT5BASE_DEPENDENCIES += pcre2
  42. endif
  43. ifeq ($(BR2_X86_CPU_HAS_SSE2),)
  44. QT5BASE_CONFIGURE_OPTS += -no-sse2
  45. else ifeq ($(BR2_X86_CPU_HAS_SSE3),)
  46. QT5BASE_CONFIGURE_OPTS += -no-sse3
  47. else ifeq ($(BR2_X86_CPU_HAS_SSSE3),)
  48. QT5BASE_CONFIGURE_OPTS += -no-ssse3
  49. else ifeq ($(BR2_X86_CPU_HAS_SSE4),)
  50. QT5BASE_CONFIGURE_OPTS += -no-sse4.1
  51. else ifeq ($(BR2_X86_CPU_HAS_SSE42),)
  52. QT5BASE_CONFIGURE_OPTS += -no-sse4.2
  53. else ifeq ($(BR2_X86_CPU_HAS_AVX),)
  54. QT5BASE_CONFIGURE_OPTS += -no-avx
  55. else ifeq ($(BR2_X86_CPU_HAS_AVX2),)
  56. QT5BASE_CONFIGURE_OPTS += -no-avx2
  57. else
  58. # no buildroot BR2_X86_CPU_HAS_AVX512 option yet for qt configure
  59. # option '-no-avx512' (available for latest only)
  60. endif
  61. ifeq ($(BR2_PACKAGE_LIBDRM),y)
  62. QT5BASE_CONFIGURE_OPTS += -kms
  63. QT5BASE_DEPENDENCIES += libdrm
  64. else
  65. QT5BASE_CONFIGURE_OPTS += -no-kms
  66. endif
  67. # Uses libgbm from mesa3d
  68. ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
  69. QT5BASE_CONFIGURE_OPTS += -gbm
  70. QT5BASE_DEPENDENCIES += mesa3d
  71. else ifeq ($(BR2_PACKAGE_GCNANO_BINARIES),y)
  72. QT5BASE_CONFIGURE_OPTS += -gbm
  73. QT5BASE_DEPENDENCIES += gcnano-binaries
  74. else ifeq ($(BR2_PACKAGE_TI_SGX_LIBGBM),y)
  75. QT5BASE_CONFIGURE_OPTS += -gbm
  76. QT5BASE_DEPENDENCIES += ti-sgx-libgbm
  77. else
  78. QT5BASE_CONFIGURE_OPTS += -no-gbm
  79. endif
  80. ifeq ($(BR2_ENABLE_DEBUG),y)
  81. QT5BASE_CONFIGURE_OPTS += -debug
  82. else
  83. QT5BASE_CONFIGURE_OPTS += -release
  84. endif
  85. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  86. QT5BASE_CONFIGURE_OPTS += -largefile
  87. endif
  88. QT5BASE_CONFIGURE_OPTS += -opensource -confirm-license
  89. ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
  90. QT5BASE_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception(tools), GFDL-1.3 (docs)
  91. QT5BASE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT LICENSE.LGPLv3 LICENSE.FDL
  92. else
  93. QT5BASE_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs)
  94. QT5BASE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
  95. endif
  96. ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
  97. QT5BASE_LICENSE += , BSD-3-Clause (examples)
  98. QT5BASE_LICENSE_FILES += header.BSD
  99. endif
  100. QT5BASE_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT5BASE_CONFIG_FILE))
  101. ifneq ($(QT5BASE_CONFIG_FILE),)
  102. QT5BASE_CONFIGURE_OPTS += -qconfig buildroot
  103. endif
  104. ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
  105. QT5BASE_DEPENDENCIES += udev
  106. endif
  107. # Qt5 SQL Plugins
  108. ifeq ($(BR2_PACKAGE_QT5BASE_SQL),y)
  109. ifeq ($(BR2_PACKAGE_QT5BASE_MYSQL),y)
  110. QT5BASE_CONFIGURE_OPTS += -plugin-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
  111. QT5BASE_DEPENDENCIES += mysql
  112. else
  113. QT5BASE_CONFIGURE_OPTS += -no-sql-mysql
  114. endif
  115. ifeq ($(BR2_PACKAGE_QT5BASE_PSQL),y)
  116. QT5BASE_CONFIGURE_OPTS += -plugin-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
  117. QT5BASE_DEPENDENCIES += postgresql
  118. else
  119. QT5BASE_CONFIGURE_OPTS += -no-sql-psql
  120. endif
  121. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_QT),-plugin-sql-sqlite)
  122. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),-system-sqlite)
  123. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),sqlite)
  124. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_NONE),-no-sql-sqlite)
  125. endif
  126. ifeq ($(BR2_PACKAGE_QT5BASE_GUI),y)
  127. QT5BASE_CONFIGURE_OPTS += -gui -system-freetype
  128. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5_VERSION_5_6),-I$(STAGING_DIR)/usr/include/freetype2)
  129. QT5BASE_DEPENDENCIES += freetype
  130. else
  131. QT5BASE_CONFIGURE_OPTS += -no-gui -no-freetype
  132. endif
  133. ifeq ($(BR2_PACKAGE_QT5BASE_HARFBUZZ),y)
  134. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y)
  135. # system harfbuzz in case __sync for 4 bytes is supported
  136. QT5BASE_CONFIGURE_OPTS += -system-harfbuzz
  137. QT5BASE_DEPENDENCIES += harfbuzz
  138. else
  139. # qt harfbuzz otherwise (using QAtomic instead)
  140. QT5BASE_CONFIGURE_OPTS += -qt-harfbuzz
  141. QT5BASE_LICENSE += , MIT (harfbuzz)
  142. QT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
  143. endif
  144. else
  145. QT5BASE_CONFIGURE_OPTS += -no-harfbuzz
  146. endif
  147. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
  148. # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
  149. # is to add a link against the "inuxfb" library.
  150. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
  151. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
  152. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),directfb)
  153. ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
  154. QT5BASE_CONFIGURE_OPTS += -xcb
  155. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  156. QT5BASE_CONFIGURE_OPTS += -system-xkbcommon-x11
  157. else
  158. QT5BASE_CONFIGURE_OPTS += -xkbcommon
  159. endif
  160. QT5BASE_DEPENDENCIES += \
  161. libxcb \
  162. xcb-util-wm \
  163. xcb-util-image \
  164. xcb-util-keysyms \
  165. xlib_libX11 \
  166. libxkbcommon
  167. ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
  168. QT5BASE_DEPENDENCIES += xlib_libXext
  169. endif
  170. else
  171. QT5BASE_CONFIGURE_OPTS += -no-xcb
  172. endif
  173. ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_DESKTOP),y)
  174. QT5BASE_CONFIGURE_OPTS += -opengl desktop
  175. QT5BASE_DEPENDENCIES += libgl
  176. else ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_ES2),y)
  177. QT5BASE_CONFIGURE_OPTS += -opengl es2
  178. QT5BASE_DEPENDENCIES += libgles
  179. else
  180. QT5BASE_CONFIGURE_OPTS += -no-opengl
  181. endif
  182. QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
  183. QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
  184. ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
  185. QT5BASE_CONFIGURE_OPTS += -eglfs
  186. QT5BASE_DEPENDENCIES += libegl
  187. else
  188. QT5BASE_CONFIGURE_OPTS += -no-eglfs
  189. endif
  190. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  191. # No OpenSSL 1.1.x support in Qt 5.6.x
  192. # LibreSSL works with shared linkage only and -fpermissive patch
  193. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBRESSL),-openssl-linked,-no-openssl)
  194. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBRESSL),openssl)
  195. else
  196. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_OPENSSL),-openssl,-no-openssl)
  197. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_OPENSSL),openssl)
  198. endif
  199. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),-fontconfig,-no-fontconfig)
  200. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),fontconfig)
  201. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GIF),,-no-gif)
  202. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_JPEG),-system-libjpeg,-no-libjpeg)
  203. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_JPEG),jpeg)
  204. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_PNG),-system-libpng,-no-libpng)
  205. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_PNG),libpng)
  206. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DBUS),-dbus,-no-dbus)
  207. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DBUS),dbus)
  208. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),-tslib,-no-tslib)
  209. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),tslib)
  210. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBGLIB2),-glib,-no-glib)
  211. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBGLIB2),libglib2)
  212. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_ICU),-icu,-no-icu)
  213. QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
  214. QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
  215. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  216. # gstreamer 0.10 support is broken in qt5multimedia
  217. ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE),y)
  218. QT5BASE_CONFIGURE_OPTS += -gstreamer 1.0
  219. QT5BASE_DEPENDENCIES += gst1-plugins-base
  220. else
  221. QT5BASE_CONFIGURE_OPTS += -no-gstreamer
  222. endif
  223. endif
  224. ifeq ($(BR2_PACKAGE_LIBINPUT),y)
  225. QT5BASE_CONFIGURE_OPTS += -libinput
  226. QT5BASE_DEPENDENCIES += libinput
  227. else
  228. QT5BASE_CONFIGURE_OPTS += -no-libinput
  229. endif
  230. ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
  231. # only enable gtk support if libgtk3 X11 backend is enabled
  232. ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_LIBGTK3_X11),yy)
  233. QT5BASE_CONFIGURE_OPTS += -gtk
  234. QT5BASE_DEPENDENCIES += libgtk3
  235. else
  236. QT5BASE_CONFIGURE_OPTS += -no-gtk
  237. endif
  238. endif
  239. ifeq ($(BR2_PACKAGE_SYSTEMD),y)
  240. QT5BASE_CONFIGURE_OPTS += -journald
  241. QT5BASE_DEPENDENCIES += systemd
  242. else
  243. QT5BASE_CONFIGURE_OPTS += -no-journald
  244. endif
  245. # Build the list of libraries to be installed on the target
  246. QT5BASE_INSTALL_LIBS_y += Qt5Core
  247. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XCB) += Qt5XcbQpa
  248. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_NETWORK) += Qt5Network
  249. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_CONCURRENT) += Qt5Concurrent
  250. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_SQL) += Qt5Sql
  251. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_TEST) += Qt5Test
  252. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XML) += Qt5Xml
  253. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_OPENGL_LIB) += Qt5OpenGL
  254. ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
  255. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglFSDeviceIntegration
  256. ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
  257. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglFsKmsSupport
  258. endif
  259. ifeq ($(BR2_PACKAGE_GCNANO_BINARIES),y)
  260. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglFsKmsSupport
  261. endif
  262. else
  263. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglDeviceIntegration
  264. endif
  265. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_GUI) += Qt5Gui
  266. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_WIDGETS) += Qt5Widgets
  267. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
  268. QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
  269. ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
  270. ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
  271. # use vivante backend
  272. QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
  273. else ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE),y)
  274. # use mali backend
  275. QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_mali
  276. endif
  277. endif
  278. ifneq ($(QT5BASE_CONFIG_FILE),)
  279. define QT5BASE_CONFIGURE_CONFIG_FILE
  280. cp $(QT5BASE_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
  281. endef
  282. endif
  283. QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
  284. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)
  285. # Qt 5.8 needs atomics, which on various architectures are in -latomic
  286. define QT5BASE_CONFIGURE_ARCH_CONFIG
  287. printf 'LIBS += -latomic\n' >$(QT5BASE_ARCH_CONFIG_FILE)
  288. endef
  289. endif
  290. # This allows to use ccache when available
  291. define QT5BASE_CONFIGURE_HOSTCC
  292. $(SED) 's,^QMAKE_CC\s*=.*,QMAKE_CC = $(HOSTCC),' $(@D)/mkspecs/common/g++-base.conf
  293. $(SED) 's,^QMAKE_CXX\s*=.*,QMAKE_CXX = $(HOSTCXX),' $(@D)/mkspecs/common/g++-base.conf
  294. endef
  295. # Must be last so can override all options set by Buildroot
  296. QT5BASE_CONFIGURE_OPTS += $(call qstrip,$(BR2_PACKAGE_QT5BASE_CUSTOM_CONF_OPTS))
  297. define QT5BASE_CONFIGURE_CMDS
  298. mkdir -p $(@D)/mkspecs/devices/linux-buildroot-g++/
  299. sed 's/@EGLFS_DEVICE@/$(QT5BASE_EGLFS_DEVICE)/g' \
  300. $(QT5BASE_PKGDIR)/qmake.conf.in > \
  301. $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
  302. $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \
  303. $(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  304. $(QT5BASE_CONFIGURE_CONFIG_FILE)
  305. touch $(QT5BASE_ARCH_CONFIG_FILE)
  306. $(QT5BASE_CONFIGURE_ARCH_CONFIG)
  307. $(QT5BASE_CONFIGURE_HOSTCC)
  308. (cd $(@D); \
  309. $(TARGET_MAKE_ENV) \
  310. PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
  311. MAKEFLAGS="-j$(PARALLEL_JOBS) $(MAKEFLAGS)" \
  312. ./configure \
  313. -v \
  314. -prefix /usr \
  315. -hostprefix $(HOST_DIR) \
  316. -headerdir /usr/include/qt5 \
  317. -sysroot $(STAGING_DIR) \
  318. -plugindir /usr/lib/qt/plugins \
  319. -examplesdir /usr/lib/qt/examples \
  320. -no-rpath \
  321. -nomake tests \
  322. -device buildroot \
  323. -device-option CROSS_COMPILE="$(TARGET_CROSS)" \
  324. -device-option BR_COMPILER_CFLAGS="$(QT5BASE_CFLAGS)" \
  325. -device-option BR_COMPILER_CXXFLAGS="$(QT5BASE_CXXFLAGS)" \
  326. $(QT5BASE_CONFIGURE_OPTS) \
  327. )
  328. endef
  329. define QT5BASE_BUILD_CMDS
  330. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
  331. endef
  332. # The file "qt.conf" can be used to override the hard-coded paths that are
  333. # compiled into the Qt library. We need it to make "qmake" relocatable.
  334. define QT5BASE_INSTALL_QT_CONF
  335. sed -e "s|@@HOST_DIR@@|$(HOST_DIR)|" -e "s|@@STAGING_DIR@@|$(STAGING_DIR)|" \
  336. $(QT5BASE_PKGDIR)/qt.conf.in > $(HOST_DIR)/bin/qt.conf
  337. endef
  338. define QT5BASE_INSTALL_STAGING_CMDS
  339. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
  340. $(QT5BASE_INSTALL_QT_CONF)
  341. endef
  342. define QT5BASE_INSTALL_TARGET_LIBS
  343. for lib in $(QT5BASE_INSTALL_LIBS_y); do \
  344. cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib || exit 1 ; \
  345. done
  346. endef
  347. define QT5BASE_INSTALL_TARGET_PLUGINS
  348. if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
  349. mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
  350. cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
  351. fi
  352. endef
  353. ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
  354. define QT5BASE_INSTALL_TARGET_FONTS
  355. if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
  356. mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
  357. cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
  358. fi
  359. endef
  360. endif
  361. define QT5BASE_INSTALL_TARGET_EXAMPLES
  362. if [ -d $(STAGING_DIR)/usr/lib/qt/examples/ ] ; then \
  363. mkdir -p $(TARGET_DIR)/usr/lib/qt/examples ; \
  364. cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/* $(TARGET_DIR)/usr/lib/qt/examples ; \
  365. fi
  366. endef
  367. ifeq ($(BR2_STATIC_LIBS),y)
  368. define QT5BASE_INSTALL_TARGET_CMDS
  369. $(QT5BASE_INSTALL_TARGET_FONTS)
  370. $(QT5BASE_INSTALL_TARGET_EXAMPLES)
  371. endef
  372. else
  373. define QT5BASE_INSTALL_TARGET_CMDS
  374. $(QT5BASE_INSTALL_TARGET_LIBS)
  375. $(QT5BASE_INSTALL_TARGET_PLUGINS)
  376. $(QT5BASE_INSTALL_TARGET_FONTS)
  377. $(QT5BASE_INSTALL_TARGET_EXAMPLES)
  378. endef
  379. endif
  380. $(eval $(generic-package))