123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- From 02e9698c96ca78342b82fa7239e93bab4aa45db2 Mon Sep 17 00:00:00 2001
- From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
- Date: Fri, 17 Nov 2017 22:20:06 +0100
- Subject: [PATCH] configure: fix build on non-x86 platforms
- When building for an uncommon platform on a ppc64le machine, Qt build
- fails because it builds qmake with the target compiler instead of
- using the host compiler. This is due to the fact that Qt configure
- script believes that both the host and target platforms are "powerpc",
- even though the target really is Xtensa or ARC for example.
- Qt's configure script defines a variable called PLATFORM that points to
- the mkspecs describing the host machine. For x86, its value is
- qws/linux-x86-g++ and for x86-64, its value is
- qws/linux-x86_64-g++. For any other host architecture, its value is
- qws/linux-generic-g++.
- In parallel to this, Qt's configure script defines a variable called
- XPLATFORM that points to the mkspecs describing the target machine. It
- points to qws/linux-${CFG_EMBEDDED}-g++, where CFG_EMBEDDED is
- simply "generic" for most uncommon architectures.
- Therefore, when we're building for an uncommon architecture, on a
- ppc64le machine, we have:
- PLATFORM = qws/linux-generic-g++
- XPLATFORM = qws/linux-generic-g++
- i.e, both values are equal. Due to this, the following condition is
- false:
- if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
- which causes Qt's configure script to fallback to:
- elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
- CFG_ARCH=$CFG_HOST_ARCH
- fi
- because CFG_ARCH is not defined, and therefore gets defined to
- CFG_HOST_ARCH. So we have CFG_ARCH == CFG_HOST_ARCH, and Qt believes
- we're doing a native build.
- Therefore, we need to ensure that PLATFORM and XPLATFORM always have a
- different value. To achieve this, we create a
- qws/linux-host-generic-g++ mkspecs, which is always used as
- PLATFORM. It is identical to qws/linux-x86-g++. Compared to
- qws/linux-x86_64-g++, the only difference is that we're not passing
- the -m64 flag, but that isn't needed when building host tools.
- Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
- ---
- configure | 8 +----
- mkspecs/qws/linux-host-generic-g++/qmake.conf | 10 ++++++
- mkspecs/qws/linux-host-generic-g++/qplatformdefs.h | 42 ++++++++++++++++++++++
- 3 files changed, 53 insertions(+), 7 deletions(-)
- create mode 100644 mkspecs/qws/linux-host-generic-g++/qmake.conf
- create mode 100644 mkspecs/qws/linux-host-generic-g++/qplatformdefs.h
- diff --git a/configure b/configure
- index 10ad7ca0b0..d25f90be1e 100755
- --- a/configure
- +++ b/configure
- @@ -2806,14 +2806,8 @@ if [ "$CFG_EMBEDDED" != "no" ]; then
- Linux:*)
- if [ -z "$PLATFORM" ]; then
- case "$UNAME_MACHINE" in
- - *86)
- - PLATFORM=qws/linux-x86-g++
- - ;;
- - *86_64)
- - PLATFORM=qws/linux-x86_64-g++
- - ;;
- *)
- - PLATFORM=qws/linux-generic-g++
- + PLATFORM=qws/linux-host-generic-g++
- ;;
- esac
- fi
- diff --git a/mkspecs/qws/linux-host-generic-g++/qmake.conf b/mkspecs/qws/linux-host-generic-g++/qmake.conf
- new file mode 100644
- index 0000000000..55011ec52b
- --- /dev/null
- +++ b/mkspecs/qws/linux-host-generic-g++/qmake.conf
- @@ -0,0 +1,10 @@
- +#
- +# qmake configuration for building with linux-g++
- +#
- +
- +include(../../common/linux.conf)
- +include(../../common/gcc-base-unix.conf)
- +include(../../common/g++-unix.conf)
- +include(../../common/qws.conf)
- +
- +load(qt_config)
- diff --git a/mkspecs/qws/linux-host-generic-g++/qplatformdefs.h b/mkspecs/qws/linux-host-generic-g++/qplatformdefs.h
- new file mode 100644
- index 0000000000..a654aa78a2
- --- /dev/null
- +++ b/mkspecs/qws/linux-host-generic-g++/qplatformdefs.h
- @@ -0,0 +1,42 @@
- +/****************************************************************************
- +**
- +** Copyright (C) 2015 The Qt Company Ltd.
- +** Contact: http://www.qt.io/licensing/
- +**
- +** This file is part of the qmake spec of the Qt Toolkit.
- +**
- +** $QT_BEGIN_LICENSE:LGPL$
- +** Commercial License Usage
- +** Licensees holding valid commercial Qt licenses may use this file in
- +** accordance with the commercial license agreement provided with the
- +** Software or, alternatively, in accordance with the terms contained in
- +** a written agreement between you and The Qt Company. For licensing terms
- +** and conditions see http://www.qt.io/terms-conditions. For further
- +** information use the contact form at http://www.qt.io/contact-us.
- +**
- +** GNU Lesser General Public License Usage
- +** Alternatively, this file may be used under the terms of the GNU Lesser
- +** General Public License version 2.1 or version 3 as published by the Free
- +** Software Foundation and appearing in the file LICENSE.LGPLv21 and
- +** LICENSE.LGPLv3 included in the packaging of this file. Please review the
- +** following information to ensure the GNU Lesser General Public License
- +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
- +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- +**
- +** As a special exception, The Qt Company gives you certain additional
- +** rights. These rights are described in The Qt Company LGPL Exception
- +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
- +**
- +** GNU General Public License Usage
- +** Alternatively, this file may be used under the terms of the GNU
- +** General Public License version 3.0 as published by the Free Software
- +** Foundation and appearing in the file LICENSE.GPL included in the
- +** packaging of this file. Please review the following information to
- +** ensure the GNU General Public License version 3.0 requirements will be
- +** met: http://www.gnu.org/copyleft/gpl.html.
- +**
- +** $QT_END_LICENSE$
- +**
- +****************************************************************************/
- +
- +#include "../../linux-g++/qplatformdefs.h"
- --
- 2.13.6
|