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])
65 # If we have (and can build) fshooks.h
67 AC_DEFUN([LC_FSHOOKS],
68 [AC_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
69 AC_MSG_CHECKING([if fshooks.h can be compiled])
70 LB_LINUX_TRY_COMPILE([
71 #include <linux/fshooks.h>
76 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
77 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
78 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
89 # rh 2.4.18 has iobuf->dovary, but other kernels do not
91 AC_DEFUN([LC_STRUCT_KIOBUF],
92 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
93 LB_LINUX_TRY_COMPILE([
94 #include <linux/iobuf.h>
100 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
107 # LC_FUNC_COND_RESCHED
109 # cond_resched() was introduced in 2.4.20
111 AC_DEFUN([LC_FUNC_COND_RESCHED],
112 [AC_MSG_CHECKING([if kernel offers cond_resched])
113 LB_LINUX_TRY_COMPILE([
114 #include <linux/sched.h>
119 AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
126 # LC_FUNC_ZAP_PAGE_RANGE
128 # if zap_page_range() takes a vma arg
130 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
131 [AC_MSG_CHECKING([if zap_pag_range with vma parameter])
132 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
133 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
134 AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
144 # if proc_fs.h defines PDE()
146 AC_DEFUN([LC_FUNC_PDE],
147 [AC_MSG_CHECKING([if kernel defines PDE])
148 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
149 if test "$HAVE_PDE" != 0 ; then
150 AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
160 # if direct_IO takes a struct file argument
162 AC_DEFUN([LC_FUNC_DIRECT_IO],
163 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
164 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
165 if test "$HAVE_DIO_FILE" != 0 ; then
166 AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
174 # LC_HEADER_MM_INLINE
176 # RHEL kernels define page_count in mm_inline.h
178 AC_DEFUN([LC_HEADER_MM_INLINE],
179 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
180 LB_LINUX_TRY_COMPILE([
181 #include <linux/mm_inline.h>
184 #error mm_inline.h does not define page_count
188 AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
197 # if inode->i_alloc_sem exists
199 AC_DEFUN([LC_STRUCT_INODE],
200 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
201 LB_LINUX_TRY_COMPILE([
202 #include <linux/fs.h>
203 #include <linux/version.h>
205 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
206 #error "down_read_trylock broken before 2.4.24"
209 return (char *)&i.i_alloc_sem - (char *)&i;
212 AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
219 # LC_CONFIG_BACKINGFS
221 # whether to use extN or ldiskfs instead of ext3
223 AC_DEFUN([LC_CONFIG_BACKINGFS],
227 # LLNL patches their ext3 and calls it extN
228 AC_MSG_CHECKING([whether to use extN])
229 AC_ARG_ENABLE([extN],
230 AC_HELP_STRING([--enable-extN],
231 [use extN instead of ext3 for lustre backend]),
232 [BACKINGFS='extN'],[enable_extN='no'])
233 AC_MSG_RESULT([$enable_extN])
236 AC_MSG_CHECKING([whether to enable ldiskfs])
237 AC_ARG_ENABLE([ldiskfs],
238 AC_HELP_STRING([--enable-ldiskfs],
239 [use ldiskfs for the Lustre backing FS]),
240 [],[enable_ldiskfs="$linux25"])
241 AC_MSG_RESULT([$enable_ldiskfs])
243 if test x$enable_ldiskfs = xyes ; then
246 AC_PATH_PROG(PATCH, patch, [no])
247 AC_PATH_PROG(QUILT, quilt, [no])
249 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
250 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
253 AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
254 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
255 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
256 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
259 AC_MSG_CHECKING([which backing filesystem to use])
260 AC_MSG_RESULT([$BACKINGFS])
265 # --- Check that ext3 and ext3 xattr are enabled in the kernel
267 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
269 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
270 AC_MSG_WARN([This build may fail.])
275 LDISKFS_SERIES="2.6-suse.series"
277 LDISKFS_SERIES="2.6-vanilla.series"
279 AC_SUBST(LDISKFS_SERIES)
287 # the pinger is temporary, until we have the recovery node in place
289 AC_DEFUN([LC_CONFIG_PINGER],
290 [AC_MSG_CHECKING([whether to enable pinger support])
291 AC_ARG_ENABLE([pinger],
292 AC_HELP_STRING([--disable-pinger],
293 [disable recovery pinger support]),
294 [],[enable_pinger='yes'])
295 AC_MSG_RESULT([$enable_pinger])
296 if test x$enable_pinger != xno ; then
297 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
302 # LC_CONFIG_OBD_BUFFER_SIZE
304 # the maximum buffer size of lctl ioctls
306 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
307 [AC_MSG_CHECKING([maximum OBD ioctl size])
308 AC_ARG_WITH([obd-buffer-size],
309 AC_HELP_STRING([--with-obd-buffer-size=[size]],
310 [set lctl ioctl maximum bytes (default=8192)]),
312 OBD_BUFFER_SIZE=$with_obd_buffer_size
316 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
317 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
323 # Whether snapfs is desired
325 AC_DEFUN([LC_CONFIG_SNAPFS],
327 AC_MSG_CHECKING([whether to enable snapfs support])
328 AC_ARG_ENABLE([snapfs],
329 AC_HELP_STRING([--enable-snapfs],
331 [],[enable_snapfs='no'])
332 AC_MSG_RESULT([$enable_snapfs])
338 # whether smfs is desired
340 AC_DEFUN([LC_CONFIG_SMFS],
341 [AC_MSG_CHECKING([whether to enable smfs support])
342 AC_ARG_ENABLE([smfs],
343 AC_HELP_STRING([--enable-smfs],
345 [],[enable_smfs='no'])
346 AC_MSG_RESULT([$enable_smfs])
352 # Lustre linux kernel checks
354 AC_DEFUN([LC_PROG_LINUX],
357 LC_CONFIG_OBD_BUFFER_SIZE
363 LC_FUNC_ZAP_PAGE_RANGE
371 # LC_CONFIG_LIBLUSTRE
373 # whether to build liblustre
375 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
376 [AC_MSG_CHECKING([whether to build Lustre library])
377 AC_ARG_ENABLE([liblustre],
378 AC_HELP_STRING([--disable-liblustre],
379 [disable building of Lustre library]),
380 [],[enable_liblustre=$enable_libsysio])
381 AC_MSG_RESULT([$enable_liblustre])
383 AC_MSG_CHECKING([whether to build mpitests])
384 AC_ARG_ENABLE([mpitests],
385 AC_HELP_STRING([--enable-mpitests],
386 [build liblustre mpi tests]),
387 [],[enable_mpitests=no])
388 AC_MSG_RESULT([$enable_mpitests])
394 # other configure checks
396 AC_DEFUN([LC_CONFIGURE],
397 [# include/liblustre.h
398 AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h])
400 # liblustre/llite_lib.h
401 AC_CHECK_HEADERS([xtio.h file.h])
404 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
407 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
408 AC_CHECK_FUNCS([inet_ntoa])
414 # AM_CONDITIONALS for lustre
416 AC_DEFUN([LC_CONDITIONALS],
417 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
418 AM_CONDITIONAL(EXTN, test x$enable_extN = xyes)
419 AM_CONDITIONAL(LDISKFS, test x$enable_ldiskfs = xyes)
420 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
421 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
422 AM_CONDITIONAL(SNAPFS, test x$enable_snapfs = xyes)
423 AM_CONDITIONAL(SMFS, test x$enable_smfs = xyes)
424 AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
425 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
431 # files that should be generated with AC_OUTPUT
433 AC_DEFUN([LC_CONFIG_FILES],
437 lustre/autoconf/Makefile
438 lustre/cmobd/Makefile
439 lustre/cmobd/autoMakefile
441 lustre/cobd/autoMakefile
444 lustre/include/Makefile
445 lustre/include/linux/Makefile
446 lustre/include/lustre/Makefile
447 lustre/ldiskfs/Makefile
448 lustre/ldiskfs/autoMakefile
450 lustre/liblustre/Makefile
451 lustre/liblustre/tests/Makefile
452 lustre/llite/Makefile
453 lustre/llite/autoMakefile
455 lustre/lmv/autoMakefile
457 lustre/lov/autoMakefile
459 lustre/lvfs/autoMakefile
461 lustre/mdc/autoMakefile
463 lustre/mds/autoMakefile
464 lustre/obdclass/Makefile
465 lustre/obdclass/autoMakefile
466 lustre/obdecho/Makefile
467 lustre/obdecho/autoMakefile
468 lustre/obdfilter/Makefile
469 lustre/obdfilter/autoMakefile
471 lustre/osc/autoMakefile
473 lustre/ost/autoMakefile
474 lustre/ptlbd/Makefile
475 lustre/ptlbd/autoMakefile
476 lustre/ptlrpc/Makefile
477 lustre/ptlrpc/autoMakefile
478 lustre/scripts/Makefile
479 lustre/scripts/version_tag.pl
481 lustre/smfs/autoMakefile
482 lustre/snapfs/Makefile
483 lustre/snapfs/autoMakefile
484 lustre/snapfs/utils/Makefile
485 lustre/tests/Makefile
486 lustre/utils/Lustre/Makefile
487 lustre/utils/Makefile