summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen Hofstee <jhofstee@victronenergy.com>2017-11-21 10:51:23 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2017-12-20 08:22:55 +0000
commitaeeaa939c7f129a4be2220c86fcebca0fcc8b100 (patch)
tree6521892a6486329428438e82a746d5fdb98cf336
parentd27c0199dbe453b3b9af32783f6d15c022f18429 (diff)
downloadmeta-qt5-aeeaa939c7f129a4be2220c86fcebca0fcc8b100.tar.gz
qtbase: mkspecs: add default toolchain options
While most mkspecs use hardcoded compiler names / options, qmake in meta-qt5 is setup to get them from the environment. While this works fine with openembedded, it does break normal workflows outside of it. For example to get the SDK working with Qt Creator either the environmental script most be sourced first, making it impossible to switch between different Qt versions or the OE_QMAKE must be set for every project, otherwise you get cryptic errors like 'make: c: Command not found', since the compiler name is not set and hence an attempt is made to execute only the arguments. Likewise on the target itself, qmake doesn't work without first setting the OE_QMAKE variables. This patch adds default toolchains options, so it is no longer required to set them, but keeps the flexibility to alter them from the environment. Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--recipes-qt/qt5/qtbase_git.bb22
1 files changed, 22 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index bf9540b7..e5f0ab76 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -217,6 +217,28 @@ do_install_append() {
217 sed -i -e 's|${STAGING_DIR_NATIVE}|$$[QT_HOST_PREFIX/get]|g' \ 217 sed -i -e 's|${STAGING_DIR_NATIVE}|$$[QT_HOST_PREFIX/get]|g' \
218 -e 's|${STAGING_DIR_HOST}|$$[QT_SYSROOT]|g' \ 218 -e 's|${STAGING_DIR_HOST}|$$[QT_SYSROOT]|g' \
219 ${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/*.pri 219 ${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/*.pri
220
221 # Update the mkspecs to include the default OE toolchain config for the target
222 conf=${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/${XPLATFORM}/qmake.conf
223
224 # qmake already knows the sysroot, see above $$[QT_SYSROOT], so remove the hardcoded sysroot
225 OE_QMAKE_CC_NO_SYSROOT=$(echo ${OE_QMAKE_CC} | sed -e 's!--sysroot=[^ ]*!!g')
226 OE_QMAKE_CXX_NO_SYSROOT=$(echo ${OE_QMAKE_CXX} | sed -e 's!--sysroot=[^ ]*!!g')
227 OE_QMAKE_LINK_NO_SYSROOT=$(echo ${OE_QMAKE_LINK} | sed -e 's!--sysroot=[^ ]*!!g')
228
229 echo "" >> $conf
230 echo "# default compiler options which can be overwritten from the environment" >> $conf
231 echo "isEmpty(QMAKE_AR): QMAKE_AR = ${OE_QMAKE_AR} cqs" >> $conf
232 echo "isEmpty(QMAKE_CC): QMAKE_CC = $OE_QMAKE_CC_NO_SYSROOT" >> $conf
233 echo "isEmpty(QMAKE_CFLAGS): QMAKE_CFLAGS = ${OE_QMAKE_CFLAGS}" >> $conf
234 echo "isEmpty(QMAKE_CXX): QMAKE_CXX = $OE_QMAKE_CXX_NO_SYSROOT" >> $conf
235 echo "isEmpty(QMAKE_CXXFLAGS): QMAKE_CXXFLAGS = ${OE_QMAKE_CXXFLAGS}" >> $conf
236 echo "isEmpty(QMAKE_LINK): QMAKE_LINK = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
237 echo "isEmpty(QMAKE_LINK_SHLIB): QMAKE_LINK_SHLIB = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
238 echo "isEmpty(QMAKE_LINK_C): QMAKE_LINK_C = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
239 echo "isEmpty(QMAKE_LINK_C_SHLIB): QMAKE_LINK_C_SHLIB = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
240 echo "isEmpty(QMAKE_LFLAGS): QMAKE_LFLAGS = ${OE_QMAKE_LDFLAGS}" >> $conf
241 echo "isEmpty(QMAKE_STRIP): QMAKE_STRIP = ${TARGET_PREFIX}strip" >> $conf
220} 242}
221 243
222# mkspecs have mac specific scripts that depend on perl and bash 244# mkspecs have mac specific scripts that depend on perl and bash