forked from JohnCremona/eclib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
181 lines (164 loc) · 4.95 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
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
177
178
179
180
181
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([eclib], [20140805], [[email protected]])
AM_INIT_AUTOMAKE([-Wall])
AC_MSG_NOTICE([Configuring eclib...])
AC_CONFIG_SRCDIR([libsrc])
#AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Initialise libtools:
LT_INIT
# Checks for programs:
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
# Checks for system features and libraries, via macros defined in m4/ directory
AX_CXX_COMPILE_STDCXX_0X
#AX_CXX_COMPILE_STDCXX_11([],[optional])
AX_CXX_HEADER_TR1_UNORDERED_MAP
AX_CXX_HEADER_UNORDERED_MAP
# Boost 1.35.0+ required for Asio (1.25.0 for Thread)
AX_BOOST_BASE([1.35.0])
AX_BOOST_SYSTEM
AX_BOOST_ASIO
AX_BOOST_THREAD
if [test "$ax_cv_boost" = "yes"] &&
[test "$ax_cv_boost_system" = "yes"] &&
[test "$ax_cv_boost_asio" = "yes"] &&
[test "$ax_cv_boost_thread" = "yes"]; then
AC_DEFINE([ECLIB_MULTITHREAD],[1],[Define if multithreading available and requested])
fi
# Check for libraries
# The following AC_ARG_WITH section were written by Volker Braun
dnl Find PARI
AC_ARG_WITH(pari,
[AS_HELP_STRING([--with-pari=<path>],
[prefix of PARI installation. e.g. /usr/local or /usr])],
[],
[AC_CHECK_LIB([pari], [pari_kernel_init],[ ],
AC_MSG_ERROR([Pari library not found.
Maybe you want to call configure with the --with-pari=<path> option?
This tells configure where to find the PARI library and headers.
e.g. --with-pari=/usr/local or --with-pari=/usr]),[ ])]
)
case "$with_pari" in
""|yes)
PARI_LDFLAGS=""
PARI_CFLAGS=""
GP="gp"
;;
no)
AC_MSG_ERROR([Compiling without libpari impossible (but --without-pari given)])
;;
*)
PARI_LDFLAGS="-L${with_pari}/lib"
PARI_CFLAGS="-I${with_pari}/include"
GP="${with_pari}/bin/gp"
;;
esac
PARI_LIBS="-lpari"
AC_SUBST(PARI_LIBS)
AC_SUBST(PARI_CFLAGS)
AC_SUBST(PARI_LDFLAGS)
AC_SUBST(GP)
dnl Find the NTL Library
AC_ARG_WITH(ntl,
[AS_HELP_STRING([--with-ntl=<path>],
[prefix of NTL installation. e.g. /usr/local or /usr])],
[],
[AC_CHECK_LIB([ntl], [_ntl_gmul],[ ],
AC_MSG_ERROR([NTL Library not found.
Maybe you want to call configure with the --with-ntl=<path> option?
This tells configure where to find the NTL library and headers.
e.g. --with-ntl=/usr/local or --with-ntl=/usr]),[ ])]
)
case "$with_ntl" in
""|yes)
NTL_LDFLAGS=""
NTL_CFLAGS=""
;;
no)
AC_MSG_ERROR([Compiling without libntl impossible (but --without-ntl given)])
;;
*)
NTL_LDFLAGS="-L${with_ntl}/lib"
NTL_CFLAGS="-I${with_ntl}/include"
;;
esac
NTL_LIBS="-lntl"
AC_SUBST(NTL_LIBS)
AC_SUBST(NTL_CFLAGS)
AC_SUBST(NTL_LDFLAGS)
dnl Find the FLINT Library and determine if it has the nmod_mat module
dnl (in FLINT from version 2.3)
dnl
dnl NB If your version of FLINT includes the optional hmod_mat module,
dnl then compile with FLINT_LEVEL=2 by either using configure as usual
dnl and then doing "make CXXFLAGS='-DFLINT_LEVEL=2'", or adding
dnl CXXFLAGS='-DFLINT_LEVEL=2' to the ./configure command. In either
dnl case, ignore the warnings about FLINT_LEVEL being redfined.
dnl
dnl First set defaults for when no suitable FLINT is found
dnl
AC_ARG_WITH(flint,
[AS_HELP_STRING([--with-flint=<path>],[prefix of FLINT installation.])],
[
if test "$withval" = "no"; then
want_flint=no
elif test "$withval" = "yes"; then
want_flint=yes
AC_CHECK_LIB([flint], [fmpz_init, nmod_mat_rref],
[FLINT_CFLAGS="-DFLINT_LEVEL=1";
FLINT_LIBS="-lflint";
AC_MSG_NOTICE([Building with FLINT support from system install])],
[AC_MSG_NOTICE([No suitable FLINT Library (version >=2.3) found])],
[])
else
want_flint=yes
FLINT_CFLAGS="-DFLINT_LEVEL=1 -I$withval/include"
FLINT_LDFLAGS="-L$withval/lib";
FLINT_LIBS="-lflint"
fi
],
[want_flint=no]
)
if test "x$want_flint" = "xno"; then
FLINT_CFLAGS="-DFLINT_LEVEL=0"
FLINT_LDFLAGS=""
FLINT_LIBS=""
fi
AC_SUBST(FLINT_LIBS)
AC_SUBST(FLINT_CFLAGS)
AC_SUBST(FLINT_LDFLAGS)
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT64_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([floor memmove memset pow sqrt strchr])
AC_ARG_ENABLE([allprogs],
AS_HELP_STRING([--disable-allprogs],
[only build the library and mwrank, otherwise build all programs and tests]),
[case "${enableval}" in
yes) allprogs=true ;;
no) allprogs=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-allprogs]) ;;
esac],[allprogs=true])
AM_CONDITIONAL([ALLPROGS], [test x$allprogs = xtrue])
AC_CONFIG_FILES([
libsrc/Makefile
libsrc/gpslave.cc
tests/Makefile
progs/Makefile
doc/Makefile
man/Makefile
Makefile
])
AC_OUTPUT