1 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 #* vim:expandtab:shiftwidth=8:tabstop=8:
6 # Wrapper for AC_CONFIG_SUBDIR
8 AC_DEFUN([LC_CONFIG_SRCDIR],
9 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
17 # lustre specific paths
19 AC_DEFUN([LC_PATH_DEFAULTS],
20 [# ptlrpc kernel build requires this
28 demodir='$(docdir)/demo'
31 pkgexampledir='${pkgdatadir}/examples'
32 AC_SUBST(pkgexampledir)
38 # is the target os supported?
40 AC_DEFUN([LC_TARGET_SUPPORTED],
52 # Ensure stack size big than 8k in Lustre server (all kernels)
54 AC_DEFUN([LC_STACK_SIZE],
55 [AC_MSG_CHECKING([stack size big than 8k])
56 LB_LINUX_TRY_COMPILE([
57 #include <linux/thread_info.h>
59 #if THREAD_SIZE < 8192
60 #error "stack size < 8192"
65 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
70 # LC_FUNC_DEV_SET_RDONLY
72 # check for the old-style dev_set_rdonly which took an extra "devno" param
73 # and can only set a single device to discard writes at one time
75 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
76 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
77 LB_LINUX_TRY_COMPILE([
79 #include <linux/blkdev.h>
81 #ifndef HAVE_CLEAR_RDONLY_ON_PUT
82 #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
86 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
88 AC_MSG_ERROR([no, Linux kernel source needs to be patches by lustre
89 kernel patches from Lustre version 1.4.3 or above.])
96 # setup, check the backing filesystem
98 AC_DEFUN([LC_CONFIG_BACKINGFS],
102 if test x$with_ldiskfs = xno ; then
103 if test x$linux25$enable_server = xyesyes ; then
104 AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
108 LB_DEFINE_LDISKFS_OPTIONS
111 AC_MSG_CHECKING([which backing filesystem to use])
112 AC_MSG_RESULT([$BACKINGFS])
119 # the pinger is temporary, until we have the recovery node in place
121 AC_DEFUN([LC_CONFIG_PINGER],
122 [AC_MSG_CHECKING([whether to enable pinger support])
123 AC_ARG_ENABLE([pinger],
124 AC_HELP_STRING([--disable-pinger],
125 [disable recovery pinger support]),
126 [],[enable_pinger='yes'])
127 AC_MSG_RESULT([$enable_pinger])
128 if test x$enable_pinger != xno ; then
129 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
136 # do checksum of bulk data between client and OST
138 AC_DEFUN([LC_CONFIG_CHECKSUM],
139 [AC_MSG_CHECKING([whether to enable data checksum support])
140 AC_ARG_ENABLE([checksum],
141 AC_HELP_STRING([--disable-checksum],
142 [disable data checksum support]),
143 [],[enable_checksum='yes'])
144 AC_MSG_RESULT([$enable_checksum])
145 if test x$enable_checksum != xno ; then
146 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
151 # LC_HEADER_LDISKFS_XATTR
153 # CHAOS kernel-devel package will not include fs/ldiskfs/xattr.h
155 AC_DEFUN([LC_HEADER_LDISKFS_XATTR],
156 [AC_MSG_CHECKING([if ldiskfs has xattr.h header])
157 tmp_flags="$EXTRA_KCFLAGS"
158 EXTRA_KCFLAGS="-I$LINUX/fs -I$LDISKFS_DIR -I$LDISKFS_DIR/ldiskfs"
159 LB_LINUX_TRY_COMPILE([
160 #include <ldiskfs/xattr.h>
162 ldiskfs_xattr_get(NULL, 0, "", NULL, 0);
163 ldiskfs_xattr_set_handle(NULL, NULL, 0, "", NULL, 0, 0);
167 AC_DEFINE(HAVE_LDISKFS_XATTR_H, 1, [ldiskfs/xattr.h found])
171 EXTRA_KCFLAGS="$tmp_flags"
175 # LC_CONFIG_HEALTH_CHECK_WRITE
177 # Turn off the actual write to the disk
179 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
180 [AC_MSG_CHECKING([whether to enable a write with the health check])
181 AC_ARG_ENABLE([health_write],
182 AC_HELP_STRING([--enable-health_write],
183 [enable disk writes when doing health check]),
184 [],[enable_health_write='no'])
185 AC_MSG_RESULT([$enable_health_write])
186 if test x$enable_health_write != xno ; then
187 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
192 # LC_CONFIG_LIBLUSTRE_RECOVERY
194 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
195 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
196 AC_ARG_ENABLE([liblustre-recovery],
197 AC_HELP_STRING([--disable-liblustre-recovery],
198 [disable liblustre recovery support]),
199 [],[enable_liblustre_recovery='yes'])
200 AC_MSG_RESULT([$enable_liblustre_recovery])
201 if test x$enable_liblustre_recovery != xno ; then
202 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
207 # LC_CONFIG_OBD_BUFFER_SIZE
209 # the maximum buffer size of lctl ioctls
211 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
212 [AC_MSG_CHECKING([maximum OBD ioctl size])
213 AC_ARG_WITH([obd-buffer-size],
214 AC_HELP_STRING([--with-obd-buffer-size=[size]],
215 [set lctl ioctl maximum bytes (default=8192)]),
217 OBD_BUFFER_SIZE=$with_obd_buffer_size
221 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
222 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
228 # AIX does not have statfs.f_namelen
230 AC_DEFUN([LC_STRUCT_STATFS],
231 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
232 LB_LINUX_TRY_COMPILE([
233 #include <linux/vfs.h>
239 AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
246 # LC_READLINK_SSIZE_T
248 AC_DEFUN([LC_READLINK_SSIZE_T],
249 [AC_MSG_CHECKING([if readlink returns ssize_t])
253 ssize_t readlink(const char *, char *, size_t);
256 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
263 # LC_FUNC_MS_FLOCK_LOCK
265 # 2.6.5 kernel has MS_FLOCK_LOCK sb flag
267 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
268 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
269 LB_LINUX_TRY_COMPILE([
270 #include <linux/fs.h>
272 int flags = MS_FLOCK_LOCK;
274 AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
275 [kernel has MS_FLOCK_LOCK flag])
283 # LC_FUNC_HAVE_CAN_SLEEP_ARG
285 # 2.6.5 kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()
287 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
288 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
289 LB_LINUX_TRY_COMPILE([
290 #include <linux/fs.h>
294 struct file_lock *file_lock;
295 flock_lock_file_wait(file, file_lock, cansleep);
297 AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
298 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
306 # LC_FUNC_RELEASEPAGE_WITH_GFP
308 # 2.6.9 ->releasepage() takes a gfp_t arg
309 # This kernel defines gfp_t (HAS_GFP_T) but doesn't use it for this function,
310 # while others either don't have gfp_t or pass gfp_t as the parameter.
312 AC_DEFUN([LC_FUNC_RELEASEPAGE_WITH_GFP],
313 [AC_MSG_CHECKING([if releasepage has a gfp_t parameter])
314 RELEASEPAGE_WITH_GFP="$(grep -c 'releasepage.*gfp_t' $LINUX/include/linux/fs.h)"
315 if test "$RELEASEPAGE_WITH_GFP" != 0 ; then
316 AC_DEFINE(HAVE_RELEASEPAGE_WITH_GFP, 1,
317 [releasepage with gfp_t parameter])
325 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
327 AC_DEFUN([LC_FILEMAP_POPULATE],
328 [AC_MSG_CHECKING([for exported filemap_populate])
329 LB_LINUX_TRY_COMPILE([
330 #include <asm/page.h>
331 #include <linux/mm.h>
333 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
336 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
345 AC_DEFUN([LC_D_ADD_UNIQUE],
346 [AC_MSG_CHECKING([for d_add_unique])
347 LB_LINUX_TRY_COMPILE([
348 #include <linux/dcache.h>
350 d_add_unique(NULL, NULL);
353 AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
362 AC_DEFUN([LC_BIT_SPINLOCK_H],
363 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
364 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
365 LB_LINUX_TRY_COMPILE([
366 #include <asm/processor.h>
367 #include <linux/spinlock.h>
368 #include <linux/bit_spinlock.h>
371 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
380 # After 2.6.26 we no longer have xattr_acl.h
382 AC_DEFUN([LC_XATTR_ACL],
383 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
384 AC_MSG_CHECKING([if xattr_acl.h can be compiled])
385 LB_LINUX_TRY_COMPILE([
386 #include <linux/xattr_acl.h>
389 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
400 AC_DEFUN([LC_STRUCT_INTENT_FILE],
401 [AC_MSG_CHECKING([if struct open_intent has a file field])
402 LB_LINUX_TRY_COMPILE([
403 #include <linux/fs.h>
404 #include <linux/namei.h>
406 struct open_intent intent;
410 AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
418 # After 2.6.16 the xattr_acl API is removed, and posix_acl is used instead
420 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
421 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
422 AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
423 LB_LINUX_TRY_COMPILE([
424 #ifdef CONFIG_FS_POSIX_ACL
425 # include <linux/fs.h>
427 #include <linux/posix_acl_xattr.h>
430 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
442 # only for Lustre-patched kernels
444 AC_DEFUN([LC_LUSTRE_VERSION_H],
445 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
446 rm -f "$LUSTRE/include/linux/lustre_version.h"
448 touch "$LUSTRE/include/linux/lustre_version.h"
449 if test x$enable_server = xyes ; then
450 AC_MSG_WARN([Unpatched kernel detected.])
451 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
452 AC_MSG_WARN([disabling server build])
461 AC_DEFUN([LC_CAPA_CRYPTO],
462 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
463 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
465 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
466 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
468 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
469 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
474 # LC_CONFIG_RMTCLIENT
477 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
479 AC_DEFUN([LC_CONFIG_RMTCLIENT],
480 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
481 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
485 AC_DEFUN([LC_SUNRPC_CACHE],
486 [AC_MSG_CHECKING([if sunrpc struct cache_head uses kref])
487 LB_LINUX_TRY_COMPILE([
488 #include <linux/sunrpc/cache.h>
490 struct cache_head ch;
494 AC_DEFINE(HAVE_SUNRPC_CACHE_V2, 1, [sunrpc cache facility v2])
500 AC_DEFUN([LC_CONFIG_SUNRPC],
501 [LB_LINUX_CONFIG_IM([SUNRPC],[],
502 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
507 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
509 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
510 [AC_MSG_CHECKING([whether to enable gss keyring backend])
511 AC_ARG_ENABLE([gss_keyring],
512 [AC_HELP_STRING([--disable-gss-keyring],
513 [disable gss keyring backend])],
514 [],[enable_gss_keyring='yes'])
515 AC_MSG_RESULT([$enable_gss_keyring])
517 if test x$enable_gss_keyring != xno; then
518 LB_LINUX_CONFIG_IM([KEYS],[],
519 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
521 AC_CHECK_LIB([keyutils], [keyctl_search], [],
522 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
524 AC_DEFINE([HAVE_GSS_KEYRING], [1],
525 [Define this if you enable gss keyring backend])
530 # LC_CONFIG_GSS (default disabled)
532 # Build gss and related tools of Lustre. Currently both kernel and user space
533 # parts are depend on linux platform.
535 AC_DEFUN([LC_CONFIG_GSS],
536 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
538 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
539 [],[enable_gss='no'])
540 AC_MSG_RESULT([$enable_gss])
542 if test x$enable_gss == xyes; then
543 LC_CONFIG_GSS_KEYRING
546 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
548 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
549 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
550 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
551 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
552 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
553 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
554 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
555 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
557 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
558 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
559 [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
560 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
561 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
563 AC_SUBST(GSSAPI_LIBS)
569 # LC_EXPORT_SYNCHRONIZE_RCU
570 # after 2.6.12 synchronize_rcu is preferred over synchronize_kernel
571 AC_DEFUN([LC_EXPORT_SYNCHRONIZE_RCU],
572 [LB_CHECK_SYMBOL_EXPORT([synchronize_rcu],
573 [kernel/rcupdate.c],[
574 AC_DEFINE(HAVE_SYNCHRONIZE_RCU, 1,
575 [in 2.6.12 synchronize_rcu preferred over synchronize_kernel])
581 # after 2.6.15 inode have i_mutex intead of i_sem
582 AC_DEFUN([LC_INODE_I_MUTEX],
583 [AC_MSG_CHECKING([if inode has i_mutex ])
584 LB_LINUX_TRY_COMPILE([
585 #include <linux/mutex.h>
586 #include <linux/fs.h>
591 mutex_unlock(&i.i_mutex);
594 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
595 [after 2.6.15 inode have i_mutex intead of i_sem])
602 # after 2.6.18 seq_file has lock intead of sem
603 AC_DEFUN([LC_SEQ_LOCK],
604 [AC_MSG_CHECKING([if struct seq_file has lock field])
605 LB_LINUX_TRY_COMPILE([
606 #include <linux/seq_file.h>
610 mutex_unlock(&seq.lock);
613 AC_DEFINE(HAVE_SEQ_LOCK, 1,
614 [after 2.6.18 seq_file has lock intead of sem])
621 # after 2.6.17 dquote use mutex instead if semaphore
622 AC_DEFUN([LC_DQUOTOFF_MUTEX],
623 [AC_MSG_CHECKING([use dqonoff_mutex])
624 LB_LINUX_TRY_COMPILE([
625 #include <linux/mutex.h>
626 #include <linux/fs.h>
627 #include <linux/quota.h>
629 struct quota_info dq;
631 mutex_unlock(&dq.dqonoff_mutex);
634 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
635 [after 2.6.17 dquote use mutex instead if semaphore])
642 # LC_STATFS_DENTRY_PARAM
643 # starting from 2.6.18 linux kernel uses dentry instead of
644 # super_block for first vfs_statfs argument
646 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
647 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
648 LB_LINUX_TRY_COMPILE([
649 #include <linux/fs.h>
651 int vfs_statfs(struct dentry *, struct kstatfs *);
653 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
654 [first parameter of vfs_statfs is dentry])
663 # starting from 2.6.18 kernel don't export do_kern_mount
664 # and want to use vfs_kern_mount instead.
666 AC_DEFUN([LC_VFS_KERN_MOUNT],
667 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
668 LB_LINUX_TRY_COMPILE([
669 #include <linux/mount.h>
671 vfs_kern_mount(NULL, 0, NULL, NULL);
673 AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
674 [vfs_kern_mount exist in kernel])
683 # starting from 2.6.18 kernel don't export do_kern_mount
684 # and want to use vfs_kern_mount instead.
686 AC_DEFUN([LC_D_OBTAIN_ALIAS],
687 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
688 LB_LINUX_TRY_COMPILE([
689 #include <linux/dcache.h>
691 d_obtain_alias(NULL);
693 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
694 [d_obtain_alias exist in kernel])
702 # LC_INVALIDATEPAGE_RETURN_INT
703 # 2.6.17 changes return type for invalidatepage to 'void' from 'int'
705 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
706 [AC_MSG_CHECKING([invalidatepage has return int])
707 LB_LINUX_TRY_COMPILE([
708 #include <linux/buffer_head.h>
710 int rc = block_invalidatepage(NULL, 0);
713 AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
714 [Define if return type of invalidatepage should be int])
720 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
721 # after 2.6.18 umount_begin has different parameters
722 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
723 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
724 tmp_flags="$EXTRA_KCFLAGS"
725 EXTRA_KCFLAGS="-Werror"
726 LB_LINUX_TRY_COMPILE([
727 #include <linux/fs.h>
730 static void cfg_umount_begin (struct vfsmount *v, int flags)
735 static struct super_operations cfg_super_operations = {
736 .umount_begin = cfg_umount_begin,
739 cfg_super_operations.umount_begin(NULL,0);
742 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
743 [Define umount_begin need second argument])
747 EXTRA_KCFLAGS="$tmp_flags"
750 # inode have i_private field since 2.6.17
751 AC_DEFUN([LC_INODE_IPRIVATE],
752 [AC_MSG_CHECKING([if inode has a i_private field])
753 LB_LINUX_TRY_COMPILE([
754 #include <linux/fs.h>
760 AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
761 [struct inode has i_private field])
768 # inode don't have i_blksize field
769 AC_DEFUN([LC_INODE_BLKSIZE],
770 [AC_MSG_CHECKING([inode has i_blksize field])
771 LB_LINUX_TRY_COMPILE([
772 #include <linux/fs.h>
778 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
779 [struct inode has i_blksize field])
785 # LC_VFS_READDIR_U64_INO
786 # 2.6.19 use u64 for inode number instead of inode_t
787 AC_DEFUN([LC_VFS_READDIR_U64_INO],
788 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
789 tmp_flags="$EXTRA_KCFLAGS"
790 EXTRA_KCFLAGS="-Werror"
791 LB_LINUX_TRY_COMPILE([
792 #include <linux/fs.h>
793 int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
794 u64 ino, unsigned int d_type)
805 AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
806 [if vfs_readdir need 64bit inode number])
810 EXTRA_KCFLAGS="$tmp_flags"
814 # 2.6.19 replaced writev with aio_write
815 AC_DEFUN([LC_FILE_WRITEV],
816 [AC_MSG_CHECKING([writev in fops])
817 LB_LINUX_TRY_COMPILE([
818 #include <linux/fs.h>
820 struct file_operations *fops = NULL;
824 AC_DEFINE(HAVE_FILE_WRITEV, 1,
831 # LC_GENERIC_FILE_READ
832 # 2.6.19 replaced readv with aio_read
833 AC_DEFUN([LC_FILE_READV],
834 [AC_MSG_CHECKING([readv in fops])
835 LB_LINUX_TRY_COMPILE([
836 #include <linux/fs.h>
838 struct file_operations *fops = NULL;
842 AC_DEFINE(HAVE_FILE_READV, 1,
850 # 2.6.18 don't export nr_pagecahe
851 AC_DEFUN([LC_NR_PAGECACHE],
852 [AC_MSG_CHECKING([kernel export nr_pagecache])
853 LB_LINUX_TRY_COMPILE([
854 #include <linux/pagemap.h>
856 return atomic_read(&nr_pagecache);
859 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
860 [is kernel export nr_pagecache])
866 # LC_CANCEL_DIRTY_PAGE
867 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
868 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
869 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
870 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
871 # backport is broken, so ignore it
872 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
873 test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e -"; then
876 LB_LINUX_TRY_COMPILE([
877 #include <linux/mm.h>
878 #include <linux/page-flags.h>
880 cancel_dirty_page(NULL, 0);
883 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
884 [kernel has cancel_dirty_page instead of clear_page_dirty])
894 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
895 # it support constant page, which means the page won't be modified during the
898 AC_DEFUN([LC_PAGE_CONSTANT],
899 [AC_MSG_CHECKING([if kernel have PageConstant defined])
900 LB_LINUX_TRY_COMPILE([
901 #include <linux/mm.h>
902 #include <linux/page-flags.h>
905 #error "Have no raid5 zcopy patch"
909 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
915 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
916 AC_DEFUN([LC_PG_FS_MISC],
917 [AC_MSG_CHECKING([kernel has PG_fs_misc])
918 LB_LINUX_TRY_COMPILE([
919 #include <linux/mm.h>
920 #include <linux/page-flags.h>
923 #error PG_fs_misc not defined in kernel
927 AC_DEFINE(HAVE_PG_FS_MISC, 1,
928 [is kernel have PG_fs_misc])
934 # RHEL5 PageChecked and SetPageChecked defined
935 AC_DEFUN([LC_PAGE_CHECKED],
936 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
937 LB_LINUX_TRY_COMPILE([
938 #include <linux/autoconf.h>
939 #ifdef HAVE_LINUX_MMTYPES_H
940 #include <linux/mm_types.h>
942 #include <linux/page-flags.h>
946 /* before 2.6.26 this define*/
948 /* 2.6.26 use function instead of define for it */
954 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
955 [does kernel have PageChecked and SetPageChecked])
961 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
962 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
964 AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
965 [kernel export truncate_complete_page])
970 AC_DEFUN([LC_EXPORT_TRUNCATE_RANGE],
971 [LB_CHECK_SYMBOL_EXPORT([truncate_inode_pages_range],
973 AC_DEFINE(HAVE_TRUNCATE_RANGE, 1,
974 [kernel export truncate_inode_pages_range])
979 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
980 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
982 AC_DEFINE(HAVE_D_REHASH_COND, 1,
983 [d_rehash_cond is exported by the kernel])
988 AC_DEFUN([LC_EXPORT___D_REHASH],
989 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
991 AC_DEFINE(HAVE___D_REHASH, 1,
992 [__d_rehash is exported by the kernel])
997 AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
998 [LB_CHECK_SYMBOL_EXPORT([d_move_locked],
1000 AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
1001 [d_move_locked is exported by the kernel])
1006 AC_DEFUN([LC_EXPORT___D_MOVE],
1007 [LB_CHECK_SYMBOL_EXPORT([__d_move],
1009 AC_DEFINE(HAVE___D_MOVE, 1,
1010 [__d_move is exported by the kernel])
1016 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
1018 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
1019 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
1021 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
1022 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
1023 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
1024 [exported invalidate_mapping_pages])],
1025 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
1026 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
1027 [exported invalidate_inode_pages])], [
1028 AC_MSG_ERROR([no way to invalidate pages])
1034 # LC_EXPORT_FILEMAP_FDATASYNC_RANGE
1036 # No standard kernels export this
1038 AC_DEFUN([LC_EXPORT_FILEMAP_FDATAWRITE_RANGE],
1039 [LB_CHECK_SYMBOL_EXPORT([filemap_fdatawrite_range],
1041 AC_DEFINE(HAVE_FILEMAP_FDATAWRITE_RANGE, 1,
1042 [filemap_fdatawrite_range is exported by the kernel])
1047 # The actual symbol exported varies among architectures, so we need
1048 # to check many symbols (but only in the current architecture.) No
1049 # matter what symbol is exported, the kernel #defines node_to_cpumask
1050 # to the appropriate function and that's what we use.
1051 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
1052 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
1053 [arch/$LINUX_ARCH/mm/numa.c],
1054 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1055 [node_to_cpumask is exported by
1056 the kernel])]) # x86_64
1057 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
1058 [arch/$LINUX_ARCH/kernel/smpboot.c],
1059 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1060 [node_to_cpumask is exported by
1061 the kernel])]) # ia64
1062 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
1063 [arch/$LINUX_ARCH/kernel/smpboot.c],
1064 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1065 [node_to_cpumask is exported by
1066 the kernel])]) # i386
1069 # 2.6.22 lost second parameter for invalidate_bdev
1070 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
1071 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
1072 LB_LINUX_TRY_COMPILE([
1073 #include <linux/buffer_head.h>
1075 invalidate_bdev(NULL,0);
1077 AC_MSG_RESULT([yes])
1078 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1079 [invalidate_bdev has second argument])
1088 # 2.6.23 have return type 'void' for unregister_blkdev
1089 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1090 [AC_MSG_CHECKING([if unregister_blkdev return int])
1091 LB_LINUX_TRY_COMPILE([
1092 #include <linux/fs.h>
1094 int i = unregister_blkdev(0,NULL);
1096 AC_MSG_RESULT([yes])
1097 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1098 [unregister_blkdev return int])
1104 # 2.6.23 change .sendfile to .splice_read
1105 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1106 AC_DEFUN([LC_KERNEL_SENDFILE],
1107 [AC_MSG_CHECKING([if kernel has .sendfile])
1108 LB_LINUX_TRY_COMPILE([
1109 #include <linux/fs.h>
1111 struct file_operations file;
1113 file.sendfile = NULL;
1115 AC_MSG_RESULT([yes])
1116 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1117 [kernel has .sendfile])
1123 # 2.6.23 change .sendfile to .splice_read
1124 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1125 [AC_MSG_CHECKING([if kernel has .splice_read])
1126 LB_LINUX_TRY_COMPILE([
1127 #include <linux/fs.h>
1129 struct file_operations file;
1131 file.splice_read = NULL;
1133 AC_MSG_RESULT([yes])
1134 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1135 [kernel has .slice_read])
1141 # 2.6.23 extract nfs export related data into exportfs.h
1142 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1143 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1144 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1145 [kernel has include/exportfs.h])
1151 # 2.6.23 has new page fault handling API
1152 AC_DEFUN([LC_VM_OP_FAULT],
1153 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1154 LB_LINUX_TRY_COMPILE([
1155 #include <linux/mm.h>
1157 struct vm_operations_struct op;
1161 AC_MSG_RESULT([yes])
1162 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1163 [kernel has .fault in vm_operation_struct])
1169 #2.6.23 has new shrinker API
1170 AC_DEFUN([LC_REGISTER_SHRINKER],
1171 [AC_MSG_CHECKING([if kernel has register_shrinker])
1172 LB_LINUX_TRY_COMPILE([
1173 #include <linux/mm.h>
1175 register_shrinker(NULL);
1177 AC_MSG_RESULT([yes])
1178 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
1179 [kernel has register_shrinker])
1185 # 2.6.24 has bio_endio with 2 args
1186 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1187 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1188 LB_LINUX_TRY_COMPILE([
1189 #include <linux/bio.h>
1193 AC_MSG_RESULT([yes])
1194 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1195 [kernel has bio_endio with 2 args])
1201 # 2.6.24 has new members in exports struct.
1202 AC_DEFUN([LC_FH_TO_DENTRY],
1203 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1204 LB_LINUX_TRY_COMPILE([
1205 #ifdef HAVE_LINUX_EXPORTFS_H
1206 #include <linux/exportfs.h>
1208 #include <linux/fs.h>
1211 struct export_operations exp;
1213 exp.fh_to_dentry = NULL;
1215 AC_MSG_RESULT([yes])
1216 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1217 [kernel has .fh_to_dentry member in export_operations struct])
1223 # 2.6.24 need linux/mm_types.h included
1224 AC_DEFUN([LC_HAVE_MMTYPES_H],
1225 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1226 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1227 [kernel has include/mm_types.h])
1233 # 2.6.24 removes long aged procfs entry -> deleted member
1234 AC_DEFUN([LC_PROCFS_DELETED],
1235 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1236 LB_LINUX_TRY_COMPILE([
1237 #include <linux/proc_fs.h>
1239 struct proc_dir_entry pde;
1243 AC_MSG_RESULT([yes])
1244 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1245 [kernel has deleted member in procfs entry struct])
1251 # 2.6.25 change define to inline
1252 AC_DEFUN([LC_MAPPING_CAP_WRITEBACK_DIRTY],
1253 [AC_MSG_CHECKING([if kernel have mapping_cap_writeback_dirty])
1254 LB_LINUX_TRY_COMPILE([
1255 #include <linux/backing-dev.h>
1257 #ifndef mapping_cap_writeback_dirty
1258 mapping_cap_writeback_dirty(NULL);
1261 AC_MSG_RESULT([yes])
1262 AC_DEFINE(HAVE_MAPPING_CAP_WRITEBACK_DIRTY, 1,
1263 [kernel have mapping_cap_writeback_dirty])
1271 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1272 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1273 [AC_MSG_CHECKING([fs_struct use path structure])
1274 LB_LINUX_TRY_COMPILE([
1275 #include <asm/atomic.h>
1276 #include <linux/spinlock.h>
1277 #include <linux/fs_struct.h>
1280 struct fs_struct fs;
1284 AC_MSG_RESULT([yes])
1285 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1286 [fs_struct use path structure])
1293 # LC_VFS_INTENT_PATCHES
1295 # check if the kernel has the VFS intent patches
1296 AC_DEFUN([LC_VFS_INTENT_PATCHES],
1297 [AC_MSG_CHECKING([if the kernel has the VFS intent patches])
1298 LB_LINUX_TRY_COMPILE([
1299 #include <linux/fs.h>
1300 #include <linux/namei.h>
1302 struct nameidata nd;
1303 struct lookup_intent *it;
1306 intent_init(it, IT_OPEN);
1307 it->d.lustre.it_disposition = 0;
1308 it->d.lustre.it_data = NULL;
1310 AC_MSG_RESULT([yes])
1311 AC_DEFINE(HAVE_VFS_INTENT_PATCHES, 1, [VFS intent patches are applied])
1317 AC_DEFUN([LC_S_TIME_GRAN],
1318 [AC_MSG_CHECKING([if super block has s_time_gran member])
1319 LB_LINUX_TRY_COMPILE([
1320 #include <linux/fs.h>
1322 struct super_block sb;
1324 return sb.s_time_gran;
1326 AC_MSG_RESULT([yes])
1327 AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
1333 AC_DEFUN([LC_SB_TIME_GRAN],
1334 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
1335 LB_LINUX_TRY_COMPILE([
1336 #include <linux/fs.h>
1338 return get_sb_time_gran(NULL);
1340 AC_MSG_RESULT([yes])
1341 AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
1348 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1350 # Check for our patched grab_cache_page_nowait_gfp() function
1351 # after 2.6.29 we can emulate this using add_to_page_cache_lru()
1353 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
1354 [LB_CHECK_SYMBOL_EXPORT([grab_cache_page_nowait_gfp],
1356 AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
1357 [kernel exports grab_cache_page_nowait_gfp])
1359 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1361 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1362 [kernel exports add_to_page_cache_lru])
1368 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
1369 AC_DEFUN([LC_RW_TREE_LOCK],
1370 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
1371 tmp_flags="$EXTRA_KCFLAGS"
1372 EXTRA_KCFLAGS="-Werror"
1373 LB_LINUX_TRY_COMPILE([
1374 #include <linux/fs.h>
1376 struct address_space a;
1378 write_lock(&a.tree_lock);
1380 AC_MSG_RESULT([yes])
1381 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
1385 EXTRA_KCFLAGS="$tmp_flags"
1388 AC_DEFUN([LC_CONST_ACL_SIZE],
1389 [AC_MSG_CHECKING([calc acl size])
1391 CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include $EXTRA_KCFLAGS"
1394 #include <linux/autoconf.h>
1395 #include <linux/types.h>
1398 #define __LINUX_POSIX_ACL_H
1400 # ifdef CONFIG_FS_POSIX_ACL
1401 # ifdef HAVE_XATTR_ACL
1402 # include <linux/xattr_acl.h>
1404 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
1405 # include <linux/posix_acl_xattr.h>
1409 #include <lustre_acl.h>
1415 int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
1416 FILE *f = fopen("acl.size","w+");
1417 fprintf(f,"%d", size);
1424 acl_size=`cat acl.size`
1425 AC_MSG_RESULT([ACL size $acl_size])
1426 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
1428 AC_ERROR([ACL size can't computed])
1434 # check for crypto API
1436 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
1437 [AC_MSG_CHECKING([if kernel has block cipher support])
1438 LB_LINUX_TRY_COMPILE([
1439 #include <linux/err.h>
1440 #include <linux/crypto.h>
1442 struct crypto_blkcipher *tfm;
1443 tfm = crypto_alloc_blkcipher("aes", 0, 0 );
1445 AC_MSG_RESULT([yes])
1446 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
1453 # check for struct hash_desc
1455 AC_DEFUN([LC_STRUCT_HASH_DESC],
1456 [AC_MSG_CHECKING([if kernel has struct hash_desc])
1457 LB_LINUX_TRY_COMPILE([
1458 #include <linux/err.h>
1459 #include <linux/crypto.h>
1461 struct hash_desc foo;
1463 AC_MSG_RESULT([yes])
1464 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
1471 # check for struct blkcipher_desc
1473 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
1474 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
1475 LB_LINUX_TRY_COMPILE([
1476 #include <linux/err.h>
1477 #include <linux/crypto.h>
1479 struct blkcipher_desc foo;
1481 AC_MSG_RESULT([yes])
1482 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
1489 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
1491 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
1492 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
1493 LB_LINUX_TRY_COMPILE([
1494 #include <linux/fs.h>
1496 int v = FS_RENAME_DOES_D_MOVE;
1498 AC_MSG_RESULT([yes])
1499 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1506 # LC_FUNC_F_OP_FLOCK
1508 # rhel4.2 kernel has f_op->flock field
1510 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
1511 [AC_MSG_CHECKING([if struct file_operations has flock field])
1512 LB_LINUX_TRY_COMPILE([
1513 #include <linux/fs.h>
1515 struct file_operations ll_file_operations_flock;
1516 ll_file_operations_flock.flock = NULL;
1518 AC_DEFINE(HAVE_F_OP_FLOCK, 1,
1519 [struct file_operations has flock field])
1520 AC_MSG_RESULT([yes])
1526 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
1527 # "mode" argument was added, but then again, in some later version it was
1529 AC_DEFUN([LC_4ARGS_VFS_SYMLINK],
1530 [AC_MSG_CHECKING([if vfs_symlink wants 4 args])
1531 LB_LINUX_TRY_COMPILE([
1532 #include <linux/fs.h>
1535 struct dentry *dentry;
1536 const char *oldname = NULL;
1539 vfs_symlink(dir, dentry, oldname, mode);
1542 AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1,
1543 [vfs_symlink wants 4 args])
1549 # 2.6.23 has new shrinker API
1550 AC_DEFUN([LC_REGISTER_SHRINKER],
1551 [LB_CHECK_SYMBOL_EXPORT([register_shrinker],
1553 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
1554 [kernel exports register_shrinker])
1560 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1561 [AC_MSG_CHECKING([inode_operations->permission has two args])
1562 LB_LINUX_TRY_COMPILE([
1563 #include <linux/fs.h>
1565 struct inode *inode;
1567 inode->i_op->permission(NULL,0);
1569 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1570 [inode_operations->permission has two args])
1571 AC_MSG_RESULT([yes])
1577 # 2.6.27 has file_remove_suid instead of remove_suid
1578 AC_DEFUN([LC_FILE_REMOVE_SUID],
1579 [AC_MSG_CHECKING([kernel has file_remove_suid])
1580 LB_LINUX_TRY_COMPILE([
1581 #include <linux/fs.h>
1583 file_remove_suid(NULL);
1585 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1586 [kernel have file_remove_suid])
1587 AC_MSG_RESULT([yes])
1593 # 2.6.27 have new page locking API
1594 AC_DEFUN([LC_TRYLOCKPAGE],
1595 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1596 LB_LINUX_TRY_COMPILE([
1597 #include <linux/pagemap.h>
1601 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1602 [kernel uses trylock_page for page lock])
1603 AC_MSG_RESULT([yes])
1609 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
1610 # "mode" argument was added, but then again, in some later version it was
1612 AC_DEFUN([LC_4ARGS_VFS_SYMLINK],
1613 [AC_MSG_CHECKING([if vfs_symlink wants 4 args])
1614 LB_LINUX_TRY_COMPILE([
1615 #include <linux/fs.h>
1618 struct dentry *dentry;
1619 const char *oldname = NULL;
1622 vfs_symlink(dir, dentry, oldname, mode);
1625 AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1,
1626 [vfs_symlink wants 4 args])
1632 # 2.6.27 sles11 remove the bi_hw_segments
1633 AC_DEFUN([LC_BI_HW_SEGMENTS],
1634 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1635 LB_LINUX_TRY_COMPILE([
1636 #include <linux/bio.h>
1639 io.bi_hw_segments = 0;
1641 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1642 [struct bio has a bi_hw_segments field])
1643 AC_MSG_RESULT([yes])
1649 # 2.6.27 sles11 move the quotaio_v1.h to fs
1650 AC_DEFUN([LC_HAVE_QUOTAIO_V1_H],
1651 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v1.h],[
1652 AC_DEFINE(HAVE_QUOTAIO_V1_H, 1,
1653 [kernel has include/linux/quotaio_v1.h])
1659 # sles10 sp2 need 5 parameter for vfs_symlink
1660 AC_DEFUN([LC_VFS_SYMLINK_5ARGS],
1661 [AC_MSG_CHECKING([vfs_symlink need 5 parameter])
1662 LB_LINUX_TRY_COMPILE([
1663 #include <linux/fs.h>
1665 struct inode *dir = NULL;
1666 struct dentry *dentry = NULL;
1667 struct vfsmount *mnt = NULL;
1668 const char * path = NULL;
1669 vfs_symlink(dir, dentry, mnt, path, 0);
1671 AC_DEFINE(HAVE_VFS_SYMLINK_5ARGS, 1,
1672 [vfs_symlink need 5 parameteres])
1673 AC_MSG_RESULT([yes])
1679 # 2.6.27 removed the read_inode from super_operations.
1680 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1681 [AC_MSG_CHECKING([super_operations has a read_inode field])
1682 LB_LINUX_TRY_COMPILE([
1683 #include <linux/fs.h>
1685 struct super_operations *sop;
1686 sop->read_inode(NULL);
1688 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1689 [super_operations has a read_inode])
1690 AC_MSG_RESULT([yes])
1696 # 2.6.27 sles11 has sb_any_quota_active
1697 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1698 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1699 LB_LINUX_TRY_COMPILE([
1700 #include <linux/quotaops.h>
1702 sb_any_quota_active(NULL);
1704 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1705 [Kernel has a sb_any_quota_active])
1706 AC_MSG_RESULT([yes])
1712 # 2.6.27 sles11 has sb_has_quota_active
1713 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1714 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1715 LB_LINUX_TRY_COMPILE([
1716 #include <linux/quotaops.h>
1718 sb_has_quota_active(NULL, 0);
1720 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1721 [Kernel has a sb_has_quota_active])
1722 AC_MSG_RESULT([yes])
1728 # 2.6.27 has inode_permission instead of permisson
1729 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1730 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1732 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1733 [inode_permission is exported by the kernel])
1738 # 2.6.27 use 5th parameter in quota_on for remount.
1739 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1740 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1741 LB_LINUX_TRY_COMPILE([
1742 #include <linux/quota.h>
1744 struct quotactl_ops *qop;
1745 qop->quota_on(NULL, 0, 0, NULL, 0);
1747 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1748 [quota_on needs 5 paramters])
1749 AC_MSG_RESULT([yes])
1755 # 2.6.27 use 3th parameter in quota_off for remount.
1756 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1757 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1758 LB_LINUX_TRY_COMPILE([
1759 #include <linux/quota.h>
1761 struct quotactl_ops *qop;
1762 qop->quota_off(NULL, 0, 0);
1764 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1765 [quota_off needs 3 paramters])
1766 AC_MSG_RESULT([yes])
1772 # 2.6.27 has vfs_dq_off inline function.
1773 AC_DEFUN([LC_VFS_DQ_OFF],
1774 [AC_MSG_CHECKING([vfs_dq_off is defined])
1775 LB_LINUX_TRY_COMPILE([
1776 #include <linux/quotaops.h>
1778 vfs_dq_off(NULL, 0);
1780 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1781 AC_MSG_RESULT([yes])
1790 # If we have fiemap.h
1791 # after 2.6.27 use fiemap.h in include/linux
1793 AC_DEFUN([LC_LINUX_FIEMAP_H],
1794 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
1795 AC_MSG_CHECKING([if fiemap.h can be compiled])
1796 LB_LINUX_TRY_COMPILE([
1797 #include <linux/types.h>
1798 #include <linux/fiemap.h>
1800 AC_MSG_RESULT([yes])
1801 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
1809 # LC_LOCK_MAP_ACQUIRE
1810 # after 2.6.27 lock_map_acquire replaces lock_acquire
1811 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1812 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1813 LB_LINUX_TRY_COMPILE([
1814 #include <linux/lockdep.h>
1816 lock_map_acquire(NULL);
1819 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1820 [lock_map_acquire is defined])
1826 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1827 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1828 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1829 LB_LINUX_TRY_COMPILE([
1830 #include <linux/blkdev.h>
1832 blk_queue_logical_block_size(NULL, 0);
1835 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1836 [blk_queue_logical_block_size is defined])
1845 # Lustre linux kernel checks
1847 AC_DEFUN([LC_PROG_LINUX],
1848 [LC_LUSTRE_VERSION_H
1849 if test x$enable_server = xyes ; then
1850 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1851 LC_FUNC_DEV_SET_RDONLY
1857 LC_CONFIG_LIBLUSTRE_RECOVERY
1858 LC_CONFIG_HEALTH_CHECK_WRITE
1859 LC_CONFIG_LRU_RESIZE
1863 LC_EXPORT_TRUNCATE_COMPLETE
1864 LC_EXPORT_TRUNCATE_RANGE
1865 LC_EXPORT_D_REHASH_COND
1866 LC_EXPORT___D_REHASH
1867 LC_EXPORT_D_MOVE_LOCKED
1869 LC_EXPORT_NODE_TO_CPUMASK
1871 LC_HEADER_LDISKFS_XATTR
1872 LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1879 LC_POSIX_ACL_XATTR_H
1882 LC_STRUCT_INTENT_FILE
1887 LC_FUNC_MS_FLOCK_LOCK
1888 LC_FUNC_HAVE_CAN_SLEEP_ARG
1891 LC_COOKIE_FOLLOW_LINK
1895 LC_4ARGS_VFS_SYMLINK
1897 # does the kernel have VFS intent patches?
1898 LC_VFS_INTENT_PATCHES
1906 LC_EXPORT_SYNCHRONIZE_RCU
1912 LC_SECURITY_PLUG # for SLES10 SP2
1920 LC_STATFS_DENTRY_PARAM
1922 LC_INVALIDATEPAGE_RETURN_INT
1923 LC_UMOUNTBEGIN_HAS_VFSMOUNT
1925 LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
1926 if test x$enable_server = xyes ; then
1927 LC_EXPORT_INVALIDATE_MAPPING_PAGES
1930 #2.6.18 + RHEL5 (fc6)
1937 LC_VFS_READDIR_U64_INO
1942 LC_CANCEL_DIRTY_PAGE
1944 # raid5-zerocopy patch
1948 LC_INVALIDATE_BDEV_2ARG
1949 LC_ASYNC_BLOCK_CIPHER
1951 LC_STRUCT_BLKCIPHER_DESC
1952 LC_FS_RENAME_DOES_D_MOVE
1954 LC_UNREGISTER_BLKDEV_RETURN_INT
1955 LC_KERNEL_SPLICE_READ
1959 LC_REGISTER_SHRINKER
1968 LC_MAPPING_CAP_WRITEBACK_DIRTY
1971 LC_FS_STRUCT_USE_PATH
1974 LC_INODE_PERMISION_2ARGS
1977 LC_READ_INODE_IN_SBOPS
1978 LC_EXPORT_INODE_PERMISSION
1984 # 2.6.27.15-2 sles11
1986 LC_HAVE_QUOTAIO_V1_H
1987 LC_VFS_SYMLINK_5ARGS
1988 LC_SB_ANY_QUOTA_ACTIVE
1989 LC_SB_HAS_QUOTA_ACTIVE
1992 LC_BLK_QUEUE_LOG_BLK_SIZE
1996 # LC_CONFIG_CLIENT_SERVER
1998 # Build client/server sides of Lustre
2000 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2001 [AC_MSG_CHECKING([whether to build Lustre server support])
2002 AC_ARG_ENABLE([server],
2003 AC_HELP_STRING([--disable-server],
2004 [disable Lustre server support]),
2005 [],[enable_server='yes'])
2006 AC_MSG_RESULT([$enable_server])
2008 AC_MSG_CHECKING([whether to build Lustre client support])
2009 AC_ARG_ENABLE([client],
2010 AC_HELP_STRING([--disable-client],
2011 [disable Lustre client support]),
2012 [],[enable_client='yes'])
2013 AC_MSG_RESULT([$enable_client])])
2016 # LC_CONFIG_LIBLUSTRE
2018 # whether to build liblustre
2020 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2021 [AC_MSG_CHECKING([whether to build Lustre library])
2022 AC_ARG_ENABLE([liblustre],
2023 AC_HELP_STRING([--disable-liblustre],
2024 [disable building of Lustre library]),
2025 [],[enable_liblustre=$with_sysio])
2026 AC_MSG_RESULT([$enable_liblustre])
2027 # only build sysio if liblustre is built
2028 with_sysio="$enable_liblustre"
2030 AC_MSG_CHECKING([whether to build liblustre tests])
2031 AC_ARG_ENABLE([liblustre-tests],
2032 AC_HELP_STRING([--enable-liblustre-tests],
2033 [enable liblustre tests, if --disable-tests is used]),
2034 [],[enable_liblustre_tests=$enable_tests])
2035 if test x$enable_liblustre != xyes ; then
2036 enable_liblustre_tests='no'
2038 AC_MSG_RESULT([$enable_liblustre_tests])
2040 AC_MSG_CHECKING([whether to enable liblustre acl])
2041 AC_ARG_ENABLE([liblustre-acl],
2042 AC_HELP_STRING([--disable-liblustre-acl],
2043 [disable ACL support for liblustre]),
2044 [],[enable_liblustre_acl=yes])
2045 AC_MSG_RESULT([$enable_liblustre_acl])
2046 if test x$enable_liblustre_acl = xyes ; then
2047 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2050 # 2.6.29 change prepare/commit_write to write_begin/end
2051 AC_DEFUN([LC_WRITE_BEGIN_END],
2052 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2053 LB_LINUX_TRY_COMPILE([
2054 #include <linux/fs.h>
2055 #include <linux/pagemap.h>
2056 #ifdef HAVE_LINUX_MMTYPES_H
2057 #include <linux/mm_types.h>
2060 struct address_space_operations aops;
2063 aops.write_begin = NULL;
2064 aops.write_end = NULL;
2065 page = grab_cache_page_write_begin(NULL, 0, 0);
2067 AC_MSG_RESULT([yes])
2068 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2069 [kernel has .write_begin/end])
2075 # 2.6.29 blkdev_put has 2 arguments
2076 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2077 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2078 LB_LINUX_TRY_COMPILE([
2079 #include <linux/fs.h>
2081 blkdev_put(NULL, 0);
2083 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2084 [blkdev_put needs 2 paramters])
2085 AC_MSG_RESULT([yes])
2091 # 2.6.29 dentry_open has 4 arguments
2092 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2093 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2094 LB_LINUX_TRY_COMPILE([
2095 #include <linux/fs.h>
2097 dentry_open(NULL, NULL, 0, NULL);
2099 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2100 [dentry_open needs 4 paramters])
2101 AC_MSG_RESULT([yes])
2110 AC_ARG_ENABLE(mpitests,
2111 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2112 [include mpi tests]),
2123 MPICC_WRAPPER=$enableval
2133 if test x$enable_mpitests != xno; then
2134 AC_MSG_CHECKING([whether mpitests can be built])
2142 MPI_Initialized(&flag);
2145 AC_MSG_RESULT([yes])
2152 AC_SUBST(MPICC_WRAPPER)
2154 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2155 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2158 LC_CONFIG_LIBLUSTRE_RECOVERY
2161 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
2162 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
2163 AC_ARG_ENABLE([lru_resize],
2164 AC_HELP_STRING([--enable-lru-resize],
2165 [enable lru resize support]),
2166 [],[enable_lru_resize='yes'])
2167 AC_MSG_RESULT([$enable_lru_resize])
2168 if test x$enable_lru_resize != xno; then
2169 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
2176 # whether to enable quota support global control
2178 AC_DEFUN([LC_CONFIG_QUOTA],
2179 [AC_ARG_ENABLE([quota],
2180 AC_HELP_STRING([--enable-quota],
2181 [enable quota support]),
2182 [],[enable_quota='yes'])
2185 # whether to enable quota support(kernel modules)
2186 AC_DEFUN([LC_QUOTA_MODULE],
2187 [if test x$enable_quota != xno; then
2188 LB_LINUX_CONFIG([QUOTA],[
2189 enable_quota_module='yes'
2190 AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
2192 enable_quota_module='no'
2193 AC_MSG_WARN([quota is not enabled because the kernel - lacks quota support])
2198 AC_DEFUN([LC_QUOTA],
2202 AC_CHECK_HEADER(sys/quota.h,
2203 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2204 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2207 AC_DEFUN([LC_QUOTA_READ],
2208 [AC_MSG_CHECKING([if kernel supports quota_read])
2209 LB_LINUX_TRY_COMPILE([
2210 #include <linux/fs.h>
2212 struct super_operations sp;
2213 void *i = (void *)sp.quota_read;
2215 AC_MSG_RESULT([yes])
2216 AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
2225 # whether to enable split support
2227 AC_DEFUN([LC_CONFIG_SPLIT],
2228 [AC_MSG_CHECKING([whether to enable split support])
2229 AC_ARG_ENABLE([split],
2230 AC_HELP_STRING([--enable-split],
2231 [enable split support]),
2232 [],[enable_split='no'])
2233 AC_MSG_RESULT([$enable_split])
2234 if test x$enable_split != xno; then
2235 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2240 # LC_COOKIE_FOLLOW_LINK
2242 # kernel 2.6.13+ ->follow_link returns a cookie
2245 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
2246 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
2247 LB_LINUX_TRY_COMPILE([
2248 #include <linux/fs.h>
2249 #include <linux/namei.h>
2251 struct dentry dentry;
2252 struct nameidata nd;
2254 dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
2256 AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
2257 AC_MSG_RESULT([yes])
2266 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE),
2267 # call_rcu takes three parameters.
2269 AC_DEFUN([LC_FUNC_RCU],
2270 [AC_MSG_CHECKING([if kernel have RCU supported])
2271 LB_LINUX_TRY_COMPILE([
2272 #include <linux/rcupdate.h>
2274 AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
2275 AC_MSG_RESULT([yes])
2277 AC_MSG_CHECKING([if call_rcu takes three parameters])
2278 LB_LINUX_TRY_COMPILE([
2279 #include <linux/rcupdate.h>
2282 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
2284 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
2285 AC_MSG_RESULT([yes])
2297 # linux kernel have 64-bit limits support
2299 AC_DEFUN([LC_QUOTA64],
2300 [if test x$enable_quota_module = xyes -a x$enable_server = xyes ; then
2301 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
2302 LB_LINUX_TRY_COMPILE([
2303 #include <linux/kernel.h>
2304 #include <linux/fs.h>
2305 #include <linux/quotaio_v2.h>
2306 int versions[] = V2_INITQVERSIONS_R1;
2307 struct v2_disk_dqblk_r1 dqblk_r1;
2309 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2310 AC_MSG_RESULT([yes])
2312 tmp_flags="$EXTRA_KCFLAGS"
2313 EXTRA_KCFLAGS="-I $LINUX/fs"
2314 LB_LINUX_TRY_COMPILE([
2315 #include <linux/kernel.h>
2316 #include <linux/fs.h>
2317 #include <quotaio_v2.h>
2318 struct v2r1_disk_dqblk dqblk_r1;
2320 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2321 AC_MSG_RESULT([yes])
2323 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
2324 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
2328 EXTRA_KCFLAGS=$tmp_flags
2333 # LC_SECURITY_PLUG # for SLES10 SP2
2334 # check security plug in sles10 sp2 kernel
2335 AC_DEFUN([LC_SECURITY_PLUG],
2336 [AC_MSG_CHECKING([If kernel has security plug support])
2337 LB_LINUX_TRY_COMPILE([
2338 #include <linux/fs.h>
2340 struct dentry *dentry;
2341 struct vfsmount *mnt;
2342 struct iattr *iattr;
2344 notify_change(dentry, mnt, iattr);
2347 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
2348 [SLES10 SP2 use extra parameter in vfs])
2354 AC_DEFUN([LC_PERCPU_COUNTER],
2355 [AC_MSG_CHECKING([if have struct percpu_counter defined])
2356 LB_LINUX_TRY_COMPILE([
2357 #include <linux/percpu_counter.h>
2359 AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
2360 AC_MSG_RESULT([yes])
2362 AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
2363 LB_LINUX_TRY_COMPILE([
2364 #include <linux/percpu_counter.h>
2366 struct percpu_counter c;
2367 percpu_counter_init(&c, 0);
2369 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
2371 AC_MSG_RESULT([yes])
2383 # other configure checks
2385 AC_DEFUN([LC_CONFIGURE],
2386 [LC_CONFIG_OBD_BUFFER_SIZE
2388 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2389 CFLAGS="$CFLAGS -Werror"
2392 # include/liblustre.h
2393 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2395 # liblustre/llite_lib.h
2396 AC_CHECK_HEADERS([xtio.h file.h])
2399 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2402 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2403 AC_CHECK_FUNCS([inet_ntoa])
2405 # libsysio/src/readlink.c
2408 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2409 AC_CHECK_HEADERS([linux/random.h], [], [],
2410 [#ifdef HAVE_LINUX_TYPES_H
2411 # include <linux/types.h>
2416 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2418 # check for -lz support
2422 [AC_CHECK_HEADERS([zlib.h],
2424 AC_DEFINE([HAVE_ADLER], 1,
2425 [support alder32 checksum type])],
2426 [AC_MSG_WARN([No zlib-devel package found,
2427 unable to use adler32 checksum])])],
2428 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2433 AC_ARG_ENABLE([mindf],
2434 AC_HELP_STRING([--enable-mindf],
2435 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2437 if test "$enable_mindf" = "yes" ; then
2438 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2441 AC_ARG_ENABLE([fail_alloc],
2442 AC_HELP_STRING([--disable-fail-alloc],
2443 [disable randomly alloc failure]),
2444 [],[enable_fail_alloc=yes])
2445 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2446 AC_MSG_RESULT([$enable_fail_alloc])
2447 if test x$enable_fail_alloc != xno ; then
2448 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2451 AC_ARG_ENABLE([invariants],
2452 AC_HELP_STRING([--enable-invariants],
2453 [enable invariant checking (cpu intensive)]),
2455 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2456 AC_MSG_RESULT([$enable_invariants])
2457 if test x$enable_invariants = xyes ; then
2458 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2461 AC_ARG_ENABLE([lu_ref],
2462 AC_HELP_STRING([--enable-lu_ref],
2463 [enable lu_ref reference tracking code]),
2465 AC_MSG_CHECKING([whether to track references with lu_ref])
2466 AC_MSG_RESULT([$enable_lu_ref])
2467 if test x$enable_lu_ref = xyes ; then
2468 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2475 LC_DENTRY_OPEN_4ARGS
2482 # AM_CONDITIONALS for lustre
2484 AC_DEFUN([LC_CONDITIONALS],
2485 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2486 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2487 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2488 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2489 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2490 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2491 AM_CONDITIONAL(QUOTA, test x$enable_quota_module = xyes)
2492 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2493 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2494 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2495 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2496 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2497 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2498 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2504 # files that should be generated with AC_OUTPUT
2506 AC_DEFUN([LC_CONFIG_FILES],
2510 lustre/autoconf/Makefile
2511 lustre/contrib/Makefile
2513 lustre/include/Makefile
2514 lustre/include/lustre_ver.h
2515 lustre/include/linux/Makefile
2516 lustre/include/lustre/Makefile
2517 lustre/kernel_patches/targets/2.6-rhel5.target
2518 lustre/kernel_patches/targets/2.6-sles10.target
2519 lustre/kernel_patches/targets/2.6-sles11.target
2520 lustre/kernel_patches/targets/2.6-oel5.target
2521 lustre/kernel_patches/targets/2.6-fc11.target
2522 lustre/kernel_patches/targets/2.6-fc12.target
2523 lustre/ldlm/Makefile
2525 lustre/fid/autoMakefile
2526 lustre/liblustre/Makefile
2527 lustre/liblustre/tests/Makefile
2528 lustre/liblustre/tests/mpi/Makefile
2529 lustre/llite/Makefile
2530 lustre/llite/autoMakefile
2531 lustre/lclient/Makefile
2533 lustre/lov/autoMakefile
2534 lustre/lvfs/Makefile
2535 lustre/lvfs/autoMakefile
2537 lustre/mdc/autoMakefile
2539 lustre/lmv/autoMakefile
2541 lustre/mds/autoMakefile
2543 lustre/mdt/autoMakefile
2545 lustre/cmm/autoMakefile
2547 lustre/mdd/autoMakefile
2549 lustre/fld/autoMakefile
2550 lustre/obdclass/Makefile
2551 lustre/obdclass/autoMakefile
2552 lustre/obdclass/linux/Makefile
2553 lustre/obdecho/Makefile
2554 lustre/obdecho/autoMakefile
2555 lustre/obdfilter/Makefile
2556 lustre/obdfilter/autoMakefile
2558 lustre/osc/autoMakefile
2560 lustre/ost/autoMakefile
2562 lustre/osd/autoMakefile
2564 lustre/mgc/autoMakefile
2566 lustre/mgs/autoMakefile
2567 lustre/ptlrpc/Makefile
2568 lustre/ptlrpc/autoMakefile
2569 lustre/ptlrpc/gss/Makefile
2570 lustre/ptlrpc/gss/autoMakefile
2571 lustre/quota/Makefile
2572 lustre/quota/autoMakefile
2573 lustre/scripts/Makefile
2574 lustre/tests/Makefile
2575 lustre/tests/mpi/Makefile
2576 lustre/utils/Makefile
2577 lustre/utils/gss/Makefile
2578 lustre/obdclass/darwin/Makefile