Module: check_mk
Branch: master
Commit: f473f681fe47c774fe9972d143ff76fcc0b91e29
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f473f681fe47c7…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Aug 2 11:01:48 2018 +0200
Handle dual C++ ABI, unbreaks older distros.
Change-Id: Icff3f0e69c510adc311d4c41f67a1643fb60635d
---
omd/packages/googletest/Makefile | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/omd/packages/googletest/Makefile b/omd/packages/googletest/Makefile
index 6d8f34e..e6712cd 100644
--- a/omd/packages/googletest/Makefile
+++ b/omd/packages/googletest/Makefile
@@ -28,7 +28,27 @@ $(DIR)/Makefile.in: $(DIR).tar.gz
cd $(DIR) && autoreconf -i
$(DIR)/Makefile: $(DIR)/Makefile.in
- cd $(DIR) && ./configure --disable-shared
+# NOTE: We have to use a recent C++ compiler, otherwise we will get linker
+# errors later when we use the libraries we compile here. For some (sad)
+# background, see e.g.:
+#
+#
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
+#
https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c11-abi/
+#
+#basically what part of AC_PROC_CXX does
+ @CXX="" ; \
+ for PROG in g++-8 g++-7 clang++-6.0 clang++-5.0 g++-6 clang++-4.0 g++-5 clang++-3.9
clang++-3.8 clang++-3.7 clang++-3.6 clang++-3.5 g++-4.9 g++ clang++; do \
+ echo -n "checking for $$PROG... "; SAVED_IFS=$$IFS; IFS=: ; \
+ for DIR in $$PATH; do \
+ IFS=$$SAVED_IFS ; \
+ test -z "$$DIR" && DIR=. ; \
+ ABS_PROG="$$DIR/$$PROG" ; \
+ test -x "$$ABS_PROG" && { CXX="$$ABS_PROG"; echo
"$$CXX"; break 2; } ; \
+ done ; \
+ echo "no"; IFS=$$SAVED_IFS ; \
+ done ; \
+ test -z "$$CXX" && { echo "error: no C++ compiler found"
>&2 ; exit 1; } ; \
+ cd $(DIR) && ./configure --disable-shared CXX="$$CXX"
install: