2018-11-19 22:40:53 +00:00
|
|
|
dnl
|
2020-09-30 15:19:32 +00:00
|
|
|
dnl Check for the fmt library
|
2018-11-19 22:40:53 +00:00
|
|
|
dnl
|
|
|
|
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([fmt],[ac_cv_fmt],[
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
|
|
|
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
CXXFLAGS="$STD_CXX $CXXFLAGS"
|
|
|
|
LIBS="$LIBS -lfmt"
|
|
|
|
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <fmt/format.h>
|
|
|
|
#include <fmt/ostream.h>
|
2020-05-15 08:33:12 +00:00
|
|
|
|
|
|
|
#if !defined(FMT_VERSION) || (FMT_VERSION < 60100)
|
|
|
|
#error fmtlib is too old, need 6.1.0 or later
|
|
|
|
#endif
|
2018-11-19 22:40:53 +00:00
|
|
|
],[
|
2020-05-15 06:36:48 +00:00
|
|
|
fmt::format("{0:02}", fmt::to_string(4254));
|
2018-11-19 22:40:53 +00:00
|
|
|
],[ac_cv_fmt=yes],[ac_cv_fmt=no])
|
|
|
|
|
|
|
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
|
|
|
LIBS="$ac_save_LIBS"
|
|
|
|
|
|
|
|
AC_LANG_POP
|
|
|
|
])
|
|
|
|
|
|
|
|
if test x"$ac_cv_fmt" = xyes; then
|
|
|
|
FMT_INTERNAL=no
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE([Using the internal version of fmt])
|
|
|
|
FMT_INTERNAL=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(FMT_INTERNAL)
|