mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
configure: add test for C++14 feature "user-defined literals for std::string"
This commit is contained in:
parent
589365a63b
commit
c9e931d69e
10
README.md
10
README.md
@ -72,11 +72,11 @@ programs and libraries you absolutely need are:
|
|||||||
|
|
||||||
- A C++ compiler that supports several features of the C++11 and C++14
|
- A C++ compiler that supports several features of the C++11 and C++14
|
||||||
standards: initializer lists, range-based `for` loops, right angle
|
standards: initializer lists, range-based `for` loops, right angle
|
||||||
brackets, the `auto` keyword, lambda functions, the `nullptr` keyword,
|
brackets, the `auto` keyword, lambda functions, the `nullptr`
|
||||||
tuples, alias declarations, `std::make_unique()`, digit
|
keyword, tuples, alias declarations, `std::make_unique()`, digit
|
||||||
separators, binary literals and generic lambdas. Others may be
|
separators, binary literals, generic lambdas, user-defined literals
|
||||||
needed, too. For GCC this means at least v4.9.x; for clang v3.4 or
|
for `std::string`. Others may be needed, too. For GCC this means at
|
||||||
later.
|
least v5.x; for clang v3.4 or later.
|
||||||
|
|
||||||
- [libEBML v1.3.5](http://dl.matroska.org/downloads/libebml/) or later
|
- [libEBML v1.3.5](http://dl.matroska.org/downloads/libebml/) or later
|
||||||
and [libMatroska v1.4.8](http://dl.matroska.org/downloads/libmatroska/)
|
and [libMatroska v1.4.8](http://dl.matroska.org/downloads/libmatroska/)
|
||||||
|
@ -349,6 +349,32 @@ AC_DEFUN([AX_CXX14_GENERIC_LAMBDAS],[
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AX_CXX14_USER_DEFINED_LITERALS_FOR_STD_STRING],[
|
||||||
|
AC_CACHE_CHECK([for support for C++14 feature "User-defined literals for std::string"], [ax_cv_cxx14_user_defined_literals_for_std_string],[
|
||||||
|
|
||||||
|
CXXFLAGS_SAVED=$CXXFLAGS
|
||||||
|
CXXFLAGS="$CXXFLAGS $STD_CXX"
|
||||||
|
export CXXFLAGS
|
||||||
|
|
||||||
|
AC_LANG_PUSH(C++)
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[
|
||||||
|
#include <string>
|
||||||
|
using namespace std::string_literals;
|
||||||
|
],
|
||||||
|
[return "hello"s.length();],
|
||||||
|
[ax_cv_cxx14_user_defined_literals_for_std_string="yes"],
|
||||||
|
[ax_cv_cxx14_user_defined_literals_for_std_string="no"])
|
||||||
|
AC_LANG_POP
|
||||||
|
|
||||||
|
CXXFLAGS="$CXXFLAGS_SAVED"
|
||||||
|
])
|
||||||
|
|
||||||
|
if ! test x"$ax_cv_cxx14_user_defined_literals_for_std_string" = xyes ; then
|
||||||
|
missing_cxx_features="$missing_cxx_features\n * User-defined literals for std::string (C++14)"
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
dnl AC_DEFUN([AX_CXX14_DEF_NAME],[
|
dnl AC_DEFUN([AX_CXX14_DEF_NAME],[
|
||||||
dnl AC_CACHE_CHECK([for support for C++14 feature "human"], [ax_cv_cxx14_def_name],[
|
dnl AC_CACHE_CHECK([for support for C++14 feature "human"], [ax_cv_cxx14_def_name],[
|
||||||
dnl
|
dnl
|
||||||
@ -385,10 +411,11 @@ AX_CXX14_MAKE_UNIQUE
|
|||||||
AX_CXX14_DIGIT_SEPARATORS
|
AX_CXX14_DIGIT_SEPARATORS
|
||||||
AX_CXX14_BINARY_LITERALS
|
AX_CXX14_BINARY_LITERALS
|
||||||
AX_CXX14_GENERIC_LAMBDAS
|
AX_CXX14_GENERIC_LAMBDAS
|
||||||
|
AX_CXX14_USER_DEFINED_LITERALS_FOR_STD_STRING
|
||||||
|
|
||||||
if test x"$missing_cxx_features" != x ; then
|
if test x"$missing_cxx_features" != x ; then
|
||||||
printf "The following features of the C++11/C++14 standards are not supported by $CXX:$missing_cxx_features\n"
|
printf "The following features of the C++11/C++14 standards are not supported by $CXX:$missing_cxx_features\n"
|
||||||
printf "If you are using the GNU C compiler collection (gcc) then you need\n"
|
printf "If you are using the GNU C compiler collection (gcc), you need\n"
|
||||||
printf "at least v4.9.x.\n"
|
printf "at least v5.x; for clang the 3.4 and newer should work.\n"
|
||||||
AC_MSG_ERROR([support for required C++11/C++14 features incomplete])
|
AC_MSG_ERROR([support for required C++11/C++14 features incomplete])
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user