void-packages/srcpkgs/kea/patches/cross-cxx-regex.patch
Đoàn Trần Công Danh 986eb7c781 kea: cross compile
Closes: #20785 [via git-merge-pr]
2020-04-09 19:50:21 +02:00

34 lines
946 B
Diff

diff --git configure.ac configure.ac
index 02fcd8b..20a7cc6 100755
--- configure.ac
+++ configure.ac
@@ -540,6 +540,21 @@ AC_TRY_COMPILE([
AC_MSG_RESULT(no))
AC_MSG_CHECKING(for usuable C++11 regex)
+AC_TRY_COMPILE([
+#ifdef __clang__
+ /* suppose all clang are usable */
+#elif defined(__GNUC__)
+ #if (__GNUC__ * 100 + __GNUC_MINOR__) < 409
+ #error regex was implemented in gcc 4.9
+ #endif
+#else
+ #error unknown compiler
+#endif
+],[ ],
+[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_REGEX, 1, [Define to 1 if C++11 regex is usable])
+],
AC_TRY_RUN([
#include <regex>
#include <iostream>
@@ -552,6 +567,7 @@ int main() {
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_REGEX, 1, [Define to 1 if C++11 regex is usable])],
AC_MSG_RESULT(no))
+)
# Run the gtest detection routines. This supports --with-gtest and --with-gtest-source
# parameters. If specified, those will set the HAVE_GTEST, HAVE_GTEST_SOURCE,