Whamcloud - gitweb
branch: b_new_cmd
[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 ])
9
10 #
11 # LC_PATH_DEFAULTS
12 #
13 # lustre specific paths
14 #
15 AC_DEFUN([LC_PATH_DEFAULTS],
16 [# ptlrpc kernel build requires this
17 LUSTRE="$PWD/lustre"
18 AC_SUBST(LUSTRE)
19
20 # mount.lustre
21 rootsbindir='/sbin'
22 AC_SUBST(rootsbindir)
23
24 demodir='$(docdir)/demo'
25 AC_SUBST(demodir)
26
27 pkgexampledir='${pkgdatadir}/examples'
28 AC_SUBST(pkgexampledir)
29 ])
30
31 #
32 # LC_TARGET_SUPPORTED
33 #
34 # is the target os supported?
35 #
36 AC_DEFUN([LC_TARGET_SUPPORTED],
37 [case $target_os in
38         linux* | darwin*)
39 $1
40                 ;;
41         *)
42 $2
43                 ;;
44 esac
45 ])
46
47 #
48 # LC_CONFIG_EXT3
49 #
50 # that ext3 is enabled in the kernel
51 #
52 AC_DEFUN([LC_CONFIG_EXT3],
53 [LB_LINUX_CONFIG([EXT3_FS],[],[
54         LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
55 ])
56 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
57 ])
58
59 #
60 # LC_FSHOOKS
61 #
62 # If we have (and can build) fshooks.h
63 #
64 AC_DEFUN([LC_FSHOOKS],
65 [LB_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
66         AC_MSG_CHECKING([if fshooks.h can be compiled])
67         LB_LINUX_TRY_COMPILE([
68                 #include <linux/fshooks.h>
69         ],[],[
70                 AC_MSG_RESULT([yes])
71         ],[
72                 AC_MSG_RESULT([no])
73                 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
74                 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
75                 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
76         ])
77 $1
78 ],[
79 $2
80 ])
81 ])
82
83 #
84 # LC_STRUCT_KIOBUF
85 #
86 # rh 2.4.18 has iobuf->dovary, but other kernels do not
87 #
88 AC_DEFUN([LC_STRUCT_KIOBUF],
89 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
90 LB_LINUX_TRY_COMPILE([
91         #include <linux/iobuf.h>
92 ],[
93         struct kiobuf iobuf;
94         iobuf.dovary = 1;
95 ],[
96         AC_MSG_RESULT([yes])
97         AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
98 ],[
99         AC_MSG_RESULT([no])
100 ])
101 ])
102
103 #
104 # LC_FUNC_COND_RESCHED
105 #
106 # cond_resched() was introduced in 2.4.20
107 #
108 AC_DEFUN([LC_FUNC_COND_RESCHED],
109 [AC_MSG_CHECKING([if kernel offers cond_resched])
110 LB_LINUX_TRY_COMPILE([
111         #include <linux/sched.h>
112 ],[
113         cond_resched();
114 ],[
115         AC_MSG_RESULT([yes])
116         AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
117 ],[
118         AC_MSG_RESULT([no])
119 ])
120 ])
121
122 #
123 # LC_FUNC_ZAP_PAGE_RANGE
124 #
125 # if zap_page_range() takes a vma arg
126 #
127 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
128 [AC_MSG_CHECKING([if zap_pag_range with vma parameter])
129 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
130 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
131         AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
132         AC_MSG_RESULT([yes])
133 else
134         AC_MSG_RESULT([no])
135 fi
136 ])
137
138 #
139 # LC_FUNC_PDE
140 #
141 # if proc_fs.h defines PDE()
142 #
143 AC_DEFUN([LC_FUNC_PDE],
144 [AC_MSG_CHECKING([if kernel defines PDE])
145 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
146 if test "$HAVE_PDE" != 0 ; then
147         AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
148         AC_MSG_RESULT([yes])
149 else
150         AC_MSG_RESULT([no])
151 fi
152 ])
153
154 #
155 # LC_FUNC_FILEMAP_FDATASYNC
156 #
157 # if filemap_fdatasync() exists
158 #
159 AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE],
160 [AC_MSG_CHECKING([whether filemap_fdatawrite() is defined])
161 LB_LINUX_TRY_COMPILE([
162         #include <linux/fs.h>
163 ],[
164         int (*foo)(struct address_space *)= filemap_fdatawrite;
165 ],[
166         AC_MSG_RESULT([yes])
167         AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found])
168 ],[
169         AC_MSG_RESULT([no])
170 ])
171 ])
172
173 #
174 # LC_FUNC_DIRECT_IO
175 #
176 # if direct_IO takes a struct file argument
177 #
178 AC_DEFUN([LC_FUNC_DIRECT_IO],
179 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
180 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
181 if test "$HAVE_DIO_FILE" != 0 ; then
182         AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
183         AC_MSG_RESULT(yes)
184 else
185         AC_MSG_RESULT(no)
186 fi
187 ])
188
189 #
190 # LC_HEADER_MM_INLINE
191 #
192 # RHEL kernels define page_count in mm_inline.h
193 #
194 AC_DEFUN([LC_HEADER_MM_INLINE],
195 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
196 LB_LINUX_TRY_COMPILE([
197         #include <linux/mm_inline.h>
198 ],[
199         #ifndef page_count
200         #error mm_inline.h does not define page_count
201         #endif
202 ],[
203         AC_MSG_RESULT([yes])
204         AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
205 ],[
206         AC_MSG_RESULT([no])
207 ])
208 ])
209
210 #
211 # LC_STRUCT_INODE
212 #
213 # if inode->i_alloc_sem exists
214 #
215 AC_DEFUN([LC_STRUCT_INODE],
216 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
217 LB_LINUX_TRY_COMPILE([
218         #include <linux/fs.h>
219         #include <linux/version.h>
220 ],[
221         #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
222         #error "down_read_trylock broken before 2.4.24"
223         #endif
224         struct inode i;
225         return (char *)&i.i_alloc_sem - (char *)&i;
226 ],[
227         AC_MSG_RESULT([yes])
228         AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
229 ],[
230         AC_MSG_RESULT([no])
231 ])
232 ])
233
234 #
235 # LC_FUNC_REGISTER_CACHE
236 #
237 # if register_cache() is defined by kernel
238 #
239 AC_DEFUN([LC_FUNC_REGISTER_CACHE],
240 [AC_MSG_CHECKING([if kernel defines register_cache()])
241 LB_LINUX_TRY_COMPILE([
242         #include <linux/list.h>
243         #include <linux/cache_def.h>
244 ],[
245         struct cache_definition cache;
246 ],[
247         AC_MSG_RESULT([yes])
248         AC_DEFINE(HAVE_REGISTER_CACHE, 1, [register_cache found])
249         AC_MSG_CHECKING([if kernel expects return from cache shrink function])
250         HAVE_CACHE_RETURN_INT="`grep -c 'int.*shrink' $LINUX/include/linux/cache_def.h`"
251         if test "$HAVE_CACHE_RETURN_INT" != 0 ; then
252                 AC_DEFINE(HAVE_CACHE_RETURN_INT, 1, [kernel expects return from shrink_cache])
253                 AC_MSG_RESULT(yes)
254         else
255                 AC_MSG_RESULT(no)
256         fi
257 ],[
258         AC_MSG_RESULT([no])
259 ])
260 ])
261
262 #
263 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
264 #
265 # check for our patched grab_cache_page_nowait_gfp() function
266 #
267 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
268 [AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
269 HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/include/linux/pagemap.h`"
270 if test "$HAVE_GCPN_GFP" != 0 ; then
271         AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
272                 [kernel has grab_cache_page_nowait_gfp()])
273         AC_MSG_RESULT(yes)
274 else
275         AC_MSG_RESULT(no)
276 fi
277 ])
278
279 #
280 # LC_FUNC_DEV_SET_RDONLY
281 #
282 # check for the old-style dev_set_rdonly which took an extra "devno" param
283 # and can only set a single device to discard writes at one time
284 #
285 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
286 [AC_MSG_CHECKING([if kernel has old single-device dev_set_rdonly])
287 HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/ll_rw_blk.c`"
288 if test x$HAVE_OLD_DSR != "x1" ; then
289         HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/blkpg.c`"
290 fi
291 if test x$HAVE_OLD_DSR = "x1" ; then
292         AC_DEFINE(HAVE_OLD_DEV_SET_RDONLY, 1,
293                 [kernel has old single-device dev_set_rdonly])
294         AC_MSG_RESULT(yes)
295 else
296         AC_MSG_RESULT(no)
297 fi
298 ])
299
300 #
301 # LC_CONFIG_BACKINGFS
302 #
303 # whether to use ldiskfs instead of ext3
304 #
305 AC_DEFUN([LC_CONFIG_BACKINGFS],
306 [
307 BACKINGFS='ext3'
308
309 # 2.6 gets ldiskfs
310 AC_MSG_CHECKING([whether to enable ldiskfs])
311 AC_ARG_ENABLE([ldiskfs],
312         AC_HELP_STRING([--enable-ldiskfs],
313                         [use ldiskfs for the Lustre backing FS]),
314         [],[enable_ldiskfs="$linux25"])
315 AC_MSG_RESULT([$enable_ldiskfs])
316
317 if test x$enable_ldiskfs = xyes ; then
318         BACKINGFS="ldiskfs"
319
320         AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
321         AC_ARG_ENABLE([quilt],
322                         AC_HELP_STRING([--disable-quilt],[disable use of quilt for ldiskfs]),
323                         [],[enable_quilt='yes'])
324         AC_MSG_RESULT([$enable_quilt])
325
326         AC_PATH_PROG(PATCH, patch, [no])
327
328         if test x$enable_quilt = xno ; then
329             QUILT="no"
330         else
331             AC_PATH_PROG(QUILT, quilt, [no])
332         fi
333
334         if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
335                 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
336         fi
337
338         AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
339         AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
340         AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
341         AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
342 fi
343
344 AC_MSG_CHECKING([which backing filesystem to use])
345 AC_MSG_RESULT([$BACKINGFS])
346 AC_SUBST(BACKINGFS)
347
348 case $BACKINGFS in
349         ext3)
350                 # --- Check that ext3 and ext3 xattr are enabled in the kernel
351                 LC_CONFIG_EXT3([],[
352                         AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
353                 ],[
354                         AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
355                         AC_MSG_WARN([This build may fail.])
356                 ])
357                 ;;
358         ldiskfs)
359                 AC_MSG_CHECKING([which ldiskfs series to use])
360                 case $LINUXRELEASE in
361                 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
362                 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
363                 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
364                 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
365                 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
366                 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
367                 2.6.16*) LDISKFS_SERIES="2.6-fc5.series";;
368                 2.6.18*) LDISKFS_SERIES="2.6.18-vanilla.series";;
369                 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix lustre/autoconf/lustre-core.m4])
370                 esac
371                 AC_MSG_RESULT([$LDISKFS_SERIES])
372                 AC_SUBST(LDISKFS_SERIES)
373                 ;;
374 esac # $BACKINGFS
375 ])
376
377 #
378 # LC_CONFIG_PINGER
379 #
380 # the pinger is temporary, until we have the recovery node in place
381 #
382 AC_DEFUN([LC_CONFIG_PINGER],
383 [AC_MSG_CHECKING([whether to enable pinger support])
384 AC_ARG_ENABLE([pinger],
385         AC_HELP_STRING([--disable-pinger],
386                         [disable recovery pinger support]),
387         [],[enable_pinger='yes'])
388 AC_MSG_RESULT([$enable_pinger])
389 if test x$enable_pinger != xno ; then
390   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
391 fi
392 ])
393
394 #
395 # LC_CONFIG_OBD_BUFFER_SIZE
396 #
397 # the maximum buffer size of lctl ioctls
398 #
399 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
400 [AC_MSG_CHECKING([maximum OBD ioctl size])
401 AC_ARG_WITH([obd-buffer-size],
402         AC_HELP_STRING([--with-obd-buffer-size=[size]],
403                         [set lctl ioctl maximum bytes (default=8192)]),
404         [
405                 OBD_BUFFER_SIZE=$with_obd_buffer_size
406         ],[
407                 OBD_BUFFER_SIZE=8192
408         ])
409 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
410 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
411 ])
412
413 #
414 # LC_STRUCT_STATFS
415 #
416 # AIX does not have statfs.f_namelen
417 #
418 AC_DEFUN([LC_STRUCT_STATFS],
419 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
420 LB_LINUX_TRY_COMPILE([
421         #include <linux/vfs.h>
422 ],[
423         struct statfs sfs;
424         sfs.f_namelen = 1;
425 ],[
426         AC_MSG_RESULT([yes])
427         AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
428 ],[
429         AC_MSG_RESULT([no])
430 ])
431 ])
432
433 AC_DEFUN([LC_FUNC_PAGE_MAPPED],
434 [AC_MSG_CHECKING([if kernel offers page_mapped])
435 LB_LINUX_TRY_COMPILE([
436         #include <linux/mm.h>
437 ],[
438         page_mapped(NULL);
439 ],[
440         AC_MSG_RESULT([yes])
441         AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found])
442 ],[
443         AC_MSG_RESULT([no])
444 ])
445 ])
446
447 AC_DEFUN([LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL],
448 [AC_MSG_CHECKING([if struct file_operations has an unlocked_ioctl field])
449 LB_LINUX_TRY_COMPILE([
450         #include <linux/fs.h>
451 ],[
452         struct file_operations fops;
453         &fops.unlocked_ioctl;
454 ],[
455         AC_MSG_RESULT([yes])
456         AC_DEFINE(HAVE_UNLOCKED_IOCTL, 1, [struct file_operations has an unlock ed_ioctl field])
457 ],[
458         AC_MSG_RESULT([no])
459 ])
460 ])
461
462 AC_DEFUN([LC_FILEMAP_POPULATE],
463 [AC_MSG_CHECKING([for exported filemap_populate])
464 LB_LINUX_TRY_COMPILE([
465         #include <asm/page.h>
466         #include <linux/mm.h>
467 ],[
468        filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
469 ],[
470         AC_MSG_RESULT([yes])
471         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
472 ],[
473         AC_MSG_RESULT([no])
474 ])
475 ])
476
477 AC_DEFUN([LC_D_ADD_UNIQUE],
478 [AC_MSG_CHECKING([for d_add_unique])
479 LB_LINUX_TRY_COMPILE([
480         #include <linux/dcache.h>
481 ],[
482        d_add_unique(NULL, NULL);
483 ],[
484         AC_MSG_RESULT([yes])
485         AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
486 ],[
487         AC_MSG_RESULT([no])
488 ])
489 ])
490
491 AC_DEFUN([LC_BIT_SPINLOCK_H],
492 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
493         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
494         LB_LINUX_TRY_COMPILE([
495                 #include <asm/processor.h>
496                 #include <linux/spinlock.h>
497                 #include <linux/bit_spinlock.h>
498         ],[],[
499                 AC_MSG_RESULT([yes])
500                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
501         ],[
502                 AC_MSG_RESULT([no])
503         ])
504 ],
505 [])
506 ])
507
508 #
509 # LC_POSIX_ACL_XATTR
510 #
511 # If we have xattr_acl.h 
512 #
513 AC_DEFUN([LC_XATTR_ACL],
514 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
515         AC_MSG_CHECKING([if xattr_acl.h can be compiled])
516         LB_LINUX_TRY_COMPILE([
517                 #include <linux/xattr_acl.h>
518         ],[],[
519                 AC_MSG_RESULT([yes])
520                 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
521         ],[
522                 AC_MSG_RESULT([no])
523         ])
524 ],
525 [])
526 ])
527
528 AC_DEFUN([LC_STRUCT_INTENT_FILE],
529 [AC_MSG_CHECKING([if struct open_intent has a file field])
530 LB_LINUX_TRY_COMPILE([
531         #include <linux/fs.h>
532         #include <linux/namei.h>
533 ],[
534         struct open_intent intent;
535         &intent.file;
536 ],[
537         AC_MSG_RESULT([yes])
538         AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
539 ],[
540         AC_MSG_RESULT([no])
541 ])
542 ])
543
544
545 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
546 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
547         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
548         LB_LINUX_TRY_COMPILE([
549                 #include <linux/posix_acl_xattr.h>
550         ],[],[
551                 AC_MSG_RESULT([yes])
552                 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
553
554         ],[
555                 AC_MSG_RESULT([no])
556         ])
557 $1
558 ],[
559 AC_MSG_RESULT([no])
560 ])
561 ])
562
563 AC_DEFUN([LC_LUSTRE_VERSION_H],
564 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
565         rm -f "$LUSTRE/include/linux/lustre_version.h"
566 ],[
567         touch "$LUSTRE/include/linux/lustre_version.h"
568         if test x$enable_server = xyes ; then
569                 AC_MSG_WARN([Patchless build detected, disabling server building])
570                 enable_server='no'
571         fi
572 ])
573 ])
574
575 AC_DEFUN([LC_FUNC_SET_FS_PWD],
576 [AC_MSG_CHECKING([if kernel exports show_task])
577 have_show_task=0
578         if grep -q "EXPORT_SYMBOL(show_task)" \
579                  "$LINUX/fs/namespace.c" 2>/dev/null ; then
580                 AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
581                 AC_MSG_RESULT([yes])
582         else
583                 AC_MSG_RESULT([no])
584         fi
585 ])
586
587
588 #
589 # LC_PROG_LINUX
590 #
591 # Lustre linux kernel checks
592 #
593 AC_DEFUN([LC_PROG_LINUX],
594 [ LC_LUSTRE_VERSION_H
595 if test x$enable_server = xyes ; then
596         LC_CONFIG_BACKINGFS
597 fi
598 LC_CONFIG_PINGER
599 LC_CONFIG_QUOTA
600
601 LC_STRUCT_KIOBUF
602 LC_FUNC_COND_RESCHED
603 LC_FUNC_ZAP_PAGE_RANGE
604 LC_FUNC_PDE
605 LC_FUNC_DIRECT_IO
606 LC_HEADER_MM_INLINE
607 LC_STRUCT_INODE
608 LC_FUNC_REGISTER_CACHE
609 LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
610 LC_FUNC_DEV_SET_RDONLY
611 LC_FUNC_FILEMAP_FDATAWRITE
612 LC_STRUCT_STATFS
613 LC_FUNC_PAGE_MAPPED
614 LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
615 LC_FILEMAP_POPULATE
616 LC_D_ADD_UNIQUE
617 LC_BIT_SPINLOCK_H
618 LC_XATTR_ACL
619 LC_STRUCT_INTENT_FILE
620 LC_POSIX_ACL_XATTR_H
621 LC_FUNC_SET_FS_PWD
622 ])
623
624 #
625 # LC_CONFIG_CLIENT_SERVER
626 #
627 # Build client/server sides of Lustre
628 #
629 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
630 [AC_MSG_CHECKING([whether to build Lustre server support])
631 AC_ARG_ENABLE([server],
632         AC_HELP_STRING([--disable-server],
633                         [disable Lustre server support]),
634         [],[enable_server='yes'])
635 AC_MSG_RESULT([$enable_server])
636
637 AC_MSG_CHECKING([whether to build Lustre client support])
638 AC_ARG_ENABLE([client],
639         AC_HELP_STRING([--disable-client],
640                         [disable Lustre client support]),
641         [],[enable_client='yes'])
642 AC_MSG_RESULT([$enable_client])])
643
644 #
645 # LC_CONFIG_LIBLUSTRE
646 #
647 # whether to build liblustre
648 #
649 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
650 [AC_MSG_CHECKING([whether to build Lustre library])
651 AC_ARG_ENABLE([liblustre],
652         AC_HELP_STRING([--disable-liblustre],
653                         [disable building of Lustre library]),
654         [],[enable_liblustre=$with_sysio])
655 AC_MSG_RESULT([$enable_liblustre])
656 # only build sysio if liblustre is built
657 with_sysio="$enable_liblustre"
658
659 AC_MSG_CHECKING([whether to build liblustre tests])
660 AC_ARG_ENABLE([liblustre-tests],
661         AC_HELP_STRING([--enable-liblustre-tests],
662                         [enable liblustre tests, if --disable-tests is used]),
663         [],[enable_liblustre_tests=$enable_tests])
664 if test x$enable_liblustre != xyes ; then
665    enable_liblustre_tests='no'
666 fi
667 AC_MSG_RESULT([$enable_liblustre_tests])
668
669 AC_MSG_CHECKING([whether to build mpitests])
670 AC_ARG_ENABLE([mpitests],
671         AC_HELP_STRING([--enable-mpitests],
672                         [build liblustre mpi tests]),
673         [],[enable_mpitests=no])
674 AC_MSG_RESULT([$enable_mpitests])
675
676 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
677 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
678 ])
679
680 #
681 # LC_CONFIG_QUOTA
682 #
683 # whether to enable quota support
684 #
685 AC_DEFUN([LC_CONFIG_QUOTA],
686 [AC_MSG_CHECKING([whether to enable quota support])
687 AC_ARG_ENABLE([quota], 
688         AC_HELP_STRING([--enable-quota],
689                         [enable quota support]),
690         [],[enable_quota='yes'])
691 AC_MSG_RESULT([$enable_quota])
692 if test x$linux25 != xyes; then
693    enable_quota='no'
694 fi
695 if test x$enable_quota != xno; then
696    AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
697 fi
698 ])
699  
700 #
701 # LC_CONFIG_SPLIT
702 #
703 # whether to enable quota support
704 #
705 AC_DEFUN([LC_CONFIG_SPLIT],
706 [AC_MSG_CHECKING([whether to disable split support])
707 AC_ARG_ENABLE([split], 
708         AC_HELP_STRING([--disable-split],
709                         [enable split support]),
710         [],[enable_split='no'])
711 AC_MSG_RESULT([$enable_split])
712 if test x$enable_split != xno; then
713    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
714 fi
715 ])
716  
717 #
718 # LC_CONFIGURE
719 #
720 # other configure checks
721 #
722 AC_DEFUN([LC_CONFIGURE],
723 [LC_CONFIG_OBD_BUFFER_SIZE
724
725 # include/liblustre.h
726 AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
727
728 # include/lustre/lustre_user.h
729 # See note there re: __ASM_X86_64_PROCESSOR_H
730 AC_CHECK_HEADERS([linux/quota.h])
731
732 # liblustre/llite_lib.h
733 AC_CHECK_HEADERS([xtio.h file.h])
734
735 # liblustre/dir.c
736 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
737
738 # liblustre/lutil.c
739 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
740 AC_CHECK_FUNCS([inet_ntoa])
741
742 # utils/llverfs.c
743 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
744
745 # Super safe df
746 AC_ARG_ENABLE([mindf],
747       AC_HELP_STRING([--enable-mindf],
748                       [Make statfs to report only minimal-available space on any simgle OST instead of sum of free spaces on all OSTs]),
749       [],[])
750 if test "$enable_mindf" = "yes" ;  then
751       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
752 fi
753
754 ])
755
756 #
757 # LC_CONDITIONALS
758 #
759 # AM_CONDITIONALS for lustre
760 #
761 AC_DEFUN([LC_CONDITIONALS],
762 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
763 AM_CONDITIONAL(LDISKFS, test x$enable_ldiskfs = xyes)
764 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
765 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
766 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
767 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
768 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
769 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
770 AM_CONDITIONAL(QUOTA, test x$enable_quota = xyes)
771 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
772 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
773 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
774 ])
775
776 #
777 # LC_CONFIG_FILES
778 #
779 # files that should be generated with AC_OUTPUT
780 #
781 AC_DEFUN([LC_CONFIG_FILES],
782 [AC_CONFIG_FILES([
783 lustre/Makefile
784 lustre/autoMakefile
785 lustre/autoconf/Makefile
786 lustre/contrib/Makefile
787 lustre/doc/Makefile
788 lustre/include/Makefile
789 lustre/include/lustre_ver.h
790 lustre/include/linux/Makefile
791 lustre/include/lustre/Makefile
792 lustre/kernel_patches/targets/2.6-suse.target
793 lustre/kernel_patches/targets/2.6-vanilla.target
794 lustre/kernel_patches/targets/2.6-rhel4.target
795 lustre/kernel_patches/targets/2.6-fc5.target
796 lustre/kernel_patches/targets/2.6-patchless.target
797 lustre/kernel_patches/targets/hp_pnnl-2.4.target
798 lustre/kernel_patches/targets/rh-2.4.target
799 lustre/kernel_patches/targets/rhel-2.4.target
800 lustre/kernel_patches/targets/suse-2.4.21-2.target
801 lustre/kernel_patches/targets/sles-2.4.target
802 lustre/ldiskfs/Makefile
803 lustre/ldiskfs/autoMakefile
804 lustre/ldlm/Makefile
805 lustre/fid/Makefile
806 lustre/fid/autoMakefile
807 lustre/liblustre/Makefile
808 lustre/liblustre/tests/Makefile
809 lustre/llite/Makefile
810 lustre/llite/autoMakefile
811 lustre/lov/Makefile
812 lustre/lov/autoMakefile
813 lustre/lvfs/Makefile
814 lustre/lvfs/autoMakefile
815 lustre/mdc/Makefile
816 lustre/mdc/autoMakefile
817 lustre/lmv/Makefile
818 lustre/lmv/autoMakefile
819 lustre/mds/Makefile
820 lustre/mds/autoMakefile
821 lustre/mdt/Makefile
822 lustre/mdt/autoMakefile
823 lustre/cmm/Makefile
824 lustre/cmm/autoMakefile
825 lustre/mdd/Makefile
826 lustre/mdd/autoMakefile
827 lustre/fld/Makefile
828 lustre/fld/autoMakefile
829 lustre/obdclass/Makefile
830 lustre/obdclass/autoMakefile
831 lustre/obdclass/linux/Makefile
832 lustre/obdecho/Makefile
833 lustre/obdecho/autoMakefile
834 lustre/obdfilter/Makefile
835 lustre/obdfilter/autoMakefile
836 lustre/osc/Makefile
837 lustre/osc/autoMakefile
838 lustre/ost/Makefile
839 lustre/ost/autoMakefile
840 lustre/osd/Makefile
841 lustre/osd/autoMakefile
842 lustre/mgc/Makefile
843 lustre/mgc/autoMakefile
844 lustre/mgs/Makefile
845 lustre/mgs/autoMakefile
846 lustre/ptlrpc/Makefile
847 lustre/ptlrpc/autoMakefile
848 lustre/ptlrpc/gss/Makefile
849 lustre/ptlrpc/gss/autoMakefile
850 lustre/quota/Makefile
851 lustre/quota/autoMakefile
852 lustre/scripts/Makefile
853 lustre/scripts/version_tag.pl
854 lustre/tests/Makefile
855 lustre/utils/Makefile
856 lustre/utils/gss/Makefile
857 ])
858 case $lb_target_os in
859         darwin)
860                 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
861                 ;;
862 esac
863
864 ])