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 infiniband 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([if OpenIB kernel headers are present])
133 OPENIBCPPFLAGS="-I$LINUX/drivers/infiniband/include -DIN_TREE_BUILD"
134 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
135 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
136 LB_LINUX_TRY_COMPILE(
138 #include <ts_ib_core.h>
140 struct ib_device_properties props;
144 OPENIBNAL="openibnal"
150 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
151 AC_SUBST(OPENIBCPPFLAGS)
158 # check for infinicon infiniband support
160 AC_DEFUN([LP_CONFIG_IIB],
161 [AC_MSG_CHECKING([if Infinicon IB kernel headers are present])
162 # for how the only infinicon ib build has headers in /usr/include/iba
163 IIBCPPFLAGS="-I/usr/include -DIN_TREE_BUILD"
164 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
165 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
166 LB_LINUX_TRY_COMPILE([
167 #include <linux/iba/ibt.h>
169 IBT_INTERFACE_UNION interfaces;
172 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
175 return rc == FSUCCESS ? 0 : 1;
184 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
185 AC_SUBST(IIBCPPFLAGS)
192 # check whether to use the RapidArray nal
194 AC_DEFUN([LP_CONFIG_RANAL],
196 AC_MSG_CHECKING([if RapidArray kernel headers are present])
199 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
200 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
201 LB_LINUX_TRY_COMPILE([
202 #include <linux/types.h>
206 RAP_PVOID dev_handle;
208 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
210 return rc == RAP_SUCCESS ? 0 : 1;
219 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
225 # LP_STRUCT_PAGE_LIST
227 # 2.6.4 no longer has page->list
229 AC_DEFUN([LP_STRUCT_PAGE_LIST],
230 [AC_MSG_CHECKING([if struct page has a list field])
231 LB_LINUX_TRY_COMPILE([
232 #include <linux/mm.h>
238 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
247 # red hat 2.4 adds sighand to struct task_struct
249 AC_DEFUN([LP_STRUCT_SIGHAND],
250 [AC_MSG_CHECKING([if task_struct has a sighand field])
251 LB_LINUX_TRY_COMPILE([
252 #include <linux/sched.h>
254 struct task_struct p;
257 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
267 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
269 AC_DEFUN([LP_FUNC_CPU_ONLINE],
270 [AC_MSG_CHECKING([if kernel defines cpu_online()])
271 LB_LINUX_TRY_COMPILE([
272 #include <linux/sched.h>
277 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
286 # same goes for cpumask_t
288 AC_DEFUN([LP_TYPE_CPUMASK_T],
289 [AC_MSG_CHECKING([if kernel defines cpumask_t])
290 LB_LINUX_TRY_COMPILE([
291 #include <linux/sched.h>
293 return sizeof (cpumask_t);
296 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
305 # we export show_task(), but not all kernels have it (yet)
307 AC_DEFUN([LP_FUNC_SHOW_TASK],
308 [AC_MSG_CHECKING([if kernel exports show_task])
310 for file in ksyms sched ; do
311 if grep -q "EXPORT_SYMBOL(show_task)" \
312 "$LINUX/kernel/$file.c" 2>/dev/null ; then
317 if test x$have_show_task = x1 ; then
318 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
328 # Portals linux kernel checks
330 AC_DEFUN([LP_PROG_LINUX],
335 if test $linux25 = 'no' ; then
351 # default paths for installed files
353 AC_DEFUN([LP_PATH_DEFAULTS],
360 # other configure checks
362 AC_DEFUN([LP_CONFIGURE],
363 [# portals/utils/portals.c
364 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h])
365 AC_CHECK_FUNCS([gethostbyname socket connect])
367 # portals/utils/debug.c
368 AC_CHECK_HEADERS([linux/version.h])
370 AC_CHECK_TYPE([spinlock_t],
371 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
373 [#include <linux/spinlock.h>])
375 # -------- Check for required packages --------------
377 # this doesn't seem to work on older autoconf
378 # AC_CHECK_LIB(readline, readline,,)
379 AC_MSG_CHECKING([for readline support])
380 AC_ARG_ENABLE(readline,
381 AC_HELP_STRING([--disable-readline],
382 [do not use readline library]),
383 [],[enable_readline='yes'])
384 AC_MSG_RESULT([$enable_readline])
385 if test x$enable_readline = xyes ; then
386 LIBREADLINE="-lreadline -lncurses"
387 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
391 AC_SUBST(LIBREADLINE)
393 AC_MSG_CHECKING([if efence debugging support is requested])
394 AC_ARG_ENABLE(efence,
395 AC_HELP_STRING([--enable-efence],
396 [use efence library]),
397 [],[enable_efence='no'])
398 AC_MSG_RESULT([$enable_efence])
399 if test "$enable_efence" = "yes" ; then
401 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
407 # -------- enable acceptor libwrap (TCP wrappers) support? -------
408 AC_MSG_CHECKING([if libwrap support is requested])
409 AC_ARG_ENABLE([libwrap],
410 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
411 [case "${enableval}" in
412 yes) enable_libwrap=yes ;;
413 no) enable_libwrap=no ;;
414 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
415 esac],[enable_libwrap=no])
416 AC_MSG_RESULT([$enable_libwrap])
417 if test x$enable_libwrap = xyes ; then
419 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
425 # ----------------------------------------
426 # some tests for catamount-like systems
427 # ----------------------------------------
428 AC_ARG_ENABLE([sysio_init],
429 AC_HELP_STRING([--disable-sysio-init],
430 [call sysio init functions when initializing liblustre]),
431 [],[enable_sysio_init=yes])
432 AC_MSG_CHECKING([whether to initialize libsysio])
433 AC_MSG_RESULT([$enable_sysio_init])
434 if test x$enable_sysio_init != xno ; then
435 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
438 AC_ARG_ENABLE([urandom],
439 AC_HELP_STRING([--disable-urandom],
440 [disable use of /dev/urandom for liblustre]),
441 [],[enable_urandom=yes])
442 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
443 AC_MSG_RESULT([$enable_urandom])
444 if test x$enable_urandom != xno ; then
445 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
448 # -------- check for -lcap and -lpthread ----
449 if test x$enable_liblustre = xyes ; then
450 AC_CHECK_LIB([cap], [cap_get_proc],
453 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
457 AC_CHECK_LIB([pthread], [pthread_create],
459 PTHREAD_LIBS="-lpthread"
460 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
463 AC_SUBST(PTHREAD_LIBS)
470 # AM_CONDITOINAL defines for portals
472 AC_DEFUN([LP_CONDITIONALS],
473 [AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
474 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
475 AM_CONDITIONAL(BUILD_OPENIBNAL, test x$OPENIBNAL = "xopenibnal")
476 AM_CONDITIONAL(BUILD_IIBNAL, test x$IIBNAL = "xiibnal")
477 AM_CONDITIONAL(BUILD_RANAL, test x$RANAL = "xranal")
483 # files that should be generated with AC_OUTPUT
485 AC_DEFUN([LP_CONFIG_FILES],
490 portals/autoconf/Makefile
492 portals/include/Makefile
493 portals/include/linux/Makefile
494 portals/include/portals/Makefile
495 portals/knals/Makefile
496 portals/knals/autoMakefile
497 portals/knals/gmnal/Makefile
498 portals/knals/gmnal/autoMakefile
499 portals/knals/iibnal/Makefile
500 portals/knals/iibnal/autoMakefile
501 portals/knals/lonal/Makefile
502 portals/knals/lonal/autoMakefile
503 portals/knals/openibnal/Makefile
504 portals/knals/openibnal/autoMakefile
505 portals/knals/qswnal/Makefile
506 portals/knals/qswnal/autoMakefile
507 portals/knals/ranal/Makefile
508 portals/knals/ranal/autoMakefile
509 portals/knals/socknal/Makefile
510 portals/knals/socknal/autoMakefile
511 portals/libcfs/Makefile
512 portals/libcfs/autoMakefile
513 portals/portals/Makefile
514 portals/portals/autoMakefile
515 portals/router/Makefile
516 portals/router/autoMakefile
517 portals/tests/Makefile
518 portals/tests/autoMakefile
519 portals/unals/Makefile
520 portals/utils/Makefile