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 AC_MSG_ERROR([Only SuSE 2.6 kernels (with fshooks) are supported at this time])
278 LDISKFS_SERIES="2.6-vanilla.series"
280 AC_SUBST(LDISKFS_SERIES)
288 # the pinger is temporary, until we have the recovery node in place
290 AC_DEFUN([LC_CONFIG_PINGER],
291 [AC_MSG_CHECKING([whether to enable pinger support])
292 AC_ARG_ENABLE([pinger],
293 AC_HELP_STRING([--disable-pinger],
294 [disable recovery pinger support]),
295 [],[enable_pinger='yes'])
296 AC_MSG_RESULT([$enable_pinger])
297 if test x$enable_pinger != xno ; then
298 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
303 # LC_CONFIG_OBD_BUFFER_SIZE
305 # the maximum buffer size of lctl ioctls
307 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
308 [AC_MSG_CHECKING([maximum OBD ioctl size])
309 AC_ARG_WITH([obd-buffer-size],
310 AC_HELP_STRING([--with-obd-buffer-size=[size]],
311 [set lctl ioctl maximum bytes (default=8192)]),
313 OBD_BUFFER_SIZE=$with_obd_buffer_size
317 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
318 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
324 # Lustre linux kernel checks
326 AC_DEFUN([LC_PROG_LINUX],
332 LC_FUNC_ZAP_PAGE_RANGE
340 # LC_CONFIG_LIBLUSTRE
342 # whether to build liblustre
344 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
345 [AC_MSG_CHECKING([whether to build Lustre library])
346 AC_ARG_ENABLE([liblustre],
347 AC_HELP_STRING([--disable-liblustre],
348 [disable building of Lustre library]),
349 [],[enable_liblustre=$enable_libsysio])
350 AC_MSG_RESULT([$enable_liblustre])
352 AC_MSG_CHECKING([whether to build mpitests])
353 AC_ARG_ENABLE([mpitests],
354 AC_HELP_STRING([--enable-mpitests],
355 [build liblustre mpi tests]),
356 [],[enable_mpitests=no])
357 AC_MSG_RESULT([$enable_mpitests])
363 # other configure checks
365 AC_DEFUN([LC_CONFIGURE],
366 [# include/liblustre.h
367 AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h])
369 LC_CONFIG_OBD_BUFFER_SIZE
371 # liblustre/llite_lib.h
372 AC_CHECK_HEADERS([xtio.h file.h])
375 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
378 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
379 AC_CHECK_FUNCS([inet_ntoa])
385 # AM_CONDITIONALS for lustre
387 AC_DEFUN([LC_CONDITIONALS],
388 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
389 AM_CONDITIONAL(EXTN, test x$enable_extN = xyes)
390 AM_CONDITIONAL(LDISKFS, test x$enable_ldiskfs = xyes)
391 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
392 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
393 AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
394 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
400 # files that should be generated with AC_OUTPUT
402 AC_DEFUN([LC_CONFIG_FILES],
406 lustre/autoconf/Makefile
409 lustre/include/Makefile
410 lustre/include/linux/Makefile
411 lustre/include/lustre/Makefile
412 lustre/kernel_patches/targets/2.6-suse.target
413 lustre/kernel_patches/targets/2.6-vanilla.target
414 lustre/kernel_patches/targets/hp_pnnl-2.4.target
415 lustre/kernel_patches/targets/rh-2.4.target
416 lustre/kernel_patches/targets/rhel-2.4.target
417 lustre/kernel_patches/targets/suse-2.4.21-2.target
418 lustre/ldiskfs/Makefile
419 lustre/ldiskfs/autoMakefile
421 lustre/liblustre/Makefile
422 lustre/liblustre/tests/Makefile
423 lustre/llite/Makefile
424 lustre/llite/autoMakefile
426 lustre/lov/autoMakefile
428 lustre/lvfs/autoMakefile
430 lustre/mdc/autoMakefile
432 lustre/mds/autoMakefile
433 lustre/obdclass/Makefile
434 lustre/obdclass/autoMakefile
435 lustre/obdecho/Makefile
436 lustre/obdecho/autoMakefile
437 lustre/obdfilter/Makefile
438 lustre/obdfilter/autoMakefile
440 lustre/osc/autoMakefile
442 lustre/ost/autoMakefile
443 lustre/ptlrpc/Makefile
444 lustre/ptlrpc/autoMakefile
445 lustre/scripts/Makefile
446 lustre/scripts/version_tag.pl
447 lustre/tests/Makefile
448 lustre/utils/Lustre/Makefile
449 lustre/utils/Makefile