diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-04-18 15:57:00 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-19 16:40:29 +0200 |
commit | 0074cc5d34a8ee314e864ba488dab1f0d0f94995 (patch) | |
tree | e770ac258fbd0f3083021ff3cb4d2c5eedaf39a9 /configure | |
parent | 14ea50598fb7217de5336ba33302a0ed151327a2 (diff) |
Fix detection of default platform plugin.
Let configure generate the QT_QPA_DEFAULT_PLATFORM_NAME in
qconfig.h. This allows us to override the platform name
using a configure argument.
This commit adds -qpa <platform> that lets the user specify
the default platform at configure time. Note that the default
platform is not checked against the tree since plugins are
allowed to exist outside the Qt source tree.
In the absence of -qpa argument, configure checks the mkspec
for a variable named QT_QPA_DEFAULT_PLATFORM. This check is
implemented only in the unix configure because it will be primarily
used in custom mkspecs (devices, boards).
If -qpa argument is absent and the mkspec variable is absent,
the default value is determined based on the OS as below:
Unix - "xcb"
Windows - "windows"
Mac - "cocoa"
QNX - "qnx"
Done-with: Jørgen Lind
Change-Id: I0df31811a1b901a3242bfada1232e596ebda04f4
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -818,6 +818,9 @@ QT_LIBS_GLIB= QT_CFLAGS_GSTREAMER= QT_LIBS_GSTREAMER= +# default qpa platform +QT_QPA_DEFAULT_PLATFORM= + #------------------------------------------------------------------------------- # check SQL drivers available in this package #------------------------------------------------------------------------------- @@ -900,7 +903,7 @@ while [ "$#" -gt 0 ]; do shift VAL=$1 ;; - -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir) + -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL="$1" @@ -1292,6 +1295,9 @@ while [ "$#" -gt 0 ]; do DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"` DeviceVar set $DEV_VAR $DEV_VAL ;; + qpa) + QT_QPA_DEFAULT_PLATFORM="$VAL" + ;; debug-and-release) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_DEBUG_RELEASE="$VAL" @@ -3109,6 +3115,8 @@ Additional options: $DFBN -no-directfb ....... Do not compile DirectFB support. $DFBY -directfb .......... Compile DirectFB support. + -qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows). + -xplatform target ... The target platform when cross-compiling. -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot. @@ -4637,6 +4645,21 @@ if [ "$CFG_EGLFS" != "no" ]; then fi fi +# Determine the default QPA platform +if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then + # check the mkspec + QT_QPA_DEFAULT_PLATFORM=`getXQMakeConf QT_QPA_DEFAULT_PLATFORM` + if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then + if [ "$BUILD_ON_MAC" = "yes" ]; then + QT_QPA_DEFAULT_PLATFORM="cocoa" + elif [ "$UNAME_SYSTEM" = "QNX" ]; then + QT_QPA_DEFAULT_PLATFORM="qnx" + else + QT_QPA_DEFAULT_PLATFORM="xcb" + fi + fi +fi + if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB" QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB" @@ -5657,6 +5680,8 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF EOF fi +echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new" + # avoid unecessary rebuilds by copying only if qconfig.h has changed if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then rm -f "$outpath/src/corelib/global/qconfig.h.new" |