-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
223 lines (190 loc) · 8.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
###########################################################################
# (C) Copyright 2016 Barcelona Supercomputing Center #
# Centro Nacional de Supercomputacion #
# #
# This file is part of the Echo Filesystem NG. #
# #
# See AUTHORS file in the top level directory for information #
# regarding developers and contributors. #
# #
# This library is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Lesser General Public #
# License as published by the Free Software Foundation; either #
# version 3 of the License, or (at your option) any later version. #
# #
# The Echo Filesystem NG is distributed in the hope that it will #
# be useful, but WITHOUT ANY WARRANTY; without even the implied #
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR #
# PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with Echo Filesystem NG; if not, write to the Free #
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
# #
###########################################################################
AC_INIT([Echo Filesystem NG],
[0.1.0],
[efs-ng])
AC_PREREQ([2.59])
AC_CONFIG_SRCDIR([src/efs-ng.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([src/config.h])
AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects])
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
LT_INIT
# check that c++11 is supported by the compiler
AX_CHECK_COMPILE_FLAG([-std=c++11], [CXXFLAGS+=" -std=c++11"], [
echo "C++ compiler cannot compile C++11 code"
exit -1
])
# check for pkg-config
PKG_PROG_PKG_CONFIG
# check for fuse3
AC_ARG_WITH([fuse3],
AS_HELP_STRING([--with-fuse3 @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library [ARG=yes].
(Note that you may need to specify the paths manually if the library is not installed in a standard locaiton.)])
)
# check whether FUSE (3.0 or 2.X >= 2.6) is available
AS_IF([test "x$with_fuse3" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3])],
[test "x$with_fuse3_readbuf" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3_readbuf])],
[test "x$with_fuse3_4mb" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3_4mb])],
[test "x$with_fuse3_4mb_readbuf" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3_4mb_readbuf])],
[test "x$with_fuse3_8mb" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3_8mb])],
[test "x$with_fuse3_12mb" = "xyes"], [PKG_CHECK_MODULES([FUSE3], [fuse3_12mb])],
[PKG_CHECK_MODULES([FUSE], [fuse >= 2.6])]
)
# WARNING: the following options are for testing purposes only and should
# not be used in production
AC_ARG_WITH([fuse3-readbuf],
AS_HELP_STRING([--with-fuse3-readbuf @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library (readbuf patch) [ARG=yes].
(EXPERIMENTAL.)])
)
AC_ARG_WITH([fuse3-4mb],
AS_HELP_STRING([--with-fuse3-4mb @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library (4mb transfer size) [ARG=yes].
(EXPERIMENTAL.)])
)
##
AC_ARG_WITH([fuse3-4mb-readbuf],
AS_HELP_STRING([--with-fuse3-4mb-readbuf @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library (4mb transfer size with readbuf patch) [ARG=yes].
(EXPERIMENTAL.)])
)
##
AC_ARG_WITH([fuse3-8mb],
AS_HELP_STRING([--with-fuse3-8mb @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library (8mb transfer size) [ARG=yes].
(EXPERIMENTAL.)])
)
##
AC_ARG_WITH([fuse3-12mb],
AS_HELP_STRING([--with-fuse3-12mb @<:@=ARG@:>@ ],
[Build the filesystem using the FUSE3 library (12mb transfer size) [ARG=yes].
(EXPERIMENTAL.)])
)
AM_CONDITIONAL([FUSE3_BUILD],
[test "x$with_fuse3" = "xyes" ||
test "x$with_fuse3_readbuf" = "xyes" ||
test "x$with_fuse3_4mb" = "xyes" ||
test "x$with_fuse3_4mb_readbuf" = "xyes" ||
test "x$with_fuse3_8mb" = "xyes" ||
test "x$with_fuse3_12mb" = "xyes" ])
# check for several functions and libraries that affect FUSE's behavior
AC_CHECK_FUNCS(setxattr fdatasync splice vmsplice fstatat utimensat)
AC_CHECK_FUNCS([posix_fallocate])
AC_CHECK_LIB(ulockmgr, ulockmgr_op)
if [ test "x$with_fuse3" == "xyes" ||
test "x$with_fuse3_readbuf" == "xyes" ||
test "x$with_fuse3_4mb" == "xyes" ||
test "x$with_fuse3_4mb_readbuf" == "xyes" ||
test "x$with_fuse3_8mb" == "xyes" ||
test "x$with_fuse3_12mb" == "xyes" ];
then
FUSE3_LIBS+=$LIBS
echo "${FUSE3_LIBS}"
else
FUSE_LIBS+=" ${LIBS}"
fi
LIBS=
# check for some BOOST libraries
AX_BOOST_BASE([1.54],, [
AC_MSG_ERROR([
The Echo Filesystem NG needs BOOST >= 1.54, but it was not found in your system
])
])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_ASIO
AX_BOOST_THREAD
# check for the presence of libyaml-cpp
PKG_CHECK_MODULES([LIBYAMLCPP], [yaml-cpp >= 0.5.1],,
AC_MSG_ERROR([libyaml-cpp 0.5.1 or newer not found.])
)
# check for the presence of the NVML libraries
PKG_CHECK_MODULES([LIBPMEM], [libpmem >= 1.1],,
AC_MSG_ERROR(libpmem 1.1 or newer not found.)
)
PKG_CHECK_MODULES([LIBPMEMOBJ], [libpmemobj >= 1.1],,
AC_MSG_ERROR(libpmemobj 1.1 or newer not found.)
)
# check for protobuf-c
PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c >= 1.0.0])
AC_CHECK_PROG([PROTOC_C], [protoc-c], [protoc-c])
AS_IF([test "x${PROTOC_C}" == "x"],
[AC_MSG_ERROR([ProtoBuf C compiler "protoc-c" not found.])])
# check for protobuf
PKG_CHECK_MODULES([PROTOBUF], [protobuf >= 2.5.0])
AC_CHECK_PROG([PROTOC], [protoc], [protoc])
AS_IF([test "x${PROTOC}" == "x"],
[AC_MSG_ERROR([ProtoBuf compiler "protoc" not found.])])
## check if documentation should be built and if we have the appropriate
## programs to do so
AC_ARG_ENABLE([docs],
[AS_HELP_STRING([--enable-docs], [Generate docs during build.])],
[enable_docs=$enableval],
[enable_docs=no]
)
AS_IF([test "x$enable_docs" = "xyes"],
[
AC_PATH_PROG([DOXYGEN], [doxygen])
AS_IF([test -z "$DOXYGEN"], [AC_MSG_ERROR([doxygen not found])])
AC_PATH_PROG([SPHINX], [sphinx-build])
AS_IF([test -z "$SPHINX"], [AC_MSG_ERROR([sphinx-build not found])])
]
)
AM_CONDITIONAL([BUILD_DOCS], [test "$enable_docs" = yes])
# for the POSIX compliance tests we need the tests definitions in
# the build hierarchy. This is the easiest way
AC_CONFIG_COMMANDS([posix-test-dependencies],
[cp -pR "$srcdir"/tests/posix-compliance/tests tests/posix-compliance/])
# likewise for consistency tests
AC_CONFIG_COMMANDS([consistency-tests-dependencies],
[cp -pR "$srcdir"/tests/consistency tests/])
# automatically find all consistency tests and put them in appropriate variables
# that can be easily used from Makefile.am
if test -d "$srcdir"/tests/consistency; then
EFSNG_READ_TESTS=`cd ${srcdir}/tests/consistency/ && find read -name '*.test' -print0 | sort -z | xargs -0`
AC_SUBST([EFSNG_READ_TESTS])
EFSNG_WRITE_TESTS=`cd ${srcdir}/tests/consistency/ && find write -name '*.test' -print0 | sort -z | xargs -0`
AC_SUBST([EFSNG_WRITE_TESTS])
fi
AC_CONFIG_FILES([
Makefile
doc/Makefile
examples/Makefile
examples/api/Makefile
lib/Makefile
tests/Makefile
tests/library/Makefile
tests/posix-compliance/Makefile
tests/consistency/Makefile
tests/unit/Makefile
])
AC_OUTPUT