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])
86 # LC_FUNC_DEV_SET_RDONLY
88 # check whether dev_set_rdonly is exported. This is needed until we
89 # have another mechanism to fence IO from the underlying device.
91 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
92 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
93 [block/ll_rw_block.c,block/blk-core.c],[
94 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
96 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
101 # Ensure stack size big than 8k in Lustre server (all kernels)
103 AC_DEFUN([LC_STACK_SIZE],
104 [AC_MSG_CHECKING([stack size big than 8k])
105 LB_LINUX_TRY_COMPILE([
106 #include <linux/thread_info.h>
108 #if THREAD_SIZE < 8192
109 #error "stack size < 8192"
114 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
119 # Allow the user to set the MDS thread upper limit
121 AC_DEFUN([LC_MDS_MAX_THREADS],
123 AC_ARG_WITH([mds_max_threads],
124 AC_HELP_STRING([--with-mds-max-threads=count],
125 [maximum threads available on the MDS: (default=512)]),
127 MDS_THREAD_COUNT=$with_mds_max_threads
128 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
135 # the pinger is temporary, until we have the recovery node in place
137 AC_DEFUN([LC_CONFIG_PINGER],
138 [AC_MSG_CHECKING([whether to enable pinger support])
139 AC_ARG_ENABLE([pinger],
140 AC_HELP_STRING([--disable-pinger],
141 [disable recovery pinger support]),
142 [],[enable_pinger='yes'])
143 AC_MSG_RESULT([$enable_pinger])
144 if test x$enable_pinger != xno ; then
145 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
152 # do checksum of bulk data between client and OST
154 AC_DEFUN([LC_CONFIG_CHECKSUM],
155 [AC_MSG_CHECKING([whether to enable data checksum support])
156 AC_ARG_ENABLE([checksum],
157 AC_HELP_STRING([--disable-checksum],
158 [disable data checksum support]),
159 [],[enable_checksum='yes'])
160 AC_MSG_RESULT([$enable_checksum])
161 if test x$enable_checksum != xno ; then
162 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
169 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
170 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
171 AC_ARG_ENABLE([liblustre-recovery],
172 AC_HELP_STRING([--disable-liblustre-recovery],
173 [disable liblustre recovery support]),
174 [],[enable_liblustre_recovery='yes'])
175 AC_MSG_RESULT([$enable_liblustre_recovery])
176 if test x$enable_liblustre_recovery != xno ; then
177 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
182 # LC_CONFIG_HEALTH_CHECK_WRITE
184 # Turn off the actual write to the disk
186 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
187 [AC_MSG_CHECKING([whether to enable a write with the health check])
188 AC_ARG_ENABLE([health_write],
189 AC_HELP_STRING([--enable-health_write],
190 [enable disk writes when doing health check]),
191 [],[enable_health_write='no'])
192 AC_MSG_RESULT([$enable_health_write])
193 if test x$enable_health_write != xno ; then
194 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
198 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
199 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
200 AC_ARG_ENABLE([lru_resize],
201 AC_HELP_STRING([--enable-lru-resize],
202 [enable lru resize support]),
203 [],[enable_lru_resize='yes'])
204 AC_MSG_RESULT([$enable_lru_resize])
205 if test x$enable_lru_resize != xno; then
206 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
211 # Quota support. The kernel must support CONFIG_QUOTA.
213 AC_DEFUN([LC_QUOTA_CONFIG],
214 [LB_LINUX_CONFIG_IM([QUOTA],[],[
215 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
219 # truncate_complete_page() has never been exported from an upstream kernel
220 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
221 # delete_from_page_cache() is exported from 2.6.39
222 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
223 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
225 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226 [kernel export truncate_complete_page])])
227 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
229 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
230 [kernel export remove_from_page_cache])])
231 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
233 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234 [kernel export delete_from_page_cache])])
240 AC_DEFUN([LC_CAPA_CRYPTO],
241 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
242 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
244 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
245 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
247 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
248 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
253 # LC_CONFIG_RMTCLIENT
256 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
258 AC_DEFUN([LC_CONFIG_RMTCLIENT],
259 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
260 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
265 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
267 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
268 [AC_MSG_CHECKING([whether to enable gss keyring backend])
269 AC_ARG_ENABLE([gss_keyring],
270 [AC_HELP_STRING([--disable-gss-keyring],
271 [disable gss keyring backend])],
272 [],[enable_gss_keyring='yes'])
273 AC_MSG_RESULT([$enable_gss_keyring])
275 if test x$enable_gss_keyring != xno; then
276 LB_LINUX_CONFIG_IM([KEYS],[],
277 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
279 AC_CHECK_LIB([keyutils], [keyctl_search], [],
280 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
282 AC_DEFINE([HAVE_GSS_KEYRING], [1],
283 [Define this if you enable gss keyring backend])
287 AC_DEFUN([LC_CONFIG_SUNRPC],
288 [LB_LINUX_CONFIG_IM([SUNRPC],[],
289 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
293 # LC_CONFIG_GSS (default disabled)
295 # Build gss and related tools of Lustre. Currently both kernel and user space
296 # parts are depend on linux platform.
298 AC_DEFUN([LC_CONFIG_GSS],
299 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
301 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
302 [],[enable_gss='no'])
303 AC_MSG_RESULT([$enable_gss])
305 if test x$enable_gss == xyes; then
306 LC_CONFIG_GSS_KEYRING
309 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
311 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
312 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
313 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
314 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
315 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
316 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
317 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
318 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
320 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
321 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
322 [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
323 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
324 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
326 AC_SUBST(GSSAPI_LIBS)
334 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
335 # yet tree_lock is converted from rwlock to spin_lock since v2.6.26
336 AC_DEFUN([LC_RW_TREE_LOCK],
337 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
338 tmp_flags="$EXTRA_KCFLAGS"
339 EXTRA_KCFLAGS="-Werror"
340 LB_LINUX_TRY_COMPILE([
341 #include <linux/fs.h>
343 struct address_space a;
345 write_lock(&a.tree_lock);
348 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
352 EXTRA_KCFLAGS="$tmp_flags"
355 #2.6.18 + RHEL5 (fc6)
357 # raid5-zerocopy patch
362 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
363 # it support constant page, which means the page won't be modified during the
366 AC_DEFUN([LC_PAGE_CONSTANT],
367 [AC_MSG_CHECKING([if kernel have PageConstant defined])
368 LB_LINUX_TRY_COMPILE([
369 #include <linux/mm.h>
370 #include <linux/page-flags.h>
373 #error "Have no raid5 zcopy patch"
377 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
386 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
388 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
389 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
390 LB_LINUX_TRY_COMPILE([
391 #include <linux/fs.h>
393 int v __attribute__ ((unused));
394 v = FS_RENAME_DOES_D_MOVE;
397 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
405 # 2.6.24 has bio_endio with 2 args
406 AC_DEFUN([LC_BIO_ENDIO_2ARG],
407 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
408 LB_LINUX_TRY_COMPILE([
409 #include <linux/bio.h>
414 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
415 [kernel has bio_endio with 2 args])
421 # 2.6.24 removes long aged procfs entry -> deleted member
422 AC_DEFUN([LC_PROCFS_DELETED],
423 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
424 LB_LINUX_TRY_COMPILE([
425 #include <linux/proc_fs.h>
427 struct proc_dir_entry pde;
429 pde.deleted = sizeof(pde);
432 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
433 [kernel has deleted member in procfs entry struct])
443 # LC_SECURITY_PLUG # for SLES10 SP2 (2.6.27)
444 # check security plug in sles10 sp2 kernel
445 AC_DEFUN([LC_SECURITY_PLUG],
446 [AC_MSG_CHECKING([If kernel has security plug support])
447 LB_LINUX_TRY_COMPILE([
448 #include <linux/fs.h>
449 #include <linux/stddef.h>
451 notify_change(NULL, NULL, NULL);
454 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
455 [SLES10 SP2 use extra parameter in vfs])
461 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
462 [AC_MSG_CHECKING([inode_operations->permission has two args])
463 LB_LINUX_TRY_COMPILE([
464 #include <linux/fs.h>
466 struct inode *inode __attribute__ ((unused));
469 inode->i_op->permission(NULL, 0);
471 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
472 [inode_operations->permission has two args])
479 # 2.6.27 use 5th parameter in quota_on for remount.
480 AC_DEFUN([LC_QUOTA_ON_5ARGS],
481 [AC_MSG_CHECKING([quota_on needs 5 parameters])
482 LB_LINUX_TRY_COMPILE([
483 #include <linux/fs.h>
484 #include <linux/quota.h>
486 struct quotactl_ops *qop = NULL;
487 qop->quota_on(NULL, 0, 0, NULL, 0);
489 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
490 [quota_on needs 5 paramters])
497 # 2.6.27 use 3th parameter in quota_off for remount.
498 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
499 [AC_MSG_CHECKING([quota_off needs 3 parameters])
500 LB_LINUX_TRY_COMPILE([
501 #include <linux/fs.h>
502 #include <linux/quota.h>
504 struct quotactl_ops *qop = NULL;
505 qop->quota_off(NULL, 0, 0);
507 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
508 [quota_off needs 3 paramters])
515 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
516 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
517 tmp_flags="$EXTRA_KCFLAGS"
518 EXTRA_KCFLAGS="-Werror"
519 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
520 LB_LINUX_TRY_COMPILE([
521 #include <linux/fs.h>
522 #include <linux/quota.h>
524 struct quotactl_ops qops = {};
525 struct fs_disk_quota fdq;
526 qops.set_dqblk(NULL, 0, 0, &fdq);
528 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
533 EXTRA_KCFLAGS="$tmp_flags"
536 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
537 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
538 [AC_MSG_CHECKING([if dquot_suspend is defined])
539 LB_LINUX_TRY_COMPILE([
540 #include <linux/quotaops.h>
542 dquot_suspend(NULL, -1);
544 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
553 # 2.6.27 sles11 remove the bi_hw_segments
554 AC_DEFUN([LC_BI_HW_SEGMENTS],
555 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
556 LB_LINUX_TRY_COMPILE([
557 #include <linux/bio.h>
560 io.bi_hw_segments = sizeof(io);
562 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
563 [struct bio has a bi_hw_segments field])
571 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
572 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
573 AC_DEFUN([LC_HAVE_QUOTAIO_H],
574 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
575 AC_DEFINE(HAVE_QUOTAIO_H, 1,
576 [kernel has include/linux/quotaio_v2.h])
577 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
578 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
579 [kernel has fs/quotaio_v1.h])
580 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
581 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
582 [kernel has fs/quota/quotaio_v2.h])
592 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
593 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
594 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
595 LB_LINUX_TRY_COMPILE([
596 #include <linux/blkdev.h>
598 blk_queue_max_segments(NULL, 0);
601 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
602 [blk_queue_max_segments is defined])
611 # Check if kernel has been patched for 64-bit quota limits support.
612 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
613 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
614 # that in the absence of quotaio_v1.h in the kernel headers.
616 AC_DEFUN([LC_QUOTA64],[
617 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
618 tmp_flags="$EXTRA_KCFLAGS"
619 EXTRA_KCFLAGS="-I$LINUX/fs"
620 LB_LINUX_TRY_COMPILE([
621 #include <linux/kernel.h>
622 #include <linux/fs.h>
623 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
624 # include <quota/quotaio_v2.h>
625 struct v2r1_disk_dqblk dqblk_r1;
627 #include <linux/quota.h>
628 int ver = QFMT_VFS_V1;
631 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
634 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
635 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
639 EXTRA_KCFLAGS=$tmp_flags
643 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
645 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
646 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
647 LB_LINUX_TRY_COMPILE([
648 #include <asm/atomic.h>
649 #include <linux/spinlock.h>
650 #include <linux/fs_struct.h>
652 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
654 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
655 [fs_struct.lock use rwlock])
663 # 2.6.36 super_operations add evict_inode method. it hybird of
664 # delete_inode & clear_inode.
666 AC_DEFUN([LC_SBOPS_EVICT_INODE],
667 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
668 LB_LINUX_TRY_COMPILE([
669 #include <linux/fs.h>
671 ((struct super_operations *)0)->evict_inode(NULL);
673 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
674 [super_operations.evict_inode() is exist in kernel])
682 # 2.6.35 file_operations.fsync taken 2 arguments.
683 # 3.0.0 file_operations.fsync takes 4 arguments.
685 AC_DEFUN([LC_FILE_FSYNC],
686 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
687 LB_LINUX_TRY_COMPILE([
688 #include <linux/fs.h>
690 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
692 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
693 [file_operations.fsync takes 4 arguments])
694 AC_MSG_RESULT([yes, 4 args])
696 LB_LINUX_TRY_COMPILE([
697 #include <linux/fs.h>
699 ((struct file_operations *)0)->fsync(NULL, 0);
701 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
702 [file_operations.fsync takes 2 arguments])
703 AC_MSG_RESULT([yes, 2 args])
711 # 2.6.37 remove kernel_locked
713 AC_DEFUN([LC_KERNEL_LOCKED],
714 [AC_MSG_CHECKING([if kernel_locked is defined])
715 LB_LINUX_TRY_COMPILE([
716 #include <linux/smp_lock.h>
721 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
722 [kernel_locked is defined])
729 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
731 AC_DEFUN([LC_D_COMPARE_7ARGS],
732 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
733 LB_LINUX_TRY_COMPILE([
734 #include <linux/dcache.h>
736 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
738 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
739 [d_compare need 7 arguments])
747 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
749 AC_DEFUN([LC_D_DELETE_CONST],
750 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
751 tmp_flags="$EXTRA_KCFLAGS"
752 EXTRA_KCFLAGS="-Werror"
753 LB_LINUX_TRY_COMPILE([
754 #include <linux/dcache.h>
756 const struct dentry *d = NULL;
757 ((struct dentry_operations*)0)->d_delete(d);
759 AC_DEFINE(HAVE_D_DELETE_CONST, const,
760 [d_delete first parameter declared const])
763 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
766 EXTRA_KCFLAGS="$tmp_flags"
770 # 2.6.38 dcache_lock removed. rcu-walk commited.
772 AC_DEFUN([LC_DCACHE_LOCK],
773 [AC_MSG_CHECKING([if dcache_lock is exist])
774 LB_LINUX_TRY_COMPILE([
775 #include <linux/dcache.h>
777 spin_lock(&dcache_lock);
779 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
780 [dcache_lock is exist])
788 # 2.6.38 inode.i_rcu added.
790 AC_DEFUN([LC_INODE_I_RCU],
791 [AC_MSG_CHECKING([if inode.i_rcu exists])
792 LB_LINUX_TRY_COMPILE([
793 #include <linux/fs.h>
796 struct rcu_head rcu = {};
799 AC_DEFINE(HAVE_INODE_I_RCU, 1,
800 [inode.i_rcu exists])
808 # 2.6.38 export blkdev_get_by_dev
810 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
811 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
813 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
814 [blkdev_get_by_dev is exported by the kernel])
820 # 2.6.38 use path as 4th parameter in quota_on.
822 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
823 [AC_MSG_CHECKING([quota_on use path as parameter])
824 tmp_flags="$EXTRA_KCFLAGS"
825 EXTRA_KCFLAGS="-Werror"
826 LB_LINUX_TRY_COMPILE([
827 #include <linux/fs.h>
828 #include <linux/quota.h>
830 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
832 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
833 [quota_on use path as 4th paramter])
838 EXTRA_KCFLAGS="$tmp_flags"
842 # 2.6.38 export simple_setattr
844 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
845 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
847 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
848 [simple_setattr is exported by the kernel])
854 # 2.6.39 remove unplug_fn from request_queue.
856 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
857 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
858 LB_LINUX_TRY_COMPILE([
859 #include <linux/blkdev.h>
861 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
863 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
864 [request_queue has unplug_fn field])
872 # 2.6.39 replace get_sb with mount in struct file_system_type
874 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
875 [AC_MSG_CHECKING([if file_system_type has mount field])
876 LB_LINUX_TRY_COMPILE([
877 #include <linux/fs.h>
879 struct file_system_type fst;
880 void *i = (void *) fst.mount;
882 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
883 [struct file_system_type has mount field])
891 # 3.0 dirty_inode() has a flag parameter
892 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
894 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
895 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
896 LB_LINUX_TRY_COMPILE([
897 #include <linux/fs.h>
900 inode->i_sb->s_op->dirty_inode(NULL, 0);
902 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
903 [dirty_inode super_operation takes flag])
911 # 2.6.38 generic_permission taken 4 parameters.
912 # in fact, it means rcu-walk aware permission bring.
914 # 3.1 generic_permission taken 2 parameters.
915 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
917 AC_DEFUN([LC_GENERIC_PERMISSION],
918 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
919 LB_LINUX_TRY_COMPILE([
920 #include <linux/fs.h>
922 generic_permission(NULL, 0);
924 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
925 [generic_permission taken 2 arguments])
926 AC_MSG_RESULT([yes, 2 args])
928 LB_LINUX_TRY_COMPILE([
929 #include <linux/fs.h>
931 generic_permission(NULL, 0, 0, NULL);
933 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
934 [generic_permission taken 4 arguments])
935 AC_MSG_RESULT([yes, 4 args])
943 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
944 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
946 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
947 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
948 LB_LINUX_TRY_COMPILE([
949 #include <linux/fs.h>
951 struct lock_manager_operations lm_ops;
952 lm_ops.lm_compare_owner = NULL;
954 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
955 [lock-manager ops renamed to lm_xxx])
963 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
964 # inode_dio_done instead.
965 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
967 AC_DEFUN([LC_INODE_DIO_WAIT],
968 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
969 LB_LINUX_TRY_COMPILE([
970 #include <linux/fs.h>
972 inode_dio_wait((struct inode *)0);
973 inode_dio_done((struct inode *)0);
975 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
976 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
984 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
985 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
987 AC_DEFUN([LC_IOP_GET_ACL],
988 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
989 LB_LINUX_TRY_COMPILE([
990 #include <linux/fs.h>
992 struct inode_operations iop;
995 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
996 [inode_operations has .get_acl member function])
1004 # 3.1.1 has ext4_blocks_for_truncate
1006 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
1007 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
1008 LB_LINUX_TRY_COMPILE([
1009 #include <linux/fs.h>
1010 #include "$LINUX/fs/ext4/ext4_jbd2.h"
1011 #include "$LINUX/fs/ext4/truncate.h"
1013 ext4_blocks_for_truncate(NULL);
1015 AC_MSG_RESULT([yes])
1016 AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
1017 [kernel has ext4_blocks_for_truncate])
1024 # 3.1 introduced generic_file_llseek_size()
1026 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
1027 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
1029 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
1030 [generic_file_llseek_size is exported by the kernel])])
1034 # 3.2 request_queue.make_request_fn defined as function returns with void
1035 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
1037 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
1038 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
1039 LB_LINUX_TRY_COMPILE([
1040 #include <linux/blkdev.h>
1043 make_request_fn *mrf;
1044 ret = mrf(NULL, NULL);
1048 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
1049 [request_queue.make_request_fn returns void but not int])
1050 AC_MSG_RESULT([yes])
1055 # 3.2 protects inode->i_nlink from direct modification
1056 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1057 # at the same time adds set_nlink(), so checks set_nlink() for it.
1059 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1060 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1061 LB_LINUX_TRY_COMPILE([
1062 #include <linux/fs.h>
1067 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1068 [inode->i_nlink is protected from direct modification])
1069 AC_MSG_RESULT([yes])
1076 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1078 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1079 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1080 AC_DEFINE(HAVE_MIGRATE_H, 1,
1081 [kernel has include/linux/migrate.h])
1082 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1083 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1084 [kernel has include/linux/migrate_mode.h])
1091 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1092 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1093 LB_LINUX_TRY_COMPILE([
1094 #include <linux/fs.h>
1095 #ifdef HAVE_MIGRATE_H
1096 #include <linux/migrate.h>
1097 #elif defined(HAVE_MIGRATE_MODE_H)
1098 #include <linux/migrate_mode.h>
1101 struct address_space_operations aops;
1103 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1105 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1106 [address_space_operations.migratepage has 4 args])
1107 AC_MSG_RESULT([yes])
1114 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1115 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1117 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1118 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1119 tmp_flags="$EXTRA_KCFLAGS"
1120 EXTRA_KCFLAGS="-Werror"
1121 LB_LINUX_TRY_COMPILE([
1122 #include <linux/fs.h>
1123 int show_options(struct seq_file *seq, struct dentry *root){
1127 struct super_operations ops;
1128 ops.show_options = show_options;
1130 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1131 [super_operations use dentry as parameter])
1132 AC_MSG_RESULT([yes])
1136 EXTRA_KCFLAGS="$tmp_flags"
1140 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1141 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1143 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1144 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1145 tmp_flags="$EXTRA_KCFLAGS"
1146 EXTRA_KCFLAGS="-Werror"
1147 LB_LINUX_TRY_COMPILE([
1148 #include <linux/fs.h>
1149 #include <linux/types.h>
1150 int my_mknod(struct inode *dir, struct dentry *dchild,
1151 umode_t mode, dev_t dev)
1156 struct inode_operations ops;
1157 ops.mknod = my_mknod;
1159 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1160 [inode_operations use umode_t as parameter])
1161 AC_MSG_RESULT([yes])
1165 EXTRA_KCFLAGS="$tmp_flags"
1168 # 3.4 kmap_atomic removes second argument
1169 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1171 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1172 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1173 LB_LINUX_TRY_COMPILE([
1174 #include <linux/highmem.h>
1178 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1179 [have kmap_atomic has only 1 argument])
1180 AC_MSG_RESULT([yes])
1187 # 3.4 switchs touch_atime to struct path
1188 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1190 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1191 [AC_MSG_CHECKING([if touch_atime use one argument])
1192 LB_LINUX_TRY_COMPILE([
1193 #include <linux/fs.h>
1195 touch_atime((struct path *)NULL);
1197 AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1198 [touch_atime use one argument])
1199 AC_MSG_RESULT([yes])
1206 # 3.4 converts d_alloc_root to d_make_root
1207 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1209 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1210 [AC_MSG_CHECKING([if have d_make_root])
1211 LB_LINUX_TRY_COMPILE([
1212 #include <linux/fs.h>
1214 d_make_root((struct inode *)NULL);
1216 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1218 AC_MSG_RESULT([yes])
1225 # 3.5 renames end_writeback() back to clear_inode()...
1226 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1228 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1229 [AC_MSG_CHECKING([if have clear_inode])
1230 LB_LINUX_TRY_COMPILE([
1231 #include <linux/fs.h>
1233 clear_inode((struct inode *)NULL);
1235 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1237 AC_MSG_RESULT([yes])
1244 # 3.5 encode_fh has parent inode passed in directly
1245 # see kernel commit b0b0382b
1247 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1248 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1249 tmp_flags="$EXTRA_KCFLAGS"
1250 EXTRA_KCFLAGS="-Werror"
1251 LB_LINUX_TRY_COMPILE([
1252 #include <linux/exportfs.h>
1253 #include <linux/fs.h>
1254 #include <linux/types.h>
1255 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1260 struct export_operations exp_op;
1261 exp_op.encode_fh = ll_encode_fh;
1263 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1264 [have parent inode as parameter])
1265 AC_MSG_RESULT([yes])
1269 EXTRA_KCFLAGS="$tmp_flags"
1272 # 3.5 has generic_file_llseek_size with 5 args
1273 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1274 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1275 LB_LINUX_TRY_COMPILE([
1276 #include <linux/fs.h>
1278 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1280 AC_MSG_RESULT([yes])
1281 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1282 [kernel has generic_file_llseek_size with 5 args])
1289 # 3.6 switch i_dentry/d_alias from list to hlist
1291 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1292 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1293 tmp_flags="$EXTRA_KCFLAGS"
1294 EXTRA_KCFLAGS="-Werror"
1295 LB_LINUX_TRY_COMPILE([
1296 #include <linux/fs.h>
1297 #include <linux/list.h>
1300 struct dentry dentry;
1301 struct hlist_head head;
1302 struct hlist_node node;
1303 inode.i_dentry = head;
1304 dentry.d_alias = node;
1306 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1307 [have i_dentry/d_alias uses hlist])
1308 AC_MSG_RESULT([yes])
1312 EXTRA_KCFLAGS="$tmp_flags"
1316 # 3.6 dentry_open uses struct path as first argument
1317 # see kernel commit 765927b2
1319 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1320 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1321 tmp_flags="$EXTRA_KCFLAGS"
1322 EXTRA_KCFLAGS="-Werror"
1323 LB_LINUX_TRY_COMPILE([
1324 #include <linux/fs.h>
1325 #include <linux/path.h>
1328 dentry_open(&path, 0, NULL);
1330 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1331 [dentry_open uses struct path as first argument])
1332 AC_MSG_RESULT([yes])
1336 EXTRA_KCFLAGS="$tmp_flags"
1340 # 3.6 vfs adds iop->atomic_open
1342 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1343 [AC_MSG_CHECKING([if iop has atomic_open])
1344 LB_LINUX_TRY_COMPILE([
1345 #include <linux/fs.h>
1347 struct inode_operations iop;
1348 iop.atomic_open = NULL;
1350 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1351 [have iop atomic_open])
1352 AC_MSG_RESULT([yes])
1359 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1361 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1362 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1363 LB_LINUX_TRY_COMPILE([
1364 #include <linux/fs.h>
1365 #include <linux/posix_acl_xattr.h>
1367 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1369 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1370 [posix_acl_to_xattr takes struct user_namespace])
1371 AC_MSG_RESULT([yes])
1378 # 3.9 uses hlist_for_each_entry with 3 args
1379 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1381 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1382 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1383 LB_LINUX_TRY_COMPILE([
1384 #include <linux/list.h>
1385 #include <linux/fs.h>
1387 struct inode *inode;
1388 struct dentry *dentry;
1389 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1393 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1394 AC_MSG_RESULT([yes])
1401 # 3.9 killed f_vfsmnt by
1402 # 182be684784334598eee1d90274e7f7aa0063616
1403 # replacement is f_path.mnt
1405 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1406 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1407 LB_LINUX_TRY_COMPILE([
1408 #include <linux/fs.h>
1410 struct file *fp = NULL;
1413 path.mnt = fp->f_path.mnt;
1415 AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1416 AC_MSG_RESULT([yes])
1425 # Lustre linux kernel checks
1427 AC_DEFUN([LC_PROG_LINUX],
1431 LC_CONFIG_LIBLUSTRE_RECOVERY
1432 LC_CONFIG_HEALTH_CHECK_WRITE
1433 LC_CONFIG_LRU_RESIZE
1434 LC_LLITE_LLOOP_MODULE
1443 # raid5-zerocopy patch
1447 LC_FS_RENAME_DOES_D_MOVE
1454 LC_SECURITY_PLUG # for SLES10 SP2
1455 LC_INODE_PERMISION_2ARGS
1459 # 2.6.27.15-2 sles11
1464 LC_BLK_QUEUE_MAX_SEGMENTS
1467 LC_HAVE_DQUOT_FS_DISK_QUOTA
1468 LC_HAVE_DQUOT_SUSPEND
1472 LC_EXPORT_SIMPLE_SETATTR
1473 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1477 LC_SBOPS_EVICT_INODE
1483 LC_BLKDEV_GET_BY_DEV
1484 LC_GENERIC_PERMISSION
1485 LC_QUOTA_ON_USE_PATH
1492 LC_REQUEST_QUEUE_UNPLUG_FN
1493 LC_HAVE_FSTYPE_MOUNT
1496 LC_DIRTY_INODE_WITH_FLAG
1499 LC_LM_XXX_LOCK_MANAGER_OPS
1505 LC_BLOCKS_FOR_TRUNCATE
1508 LC_HAVE_VOID_MAKE_REQUEST_FN
1509 LC_HAVE_PROTECT_I_NLINK
1512 LC_HAVE_MIGRATE_HEADER
1513 LC_MIGRATEPAGE_4ARGS
1514 LC_SUPEROPS_USE_DENTRY
1515 LC_INODEOPS_USE_UMODE_T
1520 LC_KMAP_ATOMIC_HAS_1ARG
1524 LC_HAVE_ENCODE_FH_PARENT
1525 LC_FILE_LLSEEK_SIZE_5ARG
1528 LC_HAVE_DENTRY_D_ALIAS_HLIST
1529 LC_DENTRY_OPEN_USE_PATH
1530 LC_HAVE_IOP_ATOMIC_OPEN
1533 LC_HAVE_POSIXACL_USER_NS
1536 LC_HAVE_HLIST_FOR_EACH_3ARG
1540 if test x$enable_server = xyes ; then
1541 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1542 LC_FUNC_DEV_SET_RDONLY
1550 # LC_CONFIG_CLIENT_SERVER
1552 # Build client/server sides of Lustre
1554 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1555 [AC_MSG_CHECKING([whether to build Lustre server support])
1556 AC_ARG_ENABLE([server],
1557 AC_HELP_STRING([--disable-server],
1558 [disable Lustre server support]),
1559 [],[enable_server='yes'])
1560 AC_MSG_RESULT([$enable_server])
1562 AC_MSG_CHECKING([whether to build Lustre client support])
1563 AC_ARG_ENABLE([client],
1564 AC_HELP_STRING([--disable-client],
1565 [disable Lustre client support]),
1566 [],[enable_client='yes'])
1567 AC_MSG_RESULT([$enable_client])])
1570 # LC_CONFIG_LIBLUSTRE
1572 # whether to build liblustre
1574 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1575 [AC_MSG_CHECKING([whether to build Lustre library])
1576 AC_ARG_ENABLE([liblustre],
1577 AC_HELP_STRING([--disable-liblustre],
1578 [disable building of Lustre library]),
1579 [],[enable_liblustre=$with_sysio])
1580 AC_MSG_RESULT([$enable_liblustre])
1581 # only build sysio if liblustre is built
1582 with_sysio="$enable_liblustre"
1584 AC_MSG_CHECKING([whether to build liblustre tests])
1585 AC_ARG_ENABLE([liblustre-tests],
1586 AC_HELP_STRING([--enable-liblustre-tests],
1587 [enable liblustre tests, if --disable-tests is used]),
1588 [],[enable_liblustre_tests=$enable_tests])
1589 if test x$enable_liblustre != xyes ; then
1590 enable_liblustre_tests='no'
1592 AC_MSG_RESULT([$enable_liblustre_tests])
1594 AC_MSG_CHECKING([whether to enable liblustre acl])
1595 AC_ARG_ENABLE([liblustre-acl],
1596 AC_HELP_STRING([--disable-liblustre-acl],
1597 [disable ACL support for liblustre]),
1598 [],[enable_liblustre_acl=yes])
1599 AC_MSG_RESULT([$enable_liblustre_acl])
1600 if test x$enable_liblustre_acl = xyes ; then
1601 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1607 AC_ARG_ENABLE(mpitests,
1608 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1609 [include mpi tests]),
1620 MPICC_WRAPPER=$enableval
1630 if test x$enable_mpitests != xno; then
1631 AC_MSG_CHECKING([whether mpitests can be built])
1639 MPI_Initialized(&flag);
1642 AC_MSG_RESULT([yes])
1649 AC_SUBST(MPICC_WRAPPER)
1651 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1652 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1655 LC_CONFIG_LIBLUSTRE_RECOVERY
1661 # whether to enable quota support global control
1663 AC_DEFUN([LC_CONFIG_QUOTA],
1664 [AC_ARG_ENABLE([quota],
1665 AC_HELP_STRING([--enable-quota],
1666 [enable quota support]),
1667 [],[enable_quota='yes'])
1670 AC_DEFUN([LC_QUOTA],
1674 AC_CHECK_HEADER(sys/quota.h,
1675 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1676 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1682 # whether to enable split support
1684 AC_DEFUN([LC_CONFIG_SPLIT],
1685 [AC_MSG_CHECKING([whether to enable split support])
1686 AC_ARG_ENABLE([split],
1687 AC_HELP_STRING([--enable-split],
1688 [enable split support]),
1689 [],[enable_split='no'])
1690 AC_MSG_RESULT([$enable_split])
1691 if test x$enable_split != xno; then
1692 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1697 # LC_LLITE_LLOOP_MODULE
1698 # lloop_llite.ko does not currently work with page sizes
1701 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1702 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1703 LB_LINUX_TRY_COMPILE([
1704 #include <asm/page.h>
1706 #if PAGE_SIZE >= 65536
1707 #error "PAGE_SIZE >= 65536"
1710 enable_llite_lloop_module='yes'
1711 AC_MSG_RESULT([yes])
1713 enable_llite_lloop_module='no'
1721 # configure support for optional OSD implementation
1723 AC_DEFUN([LC_OSD_ADDON],
1724 [AC_MSG_CHECKING([for osd])
1726 AC_HELP_STRING([--with-osd=path],
1727 [set path to optional osd]),
1730 no) ENABLEOSDADDON=0
1732 *) OSDADDON="${with_osd}"
1739 if test $ENABLEOSDADDON -eq 0; then
1743 OSDMODNAME=`basename $OSDADDON`
1744 if test -e $LUSTRE/$OSDMODNAME; then
1745 AC_MSG_RESULT([can't link])
1747 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1748 AC_MSG_RESULT([$OSDMODNAME])
1749 OSDADDON="subdir-m += $OSDMODNAME"
1751 AC_MSG_RESULT([can't link])
1761 # other configure checks
1763 AC_DEFUN([LC_CONFIGURE],
1764 [LC_CONFIG_OBD_BUFFER_SIZE
1766 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1767 CFLAGS="$CFLAGS -Werror"
1770 # maximum MDS thread count
1773 # include/liblustre.h
1774 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1776 # liblustre/llite_lib.h
1777 AC_CHECK_HEADERS([xtio.h file.h])
1780 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1783 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1784 AC_CHECK_FUNCS([inet_ntoa])
1786 # libsysio/src/readlink.c
1789 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1790 AC_CHECK_HEADERS([linux/random.h], [], [],
1791 [#ifdef HAVE_LINUX_TYPES_H
1792 # include <linux/types.h>
1797 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1799 # check for -lz support
1803 [AC_CHECK_HEADERS([zlib.h],
1805 AC_DEFINE([HAVE_ADLER], 1,
1806 [support alder32 checksum type])],
1807 [AC_MSG_WARN([No zlib-devel package found,
1808 unable to use adler32 checksum])])],
1809 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1814 AC_CHECK_LIB([selinux],
1815 [is_selinux_enabled],
1816 [AC_CHECK_HEADERS([selinux.h],
1817 [SELINUX="-lselinux"
1818 AC_DEFINE([HAVE_SELINUX], 1,
1819 [support for selinux ])],
1820 [AC_MSG_WARN([No selinux-devel package found,
1821 unable to build selinux enabled
1823 [AC_MSG_WARN([No selinux package found, unable to build selinux
1829 AC_ARG_ENABLE([mindf],
1830 AC_HELP_STRING([--enable-mindf],
1831 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1833 if test "$enable_mindf" = "yes" ; then
1834 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1837 AC_ARG_ENABLE([fail_alloc],
1838 AC_HELP_STRING([--disable-fail-alloc],
1839 [disable randomly alloc failure]),
1840 [],[enable_fail_alloc=yes])
1841 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1842 AC_MSG_RESULT([$enable_fail_alloc])
1843 if test x$enable_fail_alloc != xno ; then
1844 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1847 AC_ARG_ENABLE([invariants],
1848 AC_HELP_STRING([--enable-invariants],
1849 [enable invariant checking (cpu intensive)]),
1851 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1852 AC_MSG_RESULT([$enable_invariants])
1853 if test x$enable_invariants = xyes ; then
1854 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1857 AC_ARG_ENABLE([lu_ref],
1858 AC_HELP_STRING([--enable-lu_ref],
1859 [enable lu_ref reference tracking code]),
1861 AC_MSG_CHECKING([whether to track references with lu_ref])
1862 AC_MSG_RESULT([$enable_lu_ref])
1863 if test x$enable_lu_ref = xyes ; then
1864 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1867 AC_ARG_ENABLE([pgstate-track],
1868 AC_HELP_STRING([--enable-pgstate-track],
1869 [enable page state tracking]),
1870 [enable_pgstat_track='yes'],[])
1871 AC_MSG_CHECKING([whether to enable page state tracking])
1872 AC_MSG_RESULT([$enable_pgstat_track])
1873 if test x$enable_pgstat_track = xyes ; then
1874 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1875 [enable page state tracking code])
1882 # AM_CONDITIONALS for lustre
1884 AC_DEFUN([LC_CONDITIONALS],
1885 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1886 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1887 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1888 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1889 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1890 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1891 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1892 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1893 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1894 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1895 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1896 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1897 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1898 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1904 # files that should be generated with AC_OUTPUT
1906 AC_DEFUN([LC_CONFIG_FILES],
1910 lustre/autoconf/Makefile
1911 lustre/conf/Makefile
1912 lustre/contrib/Makefile
1914 lustre/include/Makefile
1915 lustre/include/lustre_ver.h
1916 lustre/include/linux/Makefile
1917 lustre/include/darwin/Makefile
1918 lustre/include/lustre/Makefile
1919 lustre/kernel_patches/targets/2.6-rhel6.target
1920 lustre/kernel_patches/targets/2.6-rhel5.target
1921 lustre/kernel_patches/targets/2.6-sles11.target
1922 lustre/kernel_patches/targets/3.0-sles11.target
1923 lustre/kernel_patches/targets/2.6-fc11.target
1924 lustre/kernel_patches/targets/2.6-fc12.target
1925 lustre/kernel_patches/targets/2.6-fc15.target
1926 lustre/kernel_patches/targets/3.x-fc18.target
1927 lustre/ldlm/Makefile
1929 lustre/fid/autoMakefile
1930 lustre/liblustre/Makefile
1931 lustre/liblustre/tests/Makefile
1932 lustre/liblustre/tests/mpi/Makefile
1933 lustre/llite/Makefile
1934 lustre/llite/autoMakefile
1935 lustre/lclient/Makefile
1937 lustre/lov/autoMakefile
1938 lustre/lvfs/Makefile
1939 lustre/lvfs/autoMakefile
1941 lustre/mdc/autoMakefile
1943 lustre/lmv/autoMakefile
1944 lustre/lfsck/Makefile
1945 lustre/lfsck/autoMakefile
1947 lustre/mdt/autoMakefile
1949 lustre/mdd/autoMakefile
1951 lustre/fld/autoMakefile
1952 lustre/obdclass/Makefile
1953 lustre/obdclass/autoMakefile
1954 lustre/obdclass/linux/Makefile
1955 lustre/obdecho/Makefile
1956 lustre/obdecho/autoMakefile
1958 lustre/ofd/autoMakefile
1960 lustre/osc/autoMakefile
1962 lustre/ost/autoMakefile
1963 lustre/osd-ldiskfs/Makefile
1964 lustre/osd-ldiskfs/autoMakefile
1965 lustre/osd-zfs/Makefile
1966 lustre/osd-zfs/autoMakefile
1968 lustre/mgc/autoMakefile
1970 lustre/mgs/autoMakefile
1971 lustre/target/Makefile
1972 lustre/ptlrpc/Makefile
1973 lustre/ptlrpc/autoMakefile
1974 lustre/ptlrpc/gss/Makefile
1975 lustre/ptlrpc/gss/autoMakefile
1976 lustre/quota/Makefile
1977 lustre/quota/autoMakefile
1978 lustre/scripts/Makefile
1979 lustre/tests/Makefile
1980 lustre/tests/mpi/Makefile
1981 lustre/utils/Makefile
1982 lustre/utils/gss/Makefile
1984 lustre/osp/autoMakefile
1986 lustre/lod/autoMakefile
1987 lustre/obdclass/darwin/Makefile