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