mkvtoolnix/ac/boost.m4
Moritz Bunkus 8a2da1a252
all: switch back to requiring & using Boost's file system library
gcc's implementation of the C++17 file system library doesn't support
UNC paths of style `\\?\…` on Windows. There doesn't seem to be any
progress towards implementing support for it.

Fixes #3058. See also #2916.
2023-01-14 17:49:45 +01:00

56 lines
1.3 KiB
Plaintext

# boost's headers must be present.
AX_BOOST_BASE([1.66.0])
AC_MSG_CHECKING([for Boost's multi-precision library with GMP backend])
saved_CPPFLAGS="$CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
LIBS="$LIBS -lgmp"
export LIBS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <boost/multiprecision/gmp.hpp>
]],
[[
boost::multiprecision::mpz_int i{42};
boost::multiprecision::mpq_rational r{42, 54};
]])
],[am_cv_bmp_gmp=yes],[am_cv_bmp_gmp=no])
CPPFLAGS="$saved_CPPFLAGS"
LDFLAGS="$saved_LDFLAGS"
LIBS="$saved_LIBS"
if test "x$am_cv_bmp_gmp" != xyes; then
AC_MSG_RESULT([no: a test program for Boost's multi-precision library with GMP backend could not be linked, probably because the gmp library wasn't found])
exit 1
fi
AC_MSG_RESULT([yes])
# boost::system must be present.
AX_BOOST_SYSTEM()
# boost::filesystem must be present.
AX_BOOST_FILESYSTEM()
if test x"$ax_cv_boost_filesystem" != "xyes"; then
AC_MSG_ERROR(The Boost Filesystem Library was not found.)
fi
if test x"$ax_cv_boost_system" != "xyes"; then
AC_MSG_ERROR(The Boost System Library was not found.)
fi
AX_BOOST_CHECK_HEADERS([boost/operators.hpp],,[
AC_MSG_ERROR([Boost's Operators library is required but wasn't found])
])