-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.ac
87 lines (74 loc) · 2.75 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
AC_INIT([tauriond], [0.4])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
AC_PROG_CXX
AM_PROG_AS
AM_PROG_AR
AM_PATH_PYTHON([3.7])
LT_INIT
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX([14], [noext])
AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="${CXXFLAGS} -Wall"])
AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="${CXXFLAGS} -Werror"])
AX_CHECK_COMPILE_FLAG([-pedantic], [CXXFLAGS="${CXXFLAGS} -pedantic"])
AX_CHECK_COMPILE_FLAG([-Wno-deprecated],
[CXXFLAGS="${CXXFLAGS} -Wno-deprecated"])
# Windows defines ERROR, which requires us to tell glog to not define
# it as abbreviated log severity (LOG(ERROR) still works, though, and
# that is all that we actually use in the code).
# See https://hpc.nih.gov/development/glog.html.
CXXFLAGS="${CXXFLAGS} -DGLOG_NO_ABBREVIATED_SEVERITIES"
# The code includes some sanity checks / assertions that noticably slow down
# general block-processing performance. Thus enabling them is optional,
# and should be used only for testing purposes.
AC_ARG_ENABLE([slow-asserts],
AS_HELP_STRING([--enable-slow-asserts],
[Enable slow consistency checks for testing]))
AS_IF([test "x$enable_slow_asserts" = "xyes"], [
CXXFLAGS="${CXXFLAGS} -DENABLE_SLOW_ASSERTS"
], [
enable_slow_asserts="no"
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([XAYAGAME], [libxayautil libxayagame])
PKG_CHECK_MODULES([CHARON], [charon])
PKG_CHECK_MODULES([SQLITE3], [sqlite3])
PKG_CHECK_MODULES([JSON], [jsoncpp])
PKG_CHECK_MODULES([MHD], [libmicrohttpd])
PKG_CHECK_MODULES([GLOG], [libglog])
PKG_CHECK_MODULES([GFLAGS], [gflags])
PKG_CHECK_MODULES([GTEST], [gmock gtest])
PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main])
PKG_CHECK_MODULES([PROTOBUF], [protobuf])
# Make sure that pkg-config provides the right libraries for some dependencies
# that may only be available statically. For context, see:
# https://bugs.freedesktop.org/show_bug.cgi?id=19541.
PKG_CONFIG="${PKG_CONFIG} --static"
PKG_CHECK_MODULES([BENCHMARK], [benchmark])
# It seems that GMP does not support pkg-config, so we have to check for it
# and set up the variables manually.
AC_CHECK_LIB(gmp, __gmpz_init, ,
[AC_MSG_ERROR([GNU MP not found, see https://gmplib.org/])])
AC_SUBST(GMP_CFLAGS, )
AC_SUBST(GMP_LIBS, -lgmp)
# FIXME: We need the Charon installation prefix, since we want to
# access the testenv.pem certificate installed there. For now, we
# just assume it is the default /usr/local, but ideally we should detect
# it for Charon itself.
AC_SUBST(CHARON_PREFIX, /usr/local)
AC_CONFIG_FILES([
Makefile \
data/Makefile \
database/Makefile \
gametest/Makefile \
hexagonal/Makefile \
mapdata/Makefile \
proto/Makefile \
src/Makefile
])
AC_OUTPUT
echo
echo "Slow assertions: ${enable_slow_asserts}"
echo "CXXFLAGS: ${CXXFLAGS}"