Whamcloud - gitweb
553df33a03b4a3f6dac9437159f70918545a31ee
[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 ldiskfs_is_ext4=yes
12 ])
13
14 #
15 # LC_PATH_DEFAULTS
16 #
17 # lustre specific paths
18 #
19 AC_DEFUN([LC_PATH_DEFAULTS],
20 [# ptlrpc kernel build requires this
21 LUSTRE="$PWD/lustre"
22 AC_SUBST(LUSTRE)
23
24 # mount.lustre
25 rootsbindir='/sbin'
26 AC_SUBST(rootsbindir)
27
28 demodir='$(docdir)/demo'
29 AC_SUBST(demodir)
30
31 pkgexampledir='${pkgdatadir}/examples'
32 AC_SUBST(pkgexampledir)
33 ])
34
35 #
36 # LC_TARGET_SUPPORTED
37 #
38 # is the target os supported?
39 #
40 AC_DEFUN([LC_TARGET_SUPPORTED],
41 [case $target_os in
42         linux* | darwin*)
43 $1
44                 ;;
45         *)
46 $2
47                 ;;
48 esac
49 ])
50
51 #
52 # Ensure stack size big than 8k in Lustre server (all kernels)
53 #
54 AC_DEFUN([LC_STACK_SIZE],
55 [AC_MSG_CHECKING([stack size big than 8k])
56 LB_LINUX_TRY_COMPILE([
57         #include <linux/thread_info.h>
58 ],[
59         #if THREAD_SIZE < 8192
60         #error "stack size < 8192"
61         #endif
62 ],[
63         AC_MSG_RESULT(yes)
64 ],[
65         AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
66 ])
67 ])
68
69 #
70 # LC_FUNC_DEV_SET_RDONLY
71 #
72 # check for the old-style dev_set_rdonly which took an extra "devno" param
73 # and can only set a single device to discard writes at one time
74 #
75 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
76 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
77 LB_LINUX_TRY_COMPILE([
78         #include <linux/fs.h>
79         #include <linux/blkdev.h>
80 ],[
81         #ifndef HAVE_CLEAR_RDONLY_ON_PUT
82         #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
83         #endif
84 ],[
85         AC_MSG_RESULT([yes])
86         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
87 ],[
88         AC_MSG_ERROR([no, Linux kernel source needs to be patches by lustre
89 kernel patches from Lustre version 1.4.3 or above.])
90 ])
91 ])
92
93 #
94 # LC_CONFIG_BACKINGFS
95 #
96 # setup, check the backing filesystem
97 #
98 AC_DEFUN([LC_CONFIG_BACKINGFS],
99 [
100 BACKINGFS="ldiskfs"
101
102 if test x$with_ldiskfs = xno ; then
103         if test x$linux25$enable_server = xyesyes ; then
104                 AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
105         fi
106 else
107         # ldiskfs is enabled
108         LB_DEFINE_LDISKFS_OPTIONS
109 fi #ldiskfs
110
111 AC_MSG_CHECKING([which backing filesystem to use])
112 AC_MSG_RESULT([$BACKINGFS])
113 AC_SUBST(BACKINGFS)
114 ])
115
116 #
117 # LC_CONFIG_PINGER
118 #
119 # the pinger is temporary, until we have the recovery node in place
120 #
121 AC_DEFUN([LC_CONFIG_PINGER],
122 [AC_MSG_CHECKING([whether to enable pinger support])
123 AC_ARG_ENABLE([pinger],
124         AC_HELP_STRING([--disable-pinger],
125                         [disable recovery pinger support]),
126         [],[enable_pinger='yes'])
127 AC_MSG_RESULT([$enable_pinger])
128 if test x$enable_pinger != xno ; then
129   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
130 fi
131 ])
132
133 #
134 # LC_CONFIG_CHECKSUM
135 #
136 # do checksum of bulk data between client and OST
137 #
138 AC_DEFUN([LC_CONFIG_CHECKSUM],
139 [AC_MSG_CHECKING([whether to enable data checksum support])
140 AC_ARG_ENABLE([checksum],
141        AC_HELP_STRING([--disable-checksum],
142                        [disable data checksum support]),
143        [],[enable_checksum='yes'])
144 AC_MSG_RESULT([$enable_checksum])
145 if test x$enable_checksum != xno ; then
146   AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
147 fi
148 ])
149
150 #
151 # LC_HEADER_LDISKFS_XATTR
152 #
153 # CHAOS kernel-devel package will not include fs/ldiskfs/xattr.h
154 #
155 AC_DEFUN([LC_HEADER_LDISKFS_XATTR],
156 [AC_MSG_CHECKING([if ldiskfs has xattr.h header])
157 tmp_flags="$EXTRA_KCFLAGS"
158 EXTRA_KCFLAGS="-I$LINUX/fs -I$LDISKFS_DIR -I$LDISKFS_DIR/ldiskfs"
159 LB_LINUX_TRY_COMPILE([
160         #include <ldiskfs/xattr.h>
161 ],[
162         ldiskfs_xattr_get(NULL, 0, "", NULL, 0);
163         ldiskfs_xattr_set_handle(NULL, NULL, 0, "", NULL, 0, 0);
164
165 ],[
166         AC_MSG_RESULT([yes])
167         AC_DEFINE(HAVE_LDISKFS_XATTR_H, 1, [ldiskfs/xattr.h found])
168 ],[
169         AC_MSG_RESULT([no])
170 ])
171 EXTRA_KCFLAGS="$tmp_flags"
172 ])
173
174 #
175 # LC_CONFIG_HEALTH_CHECK_WRITE
176 #
177 # Turn off the actual write to the disk
178 #
179 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
180 [AC_MSG_CHECKING([whether to enable a write with the health check])
181 AC_ARG_ENABLE([health_write],
182         AC_HELP_STRING([--enable-health_write],
183                         [enable disk writes when doing health check]),
184         [],[enable_health_write='no'])
185 AC_MSG_RESULT([$enable_health_write])
186 if test x$enable_health_write != xno ; then
187   AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
188 fi
189 ])
190
191 #
192 # LC_CONFIG_LIBLUSTRE_RECOVERY
193 #
194 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
195 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
196 AC_ARG_ENABLE([liblustre-recovery],
197         AC_HELP_STRING([--disable-liblustre-recovery],
198                         [disable liblustre recovery support]),
199         [],[enable_liblustre_recovery='yes'])
200 AC_MSG_RESULT([$enable_liblustre_recovery])
201 if test x$enable_liblustre_recovery != xno ; then
202   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
203 fi
204 ])
205
206 #
207 # LC_CONFIG_OBD_BUFFER_SIZE
208 #
209 # the maximum buffer size of lctl ioctls
210 #
211 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
212 [AC_MSG_CHECKING([maximum OBD ioctl size])
213 AC_ARG_WITH([obd-buffer-size],
214         AC_HELP_STRING([--with-obd-buffer-size=[size]],
215                         [set lctl ioctl maximum bytes (default=8192)]),
216         [
217                 OBD_BUFFER_SIZE=$with_obd_buffer_size
218         ],[
219                 OBD_BUFFER_SIZE=8192
220         ])
221 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
222 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
223 ])
224
225 #
226 # LC_STRUCT_STATFS
227 #
228 # AIX does not have statfs.f_namelen
229 #
230 AC_DEFUN([LC_STRUCT_STATFS],
231 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
232 LB_LINUX_TRY_COMPILE([
233         #include <linux/vfs.h>
234 ],[
235         struct statfs sfs;
236         sfs.f_namelen = 1;
237 ],[
238         AC_MSG_RESULT([yes])
239         AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
240 ],[
241         AC_MSG_RESULT([no])
242 ])
243 ])
244
245 #
246 # LC_READLINK_SSIZE_T
247 #
248 AC_DEFUN([LC_READLINK_SSIZE_T],
249 [AC_MSG_CHECKING([if readlink returns ssize_t])
250 AC_TRY_COMPILE([
251         #include <unistd.h>
252 ],[
253         ssize_t readlink(const char *, char *, size_t);
254 ],[
255         AC_MSG_RESULT([yes])
256         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
257 ],[
258         AC_MSG_RESULT([no])
259 ])
260 ])
261
262 #
263 # LC_FUNC_MS_FLOCK_LOCK
264 #
265 # 2.6.5 kernel has MS_FLOCK_LOCK sb flag
266 #
267 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
268 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
269 LB_LINUX_TRY_COMPILE([
270         #include <linux/fs.h>
271 ],[
272         int flags = MS_FLOCK_LOCK;
273 ],[
274         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
275                 [kernel has MS_FLOCK_LOCK flag])
276         AC_MSG_RESULT([yes])
277 ],[
278         AC_MSG_RESULT([no])
279 ])
280 ])
281
282 #
283 # LC_FUNC_HAVE_CAN_SLEEP_ARG
284 #
285 # 2.6.5 kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()
286 #
287 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
288 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
289 LB_LINUX_TRY_COMPILE([
290         #include <linux/fs.h>
291 ],[
292         int cansleep;
293         struct file *file;
294         struct file_lock *file_lock;
295         flock_lock_file_wait(file, file_lock, cansleep);
296 ],[
297         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
298                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
299         AC_MSG_RESULT([yes])
300 ],[
301         AC_MSG_RESULT([no])
302 ])
303 ])
304
305 #
306 # LC_FUNC_RELEASEPAGE_WITH_GFP
307 #
308 # 2.6.9 ->releasepage() takes a gfp_t arg
309 # This kernel defines gfp_t (HAS_GFP_T) but doesn't use it for this function,
310 # while others either don't have gfp_t or pass gfp_t as the parameter.
311 #
312 AC_DEFUN([LC_FUNC_RELEASEPAGE_WITH_GFP],
313 [AC_MSG_CHECKING([if releasepage has a gfp_t parameter])
314 RELEASEPAGE_WITH_GFP="$(grep -c 'releasepage.*gfp_t' $LINUX/include/linux/fs.h)"
315 if test "$RELEASEPAGE_WITH_GFP" != 0 ; then
316         AC_DEFINE(HAVE_RELEASEPAGE_WITH_GFP, 1,
317                   [releasepage with gfp_t parameter])
318         AC_MSG_RESULT([yes])
319 else
320         AC_MSG_RESULT([no])
321 fi
322 ])
323
324 #
325 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
326 #
327 AC_DEFUN([LC_FILEMAP_POPULATE],
328 [AC_MSG_CHECKING([for exported filemap_populate])
329 LB_LINUX_TRY_COMPILE([
330         #include <asm/page.h>
331         #include <linux/mm.h>
332 ],[
333        filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
334 ],[
335         AC_MSG_RESULT([yes])
336         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
337 ],[
338         AC_MSG_RESULT([no])
339 ])
340 ])
341
342 #
343 # added in 2.6.15
344 #
345 AC_DEFUN([LC_D_ADD_UNIQUE],
346 [AC_MSG_CHECKING([for d_add_unique])
347 LB_LINUX_TRY_COMPILE([
348         #include <linux/dcache.h>
349 ],[
350        d_add_unique(NULL, NULL);
351 ],[
352         AC_MSG_RESULT([yes])
353         AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
354 ],[
355         AC_MSG_RESULT([no])
356 ])
357 ])
358
359 #
360 # added in 2.6.17
361 #
362 AC_DEFUN([LC_BIT_SPINLOCK_H],
363 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
364         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
365         LB_LINUX_TRY_COMPILE([
366                 #include <asm/processor.h>
367                 #include <linux/spinlock.h>
368                 #include <linux/bit_spinlock.h>
369         ],[],[
370                 AC_MSG_RESULT([yes])
371                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
372         ],[
373                 AC_MSG_RESULT([no])
374         ])
375 ],
376 [])
377 ])
378
379 #
380 # After 2.6.26 we no longer have xattr_acl.h
381 #
382 AC_DEFUN([LC_XATTR_ACL],
383 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
384         AC_MSG_CHECKING([if xattr_acl.h can be compiled])
385         LB_LINUX_TRY_COMPILE([
386                 #include <linux/xattr_acl.h>
387         ],[],[
388                 AC_MSG_RESULT([yes])
389                 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
390         ],[
391                 AC_MSG_RESULT([no])
392         ])
393 ],
394 [])
395 ])
396
397
398 # added in 2.6.16
399 #
400 AC_DEFUN([LC_STRUCT_INTENT_FILE],
401 [AC_MSG_CHECKING([if struct open_intent has a file field])
402 LB_LINUX_TRY_COMPILE([
403         #include <linux/fs.h>
404         #include <linux/namei.h>
405 ],[
406         struct open_intent intent;
407         &intent.file;
408 ],[
409         AC_MSG_RESULT([yes])
410         AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
411 ],[
412         AC_MSG_RESULT([no])
413 ])
414 ])
415
416
417 #
418 # After 2.6.16 the xattr_acl API is removed, and posix_acl is used instead
419 #
420 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
421 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
422         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
423         LB_LINUX_TRY_COMPILE([
424                 #include <linux/posix_acl_xattr.h>
425         ],[],[
426                 AC_MSG_RESULT([yes])
427                 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
428
429         ],[
430                 AC_MSG_RESULT([no])
431         ])
432 $1
433 ],[
434 AC_MSG_RESULT([no])
435 ])
436 ])
437
438 #
439 # LC_EXPORT___IGET
440 # starting from 2.6.19 linux kernel exports __iget()
441 #
442 AC_DEFUN([LC_EXPORT___IGET],
443 [LB_CHECK_SYMBOL_EXPORT([__iget],
444 [fs/inode.c],[
445         AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
446 ],[
447 ])
448 ])
449
450 #
451 # only for Lustre-patched kernels
452 #
453 AC_DEFUN([LC_LUSTRE_VERSION_H],
454 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
455         rm -f "$LUSTRE/include/linux/lustre_version.h"
456 ],[
457         touch "$LUSTRE/include/linux/lustre_version.h"
458         if test x$enable_server = xyes ; then
459                 AC_MSG_WARN([Unpatched kernel detected.])
460                 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
461                 AC_MSG_WARN([disabling server build])
462                 enable_server='no'
463         fi
464 ])
465 ])
466
467 #
468 # LC_CAPA_CRYPTO
469 #
470 AC_DEFUN([LC_CAPA_CRYPTO],
471 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
472         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
473 ])
474 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
475         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
476 ])
477 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
478         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
479 ])
480 ])
481
482 #
483 # LC_CONFIG_RMTCLIENT
484 #
485 dnl FIXME
486 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
487 dnl FIXME
488 AC_DEFUN([LC_CONFIG_RMTCLIENT],
489 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
490         AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
491 ])
492 ])
493
494 AC_DEFUN([LC_SUNRPC_CACHE],
495 [AC_MSG_CHECKING([if sunrpc struct cache_head uses kref])
496 LB_LINUX_TRY_COMPILE([
497         #include <linux/sunrpc/cache.h>
498 ],[
499         struct cache_head ch;
500         &ch.ref.refcount;
501 ],[
502         AC_MSG_RESULT([yes])
503         AC_DEFINE(HAVE_SUNRPC_CACHE_V2, 1, [sunrpc cache facility v2])
504 ],[
505         AC_MSG_RESULT([no])
506 ])
507 ])
508
509 AC_DEFUN([LC_CONFIG_SUNRPC],
510 [LB_LINUX_CONFIG_IM([SUNRPC],[],
511                     [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
512  LC_SUNRPC_CACHE
513 ])
514
515 #
516 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
517 #
518 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
519 [AC_MSG_CHECKING([whether to enable gss keyring backend])
520  AC_ARG_ENABLE([gss_keyring],
521                [AC_HELP_STRING([--disable-gss-keyring],
522                                [disable gss keyring backend])],
523                [],[enable_gss_keyring='yes'])
524  AC_MSG_RESULT([$enable_gss_keyring])
525
526  if test x$enable_gss_keyring != xno; then
527         LB_LINUX_CONFIG_IM([KEYS],[],
528                            [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
529
530         AC_CHECK_LIB([keyutils], [keyctl_search], [],
531                      [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
532
533         AC_DEFINE([HAVE_GSS_KEYRING], [1],
534                   [Define this if you enable gss keyring backend])
535  fi
536 ])
537
538 #
539 # LC_CONFIG_GSS (default disabled)
540 #
541 # Build gss and related tools of Lustre. Currently both kernel and user space
542 # parts are depend on linux platform.
543 #
544 AC_DEFUN([LC_CONFIG_GSS],
545 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
546  AC_ARG_ENABLE([gss],
547                [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
548                [],[enable_gss='no'])
549  AC_MSG_RESULT([$enable_gss])
550
551  if test x$enable_gss == xyes; then
552         LC_CONFIG_GSS_KEYRING
553         LC_CONFIG_SUNRPC
554
555         AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
556
557         LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
558                            [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
559         LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
560                            [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
561         LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
562                            [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
563         LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
564                            [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
565
566         AC_CHECK_LIB([gssapi], [gss_init_sec_context],
567                      [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
568                      [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
569                                    [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
570                                    [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
571
572         AC_SUBST(GSSAPI_LIBS)
573
574         AC_KERBEROS_V5
575  fi
576 ])
577
578 # LC_EXPORT_SYNCHRONIZE_RCU
579 # after 2.6.12 synchronize_rcu is preferred over synchronize_kernel
580 AC_DEFUN([LC_EXPORT_SYNCHRONIZE_RCU],
581 [LB_CHECK_SYMBOL_EXPORT([synchronize_rcu],
582 [kernel/rcupdate.c],[
583         AC_DEFINE(HAVE_SYNCHRONIZE_RCU, 1,
584                 [in 2.6.12 synchronize_rcu preferred over synchronize_kernel])
585 ],[
586 ])
587 ])
588
589 # LC_INODE_I_MUTEX
590 # after 2.6.15 inode have i_mutex intead of i_sem
591 AC_DEFUN([LC_INODE_I_MUTEX],
592 [AC_MSG_CHECKING([if inode has i_mutex ])
593 LB_LINUX_TRY_COMPILE([
594         #include <linux/mutex.h>
595         #include <linux/fs.h>
596         #undef i_mutex
597 ],[
598         struct inode i;
599
600         mutex_unlock(&i.i_mutex);
601 ],[
602         AC_MSG_RESULT(yes)
603         AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
604                 [after 2.6.15 inode have i_mutex intead of i_sem])
605 ],[
606         AC_MSG_RESULT(no)
607 ])
608 ])
609
610 # LC_SEQ_LOCK
611 # after 2.6.18 seq_file has lock intead of sem
612 AC_DEFUN([LC_SEQ_LOCK],
613 [AC_MSG_CHECKING([if struct seq_file has lock field])
614 LB_LINUX_TRY_COMPILE([
615         #include <linux/seq_file.h>
616 ],[
617         struct seq_file seq;
618
619         mutex_unlock(&seq.lock);
620 ],[
621         AC_MSG_RESULT(yes)
622         AC_DEFINE(HAVE_SEQ_LOCK, 1,
623                 [after 2.6.18 seq_file has lock intead of sem])
624 ],[
625         AC_MSG_RESULT(NO)
626 ])
627 ])
628
629 # LC_DQUOTOFF_MUTEX
630 # after 2.6.17 dquote use mutex instead if semaphore
631 AC_DEFUN([LC_DQUOTOFF_MUTEX],
632 [AC_MSG_CHECKING([use dqonoff_mutex])
633 LB_LINUX_TRY_COMPILE([
634         #include <linux/mutex.h>
635         #include <linux/fs.h>
636         #include <linux/quota.h>
637 ],[
638         struct quota_info dq;
639
640         mutex_unlock(&dq.dqonoff_mutex);
641 ],[
642         AC_MSG_RESULT(yes)
643         AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
644                 [after 2.6.17 dquote use mutex instead if semaphore])
645 ],[
646         AC_MSG_RESULT(no)
647 ])
648 ])
649
650 #
651 # LC_STATFS_DENTRY_PARAM
652 # starting from 2.6.18 linux kernel uses dentry instead of
653 # super_block for first vfs_statfs argument
654 #
655 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
656 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
657 LB_LINUX_TRY_COMPILE([
658         #include <linux/fs.h>
659 ],[
660         int vfs_statfs(struct dentry *, struct kstatfs *);
661 ],[
662         AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
663                 [first parameter of vfs_statfs is dentry])
664         AC_MSG_RESULT([yes])
665 ],[
666         AC_MSG_RESULT([no])
667 ])
668 ])
669
670 #
671 # LC_VFS_KERN_MOUNT
672 # starting from 2.6.18 kernel don't export do_kern_mount
673 # and want to use vfs_kern_mount instead.
674 #
675 AC_DEFUN([LC_VFS_KERN_MOUNT],
676 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
677 LB_LINUX_TRY_COMPILE([
678         #include <linux/mount.h>
679 ],[
680         vfs_kern_mount(NULL, 0, NULL, NULL);
681 ],[
682         AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
683                 [vfs_kern_mount exist in kernel])
684         AC_MSG_RESULT([yes])
685 ],[
686         AC_MSG_RESULT([no])
687 ])
688 ])
689
690 #
691 # LC_INVALIDATEPAGE_RETURN_INT
692 # 2.6.17 changes return type for invalidatepage to 'void' from 'int'
693 #
694 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
695 [AC_MSG_CHECKING([invalidatepage has return int])
696 LB_LINUX_TRY_COMPILE([
697         #include <linux/buffer_head.h>
698 ],[
699         int rc = block_invalidatepage(NULL, 0);
700 ],[
701         AC_MSG_RESULT(yes)
702         AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
703                 [Define if return type of invalidatepage should be int])
704 ],[
705         AC_MSG_RESULT(no)
706 ])
707 ])
708
709 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
710 # after 2.6.18 umount_begin has different parameters
711 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
712 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
713 tmp_flags="$EXTRA_KCFLAGS"
714 EXTRA_KCFLAGS="-Werror"
715 LB_LINUX_TRY_COMPILE([
716         #include <linux/fs.h>
717
718         struct vfsmount;
719         static void cfg_umount_begin (struct vfsmount *v, int flags)
720         {
721                 ;
722         }
723
724         static struct super_operations cfg_super_operations = {
725                 .umount_begin   = cfg_umount_begin,
726         };
727 ],[
728         cfg_super_operations.umount_begin(NULL,0);
729 ],[
730         AC_MSG_RESULT(yes)
731         AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
732                 [Define umount_begin need second argument])
733 ],[
734         AC_MSG_RESULT(no)
735 ])
736 EXTRA_KCFLAGS="$tmp_flags"
737 ])
738
739 # inode have i_private field since 2.6.17
740 AC_DEFUN([LC_INODE_IPRIVATE],
741 [AC_MSG_CHECKING([if inode has a i_private field])
742 LB_LINUX_TRY_COMPILE([
743 #include <linux/fs.h>
744 ],[
745         struct inode i;
746         i.i_private = NULL; 
747 ],[
748         AC_MSG_RESULT(yes)
749         AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
750                 [struct inode has i_private field])
751 ],[
752         AC_MSG_RESULT(no)
753 ])
754 ])
755
756 # 2.6.19 API changes
757 # inode don't have i_blksize field
758 AC_DEFUN([LC_INODE_BLKSIZE],
759 [AC_MSG_CHECKING([inode has i_blksize field])
760 LB_LINUX_TRY_COMPILE([
761 #include <linux/fs.h>
762 ],[
763         struct inode i;
764         i.i_blksize = 0;
765 ],[
766         AC_MSG_RESULT(yes)
767         AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
768                 [struct inode has i_blksize field])
769 ],[
770         AC_MSG_RESULT(no)
771 ])
772 ])
773
774 # LC_VFS_READDIR_U64_INO
775 # 2.6.19 use u64 for inode number instead of inode_t
776 AC_DEFUN([LC_VFS_READDIR_U64_INO],
777 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
778 tmp_flags="$EXTRA_KCFLAGS"
779 EXTRA_KCFLAGS="-Werror"
780 LB_LINUX_TRY_COMPILE([
781 #include <linux/fs.h>
782         int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
783                       u64 ino, unsigned int d_type)
784         {
785                 return 0;
786         }
787 ],[
788         filldir_t filter;
789
790         filter = fillonedir;
791         return 1;
792 ],[
793         AC_MSG_RESULT(yes)
794         AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
795                 [if vfs_readdir need 64bit inode number])
796 ],[
797         AC_MSG_RESULT(no)
798 ])
799 EXTRA_KCFLAGS="$tmp_flags"
800 ])
801
802 # LC_FILE_WRITEV
803 # 2.6.19 replaced writev with aio_write
804 AC_DEFUN([LC_FILE_WRITEV],
805 [AC_MSG_CHECKING([writev in fops])
806 LB_LINUX_TRY_COMPILE([
807         #include <linux/fs.h>
808 ],[
809         struct file_operations *fops = NULL;
810         fops->writev = NULL;
811 ],[
812         AC_MSG_RESULT(yes)
813         AC_DEFINE(HAVE_FILE_WRITEV, 1,
814                 [use fops->writev])
815 ],[
816         AC_MSG_RESULT(no)
817 ])
818 ])
819
820 # LC_GENERIC_FILE_READ
821 # 2.6.19 replaced readv with aio_read
822 AC_DEFUN([LC_FILE_READV],
823 [AC_MSG_CHECKING([readv in fops])
824 LB_LINUX_TRY_COMPILE([
825         #include <linux/fs.h>
826 ],[
827         struct file_operations *fops = NULL;
828         fops->readv = NULL;
829 ],[
830         AC_MSG_RESULT(yes)
831         AC_DEFINE(HAVE_FILE_READV, 1,
832                 [use fops->readv])
833 ],[
834         AC_MSG_RESULT(no)
835 ])
836 ])
837
838 # LC_NR_PAGECACHE
839 # 2.6.18 don't export nr_pagecahe
840 AC_DEFUN([LC_NR_PAGECACHE],
841 [AC_MSG_CHECKING([kernel export nr_pagecache])
842 LB_LINUX_TRY_COMPILE([
843         #include <linux/pagemap.h>
844 ],[
845         return atomic_read(&nr_pagecache);
846 ],[
847         AC_MSG_RESULT(yes)
848         AC_DEFINE(HAVE_NR_PAGECACHE, 1,
849                 [is kernel export nr_pagecache])
850 ],[
851         AC_MSG_RESULT(no)
852 ])
853 ])
854
855 # LC_CANCEL_DIRTY_PAGE
856 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
857 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
858         [AC_MSG_CHECKING([kernel has cancel_dirty_page])
859         # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
860         # backport is broken, so ignore it
861         if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
862            test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e  -"; then
863                 AC_MSG_RESULT(no)
864         else
865                 LB_LINUX_TRY_COMPILE([
866                         #include <linux/mm.h>
867                         #include <linux/page-flags.h>
868 ],[
869                         cancel_dirty_page(NULL, 0);
870 ],[
871                         AC_MSG_RESULT(yes)
872                         AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
873                                   [kernel has cancel_dirty_page instead of clear_page_dirty])
874 ],[
875                         AC_MSG_RESULT(no)
876 ])
877         fi
878 ])
879
880 #
881 # LC_PAGE_CONSTANT
882 #
883 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
884 # it support constant page, which means the page won't be modified during the
885 # IO.
886 #
887 AC_DEFUN([LC_PAGE_CONSTANT],
888 [AC_MSG_CHECKING([if kernel have PageConstant defined])
889 LB_LINUX_TRY_COMPILE([
890         #include <linux/mm.h>
891         #include <linux/page-flags.h>
892 ],[
893         #ifndef PG_constant
894         #error "Have no raid5 zcopy patch"
895         #endif
896 ],[
897         AC_MSG_RESULT(yes)
898         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
899 ],[
900         AC_MSG_RESULT(no);
901 ])
902 ])
903
904 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
905 AC_DEFUN([LC_PG_FS_MISC],
906 [AC_MSG_CHECKING([kernel has PG_fs_misc])
907 LB_LINUX_TRY_COMPILE([
908         #include <linux/mm.h>
909         #include <linux/page-flags.h>
910 ],[
911         #ifndef PG_fs_misc
912         #error PG_fs_misc not defined in kernel
913         #endif
914 ],[
915         AC_MSG_RESULT(yes)
916         AC_DEFINE(HAVE_PG_FS_MISC, 1,
917                   [is kernel have PG_fs_misc])
918 ],[
919         AC_MSG_RESULT(no)
920 ])
921 ])
922
923 # RHEL5 PageChecked and SetPageChecked defined
924 AC_DEFUN([LC_PAGE_CHECKED],
925 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
926 LB_LINUX_TRY_COMPILE([
927         #include <linux/autoconf.h>
928 #ifdef HAVE_LINUX_MMTYPES_H
929         #include <linux/mm_types.h>
930 #endif
931         #include <linux/page-flags.h>
932 ],[
933         struct page *p;
934
935         /* before 2.6.26 this define*/
936         #ifndef PageChecked     
937         /* 2.6.26 use function instead of define for it */
938         SetPageChecked(p);
939         PageChecked(p);
940         #endif
941 ],[
942         AC_MSG_RESULT(yes)
943         AC_DEFINE(HAVE_PAGE_CHECKED, 1,
944                   [does kernel have PageChecked and SetPageChecked])
945 ],[
946         AC_MSG_RESULT(no)
947 ])
948 ])
949
950 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
951 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
952 [mm/truncate.c],[
953 AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
954             [kernel export truncate_complete_page])
955 ],[
956 ])
957 ])
958
959 AC_DEFUN([LC_EXPORT_TRUNCATE_RANGE],
960 [LB_CHECK_SYMBOL_EXPORT([truncate_inode_pages_range],
961 [mm/truncate.c],[
962 AC_DEFINE(HAVE_TRUNCATE_RANGE, 1,
963             [kernel export truncate_inode_pages_range])
964 ],[
965 ])
966 ])
967
968 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
969 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
970 [fs/dcache.c],[
971 AC_DEFINE(HAVE_D_REHASH_COND, 1,
972             [d_rehash_cond is exported by the kernel])
973 ],[
974 ])
975 ])
976
977 AC_DEFUN([LC_EXPORT___D_REHASH],
978 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
979 [fs/dcache.c],[
980 AC_DEFINE(HAVE___D_REHASH, 1,
981             [__d_rehash is exported by the kernel])
982 ],[
983 ])
984 ])
985
986 AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
987 [LB_CHECK_SYMBOL_EXPORT([d_move_locked],
988 [fs/dcache.c],[
989 AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
990             [d_move_locked is exported by the kernel])
991 ],[
992 ])
993 ])
994
995 AC_DEFUN([LC_EXPORT___D_MOVE],
996 [LB_CHECK_SYMBOL_EXPORT([__d_move],
997 [fs/dcache.c],[
998 AC_DEFINE(HAVE___D_MOVE, 1,
999             [__d_move is exported by the kernel])
1000 ],[
1001 ])
1002 ])
1003
1004 #
1005 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
1006 #
1007 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
1008 # SLES10 2.6.16 does not, for some reason.  For filter cache invalidation.
1009 #
1010 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
1011     [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
1012          AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
1013                         [exported invalidate_mapping_pages])],
1014     [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
1015          AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
1016                         [exported invalidate_inode_pages])], [
1017        AC_MSG_ERROR([no way to invalidate pages])
1018   ])
1019     ],[])
1020 ])
1021
1022 #
1023 # LC_EXPORT_FILEMAP_FDATASYNC_RANGE
1024 #
1025 # No standard kernels export this
1026 #
1027 AC_DEFUN([LC_EXPORT_FILEMAP_FDATAWRITE_RANGE],
1028 [LB_CHECK_SYMBOL_EXPORT([filemap_fdatawrite_range],
1029 [mm/filemap.c],[
1030 AC_DEFINE(HAVE_FILEMAP_FDATAWRITE_RANGE, 1,
1031             [filemap_fdatawrite_range is exported by the kernel])
1032 ],[
1033 ])
1034 ])
1035
1036 # The actual symbol exported varies among architectures, so we need
1037 # to check many symbols (but only in the current architecture.)  No
1038 # matter what symbol is exported, the kernel #defines node_to_cpumask
1039 # to the appropriate function and that's what we use.
1040 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
1041          [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
1042                                  [arch/$LINUX_ARCH/mm/numa.c],
1043                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1044                                             [node_to_cpumask is exported by
1045                                              the kernel])]) # x86_64
1046           LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
1047                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1048                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1049                                             [node_to_cpumask is exported by
1050                                              the kernel])]) # ia64
1051           LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
1052                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1053                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1054                                             [node_to_cpumask is exported by
1055                                              the kernel])]) # i386
1056           ])
1057
1058 # 2.6.22 lost second parameter for invalidate_bdev
1059 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
1060 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
1061 LB_LINUX_TRY_COMPILE([
1062         #include <linux/buffer_head.h>
1063 ],[
1064         invalidate_bdev(NULL,0);
1065 ],[
1066         AC_MSG_RESULT([yes])
1067         AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1068                 [invalidate_bdev has second argument])
1069 ],[
1070         AC_MSG_RESULT([no])
1071 ])
1072 ])
1073
1074 # 2.6.18
1075
1076
1077 # 2.6.23 have return type 'void' for unregister_blkdev
1078 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1079 [AC_MSG_CHECKING([if unregister_blkdev return int])
1080 LB_LINUX_TRY_COMPILE([
1081         #include <linux/fs.h>
1082 ],[
1083         int i = unregister_blkdev(0,NULL);
1084 ],[
1085         AC_MSG_RESULT([yes])
1086         AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1087                 [unregister_blkdev return int])
1088 ],[
1089         AC_MSG_RESULT([no])
1090 ])
1091 ])
1092
1093 # 2.6.23 change .sendfile to .splice_read
1094 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1095 AC_DEFUN([LC_KERNEL_SENDFILE],
1096 [AC_MSG_CHECKING([if kernel has .sendfile])
1097 LB_LINUX_TRY_COMPILE([
1098         #include <linux/fs.h>
1099 ],[
1100         struct file_operations file;
1101
1102         file.sendfile = NULL;
1103 ], [
1104         AC_MSG_RESULT([yes])
1105         AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1106                 [kernel has .sendfile])
1107 ],[
1108         AC_MSG_RESULT([no])
1109 ])
1110 ])
1111
1112 # 2.6.23 change .sendfile to .splice_read
1113 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1114 [AC_MSG_CHECKING([if kernel has .splice_read])
1115 LB_LINUX_TRY_COMPILE([
1116         #include <linux/fs.h>
1117 ],[
1118         struct file_operations file;
1119
1120         file.splice_read = NULL;
1121 ], [
1122         AC_MSG_RESULT([yes])
1123         AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1124                 [kernel has .slice_read])
1125 ],[
1126         AC_MSG_RESULT([no])
1127 ])
1128 ])
1129
1130 # 2.6.23 extract nfs export related data into exportfs.h
1131 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1132 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1133         AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1134                 [kernel has include/exportfs.h])
1135 ],[
1136         AC_MSG_RESULT([no])
1137 ])
1138 ])
1139
1140 # 2.6.23 has new page fault handling API
1141 AC_DEFUN([LC_VM_OP_FAULT],
1142 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1143 LB_LINUX_TRY_COMPILE([
1144         #include <linux/mm.h>
1145 ],[
1146         struct vm_operations_struct op;
1147
1148         op.fault = NULL;
1149 ], [
1150         AC_MSG_RESULT([yes])
1151         AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1152                 [kernel has .fault in vm_operation_struct])
1153 ],[
1154         AC_MSG_RESULT([no])
1155 ])
1156 ])
1157
1158 #2.6.23 has new shrinker API
1159 AC_DEFUN([LC_REGISTER_SHRINKER],
1160 [AC_MSG_CHECKING([if kernel has register_shrinker])
1161 LB_LINUX_TRY_COMPILE([
1162         #include <linux/mm.h>
1163 ],[
1164         register_shrinker(NULL);
1165 ], [
1166         AC_MSG_RESULT([yes])
1167         AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
1168                 [kernel has register_shrinker])
1169 ],[
1170         AC_MSG_RESULT([no])
1171 ])
1172 ])
1173
1174 # 2.6.24 has bio_endio with 2 args
1175 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1176 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1177 LB_LINUX_TRY_COMPILE([
1178         #include <linux/bio.h>
1179 ],[
1180         bio_endio(NULL, 0);
1181 ], [
1182         AC_MSG_RESULT([yes])
1183         AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1184                 [kernel has bio_endio with 2 args])
1185 ],[
1186         AC_MSG_RESULT([no])
1187 ])
1188 ])
1189
1190 # 2.6.24 has new members in exports struct.
1191 AC_DEFUN([LC_FH_TO_DENTRY],
1192 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1193 LB_LINUX_TRY_COMPILE([
1194 #ifdef HAVE_LINUX_EXPORTFS_H
1195         #include <linux/exportfs.h>
1196 #else
1197         #include <linux/fs.h>
1198 #endif
1199 ],[
1200         struct export_operations exp;
1201
1202         exp.fh_to_dentry   = NULL;
1203 ], [
1204         AC_MSG_RESULT([yes])
1205         AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1206                 [kernel has .fh_to_dentry member in export_operations struct])
1207 ],[
1208         AC_MSG_RESULT([no])
1209 ])
1210 ])
1211
1212 # 2.6.24 need linux/mm_types.h included
1213 AC_DEFUN([LC_HAVE_MMTYPES_H],
1214 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1215         AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1216                 [kernel has include/mm_types.h])
1217 ],[
1218         AC_MSG_RESULT([no])
1219 ])
1220 ])
1221
1222 # 2.6.24 removes long aged procfs entry -> deleted member
1223 AC_DEFUN([LC_PROCFS_DELETED],
1224 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1225 LB_LINUX_TRY_COMPILE([
1226         #include <linux/proc_fs.h>
1227 ],[
1228         struct proc_dir_entry pde;
1229
1230         pde.deleted   = NULL;
1231 ], [
1232         AC_MSG_RESULT([yes])
1233         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1234                 [kernel has deleted member in procfs entry struct])
1235 ],[
1236         AC_MSG_RESULT([no])
1237 ])
1238 ])
1239
1240 # 2.6.25 change define to inline
1241 AC_DEFUN([LC_MAPPING_CAP_WRITEBACK_DIRTY],
1242 [AC_MSG_CHECKING([if kernel have mapping_cap_writeback_dirty])
1243 LB_LINUX_TRY_COMPILE([
1244         #include <linux/backing-dev.h>
1245 ],[
1246         #ifndef mapping_cap_writeback_dirty
1247         mapping_cap_writeback_dirty(NULL);
1248         #endif
1249 ],[
1250         AC_MSG_RESULT([yes])
1251         AC_DEFINE(HAVE_MAPPING_CAP_WRITEBACK_DIRTY, 1,
1252                 [kernel have mapping_cap_writeback_dirty])
1253 ],[
1254         AC_MSG_RESULT([no])
1255 ])
1256 ])
1257
1258
1259
1260 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1261 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1262 [AC_MSG_CHECKING([fs_struct use path structure])
1263 LB_LINUX_TRY_COMPILE([
1264         #include <asm/atomic.h>
1265         #include <linux/spinlock.h>
1266         #include <linux/fs_struct.h>
1267 ],[
1268         struct path path;
1269         struct fs_struct fs;
1270
1271         fs.pwd = path;
1272 ], [
1273         AC_MSG_RESULT([yes])
1274         AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1275                 [fs_struct use path structure])
1276 ],[
1277         AC_MSG_RESULT([no])
1278 ])
1279 ])
1280
1281 #
1282 # LC_VFS_INTENT_PATCHES
1283 #
1284 # check if the kernel has the VFS intent patches
1285 AC_DEFUN([LC_VFS_INTENT_PATCHES],
1286 [AC_MSG_CHECKING([if the kernel has the VFS intent patches])
1287 LB_LINUX_TRY_COMPILE([
1288         #include <linux/fs.h>
1289         #include <linux/namei.h>
1290 ],[
1291         struct nameidata nd;
1292         struct lookup_intent *it;
1293
1294         it = &nd.intent;
1295         intent_init(it, IT_OPEN);
1296         it->d.lustre.it_disposition = 0;
1297         it->d.lustre.it_data = NULL;
1298 ],[
1299         AC_MSG_RESULT([yes])
1300         AC_DEFINE(HAVE_VFS_INTENT_PATCHES, 1, [VFS intent patches are applied])
1301 ],[
1302         AC_MSG_RESULT([no])
1303 ])
1304 ])
1305
1306 AC_DEFUN([LC_S_TIME_GRAN],
1307 [AC_MSG_CHECKING([if super block has s_time_gran member])
1308 LB_LINUX_TRY_COMPILE([
1309         #include <linux/fs.h>
1310 ],[
1311         struct super_block sb;
1312
1313         return sb.s_time_gran;
1314 ],[
1315         AC_MSG_RESULT([yes])
1316         AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
1317 ],[
1318         AC_MSG_RESULT([no])
1319 ])
1320 ])
1321
1322 AC_DEFUN([LC_SB_TIME_GRAN],
1323 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
1324 LB_LINUX_TRY_COMPILE([
1325         #include <linux/fs.h>
1326 ],[
1327         return get_sb_time_gran(NULL);
1328 ],[
1329         AC_MSG_RESULT([yes])
1330         AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
1331 ],[
1332         AC_MSG_RESULT([no])
1333 ])
1334 ])
1335
1336 #
1337 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1338 #
1339 # Check for our patched grab_cache_page_nowait_gfp() function
1340 # after 2.6.29 we can emulate this using add_to_page_cache_lru()
1341 #
1342 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
1343 [LB_CHECK_SYMBOL_EXPORT([grab_cache_page_nowait_gfp],
1344 [mm/filemap.c],[
1345         AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
1346                   [kernel exports grab_cache_page_nowait_gfp])
1347         ],
1348         [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1349         [mm/filemap.c],[
1350                 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1351                         [kernel exports add_to_page_cache_lru])
1352         ],[
1353         ])
1354         ])
1355 ])
1356
1357 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
1358 AC_DEFUN([LC_RW_TREE_LOCK],
1359 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
1360 tmp_flags="$EXTRA_KCFLAGS"
1361 EXTRA_KCFLAGS="-Werror"
1362 LB_LINUX_TRY_COMPILE([
1363         #include <linux/fs.h>
1364 ],[
1365         struct address_space a;
1366
1367         write_lock(&a.tree_lock);
1368 ],[
1369         AC_MSG_RESULT([yes])
1370         AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
1371 ],[
1372         AC_MSG_RESULT([no])
1373 ])
1374 EXTRA_KCFLAGS="$tmp_flags"
1375 ])
1376
1377 AC_DEFUN([LC_CONST_ACL_SIZE],
1378 [AC_MSG_CHECKING([calc acl size])
1379 tmp_flags="$CFLAGS"
1380 CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 $EXTRA_KCFLAGS"
1381 AC_TRY_RUN([
1382 #define __KERNEL__
1383 #include <linux/autoconf.h>
1384 #include <linux/types.h>
1385 #undef __KERNEL__
1386 // block include
1387 #define __LINUX_POSIX_ACL_H
1388
1389 # ifdef CONFIG_FS_POSIX_ACL
1390 #  ifdef HAVE_XATTR_ACL
1391 #   include <linux/xattr_acl.h>
1392 #  endif
1393 #  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
1394 #   include <linux/posix_acl_xattr.h>
1395 #  endif
1396 # endif
1397
1398 #include <lustre_acl.h>
1399
1400 #include <stdio.h>
1401
1402 int main(void)
1403 {
1404     int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
1405     FILE *f = fopen("acl.size","w+");
1406     fprintf(f,"%d", size);
1407     fclose(f);
1408
1409     return 0;
1410 }
1411
1412 ],[
1413         acl_size=`cat acl.size`
1414         AC_MSG_RESULT([ACL size $acl_size])
1415         AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
1416 ],[
1417         AC_ERROR([ACL size can't computed])
1418 ])
1419 CFLAGS="$tmp_flags"
1420 ])
1421
1422 #
1423 # check for crypto API
1424 #
1425 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
1426 [AC_MSG_CHECKING([if kernel has block cipher support])
1427 LB_LINUX_TRY_COMPILE([
1428         #include <linux/err.h>
1429         #include <linux/crypto.h>
1430 ],[
1431         struct crypto_blkcipher *tfm;
1432         tfm = crypto_alloc_blkcipher("aes", 0, 0 );
1433 ],[
1434         AC_MSG_RESULT([yes])
1435         AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
1436 ],[
1437         AC_MSG_RESULT([no])
1438 ])
1439 ])
1440
1441 #
1442 # check for struct hash_desc
1443 #
1444 AC_DEFUN([LC_STRUCT_HASH_DESC],
1445 [AC_MSG_CHECKING([if kernel has struct hash_desc])
1446 LB_LINUX_TRY_COMPILE([
1447         #include <linux/err.h>
1448         #include <linux/crypto.h>
1449 ],[
1450         struct hash_desc foo;
1451 ],[
1452         AC_MSG_RESULT([yes])
1453         AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
1454 ],[
1455         AC_MSG_RESULT([no])
1456 ])
1457 ])
1458
1459 #
1460 # check for struct blkcipher_desc
1461 #
1462 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
1463 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
1464 LB_LINUX_TRY_COMPILE([
1465         #include <linux/err.h>
1466         #include <linux/crypto.h>
1467 ],[
1468         struct blkcipher_desc foo;
1469 ],[
1470         AC_MSG_RESULT([yes])
1471         AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
1472 ],[
1473         AC_MSG_RESULT([no])
1474 ])
1475 ])
1476
1477 #
1478 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
1479 #
1480 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
1481 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
1482 LB_LINUX_TRY_COMPILE([
1483         #include <linux/fs.h>
1484 ],[
1485         int v = FS_RENAME_DOES_D_MOVE;
1486 ],[
1487         AC_MSG_RESULT([yes])
1488         AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1489 ],[
1490         AC_MSG_RESULT([no])
1491 ])
1492 ])
1493
1494 #
1495 # LC_FUNC_F_OP_FLOCK
1496 #
1497 # rhel4.2 kernel has f_op->flock field
1498 #
1499 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
1500 [AC_MSG_CHECKING([if struct file_operations has flock field])
1501 LB_LINUX_TRY_COMPILE([
1502         #include <linux/fs.h>
1503 ],[
1504         struct file_operations ll_file_operations_flock;
1505         ll_file_operations_flock.flock = NULL;
1506 ],[
1507         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
1508                 [struct file_operations has flock field])
1509         AC_MSG_RESULT([yes])
1510 ],[
1511         AC_MSG_RESULT([no])
1512 ])
1513 ])
1514
1515 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
1516 # "mode" argument was added, but then again, in some later version it was
1517 # removed
1518 AC_DEFUN([LC_4ARGS_VFS_SYMLINK],
1519 [AC_MSG_CHECKING([if vfs_symlink wants 4 args])
1520 LB_LINUX_TRY_COMPILE([
1521         #include <linux/fs.h>
1522 ],[
1523         struct inode *dir;
1524         struct dentry *dentry;
1525         const char *oldname = NULL;
1526         int mode = 0;
1527
1528         vfs_symlink(dir, dentry, oldname, mode);
1529 ],[
1530         AC_MSG_RESULT(yes)
1531         AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1,
1532                   [vfs_symlink wants 4 args])
1533 ],[
1534         AC_MSG_RESULT(no)
1535 ])
1536 ])
1537
1538 # 2.6.23 has new shrinker API
1539 AC_DEFUN([LC_REGISTER_SHRINKER],
1540 [LB_CHECK_SYMBOL_EXPORT([register_shrinker],
1541 [mm/vmscan.c],[
1542         AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
1543                   [kernel exports register_shrinker])
1544 ],[
1545 ])
1546 ])
1547
1548 #2.6.27
1549 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1550 [AC_MSG_CHECKING([inode_operations->permission has two args])
1551 LB_LINUX_TRY_COMPILE([
1552         #include <linux/fs.h>
1553 ],[
1554         struct inode *inode;
1555
1556         inode->i_op->permission(NULL,0);
1557 ],[
1558         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1, 
1559                   [inode_operations->permission has two args])
1560         AC_MSG_RESULT([yes])
1561 ],[
1562         AC_MSG_RESULT([no])
1563 ])
1564 ])
1565
1566 # 2.6.27 has file_remove_suid instead of remove_suid
1567 AC_DEFUN([LC_FILE_REMOVE_SUID],
1568 [AC_MSG_CHECKING([kernel has file_remove_suid])
1569 LB_LINUX_TRY_COMPILE([
1570         #include <linux/fs.h>
1571 ],[
1572         file_remove_suid(NULL);
1573 ],[
1574         AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1575                   [kernel have file_remove_suid])
1576         AC_MSG_RESULT([yes])
1577 ],[
1578         AC_MSG_RESULT([no])
1579 ])
1580 ])
1581
1582 # 2.6.27 have new page locking API
1583 AC_DEFUN([LC_TRYLOCKPAGE],
1584 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1585 LB_LINUX_TRY_COMPILE([
1586         #include <linux/pagemap.h>
1587 ],[
1588         trylock_page(NULL);
1589 ],[
1590         AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1591                   [kernel uses trylock_page for page lock])
1592         AC_MSG_RESULT([yes])
1593 ],[
1594         AC_MSG_RESULT([no])
1595 ])
1596 ])
1597
1598 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
1599 # "mode" argument was added, but then again, in some later version it was
1600 # removed
1601 AC_DEFUN([LC_4ARGS_VFS_SYMLINK],
1602 [AC_MSG_CHECKING([if vfs_symlink wants 4 args])
1603 LB_LINUX_TRY_COMPILE([
1604         #include <linux/fs.h>
1605 ],[
1606         struct inode *dir;
1607         struct dentry *dentry;
1608         const char *oldname = NULL;
1609         int mode = 0;
1610
1611         vfs_symlink(dir, dentry, oldname, mode);
1612 ],[
1613         AC_MSG_RESULT(yes)
1614         AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1,
1615                   [vfs_symlink wants 4 args])
1616 ],[
1617         AC_MSG_RESULT(no)
1618 ])
1619 ])
1620
1621 # 2.6.27 sles11 remove the bi_hw_segments
1622 AC_DEFUN([LC_BI_HW_SEGMENTS],
1623 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1624 LB_LINUX_TRY_COMPILE([
1625         #include <linux/bio.h>
1626 ],[
1627         struct bio io;
1628         io.bi_hw_segments = 0;
1629 ],[
1630         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1631                 [struct bio has a bi_hw_segments field])
1632         AC_MSG_RESULT([yes])
1633 ],[
1634         AC_MSG_RESULT([no])
1635 ])
1636 ])
1637
1638 # 2.6.27 sles11 move the quotaio_v1.h to fs
1639 AC_DEFUN([LC_HAVE_QUOTAIO_V1_H],
1640 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v1.h],[
1641         AC_DEFINE(HAVE_QUOTAIO_V1_H, 1,
1642                 [kernel has include/linux/quotaio_v1.h])
1643 ],[
1644         AC_MSG_RESULT([no])
1645 ])
1646 ])
1647
1648 # sles10 sp2 need 5 parameter for vfs_symlink
1649 AC_DEFUN([LC_VFS_SYMLINK_5ARGS],
1650 [AC_MSG_CHECKING([vfs_symlink need 5 parameter])
1651 LB_LINUX_TRY_COMPILE([
1652         #include <linux/fs.h>
1653 ],[
1654         struct inode *dir = NULL;
1655         struct dentry *dentry = NULL;
1656         struct vfsmount *mnt = NULL;
1657         const char * path = NULL;
1658         vfs_symlink(dir, dentry, mnt, path, 0);
1659 ],[
1660         AC_DEFINE(HAVE_VFS_SYMLINK_5ARGS, 1,
1661                 [vfs_symlink need 5 parameteres])
1662         AC_MSG_RESULT([yes])
1663 ],[
1664         AC_MSG_RESULT([no])
1665 ])
1666 ])
1667
1668 # 2.6.27 removed the read_inode from super_operations.
1669 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1670 [AC_MSG_CHECKING([super_operations has a read_inode field])
1671 LB_LINUX_TRY_COMPILE([
1672         #include <linux/fs.h>
1673 ],[
1674         struct super_operations *sop;
1675         sop->read_inode(NULL);
1676 ],[
1677         AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1678                 [super_operations has a read_inode])
1679         AC_MSG_RESULT([yes])
1680 ],[
1681         AC_MSG_RESULT([no])
1682 ])
1683 ])
1684
1685 # 2.6.27 sles11 has sb_any_quota_active
1686 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1687 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1688 LB_LINUX_TRY_COMPILE([
1689         #include <linux/quotaops.h>
1690 ],[
1691         sb_any_quota_active(NULL);
1692 ],[
1693         AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1694                 [Kernel has a sb_any_quota_active])
1695         AC_MSG_RESULT([yes])
1696 ],[
1697         AC_MSG_RESULT([no])
1698 ])
1699 ])
1700
1701 # 2.6.27 sles11 has sb_has_quota_active
1702 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1703 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1704 LB_LINUX_TRY_COMPILE([
1705         #include <linux/quotaops.h>
1706 ],[
1707         sb_has_quota_active(NULL, 0);
1708 ],[
1709         AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1710                 [Kernel has a sb_has_quota_active])
1711         AC_MSG_RESULT([yes])
1712 ],[
1713         AC_MSG_RESULT([no])
1714 ])
1715 ])
1716
1717 # 2.6.27 has inode_permission instead of permisson
1718 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1719 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1720 [fs/namei.c],[
1721 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1722             [inode_permission is exported by the kernel])
1723 ],[
1724 ])
1725 ])
1726
1727 # 2.6.27 use 5th parameter in quota_on for remount.
1728 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1729 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1730 LB_LINUX_TRY_COMPILE([
1731         #include <linux/quota.h>
1732 ],[
1733         struct quotactl_ops *qop;
1734         qop->quota_on(NULL, 0, 0, NULL, 0);
1735 ],[
1736         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1737                 [quota_on needs 5 paramters])
1738         AC_MSG_RESULT([yes])
1739 ],[
1740         AC_MSG_RESULT([no])
1741 ])
1742 ])
1743
1744 # 2.6.27 use 3th parameter in quota_off for remount.
1745 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1746 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1747 LB_LINUX_TRY_COMPILE([
1748         #include <linux/quota.h>
1749 ],[
1750         struct quotactl_ops *qop;
1751         qop->quota_off(NULL, 0, 0);
1752 ],[
1753         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1754                 [quota_off needs 3 paramters])
1755         AC_MSG_RESULT([yes])
1756 ],[
1757         AC_MSG_RESULT([no])
1758 ])
1759 ])
1760
1761 # 2.6.27 has vfs_dq_off inline function.
1762 AC_DEFUN([LC_VFS_DQ_OFF],
1763 [AC_MSG_CHECKING([vfs_dq_off is defined])
1764 LB_LINUX_TRY_COMPILE([
1765         #include <linux/quotaops.h>
1766 ],[
1767         vfs_dq_off(NULL, 0);
1768 ],[
1769         AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1770         AC_MSG_RESULT([yes])
1771 ],[
1772         AC_MSG_RESULT([no])
1773 ])
1774 ])
1775
1776 #
1777 # LC_LINUX_FIEMAP_H
1778 #
1779 # If we have fiemap.h
1780 # after 2.6.27 use fiemap.h in include/linux
1781 #
1782 AC_DEFUN([LC_LINUX_FIEMAP_H],
1783 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
1784         AC_MSG_CHECKING([if fiemap.h can be compiled])
1785         LB_LINUX_TRY_COMPILE([
1786                 #include <linux/types.h>
1787                 #include <linux/fiemap.h>
1788         ],[],[
1789                 AC_MSG_RESULT([yes])
1790                 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
1791         ],[
1792                 AC_MSG_RESULT([no])
1793         ])
1794 ],
1795 [])
1796 ])
1797
1798 #
1799 # LC_PROG_LINUX
1800 #
1801 # Lustre linux kernel checks
1802 #
1803 AC_DEFUN([LC_PROG_LINUX],
1804          [LC_LUSTRE_VERSION_H
1805          if test x$enable_server = xyes ; then
1806              AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1807              LC_FUNC_DEV_SET_RDONLY
1808              LC_STACK_SIZE
1809              LC_CONFIG_BACKINGFS
1810          fi
1811          LC_CONFIG_PINGER
1812          LC_CONFIG_CHECKSUM
1813          LC_CONFIG_LIBLUSTRE_RECOVERY
1814          LC_CONFIG_HEALTH_CHECK_WRITE
1815          LC_CONFIG_LRU_RESIZE
1816          LC_QUOTA_MODULE
1817
1818          # RHEL4 patches
1819          LC_EXPORT_TRUNCATE_COMPLETE
1820          LC_EXPORT_TRUNCATE_RANGE
1821          LC_EXPORT_D_REHASH_COND
1822          LC_EXPORT___D_REHASH
1823          LC_EXPORT_D_MOVE_LOCKED
1824          LC_EXPORT___D_MOVE
1825          LC_EXPORT_NODE_TO_CPUMASK
1826
1827          LC_HEADER_LDISKFS_XATTR
1828          LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1829          LC_STRUCT_STATFS
1830          LC_FILEMAP_POPULATE
1831          LC_D_ADD_UNIQUE
1832          LC_BIT_SPINLOCK_H
1833
1834          LC_XATTR_ACL
1835          LC_POSIX_ACL_XATTR_H
1836          LC_CONST_ACL_SIZE
1837
1838          LC_STRUCT_INTENT_FILE
1839
1840          LC_CAPA_CRYPTO
1841          LC_CONFIG_RMTCLIENT
1842          LC_CONFIG_GSS
1843          LC_FUNC_MS_FLOCK_LOCK
1844          LC_FUNC_HAVE_CAN_SLEEP_ARG
1845          LC_FUNC_F_OP_FLOCK
1846          LC_QUOTA_READ
1847          LC_COOKIE_FOLLOW_LINK
1848          LC_FUNC_RCU
1849          LC_PERCPU_COUNTER
1850          LC_QUOTA64
1851          LC_4ARGS_VFS_SYMLINK
1852
1853          # does the kernel have VFS intent patches?
1854          LC_VFS_INTENT_PATCHES
1855
1856          # ~2.6.11
1857          LC_S_TIME_GRAN
1858          LC_SB_TIME_GRAN
1859
1860          # 2.6.12
1861          LC_RW_TREE_LOCK
1862          LC_EXPORT_SYNCHRONIZE_RCU
1863
1864          # 2.6.15
1865          LC_INODE_I_MUTEX
1866
1867          # 2.6.16
1868          LC_SECURITY_PLUG  # for SLES10 SP2
1869
1870          # 2.6.17
1871          LC_INODE_IPRIVATE
1872          LC_DQUOTOFF_MUTEX
1873
1874          # 2.6.18
1875          LC_NR_PAGECACHE
1876          LC_STATFS_DENTRY_PARAM
1877          LC_VFS_KERN_MOUNT
1878          LC_INVALIDATEPAGE_RETURN_INT
1879          LC_UMOUNTBEGIN_HAS_VFSMOUNT
1880          LC_SEQ_LOCK
1881          LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
1882          if test x$enable_server = xyes ; then
1883                 LC_EXPORT_INVALIDATE_MAPPING_PAGES
1884          fi
1885
1886          #2.6.18 + RHEL5 (fc6)
1887          LC_PG_FS_MISC
1888          LC_PAGE_CHECKED
1889          LC_LINUX_FIEMAP_H
1890
1891          # 2.6.19
1892          LC_INODE_BLKSIZE
1893          LC_VFS_READDIR_U64_INO
1894          LC_FILE_WRITEV
1895          LC_FILE_READV
1896
1897          # 2.6.20
1898          LC_CANCEL_DIRTY_PAGE
1899
1900          # raid5-zerocopy patch
1901          LC_PAGE_CONSTANT
1902
1903          # 2.6.22
1904          LC_INVALIDATE_BDEV_2ARG
1905          LC_ASYNC_BLOCK_CIPHER
1906          LC_STRUCT_HASH_DESC
1907          LC_STRUCT_BLKCIPHER_DESC
1908          LC_FS_RENAME_DOES_D_MOVE
1909          # 2.6.23
1910          LC_UNREGISTER_BLKDEV_RETURN_INT
1911          LC_KERNEL_SPLICE_READ
1912          LC_KERNEL_SENDFILE
1913          LC_HAVE_EXPORTFS_H
1914          LC_VM_OP_FAULT
1915          LC_REGISTER_SHRINKER
1916   
1917          # 2.6.24
1918          LC_HAVE_MMTYPES_H
1919          LC_BIO_ENDIO_2ARG
1920          LC_FH_TO_DENTRY
1921          LC_PROCFS_DELETED
1922
1923          #2.6.25
1924          LC_MAPPING_CAP_WRITEBACK_DIRTY
1925   
1926          # 2.6.26
1927          LC_FS_STRUCT_USE_PATH
1928
1929          # 2.6.27
1930          LC_INODE_PERMISION_2ARGS
1931          LC_FILE_REMOVE_SUID
1932          LC_TRYLOCKPAGE
1933          LC_READ_INODE_IN_SBOPS
1934          LC_EXPORT_INODE_PERMISSION
1935          LC_QUOTA_ON_5ARGS
1936          LC_QUOTA_OFF_3ARGS
1937          LC_VFS_DQ_OFF
1938
1939          # 2.6.27.15-2 sles11
1940          LC_BI_HW_SEGMENTS
1941          LC_HAVE_QUOTAIO_V1_H
1942          LC_VFS_SYMLINK_5ARGS
1943          LC_SB_ANY_QUOTA_ACTIVE
1944          LC_SB_HAS_QUOTA_ACTIVE
1945 ])
1946
1947 #
1948 # LC_CONFIG_CLIENT_SERVER
1949 #
1950 # Build client/server sides of Lustre
1951 #
1952 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1953 [AC_MSG_CHECKING([whether to build Lustre server support])
1954 AC_ARG_ENABLE([server],
1955         AC_HELP_STRING([--disable-server],
1956                         [disable Lustre server support]),
1957         [],[enable_server='yes'])
1958 AC_MSG_RESULT([$enable_server])
1959
1960 AC_MSG_CHECKING([whether to build Lustre client support])
1961 AC_ARG_ENABLE([client],
1962         AC_HELP_STRING([--disable-client],
1963                         [disable Lustre client support]),
1964         [],[enable_client='yes'])
1965 AC_MSG_RESULT([$enable_client])])
1966
1967 #
1968 # LC_CONFIG_LIBLUSTRE
1969 #
1970 # whether to build liblustre
1971 #
1972 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1973 [AC_MSG_CHECKING([whether to build Lustre library])
1974 AC_ARG_ENABLE([liblustre],
1975         AC_HELP_STRING([--disable-liblustre],
1976                         [disable building of Lustre library]),
1977         [],[enable_liblustre=$with_sysio])
1978 AC_MSG_RESULT([$enable_liblustre])
1979 # only build sysio if liblustre is built
1980 with_sysio="$enable_liblustre"
1981
1982 AC_MSG_CHECKING([whether to build liblustre tests])
1983 AC_ARG_ENABLE([liblustre-tests],
1984         AC_HELP_STRING([--enable-liblustre-tests],
1985                         [enable liblustre tests, if --disable-tests is used]),
1986         [],[enable_liblustre_tests=$enable_tests])
1987 if test x$enable_liblustre != xyes ; then
1988    enable_liblustre_tests='no'
1989 fi
1990 AC_MSG_RESULT([$enable_liblustre_tests])
1991
1992 AC_MSG_CHECKING([whether to enable liblustre acl])
1993 AC_ARG_ENABLE([liblustre-acl],
1994         AC_HELP_STRING([--disable-liblustre-acl],
1995                         [disable ACL support for liblustre]),
1996         [],[enable_liblustre_acl=yes])
1997 AC_MSG_RESULT([$enable_liblustre_acl])
1998 if test x$enable_liblustre_acl = xyes ; then
1999   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2000 fi
2001
2002 #
2003 # --enable-mpitest
2004 #
2005 AC_ARG_ENABLE(mpitests,
2006         AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2007                            [include mpi tests]),
2008         [
2009          enable_mpitests=yes
2010          case $enableval in
2011          yes)
2012                 MPICC_WRAPPER=mpicc
2013                 ;;
2014          no)
2015                 enable_mpitests=no
2016                 ;;
2017          *)
2018                 MPICC_WRAPPER=$enableval
2019                  ;;
2020          esac
2021         ],
2022         [
2023         MPICC_WRAPPER=mpicc
2024         enable_mpitests=yes
2025         ]
2026 )
2027
2028 if test x$enable_mpitests != xno; then
2029         AC_MSG_CHECKING([whether mpitests can be built])
2030         oldcc=$CC
2031         CC=$MPICC_WRAPPER
2032         AC_LINK_IFELSE(
2033             [AC_LANG_PROGRAM([[
2034                     #include <mpi.h>
2035                 ]],[[
2036                     int flag;
2037                     MPI_Initialized(&flag);
2038                 ]])],
2039             [
2040                     AC_MSG_RESULT([yes])
2041             ],[
2042                     AC_MSG_RESULT([no])
2043                     enable_mpitests=no
2044         ])
2045         CC=$oldcc
2046 fi
2047 AC_SUBST(MPICC_WRAPPER)
2048
2049 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2050 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2051
2052 LC_CONFIG_PINGER
2053 LC_CONFIG_LIBLUSTRE_RECOVERY
2054 ])
2055
2056 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
2057 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
2058 AC_ARG_ENABLE([lru_resize],
2059         AC_HELP_STRING([--enable-lru-resize],
2060                         [enable lru resize support]),
2061         [],[enable_lru_resize='yes'])
2062 AC_MSG_RESULT([$enable_lru_resize])
2063 if test x$enable_lru_resize != xno; then
2064    AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
2065 fi
2066 ])
2067
2068 #
2069 # LC_CONFIG_QUOTA
2070 #
2071 # whether to enable quota support global control
2072 #
2073 AC_DEFUN([LC_CONFIG_QUOTA],
2074 [AC_ARG_ENABLE([quota],
2075         AC_HELP_STRING([--enable-quota],
2076                         [enable quota support]),
2077         [],[enable_quota='yes'])
2078 ])
2079
2080 # whether to enable quota support(kernel modules)
2081 AC_DEFUN([LC_QUOTA_MODULE],
2082 [if test x$enable_quota != xno; then
2083     LB_LINUX_CONFIG([QUOTA],[
2084         enable_quota_module='yes'
2085         AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
2086     ],[
2087         enable_quota_module='no'
2088         AC_MSG_WARN([quota is not enabled because the kernel - lacks quota support])
2089     ])
2090 fi
2091 ])
2092
2093 AC_DEFUN([LC_QUOTA],
2094 [#check global
2095 LC_CONFIG_QUOTA
2096 #check for utils
2097 AC_CHECK_HEADER(sys/quota.h,
2098                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2099                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2100 ])
2101
2102 AC_DEFUN([LC_QUOTA_READ],
2103 [AC_MSG_CHECKING([if kernel supports quota_read])
2104 LB_LINUX_TRY_COMPILE([
2105         #include <linux/fs.h>
2106 ],[
2107         struct super_operations sp;
2108         void *i = (void *)sp.quota_read;
2109 ],[
2110         AC_MSG_RESULT([yes])
2111         AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
2112 ],[
2113         AC_MSG_RESULT([no])
2114 ])
2115 ])
2116
2117 #
2118 # LC_CONFIG_SPLIT
2119 #
2120 # whether to enable split support
2121 #
2122 AC_DEFUN([LC_CONFIG_SPLIT],
2123 [AC_MSG_CHECKING([whether to enable split support])
2124 AC_ARG_ENABLE([split],
2125         AC_HELP_STRING([--enable-split],
2126                         [enable split support]),
2127         [],[enable_split='no'])
2128 AC_MSG_RESULT([$enable_split])
2129 if test x$enable_split != xno; then
2130    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2131 fi
2132 ])
2133
2134 #
2135 # LC_COOKIE_FOLLOW_LINK
2136 #
2137 # kernel 2.6.13+ ->follow_link returns a cookie
2138 #
2139
2140 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
2141 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
2142 LB_LINUX_TRY_COMPILE([
2143         #include <linux/fs.h>
2144         #include <linux/namei.h>
2145 ],[
2146         struct dentry dentry;
2147         struct nameidata nd;
2148
2149         dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
2150 ],[
2151         AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
2152         AC_MSG_RESULT([yes])
2153 ],[
2154         AC_MSG_RESULT([no])
2155 ])
2156 ])
2157
2158 #
2159 # LC_FUNC_RCU
2160 #
2161 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE),
2162 # call_rcu takes three parameters.
2163 #
2164 AC_DEFUN([LC_FUNC_RCU],
2165 [AC_MSG_CHECKING([if kernel have RCU supported])
2166 LB_LINUX_TRY_COMPILE([
2167         #include <linux/rcupdate.h>
2168 ],[],[
2169         AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
2170         AC_MSG_RESULT([yes])
2171
2172         AC_MSG_CHECKING([if call_rcu takes three parameters])
2173         LB_LINUX_TRY_COMPILE([
2174                 #include <linux/rcupdate.h>
2175         ],[
2176                 struct rcu_head rh;
2177                 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
2178         ],[
2179                 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
2180                 AC_MSG_RESULT([yes])
2181         ],[
2182                 AC_MSG_RESULT([no])
2183         ])
2184
2185 ],[
2186         AC_MSG_RESULT([no])
2187 ])
2188 ])
2189
2190 #
2191 # LC_QUOTA64
2192 # linux kernel have 64-bit limits support
2193 #
2194 AC_DEFUN([LC_QUOTA64],
2195 [if test x$enable_quota_module = xyes -a x$enable_server = xyes ; then
2196         AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
2197         LB_LINUX_TRY_COMPILE([
2198                 #include <linux/kernel.h>
2199                 #include <linux/fs.h>
2200                 #include <linux/quotaio_v2.h>
2201                 int versions[] = V2_INITQVERSIONS_R1;
2202                 struct v2_disk_dqblk_r1 dqblk_r1;
2203         ],[],[
2204                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2205                 AC_MSG_RESULT([yes])
2206         ],[
2207         tmp_flags="$EXTRA_KCFLAGS"
2208         EXTRA_KCFLAGS="-I $LINUX/fs"
2209         LB_LINUX_TRY_COMPILE([
2210                 #include <linux/kernel.h>
2211                 #include <linux/fs.h>
2212                 #include <quotaio_v2.h>
2213                 struct v2r1_disk_dqblk dqblk_r1;
2214         ],[],[
2215                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2216                 AC_MSG_RESULT([yes])
2217         ],[
2218                 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
2219                         AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
2220                 ],[])
2221                 AC_MSG_RESULT([no])
2222         ])
2223         EXTRA_KCFLAGS=$tmp_flags
2224         ])
2225 fi
2226 ])
2227
2228 # LC_SECURITY_PLUG  # for SLES10 SP2
2229 # check security plug in sles10 sp2 kernel
2230 AC_DEFUN([LC_SECURITY_PLUG],
2231 [AC_MSG_CHECKING([If kernel has security plug support])
2232 LB_LINUX_TRY_COMPILE([
2233         #include <linux/fs.h>
2234 ],[
2235         struct dentry   *dentry;
2236         struct vfsmount *mnt;
2237         struct iattr    *iattr;
2238
2239         notify_change(dentry, mnt, iattr);
2240 ],[
2241         AC_MSG_RESULT(yes)
2242         AC_DEFINE(HAVE_SECURITY_PLUG, 1,
2243                 [SLES10 SP2 use extra parameter in vfs])
2244 ],[
2245         AC_MSG_RESULT(no)
2246 ])
2247 ])
2248
2249 AC_DEFUN([LC_PERCPU_COUNTER],
2250 [AC_MSG_CHECKING([if have struct percpu_counter defined])
2251 LB_LINUX_TRY_COMPILE([
2252         #include <linux/percpu_counter.h>
2253 ],[],[
2254         AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
2255         AC_MSG_RESULT([yes])
2256
2257         AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
2258         LB_LINUX_TRY_COMPILE([
2259                 #include <linux/percpu_counter.h>
2260         ],[
2261                 struct percpu_counter c;
2262                 percpu_counter_init(&c, 0);
2263         ],[
2264                 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
2265                                                    arguments])
2266                 AC_MSG_RESULT([yes])
2267         ],[
2268                 AC_MSG_RESULT([no])
2269         ])
2270 ],[
2271         AC_MSG_RESULT([no])
2272 ])
2273 ])
2274
2275 #
2276 # LC_CONFIGURE
2277 #
2278 # other configure checks
2279 #
2280 AC_DEFUN([LC_CONFIGURE],
2281 [LC_CONFIG_OBD_BUFFER_SIZE
2282
2283 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2284         CFLAGS="$CFLAGS -Werror"
2285 fi
2286
2287 # include/liblustre.h
2288 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2289
2290 # liblustre/llite_lib.h
2291 AC_CHECK_HEADERS([xtio.h file.h])
2292
2293 # liblustre/dir.c
2294 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2295
2296 # liblustre/lutil.c
2297 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2298 AC_CHECK_FUNCS([inet_ntoa])
2299
2300 # libsysio/src/readlink.c
2301 LC_READLINK_SSIZE_T
2302
2303 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2304 AC_CHECK_HEADERS([linux/random.h], [], [],
2305                  [#ifdef HAVE_LINUX_TYPES_H
2306                   # include <linux/types.h>
2307                   #endif
2308                  ])
2309
2310 # utils/llverfs.c
2311 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2312
2313 # check for -lz support
2314 ZLIB=""
2315 AC_CHECK_LIB([z],
2316              [adler32],
2317              [AC_CHECK_HEADERS([zlib.h],
2318                                [ZLIB="-lz"
2319                                 AC_DEFINE([HAVE_ADLER], 1,
2320                                           [support alder32 checksum type])],
2321                                [AC_MSG_WARN([No zlib-devel package found,
2322                                              unable to use adler32 checksum])])],
2323              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2324 )
2325 AC_SUBST(ZLIB)
2326
2327 # Super safe df
2328 AC_ARG_ENABLE([mindf],
2329       AC_HELP_STRING([--enable-mindf],
2330                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2331       [],[])
2332 if test "$enable_mindf" = "yes" ;  then
2333       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2334 fi
2335
2336 AC_ARG_ENABLE([fail_alloc],
2337         AC_HELP_STRING([--disable-fail-alloc],
2338                 [disable randomly alloc failure]),
2339         [],[enable_fail_alloc=yes])
2340 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2341 AC_MSG_RESULT([$enable_fail_alloc])
2342 if test x$enable_fail_alloc != xno ; then
2343         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2344 fi
2345
2346 AC_ARG_ENABLE([invariants],
2347         AC_HELP_STRING([--enable-invariants],
2348                 [enable invariant checking (cpu intensive)]),
2349         [],[])
2350 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2351 AC_MSG_RESULT([$enable_invariants])
2352 if test x$enable_invariants = xyes ; then
2353         AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2354 fi
2355
2356 AC_ARG_ENABLE([lu_ref],
2357         AC_HELP_STRING([--enable-lu_ref],
2358                 [enable lu_ref reference tracking code]),
2359         [],[])
2360 AC_MSG_CHECKING([whether to track references with lu_ref])
2361 AC_MSG_RESULT([$enable_lu_ref])
2362 if test x$enable_lu_ref = xyes ; then
2363         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2364 fi
2365
2366 ])
2367
2368 #
2369 # LC_CONDITIONALS
2370 #
2371 # AM_CONDITIONALS for lustre
2372 #
2373 AC_DEFUN([LC_CONDITIONALS],
2374 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2375 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2376 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2377 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2378 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2379 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2380 AM_CONDITIONAL(QUOTA, test x$enable_quota_module = xyes)
2381 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2382 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2383 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2384 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2385 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2386 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2387 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2388 ])
2389
2390 #
2391 # LC_CONFIG_FILES
2392 #
2393 # files that should be generated with AC_OUTPUT
2394 #
2395 AC_DEFUN([LC_CONFIG_FILES],
2396 [AC_CONFIG_FILES([
2397 lustre/Makefile
2398 lustre/autoMakefile
2399 lustre/autoconf/Makefile
2400 lustre/contrib/Makefile
2401 lustre/doc/Makefile
2402 lustre/include/Makefile
2403 lustre/include/lustre_ver.h
2404 lustre/include/linux/Makefile
2405 lustre/include/lustre/Makefile
2406 lustre/kernel_patches/targets/2.6-vanilla.target
2407 lustre/kernel_patches/targets/2.6-rhel4.target
2408 lustre/kernel_patches/targets/2.6-rhel5.target
2409 lustre/kernel_patches/targets/2.6-fc5.target
2410 lustre/kernel_patches/targets/2.6-patchless.target
2411 lustre/kernel_patches/targets/2.6-sles10.target
2412 lustre/kernel_patches/targets/2.6-sles11.target
2413 lustre/kernel_patches/targets/2.6-oel5.target
2414 lustre/ldlm/Makefile
2415 lustre/fid/Makefile
2416 lustre/fid/autoMakefile
2417 lustre/liblustre/Makefile
2418 lustre/liblustre/tests/Makefile
2419 lustre/liblustre/tests/mpi/Makefile
2420 lustre/llite/Makefile
2421 lustre/llite/autoMakefile
2422 lustre/lclient/Makefile
2423 lustre/lov/Makefile
2424 lustre/lov/autoMakefile
2425 lustre/lvfs/Makefile
2426 lustre/lvfs/autoMakefile
2427 lustre/mdc/Makefile
2428 lustre/mdc/autoMakefile
2429 lustre/lmv/Makefile
2430 lustre/lmv/autoMakefile
2431 lustre/mds/Makefile
2432 lustre/mds/autoMakefile
2433 lustre/mdt/Makefile
2434 lustre/mdt/autoMakefile
2435 lustre/cmm/Makefile
2436 lustre/cmm/autoMakefile
2437 lustre/mdd/Makefile
2438 lustre/mdd/autoMakefile
2439 lustre/fld/Makefile
2440 lustre/fld/autoMakefile
2441 lustre/obdclass/Makefile
2442 lustre/obdclass/autoMakefile
2443 lustre/obdclass/linux/Makefile
2444 lustre/obdecho/Makefile
2445 lustre/obdecho/autoMakefile
2446 lustre/obdfilter/Makefile
2447 lustre/obdfilter/autoMakefile
2448 lustre/osc/Makefile
2449 lustre/osc/autoMakefile
2450 lustre/ost/Makefile
2451 lustre/ost/autoMakefile
2452 lustre/osd/Makefile
2453 lustre/osd/autoMakefile
2454 lustre/mgc/Makefile
2455 lustre/mgc/autoMakefile
2456 lustre/mgs/Makefile
2457 lustre/mgs/autoMakefile
2458 lustre/ptlrpc/Makefile
2459 lustre/ptlrpc/autoMakefile
2460 lustre/ptlrpc/gss/Makefile
2461 lustre/ptlrpc/gss/autoMakefile
2462 lustre/quota/Makefile
2463 lustre/quota/autoMakefile
2464 lustre/scripts/Makefile
2465 lustre/tests/Makefile
2466 lustre/tests/mpi/Makefile
2467 lustre/utils/Makefile
2468 lustre/utils/gss/Makefile
2469 ])
2470 case $lb_target_os in
2471         darwin)
2472                 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
2473                 ;;
2474 esac
2475
2476 ])