File: configure.ac

package info (click to toggle)
fplll 5.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 5,780 kB
  • sloc: cpp: 17,882; sh: 1,050; makefile: 170; perl: 46; python: 42
file content (176 lines) | stat: -rw-r--r-- 5,852 bytes parent folder | download
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(fplll, 5.2.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])
m4_ifdef([AM_SILENT_RULES], [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=5
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_ENABLE(mpir,
        AS_HELP_STRING([--enable-mpir],
         [Enable MPIR instead of GMP]))

AS_IF([test "x$enable_mpir" = "xyes"], [
	AC_ARG_WITH(mpir,
	   AS_HELP_STRING([--with-mpir=@<:@=DIR@:>@], [MPIR install directory]), [
	      CPPFLAGS="$CPPFLAGS -I$withval/include"
	      LDFLAGS="$LDFLAGS -L$withval/lib"
	      mpir_lib_path="$withval/lib"
	   ])
	AC_CHECK_LIB(mpir, __gmpz_init, , [AC_MSG_ERROR(
	[MPIR not found, see http://mpir.org])])
	AC_CHECK_LIB(mpir, __gmp_get_memory_functions, , [AC_MSG_ERROR(
	[MPIR version too old, need >= 1.0.0, see http://mpir.org])])
        LIBGMP="-lmpir"
])

AS_IF([test "x$enable_mpir" != "xyes"], [
	AC_ARG_WITH(gmp,
	   AS_HELP_STRING([--with-gmp=@<:@=DIR@:>@], [GMP install directory]), [
	      CPPFLAGS="$CPPFLAGS -I$withval/include"
	      LDFLAGS="$LDFLAGS -L$withval/lib"
	      mpir_lib_path="$withval/lib"
	   ])
	AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR(
	[GNU MP not found, see http://mpir.org])])
	AC_CHECK_LIB(gmp, __gmp_get_memory_functions, , [AC_MSG_ERROR(
	[GMP version too old, need >= 4.2.0, see http://gmplib.org])])
        LIBGMP="-lgmp"
])

AC_SUBST(LIBGMP)

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]),)

AS_IF([test "x$with_qd" != "xno"], [
       CPPFLAGS="$CPPFLAGS -I$with_qd/include"
       LDFLAGS="$LDFLAGS -L$with_qd/lib"
       qd_lib_path="$with_qd/lib"
       AC_CHECK_HEADER(qd/dd_real.h,
           have_libqd="yes",
           have_libqd="no")
      ])

AS_IF([test "x${have_libqd}" = "xyes"], [
    LIBQD_LIBADD="-lqd"
    AC_DEFINE([FPLLL_WITH_QD], [1], [defined when libqd-dev is available])])

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])

AC_ARG_ENABLE(recursive-enum,
        AS_HELP_STRING([--disable-recursive-enum],
         [Disable recursive enumeration]))

AS_IF([test "x$enable_recursive_enum" != "xno"], [
        AC_DEFINE([FPLLL_WITH_RECURSIVE_ENUM], [1], [recursive enumeration enabled])])

# 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])

FPLLL_DEFAULT_STRATEGY_PATH=\"/usr/share/libfplll$FPLLL_LT_CURRENT/strategies/\"
AC_DEFINE_UNQUOTED([FPLLL_DEFAULT_STRATEGY_PATH], [$FPLLL_DEFAULT_STRATEGY_PATH], [path to default strategy])
AC_SUBST(FPLLL_DEFAULT_STRATEGY_PATH)
AC_DEFINE_UNQUOTED([FPLLL_DEFAULT_STRATEGY], ["default.json"], [name of default strategy])
AC_SUBST(FPLLL_DEFAULT_STRATEGY)

AC_CONFIG_HEADERS([fplll/fplll_config.h])

AC_CONFIG_FILES([Makefile
                 fplll/Makefile
                 tests/Makefile
                 fplll.pc])
AC_OUTPUT