Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 #* vim:expandtab:shiftwidth=8:tabstop=8:
3 #
4 # LC_CONFIG_SRCDIR
5 #
6 # Wrapper for AC_CONFIG_SUBDIR
7 #
8 AC_DEFUN([LC_CONFIG_SRCDIR],
9 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
10 libcfs_is_module=yes
11 ])
12
13 #
14 # LC_PATH_DEFAULTS
15 #
16 # lustre specific paths
17 #
18 AC_DEFUN([LC_PATH_DEFAULTS],
19 [# ptlrpc kernel build requires this
20 LUSTRE="$PWD/lustre"
21 AC_SUBST(LUSTRE)
22
23 # mount.lustre
24 rootsbindir='/sbin'
25 AC_SUBST(rootsbindir)
26
27 demodir='$(docdir)/demo'
28 AC_SUBST(demodir)
29
30 pkgexampledir='${pkgdatadir}/examples'
31 AC_SUBST(pkgexampledir)
32 ])
33
34 #
35 # LC_TARGET_SUPPORTED
36 #
37 # is the target os supported?
38 #
39 AC_DEFUN([LC_TARGET_SUPPORTED],
40 [case $target_os in
41         linux* | darwin*)
42 $1
43                 ;;
44         *)
45 $2
46                 ;;
47 esac
48 ])
49
50 #
51 # LC_CONFIG_EXT3
52 #
53 # that ext3 is enabled in the kernel
54 #
55 AC_DEFUN([LC_CONFIG_EXT3],
56 [LB_LINUX_CONFIG([EXT3_FS],[],[
57         LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
58 ])
59 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
60 ])
61
62 #
63 # LC_FSHOOKS
64 #
65 # If we have (and can build) fshooks.h
66 #
67 AC_DEFUN([LC_FSHOOKS],
68 [LB_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
69         AC_MSG_CHECKING([if fshooks.h can be compiled])
70         LB_LINUX_TRY_COMPILE([
71                 #include <linux/fshooks.h>
72         ],[],[
73                 AC_MSG_RESULT([yes])
74         ],[
75                 AC_MSG_RESULT([no])
76                 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
77                 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
78                 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
79         ])
80 $1
81 ],[
82 $2
83 ])
84 ])
85
86 #
87 # LC_STRUCT_KIOBUF
88 #
89 # rh 2.4.18 has iobuf->dovary, but other kernels do not
90 #
91 AC_DEFUN([LC_STRUCT_KIOBUF],
92 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
93 LB_LINUX_TRY_COMPILE([
94         #include <linux/iobuf.h>
95 ],[
96         struct kiobuf iobuf;
97         iobuf.dovary = 1;
98 ],[
99         AC_MSG_RESULT([yes])
100         AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
101 ],[
102         AC_MSG_RESULT([no])
103 ])
104 ])
105
106 #
107 # LC_FUNC_COND_RESCHED
108 #
109 # cond_resched() was introduced in 2.4.20
110 #
111 AC_DEFUN([LC_FUNC_COND_RESCHED],
112 [AC_MSG_CHECKING([if kernel offers cond_resched])
113 LB_LINUX_TRY_COMPILE([
114         #include <linux/sched.h>
115 ],[
116         cond_resched();
117 ],[
118         AC_MSG_RESULT([yes])
119         AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
120 ],[
121         AC_MSG_RESULT([no])
122 ])
123 ])
124
125 #
126 # LC_FUNC_ZAP_PAGE_RANGE
127 #
128 # if zap_page_range() takes a vma arg
129 #
130 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
131 [AC_MSG_CHECKING([if zap_page_range with vma parameter])
132 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
133 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
134         AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
135         AC_MSG_RESULT([yes])
136 else
137         AC_MSG_RESULT([no])
138 fi
139 ])
140
141 #
142 # LC_FUNC_PDE
143 #
144 # if proc_fs.h defines PDE()
145 #
146 AC_DEFUN([LC_FUNC_PDE],
147 [AC_MSG_CHECKING([if kernel defines PDE])
148 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
149 if test "$HAVE_PDE" != 0 ; then
150         AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
151         AC_MSG_RESULT([yes])
152 else
153         AC_MSG_RESULT([no])
154 fi
155 ])
156
157 #
158 # LC_FUNC_FILEMAP_FDATASYNC
159 #
160 # if filemap_fdatasync() exists
161 #
162 AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE],
163 [AC_MSG_CHECKING([whether filemap_fdatawrite() is defined])
164 LB_LINUX_TRY_COMPILE([
165         #include <linux/fs.h>
166 ],[
167         int (*foo)(struct address_space *)= filemap_fdatawrite;
168 ],[
169         AC_MSG_RESULT([yes])
170         AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found])
171 ],[
172         AC_MSG_RESULT([no])
173 ])
174 ])
175
176 #
177 # LC_FUNC_DIRECT_IO
178 #
179 # if direct_IO takes a struct file argument
180 #
181 AC_DEFUN([LC_FUNC_DIRECT_IO],
182 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
183 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
184 if test "$HAVE_DIO_FILE" != 0 ; then
185         AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
186         AC_MSG_RESULT(yes)
187 else
188         AC_MSG_RESULT(no)
189 fi
190 ])
191
192 #
193 # LC_HEADER_MM_INLINE
194 #
195 # RHEL kernels define page_count in mm_inline.h
196 #
197 AC_DEFUN([LC_HEADER_MM_INLINE],
198 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
199 LB_LINUX_TRY_COMPILE([
200         #include <linux/mm_inline.h>
201 ],[
202         #ifndef page_count
203         #error mm_inline.h does not define page_count
204         #endif
205 ],[
206         AC_MSG_RESULT([yes])
207         AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
208 ],[
209         AC_MSG_RESULT([no])
210 ])
211 ])
212
213 #
214 # LC_STRUCT_INODE
215 #
216 # if inode->i_alloc_sem exists
217 #
218 AC_DEFUN([LC_STRUCT_INODE],
219 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
220 LB_LINUX_TRY_COMPILE([
221         #include <linux/fs.h>
222         #include <linux/version.h>
223 ],[
224         #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
225         #error "down_read_trylock broken before 2.4.24"
226         #endif
227         struct inode i;
228         return (char *)&i.i_alloc_sem - (char *)&i;
229 ],[
230         AC_MSG_RESULT([yes])
231         AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
232 ],[
233         AC_MSG_RESULT([no])
234 ])
235 ])
236
237 #
238 # LC_FUNC_REGISTER_CACHE
239 #
240 # if register_cache() is defined by kernel
241 #
242 AC_DEFUN([LC_FUNC_REGISTER_CACHE],
243 [AC_MSG_CHECKING([if kernel defines register_cache()])
244 LB_LINUX_TRY_COMPILE([
245         #include <linux/list.h>
246         #include <linux/cache_def.h>
247 ],[
248         struct cache_definition cache;
249 ],[
250         AC_MSG_RESULT([yes])
251         AC_DEFINE(HAVE_REGISTER_CACHE, 1, [register_cache found])
252         AC_MSG_CHECKING([if kernel expects return from cache shrink function])
253         HAVE_CACHE_RETURN_INT="`grep -c 'int.*shrink' $LINUX/include/linux/cache_def.h`"
254         if test "$HAVE_CACHE_RETURN_INT" != 0 ; then
255                 AC_DEFINE(HAVE_CACHE_RETURN_INT, 1, [kernel expects return from shrink_cache])
256                 AC_MSG_RESULT(yes)
257         else
258                 AC_MSG_RESULT(no)
259         fi
260 ],[
261         AC_MSG_RESULT([no])
262 ])
263 ])
264
265 #
266 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
267 #
268 # check for our patched grab_cache_page_nowait_gfp() function
269 #
270 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
271 [AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
272 HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/include/linux/pagemap.h`"
273 if test "$HAVE_GCPN_GFP" != 0 ; then
274         AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
275                 [kernel has grab_cache_page_nowait_gfp()])
276         AC_MSG_RESULT(yes)
277 else
278         AC_MSG_RESULT(no)
279 fi
280 ])
281
282 #
283 # LC_FUNC_DEV_SET_RDONLY
284 #
285 # check for the old-style dev_set_rdonly which took an extra "devno" param
286 # and can only set a single device to discard writes at one time
287 #
288 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
289 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
290 LB_LINUX_TRY_COMPILE([
291         #include <linux/fs.h>
292 ],[
293         #ifndef HAVE_CLEAR_RDONLY_ON_PUT
294         #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
295         #endif
296 ],[
297         AC_MSG_RESULT([yes])
298         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
299 ],[
300         AC_MSG_RESULT([no, Linux kernel source needs to be patches by lustre 
301 kernel patches from Lustre version 1.4.3 or above.])
302 ])
303 ])
304
305 #
306 # LC_CONFIG_BACKINGFS
307 #
308 # setup, check the backing filesystem
309 #
310 AC_DEFUN([LC_CONFIG_BACKINGFS],
311 [
312 BACKINGFS="ldiskfs"
313
314 if test x$with_ldiskfs = xno ; then
315         BACKINGFS="ext3"
316
317         if test x$linux25$enable_server = xyesyes ; then
318                 AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
319         fi
320
321         # --- Check that ext3 and ext3 xattr are enabled in the kernel
322         LC_CONFIG_EXT3([],[
323                 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
324         ],[
325                 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
326                 AC_MSG_WARN([This build may fail.])
327         ])
328 else
329         # ldiskfs is enabled
330         LB_DEFINE_LDISKFS_OPTIONS
331 fi #ldiskfs
332
333 AC_MSG_CHECKING([which backing filesystem to use])
334 AC_MSG_RESULT([$BACKINGFS])
335 AC_SUBST(BACKINGFS)
336 ])
337
338 #
339 # LC_CONFIG_PINGER
340 #
341 # the pinger is temporary, until we have the recovery node in place
342 #
343 AC_DEFUN([LC_CONFIG_PINGER],
344 [AC_MSG_CHECKING([whether to enable pinger support])
345 AC_ARG_ENABLE([pinger],
346         AC_HELP_STRING([--disable-pinger],
347                         [disable recovery pinger support]),
348         [],[enable_pinger='yes'])
349 AC_MSG_RESULT([$enable_pinger])
350 if test x$enable_pinger != xno ; then
351   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
352 fi
353 ])
354
355 #
356 # LC_CONFIG_CHECKSUM
357 #
358 # do checksum of bulk data between client and OST
359 #
360 AC_DEFUN([LC_CONFIG_CHECKSUM],
361 [AC_MSG_CHECKING([whether to enable data checksum support])
362 AC_ARG_ENABLE([checksum],
363        AC_HELP_STRING([--disable-checksum],
364                        [disable data checksum support]),
365        [],[enable_checksum='yes'])
366 AC_MSG_RESULT([$enable_checksum])
367 if test x$enable_checksum != xno ; then
368   AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
369 fi
370 ])
371
372 #
373 # LC_CONFIG_HEALTH_CHECK_WRITE
374 #
375 # Turn off the actual write to the disk
376 #
377 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
378 [AC_MSG_CHECKING([whether to enable a write with the health check])
379 AC_ARG_ENABLE([health_write],
380         AC_HELP_STRING([--enable-health_write],
381                         [enable disk writes when doing health check]),
382         [],[enable_health_write='no'])
383 AC_MSG_RESULT([$enable_health_write])
384 if test x$enable_health_write != xno ; then
385   AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
386 fi
387 ])
388
389 #
390 # LC_CONFIG_LIBLUSTRE_RECOVERY
391 #
392 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
393 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
394 AC_ARG_ENABLE([liblustre-recovery],
395         AC_HELP_STRING([--disable-liblustre-recovery],
396                         [disable liblustre recovery support]),
397         [],[enable_liblustre_recovery='yes'])
398 AC_MSG_RESULT([$enable_liblustre_recovery])
399 if test x$enable_liblustre_recovery != xno ; then
400   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
401 fi
402 ])
403
404 #
405 # LC_CONFIG_OBD_BUFFER_SIZE
406 #
407 # the maximum buffer size of lctl ioctls
408 #
409 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
410 [AC_MSG_CHECKING([maximum OBD ioctl size])
411 AC_ARG_WITH([obd-buffer-size],
412         AC_HELP_STRING([--with-obd-buffer-size=[size]],
413                         [set lctl ioctl maximum bytes (default=8192)]),
414         [
415                 OBD_BUFFER_SIZE=$with_obd_buffer_size
416         ],[
417                 OBD_BUFFER_SIZE=8192
418         ])
419 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
420 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
421 ])
422
423 #
424 # LC_STRUCT_STATFS
425 #
426 # AIX does not have statfs.f_namelen
427 #
428 AC_DEFUN([LC_STRUCT_STATFS],
429 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
430 LB_LINUX_TRY_COMPILE([
431         #include <linux/vfs.h>
432 ],[
433         struct statfs sfs;
434         sfs.f_namelen = 1;
435 ],[
436         AC_MSG_RESULT([yes])
437         AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
438 ],[
439         AC_MSG_RESULT([no])
440 ])
441 ])
442
443 #
444 # LC_READLINK_SSIZE_T
445 #
446 AC_DEFUN([LC_READLINK_SSIZE_T],
447 [AC_MSG_CHECKING([if readlink returns ssize_t])
448 AC_TRY_COMPILE([
449         #include <unistd.h>
450 ],[
451         ssize_t readlink(const char *, char *, size_t);
452 ],[
453         AC_MSG_RESULT([yes])
454         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
455 ],[
456         AC_MSG_RESULT([no])
457 ])
458 ])
459
460 AC_DEFUN([LC_FUNC_PAGE_MAPPED],
461 [AC_MSG_CHECKING([if kernel offers page_mapped])
462 LB_LINUX_TRY_COMPILE([
463         #include <linux/mm.h>
464 ],[
465         page_mapped(NULL);
466 ],[
467         AC_MSG_RESULT([yes])
468         AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found])
469 ],[
470         AC_MSG_RESULT([no])
471 ])
472 ])
473
474 AC_DEFUN([LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL],
475 [AC_MSG_CHECKING([if struct file_operations has an unlocked_ioctl field])
476 LB_LINUX_TRY_COMPILE([
477         #include <linux/fs.h>
478 ],[
479         struct file_operations fops;
480         &fops.unlocked_ioctl;
481 ],[
482         AC_MSG_RESULT([yes])
483         AC_DEFINE(HAVE_UNLOCKED_IOCTL, 1, [struct file_operations has an unlock ed_ioctl field])
484 ],[
485         AC_MSG_RESULT([no])
486 ])
487 ])
488
489 AC_DEFUN([LC_FILEMAP_POPULATE],
490 [AC_MSG_CHECKING([for exported filemap_populate])
491 LB_LINUX_TRY_COMPILE([
492         #include <asm/page.h>
493         #include <linux/mm.h>
494 ],[
495        filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
496 ],[
497         AC_MSG_RESULT([yes])
498         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
499 ],[
500         AC_MSG_RESULT([no])
501 ])
502 ])
503
504 AC_DEFUN([LC_D_ADD_UNIQUE],
505 [AC_MSG_CHECKING([for d_add_unique])
506 LB_LINUX_TRY_COMPILE([
507         #include <linux/dcache.h>
508 ],[
509        d_add_unique(NULL, NULL);
510 ],[
511         AC_MSG_RESULT([yes])
512         AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
513 ],[
514         AC_MSG_RESULT([no])
515 ])
516 ])
517
518 AC_DEFUN([LC_BIT_SPINLOCK_H],
519 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
520         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
521         LB_LINUX_TRY_COMPILE([
522                 #include <asm/processor.h>
523                 #include <linux/spinlock.h>
524                 #include <linux/bit_spinlock.h>
525         ],[],[
526                 AC_MSG_RESULT([yes])
527                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
528         ],[
529                 AC_MSG_RESULT([no])
530         ])
531 ],
532 [])
533 ])
534
535 #
536 # LC_POSIX_ACL_XATTR
537 #
538 # If we have xattr_acl.h 
539 #
540 AC_DEFUN([LC_XATTR_ACL],
541 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
542         AC_MSG_CHECKING([if xattr_acl.h can be compiled])
543         LB_LINUX_TRY_COMPILE([
544                 #include <linux/xattr_acl.h>
545         ],[],[
546                 AC_MSG_RESULT([yes])
547                 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
548         ],[
549                 AC_MSG_RESULT([no])
550         ])
551 ],
552 [])
553 ])
554
555 AC_DEFUN([LC_STRUCT_INTENT_FILE],
556 [AC_MSG_CHECKING([if struct open_intent has a file field])
557 LB_LINUX_TRY_COMPILE([
558         #include <linux/fs.h>
559         #include <linux/namei.h>
560 ],[
561         struct open_intent intent;
562         &intent.file;
563 ],[
564         AC_MSG_RESULT([yes])
565         AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
566 ],[
567         AC_MSG_RESULT([no])
568 ])
569 ])
570
571
572 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
573 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
574         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
575         LB_LINUX_TRY_COMPILE([
576                 #include <linux/posix_acl_xattr.h>
577         ],[],[
578                 AC_MSG_RESULT([yes])
579                 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
580
581         ],[
582                 AC_MSG_RESULT([no])
583         ])
584 $1
585 ],[
586 AC_MSG_RESULT([no])
587 ])
588 ])
589
590 #
591 # LC_EXPORT___IGET
592 # starting from 2.6.19 linux kernel exports __iget()
593 #
594 AC_DEFUN([LC_EXPORT___IGET],
595 [LB_CHECK_SYMBOL_EXPORT([__iget],
596 [fs/inode.c],[
597         AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
598 ],[
599 ])
600 ])
601
602 AC_DEFUN([LC_LUSTRE_VERSION_H],
603 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
604         rm -f "$LUSTRE/include/linux/lustre_version.h"
605 ],[
606         touch "$LUSTRE/include/linux/lustre_version.h"
607         if test x$enable_server = xyes ; then
608                 AC_MSG_WARN([Unpatched kernel detected.])
609                 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
610                 AC_MSG_WARN([disabling server build])
611                 enable_server='no'
612         fi
613 ])
614 ])
615
616 AC_DEFUN([LC_FUNC_SET_FS_PWD],
617 [LB_CHECK_SYMBOL_EXPORT([set_fs_pwd],
618 [fs/namespace.c],[
619         AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
620 ],[
621 ])
622 ])
623
624 #
625 # LC_CAPA_CRYPTO
626 #
627 AC_DEFUN([LC_CAPA_CRYPTO],
628 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
629         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
630 ])
631 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
632         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
633 ])
634 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
635         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
636 ])
637 ])
638
639 AC_DEFUN([LC_SUNRPC_CACHE],
640 [AC_MSG_CHECKING([if sunrpc struct cache_head uses kref])
641 LB_LINUX_TRY_COMPILE([
642         #include <linux/sunrpc/cache.h>
643 ],[
644         struct cache_head ch;
645         &ch.ref.refcount;
646 ],[
647         AC_MSG_RESULT([yes])
648         AC_DEFINE(HAVE_SUNRPC_CACHE_V2, 1, [sunrpc cache facility v2])
649 ],[
650         AC_MSG_RESULT([no])
651 ])
652 ])
653
654 AC_DEFUN([LC_CONFIG_SUNRPC],
655 [LB_LINUX_CONFIG_IM([SUNRPC],[],
656                     [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
657  LC_SUNRPC_CACHE
658 ])
659
660 #
661 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
662 #
663 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
664 [AC_MSG_CHECKING([whether to enable gss keyring backend])
665  AC_ARG_ENABLE([gss_keyring], 
666                [AC_HELP_STRING([--disable-gss-keyring],
667                                [disable gss keyring backend])],
668                [],[enable_gss_keyring='yes'])
669  AC_MSG_RESULT([$enable_gss_keyring])
670
671  if test x$enable_gss_keyring != xno; then
672         LB_LINUX_CONFIG_IM([KEYS],[],
673                            [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
674
675         AC_CHECK_LIB([keyutils], [keyctl_search], [],
676                      [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
677
678         AC_DEFINE([HAVE_GSS_KEYRING], [1],
679                   [Define this if you enable gss keyring backend])
680  fi
681 ])
682
683 m4_pattern_allow(AC_KERBEROS_V5)
684
685 #
686 # LC_CONFIG_GSS (default disabled)
687 #
688 # Build gss and related tools of Lustre. Currently both kernel and user space
689 # parts are depend on linux platform.
690 #
691 AC_DEFUN([LC_CONFIG_GSS],
692 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
693  AC_ARG_ENABLE([gss], 
694                [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
695                [],[enable_gss='no'])
696  AC_MSG_RESULT([$enable_gss])
697
698  if test x$enable_gss == xyes; then
699         LC_CONFIG_GSS_KEYRING
700         LC_CONFIG_SUNRPC
701
702         LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
703                            [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
704         LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
705                            [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
706         LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
707                            [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
708         LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
709                            [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
710         LB_LINUX_CONFIG_IM([CRYPTO_WP512],[],
711                            [AC_MSG_WARN([kernel WP512 support is recommended by using GSS.])])
712         LB_LINUX_CONFIG_IM([CRYPTO_ARC4],[],
713                            [AC_MSG_WARN([kernel ARC4 support is recommended by using GSS.])])
714         LB_LINUX_CONFIG_IM([CRYPTO_DES],[],
715                            [AC_MSG_WARN([kernel DES support is recommended by using GSS.])])
716         LB_LINUX_CONFIG_IM([CRYPTO_TWOFISH],[],
717                            [AC_MSG_WARN([kernel TWOFISH support is recommended by using GSS.])])
718         LB_LINUX_CONFIG_IM([CRYPTO_CAST6],[],
719                            [AC_MSG_WARN([kernel CAST6 support is recommended by using GSS.])])
720         dnl FIXME
721         dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
722         dnl FIXME
723         LB_LINUX_CONFIG_IM([CRYPTO_AES],[],
724                            [AC_MSG_WARN([kernel AES support is recommended by using GSS.])])
725
726         AC_CHECK_LIB([gssapi], [gss_init_sec_context],
727                      [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
728                      [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
729                                    [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
730                                    [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
731
732         AC_SUBST(GSSAPI_LIBS)
733
734         AC_KERBEROS_V5
735  fi
736 ])
737
738 # LC_FUNC_MS_FLOCK_LOCK
739 #
740 # SLES9 kernel has MS_FLOCK_LOCK sb flag
741 #
742 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
743 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
744 LB_LINUX_TRY_COMPILE([
745         #include <linux/fs.h>
746 ],[
747         int flags = MS_FLOCK_LOCK;
748 ],[
749         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
750                 [kernel has MS_FLOCK_LOCK flag])
751         AC_MSG_RESULT([yes])
752 ],[
753         AC_MSG_RESULT([no])
754 ])
755 ])
756
757 #
758 # LC_FUNC_HAVE_CAN_SLEEP_ARG
759 #
760 # SLES9 kernel has third arg can_sleep
761 # in fs/locks.c: flock_lock_file_wait()
762 #
763 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
764 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
765 LB_LINUX_TRY_COMPILE([
766         #include <linux/fs.h>
767 ],[
768         int cansleep;
769         struct file *file;
770         struct file_lock *file_lock;
771         flock_lock_file_wait(file, file_lock, cansleep);
772 ],[
773         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
774                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
775         AC_MSG_RESULT([yes])
776 ],[
777         AC_MSG_RESULT([no])
778 ])
779 ])
780
781 #
782 # LC_FUNC_F_OP_FLOCK
783 #
784 # rhel4.2 kernel has f_op->flock field
785 #
786 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
787 [AC_MSG_CHECKING([if struct file_operations has flock field])
788 LB_LINUX_TRY_COMPILE([
789         #include <linux/fs.h>
790 ],[
791         struct file_operations ll_file_operations_flock;
792         ll_file_operations_flock.flock = NULL;
793 ],[
794         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
795                 [struct file_operations has flock field])
796         AC_MSG_RESULT([yes])
797 ],[
798         AC_MSG_RESULT([no])
799 ])
800 ])
801
802 #
803 # LC_TASK_PPTR
804 #
805 # task struct has p_pptr instead of parent
806 #
807 AC_DEFUN([LC_TASK_PPTR],
808 [AC_MSG_CHECKING([task p_pptr found])
809 LB_LINUX_TRY_COMPILE([
810         #include <linux/sched.h>
811 ],[
812         struct task_struct *p;
813         
814         p = p->p_pptr;
815 ],[
816         AC_MSG_RESULT([yes])
817         AC_DEFINE(HAVE_TASK_PPTR, 1, [task p_pptr found])
818 ],[
819         AC_MSG_RESULT([no])
820 ])
821 ])
822
823 #
824 # LC_FUNC_F_OP_FLOCK
825 #
826 # rhel4.2 kernel has f_op->flock field
827 #
828 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
829 [AC_MSG_CHECKING([if struct file_operations has flock field])
830 LB_LINUX_TRY_COMPILE([
831         #include <linux/fs.h>
832 ],[
833         struct file_operations ll_file_operations_flock;
834         ll_file_operations_flock.flock = NULL;
835 ],[
836         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
837                 [struct file_operations has flock field])
838         AC_MSG_RESULT([yes])
839 ],[
840         AC_MSG_RESULT([no])
841 ])
842 ])
843
844 # LC_INODE_I_MUTEX
845 # after 2.6.15 inode have i_mutex intead of i_sem
846 AC_DEFUN([LC_INODE_I_MUTEX],
847 [AC_MSG_CHECKING([use inode have i_mutex ])
848 LB_LINUX_TRY_COMPILE([
849         #include <linux/mutex.h>
850         #include <linux/fs.h>
851         #undef i_mutex
852 ],[
853         struct inode i;
854
855         mutex_unlock(&i.i_mutex);
856 ],[
857         AC_MSG_RESULT(yes)
858         AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
859                 [after 2.6.15 inode have i_mutex intead of i_sem])
860 ],[
861         AC_MSG_RESULT(NO)
862 ])
863 ])
864
865 # LC_DQUOTOFF_MUTEX
866 # after 2.6.17 dquote use mutex instead if semaphore
867 AC_DEFUN([LC_DQUOTOFF_MUTEX],
868 [AC_MSG_CHECKING([use dqonoff_mutex])
869 LB_LINUX_TRY_COMPILE([
870         #include <linux/mutex.h>
871         #include <linux/fs.h>
872         #include <linux/quota.h>
873 ],[
874         struct quota_info dq;
875
876         mutex_unlock(&dq.dqonoff_mutex);
877 ],[
878         AC_MSG_RESULT(yes)
879         AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
880                 [after 2.6.17 dquote use mutex instead if semaphore])
881 ],[
882         AC_MSG_RESULT(NO)
883 ])
884 ])
885  
886 #
887 # LC_STATFS_DENTRY_PARAM
888 # starting from 2.6.18 linux kernel uses dentry instead of
889 # super_block for first vfs_statfs argument
890 #
891 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
892 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
893 LB_LINUX_TRY_COMPILE([
894         #include <linux/fs.h>
895 ],[
896         int vfs_statfs(struct dentry *, struct kstatfs *);
897 ],[
898         AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
899                 [first parameter of vfs_statfs is dentry])
900         AC_MSG_RESULT([yes])
901 ],[
902         AC_MSG_RESULT([no])
903 ])
904 ])
905
906 #
907 # LC_VFS_KERN_MOUNT
908 # starting from 2.6.18 kernel don't export do_kern_mount
909 # and want to use vfs_kern_mount instead.
910 #
911 AC_DEFUN([LC_VFS_KERN_MOUNT],
912 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
913 LB_LINUX_TRY_COMPILE([
914         #include <linux/mount.h>
915 ],[
916         vfs_kern_mount(NULL, 0, NULL, NULL);
917 ],[
918         AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
919                 [vfs_kern_mount exist in kernel])
920         AC_MSG_RESULT([yes])
921 ],[
922         AC_MSG_RESULT([no])
923 ])
924 ])
925
926
927 # LC_INVALIDATEPAGE_RETURN_INT
928 # more 2.6 api changes.  return type for the invalidatepage
929 # address_space_operation is 'void' in new kernels but 'int' in old
930 #
931 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
932 [AC_MSG_CHECKING([invalidatepage has return int])
933 LB_LINUX_TRY_COMPILE([
934         #include <linux/buffer_head.h>
935 ],[
936         int rc = block_invalidatepage(NULL, 0);
937 ],[
938         AC_MSG_RESULT(yes)
939         AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
940                 [Define if return type of invalidatepage should be int])
941 ],[
942         AC_MSG_RESULT(NO)
943 ])
944 ])
945
946 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
947 # more 2.6 API changes. 2.6.18 umount_begin has different parameters
948 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
949 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
950 tmp_flags="$EXTRA_KCFLAGS"
951 EXTRA_KCFLAGS="-Werror"
952 LB_LINUX_TRY_COMPILE([
953         #include <linux/fs.h>
954
955         struct vfsmount;
956         static void cfg_umount_begin (struct vfsmount *v, int flags)
957         {
958                 ;
959         }
960
961         static struct super_operations cfg_super_operations = {
962                 .umount_begin   = cfg_umount_begin,
963         };
964 ],[
965         cfg_super_operations.umount_begin(NULL,0);
966 ],[
967         AC_MSG_RESULT(yes)
968         AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
969                 [Define umount_begin need second argument])
970 ],[
971         AC_MSG_RESULT(NO)
972 ])
973 EXTRA_KCFLAGS="$tmp_flags"
974 ])
975
976 # 2.6.19 API changes
977 # inode don't have i_blksize field
978 AC_DEFUN([LC_INODE_BLKSIZE],
979 [AC_MSG_CHECKING([inode has i_blksize field])
980 LB_LINUX_TRY_COMPILE([
981 #include <linux/fs.h>
982 ],[
983         struct inode i;
984         i.i_blksize = 0; 
985 ],[
986         AC_MSG_RESULT(yes)
987         AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
988                 [struct inode has i_blksize field])
989 ],[
990         AC_MSG_RESULT(NO)
991 ])
992 ])
993
994 # LC_VFS_READDIR_U64_INO
995 # 2.6.19 use u64 for inode number instead of inode_t
996 AC_DEFUN([LC_VFS_READDIR_U64_INO],
997 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
998 tmp_flags="$EXTRA_KCFLAGS"
999 EXTRA_KCFLAGS="-Werror"
1000 LB_LINUX_TRY_COMPILE([
1001 #include <linux/fs.h>
1002         int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
1003                       u64 ino, unsigned int d_type)
1004         {
1005                 return 0;
1006         }
1007 ],[
1008         filldir_t filter;
1009
1010         filter = fillonedir;
1011         return 1;
1012 ],[
1013         AC_MSG_RESULT(yes)
1014         AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
1015                 [if vfs_readdir need 64bit inode number])
1016 ],[
1017         AC_MSG_RESULT(NO)
1018 ])
1019 EXTRA_KCFLAGS="$tmp_flags"
1020 ])
1021
1022 # LC_GENERIC_FILE_WRITE
1023 # 2.6.19 introduce do_sync_write instead of
1024 # generic_file_write
1025 AC_DEFUN([LC_GENERIC_FILE_WRITE],
1026 [AC_MSG_CHECKING([use generic_file_write])
1027 LB_LINUX_TRY_COMPILE([
1028         #include <linux/fs.h>
1029 ],[
1030         int result = generic_file_read(NULL, NULL, 0, 0);
1031 ],[
1032         AC_MSG_RESULT(yes)
1033         AC_DEFINE(HAVE_GENERIC_FILE_WRITE, 1,
1034                 [use generic_file_write])
1035 ],[
1036         AC_MSG_RESULT(NO)
1037 ])
1038 ])
1039
1040 # LC_GENERIC_FILE_READ
1041 # 2.6.19 need to use do_sync_read instead of
1042 # generic_file_read
1043 AC_DEFUN([LC_GENERIC_FILE_READ],
1044 [AC_MSG_CHECKING([use generic_file_read])
1045 LB_LINUX_TRY_COMPILE([
1046         #include <linux/fs.h>
1047 ],[
1048         int result = generic_file_read(NULL, NULL, 0, 0);
1049 ],[
1050         AC_MSG_RESULT(yes)
1051         AC_DEFINE(HAVE_GENERIC_FILE_READ, 1,
1052                 [use generic_file_read])
1053 ],[
1054         AC_MSG_RESULT(NO)
1055 ])
1056 ])
1057
1058 # LC_NR_PAGECACHE
1059 # 2.6.18 don't export nr_pagecahe
1060 AC_DEFUN([LC_NR_PAGECACHE],
1061 [AC_MSG_CHECKING([kernel export nr_pagecache])
1062 LB_LINUX_TRY_COMPILE([
1063         #include <linux/pagemap.h>
1064 ],[
1065         return atomic_read(&nr_pagecache);
1066 ],[
1067         AC_MSG_RESULT(yes)
1068         AC_DEFINE(HAVE_NR_PAGECACHE, 1,
1069                 [is kernel export nr_pagecache])
1070 ],[
1071         AC_MSG_RESULT(NO)
1072 ])
1073 ])
1074
1075 # LC_CANCEL_DIRTY_PAGE
1076 # 2.6.20 introduse cancel_dirty_page instead of 
1077 # clear_page_dirty.
1078 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
1079 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
1080 LB_LINUX_TRY_COMPILE([
1081         #include <linux/page-flags.h>
1082 ],[
1083         cancel_dirty_page(NULL, 0);
1084 ],[
1085         AC_MSG_RESULT(yes)
1086         AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
1087                   [kernel has cancel_dirty_page instead of clear_page_dirty])
1088 ],[
1089         AC_MSG_RESULT(NO)
1090 ])
1091 ])
1092
1093 #
1094 # LC_PAGE_CONSTANT
1095 #
1096 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
1097 # it support constant page, which means the page won't be modified during the
1098 # IO.
1099 #
1100 AC_DEFUN([LC_PAGE_CONSTANT],
1101 [AC_MSG_CHECKING([if kernel have PageConstant defined])
1102 LB_LINUX_TRY_COMPILE([
1103         #include <linux/page-flags.h>
1104 ],[
1105         #ifndef PG_constant
1106         #error "Have no raid5 zcopy patch"
1107         #endif
1108 ],[
1109         AC_MSG_RESULT(yes)
1110         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
1111 ],[
1112         AC_MSG_RESULT(no);
1113 ])
1114 ])
1115
1116 # RHEL5 in FS-cache patch rename PG_checked flag
1117 # into PG_fs_misc
1118 AC_DEFUN([LC_PG_FS_MISC],
1119 [AC_MSG_CHECKING([kernel has PG_fs_misc])
1120 LB_LINUX_TRY_COMPILE([
1121         #include <linux/page-flags.h>
1122 ],[
1123         #ifndef PG_fs_misc
1124         #error PG_fs_misc not defined in kernel
1125         #endif
1126 ],[
1127         AC_MSG_RESULT(yes)
1128         AC_DEFINE(HAVE_PG_FS_MISC, 1,
1129                   [is kernel have PG_fs_misc])
1130 ],[
1131         AC_MSG_RESULT(NO)
1132 ])
1133 ])
1134
1135 # RHEL5 PageChecked and SetPageChecked defined
1136 AC_DEFUN([LC_PAGE_CHECKED],
1137 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
1138 LB_LINUX_TRY_COMPILE([
1139         #include <linux/page-flags.h>
1140 ],[
1141         #ifndef PageChecked
1142         #error PageChecked not defined in kernel
1143         #endif
1144         #ifndef SetPageChecked
1145         #error SetPageChecked not defined in kernel
1146         #endif
1147 ],[
1148         AC_MSG_RESULT(yes)
1149         AC_DEFINE(HAVE_PAGE_CHECKED, 1,
1150                   [does kernel have PageChecked and SetPageChecked])
1151 ],[
1152         AC_MSG_RESULT(NO)
1153 ])
1154 ])
1155
1156 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
1157 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
1158 [mm/truncate.c],[
1159 AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
1160             [kernel export truncate_complete_page])
1161 ],[
1162 ])
1163 ])
1164
1165 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
1166 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
1167 [fs/dcache.c],[
1168 AC_DEFINE(HAVE_D_REHASH_COND, 1,
1169             [d_rehash_cond is exported by the kernel])
1170 ],[
1171 ])
1172 ])
1173
1174 AC_DEFUN([LC_EXPORT___D_REHASH],
1175 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
1176 [fs/dcache.c],[
1177 AC_DEFINE(HAVE___D_REHASH, 1,
1178             [__d_rehash is exported by the kernel])
1179 ],[
1180 ])
1181 ])
1182
1183 AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
1184 [LB_CHECK_SYMBOL_EXPORT([d_move_locked],
1185 [fs/dcache.c],[
1186 AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
1187             [d_move_locked is exported by the kernel])
1188 ],[
1189 ])
1190 ])
1191
1192 AC_DEFUN([LC_EXPORT___D_MOVE],
1193 [LB_CHECK_SYMBOL_EXPORT([__d_move],
1194 [fs/dcache.c],[
1195 AC_DEFINE(HAVE___D_MOVE, 1,
1196             [__d_move is exported by the kernel])
1197 ],[
1198 ])
1199 ])
1200
1201 # The actual symbol exported varies among architectures, so we need
1202 # to check many symbols (but only in the current architecture.)  No
1203 # matter what symbol is exported, the kernel #defines node_to_cpumask
1204 # to the appropriate function and that's what we use.
1205 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
1206          [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
1207                                  [arch/$LINUX_ARCH/mm/numa.c],
1208                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1209                                             [node_to_cpumask is exported by
1210                                              the kernel])]) # x86_64
1211           LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
1212                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1213                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1214                                             [node_to_cpumask is exported by
1215                                              the kernel])]) # ia64
1216           LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
1217                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1218                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1219                                             [node_to_cpumask is exported by
1220                                              the kernel])]) # i386
1221           ])
1222
1223 # 2.6.22 lost second parameter for invalidate_bdev
1224 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
1225 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
1226 LB_LINUX_TRY_COMPILE([
1227         #include <linux/buffer_head.h>
1228 ],[
1229         invalidate_bdev(NULL,0);
1230 ],[
1231         AC_MSG_RESULT([yes])
1232         AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1233                 [invalidate_bdev has second argument])
1234 ],[
1235         AC_MSG_RESULT([no])
1236 ])
1237 ])
1238
1239 # 2.6.23 have return type 'void' for unregister_blkdev
1240 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1241 [AC_MSG_CHECKING([if unregister_blkdev return int])
1242 LB_LINUX_TRY_COMPILE([
1243         #include <linux/fs.h>
1244 ],[
1245         int i = unregister_blkdev(0,NULL);
1246 ],[
1247         AC_MSG_RESULT([yes])
1248         AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1, 
1249                 [unregister_blkdev return int])
1250 ],[
1251         AC_MSG_RESULT([no])
1252 ])
1253 ])
1254
1255 # 2.6.23 change .sendfile to .splice_read
1256 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1257 [AC_MSG_CHECKING([if kernel has .splice_read])
1258 LB_LINUX_TRY_COMPILE([
1259         #include <linux/fs.h>
1260 ],[
1261         struct file_operations file;
1262
1263         file.splice_read = NULL;
1264 ], [
1265         AC_MSG_RESULT([yes])
1266         AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1267                 [kernel has .slice_read])
1268 ],[
1269         AC_MSG_RESULT([no])
1270 ])
1271 ])
1272
1273 # 2.6.23 extract nfs export related data into exportfs.h
1274 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1275 [
1276 tmpfl="$CFLAGS"
1277 CFLAGS="$CFLAGS -I$LINUX_OBJ/include"
1278 AC_CHECK_HEADERS([linux/exportfs.h])
1279 CFLAGS="$tmpfl"
1280 ])
1281
1282 #
1283 # LC_VFS_INTENT_PATCHES
1284 #
1285 # check if the kernel has the VFS intent patches
1286 AC_DEFUN([LC_VFS_INTENT_PATCHES],
1287 [AC_MSG_CHECKING([if the kernel has the VFS intent patches])
1288 LB_LINUX_TRY_COMPILE([
1289         #include <linux/fs.h>
1290         #include <linux/namei.h>
1291 ],[
1292         struct nameidata nd;
1293         struct lookup_intent *it;
1294
1295         it = &nd.intent;
1296         intent_init(it, IT_OPEN);
1297         it->d.lustre.it_disposition = 0;
1298         it->d.lustre.it_data = NULL;
1299 ],[
1300         AC_MSG_RESULT([yes])
1301         AC_DEFINE(HAVE_VFS_INTENT_PATCHES, 1, [VFS intent patches are applied])
1302 ],[
1303         AC_MSG_RESULT([no])
1304 ])
1305 ])
1306
1307 AC_DEFUN([LC_S_TIME_GRAN],
1308 [AC_MSG_CHECKING([if super block has s_time_gran member])
1309 LB_LINUX_TRY_COMPILE([
1310         #include <linux/fs.h>
1311 ],[
1312         struct super_block sb;
1313
1314         return sb.s_time_gran;
1315 ],[
1316         AC_MSG_RESULT([yes])
1317         AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
1318 ],[
1319         AC_MSG_RESULT([no])
1320 ])
1321 ])
1322
1323 AC_DEFUN([LC_SB_TIME_GRAN],
1324 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
1325 LB_LINUX_TRY_COMPILE([
1326         #include <linux/fs.h>
1327 ],[
1328         return get_sb_time_gran(NULL);
1329 ],[
1330         AC_MSG_RESULT([yes])
1331         AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
1332 ],[
1333         AC_MSG_RESULT([no])
1334 ])
1335 ])
1336
1337
1338 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
1339 AC_DEFUN([LC_RW_TREE_LOCK],
1340 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
1341 tmp_flags="$EXTRA_KCFLAGS"
1342 EXTRA_KCFLAGS="-Werror"
1343 LB_LINUX_TRY_COMPILE([
1344         #include <linux/fs.h>
1345 ],[
1346         struct address_space a;
1347
1348         write_lock(&a.tree_lock);
1349 ],[
1350         AC_MSG_RESULT([yes])
1351         AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
1352 ],[
1353         AC_MSG_RESULT([no])
1354 ])
1355 EXTRA_KCFLAGS="$tmp_flags"
1356 ])
1357
1358 AC_DEFUN([LC_CONST_ACL_SIZE],
1359 [AC_MSG_CHECKING([calc acl size])
1360 tmp_flags="$CFLAGS"
1361 CFLAGS="$CFLAGS -I $LINUX_OBJ/include $EXTRA_KCFLAGS"
1362 AC_TRY_RUN([
1363 #define __KERNEL__
1364 #include <linux/autoconf.h>
1365 #include <linux/types.h>
1366 #undef __KERNEL__
1367 // block include 
1368 #define __LINUX_POSIX_ACL_H
1369
1370 # ifdef CONFIG_FS_POSIX_ACL
1371 #  ifdef HAVE_XATTR_ACL
1372 #   include <linux/xattr_acl.h>
1373 #  endif
1374 #  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
1375 #   include <linux/posix_acl_xattr.h>
1376 #  endif
1377 # endif
1378
1379 #include <linux/lustre_acl.h>
1380
1381 #include <stdio.h>
1382
1383 int main(void)
1384 {
1385     int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
1386     FILE *f = fopen("acl.size","w+");
1387     fprintf(f,"%d", size);
1388     fclose(f);
1389
1390     return 0;
1391 }
1392
1393 ],[
1394         acl_size=`cat acl.size`
1395         AC_MSG_RESULT([ACL size $acl_size])
1396         AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
1397 ],[
1398         AC_ERROR([ACL size can't computed])
1399 ])
1400 CFLAGS="$tmp_flags"
1401 ])
1402
1403 #
1404 # check for crypto API 
1405 #
1406 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
1407 [AC_MSG_CHECKING([if kernel has block cipher support])
1408 LB_LINUX_TRY_COMPILE([
1409         #include <linux/crypto.h>
1410 ],[
1411         int v = CRYPTO_ALG_TYPE_BLKCIPHER;
1412 ],[
1413         AC_MSG_RESULT([yes])
1414         AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
1415 ],[
1416         AC_MSG_RESULT([no])
1417 ])
1418 ])
1419
1420 #
1421 # check for FS_RENAME_DOES_D_MOVE flag
1422 #
1423 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
1424 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
1425 LB_LINUX_TRY_COMPILE([
1426         #include <linux/fs.h>
1427 ],[
1428         int v = FS_RENAME_DOES_D_MOVE;
1429 ],[
1430         AC_MSG_RESULT([yes])
1431         AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1432 ],[
1433         AC_MSG_RESULT([no])
1434 ])
1435 ])
1436
1437 #
1438 # LC_PROG_LINUX
1439 #
1440 # Lustre linux kernel checks
1441 #
1442 AC_DEFUN([LC_PROG_LINUX],
1443          [LC_LUSTRE_VERSION_H
1444          if test x$enable_server = xyes ; then
1445              AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1446              LC_CONFIG_BACKINGFS
1447          fi
1448          LC_CONFIG_PINGER
1449          LC_CONFIG_CHECKSUM
1450          LC_CONFIG_LIBLUSTRE_RECOVERY
1451          LC_CONFIG_QUOTA
1452          LC_CONFIG_HEALTH_CHECK_WRITE
1453          LC_CONFIG_LRU_RESIZE
1454
1455          LC_TASK_PPTR
1456          # RHEL4 patches
1457          LC_EXPORT_TRUNCATE_COMPLETE
1458          LC_EXPORT_D_REHASH_COND
1459          LC_EXPORT___D_REHASH
1460          LC_EXPORT_D_MOVE_LOCKED
1461          LC_EXPORT___D_MOVE
1462          LC_EXPORT_NODE_TO_CPUMASK
1463
1464          LC_STRUCT_KIOBUF
1465          LC_FUNC_COND_RESCHED
1466          LC_FUNC_ZAP_PAGE_RANGE
1467          LC_FUNC_PDE
1468          LC_FUNC_DIRECT_IO
1469          LC_HEADER_MM_INLINE
1470          LC_STRUCT_INODE
1471          LC_FUNC_REGISTER_CACHE
1472          LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1473          LC_FUNC_DEV_SET_RDONLY
1474          LC_FUNC_FILEMAP_FDATAWRITE
1475          LC_STRUCT_STATFS
1476          LC_FUNC_PAGE_MAPPED
1477          LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
1478          LC_FILEMAP_POPULATE
1479          LC_D_ADD_UNIQUE
1480          LC_BIT_SPINLOCK_H
1481
1482          LC_XATTR_ACL
1483          LC_POSIX_ACL_XATTR_H
1484          LC_CONST_ACL_SIZE
1485
1486          LC_STRUCT_INTENT_FILE
1487
1488          LC_FUNC_SET_FS_PWD
1489          LC_CAPA_CRYPTO
1490          LC_CONFIG_GSS
1491          LC_FUNC_MS_FLOCK_LOCK
1492          LC_FUNC_HAVE_CAN_SLEEP_ARG
1493          LC_FUNC_F_OP_FLOCK
1494          LC_QUOTA_READ
1495          LC_COOKIE_FOLLOW_LINK
1496          LC_FUNC_RCU
1497
1498          # does the kernel have VFS intent patches?
1499          LC_VFS_INTENT_PATCHES
1500
1501          # ~2.6.11
1502          LC_S_TIME_GRAN
1503          LC_SB_TIME_GRAN
1504
1505          # 2.6.12
1506          LC_RW_TREE_LOCK
1507
1508          # 2.6.15
1509          LC_INODE_I_MUTEX
1510
1511          # 2.6.17
1512          LC_DQUOTOFF_MUTEX
1513
1514          # 2.6.18
1515          LC_NR_PAGECACHE
1516          LC_STATFS_DENTRY_PARAM
1517          LC_VFS_KERN_MOUNT
1518          LC_INVALIDATEPAGE_RETURN_INT
1519          LC_UMOUNTBEGIN_HAS_VFSMOUNT
1520
1521          #2.6.18 + RHEL5 (fc6)
1522          LC_PG_FS_MISC
1523          LC_PAGE_CHECKED
1524
1525          # 2.6.19
1526          LC_INODE_BLKSIZE
1527          LC_VFS_READDIR_U64_INO
1528          LC_GENERIC_FILE_READ
1529          LC_GENERIC_FILE_WRITE
1530
1531          # 2.6.20
1532          LC_CANCEL_DIRTY_PAGE
1533
1534          # raid5-zerocopy patch
1535          LC_PAGE_CONSTANT
1536                   
1537          # 2.6.22
1538          LC_INVALIDATE_BDEV_2ARG
1539          LC_ASYNC_BLOCK_CIPHER
1540          LC_FS_RENAME_DOES_D_MOVE
1541          # 2.6.23
1542          LC_UNREGISTER_BLKDEV_RETURN_INT
1543          LC_KERNEL_SPLICE_READ
1544          LC_HAVE_EXPORTFS_H
1545 ])
1546
1547 #
1548 # LC_CONFIG_CLIENT_SERVER
1549 #
1550 # Build client/server sides of Lustre
1551 #
1552 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1553 [AC_MSG_CHECKING([whether to build Lustre server support])
1554 AC_ARG_ENABLE([server],
1555         AC_HELP_STRING([--disable-server],
1556                         [disable Lustre server support]),
1557         [],[enable_server='yes'])
1558 AC_MSG_RESULT([$enable_server])
1559
1560 AC_MSG_CHECKING([whether to build Lustre client support])
1561 AC_ARG_ENABLE([client],
1562         AC_HELP_STRING([--disable-client],
1563                         [disable Lustre client support]),
1564         [],[enable_client='yes'])
1565 AC_MSG_RESULT([$enable_client])])
1566
1567 #
1568 # LC_CONFIG_LIBLUSTRE
1569 #
1570 # whether to build liblustre
1571 #
1572 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1573 [AC_MSG_CHECKING([whether to build Lustre library])
1574 AC_ARG_ENABLE([liblustre],
1575         AC_HELP_STRING([--disable-liblustre],
1576                         [disable building of Lustre library]),
1577         [],[enable_liblustre=$with_sysio])
1578 AC_MSG_RESULT([$enable_liblustre])
1579 # only build sysio if liblustre is built
1580 with_sysio="$enable_liblustre"
1581
1582 AC_MSG_CHECKING([whether to build liblustre tests])
1583 AC_ARG_ENABLE([liblustre-tests],
1584         AC_HELP_STRING([--enable-liblustre-tests],
1585                         [enable liblustre tests, if --disable-tests is used]),
1586         [],[enable_liblustre_tests=$enable_tests])
1587 if test x$enable_liblustre != xyes ; then
1588    enable_liblustre_tests='no'
1589 fi
1590 AC_MSG_RESULT([$enable_liblustre_tests])
1591
1592 AC_MSG_CHECKING([whether to enable liblustre acl])
1593 AC_ARG_ENABLE([liblustre-acl],
1594         AC_HELP_STRING([--disable-liblustre-acl],
1595                         [disable ACL support for liblustre]),
1596         [],[enable_liblustre_acl=yes])
1597 AC_MSG_RESULT([$enable_liblustre_acl])
1598 if test x$enable_liblustre_acl = xyes ; then
1599   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1600 fi
1601
1602 AC_MSG_CHECKING([whether to build mpitests])
1603 AC_ARG_ENABLE([mpitests],
1604         AC_HELP_STRING([--enable-mpitests],
1605                         [build liblustre mpi tests]),
1606         [],[enable_mpitests=no])
1607 AC_MSG_RESULT([$enable_mpitests])
1608
1609 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1610 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1611
1612 LC_CONFIG_PINGER
1613 LC_CONFIG_LIBLUSTRE_RECOVERY
1614 ])
1615
1616 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
1617 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
1618 AC_ARG_ENABLE([lru_resize], 
1619         AC_HELP_STRING([--enable-lru-resize],
1620                         [enable lru resize support]),
1621         [],[enable_lru_resize='yes'])
1622 AC_MSG_RESULT([$enable_lru_resize])
1623 if test x$enable_lru_resize != xno; then
1624    AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
1625 fi
1626 ])
1627
1628 #
1629 # LC_CONFIG_QUOTA
1630 #
1631 # whether to enable quota support
1632 #
1633 AC_DEFUN([LC_CONFIG_QUOTA],
1634 [AC_MSG_CHECKING([whether to disable quota support])
1635 AC_ARG_ENABLE([quota], 
1636         AC_HELP_STRING([--disable-quota],
1637                         [disable quota support]),
1638         [],[enable_quota='yes'])
1639 AC_MSG_RESULT([$enable_quota])
1640 if test x$linux25 != xyes; then
1641    enable_quota='no'
1642 fi
1643 if test x$enable_quota != xno; then
1644    AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
1645 fi
1646 ])
1647  
1648 #
1649 # LC_CONFIG_SPLIT
1650 #
1651 # whether to enable split support
1652 #
1653 AC_DEFUN([LC_CONFIG_SPLIT],
1654 [AC_MSG_CHECKING([whether to enable split support])
1655 AC_ARG_ENABLE([split], 
1656         AC_HELP_STRING([--enable-split],
1657                         [enable split support]),
1658         [],[enable_split='no'])
1659 AC_MSG_RESULT([$enable_split])
1660 if test x$enable_split != xno; then
1661    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1662 fi
1663 ])
1664  
1665 AC_DEFUN([LC_QUOTA_READ],
1666 [AC_MSG_CHECKING([if kernel supports quota_read])
1667 LB_LINUX_TRY_COMPILE([
1668         #include <linux/fs.h>
1669 ],[
1670         struct super_operations sp;
1671         void *i = (void *)sp.quota_read;
1672 ],[
1673         AC_MSG_RESULT([yes])
1674         AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
1675 ],[
1676         AC_MSG_RESULT([no])
1677 ])
1678 ])
1679
1680 #
1681 # LC_COOKIE_FOLLOW_LINK
1682 #
1683 # kernel 2.6.13+ ->follow_link returns a cookie
1684 #
1685
1686 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
1687 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
1688 LB_LINUX_TRY_COMPILE([
1689         #include <linux/fs.h>
1690         #include <linux/namei.h>
1691 ],[
1692         struct dentry dentry;
1693         struct nameidata nd;
1694
1695         dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
1696 ],[
1697         AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
1698         AC_MSG_RESULT([yes])
1699 ],[
1700         AC_MSG_RESULT([no])
1701 ])
1702 ])
1703
1704 #
1705 # LC_FUNC_RCU
1706 #
1707 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE), 
1708 # call_rcu takes three parameters.
1709 #
1710 AC_DEFUN([LC_FUNC_RCU],
1711 [AC_MSG_CHECKING([if kernel have RCU supported])
1712 LB_LINUX_TRY_COMPILE([
1713         #include <linux/rcupdate.h>
1714 ],[],[
1715         AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
1716         AC_MSG_RESULT([yes])
1717
1718         AC_MSG_CHECKING([if call_rcu takes three parameters])
1719         LB_LINUX_TRY_COMPILE([
1720                 #include <linux/rcupdate.h>
1721         ],[
1722                 struct rcu_head rh;
1723                 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
1724         ],[
1725                 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
1726                 AC_MSG_RESULT([yes])
1727         ],[
1728                 AC_MSG_RESULT([no]) 
1729         ])
1730 ],[
1731         AC_MSG_RESULT([no])
1732 ])
1733 ])
1734
1735 #
1736 # LC_CONFIGURE
1737 #
1738 # other configure checks
1739 #
1740 AC_DEFUN([LC_CONFIGURE],
1741 [LC_CONFIG_OBD_BUFFER_SIZE
1742
1743 # include/liblustre.h
1744 AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1745
1746 # liblustre/llite_lib.h
1747 AC_CHECK_HEADERS([xtio.h file.h])
1748
1749 # liblustre/dir.c
1750 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1751
1752 # liblustre/lutil.c
1753 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1754 AC_CHECK_FUNCS([inet_ntoa])
1755
1756 # libsysio/src/readlink.c
1757 LC_READLINK_SSIZE_T
1758
1759 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1760 AC_CHECK_HEADERS([linux/random.h], [], [],
1761                  [#ifdef HAVE_LINUX_TYPES_H
1762                   # include <linux/types.h>
1763                   #endif
1764                  ])
1765
1766 # utils/llverfs.c
1767 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1768
1769 # check for -lz support
1770 ZLIB=""
1771 AC_CHECK_LIB([z],
1772              [adler32],
1773              [AC_CHECK_HEADERS([zlib.h],
1774                                [ZLIB="-lz"
1775                                 AC_DEFINE([HAVE_ADLER], 1,
1776                                           [support alder32 checksum type])],
1777                                [AC_MSG_WARN([No zlib-devel package found,
1778                                              unable to use adler32 checksum])])],
1779              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1780 )
1781 AC_SUBST(ZLIB)
1782
1783 # Super safe df
1784 AC_ARG_ENABLE([mindf],
1785       AC_HELP_STRING([--enable-mindf],
1786                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1787       [],[])
1788 if test "$enable_mindf" = "yes" ;  then
1789       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1790 fi
1791
1792 AC_ARG_ENABLE([fail_alloc],
1793         AC_HELP_STRING([--disable-fail-alloc],
1794                 [disable randomly alloc failure]),
1795         [],[enable_fail_alloc=yes])
1796 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1797 AC_MSG_RESULT([$enable_fail_alloc])
1798 if test x$enable_fail_alloc != xno ; then
1799         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1800 fi
1801
1802 ])
1803
1804 #
1805 # LC_CONDITIONALS
1806 #
1807 # AM_CONDITIONALS for lustre
1808 #
1809 AC_DEFUN([LC_CONDITIONALS],
1810 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1811 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1812 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1813 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1814 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1815 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1816 AM_CONDITIONAL(QUOTA, test x$enable_quota = xyes)
1817 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1818 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1819 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1820 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1821 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1822 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1823 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1824 ])
1825
1826 #
1827 # LC_CONFIG_FILES
1828 #
1829 # files that should be generated with AC_OUTPUT
1830 #
1831 AC_DEFUN([LC_CONFIG_FILES],
1832 [AC_CONFIG_FILES([
1833 lustre/Makefile
1834 lustre/autoMakefile
1835 lustre/autoconf/Makefile
1836 lustre/contrib/Makefile
1837 lustre/doc/Makefile
1838 lustre/include/Makefile
1839 lustre/include/lustre_ver.h
1840 lustre/include/linux/Makefile
1841 lustre/include/lustre/Makefile
1842 lustre/kernel_patches/targets/2.6-vanilla.target
1843 lustre/kernel_patches/targets/2.6-rhel4.target
1844 lustre/kernel_patches/targets/2.6-rhel5.target
1845 lustre/kernel_patches/targets/2.6-fc5.target
1846 lustre/kernel_patches/targets/2.6-patchless.target
1847 lustre/kernel_patches/targets/2.6-sles10.target
1848 lustre/ldlm/Makefile
1849 lustre/fid/Makefile
1850 lustre/fid/autoMakefile
1851 lustre/liblustre/Makefile
1852 lustre/liblustre/tests/Makefile
1853 lustre/llite/Makefile
1854 lustre/llite/autoMakefile
1855 lustre/lov/Makefile
1856 lustre/lov/autoMakefile
1857 lustre/lvfs/Makefile
1858 lustre/lvfs/autoMakefile
1859 lustre/mdc/Makefile
1860 lustre/mdc/autoMakefile
1861 lustre/lmv/Makefile
1862 lustre/lmv/autoMakefile
1863 lustre/mds/Makefile
1864 lustre/mds/autoMakefile
1865 lustre/mdt/Makefile
1866 lustre/mdt/autoMakefile
1867 lustre/cmm/Makefile
1868 lustre/cmm/autoMakefile
1869 lustre/mdd/Makefile
1870 lustre/mdd/autoMakefile
1871 lustre/fld/Makefile
1872 lustre/fld/autoMakefile
1873 lustre/obdclass/Makefile
1874 lustre/obdclass/autoMakefile
1875 lustre/obdclass/linux/Makefile
1876 lustre/obdecho/Makefile
1877 lustre/obdecho/autoMakefile
1878 lustre/obdfilter/Makefile
1879 lustre/obdfilter/autoMakefile
1880 lustre/osc/Makefile
1881 lustre/osc/autoMakefile
1882 lustre/ost/Makefile
1883 lustre/ost/autoMakefile
1884 lustre/osd/Makefile
1885 lustre/osd/autoMakefile
1886 lustre/mgc/Makefile
1887 lustre/mgc/autoMakefile
1888 lustre/mgs/Makefile
1889 lustre/mgs/autoMakefile
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/scripts/version_tag.pl
1898 lustre/tests/Makefile
1899 lustre/utils/Makefile
1900 lustre/utils/gss/Makefile
1901 ])
1902 case $lb_target_os in
1903         darwin)
1904                 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
1905                 ;;
1906 esac
1907
1908 ])