iptables: bump to version 1.6.1
[buildroot-gz.git] / package / qt5 / qt5base / qt5base.mk
blobbbbaf0f4568fc073001c61919a9f4fa36c212d52
1 ################################################################################
3 # qt5base
5 ################################################################################
7 QT5BASE_VERSION = $(QT5_VERSION)
8 QT5BASE_SITE = $(QT5_SITE)
9 QT5BASE_SOURCE = qtbase-opensource-src-$(QT5BASE_VERSION).tar.xz
11 QT5BASE_DEPENDENCIES = host-pkgconf zlib pcre
12 QT5BASE_INSTALL_STAGING = YES
14 # A few comments:
15 # * -no-pch to workaround the issue described at
16 # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
17 # * -system-zlib because zlib is mandatory for Qt build, and we
18 # want to use the Buildroot packaged zlib
19 # * -system-pcre because pcre is mandatory to build Qt, and we
20 # want to use the one packaged in Buildroot
21 QT5BASE_CONFIGURE_OPTS += \
22 -optimized-qmake \
23 -no-cups \
24 -no-iconv \
25 -system-zlib \
26 -system-pcre \
27 -no-pch \
28 -shared
30 # Uses libgbm from mesa3d
31 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
32 QT5BASE_CONFIGURE_OPTS += -kms -gbm
33 QT5BASE_DEPENDENCIES += mesa3d
34 else
35 QT5BASE_CONFIGURE_OPTS += -no-kms
36 endif
38 ifeq ($(BR2_ENABLE_DEBUG),y)
39 QT5BASE_CONFIGURE_OPTS += -debug
40 else
41 QT5BASE_CONFIGURE_OPTS += -release
42 endif
44 QT5BASE_CONFIGURE_OPTS += -largefile
46 ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
47 QT5BASE_CONFIGURE_OPTS += -opensource -confirm-license
48 QT5BASE_LICENSE = GPLv3 or LGPLv2.1 with exception or LGPLv3, GFDLv1.3 (docs)
49 QT5BASE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
50 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
51 QT5BASE_LICENSE := $(QT5BASE_LICENSE), BSD-3c (examples)
52 QT5BASE_LICENSE_FILES += header.BSD
53 endif
54 else
55 QT5BASE_LICENSE = Commercial license
56 QT5BASE_REDISTRIBUTE = NO
57 endif
59 QT5BASE_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT5BASE_CONFIG_FILE))
61 ifneq ($(QT5BASE_CONFIG_FILE),)
62 QT5BASE_CONFIGURE_OPTS += -qconfig buildroot
63 endif
65 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
66 QT5BASE_DEPENDENCIES += udev
67 endif
69 # Qt5 SQL Plugins
70 ifeq ($(BR2_PACKAGE_QT5BASE_SQL),y)
71 ifeq ($(BR2_PACKAGE_QT5BASE_MYSQL),y)
72 QT5BASE_CONFIGURE_OPTS += -plugin-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
73 QT5BASE_DEPENDENCIES += mysql
74 else
75 QT5BASE_CONFIGURE_OPTS += -no-sql-mysql
76 endif
78 ifeq ($(BR2_PACKAGE_QT5BASE_PSQL),y)
79 QT5BASE_CONFIGURE_OPTS += -plugin-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
80 QT5BASE_DEPENDENCIES += postgresql
81 else
82 QT5BASE_CONFIGURE_OPTS += -no-sql-psql
83 endif
85 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_QT),-plugin-sql-sqlite)
86 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),-system-sqlite)
87 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),sqlite)
88 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_NONE),-no-sql-sqlite)
89 endif
91 # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
92 # is to add a link against the "inuxfb" library.
93 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-gui,-no-gui)
94 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
95 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
96 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
97 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),directfb)
99 ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
100 QT5BASE_CONFIGURE_OPTS += -xcb -system-xkbcommon
101 QT5BASE_DEPENDENCIES += \
102 libxcb \
103 xcb-util-wm \
104 xcb-util-image \
105 xcb-util-keysyms \
106 xlib_libX11 \
107 libxkbcommon
108 ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
109 QT5BASE_DEPENDENCIES += xlib_libXext
110 endif
111 else
112 QT5BASE_CONFIGURE_OPTS += -no-xcb
113 endif
115 ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_DESKTOP),y)
116 QT5BASE_CONFIGURE_OPTS += -opengl desktop
117 QT5BASE_DEPENDENCIES += libgl
118 else ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_ES2),y)
119 QT5BASE_CONFIGURE_OPTS += -opengl es2
120 QT5BASE_DEPENDENCIES += libgles
121 else
122 QT5BASE_CONFIGURE_OPTS += -no-opengl
123 endif
125 QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
126 QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
128 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
129 QT5BASE_CONFIGURE_OPTS += -eglfs
130 QT5BASE_DEPENDENCIES += libegl
131 else
132 QT5BASE_CONFIGURE_OPTS += -no-eglfs
133 endif
135 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_OPENSSL),-openssl,-no-openssl)
136 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_OPENSSL),openssl)
138 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),-fontconfig,-no-fontconfig)
139 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),fontconfig)
140 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GIF),,-no-gif)
141 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_JPEG),-system-libjpeg,-no-libjpeg)
142 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_JPEG),jpeg)
143 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_PNG),-system-libpng,-no-libpng)
144 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_PNG),libpng)
146 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DBUS),-dbus,-no-dbus)
147 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DBUS),dbus)
149 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),-tslib,-no-tslib)
150 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),tslib)
152 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBGLIB2),-glib,-no-glib)
153 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBGLIB2),libglib2)
155 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_ICU),-icu,-no-icu)
156 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
158 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
160 # gstreamer 0.10 support is broken in qt5multimedia
161 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE),y)
162 QT5BASE_CONFIGURE_OPTS += -gstreamer 1.0
163 QT5BASE_DEPENDENCIES += gst1-plugins-base
164 else
165 QT5BASE_CONFIGURE_OPTS += -no-gstreamer
166 endif
168 ifeq ($(BR2_PACKAGE_LIBINPUT),y)
169 QT5BASE_CONFIGURE_OPTS += -libinput
170 QT5BASE_DEPENDENCIES += libinput
171 else
172 QT5BASE_CONFIGURE_OPTS += -no-libinput
173 endif
175 # Build the list of libraries to be installed on the target
176 QT5BASE_INSTALL_LIBS_y += Qt5Core
177 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XCB) += Qt5XcbQpa
178 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_NETWORK) += Qt5Network
179 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_CONCURRENT) += Qt5Concurrent
180 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_SQL) += Qt5Sql
181 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_TEST) += Qt5Test
182 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XML) += Qt5Xml
183 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_OPENGL_LIB) += Qt5OpenGL
184 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglDeviceIntegration
186 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_GUI) += Qt5Gui
187 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_WIDGETS) += Qt5Widgets
188 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
190 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
192 ifneq ($(QT5BASE_CONFIG_FILE),)
193 define QT5BASE_CONFIGURE_CONFIG_FILE
194 cp $(QT5BASE_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
195 endef
196 endif
198 define QT5BASE_CONFIGURE_CMDS
199 $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qmake.conf \
200 $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
201 $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \
202 $(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
203 $(QT5BASE_CONFIGURE_CONFIG_FILE)
204 (cd $(@D); \
205 $(TARGET_MAKE_ENV) \
206 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
207 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
208 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
209 MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" \
210 ./configure \
211 -v \
212 -prefix /usr \
213 -hostprefix $(HOST_DIR)/usr \
214 -headerdir /usr/include/qt5 \
215 -sysroot $(STAGING_DIR) \
216 -plugindir /usr/lib/qt/plugins \
217 -examplesdir /usr/lib/qt/examples \
218 -no-rpath \
219 -nomake tests \
220 -device buildroot \
221 -device-option CROSS_COMPILE="$(TARGET_CROSS)" \
222 -device-option BR_COMPILER_CFLAGS="$(TARGET_CFLAGS) $(QT5BASE_EXTRA_CFLAGS)" \
223 -device-option BR_COMPILER_CXXFLAGS="$(TARGET_CXXFLAGS) $(QT5BASE_EXTRA_CFLAGS)" \
224 $(QT5BASE_CONFIGURE_OPTS) \
226 endef
228 define QT5BASE_BUILD_CMDS
229 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
230 endef
232 define QT5BASE_INSTALL_STAGING_CMDS
233 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
234 $(QT5_LA_PRL_FILES_FIXUP)
235 endef
237 define QT5BASE_INSTALL_TARGET_LIBS
238 for lib in $(QT5BASE_INSTALL_LIBS_y); do \
239 cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib || exit 1 ; \
240 done
241 endef
243 define QT5BASE_INSTALL_TARGET_PLUGINS
244 if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
245 mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
246 cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
248 endef
250 define QT5BASE_INSTALL_TARGET_FONTS
251 if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
252 mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
253 cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
255 endef
257 define QT5BASE_INSTALL_TARGET_EXAMPLES
258 if [ -d $(STAGING_DIR)/usr/lib/qt/examples/ ] ; then \
259 mkdir -p $(TARGET_DIR)/usr/lib/qt/examples ; \
260 cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/* $(TARGET_DIR)/usr/lib/qt/examples ; \
262 endef
264 ifeq ($(BR2_STATIC_LIBS),y)
265 define QT5BASE_INSTALL_TARGET_CMDS
266 $(QT5BASE_INSTALL_TARGET_FONTS)
267 $(QT5BASE_INSTALL_TARGET_EXAMPLES)
268 endef
269 else
270 define QT5BASE_INSTALL_TARGET_CMDS
271 $(QT5BASE_INSTALL_TARGET_LIBS)
272 $(QT5BASE_INSTALL_TARGET_PLUGINS)
273 $(QT5BASE_INSTALL_TARGET_FONTS)
274 $(QT5BASE_INSTALL_TARGET_EXAMPLES)
275 endef
276 endif
278 $(eval $(generic-package))