-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
95 lines (75 loc) · 2.63 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
AC_INIT([phylonium],[1.7],[[email protected]])
AC_CONFIG_SRCDIR([src/phylonium.cxx])
AM_INIT_AUTOMAKE([-Wall foreign ])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_RANLIB
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Make sure, also the C++ programs are compiled with OpenMP
AC_LANG(C++)
AC_OPENMP
AX_CXX_COMPILE_STDCXX(17)
# Execute all tests using C
AC_LANG(C)
AC_OPENMP
AX_GCC_FUNC_ATTRIBUTE(ifunc)
AC_CHECK_LIB([m],[cos])
AC_ARG_ENABLE([libdna],
[AS_HELP_STRING([--enable-libdna],[link against libdna @<:@default: no@:>@])],
[with_libdna=${enableval}],[with_libdna=no]
)
AS_IF([test "x${with_libdna}" = xyes], [
AC_CHECK_HEADERS([kloetzl/dna.h],[have_libdna=yes],[have_libdna=no])
AC_CHECK_LIB(dna, dna_version, [], [have_libdna=no])
AS_IF([test "x$have_libdna" = "xno"],
[AC_MSG_ERROR([Missing libdna.])
])
])
# The libdivsufsort header contains some Microsoft extension making
# compilation fail on certain systems (i.e. OS X). Add the following
# flag so the build runs smoothly.
CPPFLAGS="$CPPFLAGS -fms-extensions"
AC_CHECK_HEADERS([divsufsort64.h],[have_libdivsufsort64=yes],[have_libdivsufsort64=no])
AC_CHECK_LIB(divsufsort64, divsufsort64, [], [have_libdivsufsort64=no])
AS_IF([test "x$have_libdivsufsort64" = "xno"],
[AC_MSG_ERROR([Missing libdivsufsort64.])
])
AC_ARG_ENABLE([x86simd],
[AS_HELP_STRING([--disable-x86simd],[disable x86 SIMD support @<:@default: enabled@:>@])],
[x86simd=${enableval}],[x86simd=enabled]
)
# AC_MSG_WARN(["XXX${x86simd}"])
AS_IF([test "x${x86simd}" = xenabled],[AC_DEFINE([ENABLE_X86_SIMD],[1],[Enable x86 SIMD support])])
AM_CONDITIONAL([ENABLE_X86_SIMD],[test "x${x86simd}" = xenabled])
# older compilers don't support AVX512
AC_ARG_ENABLE([avx512],
[AS_HELP_STRING([--disable-avx512],[disable AVX512 support @<:@default: enabled@:>@])],
[avx512=${enableval}],[avx512=enabled]
)
# AC_MSG_WARN(["XXX${avx512}"])
AS_IF([test "x${avx512}" = xenabled],[AC_DEFINE([ENABLE_AVX512],[1],[Enable AVX512 support])])
AM_CONDITIONAL([ENABLE_AVX512],[test "x${avx512}" = xenabled])
# Check for various headers including those used by libdivsufsort.
AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h stdint.h inttypes.h err.h errno.h fcntl.h])
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_HEADER_STDBOOL
AC_CHECK_FUNCS([floor pow sqrt strdup strerror])
AC_CHECK_FUNCS([strtoul strtod])
AC_CHECK_FUNCS([reallocarray])
AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes])
AC_CONFIG_HEADERS([config.h:config.hin])
AC_CONFIG_FILES([
libs/Makefile
Makefile
man/phylonium.1
src/Makefile
test/Makefile
])
AC_OUTPUT