aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity/mosh/mosh/0001-configure.ac-add-support-of-protobuf-4.22.x.patch
blob: 088124391c5f883c6a2139c07578a1725254e2de (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From d9a1a6aac5a3b270449d09ec0d2a556807ab9287 Mon Sep 17 00:00:00 2001
From: Xiangyu Chen <xiangyu.chen@windriver.com>
Date: Wed, 29 Mar 2023 13:53:44 +0800
Subject: [PATCH] configure.ac: add support of protobuf 4.22.x

the protobuf 4.22x is using c++14 as default, this caused the mosh cannot compile anymore and report following error:

....
/usr/include/google/protobuf/port_def.inc:200:15: error: static assertion failed: Protobuf only supports C++14 and newer.
| 200 | static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
| | ^~~~~~~~~~~~~~~~~~~~~~
....

Upstream-Status: Pending [https://github.com/mobile-shell/mosh/pull/1266]

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
 configure.ac             | 8 ++++++++
 src/frontend/Makefile.am | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ee70c7b..5457009 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,10 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AS_IF([pkg-config --atleast-version 3.6.0 protobuf],
   [AX_CXX_COMPILE_STDCXX([11])])
 
+# If current protobuf 4.22+ update the requires to C++14.
+AS_IF([pkg-config --atleast-version 4.22.0 protobuf],
+  [AX_CXX_COMPILE_STDCXX([14])])
+
 WARNING_CXXFLAGS=""
 PICKY_CXXFLAGS=""
 DISTCHECK_CXXFLAGS=""
@@ -311,6 +315,10 @@ AC_CHECK_FUNCS(m4_normalize([
   pledge
   ]))
 
+AS_IF([pkg-config --atleast-version 4.22.0 protobuf],
+  [PKG_CHECK_MODULES([ABSL_LOG_INTERNAL_CHECK_OP], [absl_log_internal_check_op],[],
+     [AC_MSG_ERROR([Missing abseil-cpp library.])])])
+
 # Start by trying to find the needed tinfo parts by pkg-config
 PKG_CHECK_MODULES([TINFO], [tinfo],
   [AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])],
diff --git a/src/frontend/Makefile.am b/src/frontend/Makefile.am
index 1aa83fd..399ecd6 100644
--- a/src/frontend/Makefile.am
+++ b/src/frontend/Makefile.am
@@ -1,7 +1,7 @@
 AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs -I$(srcdir)/../util $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS)
 AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)
 AM_LDFLAGS  = $(HARDEN_LDFLAGS) $(CODE_COVERAGE_LIBS)
-LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lm $(TINFO_LIBS) $(protobuf_LIBS) $(CRYPTO_LIBS)
+LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lm $(TINFO_LIBS) $(protobuf_LIBS) $(CRYPTO_LIBS) $(ABSL_LOG_INTERNAL_CHECK_OP_LIBS)
 
 mosh_server_LDADD = $(LDADD)
 
-- 
2.34.1