-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.ac
71 lines (55 loc) · 2.08 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
AC_INIT([trRouting], [1.0], [https://github.com/chairemobilite/trRouting])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_MACRO_DIRS([m4])
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AR
LT_INIT
# AX_ macros copied from the autoconf-archive
# TODO Do we need the strict mode or not here ?
AX_CXX_COMPILE_STDCXX(17,noext)
AX_BOOST_BASE
AX_BOOST_SYSTEM # For include/asio_compatibility.hpp
AX_BOOST_REGEX # For include/server_http.hpp
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_DATE_TIME # For include/service.hpp
AX_PTHREAD # Explicitely checking, needed by std::thread
PKG_CHECK_MODULES(CAPNP, capnp)
# Check for the capnp binary presence
AC_PATH_PROG(CAPNP_BIN, capnp, no)
AS_IF([test x"$CAPNP_BIN" = x"no"], [AC_MSG_ERROR([Please install capnp binary.])])
PKG_CHECK_MODULES(SPDLOG, spdlog)
PKG_CHECK_MODULES(JSON, nlohmann_json)
# TODO: Add link to doc of this override flag
CPPFLAGS+=" -DBOOST_BIND_GLOBAL_PLACEHOLDERS"
CPPFLAGS+=" $BOOST_CPPFLAGS $CAPNP_CFLAGS $PTHREAD_CFLAGS $SPDLOG_CFLAGS $JSON_CLAGS"
# Add BOOST flags
LDFLAGS+=" $BOOST_LDFLAGS $BOOST_REGEX_LIB $BOOST_SYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_DATE_TIME_LIB"
# Add various flags
LDFLAGS+=" $PTHREAD_LIBS"
LDFLAGS+=" $CAPNP_LIBS"
LDFLAGS+=" $SPDLOG_LIBS"
CXXFLAGS+=" -Wall -Wextra"
# Do not enable benchmark in the make check by default
AC_ARG_ENABLE([benchmark],
[ --enable-benchmark Benchmarks will be run when running make check],
[case "${enableval}" in
yes) benchmark=true ;;
no) benchmark=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-benchmark]) ;;
esac],[benchmark=false])
AS_IF([test x"$benchmark" = xfalse], [AC_MSG_NOTICE([Benchmarks are disabled. Enable them by adding the --enable-benchmark flag to configure.])])
AM_CONDITIONAL([RUN_BENCHMARK], [test x$benchmark = xtrue])
AC_CONFIG_FILES([
Makefile
src/Makefile
tests/Makefile
tests/cache_fetch/Makefile
tests/benchmark_csa/Makefile
tests/connection_scan_algorithm/Makefile
include/Makefile
include/capnp/Makefile
connection_scan_algorithm/Makefile
connection_scan_algorithm/src/Makefile
])
AC_OUTPUT