Whamcloud - gitweb
LU-2800 autoconf: remove LC_RW_TREE_LOCK test
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #
2 # LC_CONFIG_SRCDIR
3 #
4 # Wrapper for AC_CONFIG_SUBDIR
5 #
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
8 libcfs_is_module=yes
9 ldiskfs_is_ext4=yes
10 ])
11
12 #
13 # LC_PATH_DEFAULTS
14 #
15 # lustre specific paths
16 #
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
19 LUSTRE="$PWD/lustre"
20 AC_SUBST(LUSTRE)
21
22 # mount.lustre
23 rootsbindir='$(CROSS_PATH)/sbin'
24 AC_SUBST(rootsbindir)
25
26 demodir='$(docdir)/demo'
27 AC_SUBST(demodir)
28
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
31 ])
32
33 #
34 # LC_TARGET_SUPPORTED
35 #
36 # is the target os supported?
37 #
38 AC_DEFUN([LC_TARGET_SUPPORTED],
39 [case $target_os in
40         linux* | darwin*)
41 $1
42                 ;;
43         *)
44 $2
45                 ;;
46 esac
47 ])
48
49 #
50 # LC_CONFIG_OBD_BUFFER_SIZE
51 #
52 # the maximum buffer size of lctl ioctls
53 #
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
55 [AC_MSG_CHECKING([maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57         AC_HELP_STRING([--with-obd-buffer-size=[size]],
58                         [set lctl ioctl maximum bytes (default=8192)]),
59         [
60                 OBD_BUFFER_SIZE=$with_obd_buffer_size
61         ],[
62                 OBD_BUFFER_SIZE=8192
63         ])
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
66 ])
67
68 #
69 # LC_READLINK_SSIZE_T
70 #
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
73 AC_TRY_COMPILE([
74         #include <unistd.h>
75 ],[
76         ssize_t readlink(const char *, char *, size_t);
77 ],[
78         AC_MSG_RESULT([yes])
79         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
80 ],[
81         AC_MSG_RESULT([no])
82 ])
83 ])
84
85 #
86 # LC_FUNC_DEV_SET_RDONLY
87 #
88 # check whether dev_set_rdonly is exported.  This is needed until we
89 # have another mechanism to fence IO from the underlying device.
90 #
91 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
92 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
93 [block/ll_rw_block.c,block/blk-core.c],[
94         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
95 ],[
96         AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
97 ])
98 ])
99
100 #
101 # Ensure stack size big than 8k in Lustre server (all kernels)
102 #
103 AC_DEFUN([LC_STACK_SIZE],
104 [AC_MSG_CHECKING([stack size big than 8k])
105 LB_LINUX_TRY_COMPILE([
106         #include <linux/thread_info.h>
107 ],[
108         #if THREAD_SIZE < 8192
109         #error "stack size < 8192"
110         #endif
111 ],[
112         AC_MSG_RESULT(yes)
113 ],[
114         AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
115 ])
116 ])
117
118 #
119 # Allow the user to set the MDS thread upper limit
120 #
121 AC_DEFUN([LC_MDS_MAX_THREADS],
122 [
123         AC_ARG_WITH([mds_max_threads],
124         AC_HELP_STRING([--with-mds-max-threads=count],
125                        [maximum threads available on the MDS: (default=512)]),
126         [
127                 MDS_THREAD_COUNT=$with_mds_max_threads
128                 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
129         ])
130 ])
131
132 #
133 # LC_CONFIG_PINGER
134 #
135 # the pinger is temporary, until we have the recovery node in place
136 #
137 AC_DEFUN([LC_CONFIG_PINGER],
138 [AC_MSG_CHECKING([whether to enable pinger support])
139 AC_ARG_ENABLE([pinger],
140         AC_HELP_STRING([--disable-pinger],
141                         [disable recovery pinger support]),
142         [],[enable_pinger='yes'])
143 AC_MSG_RESULT([$enable_pinger])
144 if test x$enable_pinger != xno ; then
145   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
146 fi
147 ])
148
149 #
150 # LC_CONFIG_CHECKSUM
151 #
152 # do checksum of bulk data between client and OST
153 #
154 AC_DEFUN([LC_CONFIG_CHECKSUM],
155 [AC_MSG_CHECKING([whether to enable data checksum support])
156 AC_ARG_ENABLE([checksum],
157        AC_HELP_STRING([--disable-checksum],
158                        [disable data checksum support]),
159        [],[enable_checksum='yes'])
160 AC_MSG_RESULT([$enable_checksum])
161 if test x$enable_checksum != xno ; then
162   AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
163 fi
164 ])
165
166 #
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
168 #
169 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
170 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
171 AC_ARG_ENABLE([liblustre-recovery],
172         AC_HELP_STRING([--disable-liblustre-recovery],
173                         [disable liblustre recovery support]),
174         [],[enable_liblustre_recovery='yes'])
175 AC_MSG_RESULT([$enable_liblustre_recovery])
176 if test x$enable_liblustre_recovery != xno ; then
177   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
178 fi
179 ])
180
181 #
182 # LC_CONFIG_HEALTH_CHECK_WRITE
183 #
184 # Turn off the actual write to the disk
185 #
186 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
187 [AC_MSG_CHECKING([whether to enable a write with the health check])
188 AC_ARG_ENABLE([health_write],
189         AC_HELP_STRING([--enable-health_write],
190                         [enable disk writes when doing health check]),
191         [],[enable_health_write='no'])
192 AC_MSG_RESULT([$enable_health_write])
193 if test x$enable_health_write != xno ; then
194   AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
195 fi
196 ])
197
198 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
199 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
200 AC_ARG_ENABLE([lru_resize],
201         AC_HELP_STRING([--enable-lru-resize],
202                         [enable lru resize support]),
203         [],[enable_lru_resize='yes'])
204 AC_MSG_RESULT([$enable_lru_resize])
205 if test x$enable_lru_resize != xno; then
206    AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
207 fi
208 ])
209
210 #
211 # Quota support. The kernel must support CONFIG_QUOTA.
212 #
213 AC_DEFUN([LC_QUOTA_CONFIG],
214 [LB_LINUX_CONFIG_IM([QUOTA],[],[
215         AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
216         ])
217 ])
218
219 # truncate_complete_page() has never been exported from an upstream kernel
220 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
221 # delete_from_page_cache() is exported from 2.6.39
222 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
223          [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
224                                  [mm/truncate.c],
225                                  [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226                                             [kernel export truncate_complete_page])])
227           LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
228                                  [mm/filemap.c],
229                                  [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
230                                             [kernel export remove_from_page_cache])])
231           LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
232                                  [mm/filemap.c],
233                                  [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234                                             [kernel export delete_from_page_cache])])
235          ])
236
237 #
238 # LC_CAPA_CRYPTO
239 #
240 AC_DEFUN([LC_CAPA_CRYPTO],
241 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
242         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
243 ])
244 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
245         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
246 ])
247 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
248         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
249 ])
250 ])
251
252 #
253 # LC_CONFIG_RMTCLIENT
254 #
255 dnl FIXME
256 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
257 dnl FIXME
258 AC_DEFUN([LC_CONFIG_RMTCLIENT],
259 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
260         AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
261 ])
262 ])
263
264 #
265 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
266 #
267 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
268 [AC_MSG_CHECKING([whether to enable gss keyring backend])
269  AC_ARG_ENABLE([gss_keyring],
270                [AC_HELP_STRING([--disable-gss-keyring],
271                                [disable gss keyring backend])],
272                [],[enable_gss_keyring='yes'])
273  AC_MSG_RESULT([$enable_gss_keyring])
274
275  if test x$enable_gss_keyring != xno; then
276         LB_LINUX_CONFIG_IM([KEYS],[],
277                            [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
278
279         AC_CHECK_LIB([keyutils], [keyctl_search], [],
280                      [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
281
282         AC_DEFINE([HAVE_GSS_KEYRING], [1],
283                   [Define this if you enable gss keyring backend])
284  fi
285 ])
286
287 AC_DEFUN([LC_CONFIG_SUNRPC],
288 [LB_LINUX_CONFIG_IM([SUNRPC],[],
289                     [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
290 ])
291
292 #
293 # LC_CONFIG_GSS (default disabled)
294 #
295 # Build gss and related tools of Lustre. Currently both kernel and user space
296 # parts are depend on linux platform.
297 #
298 AC_DEFUN([LC_CONFIG_GSS],
299 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
300  AC_ARG_ENABLE([gss],
301                [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
302                [],[enable_gss='no'])
303  AC_MSG_RESULT([$enable_gss])
304
305  if test x$enable_gss == xyes; then
306         LC_CONFIG_GSS_KEYRING
307         LC_CONFIG_SUNRPC
308
309         AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
310
311         LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
312                            [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
313         LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
314                            [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
315         LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
316                            [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
317         LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
318                            [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
319
320         AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
321                      [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
322                      [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
323                                    [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
324                                    [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
325
326         AC_SUBST(GSSAPI_LIBS)
327
328         AC_KERBEROS_V5
329  fi
330 ])
331
332 #2.6.18 + RHEL5 (fc6)
333
334 # raid5-zerocopy patch
335
336 #
337 # LC_PAGE_CONSTANT
338 #
339 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
340 # it support constant page, which means the page won't be modified during the
341 # IO.
342 #
343 AC_DEFUN([LC_PAGE_CONSTANT],
344 [AC_MSG_CHECKING([if kernel have PageConstant defined])
345 LB_LINUX_TRY_COMPILE([
346         #include <linux/mm.h>
347         #include <linux/page-flags.h>
348 ],[
349         #ifndef PG_constant
350         #error "Have no raid5 zcopy patch"
351         #endif
352 ],[
353         AC_MSG_RESULT(yes)
354         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
355 ],[
356         AC_MSG_RESULT(no);
357 ])
358 ])
359
360 # 2.6.24
361
362 # 2.6.24 has bio_endio with 2 args
363 AC_DEFUN([LC_BIO_ENDIO_2ARG],
364 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
365 LB_LINUX_TRY_COMPILE([
366         #include <linux/bio.h>
367 ],[
368         bio_endio(NULL, 0);
369 ], [
370         AC_MSG_RESULT([yes])
371         AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
372                 [kernel has bio_endio with 2 args])
373 ],[
374         AC_MSG_RESULT([no])
375 ])
376 ])
377
378 # 2.6.24 removes long aged procfs entry -> deleted member
379 AC_DEFUN([LC_PROCFS_DELETED],
380 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
381 LB_LINUX_TRY_COMPILE([
382         #include <linux/proc_fs.h>
383 ],[
384         struct proc_dir_entry pde;
385
386         pde.deleted = sizeof(pde);
387 ], [
388         AC_MSG_RESULT([yes])
389         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
390                 [kernel has deleted member in procfs entry struct])
391 ],[
392         AC_MSG_RESULT([no])
393 ])
394 ])
395
396 #
397 # 2.6.27
398 #
399
400 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
401 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
402 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
403 # v3.1 onward have a 2 arg version (inode, mask)
404 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
405 [AC_MSG_CHECKING([inode_operations->permission has two args])
406 LB_LINUX_TRY_COMPILE([
407         #include <linux/fs.h>
408 ],[
409         struct inode *inode __attribute__ ((unused));
410
411         inode = NULL;
412         inode->i_op->permission(NULL, 0);
413 ],[
414         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
415                   [inode_operations->permission has two args])
416         AC_MSG_RESULT([yes])
417 ],[
418         AC_MSG_RESULT([no])
419 ])
420 ])
421
422 # 2.6.27 use 5th parameter in quota_on for remount.
423 AC_DEFUN([LC_QUOTA_ON_5ARGS],
424 [AC_MSG_CHECKING([quota_on needs 5 parameters])
425 LB_LINUX_TRY_COMPILE([
426         #include <linux/fs.h>
427         #include <linux/quota.h>
428 ],[
429         struct quotactl_ops *qop = NULL;
430         qop->quota_on(NULL, 0, 0, NULL, 0);
431 ],[
432         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
433                 [quota_on needs 5 paramters])
434         AC_MSG_RESULT([yes])
435 ],[
436         AC_MSG_RESULT([no])
437 ])
438 ])
439
440 # 2.6.27 use 3th parameter in quota_off for remount.
441 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
442 [AC_MSG_CHECKING([quota_off needs 3 parameters])
443 LB_LINUX_TRY_COMPILE([
444         #include <linux/fs.h>
445         #include <linux/quota.h>
446 ],[
447         struct quotactl_ops *qop = NULL;
448         qop->quota_off(NULL, 0, 0);
449 ],[
450         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
451                 [quota_off needs 3 paramters])
452         AC_MSG_RESULT([yes])
453 ],[
454         AC_MSG_RESULT([no])
455 ])
456 ])
457
458 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
459 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
460 tmp_flags="$EXTRA_KCFLAGS"
461 EXTRA_KCFLAGS="-Werror"
462 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
463 LB_LINUX_TRY_COMPILE([
464         #include <linux/fs.h>
465         #include <linux/quota.h>
466 ],[
467         struct quotactl_ops qops = {};
468         struct fs_disk_quota fdq;
469         qops.set_dqblk(NULL, 0, 0, &fdq);
470 ],[
471         AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
472         AC_MSG_RESULT([yes])
473 ],[
474         AC_MSG_RESULT([no])
475 ])
476 EXTRA_KCFLAGS="$tmp_flags"
477 ])
478
479 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
480 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
481 [AC_MSG_CHECKING([if dquot_suspend is defined])
482 LB_LINUX_TRY_COMPILE([
483         #include <linux/quotaops.h>
484 ],[
485         dquot_suspend(NULL, -1);
486 ],[
487         AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
488         AC_MSG_RESULT([yes])
489 ],[
490         AC_MSG_RESULT([no])
491 ])
492 ])
493
494 # 2.6.27.15-2 sles11
495
496 # 2.6.27 sles11 remove the bi_hw_segments
497 AC_DEFUN([LC_BI_HW_SEGMENTS],
498 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
499 LB_LINUX_TRY_COMPILE([
500         #include <linux/bio.h>
501 ],[
502         struct bio io;
503         io.bi_hw_segments = sizeof(io);
504 ],[
505         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
506                 [struct bio has a bi_hw_segments field])
507         AC_MSG_RESULT([yes])
508 ],[
509         AC_MSG_RESULT([no])
510 ])
511 ])
512
513 #
514 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
515 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
516 AC_DEFUN([LC_HAVE_QUOTAIO_H],
517 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
518         AC_DEFINE(HAVE_QUOTAIO_H, 1,
519                 [kernel has include/linux/quotaio_v2.h])
520 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
521                AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
522                 [kernel has fs/quotaio_v1.h])
523 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
524                AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
525                 [kernel has fs/quota/quotaio_v2.h])
526 ],[
527         AC_MSG_RESULT([no])
528 ])
529 ])
530 ])
531 ])
532
533 # 2.6.32
534
535 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
536 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
537 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
538 LB_LINUX_TRY_COMPILE([
539         #include <linux/blkdev.h>
540 ],[
541         blk_queue_max_segments(NULL, 0);
542 ],[
543         AC_MSG_RESULT(yes)
544         AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
545                   [blk_queue_max_segments is defined])
546 ],[
547         AC_MSG_RESULT(no)
548 ])
549 ])
550
551 #
552 # LC_QUOTA64
553 #
554 # Check if kernel has been patched for 64-bit quota limits support.
555 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
556 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
557 # that in the absence of quotaio_v1.h in the kernel headers.
558 #
559 AC_DEFUN([LC_QUOTA64],[
560         AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
561 tmp_flags="$EXTRA_KCFLAGS"
562 EXTRA_KCFLAGS="-I$LINUX/fs"
563         LB_LINUX_TRY_COMPILE([
564                 #include <linux/kernel.h>
565                 #include <linux/fs.h>
566                 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
567                 # include <quota/quotaio_v2.h>
568                 struct v2r1_disk_dqblk dqblk_r1;
569                 #else
570                 #include <linux/quota.h>
571                 int ver = QFMT_VFS_V1;
572                 #endif
573         ],[],[
574                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
575                 AC_MSG_RESULT([yes])
576         ],[
577                 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
578                         AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
579                 ],[])
580                 AC_MSG_RESULT([no])
581         ])
582 EXTRA_KCFLAGS=$tmp_flags
583 ])
584
585 #
586 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
587 #
588 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
589 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
590 LB_LINUX_TRY_COMPILE([
591         #include <asm/atomic.h>
592         #include <linux/spinlock.h>
593         #include <linux/fs_struct.h>
594 ],[
595         ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
596 ],[
597         AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
598                   [fs_struct.lock use rwlock])
599         AC_MSG_RESULT([yes])
600 ],[
601         AC_MSG_RESULT([no])
602 ])
603 ])
604
605 #
606 # 2.6.36 super_operations add evict_inode method. it hybird of
607 # delete_inode & clear_inode.
608 #
609 AC_DEFUN([LC_SBOPS_EVICT_INODE],
610 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
611 LB_LINUX_TRY_COMPILE([
612         #include <linux/fs.h>
613 ],[
614         ((struct super_operations *)0)->evict_inode(NULL);
615 ],[
616         AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
617                 [super_operations.evict_inode() is exist in kernel])
618         AC_MSG_RESULT([yes])
619 ],[
620         AC_MSG_RESULT([no])
621 ])
622 ])
623
624 #
625 # 2.6.35 file_operations.fsync taken 2 arguments.
626 # 3.0.0 file_operations.fsync takes 4 arguments.
627 #
628 AC_DEFUN([LC_FILE_FSYNC],
629 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
630 LB_LINUX_TRY_COMPILE([
631         #include <linux/fs.h>
632 ],[
633         ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
634 ],[
635         AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
636                 [file_operations.fsync takes 4 arguments])
637         AC_MSG_RESULT([yes, 4 args])
638 ],[
639         LB_LINUX_TRY_COMPILE([
640                 #include <linux/fs.h>
641         ],[
642            ((struct file_operations *)0)->fsync(NULL, 0);
643         ],[
644                 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
645                         [file_operations.fsync takes 2 arguments])
646                 AC_MSG_RESULT([yes, 2 args])
647         ],[
648                 AC_MSG_RESULT([no])
649         ])
650 ])
651 ])
652
653 #
654 # 2.6.37 remove kernel_locked
655 #
656 AC_DEFUN([LC_KERNEL_LOCKED],
657 [AC_MSG_CHECKING([if kernel_locked is defined])
658 LB_LINUX_TRY_COMPILE([
659         #include <linux/smp_lock.h>
660 ],[
661         kernel_locked();
662 ],[
663         AC_MSG_RESULT([yes])
664         AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
665                 [kernel_locked is defined])
666 ],[
667         AC_MSG_RESULT([no])
668 ])
669 ])
670
671 #
672 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
673 #
674 AC_DEFUN([LC_D_COMPARE_7ARGS],
675 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
676 LB_LINUX_TRY_COMPILE([
677         #include <linux/dcache.h>
678 ],[
679         ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
680 ],[
681         AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
682                 [d_compare need 7 arguments])
683         AC_MSG_RESULT([yes])
684 ],[
685         AC_MSG_RESULT([no])
686 ])
687 ])
688
689 #
690 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
691 #
692 AC_DEFUN([LC_D_DELETE_CONST],
693 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
694 tmp_flags="$EXTRA_KCFLAGS"
695 EXTRA_KCFLAGS="-Werror"
696 LB_LINUX_TRY_COMPILE([
697         #include <linux/dcache.h>
698 ],[
699         const struct dentry *d = NULL;
700         ((struct dentry_operations*)0)->d_delete(d);
701 ],[
702         AC_DEFINE(HAVE_D_DELETE_CONST, const,
703                 [d_delete first parameter declared const])
704         AC_MSG_RESULT([yes])
705 ],[
706         AC_DEFINE(HAVE_D_DELETE_CONST, , [])
707         AC_MSG_RESULT([no])
708 ])
709 EXTRA_KCFLAGS="$tmp_flags"
710 ])
711
712 #
713 # 2.6.38 dcache_lock removed. rcu-walk commited.
714 #
715 AC_DEFUN([LC_DCACHE_LOCK],
716 [AC_MSG_CHECKING([if dcache_lock is exist])
717 LB_LINUX_TRY_COMPILE([
718         #include <linux/dcache.h>
719 ],[
720         spin_lock(&dcache_lock);
721 ],[
722         AC_DEFINE(HAVE_DCACHE_LOCK, 1,
723                 [dcache_lock is exist])
724         AC_MSG_RESULT([yes])
725 ],[
726         AC_MSG_RESULT([no])
727 ])
728 ])
729
730 #
731 # 2.6.38 inode.i_rcu added.
732 #
733 AC_DEFUN([LC_INODE_I_RCU],
734 [AC_MSG_CHECKING([if inode.i_rcu exists])
735 LB_LINUX_TRY_COMPILE([
736         #include <linux/fs.h>
737 ],[
738         struct inode ino;
739         struct rcu_head rcu = {};
740         ino.i_rcu = rcu;
741 ],[
742         AC_DEFINE(HAVE_INODE_I_RCU, 1,
743                 [inode.i_rcu exists])
744         AC_MSG_RESULT([yes])
745 ],[
746         AC_MSG_RESULT([no])
747 ])
748 ])
749
750 #
751 # 2.6.38 export blkdev_get_by_dev
752 #
753 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
754 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
755 [fs/block_dev.c],[
756 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
757             [blkdev_get_by_dev is exported by the kernel])
758 ],[
759 ])
760 ])
761
762 #
763 # 2.6.38 use path as 4th parameter in quota_on.
764 #
765 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
766 [AC_MSG_CHECKING([quota_on use path as parameter])
767 tmp_flags="$EXTRA_KCFLAGS"
768 EXTRA_KCFLAGS="-Werror"
769 LB_LINUX_TRY_COMPILE([
770         #include <linux/fs.h>
771         #include <linux/quota.h>
772 ],[
773         ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
774 ],[
775         AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
776                 [quota_on use path as 4th paramter])
777         AC_MSG_RESULT([yes])
778 ],[
779         AC_MSG_RESULT([no])
780 ])
781 EXTRA_KCFLAGS="$tmp_flags"
782 ])
783
784 #
785 # 2.6.38 export simple_setattr
786 #
787 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
788 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
789 [fs/libfs.c],[
790 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
791             [simple_setattr is exported by the kernel])
792 ],[
793 ])
794 ])
795
796 #
797 # 2.6.39 remove unplug_fn from request_queue.
798 #
799 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
800 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
801 LB_LINUX_TRY_COMPILE([
802         #include <linux/blkdev.h>
803 ],[
804         do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
805 ],[
806         AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
807                   [request_queue has unplug_fn field])
808         AC_MSG_RESULT([yes])
809 ],[
810         AC_MSG_RESULT([no])
811 ])
812 ])
813
814 #
815 # 2.6.39 replace get_sb with mount in struct file_system_type
816 #
817 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
818 [AC_MSG_CHECKING([if file_system_type has mount field])
819 LB_LINUX_TRY_COMPILE([
820         #include <linux/fs.h>
821 ],[
822         struct file_system_type fst;
823         void *i = (void *) fst.mount;
824 ],[
825         AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
826                 [struct file_system_type has mount field])
827         AC_MSG_RESULT([yes])
828 ],[
829         AC_MSG_RESULT([no])
830 ])
831 ])
832
833 #
834 # 3.0 dirty_inode() has a flag parameter
835 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
836 #
837 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
838 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
839 LB_LINUX_TRY_COMPILE([
840         #include <linux/fs.h>
841 ],[
842         struct inode *inode;
843         inode->i_sb->s_op->dirty_inode(NULL, 0);
844 ],[
845         AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
846                   [dirty_inode super_operation takes flag])
847         AC_MSG_RESULT([yes])
848 ],[
849         AC_MSG_RESULT([no])
850 ])
851 ])
852
853 #
854 # 2.6.38 generic_permission taken 4 parameters.
855 # in fact, it means rcu-walk aware permission bring.
856 #
857 # 3.1 generic_permission taken 2 parameters.
858 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
859 #
860 AC_DEFUN([LC_GENERIC_PERMISSION],
861 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
862 LB_LINUX_TRY_COMPILE([
863         #include <linux/fs.h>
864 ],[
865         generic_permission(NULL, 0);
866 ],[
867         AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
868                   [generic_permission taken 2 arguments])
869         AC_MSG_RESULT([yes, 2 args])
870 ],[
871         LB_LINUX_TRY_COMPILE([
872                 #include <linux/fs.h>
873         ],[
874                 generic_permission(NULL, 0, 0, NULL);
875         ],[
876                 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
877                           [generic_permission taken 4 arguments])
878                 AC_MSG_RESULT([yes, 4 args])
879         ],[
880                 AC_MSG_RESULT([no])
881         ])
882 ])
883 ])
884
885 #
886 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
887 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
888 #
889 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
890 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
891 LB_LINUX_TRY_COMPILE([
892         #include <linux/fs.h>
893 ],[
894         struct lock_manager_operations lm_ops;
895         lm_ops.lm_compare_owner = NULL;
896 ],[
897         AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
898                   [lock-manager ops renamed to lm_xxx])
899         AC_MSG_RESULT([yes])
900 ],[
901         AC_MSG_RESULT([no])
902 ])
903 ])
904
905 #
906 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
907 #     inode_dio_done instead.
908 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
909 #
910 AC_DEFUN([LC_INODE_DIO_WAIT],
911 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
912 LB_LINUX_TRY_COMPILE([
913         #include <linux/fs.h>
914 ],[
915         inode_dio_wait((struct inode *)0);
916         inode_dio_done((struct inode *)0);
917 ],[
918         AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
919                   [inode->i_alloc_sem is killed and use inode_dio_wait/done])
920         AC_MSG_RESULT([yes])
921 ],[
922         AC_MSG_RESULT([no])
923 ])
924 ])
925
926 #
927 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
928 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
929 #
930 AC_DEFUN([LC_IOP_GET_ACL],
931 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
932 LB_LINUX_TRY_COMPILE([
933         #include <linux/fs.h>
934 ],[
935         struct inode_operations iop;
936         iop.get_acl = NULL;
937 ],[
938         AC_DEFINE(HAVE_IOP_GET_ACL, 1,
939                   [inode_operations has .get_acl member function])
940         AC_MSG_RESULT([yes])
941 ],[
942         AC_MSG_RESULT([no])
943 ])
944 ])
945
946 #
947 # 3.1.1 has ext4_blocks_for_truncate
948 #
949 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
950 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
951 LB_LINUX_TRY_COMPILE([
952         #include <linux/fs.h>
953         #include "$LINUX/fs/ext4/ext4_jbd2.h"
954         #include "$LINUX/fs/ext4/truncate.h"
955 ],[
956         ext4_blocks_for_truncate(NULL);
957 ],[
958         AC_MSG_RESULT([yes])
959         AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
960                   [kernel has ext4_blocks_for_truncate])
961 ],[
962         AC_MSG_RESULT([no])
963 ])
964 ])
965
966 #
967 # 3.1 introduced generic_file_llseek_size()
968 #
969 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
970         [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
971         [fs/read_write.c],
972         [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
973                    [generic_file_llseek_size is exported by the kernel])])
974 ])
975
976 #
977 # 3.2 request_queue.make_request_fn defined as function returns with void
978 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
979 #
980 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
981 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
982 LB_LINUX_TRY_COMPILE([
983         #include <linux/blkdev.h>
984 ],[
985         int ret;
986         make_request_fn         *mrf;
987         ret = mrf(NULL, NULL);
988 ],[
989         AC_MSG_RESULT([no])
990 ],[
991         AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
992                   [request_queue.make_request_fn returns void but not int])
993         AC_MSG_RESULT([yes])
994 ])
995 ])
996
997 #
998 # 3.2 protects inode->i_nlink from direct modification
999 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1000 # at the same time adds set_nlink(), so checks set_nlink() for it.
1001 #
1002 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1003 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1004 LB_LINUX_TRY_COMPILE([
1005         #include <linux/fs.h>
1006 ],[
1007         struct inode i;
1008         set_nlink(&i, 1);
1009 ],[
1010         AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1011                   [inode->i_nlink is protected from direct modification])
1012         AC_MSG_RESULT([yes])
1013 ],[
1014         AC_MSG_RESULT([no])
1015 ])
1016 ])
1017
1018 #
1019 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1020 #
1021 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1022 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1023                 AC_DEFINE(HAVE_MIGRATE_H, 1,
1024                 [kernel has include/linux/migrate.h])
1025 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1026                 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1027                         [kernel has include/linux/migrate_mode.h])
1028 ],[
1029         AC_MSG_RESULT([no])
1030 ])
1031 ])
1032 ])
1033
1034 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1035 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1036 LB_LINUX_TRY_COMPILE([
1037         #include <linux/fs.h>
1038 #ifdef HAVE_MIGRATE_H
1039         #include <linux/migrate.h>
1040 #elif defined(HAVE_MIGRATE_MODE_H)
1041         #include <linux/migrate_mode.h>
1042 #endif
1043 ],[
1044         struct address_space_operations aops;
1045
1046         aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1047 ],[
1048         AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1049                 [address_space_operations.migratepage has 4 args])
1050         AC_MSG_RESULT([yes])
1051 ],[
1052         AC_MSG_RESULT([no])
1053 ])
1054 ])
1055
1056 #
1057 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1058 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1059 #
1060 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1061 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1062 tmp_flags="$EXTRA_KCFLAGS"
1063 EXTRA_KCFLAGS="-Werror"
1064 LB_LINUX_TRY_COMPILE([
1065         #include <linux/fs.h>
1066         int show_options(struct seq_file *seq, struct dentry *root){
1067                 return 0;
1068         }
1069 ],[
1070         struct super_operations ops;
1071         ops.show_options = show_options;
1072 ],[
1073         AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1074                   [super_operations use dentry as parameter])
1075         AC_MSG_RESULT([yes])
1076 ],[
1077         AC_MSG_RESULT([no])
1078 ])
1079 EXTRA_KCFLAGS="$tmp_flags"
1080 ])
1081
1082 #
1083 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1084 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1085 #
1086 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1087 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1088 tmp_flags="$EXTRA_KCFLAGS"
1089 EXTRA_KCFLAGS="-Werror"
1090 LB_LINUX_TRY_COMPILE([
1091         #include <linux/fs.h>
1092         #include <linux/types.h>
1093         int my_mknod(struct inode *dir, struct dentry *dchild,
1094                      umode_t mode, dev_t dev)
1095         {
1096                 return 0;
1097         }
1098 ],[
1099         struct inode_operations ops;
1100         ops.mknod = my_mknod;
1101 ],[
1102         AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1103                   [inode_operations use umode_t as parameter])
1104         AC_MSG_RESULT([yes])
1105 ],[
1106         AC_MSG_RESULT([no])
1107 ])
1108 EXTRA_KCFLAGS="$tmp_flags"
1109 ])
1110
1111 # 3.4 kmap_atomic removes second argument
1112 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1113 #
1114 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1115 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1116 LB_LINUX_TRY_COMPILE([
1117         #include <linux/highmem.h>
1118 ],[
1119         kmap_atomic(NULL);
1120 ],[
1121         AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1122                   [have kmap_atomic has only 1 argument])
1123         AC_MSG_RESULT([yes])
1124 ],[
1125         AC_MSG_RESULT([no])
1126 ])
1127 ])
1128
1129 #
1130 # 3.4 switchs touch_atime to struct path
1131 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1132 #
1133 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1134 [AC_MSG_CHECKING([if touch_atime use one argument])
1135 LB_LINUX_TRY_COMPILE([
1136         #include <linux/fs.h>
1137 ],[
1138         touch_atime((struct path *)NULL);
1139 ],[
1140         AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1141                   [touch_atime use one argument])
1142         AC_MSG_RESULT([yes])
1143 ],[
1144         AC_MSG_RESULT([no])
1145 ])
1146 ])
1147
1148 #
1149 # 3.4 converts d_alloc_root to d_make_root
1150 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1151 #
1152 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1153 [AC_MSG_CHECKING([if have d_make_root])
1154 LB_LINUX_TRY_COMPILE([
1155         #include <linux/fs.h>
1156 ],[
1157         d_make_root((struct inode *)NULL);
1158 ],[
1159         AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1160                   [have d_make_root])
1161         AC_MSG_RESULT([yes])
1162 ],[
1163         AC_MSG_RESULT([no])
1164 ])
1165 ])
1166
1167 #
1168 # 3.5 renames end_writeback() back to clear_inode()...
1169 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1170 #
1171 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1172 [AC_MSG_CHECKING([if have clear_inode])
1173 LB_LINUX_TRY_COMPILE([
1174         #include <linux/fs.h>
1175 ],[
1176         clear_inode((struct inode *)NULL);
1177 ],[
1178         AC_DEFINE(HAVE_CLEAR_INODE, 1,
1179                   [have clear_inode])
1180         AC_MSG_RESULT([yes])
1181 ],[
1182         AC_MSG_RESULT([no])
1183 ])
1184 ])
1185
1186 #
1187 # 3.5 encode_fh has parent inode passed in directly
1188 # see kernel commit b0b0382b
1189 #
1190 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1191 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1192 tmp_flags="$EXTRA_KCFLAGS"
1193 EXTRA_KCFLAGS="-Werror"
1194 LB_LINUX_TRY_COMPILE([
1195         #include <linux/exportfs.h>
1196         #include <linux/fs.h>
1197         #include <linux/types.h>
1198         int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1199         {
1200                 return 0;
1201         }
1202 ],[
1203         struct export_operations exp_op;
1204         exp_op.encode_fh = ll_encode_fh;
1205 ],[
1206         AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1207                   [have parent inode as parameter])
1208         AC_MSG_RESULT([yes])
1209 ],[
1210         AC_MSG_RESULT([no])
1211 ])
1212 EXTRA_KCFLAGS="$tmp_flags"
1213 ])
1214
1215 # 3.5 has generic_file_llseek_size with 5 args
1216 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1217 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1218 LB_LINUX_TRY_COMPILE([
1219         #include <linux/fs.h>
1220 ],[
1221         generic_file_llseek_size(NULL, 0, 0, 0, 0);
1222 ], [
1223         AC_MSG_RESULT([yes])
1224         AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1225                 [kernel has generic_file_llseek_size with 5 args])
1226 ],[
1227         AC_MSG_RESULT([no])
1228 ])
1229 ])
1230
1231 #
1232 # 3.6 switch i_dentry/d_alias from list to hlist
1233 #
1234 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1235 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1236 tmp_flags="$EXTRA_KCFLAGS"
1237 EXTRA_KCFLAGS="-Werror"
1238 LB_LINUX_TRY_COMPILE([
1239         #include <linux/fs.h>
1240         #include <linux/list.h>
1241 ],[
1242         struct inode inode;
1243         struct dentry dentry;
1244         struct hlist_head head;
1245         struct hlist_node node;
1246         inode.i_dentry = head;
1247         dentry.d_alias = node;
1248 ],[
1249         AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1250                   [have i_dentry/d_alias uses hlist])
1251         AC_MSG_RESULT([yes])
1252 ],[
1253         AC_MSG_RESULT([no])
1254 ])
1255 EXTRA_KCFLAGS="$tmp_flags"
1256 ])
1257
1258 #
1259 # 3.6 dentry_open uses struct path as first argument
1260 # see kernel commit 765927b2
1261 #
1262 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1263 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1264 tmp_flags="$EXTRA_KCFLAGS"
1265 EXTRA_KCFLAGS="-Werror"
1266 LB_LINUX_TRY_COMPILE([
1267         #include <linux/fs.h>
1268         #include <linux/path.h>
1269 ],[
1270         struct path path;
1271         dentry_open(&path, 0, NULL);
1272 ],[
1273         AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1274                   [dentry_open uses struct path as first argument])
1275         AC_MSG_RESULT([yes])
1276 ],[
1277         AC_MSG_RESULT([no])
1278 ])
1279 EXTRA_KCFLAGS="$tmp_flags"
1280 ])
1281
1282 #
1283 # 3.6 vfs adds iop->atomic_open
1284 #
1285 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1286 [AC_MSG_CHECKING([if iop has atomic_open])
1287 LB_LINUX_TRY_COMPILE([
1288         #include <linux/fs.h>
1289 ],[
1290         struct inode_operations iop;
1291         iop.atomic_open = NULL;
1292 ],[
1293         AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1294                   [have iop atomic_open])
1295         AC_MSG_RESULT([yes])
1296 ],[
1297         AC_MSG_RESULT([no])
1298 ])
1299 ])
1300
1301 #
1302 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1303 #
1304 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1305 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1306 LB_LINUX_TRY_COMPILE([
1307         #include <linux/fs.h>
1308         #include <linux/posix_acl_xattr.h>
1309 ],[
1310         posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1311 ],[
1312         AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1313                   [posix_acl_to_xattr takes struct user_namespace])
1314         AC_MSG_RESULT([yes])
1315 ],[
1316         AC_MSG_RESULT([no])
1317 ])
1318 ])
1319
1320 #
1321 # 3.9 uses hlist_for_each_entry with 3 args
1322 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1323 #
1324 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1325 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1326 LB_LINUX_TRY_COMPILE([
1327         #include <linux/list.h>
1328         #include <linux/fs.h>
1329 ],[
1330         struct inode *inode;
1331         struct dentry *dentry;
1332         hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1333                 continue;
1334         }
1335 ],[
1336         AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1337         AC_MSG_RESULT([yes])
1338 ],[
1339         AC_MSG_RESULT([no])
1340 ])
1341 ])
1342
1343 #
1344 # 3.9 killed f_vfsmnt by
1345 # 182be684784334598eee1d90274e7f7aa0063616
1346 # replacement is f_path.mnt
1347 #
1348 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1349 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1350 LB_LINUX_TRY_COMPILE([
1351         #include <linux/fs.h>
1352 ],[
1353         struct file *fp = NULL;
1354         struct path  path;
1355
1356         path.mnt = fp->f_path.mnt;
1357 ],[
1358         AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1359         AC_MSG_RESULT([yes])
1360 ],[
1361         AC_MSG_RESULT([no])
1362 ])
1363 ])
1364
1365 #
1366 # LC_PROG_LINUX
1367 #
1368 # Lustre linux kernel checks
1369 #
1370 AC_DEFUN([LC_PROG_LINUX],
1371          [
1372          LC_CONFIG_PINGER
1373          LC_CONFIG_CHECKSUM
1374          LC_CONFIG_LIBLUSTRE_RECOVERY
1375          LC_CONFIG_HEALTH_CHECK_WRITE
1376          LC_CONFIG_LRU_RESIZE
1377          LC_LLITE_LLOOP_MODULE
1378
1379          LC_CAPA_CRYPTO
1380          LC_CONFIG_RMTCLIENT
1381          LC_CONFIG_GSS
1382
1383          # raid5-zerocopy patch
1384          LC_PAGE_CONSTANT
1385
1386          # 2.6.24
1387          LC_BIO_ENDIO_2ARG
1388          LC_PROCFS_DELETED
1389
1390          # 2.6.27
1391          LC_QUOTA_ON_5ARGS
1392          LC_QUOTA_OFF_3ARGS
1393
1394          # 2.6.27.15-2 sles11
1395          LC_BI_HW_SEGMENTS
1396          LC_HAVE_QUOTAIO_H
1397
1398          # 2.6.32
1399          LC_BLK_QUEUE_MAX_SEGMENTS
1400
1401          # 2.6.34
1402          LC_HAVE_DQUOT_FS_DISK_QUOTA
1403          LC_HAVE_DQUOT_SUSPEND
1404
1405          # 2.6.35, 3.0.0
1406          LC_FILE_FSYNC
1407          LC_EXPORT_SIMPLE_SETATTR
1408          LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1409
1410          # 2.6.36
1411          LC_FS_STRUCT_RWLOCK
1412          LC_SBOPS_EVICT_INODE
1413
1414          # 2.6.37
1415          LC_KERNEL_LOCKED
1416
1417          # 2.6.38
1418          LC_BLKDEV_GET_BY_DEV
1419          LC_GENERIC_PERMISSION
1420          LC_QUOTA_ON_USE_PATH
1421          LC_DCACHE_LOCK
1422          LC_INODE_I_RCU
1423          LC_D_COMPARE_7ARGS
1424          LC_D_DELETE_CONST
1425
1426          # 2.6.39
1427          LC_REQUEST_QUEUE_UNPLUG_FN
1428          LC_HAVE_FSTYPE_MOUNT
1429
1430          # 3.0
1431          LC_DIRTY_INODE_WITH_FLAG
1432
1433          # 3.1
1434          LC_LM_XXX_LOCK_MANAGER_OPS
1435          LC_INODE_DIO_WAIT
1436          LC_IOP_GET_ACL
1437          LC_FILE_LLSEEK_SIZE
1438          LC_INODE_PERMISION_2ARGS
1439
1440          # 3.1.1
1441          LC_BLOCKS_FOR_TRUNCATE
1442
1443          # 3.2
1444          LC_HAVE_VOID_MAKE_REQUEST_FN
1445          LC_HAVE_PROTECT_I_NLINK
1446
1447          # 3.3
1448          LC_HAVE_MIGRATE_HEADER
1449          LC_MIGRATEPAGE_4ARGS
1450          LC_SUPEROPS_USE_DENTRY
1451          LC_INODEOPS_USE_UMODE_T
1452
1453          # 3.4
1454          LC_TOUCH_ATIME_1ARG
1455          LC_HAVE_D_MAKE_ROOT
1456          LC_KMAP_ATOMIC_HAS_1ARG
1457
1458          # 3.5
1459          LC_HAVE_CLEAR_INODE
1460          LC_HAVE_ENCODE_FH_PARENT
1461          LC_FILE_LLSEEK_SIZE_5ARG
1462
1463          # 3.6
1464          LC_HAVE_DENTRY_D_ALIAS_HLIST
1465          LC_DENTRY_OPEN_USE_PATH
1466          LC_HAVE_IOP_ATOMIC_OPEN
1467
1468          # 3.7
1469          LC_HAVE_POSIXACL_USER_NS
1470
1471          # 3.9
1472          LC_HAVE_HLIST_FOR_EACH_3ARG
1473          LC_HAVE_F_PATH_MNT
1474
1475          #
1476          if test x$enable_server = xyes ; then
1477                 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1478                 LC_FUNC_DEV_SET_RDONLY
1479                 LC_STACK_SIZE
1480                 LC_QUOTA64
1481                 LC_QUOTA_CONFIG
1482          fi
1483 ])
1484
1485 #
1486 # LC_CONFIG_CLIENT_SERVER
1487 #
1488 # Build client/server sides of Lustre
1489 #
1490 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1491 [AC_MSG_CHECKING([whether to build Lustre server support])
1492 AC_ARG_ENABLE([server],
1493         AC_HELP_STRING([--disable-server],
1494                         [disable Lustre server support]),
1495         [],[enable_server='yes'])
1496 AC_MSG_RESULT([$enable_server])
1497
1498 AC_MSG_CHECKING([whether to build Lustre client support])
1499 AC_ARG_ENABLE([client],
1500         AC_HELP_STRING([--disable-client],
1501                         [disable Lustre client support]),
1502         [],[enable_client='yes'])
1503 AC_MSG_RESULT([$enable_client])])
1504
1505 #
1506 # LC_CONFIG_LIBLUSTRE
1507 #
1508 # whether to build liblustre
1509 #
1510 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1511 [AC_MSG_CHECKING([whether to build Lustre library])
1512 AC_ARG_ENABLE([liblustre],
1513         AC_HELP_STRING([--disable-liblustre],
1514                         [disable building of Lustre library]),
1515         [],[enable_liblustre=$with_sysio])
1516 AC_MSG_RESULT([$enable_liblustre])
1517 # only build sysio if liblustre is built
1518 with_sysio="$enable_liblustre"
1519
1520 AC_MSG_CHECKING([whether to build liblustre tests])
1521 AC_ARG_ENABLE([liblustre-tests],
1522         AC_HELP_STRING([--enable-liblustre-tests],
1523                         [enable liblustre tests, if --disable-tests is used]),
1524         [],[enable_liblustre_tests=$enable_tests])
1525 if test x$enable_liblustre != xyes ; then
1526    enable_liblustre_tests='no'
1527 fi
1528 AC_MSG_RESULT([$enable_liblustre_tests])
1529
1530 AC_MSG_CHECKING([whether to enable liblustre acl])
1531 AC_ARG_ENABLE([liblustre-acl],
1532         AC_HELP_STRING([--disable-liblustre-acl],
1533                         [disable ACL support for liblustre]),
1534         [],[enable_liblustre_acl=yes])
1535 AC_MSG_RESULT([$enable_liblustre_acl])
1536 if test x$enable_liblustre_acl = xyes ; then
1537   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1538 fi
1539
1540 #
1541 # --enable-mpitest
1542 #
1543 AC_ARG_ENABLE(mpitests,
1544         AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1545                            [include mpi tests]),
1546         [
1547          enable_mpitests=yes
1548          case $enableval in
1549          yes)
1550                 MPICC_WRAPPER=mpicc
1551                 ;;
1552          no)
1553                 enable_mpitests=no
1554                 ;;
1555          *)
1556                 MPICC_WRAPPER=$enableval
1557                  ;;
1558          esac
1559         ],
1560         [
1561         MPICC_WRAPPER=mpicc
1562         enable_mpitests=yes
1563         ]
1564 )
1565
1566 if test x$enable_mpitests != xno; then
1567         AC_MSG_CHECKING([whether mpitests can be built])
1568         oldcc=$CC
1569         CC=$MPICC_WRAPPER
1570         AC_LINK_IFELSE(
1571             [AC_LANG_PROGRAM([[
1572                     #include <mpi.h>
1573                 ]],[[
1574                     int flag;
1575                     MPI_Initialized(&flag);
1576                 ]])],
1577             [
1578                     AC_MSG_RESULT([yes])
1579             ],[
1580                     AC_MSG_RESULT([no])
1581                     enable_mpitests=no
1582         ])
1583         CC=$oldcc
1584 fi
1585 AC_SUBST(MPICC_WRAPPER)
1586
1587 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1588 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1589
1590 LC_CONFIG_PINGER
1591 LC_CONFIG_LIBLUSTRE_RECOVERY
1592 ])
1593
1594 #
1595 # LC_CONFIG_QUOTA
1596 #
1597 # whether to enable quota support global control
1598 #
1599 AC_DEFUN([LC_CONFIG_QUOTA],
1600 [AC_ARG_ENABLE([quota],
1601         AC_HELP_STRING([--enable-quota],
1602                         [enable quota support]),
1603         [],[enable_quota='yes'])
1604 ])
1605
1606 AC_DEFUN([LC_QUOTA],
1607 [#check global
1608 LC_CONFIG_QUOTA
1609 #check for utils
1610 AC_CHECK_HEADER(sys/quota.h,
1611                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1612                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1613 ])
1614
1615 #
1616 # LC_CONFIG_SPLIT
1617 #
1618 # whether to enable split support
1619 #
1620 AC_DEFUN([LC_CONFIG_SPLIT],
1621 [AC_MSG_CHECKING([whether to enable split support])
1622 AC_ARG_ENABLE([split],
1623         AC_HELP_STRING([--enable-split],
1624                         [enable split support]),
1625         [],[enable_split='no'])
1626 AC_MSG_RESULT([$enable_split])
1627 if test x$enable_split != xno; then
1628    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1629 fi
1630 ])
1631
1632 #
1633 # LC_LLITE_LLOOP_MODULE
1634 # lloop_llite.ko does not currently work with page sizes
1635 # of 64k or larger.
1636 #
1637 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1638 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1639 LB_LINUX_TRY_COMPILE([
1640         #include <asm/page.h>
1641 ],[
1642         #if PAGE_SIZE >= 65536
1643         #error "PAGE_SIZE >= 65536"
1644         #endif
1645 ],[
1646         enable_llite_lloop_module='yes'
1647         AC_MSG_RESULT([yes])
1648 ],[
1649         enable_llite_lloop_module='no'
1650         AC_MSG_RESULT([no])
1651 ])
1652 ])
1653
1654 #
1655 # LC_OSD_ADDON
1656 #
1657 # configure support for optional OSD implementation
1658 #
1659 AC_DEFUN([LC_OSD_ADDON],
1660 [AC_MSG_CHECKING([for osd])
1661 AC_ARG_WITH([osd],
1662         AC_HELP_STRING([--with-osd=path],
1663                        [set path to optional osd]),
1664         [
1665                 case $with_osd in
1666                         no)     ENABLEOSDADDON=0
1667                                 ;;
1668                         *)      OSDADDON="${with_osd}"
1669                                 ENABLEOSDADDON=1
1670                                 ;;
1671                 esac
1672         ], [
1673                 ENABLEOSDADDON=0
1674         ])
1675 if test $ENABLEOSDADDON -eq 0; then
1676         AC_MSG_RESULT([no])
1677         OSDADDON=
1678 else
1679         OSDMODNAME=`basename $OSDADDON`
1680         if test -e $LUSTRE/$OSDMODNAME; then
1681                 AC_MSG_RESULT([can't link])
1682                 OSDADDON=
1683         elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1684                 AC_MSG_RESULT([$OSDMODNAME])
1685                 OSDADDON="subdir-m += $OSDMODNAME"
1686         else
1687                 AC_MSG_RESULT([can't link])
1688                 OSDADDON=
1689         fi
1690 fi
1691 AC_SUBST(OSDADDON)
1692 ])
1693
1694 #
1695 # LC_CONFIGURE
1696 #
1697 # other configure checks
1698 #
1699 AC_DEFUN([LC_CONFIGURE],
1700 [LC_CONFIG_OBD_BUFFER_SIZE
1701
1702 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1703         CFLAGS="$CFLAGS -Werror"
1704 fi
1705
1706 # maximum MDS thread count
1707 LC_MDS_MAX_THREADS
1708
1709 # include/liblustre.h
1710 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1711
1712 # liblustre/llite_lib.h
1713 AC_CHECK_HEADERS([xtio.h file.h])
1714
1715 # liblustre/dir.c
1716 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1717
1718 # liblustre/lutil.c
1719 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1720 AC_CHECK_FUNCS([inet_ntoa])
1721
1722 # libsysio/src/readlink.c
1723 LC_READLINK_SSIZE_T
1724
1725 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1726 AC_CHECK_HEADERS([linux/random.h], [], [],
1727                  [#ifdef HAVE_LINUX_TYPES_H
1728                   # include <linux/types.h>
1729                   #endif
1730                  ])
1731
1732 # utils/llverfs.c
1733 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1734
1735 # check for -lz support
1736 ZLIB=""
1737 AC_CHECK_LIB([z],
1738              [adler32],
1739              [AC_CHECK_HEADERS([zlib.h],
1740                                [ZLIB="-lz"
1741                                 AC_DEFINE([HAVE_ADLER], 1,
1742                                           [support alder32 checksum type])],
1743                                [AC_MSG_WARN([No zlib-devel package found,
1744                                              unable to use adler32 checksum])])],
1745              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1746 )
1747 AC_SUBST(ZLIB)
1748
1749 SELINUX=""
1750 AC_CHECK_LIB([selinux],
1751                 [is_selinux_enabled],
1752                 [AC_CHECK_HEADERS([selinux.h],
1753                                 [SELINUX="-lselinux"
1754                                 AC_DEFINE([HAVE_SELINUX], 1,
1755                                                 [support for selinux ])],
1756                                 [AC_MSG_WARN([No selinux-devel package found,
1757                                                 unable to build selinux enabled
1758                                                 tools])])],
1759                 [AC_MSG_WARN([No selinux package found, unable to build selinux
1760                                 enabled tools])]
1761 )
1762 AC_SUBST(SELINUX)
1763
1764 # Super safe df
1765 AC_ARG_ENABLE([mindf],
1766       AC_HELP_STRING([--enable-mindf],
1767                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1768       [],[])
1769 if test "$enable_mindf" = "yes" ;  then
1770       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1771 fi
1772
1773 AC_ARG_ENABLE([fail_alloc],
1774         AC_HELP_STRING([--disable-fail-alloc],
1775                 [disable randomly alloc failure]),
1776         [],[enable_fail_alloc=yes])
1777 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1778 AC_MSG_RESULT([$enable_fail_alloc])
1779 if test x$enable_fail_alloc != xno ; then
1780         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1781 fi
1782
1783 AC_ARG_ENABLE([invariants],
1784         AC_HELP_STRING([--enable-invariants],
1785                 [enable invariant checking (cpu intensive)]),
1786         [],[])
1787 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1788 AC_MSG_RESULT([$enable_invariants])
1789 if test x$enable_invariants = xyes ; then
1790         AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1791 fi
1792
1793 AC_ARG_ENABLE([lu_ref],
1794         AC_HELP_STRING([--enable-lu_ref],
1795                 [enable lu_ref reference tracking code]),
1796         [],[])
1797 AC_MSG_CHECKING([whether to track references with lu_ref])
1798 AC_MSG_RESULT([$enable_lu_ref])
1799 if test x$enable_lu_ref = xyes ; then
1800         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1801 fi
1802
1803 AC_ARG_ENABLE([pgstate-track],
1804               AC_HELP_STRING([--enable-pgstate-track],
1805                              [enable page state tracking]),
1806               [enable_pgstat_track='yes'],[])
1807 AC_MSG_CHECKING([whether to enable page state tracking])
1808 AC_MSG_RESULT([$enable_pgstat_track])
1809 if test x$enable_pgstat_track = xyes ; then
1810         AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1811                   [enable page state tracking code])
1812 fi
1813 ])
1814
1815 #
1816 # LC_CONDITIONALS
1817 #
1818 # AM_CONDITIONALS for lustre
1819 #
1820 AC_DEFUN([LC_CONDITIONALS],
1821 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1822 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1823 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1824 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1825 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1826 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1827 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1828 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1829 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1830 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1831 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1832 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1833 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1834 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1835 ])
1836
1837 #
1838 # LC_CONFIG_FILES
1839 #
1840 # files that should be generated with AC_OUTPUT
1841 #
1842 AC_DEFUN([LC_CONFIG_FILES],
1843 [AC_CONFIG_FILES([
1844 lustre/Makefile
1845 lustre/autoMakefile
1846 lustre/autoconf/Makefile
1847 lustre/conf/Makefile
1848 lustre/contrib/Makefile
1849 lustre/doc/Makefile
1850 lustre/include/Makefile
1851 lustre/include/lustre_ver.h
1852 lustre/include/linux/Makefile
1853 lustre/include/darwin/Makefile
1854 lustre/include/lustre/Makefile
1855 lustre/kernel_patches/targets/2.6-rhel6.target
1856 lustre/kernel_patches/targets/2.6-rhel5.target
1857 lustre/kernel_patches/targets/2.6-sles11.target
1858 lustre/kernel_patches/targets/3.0-sles11.target
1859 lustre/kernel_patches/targets/2.6-fc11.target
1860 lustre/kernel_patches/targets/2.6-fc12.target
1861 lustre/kernel_patches/targets/2.6-fc15.target
1862 lustre/kernel_patches/targets/3.x-fc18.target
1863 lustre/ldlm/Makefile
1864 lustre/fid/Makefile
1865 lustre/fid/autoMakefile
1866 lustre/liblustre/Makefile
1867 lustre/liblustre/tests/Makefile
1868 lustre/liblustre/tests/mpi/Makefile
1869 lustre/llite/Makefile
1870 lustre/llite/autoMakefile
1871 lustre/lclient/Makefile
1872 lustre/lov/Makefile
1873 lustre/lov/autoMakefile
1874 lustre/lvfs/Makefile
1875 lustre/lvfs/autoMakefile
1876 lustre/mdc/Makefile
1877 lustre/mdc/autoMakefile
1878 lustre/lmv/Makefile
1879 lustre/lmv/autoMakefile
1880 lustre/lfsck/Makefile
1881 lustre/lfsck/autoMakefile
1882 lustre/mdt/Makefile
1883 lustre/mdt/autoMakefile
1884 lustre/mdd/Makefile
1885 lustre/mdd/autoMakefile
1886 lustre/fld/Makefile
1887 lustre/fld/autoMakefile
1888 lustre/obdclass/Makefile
1889 lustre/obdclass/autoMakefile
1890 lustre/obdclass/linux/Makefile
1891 lustre/obdecho/Makefile
1892 lustre/obdecho/autoMakefile
1893 lustre/ofd/Makefile
1894 lustre/ofd/autoMakefile
1895 lustre/osc/Makefile
1896 lustre/osc/autoMakefile
1897 lustre/ost/Makefile
1898 lustre/ost/autoMakefile
1899 lustre/osd-ldiskfs/Makefile
1900 lustre/osd-ldiskfs/autoMakefile
1901 lustre/osd-zfs/Makefile
1902 lustre/osd-zfs/autoMakefile
1903 lustre/mgc/Makefile
1904 lustre/mgc/autoMakefile
1905 lustre/mgs/Makefile
1906 lustre/mgs/autoMakefile
1907 lustre/target/Makefile
1908 lustre/ptlrpc/Makefile
1909 lustre/ptlrpc/autoMakefile
1910 lustre/ptlrpc/gss/Makefile
1911 lustre/ptlrpc/gss/autoMakefile
1912 lustre/quota/Makefile
1913 lustre/quota/autoMakefile
1914 lustre/scripts/Makefile
1915 lustre/tests/Makefile
1916 lustre/tests/mpi/Makefile
1917 lustre/utils/Makefile
1918 lustre/utils/gss/Makefile
1919 lustre/osp/Makefile
1920 lustre/osp/autoMakefile
1921 lustre/lod/Makefile
1922 lustre/lod/autoMakefile
1923 lustre/obdclass/darwin/Makefile
1924 ])
1925 ])