-
Notifications
You must be signed in to change notification settings - Fork 70
/
configure.ac
95 lines (77 loc) · 3.42 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
95
AC_PREREQ([2.68])
AC_INIT([gg], [0.01], [[email protected]])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([src/frontend/gg-trace.cc])
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_SUBST(ARFLAGS, [cr])
# Checks for programs.
AC_PROG_CXX
AC_PROG_RANLIB
# Add picky CXXFLAGS
CXX14_FLAGS="-std=c++14 -pthread"
PICKY_CXXFLAGS="-pedantic -Wall -Wextra -Weffc++ -Werror"
AC_SUBST([CXX14_FLAGS])
AC_SUBST([PICKY_CXXFLAGS])
AC_LANG_PUSH(C++)
AC_ARG_ENABLE([sanitize],
[AS_HELP_STRING([--enable-sanitize],
[build with address and undefined-behavior santizers])],
[EXTRA_CXXFLAGS="-fsanitize=address -fsanitize=undefined -fuse-ld=gold"],
[sanitize=false])
AM_CONDITIONAL([BUILD_STATIC_BINS], [test x$sanitize = xfalse])
AC_SUBST(EXTRA_CXXFLAGS)
# Checks for libraries.
PKG_CHECK_MODULES([CRYPTO],[libcrypto++])
PKG_CHECK_MODULES([SSL],[libssl libcrypto])
PKG_CHECK_MODULES([PROTOBUF], [protobuf])
PKG_CHECK_MODULES([HIREDIS], [hiredis])
AX_BOOST_BASE([1.54.0], [], [AC_MSG_ERROR([Missing boost (may need to install libboost-dev)])])
# Protobuf compiler
AC_PATH_PROG([PROTOC], [protoc], [])
AS_IF([test x"$PROTOC" = x],
[AC_MSG_ERROR([cannot find protoc, the Protocol Buffers compiler])])
# Checks for header files.
AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([Missing libcap header file])])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT16_T
abs_srcdir=$(readlink -f $srcdir)
# gg-toolchain path
AC_ARG_VAR([TOOLCHAIN_PATH], [Path to gg toolchain.])
AS_IF([test "x$TOOLCHAIN_PATH" = x], [TOOLCHAIN_PATH="$abs_srcdir/toolchain/bin"])
AC_CHECK_FILE($TOOLCHAIN_PATH/gcc, [], [AC_MSG_ERROR([Could not find gcc in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/cc1, [], [AC_MSG_ERROR([Could not find cc1 in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/as, [], [AC_MSG_ERROR([Could not find as in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/g++, [], [AC_MSG_ERROR([Could not find g++ in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/cc1plus, [], [AC_MSG_ERROR([Could not find cc1plus in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/collect2, [], [AC_MSG_ERROR([Could not find collect2 in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/ld, [], [AC_MSG_ERROR([Could not find ld in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/strip, [], [AC_MSG_ERROR([Could not find strip in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/ar, [], [AC_MSG_ERROR([Could not find ar in toolchain dir.])])
AC_CHECK_FILE($TOOLCHAIN_PATH/ranlib, [], [AC_MSG_ERROR([Could not find ranlib in toolchain dir.])])
# Used for loading the correct syscall table
OS="$(uname | tr '[[:upper:]]' '[[:lower:]]')"
ARCH="$(uname -m)"
AC_SUBST([OS])
AC_SUBST([ARCH])
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/Makefile
src/util/Makefile
src/tui/Makefile
src/net/Makefile
src/protobufs/Makefile
src/thunk/Makefile
src/trace/Makefile
src/sandbox/Makefile
src/models/Makefile
src/storage/Makefile
src/execution/Makefile
src/frontend/Makefile
src/remote/Makefile
examples/Makefile
examples/fibonacci/Makefile
examples/gtest/Makefile
examples/viddec/Makefile
tests/Makefile])
AC_OUTPUT