Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 #
3 # LC_CONFIG_SRCDIR
4 #
5 # Wrapper for AC_CONFIG_SUBDIR
6 #
7 AC_DEFUN([LC_CONFIG_SRCDIR],
8 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
9 ])
10
11 #
12 # LC_PATH_DEFAULTS
13 #
14 # lustre specific paths
15 #
16 AC_DEFUN([LC_PATH_DEFAULTS],
17 [# ptlrpc kernel build requires this
18 LUSTRE="$PWD/lustre"
19 AC_SUBST(LUSTRE)
20
21 # mount.lustre
22 rootsbindir='/sbin'
23 AC_SUBST(rootsbindir)
24
25 demodir='$(docdir)/demo'
26 AC_SUBST(demodir)
27
28 pkgexampledir='${pkgdatadir}/examples'
29 AC_SUBST(pkgexampledir)
30 ])
31
32 #
33 # LC_TARGET_SUPPORTED
34 #
35 # is the target os supported?
36 #
37 AC_DEFUN([LC_TARGET_SUPPORTED],
38 [case $target_os in
39         linux* | darwin*)
40 $1
41                 ;;
42         *)
43 $2
44                 ;;
45 esac
46 ])
47
48 #
49 # LC_CONFIG_EXT3
50 #
51 # that ext3 is enabled in the kernel
52 #
53 AC_DEFUN([LC_CONFIG_EXT3],
54 [LB_LINUX_CONFIG([EXT3_FS],[],[
55         LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
56 ])
57 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
58 ])
59
60 #
61 # LC_FSHOOKS
62 #
63 # If we have (and can build) fshooks.h
64 #
65 AC_DEFUN([LC_FSHOOKS],
66 [LB_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
67         AC_MSG_CHECKING([if fshooks.h can be compiled])
68         LB_LINUX_TRY_COMPILE([
69                 #include <linux/fshooks.h>
70         ],[],[
71                 AC_MSG_RESULT([yes])
72         ],[
73                 AC_MSG_RESULT([no])
74                 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
75                 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
76                 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
77         ])
78 $1
79 ],[
80 $2
81 ])
82 ])
83
84 #
85 # LC_STRUCT_KIOBUF
86 #
87 # rh 2.4.18 has iobuf->dovary, but other kernels do not
88 #
89 AC_DEFUN([LC_STRUCT_KIOBUF],
90 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
91 LB_LINUX_TRY_COMPILE([
92         #include <linux/iobuf.h>
93 ],[
94         struct kiobuf iobuf;
95         iobuf.dovary = 1;
96 ],[
97         AC_MSG_RESULT([yes])
98         AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
99 ],[
100         AC_MSG_RESULT([no])
101 ])
102 ])
103
104 #
105 # LC_FUNC_COND_RESCHED
106 #
107 # cond_resched() was introduced in 2.4.20
108 #
109 AC_DEFUN([LC_FUNC_COND_RESCHED],
110 [AC_MSG_CHECKING([if kernel offers cond_resched])
111 LB_LINUX_TRY_COMPILE([
112         #include <linux/sched.h>
113 ],[
114         cond_resched();
115 ],[
116         AC_MSG_RESULT([yes])
117         AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
118 ],[
119         AC_MSG_RESULT([no])
120 ])
121 ])
122
123 #
124 # LC_FUNC_ZAP_PAGE_RANGE
125 #
126 # if zap_page_range() takes a vma arg
127 #
128 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
129 [AC_MSG_CHECKING([if zap_page_range with vma parameter])
130 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
131 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
132         AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
133         AC_MSG_RESULT([yes])
134 else
135         AC_MSG_RESULT([no])
136 fi
137 ])
138
139 #
140 # LC_FUNC_PDE
141 #
142 # if proc_fs.h defines PDE()
143 #
144 AC_DEFUN([LC_FUNC_PDE],
145 [AC_MSG_CHECKING([if kernel defines PDE])
146 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
147 if test "$HAVE_PDE" != 0 ; then
148         AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
149         AC_MSG_RESULT([yes])
150 else
151         AC_MSG_RESULT([no])
152 fi
153 ])
154
155 #
156 # LC_FUNC_FILEMAP_FDATASYNC
157 #
158 # if filemap_fdatasync() exists
159 #
160 AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE],
161 [AC_MSG_CHECKING([whether filemap_fdatawrite() is defined])
162 LB_LINUX_TRY_COMPILE([
163         #include <linux/fs.h>
164 ],[
165         int (*foo)(struct address_space *)= filemap_fdatawrite;
166 ],[
167         AC_MSG_RESULT([yes])
168         AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found])
169 ],[
170         AC_MSG_RESULT([no])
171 ])
172 ])
173
174 #
175 # LC_FUNC_DIRECT_IO
176 #
177 # if direct_IO takes a struct file argument
178 #
179 AC_DEFUN([LC_FUNC_DIRECT_IO],
180 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
181 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
182 if test "$HAVE_DIO_FILE" != 0 ; then
183         AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
184         AC_MSG_RESULT(yes)
185 else
186         AC_MSG_RESULT(no)
187 fi
188 ])
189
190 #
191 # LC_HEADER_MM_INLINE
192 #
193 # RHEL kernels define page_count in mm_inline.h
194 #
195 AC_DEFUN([LC_HEADER_MM_INLINE],
196 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
197 LB_LINUX_TRY_COMPILE([
198         #include <linux/mm_inline.h>
199 ],[
200         #ifndef page_count
201         #error mm_inline.h does not define page_count
202         #endif
203 ],[
204         AC_MSG_RESULT([yes])
205         AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
206 ],[
207         AC_MSG_RESULT([no])
208 ])
209 ])
210
211 #
212 # LC_STRUCT_INODE
213 #
214 # if inode->i_alloc_sem exists
215 #
216 AC_DEFUN([LC_STRUCT_INODE],
217 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
218 LB_LINUX_TRY_COMPILE([
219         #include <linux/fs.h>
220         #include <linux/version.h>
221 ],[
222         #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
223         #error "down_read_trylock broken before 2.4.24"
224         #endif
225         struct inode i;
226         return (char *)&i.i_alloc_sem - (char *)&i;
227 ],[
228         AC_MSG_RESULT([yes])
229         AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
230 ],[
231         AC_MSG_RESULT([no])
232 ])
233 ])
234
235 #
236 # LC_FUNC_REGISTER_CACHE
237 #
238 # if register_cache() is defined by kernel
239 #
240 AC_DEFUN([LC_FUNC_REGISTER_CACHE],
241 [AC_MSG_CHECKING([if kernel defines register_cache()])
242 LB_LINUX_TRY_COMPILE([
243         #include <linux/list.h>
244         #include <linux/cache_def.h>
245 ],[
246         struct cache_definition cache;
247 ],[
248         AC_MSG_RESULT([yes])
249         AC_DEFINE(HAVE_REGISTER_CACHE, 1, [register_cache found])
250         AC_MSG_CHECKING([if kernel expects return from cache shrink function])
251         HAVE_CACHE_RETURN_INT="`grep -c 'int.*shrink' $LINUX/include/linux/cache_def.h`"
252         if test "$HAVE_CACHE_RETURN_INT" != 0 ; then
253                 AC_DEFINE(HAVE_CACHE_RETURN_INT, 1, [kernel expects return from shrink_cache])
254                 AC_MSG_RESULT(yes)
255         else
256                 AC_MSG_RESULT(no)
257         fi
258 ],[
259         AC_MSG_RESULT([no])
260 ])
261 ])
262
263 #
264 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
265 #
266 # check for our patched grab_cache_page_nowait_gfp() function
267 #
268 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
269 [AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
270 HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/include/linux/pagemap.h`"
271 if test "$HAVE_GCPN_GFP" != 0 ; then
272         AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
273                 [kernel has grab_cache_page_nowait_gfp()])
274         AC_MSG_RESULT(yes)
275 else
276         AC_MSG_RESULT(no)
277 fi
278 ])
279
280 #
281 # LC_FUNC_DEV_SET_RDONLY
282 #
283 # check for the old-style dev_set_rdonly which took an extra "devno" param
284 # and can only set a single device to discard writes at one time
285 #
286 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
287 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
288 LB_LINUX_TRY_COMPILE([
289         #include <linux/fs.h>
290 ],[
291         #ifndef HAVE_CLEAR_RDONLY_ON_PUT
292         #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
293         #endif
294 ],[
295         AC_MSG_RESULT([yes])
296         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
297 ],[
298         AC_MSG_RESULT([no, Linux kernel source needs to be patches by lustre 
299 kernel patches from Lustre version 1.4.3 or above.])
300 ])
301 ])
302
303 #
304 # LC_CONFIG_BACKINGFS
305 #
306 # whether to use ldiskfs instead of ext3
307 #
308 AC_DEFUN([LC_CONFIG_BACKINGFS],
309 [
310 BACKINGFS='ext3'
311
312 # 2.6 gets ldiskfs
313 AC_MSG_CHECKING([whether to enable ldiskfs])
314 AC_ARG_ENABLE([ldiskfs],
315         AC_HELP_STRING([--enable-ldiskfs],
316                         [use ldiskfs for the Lustre backing FS]),
317         [],[enable_ldiskfs="$linux25"])
318 AC_MSG_RESULT([$enable_ldiskfs])
319
320 if test x$enable_ldiskfs = xyes ; then
321         BACKINGFS="ldiskfs"
322
323         AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
324         AC_ARG_ENABLE([quilt],
325                         AC_HELP_STRING([--disable-quilt],[disable use of quilt for ldiskfs]),
326                         [],[enable_quilt='yes'])
327         AC_MSG_RESULT([$enable_quilt])
328
329         AC_PATH_PROG(PATCH, patch, [no])
330
331         if test x$enable_quilt = xno ; then
332             QUILT="no"
333         else
334             AC_PATH_PROG(QUILT, quilt, [no])
335         fi
336
337         if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
338                 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
339         fi
340
341         AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
342         AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
343         AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs])
344         AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security for ldiskfs])
345
346         AC_DEFINE(CONFIG_LDISKFS2_FS_XATTR, 1, [enable extended attributes for ldiskfs2])
347         AC_DEFINE(CONFIG_LDISKFS2_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs2])
348         AC_DEFINE(CONFIG_LDISKFS2_FS_SECURITY, 1, [enable fs security for ldiskfs2])
349 fi
350
351 AC_MSG_CHECKING([which backing filesystem to use])
352 AC_MSG_RESULT([$BACKINGFS])
353 AC_SUBST(BACKINGFS)
354
355 case $BACKINGFS in
356         ext3)
357                 # --- Check that ext3 and ext3 xattr are enabled in the kernel
358                 LC_CONFIG_EXT3([],[
359                         AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
360                 ],[
361                         AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
362                         AC_MSG_WARN([This build may fail.])
363                 ])
364                 ;;
365         ldiskfs)
366                 AC_MSG_CHECKING([which ldiskfs series to use])
367                 case $LINUXRELEASE in
368                 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
369                 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
370                 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
371                 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
372                 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
373                 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
374                 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
375                 2.6.18*) LDISKFS_SERIES="2.6.18-vanilla.series";;
376                 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix lustre/autoconf/lustre-core.m4])
377                 esac
378                 AC_MSG_RESULT([$LDISKFS_SERIES])
379                 AC_SUBST(LDISKFS_SERIES)
380                 ;;
381 esac # $BACKINGFS
382 ])
383
384 #
385 # LC_CONFIG_PINGER
386 #
387 # the pinger is temporary, until we have the recovery node in place
388 #
389 AC_DEFUN([LC_CONFIG_PINGER],
390 [AC_MSG_CHECKING([whether to enable pinger support])
391 AC_ARG_ENABLE([pinger],
392         AC_HELP_STRING([--disable-pinger],
393                         [disable recovery pinger support]),
394         [],[enable_pinger='yes'])
395 AC_MSG_RESULT([$enable_pinger])
396 if test x$enable_pinger != xno ; then
397   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
398 fi
399 ])
400
401 #
402 # LC_CONFIG_LIBLUSTRE_RECOVERY
403 #
404 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
405 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
406 AC_ARG_ENABLE([liblustre-recovery],
407         AC_HELP_STRING([--disable-liblustre-recovery],
408                         [disable liblustre recovery support]),
409         [],[enable_liblustre_recovery='yes'])
410 AC_MSG_RESULT([$enable_liblustre_recovery])
411 if test x$enable_liblustre_recovery != xno ; then
412   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
413 fi
414 ])
415
416 #
417 # LC_CONFIG_OBD_BUFFER_SIZE
418 #
419 # the maximum buffer size of lctl ioctls
420 #
421 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
422 [AC_MSG_CHECKING([maximum OBD ioctl size])
423 AC_ARG_WITH([obd-buffer-size],
424         AC_HELP_STRING([--with-obd-buffer-size=[size]],
425                         [set lctl ioctl maximum bytes (default=8192)]),
426         [
427                 OBD_BUFFER_SIZE=$with_obd_buffer_size
428         ],[
429                 OBD_BUFFER_SIZE=8192
430         ])
431 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
432 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
433 ])
434
435 #
436 # LC_STRUCT_STATFS
437 #
438 # AIX does not have statfs.f_namelen
439 #
440 AC_DEFUN([LC_STRUCT_STATFS],
441 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
442 LB_LINUX_TRY_COMPILE([
443         #include <linux/vfs.h>
444 ],[
445         struct statfs sfs;
446         sfs.f_namelen = 1;
447 ],[
448         AC_MSG_RESULT([yes])
449         AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
450 ],[
451         AC_MSG_RESULT([no])
452 ])
453 ])
454
455 #
456 # LC_READLINK_SSIZE_T
457 #
458 AC_DEFUN([LC_READLINK_SSIZE_T],
459 [AC_MSG_CHECKING([if readlink returns ssize_t])
460 AC_TRY_COMPILE([
461         #include <unistd.h>
462 ],[
463         ssize_t readlink(const char *, char *, size_t);
464 ],[
465         AC_MSG_RESULT([yes])
466         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
467 ],[
468         AC_MSG_RESULT([no])
469 ])
470 ])
471
472 AC_DEFUN([LC_FUNC_PAGE_MAPPED],
473 [AC_MSG_CHECKING([if kernel offers page_mapped])
474 LB_LINUX_TRY_COMPILE([
475         #include <linux/mm.h>
476 ],[
477         page_mapped(NULL);
478 ],[
479         AC_MSG_RESULT([yes])
480         AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found])
481 ],[
482         AC_MSG_RESULT([no])
483 ])
484 ])
485
486 AC_DEFUN([LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL],
487 [AC_MSG_CHECKING([if struct file_operations has an unlocked_ioctl field])
488 LB_LINUX_TRY_COMPILE([
489         #include <linux/fs.h>
490 ],[
491         struct file_operations fops;
492         &fops.unlocked_ioctl;
493 ],[
494         AC_MSG_RESULT([yes])
495         AC_DEFINE(HAVE_UNLOCKED_IOCTL, 1, [struct file_operations has an unlock ed_ioctl field])
496 ],[
497         AC_MSG_RESULT([no])
498 ])
499 ])
500
501 AC_DEFUN([LC_FILEMAP_POPULATE],
502 [AC_MSG_CHECKING([for exported filemap_populate])
503 LB_LINUX_TRY_COMPILE([
504         #include <asm/page.h>
505         #include <linux/mm.h>
506 ],[
507        filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
508 ],[
509         AC_MSG_RESULT([yes])
510         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
511 ],[
512         AC_MSG_RESULT([no])
513 ])
514 ])
515
516 AC_DEFUN([LC_D_ADD_UNIQUE],
517 [AC_MSG_CHECKING([for d_add_unique])
518 LB_LINUX_TRY_COMPILE([
519         #include <linux/dcache.h>
520 ],[
521        d_add_unique(NULL, NULL);
522 ],[
523         AC_MSG_RESULT([yes])
524         AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
525 ],[
526         AC_MSG_RESULT([no])
527 ])
528 ])
529
530 AC_DEFUN([LC_BIT_SPINLOCK_H],
531 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
532         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
533         LB_LINUX_TRY_COMPILE([
534                 #include <asm/processor.h>
535                 #include <linux/spinlock.h>
536                 #include <linux/bit_spinlock.h>
537         ],[],[
538                 AC_MSG_RESULT([yes])
539                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
540         ],[
541                 AC_MSG_RESULT([no])
542         ])
543 ],
544 [])
545 ])
546
547 #
548 # LC_POSIX_ACL_XATTR
549 #
550 # If we have xattr_acl.h 
551 #
552 AC_DEFUN([LC_XATTR_ACL],
553 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
554         AC_MSG_CHECKING([if xattr_acl.h can be compiled])
555         LB_LINUX_TRY_COMPILE([
556                 #include <linux/xattr_acl.h>
557         ],[],[
558                 AC_MSG_RESULT([yes])
559                 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
560         ],[
561                 AC_MSG_RESULT([no])
562         ])
563 ],
564 [])
565 ])
566
567 AC_DEFUN([LC_STRUCT_INTENT_FILE],
568 [AC_MSG_CHECKING([if struct open_intent has a file field])
569 LB_LINUX_TRY_COMPILE([
570         #include <linux/fs.h>
571         #include <linux/namei.h>
572 ],[
573         struct open_intent intent;
574         &intent.file;
575 ],[
576         AC_MSG_RESULT([yes])
577         AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
578 ],[
579         AC_MSG_RESULT([no])
580 ])
581 ])
582
583
584 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
585 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
586         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
587         LB_LINUX_TRY_COMPILE([
588                 #include <linux/posix_acl_xattr.h>
589         ],[],[
590                 AC_MSG_RESULT([yes])
591                 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
592
593         ],[
594                 AC_MSG_RESULT([no])
595         ])
596 $1
597 ],[
598 AC_MSG_RESULT([no])
599 ])
600 ])
601
602 AC_DEFUN([LC_LUSTRE_VERSION_H],
603 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
604         rm -f "$LUSTRE/include/linux/lustre_version.h"
605 ],[
606         touch "$LUSTRE/include/linux/lustre_version.h"
607         if test x$enable_server = xyes ; then
608                 AC_MSG_WARN([Unpatched kernel detected.])
609                 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
610                 AC_MSG_WARN([disabling server build])
611                 enable_server='no'
612         fi
613 ])
614 ])
615
616 AC_DEFUN([LC_FUNC_SET_FS_PWD],
617 [AC_MSG_CHECKING([if kernel exports show_task])
618 have_show_task=0
619         if grep -q "EXPORT_SYMBOL(show_task)" \
620                  "$LINUX/fs/namespace.c" 2>/dev/null ; then
621                 AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
622                 AC_MSG_RESULT([yes])
623         else
624                 AC_MSG_RESULT([no])
625         fi
626 ])
627
628
629 #
630 # LC_FUNC_MS_FLOCK_LOCK
631 #
632 # SLES9 kernel has MS_FLOCK_LOCK sb flag
633 #
634 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
635 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
636 LB_LINUX_TRY_COMPILE([
637         #include <linux/fs.h>
638 ],[
639         int flags = MS_FLOCK_LOCK;
640 ],[
641         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
642                 [kernel has MS_FLOCK_LOCK flag])
643         AC_MSG_RESULT([yes])
644 ],[
645         AC_MSG_RESULT([no])
646 ])
647 ])
648
649 #
650 # LC_FUNC_HAVE_CAN_SLEEP_ARG
651 #
652 # SLES9 kernel has third arg can_sleep
653 # in fs/locks.c: flock_lock_file_wait()
654 #
655 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
656 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
657 LB_LINUX_TRY_COMPILE([
658         #include <linux/fs.h>
659 ],[
660         int cansleep;
661         struct file *file;
662         struct file_lock *file_lock;
663         flock_lock_file_wait(file, file_lock, cansleep);
664 ],[
665         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
666                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
667         AC_MSG_RESULT([yes])
668 ],[
669         AC_MSG_RESULT([no])
670 ])
671 ])
672
673 #
674 # LC_FUNC_F_OP_FLOCK
675 #
676 # rhel4.2 kernel has f_op->flock field
677 #
678 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
679 [AC_MSG_CHECKING([if struct file_operations has flock field])
680 LB_LINUX_TRY_COMPILE([
681         #include <linux/fs.h>
682 ],[
683         struct file_operations ll_file_operations_flock;
684         ll_file_operations_flock.flock = NULL;
685 ],[
686         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
687                 [struct file_operations has flock field])
688         AC_MSG_RESULT([yes])
689 ],[
690         AC_MSG_RESULT([no])
691 ])
692 ])
693
694 #
695 # LC_FUNC_MS_FLOCK_LOCK
696 #
697 # SLES9 kernel has MS_FLOCK_LOCK sb flag
698 #
699 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
700 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
701 LB_LINUX_TRY_COMPILE([
702         #include <linux/fs.h>
703 ],[
704         int flags = MS_FLOCK_LOCK;
705 ],[
706         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
707                 [kernel has MS_FLOCK_LOCK flag])
708         AC_MSG_RESULT([yes])
709 ],[
710         AC_MSG_RESULT([no])
711 ])
712 ])
713
714 #
715 # LC_FUNC_HAVE_CAN_SLEEP_ARG
716 #
717 # SLES9 kernel has third arg can_sleep
718 # in fs/locks.c: flock_lock_file_wait()
719 #
720 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
721 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
722 LB_LINUX_TRY_COMPILE([
723         #include <linux/fs.h>
724 ],[
725         int cansleep;
726         struct file *file;
727         struct file_lock *file_lock;
728         flock_lock_file_wait(file, file_lock, cansleep);
729 ],[
730         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
731                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
732         AC_MSG_RESULT([yes])
733 ],[
734         AC_MSG_RESULT([no])
735 ])
736 ])
737
738 #
739 # LC_TASK_PPTR
740 #
741 # task struct has p_pptr instead of parent
742 #
743 AC_DEFUN([LC_TASK_PPTR],
744 [AC_MSG_CHECKING([task p_pptr found])
745 LB_LINUX_TRY_COMPILE([
746         #include <linux/sched.h>
747 ],[
748         struct task_struct *p;
749         
750         p = p->p_pptr;
751 ],[
752         AC_MSG_RESULT([yes])
753         AC_DEFINE(HAVE_TASK_PPTR, 1, [task p_pptr found])
754 ],[
755         AC_MSG_RESULT([no])
756 ])
757 ])
758
759 #
760 # LC_FUNC_F_OP_FLOCK
761 #
762 # rhel4.2 kernel has f_op->flock field
763 #
764 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
765 [AC_MSG_CHECKING([if struct file_operations has flock field])
766 LB_LINUX_TRY_COMPILE([
767         #include <linux/fs.h>
768 ],[
769         struct file_operations ll_file_operations_flock;
770         ll_file_operations_flock.flock = NULL;
771 ],[
772         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
773                 [struct file_operations has flock field])
774         AC_MSG_RESULT([yes])
775 ],[
776         AC_MSG_RESULT([no])
777 ])
778 ])
779
780 # LC_INODE_I_MUTEX
781 # after 2.6.15 inode have i_mutex intead of i_sem
782 AC_DEFUN([LC_INODE_I_MUTEX],
783 [AC_MSG_CHECKING([use inode have i_mutex ])
784 LB_LINUX_TRY_COMPILE([
785         #include <linux/mutex.h>
786         #include <linux/fs.h>
787 ],[
788         struct inode i;
789
790         mutex_unlock(&i.i_mutex);
791 ],[
792         AC_MSG_RESULT(yes)
793         AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
794                 [after 2.6.15 inode have i_mutex intead of i_sem])
795 ],[
796         AC_MSG_RESULT(NO)
797 ])
798 ])
799
800
801 # LC_DQUOTOFF_MUTEX
802 # after 2.6.17 dquote use mutex instead if semaphore
803 AC_DEFUN([LC_DQUOTOFF_MUTEX],
804 [AC_MSG_CHECKING([use dqonoff_mutex])
805 LB_LINUX_TRY_COMPILE([
806         #include <linux/mutex.h>
807         #include <linux/fs.h>
808         #include <linux/quota.h>
809 ],[
810         struct quota_info dq;
811
812         mutex_unlock(&dq.dqonoff_mutex);
813 ],[
814         AC_MSG_RESULT(yes)
815         AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
816                 [after 2.6.17 dquote use mutex instead if semaphore])
817 ],[
818         AC_MSG_RESULT(NO)
819 ])
820 ])
821
822 #
823 # LC_STATFS_DENTRY_PARAM
824 # starting from 2.6.18 linux kernel uses dentry instead of
825 # super_block for first vfs_statfs argument
826 #
827 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
828 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
829 LB_LINUX_TRY_COMPILE([
830         #include <linux/fs.h>
831 ],[
832         int vfs_statfs(struct dentry *, struct kstatfs *);
833 ],[
834         AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
835                 [first parameter of vfs_statfs is dentry])
836         AC_MSG_RESULT([yes])
837 ],[
838         AC_MSG_RESULT([no])
839 ])
840 ])
841
842 #
843 # LC_VFS_KERN_MOUNT
844 # starting from 2.6.18 kernel don`t export do_kern_mount
845 # and want to use vfs_kern_mount instead.
846 #
847 AC_DEFUN([LC_VFS_KERN_MOUNT],
848 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
849 LB_LINUX_TRY_COMPILE([
850         #include <linux/mount.h>
851 ],[
852         vfs_kern_mount(NULL, 0, NULL, NULL);
853 ],[
854         AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
855                 [vfs_kern_mount exist in kernel])
856         AC_MSG_RESULT([yes])
857 ],[
858         AC_MSG_RESULT([no])
859 ])
860 ])
861
862
863 # LC_INVALIDATEPAGE_RETURN_INT
864 # more 2.6 api changes.  return type for the invalidatepage
865 # address_space_operation is 'void' in new kernels but 'int' in old
866 #
867 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
868 [AC_MSG_CHECKING([invalidatepage has return int])
869 LB_LINUX_TRY_COMPILE([
870         #include <linux/buffer_head.h>
871 ],[
872         int rc = block_invalidatepage(NULL, 0);
873 ],[
874         AC_MSG_RESULT(yes)
875         AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
876                 [Define if return type of invalidatepage should be int])
877 ],[
878         AC_MSG_RESULT(NO)
879 ])
880 ])
881
882 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
883 # more 2.6 API changes. 2.6.18 umount_begin has different parameters
884 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
885 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
886 tmp_flags="$EXTRA_KCFLAGS"
887 EXTRA_KCFLAGS="-Werror"
888 LB_LINUX_TRY_COMPILE([
889         #include <linux/fs.h>
890
891         struct vfsmount;
892         static void cfg_umount_begin (struct vfsmount *v, int flags)
893         {
894                 ;
895         }
896
897         static struct super_operations cfg_super_operations = {
898                 .umount_begin   = cfg_umount_begin,
899         };
900 ],[
901         cfg_super_operations.umount_begin(NULL,0);
902 ],[
903         AC_MSG_RESULT(yes)
904         AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
905                 [Define umount_begin need second argument])
906 ],[
907         AC_MSG_RESULT(NO)
908 ])
909 EXTRA_KCFLAGS="$tmp_flags"
910 ])
911
912 # 2.6.19 API changes
913 # inode don`t have i_blksize field
914 AC_DEFUN([LC_INODE_BLKSIZE],
915 [AC_MSG_CHECKING([inode has i_blksize field])
916 LB_LINUX_TRY_COMPILE([
917 #include <linux/fs.h>
918 ],[
919         struct inode i;
920         i.i_blksize = 0; 
921 ],[
922         AC_MSG_RESULT(yes)
923         AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
924                 [struct inode has i_blksize field])
925 ],[
926         AC_MSG_RESULT(NO)
927 ])
928 ])
929
930 # LC_VFS_READDIR_U64_INO
931 # 2.6.19 use u64 for inode number instead of inode_t
932 AC_DEFUN([LC_VFS_READDIR_U64_INO],
933 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
934 tmp_flags="$EXTRA_KCFLAGS"
935 EXTRA_KCFLAGS="-Werror"
936 LB_LINUX_TRY_COMPILE([
937 #include <linux/fs.h>
938         int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
939                       u64 ino, unsigned int d_type)
940         {
941                 return 0;
942         }
943 ],[
944         filldir_t filter;
945
946         filter = fillonedir;
947         return 1;
948 ],[
949         AC_MSG_RESULT(yes)
950         AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
951                 [if vfs_readdir need 64bit inode number])
952 ],[
953         AC_MSG_RESULT(NO)
954 ])
955 EXTRA_KCFLAGS="$tmp_flags"
956 ])
957
958 # LC_GENERIC_FILE_WRITE
959 # 2.6.19 introduce do_sync_write instead of
960 # generic_file_write
961 AC_DEFUN([LC_GENERIC_FILE_WRITE],
962 [AC_MSG_CHECKING([use generic_file_write])
963 LB_LINUX_TRY_COMPILE([
964         #include <linux/fs.h>
965 ],[
966         int result = generic_file_read(NULL, NULL, 0, 0);
967 ],[
968         AC_MSG_RESULT(yes)
969         AC_DEFINE(HAVE_GENERIC_FILE_WRITE, 1,
970                 [use generic_file_write])
971 ],[
972         AC_MSG_RESULT(NO)
973 ])
974 ])
975
976 # LC_GENERIC_FILE_READ
977 # 2.6.19 need to use do_sync_read instead of
978 # generic_file_read
979 AC_DEFUN([LC_GENERIC_FILE_READ],
980 [AC_MSG_CHECKING([use generic_file_read])
981 LB_LINUX_TRY_COMPILE([
982         #include <linux/fs.h>
983 ],[
984         int result = generic_file_read(NULL, NULL, 0, 0);
985 ],[
986         AC_MSG_RESULT(yes)
987         AC_DEFINE(HAVE_GENERIC_FILE_READ, 1,
988                 [use generic_file_read])
989 ],[
990         AC_MSG_RESULT(NO)
991 ])
992 ])
993
994 # LC_NR_PAGECACHE
995 # 2.6.18 don`t export nr_pagecahe
996 AC_DEFUN([LC_NR_PAGECACHE],
997 [AC_MSG_CHECKING([kernel export nr_pagecache])
998 LB_LINUX_TRY_COMPILE([
999         #include <linux/pagemap.h>
1000 ],[
1001         return atomic_read(&nr_pagecache);
1002 ],[
1003         AC_MSG_RESULT(yes)
1004         AC_DEFINE(HAVE_NR_PAGECACHE, 1,
1005                 [is kernel export nr_pagecache])
1006 ],[
1007         AC_MSG_RESULT(NO)
1008 ])
1009 ])
1010
1011 # LC_WB_RANGE_START
1012 # 2.6.20 rename struct writeback fields
1013 AC_DEFUN([LC_WB_RANGE_START],
1014 [AC_MSG_CHECKING([kernel has range_start in struct writeback_control])
1015 LB_LINUX_TRY_COMPILE([
1016         #include <linux/fs.h>
1017         #include <linux/sched.h>
1018         #include <linux/writeback.h>
1019 ],[
1020         struct writeback_control wb;
1021
1022         wb.range_start = 0;
1023 ],[
1024         AC_MSG_RESULT(yes)
1025         AC_DEFINE(HAVE_WB_RANGE_START, 1,
1026                   [writeback control has range_start field])
1027 ],[
1028         AC_MSG_RESULT(NO)
1029 ])
1030 ])
1031
1032 #
1033 # LC_PROG_LINUX
1034 #
1035 # Lustre linux kernel checks
1036 #
1037 AC_DEFUN([LC_PROG_LINUX],
1038 [ LC_LUSTRE_VERSION_H
1039 if test x$enable_server = xyes ; then
1040         LC_CONFIG_BACKINGFS
1041 fi
1042 LC_CONFIG_PINGER
1043 LC_CONFIG_LIBLUSTRE_RECOVERY
1044 LC_CONFIG_QUOTA
1045
1046 LC_TASK_PPTR
1047
1048 LC_STRUCT_KIOBUF
1049 LC_FUNC_COND_RESCHED
1050 LC_FUNC_ZAP_PAGE_RANGE
1051 LC_FUNC_PDE
1052 LC_FUNC_DIRECT_IO
1053 LC_HEADER_MM_INLINE
1054 LC_STRUCT_INODE
1055 LC_FUNC_REGISTER_CACHE
1056 LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1057 LC_FUNC_DEV_SET_RDONLY
1058 LC_FUNC_FILEMAP_FDATAWRITE
1059 LC_STRUCT_STATFS
1060 LC_FUNC_PAGE_MAPPED
1061 LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
1062 LC_FILEMAP_POPULATE
1063 LC_D_ADD_UNIQUE
1064 LC_BIT_SPINLOCK_H
1065 LC_XATTR_ACL
1066 LC_STRUCT_INTENT_FILE
1067 LC_POSIX_ACL_XATTR_H
1068 LC_FUNC_SET_FS_PWD
1069 LC_FUNC_MS_FLOCK_LOCK
1070 LC_FUNC_HAVE_CAN_SLEEP_ARG
1071 LC_FUNC_F_OP_FLOCK
1072 LC_QUOTA_READ
1073 LC_COOKIE_FOLLOW_LINK
1074
1075 # 2.6.15
1076 LC_INODE_I_MUTEX
1077
1078 # 2.6.17
1079 LC_DQUOTOFF_MUTEX
1080
1081 # 2.6.18
1082 LC_NR_PAGECACHE
1083 LC_STATFS_DENTRY_PARAM
1084 LC_VFS_KERN_MOUNT
1085 LC_INVALIDATEPAGE_RETURN_INT
1086 LC_UMOUNTBEGIN_HAS_VFSMOUNT
1087 LC_WB_RANGE_START
1088
1089 # 2.6.19
1090 LC_INODE_BLKSIZE
1091 LC_VFS_READDIR_U64_INO
1092 LC_GENERIC_FILE_READ
1093 LC_GENERIC_FILE_WRITE
1094 ])
1095
1096 #
1097 # LC_CONFIG_CLIENT_SERVER
1098 #
1099 # Build client/server sides of Lustre
1100 #
1101 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1102 [AC_MSG_CHECKING([whether to build Lustre server support])
1103 AC_ARG_ENABLE([server],
1104         AC_HELP_STRING([--disable-server],
1105                         [disable Lustre server support]),
1106         [],[enable_server='yes'])
1107 AC_MSG_RESULT([$enable_server])
1108
1109 AC_MSG_CHECKING([whether to build Lustre client support])
1110 AC_ARG_ENABLE([client],
1111         AC_HELP_STRING([--disable-client],
1112                         [disable Lustre client support]),
1113         [],[enable_client='yes'])
1114 AC_MSG_RESULT([$enable_client])])
1115
1116 #
1117 # LC_CONFIG_LIBLUSTRE
1118 #
1119 # whether to build liblustre
1120 #
1121 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1122 [AC_MSG_CHECKING([whether to build Lustre library])
1123 AC_ARG_ENABLE([liblustre],
1124         AC_HELP_STRING([--disable-liblustre],
1125                         [disable building of Lustre library]),
1126         [],[enable_liblustre=$with_sysio])
1127 AC_MSG_RESULT([$enable_liblustre])
1128 # only build sysio if liblustre is built
1129 with_sysio="$enable_liblustre"
1130
1131 AC_MSG_CHECKING([whether to build liblustre tests])
1132 AC_ARG_ENABLE([liblustre-tests],
1133         AC_HELP_STRING([--enable-liblustre-tests],
1134                         [enable liblustre tests, if --disable-tests is used]),
1135         [],[enable_liblustre_tests=$enable_tests])
1136 if test x$enable_liblustre != xyes ; then
1137    enable_liblustre_tests='no'
1138 fi
1139 AC_MSG_RESULT([$enable_liblustre_tests])
1140
1141 AC_MSG_CHECKING([whether to build mpitests])
1142 AC_ARG_ENABLE([mpitests],
1143         AC_HELP_STRING([--enable-mpitests],
1144                         [build liblustre mpi tests]),
1145         [],[enable_mpitests=no])
1146 AC_MSG_RESULT([$enable_mpitests])
1147
1148 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1149 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1150
1151 LC_CONFIG_PINGER
1152 LC_CONFIG_LIBLUSTRE_RECOVERY
1153 ])
1154
1155 #
1156 # LC_CONFIG_QUOTA
1157 #
1158 # whether to enable quota support
1159 #
1160 AC_DEFUN([LC_CONFIG_QUOTA],
1161 [AC_MSG_CHECKING([whether to enable quota support])
1162 AC_ARG_ENABLE([quota], 
1163         AC_HELP_STRING([--enable-quota],
1164                         [enable quota support]),
1165         [],[enable_quota='yes'])
1166 AC_MSG_RESULT([$enable_quota])
1167 if test x$linux25 != xyes; then
1168    enable_quota='no'
1169 fi
1170 if test x$enable_quota != xno; then
1171    AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
1172 fi
1173 ])
1174   
1175 AC_DEFUN([LC_QUOTA_READ],
1176 [AC_MSG_CHECKING([if kernel supports quota_read])
1177 LB_LINUX_TRY_COMPILE([
1178         #include <linux/fs.h>
1179 ],[
1180         struct super_operations sp;
1181         void *i = (void *)sp.quota_read;
1182 ],[
1183         AC_MSG_RESULT([yes])
1184         AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
1185 ],[
1186         AC_MSG_RESULT([no])
1187 ])
1188 ])
1189
1190 #
1191 # LC_COOKIE_FOLLOW_LINK
1192 #
1193 # kernel 2.6.13+ ->follow_link returns a cookie
1194 #
1195
1196 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
1197 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
1198 LB_LINUX_TRY_COMPILE([
1199         #include <linux/fs.h>
1200         #include <linux/namei.h>
1201 ],[
1202         struct dentry dentry;
1203         struct nameidata nd;
1204
1205         dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
1206 ],[
1207         AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
1208         AC_MSG_RESULT([yes])
1209 ],[
1210         AC_MSG_RESULT([no])
1211 ])
1212 ])
1213
1214 #
1215 # LC_CONFIGURE
1216 #
1217 # other configure checks
1218 #
1219 AC_DEFUN([LC_CONFIGURE],
1220 [LC_CONFIG_OBD_BUFFER_SIZE
1221
1222 # include/liblustre.h
1223 AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1224
1225 # include/lustre/lustre_user.h
1226 # See note there re: __ASM_X86_64_PROCESSOR_H
1227 AC_CHECK_HEADERS([linux/quota.h])
1228
1229 # liblustre/llite_lib.h
1230 AC_CHECK_HEADERS([xtio.h file.h])
1231
1232 # liblustre/dir.c
1233 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1234
1235 # liblustre/lutil.c
1236 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1237 AC_CHECK_FUNCS([inet_ntoa])
1238
1239 # libsysio/src/readlink.c
1240 LC_READLINK_SSIZE_T
1241
1242 # utils/llverfs.c
1243 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1244
1245 # Super safe df
1246 AC_ARG_ENABLE([mindf],
1247       AC_HELP_STRING([--enable-mindf],
1248                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1249       [],[])
1250 if test "$enable_mindf" = "yes" ;  then
1251       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1252 fi
1253
1254 ])
1255
1256 #
1257 # LC_CONDITIONALS
1258 #
1259 # AM_CONDITIONALS for lustre
1260 #
1261 AC_DEFUN([LC_CONDITIONALS],
1262 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1263 AM_CONDITIONAL(LDISKFS, test x$enable_ldiskfs = xyes)
1264 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1265 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1266 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1267 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1268 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1269 AM_CONDITIONAL(QUOTA, test x$enable_quota = xyes)
1270 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1271 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1272 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1273 ])
1274
1275 #
1276 # LC_CONFIG_FILES
1277 #
1278 # files that should be generated with AC_OUTPUT
1279 #
1280 AC_DEFUN([LC_CONFIG_FILES],
1281 [AC_CONFIG_FILES([
1282 lustre/Makefile
1283 lustre/autoMakefile
1284 lustre/autoconf/Makefile
1285 lustre/contrib/Makefile
1286 lustre/doc/Makefile
1287 lustre/include/Makefile
1288 lustre/include/lustre_ver.h
1289 lustre/include/linux/Makefile
1290 lustre/include/lustre/Makefile
1291 lustre/kernel_patches/targets/2.6-suse.target
1292 lustre/kernel_patches/targets/2.6-vanilla.target
1293 lustre/kernel_patches/targets/2.6-rhel4.target
1294 lustre/kernel_patches/targets/2.6-fc5.target
1295 lustre/kernel_patches/targets/2.6-patchless.target
1296 lustre/kernel_patches/targets/2.6-sles10.target
1297 lustre/kernel_patches/targets/hp_pnnl-2.4.target
1298 lustre/kernel_patches/targets/rh-2.4.target
1299 lustre/kernel_patches/targets/rhel-2.4.target
1300 lustre/kernel_patches/targets/suse-2.4.21-2.target
1301 lustre/kernel_patches/targets/sles-2.4.target
1302 lustre/ldiskfs/Makefile
1303 lustre/ldiskfs/autoMakefile
1304 lustre/ldiskfs2/Makefile
1305 lustre/ldiskfs2/autoMakefile
1306 lustre/ldlm/Makefile
1307 lustre/liblustre/Makefile
1308 lustre/liblustre/tests/Makefile
1309 lustre/llite/Makefile
1310 lustre/llite/autoMakefile
1311 lustre/lov/Makefile
1312 lustre/lov/autoMakefile
1313 lustre/lvfs/Makefile
1314 lustre/lvfs/autoMakefile
1315 lustre/mdc/Makefile
1316 lustre/mdc/autoMakefile
1317 lustre/mds/Makefile
1318 lustre/mds/autoMakefile
1319 lustre/obdclass/Makefile
1320 lustre/obdclass/autoMakefile
1321 lustre/obdclass/linux/Makefile
1322 lustre/obdecho/Makefile
1323 lustre/obdecho/autoMakefile
1324 lustre/obdfilter/Makefile
1325 lustre/obdfilter/autoMakefile
1326 lustre/osc/Makefile
1327 lustre/osc/autoMakefile
1328 lustre/ost/Makefile
1329 lustre/ost/autoMakefile
1330 lustre/mgc/Makefile
1331 lustre/mgc/autoMakefile
1332 lustre/mgs/Makefile
1333 lustre/mgs/autoMakefile
1334 lustre/ptlrpc/Makefile
1335 lustre/ptlrpc/autoMakefile
1336 lustre/quota/Makefile
1337 lustre/quota/autoMakefile
1338 lustre/scripts/Makefile
1339 lustre/scripts/version_tag.pl
1340 lustre/tests/Makefile
1341 lustre/utils/Makefile
1342 ])
1343 case $lb_target_os in
1344         darwin)
1345                 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
1346                 ;;
1347 esac
1348
1349 ])