-
Notifications
You must be signed in to change notification settings - Fork 21
/
configure.ac
280 lines (236 loc) · 8.99 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
dnl Process this file with autoconf to produce a configure script.
dnl autoconf 2.5 stuff
AC_PREREQ(2.50)
AC_INIT(Coda, 8.1.6~dev, [bugs@coda.cs.cmu.edu])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([coda-src/librepair/resolve.h])
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz])
AC_CONFIG_HEADERS([config.h])
CODA_RELEASE=`echo $PACKAGE_VERSION | cut -d. -f1`
AC_SUBST([CODA_RELEASE], $CODA_RELEASE, [Coda release from package version])
CONFIG_DATE=`date +"%a, %d %b %Y %T %z"`
AC_SUBST(CONFIG_DATE, "$CONFIG_DATE", [Date when configure was last run])
dnl For some reason the default prefix was set to NONE on Solaris.
AC_PREFIX_DEFAULT([/usr])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
dnl Load the CODA_ tests.
m4_include(configs/coda_macros.m4)
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_CHECK_PROGS([PRE_COMMIT], [pre-commit])
CLANG_FORMAT_VERSION=['6\.[0-9]*\.[0-9]*']
AC_CHECK_PROGS([CLANG_FORMAT], [clang-format-6.0 clang-format])
dnl Verify that the version matches in case clang-format is found
if test "x$CLANG_FORMAT" != x ; then
if ${CLANG_FORMAT} --version | grep -vq ${CLANG_FORMAT_VERSION} ; then
CLANG_FORMAT=""
fi
fi
dnl Now we can derive things like systype/cputype
m4_include(configs/codaconf.m4)
AC_PATH_PROG(PERL, perl, "")
AC_PATH_PROG(FLUID, fluid, "")
AM_PATH_PYTHON([3])
# Derive a valid version for codafs Python module
CODAFS_PY_VERSION="`echo $VERSION|sed 's/~dev/.dev0/'`"
AC_SUBST(CODAFS_PY_VERSION)
# Debian installs python packages in a non-standard location
AM_CONDITIONAL([DEBIAN_DERIVED], [test -d "${prefix}/lib/python3/dist-packages"])
AM_COND_IF([DEBIAN_DERIVED], [pythondir="${prefix}/lib/python3/dist-packages"])
AC_ARG_ENABLE(client, [ --enable-client build Coda client components],
buildclient="$enableval", buildclient="no")
AC_ARG_ENABLE(server, [ --enable-server build Coda server components],
buildserver="$enableval", buildserver="no")
AC_ARG_ENABLE(venus, [ --enable-client-only build only Coda client],
buildvenus="$enableval", buildvenus="no")
AC_ARG_ENABLE(vcodacon, [ --enable-vcodacon build graphical Coda console],
buildvcodacon="$enableval", buildvcodacon="no")
AC_ARG_ENABLE(unit_test, [ --disable-unit-test run unit tests],
run_unit="$enableval", run_unit="yes")
AC_ARG_ENABLE(coda_timespec, [ --disable-coda-timespec build client for old Coda kernel module on 32-bit],
coda_timespec="$enableval", coda_timespec="yes")
if test "x$coda_timespec" != xyes ; then
AC_DEFINE([NO_64BIT_TIMESPEC], [1], [Define to use long for time_t in coda.h])
fi
dnl Make sure we configure any sub-projects before checking with pkg-config
test -f "${srcdir}/lib-src/lwp/configure.ac" && AC_CONFIG_SUBDIRS([lib-src/lwp])
test -f "${srcdir}/lib-src/rpc2/configure.ac" && AC_CONFIG_SUBDIRS([lib-src/rpc2])
test -f "${srcdir}/lib-src/rvm/configure.ac" && AC_CONFIG_SUBDIRS([lib-src/rvm])
CODA_CONFIG_SUBDIRS
dnl pkg-config stuff
CODA_PKG_CONFIG
PKG_CHECK_MODULES([RVM_RPC2], [rvmlwp rpc2])
PKG_CHECK_MODULES([LWP], [lwp >= 2.11])
PKG_CHECK_MODULES([RPC2], [rpc2 >= 2.28])
PKG_CHECK_MODULES([RVM], [rvmlwp])
RP2GEN="`pkg-config --variable=RP2GEN rpc2`"
AC_SUBST(RP2GEN)
RVMUTL="`pkg-config --variable=RVMUTL rvmlwp`"
RDSINIT="`pkg-config --variable=RDSINIT rvmlwp`"
AC_SUBST(RVMUTL)
AC_SUBST(RDSINIT)
dnl Checks for libraries.
AC_SEARCH_LIBS(bind, socket)
AC_SEARCH_LIBS(inet_ntoa, nsl)
AC_SEARCH_LIBS(gethostbyname, resolv)
AC_SEARCH_LIBS(res_search, resolv)
AC_SEARCH_LIBS(__res_search, resolv)
AC_SEARCH_LIBS(res_9_init, resolv)
AC_SEARCH_LIBS(kvm_openfiles, kvm)
AC_CHECK_PROG([HAVE_VALGRIND_BIN], [valgrind], [1])
CODA_CHECK_LIBTERMCAP
CODA_CHECK_LIBCURSES
CODA_CHECK_READLINE
CODA_CHECK_FLTK
SYSTEMD_CHECKS
dnl Checks for header files.
AC_CHECK_HEADERS(search.h sys/resource.h sys/stream.h ncurses.h netdb.h)
AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/param.h sys/vfs.h fts.h)
AC_CHECK_HEADERS(sys/types.h sys/time.h sys/select.h sys/socket.h sys/ioccom.h)
AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h netinet/in.h osreldate.h)
AC_CHECK_HEADERS(ncurses/ncurses.h byteswap.h sys/bswap.h sys/endian.h)
AC_CHECK_HEADERS(ucred.h execinfo.h sys/random.h)
AC_CHECK_HEADERS(sys/un.h resolv.h, [], [],
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif])
AC_CHECK_HEADERS(sys/mount.h, [], [],
[#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif])
dnl Checks for typedefs.
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_CHECK_TYPES([socklen_t, struct in6_addr, struct sockaddr_in6],,,
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AC_CHECK_TYPES([ns_type, ns_class],,, [#include <arpa/nameser.h>])
dnl Checks for structures.
dnl Checks for compiler characteristics.
CODA_CC_FEATURE_TEST([Wall], wall)
CODA_CC_FEATURE_TEST([Wthread-safety], wthreadsafety)
CODA_CC_FEATURE_TEST([fno-exceptions], fnoexceptions)
CODA_CC_FEATURE_TEST([rdynamic], rdynamic)
CODA_CXX_FEATURE_TEST([Wall], wall)
CODA_CXX_FEATURE_TEST([Wthread-safety], wthreadsafety)
CODA_CXX_FEATURE_TEST([fno-exceptions], fnoexceptions)
CODA_CXX_FEATURE_TEST([fcheck-new], fchecknew)
CODA_CXX_FEATURE_TEST([rdynamic], rdynamic)
CODA_CHECK_OFFSETOF
dnl Checks for library functions.
AC_CHECK_FUNCS(inet_aton inet_ntoa res_search pread fseeko nmount)
AC_CHECK_FUNCS(select setenv snprintf statfs strerror strtol)
AC_CHECK_FUNCS(getpeereid getpeerucred backtrace __res_search)
AC_CHECK_FUNCS(getrandom clock_gettime)
dnl AC_FUNC_MMAP checks if mmap exists and works, but that fails
dnl when we run configure on file systems that do not support mmap
AC_CHECK_FUNCS(mmap)
AC_FUNC_SELECT_ARGTYPES
CODA_CHECK_FILE_LOCKING
dnl Checks for system services.
AC_SUBST(shortsys)
dnl Build conditionals
if test "$buildvcodacon" != no ; then
test -z "${FLUID}" && AC_MSG_ERROR("Unable to find fltk-fluid")
test "$coda_cv_path_fltk" = none && AC_MSG_ERROR("Unable to find libfltk")
fi
AM_CONDITIONAL(BUILD_VCODACON, [test "$buildvcodacon" != no])
if test "$buildclient" = no -a "$buildserver" = no -a "$buildvenus" = no ; then
buildclient=yes
buildserver=yes
fi
AM_CONDITIONAL(BUILD_CLIENT, [test "$buildclient" != no])
AM_CONDITIONAL(BUILD_SERVER, [test "$buildserver" != no])
AM_CONDITIONAL(BUILD_VENUS, [test "$buildclient" != no -o "$buildvenus" != no])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
AM_CONDITIONAL([WANT_FTS], [test "$ac_cv_header_fts_h" = no])
AM_CONDITIONAL(HAVE_VALGRIND, [test "$HAVE_VALGRIND_BIN" == "1"])
AM_CONDITIONAL(RUN_UNIT, [test "$run_unit" != no -a -f "${srcdir}/external-src/googletest/googletest/Makefile.am"])
dnl Needed for googletest/googletest/Makefile.am
AM_CONDITIONAL(HAVE_PTHREADS, [false])
dnl If Valgrind isn't installed notify the user
AM_COND_IF(HAVE_VALGRIND,, [
AM_COND_IF(RUN_UNIT, [
AC_MSG_WARN([Valgrind missing, please install it before running memcheck])]
)]
)
AC_CONFIG_FILES([coda-src/scripts/bldvldb.sh],
[chmod +x coda-src/scripts/bldvldb.sh])
AC_CONFIG_FILES([coda-src/scripts/createvol_rep],
[chmod +x coda-src/scripts/createvol_rep])
AC_CONFIG_FILES([coda-src/scripts/purgevol_rep],
[chmod +x coda-src/scripts/purgevol_rep])
AC_CONFIG_FILES([coda-src/scripts/startserver],
[chmod +x coda-src/scripts/startserver])
AC_CONFIG_FILES([coda-src/scripts/coda-client-setup],
[chmod +x coda-src/scripts/coda-client-setup])
AC_CONFIG_FILES([coda-src/scripts/vice-setup],
[chmod +x coda-src/scripts/vice-setup])
AC_CONFIG_FILES([coda-src/scripts/vice-setup-rvm],
[chmod +x coda-src/scripts/vice-setup-rvm])
AC_CONFIG_FILES([coda-src/scripts/vice-setup-scm],
[chmod +x coda-src/scripts/vice-setup-scm])
AC_CONFIG_FILES([coda-src/scripts/vice-setup-srvdir],
[chmod +x coda-src/scripts/vice-setup-srvdir])
AC_CONFIG_FILES([coda-src/scripts/vice-setup-user],
[chmod +x coda-src/scripts/vice-setup-user])
AC_CONFIG_FILES([coda-src/vtools/gcodacon],
[chmod +x coda-src/vtools/gcodacon])
AC_CONFIG_FILES([tools/check-blurb],
[chmod +x tools/check-blurb])
AC_CONFIG_FILES([
Makefile
coda_config.h
configs/Makefile
tools/Makefile
lib-src/Makefile
lib-src/base/Makefile
lib-src/rwcdb/Makefile
coda-src/Makefile
coda-src/scripts/Makefile
coda-src/kerndep/Makefile
coda-src/partition/Makefile
coda-src/dir/Makefile
coda-src/util/Makefile
coda-src/al/Makefile
coda-src/vicedep/Makefile
coda-src/auth2/Makefile
coda-src/vv/Makefile
coda-src/lka/Makefile
coda-src/vol/Makefile
coda-src/librepair/Makefile
coda-src/venus/Makefile
coda-src/repair/Makefile
coda-src/resolution/Makefile
coda-src/volutil/Makefile
coda-src/vtools/Makefile
coda-src/vice/Makefile
coda-src/update/Makefile
coda-src/norton/Makefile
coda-src/asr/Makefile
coda-src/egasr/Makefile
coda-src/asrlauncher/Makefile
coda-src/vcodacon/Makefile
coda-src/smon2/Makefile
python/Makefile
python/codafs/__init__.py
test-src/Makefile
test-src/unit/Makefile])
CODA_SOFT_CONFIG_SUBDIR([external-src/googletest/googletest], [--with-pthreads=no])
AC_OUTPUT