Commit 63256f09 by Maarten L. Hekkelman

better test of compiler capabilities

parent be54866c
#include <boost/regex.hpp>
int main()
{
boost::regex rx("a*b");
if (boost::regex_match("aab", rx))
;
return 0;
}
#include <clipper/core/atomsf.h>
int main()
{
auto sf = clipper::ScatteringFactors::instance()["C"];
return 0;
}
#include <algorithm>
template<typename COMP>
class foo
{
public:
foo(int a, COMP&& b)
: m_a(a), m_b(std::move(b)) {}
int m_a;
COMP m_b;
};
void bar(const int& b)
{
int c = 1;
auto f = new foo(c, [tag = c, b](const int& x)
{ x < b; });
}
...@@ -3920,6 +3920,59 @@ ac_config_headers="$ac_config_headers include/cif++/Config.hpp" ...@@ -3920,6 +3920,59 @@ ac_config_headers="$ac_config_headers include/cif++/Config.hpp"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler standards compliance" >&5
$as_echo_n "checking compiler standards compliance... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <algorithm>
template<typename COMP>
class foo
{
public:
foo(int a, COMP&& b)
: m_a(a), m_b(std::move(b)) {}
int m_a;
COMP m_b;
};
void bar(const int& b)
{
int c = 1;
auto f = new foo(c, [tag = c, b](const int& x)
{ x < b; });
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
as_fn_error $? "Your c++ compiler is not capable of compiling libcifpp, please upgrade" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"ok\"" >&5
$as_echo "\"ok\"" >&6; }
# Find a good install program. We prefer a C program (faster), # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or # so one script is as good as another. But avoid the broken or
# incompatible versions: # incompatible versions:
......
...@@ -18,6 +18,12 @@ AC_PREFIX_DEFAULT(/usr/local) ...@@ -18,6 +18,12 @@ AC_PREFIX_DEFAULT(/usr/local)
AC_DEFUN([read_test], [AC_LANG_SOURCE( AC_DEFUN([read_test], [AC_LANG_SOURCE(
esyscmd(tools/m4esc.sh config-tests/$1))]) esyscmd(tools/m4esc.sh config-tests/$1))])
AC_MSG_CHECKING([compiler standards compliance])
AC_COMPILE_IFELSE(
[read_test(cpp-17-test.cpp)], [],
[AC_MSG_ERROR([Your c++ compiler is not capable of compiling libcifpp, please upgrade])])
AC_MSG_RESULT(ok)
AC_PROG_INSTALL AC_PROG_INSTALL
AC_ENABLE_STATIC AC_ENABLE_STATIC
AC_DISABLE_SHARED AC_DISABLE_SHARED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment