Whamcloud - gitweb
* Changed --with-iib to allow a path to the installed Infinicon headers
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
1 #
2 # LP_CHECK_GCC_VERSION
3 #
4 # Check compiler version
5 #
6 AC_DEFUN([LP_CHECK_GCC_VERSION],
7 [AC_MSG_CHECKING([compiler version])
8 PTL_CC_VERSION=`$CC --version | awk '/^gcc/{print $ 3}'`
9 PTL_MIN_CC_VERSION="3.2.2"
10 v2n() {
11         awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
12 }
13 if test -z "$PTL_CC_VERSION" -o \
14         `echo $PTL_CC_VERSION | v2n` -ge `echo $PTL_MIN_CC_VERSION | v2n`; then
15         AC_MSG_RESULT([ok])
16 else
17         AC_MSG_RESULT([Buggy compiler found])
18         AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
19 fi
20 ])
21
22 #
23 # LP_CONFIG_ZEROCOPY
24 #
25 # check if zerocopy is available/wanted
26 #
27 AC_DEFUN([LP_CONFIG_ZEROCOPY],
28 [AC_MSG_CHECKING([for zero-copy TCP support])
29 AC_ARG_ENABLE([zerocopy],
30         AC_HELP_STRING([--disable-zerocopy],
31                        [disable socknal zerocopy]),
32         [],[enable_zerocopy='yes'])
33 if test x$enable_zerocopy = xno ; then
34         AC_MSG_RESULT([no (by request)])
35 else
36         ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
37         if test "$ZCCD" != 0 ; then
38                 AC_DEFINE(SOCKNAL_ZC, 1, [use zero-copy TCP])
39                 AC_MSG_RESULT(yes)
40         else
41                 AC_MSG_RESULT([no (no kernel support)])
42         fi
43 fi
44 ])
45
46 #
47 # LP_CONFIG_AFFINITY
48 #
49 # check if cpu affinity is available/wanted
50 #
51 AC_DEFUN([LP_CONFIG_AFFINITY],
52 [AC_ARG_ENABLE([affinity],
53         AC_HELP_STRING([--disable-affinity],
54                        [disable process/irq affinity]),
55         [],[enable_affinity='yes'])
56
57 AC_MSG_CHECKING([for CPU affinity support])
58 if test x$enable_affinity = xno ; then
59         AC_MSG_RESULT([no (by request)])
60 else
61         LB_LINUX_TRY_COMPILE([
62                 #include <linux/sched.h>
63         ],[
64                 struct task_struct t;
65                 #ifdef CPU_ARRAY_SIZE
66                 cpumask_t m;
67                 #else
68                 unsigned long m;
69                 #endif
70                 set_cpus_allowed(&t, m);
71         ],[
72                 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
73                 AC_MSG_RESULT([yes])
74         ],[
75                 AC_MSG_RESULT([no (no kernel support)])
76         ])
77 fi
78 ])
79
80 #
81 # LP_CONFIG_QUADRICS
82 #
83 # check if quadrics support is in this kernel
84 #
85 AC_DEFUN([LP_CONFIG_QUADRICS],
86 [AC_MSG_CHECKING([for QsNet sources])
87 AC_ARG_WITH([qsnet],
88         AC_HELP_STRING([--with-qsnet=path],
89                        [set path to qsnet source (default=$LINUX)]),
90         [QSNET=$with_qsnet],
91         [QSNET=$LINUX])
92 AC_MSG_RESULT([$QSNET])
93
94 AC_MSG_CHECKING([if quadrics kernel headers are present])
95 if test -d $QSNET/drivers/net/qsnet ; then
96         AC_MSG_RESULT([yes])
97         QSWNAL="qswnal"
98         AC_MSG_CHECKING([for multirail EKC])
99         if test -f $QSNET/include/elan/epcomms.h; then
100                 AC_MSG_RESULT([supported])
101                 QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
102         else
103                 AC_MSG_RESULT([not supported])
104                 if test -d $QSNET/drivers/net/qsnet/include; then
105                         QSWCPPFLAGS="-I$QSNET/drivers/net/qsnet/include"
106                 else
107                         QSWCPPFLAGS="-I$QSNET/include/linux"
108                 fi
109         fi
110 else
111         AC_MSG_RESULT([no])
112         QSWNAL=""
113         QSWCPPFLAGS=""
114 fi
115 AC_SUBST(QSWCPPFLAGS)
116 AC_SUBST(QSWNAL)
117 ])
118
119 #
120 # LP_CONFIG_GM
121 #
122 # check if GM support is available
123 #
124 AC_DEFUN([LP_CONFIG_GM],
125 [LB_ARG_LIBS_INCLUDES([Myrinet],[gm])
126 if test x$gm_includes != x ; then
127         GMCPPFLAGS="-I$gm_includes"
128         if test -d "$gm/drivers" ; then
129                 GMCPPFLAGS="$GMCPPFLAGS -I$gm/drivers -I$gm/drivers/linux/gm"
130         fi
131 fi
132 AC_SUBST(GMCPPFLAGS)
133
134 if test x$gm_libs != x ; then
135         GMLIBS="-L$gm_libs"
136 fi
137 AC_SUBST(GMLIBS)
138
139 ENABLE_GM=0
140 if test x$gm != x ; then
141         GMNAL="gmnal"
142         ENABLE_GM=1
143 fi
144 AC_SUBST(GMNAL)
145 AC_SUBST(ENABLE_GM)
146 ])
147
148 #
149 # LP_CONFIG_OPENIB
150 #
151 # check for OpenIB in the kernel
152 AC_DEFUN([LP_CONFIG_OPENIB],[
153 AC_MSG_CHECKING([whether to enable OpenIB support])
154 # set default
155 OPENIBPATH="$LINUX/drivers/infiniband"
156 AC_ARG_WITH([openib],
157         AC_HELP_STRING([--with-openib=path],
158                        [build openibnal against path]),
159         [
160                 case $with_openib in
161                 yes)    ENABLEOPENIB=2
162                         ;;
163                 no)     ENABLEOPENIB=0
164                         ;;
165                 *)      OPENIBPATH="$with_openib"
166                         ENABLEOPENIB=3
167                         ;;
168                 esac
169         ],[
170                 ENABLEOPENIB=1
171         ])
172 if test $ENABLEOPENIB -eq 0; then
173         AC_MSG_RESULT([disabled])
174 elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
175                -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
176                -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
177         AC_MSG_RESULT([no])
178         case $ENABLEOPENIB in
179         1) ;;
180         2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
181         3) AC_MSG_ERROR([bad --with-openib path]);;
182         *) AC_MSG_ERROR([internal error]);;
183         esac
184 else
185         case $ENABLEOPENIB in
186         1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
187         3)   OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
188         *)   AC_MSG_RESULT([no])
189              AC_MSG_ERROR([internal error]);;
190         esac
191         EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
192         EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
193         LB_LINUX_TRY_COMPILE([
194                 #include <ts_ib_core.h>
195                 #include <ts_ib_cm.h>
196                 #include <ts_ib_sa_client.h>
197         ],[
198                 struct ib_device_properties dev_props;
199                 struct ib_cm_active_param   cm_active_params;
200                 tTS_IB_CLIENT_QUERY_TID     tid;
201                 int                         enum1 = IB_QP_ATTRIBUTE_STATE;
202                 int                         enum2 = IB_ACCESS_LOCAL_WRITE;
203                 int                         enum3 = IB_CQ_CALLBACK_INTERRUPT;
204                 int                         enum4 = IB_CQ_PROVIDER_REARM;
205                 return 0;
206         ],[
207                 AC_MSG_RESULT([yes])
208                 OPENIBNAL="openibnal"
209         ],[
210                 AC_MSG_RESULT([no])
211                 case $ENABLEOPENIB in
212                 1) ;;
213                 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
214                 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
215                 *) AC_MSG_ERROR([internal error]);;
216                 esac
217                 OPENIBNAL=""
218                 OPENIBCPPFLAGS=""
219         ])
220         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
221 fi
222 AC_SUBST(OPENIBCPPFLAGS)
223 AC_SUBST(OPENIBNAL)
224 ])
225
226 #
227 # LP_CONFIG_IIB
228 #
229 # check for infinicon infiniband support
230 #
231 #
232 # LP_CONFIG_IIB
233 #
234 # check for infinicon infiniband support
235 #
236 AC_DEFUN([LP_CONFIG_IIB],[
237 AC_MSG_CHECKING([whether to enable Infinicon support])
238 # set default
239 IIBPATH="/usr/include"
240 AC_ARG_WITH([iib],
241         AC_HELP_STRING([--with-iib=path],
242                        [build iibnal against path]),
243         [
244                 case $with_iib in
245                 yes)    ENABLEIIB=2
246                         ;;
247                 no)     ENABLEIIB=0
248                         ;;
249                 *)      IIBPATH="${with_iib}/include"
250                         ENABLEIIB=3
251                         ;;
252                 esac
253         ],[
254                 ENABLEIIB=1
255         ])
256 if test $ENABLEIIB -eq 0; then
257         AC_MSG_RESULT([disabled])
258 elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then
259         AC_MSG_RESULT([no])
260         case $ENABLEIIB in
261         1) ;;
262         2) AC_MSG_ERROR([default Infinicon headers not present]);;
263         3) AC_MSG_ERROR([bad --with-iib path]);;
264         *) AC_MSG_ERROR([internal error]);;
265         esac
266 else
267         IIBCPPFLAGS="-I$IIBPATH"
268         if test $IIBPATH != "/usr/include"; then
269                 # we need /usr/include come what may
270                 IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include"
271         fi
272         EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
273         EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS"
274         LB_LINUX_TRY_COMPILE([
275                 #include <linux/iba/ibt.h>
276         ],[
277                 IBT_INTERFACE_UNION interfaces;
278                 FSTATUS             rc;
279
280                  rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2,
281                                                &interfaces);
282
283                 return rc == FSUCCESS ? 0 : 1;
284         ],[
285                 AC_MSG_RESULT([yes])
286                 IIBNAL="iibnal"
287         ],[
288                 AC_MSG_RESULT([no])
289                 case $ENABLEIIB in
290                 1) ;;
291                 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);;
292                 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);;
293                 *) AC_MSG_ERROR([internal error]);;
294                 esac
295                 IIBNAL=""
296                 IIBCPPFLAGS=""
297         ])
298         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
299 fi
300 AC_SUBST(IIBCPPFLAGS)
301 AC_SUBST(IIBNAL)
302 ])
303
304 #
305 # LP_CONFIG_VIB
306 #
307 # check for Voltaire infiniband support
308 #
309 AC_DEFUN([LP_CONFIG_VIB],
310 [AC_MSG_CHECKING([whether to enable Voltaire IB support])
311 VIBPATH=""
312 AC_ARG_WITH([vib],
313         AC_HELP_STRING([--with-vib=path],
314                        [build vibnal against path]),
315         [
316                 case $with_vib in
317                 no)     AC_MSG_RESULT([no]);;
318                 *)      VIBPATH="${with_vib}/src/nvigor/ib-code"
319                         if test -d "$with_vib" -a -d "$VIBPATH"; then
320                                 AC_MSG_RESULT([yes])
321                         else
322                                 AC_MSG_RESULT([no])
323                                 AC_MSG_ERROR([No directory $VIBPATH])
324                         fi;;
325                 esac
326         ],[
327                 AC_MSG_RESULT([no])
328         ])
329 if test -z "$VIBPATH"; then
330         VIBNAL=""
331 else
332         VIBCPPFLAGS="-I${VIBPATH}/include -I${VIBPATH}/cm"
333         EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
334         EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS"
335         LB_LINUX_TRY_COMPILE([
336                 #include <linux/list.h>
337                 #include <asm/byteorder.h>
338                 #ifdef __BIG_ENDIAN
339                 # define CPU_BE 1
340                 # define CPU_LE 0
341                 #endif
342                 #ifdef __LITTLE_ENDIAN
343                 # define CPU_BE 0
344                 # define CPU_LE 1
345                 #endif
346                 #include <vverbs.h>
347                 #include <ib-cm.h>
348                 #include <ibat.h>
349         ],[
350                 vv_hca_h_t       kib_hca;
351                 vv_return_t      vvrc;
352                 cm_cep_handle_t  cep;
353                 ibat_arp_data_t  arp_data;
354                 ibat_stat_t      ibatrc;
355
356                 vvrc = vv_hca_open("ANY_HCA", NULL, &kib_hca);
357                 cep = cm_create_cep(cm_cep_transp_rc);
358                 ibatrc = ibat_get_ib_data((uint32_t)0, (uint32_t)0,
359                                           ibat_paths_primary, &arp_data,
360                                           (ibat_get_ib_data_reply_fn_t)NULL,
361                                           NULL, 0);
362                 return 0;
363         ],[
364                 VIBNAL="vibnal"
365         ],[
366                 AC_MSG_ERROR([can't compile vibnal with given path])
367         ])
368         EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
369 fi
370 AC_SUBST(VIBCPPFLAGS)
371 AC_SUBST(VIBNAL)
372 ])
373
374 #
375 # LP_CONFIG_RANAL
376 #
377 # check whether to use the RapidArray nal
378 #
379 AC_DEFUN([LP_CONFIG_RANAL],
380 [#### Rapid Array
381 AC_MSG_CHECKING([if RapidArray kernel headers are present])
382 # placeholder
383 RACPPFLAGS="-I${LINUX}/drivers/xd1/include"
384 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
385 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $RACPPFLAGS"
386 LB_LINUX_TRY_COMPILE([
387         #include <linux/types.h>
388         #include <rapl.h>
389 ],[
390         RAP_RETURN          rc;
391         RAP_PVOID           dev_handle;
392
393         rc = RapkGetDeviceByIndex(0, NULL, &dev_handle);
394
395         return rc == RAP_SUCCESS ? 0 : 1;
396 ],[
397         AC_MSG_RESULT([yes])
398         RANAL="ranal"
399 ],[
400         AC_MSG_RESULT([no])
401         RANAL=""
402         RACPPFLAGS=""
403 ])
404 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
405 AC_SUBST(RACPPFLAGS)
406 AC_SUBST(RANAL)
407 ])
408
409 #
410 # LP_STRUCT_PAGE_LIST
411 #
412 # 2.6.4 no longer has page->list
413 #
414 AC_DEFUN([LP_STRUCT_PAGE_LIST],
415 [AC_MSG_CHECKING([if struct page has a list field])
416 LB_LINUX_TRY_COMPILE([
417         #include <linux/mm.h>
418 ],[
419         struct page page;
420         &page.list;
421 ],[
422         AC_MSG_RESULT([yes])
423         AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
424 ],[
425         AC_MSG_RESULT([no])
426 ])
427 ])
428
429 #
430 # LP_STRUCT_SIGHAND
431 #
432 # red hat 2.4 adds sighand to struct task_struct
433 #
434 AC_DEFUN([LP_STRUCT_SIGHAND],
435 [AC_MSG_CHECKING([if task_struct has a sighand field])
436 LB_LINUX_TRY_COMPILE([
437         #include <linux/sched.h>
438 ],[
439         struct task_struct p;
440         p.sighand = NULL;
441 ],[
442         AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
443         AC_MSG_RESULT([yes])
444 ],[
445         AC_MSG_RESULT([no])
446 ])
447 ])
448
449 #
450 # LP_FUNC_CPU_ONLINE
451 #
452 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
453 #
454 AC_DEFUN([LP_FUNC_CPU_ONLINE],
455 [AC_MSG_CHECKING([if kernel defines cpu_online()])
456 LB_LINUX_TRY_COMPILE([
457         #include <linux/sched.h>
458 ],[
459         cpu_online(0);
460 ],[
461         AC_MSG_RESULT([yes])
462         AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
463 ],[
464         AC_MSG_RESULT([no])
465 ])
466 ])
467
468 #
469 # LP_TYPE_CPUMASK_T
470 #
471 # same goes for cpumask_t
472 #
473 AC_DEFUN([LP_TYPE_CPUMASK_T],
474 [AC_MSG_CHECKING([if kernel defines cpumask_t])
475 LB_LINUX_TRY_COMPILE([
476         #include <linux/sched.h>
477 ],[
478         return sizeof (cpumask_t);
479 ],[
480         AC_MSG_RESULT([yes])
481         AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
482 ],[
483         AC_MSG_RESULT([no])
484 ])
485 ])
486
487 #
488 # LP_FUNC_SHOW_TASK
489 #
490 # we export show_task(), but not all kernels have it (yet)
491 #
492 AC_DEFUN([LP_FUNC_SHOW_TASK],
493 [AC_MSG_CHECKING([if kernel exports show_task])
494 have_show_task=0
495 for file in ksyms sched ; do
496         if grep -q "EXPORT_SYMBOL(show_task)" \
497                  "$LINUX/kernel/$file.c" 2>/dev/null ; then
498                 have_show_task=1
499                 break
500         fi
501 done
502 if test x$have_show_task = x1 ; then
503         AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
504         AC_MSG_RESULT([yes])
505 else
506         AC_MSG_RESULT([no])
507 fi
508 ])
509
510 #
511 # LP_PROG_LINUX
512 #
513 # Portals linux kernel checks
514 #
515 AC_DEFUN([LP_PROG_LINUX],
516 [LP_CHECK_GCC_VERSION
517
518 LP_CONFIG_ZEROCOPY
519 LP_CONFIG_AFFINITY
520 LP_CONFIG_QUADRICS
521 LP_CONFIG_GM
522 LP_CONFIG_OPENIB
523 LP_CONFIG_VIB
524 LP_CONFIG_IIB
525 LP_CONFIG_RANAL
526
527 LP_STRUCT_PAGE_LIST
528 LP_STRUCT_SIGHAND
529 LP_FUNC_CPU_ONLINE
530 LP_TYPE_CPUMASK_T
531 LP_FUNC_SHOW_TASK
532 ])
533
534 #
535 # LP_PROG_DARWIN
536 #
537 # Darwin checks
538 #
539 AC_DEFUN([LP_PROG_DARWIN],
540 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
541 ])
542
543 #
544 # LP_PATH_DEFAULTS
545 #
546 # default paths for installed files
547 #
548 AC_DEFUN([LP_PATH_DEFAULTS],
549 [
550 ])
551
552 #
553 # LP_CONFIGURE
554 #
555 # other configure checks
556 #
557 AC_DEFUN([LP_CONFIGURE],
558 [# portals/utils/portals.c
559 AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h])
560 AC_CHECK_FUNCS([gethostbyname socket connect])
561
562 # portals/utils/debug.c
563 AC_CHECK_HEADERS([linux/version.h])
564
565 AC_CHECK_TYPE([spinlock_t],
566         [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
567         [],
568         [#include <linux/spinlock.h>])
569
570 # portals/utils/wirecheck.c
571 AC_CHECK_FUNCS([strnlen])
572
573 # --------  Check for required packages  --------------
574
575 LIBS_save="$LIBS"
576 LIBS="-lncurses $LIBS"
577 AC_CHECK_LIB([readline],[readline],[
578         LIBREADLINE="-lreadline -lncurses"
579         AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
580 ],[
581         LIBREADLINE=""
582 ])
583 LIBS="$LIBS_save"
584 AC_SUBST(LIBREADLINE)
585
586 AC_MSG_CHECKING([if efence debugging support is requested])
587 AC_ARG_ENABLE(efence,
588         AC_HELP_STRING([--enable-efence],
589                         [use efence library]),
590         [],[enable_efence='no'])
591 AC_MSG_RESULT([$enable_efence])
592 if test "$enable_efence" = "yes" ; then
593         LIBEFENCE="-lefence"
594         AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
595 else 
596         LIBEFENCE=""
597 fi
598 AC_SUBST(LIBEFENCE)
599
600 # -------- enable acceptor libwrap (TCP wrappers) support? -------
601 AC_MSG_CHECKING([if libwrap support is requested])
602 AC_ARG_ENABLE([libwrap],
603         AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
604         [case "${enableval}" in
605                 yes) enable_libwrap=yes ;;
606                 no) enable_libwrap=no ;;
607                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
608         esac],[enable_libwrap=no])
609 AC_MSG_RESULT([$enable_libwrap])
610 if test x$enable_libwrap = xyes ; then
611         LIBWRAP="-lwrap"
612         AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
613 else
614         LIBWRAP=""
615 fi
616 AC_SUBST(LIBWRAP)
617
618 # ----------------------------------------
619 # some tests for catamount-like systems
620 # ----------------------------------------
621 AC_ARG_ENABLE([sysio_init],
622         AC_HELP_STRING([--disable-sysio-init],
623                 [call sysio init functions when initializing liblustre]),
624         [],[enable_sysio_init=yes])
625 AC_MSG_CHECKING([whether to initialize libsysio])
626 AC_MSG_RESULT([$enable_sysio_init])
627 if test x$enable_sysio_init != xno ; then
628         AC_DEFINE([INIT_SYSIO], 1, [call sysio init functions])
629 fi
630
631 AC_ARG_ENABLE([urandom],
632         AC_HELP_STRING([--disable-urandom],
633                 [disable use of /dev/urandom for liblustre]),
634         [],[enable_urandom=yes])
635 AC_MSG_CHECKING([whether to use /dev/urandom for liblustre])
636 AC_MSG_RESULT([$enable_urandom])
637 if test x$enable_urandom != xno ; then
638         AC_DEFINE([LIBLUSTRE_USE_URANDOM], 1, [use /dev/urandom for random data])
639 fi
640
641 # -------- check for -lcap and -lpthread ----
642 if test x$enable_liblustre = xyes ; then
643         AC_CHECK_LIB([cap], [cap_get_proc],
644                 [
645                         CAP_LIBS="-lcap"
646                         AC_DEFINE([HAVE_LIBCAP], 1, [use libcap])
647                 ],
648                 [CAP_LIBS=""])
649         AC_SUBST(CAP_LIBS)
650         AC_CHECK_LIB([pthread], [pthread_create],
651                 [
652                         PTHREAD_LIBS="-lpthread"
653                         AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
654                 ],
655                 [PTHREAD_LIBS=""])
656         AC_SUBST(PTHREAD_LIBS)
657 fi
658 ])
659
660 #
661 # LP_CONDITIONALS
662 #
663 # AM_CONDITOINAL defines for portals
664 #
665 AC_DEFUN([LP_CONDITIONALS],
666 [AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
667 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
668 AM_CONDITIONAL(BUILD_OPENIBNAL, test x$OPENIBNAL = "xopenibnal")
669 AM_CONDITIONAL(BUILD_IIBNAL, test x$IIBNAL = "xiibnal")
670 AM_CONDITIONAL(BUILD_VIBNAL, test x$VIBNAL = "xvibnal")
671 AM_CONDITIONAL(BUILD_RANAL, test x$RANAL = "xranal")
672 ])
673
674 #
675 # LP_CONFIG_FILES
676 #
677 # files that should be generated with AC_OUTPUT
678 #
679 AC_DEFUN([LP_CONFIG_FILES],
680 [AC_CONFIG_FILES([
681 portals/Kernelenv
682 portals/Makefile
683 portals/autoMakefile
684 portals/autoconf/Makefile
685 portals/doc/Makefile
686 portals/include/Makefile
687 portals/include/libcfs/Makefile
688 portals/include/libcfs/linux/Makefile
689 portals/include/portals/Makefile
690 portals/include/portals/linux/Makefile
691 portals/knals/Makefile
692 portals/knals/autoMakefile
693 portals/knals/gmnal/Makefile
694 portals/knals/gmnal/autoMakefile
695 portals/knals/openibnal/Makefile
696 portals/knals/openibnal/autoMakefile
697 portals/knals/iibnal/Makefile
698 portals/knals/iibnal/autoMakefile
699 portals/knals/vibnal/Makefile
700 portals/knals/vibnal/autoMakefile
701 portals/knals/lonal/Makefile
702 portals/knals/lonal/autoMakefile
703 portals/knals/qswnal/Makefile
704 portals/knals/qswnal/autoMakefile
705 portals/knals/ranal/Makefile
706 portals/knals/ranal/autoMakefile
707 portals/knals/socknal/Makefile
708 portals/knals/socknal/autoMakefile
709 portals/libcfs/Makefile
710 portals/libcfs/autoMakefile
711 portals/libcfs/linux/Makefile
712 portals/portals/Makefile
713 portals/portals/autoMakefile
714 portals/router/Makefile
715 portals/router/autoMakefile
716 portals/tests/Makefile
717 portals/tests/autoMakefile
718 portals/unals/Makefile
719 portals/utils/Makefile
720 ])
721 case $lb_target_os in
722         darwin)
723                 AC_CONFIG_FILES([
724 portals/include/libcfs/darwin/Makefile
725 portals/include/portals/darwin/Makefile
726 portals/libcfs/darwin/Makefile
727 ])
728                 ;;
729 esac
730 ])