-
Notifications
You must be signed in to change notification settings - Fork 29
/
configure.ac
111 lines (98 loc) · 2.84 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT(radiance, 1.1.5)
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([autoconf.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([dl], [main])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/file.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_CHECK_FUNCS([ftruncate memset socket strerror])
AM_SILENT_RULES([yes])
AM_INIT_AUTOMAKE([1.11 no-define foreign])
AC_PROG_CXX
AC_CONFIG_FILES([Makefile src/Makefile])
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
# -----------------------------------------------------------------------------
# Libraries
AX_BOOST_BASE([1.55], [], [AC_MSG_ERROR(Need boost >= 1.55)])
AX_BOOST_IOSTREAMS
AX_BOOST_SYSTEM
AX_BOOST_THREAD
AX_BOOST_LOG
AX_BOOST_LOG_SETUP
AX_BOOST_DATE_TIME
AX_PTHREAD([], AC_MSG_FAILURE([pthread library is required]))
EV_DEVEL
MYSQL_C_API_LOCATION
MYSQLPP_DEVEL
# -----------------------------------------------------------------------------
# libcap
PKG_CHECK_MODULES(
[LIBCAP],
[libcap],
[AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc],
[AC_CHECK_HEADER(
[sys/capability.h],
[have_libcap=yes],
[have_libcap=no]
)],
[have_libcap=no]
)],
[have_libcap=no]
)
if test "${have_libcap}" = "yes"; then
LIBCAP_CFLAGS="${LIBCAP_CFLAGS}"
LIBCAP_LIBS="${LIBCAP_LIBS}"
else
AC_MSG_ERROR([libcap required but not found.])
fi
# -----------------------------------------------------------------------------
# memory allocation library
AC_MSG_CHECKING([for memory allocator])
CHECK_JEMALLOC
if test "$has_jemalloc" = "1"; then
AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc])
AC_MSG_RESULT([jemalloc])
else
CHECK_TCMALLOC
if test "$has_tcmalloc" = "1"; then
AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc])
AC_MSG_RESULT([tcmalloc])
else
AC_MSG_RESULT([system])
fi
fi
# -----------------------------------------------------------------------------
# Debug build
AC_ARG_ENABLE([debug],
[ --enable-debug build with additional debugging code],
[
CFLAGS='-g -pg -ggdb';
LDFLAGS="${LDFLAGS} -ldl -lprofiler";
LIBS="$LIBS -lprofiler";
AC_DEFINE([__DEBUG_BUILD__], [true], [enable debug build])
AC_MSG_NOTICE($(tput setaf 1)"DEBUG BUILD ENABLED!!!"$(tput sgr0))
]
)
AC_OUTPUT