forked from chaos/diod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
222 lines (207 loc) · 4.59 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
##
# Prologue
##
AC_INIT([diod],
m4_esyscmd([git describe --always | awk '/.*/ {sub(/^v/, ""); printf "%s",$1; exit}']))
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_SRCDIR([NEWS])
AC_CANONICAL_HOST
X_AC_EXPAND_INSTALL_DIRS
##
# Automake support
##
AM_INIT_AUTOMAKE([subdir-objects]
m4_esyscmd([case `automake --version | head -n 1` in
*1.11*);;
*) echo serial-tests;;
esac]))
AM_SILENT_RULES([yes])
AM_CONFIG_HEADER([config/config.h])
AM_MAINTAINER_MODE
AC_DEFINE([_GNU_SOURCE], 1,
[Define _GNU_SOURCE so that we get all necessary prototypes])
##
# Checks for programs
##
AC_PROG_CC
AM_PROG_CC_C_O
if test "$GCC" = yes; then
GCCWARN="-Wall"
AC_SUBST([GCCWARN])
fi
AC_PROG_RANLIB
# dbench is conditionally compiled for 'make check'
DBENCH
##
# Checks for header files.
##
AC_HEADER_STDC
AC_CHECK_HEADERS( \
getopt.h \
pthread.h \
sys/prctl.h \
sys/statfs.h \
sys/sysmacros.h \
sys/xattr.h \
)
##
# Checks for typedefs, structures, and compiler characteristics
##
AC_C_BIGENDIAN
AC_C_CONST
##
# Checks for library functions
##
AC_CHECK_FUNCS( \
getopt_long \
vsnprintf \
vsscanf \
utimensat \
)
AC_FUNC_STRERROR_R
X_AC_CHECK_PTHREADS
X_AC_WRAP
X_AC_CURSES
X_AC_CHECK_COND_LIB(munge, munge_ctx_create)
X_AC_CHECK_COND_LIB(cap, cap_get_proc)
X_AC_TCMALLOC
AX_LUA_HEADERS
AX_LUA_HEADERS(501)
AX_LUA_LIBS
X_AC_RDMATRANS
##
# For list.c, hostlist.c, hash.c
##
AC_DEFINE(WITH_LSD_FATAL_ERROR_FUNC, 1, [Define lsd_fatal_error])
AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1, [Define lsd_nomem_error])
AC_DEFINE(WITH_PTHREADS, 1, [Make liblsd thread safe])
AC_SYS_LARGEFILE
##
# Optional features
##
AC_ARG_ENABLE([diodmount],
[AS_HELP_STRING([--disable-diodmount], [do not build diodmount])],
[],
[enable_diodmount=auto])
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--disable-tests], [do not build tests])],
[],
[enable_tests=auto])
AC_ARG_ENABLE([impersonation],
[AS_HELP_STRING([--enable-impersonation], [allow access=user])],
[],
[enable_impersonation=auto])
case "${host_os}" in
linux*)
case "${enable_diodmount}" in
no)
;;
*)
enable_diodmount=yes;;
esac
case "${enable_tests}" in
no)
;;
*)
enable_tests=yes;;
esac
case "${enable_impersonation}" in
no)
;;
yes|linux|auto)
enable_impersonation=linux;;
*)
AC_MSG_FAILURE([unsupported impersonation model]);;
esac
;;
freebsd*)
case "${enable_diodmount}" in
yes)
;;
*)
enable_diodmount=no;;
esac
case "${enable_tests}" in
yes)
;;
*)
enable_tests=no;;
esac
case "${enable_impersonation}" in
no|auto)
enable_impersonation=no;;
yes|ganesha)
enable_impersonation=ganesha;;
*)
AC_MSG_FAILURE([unsupported impersonation model]);;
esac
;;
*)
case "${enable_diodmount}" in
yes)
;;
*)
enable_diodmount=no;;
esac
case "${enable_tests}" in
yes)
;;
*)
enable_tests=no;;
esac
case "${enable_impersonation}" in
no|auto)
enable_impersonation=no;;
*)
AC_MSG_FAILURE([unsupported impersonation model]);;
esac
;;
esac
AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" = "xyes"])
AM_CONDITIONAL([ENABLE_TESTS], [test "x${enable_tests}" = "xyes"])
AM_CONDITIONAL([USE_IMPERSONATION_LINUX], [test "x${enable_impersonation}" = "xlinux"])
AM_CONDITIONAL([USE_IMPERSONATION_GANESHA], [test "x${enable_impersonation}" = "xganesha"])
if test "x${enable_impersonation}" = "xlinux"; then
AC_DEFINE([USE_IMPERSONATION_LINUX], [1], [Use Linux setfsuid])
fi
if test "x${enable_impersonation}" = "xganesha"; then
AC_DEFINE([USE_IMPERSONATION_GANESHA], [1], [Use nfs-ganesha-kmod syscalls])
fi
##
# Epilogue
##
AC_CONFIG_FILES( \
Makefile \
diod.spec \
libdiod/Makefile \
liblsd/Makefile \
libnpfs/Makefile \
libnpclient/Makefile \
diod/diod.8 \
utils/diodmount.8 \
utils/diodcat.8 \
utils/dtop.8 \
utils/diodload.8 \
utils/diodls.8 \
utils/diodshowmount.8 \
utils/dioddate.8 \
etc/diod.conf.5 \
scripts/Makefile \
scripts/diod.init \
scripts/auto.diod \
scripts/diod.service \
diod/Makefile \
utils/Makefile \
tests/Makefile \
tests/misc/Makefile \
tests/kern/Makefile \
tests/kern/fstest/Makefile \
tests/kern/dbench/Makefile \
tests/kern/postmark/Makefile \
tests/kern/fsx/Makefile \
tests/kern/fsstress/Makefile \
tests/user/Makefile \
etc/Makefile \
)
AC_OUTPUT