-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
66 lines (55 loc) · 2.52 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
AC_PREREQ([2.71])
AC_INIT([ufser],[1.0],[zoltan.turanyi@ericsson.com])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects -Wno-portability])
AM_SILENT_RULES([yes])
: ${CXXFLAGS=""}
AC_PROG_CXX
LT_INIT
UF_CPPFLAGS=
UF_CXXFLAGS="-std=c++20 -ggdb3 -Wall -Wextra -Wswitch-enum"
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [compile with debug options]))
AS_IF([test "x$enable_debug" = "xyes"],
[UF_CXXFLAGS="$UF_CXXFLAGS -O0"],
[UF_CPPFLAGS="$UF_CPPFLAGS -DNDEBUG"
UF_CXXFLAGS="$UF_CXXFLAGS -Ofast"])
AC_ARG_ENABLE([sanitizer], AS_HELP_STRING([--enable-sanitizer], [build with AddressSanitizer @<:@default=no@:>@]))
AM_CONDITIONAL([NEED_SANITIZER], [test "$enable_sanitizer" = yes])
AC_CHECK_HEADER([boost/pfr.h], [AC_DEFINE([HAVE_BOOST_PFR])], [AC_MSG_WARN(['boost/pfr.h' not found on the path; omitting some convenience helper functions])])
dnl TODO tools for ser/deser, show, etc
AM_PATH_PYTHON([3],, [:])
AC_ARG_ENABLE([python], [AS_HELP_STRING([--enable-python], [build Python bindings @<:@default=no@:>@])])dnl , [], [with_python=no])
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config (autodetected)])
AS_IF([test "$enable_python" = yes],
[AS_IF([test -z "$PYTHON_CONFIG"],
[AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], [no])
AS_IF([test "$PYTHON_CONFIG" = no], AC_MSG_ERROR([cannot find python-config; either install Python or specify PYTHON_CONFIG.]))
])
AC_MSG_CHECKING([Python include flags])
PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
AC_MSG_RESULT([$PYTHON_INCLUDE])
AC_SUBST([PYTHON_INCLUDE])
])
AM_CONDITIONAL([NEED_PYTHON], [test "$enable_python" = yes])
AC_ARG_ENABLE([benchmark], AS_HELP_STRING([--enable-benchmark], [build benchmark test @<:@default=no@:>@]))
AS_IF([test "$enable_benchmark"],
[AC_CHECK_HEADER([benchmark/benchmark.h], [], [AC_MSG_ERROR(['benchmark/benchmark.h' is needed for the benchmarks])])
AC_LANG_PUSH([C++])
save="$LIBS"
LIBS="$LIBS -lbenchmark"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <benchmark/benchmark.h>], [benchmark::Shutdown()])],
[],
[AC_MSG_ERROR([benchmark program cannot be compiled])])
LIBS="$save"
AC_LANG_POP
])
AM_CONDITIONAL([NEED_BM], [test "$enable_benchmark" = yes])
AC_SUBST([AM_CPPFLAGS], [$UF_CPPFLAGS])
AC_SUBST([AM_CXXFLAGS], [$UF_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([
Makefile
Doxyfile
tests/Makefile
])
AC_OUTPUT