f7a392093f33c55ebab6587c139fc504849c4c17
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / classpath / 0001-fix-gmp-include.patch
1 The GMP include is hardcoded to /usr/include causing obvious problems.
2
3 From classpath CVS:
4 http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?root=classpath&r1=1.245&r2=1.246
5
6 [Gustavo: ditch -L or libtool complains loudly]
7
8 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
9
10 --- a/configure.ac      2010/01/30 01:33:50     1.245
11 +++ b/configure.ac      2010/05/04 12:29:23     1.246
12 @@ -752,10 +752,32 @@
13    dnl __gmpz_mul_si for earlier versions (>= 3.1).
14    dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
15    dnl change the name of the corresponding ac_ variable on lines 860...
16 +  AC_ARG_WITH(gmp, [  --with-gmp=PATH         specify prefix directory for the installed GMP package.
17 +                          Equivalent to --with-gmp-include=PATH/include
18 +                          plus --with-gmp-lib=PATH/lib])
19 +  AC_ARG_WITH(gmp_include, [  --with-gmp-include=PATH specify directory for installed GMP include files])
20 +  AC_ARG_WITH(gmp_lib, [  --with-gmp-lib=PATH     specify directory for the installed GMP library])
21 +
22    if test "x${COMPILE_GMP}" = xyes; then
23 +    AC_MSG_CHECKING([for GMP directories])
24 +    if test "x$with_gmp" != x; then
25 +       gmplibs="-lgmp"
26 +       gmpinc="-I$with_gmp/include"
27 +       if test "x$with_gmp_include" != x; then
28 +                 gmpinc="-I$with_gmp_include $gmpinc"
29 +       fi
30 +       if test "x$with_gmp_lib" != x; then
31 +                 gmplibs="$gmplibs"
32 +       fi
33 +    else
34 +        with_gmp="/usr"
35 +       gmplibs="-lgmp"
36 +       gmpinc="-I/usr/include"
37 +    fi
38 +    AC_MSG_RESULT([prefix=$with_gmp, libs=$gmplibs, inc=$gmpinc])
39      AC_CHECK_LIB(gmp, __gmpz_mul_si,
40 -      [GMP_CFLAGS=-I/usr/include
41 -       GMP_LIBS=-lgmp ],
42 +      [GMP_CFLAGS="$gmpinc"
43 +       GMP_LIBS="$gmplibs" ],
44        [GMP_CFLAGS=
45         GMP_LIBS= ])
46      AC_SUBST(GMP_CFLAGS)