-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathconfigure.ac
108 lines (87 loc) · 3.05 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(fio-kv, m4_esyscmd([buildtools/version-gen .version]), [email protected])
AC_CONFIG_SRCDIR([src/kv_store_mgr.cpp])
AC_LANG(C++)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
# Checks for programs.
AC_PROG_CXXCPP
AC_PROG_LIBTOOL
AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
#----------------------------------------------------
MODE="-O2 -DNDEBUG" # Production mode
#MODE="-O2 -g2 -DNDEBUG" # Profiling mode without debug symbols
#MODE="-g2" # Debug mode with symbols
#----------------------------------------------------
SHARED_CFLAGS="-fPIC -Wall -Werror -Wno-trigraphs -Wno-sign-compare -fno-strict-aliasing -fno-common -pipe -funit-at-a-time -std=c++0x -rdynamic"
INCLUDE_PATH="-I/usr/include/nvm"
LD_PATH="-L/usr/lib/nvm -L/usr/lib/fio"
CXXFLAGS="$LD_PATH $SHARED_CFLAGS $INCLUDE_PATH $MODE"
LIBS="-lrt"
AC_C_INLINE
AC_C_CONST
# Check for c++0x
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[[template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "Not enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);]])],,
AC_MSG_FAILURE(['$CXX $CXXFLAGS' does not accept ISO c++0x]))
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([aio.h\
assert.h\
ctype.h\
dlfcn.h\
errno.h\
fcntl.h\
float.h\
getopt.h\
linux/fs.h\
malloc.h\
map\
pthread.h\
set\
stdarg.h\
stdbool.h\
stdint.h\
stdio.h\
stdlib.h\
string\
string.h\
sys/ioctl.h\
sys/param.h\
sys/stat.h\
sys/types.h\
sys/uio.h\
time.h\
unistd.h\
vector],,AC_MSG_ERROR(["Missing header."]))
# Checks for required libraries
LIBS+=" -ldl"
AC_CHECK_LIB([pthread], [pthread_create], [LIBS="-lpthread $LIBS"], AC_MSG_ERROR(["Missing pthread library"]))
AC_CHECK_LIB([vsl], [vsl_open], [LIBS="-lvsl $LIBS"], AC_MSG_ERROR(["Missing vsl library"]))
AC_CHECK_LIB([nvm-primitives], [nvm_get_version], [LIBS="-lnvm-primitives $LIBS"], AC_MSG_ERROR(["Missing nvm-primivites library"]))
LDFLAGS+=" $LIBS"
AC_CHECK_HEADERS([nvm_primitives.h\
nvm_types.h],,AC_MSG_ERROR(["Missing header."]))
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([preadv pwritev ftruncate memset strerror clock_gettime],,AC_MSG_ERROR(["Missing function."]))
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT