1 # -------- we can't build modules unless srcdir = builddir
2 if test x$enable_modules != xno ; then
3 AC_CHECK_FILE([autoMakefile.am],[],
4 [AC_MSG_ERROR([At this time, Lustre does not support building kernel modules with srcdir != buildir.])])
7 # -------- in kernel compilation? (2.5 only) -------------
8 AC_MSG_CHECKING([if inkernel build support is requested])
9 AC_ARG_ENABLE([inkernel],
10 AC_HELP_STRING([--enable-inkernel],
11 [set up 2.5 kernel makefiles]),
12 [],[enable_inkernel=no])
13 AC_MSG_RESULT([$enable_inkernel])
14 AM_CONDITIONAL(INKERNEL, test x$enable_inkernel = xyes)
16 # -------- are we building against an external portals? -------
17 AC_MSG_CHECKING([for Cray portals])
18 AC_ARG_WITH([cray-portals],
19 AC_HELP_STRING([--with-cray-portals=path],
20 [path to cray portals]),
22 if test "$with_cray_portals" != no; then
23 CRAY_PORTALS_PATH=$with_cray_portals
24 CRAY_PORTALS_INCLUDES="$with_cray_portals/include"
25 CRAY_PORTALS_LIBS="$with_cray_portals"
27 ],[with_cray_portals=no])
28 AC_SUBST(CRAY_PORTALS_PATH)
29 AC_MSG_RESULT([$CRAY_PORTALS_PATH])
31 AC_MSG_CHECKING([for Cray portals includes])
32 AC_ARG_WITH([cray-portals-includes],
33 AC_HELP_STRING([--with-cray-portals-includes=path],
34 [path to cray portals includes]),
36 if test "$with_cray_portals_includes" != no; then
37 CRAY_PORTALS_INCLUDES="$with_cray_portals_includes"
40 AC_SUBST(CRAY_PORTALS_INCLUDES)
41 AC_MSG_RESULT([$CRAY_PORTALS_INCLUDES])
43 AC_MSG_CHECKING([for Cray portals libs])
44 AC_ARG_WITH([cray-portals-libs],
45 AC_HELP_STRING([--with-cray-portals-libs=path],
46 [path to cray portals libs]),
48 if test "$with_cray_portals_libs" != no; then
49 CRAY_PORTALS_LIBS="$with_cray_portals_libs"
52 AC_SUBST(CRAY_PORTALS_LIBS)
53 AC_MSG_RESULT([$CRAY_PORTALS_LIBS])
55 if test x$CRAY_PORTALS_INCLUDES != x ; then
56 if test ! -r $CRAY_PORTALS_INCLUDES/portals/api.h ; then
57 AC_MSG_ERROR([Cray portals headers were not found in $CRAY_PORTALS_INCLUDES. Please check the paths passed to --with-cray-portals or --with-cray-portals-includes.])
60 if test x$CRAY_PORTALS_LIBS != x ; then
61 if test ! -r $CRAY_PORTALS_LIBS/libportals.a ; then
62 AC_MSG_ERROR([Cray portals libraries were not found in $CRAY_PORTALS_LIBS. Please check the paths passed to --with-cray-portals or --with-cray-portals-libs.])
66 AC_MSG_CHECKING([whether to use Cray portals])
67 if test x$CRAY_PORTALS_INCLUDES != x -a x$CRAY_PORTALS_LIBS != x ; then
69 AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
70 CRAY_PORTALS_INCLUDES="-I$CRAY_PORTALS_INCLUDES"
74 AC_MSG_RESULT([$with_cray_portals])
75 AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
77 # ----------------------------------------
78 # some tests for catamount-like systems
79 # ----------------------------------------
80 AC_ARG_ENABLE([sysio_init],
81 AC_HELP_STRING([--disable-sysio-init],
82 [call sysio init functions when initializing liblustre]),
83 [],[enable_sysio_init=yes])
84 AC_MSG_CHECKING([whether to initialize libsysio])
85 AC_MSG_RESULT([$enable_sysio_init])
86 if test x$enable_sysio_init != xno ; then
87 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
90 AC_ARG_ENABLE([urandom],
91 AC_HELP_STRING([--disable-urandom],
92 [disable use of /dev/urandom for liblustre]),
93 [],[enable_urandom=yes])
94 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
95 AC_MSG_RESULT([$enable_urandom])
96 if test x$enable_urandom != xno ; then
97 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
100 # -------- check for -lcap and -lpthread ----
101 if test x$enable_liblustre = xyes ; then
102 AC_CHECK_LIB([cap], [cap_get_proc],
105 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
109 AC_CHECK_LIB([pthread], [pthread_create],
111 PTHREAD_LIBS="-lpthread"
112 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
115 AC_SUBST(PTHREAD_LIBS)
118 # -------- enable tests and utils? -------
119 if test x$enable_tests = xno ; then
120 AC_MSG_NOTICE([disabling tests])
123 if test x$enable_utils = xno ; then
124 AC_MSG_NOTICE([disabling utilities])
128 if test x$enable_modules != xno ; then
129 # -------- set linuxdir ------------
130 AC_MSG_CHECKING([for Linux sources])
132 AC_HELP_STRING([--with-linux=path],
133 [set path to Linux source (default=/usr/src/linux)]),
135 [LINUX=/usr/src/linux])
136 AC_MSG_RESULT([$LINUX])
138 if test x$enable_inkernel = xyes ; then
139 echo ln -s `pwd` $LINUX/fs/lustre
141 ln -s `pwd` $LINUX/fs/lustre
144 # -------- linux objects (for 2.6) --
145 AC_MSG_CHECKING([for Linux objects dir])
146 AC_ARG_WITH([linux-obj],
147 AC_HELP_STRING([--with-linux-obj=path],
148 [set path to Linux objects dir (default=\$LINUX)]),
149 [LINUX_OBJ=$with_linux_obj],
151 AC_MSG_RESULT([$LINUX_OBJ])
154 # -------- check for .confg --------
155 AC_ARG_WITH([linux-config],
156 [AC_HELP_STRING([--with-linux-config=path],
157 [set path to Linux .conf (default=\$LINUX_OBJ/.config)])],
158 [LINUX_CONFIG=$with_linux_config],
159 [LINUX_CONFIG=$LINUX_OBJ/.config])
160 AC_SUBST(LINUX_CONFIG)
162 AC_CHECK_FILE([/boot/kernel.h],
163 [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
164 [AC_CHECK_FILE([/var/adm/running-kernel.h]),
165 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h']])
167 AC_ARG_WITH([kernel-source-header],
168 AC_HELP_STRING([--with-kernel-source-header=path],
169 [Use a different kernel version header. Consult README.kernel-source for details.]),
170 [KERNEL_SOURCE_HEADER=$with_kernel_source_header])
172 # --------------------
176 AC_MSG_CHECKING([if you are running user mode linux for $host_cpu])
177 if test -e $LINUX/include/asm-um ; then
178 if test X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
180 # see notes in Rules.in
184 AC_MSG_RESULT([no (asm doesn't point at asm-um)])
187 AC_MSG_RESULT([no (asm-um missing)])
193 # --------- Linux 25 ------------------
194 AC_CHECK_FILE([$LINUX/include/linux/namei.h],
204 AC_MSG_CHECKING([if you are using Linux 2.6])
205 AC_MSG_RESULT([$linux25])
210 AC_PATH_PROG(PATCH, patch, [no])
211 AC_PATH_PROG(QUILT, quilt, [no])
213 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
214 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
217 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
218 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
220 # ------- Makeflags ------------------
222 CPPFLAGS="$CPPFLAGS $CRAY_PORTALS_INCLUDES -I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include"
224 # liblustre are all the same
225 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
228 LLCFLAGS="-g -Wall -fPIC"
231 # everyone builds against portals and lustre
233 if test x$enable_ldiskfs = xyes ; then
234 AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
235 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
236 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
237 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
240 EXTRA_KCFLAGS="-g $CRAY_PORTALS_INCLUDES -I$PWD/portals/include -I$PWD/include"
242 # these are like AC_TRY_COMPILE, but try to build modules against the
243 # kernel, inside the kernel-tests directory
245 AC_DEFUN([LUSTRE_MODULE_CONFTEST],
246 [cat >conftest.c <<_ACEOF
251 AC_DEFUN([LUSTRE_MODULE_COMPILE_IFELSE],
252 [m4_ifvaln([$1], [LUSTRE_MODULE_CONFTEST([$1])])dnl
253 rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.ko
254 AS_IF([AC_TRY_COMMAND(cp conftest.c kernel-tests && make [$2] CC="$CC" -f $PWD/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/kernel-tests) >/dev/null && AC_TRY_COMMAND([$3])],
256 [_AC_MSG_LOG_CONFTEST
257 m4_ifvaln([$5],[$5])dnl])dnl
258 rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.mod.o kernel-tests/conftest.ko m4_ifval([$1], [kernel-tests/conftest.c conftest.c])[]dnl
261 AC_DEFUN([LUSTRE_MODULE_TRY_COMPILE],
262 [LUSTRE_MODULE_COMPILE_IFELSE(
263 [AC_LANG_PROGRAM([[$1]], [[$2]])],
265 [test -s kernel-tests/conftest.o],
268 AC_DEFUN([LUSTRE_MODULE_TRY_MAKE],
269 [LUSTRE_MODULE_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4], [$5], [$6])])
271 # ------------ include paths ------------------
273 if test x$enable_modules != xno ; then
274 # ------------ .config exists ----------------
275 AC_CHECK_FILE([$LINUX_CONFIG],[],
276 [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult README.kernel-source])])
278 # ----------- make dep run? ------------------
279 AC_CHECK_FILES([$LINUX_OBJ/include/linux/autoconf.h
280 $LINUX_OBJ/include/linux/version.h
281 $LINUX/include/linux/config.h],[],
282 [AC_MSG_ERROR([Run make config in $LINUX.])])
284 # ------------ rhconfig.h includes runtime-generated bits --
285 # red hat kernel-source checks
287 # we know this exists after the check above. if the user
288 # tarred up the tree and ran make dep etc. in it, then
289 # version.h gets overwritten with a standard linux one.
291 if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
292 # This is a clean kernel-source tree, we need to
293 # enable extensive workarounds to get this to build
295 AC_CHECK_FILE([$KERNEL_SOURCE_HEADER],
296 [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
297 AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
298 AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
299 AC_MSG_WARN([Consult README.kernel-source for details.])
301 [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult README.kernel-source for details.])])
302 EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
305 # ------------ external module support ---------------------
306 MODULE_TARGET="SUBDIRS"
307 if test $linux25 = 'yes' ; then
308 makerule="$PWD/kernel-tests"
309 AC_MSG_CHECKING([for external module build support])
310 rm -f kernel-tests/conftest.i
311 LUSTRE_MODULE_TRY_MAKE([],[],
312 [$makerule LUSTRE_KERNEL_TEST=conftest.i],
313 [test -s kernel-tests/conftest.i],
318 makerule="_module_$makerule"
322 makerule="_dir_$PWD/kernel-tests"
324 AC_SUBST(MODULE_TARGET)
326 # --- check that we can build modules at all
327 AC_MSG_CHECKING([that modules can be built])
328 LUSTRE_MODULE_TRY_COMPILE([],[],
333 AC_MSG_WARN([Consult config.log for details.])
334 AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult README.kernel-source])
335 AC_MSG_ERROR([Kernel modules could not be built.])
338 # ------------ LINUXRELEASE and moduledir ------------------
340 rm -f kernel-tests/conftest.i
341 AC_MSG_CHECKING([for Linux release])
342 LUSTRE_MODULE_TRY_MAKE(
343 [#include <linux/version.h>],
345 LINUXRELEASE=UTS_RELEASE;],
346 [$makerule LUSTRE_KERNEL_TEST=conftest.i],
347 [test -s kernel-tests/conftest.i],
349 # LINUXRELEASE="UTS_RELEASE"
350 eval $(grep "LINUXRELEASE=" kernel-tests/conftest.i)
352 AC_MSG_RESULT([unknown])
353 AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.])
355 rm -f kernel-tests/conftest.i
356 if test x$LINUXRELEASE = x ; then
357 AC_MSG_RESULT([unknown])
358 AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
360 AC_MSG_RESULT([$LINUXRELEASE])
361 AC_SUBST(LINUXRELEASE)
363 moduledir='/lib/modules/'$LINUXRELEASE/kernel
364 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
365 modulenetdir='$(moduledir)/net/$(PACKAGE)'
368 AC_SUBST(modulefsdir)
369 AC_SUBST(modulenetdir)
371 # ------------ RELEASE --------------------------------
372 AC_MSG_CHECKING([for Lustre release])
373 RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
374 AC_MSG_RESULT($RELEASE)
377 # ---------- Portals flags --------------------
379 AC_MSG_CHECKING([for zero-copy TCP support])
380 AC_ARG_ENABLE([zerocopy],
381 AC_HELP_STRING([--disable-zerocopy],
382 [disable socknal zerocopy]),
383 [],[enable_zerocopy='yes'])
384 if test x$enable_zerocopy = xno ; then
385 AC_MSG_RESULT([no (by request)])
387 ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
388 if test "$ZCCD" != 0 ; then
389 AC_DEFINE(SOCKNAL_ZC, 1, [use zero-copy TCP])
392 AC_MSG_RESULT([no (no kernel support)])
396 AC_ARG_ENABLE([affinity],
397 AC_HELP_STRING([--disable-affinity],
398 [disable process/irq affinity]),
399 [],[enable_affinity='yes'])
401 AC_MSG_CHECKING([for CPU affinity support])
402 if test x$enable_affinity = xno ; then
403 AC_MSG_RESULT([no (by request)])
405 LUSTRE_MODULE_TRY_COMPILE(
407 #include <linux/sched.h>
409 struct task_struct t;
410 #ifdef CPU_ARRAY_SIZE
415 set_cpus_allowed(&t, m);
417 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
420 AC_MSG_RESULT([no (no kernel support)])
424 #####################################
426 AC_MSG_CHECKING([if quadrics kernel headers are present])
427 if test -d $LINUX/drivers/net/qsnet ; then
430 AC_MSG_CHECKING([for multirail EKC])
431 if test -f $LINUX/include/elan/epcomms.h; then
432 AC_MSG_RESULT([supported])
433 QSWCPPFLAGS="-DMULTIRAIL_EKC=1"
435 AC_MSG_RESULT([not supported])
436 if test -d $LINUX/drivers/net/qsnet/include; then
437 QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
439 QSWCPPFLAGS="-I$LINUX/include/linux"
447 AC_SUBST(QSWCPPFLAGS)
450 AC_MSG_CHECKING([if gm support was requested])
452 AC_HELP_STRING([--with-gm=path],
453 [build gmnal against path]),
458 GMCPPFLAGS="-I/usr/local/gm/include"
468 GMCPPFLAGS="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
480 if test $linux25 = 'no' ; then
482 AC_MSG_CHECKING([if OpenIB kernel headers are present])
483 OPENIBCPPFLAGS="-I$LINUX/drivers/infiniband/include -DIN_TREE_BUILD"
484 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
485 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
486 LUSTRE_MODULE_TRY_COMPILE(
488 #include <ts_ib_core.h>
490 struct ib_device_properties props;
494 OPENIBNAL="openibnal"
500 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
501 AC_SUBST(OPENIBCPPFLAGS)
506 AC_MSG_CHECKING([if Infinicon IB kernel headers are present])
507 # for how the only infinicon ib build has headers in /usr/include/iba
508 IIBCPPFLAGS="-I/usr/include -DIN_TREE_BUILD"
509 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
510 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
511 LUSTRE_MODULE_TRY_COMPILE(
513 #include <linux/iba/ibt.h>
515 IBT_INTERFACE_UNION interfaces;
518 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
521 return rc == FSUCCESS ? 0 : 1;
530 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
531 AC_SUBST(IIBCPPFLAGS)
535 AC_MSG_CHECKING([if RapidArray kernel headers are present])
538 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
539 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
540 LUSTRE_MODULE_TRY_COMPILE(
542 #include <linux/types.h>
546 RAP_PVOID dev_handle;
548 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
550 return rc == RAP_SUCCESS ? 0 : 1;
559 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
563 # ---------- Red Hat 2.4.18 has iobuf->dovary --------------
564 # But other kernels don't
566 AC_MSG_CHECKING([if struct kiobuf has a dovary field])
567 LUSTRE_MODULE_TRY_COMPILE(
569 #include <linux/iobuf.h>
575 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
580 # ----------- 2.6.4 no longer has page->list ---------------
581 AC_MSG_CHECKING([if struct page has a list field])
582 LUSTRE_MODULE_TRY_COMPILE(
584 #include <linux/mm.h>
590 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
595 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
596 # This needs to run after we've defined the KCPPFLAGS
598 AC_MSG_CHECKING([if task_struct has a sighand field])
599 LUSTRE_MODULE_TRY_COMPILE(
601 #include <linux/sched.h>
603 struct task_struct p;
606 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
612 # ---------- 2.4.20 introduced cond_resched --------------
614 AC_MSG_CHECKING([if kernel offers cond_resched])
615 LUSTRE_MODULE_TRY_COMPILE(
617 #include <linux/sched.h>
622 AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
627 # --------- zap_page_range(vma) --------------------------------
628 AC_MSG_CHECKING([if zap_pag_range with vma parameter])
629 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
630 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
631 AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
637 # ---------- Red Hat 2.4.21 backports some more 2.5 bits --------
639 AC_MSG_CHECKING([if kernel defines PDE])
640 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
641 if test "$HAVE_PDE" != 0 ; then
642 AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
648 AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
649 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
650 if test "$HAVE_DIO_FILE" != 0 ; then
651 AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
657 AC_MSG_CHECKING([if kernel defines cpu_online()])
658 LUSTRE_MODULE_TRY_COMPILE(
660 #include <linux/sched.h>
665 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
669 AC_MSG_CHECKING([if kernel defines cpumask_t])
670 LUSTRE_MODULE_TRY_COMPILE(
672 #include <linux/sched.h>
674 return sizeof (cpumask_t);
677 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
682 # ---------- RHEL kernels define page_count in mm_inline.h
683 AC_MSG_CHECKING([if kernel has mm_inline.h header])
684 LUSTRE_MODULE_TRY_COMPILE(
686 #include <linux/mm_inline.h>
689 #error mm_inline.h does not define page_count
693 AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
698 # ---------- inode->i_alloc_sem --------------
699 AC_MSG_CHECKING([if struct inode has i_alloc_sem])
700 LUSTRE_MODULE_TRY_COMPILE(
702 #include <linux/fs.h>
703 #include <linux/version.h>
705 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
706 #error "down_read_trylock broken before 2.4.24"
709 return (char *)&i.i_alloc_sem - (char *)&i;
712 AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
718 # ---------- modules? ------------------------
719 AC_MSG_CHECKING([for module support])
720 LUSTRE_MODULE_TRY_COMPILE(
722 #include <linux/config.h>
724 #ifndef CONFIG_MODULES
725 #error CONFIG_MODULES not #defined
731 AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
734 # ---------- modversions? --------------------
735 AC_MSG_CHECKING([for MODVERSIONS])
736 LUSTRE_MODULE_TRY_COMPILE(
738 #include <linux/config.h>
740 #ifndef CONFIG_MODVERSIONS
741 #error CONFIG_MODVERSIONS not #defined
749 # ------------ preempt -----------------------
750 AC_MSG_CHECKING([if preempt is enabled])
751 LUSTRE_MODULE_TRY_COMPILE(
753 #include <linux/config.h>
755 #ifndef CONFIG_PREEMPT
756 #error CONFIG_PREEMPT is not #defined
760 AC_MSG_ERROR([Lustre does not support kernels with preempt enabled.])
765 # ------------ kallsyms (so software watchdogs produce useful stacks)
766 AC_MSG_CHECKING([if kallsyms is enabled])
767 LUSTRE_MODULE_TRY_COMPILE(
769 #include <linux/config.h>
771 #ifndef CONFIG_KALLSYMS
772 #error CONFIG_KALLSYMS is not #defined
778 if test "x$ARCH_UM" = "x" ; then
779 AC_MSG_ERROR([Lustre requires that CONFIG_KALLSYMS is enabled in your kernel.])
783 # ------------ check for our show_task patch
784 AC_MSG_CHECKING([if kernel exports show_task])
786 for file in ksyms sched ; do
787 if grep -q "EXPORT_SYMBOL(show_task)" \
788 "$LINUX/kernel/$file.c" 2>/dev/null ; then
793 if test x$have_show_task = x1 ; then
794 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
802 # --- Check that ext3 and ext3 xattr are enabled in the kernel
803 AC_MSG_CHECKING([that ext3 is enabled in the kernel])
804 LUSTRE_MODULE_TRY_COMPILE(
806 #include <linux/config.h>
808 #ifndef CONFIG_EXT3_FS
809 #ifndef CONFIG_EXT3_FS_MODULE
810 #error CONFIG_EXT3_FS not #defined
817 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
820 AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
821 LUSTRE_MODULE_TRY_COMPILE(
823 #include <linux/config.h>
825 #ifndef CONFIG_EXT3_FS_XATTR
826 #error CONFIG_EXT3_FS_XATTR not #defined
832 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR.)])
833 AC_MSG_WARN([This build may fail.])
837 AC_MSG_CHECKING([if fshooks are present])
838 LUSTRE_MODULE_TRY_COMPILE(
840 #include <linux/fshooks.h>
843 LDISKFS_SERIES="2.6-suse.series"
846 LDISKFS_SERIES="2.6-vanilla.series"
848 AC_SUBST(LDISKFS_SERIES)
849 # --- check which ldiskfs series we should use
854 AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
855 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
856 AM_CONDITIONAL(BUILD_OPENIBNAL, test x$OPENIBNAL = "xopenibnal")
857 AM_CONDITIONAL(BUILD_IIBNAL, test x$IIBNAL = "xiibnal")
858 AM_CONDITIONAL(BUILD_RANAL, test x$RANAL = "xranal")
860 # portals/utils/portals.c
861 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h])
862 AC_CHECK_FUNCS([gethostbyname socket connect])
864 # portals/utils/debug.c
865 AC_CHECK_HEADERS([linux/version.h])
867 # include/liblustre.h
868 AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h])
870 # liblustre/llite_lib.h
871 AC_CHECK_HEADERS([xtio.h file.h])
874 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
877 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
878 AC_CHECK_FUNCS([inet_ntoa])
880 CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
881 EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
882 AC_SUBST(EXTRA_KCFLAGS)
884 echo "CPPFLAGS: $CPPFLAGS"
885 echo "LLCPPFLAGS: $LLCPPFLAGS"
886 echo "CFLAGS: $CFLAGS"
887 echo "EXTRA_KCFLAGS: $EXTRA_KCFLAGS"
888 echo "LLCFLAGS: $LLCFLAGS"
890 ENABLE_INIT_SCRIPTS=0
891 if test x$enable_utils = xyes ; then
892 AC_MSG_CHECKING([whether to install init scripts])
893 # our scripts only work on red hat systems
894 if test -f /etc/init.d/functions -a -f /etc/sysconfig/network ; then
895 ENABLE_INIT_SCRIPTS=1
901 AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1")
902 AC_SUBST(ENABLE_INIT_SCRIPTS)