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/src/Makefile
108 xlators/features/locks/Makefile
109 xlators/features/locks/src/Makefile
110 xlators/features/quota/Makefile
111 xlators/features/quota/src/Makefile
112 xlators/features/marker/Makefile
113 xlators/features/marker/src/Makefile
114 xlators/features/read-only/Makefile
115 xlators/features/read-only/src/Makefile
116 xlators/features/compress/Makefile
117 xlators/features/compress/src/Makefile
118 xlators/features/mac-compat/Makefile
119 xlators/features/mac-compat/src/Makefile
120 xlators/features/quiesce/Makefile
121 xlators/features/quiesce/src/Makefile
122 xlators/features/index/Makefile
123 xlators/features/index/src/Makefile
124 xlators/features/protect/Makefile
125 xlators/features/protect/src/Makefile
126 xlators/features/gfid-access/Makefile
127 xlators/features/gfid-access/src/Makefile
128 xlators/playground/Makefile
129 xlators/playground/template/Makefile
130 xlators/playground/template/src/Makefile
131 xlators/encryption/Makefile
132 xlators/encryption/rot-13/Makefile
133 xlators/encryption/rot-13/src/Makefile
134 xlators/encryption/crypt/Makefile
135 xlators/encryption/crypt/src/Makefile
136 xlators/features/qemu-block/Makefile
137 xlators/features/qemu-block/src/Makefile
138 xlators/system/Makefile
139 xlators/system/posix-acl/Makefile
140 xlators/system/posix-acl/src/Makefile
142 xlators/nfs/server/Makefile
143 xlators/nfs/server/src/Makefile
144 xlators/mgmt/Makefile
145 xlators/mgmt/glusterd/Makefile
146 xlators/mgmt/glusterd/src/Makefile
151 extras/init.d/Makefile
152 extras/init.d/glusterd.plist
153 extras/init.d/glusterd-Debian
154 extras/init.d/glusterd-Redhat
155 extras/init.d/glusterd-SuSE
156 extras/systemd/Makefile
157 extras/systemd/glusterd.service
158 extras/benchmarking/Makefile
159 extras/hook-scripts/Makefile
163 extras/LinuxRPM/Makefile
164 extras/geo-rep/Makefile
165 extras/hook-scripts/add-brick/Makefile
166 extras/hook-scripts/add-brick/pre/Makefile
167 extras/hook-scripts/add-brick/post/Makefile
168 contrib/fuse-util/Makefile
169 contrib/uuid/uuid_types.h
174 api/examples/Makefile
175 api/examples/setup.py
176 geo-replication/Makefile
177 geo-replication/src/Makefile
178 geo-replication/syncdaemon/Makefile
187 AC_ARG_WITH(pkgconfigdir,
188 [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
189 [pkgconfigdir=$withval],
190 [pkgconfigdir='${libdir}/pkgconfig'])
191 AC_SUBST(pkgconfigdir)
193 AC_ARG_WITH(mountutildir,
194 [ --with-mountutildir=DIR mount helper utility in DIR @<:@/sbin@:>@],
195 [mountutildir=$withval],
196 [mountutildir='/sbin'])
197 AC_SUBST(mountutildir)
199 AC_ARG_WITH(systemddir,
200 [ --with-systemddir=DIR systemd service files in DIR @<:@/usr/lib/systemd/system@:>@],
201 [systemddir=$withval],
202 [systemddir='/usr/lib/systemd/system'])
206 [ --with-initdir=DIR init.d scripts in DIR @<:@/etc/init.d@:>@],
208 [initdir='/etc/init.d'])
211 AC_ARG_WITH(launchddir,
212 [ --with-launchddir=DIR launchd services in DIR @<:@/Library/LaunchDaemons@:>@],
213 [launchddir=$withval],
214 [launchddir='/Library/LaunchDaemons'])
218 [AS_HELP_STRING([--without-ocf], [build OCF-compliant cluster resource agents])],
226 if test "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
227 AC_MSG_ERROR([Flex or lex required to build glusterfs.])
233 AC_CHECK_SIZEOF(short)
235 AC_CHECK_SIZEOF(long)
236 AC_CHECK_SIZEOF(long long)
237 SIZEOF_SHORT=$ac_cv_sizeof_short
238 SIZEOF_INT=$ac_cv_sizeof_int
239 SIZEOF_LONG=$ac_cv_sizeof_long
240 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
241 AC_SUBST(SIZEOF_SHORT)
243 AC_SUBST(SIZEOF_LONG)
244 AC_SUBST(SIZEOF_LONG_LONG)
248 if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
249 AC_MSG_ERROR([GNU Bison required to build glusterfs.])
252 AC_CHECK_TOOL([LD],[ld])
254 AC_CHECK_LIB([crypto], [MD5], , AC_MSG_ERROR([OpenSSL crypto library is required to build glusterfs]))
256 AC_CHECK_LIB([pthread], [pthread_mutex_init], , AC_MSG_ERROR([Posix threads library is required to build glusterfs]))
258 AC_CHECK_FUNC([dlopen], [has_dlopen=yes], AC_CHECK_LIB([dl], [dlopen], , AC_MSG_ERROR([Dynamic linking library required to build glusterfs])))
260 AC_CHECK_FUNC([gettext], [has_gettext=yes], AC_CHECK_LIB([intl], [gettext], , AC_MSG_ERROR([gettext support is required to build glusterfs])))
262 AC_CHECK_HEADERS([sys/xattr.h])
264 AC_CHECK_HEADERS([sys/extattr.h])
266 AC_CHECK_HEADERS([openssl/md5.h])
268 AC_CHECK_HEADERS([linux/falloc.h])
272 if ! test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -ge 5; then
273 AC_MSG_ERROR([You need at least OS X 10.5 (Leopard) to build Glusterfs])
278 dnl Mac OS X does not have spinlocks
279 AC_CHECK_FUNC([pthread_spin_init], [have_spinlock=yes])
280 if test "x${have_spinlock}" = "xyes"; then
281 AC_DEFINE(HAVE_SPINLOCK, 1, [define if found spinlock])
283 AC_SUBST(HAVE_SPINLOCK)
285 dnl some os may not have GNU defined strnlen function
286 AC_CHECK_FUNC([strnlen], [have_strnlen=yes])
287 if test "x${have_strnlen}" = "xyes"; then
288 AC_DEFINE(HAVE_STRNLEN, 1, [define if found strnlen])
290 AC_SUBST(HAVE_STRNLEN)
293 AC_CHECK_FUNC([setfsuid], [have_setfsuid=yes])
294 AC_CHECK_FUNC([setfsgid], [have_setfsgid=yes])
296 if test "x${have_setfsuid}" = "xyes" -a "x${have_setfsgid}" = "xyes"; then
297 AC_DEFINE(HAVE_SET_FSID, 1, [define if found setfsuid setfsgid])
302 AC_ARG_ENABLE([fuse-client],
303 AC_HELP_STRING([--disable-fuse-client],
304 [Do not build the fuse client. NOTE: you cannot mount glusterfs without the client]))
307 if test "x$enable_fuse_client" != "xno"; then
308 FUSE_CLIENT_SUBDIR=fuse
309 BUILD_FUSE_CLIENT="yes"
312 AC_ARG_ENABLE([bd-xlator],
313 AC_HELP_STRING([--enable-bd-xlator], [Build BD xlator]))
315 if test "x$enable_bd_xlator" != "xno"; then
316 AC_CHECK_LIB([lvm2app],
317 [lvm_init,lvm_lv_from_name],
321 if test "x$HAVE_BD_LIB" = "xyes"; then
322 # lvm_lv_from_name() has been made public with lvm2-2.02.79
325 [NEED_LVM_LV_FROM_NAME_DECL="no"],
326 [NEED_LVM_LV_FROM_NAME_DECL="yes"],
327 [[#include <lvm2app.h>]])
331 if test "x$enable_bd_xlator" = "xyes" -a "x$HAVE_BD_LIB" = "xno"; then
332 echo "BD xlator requested but required lvm2 development library not found."
337 if test "x${enable-bd-xlator}" != "xno" -a "x${HAVE_BD_LIB}" = "xyes"; then
339 AC_DEFINE(HAVE_BD_XLATOR, 1, [define if lvm2app library found and bd xlator
341 if test "x$NEED_LVM_LV_FROM_NAME_DECL" = "xyes"; then
342 AC_DEFINE(NEED_LVM_LV_FROM_NAME_DECL, 1, [defined if lvm_lv_from_name()
343 was not found in the lvm2app.h header, but can be linked])
347 AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes])
349 # start encryption/crypt section
351 AC_CHECK_HEADERS([openssl/cmac.h], [have_cmac_h=yes], [have_cmac_h=no])
353 AC_ARG_ENABLE([crypt-xlator],
354 AC_HELP_STRING([--enable-crypt-xlator], [Build crypt encryption xlator]))
356 if test "x$enable_crypt_xlator" = "xyes" -a "x$have_cmac_h" = "xno"; then
357 echo "Encryption xlator requires OpenSSL with cmac.h"
361 BUILD_CRYPT_XLATOR=no
362 if test "x$enable_crypt_xlator" != "xno" -a "x$have_cmac_h" = "xyes"; then
363 BUILD_CRYPT_XLATOR=yes
364 AC_DEFINE(HAVE_CRYPT_XLATOR, 1, [enable building crypt encryption xlator])
367 AM_CONDITIONAL([ENABLE_CRYPT_XLATOR], [test x$BUILD_CRYPT_XLATOR = xyes])
369 AC_SUBST(FUSE_CLIENT_SUBDIR)
374 AC_ARG_ENABLE([fusermount],
375 AC_HELP_STRING([--disable-fusermount],
376 [Use system's fusermount]))
378 BUILD_FUSERMOUNT="yes"
379 if test "x$enable_fusermount" = "xno"; then
380 BUILD_FUSERMOUNT="no"
382 AC_DEFINE(GF_FUSERMOUNT, 1, [Use our own fusermount])
383 FUSERMOUNT_SUBDIR="contrib/fuse-util"
386 AC_SUBST(FUSERMOUNT_SUBDIR)
387 #end FUSERMOUNT section
391 AC_ARG_ENABLE([qemu-block],
392 AC_HELP_STRING([--enable-qemu-block],
393 [Build QEMU Block formats translator]))
395 if test "x$enable_qemu_block" != "xno"; then
396 PKG_CHECK_MODULES([GLIB], [glib-2.0],
401 if test "x$enable_qemu_block" = "xyes" -a "x$HAVE_GLIB_2" = "xno"; then
402 echo "QEMU Block formats translator requires libglib-2.0, but missing."
407 if test "x${enable_qemu_block}" != "xno" -a "x${HAVE_GLIB_2}" = "xyes"; then
409 AC_DEFINE(HAVE_QEMU_BLOCK, 1, [define if libglib-2.0 library found and QEMU
410 Block translator enabled])
413 AM_CONDITIONAL([ENABLE_QEMU_BLOCK], [test x$BUILD_QEMU_BLOCK = xyes])
415 # end QEMU_BLOCK section
418 AC_ARG_ENABLE([epoll],
419 AC_HELP_STRING([--disable-epoll],
420 [Use poll instead of epoll.]))
423 if test "x$enable_epoll" != "xno"; then
424 AC_CHECK_HEADERS([sys/epoll.h],
432 AC_ARG_ENABLE([ibverbs],
433 AC_HELP_STRING([--disable-ibverbs],
434 [Do not build the ibverbs transport]))
436 if test "x$enable_ibverbs" != "xno"; then
437 AC_CHECK_LIB([ibverbs],
438 [ibv_get_device_list],
439 [HAVE_LIBIBVERBS="yes"],
440 [HAVE_LIBIBVERBS="no"])
441 AC_CHECK_LIB([rdmacm], [rdma_create_id], [HAVE_RDMACM="yes"], [HAVE_RDMACM="no"])
444 if test "x$enable_ibverbs" = "xyes"; then
445 if test "x$HAVE_LIBIBVERBS" = "xno"; then
446 echo "ibverbs-transport requested, but libibverbs is not present."
450 if test "x$HAVE_RDMACM" = "xno"; then
451 echo "ibverbs-transport requested, but librdmacm is not present."
458 if test "x$enable_ibverbs" != "xno" -a "x$HAVE_LIBIBVERBS" = "xyes" -a "x$HAVE_RDMACM" = "xyes"; then
459 IBVERBS_SUBDIR=ib-verbs
465 AC_SUBST(IBVERBS_SUBDIR)
466 AC_SUBST(RDMA_SUBDIR)
467 # end IBVERBS section
471 AC_ARG_ENABLE([georeplication],
472 AC_HELP_STRING([--disable-georeplication],
473 [Do not install georeplication components]))
484 #disabling geo replication for non-linux platforms
485 enable_georeplication=no
489 if test "x$enable_georeplication" != "xno"; then
490 SYNCDAEMON_SUBDIR=geo-replication
493 BUILD_SYNCDAEMON="yes"
494 AM_PATH_PYTHON([2.4])
495 echo -n "checking if python is python 2.x... "
496 if echo $PYTHON_VERSION | grep ^2; then
500 AC_MSG_ERROR([only python 2.x is supported])
502 echo -n "checking if python has ctypes support... "
503 if "$PYTHON" -c 'import ctypes' 2>/dev/null; then
507 AC_MSG_ERROR([python does not have ctypes support])
510 AC_SUBST(SYNCDAEMON_COMPILE)
511 AC_SUBST(SYNCDAEMON_SUBDIR)
512 # end SYNCDAEMON section
514 # CDC xlator - check if libz is present if so enable HAVE_LIB_Z
515 echo -n "checking if libz is present... "
517 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],
518 [echo "yes (features requiring zlib enabled)" AC_DEFINE(HAVE_LIB_Z, 1, [define if zlib is present])],
521 AC_SUBST(LIBZ_CFLAGS)
523 # end CDC xlator secion
525 # check for systemtap/dtrace
527 AC_MSG_CHECKING([whether to include systemtap tracing support])
528 AC_ARG_ENABLE([systemtap],
529 [AS_HELP_STRING([--enable-systemtap],
530 [Enable inclusion of systemtap trace support])],
531 [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP="def"])
533 AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test "x${ENABLE_SYSTEMTAP}" = "xyes"])
534 AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
536 if test "x${ENABLE_SYSTEMTAP}" != "xno"; then
537 AC_CHECK_PROG(DTRACE, dtrace, "yes", "no")
538 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND="yes"],
542 if test "x${ENABLE_SYSTEMTAP}" = "xyes"; then
543 if test "x${DTRACE}" = "xno"; then
544 AC_MSG_ERROR([dtrace not found])
545 elif test "$x{SDT_H_FOUND}" = "xno"; then
546 AC_MSG_ERROR([systemtap support needs sys/sdt.h header])
550 if test "x${DTRACE}" = "xyes" -a "x${SDT_H_FOUND}" = "xyes"; then
551 AC_MSG_CHECKING([x"${DTRACE}"xy"${SDT_H_FOUND}"y])
552 AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using probes.])
555 # end of systemtap/dtrace
558 AC_ARG_ENABLE([xml-output],
559 AC_HELP_STRING([--disable-xml-output],
560 [Disable the xml output]))
561 BUILD_XML_OUTPUT="yes"
562 if test "x$enable_xml_output" != "xno"; then
563 #check if libxml is present if so enable HAVE_LIB_XML
564 m4_ifdef([AM_PATH_XML2],[AM_PATH_XML2([2.6.19])], [no_xml=yes])
565 if test "x${no_xml}" = "x"; then
566 AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
568 AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
569 BUILD_XML_OUTPUT="no"
572 BUILD_XML_OUTPUT="no"
576 dnl FreeBSD > 5 has execinfo as a Ported library for giving a workaround
577 dnl solution to GCC backtrace functionality
579 AC_CHECK_HEADERS([execinfo.h], [have_backtrace=yes],
580 AC_CHECK_LIB([execinfo], [backtrace], [have_backtrace=yes]))
581 dnl AC_MSG_ERROR([libexecinfo not found libexecinfo required.])))
583 if test "x${have_backtrace}" = "xyes"; then
584 AC_DEFINE(HAVE_BACKTRACE, 1, [define if found backtrace])
586 AC_SUBST(HAVE_BACKTRACE)
588 dnl glusterfs prints memory usage to stderr by sending it SIGUSR1
589 AC_CHECK_FUNC([malloc_stats], [have_malloc_stats=yes])
590 if test "x${have_malloc_stats}" = "xyes"; then
591 AC_DEFINE(HAVE_MALLOC_STATS, 1, [define if found malloc_stats])
593 AC_SUBST(HAVE_MALLOC_STATS)
595 dnl Linux, Solaris, Cygwin
596 AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec])
598 AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec])
601 CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063"
604 AC_CHECK_FUNC([linkat], [have_linkat=yes])
605 if test "x${have_linkat}" = "xyes"; then
606 AC_DEFINE(HAVE_LINKAT, 1, [define if found linkat])
608 AC_SUBST(HAVE_LINKAT)
610 dnl check for Monotonic clock
611 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])))
614 AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
615 AC_CONFIG_SUBDIRS(argp-standalone)
617 BUILD_ARGP_STANDALONE=no
618 if test "x${ac_cv_header_argp_h}" = "xno"; then
619 BUILD_ARGP_STANDALONE=yes
620 ARGP_STANDALONE_CPPFLAGS='-I${top_srcdir}/argp-standalone'
621 ARGP_STANDALONE_LDADD='${top_builddir}/argp-standalone/libargp.a'
624 AC_SUBST(ARGP_STANDALONE_CPPFLAGS)
625 AC_SUBST(ARGP_STANDALONE_LDADD)
627 AC_CHECK_HEADER([malloc.h], AC_DEFINE(HAVE_MALLOC_H, 1, [have malloc.h]))
629 AC_CHECK_FUNC([llistxattr], [have_llistxattr=yes])
630 if test "x${have_llistxattr}" = "xyes"; then
631 AC_DEFINE(HAVE_LLISTXATTR, 1, [define if llistxattr exists])
634 AC_CHECK_FUNC([fdatasync], [have_fdatasync=yes])
635 if test "x${have_fdatasync}" = "xyes"; then
636 AC_DEFINE(HAVE_FDATASYNC, 1, [define if fdatasync exists])
639 AC_CHECK_FUNC([fallocate], [have_fallocate=yes])
640 if test "x${have_fallocate}" = "xyes"; then
641 AC_DEFINE(HAVE_FALLOCATE, 1, [define if fallocate exists])
644 AC_CHECK_FUNC([posix_fallocate], [have_posix_fallocate=yes])
645 if test "x${have_posix_fallocate}" = "xyes"; then
646 AC_DEFINE(HAVE_POSIX_FALLOCATE, 1, [define if posix_fallocate exists])
650 # Check the distribution where you are compiling glusterfs on
653 AC_CHECK_FILE([/etc/debian_version])
654 AC_CHECK_FILE([/etc/SuSE-release])
655 AC_CHECK_FILE([/etc/redhat-release])
657 if test "x$ac_cv_file__etc_debian_version" = "xyes"; then
658 GF_DISTRIBUTION=Debian
660 if test "x$ac_cv_file__etc_SuSE_release" = "xyes"; then
663 if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
664 GF_DISTRIBUTION=Redhat
667 AC_SUBST(GF_DISTRIBUTION)
670 GF_LDFLAGS="-rdynamic"
672 # check for gcc -Werror=format-security
674 CFLAGS="-Wformat -Werror=format-security"
675 AC_MSG_CHECKING([whether $CC accepts -Werror=format-security])
676 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_format_security=yes], [cc_werror_format_security=no])
677 echo $cc_werror_format_security
678 if test "x$cc_werror_format_security" = "xno"; then
679 CFLAGS="$saved_CFLAGS"
681 CFLAGS="$saved_CFLAGS $CFLAGS"
684 # check for gcc -Werror=implicit-function-declaration
686 CFLAGS="-Werror=implicit-function-declaration"
687 AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
688 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
689 echo $cc_werror_implicit
690 if test "x$cc_werror_implicit" = "xno"; then
691 CFLAGS="$saved_CFLAGS"
693 CFLAGS="$saved_CFLAGS $CFLAGS"
698 GF_HOST_OS="GF_LINUX_HOST_OS"
699 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0"
700 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
701 GF_LDADD="${ARGP_STANDALONE_LDADD}"
702 GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\""
705 GF_HOST_OS="GF_SOLARIS_HOST_OS"
706 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -O0 -m64"
708 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
709 GF_LDADD="${ARGP_STANDALONE_LDADD}"
710 GF_GLUSTERFS_LIBS="-lnsl -lresolv -lsocket"
712 FUSE_CLIENT_SUBDIR=""
715 GF_HOST_OS="GF_BSD_HOST_OS"
716 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_INCOMPLETE_XOPEN_C063"
717 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
718 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
719 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
720 GF_LDADD="${ARGP_STANDALONE_LDADD}"
721 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
722 GF_GLUSTERFS_LIBS="-lexecinfo"
724 GF_FUSE_LDADD="-lperfuse"
725 BUILD_FUSE_CLIENT=yes
729 GF_HOST_OS="GF_BSD_HOST_OS"
730 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0"
731 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
732 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
733 GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
734 GF_LDADD="${ARGP_STANDALONE_LDADD}"
735 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
736 GF_GLUSTERFS_LIBS="-lexecinfo"
741 GF_HOST_OS="GF_DARWIN_HOST_OS"
743 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -bundle -undefined suppress -flat_namespace -D_XOPEN_SOURCE -O0"
744 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
745 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
746 GF_GLUSTERFS_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -undefined suppress -flat_namespace -O0"
747 GF_LDADD="${ARGP_STANDALONE_LDADD}"
748 GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
752 # enable debug section
753 AC_ARG_ENABLE([debug],
754 AC_HELP_STRING([--enable-debug],
755 [Enable debug build options.]))
758 AC_ARG_ENABLE([syslog],
759 AC_HELP_STRING([--disable-syslog],
760 [Disable syslog for logging]))
763 if test "x$enable_syslog" != "xno"; then
764 AC_DEFINE(GF_USE_SYSLOG, 1, [Use syslog for logging])
768 AM_CONDITIONAL([ENABLE_SYSLOG], [test x$USE_SYSLOG = xyes])
772 AC_CHECK_LIB([readline -lcurses],[readline],[RLLIBS="-lreadline -lcurses"])
773 AC_CHECK_LIB([readline -ltermcap],[readline],[RLLIBS="-lreadline -ltermcap"])
774 AC_CHECK_LIB([readline -lncurses],[readline],[RLLIBS="-lreadline -lncurses"])
776 if test "x$RLLIBS" != "x"; then
777 AC_DEFINE(HAVE_READLINE, 1, [readline enabled CLI])
782 AC_CHECK_LIB([aio],[io_setup],[LIBAIO="-laio"])
784 if test "x$LIBAIO" != "x"; then
785 AC_DEFINE(HAVE_LIBAIO, 1, [libaio based POSIX enabled])
795 if echo $PYTHON_VERSION | grep ^2; then
799 saved_CPPFLAGS=$CPPFLAGS
800 saved_LDFLAGS=$LDFLAGS
801 CFLAGS=`${PYTHON}-config --cflags`
803 LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
804 AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
805 AC_ARG_ENABLE([glupy],
806 AS_HELP_STRING([--enable-glupy],
808 case x$enable_glupy in
810 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
812 saved_CFLAGS="$saved_CFLAGS $CFLAGS"
813 saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
814 saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
816 AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
822 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
824 saved_CFLAGS="$saved_CFLAGS $CFLAGS"
825 saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
826 saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
829 ---------------------------------------------------------------------------------
830 cannot build glupy. python 2.x and python-devel/python-dev package are required.
831 ---------------------------------------------------------------------------------])
836 CPPFLAGS=$saved_CPPFLAGS
837 LDFLAGS=$saved_LDFLAGS
839 if test "x$BUILD_GLUPY" = "xyes"; then
840 BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
841 BUILD_PYTHON_LIB=python$PYTHON_VERSION
843 GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
844 GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
845 echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
846 AC_SUBST(BUILD_PYTHON_INC)
847 AC_SUBST(BUILD_PYTHON_LIB)
848 AC_SUBST(GLUPY_SUBDIR)
849 AC_SUBST(GLUPY_SUBDIR_MAKEFILE)
850 AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE)
854 # Other stuff (most notably the glupy section) might have injected another -O2
855 # into CFLAGS, so *do this last*.
857 if test "x$enable_debug" = "xyes"; then
859 CFLAGS=`echo $CFLAGS | sed -e s/O2/O0/g`
864 # end enable debug section
867 AC_SUBST([GF_GLUSTERFS_LIBS])
868 AC_SUBST(GF_GLUSTERFS_CFLAGS)
872 AC_SUBST(GF_FUSE_LDADD)
873 AC_SUBST(GF_FUSE_CFLAGS)
876 AC_SUBST(AM_MAKEFLAGS)
877 AC_SUBST(AM_LIBTOOLFLAGS)
879 CONTRIBDIR='$(top_srcdir)/contrib'
882 GF_CPPDEFINES='-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)'
883 GF_CPPINCLUDES='-I$(top_srcdir)/libglusterfs/src -I$(CONTRIBDIR)/uuid'
884 GF_CPPFLAGS="$GF_CPPDEFINES $GF_CPPINCLUDES"
885 AC_SUBST([GF_CPPFLAGS])
887 AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS")
889 AM_CONDITIONAL([GF_INSTALL_VAR_LIB_GLUSTERD], test ! -d ${localstatedir}/lib/glusterd && test -d ${sysconfdir}/glusterd )
891 dnl pkg-config versioning
892 GFAPI_VERSION="0.0.6"
893 LIBGFCHANGELOG_VERSION="0.0.1"
894 AC_SUBST(GFAPI_VERSION)
895 AC_SUBST(LIBGFCHANGELOG_VERSION)
897 dnl libtool versioning
898 LIBGFXDR_LT_VERSION="0:1:0"
899 LIBGFRPC_LT_VERSION="0:1:0"
900 LIBGLUSTERFS_LT_VERSION="0:1:0"
901 LIBGFCHANGELOG_LT_VERSION="0:1:0"
902 GFAPI_LT_VERSION="0:6:0"
903 AC_SUBST(LIBGFXDR_LT_VERSION)
904 AC_SUBST(LIBGFRPC_LT_VERSION)
905 AC_SUBST(LIBGLUSTERFS_LT_VERSION)
906 AC_SUBST(LIBGFCHANGELOG_LT_VERSION)
907 AC_SUBST(GFAPI_LT_VERSION)
912 echo "GlusterFS configure summary"
913 echo "==========================="
914 echo "FUSE client : $BUILD_FUSE_CLIENT"
915 echo "Infiniband verbs : $BUILD_IBVERBS"
916 echo "epoll IO multiplex : $BUILD_EPOLL"
917 echo "argp-standalone : $BUILD_ARGP_STANDALONE"
918 echo "fusermount : $BUILD_FUSERMOUNT"
919 echo "readline : $BUILD_READLINE"
920 echo "georeplication : $BUILD_SYNCDAEMON"
921 echo "Linux-AIO : $BUILD_LIBAIO"
922 echo "Enable Debug : $BUILD_DEBUG"
923 echo "systemtap : $BUILD_SYSTEMTAP"
924 echo "Block Device xlator : $BUILD_BD_XLATOR"
925 echo "glupy : $BUILD_GLUPY"
926 echo "Use syslog : $USE_SYSLOG"
927 echo "XML output : $BUILD_XML_OUTPUT"
928 echo "QEMU Block formats : $BUILD_QEMU_BLOCK"
929 echo "Encryption xlator : $BUILD_CRYPT_XLATOR"