]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ofed/libmlx4/configure.in
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ofed / libmlx4 / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.57)
4 AC_INIT(libmlx4, 1.0, general@lists.openfabrics.org)
5 AC_CONFIG_SRCDIR([src/mlx4.h])
6 AC_CONFIG_AUX_DIR(config)
7 AM_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE(libmlx4, 1.0)
9 AM_PROG_LIBTOOL
10
11 AC_ARG_WITH([valgrind],
12     AC_HELP_STRING([--with-valgrind],
13         [Enable Valgrind annotations (small runtime overhead, default NO)]))
14 if test x$with_valgrind = x || test x$with_valgrind = xno; then
15     want_valgrind=no
16     AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
17 else
18     want_valgrind=yes
19     if test -d $with_valgrind; then
20         CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
21     fi
22 fi
23
24 dnl Checks for programs
25 AC_PROG_CC
26
27 dnl Checks for libraries
28 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
29     AC_MSG_ERROR([ibv_get_device_list() not found.  libmlx4 requires libibverbs.]))
30
31 dnl Checks for header files.
32 AC_CHECK_HEADER(infiniband/driver.h, [],
33     AC_MSG_ERROR([<infiniband/driver.h> not found.  libmlx4 requires libibverbs.]))
34 AC_HEADER_STDC
35 AC_CHECK_HEADER(valgrind/memcheck.h,
36     [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
37         [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
38     [if test $want_valgrind = yes; then
39         AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
40     fi])
41
42 dnl Checks for typedefs, structures, and compiler characteristics.
43 AC_C_CONST
44 AC_CHECK_SIZEOF(long)
45 AC_CHECK_MEMBER(struct ibv_context.more_ops,
46     [AC_DEFINE([HAVE_IBV_MORE_OPS], 1, [Define to 1 if more_ops is a member of ibv_context])],,
47     [#include <infiniband/verbs.h>])
48 AC_CHECK_MEMBER(struct ibv_more_ops.create_xrc_srq,
49     [AC_DEFINE([HAVE_IBV_XRC_OPS], 1, [Define to 1 if have xrc ops])],,
50     [#include <infiniband/verbs.h>])
51
52 dnl Checks for library functions
53 AC_CHECK_FUNC(ibv_read_sysfs_file, [],
54     AC_MSG_ERROR([ibv_read_sysfs_file() not found.  libmlx4 requires libibverbs >= 1.0.3.]))
55 AC_CHECK_FUNCS(ibv_dontfork_range ibv_dofork_range ibv_register_driver)
56
57 dnl Now check if for libibverbs 1.0 vs 1.1
58 dummy=if$$
59 cat <<IBV_VERSION > $dummy.c
60 #include <infiniband/driver.h>
61 IBV_DEVICE_LIBRARY_EXTENSION
62 IBV_VERSION
63 IBV_DEVICE_LIBRARY_EXTENSION=`$CC $CPPFLAGS -E $dummy.c 2> /dev/null | tail -1`
64 rm -f $dummy.c
65 AM_CONDITIONAL(HAVE_IBV_DEVICE_LIBRARY_EXTENSION,
66     test $IBV_DEVICE_LIBRARY_EXTENSION != IBV_DEVICE_LIBRARY_EXTENSION)
67 AC_SUBST(IBV_DEVICE_LIBRARY_EXTENSION)
68
69 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
70     [if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
71         ac_cv_version_script=yes
72     else
73         ac_cv_version_script=no
74     fi])
75
76 if test $ac_cv_version_script = yes; then
77     MLX4_VERSION_SCRIPT='-Wl,--version-script=$(srcdir)/src/mlx4.map'
78 else
79     MLX4_VERSION_SCRIPT=
80 fi
81 AC_SUBST(MLX4_VERSION_SCRIPT)
82
83 AC_CONFIG_FILES([Makefile libmlx4.spec])
84 AC_OUTPUT