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