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 'auto', tests for dependencies, if found, enables; only called 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='auto'])
273 AC_MSG_RESULT([$enable_gss_keyring])
275 if test x$enable_gss_keyring != xno; then
276 LB_LINUX_CONFIG_IM([KEYS],[],
277 [gss_keyring_conf_test='fail';
278 AC_MSG_WARN([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
280 AC_CHECK_LIB([keyutils], [keyctl_search], [],
281 [gss_keyring_conf_test='fail';
282 AC_MSG_WARN([libkeyutils is not found, which is required by gss keyring backend])],)
284 if test x$gss_keyring_conf_test != xfail; then
285 AC_DEFINE([HAVE_GSS_KEYRING], [1], [Define this if you enable gss keyring backend])
286 enable_gss_keyring='yes'
288 if test x$enable_gss_keyring == xyes; then
289 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
291 AC_MSG_WARN([Cannot enable gss keyring. See above for details.])
297 AC_DEFUN([LC_CONFIG_SUNRPC],
298 [LB_LINUX_CONFIG_IM([SUNRPC],[],
299 [if test x$sunrpc_required == xyes; then
300 AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])
305 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
307 # Build gss and related tools of Lustre. Currently both kernel and user space
308 # parts are depend on linux platform.
310 AC_DEFUN([LC_CONFIG_GSS],
311 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
313 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
314 [],[enable_gss='auto'])
315 AC_MSG_RESULT([$enable_gss])
317 if test x$enable_gss != xno; then
318 LC_CONFIG_GSS_KEYRING
319 sunrpc_required=$enable_gss
323 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
324 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
325 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
326 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
327 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
328 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
329 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
330 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
332 require_krb5=$enable_gss
336 if test x$KRBDIR != x; then
337 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
338 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi";
339 gss_conf_test='success'],
340 [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
341 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue";
342 gss_conf_test='success'],
343 [if test x$enable_gss == xyes; then
344 AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])
346 AC_MSG_WARN([libgssapi or libgssglue is not found, which is required by GSS.])
348 AC_SUBST(GSSAPI_LIBS)
351 if test x$gss_conf_test == xsuccess; then
352 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
361 # 2.6.24 has bio_endio with 2 args
362 AC_DEFUN([LC_BIO_ENDIO_2ARG],
363 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
364 LB_LINUX_TRY_COMPILE([
365 #include <linux/bio.h>
370 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
371 [kernel has bio_endio with 2 args])
377 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
378 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
379 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
380 # v3.1 onward have a 2 arg version (inode, mask)
381 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
382 [AC_MSG_CHECKING([inode_operations->permission has two args])
383 LB_LINUX_TRY_COMPILE([
384 #include <linux/fs.h>
386 struct inode *inode __attribute__ ((unused));
389 inode->i_op->permission(NULL, 0);
391 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
392 [inode_operations->permission has two args])
399 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
400 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
401 tmp_flags="$EXTRA_KCFLAGS"
402 EXTRA_KCFLAGS="-Werror"
403 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
404 LB_LINUX_TRY_COMPILE([
405 #include <linux/fs.h>
406 #include <linux/quota.h>
408 struct quotactl_ops qops = {};
409 struct fs_disk_quota fdq;
410 qops.set_dqblk(NULL, 0, 0, &fdq);
412 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
417 EXTRA_KCFLAGS="$tmp_flags"
420 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
421 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
422 [AC_MSG_CHECKING([if dquot_suspend is defined])
423 LB_LINUX_TRY_COMPILE([
424 #include <linux/quotaops.h>
426 dquot_suspend(NULL, -1);
428 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
436 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
437 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
438 AC_DEFUN([LC_HAVE_QUOTAIO_H],
439 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
440 AC_DEFINE(HAVE_QUOTAIO_H, 1,
441 [kernel has include/linux/quotaio_v2.h])
442 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
443 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
444 [kernel has fs/quotaio_v1.h])
445 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
446 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
447 [kernel has fs/quota/quotaio_v2.h])
457 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
458 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
459 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
460 LB_LINUX_TRY_COMPILE([
461 #include <linux/blkdev.h>
463 blk_queue_max_segments(NULL, 0);
466 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
467 [blk_queue_max_segments is defined])
476 # Check if kernel has been patched for 64-bit quota limits support.
477 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
478 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
479 # that in the absence of quotaio_v1.h in the kernel headers.
481 AC_DEFUN([LC_QUOTA64],[
482 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
483 tmp_flags="$EXTRA_KCFLAGS"
484 EXTRA_KCFLAGS="-I$LINUX/fs"
485 LB_LINUX_TRY_COMPILE([
486 #include <linux/kernel.h>
487 #include <linux/fs.h>
488 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
489 # include <quota/quotaio_v2.h>
490 struct v2r1_disk_dqblk dqblk_r1;
492 #include <linux/quota.h>
493 int ver = QFMT_VFS_V1;
496 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
499 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
500 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
504 EXTRA_KCFLAGS=$tmp_flags
508 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
510 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
511 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
512 LB_LINUX_TRY_COMPILE([
513 #include <asm/atomic.h>
514 #include <linux/spinlock.h>
515 #include <linux/fs_struct.h>
517 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
519 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
520 [fs_struct.lock use rwlock])
528 # 2.6.36 super_operations add evict_inode method. it hybird of
529 # delete_inode & clear_inode.
531 AC_DEFUN([LC_SBOPS_EVICT_INODE],
532 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
533 LB_LINUX_TRY_COMPILE([
534 #include <linux/fs.h>
536 ((struct super_operations *)0)->evict_inode(NULL);
538 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
539 [super_operations.evict_inode() is exist in kernel])
547 # 2.6.35 file_operations.fsync taken 2 arguments.
548 # 3.0.0 file_operations.fsync takes 4 arguments.
550 AC_DEFUN([LC_FILE_FSYNC],
551 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
552 LB_LINUX_TRY_COMPILE([
553 #include <linux/fs.h>
555 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
557 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
558 [file_operations.fsync takes 4 arguments])
559 AC_MSG_RESULT([yes, 4 args])
561 LB_LINUX_TRY_COMPILE([
562 #include <linux/fs.h>
564 ((struct file_operations *)0)->fsync(NULL, 0);
566 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
567 [file_operations.fsync takes 2 arguments])
568 AC_MSG_RESULT([yes, 2 args])
576 # 2.6.37 remove kernel_locked
578 AC_DEFUN([LC_KERNEL_LOCKED],
579 [AC_MSG_CHECKING([if kernel_locked is defined])
580 LB_LINUX_TRY_COMPILE([
581 #include <linux/smp_lock.h>
586 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
587 [kernel_locked is defined])
594 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
596 AC_DEFUN([LC_D_COMPARE_7ARGS],
597 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
598 LB_LINUX_TRY_COMPILE([
599 #include <linux/dcache.h>
601 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
603 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
604 [d_compare need 7 arguments])
612 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
614 AC_DEFUN([LC_D_DELETE_CONST],
615 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
616 tmp_flags="$EXTRA_KCFLAGS"
617 EXTRA_KCFLAGS="-Werror"
618 LB_LINUX_TRY_COMPILE([
619 #include <linux/dcache.h>
621 const struct dentry *d = NULL;
622 ((struct dentry_operations*)0)->d_delete(d);
624 AC_DEFINE(HAVE_D_DELETE_CONST, const,
625 [d_delete first parameter declared const])
628 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
631 EXTRA_KCFLAGS="$tmp_flags"
635 # 2.6.38 dcache_lock removed. rcu-walk commited.
637 AC_DEFUN([LC_DCACHE_LOCK],
638 [AC_MSG_CHECKING([if dcache_lock is exist])
639 LB_LINUX_TRY_COMPILE([
640 #include <linux/dcache.h>
642 spin_lock(&dcache_lock);
644 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
645 [dcache_lock is exist])
653 # 2.6.38 inode.i_rcu added.
655 AC_DEFUN([LC_INODE_I_RCU],
656 [AC_MSG_CHECKING([if inode.i_rcu exists])
657 LB_LINUX_TRY_COMPILE([
658 #include <linux/fs.h>
661 struct rcu_head rcu = {};
664 AC_DEFINE(HAVE_INODE_I_RCU, 1,
665 [inode.i_rcu exists])
673 # 2.6.38 export blkdev_get_by_dev
675 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
676 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
678 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
679 [blkdev_get_by_dev is exported by the kernel])
685 # 2.6.38 export simple_setattr
687 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
688 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
690 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
691 [simple_setattr is exported by the kernel])
697 # 2.6.39 remove unplug_fn from request_queue.
699 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
700 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
701 LB_LINUX_TRY_COMPILE([
702 #include <linux/blkdev.h>
704 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
706 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
707 [request_queue has unplug_fn field])
715 # 2.6.39 replace get_sb with mount in struct file_system_type
717 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
718 [AC_MSG_CHECKING([if file_system_type has mount field])
719 LB_LINUX_TRY_COMPILE([
720 #include <linux/fs.h>
722 struct file_system_type fst;
723 void *i = (void *) fst.mount;
725 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
726 [struct file_system_type has mount field])
734 # 3.0 dirty_inode() has a flag parameter
735 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
737 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
738 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
739 LB_LINUX_TRY_COMPILE([
740 #include <linux/fs.h>
743 inode->i_sb->s_op->dirty_inode(NULL, 0);
745 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
746 [dirty_inode super_operation takes flag])
754 # 2.6.38 generic_permission taken 4 parameters.
755 # in fact, it means rcu-walk aware permission bring.
757 # 3.1 generic_permission taken 2 parameters.
758 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
760 AC_DEFUN([LC_GENERIC_PERMISSION],
761 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
762 LB_LINUX_TRY_COMPILE([
763 #include <linux/fs.h>
765 generic_permission(NULL, 0);
767 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
768 [generic_permission taken 2 arguments])
769 AC_MSG_RESULT([yes, 2 args])
771 LB_LINUX_TRY_COMPILE([
772 #include <linux/fs.h>
774 generic_permission(NULL, 0, 0, NULL);
776 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
777 [generic_permission taken 4 arguments])
778 AC_MSG_RESULT([yes, 4 args])
786 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
787 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
789 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
790 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
791 LB_LINUX_TRY_COMPILE([
792 #include <linux/fs.h>
794 struct lock_manager_operations lm_ops;
795 lm_ops.lm_compare_owner = NULL;
797 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
798 [lock-manager ops renamed to lm_xxx])
806 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
807 # inode_dio_done instead.
808 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
810 AC_DEFUN([LC_INODE_DIO_WAIT],
811 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
812 LB_LINUX_TRY_COMPILE([
813 #include <linux/fs.h>
815 inode_dio_wait((struct inode *)0);
816 inode_dio_done((struct inode *)0);
818 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
819 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
827 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
828 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
830 AC_DEFUN([LC_IOP_GET_ACL],
831 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
832 LB_LINUX_TRY_COMPILE([
833 #include <linux/fs.h>
835 struct inode_operations iop;
838 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
839 [inode_operations has .get_acl member function])
847 # 3.1 introduced generic_file_llseek_size()
849 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
850 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
852 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
853 [generic_file_llseek_size is exported by the kernel])])
857 # 3.2 request_queue.make_request_fn defined as function returns with void
858 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
860 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
861 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
862 LB_LINUX_TRY_COMPILE([
863 #include <linux/blkdev.h>
866 make_request_fn *mrf;
867 ret = mrf(NULL, NULL);
871 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
872 [request_queue.make_request_fn returns void but not int])
878 # 3.2 protects inode->i_nlink from direct modification
879 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
880 # at the same time adds set_nlink(), so checks set_nlink() for it.
882 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
883 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
884 LB_LINUX_TRY_COMPILE([
885 #include <linux/fs.h>
890 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
891 [inode->i_nlink is protected from direct modification])
899 # 3.3 introduces migrate_mode.h and migratepage has 4 args
901 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
902 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
903 AC_DEFINE(HAVE_MIGRATE_H, 1,
904 [kernel has include/linux/migrate.h])
905 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
906 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
907 [kernel has include/linux/migrate_mode.h])
914 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
915 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
916 LB_LINUX_TRY_COMPILE([
917 #include <linux/fs.h>
918 #ifdef HAVE_MIGRATE_H
919 #include <linux/migrate.h>
920 #elif defined(HAVE_MIGRATE_MODE_H)
921 #include <linux/migrate_mode.h>
924 struct address_space_operations aops;
926 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
928 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
929 [address_space_operations.migratepage has 4 args])
937 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
938 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
940 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
941 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
942 tmp_flags="$EXTRA_KCFLAGS"
943 EXTRA_KCFLAGS="-Werror"
944 LB_LINUX_TRY_COMPILE([
945 #include <linux/fs.h>
946 int show_options(struct seq_file *seq, struct dentry *root){
950 struct super_operations ops;
951 ops.show_options = show_options;
953 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
954 [super_operations use dentry as parameter])
959 EXTRA_KCFLAGS="$tmp_flags"
963 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
964 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
966 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
967 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
968 tmp_flags="$EXTRA_KCFLAGS"
969 EXTRA_KCFLAGS="-Werror"
970 LB_LINUX_TRY_COMPILE([
971 #include <linux/fs.h>
972 #include <linux/types.h>
973 int my_mknod(struct inode *dir, struct dentry *dchild,
974 umode_t mode, dev_t dev)
979 struct inode_operations ops;
980 ops.mknod = my_mknod;
982 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
983 [inode_operations use umode_t as parameter])
988 EXTRA_KCFLAGS="$tmp_flags"
991 # 3.4 kmap_atomic removes second argument
992 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
994 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
995 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
996 LB_LINUX_TRY_COMPILE([
997 #include <linux/highmem.h>
1001 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1002 [have kmap_atomic has only 1 argument])
1003 AC_MSG_RESULT([yes])
1010 # 3.4 switchs touch_atime to struct path
1011 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1013 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1014 [AC_MSG_CHECKING([if touch_atime use one argument])
1015 LB_LINUX_TRY_COMPILE([
1016 #include <linux/fs.h>
1018 touch_atime((struct path *)NULL);
1020 AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1021 [touch_atime use one argument])
1022 AC_MSG_RESULT([yes])
1029 # 3.4 converts d_alloc_root to d_make_root
1030 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1032 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1033 [AC_MSG_CHECKING([if have d_make_root])
1034 LB_LINUX_TRY_COMPILE([
1035 #include <linux/fs.h>
1037 d_make_root((struct inode *)NULL);
1039 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1041 AC_MSG_RESULT([yes])
1048 # 3.5 renames end_writeback() back to clear_inode()...
1049 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1051 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1052 [AC_MSG_CHECKING([if have clear_inode])
1053 LB_LINUX_TRY_COMPILE([
1054 #include <linux/fs.h>
1056 clear_inode((struct inode *)NULL);
1058 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1060 AC_MSG_RESULT([yes])
1067 # 3.5 encode_fh has parent inode passed in directly
1068 # see kernel commit b0b0382b
1070 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1071 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1072 tmp_flags="$EXTRA_KCFLAGS"
1073 EXTRA_KCFLAGS="-Werror"
1074 LB_LINUX_TRY_COMPILE([
1075 #include <linux/exportfs.h>
1076 #include <linux/fs.h>
1077 #include <linux/types.h>
1078 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1083 struct export_operations exp_op;
1084 exp_op.encode_fh = ll_encode_fh;
1086 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1087 [have parent inode as parameter])
1088 AC_MSG_RESULT([yes])
1092 EXTRA_KCFLAGS="$tmp_flags"
1095 # 3.5 has generic_file_llseek_size with 5 args
1096 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1097 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1098 LB_LINUX_TRY_COMPILE([
1099 #include <linux/fs.h>
1101 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1103 AC_MSG_RESULT([yes])
1104 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1105 [kernel has generic_file_llseek_size with 5 args])
1112 # 3.6 switch i_dentry/d_alias from list to hlist
1114 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1115 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1116 tmp_flags="$EXTRA_KCFLAGS"
1117 EXTRA_KCFLAGS="-Werror"
1118 LB_LINUX_TRY_COMPILE([
1119 #include <linux/fs.h>
1120 #include <linux/list.h>
1123 struct dentry dentry;
1124 struct hlist_head head;
1125 struct hlist_node node;
1126 inode.i_dentry = head;
1127 dentry.d_alias = node;
1129 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1130 [have i_dentry/d_alias uses hlist])
1131 AC_MSG_RESULT([yes])
1135 EXTRA_KCFLAGS="$tmp_flags"
1139 # 3.6 dentry_open uses struct path as first argument
1140 # see kernel commit 765927b2
1142 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1143 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1144 tmp_flags="$EXTRA_KCFLAGS"
1145 EXTRA_KCFLAGS="-Werror"
1146 LB_LINUX_TRY_COMPILE([
1147 #include <linux/fs.h>
1148 #include <linux/path.h>
1151 dentry_open(&path, 0, NULL);
1153 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1154 [dentry_open uses struct path as first argument])
1155 AC_MSG_RESULT([yes])
1159 EXTRA_KCFLAGS="$tmp_flags"
1163 # 3.6 vfs adds iop->atomic_open
1165 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1166 [AC_MSG_CHECKING([if iop has atomic_open])
1167 LB_LINUX_TRY_COMPILE([
1168 #include <linux/fs.h>
1170 struct inode_operations iop;
1171 iop.atomic_open = NULL;
1173 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1174 [have iop atomic_open])
1175 AC_MSG_RESULT([yes])
1182 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1184 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1185 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1186 LB_LINUX_TRY_COMPILE([
1187 #include <linux/fs.h>
1188 #include <linux/posix_acl_xattr.h>
1190 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1192 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1193 [posix_acl_to_xattr takes struct user_namespace])
1194 AC_MSG_RESULT([yes])
1201 # 3.8 struct file has new memeber f_inode
1203 AC_DEFUN([LC_HAVE_FILE_F_INODE],
1204 [AC_MSG_CHECKING([if struct file has memeber f_inode])
1205 LB_LINUX_TRY_COMPILE([
1206 #include <linux/fs.h>
1208 ((struct file *)0)->f_inode = NULL;
1210 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1211 [struct file has memeber f_inode])
1212 AC_MSG_RESULT([yes])
1219 # 3.9 uses hlist_for_each_entry with 3 args
1220 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1222 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1223 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1224 LB_LINUX_TRY_COMPILE([
1225 #include <linux/list.h>
1226 #include <linux/fs.h>
1228 struct inode *inode;
1229 struct dentry *dentry;
1230 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1234 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1235 AC_MSG_RESULT([yes])
1242 # 3.9 killed f_vfsmnt by
1243 # 182be684784334598eee1d90274e7f7aa0063616
1244 # replacement is f_path.mnt
1246 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1247 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1248 LB_LINUX_TRY_COMPILE([
1249 #include <linux/fs.h>
1251 struct file *fp = NULL;
1254 path.mnt = fp->f_path.mnt;
1256 AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1257 AC_MSG_RESULT([yes])
1266 # Lustre linux kernel checks
1268 AC_DEFUN([LC_PROG_LINUX],
1272 LC_CONFIG_LIBLUSTRE_RECOVERY
1273 LC_CONFIG_HEALTH_CHECK_WRITE
1274 LC_CONFIG_LRU_RESIZE
1275 LC_LLITE_LLOOP_MODULE
1284 # 2.6.27.15-2 sles11
1288 LC_BLK_QUEUE_MAX_SEGMENTS
1291 LC_HAVE_DQUOT_FS_DISK_QUOTA
1292 LC_HAVE_DQUOT_SUSPEND
1296 LC_EXPORT_SIMPLE_SETATTR
1297 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1301 LC_SBOPS_EVICT_INODE
1307 LC_BLKDEV_GET_BY_DEV
1308 LC_GENERIC_PERMISSION
1315 LC_REQUEST_QUEUE_UNPLUG_FN
1316 LC_HAVE_FSTYPE_MOUNT
1319 LC_DIRTY_INODE_WITH_FLAG
1322 LC_LM_XXX_LOCK_MANAGER_OPS
1326 LC_INODE_PERMISION_2ARGS
1329 LC_HAVE_VOID_MAKE_REQUEST_FN
1330 LC_HAVE_PROTECT_I_NLINK
1333 LC_HAVE_MIGRATE_HEADER
1334 LC_MIGRATEPAGE_4ARGS
1335 LC_SUPEROPS_USE_DENTRY
1336 LC_INODEOPS_USE_UMODE_T
1341 LC_KMAP_ATOMIC_HAS_1ARG
1345 LC_HAVE_ENCODE_FH_PARENT
1346 LC_FILE_LLSEEK_SIZE_5ARG
1349 LC_HAVE_DENTRY_D_ALIAS_HLIST
1350 LC_DENTRY_OPEN_USE_PATH
1351 LC_HAVE_IOP_ATOMIC_OPEN
1354 LC_HAVE_POSIXACL_USER_NS
1357 LC_HAVE_FILE_F_INODE
1360 LC_HAVE_HLIST_FOR_EACH_3ARG
1364 if test x$enable_server != xno ; then
1365 LC_FUNC_DEV_SET_RDONLY
1375 # Check whether to build the client side of Lustre
1377 AC_DEFUN([LC_CONFIG_CLIENT],
1378 [AC_MSG_CHECKING([whether to build Lustre client support])
1379 AC_ARG_ENABLE([client],
1380 AC_HELP_STRING([--disable-client],
1381 [disable Lustre client support]),
1382 [],[enable_client='yes'])
1383 AC_MSG_RESULT([$enable_client])
1387 # LC_CONFIG_LIBLUSTRE
1389 # whether to build liblustre
1391 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1392 [AC_MSG_CHECKING([whether to build Lustre library])
1393 AC_ARG_ENABLE([liblustre],
1394 AC_HELP_STRING([--disable-liblustre],
1395 [disable building of Lustre library]),
1396 [],[enable_liblustre=$with_sysio])
1397 AC_MSG_RESULT([$enable_liblustre])
1398 # only build sysio if liblustre is built
1399 with_sysio="$enable_liblustre"
1401 AC_MSG_CHECKING([whether to build liblustre tests])
1402 AC_ARG_ENABLE([liblustre-tests],
1403 AC_HELP_STRING([--enable-liblustre-tests],
1404 [enable liblustre tests, if --disable-tests is used]),
1405 [],[enable_liblustre_tests=$enable_tests])
1406 if test x$enable_liblustre != xyes ; then
1407 enable_liblustre_tests='no'
1409 AC_MSG_RESULT([$enable_liblustre_tests])
1411 AC_MSG_CHECKING([whether to enable liblustre acl])
1412 AC_ARG_ENABLE([liblustre-acl],
1413 AC_HELP_STRING([--disable-liblustre-acl],
1414 [disable ACL support for liblustre]),
1415 [],[enable_liblustre_acl=yes])
1416 AC_MSG_RESULT([$enable_liblustre_acl])
1417 if test x$enable_liblustre_acl = xyes ; then
1418 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1424 AC_ARG_ENABLE(mpitests,
1425 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1426 [include mpi tests]),
1437 MPICC_WRAPPER=$enableval
1447 if test x$enable_mpitests != xno; then
1448 AC_MSG_CHECKING([whether mpitests can be built])
1456 MPI_Initialized(&flag);
1459 AC_MSG_RESULT([yes])
1466 AC_SUBST(MPICC_WRAPPER)
1468 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1469 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1472 LC_CONFIG_LIBLUSTRE_RECOVERY
1478 # whether to enable quota support global control
1480 AC_DEFUN([LC_CONFIG_QUOTA],
1481 [AC_ARG_ENABLE([quota],
1482 AC_HELP_STRING([--enable-quota],
1483 [enable quota support]),
1484 [],[enable_quota='yes'])
1487 AC_DEFUN([LC_QUOTA],
1491 if test x$enable_quota != xno -a x$enable_utils != xno; then
1492 AC_CHECK_HEADER(sys/quota.h,
1493 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1494 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1501 # whether to enable split support
1503 AC_DEFUN([LC_CONFIG_SPLIT],
1504 [AC_MSG_CHECKING([whether to enable split support])
1505 AC_ARG_ENABLE([split],
1506 AC_HELP_STRING([--enable-split],
1507 [enable split support]),
1508 [],[enable_split='no'])
1509 AC_MSG_RESULT([$enable_split])
1510 if test x$enable_split != xno; then
1511 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1516 # LC_LLITE_LLOOP_MODULE
1517 # lloop_llite.ko does not currently work with page sizes
1520 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1521 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1522 LB_LINUX_TRY_COMPILE([
1523 #include <asm/page.h>
1525 #if PAGE_SIZE >= 65536
1526 #error "PAGE_SIZE >= 65536"
1529 enable_llite_lloop_module='yes'
1530 AC_MSG_RESULT([yes])
1532 enable_llite_lloop_module='no'
1540 # configure support for optional OSD implementation
1542 AC_DEFUN([LC_OSD_ADDON],
1543 [AC_MSG_CHECKING([for osd])
1545 AC_HELP_STRING([--with-osd=path],
1546 [set path to optional osd]),
1549 no) ENABLEOSDADDON=0
1551 *) OSDADDON="${with_osd}"
1558 if test $ENABLEOSDADDON -eq 0; then
1562 OSDMODNAME=`basename $OSDADDON`
1563 if test -e $LUSTRE/$OSDMODNAME; then
1564 AC_MSG_RESULT([can't link])
1566 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1567 AC_MSG_RESULT([$OSDMODNAME])
1568 OSDADDON="subdir-m += $OSDMODNAME"
1570 AC_MSG_RESULT([can't link])
1580 # other configure checks
1582 AC_DEFUN([LC_CONFIGURE],
1583 [LC_CONFIG_OBD_BUFFER_SIZE
1585 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1586 CFLAGS="$CFLAGS -Werror"
1589 # maximum MDS thread count
1592 # include/liblustre.h
1593 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1595 # liblustre/llite_lib.h
1596 AC_CHECK_HEADERS([xtio.h file.h])
1599 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1602 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1603 AC_CHECK_FUNCS([inet_ntoa])
1605 # libsysio/src/readlink.c
1608 # libcfs prng.c - depends on linux/types.h from liblustre/dir.c
1609 AC_CHECK_HEADERS([linux/random.h], [], [],
1610 [#ifdef HAVE_LINUX_TYPES_H
1611 # include <linux/types.h>
1616 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1618 # check for -lz support
1622 [AC_CHECK_HEADERS([zlib.h],
1624 AC_DEFINE([HAVE_ADLER], 1,
1625 [support alder32 checksum type])],
1626 [AC_MSG_WARN([No zlib-devel package found,
1627 unable to use adler32 checksum])])],
1628 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1633 AC_CHECK_LIB([selinux],
1634 [is_selinux_enabled],
1635 [AC_CHECK_HEADERS([selinux.h],
1636 [SELINUX="-lselinux"
1637 AC_DEFINE([HAVE_SELINUX], 1,
1638 [support for selinux ])],
1639 [AC_MSG_WARN([No selinux-devel package found,
1640 unable to build selinux enabled
1642 [AC_MSG_WARN([No selinux package found, unable to build selinux
1648 AC_ARG_ENABLE([mindf],
1649 AC_HELP_STRING([--enable-mindf],
1650 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1652 if test "$enable_mindf" = "yes" ; then
1653 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1656 AC_ARG_ENABLE([fail_alloc],
1657 AC_HELP_STRING([--disable-fail-alloc],
1658 [disable randomly alloc failure]),
1659 [],[enable_fail_alloc=yes])
1660 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1661 AC_MSG_RESULT([$enable_fail_alloc])
1662 if test x$enable_fail_alloc != xno ; then
1663 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1666 AC_ARG_ENABLE([invariants],
1667 AC_HELP_STRING([--enable-invariants],
1668 [enable invariant checking (cpu intensive)]),
1670 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1671 AC_MSG_RESULT([$enable_invariants])
1672 if test x$enable_invariants = xyes ; then
1673 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1676 AC_ARG_ENABLE([lu_ref],
1677 AC_HELP_STRING([--enable-lu_ref],
1678 [enable lu_ref reference tracking code]),
1680 AC_MSG_CHECKING([whether to track references with lu_ref])
1681 AC_MSG_RESULT([$enable_lu_ref])
1682 if test x$enable_lu_ref = xyes ; then
1683 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1686 AC_ARG_ENABLE([pgstate-track],
1687 AC_HELP_STRING([--enable-pgstate-track],
1688 [enable page state tracking]),
1689 [enable_pgstat_track='yes'],[])
1690 AC_MSG_CHECKING([whether to enable page state tracking])
1691 AC_MSG_RESULT([$enable_pgstat_track])
1692 if test x$enable_pgstat_track = xyes ; then
1693 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1694 [enable page state tracking code])
1701 # AM_CONDITIONALS for lustre
1703 AC_DEFUN([LC_CONDITIONALS],
1704 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1705 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1706 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1707 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1708 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1709 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1710 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1711 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1712 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1713 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1714 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1715 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1716 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1722 # files that should be generated with AC_OUTPUT
1724 AC_DEFUN([LC_CONFIG_FILES],
1728 lustre/autoconf/Makefile
1729 lustre/conf/Makefile
1730 lustre/contrib/Makefile
1732 lustre/include/Makefile
1733 lustre/include/lustre_ver.h
1734 lustre/include/linux/Makefile
1735 lustre/include/darwin/Makefile
1736 lustre/include/lustre/Makefile
1737 lustre/kernel_patches/targets/2.6-rhel6.target
1738 lustre/kernel_patches/targets/2.6-rhel5.target
1739 lustre/kernel_patches/targets/2.6-sles11.target
1740 lustre/kernel_patches/targets/3.0-sles11.target
1741 lustre/kernel_patches/targets/3.0-sles11sp3.target
1742 lustre/kernel_patches/targets/2.6-fc11.target
1743 lustre/kernel_patches/targets/2.6-fc12.target
1744 lustre/kernel_patches/targets/2.6-fc15.target
1745 lustre/kernel_patches/targets/3.x-fc18.target
1746 lustre/ldlm/Makefile
1748 lustre/fid/autoMakefile
1749 lustre/liblustre/Makefile
1750 lustre/liblustre/tests/Makefile
1751 lustre/liblustre/tests/mpi/Makefile
1752 lustre/llite/Makefile
1753 lustre/llite/autoMakefile
1754 lustre/lclient/Makefile
1756 lustre/lov/autoMakefile
1758 lustre/mdc/autoMakefile
1760 lustre/lmv/autoMakefile
1761 lustre/lfsck/Makefile
1762 lustre/lfsck/autoMakefile
1764 lustre/mdt/autoMakefile
1766 lustre/mdd/autoMakefile
1768 lustre/fld/autoMakefile
1769 lustre/obdclass/Makefile
1770 lustre/obdclass/autoMakefile
1771 lustre/obdclass/linux/Makefile
1772 lustre/obdecho/Makefile
1773 lustre/obdecho/autoMakefile
1775 lustre/ofd/autoMakefile
1777 lustre/osc/autoMakefile
1779 lustre/ost/autoMakefile
1780 lustre/osd-ldiskfs/Makefile
1781 lustre/osd-ldiskfs/autoMakefile
1782 lustre/osd-zfs/Makefile
1783 lustre/osd-zfs/autoMakefile
1785 lustre/mgc/autoMakefile
1787 lustre/mgs/autoMakefile
1788 lustre/target/Makefile
1789 lustre/ptlrpc/Makefile
1790 lustre/ptlrpc/autoMakefile
1791 lustre/ptlrpc/gss/Makefile
1792 lustre/ptlrpc/gss/autoMakefile
1793 lustre/quota/Makefile
1794 lustre/quota/autoMakefile
1795 lustre/scripts/Makefile
1796 lustre/tests/Makefile
1797 lustre/tests/mpi/Makefile
1798 lustre/utils/Makefile
1799 lustre/utils/gss/Makefile
1801 lustre/osp/autoMakefile
1803 lustre/lod/autoMakefile
1804 lustre/obdclass/darwin/Makefile