4 # check if zerocopy is available/wanted
6 AC_DEFUN([LP_CONFIG_ZEROCOPY],
7 [AC_MSG_CHECKING([for zero-copy TCP support])
8 AC_ARG_ENABLE([zerocopy],
9 AC_HELP_STRING([--disable-zerocopy],
10 [disable socknal zerocopy]),
11 [],[enable_zerocopy='yes'])
12 if test x$enable_zerocopy = xno ; then
13 AC_MSG_RESULT([no (by request)])
15 ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
16 if test "$ZCCD" != 0 ; then
17 AC_DEFINE(SOCKNAL_ZC, 1, [use zero-copy TCP])
20 AC_MSG_RESULT([no (no kernel support)])
28 # check if cpu affinity is available/wanted
30 AC_DEFUN([LP_CONFIG_AFFINITY],
31 [AC_ARG_ENABLE([affinity],
32 AC_HELP_STRING([--disable-affinity],
33 [disable process/irq affinity]),
34 [],[enable_affinity='yes'])
36 AC_MSG_CHECKING([for CPU affinity support])
37 if test x$enable_affinity = xno ; then
38 AC_MSG_RESULT([no (by request)])
40 LB_LINUX_TRY_COMPILE([
41 #include <linux/sched.h>
49 set_cpus_allowed(&t, m);
51 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
54 AC_MSG_RESULT([no (no kernel support)])
62 # check if quadrics support is in this kernel
64 AC_DEFUN([LP_CONFIG_QUADRICS],
65 [AC_MSG_CHECKING([if quadrics kernel headers are present])
66 if test -d $LINUX/drivers/net/qsnet ; then
69 AC_MSG_CHECKING([for multirail EKC])
70 if test -f $LINUX/include/elan/epcomms.h; then
71 AC_MSG_RESULT([supported])
72 QSWCPPFLAGS="-DMULTIRAIL_EKC=1"
74 AC_MSG_RESULT([not supported])
75 if test -d $LINUX/drivers/net/qsnet/include; then
76 QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
78 QSWCPPFLAGS="-I$LINUX/include/linux"
93 # check if GM support is available
95 AC_DEFUN([LP_CONFIG_GM],
96 [AC_MSG_CHECKING([if gm support was requested])
98 AC_HELP_STRING([--with-gm=path],
99 [build gmnal against path]),
104 GMCPPFLAGS="-I/usr/local/gm/include"
114 GMCPPFLAGS="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
130 # check for OpenIB in the kernel
131 AC_DEFUN([LP_CONFIG_OPENIB],[
132 AC_MSG_CHECKING([whether to enable OpenIB support])
134 OPENIBPATH="$LINUX/drivers/infiniband"
135 AC_ARG_WITH([openib],
136 AC_HELP_STRING([--with-openib=path],
137 [build openibnal against path]),
144 *) OPENIBPATH="$with_openib"
151 if test $ENABLEOPENIB -eq 0; then
152 AC_MSG_RESULT([disabled])
153 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
154 -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
155 -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
157 case $ENABLEOPENIB in
159 2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
160 3) AC_MSG_ERROR([bad --with-openib path]);;
161 *) AC_MSG_ERROR([internal error]);;
164 case $ENABLEOPENIB in
165 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
166 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
167 *) AC_MSG_RESULT([no])
168 AC_MSG_ERROR([internal error]);;
170 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
171 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
172 LB_LINUX_TRY_COMPILE([
173 #include <ts_ib_core.h>
174 #include <ts_ib_cm.h>
175 #include <ts_ib_sa_client.h>
177 struct ib_device_properties dev_props;
178 struct ib_cm_active_param cm_active_params;
179 tTS_IB_CLIENT_QUERY_TID tid;
183 OPENIBNAL="openibnal"
186 case $ENABLEOPENIB in
188 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
189 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
190 *) AC_MSG_ERROR([internal error]);;
195 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
197 AC_SUBST(OPENIBCPPFLAGS)
204 # check for infinicon infiniband support
206 AC_DEFUN([LP_CONFIG_IIB],
207 [AC_MSG_CHECKING([if Infinicon IB kernel headers are present])
208 # for how the only infinicon ib build has headers in /usr/include/iba
209 IIBCPPFLAGS="-I/usr/include -DIN_TREE_BUILD"
210 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
211 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
212 LB_LINUX_TRY_COMPILE([
213 #include <linux/iba/ibt.h>
215 IBT_INTERFACE_UNION interfaces;
218 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
221 return rc == FSUCCESS ? 0 : 1;
230 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
231 AC_SUBST(IIBCPPFLAGS)
238 # check for Voltaire infiniband support
240 AC_DEFUN([LP_CONFIG_VIB],
241 [AC_MSG_CHECKING([if Voltaire IB kernel headers are present])
242 VIBCPPFLAGS="-I/usr/local/include/ibhost-kdevel -DCPU_BE=0 -DCPU_LE=1 -DGSI_PASS_PORT_NUM"
243 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
244 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
245 LB_LINUX_TRY_COMPILE([
246 #include <linux/list.h>
252 retval = vv_hca_open("ANY_HCA", NULL, &kib_hca);
254 return retval == vv_return_ok ? 0 : 1;
263 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
264 AC_SUBST(VIBCPPFLAGS)
271 # check whether to use the RapidArray nal
273 AC_DEFUN([LP_CONFIG_RANAL],
275 AC_MSG_CHECKING([if RapidArray kernel headers are present])
278 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
279 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
280 LB_LINUX_TRY_COMPILE([
281 #include <linux/types.h>
285 RAP_PVOID dev_handle;
287 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
289 return rc == RAP_SUCCESS ? 0 : 1;
298 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
304 # LP_STRUCT_PAGE_LIST
306 # 2.6.4 no longer has page->list
308 AC_DEFUN([LP_STRUCT_PAGE_LIST],
309 [AC_MSG_CHECKING([if struct page has a list field])
310 LB_LINUX_TRY_COMPILE([
311 #include <linux/mm.h>
317 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
326 # red hat 2.4 adds sighand to struct task_struct
328 AC_DEFUN([LP_STRUCT_SIGHAND],
329 [AC_MSG_CHECKING([if task_struct has a sighand field])
330 LB_LINUX_TRY_COMPILE([
331 #include <linux/sched.h>
333 struct task_struct p;
336 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
346 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
348 AC_DEFUN([LP_FUNC_CPU_ONLINE],
349 [AC_MSG_CHECKING([if kernel defines cpu_online()])
350 LB_LINUX_TRY_COMPILE([
351 #include <linux/sched.h>
356 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
365 # same goes for cpumask_t
367 AC_DEFUN([LP_TYPE_CPUMASK_T],
368 [AC_MSG_CHECKING([if kernel defines cpumask_t])
369 LB_LINUX_TRY_COMPILE([
370 #include <linux/sched.h>
372 return sizeof (cpumask_t);
375 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
384 # we export show_task(), but not all kernels have it (yet)
386 AC_DEFUN([LP_FUNC_SHOW_TASK],
387 [AC_MSG_CHECKING([if kernel exports show_task])
389 for file in ksyms sched ; do
390 if grep -q "EXPORT_SYMBOL(show_task)" \
391 "$LINUX/kernel/$file.c" 2>/dev/null ; then
396 if test x$have_show_task = x1 ; then
397 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
407 # Portals linux kernel checks
409 AC_DEFUN([LP_PROG_LINUX],
429 # default paths for installed files
431 AC_DEFUN([LP_PATH_DEFAULTS],
438 # other configure checks
440 AC_DEFUN([LP_CONFIGURE],
441 [# portals/utils/portals.c
442 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h])
443 AC_CHECK_FUNCS([gethostbyname socket connect])
445 # portals/utils/debug.c
446 AC_CHECK_HEADERS([linux/version.h])
448 AC_CHECK_TYPE([spinlock_t],
449 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
451 [#include <linux/spinlock.h>])
453 # -------- Check for required packages --------------
455 # this doesn't seem to work on older autoconf
456 # AC_CHECK_LIB(readline, readline,,)
457 AC_MSG_CHECKING([for readline support])
458 AC_ARG_ENABLE(readline,
459 AC_HELP_STRING([--disable-readline],
460 [do not use readline library]),
461 [],[enable_readline='yes'])
462 AC_MSG_RESULT([$enable_readline])
463 if test x$enable_readline = xyes ; then
464 LIBREADLINE="-lreadline -lncurses"
465 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
469 AC_SUBST(LIBREADLINE)
471 AC_MSG_CHECKING([if efence debugging support is requested])
472 AC_ARG_ENABLE(efence,
473 AC_HELP_STRING([--enable-efence],
474 [use efence library]),
475 [],[enable_efence='no'])
476 AC_MSG_RESULT([$enable_efence])
477 if test "$enable_efence" = "yes" ; then
479 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
485 # -------- enable acceptor libwrap (TCP wrappers) support? -------
486 AC_MSG_CHECKING([if libwrap support is requested])
487 AC_ARG_ENABLE([libwrap],
488 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
489 [case "${enableval}" in
490 yes) enable_libwrap=yes ;;
491 no) enable_libwrap=no ;;
492 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
493 esac],[enable_libwrap=no])
494 AC_MSG_RESULT([$enable_libwrap])
495 if test x$enable_libwrap = xyes ; then
497 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
503 # ----------------------------------------
504 # some tests for catamount-like systems
505 # ----------------------------------------
506 AC_ARG_ENABLE([sysio_init],
507 AC_HELP_STRING([--disable-sysio-init],
508 [call sysio init functions when initializing liblustre]),
509 [],[enable_sysio_init=yes])
510 AC_MSG_CHECKING([whether to initialize libsysio])
511 AC_MSG_RESULT([$enable_sysio_init])
512 if test x$enable_sysio_init != xno ; then
513 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
516 AC_ARG_ENABLE([urandom],
517 AC_HELP_STRING([--disable-urandom],
518 [disable use of /dev/urandom for liblustre]),
519 [],[enable_urandom=yes])
520 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
521 AC_MSG_RESULT([$enable_urandom])
522 if test x$enable_urandom != xno ; then
523 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
526 # -------- check for -lcap and -lpthread ----
527 if test x$enable_liblustre = xyes ; then
528 AC_CHECK_LIB([cap], [cap_get_proc],
531 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
535 AC_CHECK_LIB([pthread], [pthread_create],
537 PTHREAD_LIBS="-lpthread"
538 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
541 AC_SUBST(PTHREAD_LIBS)
548 # AM_CONDITOINAL defines for portals
550 AC_DEFUN([LP_CONDITIONALS],
551 [AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
552 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
553 AM_CONDITIONAL(BUILD_OPENIBNAL, test x$OPENIBNAL = "xopenibnal")
554 AM_CONDITIONAL(BUILD_IIBNAL, test x$IIBNAL = "xiibnal")
555 AM_CONDITIONAL(BUILD_VIBNAL, test x$VIBNAL = "xvibnal")
556 AM_CONDITIONAL(BUILD_RANAL, test x$RANAL = "xranal")
562 # files that should be generated with AC_OUTPUT
564 AC_DEFUN([LP_CONFIG_FILES],
569 portals/autoconf/Makefile
571 portals/include/Makefile
572 portals/include/linux/Makefile
573 portals/include/portals/Makefile
574 portals/knals/Makefile
575 portals/knals/autoMakefile
576 portals/knals/gmnal/Makefile
577 portals/knals/gmnal/autoMakefile
578 portals/knals/openibnal/Makefile
579 portals/knals/openibnal/autoMakefile
580 portals/knals/iibnal/Makefile
581 portals/knals/iibnal/autoMakefile
582 portals/knals/vibnal/Makefile
583 portals/knals/vibnal/autoMakefile
584 portals/knals/lonal/Makefile
585 portals/knals/lonal/autoMakefile
586 portals/knals/qswnal/Makefile
587 portals/knals/qswnal/autoMakefile
588 portals/knals/ranal/Makefile
589 portals/knals/ranal/autoMakefile
590 portals/knals/socknal/Makefile
591 portals/knals/socknal/autoMakefile
592 portals/libcfs/Makefile
593 portals/libcfs/autoMakefile
594 portals/portals/Makefile
595 portals/portals/autoMakefile
596 portals/router/Makefile
597 portals/router/autoMakefile
598 portals/tests/Makefile
599 portals/tests/autoMakefile
600 portals/unals/Makefile
601 portals/utils/Makefile