qt5base: correct eglfs support in qmake.conf.in
authorGiulio Benetti <giulio.benetti@micronovasrl.com>
Mon, 13 Nov 2017 18:41:54 +0000 (19:41 +0100)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Wed, 4 Apr 2018 21:35:22 +0000 (23:35 +0200)
Setting EGLFS_DEVICE_INTEGRATION at the end of qmake.conf like is done
by commit 0c219ddb8a doesn't work correctly: it has to be set before the
include(../common/linux_device_post.conf)

Instead of appending to the file, change it into a qmake.conf.in
template file that contains a placeholder for the
EGLFS_DEVICE_INTEGRATION assignment and update it with sed. Since the
sed always has to be executed, this removes the need for a separate
QT5BASE_CONFIGURE_QMAKE_CONFIG definition.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
[Arnout: simplify the replacement, move sunxi-mali support to a
 separate patch]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/qt5/qt5base/qmake.conf [deleted file]
package/qt5/qt5base/qmake.conf.in [new file with mode: 0644]
package/qt5/qt5base/qt5base.mk

diff --git a/package/qt5/qt5base/qmake.conf b/package/qt5/qt5base/qmake.conf
deleted file mode 100644 (file)
index 8b6debe..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Qt5 has a mechanism to support "device" profiles, so that people can
-# specify the compiler, compiler flags and so on for a specific device.
-
-# We leverage this mechanism in the Buildroot packaging of qt5 to
-# simplify cross-compilation: we have our own "device" definition, which
-# allows us to easily pass the cross-compiler paths and flags from our
-# qt5.mk.
-
-include(../common/linux_device_pre.conf)
-
-# modifications to g++-unix.conf
-QMAKE_CC                = $${CROSS_COMPILE}gcc
-QMAKE_CXX               = $${CROSS_COMPILE}g++
-
-# modifications to gcc-base.conf
-QMAKE_CFLAGS           += $${BR_COMPILER_CFLAGS}
-QMAKE_CXXFLAGS         += $${BR_COMPILER_CXXFLAGS}
-QMAKE_CXXFLAGS_RELEASE += -O3
-CONFIG                 += nostrip
-
-QMAKE_LIBS             += -lrt -lpthread -ldl
-QMAKE_CFLAGS_ISYSTEM   =
-
-# Architecturespecific configuration
-include(arch.conf)
-
-include(../common/linux_device_post.conf)
-load(qt_config)
diff --git a/package/qt5/qt5base/qmake.conf.in b/package/qt5/qt5base/qmake.conf.in
new file mode 100644 (file)
index 0000000..d62ee7c
--- /dev/null
@@ -0,0 +1,30 @@
+# Qt5 has a mechanism to support "device" profiles, so that people can
+# specify the compiler, compiler flags and so on for a specific device.
+
+# We leverage this mechanism in the Buildroot packaging of qt5 to
+# simplify cross-compilation: we have our own "device" definition, which
+# allows us to easily pass the cross-compiler paths and flags from our
+# qt5.mk.
+
+include(../common/linux_device_pre.conf)
+
+# modifications to g++-unix.conf
+QMAKE_CC                = $${CROSS_COMPILE}gcc
+QMAKE_CXX               = $${CROSS_COMPILE}g++
+
+# modifications to gcc-base.conf
+QMAKE_CFLAGS           += $${BR_COMPILER_CFLAGS}
+QMAKE_CXXFLAGS         += $${BR_COMPILER_CXXFLAGS}
+QMAKE_CXXFLAGS_RELEASE += -O3
+CONFIG                 += nostrip
+
+QMAKE_LIBS             += -lrt -lpthread -ldl
+QMAKE_CFLAGS_ISYSTEM   =
+
+# Architecturespecific configuration
+include(arch.conf)
+
+@EGLFS_DEVICE@
+
+include(../common/linux_device_post.conf)
+load(qt_config)
index 76c129d2e4b308fc9885f14784679ee48439f47c..a9a79ba08709a71d159c6d58ffc496c4fa8f0f46 100644 (file)
@@ -242,10 +242,7 @@ QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
 
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST)$(BR2_PACKAGE_IMX_GPU_VIV),yy)
 # use vivante backend
-define QT5BASE_CONFIGURE_QMAKE_CONFIG
-       echo "EGLFS_DEVICE_INTEGRATION = eglfs_viv" >> \
-               $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
-endef
+QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
 endif
 
 ifneq ($(QT5BASE_CONFIG_FILE),)
@@ -263,7 +260,9 @@ endef
 endif
 
 define QT5BASE_CONFIGURE_CMDS
-       $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qmake.conf \
+       mkdir -p $(@D)/mkspecs/devices/linux-buildroot-g++/
+       sed 's/@EGLFS_DEVICE@/$(QT5BASE_EGLFS_DEVICE)/g' \
+               $(QT5BASE_PKGDIR)/qmake.conf.in > \
                $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
        $(QT5BASE_CONFIGURE_QMAKE_CONFIG)
        $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \