-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
83 lines (71 loc) · 2.8 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
AC_INIT([xayax], [0.1])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
AC_PROG_CXX
AM_PROG_AR
AM_PATH_PYTHON([3.7])
PKG_INSTALLDIR
AC_LANG([C++])
LT_INIT
AX_CXX_COMPILE_STDCXX([17], [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"])
# We need websocketpp, which does not have a pkg-config file.
AC_CHECK_HEADER([websocketpp/client.hpp], [],
[AC_MSG_ERROR([Failed to find websocketpp])])
# 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"
# Public dependencies (exposed in the headers of xayax to
# users of the library).
AX_PKG_CHECK_MODULES([JSONCPP], [jsoncpp], [])
# Private dependencies of the library itself.
AX_PKG_CHECK_MODULES([XAYAUTIL], [], [libxayautil])
AX_PKG_CHECK_MODULES([JSONRPCCLIENT], [], [libjsonrpccpp-client])
AX_PKG_CHECK_MODULES([JSONRPCSERVER], [], [libjsonrpccpp-server])
AX_PKG_CHECK_MODULES([GLOG], [], [libglog])
AX_PKG_CHECK_MODULES([PROTOBUF], [], [protobuf])
AX_PKG_CHECK_MODULES([SQLITE3], [], [sqlite3])
AX_PKG_CHECK_MODULES([UNIVALUE], [], [libunivalue])
AX_PKG_CHECK_MODULES([MYPP], [], [mypp])
AX_PKG_CHECK_MODULES([MARIADB], [], [mariadb])
# We use the recv variant taking message_t& over deprecated older functions,
# which requires at least version 4.3.1.
AX_PKG_CHECK_MODULES([ZMQ], [], [libzmq >= 4.3.1])
AX_PKG_CHECK_MODULES([GFLAGS], [], [gflags])
# Private dependencies that are not needed for the library, but only for
# the unit tests and the binaries.
PKG_CHECK_MODULES([ETHUTILS], [ethutils])
PKG_CHECK_MODULES([GTEST], [gmock gtest_main])
# Stuff that we need for websocketpp.
PKG_CHECK_MODULES([OPENSSL], [openssl])
AX_BOOST_BASE([1.64.0], [], [AC_MSG_ERROR([Boost is not available])])
# FIXME: Checking for boost_system seems to not work with the
# macro (even though it is installed). Thus we are for now just
# manually adding -lboost_system to the flags.
#AX_BOOST_SYSTEM
WEBSOCKET_CFLAGS="${OPENSSL_CFLAGS} ${BOOST_CPPFLAGS}"
WEBSOCKET_LIBS="${OPENSSL_LIBS} ${BOOST_LDFLAGS} ${BOOST_SYSTEM_LIB}"
WEBSOCKET_LIBS+=" -lboost_system"
AC_SUBST(WEBSOCKET_CFLAGS)
AC_SUBST(WEBSOCKET_LIBS)
AC_CONFIG_FILES([
Makefile \
eth/Makefile \
eth/solidity/Makefile \
eth/tests/Makefile \
src/Makefile \
xayacore/Makefile \
xayacore/tests/Makefile \
xayax/Makefile
])
AC_OUTPUT
echo
echo "CXXFLAGS: ${CXXFLAGS}"