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])
385 # 2.6.24 has bio_endio with 2 args
386 AC_DEFUN([LC_BIO_ENDIO_2ARG],
387 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
388 LB_LINUX_TRY_COMPILE([
389 #include <linux/bio.h>
394 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
395 [kernel has bio_endio with 2 args])
401 # 2.6.24 removes long aged procfs entry -> deleted member
402 AC_DEFUN([LC_PROCFS_DELETED],
403 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
404 LB_LINUX_TRY_COMPILE([
405 #include <linux/proc_fs.h>
407 struct proc_dir_entry pde;
409 pde.deleted = sizeof(pde);
412 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
413 [kernel has deleted member in procfs entry struct])
423 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
424 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
425 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
426 # v3.1 onward have a 2 arg version (inode, mask)
427 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
428 [AC_MSG_CHECKING([inode_operations->permission has two args])
429 LB_LINUX_TRY_COMPILE([
430 #include <linux/fs.h>
432 struct inode *inode __attribute__ ((unused));
435 inode->i_op->permission(NULL, 0);
437 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
438 [inode_operations->permission has two args])
445 # 2.6.27 use 5th parameter in quota_on for remount.
446 AC_DEFUN([LC_QUOTA_ON_5ARGS],
447 [AC_MSG_CHECKING([quota_on needs 5 parameters])
448 LB_LINUX_TRY_COMPILE([
449 #include <linux/fs.h>
450 #include <linux/quota.h>
452 struct quotactl_ops *qop = NULL;
453 qop->quota_on(NULL, 0, 0, NULL, 0);
455 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
456 [quota_on needs 5 paramters])
463 # 2.6.27 use 3th parameter in quota_off for remount.
464 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
465 [AC_MSG_CHECKING([quota_off needs 3 parameters])
466 LB_LINUX_TRY_COMPILE([
467 #include <linux/fs.h>
468 #include <linux/quota.h>
470 struct quotactl_ops *qop = NULL;
471 qop->quota_off(NULL, 0, 0);
473 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
474 [quota_off needs 3 paramters])
481 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
482 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
483 tmp_flags="$EXTRA_KCFLAGS"
484 EXTRA_KCFLAGS="-Werror"
485 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
486 LB_LINUX_TRY_COMPILE([
487 #include <linux/fs.h>
488 #include <linux/quota.h>
490 struct quotactl_ops qops = {};
491 struct fs_disk_quota fdq;
492 qops.set_dqblk(NULL, 0, 0, &fdq);
494 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
499 EXTRA_KCFLAGS="$tmp_flags"
502 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
503 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
504 [AC_MSG_CHECKING([if dquot_suspend is defined])
505 LB_LINUX_TRY_COMPILE([
506 #include <linux/quotaops.h>
508 dquot_suspend(NULL, -1);
510 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
519 # 2.6.27 sles11 remove the bi_hw_segments
520 AC_DEFUN([LC_BI_HW_SEGMENTS],
521 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
522 LB_LINUX_TRY_COMPILE([
523 #include <linux/bio.h>
526 io.bi_hw_segments = sizeof(io);
528 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
529 [struct bio has a bi_hw_segments field])
537 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
538 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
539 AC_DEFUN([LC_HAVE_QUOTAIO_H],
540 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
541 AC_DEFINE(HAVE_QUOTAIO_H, 1,
542 [kernel has include/linux/quotaio_v2.h])
543 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
544 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
545 [kernel has fs/quotaio_v1.h])
546 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
547 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
548 [kernel has fs/quota/quotaio_v2.h])
558 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
559 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
560 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
561 LB_LINUX_TRY_COMPILE([
562 #include <linux/blkdev.h>
564 blk_queue_max_segments(NULL, 0);
567 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
568 [blk_queue_max_segments is defined])
577 # Check if kernel has been patched for 64-bit quota limits support.
578 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
579 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
580 # that in the absence of quotaio_v1.h in the kernel headers.
582 AC_DEFUN([LC_QUOTA64],[
583 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
584 tmp_flags="$EXTRA_KCFLAGS"
585 EXTRA_KCFLAGS="-I$LINUX/fs"
586 LB_LINUX_TRY_COMPILE([
587 #include <linux/kernel.h>
588 #include <linux/fs.h>
589 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
590 # include <quota/quotaio_v2.h>
591 struct v2r1_disk_dqblk dqblk_r1;
593 #include <linux/quota.h>
594 int ver = QFMT_VFS_V1;
597 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
600 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
601 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
605 EXTRA_KCFLAGS=$tmp_flags
609 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
611 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
612 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
613 LB_LINUX_TRY_COMPILE([
614 #include <asm/atomic.h>
615 #include <linux/spinlock.h>
616 #include <linux/fs_struct.h>
618 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
620 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
621 [fs_struct.lock use rwlock])
629 # 2.6.36 super_operations add evict_inode method. it hybird of
630 # delete_inode & clear_inode.
632 AC_DEFUN([LC_SBOPS_EVICT_INODE],
633 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
634 LB_LINUX_TRY_COMPILE([
635 #include <linux/fs.h>
637 ((struct super_operations *)0)->evict_inode(NULL);
639 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
640 [super_operations.evict_inode() is exist in kernel])
648 # 2.6.35 file_operations.fsync taken 2 arguments.
649 # 3.0.0 file_operations.fsync takes 4 arguments.
651 AC_DEFUN([LC_FILE_FSYNC],
652 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
653 LB_LINUX_TRY_COMPILE([
654 #include <linux/fs.h>
656 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
658 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
659 [file_operations.fsync takes 4 arguments])
660 AC_MSG_RESULT([yes, 4 args])
662 LB_LINUX_TRY_COMPILE([
663 #include <linux/fs.h>
665 ((struct file_operations *)0)->fsync(NULL, 0);
667 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
668 [file_operations.fsync takes 2 arguments])
669 AC_MSG_RESULT([yes, 2 args])
677 # 2.6.37 remove kernel_locked
679 AC_DEFUN([LC_KERNEL_LOCKED],
680 [AC_MSG_CHECKING([if kernel_locked is defined])
681 LB_LINUX_TRY_COMPILE([
682 #include <linux/smp_lock.h>
687 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
688 [kernel_locked is defined])
695 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
697 AC_DEFUN([LC_D_COMPARE_7ARGS],
698 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
699 LB_LINUX_TRY_COMPILE([
700 #include <linux/dcache.h>
702 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
704 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
705 [d_compare need 7 arguments])
713 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
715 AC_DEFUN([LC_D_DELETE_CONST],
716 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
717 tmp_flags="$EXTRA_KCFLAGS"
718 EXTRA_KCFLAGS="-Werror"
719 LB_LINUX_TRY_COMPILE([
720 #include <linux/dcache.h>
722 const struct dentry *d = NULL;
723 ((struct dentry_operations*)0)->d_delete(d);
725 AC_DEFINE(HAVE_D_DELETE_CONST, const,
726 [d_delete first parameter declared const])
729 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
732 EXTRA_KCFLAGS="$tmp_flags"
736 # 2.6.38 dcache_lock removed. rcu-walk commited.
738 AC_DEFUN([LC_DCACHE_LOCK],
739 [AC_MSG_CHECKING([if dcache_lock is exist])
740 LB_LINUX_TRY_COMPILE([
741 #include <linux/dcache.h>
743 spin_lock(&dcache_lock);
745 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
746 [dcache_lock is exist])
754 # 2.6.38 inode.i_rcu added.
756 AC_DEFUN([LC_INODE_I_RCU],
757 [AC_MSG_CHECKING([if inode.i_rcu exists])
758 LB_LINUX_TRY_COMPILE([
759 #include <linux/fs.h>
762 struct rcu_head rcu = {};
765 AC_DEFINE(HAVE_INODE_I_RCU, 1,
766 [inode.i_rcu exists])
774 # 2.6.38 export blkdev_get_by_dev
776 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
777 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
779 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
780 [blkdev_get_by_dev is exported by the kernel])
786 # 2.6.38 use path as 4th parameter in quota_on.
788 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
789 [AC_MSG_CHECKING([quota_on use path as parameter])
790 tmp_flags="$EXTRA_KCFLAGS"
791 EXTRA_KCFLAGS="-Werror"
792 LB_LINUX_TRY_COMPILE([
793 #include <linux/fs.h>
794 #include <linux/quota.h>
796 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
798 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
799 [quota_on use path as 4th paramter])
804 EXTRA_KCFLAGS="$tmp_flags"
808 # 2.6.38 export simple_setattr
810 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
811 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
813 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
814 [simple_setattr is exported by the kernel])
820 # 2.6.39 remove unplug_fn from request_queue.
822 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
823 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
824 LB_LINUX_TRY_COMPILE([
825 #include <linux/blkdev.h>
827 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
829 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
830 [request_queue has unplug_fn field])
838 # 2.6.39 replace get_sb with mount in struct file_system_type
840 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
841 [AC_MSG_CHECKING([if file_system_type has mount field])
842 LB_LINUX_TRY_COMPILE([
843 #include <linux/fs.h>
845 struct file_system_type fst;
846 void *i = (void *) fst.mount;
848 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
849 [struct file_system_type has mount field])
857 # 3.0 dirty_inode() has a flag parameter
858 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
860 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
861 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
862 LB_LINUX_TRY_COMPILE([
863 #include <linux/fs.h>
866 inode->i_sb->s_op->dirty_inode(NULL, 0);
868 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
869 [dirty_inode super_operation takes flag])
877 # 2.6.38 generic_permission taken 4 parameters.
878 # in fact, it means rcu-walk aware permission bring.
880 # 3.1 generic_permission taken 2 parameters.
881 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
883 AC_DEFUN([LC_GENERIC_PERMISSION],
884 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
885 LB_LINUX_TRY_COMPILE([
886 #include <linux/fs.h>
888 generic_permission(NULL, 0);
890 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
891 [generic_permission taken 2 arguments])
892 AC_MSG_RESULT([yes, 2 args])
894 LB_LINUX_TRY_COMPILE([
895 #include <linux/fs.h>
897 generic_permission(NULL, 0, 0, NULL);
899 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
900 [generic_permission taken 4 arguments])
901 AC_MSG_RESULT([yes, 4 args])
909 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
910 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
912 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
913 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
914 LB_LINUX_TRY_COMPILE([
915 #include <linux/fs.h>
917 struct lock_manager_operations lm_ops;
918 lm_ops.lm_compare_owner = NULL;
920 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
921 [lock-manager ops renamed to lm_xxx])
929 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
930 # inode_dio_done instead.
931 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
933 AC_DEFUN([LC_INODE_DIO_WAIT],
934 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
935 LB_LINUX_TRY_COMPILE([
936 #include <linux/fs.h>
938 inode_dio_wait((struct inode *)0);
939 inode_dio_done((struct inode *)0);
941 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
942 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
950 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
951 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
953 AC_DEFUN([LC_IOP_GET_ACL],
954 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
955 LB_LINUX_TRY_COMPILE([
956 #include <linux/fs.h>
958 struct inode_operations iop;
961 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
962 [inode_operations has .get_acl member function])
970 # 3.1.1 has ext4_blocks_for_truncate
972 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
973 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
974 LB_LINUX_TRY_COMPILE([
975 #include <linux/fs.h>
976 #include "$LINUX/fs/ext4/ext4_jbd2.h"
977 #include "$LINUX/fs/ext4/truncate.h"
979 ext4_blocks_for_truncate(NULL);
982 AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
983 [kernel has ext4_blocks_for_truncate])
990 # 3.1 introduced generic_file_llseek_size()
992 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
993 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
995 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
996 [generic_file_llseek_size is exported by the kernel])])
1000 # 3.2 request_queue.make_request_fn defined as function returns with void
1001 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
1003 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
1004 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
1005 LB_LINUX_TRY_COMPILE([
1006 #include <linux/blkdev.h>
1009 make_request_fn *mrf;
1010 ret = mrf(NULL, NULL);
1014 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
1015 [request_queue.make_request_fn returns void but not int])
1016 AC_MSG_RESULT([yes])
1021 # 3.2 protects inode->i_nlink from direct modification
1022 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1023 # at the same time adds set_nlink(), so checks set_nlink() for it.
1025 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1026 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1027 LB_LINUX_TRY_COMPILE([
1028 #include <linux/fs.h>
1033 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1034 [inode->i_nlink is protected from direct modification])
1035 AC_MSG_RESULT([yes])
1042 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1044 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1045 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1046 AC_DEFINE(HAVE_MIGRATE_H, 1,
1047 [kernel has include/linux/migrate.h])
1048 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1049 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1050 [kernel has include/linux/migrate_mode.h])
1057 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1058 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1059 LB_LINUX_TRY_COMPILE([
1060 #include <linux/fs.h>
1061 #ifdef HAVE_MIGRATE_H
1062 #include <linux/migrate.h>
1063 #elif defined(HAVE_MIGRATE_MODE_H)
1064 #include <linux/migrate_mode.h>
1067 struct address_space_operations aops;
1069 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1071 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1072 [address_space_operations.migratepage has 4 args])
1073 AC_MSG_RESULT([yes])
1080 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1081 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1083 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1084 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1085 tmp_flags="$EXTRA_KCFLAGS"
1086 EXTRA_KCFLAGS="-Werror"
1087 LB_LINUX_TRY_COMPILE([
1088 #include <linux/fs.h>
1089 int show_options(struct seq_file *seq, struct dentry *root){
1093 struct super_operations ops;
1094 ops.show_options = show_options;
1096 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1097 [super_operations use dentry as parameter])
1098 AC_MSG_RESULT([yes])
1102 EXTRA_KCFLAGS="$tmp_flags"
1106 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1107 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1109 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1110 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1111 tmp_flags="$EXTRA_KCFLAGS"
1112 EXTRA_KCFLAGS="-Werror"
1113 LB_LINUX_TRY_COMPILE([
1114 #include <linux/fs.h>
1115 #include <linux/types.h>
1116 int my_mknod(struct inode *dir, struct dentry *dchild,
1117 umode_t mode, dev_t dev)
1122 struct inode_operations ops;
1123 ops.mknod = my_mknod;
1125 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1126 [inode_operations use umode_t as parameter])
1127 AC_MSG_RESULT([yes])
1131 EXTRA_KCFLAGS="$tmp_flags"
1134 # 3.4 kmap_atomic removes second argument
1135 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1137 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1138 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1139 LB_LINUX_TRY_COMPILE([
1140 #include <linux/highmem.h>
1144 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1145 [have kmap_atomic has only 1 argument])
1146 AC_MSG_RESULT([yes])
1153 # 3.4 switchs touch_atime to struct path
1154 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1156 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1157 [AC_MSG_CHECKING([if touch_atime use one argument])
1158 LB_LINUX_TRY_COMPILE([
1159 #include <linux/fs.h>
1161 touch_atime((struct path *)NULL);
1163 AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1164 [touch_atime use one argument])
1165 AC_MSG_RESULT([yes])
1172 # 3.4 converts d_alloc_root to d_make_root
1173 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1175 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1176 [AC_MSG_CHECKING([if have d_make_root])
1177 LB_LINUX_TRY_COMPILE([
1178 #include <linux/fs.h>
1180 d_make_root((struct inode *)NULL);
1182 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1184 AC_MSG_RESULT([yes])
1191 # 3.5 renames end_writeback() back to clear_inode()...
1192 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1194 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1195 [AC_MSG_CHECKING([if have clear_inode])
1196 LB_LINUX_TRY_COMPILE([
1197 #include <linux/fs.h>
1199 clear_inode((struct inode *)NULL);
1201 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1203 AC_MSG_RESULT([yes])
1210 # 3.5 encode_fh has parent inode passed in directly
1211 # see kernel commit b0b0382b
1213 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1214 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1215 tmp_flags="$EXTRA_KCFLAGS"
1216 EXTRA_KCFLAGS="-Werror"
1217 LB_LINUX_TRY_COMPILE([
1218 #include <linux/exportfs.h>
1219 #include <linux/fs.h>
1220 #include <linux/types.h>
1221 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1226 struct export_operations exp_op;
1227 exp_op.encode_fh = ll_encode_fh;
1229 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1230 [have parent inode as parameter])
1231 AC_MSG_RESULT([yes])
1235 EXTRA_KCFLAGS="$tmp_flags"
1238 # 3.5 has generic_file_llseek_size with 5 args
1239 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1240 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1241 LB_LINUX_TRY_COMPILE([
1242 #include <linux/fs.h>
1244 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1246 AC_MSG_RESULT([yes])
1247 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1248 [kernel has generic_file_llseek_size with 5 args])
1255 # 3.6 switch i_dentry/d_alias from list to hlist
1257 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1258 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1259 tmp_flags="$EXTRA_KCFLAGS"
1260 EXTRA_KCFLAGS="-Werror"
1261 LB_LINUX_TRY_COMPILE([
1262 #include <linux/fs.h>
1263 #include <linux/list.h>
1266 struct dentry dentry;
1267 struct hlist_head head;
1268 struct hlist_node node;
1269 inode.i_dentry = head;
1270 dentry.d_alias = node;
1272 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1273 [have i_dentry/d_alias uses hlist])
1274 AC_MSG_RESULT([yes])
1278 EXTRA_KCFLAGS="$tmp_flags"
1282 # 3.6 dentry_open uses struct path as first argument
1283 # see kernel commit 765927b2
1285 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1286 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1287 tmp_flags="$EXTRA_KCFLAGS"
1288 EXTRA_KCFLAGS="-Werror"
1289 LB_LINUX_TRY_COMPILE([
1290 #include <linux/fs.h>
1291 #include <linux/path.h>
1294 dentry_open(&path, 0, NULL);
1296 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1297 [dentry_open uses struct path as first argument])
1298 AC_MSG_RESULT([yes])
1302 EXTRA_KCFLAGS="$tmp_flags"
1306 # 3.6 vfs adds iop->atomic_open
1308 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1309 [AC_MSG_CHECKING([if iop has atomic_open])
1310 LB_LINUX_TRY_COMPILE([
1311 #include <linux/fs.h>
1313 struct inode_operations iop;
1314 iop.atomic_open = NULL;
1316 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1317 [have iop atomic_open])
1318 AC_MSG_RESULT([yes])
1325 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1327 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1328 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1329 LB_LINUX_TRY_COMPILE([
1330 #include <linux/fs.h>
1331 #include <linux/posix_acl_xattr.h>
1333 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1335 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1336 [posix_acl_to_xattr takes struct user_namespace])
1337 AC_MSG_RESULT([yes])
1344 # 3.9 uses hlist_for_each_entry with 3 args
1345 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1347 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1348 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1349 LB_LINUX_TRY_COMPILE([
1350 #include <linux/list.h>
1351 #include <linux/fs.h>
1353 struct inode *inode;
1354 struct dentry *dentry;
1355 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1359 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1360 AC_MSG_RESULT([yes])
1367 # 3.9 killed f_vfsmnt by
1368 # 182be684784334598eee1d90274e7f7aa0063616
1369 # replacement is f_path.mnt
1371 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1372 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1373 LB_LINUX_TRY_COMPILE([
1374 #include <linux/fs.h>
1376 struct file *fp = NULL;
1379 path.mnt = fp->f_path.mnt;
1381 AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1382 AC_MSG_RESULT([yes])
1391 # Lustre linux kernel checks
1393 AC_DEFUN([LC_PROG_LINUX],
1397 LC_CONFIG_LIBLUSTRE_RECOVERY
1398 LC_CONFIG_HEALTH_CHECK_WRITE
1399 LC_CONFIG_LRU_RESIZE
1400 LC_LLITE_LLOOP_MODULE
1409 # raid5-zerocopy patch
1420 # 2.6.27.15-2 sles11
1425 LC_BLK_QUEUE_MAX_SEGMENTS
1428 LC_HAVE_DQUOT_FS_DISK_QUOTA
1429 LC_HAVE_DQUOT_SUSPEND
1433 LC_EXPORT_SIMPLE_SETATTR
1434 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1438 LC_SBOPS_EVICT_INODE
1444 LC_BLKDEV_GET_BY_DEV
1445 LC_GENERIC_PERMISSION
1446 LC_QUOTA_ON_USE_PATH
1453 LC_REQUEST_QUEUE_UNPLUG_FN
1454 LC_HAVE_FSTYPE_MOUNT
1457 LC_DIRTY_INODE_WITH_FLAG
1460 LC_LM_XXX_LOCK_MANAGER_OPS
1464 LC_INODE_PERMISION_2ARGS
1467 LC_BLOCKS_FOR_TRUNCATE
1470 LC_HAVE_VOID_MAKE_REQUEST_FN
1471 LC_HAVE_PROTECT_I_NLINK
1474 LC_HAVE_MIGRATE_HEADER
1475 LC_MIGRATEPAGE_4ARGS
1476 LC_SUPEROPS_USE_DENTRY
1477 LC_INODEOPS_USE_UMODE_T
1482 LC_KMAP_ATOMIC_HAS_1ARG
1486 LC_HAVE_ENCODE_FH_PARENT
1487 LC_FILE_LLSEEK_SIZE_5ARG
1490 LC_HAVE_DENTRY_D_ALIAS_HLIST
1491 LC_DENTRY_OPEN_USE_PATH
1492 LC_HAVE_IOP_ATOMIC_OPEN
1495 LC_HAVE_POSIXACL_USER_NS
1498 LC_HAVE_HLIST_FOR_EACH_3ARG
1502 if test x$enable_server = xyes ; then
1503 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1504 LC_FUNC_DEV_SET_RDONLY
1512 # LC_CONFIG_CLIENT_SERVER
1514 # Build client/server sides of Lustre
1516 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1517 [AC_MSG_CHECKING([whether to build Lustre server support])
1518 AC_ARG_ENABLE([server],
1519 AC_HELP_STRING([--disable-server],
1520 [disable Lustre server support]),
1521 [],[enable_server='yes'])
1522 AC_MSG_RESULT([$enable_server])
1524 AC_MSG_CHECKING([whether to build Lustre client support])
1525 AC_ARG_ENABLE([client],
1526 AC_HELP_STRING([--disable-client],
1527 [disable Lustre client support]),
1528 [],[enable_client='yes'])
1529 AC_MSG_RESULT([$enable_client])])
1532 # LC_CONFIG_LIBLUSTRE
1534 # whether to build liblustre
1536 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1537 [AC_MSG_CHECKING([whether to build Lustre library])
1538 AC_ARG_ENABLE([liblustre],
1539 AC_HELP_STRING([--disable-liblustre],
1540 [disable building of Lustre library]),
1541 [],[enable_liblustre=$with_sysio])
1542 AC_MSG_RESULT([$enable_liblustre])
1543 # only build sysio if liblustre is built
1544 with_sysio="$enable_liblustre"
1546 AC_MSG_CHECKING([whether to build liblustre tests])
1547 AC_ARG_ENABLE([liblustre-tests],
1548 AC_HELP_STRING([--enable-liblustre-tests],
1549 [enable liblustre tests, if --disable-tests is used]),
1550 [],[enable_liblustre_tests=$enable_tests])
1551 if test x$enable_liblustre != xyes ; then
1552 enable_liblustre_tests='no'
1554 AC_MSG_RESULT([$enable_liblustre_tests])
1556 AC_MSG_CHECKING([whether to enable liblustre acl])
1557 AC_ARG_ENABLE([liblustre-acl],
1558 AC_HELP_STRING([--disable-liblustre-acl],
1559 [disable ACL support for liblustre]),
1560 [],[enable_liblustre_acl=yes])
1561 AC_MSG_RESULT([$enable_liblustre_acl])
1562 if test x$enable_liblustre_acl = xyes ; then
1563 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1569 AC_ARG_ENABLE(mpitests,
1570 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1571 [include mpi tests]),
1582 MPICC_WRAPPER=$enableval
1592 if test x$enable_mpitests != xno; then
1593 AC_MSG_CHECKING([whether mpitests can be built])
1601 MPI_Initialized(&flag);
1604 AC_MSG_RESULT([yes])
1611 AC_SUBST(MPICC_WRAPPER)
1613 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1614 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1617 LC_CONFIG_LIBLUSTRE_RECOVERY
1623 # whether to enable quota support global control
1625 AC_DEFUN([LC_CONFIG_QUOTA],
1626 [AC_ARG_ENABLE([quota],
1627 AC_HELP_STRING([--enable-quota],
1628 [enable quota support]),
1629 [],[enable_quota='yes'])
1632 AC_DEFUN([LC_QUOTA],
1636 AC_CHECK_HEADER(sys/quota.h,
1637 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1638 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1644 # whether to enable split support
1646 AC_DEFUN([LC_CONFIG_SPLIT],
1647 [AC_MSG_CHECKING([whether to enable split support])
1648 AC_ARG_ENABLE([split],
1649 AC_HELP_STRING([--enable-split],
1650 [enable split support]),
1651 [],[enable_split='no'])
1652 AC_MSG_RESULT([$enable_split])
1653 if test x$enable_split != xno; then
1654 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1659 # LC_LLITE_LLOOP_MODULE
1660 # lloop_llite.ko does not currently work with page sizes
1663 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1664 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1665 LB_LINUX_TRY_COMPILE([
1666 #include <asm/page.h>
1668 #if PAGE_SIZE >= 65536
1669 #error "PAGE_SIZE >= 65536"
1672 enable_llite_lloop_module='yes'
1673 AC_MSG_RESULT([yes])
1675 enable_llite_lloop_module='no'
1683 # configure support for optional OSD implementation
1685 AC_DEFUN([LC_OSD_ADDON],
1686 [AC_MSG_CHECKING([for osd])
1688 AC_HELP_STRING([--with-osd=path],
1689 [set path to optional osd]),
1692 no) ENABLEOSDADDON=0
1694 *) OSDADDON="${with_osd}"
1701 if test $ENABLEOSDADDON -eq 0; then
1705 OSDMODNAME=`basename $OSDADDON`
1706 if test -e $LUSTRE/$OSDMODNAME; then
1707 AC_MSG_RESULT([can't link])
1709 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1710 AC_MSG_RESULT([$OSDMODNAME])
1711 OSDADDON="subdir-m += $OSDMODNAME"
1713 AC_MSG_RESULT([can't link])
1723 # other configure checks
1725 AC_DEFUN([LC_CONFIGURE],
1726 [LC_CONFIG_OBD_BUFFER_SIZE
1728 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1729 CFLAGS="$CFLAGS -Werror"
1732 # maximum MDS thread count
1735 # include/liblustre.h
1736 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1738 # liblustre/llite_lib.h
1739 AC_CHECK_HEADERS([xtio.h file.h])
1742 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1745 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1746 AC_CHECK_FUNCS([inet_ntoa])
1748 # libsysio/src/readlink.c
1751 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1752 AC_CHECK_HEADERS([linux/random.h], [], [],
1753 [#ifdef HAVE_LINUX_TYPES_H
1754 # include <linux/types.h>
1759 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1761 # check for -lz support
1765 [AC_CHECK_HEADERS([zlib.h],
1767 AC_DEFINE([HAVE_ADLER], 1,
1768 [support alder32 checksum type])],
1769 [AC_MSG_WARN([No zlib-devel package found,
1770 unable to use adler32 checksum])])],
1771 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1776 AC_CHECK_LIB([selinux],
1777 [is_selinux_enabled],
1778 [AC_CHECK_HEADERS([selinux.h],
1779 [SELINUX="-lselinux"
1780 AC_DEFINE([HAVE_SELINUX], 1,
1781 [support for selinux ])],
1782 [AC_MSG_WARN([No selinux-devel package found,
1783 unable to build selinux enabled
1785 [AC_MSG_WARN([No selinux package found, unable to build selinux
1791 AC_ARG_ENABLE([mindf],
1792 AC_HELP_STRING([--enable-mindf],
1793 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1795 if test "$enable_mindf" = "yes" ; then
1796 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1799 AC_ARG_ENABLE([fail_alloc],
1800 AC_HELP_STRING([--disable-fail-alloc],
1801 [disable randomly alloc failure]),
1802 [],[enable_fail_alloc=yes])
1803 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1804 AC_MSG_RESULT([$enable_fail_alloc])
1805 if test x$enable_fail_alloc != xno ; then
1806 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1809 AC_ARG_ENABLE([invariants],
1810 AC_HELP_STRING([--enable-invariants],
1811 [enable invariant checking (cpu intensive)]),
1813 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1814 AC_MSG_RESULT([$enable_invariants])
1815 if test x$enable_invariants = xyes ; then
1816 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1819 AC_ARG_ENABLE([lu_ref],
1820 AC_HELP_STRING([--enable-lu_ref],
1821 [enable lu_ref reference tracking code]),
1823 AC_MSG_CHECKING([whether to track references with lu_ref])
1824 AC_MSG_RESULT([$enable_lu_ref])
1825 if test x$enable_lu_ref = xyes ; then
1826 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1829 AC_ARG_ENABLE([pgstate-track],
1830 AC_HELP_STRING([--enable-pgstate-track],
1831 [enable page state tracking]),
1832 [enable_pgstat_track='yes'],[])
1833 AC_MSG_CHECKING([whether to enable page state tracking])
1834 AC_MSG_RESULT([$enable_pgstat_track])
1835 if test x$enable_pgstat_track = xyes ; then
1836 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1837 [enable page state tracking code])
1844 # AM_CONDITIONALS for lustre
1846 AC_DEFUN([LC_CONDITIONALS],
1847 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1848 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1849 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1850 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1851 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1852 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1853 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1854 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1855 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1856 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1857 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1858 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1859 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1860 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1866 # files that should be generated with AC_OUTPUT
1868 AC_DEFUN([LC_CONFIG_FILES],
1872 lustre/autoconf/Makefile
1873 lustre/conf/Makefile
1874 lustre/contrib/Makefile
1876 lustre/include/Makefile
1877 lustre/include/lustre_ver.h
1878 lustre/include/linux/Makefile
1879 lustre/include/darwin/Makefile
1880 lustre/include/lustre/Makefile
1881 lustre/kernel_patches/targets/2.6-rhel6.target
1882 lustre/kernel_patches/targets/2.6-rhel5.target
1883 lustre/kernel_patches/targets/2.6-sles11.target
1884 lustre/kernel_patches/targets/3.0-sles11.target
1885 lustre/kernel_patches/targets/2.6-fc11.target
1886 lustre/kernel_patches/targets/2.6-fc12.target
1887 lustre/kernel_patches/targets/2.6-fc15.target
1888 lustre/kernel_patches/targets/3.x-fc18.target
1889 lustre/ldlm/Makefile
1891 lustre/fid/autoMakefile
1892 lustre/liblustre/Makefile
1893 lustre/liblustre/tests/Makefile
1894 lustre/liblustre/tests/mpi/Makefile
1895 lustre/llite/Makefile
1896 lustre/llite/autoMakefile
1897 lustre/lclient/Makefile
1899 lustre/lov/autoMakefile
1900 lustre/lvfs/Makefile
1901 lustre/lvfs/autoMakefile
1903 lustre/mdc/autoMakefile
1905 lustre/lmv/autoMakefile
1906 lustre/lfsck/Makefile
1907 lustre/lfsck/autoMakefile
1909 lustre/mdt/autoMakefile
1911 lustre/mdd/autoMakefile
1913 lustre/fld/autoMakefile
1914 lustre/obdclass/Makefile
1915 lustre/obdclass/autoMakefile
1916 lustre/obdclass/linux/Makefile
1917 lustre/obdecho/Makefile
1918 lustre/obdecho/autoMakefile
1920 lustre/ofd/autoMakefile
1922 lustre/osc/autoMakefile
1924 lustre/ost/autoMakefile
1925 lustre/osd-ldiskfs/Makefile
1926 lustre/osd-ldiskfs/autoMakefile
1927 lustre/osd-zfs/Makefile
1928 lustre/osd-zfs/autoMakefile
1930 lustre/mgc/autoMakefile
1932 lustre/mgs/autoMakefile
1933 lustre/target/Makefile
1934 lustre/ptlrpc/Makefile
1935 lustre/ptlrpc/autoMakefile
1936 lustre/ptlrpc/gss/Makefile
1937 lustre/ptlrpc/gss/autoMakefile
1938 lustre/quota/Makefile
1939 lustre/quota/autoMakefile
1940 lustre/scripts/Makefile
1941 lustre/tests/Makefile
1942 lustre/tests/mpi/Makefile
1943 lustre/utils/Makefile
1944 lustre/utils/gss/Makefile
1946 lustre/osp/autoMakefile
1948 lustre/lod/autoMakefile
1949 lustre/obdclass/darwin/Makefile