Whamcloud - gitweb
* Removed check for kernel TCP zero-copy patch - it's not used even if it's
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
1 #
2 # LN_CONFIG_MAX_PAYLOAD
3 #
4 # configure maximum payload
5 #
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]),
11         [
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)"
15         ], [
16                 AC_MSG_RESULT([no])
17                 LNET_MAX_PAYLOAD="LNET_MTU"
18         ])
19         AC_DEFINE_UNQUOTED(LNET_MAX_PAYLOAD, $LNET_MAX_PAYLOAD,
20                            [Max LNET payload])
21 ])
22
23 #
24 # LN_CHECK_GCC_VERSION
25 #
26 # Check compiler version
27 #
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"
32 v2n() {
33         awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
34 }
35 if test -z "$PTL_CC_VERSION" -o \
36         `echo $PTL_CC_VERSION | v2n` -ge `echo $PTL_MIN_CC_VERSION | v2n`; then
37         AC_MSG_RESULT([ok])
38 else
39         AC_MSG_RESULT([Buggy compiler found])
40         AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
41 fi
42 ])
43
44 #
45 # LN_CONFIG_AFFINITY
46 #
47 # check if cpu affinity is available/wanted
48 #
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'])
54
55 AC_MSG_CHECKING([for CPU affinity support])
56 if test x$enable_affinity = xno ; then
57         AC_MSG_RESULT([no (by request)])
58 else
59         LB_LINUX_TRY_COMPILE([
60                 #include <linux/sched.h>
61         ],[
62                 struct task_struct t;
63                 #if HAVE_CPUMASK_T
64                 cpumask_t     m;
65                 #else
66                 unsigned long m;
67                 #endif
68                 set_cpus_allowed(&t, m);
69         ],[
70                 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
71                 AC_MSG_RESULT([yes])
72         ],[
73                 AC_MSG_RESULT([no (no kernel support)])
74         ])
75 fi
76 ])
77
78 #
79 # LN_CONFIG_PORTALS
80 #
81 # configure support for Portals
82 #
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]),
88         [
89                 case $with_portals in
90                         no)     ENABLEPORTALS=0
91                                 ;;
92                         *)      PORTALS="${with_portals}"
93                                 ENABLEPORTALS=1
94                                 ;;
95                 esac
96                 
97         ], [
98                 ENABLEPORTALS=0
99         ])
100 PTLLNDCPPFLAGS=""
101 if test $ENABLEPORTALS -eq 0; then
102         AC_MSG_RESULT([no])
103 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
104         AC_MSG_RESULT([no])
105         AC_MSG_ERROR([bad --with-portals path])
106 else
107         AC_MSG_RESULT([$PORTALS])
108         PTLLNDCPPFLAGS="-I${PORTALS}/include"
109 fi
110 AC_SUBST(PTLLNDCPPFLAGS)
111 ])
112
113 #
114 # LN_CONFIG_BACKOFF
115 #
116 # check if tunable tcp backoff is available/wanted
117 #
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)])
126 else
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])
130                AC_MSG_RESULT(yes)
131        else
132                AC_MSG_RESULT([no (no kernel support)])
133        fi
134 fi
135 ])
136
137 #
138 # LN_CONFIG_PANIC_DUMPLOG
139 #
140 # check if tunable panic_dumplog is wanted
141 #
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)])
151 else
152        AC_MSG_RESULT([no])
153 fi
154 ])
155
156 #
157 # LN_CONFIG_PTLLND
158 #
159 # configure support for Portals LND
160 #
161 AC_DEFUN([LN_CONFIG_PTLLND],
162 [
163 if test -z "$ENABLEPORTALS"; then
164         LN_CONFIG_PORTALS
165 fi
166
167 AC_MSG_CHECKING([whether to build the kernel portals LND])
168
169 PTLLND=""
170 if test $ENABLEPORTALS -ne 0; then
171         AC_MSG_RESULT([yes])
172         PTLLND="ptllnd"
173 else
174         AC_MSG_RESULT([no])
175 fi
176 AC_SUBST(PTLLND)
177 ])
178
179 #
180 # LN_CONFIG_UPTLLND
181 #
182 # configure support for Portals LND
183 #
184 AC_DEFUN([LN_CONFIG_UPTLLND],
185 [
186 if test -z "$ENABLEPORTALS"; then
187         LN_CONFIG_PORTALS
188 fi
189
190 AC_MSG_CHECKING([whether to build the userspace portals LND])
191
192 UPTLLND=""
193 if test $ENABLEPORTALS -ne 0; then
194         AC_MSG_RESULT([yes])
195         UPTLLND="ptllnd"
196 else
197         AC_MSG_RESULT([no])
198 fi
199 AC_SUBST(UPTLLND)
200 ])
201
202 #
203 # LN_CONFIG_USOCKLND
204 #
205 # configure support for userspace TCP/IP LND
206 #
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],
211                         [disable usocklnd]),
212         [],[enable_usocklnd='yes'])
213
214 if test x$enable_usocklnd = xyes ; then
215         if test "$ENABLE_LIBPTHREAD" = "yes" ; then
216                 AC_MSG_RESULT([yes])
217                 USOCKLND="usocklnd"
218         else
219                 AC_MSG_RESULT([no (libpthread not present or disabled)])
220                 USOCKLND=""
221         fi
222 else
223         AC_MSG_RESULT([no (disabled explicitly)])
224         USOCKLND=""
225 fi
226 AC_SUBST(USOCKLND)
227 ])
228
229 #
230 # LN_CONFIG_QUADRICS
231 #
232 # check if quadrics support is in this kernel
233 #
234 AC_DEFUN([LN_CONFIG_QUADRICS],
235 [AC_MSG_CHECKING([for QsNet sources])
236 AC_ARG_WITH([qsnet],
237         AC_HELP_STRING([--with-qsnet=path],
238                        [set path to qsnet source (default=$LINUX)]),
239         [QSNET=$with_qsnet],
240         [QSNET=$LINUX])
241 AC_MSG_RESULT([$QSNET])
242
243 AC_MSG_CHECKING([if quadrics kernel headers are present])
244 if test -d $QSNET/drivers/net/qsnet ; then
245         AC_MSG_RESULT([yes])
246         QSWLND="qswlnd"
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"
251         else
252                 AC_MSG_RESULT([not supported])
253                 AC_MSG_ERROR([Need multirail EKC])
254         fi
255
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.])
260                                 QSWLND=""
261                                 QSWCPPFLAGS=""
262                         ])
263                 ])
264         fi
265 else
266         AC_MSG_RESULT([no])
267         QSWLND=""
268         QSWCPPFLAGS=""
269 fi
270 AC_SUBST(QSWCPPFLAGS)
271 AC_SUBST(QSWLND)
272 ])
273
274 #
275 # LN_CONFIG_GM
276 #
277 # check if GM support is available
278 #
279 AC_DEFUN([LN_CONFIG_GM],[
280 AC_MSG_CHECKING([whether to enable GM support])
281 AC_ARG_WITH([gm],
282         AC_HELP_STRING([--with-gm=path-to-gm-source-tree],
283                        [build gmlnd against path]),
284         [
285                 case $with_gm in
286                 no)    ENABLE_GM=0
287                        ;;
288                 *)     ENABLE_GM=1
289                        GM_SRC="$with_gm"
290                        ;;
291                 esac
292         ],[
293                 ENABLE_GM=0
294         ])
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]),
298         [
299                 GM_INSTALL=$with_gm_install
300         ],[
301                 GM_INSTALL="/opt/gm"
302         ])
303 if test $ENABLE_GM -eq 0; then
304         AC_MSG_RESULT([no])
305 else
306         AC_MSG_RESULT([yes])
307
308         GMLND="gmlnd"
309         GMCPPFLAGS="-I$GM_SRC/include -I$GM_SRC/drivers -I$GM_SRC/drivers/linux/gm"
310
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"
314         else
315                 AC_MSG_ERROR([Cant find GM libraries under $GM_INSTALL])
316         fi
317
318         EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
319         EXTRA_KCFLAGS="$GMCPPFLAGS -DGM_KERNEL $EXTRA_KCFLAGS"
320
321         AC_MSG_CHECKING([that code using GM compiles with given path])
322         LB_LINUX_TRY_COMPILE([
323                 #define GM_STRONG_TYPES 1
324                 #ifdef VERSION
325                 #undef VERSION
326                 #endif
327                 #include "gm.h"
328                 #include "gm_internal.h"
329         ],[
330                 struct gm_port *port = NULL;
331                 gm_recv_event_t *rxevent = gm_blocking_receive_no_spin(port);
332                 return 0;
333         ],[
334                 AC_MSG_RESULT([yes])
335         ],[
336                 AC_MSG_RESULT([no])
337                 AC_MSG_ERROR([Bad --with-gm path])
338         ])
339
340         AC_MSG_CHECKING([that GM has gm_register_memory_ex_phys()])
341         LB_LINUX_TRY_COMPILE([
342                 #define GM_STRONG_TYPES 1
343                 #ifdef VERSION
344                 #undef VERSION
345                 #endif
346                 #include "gm.h"
347                 #include "gm_internal.h"
348         ],[
349                 gm_status_t     gmrc;
350                 struct gm_port *port = NULL;
351                 gm_u64_t        phys = 0;
352                 gm_up_t         pvma = 0;
353
354                 gmrc = gm_register_memory_ex_phys(port, phys, 100, pvma);
355                 return 0;
356         ],[
357                 AC_MSG_RESULT([yes])
358         ],[
359                 AC_MSG_RESULT([no.
360 Please patch the GM sources as follows...
361     cd $GM_SRC
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()])
365         ])
366
367         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
368 fi
369 AC_SUBST(GMCPPFLAGS)
370 AC_SUBST(GMLIBS)
371 AC_SUBST(GMLND)
372 ])
373
374
375 #
376 # LN_CONFIG_MX
377 #
378 AC_DEFUN([LN_CONFIG_MX],
379 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
380 # set default
381 MXPATH="/opt/mx"
382 AC_ARG_WITH([mx],
383        AC_HELP_STRING([--with-mx=path],
384                       [build mxlnd against path]),
385        [
386                case $with_mx in
387                yes)    ENABLEMX=2
388                        ;;
389                no)     ENABLEMX=0
390                        ;;
391                *)      MXPATH=$with_mx
392                        ENABLEMX=3
393                        ;;
394                esac
395        ],[
396                ENABLEMX=1
397        ])
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
403        AC_MSG_RESULT([no])
404        case $ENABLEMX in
405        1) ;;
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]);;
409        esac
410 else
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([
416                #define MX_KERNEL 1
417                #include <mx_extensions.h>
418                #include <myriexpress.h>
419        ],[
420                mx_endpoint_t   end;
421                mx_status_t     status;
422                mx_request_t    request;
423                int             result;
424
425                mx_init();
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);
430                return 0;
431        ],[
432                AC_MSG_RESULT([yes])
433                MXLND="mxlnd"
434        ],[
435                AC_MSG_RESULT([no])
436                case $ENABLEMX in
437                1) ;;
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]);;
441                esac
442                MXLND=""
443                MXCPPFLAGS=""
444        ])
445        EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
446 fi
447 AC_SUBST(MXCPPFLAGS)
448 AC_SUBST(MXLIBS)
449 AC_SUBST(MXLND)
450 ])
451
452
453
454 #
455 # LN_CONFIG_O2IB
456 #
457 AC_DEFUN([LN_CONFIG_O2IB],[
458 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
459 # set default
460 O2IBPATH="$LINUX/drivers/infiniband"
461 AC_ARG_WITH([o2ib],
462         AC_HELP_STRING([--with-o2ib=path],
463                        [build o2iblnd against path]),
464         [
465                 case $with_o2ib in
466                 yes)    ENABLEO2IB=2
467                         ;;
468                 no)     ENABLEO2IB=0
469                         ;;
470                 *)      O2IBPATH=$with_o2ib
471                         ENABLEO2IB=3
472                         ;;
473                 esac
474         ],[
475                 ENABLEO2IB=1
476         ])
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
483         AC_MSG_RESULT([no])
484         case $ENABLEO2IB in
485         1) ;;
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]);;
489         esac
490 else
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>
496                 #if !HAVE_GFP_T
497                 typedef int gfp_t;
498                 #endif
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>
503         ],[
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;
510
511                 cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
512                 return PTR_ERR(cm_id);
513         ],[
514                 AC_MSG_RESULT([yes])
515                 O2IBLND="o2iblnd"
516         ],[
517                 AC_MSG_RESULT([no])
518                 case $ENABLEO2IB in
519                 1) ;;
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]);;
523                 esac
524                 O2IBLND=""
525                 O2IBCPPFLAGS=""
526         ])
527         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
528 fi
529 AC_SUBST(O2IBCPPFLAGS)
530 AC_SUBST(O2IBLND)
531 ])
532
533 #
534 # LN_CONFIG_OPENIB
535 #
536 # check for OpenIB in the kernel
537 AC_DEFUN([LN_CONFIG_OPENIB],[
538 AC_MSG_CHECKING([whether to enable OpenIB support])
539 # set default
540 OPENIBPATH="$LINUX/drivers/infiniband"
541 AC_ARG_WITH([openib],
542         AC_HELP_STRING([--with-openib=path],
543                        [build openiblnd against path]),
544         [
545                 case $with_openib in
546                 yes)    ENABLEOPENIB=2
547                         ;;
548                 no)     ENABLEOPENIB=0
549                         ;;
550                 *)      OPENIBPATH="$with_openib"
551                         ENABLEOPENIB=3
552                         ;;
553                 esac
554         ],[
555                 ENABLEOPENIB=1
556         ])
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
562         AC_MSG_RESULT([no])
563         case $ENABLEOPENIB in
564         1) ;;
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]);;
568         esac
569 else
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]);;
575         esac
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>
583         ],[
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;
591                 return 0;
592         ],[
593                 AC_MSG_RESULT([yes])
594                 OPENIBLND="openiblnd"
595         ],[
596                 AC_MSG_RESULT([no])
597                 case $ENABLEOPENIB in
598                 1) ;;
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]);;
602                 esac
603                 OPENIBLND=""
604                 OPENIBCPPFLAGS=""
605         ])
606         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
607 fi
608 AC_SUBST(OPENIBCPPFLAGS)
609 AC_SUBST(OPENIBLND)
610 ])
611
612 #
613 # LN_CONFIG_CIBLND
614 #
615 AC_DEFUN([LN_CONFIG_CIB],[
616 AC_MSG_CHECKING([whether to enable Cisco/TopSpin IB support])
617 # set default
618 CIBPATH=""
619 CIBLND=""
620 AC_ARG_WITH([cib],
621         AC_HELP_STRING([--with-cib=path],
622                        [build ciblnd against path]),
623         [
624                 case $with_cib in
625                 no)     AC_MSG_RESULT([no]);;
626                 *)      CIBPATH="$with_cib"
627                         if test -d "$CIBPATH"; then
628                                 AC_MSG_RESULT([yes])
629                         else
630                                 AC_MSG_RESULT([no])
631                                 AC_MSG_ERROR([No directory $CIBPATH])
632                         fi;;
633                 esac
634         ],[
635                 AC_MSG_RESULT([no])
636         ])
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>
646         ],[
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;
654                 return 0;
655         ],[
656                 CIBLND="ciblnd"
657         ],[
658                 AC_MSG_ERROR([can't compile ciblnd with given path])
659                 CIBCPPFLAGS=""
660         ])
661         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
662 fi
663 AC_SUBST(CIBCPPFLAGS)
664 AC_SUBST(CIBLND)
665 ])
666
667 #
668 # LN_CONFIG_IIB
669 #
670 # check for infinicon infiniband support
671 #
672 AC_DEFUN([LN_CONFIG_IIB],[
673 AC_MSG_CHECKING([whether to enable Infinicon support])
674 # set default
675 IIBPATH="/usr/include"
676 AC_ARG_WITH([iib],
677         AC_HELP_STRING([--with-iib=path],
678                        [build iiblnd against path]),
679         [
680                 case $with_iib in
681                 yes)    ENABLEIIB=2
682                         ;;
683                 no)     ENABLEIIB=0
684                         ;;
685                 *)      IIBPATH="${with_iib}/include"
686                         ENABLEIIB=3
687                         ;;
688                 esac
689         ],[
690                 ENABLEIIB=1
691         ])
692 if test $ENABLEIIB -eq 0; then
693         AC_MSG_RESULT([disabled])
694 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
695         AC_MSG_RESULT([no])
696         case $ENABLEIIB in
697         1) ;;
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]);;
701         esac
702 else
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"
707         fi
708         EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
709         EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
710         LB_LINUX_TRY_COMPILE([
711                 #include <linux/iba/ibt.h>
712         ],[
713                 IBT_INTERFACE_UNION interfaces;
714                 FSTATUS             rc;
715
716                  rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
717                                                &interfaces);
718
719                 return rc == FSUCCESS ? 0 : 1;
720         ],[
721                 AC_MSG_RESULT([yes])
722                 IIBLND="iiblnd"
723         ],[
724                 AC_MSG_RESULT([no])
725                 case $ENABLEIIB in
726                 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]);;
730                 esac
731                 IIBLND=""
732                 IIBCPPFLAGS=""
733         ])
734         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
735 fi
736 AC_SUBST(IIBCPPFLAGS)
737 AC_SUBST(IIBLND)
738 ])
739
740 #
741 # LN_CONFIG_VIB
742 #
743 # check for Voltaire infiniband support
744 #
745 AC_DEFUN([LN_CONFIG_VIB],
746 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
747 VIBPATH=""
748 AC_ARG_WITH([vib],
749         AC_HELP_STRING([--with-vib=path],
750                        [build viblnd against path]),
751         [
752                 case $with_vib in
753                 no)     AC_MSG_RESULT([no]);;
754                 *)      VIBPATH="${with_vib}/src/nvigor/ib-code"
755                         if test -d "$with_vib" -a -d "$VIBPATH"; then
756                                 AC_MSG_RESULT([yes])
757                         else
758                                 AC_MSG_RESULT([no])
759                                 AC_MSG_ERROR([No directory $VIBPATH])
760                         fi;;
761                 esac
762         ],[
763                 AC_MSG_RESULT([no])
764         ])
765 if test -z "$VIBPATH"; then
766         VIBLND=""
767 else
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>
774                 #ifdef __BIG_ENDIAN
775                 # define CPU_BE 1
776                 # define CPU_LE 0
777                 #endif
778                 #ifdef __LITTLE_ENDIAN
779                 # define CPU_BE 0
780                 # define CPU_LE 1
781                 #endif
782                 #include <vverbs.h>
783                 #include <ib-cm.h>
784                 #include <ibat.h>
785         ],[
786                 vv_hca_h_t       kib_hca;
787                 vv_return_t      vvrc;
788                 cm_cep_handle_t  cep;
789                 ibat_arp_data_t  arp_data;
790                 ibat_stat_t      ibatrc;
791
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,
797                                           NULL, 0);
798                 return 0;
799         ],[
800                 VIBLND="viblnd"
801         ],[
802                 AC_MSG_ERROR([can't compile viblnd with given path])
803         ])
804         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
805 fi
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>
813                 #ifdef __BIG_ENDIAN
814                 # define CPU_BE 1
815                 # define CPU_LE 0
816                 #endif
817                 #ifdef __LITTLE_ENDIAN
818                 # define CPU_BE 0
819                 # define CPU_LE 1
820                 #endif
821                 #include <vverbs.h>
822                 #include <ib-cm.h>
823                 #include <ibat.h>
824         ],[
825                 vv_scatgat_t  sg;
826
827                 return &sg.v_address[3] == NULL;
828         ],[
829                 AC_MSG_RESULT([yes])
830                 VIBCPPFLAGS="$VIBCPPFLAGS -DIBNAL_VOIDSTAR_SGADDR=1"
831         ],[
832                 AC_MSG_RESULT([no])
833         ])
834         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
835 fi
836 AC_SUBST(VIBCPPFLAGS)
837 AC_SUBST(VIBLND)
838 ])
839
840 #
841 # LN_CONFIG_RALND
842 #
843 # check whether to use the RapidArray lnd
844 #
845 AC_DEFUN([LN_CONFIG_RALND],
846 [#### Rapid Array
847 AC_MSG_CHECKING([if RapidArray kernel headers are present])
848 # placeholder
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>
854         #include <rapl.h>
855 ],[
856         RAP_RETURN          rc;
857         RAP_PVOID           dev_handle;
858
859         rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
860
861         return rc == RAP_SUCCESS ? 0 : 1;
862 ],[
863         AC_MSG_RESULT([yes])
864         RALND="ralnd"
865 ],[
866         AC_MSG_RESULT([no])
867         RALND=""
868         RACPPFLAGS=""
869 ])
870 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
871 AC_SUBST(RACPPFLAGS)
872 AC_SUBST(RALND)
873 ])
874
875 #
876 # LN_STRUCT_PAGE_LIST
877 #
878 # 2.6.4 no longer has page->list
879 #
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>
884 ],[
885         struct page page;
886         &page.list;
887 ],[
888         AC_MSG_RESULT([yes])
889         AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
890 ],[
891         AC_MSG_RESULT([no])
892 ])
893 ])
894
895 #
896 # LN_STRUCT_SIGHAND
897 #
898 # red hat 2.4 adds sighand to struct task_struct
899 #
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>
904 ],[
905         struct task_struct p;
906         p.sighand = NULL;
907 ],[
908         AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
909         AC_MSG_RESULT([yes])
910 ],[
911         AC_MSG_RESULT([no])
912 ])
913 ])
914
915 #
916 # LN_FUNC_CPU_ONLINE
917 #
918 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
919 #
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>
924 ],[
925         cpu_online(0);
926 ],[
927         AC_MSG_RESULT([yes])
928         AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
929 ],[
930         AC_MSG_RESULT([no])
931 ])
932 ])
933
934 #
935 # LN_TYPE_GFP_T
936 #
937 # check if gfp_t is typedef-ed
938 #
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>
943 ],[
944         return sizeof(gfp_t);
945 ],[
946         AC_MSG_RESULT([yes])
947         AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
948 ],[
949         AC_MSG_RESULT([no])
950 ])
951 ])
952
953 #
954 # LN_TYPE_CPUMASK_T
955 #
956 # same goes for cpumask_t
957 #
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>
962 ],[
963         return sizeof (cpumask_t);
964 ],[
965         AC_MSG_RESULT([yes])
966         AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
967 ],[
968         AC_MSG_RESULT([no])
969 ])
970 ])
971
972 #
973 # LN_FUNC_SHOW_TASK
974 #
975 # we export show_task(), but not all kernels have it (yet)
976 #
977 AC_DEFUN([LN_FUNC_SHOW_TASK],
978 [AC_MSG_CHECKING([if kernel exports show_task])
979 have_show_task=0
980 for file in ksyms sched ; do
981         if grep -q "EXPORT_SYMBOL(show_task)" \
982                  "$LINUX/kernel/$file.c" 2>/dev/null ; then
983                 have_show_task=1
984                 break
985         fi
986 done
987 if test x$have_show_task = x1 ; then
988         AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
989         AC_MSG_RESULT([yes])
990 else
991         AC_MSG_RESULT([no])
992 fi
993 ])
994
995 # LN_TASKLIST_LOCK
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])
1004         else
1005                 AC_MSG_RESULT([no])
1006         fi
1007 ])
1008
1009 # 2.6.19 API changes
1010 # kmem_cache_destroy(cachep) return void instead of 
1011 # int
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>
1016 ],[
1017         int i = kmem_cache_destroy(NULL);
1018 ],[
1019         AC_MSG_RESULT(yes)
1020         AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
1021                 [kmem_cache_destroy(cachep) return int])
1022 ],[
1023         AC_MSG_RESULT(NO)
1024 ])
1025 ])
1026
1027 #2.6.19 API change
1028 #panic_notifier_list use atomic_notifier operations
1029 #
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>       
1035 ],[
1036         struct atomic_notifier_head panic_notifier_list;
1037 ],[
1038         AC_MSG_RESULT(yes)
1039         AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
1040                 [panic_notifier_list is atomic_notifier_head])
1041 ],[
1042         AC_MSG_RESULT(NO)
1043 ])
1044 ])
1045
1046 #
1047 # LN_PROG_LINUX
1048 #
1049 # LNet linux kernel checks
1050 #
1051 AC_DEFUN([LN_PROG_LINUX],
1052 [
1053 LN_FUNC_CPU_ONLINE
1054 LN_TYPE_GFP_T
1055 LN_TYPE_CPUMASK_T
1056 LN_CONFIG_AFFINITY
1057 LN_CONFIG_BACKOFF
1058 LN_CONFIG_PANIC_DUMPLOG
1059 LN_CONFIG_QUADRICS
1060 LN_CONFIG_GM
1061 LN_CONFIG_OPENIB
1062 LN_CONFIG_CIB
1063 LN_CONFIG_VIB
1064 LN_CONFIG_IIB
1065 LN_CONFIG_O2IB
1066 LN_CONFIG_RALND
1067 LN_CONFIG_PTLLND
1068 LN_CONFIG_MX
1069
1070 LN_STRUCT_PAGE_LIST
1071 LN_STRUCT_SIGHAND
1072 LN_FUNC_SHOW_TASK
1073 # 2.6.18
1074 LN_TASKLIST_LOCK
1075 # 2.6.19
1076 LN_KMEM_CACHE_DESTROY_INT
1077 LN_ATOMIC_PANIC_NOTIFIER
1078 ])
1079
1080 #
1081 # LN_PROG_DARWIN
1082 #
1083 # Darwin checks
1084 #
1085 AC_DEFUN([LN_PROG_DARWIN],
1086 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
1087 ])
1088
1089 #
1090 # LN_PATH_DEFAULTS
1091 #
1092 # default paths for installed files
1093 #
1094 AC_DEFUN([LN_PATH_DEFAULTS],
1095 [
1096 ])
1097
1098 #
1099 # LN_CONFIGURE
1100 #
1101 # other configure checks
1102 #
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])
1107
1108 # lnet/utils/debug.c
1109 AC_CHECK_HEADERS([linux/version.h])
1110
1111 AC_CHECK_TYPE([spinlock_t],
1112         [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
1113         [],
1114         [#include <linux/spinlock.h>])
1115
1116 # lnet/utils/wirecheck.c
1117 AC_CHECK_FUNCS([strnlen])
1118
1119 # --------  Check for required packages  --------------
1120
1121 #
1122 # LC_CONFIG_READLINE
1123 #
1124 # Build with readline
1125 #
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])
1132
1133 # -------- check for readline if enabled ----
1134 if test x$enable_readline = xyes ; then
1135         LIBS_save="$LIBS"
1136         LIBS="-lncurses $LIBS"
1137         AC_CHECK_LIB([readline],[readline],[
1138         LIBREADLINE="-lreadline -lncurses"
1139         AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
1140         ],[
1141         LIBREADLINE=""
1142         ])
1143         LIBS="$LIBS_save"
1144 else
1145         LIBREADLINE=""
1146 fi
1147 AC_SUBST(LIBREADLINE)
1148
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])
1158 else
1159         LIBEFENCE=""
1160 fi
1161 AC_SUBST(LIBEFENCE)
1162
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
1174         LIBWRAP="-lwrap"
1175         AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
1176 else
1177         LIBWRAP=""
1178 fi
1179 AC_SUBST(LIBWRAP)
1180
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])
1195         else
1196                 PTHREAD_LIBS=""
1197                 AC_MSG_RESULT([no libpthread is found])
1198         fi
1199         AC_SUBST(PTHREAD_LIBS)
1200 else
1201         AC_MSG_RESULT([no (disabled explicitly)])
1202         ENABLE_LIBPTHREAD="no"
1203 fi
1204 AC_SUBST(ENABLE_LIBPTHREAD)
1205
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])
1217 fi
1218
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])
1227 fi
1228
1229 # -------- check for -lcap support ----
1230 if test x$enable_liblustre = xyes ; then
1231         AC_CHECK_LIB([cap], [cap_get_proc],
1232                 [
1233                         CAP_LIBS="-lcap"
1234                         AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
1235                 ],
1236                 [
1237                         CAP_LIBS=""
1238                 ])
1239         AC_SUBST(CAP_LIBS)
1240
1241 fi
1242
1243 LN_CONFIG_MAX_PAYLOAD
1244 LN_CONFIG_UPTLLND
1245 LN_CONFIG_USOCKLND
1246 ])
1247
1248 #
1249 # LN_CONDITIONALS
1250 #
1251 # AM_CONDITOINAL defines for lnet
1252 #
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")
1266 ])
1267
1268 #
1269 # LN_CONFIG_FILES
1270 #
1271 # files that should be generated with AC_OUTPUT
1272 #
1273 AC_DEFUN([LN_CONFIG_FILES],
1274 [AC_CONFIG_FILES([
1275 lnet/Kernelenv
1276 lnet/Makefile
1277 lnet/autoMakefile
1278 lnet/autoconf/Makefile
1279 lnet/doc/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
1285 lnet/klnds/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
1312 lnet/lnet/Makefile
1313 lnet/lnet/autoMakefile
1314 lnet/tests/Makefile
1315 lnet/tests/autoMakefile
1316 lnet/ulnds/Makefile
1317 lnet/ulnds/autoMakefile
1318 lnet/ulnds/socklnd/Makefile
1319 lnet/ulnds/ptllnd/Makefile
1320 lnet/utils/Makefile
1321 ])
1322 case $lb_target_os in
1323         darwin)
1324                 AC_CONFIG_FILES([
1325 lnet/include/libcfs/darwin/Makefile
1326 lnet/include/lnet/darwin/Makefile
1327 lnet/libcfs/darwin/Makefile
1328 ])
1329                 ;;
1330 esac
1331 ])