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 cpu affinity is available/wanted
49 AC_DEFUN([LN_CONFIG_AFFINITY],
50 [AC_ARG_ENABLE([affinity],
51 AC_HELP_STRING([--disable-affinity],
52 [disable process/irq affinity]),
53 [],[enable_affinity='yes'])
55 AC_MSG_CHECKING([for CPU affinity support])
56 if test x$enable_affinity = xno ; then
57 AC_MSG_RESULT([no (by request)])
59 LB_LINUX_TRY_COMPILE([
60 #include <linux/sched.h>
68 set_cpus_allowed(&t, m);
70 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
73 AC_MSG_RESULT([no (no kernel support)])
81 # configure support for Portals
83 AC_DEFUN([LN_CONFIG_PORTALS],
84 [AC_MSG_CHECKING([for portals])
85 AC_ARG_WITH([portals],
86 AC_HELP_STRING([--with-portals=path],
87 [set path to portals]),
92 *) PORTALS="${with_portals}"
101 if test $ENABLEPORTALS -eq 0; then
103 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
105 AC_MSG_ERROR([bad --with-portals path])
107 AC_MSG_RESULT([$PORTALS])
108 PTLLNDCPPFLAGS="-I${PORTALS}/include"
110 AC_SUBST(PTLLNDCPPFLAGS)
116 # check if tunable tcp backoff is available/wanted
118 AC_DEFUN([LN_CONFIG_BACKOFF],
119 [AC_MSG_CHECKING([for tunable backoff TCP support])
120 AC_ARG_ENABLE([backoff],
121 AC_HELP_STRING([--disable-backoff],
122 [disable socknal tunable backoff]),
123 [],[enable_backoff='yes'])
124 if test x$enable_backoff = xno ; then
125 AC_MSG_RESULT([no (by request)])
127 BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
128 if test "$BOCD" != 0 ; then
129 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
132 AC_MSG_RESULT([no (no kernel support)])
138 # LN_CONFIG_PANIC_DUMPLOG
140 # check if tunable panic_dumplog is wanted
142 AC_DEFUN([LN_CONFIG_PANIC_DUMPLOG],
143 [AC_MSG_CHECKING([for tunable panic_dumplog support])
144 AC_ARG_ENABLE([panic_dumplog],
145 AC_HELP_STRING([--enable-panic_dumplog],
146 [enable panic_dumplog]),
147 [],[enable_panic_dumplog='no'])
148 if test x$enable_panic_dumplog = xyes ; then
149 AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])
150 AC_MSG_RESULT([yes (by request)])
159 # configure support for Portals LND
161 AC_DEFUN([LN_CONFIG_PTLLND],
163 if test -z "$ENABLEPORTALS"; then
167 AC_MSG_CHECKING([whether to build the kernel portals LND])
170 if test $ENABLEPORTALS -ne 0; then
182 # configure support for Portals LND
184 AC_DEFUN([LN_CONFIG_UPTLLND],
186 if test -z "$ENABLEPORTALS"; then
190 AC_MSG_CHECKING([whether to build the userspace portals LND])
193 if test $ENABLEPORTALS -ne 0; then
205 # configure support for userspace TCP/IP LND
207 AC_DEFUN([LN_CONFIG_USOCKLND],
208 [AC_MSG_CHECKING([whether to build usocklnd])
209 AC_ARG_ENABLE([usocklnd],
210 AC_HELP_STRING([--disable-usocklnd],
212 [],[enable_usocklnd='yes'])
214 if test x$enable_usocklnd = xyes ; then
215 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
219 AC_MSG_RESULT([no (libpthread not present or disabled)])
223 AC_MSG_RESULT([no (disabled explicitly)])
232 # check if quadrics support is in this kernel
234 AC_DEFUN([LN_CONFIG_QUADRICS],
235 [AC_MSG_CHECKING([for QsNet sources])
237 AC_HELP_STRING([--with-qsnet=path],
238 [set path to qsnet source (default=$LINUX)]),
241 AC_MSG_RESULT([$QSNET])
243 AC_MSG_CHECKING([if quadrics kernel headers are present])
244 if test -d $QSNET/drivers/net/qsnet ; then
247 AC_MSG_CHECKING([for multirail EKC])
248 if test -f $QSNET/include/elan/epcomms.h; then
249 AC_MSG_RESULT([supported])
250 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
252 AC_MSG_RESULT([not supported])
253 AC_MSG_ERROR([Need multirail EKC])
256 if test x$QSNET = x$LINUX ; then
257 LB_LINUX_CONFIG([QSNET],[],[
258 LB_LINUX_CONFIG([QSNET_MODULE],[],[
259 AC_MSG_WARN([QSNET is not enabled in this kernel; not building qswlnd.])
270 AC_SUBST(QSWCPPFLAGS)
277 # check if GM support is available
279 AC_DEFUN([LN_CONFIG_GM],[
280 AC_MSG_CHECKING([whether to enable GM support])
282 AC_HELP_STRING([--with-gm=path-to-gm-source-tree],
283 [build gmlnd against path]),
295 AC_ARG_WITH([gm-install],
296 AC_HELP_STRING([--with-gm-install=path-to-gm-install-tree],
297 [say where GM has been installed]),
299 GM_INSTALL=$with_gm_install
303 if test $ENABLE_GM -eq 0; then
309 GMCPPFLAGS="-I$GM_SRC/include -I$GM_SRC/drivers -I$GM_SRC/drivers/linux/gm"
311 if test -f $GM_INSTALL/lib/libgm.a -o \
312 -f $GM_INSTALL/lib64/libgm.a; then
313 GMLIBS="-L$GM_INSTALL/lib -L$GM_INSTALL/lib64"
315 AC_MSG_ERROR([Cant find GM libraries under $GM_INSTALL])
318 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
319 EXTRA_KCFLAGS="$GMCPPFLAGS -DGM_KERNEL $EXTRA_KCFLAGS"
321 AC_MSG_CHECKING([that code using GM compiles with given path])
322 LB_LINUX_TRY_COMPILE([
323 #define GM_STRONG_TYPES 1
328 #include "gm_internal.h"
330 struct gm_port *port = NULL;
331 gm_recv_event_t *rxevent = gm_blocking_receive_no_spin(port);
337 AC_MSG_ERROR([Bad --with-gm path])
340 AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
341 LB_LINUX_TRY_COMPILE([
342 #define GM_STRONG_TYPES 1
347 #include "gm_internal.h"
350 struct gm_port *port = NULL;
354 gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
360 Please patch the GM sources as follows...
362 patch -p0 < $PWD/lnet/klnds/gmlnd/gm-reg-phys.patch
363 ...then rebuild and re-install them])
364 AC_MSG_ERROR([Can't build GM without gm_register_memory_ex_phys()])
367 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
378 AC_DEFUN([LN_CONFIG_MX],
379 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
383 AC_HELP_STRING([--with-mx=path],
384 [build mxlnd against path]),
398 if test $ENABLEMX -eq 0; then
399 AC_MSG_RESULT([disabled])
400 elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
401 -f ${MXPATH}/include/mx_kernel_api.h -a \
402 -f ${MXPATH}/include/mx_pin.h \); then
406 2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
407 3) AC_MSG_ERROR([bad --with-mx path]);;
408 *) AC_MSG_ERROR([internal error]);;
411 MXCPPFLAGS="-I$MXPATH/include"
412 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
413 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
414 MXLIBS="-L$MXPATH/lib"
415 LB_LINUX_TRY_COMPILE([
417 #include <mx_extensions.h>
418 #include <myriexpress.h>
422 mx_request_t request;
426 mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
427 mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
428 mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
429 mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
438 2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
439 3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
440 *) AC_MSG_ERROR([internal error]);;
445 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
457 AC_DEFUN([LN_CONFIG_O2IB],[
458 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
460 O2IBPATH="$LINUX/drivers/infiniband"
462 AC_HELP_STRING([--with-o2ib=path],
463 [build o2iblnd against path]),
470 *) O2IBPATH=$with_o2ib
477 if test $ENABLEO2IB -eq 0; then
478 AC_MSG_RESULT([disabled])
479 elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
480 -f ${O2IBPATH}/include/rdma/ib_cm.h -a\
481 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\
482 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
486 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
487 3) AC_MSG_ERROR([bad --with-o2ib path]);;
488 *) AC_MSG_ERROR([internal error]);;
491 O2IBCPPFLAGS="-I$O2IBPATH/include"
492 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
493 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
494 LB_LINUX_TRY_COMPILE([
495 #include <linux/version.h>
499 #include <rdma/rdma_cm.h>
500 #include <rdma/ib_cm.h>
501 #include <rdma/ib_verbs.h>
502 #include <rdma/ib_fmr_pool.h>
504 struct rdma_cm_id *cm_id;
505 struct rdma_conn_param conn_param;
506 struct ib_device_attr device_attr;
507 struct ib_qp_attr qp_attr;
508 struct ib_pool_fmr pool_fmr;
509 enum ib_cm_rej_reason rej_reason;
511 cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
512 return PTR_ERR(cm_id);
520 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
521 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
522 *) AC_MSG_ERROR([internal error]);;
527 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
529 AC_SUBST(O2IBCPPFLAGS)
536 # check for OpenIB in the kernel
537 AC_DEFUN([LN_CONFIG_OPENIB],[
538 AC_MSG_CHECKING([whether to enable OpenIB support])
540 OPENIBPATH="$LINUX/drivers/infiniband"
541 AC_ARG_WITH([openib],
542 AC_HELP_STRING([--with-openib=path],
543 [build openiblnd against path]),
550 *) OPENIBPATH="$with_openib"
557 if test $ENABLEOPENIB -eq 0; then
558 AC_MSG_RESULT([disabled])
559 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
560 -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
561 -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
563 case $ENABLEOPENIB in
565 2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
566 3) AC_MSG_ERROR([bad --with-openib path]);;
567 *) AC_MSG_ERROR([internal error]);;
570 case $ENABLEOPENIB in
571 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
572 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
573 *) AC_MSG_RESULT([no])
574 AC_MSG_ERROR([internal error]);;
576 OPENIBCPPFLAGS="$OPENIBCPPFLAGS -DIB_NTXRXPARAMS=4"
577 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
578 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
579 LB_LINUX_TRY_COMPILE([
580 #include <ts_ib_core.h>
581 #include <ts_ib_cm.h>
582 #include <ts_ib_sa_client.h>
584 struct ib_device_properties dev_props;
585 struct ib_cm_active_param cm_active_params;
586 tTS_IB_CLIENT_QUERY_TID tid;
587 int enum1 = IB_QP_ATTRIBUTE_STATE;
588 int enum2 = IB_ACCESS_LOCAL_WRITE;
589 int enum3 = IB_CQ_CALLBACK_INTERRUPT;
590 int enum4 = IB_CQ_PROVIDER_REARM;
594 OPENIBLND="openiblnd"
597 case $ENABLEOPENIB in
599 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
600 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
601 *) AC_MSG_ERROR([internal error]);;
606 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
608 AC_SUBST(OPENIBCPPFLAGS)
615 AC_DEFUN([LN_CONFIG_CIB],[
616 AC_MSG_CHECKING([whether to enable Cisco/TopSpin IB support])
621 AC_HELP_STRING([--with-cib=path],
622 [build ciblnd against path]),
625 no) AC_MSG_RESULT([no]);;
626 *) CIBPATH="$with_cib"
627 if test -d "$CIBPATH"; then
631 AC_MSG_ERROR([No directory $CIBPATH])
637 if test -n "$CIBPATH"; then
638 CIBCPPFLAGS="-I${CIBPATH}/ib/ts_api_ng/include -I${CIBPATH}/all/kernel_services/include -DUSING_TSAPI"
639 CIBCPPFLAGS="$CIBCPPFLAGS -DIB_NTXRXPARAMS=3"
640 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
641 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $CIBCPPFLAGS"
642 LB_LINUX_TRY_COMPILE([
643 #include <ts_ib_core.h>
644 #include <ts_ib_cm.h>
645 #include <ts_ib_sa_client.h>
647 struct ib_device_properties dev_props;
648 struct ib_cm_active_param cm_active_params;
649 tTS_IB_CLIENT_QUERY_TID tid;
650 int enum1 = TS_IB_QP_ATTRIBUTE_STATE;
651 int enum2 = TS_IB_ACCESS_LOCAL_WRITE;
652 int enum3 = TS_IB_CQ_CALLBACK_INTERRUPT;
653 int enum4 = TS_IB_CQ_PROVIDER_REARM;
658 AC_MSG_ERROR([can't compile ciblnd with given path])
661 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
663 AC_SUBST(CIBCPPFLAGS)
670 # check for infinicon infiniband support
672 AC_DEFUN([LN_CONFIG_IIB],[
673 AC_MSG_CHECKING([whether to enable Infinicon support])
675 IIBPATH="/usr/include"
677 AC_HELP_STRING([--with-iib=path],
678 [build iiblnd against path]),
685 *) IIBPATH="${with_iib}/include"
692 if test $ENABLEIIB -eq 0; then
693 AC_MSG_RESULT([disabled])
694 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
698 2) AC_MSG_ERROR([default Infinicon headers not present]);;
699 3) AC_MSG_ERROR([bad --with-iib path]);;
700 *) AC_MSG_ERROR([internal error]);;
703 IIBCPPFLAGS="-I$IIBPATH"
704 if test $IIBPATH != "/usr/include"; then
705 # we need /usr/include come what may
706 IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include"
708 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
709 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
710 LB_LINUX_TRY_COMPILE([
711 #include <linux/iba/ibt.h>
713 IBT_INTERFACE_UNION interfaces;
716 rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
719 return rc == FSUCCESS ? 0 : 1;
727 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);;
728 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);;
729 *) AC_MSG_ERROR([internal error]);;
734 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
736 AC_SUBST(IIBCPPFLAGS)
743 # check for Voltaire infiniband support
745 AC_DEFUN([LN_CONFIG_VIB],
746 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
749 AC_HELP_STRING([--with-vib=path],
750 [build viblnd against path]),
753 no) AC_MSG_RESULT([no]);;
754 *) VIBPATH="${with_vib}/src/nvigor/ib-code"
755 if test -d "$with_vib" -a -d "$VIBPATH"; then
759 AC_MSG_ERROR([No directory $VIBPATH])
765 if test -z "$VIBPATH"; then
768 VIBCPPFLAGS="-I${VIBPATH}/include -I${VIBPATH}/cm"
769 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
770 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
771 LB_LINUX_TRY_COMPILE([
772 #include <linux/list.h>
773 #include <asm/byteorder.h>
778 #ifdef __LITTLE_ENDIAN
789 ibat_arp_data_t arp_data;
792 vvrc = vv_hca_open("ANY_HCA", NULL, &kib_hca);
793 cep = cm_create_cep(cm_cep_transp_rc);
794 ibatrc = ibat_get_ib_data((uint32_t)0, (uint32_t)0,
795 ibat_paths_primary, &arp_data,
796 (ibat_get_ib_data_reply_fn_t)NULL,
802 AC_MSG_ERROR([can't compile viblnd with given path])
804 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
806 if test -n "$VIBLND"; then
807 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
808 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
809 AC_MSG_CHECKING([if Voltaire still uses void * sg addresses])
810 LB_LINUX_TRY_COMPILE([
811 #include <linux/list.h>
812 #include <asm/byteorder.h>
817 #ifdef __LITTLE_ENDIAN
827 return &sg.v_address[3] == NULL;
830 VIBCPPFLAGS="$VIBCPPFLAGS -DIBNAL_VOIDSTAR_SGADDR=1"
834 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
836 AC_SUBST(VIBCPPFLAGS)
843 # check whether to use the RapidArray lnd
845 AC_DEFUN([LN_CONFIG_RALND],
847 AC_MSG_CHECKING([if RapidArray kernel headers are present])
849 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
850 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
851 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
852 LB_LINUX_TRY_COMPILE([
853 #include <linux/types.h>
857 RAP_PVOID dev_handle;
859 rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
861 return rc == RAP_SUCCESS ? 0 : 1;
870 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
876 # LN_STRUCT_PAGE_LIST
878 # 2.6.4 no longer has page->list
880 AC_DEFUN([LN_STRUCT_PAGE_LIST],
881 [AC_MSG_CHECKING([if struct page has a list field])
882 LB_LINUX_TRY_COMPILE([
883 #include <linux/mm.h>
889 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
898 # red hat 2.4 adds sighand to struct task_struct
900 AC_DEFUN([LN_STRUCT_SIGHAND],
901 [AC_MSG_CHECKING([if task_struct has a sighand field])
902 LB_LINUX_TRY_COMPILE([
903 #include <linux/sched.h>
905 struct task_struct p;
908 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
918 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
920 AC_DEFUN([LN_FUNC_CPU_ONLINE],
921 [AC_MSG_CHECKING([if kernel defines cpu_online()])
922 LB_LINUX_TRY_COMPILE([
923 #include <linux/sched.h>
928 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
937 # check if gfp_t is typedef-ed
939 AC_DEFUN([LN_TYPE_GFP_T],
940 [AC_MSG_CHECKING([if kernel defines gfp_t])
941 LB_LINUX_TRY_COMPILE([
942 #include <linux/gfp.h>
944 return sizeof(gfp_t);
947 AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
956 # same goes for cpumask_t
958 AC_DEFUN([LN_TYPE_CPUMASK_T],
959 [AC_MSG_CHECKING([if kernel defines cpumask_t])
960 LB_LINUX_TRY_COMPILE([
961 #include <linux/sched.h>
963 return sizeof (cpumask_t);
966 AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
975 # we export show_task(), but not all kernels have it (yet)
977 AC_DEFUN([LN_FUNC_SHOW_TASK],
978 [AC_MSG_CHECKING([if kernel exports show_task])
980 for file in ksyms sched ; do
981 if grep -q "EXPORT_SYMBOL(show_task)" \
982 "$LINUX/kernel/$file.c" 2>/dev/null ; then
987 if test x$have_show_task = x1 ; then
988 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
996 # 2.6.18 remove tasklist_lock export
997 AC_DEFUN([LN_TASKLIST_LOCK],
998 [AC_MSG_CHECKING([kernel export tasklist_lock])
999 if grep -q "EXPORT_SYMBOL(tasklist_lock)" \
1000 "$LINUX/kernel/fork.c" 2>/dev/null ; then
1001 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
1002 [tasklist_lock exported])
1003 AC_MSG_RESULT([yes])
1009 # 2.6.19 API changes
1010 # kmem_cache_destroy(cachep) return void instead of
1012 AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT],
1013 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
1014 LB_LINUX_TRY_COMPILE([
1015 #include <linux/slab.h>
1017 int i = kmem_cache_destroy(NULL);
1020 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
1021 [kmem_cache_destroy(cachep) return int])
1028 #panic_notifier_list use atomic_notifier operations
1030 AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER],
1031 [AC_MSG_CHECKING([panic_notifier_list is atomic])
1032 LB_LINUX_TRY_COMPILE([
1033 #include <linux/notifier.h>
1034 #include <linux/kernel.h>
1036 struct atomic_notifier_head panic_notifier_list;
1039 AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
1040 [panic_notifier_list is atomic_notifier_head])
1049 # LNet linux kernel checks
1051 AC_DEFUN([LN_PROG_LINUX],
1058 LN_CONFIG_PANIC_DUMPLOG
1076 LN_KMEM_CACHE_DESTROY_INT
1077 LN_ATOMIC_PANIC_NOTIFIER
1085 AC_DEFUN([LN_PROG_DARWIN],
1086 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
1092 # default paths for installed files
1094 AC_DEFUN([LN_PATH_DEFAULTS],
1101 # other configure checks
1103 AC_DEFUN([LN_CONFIGURE],
1104 [# lnet/utils/portals.c
1105 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
1106 AC_CHECK_FUNCS([gethostbyname socket connect])
1108 # lnet/utils/debug.c
1109 AC_CHECK_HEADERS([linux/version.h])
1111 AC_CHECK_TYPE([spinlock_t],
1112 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
1114 [#include <linux/spinlock.h>])
1116 # lnet/utils/wirecheck.c
1117 AC_CHECK_FUNCS([strnlen])
1119 # -------- Check for required packages --------------
1122 # LC_CONFIG_READLINE
1124 # Build with readline
1126 AC_MSG_CHECKING([whether to enable readline support])
1127 AC_ARG_ENABLE(readline,
1128 AC_HELP_STRING([--disable-readline],
1129 [disable readline support]),
1130 [],[enable_readline='yes'])
1131 AC_MSG_RESULT([$enable_readline])
1133 # -------- check for readline if enabled ----
1134 if test x$enable_readline = xyes ; then
1136 LIBS="-lncurses $LIBS"
1137 AC_CHECK_LIB([readline],[readline],[
1138 LIBREADLINE="-lreadline -lncurses"
1139 AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
1147 AC_SUBST(LIBREADLINE)
1149 AC_MSG_CHECKING([if efence debugging support is requested])
1150 AC_ARG_ENABLE(efence,
1151 AC_HELP_STRING([--enable-efence],
1152 [use efence library]),
1153 [],[enable_efence='no'])
1154 AC_MSG_RESULT([$enable_efence])
1155 if test "$enable_efence" = "yes" ; then
1156 LIBEFENCE="-lefence"
1157 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
1163 # -------- enable acceptor libwrap (TCP wrappers) support? -------
1164 AC_MSG_CHECKING([if libwrap support is requested])
1165 AC_ARG_ENABLE([libwrap],
1166 AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
1167 [case "${enableval}" in
1168 yes) enable_libwrap=yes ;;
1169 no) enable_libwrap=no ;;
1170 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
1171 esac],[enable_libwrap=no])
1172 AC_MSG_RESULT([$enable_libwrap])
1173 if test x$enable_libwrap = xyes ; then
1175 AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
1181 # -------- check for -lpthread support ----
1182 AC_MSG_CHECKING([whether to use libpthread for lnet library])
1183 AC_ARG_ENABLE([libpthread],
1184 AC_HELP_STRING([--disable-libpthread],
1185 [disable libpthread]),
1186 [],[enable_libpthread=yes])
1187 if test "$enable_libpthread" = "yes" ; then
1188 AC_CHECK_LIB([pthread], [pthread_create],
1189 [ENABLE_LIBPTHREAD="yes"],
1190 [ENABLE_LIBPTHREAD="no"])
1191 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
1192 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
1193 PTHREAD_LIBS="-lpthread"
1194 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
1197 AC_MSG_RESULT([no libpthread is found])
1199 AC_SUBST(PTHREAD_LIBS)
1201 AC_MSG_RESULT([no (disabled explicitly)])
1202 ENABLE_LIBPTHREAD="no"
1204 AC_SUBST(ENABLE_LIBPTHREAD)
1206 # ----------------------------------------
1207 # some tests for catamount-like systems
1208 # ----------------------------------------
1209 AC_ARG_ENABLE([sysio_init],
1210 AC_HELP_STRING([--disable-sysio-init],
1211 [call sysio init functions when initializing liblustre]),
1212 [],[enable_sysio_init=yes])
1213 AC_MSG_CHECKING([whether to initialize libsysio])
1214 AC_MSG_RESULT([$enable_sysio_init])
1215 if test x$enable_sysio_init != xno ; then
1216 AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
1219 AC_ARG_ENABLE([urandom],
1220 AC_HELP_STRING([--disable-urandom],
1221 [disable use of /dev/urandom for liblustre]),
1222 [],[enable_urandom=yes])
1223 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
1224 AC_MSG_RESULT([$enable_urandom])
1225 if test x$enable_urandom != xno ; then
1226 AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
1229 # -------- check for -lcap support ----
1230 if test x$enable_liblustre = xyes ; then
1231 AC_CHECK_LIB([cap], [cap_get_proc],
1234 AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
1243 LN_CONFIG_MAX_PAYLOAD
1251 # AM_CONDITOINAL defines for lnet
1253 AC_DEFUN([LN_CONDITIONALS],
1254 [AM_CONDITIONAL(BUILD_QSWLND, test x$QSWLND = "xqswlnd")
1255 AM_CONDITIONAL(BUILD_GMLND, test x$GMLND = "xgmlnd")
1256 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
1257 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1258 AM_CONDITIONAL(BUILD_OPENIBLND, test x$OPENIBLND = "xopeniblnd")
1259 AM_CONDITIONAL(BUILD_CIBLND, test x$CIBLND = "xciblnd")
1260 AM_CONDITIONAL(BUILD_IIBLND, test x$IIBLND = "xiiblnd")
1261 AM_CONDITIONAL(BUILD_VIBLND, test x$VIBLND = "xviblnd")
1262 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
1263 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
1264 AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
1265 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
1271 # files that should be generated with AC_OUTPUT
1273 AC_DEFUN([LN_CONFIG_FILES],
1278 lnet/autoconf/Makefile
1280 lnet/include/Makefile
1281 lnet/include/libcfs/Makefile
1282 lnet/include/libcfs/linux/Makefile
1283 lnet/include/lnet/Makefile
1284 lnet/include/lnet/linux/Makefile
1286 lnet/klnds/autoMakefile
1287 lnet/klnds/gmlnd/Makefile
1288 lnet/klnds/mxlnd/autoMakefile
1289 lnet/klnds/mxlnd/Makefile
1290 lnet/klnds/gmlnd/autoMakefile
1291 lnet/klnds/openiblnd/Makefile
1292 lnet/klnds/openiblnd/autoMakefile
1293 lnet/klnds/o2iblnd/Makefile
1294 lnet/klnds/o2iblnd/autoMakefile
1295 lnet/klnds/ciblnd/Makefile
1296 lnet/klnds/ciblnd/autoMakefile
1297 lnet/klnds/iiblnd/Makefile
1298 lnet/klnds/iiblnd/autoMakefile
1299 lnet/klnds/viblnd/Makefile
1300 lnet/klnds/viblnd/autoMakefile
1301 lnet/klnds/qswlnd/Makefile
1302 lnet/klnds/qswlnd/autoMakefile
1303 lnet/klnds/ralnd/Makefile
1304 lnet/klnds/ralnd/autoMakefile
1305 lnet/klnds/socklnd/Makefile
1306 lnet/klnds/socklnd/autoMakefile
1307 lnet/klnds/ptllnd/Makefile
1308 lnet/klnds/ptllnd/autoMakefile
1309 lnet/libcfs/Makefile
1310 lnet/libcfs/autoMakefile
1311 lnet/libcfs/linux/Makefile
1313 lnet/lnet/autoMakefile
1315 lnet/tests/autoMakefile
1317 lnet/ulnds/autoMakefile
1318 lnet/ulnds/socklnd/Makefile
1319 lnet/ulnds/ptllnd/Makefile
1322 case $lb_target_os in
1325 lnet/include/libcfs/darwin/Makefile
1326 lnet/include/lnet/darwin/Makefile
1327 lnet/libcfs/darwin/Makefile