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 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
49 AC_DEFUN([LC_CONFIG_CDEBUG],
51 AC_MSG_CHECKING([whether to disable CDEBUG, CWARN, etc.])
52 AC_ARG_ENABLE([libcfs_cdebug],
53 AC_HELP_STRING([--disable-libcfs-cdebug],
54 [disable libcfs CDEBUG, CWARN]),
55 [],[disable_libcfs_cdebug='no'])
56 AC_MSG_RESULT([$disable_libcfs_cdebug])
57 if test x$disable_libcfs_cdebug != xno; then
58 AC_DEFINE(CDEBUG_ENABLED, 0, [disable libcfs CDEBUG, CWARN])
60 AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])
63 AC_MSG_CHECKING([whether to enable ENTRY/EXIT])
64 AC_ARG_ENABLE([libcfs_trace],
65 AC_HELP_STRING([--enable-libcfs-trace],
66 [enable libcfs ENTRY/EXIT]),
67 [],[enable_libcfs_trace='no'])
68 AC_MSG_RESULT([$enable_libcfs_trace])
69 if test x$enable_libcfs_trace != xno; then
70 AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])
72 AC_DEFINE(CDEBUG_ENTRY_EXIT, 0, [disable libcfs ENTRY/EXIT])
75 AC_MSG_CHECKING([whether to disable LASSERT, LASSERTF])
76 AC_ARG_ENABLE([libcfs_assert],
77 AC_HELP_STRING([--disable-libcfs-assert],
78 [disable libcfs LASSERT, LASSERTF]),
79 [],[disable_libcfs_assert='no'])
80 AC_MSG_RESULT([$disable_libcfs_assert])
81 if test x$disable_libcfs_assert != xno; then
82 AC_DEFINE(LIBCFS_DEBUG, 0, [disable libcfs LASSERT, LASSERTF])
84 AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])
91 # check if cpu affinity is available/wanted
93 AC_DEFUN([LN_CONFIG_AFFINITY],
94 [AC_ARG_ENABLE([affinity],
95 AC_HELP_STRING([--disable-affinity],
96 [disable process/irq affinity]),
97 [],[enable_affinity='yes'])
99 AC_MSG_CHECKING([for CPU affinity support])
100 if test x$enable_affinity = xno ; then
101 AC_MSG_RESULT([no (by request)])
103 LB_LINUX_TRY_COMPILE([
104 #include <linux/sched.h>
106 struct task_struct t;
112 set_cpus_allowed(&t, m);
114 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
117 AC_MSG_RESULT([no (no kernel support)])
125 # configure support for Portals
127 AC_DEFUN([LN_CONFIG_PORTALS],
128 [AC_MSG_CHECKING([for portals])
129 AC_ARG_WITH([portals],
130 AC_HELP_STRING([--with-portals=path],
131 [set path to portals]),
133 case $with_portals in
136 *) PORTALS="${with_portals}"
145 if test $ENABLEPORTALS -eq 0; then
147 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
149 AC_MSG_ERROR([bad --with-portals path])
151 AC_MSG_RESULT([$PORTALS])
152 PTLLNDCPPFLAGS="-I${PORTALS}/include"
154 AC_SUBST(PTLLNDCPPFLAGS)
160 # check if tunable tcp backoff is available/wanted
162 AC_DEFUN([LN_CONFIG_BACKOFF],
163 [AC_MSG_CHECKING([for tunable backoff TCP support])
164 AC_ARG_ENABLE([backoff],
165 AC_HELP_STRING([--disable-backoff],
166 [disable socknal tunable backoff]),
167 [],[enable_backoff='yes'])
168 if test x$enable_backoff = xno ; then
169 AC_MSG_RESULT([no (by request)])
171 BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
172 if test "$BOCD" != 0 ; then
173 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
176 AC_MSG_RESULT([no (no kernel support)])
182 # LN_CONFIG_PANIC_DUMPLOG
184 # check if tunable panic_dumplog is wanted
186 AC_DEFUN([LN_CONFIG_PANIC_DUMPLOG],
187 [AC_MSG_CHECKING([for tunable panic_dumplog support])
188 AC_ARG_ENABLE([panic_dumplog],
189 AC_HELP_STRING([--enable-panic_dumplog],
190 [enable panic_dumplog]),
191 [],[enable_panic_dumplog='no'])
192 if test x$enable_panic_dumplog = xyes ; then
193 AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])
194 AC_MSG_RESULT([yes (by request)])
203 # configure support for Portals LND
205 AC_DEFUN([LN_CONFIG_PTLLND],
207 if test -z "$ENABLEPORTALS"; then
211 AC_MSG_CHECKING([whether to build the kernel portals LND])
214 if test $ENABLEPORTALS -ne 0; then
226 # configure support for Portals LND
228 AC_DEFUN([LN_CONFIG_UPTLLND],
230 if test -z "$ENABLEPORTALS"; then
234 AC_MSG_CHECKING([whether to build the userspace portals LND])
237 if test $ENABLEPORTALS -ne 0; then
249 # configure support for userspace TCP/IP LND
251 AC_DEFUN([LN_CONFIG_USOCKLND],
252 [AC_MSG_CHECKING([whether to build usocklnd])
253 AC_ARG_ENABLE([usocklnd],
254 AC_HELP_STRING([--disable-usocklnd],
256 [],[enable_usocklnd='yes'])
258 if test x$enable_usocklnd = xyes ; then
259 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
263 AC_MSG_RESULT([no (libpthread not present or disabled)])
267 AC_MSG_RESULT([no (disabled explicitly)])
276 # check if quadrics support is in this kernel
278 AC_DEFUN([LN_CONFIG_QUADRICS],
279 [AC_MSG_CHECKING([for QsNet sources])
281 AC_HELP_STRING([--with-qsnet=path],
282 [set path to qsnet source (default=$LINUX)]),
285 AC_MSG_RESULT([$QSNET])
287 AC_MSG_CHECKING([if quadrics kernel headers are present])
288 if test -d $QSNET/drivers/net/qsnet ; then
291 AC_MSG_CHECKING([for multirail EKC])
292 if test -f $QSNET/include/elan/epcomms.h; then
293 AC_MSG_RESULT([supported])
294 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
296 AC_MSG_RESULT([not supported])
297 AC_MSG_ERROR([Need multirail EKC])
300 if test x$QSNET = x$LINUX ; then
301 LB_LINUX_CONFIG([QSNET],[],[
302 LB_LINUX_CONFIG([QSNET_MODULE],[],[
303 AC_MSG_WARN([QSNET is not enabled in this kernel; not building qswlnd.])
314 AC_SUBST(QSWCPPFLAGS)
321 # check if GM support is available
323 AC_DEFUN([LN_CONFIG_GM],[
324 AC_MSG_CHECKING([whether to enable GM support])
326 AC_HELP_STRING([--with-gm=path-to-gm-source-tree],
327 [build gmlnd against path]),
339 AC_ARG_WITH([gm-install],
340 AC_HELP_STRING([--with-gm-install=path-to-gm-install-tree],
341 [say where GM has been installed]),
343 GM_INSTALL=$with_gm_install
347 if test $ENABLE_GM -eq 0; then
353 GMCPPFLAGS="-I$GM_SRC/include -I$GM_SRC/drivers -I$GM_SRC/drivers/linux/gm"
355 if test -f $GM_INSTALL/lib/libgm.a -o \
356 -f $GM_INSTALL/lib64/libgm.a; then
357 GMLIBS="-L$GM_INSTALL/lib -L$GM_INSTALL/lib64"
359 AC_MSG_ERROR([Cant find GM libraries under $GM_INSTALL])
362 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
363 EXTRA_KCFLAGS="$GMCPPFLAGS -DGM_KERNEL $EXTRA_KCFLAGS"
365 AC_MSG_CHECKING([that code using GM compiles with given path])
366 LB_LINUX_TRY_COMPILE([
367 #define GM_STRONG_TYPES 1
372 #include "gm_internal.h"
374 struct gm_port *port = NULL;
375 gm_recv_event_t *rxevent = gm_blocking_receive_no_spin(port);
381 AC_MSG_ERROR([Bad --with-gm path])
384 AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
385 LB_LINUX_TRY_COMPILE([
386 #define GM_STRONG_TYPES 1
391 #include "gm_internal.h"
394 struct gm_port *port = NULL;
398 gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
404 Please patch the GM sources as follows...
406 patch -p0 < $PWD/lnet/klnds/gmlnd/gm-reg-phys.patch
407 ...then rebuild and re-install them])
408 AC_MSG_ERROR([Can't build GM without gm_register_memory_ex_phys()])
411 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
422 AC_DEFUN([LN_CONFIG_MX],
423 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
427 AC_HELP_STRING([--with-mx=path],
428 [build mxlnd against path]),
442 if test $ENABLEMX -eq 0; then
443 AC_MSG_RESULT([disabled])
444 elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
445 -f ${MXPATH}/include/mx_kernel_api.h -a \
446 -f ${MXPATH}/include/mx_pin.h \); then
450 2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
451 3) AC_MSG_ERROR([bad --with-mx path]);;
452 *) AC_MSG_ERROR([internal error]);;
455 MXCPPFLAGS="-I$MXPATH/include"
456 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
457 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
458 MXLIBS="-L$MXPATH/lib"
459 LB_LINUX_TRY_COMPILE([
461 #include <mx_extensions.h>
462 #include <myriexpress.h>
466 mx_request_t request;
470 mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
471 mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
472 mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
473 mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
482 2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
483 3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
484 *) AC_MSG_ERROR([internal error]);;
489 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
501 AC_DEFUN([LN_CONFIG_O2IB],[
502 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
504 O2IBPATH="$LINUX/drivers/infiniband"
506 AC_HELP_STRING([--with-o2ib=path],
507 [build o2iblnd against path]),
514 *) O2IBPATH=$with_o2ib
521 if test $ENABLEO2IB -eq 0; then
522 AC_MSG_RESULT([disabled])
523 elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
524 -f ${O2IBPATH}/include/rdma/ib_cm.h -a\
525 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\
526 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
530 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
531 3) AC_MSG_ERROR([bad --with-o2ib path]);;
532 *) AC_MSG_ERROR([internal error]);;
535 O2IBCPPFLAGS="-I$O2IBPATH/include"
536 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
537 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
538 LB_LINUX_TRY_COMPILE([
539 #include <linux/version.h>
543 #include <rdma/rdma_cm.h>
544 #include <rdma/ib_cm.h>
545 #include <rdma/ib_verbs.h>
546 #include <rdma/ib_fmr_pool.h>
548 struct rdma_cm_id *cm_id;
549 struct rdma_conn_param conn_param;
550 struct ib_device_attr device_attr;
551 struct ib_qp_attr qp_attr;
552 struct ib_pool_fmr pool_fmr;
553 enum ib_cm_rej_reason rej_reason;
555 cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
556 return PTR_ERR(cm_id);
564 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
565 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
566 *) AC_MSG_ERROR([internal error]);;
571 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
573 AC_SUBST(O2IBCPPFLAGS)
580 # check for OpenIB in the kernel
581 AC_DEFUN([LN_CONFIG_OPENIB],[
582 AC_MSG_CHECKING([whether to enable OpenIB support])
584 OPENIBPATH="$LINUX/drivers/infiniband"
585 AC_ARG_WITH([openib],
586 AC_HELP_STRING([--with-openib=path],
587 [build openiblnd against path]),
594 *) OPENIBPATH="$with_openib"
601 if test $ENABLEOPENIB -eq 0; then
602 AC_MSG_RESULT([disabled])
603 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
604 -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
605 -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
607 case $ENABLEOPENIB in
609 2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
610 3) AC_MSG_ERROR([bad --with-openib path]);;
611 *) AC_MSG_ERROR([internal error]);;
614 case $ENABLEOPENIB in
615 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
616 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
617 *) AC_MSG_RESULT([no])
618 AC_MSG_ERROR([internal error]);;
620 OPENIBCPPFLAGS="$OPENIBCPPFLAGS -DIB_NTXRXPARAMS=4"
621 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
622 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
623 LB_LINUX_TRY_COMPILE([
624 #include <ts_ib_core.h>
625 #include <ts_ib_cm.h>
626 #include <ts_ib_sa_client.h>
628 struct ib_device_properties dev_props;
629 struct ib_cm_active_param cm_active_params;
630 tTS_IB_CLIENT_QUERY_TID tid;
631 int enum1 = IB_QP_ATTRIBUTE_STATE;
632 int enum2 = IB_ACCESS_LOCAL_WRITE;
633 int enum3 = IB_CQ_CALLBACK_INTERRUPT;
634 int enum4 = IB_CQ_PROVIDER_REARM;
638 OPENIBLND="openiblnd"
641 case $ENABLEOPENIB in
643 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
644 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
645 *) AC_MSG_ERROR([internal error]);;
650 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
652 AC_SUBST(OPENIBCPPFLAGS)
659 AC_DEFUN([LN_CONFIG_CIB],[
660 AC_MSG_CHECKING([whether to enable Cisco/TopSpin IB support])
665 AC_HELP_STRING([--with-cib=path],
666 [build ciblnd against path]),
669 no) AC_MSG_RESULT([no]);;
670 *) CIBPATH="$with_cib"
671 if test -d "$CIBPATH"; then
675 AC_MSG_ERROR([No directory $CIBPATH])
681 if test -n "$CIBPATH"; then
682 CIBCPPFLAGS="-I${CIBPATH}/ib/ts_api_ng/include -I${CIBPATH}/all/kernel_services/include -DUSING_TSAPI"
683 CIBCPPFLAGS="$CIBCPPFLAGS -DIB_NTXRXPARAMS=3"
684 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
685 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $CIBCPPFLAGS"
686 LB_LINUX_TRY_COMPILE([
687 #include <ts_ib_core.h>
688 #include <ts_ib_cm.h>
689 #include <ts_ib_sa_client.h>
691 struct ib_device_properties dev_props;
692 struct ib_cm_active_param cm_active_params;
693 tTS_IB_CLIENT_QUERY_TID tid;
694 int enum1 = TS_IB_QP_ATTRIBUTE_STATE;
695 int enum2 = TS_IB_ACCESS_LOCAL_WRITE;
696 int enum3 = TS_IB_CQ_CALLBACK_INTERRUPT;
697 int enum4 = TS_IB_CQ_PROVIDER_REARM;
702 AC_MSG_ERROR([can't compile ciblnd with given path])
705 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
707 AC_SUBST(CIBCPPFLAGS)
714 # check for infinicon infiniband support
716 AC_DEFUN([LN_CONFIG_IIB],[
717 AC_MSG_CHECKING([whether to enable Infinicon support])
719 IIBPATH="/usr/include"
721 AC_HELP_STRING([--with-iib=path],
722 [build iiblnd against path]),
729 *) IIBPATH="${with_iib}/include"
736 if test $ENABLEIIB -eq 0; then
737 AC_MSG_RESULT([disabled])
738 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
742 2) AC_MSG_ERROR([default Infinicon headers not present]);;
743 3) AC_MSG_ERROR([bad --with-iib path]);;
744 *) AC_MSG_ERROR([internal error]);;
747 IIBCPPFLAGS="-I$IIBPATH"
748 if test $IIBPATH != "/usr/include"; then
749 # we need /usr/include come what may
750 IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include"
752 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
753 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
754 LB_LINUX_TRY_COMPILE([
755 #include <linux/iba/ibt.h>
757 IBT_INTERFACE_UNION interfaces;
760 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
763 return rc == FSUCCESS ? 0 : 1;
771 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);;
772 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);;
773 *) AC_MSG_ERROR([internal error]);;
778 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
780 AC_SUBST(IIBCPPFLAGS)
787 # check for Voltaire infiniband support
789 AC_DEFUN([LN_CONFIG_VIB],
790 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
793 AC_HELP_STRING([--with-vib=path],
794 [build viblnd against path]),
797 no) AC_MSG_RESULT([no]);;
798 *) VIBPATH="${with_vib}/src/nvigor/ib-code"
799 if test -d "$with_vib" -a -d "$VIBPATH"; then
803 AC_MSG_ERROR([No directory $VIBPATH])
809 if test -z "$VIBPATH"; then
812 VIBCPPFLAGS="-I${VIBPATH}/include -I${VIBPATH}/cm"
813 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
814 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
815 LB_LINUX_TRY_COMPILE([
816 #include <linux/list.h>
817 #include <asm/byteorder.h>
822 #ifdef __LITTLE_ENDIAN
833 ibat_arp_data_t arp_data;
836 vvrc = vv_hca_open("ANY_HCA", NULL, &kib_hca);
837 cep = cm_create_cep(cm_cep_transp_rc);
838 ibatrc = ibat_get_ib_data((uint32_t)0, (uint32_t)0,
839 ibat_paths_primary, &arp_data,
840 (ibat_get_ib_data_reply_fn_t)NULL,
846 AC_MSG_ERROR([can't compile viblnd with given path])
848 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
850 if test -n "$VIBLND"; then
851 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
852 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
853 AC_MSG_CHECKING([if Voltaire still uses void * sg addresses])
854 LB_LINUX_TRY_COMPILE([
855 #include <linux/list.h>
856 #include <asm/byteorder.h>
861 #ifdef __LITTLE_ENDIAN
871 return &sg.v_address[3] == NULL;
874 VIBCPPFLAGS="$VIBCPPFLAGS -DIBNAL_VOIDSTAR_SGADDR=1"
878 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
880 AC_SUBST(VIBCPPFLAGS)
887 # check whether to use the RapidArray lnd
889 AC_DEFUN([LN_CONFIG_RALND],
891 AC_MSG_CHECKING([if RapidArray kernel headers are present])
893 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
894 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
895 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
896 LB_LINUX_TRY_COMPILE([
897 #include <linux/types.h>
901 RAP_PVOID dev_handle;
903 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
905 return rc == RAP_SUCCESS ? 0 : 1;
914 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
920 # LN_STRUCT_PAGE_LIST
922 # 2.6.4 no longer has page->list
924 AC_DEFUN([LN_STRUCT_PAGE_LIST],
925 [AC_MSG_CHECKING([if struct page has a list field])
926 LB_LINUX_TRY_COMPILE([
927 #include <linux/mm.h>
933 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
942 # red hat 2.4 adds sighand to struct task_struct
944 AC_DEFUN([LN_STRUCT_SIGHAND],
945 [AC_MSG_CHECKING([if task_struct has a sighand field])
946 LB_LINUX_TRY_COMPILE([
947 #include <linux/sched.h>
949 struct task_struct p;
952 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
962 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
964 AC_DEFUN([LN_FUNC_CPU_ONLINE],
965 [AC_MSG_CHECKING([if kernel defines cpu_online()])
966 LB_LINUX_TRY_COMPILE([
967 #include <linux/sched.h>
972 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
981 # check if gfp_t is typedef-ed
983 AC_DEFUN([LN_TYPE_GFP_T],
984 [AC_MSG_CHECKING([if kernel defines gfp_t])
985 LB_LINUX_TRY_COMPILE([
986 #include <linux/gfp.h>
988 return sizeof(gfp_t);
991 AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
1000 # same goes for cpumask_t
1002 AC_DEFUN([LN_TYPE_CPUMASK_T],
1003 [AC_MSG_CHECKING([if kernel defines cpumask_t])
1004 LB_LINUX_TRY_COMPILE([
1005 #include <linux/sched.h>
1007 return sizeof (cpumask_t);
1009 AC_MSG_RESULT([yes])
1010 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
1019 # we export show_task(), but not all kernels have it (yet)
1021 AC_DEFUN([LN_FUNC_SHOW_TASK],
1022 [AC_MSG_CHECKING([if kernel exports show_task])
1024 for file in ksyms sched ; do
1025 if grep -q "EXPORT_SYMBOL(show_task)" \
1026 "$LINUX/kernel/$file.c" 2>/dev/null ; then
1031 if test x$have_show_task = x1 ; then
1032 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
1033 AC_MSG_RESULT([yes])
1040 # 2.6.18 remove tasklist_lock export
1041 AC_DEFUN([LN_TASKLIST_LOCK],
1042 [AC_MSG_CHECKING([kernel export tasklist_lock])
1043 if grep -q "EXPORT_SYMBOL(tasklist_lock)" \
1044 "$LINUX/kernel/fork.c" 2>/dev/null ; then
1045 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
1046 [tasklist_lock exported])
1047 AC_MSG_RESULT([yes])
1053 # 2.6.19 API changes
1054 # kmem_cache_destroy(cachep) return void instead of
1056 AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT],
1057 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
1058 LB_LINUX_TRY_COMPILE([
1059 #include <linux/slab.h>
1061 int i = kmem_cache_destroy(NULL);
1064 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
1065 [kmem_cache_destroy(cachep) return int])
1072 #panic_notifier_list use atomic_notifier operations
1074 AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER],
1075 [AC_MSG_CHECKING([panic_notifier_list is atomic])
1076 LB_LINUX_TRY_COMPILE([
1077 #include <linux/notifier.h>
1078 #include <linux/kernel.h>
1080 struct atomic_notifier_head panic_notifier_list;
1083 AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
1084 [panic_notifier_list is atomic_notifier_head])
1093 # LNet linux kernel checks
1095 AC_DEFUN([LN_PROG_LINUX],
1103 LN_CONFIG_PANIC_DUMPLOG
1121 LN_KMEM_CACHE_DESTROY_INT
1122 LN_ATOMIC_PANIC_NOTIFIER
1130 AC_DEFUN([LN_PROG_DARWIN],
1131 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
1137 # default paths for installed files
1139 AC_DEFUN([LN_PATH_DEFAULTS],
1146 # other configure checks
1148 AC_DEFUN([LN_CONFIGURE],
1149 [# lnet/utils/portals.c
1150 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
1151 AC_CHECK_FUNCS([gethostbyname socket connect])
1153 # lnet/utils/debug.c
1154 AC_CHECK_HEADERS([linux/version.h])
1156 AC_CHECK_TYPE([spinlock_t],
1157 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
1159 [#include <linux/spinlock.h>])
1161 # lnet/utils/wirecheck.c
1162 AC_CHECK_FUNCS([strnlen])
1164 # -------- Check for required packages --------------
1167 # LC_CONFIG_READLINE
1169 # Build with readline
1171 AC_MSG_CHECKING([whether to enable readline support])
1172 AC_ARG_ENABLE(readline,
1173 AC_HELP_STRING([--disable-readline],
1174 [disable readline support]),
1175 [],[enable_readline='yes'])
1176 AC_MSG_RESULT([$enable_readline])
1178 # -------- check for readline if enabled ----
1179 if test x$enable_readline = xyes ; then
1181 LIBS="-lncurses $LIBS"
1182 AC_CHECK_LIB([readline],[readline],[
1183 LIBREADLINE="-lreadline -lncurses"
1184 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
1192 AC_SUBST(LIBREADLINE)
1194 AC_MSG_CHECKING([if efence debugging support is requested])
1195 AC_ARG_ENABLE(efence,
1196 AC_HELP_STRING([--enable-efence],
1197 [use efence library]),
1198 [],[enable_efence='no'])
1199 AC_MSG_RESULT([$enable_efence])
1200 if test "$enable_efence" = "yes" ; then
1201 LIBEFENCE="-lefence"
1202 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
1208 # -------- enable acceptor libwrap (TCP wrappers) support? -------
1209 AC_MSG_CHECKING([if libwrap support is requested])
1210 AC_ARG_ENABLE([libwrap],
1211 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
1212 [case "${enableval}" in
1213 yes) enable_libwrap=yes ;;
1214 no) enable_libwrap=no ;;
1215 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
1216 esac],[enable_libwrap=no])
1217 AC_MSG_RESULT([$enable_libwrap])
1218 if test x$enable_libwrap = xyes ; then
1220 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
1226 # -------- check for -lpthread support ----
1227 AC_MSG_CHECKING([whether to use libpthread for lnet library])
1228 AC_ARG_ENABLE([libpthread],
1229 AC_HELP_STRING([--disable-libpthread],
1230 [disable libpthread]),
1231 [],[enable_libpthread=yes])
1232 if test "$enable_libpthread" = "yes" ; then
1233 AC_CHECK_LIB([pthread], [pthread_create],
1234 [ENABLE_LIBPTHREAD="yes"],
1235 [ENABLE_LIBPTHREAD="no"])
1236 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
1237 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
1238 PTHREAD_LIBS="-lpthread"
1239 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
1242 AC_MSG_RESULT([no libpthread is found])
1244 AC_SUBST(PTHREAD_LIBS)
1246 AC_MSG_RESULT([no (disabled explicitly)])
1247 ENABLE_LIBPTHREAD="no"
1249 AC_SUBST(ENABLE_LIBPTHREAD)
1251 # ----------------------------------------
1252 # some tests for catamount-like systems
1253 # ----------------------------------------
1254 AC_ARG_ENABLE([sysio_init],
1255 AC_HELP_STRING([--disable-sysio-init],
1256 [call sysio init functions when initializing liblustre]),
1257 [],[enable_sysio_init=yes])
1258 AC_MSG_CHECKING([whether to initialize libsysio])
1259 AC_MSG_RESULT([$enable_sysio_init])
1260 if test x$enable_sysio_init != xno ; then
1261 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
1264 AC_ARG_ENABLE([urandom],
1265 AC_HELP_STRING([--disable-urandom],
1266 [disable use of /dev/urandom for liblustre]),
1267 [],[enable_urandom=yes])
1268 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
1269 AC_MSG_RESULT([$enable_urandom])
1270 if test x$enable_urandom != xno ; then
1271 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
1274 # -------- check for -lcap support ----
1275 if test x$enable_liblustre = xyes ; then
1276 AC_CHECK_LIB([cap], [cap_get_proc],
1279 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
1288 LN_CONFIG_MAX_PAYLOAD
1296 # AM_CONDITOINAL defines for lnet
1298 AC_DEFUN([LN_CONDITIONALS],
1299 [AM_CONDITIONAL(BUILD_QSWLND, test x$QSWLND = "xqswlnd")
1300 AM_CONDITIONAL(BUILD_GMLND, test x$GMLND = "xgmlnd")
1301 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
1302 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1303 AM_CONDITIONAL(BUILD_OPENIBLND, test x$OPENIBLND = "xopeniblnd")
1304 AM_CONDITIONAL(BUILD_CIBLND, test x$CIBLND = "xciblnd")
1305 AM_CONDITIONAL(BUILD_IIBLND, test x$IIBLND = "xiiblnd")
1306 AM_CONDITIONAL(BUILD_VIBLND, test x$VIBLND = "xviblnd")
1307 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
1308 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
1309 AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
1310 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
1316 # files that should be generated with AC_OUTPUT
1318 AC_DEFUN([LN_CONFIG_FILES],
1323 lnet/autoconf/Makefile
1325 lnet/include/Makefile
1326 lnet/include/libcfs/Makefile
1327 lnet/include/libcfs/linux/Makefile
1328 lnet/include/lnet/Makefile
1329 lnet/include/lnet/linux/Makefile
1331 lnet/klnds/autoMakefile
1332 lnet/klnds/gmlnd/Makefile
1333 lnet/klnds/mxlnd/autoMakefile
1334 lnet/klnds/mxlnd/Makefile
1335 lnet/klnds/gmlnd/autoMakefile
1336 lnet/klnds/openiblnd/Makefile
1337 lnet/klnds/openiblnd/autoMakefile
1338 lnet/klnds/o2iblnd/Makefile
1339 lnet/klnds/o2iblnd/autoMakefile
1340 lnet/klnds/ciblnd/Makefile
1341 lnet/klnds/ciblnd/autoMakefile
1342 lnet/klnds/iiblnd/Makefile
1343 lnet/klnds/iiblnd/autoMakefile
1344 lnet/klnds/viblnd/Makefile
1345 lnet/klnds/viblnd/autoMakefile
1346 lnet/klnds/qswlnd/Makefile
1347 lnet/klnds/qswlnd/autoMakefile
1348 lnet/klnds/ralnd/Makefile
1349 lnet/klnds/ralnd/autoMakefile
1350 lnet/klnds/socklnd/Makefile
1351 lnet/klnds/socklnd/autoMakefile
1352 lnet/klnds/ptllnd/Makefile
1353 lnet/klnds/ptllnd/autoMakefile
1354 lnet/libcfs/Makefile
1355 lnet/libcfs/autoMakefile
1356 lnet/libcfs/linux/Makefile
1358 lnet/lnet/autoMakefile
1360 lnet/tests/autoMakefile
1362 lnet/ulnds/autoMakefile
1363 lnet/ulnds/socklnd/Makefile
1364 lnet/ulnds/ptllnd/Makefile
1367 case $lb_target_os in
1370 lnet/include/libcfs/darwin/Makefile
1371 lnet/include/lnet/darwin/Makefile
1372 lnet/libcfs/darwin/Makefile