glusterfs

Форк
0
/
configure.ac 
1948 строк · 68.3 Кб
1
dnl  Copyright (c) 2006-2016 Red Hat, Inc. <http://www.redhat.com>
2
dnl  This file is part of GlusterFS.
3
dnl
4
dnl  This file is licensed to you under your choice of the GNU Lesser
5
dnl  General Public License, version 3 or any later version (LGPLv3 or
6
dnl  later), or the GNU General Public License, version 2 (GPLv2), in all
7
dnl  cases as published by the Free Software Foundation.
8

9
// clang-format off
10
AC_INIT([glusterfs],[m4_esyscmd([build-aux/pkg-version --version])],[gluster-users@gluster.org],[],[https://github.com/gluster/glusterfs.git])
11

12
AC_SUBST([PACKAGE_RELEASE],
13
         [m4_esyscmd([build-aux/pkg-version --release])])
14

15
AM_INIT_AUTOMAKE([tar-pax foreign])
16

17
# Removes warnings when using automake 1.14 around (...but option 'subdir-objects' is disabled )
18
#but libglusterfs fails to build with contrib (Then are not set up that way?)
19
#AM_INIT_AUTOMAKE([subdir-objects])
20

21
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
22

23
AC_CONFIG_HEADERS([config.h site.h])
24

25
AC_CONFIG_FILES([Makefile
26
                libglusterfs/Makefile
27
                libglusterfs/src/Makefile
28
                geo-replication/src/peer_gsec_create
29
                geo-replication/src/peer_mountbroker
30
                geo-replication/src/peer_mountbroker.py
31
                geo-replication/src/peer_georep-sshkey.py
32
                extras/peer_add_secret_pub
33
                geo-replication/syncdaemon/conf.py
34
                geo-replication/gsyncd.conf
35
                extras/snap_scheduler/conf.py
36
                glusterfsd/Makefile
37
                glusterfsd/src/Makefile
38
                rpc/Makefile
39
                rpc/rpc-lib/Makefile
40
                rpc/rpc-lib/src/Makefile
41
                rpc/rpc-transport/Makefile
42
                rpc/rpc-transport/socket/Makefile
43
                rpc/rpc-transport/socket/src/Makefile
44
                rpc/xdr/Makefile
45
                rpc/xdr/src/Makefile
46
                xlators/Makefile
47
                xlators/meta/Makefile
48
                xlators/meta/src/Makefile
49
                xlators/mount/Makefile
50
                xlators/mount/fuse/Makefile
51
                xlators/mount/fuse/src/Makefile
52
                xlators/mount/fuse/utils/mount.glusterfs
53
                xlators/mount/fuse/utils/mount_glusterfs
54
                xlators/mount/fuse/utils/Makefile
55
                xlators/storage/Makefile
56
                xlators/storage/posix/Makefile
57
                xlators/storage/posix/src/Makefile
58
                xlators/cluster/Makefile
59
                xlators/cluster/afr/Makefile
60
                xlators/cluster/afr/src/Makefile
61
                xlators/cluster/dht/Makefile
62
                xlators/cluster/dht/src/Makefile
63
                xlators/cluster/ec/Makefile
64
                xlators/cluster/ec/src/Makefile
65
                xlators/performance/Makefile
66
                xlators/performance/write-behind/Makefile
67
                xlators/performance/write-behind/src/Makefile
68
                xlators/performance/read-ahead/Makefile
69
                xlators/performance/read-ahead/src/Makefile
70
                xlators/performance/readdir-ahead/Makefile
71
                xlators/performance/readdir-ahead/src/Makefile
72
                xlators/performance/io-threads/Makefile
73
                xlators/performance/io-threads/src/Makefile
74
                xlators/performance/io-cache/Makefile
75
                xlators/performance/io-cache/src/Makefile
76
                xlators/performance/quick-read/Makefile
77
                xlators/performance/quick-read/src/Makefile
78
                xlators/performance/open-behind/Makefile
79
                xlators/performance/open-behind/src/Makefile
80
                xlators/performance/md-cache/Makefile
81
                xlators/performance/md-cache/src/Makefile
82
                xlators/performance/nl-cache/Makefile
83
                xlators/performance/nl-cache/src/Makefile
84
                xlators/debug/Makefile
85
                xlators/debug/sink/Makefile
86
                xlators/debug/sink/src/Makefile
87
                xlators/debug/trace/Makefile
88
                xlators/debug/trace/src/Makefile
89
                xlators/debug/error-gen/Makefile
90
                xlators/debug/error-gen/src/Makefile
91
                xlators/debug/delay-gen/Makefile
92
                xlators/debug/delay-gen/src/Makefile
93
                xlators/debug/io-stats/Makefile
94
                xlators/debug/io-stats/src/Makefile
95
                xlators/protocol/Makefile
96
                xlators/protocol/auth/Makefile
97
                xlators/protocol/auth/addr/Makefile
98
                xlators/protocol/auth/addr/src/Makefile
99
                xlators/protocol/auth/login/Makefile
100
                xlators/protocol/auth/login/src/Makefile
101
                xlators/protocol/client/Makefile
102
                xlators/protocol/client/src/Makefile
103
                xlators/protocol/server/Makefile
104
                xlators/protocol/server/src/Makefile
105
                xlators/features/Makefile
106
                xlators/features/arbiter/Makefile
107
                xlators/features/arbiter/src/Makefile
108
                xlators/features/thin-arbiter/Makefile
109
                xlators/features/thin-arbiter/src/Makefile
110
                xlators/features/changelog/Makefile
111
                xlators/features/changelog/src/Makefile
112
                xlators/features/changelog/lib/Makefile
113
                xlators/features/changelog/lib/src/Makefile
114
                xlators/features/locks/Makefile
115
                xlators/features/locks/src/Makefile
116
                xlators/features/simple-quota/Makefile
117
                xlators/features/simple-quota/src/Makefile
118
                xlators/features/quota/Makefile
119
                xlators/features/quota/src/Makefile
120
                xlators/features/marker/Makefile
121
                xlators/features/marker/src/Makefile
122
                xlators/features/selinux/Makefile
123
                xlators/features/selinux/src/Makefile
124
                xlators/features/sdfs/Makefile
125
                xlators/features/sdfs/src/Makefile
126
                xlators/features/read-only/Makefile
127
                xlators/features/read-only/src/Makefile
128
                xlators/features/compress/Makefile
129
                xlators/features/compress/src/Makefile
130
                xlators/features/namespace/Makefile
131
                xlators/features/namespace/src/Makefile
132
                xlators/features/quiesce/Makefile
133
                xlators/features/quiesce/src/Makefile
134
                xlators/features/barrier/Makefile
135
                xlators/features/barrier/src/Makefile
136
                xlators/features/index/Makefile
137
                xlators/features/index/src/Makefile
138
                xlators/features/gfid-access/Makefile
139
                xlators/features/gfid-access/src/Makefile
140
                xlators/features/trash/Makefile
141
                xlators/features/trash/src/Makefile
142
                xlators/features/snapview-server/Makefile
143
                xlators/features/snapview-server/src/Makefile
144
                xlators/features/snapview-client/Makefile
145
                xlators/features/snapview-client/src/Makefile
146
                xlators/features/upcall/Makefile
147
                xlators/features/upcall/src/Makefile
148
                xlators/features/shard/Makefile
149
                xlators/features/shard/src/Makefile
150
                xlators/features/bit-rot/Makefile
151
                xlators/features/bit-rot/src/Makefile
152
                xlators/features/bit-rot/src/stub/Makefile
153
                xlators/features/bit-rot/src/bitd/Makefile
154
                xlators/features/leases/Makefile
155
                xlators/features/leases/src/Makefile
156
                xlators/features/cloudsync/Makefile
157
                xlators/features/cloudsync/src/Makefile
158
                xlators/features/utime/Makefile
159
                xlators/features/utime/src/Makefile
160
                xlators/features/cloudsync/src/cloudsync-plugins/Makefile
161
                xlators/features/cloudsync/src/cloudsync-plugins/src/Makefile
162
                xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/Makefile
163
                xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/Makefile
164
                xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/Makefile
165
                xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/Makefile
166
                xlators/features/metadisp/Makefile
167
                xlators/features/metadisp/src/Makefile
168
                xlators/playground/Makefile
169
                xlators/playground/template/Makefile
170
                xlators/playground/template/src/Makefile
171
                xlators/system/Makefile
172
                xlators/system/posix-acl/Makefile
173
                xlators/system/posix-acl/src/Makefile
174
                xlators/nfs/Makefile
175
                xlators/nfs/server/Makefile
176
                xlators/nfs/server/src/Makefile
177
                xlators/mgmt/Makefile
178
                xlators/mgmt/glusterd/Makefile
179
                xlators/mgmt/glusterd/src/Makefile
180
                cli/Makefile
181
                cli/src/Makefile
182
                doc/Makefile
183
                extras/Makefile
184
                extras/glusterd.vol
185
                extras/cliutils/Makefile
186
                extras/init.d/Makefile
187
                extras/init.d/glusterd.plist
188
                extras/init.d/glusterd-Debian
189
                extras/init.d/glusterd-Redhat
190
                extras/init.d/glusterd-FreeBSD
191
                extras/init.d/glusterd-SuSE
192
                extras/init.d/glustereventsd-Debian
193
                extras/init.d/glustereventsd-Redhat
194
                extras/init.d/glustereventsd-FreeBSD
195
                extras/ganesha/Makefile
196
                extras/ganesha/config/Makefile
197
                extras/ganesha/scripts/Makefile
198
                extras/ganesha/ocf/Makefile
199
                extras/systemd/Makefile
200
                extras/systemd/glusterd.service
201
                extras/systemd/glustereventsd.service
202
                extras/systemd/glusterfssharedstorage.service
203
                extras/systemd/gluster-ta-volume.service
204
                extras/run-gluster.tmpfiles
205
                extras/benchmarking/Makefile
206
                extras/command-completion/Makefile
207
                extras/hook-scripts/Makefile
208
                extras/ocf/Makefile
209
                extras/ocf/glusterd
210
                extras/ocf/volume
211
                extras/LinuxRPM/Makefile
212
                extras/geo-rep/Makefile
213
                extras/geo-rep/schedule_georep.py
214
                extras/firewalld/Makefile
215
                extras/hook-scripts/add-brick/Makefile
216
                extras/hook-scripts/add-brick/pre/Makefile
217
                extras/hook-scripts/add-brick/post/Makefile
218
                extras/hook-scripts/create/Makefile
219
                extras/hook-scripts/create/post/Makefile
220
                extras/hook-scripts/delete/Makefile
221
                extras/hook-scripts/delete/pre/Makefile
222
                extras/hook-scripts/start/Makefile
223
                extras/hook-scripts/start/post/Makefile
224
                extras/hook-scripts/set/Makefile
225
                extras/hook-scripts/set/post/Makefile
226
                extras/hook-scripts/stop/Makefile
227
                extras/hook-scripts/stop/pre/Makefile
228
                extras/hook-scripts/reset/Makefile
229
                extras/hook-scripts/reset/post/Makefile
230
                extras/hook-scripts/reset/pre/Makefile
231
                extras/python/Makefile
232
                extras/snap_scheduler/Makefile
233
                events/Makefile
234
                events/src/Makefile
235
                events/src/eventsapiconf.py
236
                events/tools/Makefile
237
                contrib/fuse-util/Makefile
238
                contrib/umountd/Makefile
239
                glusterfs-api.pc
240
                libgfchangelog.pc
241
                api/Makefile
242
                api/src/Makefile
243
                api/examples/Makefile
244
                geo-replication/Makefile
245
                geo-replication/src/Makefile
246
                geo-replication/syncdaemon/Makefile
247
                tools/Makefile
248
                tools/gfind_missing_files/Makefile
249
                heal/Makefile
250
                heal/src/Makefile
251
                glusterfs.spec
252
                tools/glusterfind/src/tool.conf
253
                tools/glusterfind/glusterfind
254
                tools/glusterfind/Makefile
255
                tools/glusterfind/src/Makefile
256
                tools/setgfid2path/Makefile
257
                tools/setgfid2path/src/Makefile])
258

259
AC_CANONICAL_HOST
260

261
AC_PROG_CC
262
AC_DISABLE_STATIC
263
LT_INIT
264
AC_SUBST([shrext_cmds])
265

266
AC_CHECK_PROG([RPCGEN], [rpcgen], [yes], [no])
267

268
if test "x$RPCGEN" = "xno"; then
269
   AC_MSG_ERROR([`rpcgen` not found, glusterfs needs `rpcgen` exiting..])
270
fi
271

272
# Force 'char' type to be signed
273
CFLAGS="${CFLAGS} -fsigned-char"
274

275
# Initialize CFLAGS before usage
276
AC_ARG_ENABLE([debug],
277
              AS_HELP_STRING([--enable-debug],[Enable debug build options.]))
278
if test "x$enable_debug" = "xyes"; then
279
        BUILD_DEBUG=yes
280
        GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG"
281
else
282
        BUILD_DEBUG=no
283
fi
284

285
SANITIZER=none
286

287
AC_ARG_ENABLE([asan],
288
              AS_HELP_STRING([--enable-asan],[Enable Address Sanitizer support]))
289
if test "x$enable_asan" = "xyes"; then
290
        SANITIZER=asan
291
        AC_CHECK_LIB([asan], [_init], ,
292
                [AC_MSG_ERROR([--enable-asan requires libasan.so, exiting])])
293
        if test "x$ac_cv_lib_asan__init" = xyes; then
294
                AC_MSG_CHECKING([whether asan API can be used])
295
                saved_CFLAGS=${CFLAGS}
296
                CFLAGS="${CFLAGS} -fsanitize=address"
297
                AC_COMPILE_IFELSE(
298
                [AC_LANG_PROGRAM([
299
                   [#include <sanitizer/common_interface_defs.h>]],
300
                   [[__sanitizer_finish_switch_fiber(0, 0, 0)]])],
301
                   [ASAN_API=yes], [ASAN_API=no])
302
                AC_MSG_RESULT([$ASAN_API])
303
                if test x$ASAN_API = "xyes"; then
304
                   AC_DEFINE(HAVE_ASAN_API, 1, [Define if asan API can be used.])
305
                fi
306
                CFLAGS=${saved_CFLAGS}
307
        fi
308
        GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=address -fno-omit-frame-pointer"
309

310
        dnl See: https://groups.google.com/d/msg/address-sanitizer/SD590XDinfQ/NMUPj_G0BgAJ
311
        GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=address"
312
fi
313

314
AC_ARG_ENABLE([tsan],
315
              AS_HELP_STRING([--enable-tsan],[Enable Thread Sanitizer support]))
316
if test "x$enable_tsan" = "xyes"; then
317
        if test "x$SANITIZER" != "xnone"; then
318
                AC_MSG_ERROR([only one sanitizer can be enabled at once])
319
        fi
320
        SANITIZER=tsan
321
        AC_CHECK_LIB([tsan], [_init], ,
322
                [AC_MSG_ERROR([--enable-tsan requires libtsan.so, exiting])])
323
        if test "x$ac_cv_lib_tsan__init" = xyes; then
324
                AC_MSG_CHECKING([whether tsan API can be used])
325
                saved_CFLAGS=${CFLAGS}
326
                CFLAGS="${CFLAGS} -fsanitize=thread"
327
                AC_COMPILE_IFELSE(
328
                [AC_LANG_PROGRAM([
329
                   [#include <sanitizer/tsan_interface.h>]],
330
                   [[__tsan_create_fiber(0)]])],
331
                   [TSAN_API=yes], [TSAN_API=no])
332
                AC_MSG_RESULT([$TSAN_API])
333
                if test x$TSAN_API = "xyes"; then
334
                   AC_DEFINE(HAVE_TSAN_API, 1, [Define if tsan API can be used.])
335
                fi
336
                CFLAGS=${saved_CFLAGS}
337
        fi
338
        GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=thread -fno-omit-frame-pointer"
339
        GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=thread"
340
fi
341

342
AC_ARG_ENABLE([ubsan],
343
              AS_HELP_STRING([--enable-ubsan],[Enable Undefined Behavior Sanitizer support]))
344
if test "x$enable_ubsan" = "xyes"; then
345
        if test "x$SANITIZER" != "xnone"; then
346
                AC_MSG_ERROR([only one sanitizer can be enabled at once])
347
        fi
348
        SANITIZER=ubsan
349
        AC_CHECK_LIB([ubsan], [_init], ,
350
                [AC_MSG_ERROR([--enable-ubsan requires libubsan.so, exiting])])
351
        GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=undefined -fno-omit-frame-pointer"
352
        GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=undefined"
353
fi
354

355
# Initialize CFLAGS before usage
356
BUILD_TCMALLOC=no
357
USE_MEMPOOL=yes
358
AC_ARG_WITH([tcmalloc],
359
        [AS_HELP_STRING([--without-tcmalloc],[Use gluster based mempool])],
360
        [with_tcmalloc="no"], [with_tcmalloc="yes"])
361
if test "x$with_tcmalloc" = "xyes"; then
362
    AC_CHECK_LIB([tcmalloc_minimal], [malloc], [],
363
                 [AC_MSG_ERROR([tcmalloc library needs to be present])])
364
    BUILD_TCMALLOC=yes
365
    GF_CFLAGS="${GF_CFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
366
    GF_LDFLAGS="-ltcmalloc_minimal ${GF_LDFLAGS}"
367
    AC_DEFINE(GF_DISABLE_MEMPOOL, 1, [Disable the Gluster memory pooler.])
368
    USE_MEMPOOL=no
369
fi
370

371

372
dnl When possible, prefer libtirpc over glibc rpc.
373
dnl
374
dnl On newer linux with only libtirpc, use libtirpc. (Specifying
375
dnl --without-libtirpc is an error.)
376
dnl
377
dnl on older linux with glibc rpc and WITH libtirpc, use libtirpc
378
dnl by default except when configured with --without-libtirpc.
379
dnl
380
dnl on old linux with glibc rpc and WITHOUT libtirpc, default to
381
dnl use glibc rpc.
382
dnl
383
AC_ARG_WITH([libtirpc],
384
        [AS_HELP_STRING([--without-libtirpc],[Use legacy glibc RPC.])],
385
        [with_libtirpc="no"], [with_libtirpc="yes"])
386

387
dnl For --without-libtirpc, check whether legacy glibc rpc is available.
388
if test "x$with_libtirpc" = "xno"; then
389
    AC_CHECK_HEADER([rpc/types.h], ,
390
        AC_MSG_ERROR([Your C library lacks support for RPC. Please use libtirpc instead.]))
391
fi
392

393
dnl ipv6-default is off by default
394
dnl
395
dnl ipv6-default requires libtirpc. (glibc rpc does not support IPv6.)
396
dnl ipv6-default can only be enabled if libtipc is enabled.
397
dnl
398
AC_ARG_WITH([ipv6-default],
399
        AS_HELP_STRING([--with-ipv6-default],[Set IPv6 as default.]),
400
        [with_ipv6_default=${with_libtirpc}], [with_ipv6_default="no"])
401

402
if test x$cross_compiling != xyes; then
403
    AC_CHECK_FILE([/etc/centos-release])
404
    if test "x$ac_cv_file__etc_centos_release" = "xyes"; then
405
        if grep "release 6" /etc/centos-release; then
406
                with_ipv6_default="no"
407
        fi
408
    fi
409
fi
410

411
dnl On some distributions '-ldl' isn't automatically added to LIBS
412
AC_CHECK_LIB([dl], [dlopen], [LIB_DL=-ldl])
413
AC_SUBST(LIB_DL)
414

415
AC_ARG_ENABLE([privport_tracking],
416
              AS_HELP_STRING([--disable-privport_tracking],[Disable internal tracking of privileged ports.]))
417
TRACK_PRIVPORTS="yes"
418
if test x"$enable_privport_tracking" = x"no"; then
419
        TRACK_PRIVPORTS="no"
420
        AC_DEFINE(GF_DISABLE_PRIVPORT_TRACKING, 1,
421
                  [Disable internal tracking of privileged ports.])
422
fi
423

424
case $host_os in
425
  darwin*)
426
    # macOS version checking became a bit complicated since 11.x
427
    # It is preferred to match against kernel version now instead of product version
428
    # Darwin kernel is versioned as A.B.C where
429
    # A = Kernel Version Major, starts from 5 (OS X Puma), incremented by 1 for each new release
430
    # B = Kernel Version Minor
431
    # C = Kernel Version Patch
432

433
    # Should be greater than OS X Lion i.e. KernelMajor 11
434
    DARWIN_KERNEL_MAJOR="`/usr/bin/uname -r | cut -d . -f 1`"
435
    if ! test $DARWIN_KERNEL_MAJOR -ge 11; then
436
       AC_MSG_ERROR([You need at least OS X 10.7 (Lion) to build Glusterfs])
437
    fi
438
    # OSX version lesser than 9 has llvm/clang optimization issues which leads to various segfaults
439
    # If OS X Mavericks or lower i.e KernelMajor = 13
440
    if test $DARWIN_KERNEL_MAJOR -lt 13; then
441
       GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG"
442
    fi
443
    ;;
444
esac
445

446
# --enable-valgrind prevents calling dlclose(), this leaks memory
447
AC_ARG_ENABLE([valgrind],
448
              AS_HELP_STRING([--enable-valgrind@<:@=memcheck,drd@:>@],[Enable valgrind for resource leak (memcheck, which is
449
                              the default) or thread synchronization (drd) debugging.]))
450
case x$enable_valgrind in
451
  xmemcheck|xyes)
452
    AC_DEFINE(RUN_WITH_MEMCHECK, 1,
453
              [Define if all processes should run under 'valgrind --tool=memcheck'.])
454
    VALGRIND_TOOL=memcheck
455
    ;;
456
  xdrd)
457
    AC_DEFINE(RUN_WITH_DRD, 1,
458
              [Define if all processes should run under 'valgrind --tool=drd'.])
459
    VALGRIND_TOOL=drd
460
    ;;
461
  x|xno)
462
    VALGRIND_TOOL=no
463
    ;;
464
  *)
465
    AC_MSG_ERROR([Please specify --enable-valgrind@<:@=memcheck,drd@:>@])
466
    ;;
467
esac
468

469
if test "x$VALGRIND_TOOL" != xno; then
470
   AC_MSG_CHECKING([whether valgrind API can be used])
471
   AC_COMPILE_IFELSE(
472
   [AC_LANG_PROGRAM([
473
      [#include <valgrind/valgrind.h>]],
474
      [[VALGRIND_STACK_DEREGISTER(VALGRIND_STACK_REGISTER(0, 0))]])],
475
      [HAVE_VALGRIND_API=yes], [HAVE_VALGRIND_API=no])
476
   AC_MSG_RESULT([$HAVE_VALGRIND_API])
477
   if test x$HAVE_VALGRIND_API = "xyes"; then
478
      AC_DEFINE(HAVE_VALGRIND_API, 1, [Define if valgrind API can be used.])
479
   fi
480
fi
481

482
AC_ARG_WITH([previous-options],
483
        [AS_HELP_STRING([--with-previous-options],
484
                        [read config.status for configure options])
485
        ],
486
        [ if test -r ./config.status && \
487
             args=$(grep 'ac_cs_config=' config.status | \
488
                    sed -e 's/.*"\(.*\)".*/\1/' -e "s/'//g" -e "s/--with-previous-options//g") ; then
489
            echo "###"
490
            echo "### Rerunning as '$0 $args'"
491
            echo "###"
492
            exec $0 $args
493
          fi
494
        ])
495

496
AC_ARG_WITH(pkgconfigdir,
497
            [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
498
            [pkgconfigdir=$withval],
499
            [pkgconfigdir='${libdir}/pkgconfig'])
500
AC_SUBST(pkgconfigdir)
501

502
AC_ARG_WITH(mountutildir,
503
            [  --with-mountutildir=DIR mount helper utility in DIR @<:@/sbin@:>@],
504
            [mountutildir=$withval],
505
            [mountutildir='/sbin'])
506
AC_SUBST(mountutildir)
507

508
AC_ARG_WITH(systemddir,
509
            [  --with-systemddir=DIR systemd service files in DIR @<:@PREFIX/lib/systemd/system@:>@],
510
            [systemddir=$withval],
511
            [systemddir='${prefix}/lib/systemd/system'])
512
AC_SUBST(systemddir)
513
AM_CONDITIONAL([USE_SYSTEMD], test [ -d '/usr/lib/systemd/system' ])
514

515
AC_ARG_WITH(initdir,
516
            [  --with-initdir=DIR init.d scripts in DIR @<:@/etc/init.d@:>@],
517
            [initdir=$withval],
518
            [initdir='/etc/init.d'])
519
AC_SUBST(initdir)
520

521
AC_ARG_WITH(launchddir,
522
            [  --with-launchddir=DIR launchd services in DIR @<:@/Library/LaunchDaemons@:>@],
523
            [launchddir=$withval],
524
            [launchddir='/Library/LaunchDaemons'])
525
AC_SUBST(launchddir)
526

527
AC_ARG_WITH(tmpfilesdir,
528
            AS_HELP_STRING([--with-tmpfilesdir=DIR],[tmpfiles config in DIR, disabled by default]),
529
            [tmpfilesdir=$withval],
530
            [tmpfilesdir=''])
531
AC_SUBST(tmpfilesdir)
532

533
AC_ARG_WITH([ocf],
534
            [AS_HELP_STRING([--without-ocf], [build OCF-compliant cluster resource agents])],
535
            ,
536
            [OCF_SUBDIR='ocf'],
537
            )
538
AC_SUBST(OCF_SUBDIR)
539

540
AC_ARG_WITH([server],
541
            [AS_HELP_STRING([--without-server], [do not build server components])],
542
            [with_server=$withval],
543
            [with_server='yes'],
544
            )
545
AM_CONDITIONAL([WITH_SERVER], [test x$with_server = xyes])
546

547
# LEX needs a check
548
AC_PROG_LEX([noyywrap])
549
if test  "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
550
   AC_MSG_ERROR([Flex or lex required to build glusterfs.])
551
fi
552

553
dnl
554
dnl Word sizes...
555
dnl
556
AC_CHECK_SIZEOF(short)
557
AC_CHECK_SIZEOF(int)
558
AC_CHECK_SIZEOF(long)
559
AC_CHECK_SIZEOF(long long)
560
SIZEOF_SHORT=$ac_cv_sizeof_short
561
SIZEOF_INT=$ac_cv_sizeof_int
562
SIZEOF_LONG=$ac_cv_sizeof_long
563
SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
564
AC_SUBST(SIZEOF_SHORT)
565
AC_SUBST(SIZEOF_INT)
566
AC_SUBST(SIZEOF_LONG)
567
AC_SUBST(SIZEOF_LONG_LONG)
568

569
# size of time_t
570
AC_CHECK_SIZEOF(time_t)
571
SIZEOF_TIME_T=$ac_cv_sizeof_time_t
572
AC_SUBST(SIZEOF_TIME_T)
573

574
# YACC needs a check
575
AC_PROG_YACC
576
if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
577
   AC_MSG_ERROR([GNU Bison required to build glusterfs.])
578
fi
579

580
AC_CHECK_TOOL([LD],[ld])
581

582
AC_CHECK_LIB([crypto], [MD5], , AC_MSG_ERROR([OpenSSL crypto library is required to build glusterfs]))
583

584
AC_CHECK_LIB([pthread], [pthread_mutex_init], , AC_MSG_ERROR([Posix threads library is required to build glusterfs]))
585

586
AC_CHECK_FUNC([dlopen], [has_dlopen=yes], AC_CHECK_LIB([dl], [dlopen], , AC_MSG_ERROR([Dynamic linking library required to build glusterfs])))
587

588
AC_CHECK_LIB([intl], [gettext])
589

590
AC_CHECK_HEADERS([sys/xattr.h])
591

592
AC_CHECK_HEADERS([sys/ioctl.h], AC_DEFINE(HAVE_IOCTL_IN_SYS_IOCTL_H, 1, [have sys/ioctl.h]))
593

594
AC_CHECK_HEADERS([sys/extattr.h])
595

596
AC_CHECK_HEADERS([openssl/dh.h])
597

598
AC_CHECK_HEADERS([openssl/ecdh.h])
599

600
AC_CHECK_LIB([ssl], [SSL_CTX_get0_param], [AC_DEFINE([HAVE_SSL_CTX_GET0_PARAM], [1], [define if found OpenSSL SSL_CTX_get0_param])])
601

602
dnl Math library
603
AC_CHECK_LIB([m], [pow], [MATH_LIB='-lm'], [MATH_LIB=''])
604
AC_SUBST(MATH_LIB)
605

606
dnl depend on libuuid.so
607
PKG_CHECK_MODULES([UUID], [uuid],
608
        [have_uuid=yes
609
         AC_DEFINE(HAVE_LIBUUID, 1, [have libuuid.so])
610
         PKGCONFIG_UUID=uuid],
611
        [have_uuid=no])
612
AM_CONDITIONAL([HAVE_LIBUUID], [test x$have_uuid = xyes])
613

614
dnl older version of libuuid (from e2fsprogs) require including uuid/uuid.h
615
saved_CFLAGS=${CFLAGS}
616
CFLAGS="${CFLAGS} ${UUID_CFLAGS}"
617
AC_CHECK_HEADER([uuid.h], [], [AC_CHECK_HEADER([uuid/uuid.h])],
618
                [[#if HAVE_UUID_H
619
                  #include <uuid.h>
620
                  #endif
621
                ]])
622
CFLAGS=${saved_CFLAGS}
623
if test "x$ac_cv_header_uuid_uuid_h" = "xyes"; then
624
    UUID_CFLAGS="${UUID_CFLAGS} -I$(pkg-config --variable=includedir uuid)/uuid"
625
    have_uuid=yes
626
fi
627

628
if test "x$have_uuid" != "xyes"; then
629
    case $host_os in
630
        *freebsd*)
631
            AC_MSG_ERROR([e2fsprogs-libuuid is required to build glusterfs])
632
            ;;
633
        linux*)
634
            AC_MSG_ERROR([libuuid is required to build glusterfs])
635
            ;;
636
        *)
637
            AC_MSG_ERROR([a Linux compatible libuuid is required to build glusterfs])
638
            ;;
639
    esac
640
fi
641

642
dnl libglusterfs needs uuid.h, practically everything depends on it
643
GF_CFLAGS="${GF_CFLAGS} ${UUID_CFLAGS}"
644
dnl PKGCONFIG_UUID is used for the dependency in *.pc.in files
645
AC_SUBST(PKGCONFIG_UUID)
646

647
dnl Check for xxhash library.
648
PKG_CHECK_MODULES([XXHASH], [libxxhash],
649
  [have_libxxhash=yes
650
   AC_DEFINE(HAVE_LIBXXHASH, 1, [Define to 1 if you have libxxhash.so.])],
651
  [have_libxxhash=no])
652
AM_CONDITIONAL([HAVE_LIBXXHASH], [test x$have_libxxhash = xyes])
653

654
dnl Note xxhsum binary is required to run gfid2path tests.
655
if test "x$have_libxxhash" = "xyes"; then
656
    AC_CHECK_PROG([XXHSUM], [xxhsum], [yes], [no])
657
    if test "x$XXHSUM" = "xno"; then
658
        AC_MSG_WARN([install 'xxhsum' binary if you plan to run the tests.])
659
    fi
660
    GF_CFLAGS="${GF_CFLAGS} ${XXHASH_CFLAGS}"
661
fi
662

663
dnl NetBSD does not support POSIX ACLs :-(
664
case $host_os in
665
     *netbsd* | darwin*)
666
        AC_MSG_WARN([platform does not support POSIX ACLs... disabling them])
667
        ACL_LIBS=''
668
        USE_POSIX_ACLS='0'
669
        BUILD_POSIX_ACLS='no'
670
        ;;
671
     *)
672
        AC_CHECK_HEADERS([sys/acl.h], ,
673
                         AC_MSG_ERROR([Support for POSIX ACLs is required]))
674
        USE_POSIX_ACLS='1'
675
        BUILD_POSIX_ACLS='yes'
676
        case $host_os in
677
             linux*)
678
                ACL_LIBS='-lacl'
679
                ;;
680
             solaris*)
681
                ACL_LIBS='-lsec'
682
                ;;
683
             *freebsd*)
684
                ACL_LIBS='-lc'
685
                ;;
686
             darwin*)
687
                ACL_LIBS='-lc'
688
                ;;
689
        esac
690
        if test "x${ACL_LIBS}" = "x-lacl"; then
691
          AC_CHECK_HEADERS([acl/libacl.h], , AC_MSG_ERROR([libacl is required for building on ${host_os}]))
692
        fi
693
        ;;
694
esac
695
AC_SUBST(ACL_LIBS)
696
AC_SUBST(USE_POSIX_ACLS)
697

698
# libglusterfs/checksum
699
AC_CHECK_HEADERS([openssl/md5.h])
700

701
# Zlib is used by libglusterfs checksum and cdc xlator.
702
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0], [have_zlib=yes], [have_zlib=no])
703
if test x$have_zlib = xyes; then
704
   AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib is found.])
705
   AC_SUBST([ZLIB_CFLAGS])
706
   AC_SUBST([ZLIB_LIBS])
707
else
708
   AC_MSG_ERROR([zlib is required to build glusterfs])
709
fi
710

711
AC_CHECK_HEADERS([linux/falloc.h])
712

713
AC_CHECK_HEADERS([linux/oom.h], AC_DEFINE(HAVE_LINUX_OOM_H, 1, [have linux/oom.h]))
714

715
dnl some os may not have GNU defined strnlen function
716
AC_CHECK_FUNC([strnlen], [have_strnlen=yes])
717
if test "x${have_strnlen}" = "xyes"; then
718
   AC_DEFINE(HAVE_STRNLEN, 1, [define if found strnlen])
719
fi
720
AC_SUBST(HAVE_STRNLEN)
721

722

723
AC_CHECK_FUNC([setfsuid], [have_setfsuid=yes])
724
AC_CHECK_FUNC([setfsgid], [have_setfsgid=yes])
725

726
if test "x${have_setfsuid}" = "xyes" -a "x${have_setfsgid}" = "xyes"; then
727
  AC_DEFINE(HAVE_SET_FSID, 1, [define if found setfsuid setfsgid])
728
fi
729

730
dnl test umount2 function
731
AC_CHECK_FUNC([umount2], [have_umount2=yes])
732

733
if test "x${have_umount2}" = "xyes"; then
734
   AC_DEFINE(HAVE_UMOUNT2, 1, [define if found umount2])
735
fi
736

737
dnl Check Python Availability
738
have_python=no
739
dnl if the user has not specified a python, pick one
740
if test -z "${PYTHON}"; then
741
  case $host_os in
742
    freebsd*)
743
      if test -x /usr/local/bin/python3; then
744
        PYTHON=/usr/local/bin/python3
745
      else
746
        PYTHON=/usr/local/bin/python2
747
      fi
748
      ;;
749
    *)
750
      if test -x /usr/bin/python3; then
751
        PYTHON=/usr/bin/python3
752
      else
753
        PYTHON=/usr/bin/python2
754
      fi
755
      ;;
756
  esac
757
fi
758
AM_PATH_PYTHON([2.6],,[:])
759
if test -n "${PYTHON}"; then
760
   have_python=yes
761
fi
762
AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
763

764
dnl Use pkg-config to get runtime search path missing from ${PYTHON}-config
765
dnl Just do "true" on failure so that configure does not bail out
766
dnl Note: python 2.6's devel pkg (e.g. in CentOS/RHEL 6) does not have
767
dnl pkg-config files, so this work-around instead
768
if test "x${PYTHON_VERSION}" = "x2.6"; then
769
  PYTHON_CFLAGS=$(python-config --includes)
770
  PYTHON_LIBS=$(python-config --libs)
771
else
772
  PKG_CHECK_MODULES([PYTHON], "python-${PYTHON_VERSION}",,true)
773
fi
774

775
PYTHON_CFLAGS=$(echo ${PYTHON_CFLAGS} | sed -e 's|-I|-isystem |')
776

777
BUILD_PYTHON_SITE_PACKAGES=${pythondir}
778
AC_SUBST(BUILD_PYTHON_SITE_PACKAGES)
779

780
# Eval two times to expand fully. First eval replaces $exec_prefix into $prefix
781
# Second eval will expand $prefix
782
build_python_site_packages_temp="${pythondir}"
783
eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\"
784
eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\"
785
BUILD_PYTHON_SITE_PACKAGES_EXPANDED=${build_python_site_packages_temp}
786
AC_SUBST(BUILD_PYTHON_SITE_PACKAGES_EXPANDED)
787

788
# FUSE section
789
AC_ARG_ENABLE([fuse-client],
790
              AS_HELP_STRING([--disable-fuse-client],[Do not build the fuse client. NOTE: you cannot mount glusterfs without the client]))
791

792
BUILD_FUSE_CLIENT=no
793
if test "x$enable_fuse_client" != "xno"; then
794
   FUSE_CLIENT_SUBDIR=fuse
795
   BUILD_FUSE_CLIENT="yes"
796
fi
797

798
AC_SUBST(FUSE_CLIENT_SUBDIR)
799

800
AC_ARG_ENABLE([fuse-notifications],
801
  AS_HELP_STRING([--disable-fuse-notifications], [Disable FUSE notifications]))
802

803
AS_IF([test "x$enable_fuse_notifications" != "xno"], [
804
  AC_DEFINE([HAVE_FUSE_NOTIFICATIONS], [1], [Use FUSE notifications])
805
])
806

807
# end FUSE section
808

809
dnl Find out OpenSSL trusted certificates path
810
AC_MSG_CHECKING([for OpenSSL trusted certificates path])
811
SSL_CERT_PATH=$(openssl version -d | sed -e 's|OPENSSLDIR: "\(.*\)".*|\1|')
812
if test -d "${SSL_CERT_PATH}" 1>/dev/null 2>&1; then
813
   AC_MSG_RESULT([$SSL_CERT_PATH])
814
   AC_DEFINE_UNQUOTED(SSL_CERT_PATH, ["$SSL_CERT_PATH"], [Path to OpenSSL trusted certificates.])
815
   AC_SUBST(SSL_CERT_PATH)
816
else
817
   AC_MSG_ERROR([Unable to detect path to OpenSSL trusted certificates])
818
fi
819

820
AC_CHECK_LIB([ssl], TLS_method, [HAVE_OPENSSL_1_1="yes"], [HAVE_OPENSSL_1_1="no"])
821
if test "x$HAVE_OPENSSL_1_1" = "xyes"; then
822
    AC_DEFINE([HAVE_TLS_METHOD], [1], [Using OpenSSL-1.1 TLS_method])
823
else
824
    AC_CHECK_LIB([ssl], TLSv1_2_method, [AC_DEFINE([HAVE_TLSV1_2_METHOD], [1], [Using OpenSSL-1.0 TLSv1_2_method])])
825
fi
826

827

828
# FUSERMOUNT section
829
AC_ARG_ENABLE([fusermount],
830
              AS_HELP_STRING([--disable-fusermount],[Use system's fusermount]))
831

832
BUILD_FUSERMOUNT="yes"
833
if test "x$enable_fusermount" = "xno"; then
834
   BUILD_FUSERMOUNT="no"
835
else
836
   AC_DEFINE(GF_FUSERMOUNT, 1, [Use our own fusermount])
837
   FUSERMOUNT_SUBDIR="contrib/fuse-util"
838
fi
839

840
AC_SUBST(FUSERMOUNT_SUBDIR)
841
#end FUSERMOUNT section
842

843
# EPOLL section
844
AC_ARG_ENABLE([epoll],
845
              AS_HELP_STRING([--disable-epoll],[Use poll instead of epoll.]))
846

847
BUILD_EPOLL=no
848
if test "x$enable_epoll" != "xno"; then
849
   AC_CHECK_HEADERS([sys/epoll.h],
850
                    [BUILD_EPOLL=yes],
851
                    [BUILD_EPOLL=no])
852
fi
853
# end EPOLL section
854

855
# SYNCDAEMON section
856
AC_ARG_ENABLE([georeplication],
857
              AS_HELP_STRING([--disable-georeplication],[Do not install georeplication components]))
858

859
BUILD_SYNCDAEMON=no
860
case $host_os in
861
     freebsd*)
862
#do nothing
863
       ;;
864
     linux*)
865
#do nothing
866
       ;;
867
     netbsd*)
868
#do nothing
869
       ;;
870
     *)
871
#disabling geo replication for non-linux platforms
872
        enable_georeplication=no
873
        ;;
874
esac
875
SYNCDAEMON_COMPILE=0
876
if test "x${with_server}" = "xyes" -a "x${enable_georeplication}" != "xno"; then
877
  if test "x${have_python}" = "xno" ; then
878
    AC_MSG_ERROR([only python 2 and 3 are supported])
879
  else
880
    SYNCDAEMON_SUBDIR=geo-replication
881
    SYNCDAEMON_COMPILE=1
882

883
    BUILD_SYNCDAEMON="yes"
884
    AC_MSG_CHECKING([if python has ctypes support...])
885
    if "${PYTHON}" -c 'import ctypes' 2>/dev/null; then
886
      AC_MSG_RESULT("yes")
887
    else
888
      AC_MSG_ERROR([python does not have ctypes support])
889
    fi
890
  fi
891
fi
892
AC_SUBST(SYNCDAEMON_COMPILE)
893
AC_SUBST(SYNCDAEMON_SUBDIR)
894
# end SYNCDAEMON section
895

896
# only install scripts from extras/geo-rep when enabled
897
if test "x${with_server}" = "xyes" -a "x$enable_georeplication" != "xno"; then
898
  GEOREP_EXTRAS_SUBDIR=geo-rep
899
fi
900
AC_SUBST(GEOREP_EXTRAS_SUBDIR)
901
AM_CONDITIONAL(USE_GEOREP, test "x$enable_georeplication" != "xno")
902

903
# METADISP section
904
AC_ARG_ENABLE([metadisp],
905
              AS_HELP_STRING([--enable-metadisp],[Enable the metadata dispersal xlator]))
906
BUILD_METADISP=no
907
if test "x${enable_metadisp}" = "xyes"; then
908
  BUILD_METADISP=yes
909
fi
910
AM_CONDITIONAL([BUILD_METADISP], [test "x$BUILD_METADISP" = "xyes"])
911
# end METADISP section
912

913
# Events section
914
AC_ARG_ENABLE([events],
915
              AS_HELP_STRING([--disable-events],[Do not install Events components]))
916

917
BUILD_EVENTS=no
918
EVENTS_ENABLED=0
919
EVENTS_SUBDIR=
920
if test "x$enable_events" != "xno"; then
921
  EVENTS_SUBDIR=events
922
  EVENTS_ENABLED=1
923

924
  BUILD_EVENTS="yes"
925

926
  if test "x${have_python}" = "xno"; then
927
     if test "x${enable_events}" = "xyes"; then
928
        AC_MSG_ERROR([python 2 or 3 required. exiting.])
929
     fi
930
     AC_MSG_WARN([python not found, disabling events])
931
     EVENTS_SUBDIR=
932
     EVENTS_ENABLED=0
933
     BUILD_EVENTS="no"
934
  else
935
    AC_DEFINE(USE_EVENTS, 1, [define if events enabled])
936
  fi
937
fi
938
AC_SUBST(EVENTS_ENABLED)
939
AC_SUBST(EVENTS_SUBDIR)
940
AM_CONDITIONAL([BUILD_EVENTS], [test "x${BUILD_EVENTS}" = "xyes"])
941
# end Events section
942

943
#start firewalld section
944
BUILD_FIREWALLD="no"
945
AC_ARG_ENABLE([firewalld],
946
              AS_HELP_STRING([--enable-firewalld],[enable installation configuration for firewalld]),
947
              [BUILD_FIREWALLD="${enableval}"], [BUILD_FIREWALLD="no"])
948

949
if test "x${with_server}" = "xyes" -a "x${BUILD_FIREWALLD}" = "xyes"; then
950
        if !(test -d /usr/lib/firewalld/services 1>/dev/null 2>&1) ; then
951
                BUILD_FIREWALLD="no (firewalld not installed)"
952
        fi
953
fi
954
AM_CONDITIONAL([USE_FIREWALLD],test ["x${BUILD_FIREWALLD}" =  "xyes"])
955

956
#endof firewald section
957

958
# xml-output
959
AC_ARG_ENABLE([xml-output],
960
              AS_HELP_STRING([--disable-xml-output],[Disable the xml output]))
961
BUILD_XML_OUTPUT="yes"
962
if test "x$enable_xml_output" != "xno"; then
963
    PKG_CHECK_MODULES([XML], [libxml-2.0], [], [no_xml="yes"])
964
    if test "x${no_xml}" = "x"; then
965
        AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
966
    else
967
        if test "x$enable_georeplication" != "xno"; then
968
           AC_MSG_ERROR([libxml2 devel libraries not found])
969
        else
970
           AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
971
           BUILD_XML_OUTPUT="no"
972
        fi
973

974
    fi
975
else
976
    if test "x$enable_georeplication" != "xno"; then
977
       AC_MSG_ERROR([geo-replication requires xml output])
978
    fi
979
    BUILD_XML_OUTPUT="no"
980
fi
981
# end of xml-output
982

983
dnl cloudsync section
984
BUILD_CLOUDSYNC="no"
985
AC_CHECK_LIB([curl], [curl_easy_setopt], [LIBCURL="-lcurl"])
986
if test -n "$LIBCURL";then
987
        HAVE_LIBCURL="yes"
988
fi
989
AC_CHECK_HEADERS([openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h], [HAVE_OPENSSL="yes"])
990
if test "x$HAVE_LIBCURL" = "xyes" -a "x$HAVE_OPENSSL" = "xyes";then
991
   HAVE_AMAZONS3="yes"
992
fi
993
AM_CONDITIONAL([BUILD_AMAZONS3_PLUGIN], [test "x$HAVE_AMAZONS3" = "xyes"])
994
if test "x$HAVE_AMAZONS3" = "xyes";then
995
   BUILD_CLOUDSYNC="yes"
996
fi
997
BUILD_CVLT_PLUGIN="no"
998
case $host_os in
999
#enable cvlt plugin only for linux platforms
1000
     linux*)
1001
       BUILD_CVLT_PLUGIN="yes"
1002
       BUILD_CLOUDSYNC="yes"
1003
       ;;
1004
     *)
1005
       ;;
1006
esac
1007
AM_CONDITIONAL([BUILD_CVLT_PLUGIN], [test "x$BUILD_CVLT_PLUGIN" = "xyes"])
1008
AM_CONDITIONAL([BUILD_CLOUDSYNC], [test "x$BUILD_CLOUDSYNC" = "xyes"])
1009
dnl end cloudsync section
1010

1011
dnl SELinux feature enablement
1012
case $host_os in
1013
  linux*)
1014
    AC_ARG_ENABLE([selinux],
1015
                  AS_HELP_STRING([--disable-selinux],[Disable SELinux features]),
1016
                  [USE_SELINUX="${enableval}"], [USE_SELINUX="yes"])
1017
    ;;
1018
  *)
1019
    USE_SELINUX=no
1020
    ;;
1021
esac
1022
AM_CONDITIONAL(USE_SELINUX, test "x${USE_SELINUX}" = "xyes")
1023
dnl end of SELinux feature enablement
1024

1025
AC_CHECK_HEADERS([execinfo.h], [have_backtrace=yes])
1026
if test "x${have_backtrace}" = "xyes"; then
1027
   AC_DEFINE(HAVE_BACKTRACE, 1, [define if found backtrace])
1028
fi
1029
AC_SUBST(HAVE_BACKTRACE)
1030
AM_CONDITIONAL([HAVE_BACKTRACE], [test x$have_backtrace = xyes])
1031

1032
dnl Old (before C11) compiler can compile (but not link) this:
1033
dnl
1034
dnl int main () {
1035
dnl     _Static_assert(1, "True");
1036
dnl     return 0;
1037
dnl }
1038
dnl
1039
dnl assuming that _Static_assert is an implicitly declared function. So
1040
dnl we're trying to link just to make sure that this is not the case.
1041

1042
AC_MSG_CHECKING([whether $CC supports C11 _Static_assert])
1043
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[_Static_assert(1, "True");]])],[STATIC_ASSERT=yes],[STATIC_ASSERT=no])
1044

1045
AC_MSG_RESULT([$STATIC_ASSERT])
1046
if test x$STATIC_ASSERT = "xyes"; then
1047
   AC_DEFINE(HAVE_STATIC_ASSERT, 1, [Define if C11 _Static_assert is supported.])
1048
fi
1049

1050
if test "x${have_backtrace}" != "xyes"; then
1051
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[double x=0.0; x=ceil(0.0);]])],[],[AC_MSG_ERROR(need math library for libexecinfo)])
1052
fi
1053

1054
dnl glusterfs prints memory usage to stderr by sending it SIGUSR1
1055
dnl try mallinfo2 first, fallback to mallinfo if not available
1056
AC_CHECK_FUNC([mallinfo2], [have_mallinfo2=yes])
1057
if test "x${have_mallinfo2}" = "xyes"; then
1058
   AC_DEFINE(HAVE_MALLINFO2, 1, [define if found mallinfo2])
1059
else
1060
   AC_CHECK_FUNC([mallinfo], [have_mallinfo=yes])
1061
   if test "x${have_mallinfo}" = "xyes"; then
1062
      AC_DEFINE(HAVE_MALLINFO, 1, [define if found mallinfo])
1063
   fi
1064
fi
1065
AC_SUBST(HAVE_MALLINFO2)
1066
AC_SUBST(HAVE_MALLINFO)
1067

1068
dnl Linux, Solaris, Cygwin
1069
AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec])
1070
dnl FreeBSD, NetBSD
1071
AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec])
1072
case $host_os in
1073
        *netbsd*)
1074
        GF_CFLAGS="${GF_CFLAGS} -D_INCOMPLETE_XOPEN_C063 -DCONFIG_MACHINE_BSWAP_H"
1075
        ;;
1076
esac
1077
AC_CHECK_FUNC([linkat], [have_linkat=yes])
1078
if test "x${have_linkat}" = "xyes"; then
1079
   AC_DEFINE(HAVE_LINKAT, 1, [define if found linkat])
1080
fi
1081
AC_SUBST(HAVE_LINKAT)
1082

1083
dnl prefer futimens for nanosecond resolution
1084
AC_CHECK_FUNC([futimens], [have_futimens=yes])
1085
if test "x${have_futimens}" = "xyes"; then
1086
   AC_DEFINE(HAVE_FUTIMENS, 1, [define if found futimens])
1087
else
1088
   AC_CHECK_FUNC([futimes], [have_futimes=yes])
1089
   if test "x${have_futimes}" = "xyes"; then
1090
      AC_DEFINE(HAVE_FUTIMES, 1, [define if found futimes])
1091
   else
1092
      AC_MSG_ERROR([This system doesn't support neither futimens() nor futimes()])
1093
   fi
1094
fi
1095
AC_SUBST(HAVE_FUTIMENS)
1096
AC_SUBST(HAVE_FUTIMES)
1097

1098
dnl check for Monotonic clock
1099
AC_CHECK_LIB([rt], [clock_gettime], ,
1100
             AC_MSG_WARN([System doesn't have monotonic clock using contrib]))
1101

1102
dnl check for argp, FreeBSD has the header in /usr/local/include
1103
case $host_os in
1104
    *freebsd*)
1105
    CFLAGS="${CFLAGS} -isystem /usr/local/include"
1106
    ARGP_LDADD=-largp
1107
    ;;
1108
    *netbsd*)
1109
    ARGP_LDADD=-largp
1110
    ;;
1111
esac
1112
dnl argp-standalone does not provide a pkg-config file
1113
AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
1114
if test "x$ac_cv_header_argp_h" != "xyes"; then
1115
    AC_MSG_ERROR([argp.h not found, install libargp or argp-standalone])
1116
fi
1117
AC_SUBST(ARGP_LDADD)
1118

1119
dnl Check for atomic operation support
1120
AC_MSG_CHECKING([for gcc __atomic builtins])
1121
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int v; __atomic_load_n(&v, __ATOMIC_ACQUIRE);]])],[have_atomic_builtins=yes],[have_atomic_builtins=no])
1122
if test "x${have_atomic_builtins}" = "xyes"; then
1123
   AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [define if __atomic_*() builtins are available])
1124
fi
1125
AC_SUBST(HAVE_ATOMIC_BUILTINS)
1126
AC_MSG_RESULT([$have_atomic_builtins])
1127

1128
dnl __sync_*() will not be needed if __atomic_*() is available
1129
AC_MSG_CHECKING([for gcc __sync builtins])
1130
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[__sync_synchronize();]])],[have_sync_builtins=yes],[have_sync_builtins=no])
1131
if test "x${have_sync_builtins}" = "xyes"; then
1132
   AC_DEFINE(HAVE_SYNC_BUILTINS, 1, [define if __sync_*() builtins are available])
1133
fi
1134
AC_SUBST(HAVE_SYNC_BUILTINS)
1135
AC_MSG_RESULT([$have_sync_builtins])
1136

1137
AC_CHECK_HEADER([malloc.h], AC_DEFINE(HAVE_MALLOC_H, 1, [have malloc.h]))
1138

1139
AC_CHECK_FUNC([llistxattr], [have_llistxattr=yes])
1140
if test "x${have_llistxattr}" = "xyes"; then
1141
   AC_DEFINE(HAVE_LLISTXATTR, 1, [define if llistxattr exists])
1142
fi
1143

1144
AC_CHECK_FUNC([fdatasync], [have_fdatasync=no])
1145
if test "x${have_fdatasync}" = "xyes"; then
1146
   AC_DEFINE(HAVE_FDATASYNC, 1, [define if fdatasync exists])
1147
fi
1148

1149
AC_CHECK_FUNC([fallocate], [have_fallocate=yes])
1150
if test "x${have_fallocate}" = "xyes"; then
1151
   AC_DEFINE(HAVE_FALLOCATE, 1, [define if fallocate exists])
1152
fi
1153

1154
AC_CHECK_FUNC([posix_fallocate], [have_posix_fallocate=yes])
1155
if test "x${have_posix_fallocate}" = "xyes"; then
1156
   AC_DEFINE(HAVE_POSIX_FALLOCATE, 1, [define if posix_fallocate exists])
1157
fi
1158

1159
# On fedora-29, copy_file_range syscall and the libc API both are present.
1160
# Whereas, on some machines such as centos-7, RHEL-7, the API is not there.
1161
# Only the system call is present. So, this change is to determine whether
1162
# the API is present or not. If not, then check whether the system call is
1163
# present or not. Accordingly sys_copy_file_range function will first call
1164
# the API if it is there. Otherwise it will call syscall(SYS_copy_file_range).
1165
AC_CHECK_FUNC([copy_file_range], [have_copy_file_range=yes])
1166
if test "x${have_copy_file_range}" = "xyes"; then
1167
   AC_DEFINE(HAVE_COPY_FILE_RANGE, 1, [define if copy_file_range exists])
1168
else
1169
   OLD_CFLAGS=${CFLAGS}
1170
   CFLAGS="-D_GNU_SOURCE"
1171
   AC_CHECK_DECL([SYS_copy_file_range], , , [#include <sys/syscall.h>])
1172
   if test "x${ac_cv_have_decl_SYS_copy_file_range}" = "xyes"; then
1173
      AC_DEFINE(HAVE_COPY_FILE_RANGE_SYS, 1, [define if SYS_copy_file_range is available])
1174
   fi
1175
   CFLAGS=${OLD_CFLAGS}
1176
fi
1177

1178
AC_CHECK_FUNC([syncfs], [have_syncfs=yes])
1179
if test "x${have_syncfs}" = "xyes"; then
1180
   AC_DEFINE(HAVE_SYNCFS, 1, [define if syncfs exists])
1181
else
1182
   OLD_CFLAGS=${CFLAGS}
1183
   CFLAGS="-D_GNU_SOURCE"
1184
   AC_CHECK_DECL([SYS_syncfs], , , [#include <sys/syscall.h>])
1185
   if test "x${ac_cv_have_decl_SYS_syncfs}" = "xyes"; then
1186
      AC_DEFINE(HAVE_SYNCFS_SYS, 1, [define if SYS_syncfs is available])
1187
   fi
1188
   CFLAGS=${OLD_CFLAGS}
1189
fi
1190

1191
BUILD_NANOSECOND_TIMESTAMPS=no
1192
AC_CHECK_FUNC([utimensat], [have_utimensat=yes])
1193
if test "x${have_utimensat}" = "xyes"; then
1194
   BUILD_NANOSECOND_TIMESTAMPS=yes
1195
   AC_DEFINE(HAVE_UTIMENSAT, 1, [define if utimensat exists])
1196
fi
1197

1198
OLD_CFLAGS=${CFLAGS}
1199
CFLAGS="-D_GNU_SOURCE"
1200
AC_CHECK_DECL([SEEK_HOLE], , , [#include <unistd.h>])
1201
if test "x${ac_cv_have_decl_SEEK_HOLE}" = "xyes"; then
1202
   AC_DEFINE(HAVE_SEEK_HOLE, 1, [define if SEEK_HOLE is available])
1203
fi
1204
CFLAGS=${OLD_CFLAGS}
1205

1206
AC_CHECK_FUNC([accept4], [have_accept4=yes])
1207
if test "x${have_accept4}" = "xyes"; then
1208
   AC_DEFINE(HAVE_ACCEPT4, 1, [define if accept4 exists])
1209
fi
1210

1211
AC_CHECK_FUNC([paccept], [have_paccept=yes])
1212
if test "x${have_paccept}" = "xyes"; then
1213
AC_DEFINE(HAVE_PACCEPT, 1, [define if paccept exists])
1214
fi
1215

1216
AC_CHECK_FUNC([pipe2], [have_pipe2=yes])
1217
if test "x${have_pipe2}" = "xyes"; then
1218
AC_DEFINE(HAVE_PIPE2, 1, [Define if (Linux-specific) pipe2() exists.])
1219
fi
1220

1221
dnl Looking for OS-dependent non-POSIX function to set thread name.
1222

1223
PTHREAD_SETNAME_FOUND=no
1224

1225
dnl Linux-like version assuming glibc (so _GNU_SOURCE).
1226
if test x$PTHREAD_SETNAME_FOUND = xno; then
1227
   AC_MSG_CHECKING([for pthread_setname_np(thread, name)])
1228
   saved_CFLAGS=${CFLAGS}
1229
   CFLAGS="-D_GNU_SOURCE -pthread ${saved_CFLAGS}"
1230
   AC_LINK_IFELSE(
1231
      [AC_LANG_PROGRAM([
1232
         [#include <pthread.h>]],
1233
         [[pthread_t t; pthread_setname_np(t, "name");]])],
1234
         [pthread_setname_np_two_args=yes], [pthread_setname_np_two_args=no])
1235
   AC_MSG_RESULT([$pthread_setname_np_two_args])
1236
   CFLAGS="$saved_CFLAGS"
1237

1238
   if test x$pthread_setname_np_two_args = xyes; then
1239
      AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_TWO_ARGS, 1,
1240
                [Define if 'pthread_setname_np(thread, name)' is present.])
1241
      PTHREAD_SETNAME_FOUND=yes
1242
   fi
1243
fi
1244

1245
dnl NetBSD-like version with three arguments.
1246
if test x$PTHREAD_SETNAME_FOUND = xno; then
1247
   AC_MSG_CHECKING([for pthread_setname_np(thread, name, arg)])
1248
   saved_CFLAGS=${CFLAGS}
1249
   CFLAGS="-pthread ${saved_CFLAGS}"
1250
   AC_LINK_IFELSE(
1251
      [AC_LANG_PROGRAM([
1252
         [#include <pthread.h>]],
1253
         [[pthread_t t; pthread_setname_np(t, "name", NULL);]])],
1254
         [pthread_setname_np_three_args=yes], [pthread_setname_np_three_args=no])
1255
   AC_MSG_RESULT([$pthread_setname_np_three_args])
1256
   CFLAGS="$saved_CFLAGS"
1257

1258
   if test x$pthread_setname_np_three_args = xyes; then
1259
      AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_THREE_ARGS, 1,
1260
                [Define if 'pthread_setname_np(thread, name, arg)' is present.])
1261
      PTHREAD_SETNAME_FOUND=yes
1262
   fi
1263
fi
1264

1265
dnl FreeBSD provides pthread_np.h header file and both (not sure
1266
dnl for versions older than 13.0) 'pthread_setname_np(thread, name)'
1267
dnl and 'pthread_set_name_np(thread, name)'.
1268

1269
if test x$PTHREAD_SETNAME_FOUND = xno; then
1270
   AC_MSG_CHECKING([for pthread_set_name_np(thread, name)])
1271
   saved_CFLAGS=${CFLAGS}
1272
   CFLAGS="-pthread ${saved_CFLAGS}"
1273
   AC_LINK_IFELSE(
1274
      [AC_LANG_PROGRAM([
1275
         [#include <pthread_np.h>]],
1276
         [[pthread_t t; pthread_set_name_np(t, "name");]])],
1277
         [pthread_set_name_np=yes], [pthread_set_name_np=no])
1278
   AC_MSG_RESULT([$pthread_set_name_np])
1279
   CFLAGS="$saved_CFLAGS"
1280

1281
   if test x$pthread_set_name_np = xyes; then
1282
      AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1,
1283
                [Define if 'pthread_set_name_np(thread, name)' is present.])
1284
      PTHREAD_SETNAME_FOUND=yes
1285
   fi
1286
fi
1287

1288
if test x$PTHREAD_SETNAME_FOUND = xno; then
1289
   AC_MSG_WARN([Unable to detect function to set thread name])
1290
fi
1291

1292
# Check the distribution where you are compiling glusterfs on.
1293
# For cross-compiling, you're advised to specify it manually.
1294

1295
GF_DISTRIBUTION=
1296

1297
if test x$cross_compiling != xyes; then
1298
    AC_CHECK_FILE([/etc/debian_version])
1299
    AC_CHECK_FILE([/etc/SuSE-release])
1300
    AC_CHECK_FILE([/etc/redhat-release])
1301

1302
    if test "x$ac_cv_file__etc_debian_version" = "xyes"; then
1303
        GF_DISTRIBUTION=Debian
1304
    fi
1305
    if test "x$ac_cv_file__etc_SuSE_release" = "xyes"; then
1306
        GF_DISTRIBUTION=SuSE
1307
    fi
1308
    if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
1309
        GF_DISTRIBUTION=Redhat
1310
    fi
1311
else
1312
    GF_DISTRIBUTION=Unspecified
1313
fi
1314

1315
AC_SUBST(GF_DISTRIBUTION)
1316

1317
GF_HOST_OS=""
1318
GF_LDFLAGS="${GF_LDFLAGS} -rdynamic"
1319

1320
dnl see --with-libtirpc option check above, libtirpc(-devel) is required for
1321
dnl ipv6-default
1322
if test "x${with_libtirpc}" = "xyes" || test "x${with_ipv6_default}" = "xyes" ; then
1323
    PKG_CHECK_MODULES([TIRPC], [libtirpc],
1324
       [with_libtirpc="yes"; GF_CFLAGS="$GF_CFLAGS $TIRPC_CFLAGS"; GF_LDFLAGS="$GF_LDFLAGS $TIRPC_LIBS";],
1325
       [with_libtirpc="missing"; with_ipv6_default="no"])
1326
fi
1327

1328
if test "x${with_libtirpc}" = "xyes" ; then
1329
    AC_DEFINE(HAVE_LIBTIRPC, 1, [Using libtirpc])
1330
fi
1331

1332
if test "x${with_libtirpc}" = "xmissing" ; then
1333
    AC_CHECK_HEADERS([rpc/rpc.h],[
1334
        AC_MSG_WARN([
1335
            ---------------------------------------------------------------------------------
1336
            libtirpc (and/or ipv6-default) were enabled but libtirpc-devel is not installed.
1337
            Disabling libtirpc and ipv6-default and falling back to legacy glibc rpc headers.
1338
            This is a transitional warning message. Eventually it will be an error message.
1339
            ---------------------------------------------------------------------------------])],[
1340
        AC_MSG_ERROR([
1341
            ---------------------------------------------------------------------------------
1342
            libtirpc (and/or ipv6-default) were enabled but libtirpc-devel is not installed
1343
            and there were no legacy glibc rpc headers and library to fall back to.
1344
            ---------------------------------------------------------------------------------])])
1345
fi
1346

1347
if test "x$with_ipv6_default" = "xyes" ; then
1348
   GF_CFLAGS="$GF_CFLAGS -DIPV6_DEFAULT"
1349
fi
1350

1351
USE_BRICKMUX="no"
1352
if test "x$enable_brickmux" = "xyes" ; then
1353
   USE_BRICKMUX="yes"
1354
   AC_DEFINE(GF_ENABLE_BRICKMUX, 1, [Enable Brick Mux.])
1355
fi
1356

1357
dnl check for gcc -Werror=format-security
1358
saved_CFLAGS=$CFLAGS
1359
CFLAGS="-Wformat -Werror=format-security"
1360
AC_MSG_CHECKING([whether $CC accepts -Werror=format-security])
1361
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_format_security=yes], [cc_werror_format_security=no])
1362
echo $cc_werror_format_security
1363
if test "x$cc_werror_format_security" = "xyes"; then
1364
    GF_CFLAGS="$GF_CFLAGS ${CFLAGS}"
1365
fi
1366
CFLAGS="$saved_CFLAGS"
1367

1368
dnl check for gcc -Werror=implicit-function-declaration
1369
saved_CFLAGS=$CFLAGS
1370
CFLAGS="-Werror=implicit-function-declaration"
1371
AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
1372
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
1373
echo $cc_werror_implicit
1374
if test "x$cc_werror_implicit" = "xyes"; then
1375
    GF_CFLAGS="${GF_CFLAGS} ${CFLAGS}"
1376
fi
1377
CFLAGS="$saved_CFLAGS"
1378

1379
dnl clang is mostly GCC-compatible, but its version is much lower,
1380
dnl so we have to check for it.
1381
AC_MSG_CHECKING([if compiling with clang])
1382

1383
AC_COMPILE_IFELSE(
1384
[AC_LANG_PROGRAM([], [[
1385
#ifndef __clang__
1386
       not clang
1387
#endif
1388
]])],
1389
[CLANG=yes], [CLANG=no])
1390

1391
AC_MSG_RESULT([$CLANG])
1392

1393
if test "x$CLANG" = "xyes"; then
1394
   GF_CFLAGS="${GF_CFLAGS} -Wno-gnu"
1395
fi
1396

1397
if test "x$ac_cv_header_execinfo_h" = "xno"; then
1398
   # The reason is that __builtin_frame_address(n) for n > 0 seems
1399
   # to just crash on most platforms when -fomit-stack-pointer is
1400
   # specified, which seems to be the default for many platforms on
1401
   # -O2. The documentation says that __builtin_frame_address()
1402
   # should return NULL in case it can't get the frame, but it
1403
   # seems to crash instead.
1404

1405
   # execinfo.c in ./contrib/libexecinfo uses __builtin_frame_address(n)
1406
   # for providing cross platform backtrace*() functions.
1407
   if test "x$CLANG" = "xno"; then
1408
      GF_CFLAGS="${GF_CFLAGS} -fno-omit-frame-pointer"
1409
   fi
1410
fi
1411

1412
old_prefix=$prefix
1413
if test "x$prefix" = xNONE; then
1414
        prefix=$ac_default_prefix
1415
fi
1416
old_exec_prefix=$exec_prefix
1417
if test "x$exec_prefix" = xNONE; then
1418
        exec_prefix="$(eval echo $prefix)"
1419
fi
1420
GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs"
1421
prefix=$old_prefix
1422
exec_prefix=$old_exec_prefix
1423

1424
### Dirty hacky stuff to make LOCALSTATEDIR work
1425
if test "x$prefix" = xNONE; then
1426
   test "${localstatedir}" = '${prefix}/var' && localstatedir=$ac_default_prefix/var
1427
   localstatedir=/var
1428
fi
1429
localstatedir="$(eval echo ${localstatedir})"
1430
LOCALSTATEDIR=$localstatedir
1431

1432
GLUSTERFSD_MISCDIR="$(eval echo ${localstatedir})/lib/misc/glusterfsd"
1433

1434
old_prefix=$prefix
1435
if test "x$prefix" = xNONE; then
1436
    prefix=$ac_default_prefix
1437
fi
1438
GLUSTERD_VOLFILE="$(eval echo ${sysconfdir})/glusterfs/glusterd.vol"
1439
prefix=$old_prefix
1440

1441

1442
GFAPI_EXTRA_LDFLAGS='-Wl,--version-script=$(top_srcdir)/api/src/gfapi.map'
1443
case $host_os in
1444
     linux*)
1445
        GF_HOST_OS="GF_LINUX_HOST_OS"
1446
        GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\""
1447
        GLUSTERD_WORKDIR="${LOCALSTATEDIR}/lib/glusterd"
1448
        ;;
1449
     solaris*)
1450
        GF_HOST_OS="GF_SOLARIS_HOST_OS"
1451
        GF_CFLAGS="${GF_CFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m64"
1452
        BUILD_FUSE_CLIENT=no
1453
        FUSE_CLIENT_SUBDIR=""
1454
        GLUSTERD_WORKDIR="${LOCALSTATEDIR}/lib/glusterd"
1455
        ;;
1456
     *netbsd*)
1457
        GF_HOST_OS="GF_BSD_HOST_OS"
1458
        GF_CFLAGS="${GF_CFLAGS} -D_INCOMPLETE_XOPEN_C063"
1459
        GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
1460
        GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
1461
        GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\""
1462
        GF_LDADD="${ARGP_LDADD}"
1463
        if test "x$ac_cv_header_execinfo_h" = "xyes"; then
1464
           GF_LDFLAGS="${GF_LDFLAGS} -lexecinfo"
1465
        fi
1466
        GF_FUSE_LDADD="-lperfuse"
1467
        BUILD_FUSE_CLIENT=yes
1468
        LEXLIB=""
1469
        BUILD_FUSERMOUNT=no
1470
        FUSERMOUNT_SUBDIR=""
1471
        GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd"
1472
        ;;
1473
     *freebsd*)
1474
        GF_HOST_OS="GF_BSD_HOST_OS"
1475
        GF_CFLAGS="${GF_CFLAGS} -DO_DSYNC=0"
1476
        GF_CFLAGS="${GF_CFLAGS} -Dxdr_quad_t=xdr_longlong_t"
1477
        GF_CFLAGS="${GF_CFLAGS} -Dxdr_u_quad_t=xdr_u_longlong_t"
1478
        GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\""
1479
        GF_LDADD="${ARGP_LDADD}"
1480
        if test "x$ac_cv_header_execinfo_h" = "xyes"; then
1481
           GF_LDFLAGS="${GF_LDFLAGS} -lexecinfo"
1482
        fi
1483
        BUILD_FUSE_CLIENT=yes
1484
        BUILD_FUSERMOUNT=no
1485
        FUSERMOUNT_SUBDIR=""
1486
        GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd"
1487
        ;;
1488
     darwin*)
1489
        GF_HOST_OS="GF_DARWIN_HOST_OS"
1490
        LIBTOOL=glibtool
1491
        GF_CFLAGS="${GF_CFLAGS} -D_REENTRANT -D_XOPEN_SOURCE "
1492
        GF_CFLAGS="${GF_CFLAGS} -D_DARWIN_USE_64_BIT_INODE "
1493
        GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
1494
        GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
1495
        GF_LDADD="${ARGP_LDADD}"
1496
        GF_LDFLAGS="${GF_LDFLAGS}"
1497
        GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
1498
        BUILD_FUSERMOUNT="no"
1499
        FUSERMOUNT_SUBDIR=""
1500
        GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd"
1501
        GFAPI_EXTRA_LDFLAGS='-Wl,-alias_list,$(top_srcdir)/api/src/gfapi.aliases'
1502
        ;;
1503
esac
1504

1505
# LTO section
1506
AC_ARG_ENABLE([lto],
1507
              AS_HELP_STRING([--disable-lto],[Disable buidling with LTO]))
1508

1509
LTO_BUILD=no
1510
AS_IF([ test "x$BUILD_DEBUG" = "xno" && test "x$enable_lto" != "xno" ], [
1511
    CC_VER=`"$CC" -dumpversion 2>/dev/null | cut -f 1 -d '.'`
1512
    AS_IF([ test ! -z "$CC_VER" && test "$CC_VER" -ge "10" ], [
1513
        GF_CFLAGS="${GF_CFLAGS} -flto"
1514
        GF_LDFLAGS="${GF_LDFLAGS} -flto"
1515
        LTO_BUILD=yes
1516
        AC_MSG_NOTICE([building with LTO])],
1517
        [AC_MSG_NOTICE([not using LTO for gcc_ver=$CC_VER]) ])
1518
    ], [
1519
    AC_MSG_NOTICE([LTO is disabled])
1520
])
1521

1522
dnl ------------------------------
1523
dnl Checking posix_spawn(3) sanity
1524
dnl ------------------------------
1525

1526
AC_ARG_ENABLE(posix_spawn,
1527
              AS_HELP_STRING([--disable-posix_spawn],
1528
                             [Disable usage of posix_spawn when calling out]),
1529
              AC_MSG_CHECKING([if posix_spawn returns properly on failure])
1530
              [ case "$enableval" in
1531
                no)
1532
                     AC_MSG_RESULT(no)
1533
                     posix_spawn=no
1534
                     ;;
1535
                *)   AC_MSG_RESULT(yes)
1536
                    posix_spawn=yes
1537
                     ;;
1538
                esac ],
1539
              AC_MSG_CHECKING([if posix_spawn returns properly on failure])
1540
              AC_RUN_IFELSE([AC_LANG_SOURCE([[
1541
/*
1542
 * Test posix_spawn(3) return value on failure,
1543
 * adapted from and because of
1544
 * https://sourceware.org/bugzilla/show_bug.cgi?id=18433
1545
 */
1546
#include <stdio.h>
1547
#include <spawn.h>
1548
#include <errno.h>
1549

1550
int main()
1551
{
1552
  extern char **environ;
1553
  char *argv[[]] = { "3a7e588d3bdc4a069dbef540886ecf78", 0 };
1554
  pid_t pid = -1;
1555
  int ret = ret = posix_spawn(&pid, argv[[0]], 0, 0, argv, environ);
1556
  return ret == ENOENT ? 0 : 1;
1557
}
1558
]])
1559
],
1560
    AC_MSG_RESULT(yes)
1561
    posix_spawn=yes,
1562
    AC_MSG_RESULT(no)
1563
    posix_spawn=no,
1564
    AC_MSG_RESULT(yes)
1565
    posix_spawn=yes
1566
))
1567
AM_CONDITIONAL([USE_POSIX_SPAWN], [test x$posix_spawn = xyes])
1568

1569
# Default value for sbindir
1570
prefix_temp=$prefix
1571
exec_prefix_temp=$exec_prefix
1572

1573
test "${prefix}" = "NONE" && prefix="${ac_default_prefix}"
1574
test "${exec_prefix}" = "NONE" && exec_prefix='${prefix}'
1575
sbintemp="${sbindir}"
1576
eval sbintemp=\"${sbintemp}\"
1577
eval sbintemp=\"${sbintemp}\"
1578
SBIN_DIR=${sbintemp}
1579

1580
sysconfdirtemp="${sysconfdir}"
1581
eval sysconfdirtemp=\"${sysconfdirtemp}\"
1582
SYSCONF_DIR=${sysconfdirtemp}
1583

1584
prefix=$prefix_temp
1585
exec_prefix=$exec_prefix_temp
1586

1587
AC_SUBST(SBIN_DIR)
1588
AC_SUBST(SYSCONF_DIR)
1589

1590
# lazy umount emulation
1591
UMOUNTD_SUBDIR=""
1592
if test "x${GF_HOST_OS}" != "xGF_LINUX_HOST_OS" ; then
1593
        UMOUNTD_SUBDIR="contrib/umountd"
1594
fi
1595
AC_SUBST(UMOUNTD_SUBDIR)
1596

1597

1598
# enable debug section
1599
AC_ARG_ENABLE([debug],
1600
              AS_HELP_STRING([--enable-debug],[Enable debug build options.]))
1601

1602
dnl Add readline support in CLI if available.
1603
PKG_CHECK_MODULES([READLINE], [readline], [BUILD_READLINE="yes"],
1604
                  [BUILD_READLINE="no"])
1605
if test x$BUILD_READLINE = xyes; then
1606
    AC_DEFINE(HAVE_READLINE, 1, [Enable CLI readline support.])
1607
fi
1608

1609
# bash-completion script installation directory
1610
# PKG_CHECK_VAR should be used but is not available in some distributions
1611
bashcompdir="$(pkg-config --variable=completionsdir bash-completion 2>/dev/null)"
1612
if test "x${bashcompdir}" = "x"; then
1613
    bashcompdir="${sysconfdir}/bash_completion.d"
1614
fi
1615
AC_SUBST(bashcompdir)
1616

1617
BUILD_LIBAIO=no
1618
AC_CHECK_LIB([aio],[io_setup],[LIBAIO="-laio"])
1619

1620
if test -n "$LIBAIO"; then
1621
   AC_DEFINE(HAVE_LIBAIO, 1, [libaio based POSIX enabled])
1622
   BUILD_LIBAIO=yes
1623
fi
1624

1625
BUILD_LINUX_IO_URING="no"
1626
BUILD_LIBURING="no"
1627

1628
case $host_os in
1629
    linux*)
1630
        AC_ARG_ENABLE([linux_io_uring],
1631
                      AS_HELP_STRING([--disable-linux-io_uring],[Disable io-uring support.]))
1632

1633
        if test "x$enable_linux_io_uring" != "xno" ; then
1634
            AC_CHECK_HEADERS([liburing.h],
1635
                             [AC_DEFINE(HAVE_LIBURING, 1, [io-uring based POSIX enabled]) LIBURING="-luring"],
1636
                             AC_MSG_ERROR([Install liburing library and headers or use --disable-linux-io_uring]))
1637
            BUILD_LIBURING=yes
1638

1639
            AC_CHECK_HEADER([linux/io_uring.h],
1640
                            [
1641
                                AC_DEFINE([HAVE_IO_URING], [1], "io_uring support")
1642
                                BUILD_LINUX_IO_URING="yes"
1643
                            ])
1644
        fi
1645
        ;;
1646
esac
1647

1648
AM_CONDITIONAL([BUILD_LINUX_IO_URING], [test x$BUILD_LINUX_IO_URING = xyes])
1649

1650
dnl gnfs section
1651
BUILD_GNFS="no"
1652
RPCBIND_SERVICE=""
1653
AC_ARG_ENABLE([gnfs],
1654
              AS_HELP_STRING([--enable-gnfs],[Enable legacy gnfs server xlator.]))
1655
if test "x${with_server}" = "xyes" -a "x$enable_gnfs" = "xyes"; then
1656
    BUILD_GNFS="yes"
1657
    GF_CFLAGS="$GF_CFLAGS -DBUILD_GNFS"
1658
    RPCBIND_SERVICE="rpcbind.service"
1659
fi
1660
AM_CONDITIONAL([BUILD_GNFS], [test x$BUILD_GNFS = xyes])
1661
AC_SUBST(BUILD_GNFS)
1662
AC_SUBST(RPCBIND_SERVICE)
1663
dnl end gnfs section
1664

1665
dnl Check for userspace-rcu
1666
PKG_CHECK_MODULES([URCU], [liburcu-bp], [],
1667
  [AC_CHECK_HEADERS([urcu-bp.h],
1668
     [URCU_LIBS='-lurcu-bp'],
1669
     AC_MSG_ERROR([liburcu-bp not found]))])
1670
PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.8], [],
1671
  [PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.7],
1672
    [AC_DEFINE(URCU_OLD, 1, [Define if liburcu 0.6 or 0.7 is found])
1673
     USE_CONTRIB_URCU='yes'],
1674
    [AC_CHECK_HEADERS([urcu/cds.h],
1675
      [AC_DEFINE(URCU_OLD, 1, [Define if liburcu 0.6 or 0.7 is found])
1676
       URCU_CDS_LIBS='-lurcu-cds'
1677
       USE_CONTRIB_URCU='yes'],
1678
      [AC_MSG_ERROR([liburcu-cds not found])])])])
1679

1680
BUILD_UNITTEST="no"
1681
AC_ARG_ENABLE([cmocka],
1682
              AS_HELP_STRING([--enable-cmocka],[Enable cmocka build options.]))
1683
if test "x$enable_cmocka" = "xyes"; then
1684
    BUILD_UNITTEST="yes"
1685
    PKG_CHECK_MODULES([UNITTEST], [cmocka >= 1.0.1], [BUILD_UNITTEST="yes"],
1686
        [AC_MSG_ERROR([cmocka library is required to build glusterfs])]
1687
    )
1688
fi
1689
AM_CONDITIONAL([UNITTEST], [test x$BUILD_UNITTEST = xyes])
1690

1691
dnl Define UNIT_TESTING only for building cmocka binaries.
1692
UNITTEST_CFLAGS="${UNITTEST_CFLAGS} -DUNIT_TESTING=1"
1693

1694
dnl Add cmocka for unit tests
1695
case $host_os in
1696
  freebsd*)
1697
    dnl remove --coverage on FreeBSD due to a known llvm packaging bug
1698
    UNITTEST_CFLAGS="${UNITTEST_CPPFLAGS} ${UNITTEST_CFLAGS} -g -DDEBUG -O0"
1699
    UNITTEST_LDFLAGS="${UNITTEST_LIBS} ${UNITTEST_LDFLAGS}"
1700
    ;;
1701
  *)
1702
    UNITTEST_CFLAGS="${UNITTEST_CPPFLAGS} ${UNITTEST_CFLAGS} -g -DDEBUG -O0 --coverage"
1703
    UNITTEST_LDFLAGS="${UNITTEST_LIBS} ${UNITTEST_LDFLAGS}"
1704
    ;;
1705
esac
1706

1707
AC_SUBST(UNITTEST_CFLAGS)
1708
AC_SUBST(UNITTEST_LDFLAGS)
1709

1710
AC_SUBST(CFLAGS)
1711
# end enable debug section
1712

1713
dnl do not add -lresolv for freebsd
1714
case $host_os in
1715
  freebsd*)
1716
    RESOLV_LIBS=""
1717
    ;;
1718
  *)
1719
    RESOLV_LIBS="-lresolv"
1720
    ;;
1721
esac
1722

1723
AC_SUBST(RESOLV_LIBS)
1724

1725
# EC dynamic code generation section
1726

1727
EC_DYNAMIC_SUPPORT="none"
1728
EC_DYNAMIC_ARCH="none"
1729

1730
AC_ARG_ENABLE([ec-dynamic],
1731
              AS_HELP_STRING([--disable-ec-dynamic],[Disable all dynamic code generation extensions for EC module]))
1732

1733
AC_ARG_ENABLE([ec-dynamic-intel],
1734
              AS_HELP_STRING([--disable-ec-dynamic-intel],[Disable all INTEL dynamic code generation extensions for EC module]))
1735

1736
AC_ARG_ENABLE([ec-dynamic-arm],
1737
              AS_HELP_STRING([--disable-ec-dynamic-arm],[Disable all ARM dynamic code generation extensions for EC module]))
1738

1739
AC_ARG_ENABLE([ec-dynamic-x64],
1740
              AS_HELP_STRING([--disable-ec-dynamic-x64],[Disable dynamic INTEL x64 code generation for EC module]))
1741

1742
AC_ARG_ENABLE([ec-dynamic-sse],
1743
              AS_HELP_STRING([--disable-ec-dynamic-sse],[Disable dynamic INTEL SSE code generation for EC module]))
1744

1745
AC_ARG_ENABLE([ec-dynamic-avx],
1746
              AS_HELP_STRING([--disable-ec-dynamic-avx],[Disable dynamic INTEL AVX code generation for EC module]))
1747

1748
AC_ARG_ENABLE([ec-dynamic-neon],
1749
              AS_HELP_STRING([--disable-ec-dynamic-neon],[Disable dynamic ARM NEON code generation for EC module]))
1750

1751
if test "x$enable_ec_dynamic" != "xno"; then
1752
  case $host in
1753
    x86_64*)
1754
      if test "x$enable_ec_dynamic_intel" != "xno"; then
1755
        if test "x$enable_ec_dynamic_x64" != "xno"; then
1756
          EC_DYNAMIC_SUPPORT="$EC_DYNAMIC_SUPPORT x64"
1757
          AC_DEFINE(USE_EC_DYNAMIC_X64, 1, [Defined if using dynamic INTEL x64 code])
1758
        fi
1759
        if test "x$enable_ec_dynamic_sse" != "xno"; then
1760
          EC_DYNAMIC_SUPPORT="$EC_DYNAMIC_SUPPORT sse"
1761
          AC_DEFINE(USE_EC_DYNAMIC_SSE, 1, [Defined if using dynamic INTEL SSE code])
1762
        fi
1763
        if test "x$enable_ec_dynamic_avx" != "xno"; then
1764
          EC_DYNAMIC_SUPPORT="$EC_DYNAMIC_SUPPORT avx"
1765
          AC_DEFINE(USE_EC_DYNAMIC_AVX, 1, [Defined if using dynamic INTEL AVX code])
1766
        fi
1767

1768
        if test "x$EC_DYNAMIC_SUPPORT" != "xnone"; then
1769
          EC_DYNAMIC_ARCH="intel"
1770
        fi
1771
      fi
1772
      ;;
1773
    arm*)
1774
      if test "x$enable_ec_dynamic_arm" != "xno"; then
1775
        if test "x$enable_ec_dynamic_neon" != "xno"; then
1776
          EC_DYNAMIC_SUPPORT="$EC_DYNAMIC_SUPPORT neon"
1777
          AC_DEFINE(USE_EC_DYNAMIC_NEON, 1, [Defined if using dynamic ARM NEON code])
1778
        fi
1779

1780
        if test "x$EC_DYNAMIC_SUPPORT" != "xnone"; then
1781
          EC_DYNAMIC_ARCH="arm"
1782
        fi
1783
      fi
1784
      ;;
1785
  esac
1786

1787
  EC_DYNAMIC_SUPPORT="${EC_DYNAMIC_SUPPORT#none }"
1788
fi
1789

1790
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_INTEL], [test "x$EC_DYNAMIC_ARCH" = "xintel"])
1791
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_ARM], [test "x$EC_DYNAMIC_ARCH" = "xarm"])
1792

1793
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_X64], [test "x${EC_DYNAMIC_SUPPORT##*x64*}" = "x"])
1794
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_SSE], [test "x${EC_DYNAMIC_SUPPORT##*sse*}" = "x"])
1795
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_AVX], [test "x${EC_DYNAMIC_SUPPORT##*avx*}" = "x"])
1796
AM_CONDITIONAL([ENABLE_EC_DYNAMIC_NEON], [test "x${EC_DYNAMIC_SUPPORT##*neon*}" = "x"])
1797

1798
AC_SUBST(USE_EC_DYNAMIC_X64)
1799
AC_SUBST(USE_EC_DYNAMIC_SSE)
1800
AC_SUBST(USE_EC_DYNAMIC_AVX)
1801
AC_SUBST(USE_EC_DYNAMIC_NEON)
1802

1803
# end EC dynamic code generation section
1804

1805
dnl libglusterfs.so uses math functions
1806
GF_LDADD="${GF_LDADD} ${MATH_LIB}"
1807

1808
case $host_os in
1809
  dnl Can't use libtool's portable "-no-undefined" as it seems to be ignored on Linux
1810
  linux*)
1811
    GF_NO_UNDEFINED='-Wl,--no-undefined'
1812
    ;;
1813
  darwin*)
1814
    GF_NO_UNDEFINED='-Wl,-undefined'
1815
    ;;
1816
  *)
1817
  dnl There's an issue on FreeBSD with reference to __progname used in some parts of code
1818
    GF_NO_UNDEFINED=''
1819
    ;;
1820
esac
1821
dnl GF_XLATOR_DEFAULT_LDFLAGS is for most xlators that expose a common set of symbols
1822
GF_XLATOR_DEFAULT_LDFLAGS='-avoid-version -export-symbols $(top_srcdir)/xlators/xlator.sym $(UUID_LIBS) $(GF_NO_UNDEFINED) $(TIRPC_LIBS)'
1823
dnl GF_XLATOR_LDFLAGS is for xlators that expose extra symbols, e.g. dht
1824
GF_XLATOR_LDFLAGS='-avoid-version $(UUID_LIBS) $(GF_NO_UNDEFINED) $(TIRPC_LIBS)'
1825

1826
AC_SUBST(GF_HOST_OS)
1827
AC_SUBST(GF_CFLAGS)
1828
AC_SUBST(GF_LDFLAGS)
1829
AC_SUBST(GF_LDADD)
1830
AC_SUBST(GF_FUSE_LDADD)
1831
AC_SUBST(GF_FUSE_CFLAGS)
1832
AC_SUBST(RLLIBS)
1833
AC_SUBST(LIBAIO)
1834
AC_SUBST(LIBURING)
1835
AC_SUBST(AM_MAKEFLAGS)
1836
AC_SUBST(AM_LIBTOOLFLAGS)
1837
AC_SUBST(GF_NO_UNDEFINED)
1838
AC_SUBST(GF_XLATOR_DEFAULT_LDFLAGS)
1839
AC_SUBST(GF_XLATOR_LDFLAGS)
1840
AC_SUBST(GF_XLATOR_MGNT_LIBADD)
1841

1842
case $host_os in
1843
     *freebsd*)
1844
        GF_XLATOR_MGNT_LIBADD="-lutil -lprocstat"
1845
        ;;
1846
esac
1847

1848
CONTRIBDIR='$(top_srcdir)/contrib'
1849
AC_SUBST(CONTRIBDIR)
1850

1851
GF_CPPDEFINES='-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)'
1852
GF_CPPINCLUDES='-include $(top_builddir)/config.h -include $(top_builddir)/site.h -I$(top_srcdir)/libglusterfs/src -I$(top_builddir)/libglusterfs/src'
1853
if test "x${USE_CONTRIB_URCU}" = "xyes"; then
1854
    GF_CPPINCLUDES="${GF_CPPINCLUDES} -I\$(CONTRIBDIR)/userspace-rcu"
1855
fi
1856
GF_CPPFLAGS="$GF_CPPFLAGS $GF_CPPDEFINES $GF_CPPINCLUDES"
1857
AC_SUBST([GF_CPPFLAGS])
1858

1859
dnl Note GF_BSD_HOST_OS and GF_SOLARIS_HOST_OS are not used
1860
dnl through Makefile.am and so not defined as conditionals.
1861
AM_CONDITIONAL([GF_LINUX_HOST_OS], test "${GF_HOST_OS}" = "GF_LINUX_HOST_OS")
1862
AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS")
1863

1864
AC_SUBST(GLUSTERD_WORKDIR)
1865
AM_CONDITIONAL([GF_INSTALL_GLUSTERD_WORKDIR], test ! -d "${GLUSTERD_WORKDIR}" && test -d "${sysconfdir}/glusterd" )
1866
AC_SUBST(GLUSTERD_VOLFILE)
1867
AC_SUBST(GLUSTERFS_LIBEXECDIR)
1868
AC_SUBST(GLUSTERFSD_MISCDIR)
1869

1870
dnl pkg-config versioning
1871
dnl
1872
dnl Once we released gluster-api.pc with version=7. Since then we undid the
1873
dnl library versioning and replaced it with symbol-versioning. The current
1874
dnl libgfapi.so has version 0, but the symbols have the version from the main
1875
dnl package at the time they were added.
1876
dnl
1877
dnl Because other packages (like samba) use the pkg-config version, we can not
1878
dnl drop it, or decrease the version easily. The simplest solution is to keep
1879
dnl the version=7 and add sub-digits for the actual package/symbol versions.
1880
GFAPI_VERSION="7."${PACKAGE_VERSION}
1881
LIBGFCHANGELOG_VERSION="0.0.1"
1882
AC_SUBST(GFAPI_VERSION)
1883
AC_SUBST(LIBGFCHANGELOG_VERSION)
1884

1885
dnl libtool versioning
1886
LIBGFXDR_LT_VERSION="0:1:0"
1887
LIBGFRPC_LT_VERSION="0:1:0"
1888
LIBGLUSTERFS_LT_VERSION="0:1:0"
1889
LIBGFCHANGELOG_LT_VERSION="0:1:0"
1890
GFAPI_LT_VERSION="0:0:0"
1891
AC_SUBST(LIBGFXDR_LT_VERSION)
1892
AC_SUBST(LIBGFRPC_LT_VERSION)
1893
AC_SUBST(LIBGLUSTERFS_LT_VERSION)
1894
AC_SUBST(LIBGFCHANGELOG_LT_VERSION)
1895
AC_SUBST(GFAPI_LT_VERSION)
1896
AC_SUBST(GFAPI_EXTRA_LDFLAGS)
1897

1898
GFAPI_LIBS="${ACL_LIBS}"
1899
AC_SUBST(GFAPI_LIBS)
1900

1901
dnl this change necessary for run-tests.sh
1902
AC_CONFIG_FILES([tests/env.rc],[ln -s ${ac_abs_builddir}/env.rc ${ac_abs_srcdir}/env.rc 2>/dev/null])
1903

1904
AC_OUTPUT
1905

1906
echo
1907
echo "GlusterFS configure summary"
1908
echo "==========================="
1909
echo "FUSE client          : $BUILD_FUSE_CLIENT"
1910
echo "epoll IO multiplex   : $BUILD_EPOLL"
1911
echo "fusermount           : $BUILD_FUSERMOUNT"
1912
echo "readline             : $BUILD_READLINE"
1913
echo "georeplication       : $BUILD_SYNCDAEMON"
1914
echo "Linux-AIO            : $BUILD_LIBAIO"
1915
echo "Linux io_uring       : $BUILD_LINUX_IO_URING"
1916
echo "Use liburing         : $BUILD_LIBURING"
1917
echo "Enable Debug         : $BUILD_DEBUG"
1918
echo "Run with Valgrind    : $VALGRIND_TOOL"
1919
echo "Sanitizer enabled    : $SANITIZER"
1920
echo "XML output           : $BUILD_XML_OUTPUT"
1921
echo "Unit Tests           : $BUILD_UNITTEST"
1922
echo "Track priv ports     : $TRACK_PRIVPORTS"
1923
echo "POSIX ACLs           : $BUILD_POSIX_ACLS"
1924
echo "SELinux features     : $USE_SELINUX"
1925
echo "firewalld-config     : $BUILD_FIREWALLD"
1926
echo "Events               : $BUILD_EVENTS"
1927
echo "EC dynamic support   : $EC_DYNAMIC_SUPPORT"
1928
echo "Use memory pools     : $USE_MEMPOOL"
1929
echo "Nanosecond m/atimes  : $BUILD_NANOSECOND_TIMESTAMPS"
1930
echo "Server components    : $with_server"
1931
echo "Legacy gNFS server   : $BUILD_GNFS"
1932
echo "IPV6 default         : $with_ipv6_default"
1933
echo "Use TIRPC            : $with_libtirpc"
1934
echo "With Python          : ${PYTHON_VERSION}"
1935
echo "Cloudsync            : $BUILD_CLOUDSYNC"
1936
echo "Metadata dispersal   : $BUILD_METADISP"
1937
echo "Link with TCMALLOC   : $BUILD_TCMALLOC"
1938
echo "Enable Brick Mux     : $USE_BRICKMUX"
1939
echo "Building with LTO    : $LTO_BUILD"
1940
echo
1941

1942
if test "x$SANITIZER" != "xnone"; then
1943
        UC_SANITIZER=$(echo ${SANITIZER} | tr 'a-z' 'A-Z')
1944
        echo "Note: since glusterfs processes are daemon processes, use"
1945
        echo "'export ${UC_SANITIZER}_OPTIONS=log_path=/path/to/xxx.log' to collect"
1946
        echo "sanitizer output. Further details and more options can be"
1947
        echo "found at https://github.com/google/sanitizers."
1948
fi
1949

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.