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
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(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=size],
125 [define the maximum number of threads available on the MDS: (default=512)]),
127 MDS_THREAD_COUNT=$with_mds_max_threads
128 AC_DEFINE_UNQUOTED(MDT_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of mdt 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],[AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [support quota])],[
215 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
219 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
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],
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])])
237 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
238 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
240 AC_DEFINE(HAVE_D_REHASH_COND, 1,
241 [d_rehash_cond is exported by the kernel])
246 AC_DEFUN([LC_EXPORT___D_REHASH],
247 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
249 AC_DEFINE(HAVE___D_REHASH, 1,
250 [__d_rehash is exported by the kernel])
255 # The actual symbol exported varies among architectures, so we need
256 # to check many symbols (but only in the current architecture.) No
257 # matter what symbol is exported, the kernel #defines node_to_cpumask
258 # to the appropriate function and that's what we use.
259 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
260 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
261 [arch/$LINUX_ARCH/mm/numa.c],
262 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
263 [node_to_cpumask is exported by
264 the kernel])]) # x86_64
265 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
266 [arch/$LINUX_ARCH/kernel/smpboot.c],
267 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
268 [node_to_cpumask is exported by
269 the kernel])]) # ia64
270 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
271 [arch/$LINUX_ARCH/kernel/smpboot.c],
272 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
273 [node_to_cpumask is exported by
274 the kernel])]) # i386
279 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
281 AC_DEFUN([LC_FILEMAP_POPULATE],
282 [AC_MSG_CHECKING([for exported filemap_populate])
283 LB_LINUX_TRY_COMPILE([
284 #include <asm/page.h>
285 #include <linux/mm.h>
287 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
290 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
299 AC_DEFUN([LC_BIT_SPINLOCK_H],
300 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
301 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
302 LB_LINUX_TRY_COMPILE([
303 #include <asm/processor.h>
304 #include <linux/spinlock.h>
305 #include <linux/bit_spinlock.h>
308 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
319 AC_DEFUN([LC_CONST_ACL_SIZE],
320 [AC_MSG_CHECKING([calc acl size])
322 CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS"
325 #include <linux/types.h>
328 #define __LINUX_POSIX_ACL_H
330 #ifdef CONFIG_FS_POSIX_ACL
331 # include <linux/posix_acl_xattr.h>
338 /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */
339 int size = posix_acl_xattr_size(32);
340 FILE *f = fopen("acl.size","w+");
341 fprintf(f,"%d", size);
347 acl_size=`cat acl.size`
348 AC_MSG_RESULT([ACL size $acl_size])
349 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
351 AC_ERROR([ACL size can't be computed])
353 AC_MSG_RESULT([can't check ACL size, make it 260])
354 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE,260)
362 AC_DEFUN([LC_CAPA_CRYPTO],
363 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
364 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
366 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
367 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
369 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
370 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
375 # LC_CONFIG_RMTCLIENT
378 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
380 AC_DEFUN([LC_CONFIG_RMTCLIENT],
381 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
382 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
387 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
389 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
390 [AC_MSG_CHECKING([whether to enable gss keyring backend])
391 AC_ARG_ENABLE([gss_keyring],
392 [AC_HELP_STRING([--disable-gss-keyring],
393 [disable gss keyring backend])],
394 [],[enable_gss_keyring='yes'])
395 AC_MSG_RESULT([$enable_gss_keyring])
397 if test x$enable_gss_keyring != xno; then
398 LB_LINUX_CONFIG_IM([KEYS],[],
399 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
401 AC_CHECK_LIB([keyutils], [keyctl_search], [],
402 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
404 AC_DEFINE([HAVE_GSS_KEYRING], [1],
405 [Define this if you enable gss keyring backend])
409 AC_DEFUN([LC_CONFIG_SUNRPC],
410 [LB_LINUX_CONFIG_IM([SUNRPC],[],
411 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
415 # LC_CONFIG_GSS (default disabled)
417 # Build gss and related tools of Lustre. Currently both kernel and user space
418 # parts are depend on linux platform.
420 AC_DEFUN([LC_CONFIG_GSS],
421 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
423 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
424 [],[enable_gss='no'])
425 AC_MSG_RESULT([$enable_gss])
427 if test x$enable_gss == xyes; then
428 LC_CONFIG_GSS_KEYRING
431 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
433 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
434 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
435 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
436 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
437 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
438 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
439 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
440 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
442 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
443 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
444 [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
445 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
446 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
448 AC_SUBST(GSSAPI_LIBS)
454 AC_DEFUN([LC_TASK_CLENV_STORE],
456 AC_MSG_CHECKING([if we can store cl_env in task_struct])
457 if test x$have_task_clenv_store != xyes ; then
458 LC_TASK_CLENV_TUX_INFO
464 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
465 # yet tree_lock is converted from rwlock to spin_lock since v2.6.26
466 AC_DEFUN([LC_RW_TREE_LOCK],
467 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
468 tmp_flags="$EXTRA_KCFLAGS"
469 EXTRA_KCFLAGS="-Werror"
470 LB_LINUX_TRY_COMPILE([
471 #include <linux/fs.h>
473 struct address_space a;
475 write_lock(&a.tree_lock);
478 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
482 EXTRA_KCFLAGS="$tmp_flags"
487 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
488 # 2.6.18~2.6.25 umount_begin has different parameters
489 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
490 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
491 tmp_flags="$EXTRA_KCFLAGS"
492 EXTRA_KCFLAGS="-Werror"
493 LB_LINUX_TRY_COMPILE([
494 #include <linux/fs.h>
497 static void cfg_umount_begin (struct vfsmount *v, int flags)
502 static struct super_operations cfg_super_operations = {
503 .umount_begin = cfg_umount_begin,
506 cfg_super_operations.umount_begin(NULL,0);
509 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
510 [Define umount_begin need second argument])
514 EXTRA_KCFLAGS="$tmp_flags"
518 # starting from 2.6.18 the file_operations .flush
519 # method has a new "fl_owner_t id" parameter
521 AC_DEFUN([LC_FLUSH_OWNER_ID],
522 [AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
523 LB_LINUX_TRY_COMPILE([
524 #include <linux/fs.h>
526 struct file_operations *fops = NULL;
527 fl_owner_t id = NULL;
530 i = fops->flush(NULL, id);
532 AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
533 [file_operations .flush method has an fl_owner_t id])
541 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
543 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
544 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
546 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
547 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
548 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
549 [exported invalidate_mapping_pages])],
550 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
551 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
552 [exported invalidate_inode_pages])], [
553 AC_MSG_ERROR([no way to invalidate pages])
558 #2.6.18 + RHEL5 (fc6)
560 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
561 AC_DEFUN([LC_PG_FS_MISC],
562 [AC_MSG_CHECKING([kernel has PG_fs_misc])
563 LB_LINUX_TRY_COMPILE([
564 #include <linux/mm.h>
565 #include <linux/page-flags.h>
568 #error PG_fs_misc not defined in kernel
572 AC_DEFINE(HAVE_PG_FS_MISC, 1,
573 [is kernel have PG_fs_misc])
579 # RHEL5 PageChecked and SetPageChecked defined
580 AC_DEFUN([LC_PAGE_CHECKED],
581 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
582 LB_LINUX_TRY_COMPILE([
583 #include <linux/mm.h>
584 #ifdef HAVE_LINUX_MMTYPES_H
585 #include <linux/mm_types.h>
587 #include <linux/page-flags.h>
589 struct page *p = NULL;
591 /* before 2.6.26 this define*/
593 /* 2.6.26 use function instead of define for it */
599 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
600 [does kernel have PageChecked and SetPageChecked])
609 # If we have fiemap.h
610 # after 2.6.27 use fiemap.h in include/linux
612 AC_DEFUN([LC_LINUX_FIEMAP_H],
613 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
614 AC_MSG_CHECKING([if fiemap.h can be compiled])
615 LB_LINUX_TRY_COMPILE([
616 #include <linux/types.h>
617 #include <linux/fiemap.h>
620 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
631 # inode don't have i_blksize field
632 AC_DEFUN([LC_INODE_BLKSIZE],
633 [AC_MSG_CHECKING([inode has i_blksize field])
634 LB_LINUX_TRY_COMPILE([
635 #include <linux/fs.h>
641 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
642 [struct inode has i_blksize field])
649 # 2.6.19 replaced writev with aio_write
650 AC_DEFUN([LC_FILE_WRITEV],
651 [AC_MSG_CHECKING([writev in fops])
652 LB_LINUX_TRY_COMPILE([
653 #include <linux/fs.h>
655 struct file_operations *fops = NULL;
659 AC_DEFINE(HAVE_FILE_WRITEV, 1,
667 # 2.6.19 replaced readv with aio_read
668 AC_DEFUN([LC_FILE_READV],
669 [AC_MSG_CHECKING([readv in fops])
670 LB_LINUX_TRY_COMPILE([
671 #include <linux/fs.h>
673 struct file_operations *fops = NULL;
677 AC_DEFINE(HAVE_FILE_READV, 1,
686 # LC_CANCEL_DIRTY_PAGE
687 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
688 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
689 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
690 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
691 # backport is broken, so ignore it
692 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
693 test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e -"; then
696 LB_LINUX_TRY_COMPILE([
697 #include <linux/mm.h>
698 #include <linux/page-flags.h>
700 cancel_dirty_page(NULL, 0);
703 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
704 [kernel has cancel_dirty_page instead of clear_page_dirty])
711 # raid5-zerocopy patch
716 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
717 # it support constant page, which means the page won't be modified during the
720 AC_DEFUN([LC_PAGE_CONSTANT],
721 [AC_MSG_CHECKING([if kernel have PageConstant defined])
722 LB_LINUX_TRY_COMPILE([
723 #include <linux/mm.h>
724 #include <linux/page-flags.h>
727 #error "Have no raid5 zcopy patch"
731 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
739 # 2.6.22 lost second parameter for invalidate_bdev
740 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
741 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
742 LB_LINUX_TRY_COMPILE([
743 #include <linux/buffer_head.h>
745 invalidate_bdev(NULL,0);
748 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
749 [invalidate_bdev has second argument])
756 # check for crypto API
758 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
759 [AC_MSG_CHECKING([if kernel has block cipher support])
760 LB_LINUX_TRY_COMPILE([
761 #include <linux/err.h>
762 #include <linux/crypto.h>
764 struct crypto_blkcipher *tfm;
765 tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
768 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
775 # check for struct hash_desc
777 AC_DEFUN([LC_STRUCT_HASH_DESC],
778 [AC_MSG_CHECKING([if kernel has struct hash_desc])
779 LB_LINUX_TRY_COMPILE([
780 #include <linux/err.h>
781 #include <linux/crypto.h>
783 struct hash_desc foo __attribute__ ((unused));
786 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
793 # check for struct blkcipher_desc
795 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
796 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
797 LB_LINUX_TRY_COMPILE([
798 #include <linux/err.h>
799 #include <linux/crypto.h>
801 struct blkcipher_desc foo __attribute__ ((unused));
804 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
811 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
813 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
814 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
815 LB_LINUX_TRY_COMPILE([
816 #include <linux/fs.h>
818 int v __attribute__ ((unused));
819 v = FS_RENAME_DOES_D_MOVE;
822 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
830 # 2.6.23 have return type 'void' for unregister_blkdev
831 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
832 [AC_MSG_CHECKING([if unregister_blkdev return int])
833 LB_LINUX_TRY_COMPILE([
834 #include <linux/fs.h>
836 int i __attribute__ ((unused));
837 i = unregister_blkdev(0,NULL);
840 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
841 [unregister_blkdev return int])
847 # 2.6.23 change .sendfile to .splice_read
848 AC_DEFUN([LC_KERNEL_SPLICE_READ],
849 [AC_MSG_CHECKING([if kernel has .splice_read])
850 LB_LINUX_TRY_COMPILE([
851 #include <linux/fs.h>
853 struct file_operations file;
855 file.splice_read = NULL;
858 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
859 [kernel has .slice_read])
865 # 2.6.23 change .sendfile to .splice_read
866 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
867 AC_DEFUN([LC_KERNEL_SENDFILE],
868 [AC_MSG_CHECKING([if kernel has .sendfile])
869 LB_LINUX_TRY_COMPILE([
870 #include <linux/fs.h>
872 struct file_operations file;
874 file.sendfile = NULL;
877 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
878 [kernel has .sendfile])
884 # 2.6.23 extract nfs export related data into exportfs.h
885 AC_DEFUN([LC_HAVE_EXPORTFS_H],
886 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
887 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
888 [kernel has include/exportfs.h])
894 # 2.6.23 has new page fault handling API
895 AC_DEFUN([LC_VM_OP_FAULT],
896 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
897 LB_LINUX_TRY_COMPILE([
898 #include <linux/mm.h>
900 struct vm_operations_struct op;
905 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
906 [kernel has .fault in vm_operation_struct])
912 # 2.6.23 add code to wait other users to complete before removing procfs entry
913 AC_DEFUN([LC_PROCFS_USERS],
914 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
915 LB_LINUX_TRY_COMPILE([
916 #include <linux/proc_fs.h>
918 struct proc_dir_entry pde;
923 AC_DEFINE(HAVE_PROCFS_USERS, 1,
924 [kernel has pde_users member in procfs entry struct])
926 LB_LINUX_TRY_COMPILE([
927 #include "$LINUX/fs/proc/internal.h"
929 struct proc_dir_entry_aux pde_aux;
931 pde_aux.pde_users = 0;
934 AC_DEFINE(HAVE_PROCFS_USERS, 1,
935 [kernel has pde_users member in proc_dir_entry_aux])
942 # 2.6.23 exports exportfs_decode_fh
943 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
944 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
945 [fs/exportfs/expfs.c],[
946 AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
947 [exportfs_decode_fh has been export])
954 # 2.6.24 need linux/mm_types.h included
955 AC_DEFUN([LC_HAVE_MMTYPES_H],
956 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
957 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
958 [kernel has include/mm_types.h])
964 # 2.6.24 has bio_endio with 2 args
965 AC_DEFUN([LC_BIO_ENDIO_2ARG],
966 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
967 LB_LINUX_TRY_COMPILE([
968 #include <linux/bio.h>
973 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
974 [kernel has bio_endio with 2 args])
980 # 2.6.24 has new members in exports struct.
981 AC_DEFUN([LC_FH_TO_DENTRY],
982 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
983 LB_LINUX_TRY_COMPILE([
984 #include <linux/fs.h>
985 #ifdef HAVE_LINUX_EXPORTFS_H
986 #include <linux/exportfs.h>
989 do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
992 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
993 [kernel has .fh_to_dentry member in export_operations struct])
999 # 2.6.24 removes long aged procfs entry -> deleted member
1000 AC_DEFUN([LC_PROCFS_DELETED],
1001 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1002 LB_LINUX_TRY_COMPILE([
1003 #include <linux/proc_fs.h>
1005 struct proc_dir_entry pde;
1007 pde.deleted = sizeof(pde);
1009 AC_MSG_RESULT([yes])
1010 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1011 [kernel has deleted member in procfs entry struct])
1017 # 2.6.24 has bdi_init()/bdi_destroy() functions.
1018 AC_DEFUN([LC_EXPORT_BDI_INIT],
1019 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
1020 [mm/backing-dev.c],[
1021 AC_DEFINE(HAVE_BDI_INIT, 1,
1022 [bdi_init/bdi_destroy functions are present])
1029 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1030 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1031 [AC_MSG_CHECKING([fs_struct use path structure])
1032 LB_LINUX_TRY_COMPILE([
1033 #include <asm/atomic.h>
1034 #include <linux/spinlock.h>
1035 #include <linux/fs_struct.h>
1037 struct fs_struct fs;
1039 fs.pwd = *((struct path *)sizeof(fs));
1041 AC_MSG_RESULT([yes])
1042 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1043 [fs_struct use path structure])
1054 # LC_SECURITY_PLUG # for SLES10 SP2 (2.6.27)
1055 # check security plug in sles10 sp2 kernel
1056 AC_DEFUN([LC_SECURITY_PLUG],
1057 [AC_MSG_CHECKING([If kernel has security plug support])
1058 LB_LINUX_TRY_COMPILE([
1059 #include <linux/fs.h>
1060 #include <linux/stddef.h>
1062 notify_change(NULL, NULL, NULL);
1065 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
1066 [SLES10 SP2 use extra parameter in vfs])
1072 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
1073 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
1074 tmp_flags="$EXTRA_KCFLAGS"
1075 EXTRA_KCFLAGS="-Werror"
1076 LB_LINUX_TRY_COMPILE([
1077 #include <linux/mm.h>
1079 ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
1081 AC_MSG_RESULT([yes])
1082 AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
1083 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
1087 EXTRA_KCFLAGS="$tmp_flags"
1090 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1091 [AC_MSG_CHECKING([inode_operations->permission has two args])
1092 LB_LINUX_TRY_COMPILE([
1093 #include <linux/fs.h>
1095 struct inode *inode __attribute__ ((unused));
1098 inode->i_op->permission(NULL, 0);
1100 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1101 [inode_operations->permission has two args])
1102 AC_MSG_RESULT([yes])
1108 # 2.6.27 has file_remove_suid instead of remove_suid
1109 AC_DEFUN([LC_FILE_REMOVE_SUID],
1110 [AC_MSG_CHECKING([kernel has file_remove_suid])
1111 LB_LINUX_TRY_COMPILE([
1112 #include <linux/fs.h>
1114 file_remove_suid(NULL);
1116 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1117 [kernel have file_remove_suid])
1118 AC_MSG_RESULT([yes])
1124 # 2.6.27 have new page locking API
1125 AC_DEFUN([LC_TRYLOCKPAGE],
1126 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1127 LB_LINUX_TRY_COMPILE([
1128 #include <linux/pagemap.h>
1132 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1133 [kernel uses trylock_page for page lock])
1134 AC_MSG_RESULT([yes])
1140 # 2.6.27 removed the read_inode from super_operations.
1141 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1142 [AC_MSG_CHECKING([super_operations has a read_inode field])
1143 LB_LINUX_TRY_COMPILE([
1144 #include <linux/fs.h>
1146 struct super_operations *sop;
1147 sop->read_inode(NULL);
1149 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1150 [super_operations has a read_inode])
1151 AC_MSG_RESULT([yes])
1157 # 2.6.27 has inode_permission instead of permisson
1158 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1159 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1161 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1162 [inode_permission is exported by the kernel])
1167 # 2.6.27 use 5th parameter in quota_on for remount.
1168 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1169 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1170 LB_LINUX_TRY_COMPILE([
1171 #include <linux/fs.h>
1172 #include <linux/quota.h>
1174 struct quotactl_ops *qop = NULL;
1175 qop->quota_on(NULL, 0, 0, NULL, 0);
1177 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1178 [quota_on needs 5 paramters])
1179 AC_MSG_RESULT([yes])
1185 # 2.6.27 use 3th parameter in quota_off for remount.
1186 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1187 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1188 LB_LINUX_TRY_COMPILE([
1189 #include <linux/fs.h>
1190 #include <linux/quota.h>
1192 struct quotactl_ops *qop = NULL;
1193 qop->quota_off(NULL, 0, 0);
1195 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1196 [quota_off needs 3 paramters])
1197 AC_MSG_RESULT([yes])
1203 # 2.6.27 has vfs_dq_off inline function.
1204 AC_DEFUN([LC_VFS_DQ_OFF],
1205 [AC_MSG_CHECKING([vfs_dq_off is defined])
1206 LB_LINUX_TRY_COMPILE([
1207 #include <linux/quotaops.h>
1209 vfs_dq_off(NULL, 0);
1211 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1212 AC_MSG_RESULT([yes])
1218 # LC_LOCK_MAP_ACQUIRE
1219 # after 2.6.27 lock_map_acquire replaces lock_acquire
1220 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1221 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1222 LB_LINUX_TRY_COMPILE([
1223 #include <linux/lockdep.h>
1225 lock_map_acquire(NULL);
1228 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1229 [lock_map_acquire is defined])
1235 # 2.6.27.15-2 sles11
1237 # 2.6.27 sles11 remove the bi_hw_segments
1238 AC_DEFUN([LC_BI_HW_SEGMENTS],
1239 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1240 LB_LINUX_TRY_COMPILE([
1241 #include <linux/bio.h>
1244 io.bi_hw_segments = sizeof(io);
1246 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1247 [struct bio has a bi_hw_segments field])
1248 AC_MSG_RESULT([yes])
1255 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1256 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1257 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1258 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1259 AC_DEFINE(HAVE_QUOTAIO_H, 1,
1260 [kernel has include/linux/quotaio_v2.h])
1261 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1262 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1263 [kernel has fs/quotaio_v1.h])
1264 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1265 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1266 [kernel has fs/quota/quotaio_v2.h])
1274 # 2.6.27 sles11 has sb_any_quota_active
1275 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1276 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1277 LB_LINUX_TRY_COMPILE([
1278 #include <linux/quotaops.h>
1280 sb_any_quota_active(NULL);
1282 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1283 [Kernel has a sb_any_quota_active])
1284 AC_MSG_RESULT([yes])
1290 # 2.6.27 sles11 has sb_has_quota_active
1291 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1292 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1293 LB_LINUX_TRY_COMPILE([
1294 #include <linux/quotaops.h>
1296 sb_has_quota_active(NULL, 0);
1298 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1299 [Kernel has a sb_has_quota_active])
1300 AC_MSG_RESULT([yes])
1306 # 2.6.27 exported add_to_page_cache_lru.
1307 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1308 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1310 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1311 [add_to_page_cache_lru functions are present])
1317 # 2.6.29 introduce sb_any_quota_loaded.
1319 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1320 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1321 LB_LINUX_TRY_COMPILE([
1322 #include <linux/quotaops.h>
1324 sb_any_quota_loaded(NULL);
1326 AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1327 [Kernel has a sb_any_quota_loaded])
1328 AC_MSG_RESULT([yes])
1334 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1335 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1336 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1337 [arch/$LINUX_ARCH/mm/numa.c],
1338 [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1339 [node_to_cpumask_map is exported by
1340 the kernel])]) # x86_64
1343 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1344 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1345 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1346 LB_LINUX_TRY_COMPILE([
1347 #include <linux/blkdev.h>
1349 blk_queue_logical_block_size(NULL, 0);
1352 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1353 [blk_queue_logical_block_size is defined])
1361 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1362 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1363 AC_DEFUN([LC_CACHE_UPCALL],
1364 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1365 LB_LINUX_TRY_COMPILE([
1366 #include <linux/sunrpc/cache.h>
1368 struct cache_detail cd;
1369 cd.cache_upcall = NULL;
1372 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1373 [cache_detail has cache_upcall field])
1379 # 2.6.32 add a limits member in struct request_queue.
1380 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1381 [AC_MSG_CHECKING([if request_queue has a limits field])
1382 LB_LINUX_TRY_COMPILE([
1383 #include <linux/blkdev.h>
1385 struct request_queue rq;
1386 rq.limits.io_min = 0;
1389 AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1390 [request_queue has a limits field])
1396 # 2.6.32 has bdi_register() functions.
1397 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1398 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1399 [mm/backing-dev.c],[
1400 AC_DEFINE(HAVE_BDI_REGISTER, 1,
1401 [bdi_register function is present])
1406 # 2.6.32 add s_bdi for super block
1407 AC_DEFUN([LC_SB_BDI],
1408 [AC_MSG_CHECKING([if super_block has s_bdi field])
1409 LB_LINUX_TRY_COMPILE([
1410 #include <linux/fs.h>
1412 struct super_block sb;
1416 AC_DEFINE(HAVE_SB_BDI, 1,
1417 [super_block has s_bdi field])
1423 # 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1424 AC_DEFUN([LC_BDI_NAME],
1425 [AC_MSG_CHECKING([if backing_device_info has name field])
1426 LB_LINUX_TRY_COMPILE([
1427 #include <linux/blkkdev.h>
1429 struct backing_dev_info bdi;
1433 AC_DEFINE(HAVE_BDI_NAME, 1,
1434 [backing_device_info has name field])
1440 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1441 # check blk_queue_max_sectors and use it until disappear.
1442 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1443 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1444 LB_LINUX_TRY_COMPILE([
1445 #include <linux/blkdev.h>
1447 blk_queue_max_sectors(NULL, 0);
1450 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1451 [blk_queue_max_sectors is defined])
1457 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1458 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1459 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1460 LB_LINUX_TRY_COMPILE([
1461 #include <linux/blkdev.h>
1463 blk_queue_max_segments(NULL, 0);
1466 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1467 [blk_queue_max_segments is defined])
1476 # Check if kernel has been patched for 64-bit quota limits support.
1477 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1478 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1479 # that in the absence of quotaio_v1.h in the kernel headers.
1481 AC_DEFUN([LC_QUOTA64],[
1482 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1483 tmp_flags="$EXTRA_KCFLAGS"
1484 EXTRA_KCFLAGS="-I$LINUX/fs"
1485 LB_LINUX_TRY_COMPILE([
1486 #include <linux/kernel.h>
1487 #include <linux/fs.h>
1488 #ifdef HAVE_QUOTAIO_H
1489 # include <linux/quotaio_v2.h>
1490 int versions[] = V2_INITQVERSIONS_R1;
1491 struct v2_disk_dqblk_r1 dqblk_r1;
1492 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1493 # include <quota/quotaio_v2.h>
1494 struct v2r1_disk_dqblk dqblk_r1;
1495 #elif defined(HAVE_FS_QUOTAIO_H)
1496 # include <quotaio_v2.h>
1497 struct v2r1_disk_dqblk dqblk_r1;
1499 #include <linux/quota.h>
1500 int ver = QFMT_VFS_V1;
1503 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1504 AC_MSG_RESULT([yes])
1506 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1507 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1511 EXTRA_KCFLAGS=$tmp_flags
1514 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1515 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1516 [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1517 LB_LINUX_TRY_COMPILE(
1518 [#include <linux/sched.h>],
1519 [struct task_struct *p = NULL;
1520 cpumask_t mask = { { 0 } };
1521 (void) set_cpus_allowed(p, mask);],
1522 [AC_MSG_RESULT([yes])
1523 AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1524 [set_cpus_allowed is exported by the kernel])],
1525 [AC_MSG_RESULT([no])] )])
1527 # 2.6.32 introduces selinux_is_enabled()
1528 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1529 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1530 LB_LINUX_TRY_COMPILE([
1531 #include <linux/selinux.h>
1533 selinux_is_enabled();
1535 AC_MSG_RESULT([yes])
1536 AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1537 [selinux_is_enabled is defined])
1545 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1546 # d_obtain_alias() for getting anonymous dentries
1547 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1549 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1550 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1551 LB_LINUX_TRY_COMPILE([
1552 #include <linux/dcache.h>
1554 d_obtain_alias(NULL);
1556 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1557 [d_obtain_alias exist in kernel])
1558 AC_MSG_RESULT([yes])
1565 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1567 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1568 [LB_CHECK_SYMBOL_EXPORT(
1569 [generic_error_remove_page],
1571 [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1572 [kernel export generic_error_remove_page])],
1577 # 2.6.32 if kernel export access_process_vm().
1578 AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
1579 [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
1581 [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
1582 [access_process_vm function is present])],
1588 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1590 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1591 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1592 LB_LINUX_TRY_COMPILE([
1593 #include <asm/atomic.h>
1594 #include <linux/spinlock.h>
1595 #include <linux/fs_struct.h>
1597 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1599 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1600 [fs_struct.lock use rwlock])
1601 AC_MSG_RESULT([yes])
1608 # 2.6.36 super_operations add evict_inode method. it hybird of
1609 # delete_inode & clear_inode.
1611 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1612 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1613 LB_LINUX_TRY_COMPILE([
1614 #include <linux/fs.h>
1616 ((struct super_operations *)0)->evict_inode(NULL);
1618 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1619 [super_operations.evict_inode() is exist in kernel])
1620 AC_MSG_RESULT([yes])
1627 # 2.6.35 file_operations.fsync taken 2 arguments.
1628 # 3.0.0 file_operations.fsync takes 4 arguments.
1630 AC_DEFUN([LC_FILE_FSYNC],
1631 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1632 LB_LINUX_TRY_COMPILE([
1633 #include <linux/fs.h>
1635 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1637 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1638 [file_operations.fsync takes 4 arguments])
1639 AC_MSG_RESULT([yes, 4 args])
1641 LB_LINUX_TRY_COMPILE([
1642 #include <linux/fs.h>
1644 ((struct file_operations *)0)->fsync(NULL, 0);
1646 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1647 [file_operations.fsync takes 2 arguments])
1648 AC_MSG_RESULT([yes, 2 args])
1656 # 2.6.37 remove kernel_locked
1658 AC_DEFUN([LC_KERNEL_LOCKED],
1659 [AC_MSG_CHECKING([if kernel_locked is defined])
1660 LB_LINUX_TRY_COMPILE([
1661 #include <linux/smp_lock.h>
1665 AC_MSG_RESULT([yes])
1666 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
1667 [kernel_locked is defined])
1674 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
1676 AC_DEFUN([LC_D_COMPARE_7ARGS],
1677 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
1678 LB_LINUX_TRY_COMPILE([
1679 #include <linux/dcache.h>
1681 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
1683 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
1684 [d_compare need 7 arguments])
1685 AC_MSG_RESULT([yes])
1692 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
1694 AC_DEFUN([LC_D_DELETE_CONST],
1695 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
1696 tmp_flags="$EXTRA_KCFLAGS"
1697 EXTRA_KCFLAGS="-Werror"
1698 LB_LINUX_TRY_COMPILE([
1699 #include <linux/dcache.h>
1701 const struct dentry *d = NULL;
1702 ((struct dentry_operations*)0)->d_delete(d);
1704 AC_DEFINE(HAVE_D_DELETE_CONST, const,
1705 [d_delete first parameter declared const])
1706 AC_MSG_RESULT([yes])
1708 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
1711 EXTRA_KCFLAGS="$tmp_flags"
1715 # 2.6.38 dcache_lock removed. rcu-walk commited.
1717 AC_DEFUN([LC_DCACHE_LOCK],
1718 [AC_MSG_CHECKING([if dcache_lock is exist])
1719 LB_LINUX_TRY_COMPILE([
1720 #include <linux/dcache.h>
1722 spin_lock(&dcache_lock);
1724 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
1725 [dcache_lock is exist])
1726 AC_MSG_RESULT([yes])
1733 # 2.6.38 export blkdev_get_by_dev
1735 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1736 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1738 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1739 [blkdev_get_by_dev is exported by the kernel])
1745 # 2.6.38 vfsmount.mnt_count doesn't use atomic_t
1747 # 3.3 starts hiding vfsmount guts series (move from include/linux/mount.h to
1748 # fs/mount.h, see kernel commit 7d6fec45a5131918b51dcd76da52f2ec86a85be6)
1750 AC_DEFUN([LC_ATOMIC_MNT_COUNT],
1751 [AC_MSG_CHECKING([if vfsmount guts is hidden, or vfsmount.mnt_count is atomic_t.])
1752 LB_LINUX_TRY_COMPILE([
1753 #include <linux/fs.h>
1754 #include <../fs/mount.h>
1756 struct mount *mnt = real_mount((struct vfsmount *)0);
1758 AC_DEFINE(HAVE_HIDE_VFSMOUNT_GUTS, 1,
1759 [hide vfsmount guts in fs/mount.h])
1760 AC_MSG_RESULT([yes, hide vfsmount guts in fs/mount.h])
1762 LB_LINUX_TRY_COMPILE([
1763 #include <asm/atomic.h>
1764 #include <linux/fs.h>
1765 #include <linux/mount.h>
1767 ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
1769 AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
1770 [vfsmount.mnt_count is atomic_t])
1771 AC_MSG_RESULT([yes, vfsmount.mnt_count is atomic_t])
1779 # 2.6.38 use path as 4th parameter in quota_on.
1781 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1782 [AC_MSG_CHECKING([quota_on use path as parameter])
1783 tmp_flags="$EXTRA_KCFLAGS"
1784 EXTRA_KCFLAGS="-Werror"
1785 LB_LINUX_TRY_COMPILE([
1786 #include <linux/fs.h>
1787 #include <linux/quota.h>
1789 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1791 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1792 [quota_on use path as 4th paramter])
1793 AC_MSG_RESULT([yes])
1797 EXTRA_KCFLAGS="$tmp_flags"
1801 # 2.6.39 remove unplug_fn from request_queue.
1803 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1804 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1805 LB_LINUX_TRY_COMPILE([
1806 #include <linux/blkdev.h>
1808 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1810 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1811 [request_queue has unplug_fn field])
1812 AC_MSG_RESULT([yes])
1819 # 2.6.38 generic_permission taken 4 paremater.
1820 # in fact, it means rcu-walk aware permission bring.
1822 AC_DEFUN([LC_GENERIC_PERMISSION],
1823 [AC_MSG_CHECKING([if generic_permission take 4 arguments])
1824 LB_LINUX_TRY_COMPILE([
1825 #include <linux/fs.h>
1827 generic_permission(NULL, 0, 0, NULL);
1829 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1830 [generic_permission taken 4 arguments])
1831 AC_MSG_RESULT([yes])
1838 # 2.6.38 export simple_setattr
1840 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1841 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1843 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1844 [simple_setattr is exported by the kernel])
1852 # Lustre linux kernel checks
1854 AC_DEFUN([LC_PROG_LINUX],
1858 LC_CONFIG_LIBLUSTRE_RECOVERY
1859 LC_CONFIG_HEALTH_CHECK_WRITE
1860 LC_CONFIG_LRU_RESIZE
1861 LC_LLITE_LLOOP_MODULE
1864 LC_EXPORT_TRUNCATE_COMPLETE
1865 LC_EXPORT_D_REHASH_COND
1866 LC_EXPORT___D_REHASH
1867 LC_EXPORT_NODE_TO_CPUMASK
1883 LC_UMOUNTBEGIN_HAS_VFSMOUNT
1885 if test x$enable_server = xyes ; then
1886 LC_EXPORT_INVALIDATE_MAPPING_PAGES
1889 #2.6.18 + RHEL5 (fc6)
1900 LC_CANCEL_DIRTY_PAGE
1902 # raid5-zerocopy patch
1906 LC_INVALIDATE_BDEV_2ARG
1907 LC_ASYNC_BLOCK_CIPHER
1909 LC_STRUCT_BLKCIPHER_DESC
1910 LC_FS_RENAME_DOES_D_MOVE
1913 LC_UNREGISTER_BLKDEV_RETURN_INT
1914 LC_KERNEL_SPLICE_READ
1919 LC_EXPORTFS_DECODE_FH
1929 LC_FS_STRUCT_USE_PATH
1932 LC_SECURITY_PLUG # for SLES10 SP2
1933 LC_PGMKWRITE_USE_VMFAULT
1934 LC_INODE_PERMISION_2ARGS
1937 LC_READ_INODE_IN_SBOPS
1938 LC_EXPORT_INODE_PERMISSION
1944 # 2.6.27.15-2 sles11
1948 LC_SB_ANY_QUOTA_ACTIVE
1949 LC_SB_HAS_QUOTA_ACTIVE
1950 LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
1953 LC_SB_ANY_QUOTA_LOADED
1956 LC_EXPORT_CPUMASK_OF_NODE
1959 LC_BLK_QUEUE_LOG_BLK_SIZE
1962 LC_REQUEST_QUEUE_LIMITS
1963 LC_EXPORT_BDI_REGISTER
1965 LC_BLK_QUEUE_MAX_SECTORS
1966 LC_BLK_QUEUE_MAX_SEGMENTS
1969 LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1970 LC_SELINUX_IS_ENABLED
1971 LC_EXPORT_ACCESS_PROCESS_VM
1975 LC_EXPORT_SIMPLE_SETATTR
1979 LC_SBOPS_EVICT_INODE
1986 LC_BLKDEV_GET_BY_DEV
1987 LC_GENERIC_PERMISSION
1988 LC_QUOTA_ON_USE_PATH
1994 LC_REQUEST_QUEUE_UNPLUG_FN
1997 if test x$enable_server = xyes ; then
1998 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1999 LC_FUNC_DEV_SET_RDONLY
2007 # LC_CONFIG_CLIENT_SERVER
2009 # Build client/server sides of Lustre
2011 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2012 [AC_MSG_CHECKING([whether to build Lustre server support])
2013 AC_ARG_ENABLE([server],
2014 AC_HELP_STRING([--disable-server],
2015 [disable Lustre server support]),
2016 [],[enable_server='yes'])
2017 AC_MSG_RESULT([$enable_server])
2019 AC_MSG_CHECKING([whether to build Lustre client support])
2020 AC_ARG_ENABLE([client],
2021 AC_HELP_STRING([--disable-client],
2022 [disable Lustre client support]),
2023 [],[enable_client='yes'])
2024 AC_MSG_RESULT([$enable_client])])
2027 # LC_CONFIG_LIBLUSTRE
2029 # whether to build liblustre
2031 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2032 [AC_MSG_CHECKING([whether to build Lustre library])
2033 AC_ARG_ENABLE([liblustre],
2034 AC_HELP_STRING([--disable-liblustre],
2035 [disable building of Lustre library]),
2036 [],[enable_liblustre=$with_sysio])
2037 AC_MSG_RESULT([$enable_liblustre])
2038 # only build sysio if liblustre is built
2039 with_sysio="$enable_liblustre"
2041 AC_MSG_CHECKING([whether to build liblustre tests])
2042 AC_ARG_ENABLE([liblustre-tests],
2043 AC_HELP_STRING([--enable-liblustre-tests],
2044 [enable liblustre tests, if --disable-tests is used]),
2045 [],[enable_liblustre_tests=$enable_tests])
2046 if test x$enable_liblustre != xyes ; then
2047 enable_liblustre_tests='no'
2049 AC_MSG_RESULT([$enable_liblustre_tests])
2051 AC_MSG_CHECKING([whether to enable liblustre acl])
2052 AC_ARG_ENABLE([liblustre-acl],
2053 AC_HELP_STRING([--disable-liblustre-acl],
2054 [disable ACL support for liblustre]),
2055 [],[enable_liblustre_acl=yes])
2056 AC_MSG_RESULT([$enable_liblustre_acl])
2057 if test x$enable_liblustre_acl = xyes ; then
2058 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2061 # 2.6.29 change prepare/commit_write to write_begin/end
2062 AC_DEFUN([LC_WRITE_BEGIN_END],
2063 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2064 LB_LINUX_TRY_COMPILE([
2065 #include <linux/fs.h>
2066 #include <linux/pagemap.h>
2067 #ifdef HAVE_LINUX_MMTYPES_H
2068 #include <linux/mm_types.h>
2071 struct address_space_operations aops;
2074 aops.write_begin = NULL;
2075 aops.write_end = NULL;
2076 page = grab_cache_page_write_begin(NULL, 0, 0);
2078 AC_MSG_RESULT([yes])
2079 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2080 [kernel has .write_begin/end])
2086 # 2.6.29 blkdev_put has 2 arguments
2087 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2088 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2089 LB_LINUX_TRY_COMPILE([
2090 #include <linux/fs.h>
2092 blkdev_put(NULL, 0);
2094 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2095 [blkdev_put needs 2 paramters])
2096 AC_MSG_RESULT([yes])
2102 # 2.6.29 dentry_open has 4 arguments
2103 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2104 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2105 LB_LINUX_TRY_COMPILE([
2106 #include <linux/fs.h>
2108 dentry_open(NULL, NULL, 0, NULL);
2110 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2111 [dentry_open needs 4 paramters])
2112 AC_MSG_RESULT([yes])
2118 # 2.6.29 split file and anonymous page queues
2119 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2120 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2121 LB_LINUX_TRY_COMPILE([
2122 #include <linux/mm.h>
2123 #include <linux/pagevec.h>
2125 struct pagevec lru_pagevec;
2127 pagevec_init(&lru_pagevec, 0);
2128 pagevec_lru_add_file(&lru_pagevec);
2130 AC_MSG_RESULT([yes])
2131 AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2132 [kernel has .pagevec_lru_add_file])
2141 AC_ARG_ENABLE(mpitests,
2142 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2143 [include mpi tests]),
2154 MPICC_WRAPPER=$enableval
2164 if test x$enable_mpitests != xno; then
2165 AC_MSG_CHECKING([whether mpitests can be built])
2173 MPI_Initialized(&flag);
2176 AC_MSG_RESULT([yes])
2183 AC_SUBST(MPICC_WRAPPER)
2185 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2186 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2189 LC_CONFIG_LIBLUSTRE_RECOVERY
2195 # whether to enable quota support global control
2197 AC_DEFUN([LC_CONFIG_QUOTA],
2198 [AC_ARG_ENABLE([quota],
2199 AC_HELP_STRING([--enable-quota],
2200 [enable quota support]),
2201 [],[enable_quota='yes'])
2204 AC_DEFUN([LC_QUOTA],
2208 AC_CHECK_HEADER(sys/quota.h,
2209 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2210 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2216 # whether to enable split support
2218 AC_DEFUN([LC_CONFIG_SPLIT],
2219 [AC_MSG_CHECKING([whether to enable split support])
2220 AC_ARG_ENABLE([split],
2221 AC_HELP_STRING([--enable-split],
2222 [enable split support]),
2223 [],[enable_split='no'])
2224 AC_MSG_RESULT([$enable_split])
2225 if test x$enable_split != xno; then
2226 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2230 # RHEL5(2.6.18) has tux_info
2231 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2232 [AC_MSG_CHECKING([tux_info])
2233 LB_LINUX_TRY_COMPILE([
2234 #include <linux/sched.h>
2236 struct task_struct task;
2239 AC_MSG_RESULT([yes])
2240 AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2241 have_task_clenv_store='yes'
2248 # LC_LLITE_LLOOP_MODULE
2249 # lloop_llite.ko does not currently work with page sizes
2252 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2253 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2254 LB_LINUX_TRY_COMPILE([
2255 #include <asm/page.h>
2257 #if PAGE_SIZE >= 65536
2258 #error "PAGE_SIZE >= 65536"
2261 enable_llite_lloop_module='yes'
2262 AC_MSG_RESULT([yes])
2264 enable_llite_lloop_module='no'
2272 # other configure checks
2274 AC_DEFUN([LC_CONFIGURE],
2275 [LC_CONFIG_OBD_BUFFER_SIZE
2277 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2278 CFLAGS="$CFLAGS -Werror"
2281 # maximum MDS thread count
2284 # include/liblustre.h
2285 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2287 # liblustre/llite_lib.h
2288 AC_CHECK_HEADERS([xtio.h file.h])
2291 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2294 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2295 AC_CHECK_FUNCS([inet_ntoa])
2297 # libsysio/src/readlink.c
2300 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2301 AC_CHECK_HEADERS([linux/random.h], [], [],
2302 [#ifdef HAVE_LINUX_TYPES_H
2303 # include <linux/types.h>
2308 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2310 # check for -lz support
2314 [AC_CHECK_HEADERS([zlib.h],
2316 AC_DEFINE([HAVE_ADLER], 1,
2317 [support alder32 checksum type])],
2318 [AC_MSG_WARN([No zlib-devel package found,
2319 unable to use adler32 checksum])])],
2320 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2325 AC_ARG_ENABLE([mindf],
2326 AC_HELP_STRING([--enable-mindf],
2327 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2329 if test "$enable_mindf" = "yes" ; then
2330 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2333 AC_ARG_ENABLE([fail_alloc],
2334 AC_HELP_STRING([--disable-fail-alloc],
2335 [disable randomly alloc failure]),
2336 [],[enable_fail_alloc=yes])
2337 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2338 AC_MSG_RESULT([$enable_fail_alloc])
2339 if test x$enable_fail_alloc != xno ; then
2340 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2343 AC_ARG_ENABLE([invariants],
2344 AC_HELP_STRING([--enable-invariants],
2345 [enable invariant checking (cpu intensive)]),
2347 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2348 AC_MSG_RESULT([$enable_invariants])
2349 if test x$enable_invariants = xyes ; then
2350 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2353 AC_ARG_ENABLE([lu_ref],
2354 AC_HELP_STRING([--enable-lu_ref],
2355 [enable lu_ref reference tracking code]),
2357 AC_MSG_CHECKING([whether to track references with lu_ref])
2358 AC_MSG_RESULT([$enable_lu_ref])
2359 if test x$enable_lu_ref = xyes ; then
2360 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2363 AC_ARG_ENABLE([pgstate-track],
2364 AC_HELP_STRING([--enable-pgstate-track],
2365 [enable page state tracking]),
2366 [enable_pgstat_track='yes'],[])
2367 AC_MSG_CHECKING([whether to enable page state tracking])
2368 AC_MSG_RESULT([$enable_pgstat_track])
2369 if test x$enable_pgstat_track = xyes ; then
2370 AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
2371 [enable page state tracking code])
2378 LC_DENTRY_OPEN_4ARGS
2379 LC_PAGEVEC_LRU_ADD_FILE
2386 # AM_CONDITIONALS for lustre
2388 AC_DEFUN([LC_CONDITIONALS],
2389 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2390 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2391 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2392 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2393 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2394 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2395 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2396 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2397 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2398 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2399 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2400 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2401 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2402 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2408 # files that should be generated with AC_OUTPUT
2410 AC_DEFUN([LC_CONFIG_FILES],
2414 lustre/autoconf/Makefile
2415 lustre/conf/Makefile
2416 lustre/contrib/Makefile
2418 lustre/include/Makefile
2419 lustre/include/lustre_ver.h
2420 lustre/include/linux/Makefile
2421 lustre/include/darwin/Makefile
2422 lustre/include/lustre/Makefile
2423 lustre/kernel_patches/targets/2.6-rhel6.target
2424 lustre/kernel_patches/targets/2.6-rhel5.target
2425 lustre/kernel_patches/targets/2.6-sles10.target
2426 lustre/kernel_patches/targets/2.6-sles11.target
2427 lustre/kernel_patches/targets/2.6-oel5.target
2428 lustre/kernel_patches/targets/2.6-fc11.target
2429 lustre/kernel_patches/targets/2.6-fc12.target
2430 lustre/ldlm/Makefile
2432 lustre/fid/autoMakefile
2433 lustre/liblustre/Makefile
2434 lustre/liblustre/tests/Makefile
2435 lustre/liblustre/tests/mpi/Makefile
2436 lustre/llite/Makefile
2437 lustre/llite/autoMakefile
2438 lustre/lclient/Makefile
2440 lustre/lov/autoMakefile
2441 lustre/lvfs/Makefile
2442 lustre/lvfs/autoMakefile
2444 lustre/mdc/autoMakefile
2446 lustre/lmv/autoMakefile
2448 lustre/mds/autoMakefile
2450 lustre/mdt/autoMakefile
2452 lustre/cmm/autoMakefile
2454 lustre/mdd/autoMakefile
2456 lustre/fld/autoMakefile
2457 lustre/obdclass/Makefile
2458 lustre/obdclass/autoMakefile
2459 lustre/obdclass/linux/Makefile
2460 lustre/obdecho/Makefile
2461 lustre/obdecho/autoMakefile
2462 lustre/obdfilter/Makefile
2463 lustre/obdfilter/autoMakefile
2465 lustre/ofd/autoMakefile
2467 lustre/osc/autoMakefile
2469 lustre/ost/autoMakefile
2470 lustre/osd-ldiskfs/Makefile
2471 lustre/osd-ldiskfs/autoMakefile
2472 lustre/osd-zfs/Makefile
2473 lustre/osd-zfs/autoMakefile
2475 lustre/mgc/autoMakefile
2477 lustre/mgs/autoMakefile
2478 lustre/ptlrpc/Makefile
2479 lustre/ptlrpc/autoMakefile
2480 lustre/ptlrpc/gss/Makefile
2481 lustre/ptlrpc/gss/autoMakefile
2482 lustre/quota/Makefile
2483 lustre/quota/autoMakefile
2484 lustre/scripts/Makefile
2485 lustre/scripts/lustre
2486 lustre/tests/Makefile
2487 lustre/tests/mpi/Makefile
2488 lustre/utils/Makefile
2489 lustre/utils/gss/Makefile
2490 lustre/obdclass/darwin/Makefile