From cac5d3744c5fc115844a40c59fa26cc84a36300e Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Tue, 16 Dec 2014 08:15:26 +0000 Subject: [PATCH] Haiku: Add support for Haiku to build system Change-Id: I12afaeb53a7f35c3f02776d28dad96107f3c5819 Reviewed-by: Oswald Buddenhagen Reviewed-by: Augustin Cavalier Reviewed-by: Thiago Macieira Reviewed-by: Sean Harmer --- configure | 6 ++- mkspecs/features/qt_functions.prf | 2 + mkspecs/haiku-g++/qmake.conf | 27 +++++++++++ mkspecs/haiku-g++/qplatformdefs.h | 77 +++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 mkspecs/haiku-g++/qmake.conf create mode 100644 mkspecs/haiku-g++/qplatformdefs.h diff --git a/configure b/configure index d39478c3f5..9541ee3495 100755 --- a/configure +++ b/configure @@ -707,6 +707,7 @@ XPLATFORM_IOS=no # Whether target platform is iOS XPLATFORM_ANDROID=no XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*) XPLATFORM_QNX=no +XPLATFORM_HAIKU=no PLATFORM=$QMAKESPEC QT_CROSS_COMPILE=no OPT_CONFIRM_LICENSE=no @@ -2824,6 +2825,9 @@ case "$XPLATFORM" in *qnx-*|*blackberry-*) XPLATFORM_QNX=yes ;; + *haiku-*) + XPLATFORM_HAIKU=yes + ;; *ios*) XPLATFORM_MAC=yes XPLATFORM_IOS=yes @@ -5473,7 +5477,7 @@ if [ "$CFG_KMS" = "yes" ]; then QT_CONFIG="$QT_CONFIG kms" fi -if [ "$XPLATFORM_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ] && [ "$XPLATFORM_ANDROID" = "no" ]; then +if [ "$XPLATFORM_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ] && [ "$XPLATFORM_ANDROID" = "no" ] && [ "$XPLATFORM_HAIKU" = "no" ]; then if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_KMS" = "no" ]; then if [ "$QPA_PLATFORM_GUARD" = "yes" ] && ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_KMS" = "auto" ] ); then diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 7961f6512a..4dfffc4c2f 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -266,6 +266,8 @@ defineTest(qtAddTargetEnv) { deppath.name = PATH } else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) { deppath.name = LD_LIBRARY_PATH + } else:contains(QMAKE_HOST.os, Haiku) { + deppath.name = LIBRARY_PATH } else:equals(QMAKE_HOST.os, Darwin) { contains(QT_CONFIG, qt_framework): \ deppath.name = DYLD_FRAMEWORK_PATH diff --git a/mkspecs/haiku-g++/qmake.conf b/mkspecs/haiku-g++/qmake.conf new file mode 100644 index 0000000000..6144392385 --- /dev/null +++ b/mkspecs/haiku-g++/qmake.conf @@ -0,0 +1,27 @@ +# +# qmake configuration for haiku-g++ +# + +MAKEFILE_GENERATOR = UNIX +QMAKE_PLATFORM = haiku + +# Choose haiku QPA Plugin as default +QT_QPA_DEFAULT_PLATFORM = haiku + +QMAKE_LIBS = +QMAKE_INCDIR = +QMAKE_LIBDIR = + +QMAKE_LIBS_NETWORK = -lnetwork +QMAKE_LIBS_OPENGL = -lGL +QMAKE_LIBS_OPENGL_QT = -lGL + +QMAKE_AR = ar cqs +QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P +QMAKE_RANLIB = + +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) +include(../common/unix.conf) +load(qt_config) diff --git a/mkspecs/haiku-g++/qplatformdefs.h b/mkspecs/haiku-g++/qplatformdefs.h new file mode 100644 index 0000000000..ed1abc95c7 --- /dev/null +++ b/mkspecs/haiku-g++/qplatformdefs.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt-project.org/legal +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $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 + + +// We are hot - unistd.h should have turned on the specific APIs we requested + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +#include "../common/posix/qplatformdefs.h" + +#define QT_SOCKLEN_T socklen_t + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 + +#endif // QPLATFORMDEFS_H