4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
13 # lustre specific paths
15 AC_DEFUN([LC_PATH_DEFAULTS],
16 [# ptlrpc kernel build requires this
24 demodir='$(docdir)/demo'
27 pkgexampledir='${pkgdatadir}/examples'
28 AC_SUBST(pkgexampledir)
30 pymoddir='${pkglibdir}/python/Lustre'
37 # is the target os supported?
39 AC_DEFUN([LC_TARGET_SUPPORTED],
53 # that ext3 is enabled in the kernel
55 AC_DEFUN([LC_CONFIG_EXT3],
56 [LB_LINUX_CONFIG([EXT3_FS],[],[
57 LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
59 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
66 # If we have (and can build) fshooks.h
68 AC_DEFUN([LC_FSHOOKS],
69 [AC_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
70 AC_MSG_CHECKING([if fshooks.h can be compiled])
71 LB_LINUX_TRY_COMPILE([
72 #include <linux/fshooks.h>
77 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
78 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
79 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
83 LB_LINUX_TRY_COMPILE([
84 #include <linux/version.h>
86 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
87 #error "linux version < 2.6.10, only support 2.6.7"
100 # rh 2.4.18 has iobuf->dovary, but other kernels do not
102 AC_DEFUN([LC_STRUCT_KIOBUF],
103 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
104 LB_LINUX_TRY_COMPILE([
105 #include <linux/iobuf.h>
111 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
118 # LC_FUNC_COND_RESCHED
120 # cond_resched() was introduced in 2.4.20
122 AC_DEFUN([LC_FUNC_COND_RESCHED],
123 [AC_MSG_CHECKING([if kernel offers cond_resched])
124 LB_LINUX_TRY_COMPILE([
125 #include <linux/sched.h>
130 AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
137 # LC_FUNC_ZAP_PAGE_RANGE
139 # if zap_page_range() takes a vma arg
141 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
142 [AC_MSG_CHECKING([if zap_pag_range with vma parameter])
143 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
144 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
145 AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
155 # if proc_fs.h defines PDE()
157 AC_DEFUN([LC_FUNC_PDE],
158 [AC_MSG_CHECKING([if kernel defines PDE])
159 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
160 if test "$HAVE_PDE" != 0 ; then
161 AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
171 # if direct_IO takes a struct file argument
173 AC_DEFUN([LC_FUNC_DIRECT_IO],
174 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
175 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
176 if test "$HAVE_DIO_FILE" != 0 ; then
177 AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
185 # LC_HEADER_MM_INLINE
187 # RHEL kernels define page_count in mm_inline.h
189 AC_DEFUN([LC_HEADER_MM_INLINE],
190 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
191 LB_LINUX_TRY_COMPILE([
192 #include <linux/mm_inline.h>
195 #error mm_inline.h does not define page_count
199 AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
208 # if inode->i_alloc_sem exists
210 AC_DEFUN([LC_STRUCT_INODE],
211 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
212 LB_LINUX_TRY_COMPILE([
213 #include <linux/fs.h>
214 #include <linux/version.h>
216 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
217 #error "down_read_trylock broken before 2.4.24"
220 return (char *)&i.i_alloc_sem - (char *)&i;
223 AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
231 # LC_FUNC_DEV_SET_RDONLY
233 # check for the old-style dev_set_rdonly which took an extra "devno" param
234 # and can only set a single device to discard writes at one time
236 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
237 [AC_MSG_CHECKING([if kernel has old single-device dev_set_rdonly])
238 HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/ll_rw_blk.c`"
239 if test x$HAVE_OLD_DSR != "x1" ; then
240 HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/blkpg.c`"
242 if test x$HAVE_OLD_DSR = "x1" ; then
243 AC_DEFINE(HAVE_OLD_DEV_SET_RDONLY, 1,
244 [kernel has old single-device dev_set_rdonly])
253 # LC_CONFIG_BACKINGFS
255 # whether to use extN or ldiskfs instead of ext3
257 AC_DEFUN([LC_CONFIG_BACKINGFS],
261 # LLNL patches their ext3 and calls it extN
262 AC_MSG_CHECKING([whether to use extN])
263 AC_ARG_ENABLE([extN],
264 AC_HELP_STRING([--enable-extN],
265 [use extN instead of ext3 for lustre backend]),
266 [BACKINGFS='extN'],[enable_extN='no'])
267 AC_MSG_RESULT([$enable_extN])
270 AC_MSG_CHECKING([whether to enable ldiskfs])
271 AC_ARG_ENABLE([ldiskfs],
272 AC_HELP_STRING([--enable-ldiskfs],
273 [use ldiskfs for the Lustre backing FS]),
274 [],[enable_ldiskfs="$linux25"])
275 AC_MSG_RESULT([$enable_ldiskfs])
277 if test x$enable_ldiskfs = xyes ; then
280 AC_PATH_PROG(PATCH, patch, [no])
281 AC_PATH_PROG(QUILT, quilt, [no])
283 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
284 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
287 AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
288 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
289 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
290 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
293 AC_MSG_CHECKING([which backing filesystem to use])
294 AC_MSG_RESULT([$BACKINGFS])
299 # --- Check that ext3 and ext3 xattr are enabled in the kernel
301 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
303 AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel])
308 LDISKFS_SERIES="2.6-suse.series"
310 LDISKFS_SERIES="2.6-fc3.series"
312 LDISKFS_SERIES="2.6-vanilla.series"
315 AC_SUBST(LDISKFS_SERIES)
321 AC_DEFUN([LC_CONFIG_LOOKUP_RAW],
322 [AC_MSG_CHECKING([whether to have raw lookup patch])
323 HAVE_LOOKUP_RAW="`grep -c -s 'raw-lookup' $LUSTRE/kernel_patches/series/ldiskfs-$LDISKFS_SERIES`"
325 if test x$HAVE_LOOKUP_RAW = "x1" ; then
326 AC_DEFINE(HAVE_LOOKUP_RAW, 1,
327 [kernel have lookup raw patch])
337 # the pinger is temporary, until we have the recovery node in place
339 AC_DEFUN([LC_CONFIG_PINGER],
340 [AC_MSG_CHECKING([whether to enable pinger support])
341 AC_ARG_ENABLE([pinger],
342 AC_HELP_STRING([--disable-pinger],
343 [disable recovery pinger support]),
344 [],[enable_pinger='yes'])
345 AC_MSG_RESULT([$enable_pinger])
346 if test x$enable_pinger != xno ; then
347 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
352 # LC_CONFIG_OBD_BUFFER_SIZE
354 # the maximum buffer size of lctl ioctls
356 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
357 [AC_MSG_CHECKING([maximum OBD ioctl size])
358 AC_ARG_WITH([obd-buffer-size],
359 AC_HELP_STRING([--with-obd-buffer-size=[size]],
360 [set lctl ioctl maximum bytes (default=8192)]),
362 OBD_BUFFER_SIZE=$with_obd_buffer_size
366 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
367 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
373 # whether build-in gss/krb5 capability
375 AC_DEFUN([LC_CONFIG_GSS],
376 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
378 AC_HELP_STRING([--enable-gss],
379 [enable gss/krb5 support]),
380 [],[enable_gss='yes'])
381 AC_MSG_RESULT([$enable_gss])
382 if test x$enable_gss != xno ; then
383 AC_DEFINE(ENABLE_GSS, 1, Support GSS/krb5)
390 # Whether snapfs is desired
392 AC_DEFUN([LC_CONFIG_SNAPFS],
394 AC_MSG_CHECKING([whether to enable snapfs support])
395 AC_ARG_ENABLE([snapfs],
396 AC_HELP_STRING([--enable-snapfs],
398 [],[enable_snapfs='no'])
399 AC_MSG_RESULT([$enable_snapfs])
405 # whether smfs is desired
407 AC_DEFUN([LC_CONFIG_SMFS],
408 [AC_MSG_CHECKING([whether to enable smfs support])
409 AC_ARG_ENABLE([smfs],
410 AC_HELP_STRING([--enable-smfs],
412 [],[enable_smfs='no'])
413 AC_MSG_RESULT([$enable_smfs])
419 # Lustre linux kernel checks
421 AC_DEFUN([LC_PROG_LINUX],
422 [if test x$enable_server = xyes ; then
433 LC_FUNC_ZAP_PAGE_RANGE
438 LC_FUNC_DEV_SET_RDONLY
442 # LC_CONFIG_CLIENT_SERVER
444 # Build client/server sides of Lustre
446 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
447 [AC_MSG_CHECKING([whether to build Lustre server support])
448 AC_ARG_ENABLE([server],
449 AC_HELP_STRING([--disable-server],
450 [disable Lustre server support]),
451 [],[enable_server='yes'])
452 AC_MSG_RESULT([$enable_server])
454 AC_MSG_CHECKING([whether to build Lustre client support])
455 AC_ARG_ENABLE([client],
456 AC_HELP_STRING([--disable-client],
457 [disable Lustre client support]),
458 [],[enable_client='yes'])
459 AC_MSG_RESULT([$enable_client])])
462 # LC_CONFIG_LIBLUSTRE
464 # whether to build liblustre
466 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
467 [AC_MSG_CHECKING([whether to build Lustre library])
468 AC_ARG_ENABLE([liblustre],
469 AC_HELP_STRING([--disable-liblustre],
470 [disable building of Lustre library]),
471 [],[enable_liblustre=$with_sysio])
472 AC_MSG_RESULT([$enable_liblustre])
473 # only build sysio if liblustre is built
474 with_sysio="$enable_liblustre"
476 AC_MSG_CHECKING([whether to build mpitests])
477 AC_ARG_ENABLE([mpitests],
478 AC_HELP_STRING([--enable-mpitests],
479 [build liblustre mpi tests]),
480 [],[enable_mpitests=no])
481 AC_MSG_RESULT([$enable_mpitests])
487 # other configure checks
489 AC_DEFUN([LC_CONFIGURE],
490 [LC_CONFIG_OBD_BUFFER_SIZE
492 # include/liblustre.h
493 AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h])
495 # liblustre/llite_lib.h
496 AC_CHECK_HEADERS([xtio.h file.h])
499 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
502 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
503 AC_CHECK_FUNCS([inet_ntoa])
509 # AM_CONDITIONALS for lustre
511 AC_DEFUN([LC_CONDITIONALS],
512 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
513 AM_CONDITIONAL(EXTN, test x$enable_extN = xyes)
514 AM_CONDITIONAL(LDISKFS, test x$enable_ldiskfs = xyes)
515 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
516 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
517 AM_CONDITIONAL(SNAPFS, test x$enable_snapfs = xyes)
518 AM_CONDITIONAL(SMFS, test x$enable_smfs = xyes)
519 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
520 AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
521 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
522 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
523 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
524 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
530 # files that should be generated with AC_OUTPUT
532 AC_DEFUN([LC_CONFIG_FILES],
536 lustre/autoconf/Makefile
537 lustre/cmobd/Makefile
538 lustre/cmobd/autoMakefile
540 lustre/cobd/autoMakefile
543 lustre/include/Makefile
544 lustre/include/linux/Makefile
545 lustre/include/lustre/Makefile
546 lustre/kernel_patches/targets/2.6-fc3.target
547 lustre/ldiskfs/Makefile
548 lustre/ldiskfs/autoMakefile
550 lustre/liblustre/Makefile
551 lustre/llite/Makefile
552 lustre/llite/autoMakefile
554 lustre/lmv/autoMakefile
556 lustre/lov/autoMakefile
558 lustre/lvfs/autoMakefile
560 lustre/mdc/autoMakefile
562 lustre/mds/autoMakefile
563 lustre/obdclass/Makefile
564 lustre/obdclass/autoMakefile
565 lustre/obdecho/Makefile
566 lustre/obdecho/autoMakefile
567 lustre/obdfilter/Makefile
568 lustre/obdfilter/autoMakefile
570 lustre/osc/autoMakefile
572 lustre/ost/autoMakefile
573 lustre/ptlbd/Makefile
574 lustre/ptlbd/autoMakefile
575 lustre/ptlrpc/Makefile
576 lustre/ptlrpc/autoMakefile
577 lustre/scripts/Makefile
578 lustre/scripts/version_tag.pl
580 lustre/sec/autoMakefile
581 lustre/sec/gss/Makefile
582 lustre/sec/gss/autoMakefile
583 lustre/sec/gks/Makefile
584 lustre/sec/gks/autoMakefile
586 lustre/smfs/autoMakefile
587 lustre/snapfs/Makefile
588 lustre/snapfs/autoMakefile
589 lustre/snapfs/utils/Makefile
590 lustre/tests/Makefile
591 lustre/utils/Lustre/Makefile
592 lustre/utils/Makefile