Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.65)
5 AC_INIT([mpfi],[1.5.4],[[email protected]],[mpfi],[https://gforge.inria.fr/projects/mpfi/])
6 AC_CONFIG_SRCDIR([src/mpfi.h])
7 AC_CONFIG_HEADERS([mpfi_config.h])
8
9 AC_CONFIG_MACRO_DIR([m4])
10 AC_CONFIG_AUX_DIR([build-aux])
11 AC_USE_SYSTEM_EXTENSIONS
12 AM_INIT_AUTOMAKE([1.9 -Wall -Werror dist-bzip2 dist-zip])
13 AM_SILENT_RULES([no])
14 AM_MAINTAINER_MODE([])
15
16 dnl Extra arguments to configure
17 AC_ARG_WITH([mpfr_include],
18 [AS_HELP_STRING([--with-mpfr-include=DIR],[MPFR include directory])],
19 [CPPFLAGS="-I$withval $CPPFLAGS"])
20 AC_ARG_WITH([mpfr_lib],
21 [AS_HELP_STRING([--with-mpfr-lib=DIR],[MPFR lib directory])],
22 [LDFLAGS="-L$withval $LDFLAGS"])
23 AC_ARG_WITH([mpfr],
24 [AS_HELP_STRING([--with-mpfr=DIR],[MPFR install directory])],
25 [
26 if test -z "$with_mpfr_include" -a -z "$with_mpfr_lib" ; then
27 CPPFLAGS="-I$withval/include $CPPFLAGS"
28 LDFLAGS="-L$withval/lib $LDFLAGS"
29 else
30 AC_MSG_FAILURE([Do not use --with-mpfr and --with-mpfr-include/--with-mpfr-lib options simultaneously.])
31 fi
32 ])
33 AC_ARG_WITH([gmp_include],
34 [AS_HELP_STRING([--with-gmp-include=DIR],[GMP include directory])],
35 [CPPFLAGS="-I$withval $CPPFLAGS"])
36 AC_ARG_WITH([gmp_lib],
37 [AS_HELP_STRING([--with-gmp-lib=DIR],[GMP lib directory])],
38 [LDFLAGS="-L$withval $LDFLAGS"])
39 AC_ARG_WITH([gmp],
40 [AS_HELP_STRING([--with-gmp=DIR],[GMP install directory])],
41 [
42 if test -z "$with_gmp_lib" -a -z "$with_gmp_include" ; then
43 CPPFLAGS="-I$withval/include $CPPFLAGS"
44 LDFLAGS="-L$withval/lib $LDFLAGS"
45 else
46 AC_MSG_FAILURE([Do not use --with-gmp and --with-gmp-include/--with-gmp-lib options simultaneously.])
47 fi
48 ])
49
50 # Checks for programs.
51 AC_PROG_CC
52 AC_PROG_CPP
53 AC_PROG_INSTALL
54 AC_PROG_LN_S
55 AC_PROG_MAKE_SET
56 AM_PROG_AR
57 LT_INIT
58
59 # Checks for libraries.
60 dnl Check GMP Header
61 AC_MSG_CHECKING(for gmp.h)
62 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
63 #include "gmp.h"
64 ]])],[AC_MSG_RESULT(yes)],[
65 AC_MSG_RESULT(no)
66 AC_MSG_ERROR([gmp.h can't be found, or is unusable.])
67 ])
68
69 AC_CHECK_LIB([gmp], [__gmpz_init],
70 [LIBS="-lgmp $LIBS"],
71 [AC_MSG_ERROR([libgmp not found.])])
72
73 AC_MSG_CHECKING(for valid GMP)
74 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
75 #include "gmp.h"
76 #if (__GNU_MP_VERSION*100+__GNU_MP_VERSION_MINOR*10 < 410)
77 # error "min: GMP 4.1.0"
78 #endif
79 ]], [[]])],[AC_MSG_RESULT(yes)],[
80 AC_MSG_RESULT(no)
81 AC_MSG_ERROR([GMP 4.1.0 min required])
82 ])
83
84 dnl Check MPFR Header
85 AC_MSG_CHECKING(for mpfr.h)
86 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
87 #include "mpfr.h"
88 ]])],[AC_MSG_RESULT(yes)],[
89 AC_MSG_RESULT(no)
90 AC_MSG_ERROR([mpfr.h can't be found, or is unusable.])
91 ])
92
93 AC_CHECK_LIB([mpfr], [mpfr_init],
94 [LIBS="-lmpfr $LIBS"],
95 [AC_MSG_ERROR([libmpfr not found.])])
96
97 AC_MSG_CHECKING(for valid MPFR)
98 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
99 #include "mpfr.h"
100 #if (MPFR_VERSION < MPFR_VERSION_NUM(2,4,2))
101 # error "min: MPFR 2.4.2"
102 #endif
103 ]], [[]])],[AC_MSG_RESULT(yes)],[
104 AC_MSG_RESULT(no)
105 AC_MSG_ERROR([MPFR 2.4.2 min required])
106 ])
107
108 # Checks for header files.
109 AC_CHECK_HEADERS([float.h limits.h stdlib.h string.h sys/time.h unistd.h])
110 AC_CHECK_HEADER([stdarg.h],[AC_DEFINE([HAVE_STDARG],1,[Define if stdarg])],
111 [AC_CHECK_HEADER([varargs.h],,
112 AC_MSG_ERROR([stdarg.h or varargs.h not found]))])
113
114 # Checks for typedefs, structures, and compiler characteristics.
115 AC_TYPE_SIZE_T
116
117 # Checks for library functions.
118 AC_CHECK_FUNCS([dup2 gettimeofday])
119 AC_CHECK_FUNCS([mpfr_q_sub mpfr_z_sub mpfr_z_div])
120
121 case $AC_PACKAGE_VERSION in
122 *-dev)
123 AC_DEFINE([WARN_IF_REVERTED_ENDPOINTS], 1,
124 [Define to 1 if it is a development version.]);;
125 esac
126
127 AC_CONFIG_FILES([Makefile
128 doc/Makefile
129 src/Makefile
130 tests/Makefile])
131 AC_OUTPUT