Whamcloud - gitweb
LU-3490 kerberos: Enable GSSAPI support by default
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #
2 # LC_CONFIG_SRCDIR
3 #
4 # Wrapper for AC_CONFIG_SUBDIR
5 #
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
8 libcfs_is_module=yes
9 ldiskfs_is_ext4=yes
10 ])
11
12 #
13 # LC_PATH_DEFAULTS
14 #
15 # lustre specific paths
16 #
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
19 LUSTRE="$PWD/lustre"
20 AC_SUBST(LUSTRE)
21
22 # mount.lustre
23 rootsbindir='$(CROSS_PATH)/sbin'
24 AC_SUBST(rootsbindir)
25
26 demodir='$(docdir)/demo'
27 AC_SUBST(demodir)
28
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
31 ])
32
33 #
34 # LC_TARGET_SUPPORTED
35 #
36 # is the target os supported?
37 #
38 AC_DEFUN([LC_TARGET_SUPPORTED],
39 [case $target_os in
40         linux* | darwin*)
41 $1
42                 ;;
43         *)
44 $2
45                 ;;
46 esac
47 ])
48
49 #
50 # LC_CONFIG_OBD_BUFFER_SIZE
51 #
52 # the maximum buffer size of lctl ioctls
53 #
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)]),
59         [
60                 OBD_BUFFER_SIZE=$with_obd_buffer_size
61         ],[
62                 OBD_BUFFER_SIZE=8192
63         ])
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
66 ])
67
68 #
69 # LC_READLINK_SSIZE_T
70 #
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
73 AC_TRY_COMPILE([
74         #include <unistd.h>
75 ],[
76         ssize_t readlink(const char *, char *, size_t);
77 ],[
78         AC_MSG_RESULT([yes])
79         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
80 ],[
81         AC_MSG_RESULT([no])
82 ])
83 ])
84
85 #
86 # LC_FUNC_DEV_SET_RDONLY
87 #
88 # check whether dev_set_rdonly is exported.  This is needed until we
89 # have another mechanism to fence IO from the underlying device.
90 #
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])
95 ],[
96         AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
97 ])
98 ])
99
100 #
101 # Ensure stack size big than 8k in Lustre server (all kernels)
102 #
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>
107 ],[
108         #if THREAD_SIZE < 8192
109         #error "stack size < 8192"
110         #endif
111 ],[
112         AC_MSG_RESULT(yes)
113 ],[
114         AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
115 ])
116 ])
117
118 #
119 # Allow the user to set the MDS thread upper limit
120 #
121 AC_DEFUN([LC_MDS_MAX_THREADS],
122 [
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)]),
126         [
127                 MDS_THREAD_COUNT=$with_mds_max_threads
128                 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
129         ])
130 ])
131
132 #
133 # LC_CONFIG_PINGER
134 #
135 # the pinger is temporary, until we have the recovery node in place
136 #
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)
146 fi
147 ])
148
149 #
150 # LC_CONFIG_CHECKSUM
151 #
152 # do checksum of bulk data between client and OST
153 #
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)
163 fi
164 ])
165
166 #
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
168 #
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)
178 fi
179 ])
180
181 #
182 # LC_CONFIG_HEALTH_CHECK_WRITE
183 #
184 # Turn off the actual write to the disk
185 #
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)
195 fi
196 ])
197
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])
207 fi
208 ])
209
210 #
211 # Quota support. The kernel must support CONFIG_QUOTA.
212 #
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.])
216         ])
217 ])
218
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],
224                                  [mm/truncate.c],
225                                  [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226                                             [kernel export truncate_complete_page])])
227           LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
228                                  [mm/filemap.c],
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],
232                                  [mm/filemap.c],
233                                  [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234                                             [kernel export delete_from_page_cache])])
235          ])
236
237 #
238 # LC_CAPA_CRYPTO
239 #
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.])
243 ])
244 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
245         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
246 ])
247 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
248         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
249 ])
250 ])
251
252 #
253 # LC_CONFIG_RMTCLIENT
254 #
255 dnl FIXME
256 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
257 dnl FIXME
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.])
261 ])
262 ])
263
264 #
265 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
266 #
267 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
268 [AC_MSG_CHECKING([whether to enable gss keyring backend])
269  AC_ARG_ENABLE([gss_keyring],
270                [AC_HELP_STRING([--disable-gss-keyring],
271                                [disable gss keyring backend])],
272                [],[enable_gss_keyring='yes'])
273  AC_MSG_RESULT([$enable_gss_keyring])
274
275  if test x$enable_gss_keyring != xno; then
276         LB_LINUX_CONFIG_IM([KEYS],[],
277                            [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
278
279         AC_CHECK_LIB([keyutils], [keyctl_search], [],
280                      [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
281
282         AC_DEFINE([HAVE_GSS_KEYRING], [1],
283                   [Define this if you enable gss keyring backend])
284  fi
285 ])
286
287 AC_DEFUN([LC_CONFIG_SUNRPC],
288 [LB_LINUX_CONFIG_IM([SUNRPC],[],
289                     [if test x$sunrpc_required == xyes; then
290                          AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])
291                      fi])
292 ])
293
294 #
295 # LC_CONFIG_GSS (default disabled)
296 #
297 # Build gss and related tools of Lustre. Currently both kernel and user space
298 # parts are depend on linux platform.
299 #
300 AC_DEFUN([LC_CONFIG_GSS],
301 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
302  AC_ARG_ENABLE([gss],
303                [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
304                [],[enable_gss='auto'])
305  AC_MSG_RESULT([$enable_gss])
306
307  if test x$enable_gss != xno; then
308         LC_CONFIG_GSS_KEYRING
309         sunrpc_required=$enable_gss
310         LC_CONFIG_SUNRPC
311         sunrpc_required=no
312
313         AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
314
315         LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
316                            [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
317         LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
318                            [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
319         LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
320                            [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
321         LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
322                            [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
323
324         require_krb5=$enable_gss
325         AC_KERBEROS_V5
326         require_krb5=no
327
328         if test x$KRBDIR != x; then
329             AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
330                          [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
331                          [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
332                                        [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
333                                        [if test x$enable_gss == xyes; then
334                                             AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])
335                                         fi])],)
336             AC_SUBST(GSSAPI_LIBS)
337         fi
338  fi
339 ])
340
341 #2.6.18 + RHEL5 (fc6)
342
343 # raid5-zerocopy patch
344
345 #
346 # LC_PAGE_CONSTANT
347 #
348 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
349 # it support constant page, which means the page won't be modified during the
350 # IO.
351 #
352 AC_DEFUN([LC_PAGE_CONSTANT],
353 [AC_MSG_CHECKING([if kernel have PageConstant defined])
354 LB_LINUX_TRY_COMPILE([
355         #include <linux/mm.h>
356         #include <linux/page-flags.h>
357 ],[
358         #ifndef PG_constant
359         #error "Have no raid5 zcopy patch"
360         #endif
361 ],[
362         AC_MSG_RESULT(yes)
363         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
364 ],[
365         AC_MSG_RESULT(no);
366 ])
367 ])
368
369 # 2.6.24
370
371 # 2.6.24 has bio_endio with 2 args
372 AC_DEFUN([LC_BIO_ENDIO_2ARG],
373 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
374 LB_LINUX_TRY_COMPILE([
375         #include <linux/bio.h>
376 ],[
377         bio_endio(NULL, 0);
378 ], [
379         AC_MSG_RESULT([yes])
380         AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
381                 [kernel has bio_endio with 2 args])
382 ],[
383         AC_MSG_RESULT([no])
384 ])
385 ])
386
387 # 2.6.24 removes long aged procfs entry -> deleted member
388 AC_DEFUN([LC_PROCFS_DELETED],
389 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
390 LB_LINUX_TRY_COMPILE([
391         #include <linux/proc_fs.h>
392 ],[
393         struct proc_dir_entry pde;
394
395         pde.deleted = sizeof(pde);
396 ], [
397         AC_MSG_RESULT([yes])
398         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
399                 [kernel has deleted member in procfs entry struct])
400 ],[
401         AC_MSG_RESULT([no])
402 ])
403 ])
404
405 #
406 # 2.6.27
407 #
408
409 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
410 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
411 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
412 # v3.1 onward have a 2 arg version (inode, mask)
413 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
414 [AC_MSG_CHECKING([inode_operations->permission has two args])
415 LB_LINUX_TRY_COMPILE([
416         #include <linux/fs.h>
417 ],[
418         struct inode *inode __attribute__ ((unused));
419
420         inode = NULL;
421         inode->i_op->permission(NULL, 0);
422 ],[
423         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
424                   [inode_operations->permission has two args])
425         AC_MSG_RESULT([yes])
426 ],[
427         AC_MSG_RESULT([no])
428 ])
429 ])
430
431 # 2.6.27 use 5th parameter in quota_on for remount.
432 AC_DEFUN([LC_QUOTA_ON_5ARGS],
433 [AC_MSG_CHECKING([quota_on needs 5 parameters])
434 LB_LINUX_TRY_COMPILE([
435         #include <linux/fs.h>
436         #include <linux/quota.h>
437 ],[
438         struct quotactl_ops *qop = NULL;
439         qop->quota_on(NULL, 0, 0, NULL, 0);
440 ],[
441         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
442                 [quota_on needs 5 paramters])
443         AC_MSG_RESULT([yes])
444 ],[
445         AC_MSG_RESULT([no])
446 ])
447 ])
448
449 # 2.6.27 use 3th parameter in quota_off for remount.
450 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
451 [AC_MSG_CHECKING([quota_off needs 3 parameters])
452 LB_LINUX_TRY_COMPILE([
453         #include <linux/fs.h>
454         #include <linux/quota.h>
455 ],[
456         struct quotactl_ops *qop = NULL;
457         qop->quota_off(NULL, 0, 0);
458 ],[
459         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
460                 [quota_off needs 3 paramters])
461         AC_MSG_RESULT([yes])
462 ],[
463         AC_MSG_RESULT([no])
464 ])
465 ])
466
467 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
468 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
469 tmp_flags="$EXTRA_KCFLAGS"
470 EXTRA_KCFLAGS="-Werror"
471 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
472 LB_LINUX_TRY_COMPILE([
473         #include <linux/fs.h>
474         #include <linux/quota.h>
475 ],[
476         struct quotactl_ops qops = {};
477         struct fs_disk_quota fdq;
478         qops.set_dqblk(NULL, 0, 0, &fdq);
479 ],[
480         AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
481         AC_MSG_RESULT([yes])
482 ],[
483         AC_MSG_RESULT([no])
484 ])
485 EXTRA_KCFLAGS="$tmp_flags"
486 ])
487
488 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
489 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
490 [AC_MSG_CHECKING([if dquot_suspend is defined])
491 LB_LINUX_TRY_COMPILE([
492         #include <linux/quotaops.h>
493 ],[
494         dquot_suspend(NULL, -1);
495 ],[
496         AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
497         AC_MSG_RESULT([yes])
498 ],[
499         AC_MSG_RESULT([no])
500 ])
501 ])
502
503 # 2.6.27.15-2 sles11
504
505 # 2.6.27 sles11 remove the bi_hw_segments
506 AC_DEFUN([LC_BI_HW_SEGMENTS],
507 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
508 LB_LINUX_TRY_COMPILE([
509         #include <linux/bio.h>
510 ],[
511         struct bio io;
512         io.bi_hw_segments = sizeof(io);
513 ],[
514         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
515                 [struct bio has a bi_hw_segments field])
516         AC_MSG_RESULT([yes])
517 ],[
518         AC_MSG_RESULT([no])
519 ])
520 ])
521
522 #
523 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
524 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
525 AC_DEFUN([LC_HAVE_QUOTAIO_H],
526 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
527         AC_DEFINE(HAVE_QUOTAIO_H, 1,
528                 [kernel has include/linux/quotaio_v2.h])
529 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
530                AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
531                 [kernel has fs/quotaio_v1.h])
532 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
533                AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
534                 [kernel has fs/quota/quotaio_v2.h])
535 ],[
536         AC_MSG_RESULT([no])
537 ])
538 ])
539 ])
540 ])
541
542 # 2.6.32
543
544 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
545 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
546 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
547 LB_LINUX_TRY_COMPILE([
548         #include <linux/blkdev.h>
549 ],[
550         blk_queue_max_segments(NULL, 0);
551 ],[
552         AC_MSG_RESULT(yes)
553         AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
554                   [blk_queue_max_segments is defined])
555 ],[
556         AC_MSG_RESULT(no)
557 ])
558 ])
559
560 #
561 # LC_QUOTA64
562 #
563 # Check if kernel has been patched for 64-bit quota limits support.
564 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
565 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
566 # that in the absence of quotaio_v1.h in the kernel headers.
567 #
568 AC_DEFUN([LC_QUOTA64],[
569         AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
570 tmp_flags="$EXTRA_KCFLAGS"
571 EXTRA_KCFLAGS="-I$LINUX/fs"
572         LB_LINUX_TRY_COMPILE([
573                 #include <linux/kernel.h>
574                 #include <linux/fs.h>
575                 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
576                 # include <quota/quotaio_v2.h>
577                 struct v2r1_disk_dqblk dqblk_r1;
578                 #else
579                 #include <linux/quota.h>
580                 int ver = QFMT_VFS_V1;
581                 #endif
582         ],[],[
583                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
584                 AC_MSG_RESULT([yes])
585         ],[
586                 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
587                         AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
588                 ],[])
589                 AC_MSG_RESULT([no])
590         ])
591 EXTRA_KCFLAGS=$tmp_flags
592 ])
593
594 #
595 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
596 #
597 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
598 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
599 LB_LINUX_TRY_COMPILE([
600         #include <asm/atomic.h>
601         #include <linux/spinlock.h>
602         #include <linux/fs_struct.h>
603 ],[
604         ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
605 ],[
606         AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
607                   [fs_struct.lock use rwlock])
608         AC_MSG_RESULT([yes])
609 ],[
610         AC_MSG_RESULT([no])
611 ])
612 ])
613
614 #
615 # 2.6.36 super_operations add evict_inode method. it hybird of
616 # delete_inode & clear_inode.
617 #
618 AC_DEFUN([LC_SBOPS_EVICT_INODE],
619 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
620 LB_LINUX_TRY_COMPILE([
621         #include <linux/fs.h>
622 ],[
623         ((struct super_operations *)0)->evict_inode(NULL);
624 ],[
625         AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
626                 [super_operations.evict_inode() is exist in kernel])
627         AC_MSG_RESULT([yes])
628 ],[
629         AC_MSG_RESULT([no])
630 ])
631 ])
632
633 #
634 # 2.6.35 file_operations.fsync taken 2 arguments.
635 # 3.0.0 file_operations.fsync takes 4 arguments.
636 #
637 AC_DEFUN([LC_FILE_FSYNC],
638 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
639 LB_LINUX_TRY_COMPILE([
640         #include <linux/fs.h>
641 ],[
642         ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
643 ],[
644         AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
645                 [file_operations.fsync takes 4 arguments])
646         AC_MSG_RESULT([yes, 4 args])
647 ],[
648         LB_LINUX_TRY_COMPILE([
649                 #include <linux/fs.h>
650         ],[
651            ((struct file_operations *)0)->fsync(NULL, 0);
652         ],[
653                 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
654                         [file_operations.fsync takes 2 arguments])
655                 AC_MSG_RESULT([yes, 2 args])
656         ],[
657                 AC_MSG_RESULT([no])
658         ])
659 ])
660 ])
661
662 #
663 # 2.6.37 remove kernel_locked
664 #
665 AC_DEFUN([LC_KERNEL_LOCKED],
666 [AC_MSG_CHECKING([if kernel_locked is defined])
667 LB_LINUX_TRY_COMPILE([
668         #include <linux/smp_lock.h>
669 ],[
670         kernel_locked();
671 ],[
672         AC_MSG_RESULT([yes])
673         AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
674                 [kernel_locked is defined])
675 ],[
676         AC_MSG_RESULT([no])
677 ])
678 ])
679
680 #
681 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
682 #
683 AC_DEFUN([LC_D_COMPARE_7ARGS],
684 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
685 LB_LINUX_TRY_COMPILE([
686         #include <linux/dcache.h>
687 ],[
688         ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
689 ],[
690         AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
691                 [d_compare need 7 arguments])
692         AC_MSG_RESULT([yes])
693 ],[
694         AC_MSG_RESULT([no])
695 ])
696 ])
697
698 #
699 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
700 #
701 AC_DEFUN([LC_D_DELETE_CONST],
702 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
703 tmp_flags="$EXTRA_KCFLAGS"
704 EXTRA_KCFLAGS="-Werror"
705 LB_LINUX_TRY_COMPILE([
706         #include <linux/dcache.h>
707 ],[
708         const struct dentry *d = NULL;
709         ((struct dentry_operations*)0)->d_delete(d);
710 ],[
711         AC_DEFINE(HAVE_D_DELETE_CONST, const,
712                 [d_delete first parameter declared const])
713         AC_MSG_RESULT([yes])
714 ],[
715         AC_DEFINE(HAVE_D_DELETE_CONST, , [])
716         AC_MSG_RESULT([no])
717 ])
718 EXTRA_KCFLAGS="$tmp_flags"
719 ])
720
721 #
722 # 2.6.38 dcache_lock removed. rcu-walk commited.
723 #
724 AC_DEFUN([LC_DCACHE_LOCK],
725 [AC_MSG_CHECKING([if dcache_lock is exist])
726 LB_LINUX_TRY_COMPILE([
727         #include <linux/dcache.h>
728 ],[
729         spin_lock(&dcache_lock);
730 ],[
731         AC_DEFINE(HAVE_DCACHE_LOCK, 1,
732                 [dcache_lock is exist])
733         AC_MSG_RESULT([yes])
734 ],[
735         AC_MSG_RESULT([no])
736 ])
737 ])
738
739 #
740 # 2.6.38 inode.i_rcu added.
741 #
742 AC_DEFUN([LC_INODE_I_RCU],
743 [AC_MSG_CHECKING([if inode.i_rcu exists])
744 LB_LINUX_TRY_COMPILE([
745         #include <linux/fs.h>
746 ],[
747         struct inode ino;
748         struct rcu_head rcu = {};
749         ino.i_rcu = rcu;
750 ],[
751         AC_DEFINE(HAVE_INODE_I_RCU, 1,
752                 [inode.i_rcu exists])
753         AC_MSG_RESULT([yes])
754 ],[
755         AC_MSG_RESULT([no])
756 ])
757 ])
758
759 #
760 # 2.6.38 export blkdev_get_by_dev
761 #
762 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
763 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
764 [fs/block_dev.c],[
765 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
766             [blkdev_get_by_dev is exported by the kernel])
767 ],[
768 ])
769 ])
770
771 #
772 # 2.6.38 use path as 4th parameter in quota_on.
773 #
774 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
775 [AC_MSG_CHECKING([quota_on use path as parameter])
776 tmp_flags="$EXTRA_KCFLAGS"
777 EXTRA_KCFLAGS="-Werror"
778 LB_LINUX_TRY_COMPILE([
779         #include <linux/fs.h>
780         #include <linux/quota.h>
781 ],[
782         ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
783 ],[
784         AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
785                 [quota_on use path as 4th paramter])
786         AC_MSG_RESULT([yes])
787 ],[
788         AC_MSG_RESULT([no])
789 ])
790 EXTRA_KCFLAGS="$tmp_flags"
791 ])
792
793 #
794 # 2.6.38 export simple_setattr
795 #
796 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
797 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
798 [fs/libfs.c],[
799 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
800             [simple_setattr is exported by the kernel])
801 ],[
802 ])
803 ])
804
805 #
806 # 2.6.39 remove unplug_fn from request_queue.
807 #
808 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
809 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
810 LB_LINUX_TRY_COMPILE([
811         #include <linux/blkdev.h>
812 ],[
813         do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
814 ],[
815         AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
816                   [request_queue has unplug_fn field])
817         AC_MSG_RESULT([yes])
818 ],[
819         AC_MSG_RESULT([no])
820 ])
821 ])
822
823 #
824 # 2.6.39 replace get_sb with mount in struct file_system_type
825 #
826 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
827 [AC_MSG_CHECKING([if file_system_type has mount field])
828 LB_LINUX_TRY_COMPILE([
829         #include <linux/fs.h>
830 ],[
831         struct file_system_type fst;
832         void *i = (void *) fst.mount;
833 ],[
834         AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
835                 [struct file_system_type has mount field])
836         AC_MSG_RESULT([yes])
837 ],[
838         AC_MSG_RESULT([no])
839 ])
840 ])
841
842 #
843 # 3.0 dirty_inode() has a flag parameter
844 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
845 #
846 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
847 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
848 LB_LINUX_TRY_COMPILE([
849         #include <linux/fs.h>
850 ],[
851         struct inode *inode;
852         inode->i_sb->s_op->dirty_inode(NULL, 0);
853 ],[
854         AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
855                   [dirty_inode super_operation takes flag])
856         AC_MSG_RESULT([yes])
857 ],[
858         AC_MSG_RESULT([no])
859 ])
860 ])
861
862 #
863 # 2.6.38 generic_permission taken 4 parameters.
864 # in fact, it means rcu-walk aware permission bring.
865 #
866 # 3.1 generic_permission taken 2 parameters.
867 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
868 #
869 AC_DEFUN([LC_GENERIC_PERMISSION],
870 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
871 LB_LINUX_TRY_COMPILE([
872         #include <linux/fs.h>
873 ],[
874         generic_permission(NULL, 0);
875 ],[
876         AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
877                   [generic_permission taken 2 arguments])
878         AC_MSG_RESULT([yes, 2 args])
879 ],[
880         LB_LINUX_TRY_COMPILE([
881                 #include <linux/fs.h>
882         ],[
883                 generic_permission(NULL, 0, 0, NULL);
884         ],[
885                 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
886                           [generic_permission taken 4 arguments])
887                 AC_MSG_RESULT([yes, 4 args])
888         ],[
889                 AC_MSG_RESULT([no])
890         ])
891 ])
892 ])
893
894 #
895 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
896 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
897 #
898 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
899 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
900 LB_LINUX_TRY_COMPILE([
901         #include <linux/fs.h>
902 ],[
903         struct lock_manager_operations lm_ops;
904         lm_ops.lm_compare_owner = NULL;
905 ],[
906         AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
907                   [lock-manager ops renamed to lm_xxx])
908         AC_MSG_RESULT([yes])
909 ],[
910         AC_MSG_RESULT([no])
911 ])
912 ])
913
914 #
915 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
916 #     inode_dio_done instead.
917 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
918 #
919 AC_DEFUN([LC_INODE_DIO_WAIT],
920 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
921 LB_LINUX_TRY_COMPILE([
922         #include <linux/fs.h>
923 ],[
924         inode_dio_wait((struct inode *)0);
925         inode_dio_done((struct inode *)0);
926 ],[
927         AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
928                   [inode->i_alloc_sem is killed and use inode_dio_wait/done])
929         AC_MSG_RESULT([yes])
930 ],[
931         AC_MSG_RESULT([no])
932 ])
933 ])
934
935 #
936 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
937 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
938 #
939 AC_DEFUN([LC_IOP_GET_ACL],
940 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
941 LB_LINUX_TRY_COMPILE([
942         #include <linux/fs.h>
943 ],[
944         struct inode_operations iop;
945         iop.get_acl = NULL;
946 ],[
947         AC_DEFINE(HAVE_IOP_GET_ACL, 1,
948                   [inode_operations has .get_acl member function])
949         AC_MSG_RESULT([yes])
950 ],[
951         AC_MSG_RESULT([no])
952 ])
953 ])
954
955 #
956 # 3.1.1 has ext4_blocks_for_truncate
957 #
958 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
959 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
960 LB_LINUX_TRY_COMPILE([
961         #include <linux/fs.h>
962         #include "$LINUX/fs/ext4/ext4_jbd2.h"
963         #include "$LINUX/fs/ext4/truncate.h"
964 ],[
965         ext4_blocks_for_truncate(NULL);
966 ],[
967         AC_MSG_RESULT([yes])
968         AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
969                   [kernel has ext4_blocks_for_truncate])
970 ],[
971         AC_MSG_RESULT([no])
972 ])
973 ])
974
975 #
976 # 3.1 introduced generic_file_llseek_size()
977 #
978 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
979         [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
980         [fs/read_write.c],
981         [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
982                    [generic_file_llseek_size is exported by the kernel])])
983 ])
984
985 #
986 # 3.2 request_queue.make_request_fn defined as function returns with void
987 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
988 #
989 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
990 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
991 LB_LINUX_TRY_COMPILE([
992         #include <linux/blkdev.h>
993 ],[
994         int ret;
995         make_request_fn         *mrf;
996         ret = mrf(NULL, NULL);
997 ],[
998         AC_MSG_RESULT([no])
999 ],[
1000         AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
1001                   [request_queue.make_request_fn returns void but not int])
1002         AC_MSG_RESULT([yes])
1003 ])
1004 ])
1005
1006 #
1007 # 3.2 protects inode->i_nlink from direct modification
1008 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1009 # at the same time adds set_nlink(), so checks set_nlink() for it.
1010 #
1011 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1012 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1013 LB_LINUX_TRY_COMPILE([
1014         #include <linux/fs.h>
1015 ],[
1016         struct inode i;
1017         set_nlink(&i, 1);
1018 ],[
1019         AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1020                   [inode->i_nlink is protected from direct modification])
1021         AC_MSG_RESULT([yes])
1022 ],[
1023         AC_MSG_RESULT([no])
1024 ])
1025 ])
1026
1027 #
1028 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1029 #
1030 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1031 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1032                 AC_DEFINE(HAVE_MIGRATE_H, 1,
1033                 [kernel has include/linux/migrate.h])
1034 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1035                 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1036                         [kernel has include/linux/migrate_mode.h])
1037 ],[
1038         AC_MSG_RESULT([no])
1039 ])
1040 ])
1041 ])
1042
1043 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1044 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1045 LB_LINUX_TRY_COMPILE([
1046         #include <linux/fs.h>
1047 #ifdef HAVE_MIGRATE_H
1048         #include <linux/migrate.h>
1049 #elif defined(HAVE_MIGRATE_MODE_H)
1050         #include <linux/migrate_mode.h>
1051 #endif
1052 ],[
1053         struct address_space_operations aops;
1054
1055         aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1056 ],[
1057         AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1058                 [address_space_operations.migratepage has 4 args])
1059         AC_MSG_RESULT([yes])
1060 ],[
1061         AC_MSG_RESULT([no])
1062 ])
1063 ])
1064
1065 #
1066 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1067 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1068 #
1069 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1070 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1071 tmp_flags="$EXTRA_KCFLAGS"
1072 EXTRA_KCFLAGS="-Werror"
1073 LB_LINUX_TRY_COMPILE([
1074         #include <linux/fs.h>
1075         int show_options(struct seq_file *seq, struct dentry *root){
1076                 return 0;
1077         }
1078 ],[
1079         struct super_operations ops;
1080         ops.show_options = show_options;
1081 ],[
1082         AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1083                   [super_operations use dentry as parameter])
1084         AC_MSG_RESULT([yes])
1085 ],[
1086         AC_MSG_RESULT([no])
1087 ])
1088 EXTRA_KCFLAGS="$tmp_flags"
1089 ])
1090
1091 #
1092 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1093 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1094 #
1095 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1096 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1097 tmp_flags="$EXTRA_KCFLAGS"
1098 EXTRA_KCFLAGS="-Werror"
1099 LB_LINUX_TRY_COMPILE([
1100         #include <linux/fs.h>
1101         #include <linux/types.h>
1102         int my_mknod(struct inode *dir, struct dentry *dchild,
1103                      umode_t mode, dev_t dev)
1104         {
1105                 return 0;
1106         }
1107 ],[
1108         struct inode_operations ops;
1109         ops.mknod = my_mknod;
1110 ],[
1111         AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1112                   [inode_operations use umode_t as parameter])
1113         AC_MSG_RESULT([yes])
1114 ],[
1115         AC_MSG_RESULT([no])
1116 ])
1117 EXTRA_KCFLAGS="$tmp_flags"
1118 ])
1119
1120 # 3.4 kmap_atomic removes second argument
1121 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1122 #
1123 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1124 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1125 LB_LINUX_TRY_COMPILE([
1126         #include <linux/highmem.h>
1127 ],[
1128         kmap_atomic(NULL);
1129 ],[
1130         AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1131                   [have kmap_atomic has only 1 argument])
1132         AC_MSG_RESULT([yes])
1133 ],[
1134         AC_MSG_RESULT([no])
1135 ])
1136 ])
1137
1138 #
1139 # 3.4 switchs touch_atime to struct path
1140 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1141 #
1142 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1143 [AC_MSG_CHECKING([if touch_atime use one argument])
1144 LB_LINUX_TRY_COMPILE([
1145         #include <linux/fs.h>
1146 ],[
1147         touch_atime((struct path *)NULL);
1148 ],[
1149         AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1150                   [touch_atime use one argument])
1151         AC_MSG_RESULT([yes])
1152 ],[
1153         AC_MSG_RESULT([no])
1154 ])
1155 ])
1156
1157 #
1158 # 3.4 converts d_alloc_root to d_make_root
1159 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1160 #
1161 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1162 [AC_MSG_CHECKING([if have d_make_root])
1163 LB_LINUX_TRY_COMPILE([
1164         #include <linux/fs.h>
1165 ],[
1166         d_make_root((struct inode *)NULL);
1167 ],[
1168         AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1169                   [have d_make_root])
1170         AC_MSG_RESULT([yes])
1171 ],[
1172         AC_MSG_RESULT([no])
1173 ])
1174 ])
1175
1176 #
1177 # 3.5 renames end_writeback() back to clear_inode()...
1178 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1179 #
1180 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1181 [AC_MSG_CHECKING([if have clear_inode])
1182 LB_LINUX_TRY_COMPILE([
1183         #include <linux/fs.h>
1184 ],[
1185         clear_inode((struct inode *)NULL);
1186 ],[
1187         AC_DEFINE(HAVE_CLEAR_INODE, 1,
1188                   [have clear_inode])
1189         AC_MSG_RESULT([yes])
1190 ],[
1191         AC_MSG_RESULT([no])
1192 ])
1193 ])
1194
1195 #
1196 # 3.5 encode_fh has parent inode passed in directly
1197 # see kernel commit b0b0382b
1198 #
1199 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1200 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1201 tmp_flags="$EXTRA_KCFLAGS"
1202 EXTRA_KCFLAGS="-Werror"
1203 LB_LINUX_TRY_COMPILE([
1204         #include <linux/exportfs.h>
1205         #include <linux/fs.h>
1206         #include <linux/types.h>
1207         int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1208         {
1209                 return 0;
1210         }
1211 ],[
1212         struct export_operations exp_op;
1213         exp_op.encode_fh = ll_encode_fh;
1214 ],[
1215         AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1216                   [have parent inode as parameter])
1217         AC_MSG_RESULT([yes])
1218 ],[
1219         AC_MSG_RESULT([no])
1220 ])
1221 EXTRA_KCFLAGS="$tmp_flags"
1222 ])
1223
1224 # 3.5 has generic_file_llseek_size with 5 args
1225 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1226 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1227 LB_LINUX_TRY_COMPILE([
1228         #include <linux/fs.h>
1229 ],[
1230         generic_file_llseek_size(NULL, 0, 0, 0, 0);
1231 ], [
1232         AC_MSG_RESULT([yes])
1233         AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1234                 [kernel has generic_file_llseek_size with 5 args])
1235 ],[
1236         AC_MSG_RESULT([no])
1237 ])
1238 ])
1239
1240 #
1241 # 3.6 switch i_dentry/d_alias from list to hlist
1242 #
1243 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1244 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1245 tmp_flags="$EXTRA_KCFLAGS"
1246 EXTRA_KCFLAGS="-Werror"
1247 LB_LINUX_TRY_COMPILE([
1248         #include <linux/fs.h>
1249         #include <linux/list.h>
1250 ],[
1251         struct inode inode;
1252         struct dentry dentry;
1253         struct hlist_head head;
1254         struct hlist_node node;
1255         inode.i_dentry = head;
1256         dentry.d_alias = node;
1257 ],[
1258         AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1259                   [have i_dentry/d_alias uses hlist])
1260         AC_MSG_RESULT([yes])
1261 ],[
1262         AC_MSG_RESULT([no])
1263 ])
1264 EXTRA_KCFLAGS="$tmp_flags"
1265 ])
1266
1267 #
1268 # 3.6 dentry_open uses struct path as first argument
1269 # see kernel commit 765927b2
1270 #
1271 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1272 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1273 tmp_flags="$EXTRA_KCFLAGS"
1274 EXTRA_KCFLAGS="-Werror"
1275 LB_LINUX_TRY_COMPILE([
1276         #include <linux/fs.h>
1277         #include <linux/path.h>
1278 ],[
1279         struct path path;
1280         dentry_open(&path, 0, NULL);
1281 ],[
1282         AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1283                   [dentry_open uses struct path as first argument])
1284         AC_MSG_RESULT([yes])
1285 ],[
1286         AC_MSG_RESULT([no])
1287 ])
1288 EXTRA_KCFLAGS="$tmp_flags"
1289 ])
1290
1291 #
1292 # 3.6 vfs adds iop->atomic_open
1293 #
1294 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1295 [AC_MSG_CHECKING([if iop has atomic_open])
1296 LB_LINUX_TRY_COMPILE([
1297         #include <linux/fs.h>
1298 ],[
1299         struct inode_operations iop;
1300         iop.atomic_open = NULL;
1301 ],[
1302         AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1303                   [have iop atomic_open])
1304         AC_MSG_RESULT([yes])
1305 ],[
1306         AC_MSG_RESULT([no])
1307 ])
1308 ])
1309
1310 #
1311 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1312 #
1313 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1314 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1315 LB_LINUX_TRY_COMPILE([
1316         #include <linux/fs.h>
1317         #include <linux/posix_acl_xattr.h>
1318 ],[
1319         posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1320 ],[
1321         AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1322                   [posix_acl_to_xattr takes struct user_namespace])
1323         AC_MSG_RESULT([yes])
1324 ],[
1325         AC_MSG_RESULT([no])
1326 ])
1327 ])
1328
1329 #
1330 # 3.9 uses hlist_for_each_entry with 3 args
1331 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1332 #
1333 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1334 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1335 LB_LINUX_TRY_COMPILE([
1336         #include <linux/list.h>
1337         #include <linux/fs.h>
1338 ],[
1339         struct inode *inode;
1340         struct dentry *dentry;
1341         hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1342                 continue;
1343         }
1344 ],[
1345         AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1346         AC_MSG_RESULT([yes])
1347 ],[
1348         AC_MSG_RESULT([no])
1349 ])
1350 ])
1351
1352 #
1353 # 3.9 killed f_vfsmnt by
1354 # 182be684784334598eee1d90274e7f7aa0063616
1355 # replacement is f_path.mnt
1356 #
1357 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1358 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1359 LB_LINUX_TRY_COMPILE([
1360         #include <linux/fs.h>
1361 ],[
1362         struct file *fp = NULL;
1363         struct path  path;
1364
1365         path.mnt = fp->f_path.mnt;
1366 ],[
1367         AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1368         AC_MSG_RESULT([yes])
1369 ],[
1370         AC_MSG_RESULT([no])
1371 ])
1372 ])
1373
1374 #
1375 # LC_PROG_LINUX
1376 #
1377 # Lustre linux kernel checks
1378 #
1379 AC_DEFUN([LC_PROG_LINUX],
1380          [
1381          LC_CONFIG_PINGER
1382          LC_CONFIG_CHECKSUM
1383          LC_CONFIG_LIBLUSTRE_RECOVERY
1384          LC_CONFIG_HEALTH_CHECK_WRITE
1385          LC_CONFIG_LRU_RESIZE
1386          LC_LLITE_LLOOP_MODULE
1387
1388          LC_CAPA_CRYPTO
1389          LC_CONFIG_RMTCLIENT
1390          LC_CONFIG_GSS
1391
1392          # raid5-zerocopy patch
1393          LC_PAGE_CONSTANT
1394
1395          # 2.6.24
1396          LC_BIO_ENDIO_2ARG
1397          LC_PROCFS_DELETED
1398
1399          # 2.6.27
1400          LC_QUOTA_ON_5ARGS
1401          LC_QUOTA_OFF_3ARGS
1402
1403          # 2.6.27.15-2 sles11
1404          LC_BI_HW_SEGMENTS
1405          LC_HAVE_QUOTAIO_H
1406
1407          # 2.6.32
1408          LC_BLK_QUEUE_MAX_SEGMENTS
1409
1410          # 2.6.34
1411          LC_HAVE_DQUOT_FS_DISK_QUOTA
1412          LC_HAVE_DQUOT_SUSPEND
1413
1414          # 2.6.35, 3.0.0
1415          LC_FILE_FSYNC
1416          LC_EXPORT_SIMPLE_SETATTR
1417          LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1418
1419          # 2.6.36
1420          LC_FS_STRUCT_RWLOCK
1421          LC_SBOPS_EVICT_INODE
1422
1423          # 2.6.37
1424          LC_KERNEL_LOCKED
1425
1426          # 2.6.38
1427          LC_BLKDEV_GET_BY_DEV
1428          LC_GENERIC_PERMISSION
1429          LC_QUOTA_ON_USE_PATH
1430          LC_DCACHE_LOCK
1431          LC_INODE_I_RCU
1432          LC_D_COMPARE_7ARGS
1433          LC_D_DELETE_CONST
1434
1435          # 2.6.39
1436          LC_REQUEST_QUEUE_UNPLUG_FN
1437          LC_HAVE_FSTYPE_MOUNT
1438
1439          # 3.0
1440          LC_DIRTY_INODE_WITH_FLAG
1441
1442          # 3.1
1443          LC_LM_XXX_LOCK_MANAGER_OPS
1444          LC_INODE_DIO_WAIT
1445          LC_IOP_GET_ACL
1446          LC_FILE_LLSEEK_SIZE
1447          LC_INODE_PERMISION_2ARGS
1448
1449          # 3.1.1
1450          LC_BLOCKS_FOR_TRUNCATE
1451
1452          # 3.2
1453          LC_HAVE_VOID_MAKE_REQUEST_FN
1454          LC_HAVE_PROTECT_I_NLINK
1455
1456          # 3.3
1457          LC_HAVE_MIGRATE_HEADER
1458          LC_MIGRATEPAGE_4ARGS
1459          LC_SUPEROPS_USE_DENTRY
1460          LC_INODEOPS_USE_UMODE_T
1461
1462          # 3.4
1463          LC_TOUCH_ATIME_1ARG
1464          LC_HAVE_D_MAKE_ROOT
1465          LC_KMAP_ATOMIC_HAS_1ARG
1466
1467          # 3.5
1468          LC_HAVE_CLEAR_INODE
1469          LC_HAVE_ENCODE_FH_PARENT
1470          LC_FILE_LLSEEK_SIZE_5ARG
1471
1472          # 3.6
1473          LC_HAVE_DENTRY_D_ALIAS_HLIST
1474          LC_DENTRY_OPEN_USE_PATH
1475          LC_HAVE_IOP_ATOMIC_OPEN
1476
1477          # 3.7
1478          LC_HAVE_POSIXACL_USER_NS
1479
1480          # 3.9
1481          LC_HAVE_HLIST_FOR_EACH_3ARG
1482          LC_HAVE_F_PATH_MNT
1483
1484          #
1485          if test x$enable_server = xyes ; then
1486                 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1487                 LC_FUNC_DEV_SET_RDONLY
1488                 LC_STACK_SIZE
1489                 LC_QUOTA64
1490                 LC_QUOTA_CONFIG
1491          fi
1492 ])
1493
1494 #
1495 # LC_CONFIG_CLIENT_SERVER
1496 #
1497 # Build client/server sides of Lustre
1498 #
1499 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1500 [AC_MSG_CHECKING([whether to build Lustre server support])
1501 AC_ARG_ENABLE([server],
1502         AC_HELP_STRING([--disable-server],
1503                         [disable Lustre server support]),
1504         [],[enable_server='yes'])
1505 AC_MSG_RESULT([$enable_server])
1506
1507 AC_MSG_CHECKING([whether to build Lustre client support])
1508 AC_ARG_ENABLE([client],
1509         AC_HELP_STRING([--disable-client],
1510                         [disable Lustre client support]),
1511         [],[enable_client='yes'])
1512 AC_MSG_RESULT([$enable_client])])
1513
1514 #
1515 # LC_CONFIG_LIBLUSTRE
1516 #
1517 # whether to build liblustre
1518 #
1519 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1520 [AC_MSG_CHECKING([whether to build Lustre library])
1521 AC_ARG_ENABLE([liblustre],
1522         AC_HELP_STRING([--disable-liblustre],
1523                         [disable building of Lustre library]),
1524         [],[enable_liblustre=$with_sysio])
1525 AC_MSG_RESULT([$enable_liblustre])
1526 # only build sysio if liblustre is built
1527 with_sysio="$enable_liblustre"
1528
1529 AC_MSG_CHECKING([whether to build liblustre tests])
1530 AC_ARG_ENABLE([liblustre-tests],
1531         AC_HELP_STRING([--enable-liblustre-tests],
1532                         [enable liblustre tests, if --disable-tests is used]),
1533         [],[enable_liblustre_tests=$enable_tests])
1534 if test x$enable_liblustre != xyes ; then
1535    enable_liblustre_tests='no'
1536 fi
1537 AC_MSG_RESULT([$enable_liblustre_tests])
1538
1539 AC_MSG_CHECKING([whether to enable liblustre acl])
1540 AC_ARG_ENABLE([liblustre-acl],
1541         AC_HELP_STRING([--disable-liblustre-acl],
1542                         [disable ACL support for liblustre]),
1543         [],[enable_liblustre_acl=yes])
1544 AC_MSG_RESULT([$enable_liblustre_acl])
1545 if test x$enable_liblustre_acl = xyes ; then
1546   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1547 fi
1548
1549 #
1550 # --enable-mpitest
1551 #
1552 AC_ARG_ENABLE(mpitests,
1553         AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1554                            [include mpi tests]),
1555         [
1556          enable_mpitests=yes
1557          case $enableval in
1558          yes)
1559                 MPICC_WRAPPER=mpicc
1560                 ;;
1561          no)
1562                 enable_mpitests=no
1563                 ;;
1564          *)
1565                 MPICC_WRAPPER=$enableval
1566                  ;;
1567          esac
1568         ],
1569         [
1570         MPICC_WRAPPER=mpicc
1571         enable_mpitests=yes
1572         ]
1573 )
1574
1575 if test x$enable_mpitests != xno; then
1576         AC_MSG_CHECKING([whether mpitests can be built])
1577         oldcc=$CC
1578         CC=$MPICC_WRAPPER
1579         AC_LINK_IFELSE(
1580             [AC_LANG_PROGRAM([[
1581                     #include <mpi.h>
1582                 ]],[[
1583                     int flag;
1584                     MPI_Initialized(&flag);
1585                 ]])],
1586             [
1587                     AC_MSG_RESULT([yes])
1588             ],[
1589                     AC_MSG_RESULT([no])
1590                     enable_mpitests=no
1591         ])
1592         CC=$oldcc
1593 fi
1594 AC_SUBST(MPICC_WRAPPER)
1595
1596 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1597 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1598
1599 LC_CONFIG_PINGER
1600 LC_CONFIG_LIBLUSTRE_RECOVERY
1601 ])
1602
1603 #
1604 # LC_CONFIG_QUOTA
1605 #
1606 # whether to enable quota support global control
1607 #
1608 AC_DEFUN([LC_CONFIG_QUOTA],
1609 [AC_ARG_ENABLE([quota],
1610         AC_HELP_STRING([--enable-quota],
1611                         [enable quota support]),
1612         [],[enable_quota='yes'])
1613 ])
1614
1615 AC_DEFUN([LC_QUOTA],
1616 [#check global
1617 LC_CONFIG_QUOTA
1618 #check for utils
1619 AC_CHECK_HEADER(sys/quota.h,
1620                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1621                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1622 ])
1623
1624 #
1625 # LC_CONFIG_SPLIT
1626 #
1627 # whether to enable split support
1628 #
1629 AC_DEFUN([LC_CONFIG_SPLIT],
1630 [AC_MSG_CHECKING([whether to enable split support])
1631 AC_ARG_ENABLE([split],
1632         AC_HELP_STRING([--enable-split],
1633                         [enable split support]),
1634         [],[enable_split='no'])
1635 AC_MSG_RESULT([$enable_split])
1636 if test x$enable_split != xno; then
1637    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1638 fi
1639 ])
1640
1641 #
1642 # LC_LLITE_LLOOP_MODULE
1643 # lloop_llite.ko does not currently work with page sizes
1644 # of 64k or larger.
1645 #
1646 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1647 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1648 LB_LINUX_TRY_COMPILE([
1649         #include <asm/page.h>
1650 ],[
1651         #if PAGE_SIZE >= 65536
1652         #error "PAGE_SIZE >= 65536"
1653         #endif
1654 ],[
1655         enable_llite_lloop_module='yes'
1656         AC_MSG_RESULT([yes])
1657 ],[
1658         enable_llite_lloop_module='no'
1659         AC_MSG_RESULT([no])
1660 ])
1661 ])
1662
1663 #
1664 # LC_OSD_ADDON
1665 #
1666 # configure support for optional OSD implementation
1667 #
1668 AC_DEFUN([LC_OSD_ADDON],
1669 [AC_MSG_CHECKING([for osd])
1670 AC_ARG_WITH([osd],
1671         AC_HELP_STRING([--with-osd=path],
1672                        [set path to optional osd]),
1673         [
1674                 case $with_osd in
1675                         no)     ENABLEOSDADDON=0
1676                                 ;;
1677                         *)      OSDADDON="${with_osd}"
1678                                 ENABLEOSDADDON=1
1679                                 ;;
1680                 esac
1681         ], [
1682                 ENABLEOSDADDON=0
1683         ])
1684 if test $ENABLEOSDADDON -eq 0; then
1685         AC_MSG_RESULT([no])
1686         OSDADDON=
1687 else
1688         OSDMODNAME=`basename $OSDADDON`
1689         if test -e $LUSTRE/$OSDMODNAME; then
1690                 AC_MSG_RESULT([can't link])
1691                 OSDADDON=
1692         elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1693                 AC_MSG_RESULT([$OSDMODNAME])
1694                 OSDADDON="subdir-m += $OSDMODNAME"
1695         else
1696                 AC_MSG_RESULT([can't link])
1697                 OSDADDON=
1698         fi
1699 fi
1700 AC_SUBST(OSDADDON)
1701 ])
1702
1703 #
1704 # LC_CONFIGURE
1705 #
1706 # other configure checks
1707 #
1708 AC_DEFUN([LC_CONFIGURE],
1709 [LC_CONFIG_OBD_BUFFER_SIZE
1710
1711 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1712         CFLAGS="$CFLAGS -Werror"
1713 fi
1714
1715 # maximum MDS thread count
1716 LC_MDS_MAX_THREADS
1717
1718 # include/liblustre.h
1719 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1720
1721 # liblustre/llite_lib.h
1722 AC_CHECK_HEADERS([xtio.h file.h])
1723
1724 # liblustre/dir.c
1725 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1726
1727 # liblustre/lutil.c
1728 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1729 AC_CHECK_FUNCS([inet_ntoa])
1730
1731 # libsysio/src/readlink.c
1732 LC_READLINK_SSIZE_T
1733
1734 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1735 AC_CHECK_HEADERS([linux/random.h], [], [],
1736                  [#ifdef HAVE_LINUX_TYPES_H
1737                   # include <linux/types.h>
1738                   #endif
1739                  ])
1740
1741 # utils/llverfs.c
1742 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1743
1744 # check for -lz support
1745 ZLIB=""
1746 AC_CHECK_LIB([z],
1747              [adler32],
1748              [AC_CHECK_HEADERS([zlib.h],
1749                                [ZLIB="-lz"
1750                                 AC_DEFINE([HAVE_ADLER], 1,
1751                                           [support alder32 checksum type])],
1752                                [AC_MSG_WARN([No zlib-devel package found,
1753                                              unable to use adler32 checksum])])],
1754              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1755 )
1756 AC_SUBST(ZLIB)
1757
1758 SELINUX=""
1759 AC_CHECK_LIB([selinux],
1760                 [is_selinux_enabled],
1761                 [AC_CHECK_HEADERS([selinux.h],
1762                                 [SELINUX="-lselinux"
1763                                 AC_DEFINE([HAVE_SELINUX], 1,
1764                                                 [support for selinux ])],
1765                                 [AC_MSG_WARN([No selinux-devel package found,
1766                                                 unable to build selinux enabled
1767                                                 tools])])],
1768                 [AC_MSG_WARN([No selinux package found, unable to build selinux
1769                                 enabled tools])]
1770 )
1771 AC_SUBST(SELINUX)
1772
1773 # Super safe df
1774 AC_ARG_ENABLE([mindf],
1775       AC_HELP_STRING([--enable-mindf],
1776                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1777       [],[])
1778 if test "$enable_mindf" = "yes" ;  then
1779       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1780 fi
1781
1782 AC_ARG_ENABLE([fail_alloc],
1783         AC_HELP_STRING([--disable-fail-alloc],
1784                 [disable randomly alloc failure]),
1785         [],[enable_fail_alloc=yes])
1786 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1787 AC_MSG_RESULT([$enable_fail_alloc])
1788 if test x$enable_fail_alloc != xno ; then
1789         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1790 fi
1791
1792 AC_ARG_ENABLE([invariants],
1793         AC_HELP_STRING([--enable-invariants],
1794                 [enable invariant checking (cpu intensive)]),
1795         [],[])
1796 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1797 AC_MSG_RESULT([$enable_invariants])
1798 if test x$enable_invariants = xyes ; then
1799         AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1800 fi
1801
1802 AC_ARG_ENABLE([lu_ref],
1803         AC_HELP_STRING([--enable-lu_ref],
1804                 [enable lu_ref reference tracking code]),
1805         [],[])
1806 AC_MSG_CHECKING([whether to track references with lu_ref])
1807 AC_MSG_RESULT([$enable_lu_ref])
1808 if test x$enable_lu_ref = xyes ; then
1809         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1810 fi
1811
1812 AC_ARG_ENABLE([pgstate-track],
1813               AC_HELP_STRING([--enable-pgstate-track],
1814                              [enable page state tracking]),
1815               [enable_pgstat_track='yes'],[])
1816 AC_MSG_CHECKING([whether to enable page state tracking])
1817 AC_MSG_RESULT([$enable_pgstat_track])
1818 if test x$enable_pgstat_track = xyes ; then
1819         AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1820                   [enable page state tracking code])
1821 fi
1822 ])
1823
1824 #
1825 # LC_CONDITIONALS
1826 #
1827 # AM_CONDITIONALS for lustre
1828 #
1829 AC_DEFUN([LC_CONDITIONALS],
1830 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1831 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1832 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1833 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1834 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1835 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1836 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1837 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1838 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1839 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1840 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1841 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1842 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1843 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1844 ])
1845
1846 #
1847 # LC_CONFIG_FILES
1848 #
1849 # files that should be generated with AC_OUTPUT
1850 #
1851 AC_DEFUN([LC_CONFIG_FILES],
1852 [AC_CONFIG_FILES([
1853 lustre/Makefile
1854 lustre/autoMakefile
1855 lustre/autoconf/Makefile
1856 lustre/conf/Makefile
1857 lustre/contrib/Makefile
1858 lustre/doc/Makefile
1859 lustre/include/Makefile
1860 lustre/include/lustre_ver.h
1861 lustre/include/linux/Makefile
1862 lustre/include/darwin/Makefile
1863 lustre/include/lustre/Makefile
1864 lustre/kernel_patches/targets/2.6-rhel6.target
1865 lustre/kernel_patches/targets/2.6-rhel5.target
1866 lustre/kernel_patches/targets/2.6-sles11.target
1867 lustre/kernel_patches/targets/3.0-sles11.target
1868 lustre/kernel_patches/targets/2.6-fc11.target
1869 lustre/kernel_patches/targets/2.6-fc12.target
1870 lustre/kernel_patches/targets/2.6-fc15.target
1871 lustre/kernel_patches/targets/3.x-fc18.target
1872 lustre/ldlm/Makefile
1873 lustre/fid/Makefile
1874 lustre/fid/autoMakefile
1875 lustre/liblustre/Makefile
1876 lustre/liblustre/tests/Makefile
1877 lustre/liblustre/tests/mpi/Makefile
1878 lustre/llite/Makefile
1879 lustre/llite/autoMakefile
1880 lustre/lclient/Makefile
1881 lustre/lov/Makefile
1882 lustre/lov/autoMakefile
1883 lustre/lvfs/Makefile
1884 lustre/lvfs/autoMakefile
1885 lustre/mdc/Makefile
1886 lustre/mdc/autoMakefile
1887 lustre/lmv/Makefile
1888 lustre/lmv/autoMakefile
1889 lustre/lfsck/Makefile
1890 lustre/lfsck/autoMakefile
1891 lustre/mdt/Makefile
1892 lustre/mdt/autoMakefile
1893 lustre/mdd/Makefile
1894 lustre/mdd/autoMakefile
1895 lustre/fld/Makefile
1896 lustre/fld/autoMakefile
1897 lustre/obdclass/Makefile
1898 lustre/obdclass/autoMakefile
1899 lustre/obdclass/linux/Makefile
1900 lustre/obdecho/Makefile
1901 lustre/obdecho/autoMakefile
1902 lustre/ofd/Makefile
1903 lustre/ofd/autoMakefile
1904 lustre/osc/Makefile
1905 lustre/osc/autoMakefile
1906 lustre/ost/Makefile
1907 lustre/ost/autoMakefile
1908 lustre/osd-ldiskfs/Makefile
1909 lustre/osd-ldiskfs/autoMakefile
1910 lustre/osd-zfs/Makefile
1911 lustre/osd-zfs/autoMakefile
1912 lustre/mgc/Makefile
1913 lustre/mgc/autoMakefile
1914 lustre/mgs/Makefile
1915 lustre/mgs/autoMakefile
1916 lustre/target/Makefile
1917 lustre/ptlrpc/Makefile
1918 lustre/ptlrpc/autoMakefile
1919 lustre/ptlrpc/gss/Makefile
1920 lustre/ptlrpc/gss/autoMakefile
1921 lustre/quota/Makefile
1922 lustre/quota/autoMakefile
1923 lustre/scripts/Makefile
1924 lustre/tests/Makefile
1925 lustre/tests/mpi/Makefile
1926 lustre/utils/Makefile
1927 lustre/utils/gss/Makefile
1928 lustre/osp/Makefile
1929 lustre/osp/autoMakefile
1930 lustre/lod/Makefile
1931 lustre/lod/autoMakefile
1932 lustre/obdclass/darwin/Makefile
1933 ])
1934 ])