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;
180 int enum1 = IB_QP_ATTRIBUTE_STATE;
181 int enum2 = IB_ACCESS_LOCAL_WRITE;
182 int enum3 = IB_CQ_CALLBACK_INTERRUPT;
183 int enum4 = IB_CQ_PROVIDER_REARM;
187 OPENIBNAL="openibnal"
190 case $ENABLEOPENIB in
192 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
193 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
194 *) AC_MSG_ERROR([internal error]);;
199 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
201 AC_SUBST(OPENIBCPPFLAGS)
208 # check for infinicon infiniband support
210 AC_DEFUN([LP_CONFIG_IIB],
211 [AC_MSG_CHECKING([if Infinicon IB kernel headers are present])
212 # for how the only infinicon ib build has headers in /usr/include/iba
213 IIBCPPFLAGS="-I/usr/include -DIN_TREE_BUILD"
214 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
215 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
216 LB_LINUX_TRY_COMPILE([
217 #include <linux/iba/ibt.h>
219 IBT_INTERFACE_UNION interfaces;
222 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
225 return rc == FSUCCESS ? 0 : 1;
234 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
235 AC_SUBST(IIBCPPFLAGS)
242 # check for Voltaire infiniband support
244 AC_DEFUN([LP_CONFIG_VIB],
245 [AC_MSG_CHECKING([if Voltaire IB kernel headers are present])
246 VIBCPPFLAGS="-I/usr/local/include/ibhost-kdevel -DCPU_BE=0 -DCPU_LE=1 -DGSI_PASS_PORT_NUM"
247 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
248 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
249 LB_LINUX_TRY_COMPILE([
250 #include <linux/list.h>
256 retval = vv_hca_open("ANY_HCA", NULL, &kib_hca);
258 return retval == vv_return_ok ? 0 : 1;
267 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
268 AC_SUBST(VIBCPPFLAGS)
275 # check whether to use the RapidArray nal
277 AC_DEFUN([LP_CONFIG_RANAL],
279 AC_MSG_CHECKING([if RapidArray kernel headers are present])
281 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
282 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
283 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
284 LB_LINUX_TRY_COMPILE([
285 #include <linux/types.h>
289 RAP_PVOID dev_handle;
291 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
293 return rc == RAP_SUCCESS ? 0 : 1;
302 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
308 # LP_STRUCT_PAGE_LIST
310 # 2.6.4 no longer has page->list
312 AC_DEFUN([LP_STRUCT_PAGE_LIST],
313 [AC_MSG_CHECKING([if struct page has a list field])
314 LB_LINUX_TRY_COMPILE([
315 #include <linux/mm.h>
321 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
330 # red hat 2.4 adds sighand to struct task_struct
332 AC_DEFUN([LP_STRUCT_SIGHAND],
333 [AC_MSG_CHECKING([if task_struct has a sighand field])
334 LB_LINUX_TRY_COMPILE([
335 #include <linux/sched.h>
337 struct task_struct p;
340 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
350 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
352 AC_DEFUN([LP_FUNC_CPU_ONLINE],
353 [AC_MSG_CHECKING([if kernel defines cpu_online()])
354 LB_LINUX_TRY_COMPILE([
355 #include <linux/sched.h>
360 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
369 # same goes for cpumask_t
371 AC_DEFUN([LP_TYPE_CPUMASK_T],
372 [AC_MSG_CHECKING([if kernel defines cpumask_t])
373 LB_LINUX_TRY_COMPILE([
374 #include <linux/sched.h>
376 return sizeof (cpumask_t);
379 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
388 # we export show_task(), but not all kernels have it (yet)
390 AC_DEFUN([LP_FUNC_SHOW_TASK],
391 [AC_MSG_CHECKING([if kernel exports show_task])
393 for file in ksyms sched ; do
394 if grep -q "EXPORT_SYMBOL(show_task)" \
395 "$LINUX/kernel/$file.c" 2>/dev/null ; then
400 if test x$have_show_task = x1 ; then
401 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
411 # Portals linux kernel checks
413 AC_DEFUN([LP_PROG_LINUX],
435 AC_DEFUN([LP_PROG_DARWIN],
436 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
442 # default paths for installed files
444 AC_DEFUN([LP_PATH_DEFAULTS],
451 # other configure checks
453 AC_DEFUN([LP_CONFIGURE],
454 [# portals/utils/portals.c
455 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h])
456 AC_CHECK_FUNCS([gethostbyname socket connect])
458 # portals/utils/debug.c
459 AC_CHECK_HEADERS([linux/version.h])
461 AC_CHECK_TYPE([spinlock_t],
462 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
464 [#include <linux/spinlock.h>])
466 # portals/utils/wirecheck.c
467 AC_CHECK_FUNCS([strnlen])
469 # -------- Check for required packages --------------
472 LIBS="-lncurses $LIBS"
473 AC_CHECK_LIB([readline],[readline],[
474 LIBREADLINE="-lreadline -lncurses"
475 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
480 AC_SUBST(LIBREADLINE)
482 AC_MSG_CHECKING([if efence debugging support is requested])
483 AC_ARG_ENABLE(efence,
484 AC_HELP_STRING([--enable-efence],
485 [use efence library]),
486 [],[enable_efence='no'])
487 AC_MSG_RESULT([$enable_efence])
488 if test "$enable_efence" = "yes" ; then
490 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
496 # -------- enable acceptor libwrap (TCP wrappers) support? -------
497 AC_MSG_CHECKING([if libwrap support is requested])
498 AC_ARG_ENABLE([libwrap],
499 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
500 [case "${enableval}" in
501 yes) enable_libwrap=yes ;;
502 no) enable_libwrap=no ;;
503 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
504 esac],[enable_libwrap=no])
505 AC_MSG_RESULT([$enable_libwrap])
506 if test x$enable_libwrap = xyes ; then
508 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
514 # ----------------------------------------
515 # some tests for catamount-like systems
516 # ----------------------------------------
517 AC_ARG_ENABLE([sysio_init],
518 AC_HELP_STRING([--disable-sysio-init],
519 [call sysio init functions when initializing liblustre]),
520 [],[enable_sysio_init=yes])
521 AC_MSG_CHECKING([whether to initialize libsysio])
522 AC_MSG_RESULT([$enable_sysio_init])
523 if test x$enable_sysio_init != xno ; then
524 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
527 AC_ARG_ENABLE([urandom],
528 AC_HELP_STRING([--disable-urandom],
529 [disable use of /dev/urandom for liblustre]),
530 [],[enable_urandom=yes])
531 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
532 AC_MSG_RESULT([$enable_urandom])
533 if test x$enable_urandom != xno ; then
534 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
537 # -------- check for -lcap and -lpthread ----
538 if test x$enable_liblustre = xyes ; then
539 AC_CHECK_LIB([cap], [cap_get_proc],
542 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
546 AC_CHECK_LIB([pthread], [pthread_create],
548 PTHREAD_LIBS="-lpthread"
549 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
552 AC_SUBST(PTHREAD_LIBS)
559 # AM_CONDITOINAL defines for portals
561 AC_DEFUN([LP_CONDITIONALS],
562 [AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
563 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
564 AM_CONDITIONAL(BUILD_OPENIBNAL, test x$OPENIBNAL = "xopenibnal")
565 AM_CONDITIONAL(BUILD_IIBNAL, test x$IIBNAL = "xiibnal")
566 AM_CONDITIONAL(BUILD_VIBNAL, test x$VIBNAL = "xvibnal")
567 AM_CONDITIONAL(BUILD_RANAL, test x$RANAL = "xranal")
573 # files that should be generated with AC_OUTPUT
575 AC_DEFUN([LP_CONFIG_FILES],
580 portals/autoconf/Makefile
582 portals/include/Makefile
583 portals/include/libcfs/Makefile
584 portals/include/libcfs/darwin/Makefile
585 portals/include/libcfs/linux/Makefile
586 portals/include/portals/Makefile
587 portals/include/portals/darwin/Makefile
588 portals/include/portals/linux/Makefile
589 portals/knals/Makefile
590 portals/knals/autoMakefile
591 portals/knals/gmnal/Makefile
592 portals/knals/gmnal/autoMakefile
593 portals/knals/openibnal/Makefile
594 portals/knals/openibnal/autoMakefile
595 portals/knals/iibnal/Makefile
596 portals/knals/iibnal/autoMakefile
597 portals/knals/vibnal/Makefile
598 portals/knals/vibnal/autoMakefile
599 portals/knals/lonal/Makefile
600 portals/knals/lonal/autoMakefile
601 portals/knals/qswnal/Makefile
602 portals/knals/qswnal/autoMakefile
603 portals/knals/ranal/Makefile
604 portals/knals/ranal/autoMakefile
605 portals/knals/socknal/Makefile
606 portals/knals/socknal/autoMakefile
607 portals/libcfs/Makefile
608 portals/libcfs/autoMakefile
609 portals/libcfs/darwin/Makefile
610 portals/libcfs/linux/Makefile
611 portals/portals/Makefile
612 portals/portals/autoMakefile
613 portals/router/Makefile
614 portals/router/autoMakefile
615 portals/tests/Makefile
616 portals/tests/autoMakefile
617 portals/unals/Makefile
618 portals/utils/Makefile