]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/ppl/patches/ppl-0.10.2-gmp-build-fix.patch
Move packages to pkgs subdirectory.
[people/ms/ipfire-3.x.git] / pkgs / ppl / patches / ppl-0.10.2-gmp-build-fix.patch
1 X-Git-Url: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl%2Fppl.git;a=blobdiff_plain;f=m4%2Fac_check_gmp.m4;h=15acb182ed2d386e899fcdf6eeb9ea5b8fb3b90c;hp=4dc3bc84e978da109e08c4d64d6551535f2eef4b;hb=refs%2Fheads%2Fpip;hpb=5596eca02f2dea09e57ea22a240c2f3eab8be9e5
2
3 diff --git a/m4/ac_check_gmp.m4 b/m4/ac_check_gmp.m4
4 index 4dc3bc8..15acb18 100644
5 --- a/m4/ac_check_gmp.m4
6 +++ b/m4/ac_check_gmp.m4
7 @@ -1,5 +1,5 @@
8 dnl A function to check for the existence and usability of GMP.
9 -dnl Copyright (C) 2001-2009 Roberto Bagnara <bagnara@cs.unipr.it>
10 +dnl Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
11 dnl
12 dnl This file is part of the Parma Polyhedra Library (PPL).
13 dnl
14 @@ -32,6 +32,23 @@ else
15 fi
16 fi
17
18 +AC_ARG_WITH(gmp-build,
19 + AS_HELP_STRING([--with-gmp-build=DIR],
20 + [use a non-installed build of GMP in DIR]),
21 + gmp_build_dir=$with_gmp_build
22 + if test -z "$with_libgmp_prefix"
23 + then
24 + CPPFLAGS="$CPPFLAGS -I$gmp_build_dir -I$gmp_build_dir/tune"
25 + LDFLAGS="$LDFLAGS -L$gmp_build_dir -L$gmp_build_dir/.libs"
26 + LDFLAGS="$LDFLAGS -L$gmp_build_dir/tune"
27 + else
28 + AC_MSG_ERROR([cannot use --with-gmp-build and --with-gmp-prefix together])
29 + fi)
30 +
31 +dnl Both libgmp and libbmpxx come from the gmp package.
32 +AC_LIB_FROMPACKAGE([gmp], [gmp])
33 +AC_LIB_FROMPACKAGE([gmpxx], [gmp])
34 +
35 dnl Check how to link with libgmp.
36 AC_LIB_LINKFLAGS([gmp])
37
38 @@ -54,6 +71,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
39 #GMP version 4.1.3 or higher is required
40 #endif
41
42 +#ifndef BITS_PER_MP_LIMB
43 +#define BITS_PER_MP_LIMB GMP_LIMB_BITS
44 +#endif
45 +
46 int
47 main() {
48 std::string header_version;
49 @@ -80,11 +101,11 @@ main() {
50 return 1;
51 }
52
53 - if (sizeof(mp_limb_t)*CHAR_BIT != GMP_LIMB_BITS
54 - || GMP_LIMB_BITS != mp_bits_per_limb) {
55 + if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB
56 + || BITS_PER_MP_LIMB != mp_bits_per_limb) {
57 std::cerr
58 << "GMP header (gmp.h) and library (ligmp.*) bits-per-limb mismatch:\n"
59 - << "header gives " << __GMP_BITS_PER_MP_LIMB << ";\n"
60 + << "header gives " << BITS_PER_MP_LIMB << ";\n"
61 << "library gives " << mp_bits_per_limb << ".\n"
62 << "This probably means you are on a bi-arch system and\n"
63 << "you are compiling with the wrong header or linking with\n"