This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
78 lines (63 loc) · 3.23 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
dnl Process this file with autoconf to produce a configure script.
dnl We need at least autoconf 2.69 for this configure.ac to work.
AC_PREREQ([2.69])
AC_INIT([pyeantic], [1.5.0], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.14.1])
dnl Find C++ Compiler
AC_PROG_CXX
dnl Set INSTALL or use install-sh.
AC_PROG_INSTALL
dnl We build our library with libtool.
LT_INIT
AC_CANONICAL_HOST
dnl We run the valgrind test-suite in make check-valgrind (if valgrind is installed)
AX_VALGRIND_DFLT([sgcheck], [off])
AX_VALGRIND_DFLT([drd], [off])
AX_VALGRIND_DFLT([helgrind], [off])
AX_VALGRIND_CHECK()
dnl Check for required libraries
AC_LANG([C++])
dnl We want to build a Python module powered by cppyy
AM_PATH_PYTHON([3.6], [have_python=yes], [have_python=no])
dnl We use some C++17 features, such as if constexpr
AX_CXX_COMPILE_STDCXX(17)
AC_CHECK_HEADERS([e-antic/renfxx.h], , AC_MSG_ERROR([E-ANTIC headers not found]))
AC_CHECK_LIB([eantic], [renf_elem_clear], , AC_MSG_ERROR([E-ANTIC library not found]), [-lgmp -lmpfr -lflint])
AX_CXX_CHECK_LIB([eanticxx], [eantic::renf_elem_class], , AC_MSG_ERROR([E-ANTIC library not found]), [-lgmp -lmpfr -lflint])
dnl Our Python library relies on cppyy. It can be built without since it is a
dnl pure Python package but we cannot test it if cppyy is not present.
AC_ARG_WITH([pytest], AS_HELP_STRING([--without-pytest], [Do not run Python tests]))
AS_IF([test "x$with_pytest" != "xno" && test "x$have_python" = "xyes"],
[
with_pytest=yes
AC_MSG_CHECKING([for pytest module])
AS_IF([$PYTHON -c 'import pytest'], , AC_MSG_ERROR([pytest for make check not found; run --without-pytest to disable Python tests in make check]))
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for cppyy])
AS_IF([$PYTHON -c 'import cppyy'], , AC_MSG_ERROR([cppyy for make check not found; run --without-pytest to disable Python tests in make check]))
AC_MSG_RESULT([yes])
], [])
AM_CONDITIONAL([HAVE_PYTEST], [test "x$with_pytest" = "xyes"])
dnl Some bits require SageMath to be installed. We can build without it since it is a pure Python package but we cannot test it then.
AC_ARG_WITH([sage], AS_HELP_STRING([--without-sage], [Do not run SageMath tests]))
AS_IF([test "x$with_sage" != "xno" && test "x$with_pytest" = "xyes"],
[
with_sage=yes
AC_MSG_CHECKING([for sage module])
AS_IF([$PYTHON -c 'import sage'], , AC_MSG_ERROR([SageMath for make check not found; run --without-sage to disable SageMath tests in make check]))
AC_MSG_RESULT([yes])
], [])
AM_CONDITIONAL([HAVE_SAGE], [test "x$with_sage" = "xyes"])
dnl We do not need realalg to build a converter for realalg but we need it to test.
AC_ARG_WITH([realalg], AS_HELP_STRING([--without-realalg], [Do not run realalg tests]))
AS_IF([test "x$with_realalg" != "xno" && test "$x$with_pytest" = "$xyes"],
[
with_realalg=yes
AC_MSG_CHECKING([for realalg module])
AS_IF([$PYTHON -c 'import realalg'], , AC_MSG_ERROR([realalg for make check not found; run --without-realalg to disable realalg tests in make check]))
AC_MSG_RESULT([yes])
], [])
AM_CONDITIONAL([HAVE_REALALG], [test "x$with_realalg" = "xyes"])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile])
AC_OUTPUT