Skip to content

Commit 45a2b05

Browse files
givaro: fix cross build
1 parent 4534205 commit 45a2b05

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

pkgs/development/libraries/givaro/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ stdenv.mkDerivation rec {
4444
url = "https://github.com/linbox-team/givaro/commit/a18baf5227d4f3e81a50850fe98e0d954eaa3ddb.patch";
4545
hash = "sha256-IR0IHhCqbxgtsST30vxM9ak1nGtt0apxcLUQ1kS1DHw=";
4646
})
47+
# skip gmp version check for cross-compiling, our version is new enough
48+
./skip-gmp-check.patch
4749
];
4850

4951
enableParallelBuilding = true;
@@ -59,6 +61,7 @@ stdenv.mkDerivation rec {
5961
configureFlags =
6062
[
6163
"--without-archnative"
64+
"CCNAM=${stdenv.cc.cc.pname}"
6265
]
6366
++ lib.optionals stdenv.hostPlatform.isx86_64 [
6467
# disable SIMD instructions (which are enabled *when available* by default)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/macros/gmp-check.m4 b/macros/gmp-check.m4
2+
index 72eba8c..25af64e 100644
3+
--- a/macros/gmp-check.m4
4+
+++ b/macros/gmp-check.m4
5+
@@ -105,21 +105,6 @@ AC_DEFUN([GIV_CHECK_GMP], [
6+
exit 1
7+
])
8+
9+
- AC_MSG_CHECKING([whether gmp version is at least $min_gmp_release])
10+
- AC_TRY_RUN(
11+
- [
12+
- #include <cstddef>
13+
- #include <gmp.h>
14+
- int main () {
15+
- return (__GNU_MP_RELEASE < $min_gmp_release);
16+
- }
17+
- ],
18+
- [ AC_MSG_RESULT(yes)
19+
- ],
20+
- [ AC_MSG_RESULT(no)
21+
- AC_MSG_ERROR(your GMP is too old. GMP release >= $min_gmp_release needed)
22+
- exit 1]
23+
- )
24+
AC_LANG_POP([C++])
25+
26+
AC_SUBST(GMP_CFLAGS)

0 commit comments

Comments
 (0)