2 # LN_CONFIG_MAX_PAYLOAD
4 # configure maximum payload
6 AC_DEFUN([LN_CONFIG_MAX_PAYLOAD],
7 [AC_MSG_CHECKING([for non-default maximum LNET payload])
8 AC_ARG_WITH([max-payload-mb],
9 AC_HELP_STRING([--with-max-payload-mb=MBytes],
10 [set maximum lnet payload in MBytes]),
12 AC_MSG_RESULT([$with_max_payload_mb])
13 LNET_MAX_PAYLOAD_MB=$with_max_payload_mb
14 LNET_MAX_PAYLOAD="(($with_max_payload_mb)<<20)"
17 LNET_MAX_PAYLOAD="LNET_MTU"
19 AC_DEFINE_UNQUOTED(LNET_MAX_PAYLOAD, $LNET_MAX_PAYLOAD,
24 # LN_CHECK_GCC_VERSION
26 # Check compiler version
28 AC_DEFUN([LN_CHECK_GCC_VERSION],
29 [AC_MSG_CHECKING([compiler version])
30 PTL_CC_VERSION=`$CC --version | awk '/^gcc/{print $ 3}'`
31 PTL_MIN_CC_VERSION="3.2.2"
33 awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
35 if test -z "$PTL_CC_VERSION" -o \
36 `echo $PTL_CC_VERSION | v2n` -ge `echo $PTL_MIN_CC_VERSION | v2n`; then
39 AC_MSG_RESULT([Buggy compiler found])
40 AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
47 # check if zerocopy is available/wanted
49 AC_DEFUN([LN_CONFIG_ZEROCOPY],
50 [AC_ARG_ENABLE([zerocopy],
51 AC_HELP_STRING([--disable-zerocopy],
52 [disable socklnd zerocopy]),
53 [],[enable_zerocopy='yes'])
54 AC_MSG_CHECKING([for zero-copy TCP support])
55 if test x$enable_zerocopy = xno ; then
56 AC_MSG_RESULT([no (by request)])
58 ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
59 if test "$ZCCD" = 0 ; then
60 AC_MSG_RESULT([no (no kernel support)])
63 AC_MSG_CHECKING([for up-to-date tcp zero-copy patch])
64 LB_LINUX_TRY_COMPILE([
65 #include <linux/config.h>
66 #include <linux/kernel.h>
67 #include <linux/sched.h>
68 #include <linux/types.h>
70 #include <linux/string.h>
71 #include <linux/init.h>
72 #include <linux/errno.h>
73 #include <linux/interrupt.h>
74 #include <linux/netdevice.h>
75 #include <linux/skbuff.h>
79 return atomic_read(&zc.zccd_refcount);
82 AC_DEFINE(SOCKNAL_ZC, 1, [enable zero-copy support])
85 AC_MSG_ERROR([old TCP zero-copy in kernel (bug 10889) - use --disable-zerocopy to continue ])
94 # check if cpu affinity is available/wanted
96 AC_DEFUN([LN_CONFIG_AFFINITY],
97 [AC_ARG_ENABLE([affinity],
98 AC_HELP_STRING([--disable-affinity],
99 [disable process/irq affinity]),
100 [],[enable_affinity='yes'])
102 AC_MSG_CHECKING([for CPU affinity support])
103 if test x$enable_affinity = xno ; then
104 AC_MSG_RESULT([no (by request)])
106 LB_LINUX_TRY_COMPILE([
107 #include <linux/sched.h>
109 struct task_struct t;
115 set_cpus_allowed(&t, m);
117 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
120 AC_MSG_RESULT([no (no kernel support)])
128 # configure support for Portals
130 AC_DEFUN([LN_CONFIG_PORTALS],
131 [AC_MSG_CHECKING([for portals])
132 AC_ARG_WITH([portals],
133 AC_HELP_STRING([--with-portals=path],
134 [set path to portals]),
136 case $with_portals in
139 *) PORTALS="${with_portals}"
148 if test $ENABLEPORTALS -eq 0; then
150 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
152 AC_MSG_ERROR([bad --with-portals path])
154 AC_MSG_RESULT([$PORTALS])
155 PTLLNDCPPFLAGS="-I${PORTALS}/include"
157 AC_SUBST(PTLLNDCPPFLAGS)
163 # check if tunable tcp backoff is available/wanted
165 AC_DEFUN([LN_CONFIG_BACKOFF],
166 [AC_MSG_CHECKING([for tunable backoff TCP support])
167 AC_ARG_ENABLE([backoff],
168 AC_HELP_STRING([--disable-backoff],
169 [disable socknal tunable backoff]),
170 [],[enable_backoff='yes'])
171 if test x$enable_backoff = xno ; then
172 AC_MSG_RESULT([no (by request)])
174 BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
175 if test "$BOCD" != 0 ; then
176 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
179 AC_MSG_RESULT([no (no kernel support)])
185 # LN_CONFIG_PANIC_DUMPLOG
187 # check if tunable panic_dumplog is wanted
189 AC_DEFUN([LN_CONFIG_PANIC_DUMPLOG],
190 [AC_MSG_CHECKING([for tunable panic_dumplog support])
191 AC_ARG_ENABLE([panic_dumplog],
192 AC_HELP_STRING([--enable-panic_dumplog],
193 [enable panic_dumplog]),
194 [],[enable_panic_dumplog='no'])
195 if test x$enable_panic_dumplog = xyes ; then
196 AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])
197 AC_MSG_RESULT([yes (by request)])
206 # configure support for Portals LND
208 AC_DEFUN([LN_CONFIG_PTLLND],
210 if test -z "$ENABLEPORTALS"; then
214 AC_MSG_CHECKING([whether to build the kernel portals LND])
217 if test $ENABLEPORTALS -ne 0; then
229 # configure support for Portals LND
231 AC_DEFUN([LN_CONFIG_UPTLLND],
233 if test -z "$ENABLEPORTALS"; then
237 AC_MSG_CHECKING([whether to build the userspace portals LND])
240 if test $ENABLEPORTALS -ne 0; then
252 # configure support for userspace TCP/IP LND
254 AC_DEFUN([LN_CONFIG_USOCKLND],
255 [AC_MSG_CHECKING([whether to build usocklnd])
256 AC_ARG_ENABLE([usocklnd],
257 AC_HELP_STRING([--disable-usocklnd],
259 [],[enable_usocklnd='yes'])
261 if test x$enable_usocklnd = xyes ; then
262 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
266 AC_MSG_RESULT([no (libpthread not present or disabled)])
270 AC_MSG_RESULT([no (disabled explicitly)])
279 # check if quadrics support is in this kernel
281 AC_DEFUN([LN_CONFIG_QUADRICS],
282 [AC_MSG_CHECKING([for QsNet sources])
284 AC_HELP_STRING([--with-qsnet=path],
285 [set path to qsnet source (default=$LINUX)]),
288 AC_MSG_RESULT([$QSNET])
290 AC_MSG_CHECKING([if quadrics kernel headers are present])
291 if test -d $QSNET/drivers/net/qsnet ; then
294 AC_MSG_CHECKING([for multirail EKC])
295 if test -f $QSNET/include/elan/epcomms.h; then
296 AC_MSG_RESULT([supported])
297 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
299 AC_MSG_RESULT([not supported])
300 AC_MSG_ERROR([Need multirail EKC])
303 if test x$QSNET = x$LINUX ; then
304 LB_LINUX_CONFIG([QSNET],[],[
305 LB_LINUX_CONFIG([QSNET_MODULE],[],[
306 AC_MSG_WARN([QSNET is not enabled in this kernel; not building qswlnd.])
317 AC_SUBST(QSWCPPFLAGS)
324 # check if GM support is available
326 AC_DEFUN([LN_CONFIG_GM],[
327 AC_MSG_CHECKING([whether to enable GM support])
329 AC_HELP_STRING([--with-gm=path-to-gm-source-tree],
330 [build gmlnd against path]),
342 AC_ARG_WITH([gm-install],
343 AC_HELP_STRING([--with-gm-install=path-to-gm-install-tree],
344 [say where GM has been installed]),
346 GM_INSTALL=$with_gm_install
350 if test $ENABLE_GM -eq 0; then
356 GMCPPFLAGS="-I$GM_SRC/include -I$GM_SRC/drivers -I$GM_SRC/drivers/linux/gm"
358 if test -f $GM_INSTALL/lib/libgm.a -o \
359 -f $GM_INSTALL/lib64/libgm.a; then
360 GMLIBS="-L$GM_INSTALL/lib -L$GM_INSTALL/lib64"
362 AC_MSG_ERROR([Cant find GM libraries under $GM_INSTALL])
365 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
366 EXTRA_KCFLAGS="$GMCPPFLAGS -DGM_KERNEL $EXTRA_KCFLAGS"
368 AC_MSG_CHECKING([that code using GM compiles with given path])
369 LB_LINUX_TRY_COMPILE([
370 #define GM_STRONG_TYPES 1
375 #include "gm_internal.h"
377 struct gm_port *port = NULL;
378 gm_recv_event_t *rxevent = gm_blocking_receive_no_spin(port);
384 AC_MSG_ERROR([Bad --with-gm path])
387 AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
388 LB_LINUX_TRY_COMPILE([
389 #define GM_STRONG_TYPES 1
394 #include "gm_internal.h"
397 struct gm_port *port = NULL;
401 gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
407 Please patch the GM sources as follows...
409 patch -p0 < $PWD/lnet/klnds/gmlnd/gm-reg-phys.patch
410 ...then rebuild and re-install them])
411 AC_MSG_ERROR([Can't build GM without gm_register_memory_ex_phys()])
414 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
425 AC_DEFUN([LN_CONFIG_MX],
426 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
430 AC_HELP_STRING([--with-mx=path],
431 [build mxlnd against path]),
445 if test $ENABLEMX -eq 0; then
446 AC_MSG_RESULT([disabled])
447 elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
448 -f ${MXPATH}/include/mx_kernel_api.h -a \
449 -f ${MXPATH}/include/mx_pin.h \); then
453 2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
454 3) AC_MSG_ERROR([bad --with-mx path]);;
455 *) AC_MSG_ERROR([internal error]);;
458 MXCPPFLAGS="-I$MXPATH/include"
459 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
460 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
461 MXLIBS="-L$MXPATH/lib"
462 LB_LINUX_TRY_COMPILE([
464 #include <mx_extensions.h>
465 #include <myriexpress.h>
469 mx_request_t request;
473 mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
474 mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
475 mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
476 mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
485 2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
486 3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
487 *) AC_MSG_ERROR([internal error]);;
492 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
504 AC_DEFUN([LN_CONFIG_O2IB],[
505 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
507 O2IBPATH="$LINUX/drivers/infiniband"
509 AC_HELP_STRING([--with-o2ib=path],
510 [build o2iblnd against path]),
517 *) O2IBPATH=$with_o2ib
524 if test $ENABLEO2IB -eq 0; then
525 AC_MSG_RESULT([disabled])
526 elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
527 -f ${O2IBPATH}/include/rdma/ib_cm.h -a\
528 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\
529 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
533 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
534 3) AC_MSG_ERROR([bad --with-o2ib path]);;
535 *) AC_MSG_ERROR([internal error]);;
538 O2IBCPPFLAGS="-I$O2IBPATH/include"
539 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
540 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
541 LB_LINUX_TRY_COMPILE([
542 #include <linux/version.h>
546 #include <rdma/rdma_cm.h>
547 #include <rdma/ib_cm.h>
548 #include <rdma/ib_verbs.h>
549 #include <rdma/ib_fmr_pool.h>
551 struct rdma_cm_id *cm_id;
552 struct rdma_conn_param conn_param;
553 struct ib_device_attr device_attr;
554 struct ib_qp_attr qp_attr;
555 struct ib_pool_fmr pool_fmr;
556 enum ib_cm_rej_reason rej_reason;
558 cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
559 return PTR_ERR(cm_id);
567 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
568 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
569 *) AC_MSG_ERROR([internal error]);;
574 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
576 AC_SUBST(O2IBCPPFLAGS)
583 # check for OpenIB in the kernel
584 AC_DEFUN([LN_CONFIG_OPENIB],[
585 AC_MSG_CHECKING([whether to enable OpenIB support])
587 OPENIBPATH="$LINUX/drivers/infiniband"
588 AC_ARG_WITH([openib],
589 AC_HELP_STRING([--with-openib=path],
590 [build openiblnd against path]),
597 *) OPENIBPATH="$with_openib"
604 if test $ENABLEOPENIB -eq 0; then
605 AC_MSG_RESULT([disabled])
606 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
607 -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
608 -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
610 case $ENABLEOPENIB in
612 2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
613 3) AC_MSG_ERROR([bad --with-openib path]);;
614 *) AC_MSG_ERROR([internal error]);;
617 case $ENABLEOPENIB in
618 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
619 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
620 *) AC_MSG_RESULT([no])
621 AC_MSG_ERROR([internal error]);;
623 OPENIBCPPFLAGS="$OPENIBCPPFLAGS -DIB_NTXRXPARAMS=4"
624 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
625 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
626 LB_LINUX_TRY_COMPILE([
627 #include <ts_ib_core.h>
628 #include <ts_ib_cm.h>
629 #include <ts_ib_sa_client.h>
631 struct ib_device_properties dev_props;
632 struct ib_cm_active_param cm_active_params;
633 tTS_IB_CLIENT_QUERY_TID tid;
634 int enum1 = IB_QP_ATTRIBUTE_STATE;
635 int enum2 = IB_ACCESS_LOCAL_WRITE;
636 int enum3 = IB_CQ_CALLBACK_INTERRUPT;
637 int enum4 = IB_CQ_PROVIDER_REARM;
641 OPENIBLND="openiblnd"
644 case $ENABLEOPENIB in
646 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
647 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
648 *) AC_MSG_ERROR([internal error]);;
653 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
655 AC_SUBST(OPENIBCPPFLAGS)
662 AC_DEFUN([LN_CONFIG_CIB],[
663 AC_MSG_CHECKING([whether to enable Cisco/TopSpin IB support])
668 AC_HELP_STRING([--with-cib=path],
669 [build ciblnd against path]),
672 no) AC_MSG_RESULT([no]);;
673 *) CIBPATH="$with_cib"
674 if test -d "$CIBPATH"; then
678 AC_MSG_ERROR([No directory $CIBPATH])
684 if test -n "$CIBPATH"; then
685 CIBCPPFLAGS="-I${CIBPATH}/ib/ts_api_ng/include -I${CIBPATH}/all/kernel_services/include -DUSING_TSAPI"
686 CIBCPPFLAGS="$CIBCPPFLAGS -DIB_NTXRXPARAMS=3"
687 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
688 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $CIBCPPFLAGS"
689 LB_LINUX_TRY_COMPILE([
690 #include <ts_ib_core.h>
691 #include <ts_ib_cm.h>
692 #include <ts_ib_sa_client.h>
694 struct ib_device_properties dev_props;
695 struct ib_cm_active_param cm_active_params;
696 tTS_IB_CLIENT_QUERY_TID tid;
697 int enum1 = TS_IB_QP_ATTRIBUTE_STATE;
698 int enum2 = TS_IB_ACCESS_LOCAL_WRITE;
699 int enum3 = TS_IB_CQ_CALLBACK_INTERRUPT;
700 int enum4 = TS_IB_CQ_PROVIDER_REARM;
705 AC_MSG_ERROR([can't compile ciblnd with given path])
708 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
710 AC_SUBST(CIBCPPFLAGS)
717 # check for infinicon infiniband support
719 AC_DEFUN([LN_CONFIG_IIB],[
720 AC_MSG_CHECKING([whether to enable Infinicon support])
722 IIBPATH="/usr/include"
724 AC_HELP_STRING([--with-iib=path],
725 [build iiblnd against path]),
732 *) IIBPATH="${with_iib}/include"
739 if test $ENABLEIIB -eq 0; then
740 AC_MSG_RESULT([disabled])
741 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
745 2) AC_MSG_ERROR([default Infinicon headers not present]);;
746 3) AC_MSG_ERROR([bad --with-iib path]);;
747 *) AC_MSG_ERROR([internal error]);;
750 IIBCPPFLAGS="-I$IIBPATH"
751 if test $IIBPATH != "/usr/include"; then
752 # we need /usr/include come what may
753 IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include"
755 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
756 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
757 LB_LINUX_TRY_COMPILE([
758 #include <linux/iba/ibt.h>
760 IBT_INTERFACE_UNION interfaces;
763 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
766 return rc == FSUCCESS ? 0 : 1;
774 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);;
775 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);;
776 *) AC_MSG_ERROR([internal error]);;
781 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
783 AC_SUBST(IIBCPPFLAGS)
790 # check for Voltaire infiniband support
792 AC_DEFUN([LN_CONFIG_VIB],
793 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
796 AC_HELP_STRING([--with-vib=path],
797 [build viblnd against path]),
800 no) AC_MSG_RESULT([no]);;
801 *) VIBPATH="${with_vib}/src/nvigor/ib-code"
802 if test -d "$with_vib" -a -d "$VIBPATH"; then
806 AC_MSG_ERROR([No directory $VIBPATH])
812 if test -z "$VIBPATH"; then
815 VIBCPPFLAGS="-I${VIBPATH}/include -I${VIBPATH}/cm"
816 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
817 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
818 LB_LINUX_TRY_COMPILE([
819 #include <linux/list.h>
820 #include <asm/byteorder.h>
825 #ifdef __LITTLE_ENDIAN
836 ibat_arp_data_t arp_data;
839 vvrc = vv_hca_open("ANY_HCA", NULL, &kib_hca);
840 cep = cm_create_cep(cm_cep_transp_rc);
841 ibatrc = ibat_get_ib_data((uint32_t)0, (uint32_t)0,
842 ibat_paths_primary, &arp_data,
843 (ibat_get_ib_data_reply_fn_t)NULL,
849 AC_MSG_ERROR([can't compile viblnd with given path])
851 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
853 if test -n "$VIBLND"; then
854 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
855 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
856 AC_MSG_CHECKING([if Voltaire still uses void * sg addresses])
857 LB_LINUX_TRY_COMPILE([
858 #include <linux/list.h>
859 #include <asm/byteorder.h>
864 #ifdef __LITTLE_ENDIAN
874 return &sg.v_address[3] == NULL;
877 VIBCPPFLAGS="$VIBCPPFLAGS -DIBNAL_VOIDSTAR_SGADDR=1"
881 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
883 AC_SUBST(VIBCPPFLAGS)
890 # check whether to use the RapidArray lnd
892 AC_DEFUN([LN_CONFIG_RALND],
894 AC_MSG_CHECKING([if RapidArray kernel headers are present])
896 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
897 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
898 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
899 LB_LINUX_TRY_COMPILE([
900 #include <linux/types.h>
904 RAP_PVOID dev_handle;
906 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
908 return rc == RAP_SUCCESS ? 0 : 1;
917 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
923 # LN_STRUCT_PAGE_LIST
925 # 2.6.4 no longer has page->list
927 AC_DEFUN([LN_STRUCT_PAGE_LIST],
928 [AC_MSG_CHECKING([if struct page has a list field])
929 LB_LINUX_TRY_COMPILE([
930 #include <linux/mm.h>
936 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
945 # red hat 2.4 adds sighand to struct task_struct
947 AC_DEFUN([LN_STRUCT_SIGHAND],
948 [AC_MSG_CHECKING([if task_struct has a sighand field])
949 LB_LINUX_TRY_COMPILE([
950 #include <linux/sched.h>
952 struct task_struct p;
955 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
965 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
967 AC_DEFUN([LN_FUNC_CPU_ONLINE],
968 [AC_MSG_CHECKING([if kernel defines cpu_online()])
969 LB_LINUX_TRY_COMPILE([
970 #include <linux/sched.h>
975 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
984 # check if gfp_t is typedef-ed
986 AC_DEFUN([LN_TYPE_GFP_T],
987 [AC_MSG_CHECKING([if kernel defines gfp_t])
988 LB_LINUX_TRY_COMPILE([
989 #include <linux/gfp.h>
991 return sizeof(gfp_t);
994 AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
1003 # same goes for cpumask_t
1005 AC_DEFUN([LN_TYPE_CPUMASK_T],
1006 [AC_MSG_CHECKING([if kernel defines cpumask_t])
1007 LB_LINUX_TRY_COMPILE([
1008 #include <linux/sched.h>
1010 return sizeof (cpumask_t);
1012 AC_MSG_RESULT([yes])
1013 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
1022 # we export show_task(), but not all kernels have it (yet)
1024 AC_DEFUN([LN_FUNC_SHOW_TASK],
1025 [AC_MSG_CHECKING([if kernel exports show_task])
1027 for file in ksyms sched ; do
1028 if grep -q "EXPORT_SYMBOL(show_task)" \
1029 "$LINUX/kernel/$file.c" 2>/dev/null ; then
1034 if test x$have_show_task = x1 ; then
1035 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
1036 AC_MSG_RESULT([yes])
1043 # 2.6.18 remove tasklist_lock export
1044 AC_DEFUN([LN_TASKLIST_LOCK],
1045 [AC_MSG_CHECKING([kernel export tasklist_lock])
1046 if grep -q "EXPORT_SYMBOL(tasklist_lock)" \
1047 "$LINUX/kernel/fork.c" 2>/dev/null ; then
1048 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
1049 [tasklist_lock exported])
1050 AC_MSG_RESULT([yes])
1056 # 2.6.19 API changes
1057 # kmem_cache_destroy(cachep) return void instead of
1059 AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT],
1060 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
1061 LB_LINUX_TRY_COMPILE([
1062 #include <linux/slab.h>
1064 int i = kmem_cache_destroy(NULL);
1067 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
1068 [kmem_cache_destroy(cachep) return int])
1075 #panic_notifier_list use atomic_notifier operations
1077 AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER],
1078 [AC_MSG_CHECKING([panic_notifier_list is atomic])
1079 LB_LINUX_TRY_COMPILE([
1080 #include <linux/notifier.h>
1081 #include <linux/kernel.h>
1083 struct atomic_notifier_head panic_notifier_list;
1086 AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
1087 [panic_notifier_list is atomic_notifier_head])
1096 # LNet linux kernel checks
1098 AC_DEFUN([LN_PROG_LINUX],
1105 LN_CONFIG_PANIC_DUMPLOG
1123 LN_KMEM_CACHE_DESTROY_INT
1124 LN_ATOMIC_PANIC_NOTIFIER
1132 AC_DEFUN([LN_PROG_DARWIN],
1133 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
1139 # default paths for installed files
1141 AC_DEFUN([LN_PATH_DEFAULTS],
1148 # other configure checks
1150 AC_DEFUN([LN_CONFIGURE],
1151 [# lnet/utils/portals.c
1152 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
1153 AC_CHECK_FUNCS([gethostbyname socket connect])
1155 # lnet/utils/debug.c
1156 AC_CHECK_HEADERS([linux/version.h])
1158 AC_CHECK_TYPE([spinlock_t],
1159 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
1161 [#include <linux/spinlock.h>])
1163 # lnet/utils/wirecheck.c
1164 AC_CHECK_FUNCS([strnlen])
1166 # -------- Check for required packages --------------
1169 # LC_CONFIG_READLINE
1171 # Build with readline
1173 AC_MSG_CHECKING([whether to enable readline support])
1174 AC_ARG_ENABLE(readline,
1175 AC_HELP_STRING([--disable-readline],
1176 [disable readline support]),
1177 [],[enable_readline='yes'])
1178 AC_MSG_RESULT([$enable_readline])
1180 # -------- check for readline if enabled ----
1181 if test x$enable_readline = xyes ; then
1183 LIBS="-lncurses $LIBS"
1184 AC_CHECK_LIB([readline],[readline],[
1185 LIBREADLINE="-lreadline -lncurses"
1186 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
1194 AC_SUBST(LIBREADLINE)
1196 AC_MSG_CHECKING([if efence debugging support is requested])
1197 AC_ARG_ENABLE(efence,
1198 AC_HELP_STRING([--enable-efence],
1199 [use efence library]),
1200 [],[enable_efence='no'])
1201 AC_MSG_RESULT([$enable_efence])
1202 if test "$enable_efence" = "yes" ; then
1203 LIBEFENCE="-lefence"
1204 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
1210 # -------- enable acceptor libwrap (TCP wrappers) support? -------
1211 AC_MSG_CHECKING([if libwrap support is requested])
1212 AC_ARG_ENABLE([libwrap],
1213 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
1214 [case "${enableval}" in
1215 yes) enable_libwrap=yes ;;
1216 no) enable_libwrap=no ;;
1217 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
1218 esac],[enable_libwrap=no])
1219 AC_MSG_RESULT([$enable_libwrap])
1220 if test x$enable_libwrap = xyes ; then
1222 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
1228 # -------- check for -lpthread support ----
1229 AC_MSG_CHECKING([whether to use libpthread for lnet library])
1230 AC_ARG_ENABLE([libpthread],
1231 AC_HELP_STRING([--disable-libpthread],
1232 [disable libpthread]),
1233 [],[enable_libpthread=yes])
1234 if test "$enable_libpthread" = "yes" ; then
1235 AC_CHECK_LIB([pthread], [pthread_create],
1236 [ENABLE_LIBPTHREAD="yes"],
1237 [ENABLE_LIBPTHREAD="no"])
1238 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
1239 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
1240 PTHREAD_LIBS="-lpthread"
1241 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
1244 AC_MSG_RESULT([no libpthread is found])
1246 AC_SUBST(PTHREAD_LIBS)
1248 AC_MSG_RESULT([no (disabled explicitly)])
1249 ENABLE_LIBPTHREAD="no"
1251 AC_SUBST(ENABLE_LIBPTHREAD)
1253 # ----------------------------------------
1254 # some tests for catamount-like systems
1255 # ----------------------------------------
1256 AC_ARG_ENABLE([sysio_init],
1257 AC_HELP_STRING([--disable-sysio-init],
1258 [call sysio init functions when initializing liblustre]),
1259 [],[enable_sysio_init=yes])
1260 AC_MSG_CHECKING([whether to initialize libsysio])
1261 AC_MSG_RESULT([$enable_sysio_init])
1262 if test x$enable_sysio_init != xno ; then
1263 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
1266 AC_ARG_ENABLE([urandom],
1267 AC_HELP_STRING([--disable-urandom],
1268 [disable use of /dev/urandom for liblustre]),
1269 [],[enable_urandom=yes])
1270 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
1271 AC_MSG_RESULT([$enable_urandom])
1272 if test x$enable_urandom != xno ; then
1273 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
1276 # -------- check for -lcap support ----
1277 if test x$enable_liblustre = xyes ; then
1278 AC_CHECK_LIB([cap], [cap_get_proc],
1281 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
1290 LN_CONFIG_MAX_PAYLOAD
1298 # AM_CONDITOINAL defines for lnet
1300 AC_DEFUN([LN_CONDITIONALS],
1301 [AM_CONDITIONAL(BUILD_QSWLND, test x$QSWLND = "xqswlnd")
1302 AM_CONDITIONAL(BUILD_GMLND, test x$GMLND = "xgmlnd")
1303 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
1304 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1305 AM_CONDITIONAL(BUILD_OPENIBLND, test x$OPENIBLND = "xopeniblnd")
1306 AM_CONDITIONAL(BUILD_CIBLND, test x$CIBLND = "xciblnd")
1307 AM_CONDITIONAL(BUILD_IIBLND, test x$IIBLND = "xiiblnd")
1308 AM_CONDITIONAL(BUILD_VIBLND, test x$VIBLND = "xviblnd")
1309 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
1310 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
1311 AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
1312 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
1318 # files that should be generated with AC_OUTPUT
1320 AC_DEFUN([LN_CONFIG_FILES],
1325 lnet/autoconf/Makefile
1327 lnet/include/Makefile
1328 lnet/include/libcfs/Makefile
1329 lnet/include/libcfs/linux/Makefile
1330 lnet/include/lnet/Makefile
1331 lnet/include/lnet/linux/Makefile
1333 lnet/klnds/autoMakefile
1334 lnet/klnds/gmlnd/Makefile
1335 lnet/klnds/mxlnd/autoMakefile
1336 lnet/klnds/mxlnd/Makefile
1337 lnet/klnds/gmlnd/autoMakefile
1338 lnet/klnds/openiblnd/Makefile
1339 lnet/klnds/openiblnd/autoMakefile
1340 lnet/klnds/o2iblnd/Makefile
1341 lnet/klnds/o2iblnd/autoMakefile
1342 lnet/klnds/ciblnd/Makefile
1343 lnet/klnds/ciblnd/autoMakefile
1344 lnet/klnds/iiblnd/Makefile
1345 lnet/klnds/iiblnd/autoMakefile
1346 lnet/klnds/viblnd/Makefile
1347 lnet/klnds/viblnd/autoMakefile
1348 lnet/klnds/qswlnd/Makefile
1349 lnet/klnds/qswlnd/autoMakefile
1350 lnet/klnds/ralnd/Makefile
1351 lnet/klnds/ralnd/autoMakefile
1352 lnet/klnds/socklnd/Makefile
1353 lnet/klnds/socklnd/autoMakefile
1354 lnet/klnds/ptllnd/Makefile
1355 lnet/klnds/ptllnd/autoMakefile
1356 lnet/libcfs/Makefile
1357 lnet/libcfs/autoMakefile
1358 lnet/libcfs/linux/Makefile
1360 lnet/lnet/autoMakefile
1362 lnet/tests/autoMakefile
1364 lnet/ulnds/autoMakefile
1365 lnet/ulnds/socklnd/Makefile
1366 lnet/ulnds/ptllnd/Makefile
1369 case $lb_target_os in
1372 lnet/include/libcfs/darwin/Makefile
1373 lnet/include/lnet/darwin/Makefile
1374 lnet/libcfs/darwin/Makefile