-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathconfigure.ac
188 lines (163 loc) · 4.2 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
##
# 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
AC_REQUIRE_AUX_FILE([tap-driver.sh])
X_AC_EXPAND_INSTALL_DIRS
##
# Automake support
##
AM_INIT_AUTOMAKE([subdir-objects foreign])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config/config.h])
AM_MAINTAINER_MODE([enable])
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
AX_COMPILER_VENDOR
AS_CASE($ax_cv_c_compiler_vendor,
[gnu], [
WARNING_CFLAGS="-Wall -Werror"
],
[clang], [
WARNING_CFLAGS="-Wall -Werror -Wno-unknown-warning-option -Wno-error=unknown-warning-option"
]
)
AC_SUBST([WARNING_CFLAGS])
AC_PROG_RANLIB
##
# Checks for pkg.m4 from pkgconf package
##
m4_ifndef([PKG_PROG_PKG_CONFIG],
[AC_MSG_ERROR([PKG_PROG_PKG_CONFIG not found, please install pkgconf package before configuring.])])
##
# Initialize pkg-config for PKG_CHECK_MODULES to avoid conditional issues
##
PKG_PROG_PKG_CONFIG
##
# Checks for ncurses
##
PKG_CHECK_MODULES([ncurses], [ncurses])
##
# Checks for header files.
##
AC_CHECK_HEADERS( \
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( \
utimensat \
)
AC_FUNC_STRERROR_R
X_AC_CHECK_PTHREADS
X_AC_TCMALLOC
X_AC_RDMA
##
# 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])])
AC_ARG_ENABLE([multiuser],
[AS_HELP_STRING([--disable-multiuser], [build without multi-user support])])
AC_ARG_ENABLE([auth],
[AS_HELP_STRING([--disable-auth], [build without authentication support])])
AC_ARG_WITH([ganesha-kmod],
[AS_HELP_STRING([--with-ganesha-kmod], [use nfs-ganesha-kmod syscalls for multi-user])])
AS_IF([test "x$with_ganesha_kmod" = "xyes"], [
AC_DEFINE([USE_GANESHA_KMOD], [1], [Use nfs-ganesha-kmod syscalls])
])
AS_IF([test "x$enable_auth" != "xno"], [
PKG_CHECK_MODULES([MUNGE], [munge], [], [
AC_MSG_ERROR([Install munge or configure with --disable-auth])
])
AC_DEFINE([AUTH], [1], [Support MUNGE authentication])
])
AS_IF([test "x$enable_multiuser" != "xno"], [
PKG_CHECK_MODULES([CAP], [libcap], [], [
AC_MSG_ERROR([Install libcap or configure with --disable-multiuser])
])
AC_DEFINE([MULTIUSER], [1], [service files to multiple users])
])
AC_ARG_ENABLE([config],
[AS_HELP_STRING([--disable-config], [disable lua config file support])])
AS_IF([test "x$enable_config" != "xno"], [
AX_PROG_LUA([5.1],[5.5])
AX_LUA_HEADERS([],[
AC_MSG_ERROR([Install lua headers or configure with --disable-config])
])
AX_LUA_LIBS([],[
AC_MSG_ERROR([Install lua libs or configure with --disable-config])
])
AC_DEFINE([HAVE_CONFIG_FILE], [1], [lua config file support])
])
AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" != "xno"])
AM_CONDITIONAL([MULTIUSER], [test "x${enable_multiuser}" != "xno"])
AM_CONDITIONAL([USE_GANESHA_KMOD], [test "x${with_ganesha_kmod}" = "xyes"])
##
# Check for systemd
##
RRA_WITH_SYSTEMD_UNITDIR
##
# Epilogue
##
AC_CONFIG_FILES( \
Makefile \
diod.spec \
src/libtap/Makefile \
src/libtest/Makefile \
src/libdiod/Makefile \
src/liblsd/Makefile \
src/libnpfs/Makefile \
src/libnpclient/Makefile \
man/Makefile \
man/diod.8 \
man/diodmount.8 \
man/diodcat.8 \
man/dtop.8 \
man/diodload.8 \
man/diodls.8 \
man/diodshowmount.8 \
man/dioddate.8 \
man/diod.conf.5 \
etc/diod.service \
etc/auto.diod \
src/cmd/Makefile \
src/Makefile \
tests/Makefile \
tests/misc/Makefile \
tests/kern/Makefile \
tests/kern/fstest/Makefile \
tests/kern/postmark/Makefile \
tests/kern/fsx/Makefile \
tests/kern/fsstress/Makefile \
tests/user/Makefile \
etc/Makefile \
)
AC_OUTPUT