Whamcloud - gitweb
LU-165: Support privileged ports in the o2iblnd driver.
[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_FUNC_DEV_GET_BY_NAME_2ARG
46 #
47 AC_DEFUN([LN_FUNC_DEV_GET_BY_NAME_2ARG],
48 [AC_MSG_CHECKING([if dev_get_by_name has two args])
49 LB_LINUX_TRY_COMPILE([
50         #include <linux/netdevice.h>
51 ],[
52         dev_get_by_name(NULL, NULL);
53 ],[
54         AC_MSG_RESULT([yes])
55         AC_DEFINE(HAVE_DEV_GET_BY_NAME_2ARG, 1, [dev_get_by_name has 2 args])
56 ],[
57         AC_MSG_RESULT([no])
58 ])
59 ])
60
61 #
62 # LN_CONFIG_AFFINITY
63 #
64 # check if cpu affinity is available/wanted
65 #
66 AC_DEFUN([LN_CONFIG_AFFINITY],
67 [AC_ARG_ENABLE([affinity],
68         AC_HELP_STRING([--disable-affinity],
69                        [disable process/irq affinity]),
70         [],[enable_affinity='yes'])
71
72 AC_MSG_CHECKING([for CPU affinity support])
73 if test x$enable_affinity = xno ; then
74         AC_MSG_RESULT([no (by request)])
75 else
76         LB_LINUX_TRY_COMPILE([
77                 #include <linux/sched.h>
78         ],[
79                 struct task_struct t;
80                 #if HAVE_CPUMASK_T
81                 cpumask_t     m;
82                 #else
83                 unsigned long m;
84                 #endif
85                 set_cpus_allowed(&t, m);
86         ],[
87                 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
88                 AC_MSG_RESULT([yes])
89         ],[
90                 AC_MSG_RESULT([no (no kernel support)])
91         ])
92 fi
93 ])
94
95 #
96 # LN_CONFIG_PORTALS
97 #
98 # configure support for Portals
99 #
100 AC_DEFUN([LN_CONFIG_PORTALS],
101 [AC_MSG_CHECKING([for portals])
102 AC_ARG_WITH([portals],
103         AC_HELP_STRING([--with-portals=path],
104                        [set path to portals]),
105         [
106                 case $with_portals in
107                         no)     ENABLEPORTALS=0
108                                 ;;
109                         *)      PORTALS="${with_portals}"
110                                 ENABLEPORTALS=1
111                                 ;;
112                 esac
113         ], [
114                 ENABLEPORTALS=0
115         ])
116 PTLLNDCPPFLAGS=""
117 if test $ENABLEPORTALS -eq 0; then
118         AC_MSG_RESULT([no])
119 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
120         AC_MSG_RESULT([no])
121         AC_MSG_ERROR([bad --with-portals path])
122 else
123         AC_MSG_RESULT([$PORTALS])
124         PTLLNDCPPFLAGS="-I${PORTALS}/include"
125 fi
126 AC_SUBST(PTLLNDCPPFLAGS)
127 ])
128
129 #
130 # LN_CONFIG_BACKOFF
131 #
132 # check if tunable tcp backoff is available/wanted
133 #
134 AC_DEFUN([LN_CONFIG_BACKOFF],
135 [AC_MSG_CHECKING([for tunable backoff TCP support])
136 AC_ARG_ENABLE([backoff],
137        AC_HELP_STRING([--disable-backoff],
138                       [disable socknal tunable backoff]),
139        [],[enable_backoff='yes'])
140 if test x$enable_backoff = xno ; then
141        AC_MSG_RESULT([no (by request)])
142 else
143        BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
144        if test "$BOCD" != 0 ; then
145                AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
146                AC_MSG_RESULT(yes)
147                if grep rto_max $LINUX/include/linux/tcp.h|grep -q __u16; then
148                    AC_DEFINE(SOCKNAL_BACKOFF_MS, 1, [tunable backoff TCP in ms])
149                fi
150        else
151                AC_MSG_RESULT([no (no kernel support)])
152        fi
153 fi
154 ])
155
156
157 #
158 # LN_CONFIG_PTLLND
159 #
160 # configure support for Portals LND
161 #
162 AC_DEFUN([LN_CONFIG_PTLLND],
163 [
164 if test -z "$ENABLEPORTALS"; then
165         LN_CONFIG_PORTALS
166 fi
167
168 AC_MSG_CHECKING([whether to build the kernel portals LND])
169
170 PTLLND=""
171 if test $ENABLEPORTALS -ne 0; then
172         AC_MSG_RESULT([yes])
173         PTLLND="ptllnd"
174 else
175         AC_MSG_RESULT([no])
176 fi
177 AC_SUBST(PTLLND)
178 ])
179
180 #
181 # LN_CONFIG_UPTLLND
182 #
183 # configure support for Portals LND
184 #
185 AC_DEFUN([LN_CONFIG_UPTLLND],
186 [
187 if test -z "$ENABLEPORTALS"; then
188         LN_CONFIG_PORTALS
189 fi
190
191 AC_MSG_CHECKING([whether to build the userspace portals LND])
192
193 UPTLLND=""
194 if test $ENABLEPORTALS -ne 0; then
195         AC_MSG_RESULT([yes])
196         UPTLLND="ptllnd"
197 else
198         AC_MSG_RESULT([no])
199 fi
200 AC_SUBST(UPTLLND)
201 ])
202
203 #
204 # LN_CONFIG_USOCKLND
205 #
206 # configure support for userspace TCP/IP LND
207 #
208 AC_DEFUN([LN_CONFIG_USOCKLND],
209 [AC_MSG_CHECKING([whether to build usocklnd])
210 AC_ARG_ENABLE([usocklnd],
211         AC_HELP_STRING([--disable-usocklnd],
212                         [disable usocklnd]),
213         [],[enable_usocklnd='yes'])
214
215 if test x$enable_usocklnd = xyes ; then
216         if test "$ENABLE_LIBPTHREAD" = "yes" ; then
217                 AC_MSG_RESULT([yes])
218                 USOCKLND="usocklnd"
219         else
220                 AC_MSG_RESULT([no (libpthread not present or disabled)])
221                 USOCKLND=""
222         fi
223 else
224         AC_MSG_RESULT([no (disabled explicitly)])
225         USOCKLND=""
226 fi
227 AC_SUBST(USOCKLND)
228 ])
229
230 #
231 # LN_CONFIG_QUADRICS
232 #
233 # check if quadrics support is in this kernel
234 #
235 AC_DEFUN([LN_CONFIG_QUADRICS],
236 [AC_MSG_CHECKING([for QsNet sources])
237 AC_ARG_WITH([qsnet],
238         AC_HELP_STRING([--with-qsnet=path],
239                        [set path to qsnet source (default=$LINUX)]),
240         [QSNET=$with_qsnet],
241         [QSNET=$LINUX])
242 AC_MSG_RESULT([$QSNET])
243
244 AC_MSG_CHECKING([if quadrics kernel headers are present])
245 if test -d $QSNET/drivers/net/qsnet ; then
246         AC_MSG_RESULT([yes])
247         QSWLND="qswlnd"
248         AC_MSG_CHECKING([for multirail EKC])
249         if test -f $QSNET/include/elan/epcomms.h; then
250                 AC_MSG_RESULT([supported])
251                 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
252         else
253                 AC_MSG_RESULT([not supported])
254                 AC_MSG_ERROR([Need multirail EKC])
255         fi
256
257         if test x$QSNET = x$LINUX ; then
258                 LB_LINUX_CONFIG([QSNET],[],[
259                         LB_LINUX_CONFIG([QSNET_MODULE],[],[
260                                 AC_MSG_WARN([QSNET is not enabled in this kernel; not building qswlnd.])
261                                 QSWLND=""
262                                 QSWCPPFLAGS=""
263                         ])
264                 ])
265         fi
266 else
267         AC_MSG_RESULT([no])
268         QSWLND=""
269         QSWCPPFLAGS=""
270 fi
271 AC_SUBST(QSWCPPFLAGS)
272 AC_SUBST(QSWLND)
273 ])
274
275
276 #
277 # LN_CONFIG_MX
278 #
279 AC_DEFUN([LN_CONFIG_MX],
280 [AC_MSG_CHECKING([whether to enable Myrinet MX support])
281 # set default
282 MXPATH="/opt/mx"
283 AC_ARG_WITH([mx],
284        AC_HELP_STRING([--with-mx=path],
285                       [build mxlnd against path]),
286        [
287                case $with_mx in
288                yes)    ENABLEMX=2
289                        ;;
290                no)     ENABLEMX=0
291                        ;;
292                *)      MXPATH=$with_mx
293                        ENABLEMX=3
294                        ;;
295                esac
296        ],[
297                ENABLEMX=1
298        ])
299 if test $ENABLEMX -eq 0; then
300        AC_MSG_RESULT([disabled])
301 elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
302               -f ${MXPATH}/include/mx_kernel_api.h -a \
303               -f ${MXPATH}/include/mx_pin.h \); then
304        AC_MSG_RESULT([no])
305        case $ENABLEMX in
306        1) ;;
307        2) AC_MSG_ERROR([Myrinet MX kernel headers not present]);;
308        3) AC_MSG_ERROR([bad --with-mx path]);;
309        *) AC_MSG_ERROR([internal error]);;
310        esac
311 else
312        MXCPPFLAGS="-I$MXPATH/include"
313        EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
314        EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
315        MXLIBS="-L$MXPATH/lib"
316        LB_LINUX_TRY_COMPILE([
317                #define MX_KERNEL 1
318                #include <mx_extensions.h>
319                #include <myriexpress.h>
320        ],[
321                mx_endpoint_t   end;
322                mx_status_t     status;
323                mx_request_t    request;
324                int             result;
325
326                mx_init();
327                mx_open_endpoint(MX_ANY_NIC, MX_ANY_ENDPOINT, 0, NULL, 0, &end);
328                mx_register_unexp_handler(end, (mx_unexp_handler_t) NULL, NULL);
329                mx_wait_any(end, MX_INFINITE, 0LL, 0LL, &status, &result);
330                mx_iconnect(end, 0LL, 0, 0, 0, NULL, &request);
331                return 0;
332        ],[
333                AC_MSG_RESULT([yes])
334                MXLND="mxlnd"
335        ],[
336                AC_MSG_RESULT([no])
337                case $ENABLEMX in
338                1) ;;
339                2) AC_MSG_ERROR([can't compile with Myrinet MX kernel headers]);;
340                3) AC_MSG_ERROR([can't compile with Myrinet MX headers under $MXPATH]);;
341                *) AC_MSG_ERROR([internal error]);;
342                esac
343                MXLND=""
344                MXCPPFLAGS=""
345        ])
346        EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
347 fi
348 AC_SUBST(MXCPPFLAGS)
349 AC_SUBST(MXLIBS)
350 AC_SUBST(MXLND)
351 ])
352
353
354
355 #
356 # LN_CONFIG_O2IB
357 #
358 AC_DEFUN([LN_CONFIG_O2IB],[
359 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
360 # set default
361 AC_ARG_WITH([o2ib],
362         AC_HELP_STRING([--with-o2ib=path],
363                        [build o2iblnd against path]),
364         [
365                 case $with_o2ib in
366                 yes)    O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
367                         ENABLEO2IB=2
368                         ;;
369                 no)     ENABLEO2IB=0
370                         ;;
371                 *)      O2IBPATHS=$with_o2ib
372                         ENABLEO2IB=3
373                         ;;
374                 esac
375         ],[
376                 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
377                 ENABLEO2IB=1
378         ])
379 if test $ENABLEO2IB -eq 0; then
380         AC_MSG_RESULT([disabled])
381 else
382         o2ib_found=false
383         for O2IBPATH in $O2IBPATHS; do
384                 if test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
385                            -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
386                            -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
387                            -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
388                         if test \( -d ${O2IBPATH}/kernel_patches -a \
389                                    -f ${O2IBPATH}/Makefile \); then
390                                 AC_MSG_RESULT([no])
391                                 AC_MSG_ERROR([you appear to be trying to use the OFED distribution's source directory (${O2IBPATH}) rather than the "development/headers" directory which is likely in ${O2IBPATH%-*}])
392                         fi
393                         o2ib_found=true
394                         break
395                 fi
396         done
397         if ! $o2ib_found; then
398                 AC_MSG_RESULT([no])
399                 case $ENABLEO2IB in
400                         1) ;;
401                         2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
402                         3) AC_MSG_ERROR([bad --with-o2ib path]);;
403                         *) AC_MSG_ERROR([internal error]);;
404                 esac
405         else
406                 O2IBCPPFLAGS="-I$O2IBPATH/include"
407                 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
408                 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
409                 EXTRA_LNET_INCLUDE="$EXTRA_LNET_INCLUDE $O2IBCPPFLAGS"
410
411                 LB_LINUX_TRY_COMPILE([
412                         #include <linux/version.h>
413                         #include <linux/pci.h>
414                         #if !HAVE_GFP_T
415                         typedef int gfp_t;
416                         #endif
417                         #include <rdma/rdma_cm.h>
418                         #include <rdma/ib_cm.h>
419                         #include <rdma/ib_verbs.h>
420                         #include <rdma/ib_fmr_pool.h>
421                 ],[
422                         struct rdma_cm_id          *cm_id;
423                         struct rdma_conn_param      conn_param;
424                         struct ib_device_attr       device_attr;
425                         struct ib_qp_attr           qp_attr;
426                         struct ib_pool_fmr          pool_fmr;
427                         enum   ib_cm_rej_reason     rej_reason;
428
429                         cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
430                         return PTR_ERR(cm_id);
431                 ],[
432                         AC_MSG_RESULT([yes])
433                         O2IBLND="o2iblnd"
434                 ],[
435                         AC_MSG_RESULT([no])
436                         case $ENABLEO2IB in
437                         1) ;;
438                         2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);;
439                         3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);;
440                         *) AC_MSG_ERROR([internal error]);;
441                         esac
442                         O2IBLND=""
443                         O2IBCPPFLAGS=""
444                 ])
445                 # we know at this point that the found OFED source is good
446                 O2IB_SYMVER=""
447                 if test $ENABLEO2IB -eq 3 ; then
448                         # OFED default rpm not handle sles10 Modules.symvers name
449                         for name in Module.symvers Modules.symvers; do
450                                 if test -f $O2IBPATH/$name; then
451                                         O2IB_SYMVER=$name;
452                                         break;
453                                 fi
454                         done
455                         if test -n "$O2IB_SYMVER"; then
456                                 AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to $PWD/$SYMVERFILE])
457                                 # strip out the existing symbols versions first
458                                 if test -f $PWD/$SYMVERFILE; then
459                                 egrep -v $(echo $(awk '{ print $2 }' $O2IBPATH/$O2IB_SYMVER) | tr ' ' '|') $PWD/$SYMVERFILE > $PWD/$SYMVERFILE.old
460                                 else
461                                     touch $PWD/$SYMVERFILE.old
462                                 fi
463                                 cat $PWD/$SYMVERFILE.old $O2IBPATH/$O2IB_SYMVER > $PWD/$SYMVERFILE
464                                 rm $PWD/$SYMVERFILE.old
465                         else
466                                 AC_MSG_ERROR([an external source tree was specified for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
467                         fi
468                 fi
469
470                 LN_CONFIG_OFED_SPEC
471                 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
472         fi
473 fi
474
475 AC_SUBST(EXTRA_LNET_INCLUDE)
476 AC_SUBST(O2IBCPPFLAGS)
477 AC_SUBST(O2IBLND)
478 ])
479
480 #
481 # LN_CONFIG_RALND
482 #
483 # check whether to use the RapidArray lnd
484 #
485 AC_DEFUN([LN_CONFIG_RALND],
486 [#### Rapid Array
487 AC_MSG_CHECKING([if RapidArray kernel headers are present])
488 # placeholder
489 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
490 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
491 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
492 LB_LINUX_TRY_COMPILE([
493         #include <linux/types.h>
494         #include <rapl.h>
495 ],[
496         RAP_RETURN          rc;
497         RAP_PVOID           dev_handle;
498
499         rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
500
501         return rc == RAP_SUCCESS ? 0 : 1;
502 ],[
503         AC_MSG_RESULT([yes])
504         RALND="ralnd"
505 ],[
506         AC_MSG_RESULT([no])
507         RALND=""
508         RACPPFLAGS=""
509 ])
510 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
511 AC_SUBST(RACPPFLAGS)
512 AC_SUBST(RALND)
513 ])
514
515
516
517 #
518 #
519 # LN_CONFIG_USERSPACE
520 #
521 # This is defined but empty because it is called from 
522 # build/autconf/lustre-build.m4 which is shared by all branches.
523 #
524 AC_DEFUN([LN_CONFIG_USERSPACE],
525 [
526 ])
527
528 # See if sysctl proc_handler wants only 5 arguments (since 2.6.32)
529 AC_DEFUN([LN_5ARGS_SYSCTL_PROC_HANDLER],
530 [AC_MSG_CHECKING([if sysctl proc_handler wants 5 args])
531 LB_LINUX_TRY_COMPILE([
532        #include <linux/sysctl.h>
533 ],[
534         struct ctl_table *table = NULL;
535        int write = 1;
536        void __user *buffer = NULL;
537        size_t *lenp = NULL;
538        loff_t *ppos = NULL;
539
540        proc_handler *proc_handler;
541        proc_handler(table, write, buffer, lenp, ppos);
542
543 ],[
544         AC_MSG_RESULT(yes)
545         AC_DEFINE(HAVE_5ARGS_SYSCTL_PROC_HANDLER, 1,
546                   [sysctl proc_handler wants 5 args])
547 ],[
548         AC_MSG_RESULT(no)
549 ])
550 ])
551
552 #
553 # LN_PROG_LINUX
554 #
555 # LNet linux kernel checks
556 #
557 AC_DEFUN([LN_PROG_LINUX],
558 [
559 LN_FUNC_DEV_GET_BY_NAME_2ARG
560 LN_CONFIG_AFFINITY
561 LN_CONFIG_BACKOFF
562 LN_CONFIG_QUADRICS
563 LN_CONFIG_O2IB
564 LN_CONFIG_RALND
565 LN_CONFIG_PTLLND
566 LN_CONFIG_MX
567 # 2.6.32
568 LN_5ARGS_SYSCTL_PROC_HANDLER
569 ])
570
571 #
572 # LN_PROG_DARWIN
573 #
574 # Darwin checks
575 #
576 AC_DEFUN([LN_PROG_DARWIN],
577 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
578 ])
579
580 #
581 # LN_PATH_DEFAULTS
582 #
583 # default paths for installed files
584 #
585 AC_DEFUN([LN_PATH_DEFAULTS],
586 [
587 ])
588
589 #
590 # LN_CONFIGURE
591 #
592 # other configure checks
593 #
594 AC_DEFUN([LN_CONFIGURE],
595 [# lnet/utils/portals.c
596 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
597 AC_CHECK_FUNCS([gethostbyname socket connect])
598
599 # lnet/utils/debug.c
600 AC_CHECK_HEADERS([linux/version.h])
601
602 AC_CHECK_TYPE([spinlock_t],
603         [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
604         [],
605         [#include <linux/spinlock.h>])
606
607 # lnet/utils/wirecheck.c
608 AC_CHECK_FUNCS([strnlen])
609
610 # --------  Check for required packages  --------------
611
612 #
613 # LC_CONFIG_READLINE
614 #
615 # Build with readline
616 #
617 AC_MSG_CHECKING([whether to enable readline support])
618 AC_ARG_ENABLE(readline,
619         AC_HELP_STRING([--disable-readline],
620                         [disable readline support]),
621         [],[enable_readline='yes'])
622 AC_MSG_RESULT([$enable_readline])
623
624 # -------- check for readline if enabled ----
625 if test x$enable_readline = xyes ; then
626         LIBS_save="$LIBS"
627         LIBS="-lncurses $LIBS"
628         AC_CHECK_LIB([readline],[readline],[
629         LIBREADLINE="-lreadline -lncurses"
630         AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
631         ],[
632         LIBREADLINE=""
633         ])
634         LIBS="$LIBS_save"
635 else
636         LIBREADLINE=""
637 fi
638 AC_SUBST(LIBREADLINE)
639
640 # -------- enable acceptor libwrap (TCP wrappers) support? -------
641 AC_MSG_CHECKING([if libwrap support is requested])
642 AC_ARG_ENABLE([libwrap],
643         AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
644         [case "${enableval}" in
645                 yes) enable_libwrap=yes ;;
646                 no) enable_libwrap=no ;;
647                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
648         esac],[enable_libwrap=no])
649 AC_MSG_RESULT([$enable_libwrap])
650 if test x$enable_libwrap = xyes ; then
651         LIBWRAP="-lwrap"
652         AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
653 else
654         LIBWRAP=""
655 fi
656 AC_SUBST(LIBWRAP)
657
658 # ----------------------------------------
659 # some tests for catamount-like systems
660 # ----------------------------------------
661 AC_ARG_ENABLE([sysio_init],
662         AC_HELP_STRING([--disable-sysio-init],
663                 [call sysio init functions when initializing liblustre]),
664         [],[enable_sysio_init=yes])
665 AC_MSG_CHECKING([whether to initialize libsysio])
666 AC_MSG_RESULT([$enable_sysio_init])
667 if test x$enable_sysio_init != xno ; then
668         AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
669 fi
670
671 AC_ARG_ENABLE([urandom],
672         AC_HELP_STRING([--disable-urandom],
673                 [disable use of /dev/urandom for liblustre]),
674         [],[enable_urandom=yes])
675 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
676 AC_MSG_RESULT([$enable_urandom])
677 if test x$enable_urandom != xno ; then
678         AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
679 fi
680
681 # -------- check for -lcap support ----
682 if test x$enable_liblustre = xyes ; then
683         AC_CHECK_LIB([cap], [cap_get_proc],
684                 [
685                         CAP_LIBS="-lcap"
686                         AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
687                 ],
688                 [
689                         CAP_LIBS=""
690                 ])
691         AC_SUBST(CAP_LIBS)
692
693 fi
694
695 LN_CONFIG_MAX_PAYLOAD
696 LN_CONFIG_UPTLLND
697 LN_CONFIG_USOCKLND
698 ])
699
700 #
701 # LN_CONDITIONALS
702 #
703 # AM_CONDITOINAL defines for lnet
704 #
705 AC_DEFUN([LN_CONDITIONALS],
706 [AM_CONDITIONAL(BUILD_QSWLND, test x$QSWLND = "xqswlnd")
707 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
708 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
709 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
710 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
711 AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
712 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
713 ])
714
715 #
716 # LN_CONFIG_FILES
717 #
718 # files that should be generated with AC_OUTPUT
719 #
720 AC_DEFUN([LN_CONFIG_FILES],
721 [AC_CONFIG_FILES([
722 lnet/Kernelenv
723 lnet/Makefile
724 lnet/autoMakefile
725 lnet/autoconf/Makefile
726 lnet/doc/Makefile
727 lnet/include/Makefile
728 lnet/include/lnet/Makefile
729 lnet/include/lnet/linux/Makefile
730 lnet/klnds/Makefile
731 lnet/klnds/autoMakefile
732 lnet/klnds/mxlnd/autoMakefile
733 lnet/klnds/mxlnd/Makefile
734 lnet/klnds/o2iblnd/Makefile
735 lnet/klnds/o2iblnd/autoMakefile
736 lnet/klnds/qswlnd/Makefile
737 lnet/klnds/qswlnd/autoMakefile
738 lnet/klnds/ralnd/Makefile
739 lnet/klnds/ralnd/autoMakefile
740 lnet/klnds/socklnd/Makefile
741 lnet/klnds/socklnd/autoMakefile
742 lnet/klnds/ptllnd/Makefile
743 lnet/klnds/ptllnd/autoMakefile
744 lnet/lnet/Makefile
745 lnet/lnet/autoMakefile
746 lnet/selftest/Makefile
747 lnet/selftest/autoMakefile
748 lnet/ulnds/Makefile
749 lnet/ulnds/autoMakefile
750 lnet/ulnds/socklnd/Makefile
751 lnet/ulnds/ptllnd/Makefile
752 lnet/utils/Makefile
753 lnet/include/lnet/darwin/Makefile
754 ])
755 ])