1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-19 08:13:21 +00:00

Qt5: Add a patch to allow using clang, -std=c++11 and base libstdc++.

This is similar to what we did for Qt4 in r362770. Some C++11 features actually
depend on the C++ standard library, such as <initializer_list> or std::move().

So far, ports with USES=compiler:c++0x and similar failed to build with Qt5 on
FreeBSD 9.x, as base libstdc++ is very old and does not support those C++11
features.

Piggyback on a check that is already present upstream for OS X, which has the
same ancient libstdc++ version. Apple's version has a custom patch with version
macros that we can't use, so we make a broader check and disable the features
that depend on a modern standard library if libc++ is not used.
This commit is contained in:
Raphael Kubo da Costa 2016-01-03 21:25:23 +00:00
parent 73100c6703
commit 1fc9a94f24
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=405187
3 changed files with 19 additions and 2 deletions

View File

@ -173,11 +173,13 @@ CONFIGURE_ARGS+=-verbose
. if ${QT_DIST} == "base" || ${_QT_VERSION:M4*}
. if ${_QT_VERSION:M4*}
_EXTRA_PATCHES_QT4= ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-src-corelib-global-qglobal.h
. else
_EXTRA_PATCHES_QT5= ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-src_corelib_global_qcompilerdetection.h
. endif
EXTRA_PATCHES?= ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-configure \
${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-config.tests-unix-compile.test \
${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-libtool \
${_EXTRA_PATCHES_QT4}
${_EXTRA_PATCHES_QT4} ${_EXTRA_PATCHES_QT5}
. endif
# Override settings installed in qconfig.h and *.pri files. The flags will be

View File

@ -2,7 +2,7 @@
PORTNAME= core
DISTVERSION= ${QT5_VERSION}
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= devel
PKGNAMEPREFIX= qt5-

View File

@ -0,0 +1,15 @@
--- src/corelib/global/qcompilerdetection.h.orig 2016-01-03 18:13:55 UTC
+++ src/corelib/global/qcompilerdetection.h
@@ -900,10 +900,10 @@
# undef Q_COMPILER_REF_QUALIFIERS
# endif
# endif // Q_OS_QNX
-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
+# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && !defined(_LIBCPP_VERSION)
// Mac OS X: Apple has not updated libstdc++ since 2007, which means it does not have
// <initializer_list> or std::move. Let's disable these features
+// The same applies to FreeBSD's base libstdc++ version used in FreeBSD 9.x.
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS