maint: update all copyright year number ranges
[platform/upstream/coreutils.git] / m4 / gmp.m4
1 # Tests for GNU GMP (or any compatible replacement).
2
3 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
4
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
8
9 dnl Written by James Youngman.
10
11 dnl Check for libgmp.  We avoid use of AC_CHECK_LIBS because we don't want to
12 dnl add this to $LIBS for all targets.
13 AC_DEFUN([cu_GMP],
14 [
15   LIB_GMP=
16   AC_SUBST([LIB_GMP])
17
18   AC_ARG_WITH([gmp],
19     AS_HELP_STRING([--without-gmp],
20       [do not use the GNU MP library for arbitrary precision
21        calculation (default: use it if available)]),
22     [cu_use_gmp=$withval],
23     [cu_use_gmp=auto])
24
25   if test $cu_use_gmp != no; then
26     cu_saved_libs=$LIBS
27     AC_SEARCH_LIBS([__gmpz_init], [gmp],
28       [test "$ac_cv_search___gmpz_init" = "none required" ||
29        {
30         LIB_GMP=$ac_cv_search___gmpz_init
31         AC_DEFINE([HAVE_GMP], [1],
32           [Define if you have GNU libgmp (or replacement)])
33         # This only available in GMP >= 5
34         AC_CHECK_DECLS([mpz_inits], [], [], [[#include <gmp.h>]])
35        }],
36       [AC_MSG_WARN([libgmp development library was not found or not usable.])
37        AC_MSG_WARN([AC_PACKAGE_NAME will be built without GMP support.])])
38     LIBS=$cu_saved_libs
39   fi
40 ])