4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
23 rootsbindir='$(CROSS_PATH)/sbin'
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED],
50 # LC_CONFIG_OBD_BUFFER_SIZE
52 # the maximum buffer size of lctl ioctls
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
55 [AC_MSG_CHECKING([maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57 AC_HELP_STRING([--with-obd-buffer-size=[size]],
58 [set lctl ioctl maximum bytes (default=8192)]),
60 OBD_BUFFER_SIZE=$with_obd_buffer_size
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
76 ssize_t readlink(const char *, char *, size_t);
79 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
85 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES],
86 [AC_CHECK_FUNCS([name_to_handle_at],[
87 AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
88 [file handle and related syscalls are supported])
90 AC_MSG_WARN([file handle and related syscalls are not supported])
95 # LC_FUNC_DEV_SET_RDONLY
97 # check whether dev_set_rdonly is exported. This is needed until we
98 # have another mechanism to fence IO from the underlying device.
100 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
101 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
102 [block/ll_rw_block.c,block/blk-core.c],[
103 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
105 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
110 # Ensure stack size big than 8k in Lustre server (all kernels)
112 AC_DEFUN([LC_STACK_SIZE],
113 [AC_MSG_CHECKING([stack size big than 8k])
114 LB_LINUX_TRY_COMPILE([
115 #include <linux/thread_info.h>
117 #if THREAD_SIZE < 8192
118 #error "stack size < 8192"
123 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
128 # Allow the user to set the MDS thread upper limit
130 AC_DEFUN([LC_MDS_MAX_THREADS],
132 AC_ARG_WITH([mds_max_threads],
133 AC_HELP_STRING([--with-mds-max-threads=count],
134 [maximum threads available on the MDS: (default=512)]),
136 MDS_THREAD_COUNT=$with_mds_max_threads
137 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
144 # the pinger is temporary, until we have the recovery node in place
146 AC_DEFUN([LC_CONFIG_PINGER],
147 [AC_MSG_CHECKING([whether to enable pinger support])
148 AC_ARG_ENABLE([pinger],
149 AC_HELP_STRING([--disable-pinger],
150 [disable recovery pinger support]),
151 [],[enable_pinger='yes'])
152 AC_MSG_RESULT([$enable_pinger])
153 if test x$enable_pinger != xno ; then
154 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
161 # do checksum of bulk data between client and OST
163 AC_DEFUN([LC_CONFIG_CHECKSUM],
164 [AC_MSG_CHECKING([whether to enable data checksum support])
165 AC_ARG_ENABLE([checksum],
166 AC_HELP_STRING([--disable-checksum],
167 [disable data checksum support]),
168 [],[enable_checksum='yes'])
169 AC_MSG_RESULT([$enable_checksum])
170 if test x$enable_checksum != xno ; then
171 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
176 # LC_CONFIG_LIBLUSTRE_RECOVERY
178 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
179 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
180 AC_ARG_ENABLE([liblustre-recovery],
181 AC_HELP_STRING([--disable-liblustre-recovery],
182 [disable liblustre recovery support]),
183 [],[enable_liblustre_recovery='yes'])
184 AC_MSG_RESULT([$enable_liblustre_recovery])
185 if test x$enable_liblustre_recovery != xno ; then
186 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
191 # LC_CONFIG_HEALTH_CHECK_WRITE
193 # Turn off the actual write to the disk
195 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
196 [AC_MSG_CHECKING([whether to enable a write with the health check])
197 AC_ARG_ENABLE([health_write],
198 AC_HELP_STRING([--enable-health_write],
199 [enable disk writes when doing health check]),
200 [],[enable_health_write='no'])
201 AC_MSG_RESULT([$enable_health_write])
202 if test x$enable_health_write != xno ; then
203 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
207 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
208 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
209 AC_ARG_ENABLE([lru_resize],
210 AC_HELP_STRING([--enable-lru-resize],
211 [enable lru resize support]),
212 [],[enable_lru_resize='yes'])
213 AC_MSG_RESULT([$enable_lru_resize])
214 if test x$enable_lru_resize != xno; then
215 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
220 # Quota support. The kernel must support CONFIG_QUOTA.
222 AC_DEFUN([LC_QUOTA_CONFIG],
223 [LB_LINUX_CONFIG_IM([QUOTA],[],[
224 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
228 # truncate_complete_page() has never been exported from an upstream kernel
229 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
230 # delete_from_page_cache() is exported from 2.6.39
231 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
232 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
234 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
235 [kernel export truncate_complete_page])])
236 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
238 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
239 [kernel export remove_from_page_cache])])
240 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
242 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
243 [kernel export delete_from_page_cache])])
249 AC_DEFUN([LC_CAPA_CRYPTO],
250 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
251 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
253 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
254 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
256 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
257 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
262 # LC_CONFIG_RMTCLIENT
265 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
267 AC_DEFUN([LC_CONFIG_RMTCLIENT],
268 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
271 Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.
277 # LC_CONFIG_GSS_KEYRING (default 'auto', tests for dependencies, if found, enables; only called if gss is enabled)
279 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
280 [AC_MSG_CHECKING([whether to enable gss keyring backend])
281 AC_ARG_ENABLE([gss_keyring],
282 [AC_HELP_STRING([--disable-gss-keyring],
283 [disable gss keyring backend])],
284 [],[enable_gss_keyring='auto'])
285 AC_MSG_RESULT([$enable_gss_keyring])
287 if test x$enable_gss_keyring != xno; then
288 LB_LINUX_CONFIG_IM([KEYS],[],
289 [gss_keyring_conf_test='fail';
292 GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.
295 AC_CHECK_LIB([keyutils], [keyctl_search], [],
296 [gss_keyring_conf_test='fail';
299 libkeyutils is not found, which is required by gss keyring backend
302 if test x$gss_keyring_conf_test != xfail; then
303 AC_DEFINE([HAVE_GSS_KEYRING], [1], [Define this if you enable gss keyring backend])
304 enable_gss_keyring='yes'
306 if test x$enable_gss_keyring == xyes; then
309 Cannot enable gss_keyring. See above for details.
314 Cannot enable gss keyring. See above for details.
321 AC_DEFUN([LC_CONFIG_SUNRPC],
322 [LB_LINUX_CONFIG_IM([SUNRPC],[],
323 [if test x$sunrpc_required == xyes; then
326 kernel SUNRPC support is required by using GSS.
332 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
334 # Build gss and related tools of Lustre. Currently both kernel and user space
335 # parts are depend on linux platform.
337 AC_DEFUN([LC_CONFIG_GSS],
338 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
340 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
341 [],[enable_gss='auto'])
342 AC_MSG_RESULT([$enable_gss])
344 if test x$enable_gss != xno; then
345 LC_CONFIG_GSS_KEYRING
346 sunrpc_required=$enable_gss
350 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
351 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
352 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
353 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
354 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
355 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
356 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
357 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
359 require_krb5=$enable_gss
363 if test x$KRBDIR != x; then
364 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
365 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi";
366 gss_conf_test='success'],
367 [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
368 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue";
369 gss_conf_test='success'],
370 [if test x$enable_gss == xyes; then
373 libgssapi or libgssglue is not found, which is required by GSS.
378 libgssapi or libgssglue is not found, which is required by GSS.
381 AC_SUBST(GSSAPI_LIBS)
384 if test x$gss_conf_test == xsuccess; then
385 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
392 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
393 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
394 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
395 # v3.1 onward have a 2 arg version (inode, mask)
396 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
397 [AC_MSG_CHECKING([inode_operations->permission has two args])
398 LB_LINUX_TRY_COMPILE([
399 #include <linux/fs.h>
401 struct inode *inode __attribute__ ((unused));
404 inode->i_op->permission(NULL, 0);
406 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
407 [inode_operations->permission has two args])
414 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
415 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
416 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
417 LB_LINUX_TRY_COMPILE([
418 #include <linux/blkdev.h>
420 blk_queue_max_segments(NULL, 0);
423 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
424 [blk_queue_max_segments is defined])
430 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
431 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
432 tmp_flags="$EXTRA_KCFLAGS"
433 EXTRA_KCFLAGS="-Werror"
434 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
435 LB_LINUX_TRY_COMPILE([
436 #include <linux/fs.h>
437 #include <linux/quota.h>
439 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
441 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
445 AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct kqid & fs_disk_quota])
446 LB_LINUX_TRY_COMPILE([
447 #include <linux/fs.h>
448 #include <linux/quota.h>
450 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
452 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
453 AC_DEFINE(HAVE_DQUOT_KQID, 1, [quotactl_ops.set_dqblk takes struct kqid])
459 EXTRA_KCFLAGS="$tmp_flags"
462 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
463 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
464 [AC_MSG_CHECKING([if dquot_suspend is defined])
465 LB_LINUX_TRY_COMPILE([
466 #include <linux/quotaops.h>
468 dquot_suspend(NULL, -1);
470 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
480 # Check if kernel has been patched for 64-bit quota limits support.
481 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
482 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
483 # that in the absence of quotaio_v1.h in the kernel headers.
485 AC_DEFUN([LC_QUOTA64],[
486 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
487 tmp_flags="$EXTRA_KCFLAGS"
488 EXTRA_KCFLAGS="-I$LINUX/fs"
489 LB_LINUX_TRY_COMPILE([
490 #include <linux/kernel.h>
491 #include <linux/fs.h>
492 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
493 # include <quota/quotaio_v2.h>
494 struct v2r1_disk_dqblk dqblk_r1;
496 #include <linux/quota.h>
497 int ver = QFMT_VFS_V1;
500 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
503 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
504 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
508 EXTRA_KCFLAGS=$tmp_flags
512 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
514 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
515 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
516 LB_LINUX_TRY_COMPILE([
517 #include <asm/atomic.h>
518 #include <linux/spinlock.h>
519 #include <linux/fs_struct.h>
521 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
523 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
524 [fs_struct.lock use rwlock])
532 # 2.6.36 super_operations add evict_inode method. it hybird of
533 # delete_inode & clear_inode.
535 AC_DEFUN([LC_SBOPS_EVICT_INODE],
536 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
537 LB_LINUX_TRY_COMPILE([
538 #include <linux/fs.h>
540 ((struct super_operations *)0)->evict_inode(NULL);
542 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
543 [super_operations.evict_inode() is exist in kernel])
551 # 2.6.35 file_operations.fsync taken 2 arguments.
552 # 3.0.0 file_operations.fsync takes 4 arguments.
554 AC_DEFUN([LC_FILE_FSYNC],
555 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
556 LB_LINUX_TRY_COMPILE([
557 #include <linux/fs.h>
559 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
561 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
562 [file_operations.fsync takes 4 arguments])
563 AC_MSG_RESULT([yes, 4 args])
565 LB_LINUX_TRY_COMPILE([
566 #include <linux/fs.h>
568 ((struct file_operations *)0)->fsync(NULL, 0);
570 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
571 [file_operations.fsync takes 2 arguments])
572 AC_MSG_RESULT([yes, 2 args])
580 # 2.6.37 remove kernel_locked
582 AC_DEFUN([LC_KERNEL_LOCKED],
583 [AC_MSG_CHECKING([if kernel_locked is defined])
584 LB_LINUX_TRY_COMPILE([
585 #include <linux/smp_lock.h>
590 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
591 [kernel_locked is defined])
598 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
600 AC_DEFUN([LC_D_COMPARE_7ARGS],
601 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
602 LB_LINUX_TRY_COMPILE([
603 #include <linux/dcache.h>
605 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
607 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
608 [d_compare need 7 arguments])
616 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
618 AC_DEFUN([LC_D_DELETE_CONST],
619 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
620 tmp_flags="$EXTRA_KCFLAGS"
621 EXTRA_KCFLAGS="-Werror"
622 LB_LINUX_TRY_COMPILE([
623 #include <linux/dcache.h>
625 const struct dentry *d = NULL;
626 ((struct dentry_operations*)0)->d_delete(d);
628 AC_DEFINE(HAVE_D_DELETE_CONST, const,
629 [d_delete first parameter declared const])
632 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
635 EXTRA_KCFLAGS="$tmp_flags"
639 # 2.6.38 dcache_lock removed. rcu-walk commited.
641 AC_DEFUN([LC_DCACHE_LOCK],
642 [AC_MSG_CHECKING([if dcache_lock is exist])
643 LB_LINUX_TRY_COMPILE([
644 #include <linux/dcache.h>
646 spin_lock(&dcache_lock);
648 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
649 [dcache_lock is exist])
657 # 2.6.38 inode.i_rcu added.
659 AC_DEFUN([LC_INODE_I_RCU],
660 [AC_MSG_CHECKING([if inode.i_rcu exists])
661 LB_LINUX_TRY_COMPILE([
662 #include <linux/fs.h>
665 struct rcu_head rcu = {};
668 AC_DEFINE(HAVE_INODE_I_RCU, 1,
669 [inode.i_rcu exists])
677 # 2.6.38 export blkdev_get_by_dev
679 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
680 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
682 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
683 [blkdev_get_by_dev is exported by the kernel])
689 # 2.6.38 export simple_setattr
691 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
692 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
694 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
695 [simple_setattr is exported by the kernel])
701 # truncate callback removed since 2.6.39
703 AC_DEFUN([LC_IOP_TRUNCATE],
704 [AC_MSG_CHECKING([inode_operations has .truncate member function])
705 LB_LINUX_TRY_COMPILE([
706 #include <linux/fs.h>
708 ((struct inode_operations *)0)->truncate(NULL);
710 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
711 [inode_operations has .truncate member function])
719 # 2.6.39 remove unplug_fn from request_queue.
721 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
722 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
723 LB_LINUX_TRY_COMPILE([
724 #include <linux/blkdev.h>
726 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
728 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
729 [request_queue has unplug_fn field])
737 # 2.6.39 replace get_sb with mount in struct file_system_type
739 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
740 [AC_MSG_CHECKING([if file_system_type has mount field])
741 LB_LINUX_TRY_COMPILE([
742 #include <linux/fs.h>
744 struct file_system_type fst;
745 void *i = (void *) fst.mount;
747 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
748 [struct file_system_type has mount field])
756 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
757 # added to Linux kernel 2.6.39.
758 # Check if client supports these functions
760 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS],
761 [LB_LINUX_CONFIG_IM([FHANDLE],[
762 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
763 [kernel supports fhandles and related syscalls])
768 # 3.0 dirty_inode() has a flag parameter
769 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
771 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
772 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
773 LB_LINUX_TRY_COMPILE([
774 #include <linux/fs.h>
777 inode->i_sb->s_op->dirty_inode(NULL, 0);
779 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
780 [dirty_inode super_operation takes flag])
788 # 2.6.38 generic_permission taken 4 parameters.
789 # in fact, it means rcu-walk aware permission bring.
791 # 3.1 generic_permission taken 2 parameters.
792 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
794 AC_DEFUN([LC_GENERIC_PERMISSION],
795 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
796 LB_LINUX_TRY_COMPILE([
797 #include <linux/fs.h>
799 generic_permission(NULL, 0);
801 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
802 [generic_permission taken 2 arguments])
803 AC_MSG_RESULT([yes, 2 args])
805 LB_LINUX_TRY_COMPILE([
806 #include <linux/fs.h>
808 generic_permission(NULL, 0, 0, NULL);
810 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
811 [generic_permission taken 4 arguments])
812 AC_MSG_RESULT([yes, 4 args])
820 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
821 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
823 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
824 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
825 LB_LINUX_TRY_COMPILE([
826 #include <linux/fs.h>
828 struct lock_manager_operations lm_ops;
829 lm_ops.lm_compare_owner = NULL;
831 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
832 [lock-manager ops renamed to lm_xxx])
840 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
841 # inode_dio_done instead.
842 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
844 AC_DEFUN([LC_INODE_DIO_WAIT],
845 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
846 LB_LINUX_TRY_COMPILE([
847 #include <linux/fs.h>
849 inode_dio_wait((struct inode *)0);
850 inode_dio_done((struct inode *)0);
852 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
853 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
861 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
862 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
864 AC_DEFUN([LC_IOP_GET_ACL],
865 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
866 LB_LINUX_TRY_COMPILE([
867 #include <linux/fs.h>
869 struct inode_operations iop;
872 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
873 [inode_operations has .get_acl member function])
881 # 3.1 introduced generic_file_llseek_size()
883 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
884 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
886 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
887 [generic_file_llseek_size is exported by the kernel])])
891 # 3.2 request_queue.make_request_fn defined as function returns with void
892 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
894 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
895 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
896 LB_LINUX_TRY_COMPILE([
897 #include <linux/blkdev.h>
900 make_request_fn *mrf;
901 ret = mrf(NULL, NULL);
905 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
906 [request_queue.make_request_fn returns void but not int])
912 # 3.2 protects inode->i_nlink from direct modification
913 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
914 # at the same time adds set_nlink(), so checks set_nlink() for it.
916 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
917 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
918 LB_LINUX_TRY_COMPILE([
919 #include <linux/fs.h>
924 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
925 [inode->i_nlink is protected from direct modification])
933 # 3.3 introduces migrate_mode.h and migratepage has 4 args
935 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
936 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
937 AC_DEFINE(HAVE_MIGRATE_H, 1,
938 [kernel has include/linux/migrate.h])
939 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
940 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
941 [kernel has include/linux/migrate_mode.h])
948 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
949 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
950 LB_LINUX_TRY_COMPILE([
951 #include <linux/fs.h>
952 #ifdef HAVE_MIGRATE_H
953 #include <linux/migrate.h>
954 #elif defined(HAVE_MIGRATE_MODE_H)
955 #include <linux/migrate_mode.h>
958 struct address_space_operations aops;
960 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
962 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
963 [address_space_operations.migratepage has 4 args])
971 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
972 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
974 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
975 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
976 tmp_flags="$EXTRA_KCFLAGS"
977 EXTRA_KCFLAGS="-Werror"
978 LB_LINUX_TRY_COMPILE([
979 #include <linux/fs.h>
980 int show_options(struct seq_file *seq, struct dentry *root){
984 struct super_operations ops;
985 ops.show_options = show_options;
987 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
988 [super_operations use dentry as parameter])
993 EXTRA_KCFLAGS="$tmp_flags"
997 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
998 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1000 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1001 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1002 tmp_flags="$EXTRA_KCFLAGS"
1003 EXTRA_KCFLAGS="-Werror"
1004 LB_LINUX_TRY_COMPILE([
1005 #include <linux/fs.h>
1006 #include <linux/types.h>
1007 int my_mknod(struct inode *dir, struct dentry *dchild,
1008 umode_t mode, dev_t dev)
1013 struct inode_operations ops;
1014 ops.mknod = my_mknod;
1016 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1017 [inode_operations use umode_t as parameter])
1018 AC_MSG_RESULT([yes])
1022 EXTRA_KCFLAGS="$tmp_flags"
1025 # 3.4 kmap_atomic removes second argument
1026 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1028 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1029 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1030 LB_LINUX_TRY_COMPILE([
1031 #include <linux/highmem.h>
1035 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1036 [have kmap_atomic has only 1 argument])
1037 AC_MSG_RESULT([yes])
1044 # 3.4 converts d_alloc_root to d_make_root
1045 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1047 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1048 [AC_MSG_CHECKING([if have d_make_root])
1049 LB_LINUX_TRY_COMPILE([
1050 #include <linux/fs.h>
1052 d_make_root((struct inode *)NULL);
1054 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1056 AC_MSG_RESULT([yes])
1063 # 3.4 cache_register/cache_unregister are removed
1064 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1065 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1066 # are defined, but not exported.
1067 # 3.3 cache_register_net/cache_unregister_net are
1068 # exported and replacing cache_register/cache_unregister in 3.4
1070 AC_DEFUN([LC_HAVE_CACHE_REGISTER],
1071 [AC_MSG_CHECKING([if have cache_register])
1072 LB_LINUX_TRY_COMPILE([
1073 #include <linux/sunrpc/cache.h>
1075 cache_register(NULL);
1077 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1078 [have cache_register])
1079 AC_MSG_RESULT([yes])
1086 # 3.5 renames end_writeback() back to clear_inode()...
1087 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1089 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1090 [AC_MSG_CHECKING([if have clear_inode])
1091 LB_LINUX_TRY_COMPILE([
1092 #include <linux/fs.h>
1094 clear_inode((struct inode *)NULL);
1096 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1098 AC_MSG_RESULT([yes])
1105 # 3.5 encode_fh has parent inode passed in directly
1106 # see kernel commit b0b0382b
1108 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1109 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1110 tmp_flags="$EXTRA_KCFLAGS"
1111 EXTRA_KCFLAGS="-Werror"
1112 LB_LINUX_TRY_COMPILE([
1113 #include <linux/exportfs.h>
1114 #include <linux/fs.h>
1115 #include <linux/types.h>
1116 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1121 struct export_operations exp_op;
1122 exp_op.encode_fh = ll_encode_fh;
1124 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1125 [have parent inode as parameter])
1126 AC_MSG_RESULT([yes])
1130 EXTRA_KCFLAGS="$tmp_flags"
1133 # 3.5 has generic_file_llseek_size with 5 args
1134 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1135 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1136 LB_LINUX_TRY_COMPILE([
1137 #include <linux/fs.h>
1139 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1141 AC_MSG_RESULT([yes])
1142 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1143 [kernel has generic_file_llseek_size with 5 args])
1150 # 3.6 switch i_dentry/d_alias from list to hlist
1152 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1153 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1154 tmp_flags="$EXTRA_KCFLAGS"
1155 EXTRA_KCFLAGS="-Werror"
1156 LB_LINUX_TRY_COMPILE([
1157 #include <linux/fs.h>
1158 #include <linux/list.h>
1161 struct dentry dentry;
1162 struct hlist_head head;
1163 struct hlist_node node;
1164 inode.i_dentry = head;
1165 dentry.d_alias = node;
1167 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1168 [have i_dentry/d_alias uses hlist])
1169 AC_MSG_RESULT([yes])
1173 EXTRA_KCFLAGS="$tmp_flags"
1177 # 3.6 dentry_open uses struct path as first argument
1178 # see kernel commit 765927b2
1180 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1181 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1182 tmp_flags="$EXTRA_KCFLAGS"
1183 EXTRA_KCFLAGS="-Werror"
1184 LB_LINUX_TRY_COMPILE([
1185 #include <linux/fs.h>
1186 #include <linux/path.h>
1189 dentry_open(&path, 0, NULL);
1191 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1192 [dentry_open uses struct path as first argument])
1193 AC_MSG_RESULT([yes])
1197 EXTRA_KCFLAGS="$tmp_flags"
1201 # 3.6 vfs adds iop->atomic_open
1203 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1204 [AC_MSG_CHECKING([if iop has atomic_open])
1205 LB_LINUX_TRY_COMPILE([
1206 #include <linux/fs.h>
1208 struct inode_operations iop;
1209 iop.atomic_open = NULL;
1211 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1212 [have iop atomic_open])
1213 AC_MSG_RESULT([yes])
1220 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1222 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1223 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1224 LB_LINUX_TRY_COMPILE([
1225 #include <linux/fs.h>
1226 #include <linux/posix_acl_xattr.h>
1228 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1230 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1231 [posix_acl_to_xattr takes struct user_namespace])
1232 AC_MSG_RESULT([yes])
1239 # 3.8 struct file has new member f_inode
1241 AC_DEFUN([LC_HAVE_FILE_F_INODE],
1242 [AC_MSG_CHECKING([if struct file has memeber f_inode])
1243 LB_LINUX_TRY_COMPILE([
1244 #include <linux/fs.h>
1246 ((struct file *)0)->f_inode = NULL;
1248 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1249 [struct file has memeber f_inode])
1250 AC_MSG_RESULT([yes])
1256 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS],
1257 [AC_MSG_CHECKING([if sunrpc_cache_pipe_upcall takes 3 args])
1258 LB_LINUX_TRY_COMPILE([
1259 #include <linux/sunrpc/cache.h>
1261 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1263 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1264 [sunrpc_cache_pipe_upcall takes 3 args])
1265 AC_MSG_RESULT([yes])
1272 # 3.9 uses hlist_for_each_entry with 3 args
1273 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1275 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1276 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1277 LB_LINUX_TRY_COMPILE([
1278 #include <linux/list.h>
1279 #include <linux/fs.h>
1281 struct inode *inode;
1282 struct dentry *dentry;
1283 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1287 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1288 AC_MSG_RESULT([yes])
1295 # 3.10+ only supports procfs seq_files handling
1297 AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ],
1298 [AC_MSG_CHECKING([if procfs only supports using seq_files])
1299 LB_LINUX_TRY_COMPILE([
1300 #include <linux/proc_fs.h>
1302 ((struct proc_dir_entry *)0)->write_proc(NULL, NULL, 0, NULL);
1306 AC_DEFINE(HAVE_ONLY_PROCFS_SEQ, 1, [only seq_files supported])
1307 AC_MSG_RESULT([yes])
1311 # 3.10 release for block device doesn't return int
1312 AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT],
1313 [AC_MSG_CHECKING([if block_device_operations release returns int])
1314 LB_LINUX_TRY_COMPILE([
1315 #include <linux/blkdev.h>
1317 struct block_device_operations fops;
1318 int i __attribute__ ((unused));
1320 i = fops.release(NULL,0);
1322 AC_MSG_RESULT([yes])
1323 AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
1324 [block device release returns int])
1331 # 3.11 invalidatepage requires the length of the range to invalidate
1333 AC_DEFUN([LC_INVALIDATE_RANGE],
1334 [AC_MSG_CHECKING([if address_space_operations.invalidatepage requires 3 arguments])
1335 LB_LINUX_TRY_COMPILE([
1336 #include <linux/fs.h>
1338 struct address_space_operations a_ops;
1340 a_ops.invalidatepage(NULL,0,0);
1342 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1, [address_space_operations.invalidatepage needs 3 arguments])
1343 AC_MSG_RESULT([yes])
1350 # 3.11 readdir now takes the new struct dir_context
1352 AC_DEFUN([LC_HAVE_DIR_CONTEXT],
1353 [AC_MSG_CHECKING([if dir_context exist])
1354 LB_LINUX_TRY_COMPILE([
1355 #include <linux/fs.h>
1357 struct dir_context ctx;
1361 AC_DEFINE(HAVE_DIR_CONTEXT, 1, [dir_context exist])
1362 AC_MSG_RESULT([yes])
1369 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1371 AC_DEFUN([LC_D_COMPARE_5ARGS],
1372 [AC_MSG_CHECKING([if d_compare taken 5 arguments])
1373 LB_LINUX_TRY_COMPILE([
1374 #include <linux/dcache.h>
1376 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1378 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1379 [d_compare need 5 arguments])
1380 AC_MSG_RESULT([yes])
1387 # 3.11 need to access d_count to get dentry reference count
1389 AC_DEFUN([LC_HAVE_DCOUNT],
1390 [AC_MSG_CHECKING([if d_count exist])
1391 LB_LINUX_TRY_COMPILE([
1392 #include <linux/dcache.h>
1398 AC_DEFINE(HAVE_D_COUNT, 1, [d_count exist])
1399 AC_MSG_RESULT([yes])
1406 # 3.12 truncate_pagecache without oldsize parameter
1408 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE],
1409 [AC_MSG_CHECKING([if truncate_pagecache with old_size parameter])
1410 LB_LINUX_TRY_COMPILE([
1411 #include <linux/mm.h>
1413 truncate_pagecache(NULL, 0, 0);
1415 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1, [with oldsize])
1416 AC_MSG_RESULT([yes])
1423 # 3.12 ki_left removed from struct kiocb
1425 AC_DEFUN([LC_KIOCB_KI_LEFT],
1426 [AC_MSG_CHECKING([if struct kiocb with ki_left member])
1427 LB_LINUX_TRY_COMPILE([
1428 #include <linux/aio.h>
1430 ((struct kiocb*)0)->ki_left = 0;
1432 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1, [ki_left exist])
1433 AC_MSG_RESULT([yes])
1442 # Lustre linux kernel checks
1444 AC_DEFUN([LC_PROG_LINUX],
1448 LC_CONFIG_LIBLUSTRE_RECOVERY
1449 LC_CONFIG_HEALTH_CHECK_WRITE
1450 LC_CONFIG_LRU_RESIZE
1451 LC_LLITE_LLOOP_MODULE
1453 LC_GLIBC_SUPPORT_FHANDLES
1459 LC_BLK_QUEUE_MAX_SEGMENTS
1462 LC_HAVE_DQUOT_FS_DISK_QUOTA
1463 LC_HAVE_DQUOT_SUSPEND
1467 LC_EXPORT_SIMPLE_SETATTR
1468 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1472 LC_SBOPS_EVICT_INODE
1478 LC_BLKDEV_GET_BY_DEV
1479 LC_GENERIC_PERMISSION
1486 LC_REQUEST_QUEUE_UNPLUG_FN
1487 LC_HAVE_FHANDLE_SYSCALLS
1488 LC_HAVE_FSTYPE_MOUNT
1492 LC_DIRTY_INODE_WITH_FLAG
1495 LC_LM_XXX_LOCK_MANAGER_OPS
1499 LC_INODE_PERMISION_2ARGS
1502 LC_HAVE_VOID_MAKE_REQUEST_FN
1503 LC_HAVE_PROTECT_I_NLINK
1506 LC_HAVE_MIGRATE_HEADER
1507 LC_MIGRATEPAGE_4ARGS
1508 LC_SUPEROPS_USE_DENTRY
1509 LC_INODEOPS_USE_UMODE_T
1510 LC_HAVE_CACHE_REGISTER
1514 LC_KMAP_ATOMIC_HAS_1ARG
1518 LC_HAVE_ENCODE_FH_PARENT
1519 LC_FILE_LLSEEK_SIZE_5ARG
1522 LC_HAVE_DENTRY_D_ALIAS_HLIST
1523 LC_DENTRY_OPEN_USE_PATH
1524 LC_HAVE_IOP_ATOMIC_OPEN
1527 LC_HAVE_POSIXACL_USER_NS
1530 LC_HAVE_FILE_F_INODE
1531 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1534 LC_HAVE_HLIST_FOR_EACH_3ARG
1537 LC_HAVE_ONLY_PROCFS_SEQ
1538 LC_BLKDEV_RELEASE_RETURN_INT
1547 LC_OLDSIZE_TRUNCATE_PAGECACHE
1551 if test x$enable_server != xno ; then
1552 LC_FUNC_DEV_SET_RDONLY
1562 # Check whether to build the client side of Lustre
1564 AC_DEFUN([LC_CONFIG_CLIENT],
1565 [AC_MSG_CHECKING([whether to build Lustre client support])
1566 AC_ARG_ENABLE([client],
1567 AC_HELP_STRING([--disable-client],
1568 [disable Lustre client support]),
1569 [],[enable_client='yes'])
1570 AC_MSG_RESULT([$enable_client])
1574 # LC_CONFIG_LIBLUSTRE
1576 # whether to build liblustre
1578 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1579 [AC_MSG_CHECKING([whether to build Lustre library])
1580 AC_ARG_ENABLE([liblustre],
1581 AC_HELP_STRING([--disable-liblustre],
1582 [disable building of Lustre library]),
1583 [],[enable_liblustre=$with_sysio])
1584 AC_MSG_RESULT([$enable_liblustre])
1585 # only build sysio if liblustre is built
1586 with_sysio="$enable_liblustre"
1588 AC_MSG_CHECKING([whether to build liblustre tests])
1589 AC_ARG_ENABLE([liblustre-tests],
1590 AC_HELP_STRING([--enable-liblustre-tests],
1591 [enable liblustre tests, if --disable-tests is used]),
1592 [],[enable_liblustre_tests=$enable_tests])
1593 if test x$enable_liblustre != xyes ; then
1594 enable_liblustre_tests='no'
1596 AC_MSG_RESULT([$enable_liblustre_tests])
1598 AC_MSG_CHECKING([whether to enable liblustre acl])
1599 AC_ARG_ENABLE([liblustre-acl],
1600 AC_HELP_STRING([--disable-liblustre-acl],
1601 [disable ACL support for liblustre]),
1602 [],[enable_liblustre_acl=yes])
1603 AC_MSG_RESULT([$enable_liblustre_acl])
1604 if test x$enable_liblustre_acl = xyes ; then
1605 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1611 AC_ARG_ENABLE(mpitests,
1612 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1613 [include mpi tests]),
1624 MPICC_WRAPPER=$enableval
1634 if test x$enable_mpitests != xno; then
1635 AC_MSG_CHECKING([whether mpitests can be built])
1643 MPI_Initialized(&flag);
1646 AC_MSG_RESULT([yes])
1653 AC_SUBST(MPICC_WRAPPER)
1655 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1656 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1659 LC_CONFIG_LIBLUSTRE_RECOVERY
1665 # whether to enable quota support global control
1667 AC_DEFUN([LC_CONFIG_QUOTA],
1668 [AC_ARG_ENABLE([quota],
1669 AC_HELP_STRING([--enable-quota],
1670 [enable quota support]),
1671 [],[enable_quota='yes'])
1674 AC_DEFUN([LC_QUOTA],
1678 if test x$enable_quota != xno -a x$enable_utils != xno; then
1679 AC_CHECK_HEADER(sys/quota.h,
1680 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1681 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1688 # whether to enable split support
1690 AC_DEFUN([LC_CONFIG_SPLIT],
1691 [AC_MSG_CHECKING([whether to enable split support])
1692 AC_ARG_ENABLE([split],
1693 AC_HELP_STRING([--enable-split],
1694 [enable split support]),
1695 [],[enable_split='no'])
1696 AC_MSG_RESULT([$enable_split])
1697 if test x$enable_split != xno; then
1698 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1703 # LC_CONFIG_NODEMAP_PROC_DEBUG
1705 # enable nodemap proc file debugging
1707 AC_DEFUN([LC_NODEMAP_PROC_DEBUG],
1708 [AC_MSG_CHECKING([whether to enable nodemap proc debug])
1709 AC_ARG_ENABLE([nodemap_proc_debug],
1710 AC_HELP_STRING([--enable-nodemap-proc-debug],
1711 [enable nodemap proc debug]),
1712 [],[enable_nodemap_proc_debug='no'])
1713 AC_MSG_RESULT([$enable_nodemap_proc_debug])
1714 if test x$enable_nodemap_proc_debug != xno; then
1715 AC_DEFINE(NODEMAP_PROC_DEBUG, 1, [enable nodemap proc debug support])
1720 # LC_LLITE_LLOOP_MODULE
1721 # lloop_llite.ko does not currently work with page sizes
1724 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1725 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1726 LB_LINUX_TRY_COMPILE([
1727 #include <asm/page.h>
1729 #if PAGE_SIZE >= 65536
1730 #error "PAGE_SIZE >= 65536"
1733 enable_llite_lloop_module='yes'
1734 AC_MSG_RESULT([yes])
1736 enable_llite_lloop_module='no'
1744 # configure support for optional OSD implementation
1746 AC_DEFUN([LC_OSD_ADDON],
1747 [AC_MSG_CHECKING([for osd])
1749 AC_HELP_STRING([--with-osd=path],
1750 [set path to optional osd]),
1753 no) ENABLEOSDADDON=0
1755 *) OSDADDON="${with_osd}"
1762 if test $ENABLEOSDADDON -eq 0; then
1766 OSDMODNAME=`basename $OSDADDON`
1767 if test -e $LUSTRE/$OSDMODNAME; then
1768 AC_MSG_RESULT([can't link])
1770 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1771 AC_MSG_RESULT([$OSDMODNAME])
1772 OSDADDON="subdir-m += $OSDMODNAME"
1774 AC_MSG_RESULT([can't link])
1784 # other configure checks
1786 AC_DEFUN([LC_CONFIGURE],
1787 [LC_CONFIG_OBD_BUFFER_SIZE
1789 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1790 CFLAGS="$CFLAGS -Werror"
1793 # maximum MDS thread count
1796 # include/liblustre.h
1797 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1799 # liblustre/llite_lib.h
1800 AC_CHECK_HEADERS([xtio.h file.h])
1803 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1806 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1807 AC_CHECK_FUNCS([inet_ntoa])
1809 # libsysio/src/readlink.c
1812 # libcfs prng.c - depends on linux/types.h from liblustre/dir.c
1813 AC_CHECK_HEADERS([linux/random.h], [], [],
1814 [#ifdef HAVE_LINUX_TYPES_H
1815 # include <linux/types.h>
1820 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1822 # check for -lz support
1826 [AC_CHECK_HEADERS([zlib.h],
1828 AC_DEFINE([HAVE_ADLER], 1,
1829 [support alder32 checksum type])],
1832 No zlib-devel package found, unable to use adler32 checksum
1836 No zlib package found, unable to use adler32 checksum
1842 AC_CHECK_LIB([selinux],
1843 [is_selinux_enabled],
1844 [AC_CHECK_HEADERS([selinux.h],
1845 [SELINUX="-lselinux"
1846 AC_DEFINE([HAVE_SELINUX], 1,
1847 [support for selinux ])],
1850 No selinux-devel package found, unable to build selinux enabled tools
1854 No selinux package found, unable to build selinux enabled tools
1860 AC_ARG_ENABLE([mindf],
1861 AC_HELP_STRING([--enable-mindf],
1862 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1864 if test "$enable_mindf" = "yes" ; then
1865 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1868 AC_ARG_ENABLE([fail_alloc],
1869 AC_HELP_STRING([--disable-fail-alloc],
1870 [disable randomly alloc failure]),
1871 [],[enable_fail_alloc=yes])
1872 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1873 AC_MSG_RESULT([$enable_fail_alloc])
1874 if test x$enable_fail_alloc != xno ; then
1875 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1878 AC_ARG_ENABLE([invariants],
1879 AC_HELP_STRING([--enable-invariants],
1880 [enable invariant checking (cpu intensive)]),
1882 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1883 AC_MSG_RESULT([$enable_invariants])
1884 if test x$enable_invariants = xyes ; then
1885 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1888 AC_ARG_ENABLE([lu_ref],
1889 AC_HELP_STRING([--enable-lu_ref],
1890 [enable lu_ref reference tracking code]),
1892 AC_MSG_CHECKING([whether to track references with lu_ref])
1893 AC_MSG_RESULT([$enable_lu_ref])
1894 if test x$enable_lu_ref = xyes ; then
1895 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1898 AC_ARG_ENABLE([pgstate-track],
1899 AC_HELP_STRING([--enable-pgstate-track],
1900 [enable page state tracking]),
1901 [enable_pgstat_track='yes'],[])
1902 AC_MSG_CHECKING([whether to enable page state tracking])
1903 AC_MSG_RESULT([$enable_pgstat_track])
1904 if test x$enable_pgstat_track = xyes ; then
1905 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1906 [enable page state tracking code])
1913 # AM_CONDITIONALS for lustre
1915 AC_DEFUN([LC_CONDITIONALS],
1916 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1917 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1918 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1919 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1920 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1921 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1922 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1923 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1924 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1925 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1926 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1927 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1928 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1934 # files that should be generated with AC_OUTPUT
1936 AC_DEFUN([LC_CONFIG_FILES],
1940 lustre/autoconf/Makefile
1941 lustre/conf/Makefile
1942 lustre/contrib/Makefile
1944 lustre/include/Makefile
1945 lustre/include/lustre_ver.h
1946 lustre/include/linux/Makefile
1947 lustre/include/darwin/Makefile
1948 lustre/include/lustre/Makefile
1949 lustre/kernel_patches/targets/2.6-rhel6.target
1950 lustre/kernel_patches/targets/2.6-rhel5.target
1951 lustre/kernel_patches/targets/2.6-sles11.target
1952 lustre/kernel_patches/targets/3.0-sles11.target
1953 lustre/kernel_patches/targets/3.0-sles11sp3.target
1954 lustre/kernel_patches/targets/2.6-fc11.target
1955 lustre/kernel_patches/targets/2.6-fc12.target
1956 lustre/kernel_patches/targets/2.6-fc15.target
1957 lustre/kernel_patches/targets/3.x-fc18.target
1958 lustre/ldlm/Makefile
1960 lustre/fid/autoMakefile
1961 lustre/liblustre/Makefile
1962 lustre/liblustre/tests/Makefile
1963 lustre/liblustre/tests/mpi/Makefile
1964 lustre/llite/Makefile
1965 lustre/llite/autoMakefile
1966 lustre/lclient/Makefile
1968 lustre/lov/autoMakefile
1970 lustre/mdc/autoMakefile
1972 lustre/lmv/autoMakefile
1973 lustre/lfsck/Makefile
1974 lustre/lfsck/autoMakefile
1976 lustre/mdt/autoMakefile
1977 lustre/nodemap/Makefile
1978 lustre/nodemap/autoMakefile
1980 lustre/mdd/autoMakefile
1982 lustre/fld/autoMakefile
1983 lustre/obdclass/Makefile
1984 lustre/obdclass/autoMakefile
1985 lustre/obdclass/linux/Makefile
1986 lustre/obdecho/Makefile
1987 lustre/obdecho/autoMakefile
1989 lustre/ofd/autoMakefile
1991 lustre/osc/autoMakefile
1993 lustre/ost/autoMakefile
1994 lustre/osd-ldiskfs/Makefile
1995 lustre/osd-ldiskfs/autoMakefile
1996 lustre/osd-zfs/Makefile
1997 lustre/osd-zfs/autoMakefile
1999 lustre/mgc/autoMakefile
2001 lustre/mgs/autoMakefile
2002 lustre/target/Makefile
2003 lustre/ptlrpc/Makefile
2004 lustre/ptlrpc/autoMakefile
2005 lustre/ptlrpc/gss/Makefile
2006 lustre/ptlrpc/gss/autoMakefile
2007 lustre/quota/Makefile
2008 lustre/quota/autoMakefile
2009 lustre/scripts/Makefile
2010 lustre/tests/Makefile
2011 lustre/tests/mpi/Makefile
2012 lustre/utils/Makefile
2013 lustre/utils/gss/Makefile
2015 lustre/osp/autoMakefile
2017 lustre/lod/autoMakefile
2018 lustre/obdclass/darwin/Makefile