summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2023-03-23 14:29:51 +0100
committerMartin Michlmayr <tbm@cyrius.com>2023-03-24 14:29:57 +0800
commited385a0f4917e9013065bd7e0a08de7cb8f805f3 (patch)
tree43643c43695f24fb9d286aa9a30bf294c644f0d8
parent70240b4cdb8b8261879bfd70e60c7b64f1124004 (diff)
downloadfork-ledger-ed385a0f4917e9013065bd7e0a08de7cb8f805f3.tar.gz
fork-ledger-ed385a0f4917e9013065bd7e0a08de7cb8f805f3.tar.bz2
fork-ledger-ed385a0f4917e9013065bd7e0a08de7cb8f805f3.zip
Bump required Mpfr version to 4.0.2
-rw-r--r--CMakeLists.txt13
-rw-r--r--README.md2
2 files changed, 14 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2592259e..ab654706 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
set(Required_CMake_Version 3.16.2)
set(Required_Boost_Version 1.72)
set(Required_Gmp_Version 6.1.2)
+set(Required_Mpfr_Version 4.0.2)
set(Required_Python_Version 3.9)
set(Required_Gpgmepp_Version 1.13.1)
@@ -232,6 +233,18 @@ if (GMP_PATH AND EXISTS "${GMP_PATH}/gmp.h")
endif()
find_req_library_and_header(MPFR_PATH mpfr.h MPFR_LIB mpfr)
+if (MPFR_PATH AND EXISTS "${MPFR_PATH}/mpfr.h")
+ file(STRINGS "${MPFR_PATH}/mpfr.h" mpfr_header_str REGEX "^#define[\t ]+MPFR_VERSION_(MAJOR|MINOR|PATCHLEVEL)[\t ]+[0-9]+")
+ string(REGEX REPLACE ".*#define MPFR_VERSION_MAJOR[\t ]+([0-9]+).*" "\\1" MPFR_VERSION_MAJOR "${mpfr_header_str}")
+ string(REGEX REPLACE ".*#define MPFR_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" MPFR_VERSION_MINOR "${mpfr_header_str}")
+ string(REGEX REPLACE ".*#define MPFR_VERSION_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" MPFR_VERSION_PATCH "${mpfr_header_str}")
+ unset(mpfr_header_str)
+ set(MPFR_VERSION_STRING "${MPFR_VERSION_MAJOR}.${MPFR_VERSION_MINOR}.${MPFR_VERSION_PATCH}")
+ if ("${MPFR_VERSION_STRING}" VERSION_LESS ${Required_Mpfr_Version})
+ message(FATAL_ERROR "Ledger requires MPFR version ${Expected_Mpfr_Version} or greater, but only MPFR version ${MPFR_VERSION_STRING} was found")
+ endif()
+endif()
+
check_library_exists(edit readline "" HAVE_EDIT)
find_opt_library_and_header(EDIT_PATH histedit.h EDIT_LIB edit HAVE_EDIT)
diff --git a/README.md b/README.md
index c523d4de..c7a037e5 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,7 @@ Dependency | Version (or greater)
[CMake] | 3.16.2
[Boost] | 1.72
[Gmp] | 6.1.2
-[MPFR] | 2.4.0
+[Mpfr] | 4.0.2
[utfcpp] | 3.2.3
[gettext] | 0.17 _optional_
[libedit] | 20090111-3.0 _optional_