-
Notifications
You must be signed in to change notification settings - Fork 60
/
configure.ac
180 lines (153 loc) · 5.33 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
m4_define([version_major], [0])
m4_define([version_minor], [8])
m4_define([version_micro], [0])
m4_define([version_micro_extra], version_micro)
m4_append([version_micro_extra], [])
AC_INIT([riofs], [version_major.version_minor.version_micro_extra], [paul.ionkin@gmail.com], , [https://github.com/skoobe/riofs])
AC_PREREQ(2.61)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip subdir-objects no-dependencies])
AC_DEFINE(VERSION_MAJOR, version_major, [RioFS major version])
AC_DEFINE(VERSION_MINOR, version_minor, [RioFS minor version])
AC_DEFINE(VERSION_MICRO, version_micro, [RioFS micro version])
AC_CONFIG_HEADERS([include/config.h])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_RANLIB
PKG_PROG_PKG_CONFIG
AC_CHECK_SIZEOF(long int)
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_TYPE_OFF_T
AC_STRUCT_TM
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
PKG_CHECK_MODULES([DEPS], [glib-2.0 >= 2.22 fuse >= 2.7.3 libxml-2.0 >= 2.6 libcrypto >= 0.9])
AC_ARG_WITH(libevent,
AS_HELP_STRING(--with-libevent=PATH, base of libevent2 installation),
[
case $with_libevent in
no)
AC_MSG_ERROR([Please specify libevent2 installation path])
;;
yes)
PKG_CHECK_MODULES([LEDEPS], [libevent >= 2.0])
;;
*)
CFLAGS="-I$with_libevent/include"
LDFLAGS="-L$with_libevent/lib -levent"
AC_CHECK_HEADERS(event2/event.h, [],
AC_MSG_ERROR([libevent2 headers not found or not usable])
)
AC_CHECK_LIB(event, [main], [],
AC_MSG_ERROR([Could not find libevent2])
)
LEDEPS_CFLAGS="-I$with_libevent/include"
LEDEPS_LIBS="-L$with_libevent/lib -levent"
;;
esac
],
[
PKG_CHECK_MODULES([LEDEPS], [libevent >= 2.0])
]
)
# check if we should link against libevent_openssl
AC_ARG_ENABLE(openssl,
AS_HELP_STRING(--disable-openssl, disable support for openssl encryption (libevent_openssl must be installed)),
[], [enable_openssl=yes]
)
if test "x$enable_openssl" = "xyes" ; then
# check if openssl is present
AC_CHECK_LIB([ssl],[SSL_library_init],, AC_CHECK_LIB([ssl],[OPENSSL_init_ssl],, AC_MSG_ERROR([OpenSSL developer library 'libssl-dev' or 'openssl-devel' not installed])))
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.1.2], [found_libevent_openssl=yes], [found_libevent_openssl=no])
if test "x$found_libevent_openssl" = "xyes" ; then
AC_DEFINE([SSL_ENABLED], [1], [Define to 1 if SSL support is enabled])
fi
fi
#AC_MSG_CHECKING(for libmagic)
libmagic=false
AC_ARG_WITH(libmagic,
AS_HELP_STRING(--with-libmagic=PATH, base of libmagic installation),
[AC_MSG_RESULT($with_libmagic)
case $with_libmagic in
no)
libmagic=false
;;
yes)
AC_CHECK_HEADERS([magic.h],, [
AC_MSG_ERROR([magic.h header not found or not usable])
])
AC_CHECK_LIB(magic, [magic_open], [MAGIC_LIBS="-lmagic"],[
AC_MSG_ERROR([Could not find libmagic])
])
libmagic=true
;;
*)
# set temp variables
LDFLAGS="-L$with_libmagic/lib $LDFLAGS"
CFLAGS="-I$with_libmagic/include $CFLAGS"
AC_CHECK_HEADERS(magic.h,
EXT_LIB_PATH="-L$with_libmagic/lib $EXT_LIB_PATH"
MAGIC_CFLAGS="-L$with_libmagic/lib"
MAGIC_LDFLAGS="-I$with_libmagic/include",
AC_MSG_ERROR([magic.h header not found or not usable])
)
AC_CHECK_LIB(magic, [magic_open], [MAGIC_LIBS="-lmagic"],[
AC_MSG_ERROR([Could not find libmagic])
])
libmagic=true
#restore
LDFLAGS=$SAVE_LDFLAGS
CFLAGS=$SAVE_CFLAGS
;;
esac
],
[
libmagic=true
AC_CHECK_HEADERS([magic.h],, [
libmagic=false
])
AC_CHECK_LIB(magic, [magic_open], [MAGIC_LIBS="-lmagic"],[
libmagic=false
])
])
AC_SUBST(MAGIC_CFLAGS)
AC_SUBST(MAGIC_LDFLAGS)
AC_SUBST(MAGIC_LIBS)
if test "x$libmagic" = "xtrue" ; then
AC_DEFINE(MAGIC_ENABLED, [1], [Define to use libmagic])
fi
AX_EXECINFO()
# check if we need to build test applications
AC_MSG_CHECKING([if building example applications])
AC_ARG_ENABLE([test-apps],
AS_HELP_STRING(--enable-test-apps, build test applications),
[], [enable_test_apps=no]
)
AM_CONDITIONAL([BUILD_TEST_APPS], [test "$enable_test_apps" = "yes"])
AC_MSG_RESULT([$enable_test_apps])
AC_DEFINE(FUSE_USE_VERSION, 26, [Fuse API Version])
# check if we should enable strict compile warnings
AC_ARG_ENABLE(strict-compile,
AS_HELP_STRING(--enable-strict-compile, enable support for strict compiler warnings),
[], [enable_strict_compile=no]
)
if test "x$enable_strict_compile" = "xyes" ; then
CFLAGS="$CFLAGS -Wextra -pedantic -Wall"
fi
# check if we should enable verbose debugging
AC_ARG_ENABLE(debug,
AS_HELP_STRING(--enable-debug, enable support for running in debug mode),
[], [enable_debug=no]
)
if test "x$enable_debug" = "xyes" ; then
CFLAGS="$CFLAGS -Wall -Wextra -O0 -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-default -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs -Wstrict-overflow=5 -Wformat=2 -Wunreachable-code -Wfloat-equal -ffloat-store -g -ggdb3"
fi
AC_CONFIG_FILES(Makefile src/Makefile include/Makefile tests/Makefile)
AC_OUTPUT