forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pinentry-0.9.7-require-CPP11-for-qt-5-7.patches
48 lines (41 loc) · 1.38 KB
/
pinentry-0.9.7-require-CPP11-for-qt-5-7.patches
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 7384e2a575dde2809784d9f182fd1d247064c8a2 Mon Sep 17 00:00:00 2001
From: Kristian Fiskerstrand <[email protected]>
Date: Thu, 11 Aug 2016 14:44:37 +0200
Subject: [PATCH] Qt: Append -std=c++11 if building against Qt 5.7
* m4/qt.m4: Append -std=c++11 to CFLAGS if building against Qt 5.7
--
Qt 5.7 enables C++11 for Qt modules, and any app relying on it require to be
compiled with at least this standard.
This patch adds detection for Qt 5.7 and make sure -std=c++11 is passed if
building against Qt 5.7 or higher.
---
m4/qt.m4 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/m4/qt.m4 b/m4/qt.m4
index 093f428..90c4a6e 100644
--- a/m4/qt.m4
+++ b/m4/qt.m4
@@ -35,6 +35,7 @@ AC_DEFUN([FIND_QT],
enable_pinentry_qt5="try")
have_qt5_libs="no";
+ require_qt_cpp11="no";
if test "$enable_pinentry_qt5" != "no"; then
PKG_CHECK_MODULES(PINENTRY_QT,
@@ -47,6 +48,15 @@ AC_DEFUN([FIND_QT],
fi
fi
if test "$have_qt5_libs" = "yes"; then
+ PKG_CHECK_MODULES(PINENTRY_QT_REQUIRE_CPP11,
+ Qt5Core >= 5.7.0,
+ [require_qt_cpp11="yes"],
+ [require_qt_cpp11="no"])
+
+ if test "${require_qt_cpp11}" = "yes"; then
+ PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -std=c++11"
+ fi
+
AC_CHECK_TOOL(MOC, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC -v 2>&1`
--
2.7.3