1 dnl Copyright (c) 2006-2012 Red Hat, Inc. <http://www.redhat.com>
2 dnl This file is part of GlusterFS.
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.
9 AC_INIT([glusterfs],[3git],[gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git])
13 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
15 if make --help 2>&1 | grep -q no-print-directory; then
16 AM_MAKEFLAGS="$AM_MAKEFLAGS --no-print-directory";
19 if make --help 2>&1 | grep -q quiet; then
20 AM_MAKEFLAGS="$AM_MAKEFLAGS --quiet"
23 if libtool --help 2>&1 | grep -q quiet; then
24 AM_LIBTOOLFLAGS="--quiet";
27 AC_CONFIG_HEADERS([config.h])
29 AC_CONFIG_FILES([Makefile
31 libglusterfs/src/Makefile
32 geo-replication/src/peer_gsec_create
33 geo-replication/src/peer_add_secret_pub
35 glusterfsd/src/Makefile
38 rpc/rpc-lib/src/Makefile
39 rpc/rpc-transport/Makefile
40 rpc/rpc-transport/socket/Makefile
41 rpc/rpc-transport/socket/src/Makefile
42 rpc/rpc-transport/rdma/Makefile
43 rpc/rpc-transport/rdma/src/Makefile
47 xlators/mount/Makefile
48 xlators/mount/fuse/Makefile
49 xlators/mount/fuse/src/Makefile
50 xlators/mount/fuse/utils/mount.glusterfs
51 xlators/mount/fuse/utils/mount_glusterfs
52 xlators/mount/fuse/utils/Makefile
53 xlators/storage/Makefile
54 xlators/storage/posix/Makefile
55 xlators/storage/posix/src/Makefile
56 xlators/storage/bd/Makefile
57 xlators/storage/bd/src/Makefile
58 xlators/cluster/Makefile
59 xlators/cluster/afr/Makefile
60 xlators/cluster/afr/src/Makefile
61 xlators/cluster/stripe/Makefile
62 xlators/cluster/stripe/src/Makefile
63 xlators/cluster/dht/Makefile
64 xlators/cluster/dht/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/symlink-cache/Makefile
77 xlators/performance/symlink-cache/src/Makefile
78 xlators/performance/quick-read/Makefile
79 xlators/performance/quick-read/src/Makefile
80 xlators/performance/open-behind/Makefile
81 xlators/performance/open-behind/src/Makefile
82 xlators/performance/md-cache/Makefile
83 xlators/performance/md-cache/src/Makefile
84 xlators/debug/Makefile
85 xlators/debug/trace/Makefile
86 xlators/debug/trace/src/Makefile
87 xlators/debug/error-gen/Makefile
88 xlators/debug/error-gen/src/Makefile
89 xlators/debug/io-stats/Makefile
90 xlators/debug/io-stats/src/Makefile
91 xlators/protocol/Makefile
92 xlators/protocol/auth/Makefile
93 xlators/protocol/auth/addr/Makefile
94 xlators/protocol/auth/addr/src/Makefile
95 xlators/protocol/auth/login/Makefile
96 xlators/protocol/auth/login/src/Makefile
97 xlators/protocol/client/Makefile
98 xlators/protocol/client/src/Makefile
99 xlators/protocol/server/Makefile
100 xlators/protocol/server/src/Makefile
101 xlators/features/Makefile
102 xlators/features/changelog/Makefile
103 xlators/features/changelog/src/Makefile
104 xlators/features/changelog/lib/Makefile
105 xlators/features/changelog/lib/src/Makefile
106 xlators/features/glupy/Makefile
107 xlators/features/glupy/examples/Makefile
108 xlators/features/glupy/src/Makefile
109 xlators/features/glupy/src/setup.py
110 xlators/features/locks/Makefile
111 xlators/features/locks/src/Makefile
112 xlators/features/quota/Makefile
113 xlators/features/quota/src/Makefile
114 xlators/features/marker/Makefile
115 xlators/features/marker/src/Makefile
116 xlators/features/read-only/Makefile
117 xlators/features/read-only/src/Makefile
118 xlators/features/compress/Makefile
119 xlators/features/compress/src/Makefile
120 xlators/features/mac-compat/Makefile
121 xlators/features/mac-compat/src/Makefile
122 xlators/features/quiesce/Makefile
123 xlators/features/quiesce/src/Makefile
124 xlators/features/index/Makefile
125 xlators/features/index/src/Makefile
126 xlators/features/protect/Makefile
127 xlators/features/protect/src/Makefile
128 xlators/features/gfid-access/Makefile
129 xlators/features/gfid-access/src/Makefile
130 xlators/playground/Makefile
131 xlators/playground/template/Makefile
132 xlators/playground/template/src/Makefile
133 xlators/encryption/Makefile
134 xlators/encryption/rot-13/Makefile
135 xlators/encryption/rot-13/src/Makefile
136 xlators/encryption/crypt/Makefile
137 xlators/encryption/crypt/src/Makefile
138 xlators/features/qemu-block/Makefile
139 xlators/features/qemu-block/src/Makefile
140 xlators/system/Makefile
141 xlators/system/posix-acl/Makefile
142 xlators/system/posix-acl/src/Makefile
144 xlators/nfs/server/Makefile
145 xlators/nfs/server/src/Makefile
146 xlators/mgmt/Makefile
147 xlators/mgmt/glusterd/Makefile
148 xlators/mgmt/glusterd/src/Makefile
153 extras/init.d/Makefile
154 extras/init.d/glusterd.plist
155 extras/init.d/glusterd-Debian
156 extras/init.d/glusterd-Redhat
157 extras/init.d/glusterd-SuSE
158 extras/systemd/Makefile
159 extras/systemd/glusterd.service
160 extras/benchmarking/Makefile
161 extras/hook-scripts/Makefile
165 extras/LinuxRPM/Makefile
166 extras/geo-rep/Makefile
167 extras/hook-scripts/add-brick/Makefile
168 extras/hook-scripts/add-brick/pre/Makefile
169 extras/hook-scripts/add-brick/post/Makefile
170 extras/hook-scripts/start/Makefile
171 extras/hook-scripts/start/post/Makefile
172 extras/hook-scripts/set/Makefile
173 extras/hook-scripts/set/post/Makefile
174 extras/hook-scripts/stop/Makefile
175 extras/hook-scripts/stop/pre/Makefile
176 contrib/fuse-util/Makefile
177 contrib/uuid/uuid_types.h
182 api/examples/Makefile
183 api/examples/__init__.py
184 api/examples/setup.py
185 geo-replication/Makefile
186 geo-replication/src/Makefile
187 geo-replication/syncdaemon/Makefile
196 # Initialize CFLAGS before usage
197 AC_ARG_ENABLE([debug],
198 AC_HELP_STRING([--enable-debug],
199 [Enable debug build options.]))
200 if test "x$enable_debug" = "xyes"; then
202 CFLAGS="${CFLAGS} -g -O0 -DDEBUG"
205 CFLAGS="${CFLAGS} -g -O2"
208 AC_ARG_WITH(pkgconfigdir,
209 [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
210 [pkgconfigdir=$withval],
211 [pkgconfigdir='${libdir}/pkgconfig'])
212 AC_SUBST(pkgconfigdir)
214 AC_ARG_WITH(mountutildir,
215 [ --with-mountutildir=DIR mount helper utility in DIR @<:@/sbin@:>@],
216 [mountutildir=$withval],
217 [mountutildir='/sbin'])
218 AC_SUBST(mountutildir)
220 AC_ARG_WITH(systemddir,
221 [ --with-systemddir=DIR systemd service files in DIR @<:@/usr/lib/systemd/system@:>@],
222 [systemddir=$withval],
223 [systemddir='/usr/lib/systemd/system'])
227 [ --with-initdir=DIR init.d scripts in DIR @<:@/etc/init.d@:>@],
229 [initdir='/etc/init.d'])
232 AC_ARG_WITH(launchddir,
233 [ --with-launchddir=DIR launchd services in DIR @<:@/Library/LaunchDaemons@:>@],
234 [launchddir=$withval],
235 [launchddir='/Library/LaunchDaemons'])
239 [AS_HELP_STRING([--without-ocf], [build OCF-compliant cluster resource agents])],
247 if test "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
248 AC_MSG_ERROR([Flex or lex required to build glusterfs.])
254 AC_CHECK_SIZEOF(short)
256 AC_CHECK_SIZEOF(long)
257 AC_CHECK_SIZEOF(long long)
258 SIZEOF_SHORT=$ac_cv_sizeof_short
259 SIZEOF_INT=$ac_cv_sizeof_int
260 SIZEOF_LONG=$ac_cv_sizeof_long
261 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
262 AC_SUBST(SIZEOF_SHORT)
264 AC_SUBST(SIZEOF_LONG)
265 AC_SUBST(SIZEOF_LONG_LONG)
269 if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
270 AC_MSG_ERROR([GNU Bison required to build glusterfs.])
273 AC_CHECK_TOOL([LD],[ld])
275 AC_CHECK_LIB([crypto], [MD5], , AC_MSG_ERROR([OpenSSL crypto library is required to build glusterfs]))
277 AC_CHECK_LIB([pthread], [pthread_mutex_init], , AC_MSG_ERROR([Posix threads library is required to build glusterfs]))
279 AC_CHECK_FUNC([dlopen], [has_dlopen=yes], AC_CHECK_LIB([dl], [dlopen], , AC_MSG_ERROR([Dynamic linking library required to build glusterfs])))
281 AC_CHECK_FUNC([gettext], [has_gettext=yes], AC_CHECK_LIB([intl], [gettext], , AC_MSG_ERROR([gettext support is required to build glusterfs])))
283 AC_CHECK_HEADERS([sys/xattr.h])
285 AC_CHECK_HEADERS([sys/extattr.h])
287 AC_CHECK_HEADERS([openssl/md5.h])
289 AC_CHECK_HEADERS([linux/falloc.h])
293 if ! test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -ge 5; then
294 AC_MSG_ERROR([You need at least OS X 10.5 (Leopard) to build Glusterfs])
299 dnl Mac OS X does not have spinlocks
300 AC_CHECK_FUNC([pthread_spin_init], [have_spinlock=yes])
301 if test "x${have_spinlock}" = "xyes"; then
302 AC_DEFINE(HAVE_SPINLOCK, 1, [define if found spinlock])
304 AC_SUBST(HAVE_SPINLOCK)
306 dnl some os may not have GNU defined strnlen function
307 AC_CHECK_FUNC([strnlen], [have_strnlen=yes])
308 if test "x${have_strnlen}" = "xyes"; then
309 AC_DEFINE(HAVE_STRNLEN, 1, [define if found strnlen])
311 AC_SUBST(HAVE_STRNLEN)
314 AC_CHECK_FUNC([setfsuid], [have_setfsuid=yes])
315 AC_CHECK_FUNC([setfsgid], [have_setfsgid=yes])
317 if test "x${have_setfsuid}" = "xyes" -a "x${have_setfsgid}" = "xyes"; then
318 AC_DEFINE(HAVE_SET_FSID, 1, [define if found setfsuid setfsgid])
323 AC_ARG_ENABLE([fuse-client],
324 AC_HELP_STRING([--disable-fuse-client],
325 [Do not build the fuse client. NOTE: you cannot mount glusterfs without the client]))
328 if test "x$enable_fuse_client" != "xno"; then
329 FUSE_CLIENT_SUBDIR=fuse
330 BUILD_FUSE_CLIENT="yes"
333 AC_ARG_ENABLE([bd-xlator],
334 AC_HELP_STRING([--enable-bd-xlator], [Build BD xlator]))
336 if test "x$enable_bd_xlator" != "xno"; then
337 AC_CHECK_LIB([lvm2app],
338 [lvm_init,lvm_lv_from_name],
342 if test "x$HAVE_BD_LIB" = "xyes"; then
343 # lvm_lv_from_name() has been made public with lvm2-2.02.79
346 [NEED_LVM_LV_FROM_NAME_DECL="no"],
347 [NEED_LVM_LV_FROM_NAME_DECL="yes"],
348 [[#include <lvm2app.h>]])
352 if test "x$enable_bd_xlator" = "xyes" -a "x$HAVE_BD_LIB" = "xno"; then
353 echo "BD xlator requested but required lvm2 development library not found."
358 if test "x${enable-bd-xlator}" != "xno" -a "x${HAVE_BD_LIB}" = "xyes"; then
360 AC_DEFINE(HAVE_BD_XLATOR, 1, [define if lvm2app library found and bd xlator
362 if test "x$NEED_LVM_LV_FROM_NAME_DECL" = "xyes"; then
363 AC_DEFINE(NEED_LVM_LV_FROM_NAME_DECL, 1, [defined if lvm_lv_from_name()
364 was not found in the lvm2app.h header, but can be linked])
368 AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes])
370 # start encryption/crypt section
372 AC_CHECK_HEADERS([openssl/cmac.h], [have_cmac_h=yes], [have_cmac_h=no])
374 AC_ARG_ENABLE([crypt-xlator],
375 AC_HELP_STRING([--enable-crypt-xlator], [Build crypt encryption xlator]))
377 if test "x$enable_crypt_xlator" = "xyes" -a "x$have_cmac_h" = "xno"; then
378 echo "Encryption xlator requires OpenSSL with cmac.h"
382 BUILD_CRYPT_XLATOR=no
383 if test "x$enable_crypt_xlator" != "xno" -a "x$have_cmac_h" = "xyes"; then
384 BUILD_CRYPT_XLATOR=yes
385 AC_DEFINE(HAVE_CRYPT_XLATOR, 1, [enable building crypt encryption xlator])
388 AM_CONDITIONAL([ENABLE_CRYPT_XLATOR], [test x$BUILD_CRYPT_XLATOR = xyes])
390 AC_SUBST(FUSE_CLIENT_SUBDIR)
395 AC_ARG_ENABLE([fusermount],
396 AC_HELP_STRING([--disable-fusermount],
397 [Use system's fusermount]))
399 BUILD_FUSERMOUNT="yes"
400 if test "x$enable_fusermount" = "xno"; then
401 BUILD_FUSERMOUNT="no"
403 AC_DEFINE(GF_FUSERMOUNT, 1, [Use our own fusermount])
404 FUSERMOUNT_SUBDIR="contrib/fuse-util"
407 AC_SUBST(FUSERMOUNT_SUBDIR)
408 #end FUSERMOUNT section
412 AC_ARG_ENABLE([qemu-block],
413 AC_HELP_STRING([--enable-qemu-block],
414 [Build QEMU Block formats translator]))
416 if test "x$enable_qemu_block" != "xno"; then
417 PKG_CHECK_MODULES([GLIB], [glib-2.0],
422 if test "x$enable_qemu_block" = "xyes" -a "x$HAVE_GLIB_2" = "xno"; then
423 echo "QEMU Block formats translator requires libglib-2.0, but missing."
428 if test "x${enable_qemu_block}" != "xno" -a "x${HAVE_GLIB_2}" = "xyes"; then
430 AC_DEFINE(HAVE_QEMU_BLOCK, 1, [define if libglib-2.0 library found and QEMU
431 Block translator enabled])
434 AM_CONDITIONAL([ENABLE_QEMU_BLOCK], [test x$BUILD_QEMU_BLOCK = xyes])
436 # end QEMU_BLOCK section
439 AC_ARG_ENABLE([epoll],
440 AC_HELP_STRING([--disable-epoll],
441 [Use poll instead of epoll.]))
444 if test "x$enable_epoll" != "xno"; then
445 AC_CHECK_HEADERS([sys/epoll.h],
453 AC_ARG_ENABLE([ibverbs],
454 AC_HELP_STRING([--disable-ibverbs],
455 [Do not build the ibverbs transport]))
457 if test "x$enable_ibverbs" != "xno"; then
458 AC_CHECK_LIB([ibverbs],
459 [ibv_get_device_list],
460 [HAVE_LIBIBVERBS="yes"],
461 [HAVE_LIBIBVERBS="no"])
462 AC_CHECK_LIB([rdmacm], [rdma_create_id], [HAVE_RDMACM="yes"], [HAVE_RDMACM="no"])
465 if test "x$enable_ibverbs" = "xyes"; then
466 if test "x$HAVE_LIBIBVERBS" = "xno"; then
467 echo "ibverbs-transport requested, but libibverbs is not present."
471 if test "x$HAVE_RDMACM" = "xno"; then
472 echo "ibverbs-transport requested, but librdmacm is not present."
479 if test "x$enable_ibverbs" != "xno" -a "x$HAVE_LIBIBVERBS" = "xyes" -a "x$HAVE_RDMACM" = "xyes"; then
480 IBVERBS_SUBDIR=ib-verbs
486 AC_SUBST(IBVERBS_SUBDIR)
487 AC_SUBST(RDMA_SUBDIR)
488 # end IBVERBS section
492 AC_ARG_ENABLE([georeplication],
493 AC_HELP_STRING([--disable-georeplication],
494 [Do not install georeplication components]))
505 #disabling geo replication for non-linux platforms
506 enable_georeplication=no
510 if test "x$enable_georeplication" != "xno"; then
511 SYNCDAEMON_SUBDIR=geo-replication
514 BUILD_SYNCDAEMON="yes"
515 AM_PATH_PYTHON([2.4])
516 echo -n "checking if python is python 2.x... "
517 if echo $PYTHON_VERSION | grep ^2; then
521 AC_MSG_ERROR([only python 2.x is supported])
523 echo -n "checking if python has ctypes support... "
524 if "$PYTHON" -c 'import ctypes' 2>/dev/null; then
528 AC_MSG_ERROR([python does not have ctypes support])
531 AC_SUBST(SYNCDAEMON_COMPILE)
532 AC_SUBST(SYNCDAEMON_SUBDIR)
533 # end SYNCDAEMON section
535 # CDC xlator - check if libz is present if so enable HAVE_LIB_Z
536 echo -n "checking if libz is present... "
538 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],
539 [echo "yes (features requiring zlib enabled)" AC_DEFINE(HAVE_LIB_Z, 1, [define if zlib is present])],
542 AC_SUBST(LIBZ_CFLAGS)
544 # end CDC xlator secion
546 # check for systemtap/dtrace
548 AC_MSG_CHECKING([whether to include systemtap tracing support])
549 AC_ARG_ENABLE([systemtap],
550 [AS_HELP_STRING([--enable-systemtap],
551 [Enable inclusion of systemtap trace support])],
552 [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP="def"])
554 AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test "x${ENABLE_SYSTEMTAP}" = "xyes"])
555 AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
557 if test "x${ENABLE_SYSTEMTAP}" != "xno"; then
558 AC_CHECK_PROG(DTRACE, dtrace, "yes", "no")
559 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND="yes"],
563 if test "x${ENABLE_SYSTEMTAP}" = "xyes"; then
564 if test "x${DTRACE}" = "xno"; then
565 AC_MSG_ERROR([dtrace not found])
566 elif test "$x{SDT_H_FOUND}" = "xno"; then
567 AC_MSG_ERROR([systemtap support needs sys/sdt.h header])
571 if test "x${DTRACE}" = "xyes" -a "x${SDT_H_FOUND}" = "xyes"; then
572 AC_MSG_CHECKING([x"${DTRACE}"xy"${SDT_H_FOUND}"y])
573 AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using probes.])
576 # end of systemtap/dtrace
579 AC_ARG_ENABLE([xml-output],
580 AC_HELP_STRING([--disable-xml-output],
581 [Disable the xml output]))
582 BUILD_XML_OUTPUT="yes"
583 if test "x$enable_xml_output" != "xno"; then
584 #check if libxml is present if so enable HAVE_LIB_XML
585 m4_ifdef([AM_PATH_XML2],[AM_PATH_XML2([2.6.19])], [no_xml=yes])
586 if test "x${no_xml}" = "x"; then
587 AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
589 if test "x$enable_georeplication" != "xno"; then
590 AC_MSG_ERROR([libxml2 devel libraries not found])
592 AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
593 BUILD_XML_OUTPUT="no"
598 if test "x$enable_georeplication" != "xno"; then
599 AC_MSG_ERROR([geo-replication requires xml output])
601 BUILD_XML_OUTPUT="no"
605 dnl FreeBSD > 5 has execinfo as a Ported library for giving a workaround
606 dnl solution to GCC backtrace functionality
608 AC_CHECK_HEADERS([execinfo.h], [have_backtrace=yes],
609 AC_CHECK_LIB([execinfo], [backtrace], [have_backtrace=yes]))
610 dnl AC_MSG_ERROR([libexecinfo not found libexecinfo required.])))
612 if test "x${have_backtrace}" = "xyes"; then
613 AC_DEFINE(HAVE_BACKTRACE, 1, [define if found backtrace])
615 AC_SUBST(HAVE_BACKTRACE)
617 dnl glusterfs prints memory usage to stderr by sending it SIGUSR1
618 AC_CHECK_FUNC([malloc_stats], [have_malloc_stats=yes])
619 if test "x${have_malloc_stats}" = "xyes"; then
620 AC_DEFINE(HAVE_MALLOC_STATS, 1, [define if found malloc_stats])
622 AC_SUBST(HAVE_MALLOC_STATS)
624 dnl Linux, Solaris, Cygwin
625 AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec])
627 AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec])
630 CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063"
633 AC_CHECK_FUNC([linkat], [have_linkat=yes])
634 if test "x${have_linkat}" = "xyes"; then
635 AC_DEFINE(HAVE_LINKAT, 1, [define if found linkat])
637 AC_SUBST(HAVE_LINKAT)
639 dnl check for Monotonic clock
640 AC_CHECK_FUNC([clock_gettime], [has_monotonic_clock=yes], AC_CHECK_LIB([rt], [clock_gettime], , AC_MSG_WARN([System doesn't have monotonic clock using contrib])))
643 AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
644 AC_CONFIG_SUBDIRS(argp-standalone)
646 BUILD_ARGP_STANDALONE=no
647 if test "x${ac_cv_header_argp_h}" = "xno"; then
648 BUILD_ARGP_STANDALONE=yes
649 ARGP_STANDALONE_CPPFLAGS='-I${top_srcdir}/argp-standalone'
650 ARGP_STANDALONE_LDADD='${top_builddir}/argp-standalone/libargp.a'
653 AC_SUBST(ARGP_STANDALONE_CPPFLAGS)
654 AC_SUBST(ARGP_STANDALONE_LDADD)
656 AC_CHECK_HEADER([malloc.h], AC_DEFINE(HAVE_MALLOC_H, 1, [have malloc.h]))
658 AC_CHECK_FUNC([llistxattr], [have_llistxattr=yes])
659 if test "x${have_llistxattr}" = "xyes"; then
660 AC_DEFINE(HAVE_LLISTXATTR, 1, [define if llistxattr exists])
663 AC_CHECK_FUNC([fdatasync], [have_fdatasync=yes])
664 if test "x${have_fdatasync}" = "xyes"; then
665 AC_DEFINE(HAVE_FDATASYNC, 1, [define if fdatasync exists])
668 AC_CHECK_FUNC([fallocate], [have_fallocate=yes])
669 if test "x${have_fallocate}" = "xyes"; then
670 AC_DEFINE(HAVE_FALLOCATE, 1, [define if fallocate exists])
673 AC_CHECK_FUNC([posix_fallocate], [have_posix_fallocate=yes])
674 if test "x${have_posix_fallocate}" = "xyes"; then
675 AC_DEFINE(HAVE_POSIX_FALLOCATE, 1, [define if posix_fallocate exists])
679 # Check the distribution where you are compiling glusterfs on
682 AC_CHECK_FILE([/etc/debian_version])
683 AC_CHECK_FILE([/etc/SuSE-release])
684 AC_CHECK_FILE([/etc/redhat-release])
686 if test "x$ac_cv_file__etc_debian_version" = "xyes"; then
687 GF_DISTRIBUTION=Debian
689 if test "x$ac_cv_file__etc_SuSE_release" = "xyes"; then
692 if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
693 GF_DISTRIBUTION=Redhat
696 AC_SUBST(GF_DISTRIBUTION)
699 GF_LDFLAGS="-rdynamic"
701 # check for gcc -Werror=format-security
703 CFLAGS="-Wformat -Werror=format-security"
704 AC_MSG_CHECKING([whether $CC accepts -Werror=format-security])
705 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_format_security=yes], [cc_werror_format_security=no])
706 echo $cc_werror_format_security
707 if test "x$cc_werror_format_security" = "xno"; then
708 CFLAGS="$saved_CFLAGS"
710 CFLAGS="$saved_CFLAGS $CFLAGS"
713 # check for gcc -Werror=implicit-function-declaration
715 CFLAGS="-Werror=implicit-function-declaration"
716 AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
717 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
718 echo $cc_werror_implicit
719 if test "x$cc_werror_implicit" = "xno"; then
720 CFLAGS="$saved_CFLAGS"
722 CFLAGS="$saved_CFLAGS $CFLAGS"
727 GF_HOST_OS="GF_LINUX_HOST_OS"
728 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
729 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
730 GF_LDADD="${ARGP_STANDALONE_LDADD}"
731 GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\""
734 GF_HOST_OS="GF_SOLARIS_HOST_OS"
735 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m64"
737 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
738 GF_LDADD="${ARGP_STANDALONE_LDADD}"
739 GF_GLUSTERFS_LIBS="-lnsl -lresolv -lsocket"
741 FUSE_CLIENT_SUBDIR=""
744 GF_HOST_OS="GF_BSD_HOST_OS"
745 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_INCOMPLETE_XOPEN_C063"
746 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
747 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
748 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
749 GF_LDADD="${ARGP_STANDALONE_LDADD}"
750 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
751 GF_GLUSTERFS_LIBS="-lexecinfo"
753 GF_FUSE_LDADD="-lperfuse"
754 BUILD_FUSE_CLIENT=yes
758 GF_HOST_OS="GF_BSD_HOST_OS"
759 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
760 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
761 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
762 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
763 GF_LDADD="${ARGP_STANDALONE_LDADD}"
764 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
765 GF_GLUSTERFS_LIBS="-lexecinfo"
770 GF_HOST_OS="GF_DARWIN_HOST_OS"
772 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -bundle -undefined suppress -flat_namespace -D_XOPEN_SOURCE"
773 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
774 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
775 GF_GLUSTERFS_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -undefined suppress -flat_namespace"
776 GF_LDADD="${ARGP_STANDALONE_LDADD}"
777 GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
781 # enable debug section
782 AC_ARG_ENABLE([debug],
783 AC_HELP_STRING([--enable-debug],
784 [Enable debug build options.]))
787 AC_ARG_ENABLE([syslog],
788 AC_HELP_STRING([--disable-syslog],
789 [Disable syslog for logging]))
792 if test "x$enable_syslog" != "xno"; then
793 AC_DEFINE(GF_USE_SYSLOG, 1, [Use syslog for logging])
797 AM_CONDITIONAL([ENABLE_SYSLOG], [test x$USE_SYSLOG = xyes])
801 AC_CHECK_LIB([readline -lcurses],[readline],[RLLIBS="-lreadline -lcurses"])
802 AC_CHECK_LIB([readline -ltermcap],[readline],[RLLIBS="-lreadline -ltermcap"])
803 AC_CHECK_LIB([readline -lncurses],[readline],[RLLIBS="-lreadline -lncurses"])
805 if test "x$RLLIBS" != "x"; then
806 AC_DEFINE(HAVE_READLINE, 1, [readline enabled CLI])
811 AC_CHECK_LIB([aio],[io_setup],[LIBAIO="-laio"])
813 if test "x$LIBAIO" != "x"; then
814 AC_DEFINE(HAVE_LIBAIO, 1, [libaio based POSIX enabled])
824 if echo $PYTHON_VERSION | grep ^2; then
828 # Save flags before testing python
830 saved_CPPFLAGS=$CPPFLAGS
831 saved_LDFLAGS=$LDFLAGS
832 CFLAGS=`${PYTHON}-config --cflags`
834 LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
835 AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
836 AC_ARG_ENABLE([glupy],
837 AS_HELP_STRING([--enable-glupy],
839 case x$enable_glupy in
841 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
843 PYTHONDEV_CFLAGS="$CFLAGS"
844 PYTHONDEV_CPPFLAGS="$CPPFLAGS"
845 PYTHONDEV_LDFLAGS="$LDFLAGS"
846 AC_SUBST(PYTHONDEV_CFLAGS)
847 AC_SUBST(PYTHONDEV_CPPFLAGS)
848 AC_SUBST(PYTHONDEV_LDFLAGS)
850 AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
856 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
858 PYTHONDEV_CFLAGS="$CFLAGS"
859 PYTHONDEV_CPPFLAGS="$CPPFLAGS"
860 PYTHONDEV_LDFLAGS="$LDFLAGS"
861 AC_SUBST(PYTHONDEV_CFLAGS)
862 AC_SUBST(PYTHONDEV_CPPFLAGS)
863 AC_SUBST(PYTHONDEV_LDFLAGS)
866 ---------------------------------------------------------------------------------
867 cannot build glupy. python 2.x and python-devel/python-dev package are required.
868 ---------------------------------------------------------------------------------])
874 CPPFLAGS=$saved_CPPFLAGS
875 LDFLAGS=$saved_LDFLAGS
877 if test "x$BUILD_GLUPY" = "xyes"; then
878 BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
879 BUILD_PYTHON_LIB=python$PYTHON_VERSION
881 GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
882 GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
883 echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
884 AC_SUBST(BUILD_PYTHON_INC)
885 AC_SUBST(BUILD_PYTHON_LIB)
886 AC_SUBST(GLUPY_SUBDIR)
887 AC_SUBST(GLUPY_SUBDIR_MAKEFILE)
888 AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE)
893 # end enable debug section
896 AC_SUBST([GF_GLUSTERFS_LIBS])
897 AC_SUBST(GF_GLUSTERFS_CFLAGS)
901 AC_SUBST(GF_FUSE_LDADD)
902 AC_SUBST(GF_FUSE_CFLAGS)
905 AC_SUBST(AM_MAKEFLAGS)
906 AC_SUBST(AM_LIBTOOLFLAGS)
908 CONTRIBDIR='$(top_srcdir)/contrib'
911 GF_CPPDEFINES='-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)'
912 GF_CPPINCLUDES='-I$(top_srcdir)/libglusterfs/src -I$(CONTRIBDIR)/uuid $(UNITTEST_CPPFLAGS)'
913 GF_CPPFLAGS="$GF_CPPDEFINES $GF_CPPINCLUDES"
914 AC_SUBST([GF_CPPFLAGS])
916 AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS")
918 AM_CONDITIONAL([GF_INSTALL_VAR_LIB_GLUSTERD], test ! -d ${localstatedir}/lib/glusterd && test -d ${sysconfdir}/glusterd )
920 dnl pkg-config versioning
921 GFAPI_VERSION="6.0.0"
922 LIBGFCHANGELOG_VERSION="0.0.1"
923 AC_SUBST(GFAPI_VERSION)
924 AC_SUBST(LIBGFCHANGELOG_VERSION)
926 dnl libtool versioning
927 LIBGFXDR_LT_VERSION="0:1:0"
928 LIBGFRPC_LT_VERSION="0:1:0"
929 LIBGLUSTERFS_LT_VERSION="0:1:0"
930 LIBGFCHANGELOG_LT_VERSION="0:1:0"
931 GFAPI_LT_VERSION="6:0:0"
932 AC_SUBST(LIBGFXDR_LT_VERSION)
933 AC_SUBST(LIBGFRPC_LT_VERSION)
934 AC_SUBST(LIBGLUSTERFS_LT_VERSION)
935 AC_SUBST(LIBGFCHANGELOG_LT_VERSION)
936 AC_SUBST(GFAPI_LT_VERSION)
941 echo "GlusterFS configure summary"
942 echo "==========================="
943 echo "FUSE client : $BUILD_FUSE_CLIENT"
944 echo "Infiniband verbs : $BUILD_IBVERBS"
945 echo "epoll IO multiplex : $BUILD_EPOLL"
946 echo "argp-standalone : $BUILD_ARGP_STANDALONE"
947 echo "fusermount : $BUILD_FUSERMOUNT"
948 echo "readline : $BUILD_READLINE"
949 echo "georeplication : $BUILD_SYNCDAEMON"
950 echo "Linux-AIO : $BUILD_LIBAIO"
951 echo "Enable Debug : $BUILD_DEBUG"
952 echo "systemtap : $BUILD_SYSTEMTAP"
953 echo "Block Device xlator : $BUILD_BD_XLATOR"
954 echo "glupy : $BUILD_GLUPY"
955 echo "Use syslog : $USE_SYSLOG"
956 echo "XML output : $BUILD_XML_OUTPUT"
957 echo "QEMU Block formats : $BUILD_QEMU_BLOCK"
958 echo "Encryption xlator : $BUILD_CRYPT_XLATOR"