diff --git a/NEWS.md b/NEWS.md index c825e9f16..ae7106872 100644 --- a/NEWS.md +++ b/NEWS.md @@ -86,6 +86,7 @@ * The bundled `fmt` library was updated to v8.0.0. * The `PCRE2` & `JPCRE2` libraries are not used anymore. The bundled version of `JPCRE2` was removed. +* The `gmp` library is now required. # Version 58.0.0 "Supper's Ready" 2021-06-13 diff --git a/Rakefile b/Rakefile index ea27aae50..bc18c7c4c 100644 --- a/Rakefile +++ b/Rakefile @@ -1066,6 +1066,7 @@ $common_libs = [ :fmt, :stdcppfs, :qt_non_gui, + :gmp, "-lstdc++", ] diff --git a/ac/boost.m4 b/ac/boost.m4 index bbb17f887..d31cab18f 100644 --- a/ac/boost.m4 +++ b/ac/boost.m4 @@ -1,9 +1,40 @@ # boost's headers must be present. AX_BOOST_BASE([1.66.0]) -AX_BOOST_CHECK_HEADERS([boost/multiprecision/cpp_int.hpp],,[ - AC_MSG_ERROR([Boost's multi-precision library is required but wasn't found]) -]) +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::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]) AX_BOOST_CHECK_HEADERS([boost/operators.hpp],,[ AC_MSG_ERROR([Boost's Operators library is required but wasn't found]) diff --git a/packaging/centos-fedora-opensuse/mkvtoolnix.spec b/packaging/centos-fedora-opensuse/mkvtoolnix.spec index e93a05202..d72eeee79 100644 --- a/packaging/centos-fedora-opensuse/mkvtoolnix.spec +++ b/packaging/centos-fedora-opensuse/mkvtoolnix.spec @@ -20,6 +20,7 @@ BuildRequires: flac-devel BuildRequires: fmt-devel BuildRequires: gettext-devel BuildRequires: glibc-devel +BuildRequires: gmp-devel BuildRequires: gtest-devel BuildRequires: libdvdread-devel BuildRequires: libogg-devel diff --git a/packaging/debian/control b/packaging/debian/control index 2e48e2150..f30af3d18 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.5 Build-Depends: debhelper (>= 9), rake (>= 10), - zlib1g-dev, libflac-dev, libogg-dev, libvorbis-dev, + zlib1g-dev, libflac-dev, libogg-dev, libvorbis-dev, libgmp-dev, libboost-dev (>= 1.66), qtbase5-dev, qtbase5-dev-tools, qtmultimedia5-dev, qt5-default | base-files (>= 11ubuntu18), libcmark-dev, libgtest-dev, libfmt-dev (>= 4), libdvdread-dev, diff --git a/src/input/r_qtmp4.cpp b/src/input/r_qtmp4.cpp index f01a0dd30..4ea045939 100644 --- a/src/input/r_qtmp4.cpp +++ b/src/input/r_qtmp4.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -2199,7 +2199,7 @@ qtmp4_demuxer_c::to_nsecs(int64_t value, if (!actual_time_scale) return 0; - auto value128 = static_cast(value); + auto value128 = static_cast(value); value128 *= 1'000'000'000ll; value128 /= actual_time_scale;