diff options
author | Robin Burchell <robin.burchell@collabora.co.uk> | 2012-05-01 14:39:23 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-29 21:15:46 +0200 |
commit | ddf7233125dbf7dfb218fd47f77a94446ce3c027 (patch) | |
tree | 8a8d25dff1f008a8c6bcfe5290e1dd985ba09115 /mkspecs/unsupported | |
parent | f58e046a611118a6349ee617a98dbb24280ef183 (diff) |
Add mkspecs for android cross compilation.
Using these requires setting two environment variables, e.g, for me:
export ANDROID_NDK_ROOT=/Users/burchr/android-ndk-r7c
export ANDROID_NDK_HOST=darwin-x86
./configure -opensource -confirm-license -xplatform unsupported/linux-android-armeabi-v7a-g++ -nomake examples -nomake demos -nomake tests -v
These mkspecs are somewhat based on the work of the Necessitas crew, kudos to
them for their work in getting the NDK integration into qmake.
Change-Id: I591e423ed8dc70616009f681c81890c696110e62
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'mkspecs/unsupported')
6 files changed, 171 insertions, 0 deletions
diff --git a/mkspecs/unsupported/linux-android-armeabi-g++/qmake.conf b/mkspecs/unsupported/linux-android-armeabi-g++/qmake.conf new file mode 100644 index 0000000000..ef5594e3a4 --- /dev/null +++ b/mkspecs/unsupported/linux-android-armeabi-g++/qmake.conf @@ -0,0 +1,15 @@ +# +# qmake configuration for building with android-g++ for ARMv5 +# + +ANDROID_TARGET_ARCH = armeabi +ANDROID_ARCHITECTURE = arm +ANDROID_NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi +ANDROID_NDK_TOOLS_PREFIX = arm-linux-androideabi + +include(../../common/linux-android.conf) + +QMAKE_CFLAGS = -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack +QMAKE_CFLAGS_RELEASE = -g -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 +QMAKE_CFLAGS_DEBUG = -g -marm -O0 -fno-omit-frame-pointer + diff --git a/mkspecs/unsupported/linux-android-armeabi-g++/qplatformdefs.h b/mkspecs/unsupported/linux-android-armeabi-g++/qplatformdefs.h new file mode 100644 index 0000000000..ff3730b246 --- /dev/null +++ b/mkspecs/unsupported/linux-android-armeabi-g++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Collabora Ltd, author <robin.burchell@collabora.co.uk> +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../common/android/qplatformdefs.h" diff --git a/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qmake.conf b/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qmake.conf new file mode 100644 index 0000000000..91e0c4cb72 --- /dev/null +++ b/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qmake.conf @@ -0,0 +1,15 @@ +# +# qmake configuration for building with android-g++ for ARMv7 +# + +ANDROID_TARGET_ARCH = armeabi-v7a +ANDROID_ARCHITECTURE = arm +ANDROID_NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi +ANDROID_NDK_TOOLS_PREFIX = arm-linux-androideabi + +include(../../common/linux-android.conf) + +QMAKE_CFLAGS = -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack +QMAKE_CFLAGS_RELEASE = -g -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 +QMAKE_CFLAGS_DEBUG = -g -marm -O0 -fno-omit-frame-pointer + diff --git a/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qplatformdefs.h b/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qplatformdefs.h new file mode 100644 index 0000000000..ff3730b246 --- /dev/null +++ b/mkspecs/unsupported/linux-android-armeabi-v7a-g++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Collabora Ltd, author <robin.burchell@collabora.co.uk> +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../common/android/qplatformdefs.h" diff --git a/mkspecs/unsupported/linux-android-x86-g++/qmake.conf b/mkspecs/unsupported/linux-android-x86-g++/qmake.conf new file mode 100644 index 0000000000..9550e1ae46 --- /dev/null +++ b/mkspecs/unsupported/linux-android-x86-g++/qmake.conf @@ -0,0 +1,15 @@ +# +# qmake configuration for building with android-g++ for x86 +# + +ANDROID_TARGET_ARCH = x86 +ANDROID_ARCHITECTURE = x86 +ANDROID_NDK_TOOLCHAIN_PREFIX = x86 +ANDROID_NDK_TOOLS_PREFIX = i686-android-linux + +include(../../common/linux-android.conf) + +QMAKE_CFLAGS = -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack +QMAKE_CFLAGS_RELEASE = -g -O2 +QMAKE_CFLAGS_DEBUG = -g + diff --git a/mkspecs/unsupported/linux-android-x86-g++/qplatformdefs.h b/mkspecs/unsupported/linux-android-x86-g++/qplatformdefs.h new file mode 100644 index 0000000000..ff3730b246 --- /dev/null +++ b/mkspecs/unsupported/linux-android-x86-g++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Collabora Ltd, author <robin.burchell@collabora.co.uk> +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../common/android/qplatformdefs.h" |