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([LN_CONFIG_CDEBUG],
51 AC_MSG_CHECKING([whether to enable CDEBUG, CWARN])
52 AC_ARG_ENABLE([libcfs_cdebug],
53 AC_HELP_STRING([--disable-libcfs-cdebug],
54 [disable libcfs CDEBUG, CWARN]),
55 [],[enable_libcfs_cdebug='yes'])
56 AC_MSG_RESULT([$enable_libcfs_cdebug])
57 if test x$enable_libcfs_cdebug = xyes; then
58 AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])
60 AC_DEFINE(CDEBUG_ENABLED, 0, [disable libcfs CDEBUG, CWARN])
63 AC_MSG_CHECKING([whether to enable ENTRY/EXIT])
64 AC_ARG_ENABLE([libcfs_trace],
65 AC_HELP_STRING([--disable-libcfs-trace],
66 [disable libcfs ENTRY/EXIT]),
67 [],[enable_libcfs_trace='yes'])
68 AC_MSG_RESULT([$enable_libcfs_trace])
69 if test x$enable_libcfs_trace = xyes; 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 enable LASSERT, LASSERTF])
76 AC_ARG_ENABLE([libcfs_assert],
77 AC_HELP_STRING([--disable-libcfs-assert],
78 [disable libcfs LASSERT, LASSERTF]),
79 [],[enable_libcfs_assert='yes'])
80 AC_MSG_RESULT([$enable_libcfs_assert])
81 if test x$enable_libcfs_assert = xyes; then
82 AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])
89 # check if cpu affinity is available/wanted
91 AC_DEFUN([LN_CONFIG_AFFINITY],
92 [AC_ARG_ENABLE([affinity],
93 AC_HELP_STRING([--disable-affinity],
94 [disable process/irq affinity]),
95 [],[enable_affinity='yes'])
97 AC_MSG_CHECKING([for CPU affinity support])
98 if test x$enable_affinity = xno ; then
99 AC_MSG_RESULT([no (by request)])
101 LB_LINUX_TRY_COMPILE([
102 #include <linux/sched.h>
104 struct task_struct t;
110 set_cpus_allowed(&t, m);
112 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
115 AC_MSG_RESULT([no (no kernel support)])
123 # configure support for Portals
125 AC_DEFUN([LN_CONFIG_PORTALS],
126 [AC_MSG_CHECKING([for portals])
127 AC_ARG_WITH([portals],
128 AC_HELP_STRING([--with-portals=path],
129 [set path to portals]),
131 case $with_portals in
134 *) PORTALS="${with_portals}"
143 if test $ENABLEPORTALS -eq 0; then
145 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
147 AC_MSG_ERROR([bad --with-portals path])
149 AC_MSG_RESULT([$PORTALS])
150 PTLLNDCPPFLAGS="-I${PORTALS}/include"
152 AC_SUBST(PTLLNDCPPFLAGS)
158 # check if tunable tcp backoff is available/wanted
160 AC_DEFUN([LN_CONFIG_BACKOFF],
161 [AC_MSG_CHECKING([for tunable backoff TCP support])
162 AC_ARG_ENABLE([backoff],
163 AC_HELP_STRING([--disable-backoff],
164 [disable socknal tunable backoff]),
165 [],[enable_backoff='yes'])
166 if test x$enable_backoff = xno ; then
167 AC_MSG_RESULT([no (by request)])
169 BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
170 if test "$BOCD" != 0 ; then
171 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
174 AC_MSG_RESULT([no (no kernel support)])
180 # LN_CONFIG_PANIC_DUMPLOG
182 # check if tunable panic_dumplog is wanted
184 AC_DEFUN([LN_CONFIG_PANIC_DUMPLOG],
185 [AC_MSG_CHECKING([for tunable panic_dumplog support])
186 AC_ARG_ENABLE([panic_dumplog],
187 AC_HELP_STRING([--enable-panic_dumplog],
188 [enable panic_dumplog]),
189 [],[enable_panic_dumplog='no'])
190 if test x$enable_panic_dumplog = xyes ; then
191 AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])
192 AC_MSG_RESULT([yes (by request)])
201 # configure support for Portals LND
203 AC_DEFUN([LN_CONFIG_PTLLND],
205 if test -z "$ENABLEPORTALS"; then
209 AC_MSG_CHECKING([whether to build the kernel portals LND])
212 if test $ENABLEPORTALS -ne 0; then
224 # configure support for Portals LND
226 AC_DEFUN([LN_CONFIG_UPTLLND],
228 if test -z "$ENABLEPORTALS"; then
232 AC_MSG_CHECKING([whether to build the userspace portals LND])
235 if test $ENABLEPORTALS -ne 0; then
247 # configure support for userspace TCP/IP LND
249 AC_DEFUN([LN_CONFIG_USOCKLND],
250 [AC_MSG_CHECKING([whether to build usocklnd])
251 AC_ARG_ENABLE([usocklnd],
252 AC_HELP_STRING([--disable-usocklnd],
254 [],[enable_usocklnd='yes'])
256 if test x$enable_usocklnd = xyes ; then
257 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
261 AC_MSG_RESULT([no (libpthread not present or disabled)])
265 AC_MSG_RESULT([no (disabled explicitly)])
274 # check if quadrics support is in this kernel
276 AC_DEFUN([LN_CONFIG_QUADRICS],
277 [AC_MSG_CHECKING([for QsNet sources])
279 AC_HELP_STRING([--with-qsnet=path],
280 [set path to qsnet source (default=$LINUX)]),
283 AC_MSG_RESULT([$QSNET])
285 AC_MSG_CHECKING([if quadrics kernel headers are present])
286 if test -d $QSNET/drivers/net/qsnet ; then
289 AC_MSG_CHECKING([for multirail EKC])
290 if test -f $QSNET/include/elan/epcomms.h; then
291 AC_MSG_RESULT([supported])
292 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
294 AC_MSG_RESULT([not supported])
295 AC_MSG_ERROR([Need multirail EKC])
298 if test x$QSNET = x$LINUX ; then
299 LB_LINUX_CONFIG([QSNET],[],[
300 LB_LINUX_CONFIG([QSNET_MODULE],[],[
301 AC_MSG_WARN([QSNET is not enabled in this kernel; not building qswlnd.])
312 AC_SUBST(QSWCPPFLAGS)
319 # check if GM support is available
321 AC_DEFUN([LN_CONFIG_GM],[
322 AC_MSG_CHECKING([whether to enable GM support])
324 AC_HELP_STRING([--with-gm=path-to-gm-source-tree],
325 [build gmlnd against path]),
337 AC_ARG_WITH([gm-install],
338 AC_HELP_STRING([--with-gm-install=path-to-gm-install-tree],
339 [say where GM has been installed]),
341 GM_INSTALL=$with_gm_install
345 if test $ENABLE_GM -eq 0; then
351 GMCPPFLAGS="-I$GM_SRC/include -I$GM_SRC/drivers -I$GM_SRC/drivers/linux/gm"
353 if test -f $GM_INSTALL/lib/libgm.a -o \
354 -f $GM_INSTALL/lib64/libgm.a; then
355 GMLIBS="-L$GM_INSTALL/lib -L$GM_INSTALL/lib64"
357 AC_MSG_ERROR([Cant find GM libraries under $GM_INSTALL])
360 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
361 EXTRA_KCFLAGS="$GMCPPFLAGS -DGM_KERNEL $EXTRA_KCFLAGS"
363 AC_MSG_CHECKING([that code using GM compiles with given path])
364 LB_LINUX_TRY_COMPILE([
365 #define GM_STRONG_TYPES 1
370 #include "gm_internal.h"
372 struct gm_port *port = NULL;
373 gm_recv_event_t *rxevent = gm_blocking_receive_no_spin(port);
379 AC_MSG_ERROR([Bad --with-gm path])
382 AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
383 LB_LINUX_TRY_COMPILE([
384 #define GM_STRONG_TYPES 1
389 #include "gm_internal.h"
392 struct gm_port *port = NULL;
396 gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
402 Please patch the GM sources as follows...
404 patch -p0 < $PWD/lnet/klnds/gmlnd/gm-reg-phys.patch
405 ...then rebuild and re-install them])
406 AC_MSG_ERROR([Can't build GM without gm_register_memory_ex_phys()])
409 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
420 AC_DEFUN([LN_CONFIG_MX],
421 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
425 AC_HELP_STRING([--with-mx=path],
426 [build mxlnd against path]),
440 if test $ENABLEMX -eq 0; then
441 AC_MSG_RESULT([disabled])
442 elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
443 -f ${MXPATH}/include/mx_kernel_api.h -a \
444 -f ${MXPATH}/include/mx_pin.h \); then
448 2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
449 3) AC_MSG_ERROR([bad --with-mx path]);;
450 *) AC_MSG_ERROR([internal error]);;
453 MXCPPFLAGS="-I$MXPATH/include"
454 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
455 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
456 MXLIBS="-L$MXPATH/lib"
457 LB_LINUX_TRY_COMPILE([
459 #include <mx_extensions.h>
460 #include <myriexpress.h>
464 mx_request_t request;
468 mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
469 mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
470 mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
471 mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
480 2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
481 3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
482 *) AC_MSG_ERROR([internal error]);;
487 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
499 AC_DEFUN([LN_CONFIG_O2IB],[
500 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
502 O2IBPATH="$LINUX/drivers/infiniband"
504 AC_HELP_STRING([--with-o2ib=path],
505 [build o2iblnd against path]),
512 *) O2IBPATH=$with_o2ib
519 if test $ENABLEO2IB -eq 0; then
520 AC_MSG_RESULT([disabled])
521 elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
522 -f ${O2IBPATH}/include/rdma/ib_cm.h -a\
523 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\
524 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
528 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
529 3) AC_MSG_ERROR([bad --with-o2ib path]);;
530 *) AC_MSG_ERROR([internal error]);;
533 O2IBCPPFLAGS="-I$O2IBPATH/include"
534 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
535 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
536 EXTRA_LNET_INCLUDE="$O2IBCPPFLAGS $EXTRA_LNET_INCLUDE"
537 LB_LINUX_TRY_COMPILE([
538 #include <linux/version.h>
542 #include <rdma/rdma_cm.h>
543 #include <rdma/ib_cm.h>
544 #include <rdma/ib_verbs.h>
545 #include <rdma/ib_fmr_pool.h>
547 struct rdma_cm_id *cm_id;
548 struct rdma_conn_param conn_param;
549 struct ib_device_attr device_attr;
550 struct ib_qp_attr qp_attr;
551 struct ib_pool_fmr pool_fmr;
552 enum ib_cm_rej_reason rej_reason;
554 cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
555 return PTR_ERR(cm_id);
563 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
564 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
565 *) AC_MSG_ERROR([internal error]);;
571 IB_DMA_MAP="`grep -c ib_dma_map_single ${O2IBPATH}/include/rdma/ib_verbs.h`"
572 if test "$IB_DMA_MAP" != 0 ; then
573 IBLND_OFED_VERSION="102"
575 IBLND_OFED_VERSION="101"
578 AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION,
581 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
584 AC_SUBST(EXTRA_LNET_INCLUDE)
585 AC_SUBST(O2IBCPPFLAGS)
592 # check for OpenIB in the kernel
593 AC_DEFUN([LN_CONFIG_OPENIB],[
594 AC_MSG_CHECKING([whether to enable OpenIB support])
596 OPENIBPATH="$LINUX/drivers/infiniband"
597 AC_ARG_WITH([openib],
598 AC_HELP_STRING([--with-openib=path],
599 [build openiblnd against path]),
606 *) OPENIBPATH="$with_openib"
613 if test $ENABLEOPENIB -eq 0; then
614 AC_MSG_RESULT([disabled])
615 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
616 -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
617 -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
619 case $ENABLEOPENIB in
621 2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
622 3) AC_MSG_ERROR([bad --with-openib path]);;
623 *) AC_MSG_ERROR([internal error]);;
626 case $ENABLEOPENIB in
627 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
628 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
629 *) AC_MSG_RESULT([no])
630 AC_MSG_ERROR([internal error]);;
632 OPENIBCPPFLAGS="$OPENIBCPPFLAGS -DIB_NTXRXPARAMS=4"
633 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
634 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
635 LB_LINUX_TRY_COMPILE([
636 #include <ts_ib_core.h>
637 #include <ts_ib_cm.h>
638 #include <ts_ib_sa_client.h>
640 struct ib_device_properties dev_props;
641 struct ib_cm_active_param cm_active_params;
642 tTS_IB_CLIENT_QUERY_TID tid;
643 int enum1 = IB_QP_ATTRIBUTE_STATE;
644 int enum2 = IB_ACCESS_LOCAL_WRITE;
645 int enum3 = IB_CQ_CALLBACK_INTERRUPT;
646 int enum4 = IB_CQ_PROVIDER_REARM;
650 OPENIBLND="openiblnd"
653 case $ENABLEOPENIB in
655 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
656 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
657 *) AC_MSG_ERROR([internal error]);;
662 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
664 AC_SUBST(OPENIBCPPFLAGS)
671 AC_DEFUN([LN_CONFIG_CIB],[
672 AC_MSG_CHECKING([whether to enable Cisco/TopSpin IB support])
677 AC_HELP_STRING([--with-cib=path],
678 [build ciblnd against path]),
681 no) AC_MSG_RESULT([no]);;
682 *) CIBPATH="$with_cib"
683 if test -d "$CIBPATH"; then
687 AC_MSG_ERROR([No directory $CIBPATH])
693 if test -n "$CIBPATH"; then
694 CIBCPPFLAGS="-I${CIBPATH}/ib/ts_api_ng/include -I${CIBPATH}/all/kernel_services/include -DUSING_TSAPI"
695 CIBCPPFLAGS="$CIBCPPFLAGS -DIB_NTXRXPARAMS=3"
696 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
697 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $CIBCPPFLAGS"
698 LB_LINUX_TRY_COMPILE([
699 #include <ts_ib_core.h>
700 #include <ts_ib_cm.h>
701 #include <ts_ib_sa_client.h>
703 struct ib_device_properties dev_props;
704 struct ib_cm_active_param cm_active_params;
705 tTS_IB_CLIENT_QUERY_TID tid;
706 int enum1 = TS_IB_QP_ATTRIBUTE_STATE;
707 int enum2 = TS_IB_ACCESS_LOCAL_WRITE;
708 int enum3 = TS_IB_CQ_CALLBACK_INTERRUPT;
709 int enum4 = TS_IB_CQ_PROVIDER_REARM;
714 AC_MSG_ERROR([can't compile ciblnd with given path])
717 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
719 AC_SUBST(CIBCPPFLAGS)
726 # check for infinicon infiniband support
728 AC_DEFUN([LN_CONFIG_IIB],[
729 AC_MSG_CHECKING([whether to enable Infinicon support])
731 IIBPATH="/usr/include"
733 AC_HELP_STRING([--with-iib=path],
734 [build iiblnd against path]),
741 *) IIBPATH="${with_iib}/include"
748 if test $ENABLEIIB -eq 0; then
749 AC_MSG_RESULT([disabled])
750 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
754 2) AC_MSG_ERROR([default Infinicon headers not present]);;
755 3) AC_MSG_ERROR([bad --with-iib path]);;
756 *) AC_MSG_ERROR([internal error]);;
759 IIBCPPFLAGS="-I$IIBPATH"
760 if test $IIBPATH != "/usr/include"; then
761 # we need /usr/include come what may
762 IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include"
764 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
765 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
766 LB_LINUX_TRY_COMPILE([
767 #include <linux/iba/ibt.h>
769 IBT_INTERFACE_UNION interfaces;
772 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
775 return rc == FSUCCESS ? 0 : 1;
783 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);;
784 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);;
785 *) AC_MSG_ERROR([internal error]);;
790 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
792 AC_SUBST(IIBCPPFLAGS)
799 # check for Voltaire infiniband support
801 AC_DEFUN([LN_CONFIG_VIB],
802 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
805 AC_HELP_STRING([--with-vib=path],
806 [build viblnd against path]),
809 no) AC_MSG_RESULT([no]);;
810 *) VIBPATH="${with_vib}/src/nvigor/ib-code"
811 if test -d "$with_vib" -a -d "$VIBPATH"; then
815 AC_MSG_ERROR([No directory $VIBPATH])
821 if test -z "$VIBPATH"; then
824 VIBCPPFLAGS="-I${VIBPATH}/include -I${VIBPATH}/cm"
825 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
826 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
827 LB_LINUX_TRY_COMPILE([
828 #include <linux/list.h>
829 #include <asm/byteorder.h>
834 #ifdef __LITTLE_ENDIAN
845 ibat_arp_data_t arp_data;
848 vvrc = vv_hca_open("ANY_HCA", NULL, &kib_hca);
849 cep = cm_create_cep(cm_cep_transp_rc);
850 ibatrc = ibat_get_ib_data((uint32_t)0, (uint32_t)0,
851 ibat_paths_primary, &arp_data,
852 (ibat_get_ib_data_reply_fn_t)NULL,
858 AC_MSG_ERROR([can't compile viblnd with given path])
860 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
862 if test -n "$VIBLND"; then
863 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
864 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
865 AC_MSG_CHECKING([if Voltaire still uses void * sg addresses])
866 LB_LINUX_TRY_COMPILE([
867 #include <linux/list.h>
868 #include <asm/byteorder.h>
873 #ifdef __LITTLE_ENDIAN
883 return &sg.v_address[3] == NULL;
886 VIBCPPFLAGS="$VIBCPPFLAGS -DIBNAL_VOIDSTAR_SGADDR=1"
890 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
892 AC_SUBST(VIBCPPFLAGS)
899 # check whether to use the RapidArray lnd
901 AC_DEFUN([LN_CONFIG_RALND],
903 AC_MSG_CHECKING([if RapidArray kernel headers are present])
905 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
906 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
907 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
908 LB_LINUX_TRY_COMPILE([
909 #include <linux/types.h>
913 RAP_PVOID dev_handle;
915 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
917 return rc == RAP_SUCCESS ? 0 : 1;
926 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
932 # LN_STRUCT_PAGE_LIST
934 # 2.6.4 no longer has page->list
936 AC_DEFUN([LN_STRUCT_PAGE_LIST],
937 [AC_MSG_CHECKING([if struct page has a list field])
938 LB_LINUX_TRY_COMPILE([
939 #include <linux/mm.h>
945 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
954 # red hat 2.4 adds sighand to struct task_struct
956 AC_DEFUN([LN_STRUCT_SIGHAND],
957 [AC_MSG_CHECKING([if task_struct has a sighand field])
958 LB_LINUX_TRY_COMPILE([
959 #include <linux/sched.h>
961 struct task_struct p;
964 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
974 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
976 AC_DEFUN([LN_FUNC_CPU_ONLINE],
977 [AC_MSG_CHECKING([if kernel defines cpu_online()])
978 LB_LINUX_TRY_COMPILE([
979 #include <linux/sched.h>
984 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
993 # check if gfp_t is typedef-ed
995 AC_DEFUN([LN_TYPE_GFP_T],
996 [AC_MSG_CHECKING([if kernel defines gfp_t])
997 LB_LINUX_TRY_COMPILE([
998 #include <linux/gfp.h>
1000 return sizeof(gfp_t);
1002 AC_MSG_RESULT([yes])
1003 AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
1012 # same goes for cpumask_t
1014 AC_DEFUN([LN_TYPE_CPUMASK_T],
1015 [AC_MSG_CHECKING([if kernel defines cpumask_t])
1016 LB_LINUX_TRY_COMPILE([
1017 #include <linux/sched.h>
1019 return sizeof (cpumask_t);
1021 AC_MSG_RESULT([yes])
1022 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
1031 # we export show_task(), but not all kernels have it (yet)
1033 AC_DEFUN([LN_FUNC_SHOW_TASK],
1034 [LB_CHECK_SYMBOL_EXPORT([show_task],
1035 [kernel/ksyms.c kernel/sched.c],[
1036 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
1042 # 2.6.18 remove tasklist_lock export
1043 AC_DEFUN([LN_TASKLIST_LOCK],
1044 [LB_CHECK_SYMBOL_EXPORT([tasklist_lock],
1046 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
1047 [tasklist_lock exported])
1052 # 2.6.19 API changes
1053 # kmem_cache_destroy(cachep) return void instead of
1055 AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT],
1056 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
1057 LB_LINUX_TRY_COMPILE([
1058 #include <linux/slab.h>
1060 int i = kmem_cache_destroy(NULL);
1063 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
1064 [kmem_cache_destroy(cachep) return int])
1071 #panic_notifier_list use atomic_notifier operations
1073 AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER],
1074 [AC_MSG_CHECKING([panic_notifier_list is atomic])
1075 LB_LINUX_TRY_COMPILE([
1076 #include <linux/notifier.h>
1077 #include <linux/kernel.h>
1079 struct atomic_notifier_head panic_notifier_list;
1082 AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
1083 [panic_notifier_list is atomic_notifier_head])
1089 # 2.6.20 API change INIT_WORK use 2 args and not
1091 AC_DEFUN([LN_3ARGS_INIT_WORK],
1092 [AC_MSG_CHECKING([check INIT_WORK want 3 args])
1093 LB_LINUX_TRY_COMPILE([
1094 #include <linux/workqueue.h>
1096 struct work_struct work;
1098 INIT_WORK(&work, NULL, NULL);
1101 AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
1102 [INIT_WORK use 3 args and store data inside])
1108 # 2.6.21 api change. 'register_sysctl_table' use only one argument,
1109 # instead of more old which need two.
1110 AC_DEFUN([LN_2ARGS_REGISTER_SYSCTL],
1111 [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
1112 LB_LINUX_TRY_COMPILE([
1113 #include <linux/sysctl.h>
1115 return register_sysctl_table(NULL,0);
1118 AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
1119 [register_sysctl_table want 2 args])
1125 # 2.6.21 uses struct kmem_cache instead of kmem_cache_s for
1127 AC_DEFUN([LN_KMEM_CACHE_S],
1128 [AC_MSG_CHECKING([check kernel has struct kmem_cache_s])
1129 tmp_flags="$EXTRA_KCFLAGS"
1130 EXTRA_KCFLAGS="-Werror"
1131 LB_LINUX_TRY_COMPILE([
1132 #include <linux/slab.h>
1134 struct kmem_cache_s *cachep = NULL;
1136 kmem_cache_free(cachep, NULL);
1140 AC_DEFINE(HAVE_KMEM_CACHE_S, 1,
1141 [kernel has struct kmem_cache_s])
1145 EXTRA_KCFLAGS="$tmp_flags"
1151 # LNet linux kernel checks
1153 AC_DEFUN([LN_PROG_LINUX],
1160 LN_CONFIG_PANIC_DUMPLOG
1178 LN_KMEM_CACHE_DESTROY_INT
1179 LN_ATOMIC_PANIC_NOTIFIER
1183 LN_2ARGS_REGISTER_SYSCTL
1192 AC_DEFUN([LN_PROG_DARWIN],
1193 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
1199 # default paths for installed files
1201 AC_DEFUN([LN_PATH_DEFAULTS],
1208 # other configure checks
1210 AC_DEFUN([LN_CONFIGURE],
1211 [# lnet/utils/portals.c
1212 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
1213 AC_CHECK_FUNCS([gethostbyname socket connect])
1215 # lnet/utils/debug.c
1216 AC_CHECK_HEADERS([linux/version.h])
1218 AC_CHECK_TYPE([spinlock_t],
1219 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
1221 [#include <linux/spinlock.h>])
1223 # lnet/utils/wirecheck.c
1224 AC_CHECK_FUNCS([strnlen])
1226 # -------- Check for required packages --------------
1229 # LC_CONFIG_READLINE
1231 # Build with readline
1233 AC_MSG_CHECKING([whether to enable readline support])
1234 AC_ARG_ENABLE(readline,
1235 AC_HELP_STRING([--disable-readline],
1236 [disable readline support]),
1237 [],[enable_readline='yes'])
1238 AC_MSG_RESULT([$enable_readline])
1240 # -------- check for readline if enabled ----
1241 if test x$enable_readline = xyes ; then
1243 LIBS="-lncurses $LIBS"
1244 AC_CHECK_LIB([readline],[readline],[
1245 LIBREADLINE="-lreadline -lncurses"
1246 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
1254 AC_SUBST(LIBREADLINE)
1256 AC_MSG_CHECKING([if efence debugging support is requested])
1257 AC_ARG_ENABLE(efence,
1258 AC_HELP_STRING([--enable-efence],
1259 [use efence library]),
1260 [],[enable_efence='no'])
1261 AC_MSG_RESULT([$enable_efence])
1262 if test "$enable_efence" = "yes" ; then
1263 LIBEFENCE="-lefence"
1264 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
1270 # -------- enable acceptor libwrap (TCP wrappers) support? -------
1271 AC_MSG_CHECKING([if libwrap support is requested])
1272 AC_ARG_ENABLE([libwrap],
1273 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
1274 [case "${enableval}" in
1275 yes) enable_libwrap=yes ;;
1276 no) enable_libwrap=no ;;
1277 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
1278 esac],[enable_libwrap=no])
1279 AC_MSG_RESULT([$enable_libwrap])
1280 if test x$enable_libwrap = xyes ; then
1282 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
1288 # -------- check for -lpthread support ----
1289 AC_MSG_CHECKING([whether to use libpthread for lnet library])
1290 AC_ARG_ENABLE([libpthread],
1291 AC_HELP_STRING([--disable-libpthread],
1292 [disable libpthread]),
1293 [],[enable_libpthread=yes])
1294 if test "$enable_libpthread" = "yes" ; then
1295 AC_CHECK_LIB([pthread], [pthread_create],
1296 [ENABLE_LIBPTHREAD="yes"],
1297 [ENABLE_LIBPTHREAD="no"])
1298 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
1299 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
1300 PTHREAD_LIBS="-lpthread"
1301 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
1304 AC_MSG_RESULT([no libpthread is found])
1306 AC_SUBST(PTHREAD_LIBS)
1308 AC_MSG_RESULT([no (disabled explicitly)])
1309 ENABLE_LIBPTHREAD="no"
1311 AC_SUBST(ENABLE_LIBPTHREAD)
1313 # ----------------------------------------
1314 # some tests for catamount-like systems
1315 # ----------------------------------------
1316 AC_ARG_ENABLE([sysio_init],
1317 AC_HELP_STRING([--disable-sysio-init],
1318 [call sysio init functions when initializing liblustre]),
1319 [],[enable_sysio_init=yes])
1320 AC_MSG_CHECKING([whether to initialize libsysio])
1321 AC_MSG_RESULT([$enable_sysio_init])
1322 if test x$enable_sysio_init != xno ; then
1323 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
1326 AC_ARG_ENABLE([urandom],
1327 AC_HELP_STRING([--disable-urandom],
1328 [disable use of /dev/urandom for liblustre]),
1329 [],[enable_urandom=yes])
1330 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
1331 AC_MSG_RESULT([$enable_urandom])
1332 if test x$enable_urandom != xno ; then
1333 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
1336 # -------- check for -lcap support ----
1337 if test x$enable_liblustre = xyes ; then
1338 AC_CHECK_LIB([cap], [cap_get_proc],
1341 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
1350 LN_CONFIG_MAX_PAYLOAD
1358 # AM_CONDITOINAL defines for lnet
1360 AC_DEFUN([LN_CONDITIONALS],
1361 [AM_CONDITIONAL(BUILD_QSWLND, test x$QSWLND = "xqswlnd")
1362 AM_CONDITIONAL(BUILD_GMLND, test x$GMLND = "xgmlnd")
1363 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
1364 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1365 AM_CONDITIONAL(BUILD_OPENIBLND, test x$OPENIBLND = "xopeniblnd")
1366 AM_CONDITIONAL(BUILD_CIBLND, test x$CIBLND = "xciblnd")
1367 AM_CONDITIONAL(BUILD_IIBLND, test x$IIBLND = "xiiblnd")
1368 AM_CONDITIONAL(BUILD_VIBLND, test x$VIBLND = "xviblnd")
1369 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
1370 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
1371 AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
1372 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
1378 # files that should be generated with AC_OUTPUT
1380 AC_DEFUN([LN_CONFIG_FILES],
1385 lnet/autoconf/Makefile
1387 lnet/include/Makefile
1388 lnet/include/libcfs/Makefile
1389 lnet/include/libcfs/linux/Makefile
1390 lnet/include/lnet/Makefile
1391 lnet/include/lnet/linux/Makefile
1393 lnet/klnds/autoMakefile
1394 lnet/klnds/gmlnd/Makefile
1395 lnet/klnds/mxlnd/autoMakefile
1396 lnet/klnds/mxlnd/Makefile
1397 lnet/klnds/gmlnd/autoMakefile
1398 lnet/klnds/openiblnd/Makefile
1399 lnet/klnds/openiblnd/autoMakefile
1400 lnet/klnds/o2iblnd/Makefile
1401 lnet/klnds/o2iblnd/autoMakefile
1402 lnet/klnds/ciblnd/Makefile
1403 lnet/klnds/ciblnd/autoMakefile
1404 lnet/klnds/iiblnd/Makefile
1405 lnet/klnds/iiblnd/autoMakefile
1406 lnet/klnds/viblnd/Makefile
1407 lnet/klnds/viblnd/autoMakefile
1408 lnet/klnds/qswlnd/Makefile
1409 lnet/klnds/qswlnd/autoMakefile
1410 lnet/klnds/ralnd/Makefile
1411 lnet/klnds/ralnd/autoMakefile
1412 lnet/klnds/socklnd/Makefile
1413 lnet/klnds/socklnd/autoMakefile
1414 lnet/klnds/ptllnd/Makefile
1415 lnet/klnds/ptllnd/autoMakefile
1416 lnet/libcfs/Makefile
1417 lnet/libcfs/autoMakefile
1418 lnet/libcfs/linux/Makefile
1420 lnet/lnet/autoMakefile
1421 lnet/selftest/Makefile
1422 lnet/selftest/autoMakefile
1424 lnet/ulnds/autoMakefile
1425 lnet/ulnds/socklnd/Makefile
1426 lnet/ulnds/ptllnd/Makefile
1429 case $lb_target_os in
1432 lnet/include/libcfs/darwin/Makefile
1433 lnet/include/lnet/darwin/Makefile
1434 lnet/libcfs/darwin/Makefile