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.
10 [m4_esyscmd([build-aux/pkg-version --version])],
11 [gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git])
13 AC_SUBST([PACKAGE_RELEASE],
14 [m4_esyscmd([build-aux/pkg-version --release])])
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])
21 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
23 if make --help 2>&1 | grep -q no-print-directory; then
24 AM_MAKEFLAGS="$AM_MAKEFLAGS --no-print-directory";
27 if make --help 2>&1 | grep -q quiet; then
28 AM_MAKEFLAGS="$AM_MAKEFLAGS --quiet"
31 if libtool --help 2>&1 | grep -q quiet; then
32 AM_LIBTOOLFLAGS="--quiet";
35 AC_CONFIG_HEADERS([config.h])
37 AC_CONFIG_FILES([Makefile
39 libglusterfs/src/Makefile
40 geo-replication/src/peer_gsec_create
41 geo-replication/src/peer_add_secret_pub
43 glusterfsd/src/Makefile
46 rpc/rpc-lib/src/Makefile
47 rpc/rpc-transport/Makefile
48 rpc/rpc-transport/socket/Makefile
49 rpc/rpc-transport/socket/src/Makefile
50 rpc/rpc-transport/rdma/Makefile
51 rpc/rpc-transport/rdma/src/Makefile
56 xlators/meta/src/Makefile
57 xlators/mount/Makefile
58 xlators/mount/fuse/Makefile
59 xlators/mount/fuse/src/Makefile
60 xlators/mount/fuse/utils/mount.glusterfs
61 xlators/mount/fuse/utils/mount_glusterfs
62 xlators/mount/fuse/utils/Makefile
63 xlators/storage/Makefile
64 xlators/storage/posix/Makefile
65 xlators/storage/posix/src/Makefile
66 xlators/storage/bd/Makefile
67 xlators/storage/bd/src/Makefile
68 xlators/cluster/Makefile
69 xlators/cluster/afr/Makefile
70 xlators/cluster/afr/src/Makefile
71 xlators/cluster/stripe/Makefile
72 xlators/cluster/stripe/src/Makefile
73 xlators/cluster/dht/Makefile
74 xlators/cluster/dht/src/Makefile
75 xlators/performance/Makefile
76 xlators/performance/write-behind/Makefile
77 xlators/performance/write-behind/src/Makefile
78 xlators/performance/read-ahead/Makefile
79 xlators/performance/read-ahead/src/Makefile
80 xlators/performance/readdir-ahead/Makefile
81 xlators/performance/readdir-ahead/src/Makefile
82 xlators/performance/io-threads/Makefile
83 xlators/performance/io-threads/src/Makefile
84 xlators/performance/io-cache/Makefile
85 xlators/performance/io-cache/src/Makefile
86 xlators/performance/symlink-cache/Makefile
87 xlators/performance/symlink-cache/src/Makefile
88 xlators/performance/quick-read/Makefile
89 xlators/performance/quick-read/src/Makefile
90 xlators/performance/open-behind/Makefile
91 xlators/performance/open-behind/src/Makefile
92 xlators/performance/md-cache/Makefile
93 xlators/performance/md-cache/src/Makefile
94 xlators/debug/Makefile
95 xlators/debug/trace/Makefile
96 xlators/debug/trace/src/Makefile
97 xlators/debug/error-gen/Makefile
98 xlators/debug/error-gen/src/Makefile
99 xlators/debug/io-stats/Makefile
100 xlators/debug/io-stats/src/Makefile
101 xlators/protocol/Makefile
102 xlators/protocol/auth/Makefile
103 xlators/protocol/auth/addr/Makefile
104 xlators/protocol/auth/addr/src/Makefile
105 xlators/protocol/auth/login/Makefile
106 xlators/protocol/auth/login/src/Makefile
107 xlators/protocol/client/Makefile
108 xlators/protocol/client/src/Makefile
109 xlators/protocol/server/Makefile
110 xlators/protocol/server/src/Makefile
111 xlators/features/Makefile
112 xlators/features/changelog/Makefile
113 xlators/features/changelog/src/Makefile
114 xlators/features/changelog/lib/Makefile
115 xlators/features/changelog/lib/src/Makefile
116 xlators/features/glupy/Makefile
117 xlators/features/glupy/examples/Makefile
118 xlators/features/glupy/src/Makefile
119 xlators/features/glupy/src/setup.py
120 xlators/features/locks/Makefile
121 xlators/features/locks/src/Makefile
122 xlators/features/quota/Makefile
123 xlators/features/quota/src/Makefile
124 xlators/features/marker/Makefile
125 xlators/features/marker/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/mac-compat/Makefile
131 xlators/features/mac-compat/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/protect/Makefile
139 xlators/features/protect/src/Makefile
140 xlators/features/gfid-access/Makefile
141 xlators/features/gfid-access/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/playground/Makefile
147 xlators/playground/template/Makefile
148 xlators/playground/template/src/Makefile
149 xlators/encryption/Makefile
150 xlators/encryption/rot-13/Makefile
151 xlators/encryption/rot-13/src/Makefile
152 xlators/encryption/crypt/Makefile
153 xlators/encryption/crypt/src/Makefile
154 xlators/features/qemu-block/Makefile
155 xlators/features/qemu-block/src/Makefile
156 xlators/system/Makefile
157 xlators/system/posix-acl/Makefile
158 xlators/system/posix-acl/src/Makefile
160 xlators/nfs/server/Makefile
161 xlators/nfs/server/src/Makefile
162 xlators/mgmt/Makefile
163 xlators/mgmt/glusterd/Makefile
164 xlators/mgmt/glusterd/src/Makefile
169 extras/init.d/Makefile
170 extras/init.d/glusterd.plist
171 extras/init.d/glusterd-Debian
172 extras/init.d/glusterd-Redhat
173 extras/init.d/glusterd-SuSE
174 extras/systemd/Makefile
175 extras/systemd/glusterd.service
176 extras/benchmarking/Makefile
177 extras/hook-scripts/Makefile
181 extras/LinuxRPM/Makefile
182 extras/geo-rep/Makefile
183 extras/hook-scripts/add-brick/Makefile
184 extras/hook-scripts/add-brick/pre/Makefile
185 extras/hook-scripts/add-brick/post/Makefile
186 extras/hook-scripts/start/Makefile
187 extras/hook-scripts/start/post/Makefile
188 extras/hook-scripts/set/Makefile
189 extras/hook-scripts/set/post/Makefile
190 extras/hook-scripts/stop/Makefile
191 extras/hook-scripts/stop/pre/Makefile
192 extras/hook-scripts/reset/Makefile
193 extras/hook-scripts/reset/post/Makefile
194 extras/hook-scripts/reset/pre/Makefile
195 contrib/fuse-util/Makefile
196 contrib/uuid/uuid_types.h
201 api/examples/Makefile
202 geo-replication/Makefile
203 geo-replication/src/Makefile
204 geo-replication/syncdaemon/Makefile
213 AC_CHECK_PROG([RPCGEN], [rpcgen], [yes], [no])
215 if test "x$RPCGEN" = "xno"; then
216 AC_MSG_ERROR([`rpcgen` not found, glusterfs needs `rpcgen` exiting..])
219 # Initialize CFLAGS before usage
220 AC_ARG_ENABLE([debug],
221 AC_HELP_STRING([--enable-debug],
222 [Enable debug build options.]))
223 if test "x$enable_debug" = "xyes"; then
225 CFLAGS="${CFLAGS} -g -O0 -DDEBUG"
228 CFLAGS="${CFLAGS} -g -O2"
233 if ! test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -ge 7; then
234 AC_MSG_ERROR([You need at least OS X 10.7 (Lion) to build Glusterfs])
236 # OSX version lesser than 9 has llvm/clang optimization issues which leads to various segfaults
237 if test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -lt 9; then
238 CFLAGS="${CFLAGS} -g -O0 -DDEBUG"
243 AC_ARG_WITH(pkgconfigdir,
244 [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
245 [pkgconfigdir=$withval],
246 [pkgconfigdir='${libdir}/pkgconfig'])
247 AC_SUBST(pkgconfigdir)
249 AC_ARG_WITH(mountutildir,
250 [ --with-mountutildir=DIR mount helper utility in DIR @<:@/sbin@:>@],
251 [mountutildir=$withval],
252 [mountutildir='/sbin'])
253 AC_SUBST(mountutildir)
255 AC_ARG_WITH(systemddir,
256 [ --with-systemddir=DIR systemd service files in DIR @<:@/usr/lib/systemd/system@:>@],
257 [systemddir=$withval],
258 [systemddir='/usr/lib/systemd/system'])
262 [ --with-initdir=DIR init.d scripts in DIR @<:@/etc/init.d@:>@],
264 [initdir='/etc/init.d'])
267 AC_ARG_WITH(launchddir,
268 [ --with-launchddir=DIR launchd services in DIR @<:@/Library/LaunchDaemons@:>@],
269 [launchddir=$withval],
270 [launchddir='/Library/LaunchDaemons'])
274 [AS_HELP_STRING([--without-ocf], [build OCF-compliant cluster resource agents])],
282 if test "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
283 AC_MSG_ERROR([Flex or lex required to build glusterfs.])
289 AC_CHECK_SIZEOF(short)
291 AC_CHECK_SIZEOF(long)
292 AC_CHECK_SIZEOF(long long)
293 SIZEOF_SHORT=$ac_cv_sizeof_short
294 SIZEOF_INT=$ac_cv_sizeof_int
295 SIZEOF_LONG=$ac_cv_sizeof_long
296 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
297 AC_SUBST(SIZEOF_SHORT)
299 AC_SUBST(SIZEOF_LONG)
300 AC_SUBST(SIZEOF_LONG_LONG)
304 if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
305 AC_MSG_ERROR([GNU Bison required to build glusterfs.])
308 AC_CHECK_TOOL([LD],[ld])
310 AC_CHECK_LIB([crypto], [MD5], , AC_MSG_ERROR([OpenSSL crypto library is required to build glusterfs]))
312 AC_CHECK_LIB([pthread], [pthread_mutex_init], , AC_MSG_ERROR([Posix threads library is required to build glusterfs]))
314 AC_CHECK_FUNC([dlopen], [has_dlopen=yes], AC_CHECK_LIB([dl], [dlopen], , AC_MSG_ERROR([Dynamic linking library required to build glusterfs])))
316 AC_CHECK_LIB([readline], [rl_do_undo], [RL_UNDO="yes"], [RL_UNDO="no"])
318 AC_CHECK_LIB([intl], [gettext])
320 AC_CHECK_HEADERS([sys/xattr.h])
322 AC_CHECK_HEADERS([sys/ioctl.h], AC_DEFINE(HAVE_IOCTL_IN_SYS_IOCTL_H, 1, [have sys/ioctl.h]))
324 AC_CHECK_HEADERS([sys/extattr.h])
326 AC_CHECK_HEADERS([openssl/md5.h])
328 AC_CHECK_HEADERS([linux/falloc.h])
330 dnl Mac OS X does not have spinlocks
331 AC_CHECK_FUNC([pthread_spin_init], [have_spinlock=yes])
332 if test "x${have_spinlock}" = "xyes"; then
333 AC_DEFINE(HAVE_SPINLOCK, 1, [define if found spinlock])
335 AC_SUBST(HAVE_SPINLOCK)
337 dnl some os may not have GNU defined strnlen function
338 AC_CHECK_FUNC([strnlen], [have_strnlen=yes])
339 if test "x${have_strnlen}" = "xyes"; then
340 AC_DEFINE(HAVE_STRNLEN, 1, [define if found strnlen])
342 AC_SUBST(HAVE_STRNLEN)
345 AC_CHECK_FUNC([setfsuid], [have_setfsuid=yes])
346 AC_CHECK_FUNC([setfsgid], [have_setfsgid=yes])
348 if test "x${have_setfsuid}" = "xyes" -a "x${have_setfsgid}" = "xyes"; then
349 AC_DEFINE(HAVE_SET_FSID, 1, [define if found setfsuid setfsgid])
352 dnl test umount2 function
353 AC_CHECK_FUNC([umount2], [have_umount2=yes])
355 if test "x${have_umount2}" = "xyes"; then
356 AC_DEFINE(HAVE_UMOUNT2, 1, [define if found umount2])
360 AC_ARG_ENABLE([fuse-client],
361 AC_HELP_STRING([--disable-fuse-client],
362 [Do not build the fuse client. NOTE: you cannot mount glusterfs without the client]))
365 if test "x$enable_fuse_client" != "xno"; then
366 FUSE_CLIENT_SUBDIR=fuse
367 BUILD_FUSE_CLIENT="yes"
370 AC_ARG_ENABLE([bd-xlator],
371 AC_HELP_STRING([--enable-bd-xlator], [Build BD xlator]))
373 if test "x$enable_bd_xlator" != "xno"; then
374 AC_CHECK_LIB([lvm2app],
375 [lvm_init,lvm_lv_from_name],
379 if test "x$HAVE_BD_LIB" = "xyes"; then
380 # lvm_lv_from_name() has been made public with lvm2-2.02.79
383 [NEED_LVM_LV_FROM_NAME_DECL="no"],
384 [NEED_LVM_LV_FROM_NAME_DECL="yes"],
385 [[#include <lvm2app.h>]])
389 if test "x$enable_bd_xlator" = "xyes" -a "x$HAVE_BD_LIB" = "xno"; then
390 echo "BD xlator requested but required lvm2 development library not found."
395 if test "x${enable-bd-xlator}" != "xno" -a "x${HAVE_BD_LIB}" = "xyes"; then
397 AC_DEFINE(HAVE_BD_XLATOR, 1, [define if lvm2app library found and bd xlator
399 if test "x$NEED_LVM_LV_FROM_NAME_DECL" = "xyes"; then
400 AC_DEFINE(NEED_LVM_LV_FROM_NAME_DECL, 1, [defined if lvm_lv_from_name()
401 was not found in the lvm2app.h header, but can be linked])
405 AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes])
407 # start encryption/crypt section
409 AC_CHECK_HEADERS([openssl/cmac.h], [have_cmac_h=yes], [have_cmac_h=no])
411 AC_ARG_ENABLE([crypt-xlator],
412 AC_HELP_STRING([--enable-crypt-xlator], [Build crypt encryption xlator]))
414 if test "x$enable_crypt_xlator" = "xyes" -a "x$have_cmac_h" = "xno"; then
415 AC_MSG_ERROR([Encryption xlator requires OpenSSL with cmac.h])
418 BUILD_CRYPT_XLATOR=no
419 if test "x$enable_crypt_xlator" != "xno" -a "x$have_cmac_h" = "xyes"; then
420 BUILD_CRYPT_XLATOR=yes
421 AC_DEFINE(HAVE_CRYPT_XLATOR, 1, [enable building crypt encryption xlator])
424 AM_CONDITIONAL([ENABLE_CRYPT_XLATOR], [test x$BUILD_CRYPT_XLATOR = xyes])
426 AC_SUBST(FUSE_CLIENT_SUBDIR)
431 AC_ARG_ENABLE([fusermount],
432 AC_HELP_STRING([--disable-fusermount],
433 [Use system's fusermount]))
435 BUILD_FUSERMOUNT="yes"
436 if test "x$enable_fusermount" = "xno"; then
437 BUILD_FUSERMOUNT="no"
439 AC_DEFINE(GF_FUSERMOUNT, 1, [Use our own fusermount])
440 FUSERMOUNT_SUBDIR="contrib/fuse-util"
443 AC_SUBST(FUSERMOUNT_SUBDIR)
444 #end FUSERMOUNT section
448 AC_ARG_ENABLE([qemu-block],
449 AC_HELP_STRING([--enable-qemu-block],
450 [Build QEMU Block formats translator]))
452 if test "x$enable_qemu_block" != "xno"; then
453 PKG_CHECK_MODULES([GLIB], [glib-2.0],
458 if test "x$enable_qemu_block" = "xyes" -a "x$HAVE_GLIB_2" = "xno"; then
459 echo "QEMU Block formats translator requires libglib-2.0, but missing."
464 if test "x${enable_qemu_block}" != "xno" -a "x${HAVE_GLIB_2}" = "xyes"; then
466 AC_DEFINE(HAVE_QEMU_BLOCK, 1, [define if libglib-2.0 library found and QEMU
467 Block translator enabled])
471 # end QEMU_BLOCK section
474 AC_ARG_ENABLE([epoll],
475 AC_HELP_STRING([--disable-epoll],
476 [Use poll instead of epoll.]))
479 if test "x$enable_epoll" != "xno"; then
480 AC_CHECK_HEADERS([sys/epoll.h],
488 AC_ARG_ENABLE([ibverbs],
489 AC_HELP_STRING([--disable-ibverbs],
490 [Do not build the ibverbs transport]))
492 if test "x$enable_ibverbs" != "xno"; then
493 AC_CHECK_LIB([ibverbs],
494 [ibv_get_device_list],
495 [HAVE_LIBIBVERBS="yes"],
496 [HAVE_LIBIBVERBS="no"])
497 AC_CHECK_LIB([rdmacm], [rdma_create_id], [HAVE_RDMACM="yes"], [HAVE_RDMACM="no"])
500 if test "x$enable_ibverbs" = "xyes"; then
501 if test "x$HAVE_LIBIBVERBS" = "xno"; then
502 echo "ibverbs-transport requested, but libibverbs is not present."
506 if test "x$HAVE_RDMACM" = "xno"; then
507 echo "ibverbs-transport requested, but librdmacm is not present."
514 if test "x$enable_ibverbs" != "xno" -a "x$HAVE_LIBIBVERBS" = "xyes" -a "x$HAVE_RDMACM" = "xyes"; then
515 IBVERBS_SUBDIR=ib-verbs
521 AC_SUBST(IBVERBS_SUBDIR)
522 AC_SUBST(RDMA_SUBDIR)
523 # end IBVERBS section
527 AC_ARG_ENABLE([georeplication],
528 AC_HELP_STRING([--disable-georeplication],
529 [Do not install georeplication components]))
540 #disabling geo replication for non-linux platforms
541 enable_georeplication=no
545 if test "x$enable_georeplication" != "xno"; then
546 SYNCDAEMON_SUBDIR=geo-replication
549 BUILD_SYNCDAEMON="yes"
550 AM_PATH_PYTHON([2.4])
551 echo -n "checking if python is python 2.x... "
552 if echo $PYTHON_VERSION | grep ^2; then
556 AC_MSG_ERROR([only python 2.x is supported])
558 echo -n "checking if python has ctypes support... "
559 if "$PYTHON" -c 'import ctypes' 2>/dev/null; then
563 AC_MSG_ERROR([python does not have ctypes support])
566 AC_SUBST(SYNCDAEMON_COMPILE)
567 AC_SUBST(SYNCDAEMON_SUBDIR)
568 # end SYNCDAEMON section
570 # CDC xlator - check if libz is present if so enable HAVE_LIB_Z
571 echo -n "checking if libz is present... "
573 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],
574 [echo "yes (features requiring zlib enabled)" AC_DEFINE(HAVE_LIB_Z, 1, [define if zlib is present])],
577 AC_SUBST(LIBZ_CFLAGS)
579 # end CDC xlator secion
581 # check for systemtap/dtrace
583 AC_MSG_CHECKING([whether to include systemtap tracing support])
584 AC_ARG_ENABLE([systemtap],
585 [AS_HELP_STRING([--enable-systemtap],
586 [Enable inclusion of systemtap trace support])],
587 [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP="def"])
589 AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test "x${ENABLE_SYSTEMTAP}" = "xyes"])
590 AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
592 if test "x${ENABLE_SYSTEMTAP}" != "xno"; then
593 AC_CHECK_PROG(DTRACE, dtrace, "yes", "no")
594 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND="yes"],
598 if test "x${ENABLE_SYSTEMTAP}" = "xyes"; then
599 if test "x${DTRACE}" = "xno"; then
600 AC_MSG_ERROR([dtrace not found])
601 elif test "$x{SDT_H_FOUND}" = "xno"; then
602 AC_MSG_ERROR([systemtap support needs sys/sdt.h header])
606 if test "x${DTRACE}" = "xyes" -a "x${SDT_H_FOUND}" = "xyes"; then
607 AC_MSG_CHECKING([x"${DTRACE}"xy"${SDT_H_FOUND}"y])
608 AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using probes.])
611 # end of systemtap/dtrace
614 AC_ARG_ENABLE([xml-output],
615 AC_HELP_STRING([--disable-xml-output],
616 [Disable the xml output]))
617 BUILD_XML_OUTPUT="yes"
618 if test "x$enable_xml_output" != "xno"; then
619 #check if libxml is present if so enable HAVE_LIB_XML
620 m4_ifdef([AM_PATH_XML2],[AM_PATH_XML2([2.6.19])], [no_xml=yes])
621 if test "x${no_xml}" = "x"; then
622 AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
624 if test "x$enable_georeplication" != "xno"; then
625 AC_MSG_ERROR([libxml2 devel libraries not found])
627 AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
628 BUILD_XML_OUTPUT="no"
633 if test "x$enable_georeplication" != "xno"; then
634 AC_MSG_ERROR([geo-replication requires xml output])
636 BUILD_XML_OUTPUT="no"
640 dnl FreeBSD > 5 has execinfo as a Ported library for giving a workaround
641 dnl solution to GCC backtrace functionality
643 AC_CHECK_HEADERS([execinfo.h], [have_backtrace=yes],
644 AC_CHECK_LIB([execinfo], [backtrace], [have_backtrace=yes]))
645 dnl AC_MSG_ERROR([libexecinfo not found libexecinfo required.])))
647 if test "x${have_backtrace}" = "xyes"; then
648 AC_DEFINE(HAVE_BACKTRACE, 1, [define if found backtrace])
650 AC_SUBST(HAVE_BACKTRACE)
652 dnl glusterfs prints memory usage to stderr by sending it SIGUSR1
653 AC_CHECK_FUNC([malloc_stats], [have_malloc_stats=yes])
654 if test "x${have_malloc_stats}" = "xyes"; then
655 AC_DEFINE(HAVE_MALLOC_STATS, 1, [define if found malloc_stats])
657 AC_SUBST(HAVE_MALLOC_STATS)
659 dnl Linux, Solaris, Cygwin
660 AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec])
662 AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec])
665 CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063 -DCONFIG_MACHINE_BSWAP_H"
668 AC_CHECK_FUNC([linkat], [have_linkat=yes])
669 if test "x${have_linkat}" = "xyes"; then
670 AC_DEFINE(HAVE_LINKAT, 1, [define if found linkat])
672 AC_SUBST(HAVE_LINKAT)
674 dnl check for Monotonic clock
675 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])))
678 AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
679 AC_CONFIG_SUBDIRS(contrib/argp-standalone)
681 BUILD_ARGP_STANDALONE=no
682 if test "x${ac_cv_header_argp_h}" = "xno"; then
683 BUILD_ARGP_STANDALONE=yes
684 ARGP_STANDALONE_CPPFLAGS='-I${top_srcdir}/contrib/argp-standalone'
685 ARGP_STANDALONE_LDADD='${top_builddir}/contrib/argp-standalone/libargp.a'
686 ARGP_STANDALONE_DIR='${top_builddir}/contrib/argp-standalone'
689 AC_SUBST(ARGP_STANDALONE_CPPFLAGS)
690 AC_SUBST(ARGP_STANDALONE_LDADD)
691 AC_SUBST(ARGP_STANDALONE_DIR)
693 AC_CHECK_HEADER([malloc.h], AC_DEFINE(HAVE_MALLOC_H, 1, [have malloc.h]))
695 AC_CHECK_FUNC([llistxattr], [have_llistxattr=yes])
696 if test "x${have_llistxattr}" = "xyes"; then
697 AC_DEFINE(HAVE_LLISTXATTR, 1, [define if llistxattr exists])
700 AC_CHECK_FUNC([fdatasync], [have_fdatasync=no])
701 if test "x${have_fdatasync}" = "xyes"; then
702 AC_DEFINE(HAVE_FDATASYNC, 1, [define if fdatasync exists])
705 AC_CHECK_FUNC([fallocate], [have_fallocate=yes])
706 if test "x${have_fallocate}" = "xyes"; then
707 AC_DEFINE(HAVE_FALLOCATE, 1, [define if fallocate exists])
710 AC_CHECK_FUNC([posix_fallocate], [have_posix_fallocate=yes])
711 if test "x${have_posix_fallocate}" = "xyes"; then
712 AC_DEFINE(HAVE_POSIX_FALLOCATE, 1, [define if posix_fallocate exists])
715 # Check the distribution where you are compiling glusterfs on
718 AC_CHECK_FILE([/etc/debian_version])
719 AC_CHECK_FILE([/etc/SuSE-release])
720 AC_CHECK_FILE([/etc/redhat-release])
722 if test "x$ac_cv_file__etc_debian_version" = "xyes"; then
723 GF_DISTRIBUTION=Debian
725 if test "x$ac_cv_file__etc_SuSE_release" = "xyes"; then
728 if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
729 GF_DISTRIBUTION=Redhat
732 AC_SUBST(GF_DISTRIBUTION)
735 GF_LDFLAGS="-rdynamic"
737 dnl check for gcc -Werror=format-security
738 saved_GF_CFLAGS="-Wformat -Werror=format-security"
739 AC_MSG_CHECKING([whether $CC accepts -Werror=format-security])
740 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_format_security=yes], [cc_werror_format_security=no])
741 echo $cc_werror_format_security
742 if test "x$cc_werror_format_security" = "xno"; then
743 GF_CFLAGS="$GF_CFLAGS"
745 GF_CFLAGS="$saved_GF_CFLAGS $GF_CFLAGS"
748 dnl check for gcc -Werror=implicit-function-declaration
749 saved_GF_CFLAGS=$GF_CFLAGS
750 GF_CFLAGS="-Werror=implicit-function-declaration"
751 AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
752 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
753 echo $cc_werror_implicit
754 if test "x$cc_werror_implicit" = "xno"; then
755 GF_CFLAGS="$saved_GF_CFLAGS"
757 GF_CFLAGS="$saved_GF_CFLAGS $GF_CFLAGS"
760 dnl clang is mostly GCC-compatible, but its version is much lower,
761 dnl so we have to check for it.
762 AC_MSG_CHECKING([if compiling with clang])
765 [AC_LANG_PROGRAM([], [[
770 [CLANG=yes], [CLANG=no])
772 AC_MSG_RESULT([$CLANG])
774 if test "x$CLANG" = "xyes"; then
775 GF_COMPILER_FLAGS="-Wno-gnu -Wno-deprecated-declarations -Wno-enum-conversion"
781 GF_HOST_OS="GF_LINUX_HOST_OS"
782 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
783 GF_LDADD="${ARGP_STANDALONE_LDADD}"
784 GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\""
787 GF_HOST_OS="GF_SOLARIS_HOST_OS"
788 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m64"
790 GF_LDADD="${ARGP_STANDALONE_LDADD}"
791 GF_GLUSTERFS_LIBS="-lnsl -lresolv -lsocket"
793 FUSE_CLIENT_SUBDIR=""
796 GF_HOST_OS="GF_BSD_HOST_OS"
797 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_INCOMPLETE_XOPEN_C063"
798 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
799 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
800 GF_LDADD="${ARGP_STANDALONE_LDADD}"
801 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
802 GF_GLUSTERFS_LIBS="-lexecinfo"
804 GF_FUSE_LDADD="-lperfuse"
805 BUILD_FUSE_CLIENT=yes
809 GF_HOST_OS="GF_BSD_HOST_OS"
810 GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
811 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
812 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
813 GF_LDADD="${ARGP_STANDALONE_LDADD}"
814 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
815 GF_GLUSTERFS_LIBS="-lexecinfo"
820 GF_HOST_OS="GF_DARWIN_HOST_OS"
822 GF_CFLAGS="${GF_COMPILER_FLAGS} ${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -D_XOPEN_SOURCE "
823 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
824 GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
825 GF_LDADD="${ARGP_STANDALONE_LDADD}"
827 GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
828 BUILD_FUSERMOUNT="no"
829 BUILD_QEMU_BLOCK="no"
834 # enable/disable QEMU
835 AM_CONDITIONAL([ENABLE_QEMU_BLOCK], [test x$BUILD_QEMU_BLOCK = xyes])
838 # enable debug section
839 AC_ARG_ENABLE([debug],
840 AC_HELP_STRING([--enable-debug],
841 [Enable debug build options.]))
845 AC_ARG_ENABLE([syslog],
846 AC_HELP_STRING([--disable-syslog],
847 [Disable syslog for logging]))
850 if test "x$enable_syslog" != "xno"; then
851 AC_DEFINE(GF_USE_SYSLOG, 1, [Use syslog for logging])
855 AM_CONDITIONAL([ENABLE_SYSLOG], [test x$USE_SYSLOG = xyes])
859 AC_CHECK_LIB([readline -lcurses],[readline],[RLLIBS="-lreadline -lcurses"])
860 AC_CHECK_LIB([readline -ltermcap],[readline],[RLLIBS="-lreadline -ltermcap"])
861 AC_CHECK_LIB([readline -lncurses],[readline],[RLLIBS="-lreadline -lncurses"])
863 if test "x$RLLIBS" != "x"; then
864 if test "x$RL_UNDO" = "xyes"; then
865 AC_DEFINE(HAVE_READLINE, 1, [readline enabled CLI])
868 BUILD_READLINE="no (present but missing undo)"
874 AC_CHECK_LIB([aio],[io_setup],[LIBAIO="-laio"])
876 if test "x$LIBAIO" != "x"; then
877 AC_DEFINE(HAVE_LIBAIO, 1, [libaio based POSIX enabled])
887 if echo $PYTHON_VERSION | grep ^2; then
891 # Save flags before testing python
893 saved_CPPFLAGS=$CPPFLAGS
894 saved_LDFLAGS=$LDFLAGS
898 CFLAGS="`${PYTHON}-config --cflags`"
900 LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
903 CFLAGS="`${PYTHON}-config --cflags`"
905 LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
909 AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
910 AC_ARG_ENABLE([glupy],
911 AS_HELP_STRING([--enable-glupy],
913 case x$enable_glupy in
915 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
917 PYTHONDEV_CFLAGS="$CFLAGS"
918 PYTHONDEV_CPPFLAGS="$CPPFLAGS"
919 PYTHONDEV_LDFLAGS="$LDFLAGS"
920 AC_SUBST(PYTHONDEV_CFLAGS)
921 AC_SUBST(PYTHONDEV_CPPFLAGS)
922 AC_SUBST(PYTHONDEV_LDFLAGS)
924 AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
930 if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
932 PYTHONDEV_CFLAGS="$CFLAGS"
933 PYTHONDEV_CPPFLAGS="$CPPFLAGS"
934 PYTHONDEV_LDFLAGS="$LDFLAGS"
935 AC_SUBST(PYTHONDEV_CFLAGS)
936 AC_SUBST(PYTHONDEV_CPPFLAGS)
937 AC_SUBST(PYTHONDEV_LDFLAGS)
940 ---------------------------------------------------------------------------------
941 cannot build glupy. python 2.x and python-devel/python-dev package are required.
942 ---------------------------------------------------------------------------------])
948 CPPFLAGS=$saved_CPPFLAGS
949 LDFLAGS=$saved_LDFLAGS
957 if test "x$BUILD_GLUPY" = "xyes"; then
958 BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
959 BUILD_PYTHON_LIB=python$PYTHON_VERSION
961 GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
962 GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
963 echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
964 AC_SUBST(BUILD_PYTHON_INC)
965 AC_SUBST(BUILD_PYTHON_LIB)
966 AC_SUBST(GLUPY_SUBDIR)
967 AC_SUBST(GLUPY_SUBDIR_MAKEFILE)
968 AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE)
973 # end enable debug section
976 AC_SUBST([GF_GLUSTERFS_LIBS])
980 AC_SUBST(GF_FUSE_LDADD)
981 AC_SUBST(GF_FUSE_CFLAGS)
984 AC_SUBST(AM_MAKEFLAGS)
985 AC_SUBST(AM_LIBTOOLFLAGS)
987 CONTRIBDIR='$(top_srcdir)/contrib'
990 GF_CPPDEFINES='-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)'
991 GF_CPPINCLUDES='-I$(top_srcdir)/libglusterfs/src -I$(CONTRIBDIR)/uuid'
992 GF_CPPFLAGS="$GF_CPPDEFINES $GF_CPPINCLUDES"
993 AC_SUBST([GF_CPPFLAGS])
995 AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS")
997 AM_CONDITIONAL([GF_INSTALL_VAR_LIB_GLUSTERD], test ! -d ${localstatedir}/lib/glusterd && test -d ${sysconfdir}/glusterd )
999 dnl pkg-config versioning
1000 GFAPI_VERSION="7.0.0"
1001 LIBGFCHANGELOG_VERSION="0.0.1"
1002 AC_SUBST(GFAPI_VERSION)
1003 AC_SUBST(LIBGFCHANGELOG_VERSION)
1005 dnl libtool versioning
1006 LIBGFXDR_LT_VERSION="0:1:0"
1007 LIBGFRPC_LT_VERSION="0:1:0"
1008 LIBGLUSTERFS_LT_VERSION="0:1:0"
1009 LIBGFCHANGELOG_LT_VERSION="0:1:0"
1010 GFAPI_LT_VERSION="7:0:0"
1011 AC_SUBST(LIBGFXDR_LT_VERSION)
1012 AC_SUBST(LIBGFRPC_LT_VERSION)
1013 AC_SUBST(LIBGLUSTERFS_LT_VERSION)
1014 AC_SUBST(LIBGFCHANGELOG_LT_VERSION)
1015 AC_SUBST(GFAPI_LT_VERSION)
1020 echo "GlusterFS configure summary"
1021 echo "==========================="
1022 echo "FUSE client : $BUILD_FUSE_CLIENT"
1023 echo "Infiniband verbs : $BUILD_IBVERBS"
1024 echo "epoll IO multiplex : $BUILD_EPOLL"
1025 echo "argp-standalone : $BUILD_ARGP_STANDALONE"
1026 echo "fusermount : $BUILD_FUSERMOUNT"
1027 echo "readline : $BUILD_READLINE"
1028 echo "georeplication : $BUILD_SYNCDAEMON"
1029 echo "Linux-AIO : $BUILD_LIBAIO"
1030 echo "Enable Debug : $BUILD_DEBUG"
1031 echo "systemtap : $BUILD_SYSTEMTAP"
1032 echo "Block Device xlator : $BUILD_BD_XLATOR"
1033 echo "glupy : $BUILD_GLUPY"
1034 echo "Use syslog : $USE_SYSLOG"
1035 echo "XML output : $BUILD_XML_OUTPUT"
1036 echo "QEMU Block formats : $BUILD_QEMU_BLOCK"
1037 echo "Encryption xlator : $BUILD_CRYPT_XLATOR"