forked from fplll/fplll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
143 lines (109 loc) · 4.37 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(fplll, 5.0.1)
AC_CONFIG_SRCDIR([fplll/fplll.cpp])
# cf http://comments.gmane.org/gmane.comp.sysutils.autoconf.general/15737
# First extract pieces from the version number string
FPLLL_MAJOR_VERSION=`echo AC_PACKAGE_VERSION | awk -F. '{print $1}'`
FPLLL_MINOR_VERSION=`echo AC_PACKAGE_VERSION | awk -F. '{print $2}'`
FPLLL_MICRO_VERSION=`echo AC_PACKAGE_VERSION | awk -F. '{print $3}'`
FPLLL_VERSION=$FPLLL_MAJOR_VERSION.$FPLLL_MINOR_VERSION.$FPLLL_MICRO_VERSION$FPLLL_MICRO_VERSION_SUFFIX
FPLLL_VERSION_NUMBER=`expr $FPLLL_MAJOR_VERSION \* 1000000 + $FPLLL_MINOR_VERSION \* 1000 + $FPLLL_MICRO_VERSION`
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADER(config.h)
DEFAULT_CXXFLAGS="-O3 -Wall"
CXXFLAGS=${CXXFLAGS:-$DEFAULT_CXXFLAGS}
LT_INIT
# The version of the libtool library is of the form current:revision:age
#
# See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# When doing a release, they should be updated like this:
# 1. If no interfaces changed, only implementations: just increment
# revision.
# 2. If interfaces were added, none removed: increment current, set
# revision to zero and increment age.
# 3. If interfaces were removed (breaks backward compatibility): increment
# current, and set both revision and age to zero.
FPLLL_LT_CURRENT=2
FPLLL_LT_REVISION=0
FPLLL_LT_AGE=0
AC_SUBST(FPLLL_LT_CURRENT)
AC_SUBST(FPLLL_LT_REVISION)
AC_SUBST(FPLLL_LT_AGE)
AC_PROG_INSTALL
# Checks for programs.
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AX_CXX_COMPILE_STDCXX([11],[noext],[mandatory])
# Checks for libraries.
AC_ARG_WITH(gmp,
AS_HELP_STRING([--with-gmp=@<:@=DIR@:>@], [GMP install directory]), [
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
gmp_lib_path="$withval/lib"
])
AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR(
[GNU MP not found, see http://gmplib.org])])
AC_CHECK_LIB(gmp, __gmp_get_memory_functions, , [AC_MSG_ERROR(
[GMP version too old, need >= 4.2.0, see http://gmplib.org])])
AC_ARG_WITH(mpfr,
AS_HELP_STRING([--with-mpfr=@<:@=DIR@:>@], [MPFR install directory]), [
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
mpfr_lib_path="$withval/lib"
])
AC_CHECK_LIB(mpfr, mpfr_add, , [AC_MSG_ERROR(
[MPFR not found, see http://www.mpfr.org])])
AC_CHECK_LIB(mpfr, mpfr_fms, , [AC_MSG_ERROR(
[MPFR version too old, need >= 2.3.0, see http://www.mpfr.org])])
AC_ARG_WITH(qd,
AS_HELP_STRING([--with-qd=@<:@=DIR@:>@], [quaddouble install directory]), [
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
qd_lib_path="$withval/lib"
])
AC_CHECK_HEADER(qd/dd_real.h,
have_libqd="yes",
have_libqd="no")
if test "x${have_libqd}" = "xyes"; then
LIBQD_LIBADD="-lqd"
AC_DEFINE([FPLLL_WITH_QD], [1], [defined when libqd-dev is available])
fi
AC_SUBST(LIBQD_LIBADD)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h cstdio iostream string limits vector])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_C_VOLATILE
# Checks for library functions.
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor pow rint sqrt strtol])
# enumeration dimension
max_enumeration_dimension=256
AC_ARG_WITH(max-enumeration-dimension,
AS_HELP_STRING([--with-max-enumeration-dimension@<:@=DIM@:>@],
[Maximum supported enumeration dimension (default: 256).]),
[max_enumeration_dimension=$withval])
AC_DEFINE_UNQUOTED([FPLLL_MAX_ENUM_DIMENSION], $max_enumeration_dimension, [maximum supported enumeration dimension])
# Store version numbers in header
AC_DEFINE_UNQUOTED([FPLLL_MAJOR_VERSION],[$FPLLL_MAJOR_VERSION],[major version])
AC_DEFINE_UNQUOTED([FPLLL_MINOR_VERSION],[$FPLLL_MINOR_VERSION],[minor version])
AC_DEFINE_UNQUOTED([FPLLL_MICRO_VERSION],[$FPLLL_MICRO_VERSION],[micro version])
AC_DEFINE_UNQUOTED([FPLLL_VERSION],[$FPLLL_VERSION],[full version])
AC_DEFINE_UNQUOTED([FPLLL_VERSION_INFO],[$FPLLL_VERSION_INFO],[long version string])
AC_CONFIG_HEADERS([fplll/fplll_config.h])
AC_CONFIG_FILES([Makefile
fplll/Makefile
tests/Makefile
fplll.pc])
AC_OUTPUT