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