diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-05 19:23:14 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-06 10:38:19 +0200 |
commit | 05094b91a070c0a498870a473b37732929289ca1 (patch) | |
tree | 393f73dfb04252bca4b51499f6dbce4e41f61a6d | |
parent | 08371f8d8532fd82cb59d9eae85cb2e5a835376f (diff) |
Test the C++ compiler works
Stops the configure process if the C++ compiler doesn't work, otherwise
it will fail at build time.
Fixes: https://github.com/dillo-browser/dillo/issues/187
-rw-r--r-- | configure.ac | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5c308cb7..7d156b81 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,19 @@ AC_PROG_CXX AC_PROG_RANLIB AC_PROG_CPP +AC_MSG_CHECKING(if C++ compiler '$CXX' works) +AC_LANG_PUSH([C++]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifndef __cplusplus + #error "No C++ support, AC_PROG_CXX failed" + #endif + ]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT(no) + AC_MSG_FAILURE([C++ compiler doesn't work])] +) +AC_LANG_POP([C++]) + dnl ---------------------------- dnl Check our char and int types dnl ---------------------------- |