From 70170a1c32fc32832359fec14e1e1af7a1968fe9 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 24 Jan 2012 18:05:07 +0100 Subject: Add mkspecs for Blackberry Playbook NDK mkspecs for QNX qcc, armv7le and x86 targets cherry-picked from 43a48ad218fec43ef3c854cb4e215e7b372b23d4 Change-Id: Ic4bb8947aa4dd31a3ab6e23c36775f9c64d1443c Reviewed-by: Oswald Buddenhagen --- mkspecs/common/qcc-base-qnx.conf | 69 ++++++++++++++ mkspecs/common/qcc-base.conf | 36 ++++++++ .../unsupported/blackberry-armv7le-qcc/qmake.conf | 25 +++++ .../blackberry-armv7le-qcc/qplatformdefs.h | 101 +++++++++++++++++++++ mkspecs/unsupported/blackberry-x86-qcc/qmake.conf | 25 +++++ .../unsupported/blackberry-x86-qcc/qplatformdefs.h | 101 +++++++++++++++++++++ 6 files changed, 357 insertions(+) create mode 100644 mkspecs/common/qcc-base-qnx.conf create mode 100644 mkspecs/common/qcc-base.conf create mode 100644 mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf create mode 100644 mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h create mode 100644 mkspecs/unsupported/blackberry-x86-qcc/qmake.conf create mode 100644 mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf new file mode 100644 index 0000000..2bc3311 --- /dev/null +++ b/mkspecs/common/qcc-base-qnx.conf @@ -0,0 +1,69 @@ +# +# Base qmake configuration for QCC on *nix-systems +# + +include(qcc-base.conf) + +QMAKE_LFLAGS_SHLIB += -shared +QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_SONAME += -Wl,-soname, +QMAKE_LFLAGS_THREAD += +QMAKE_LFLAGS_RPATH = -Wl,-rpath, + +# -Bsymbolic-functions (ld) support +QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions +QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, + +# Generic options for all BlackBerry/QNX qcc mkspecs +QMAKE_CFLAGS_THREAD = -D_REENTRANT +QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_COMPILER_DEFINES += __QNXNTO__ + +QMAKE_LIBS = -lm +QMAKE_LIBS_NETWORK = -lsocket + +# OpenGL libraries have a dependency on libEGL +QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -lEGL +QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL + +# When using this mkspec to build Qt apps (ie - not Qt itself) we want to build +# against the NDK's target directory which is referenced by the QNX_TARGET environment +# variable, and which is guaranteed by the NDK to be set. +QNX_DIR = $$(QNX_TARGET) + +isEmpty(QNX_DIR) { + error(QNX_TARGET environment variable not set) +} + +QMAKE_INCDIR = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freetype2 +QMAKE_LIBDIR = $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUDIR}/usr/lib +QMAKE_LFLAGS = -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/lib -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/usr/lib + +QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] +QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] +QMAKE_MOC = $$[QT_INSTALL_BINS]/moc +QMAKE_UIC = $$[QT_INSTALL_BINS]/uic +QMAKE_RCC = $$[QT_INSTALL_BINS]/rcc + +QMAKE_CXX = $$QMAKE_CC -lang-c++ + +QMAKE_LINK_C = $$QMAKE_CC +QMAKE_LINK_C_SHLIB = $$QMAKE_CC + +QMAKE_LINK = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX + +QMAKE_TAR = tar -cf +QMAKE_GZIP = gzip -9f + +QMAKE_COPY = cp -f +QMAKE_COPY_FILE = $(COPY) +QMAKE_COPY_DIR = $(COPY) -r +QMAKE_MOVE = mv -f +QMAKE_DEL_FILE = rm -f +QMAKE_DEL_DIR = rmdir +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p +QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf new file mode 100644 index 0000000..da006f5 --- /dev/null +++ b/mkspecs/common/qcc-base.conf @@ -0,0 +1,36 @@ +# +# This file is used as a basis for the following compilers: +# +# - The QNX qcc compiler +# +# The only difference between this and gcc-base.conf is that -pipe is removed +# as it's on by default in qcc (and has an analogous -nopipe option) +# + +QMAKE_CFLAGS += +QMAKE_CFLAGS_DEPS += -M +QMAKE_CFLAGS_WARN_ON += -Wall -W +QMAKE_CFLAGS_WARN_OFF += -w +QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_DEBUG += -g +QMAKE_CFLAGS_SHLIB += -fPIC +QMAKE_CFLAGS_STATIC_LIB += -fPIC +QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses +QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden + +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS +QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON +QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF +QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG +QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB +QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB +QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden + +QMAKE_LFLAGS += +QMAKE_LFLAGS_DEBUG += +QMAKE_LFLAGS_APP += +QMAKE_LFLAGS_RELEASE += + diff --git a/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf new file mode 100644 index 0000000..f2407a6 --- /dev/null +++ b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf @@ -0,0 +1,25 @@ +# +# qmake configuration for blackberry-qcc +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release link_prl qnx +QT += core gui + +include(../../common/g++-unix.conf) +include(../../common/unix.conf) + +QMAKE_CC = qcc -Vgcc_ntoarmv7le +QNX_CPUDIR = armle-v7 + +include(../../common/qcc-base-qnx.conf) + +QMAKE_AR = ntoarmv7-ar cqs +QMAKE_OBJCOPY = ntoarmv7-objcopy +QMAKE_RANLIB = ntoarmv7-ranlib + +QMAKE_STRIP = ntoarmv7-strip + +load(qt_config) diff --git a/mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h b/mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h new file mode 100644 index 0000000..3a91ba8 --- /dev/null +++ b/mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion Limited. +** 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$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + +#define __STDC_CONSTANT_MACROS + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +// QNX doesn't have the System V header. This is not a standard +// POSIX header, it's only documented in the Single UNIX Specification. +// The preferred POSIX compliant way to share memory is to use the functions +// in that comply with the POSIX Real Time Interface (1003.1b). +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +// for htonl +#include + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#define QT_NO_READDIR64 +#include "../../common/posix/qplatformdefs.h" + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +// QNX6 doesn't have getpagesize() +inline int getpagesize() +{ + return ::sysconf(_SC_PAGESIZE); +} + +#include + +#define QT_QWS_TEMP_DIR QString::fromLatin1(qgetenv("TMP")) + +#endif // QPLATFORMDEFS_H diff --git a/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf new file mode 100644 index 0000000..93f1df2 --- /dev/null +++ b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf @@ -0,0 +1,25 @@ +# +# qmake configuration for blackberry-qcc +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release link_prl +QT += core gui + +include(../../common/g++-unix.conf) +include(../../common/unix.conf) + +QMAKE_CC = qcc -Vgcc_ntox86 +QNX_CPUDIR = x86 + +include(../../common/qcc-base-qnx.conf) + +QMAKE_AR = ntox86-ar cqs +QMAKE_OBJCOPY = ntox86-objcopy +QMAKE_RANLIB = ntox86-ranlib + +QMAKE_STRIP = ntox86-strip + +load(qt_config) diff --git a/mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h b/mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h new file mode 100644 index 0000000..3a91ba8 --- /dev/null +++ b/mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion Limited. +** 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$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + +#define __STDC_CONSTANT_MACROS + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +// QNX doesn't have the System V header. This is not a standard +// POSIX header, it's only documented in the Single UNIX Specification. +// The preferred POSIX compliant way to share memory is to use the functions +// in that comply with the POSIX Real Time Interface (1003.1b). +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +// for htonl +#include + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#define QT_NO_READDIR64 +#include "../../common/posix/qplatformdefs.h" + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +// QNX6 doesn't have getpagesize() +inline int getpagesize() +{ + return ::sysconf(_SC_PAGESIZE); +} + +#include + +#define QT_QWS_TEMP_DIR QString::fromLatin1(qgetenv("TMP")) + +#endif // QPLATFORMDEFS_H -- cgit v0.12