File: configure.ac

package info (click to toggle)
libibverbs 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,288 kB
  • ctags: 2,848
  • sloc: ansic: 12,372; sh: 4,098; makefile: 119
file content (125 lines) | stat: -rw-r--r-- 4,388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([libibverbs],[1.2.1],[linux-rdma@vger.kernel.org])
AC_CONFIG_SRCDIR([src/ibverbs.h])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl Checks for programs
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_LN_S
LT_INIT

AC_ARG_WITH([valgrind],
    AS_HELP_STRING([--with-valgrind],
        [Enable Valgrind annotations (small runtime overhead, default NO)]))
if test x$with_valgrind = x || test x$with_valgrind = xno; then
    want_valgrind=no
    AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
else
    want_valgrind=yes
    if test -d $with_valgrind; then
        CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
    fi
fi

AC_ARG_WITH([resolve-neigh],
    AC_HELP_STRING([--with-resolve-neigh],
        [Enable neighbour resolution in Ethernet (default YES)]))
have_libnl=no
if  test x$with_resolve_neigh = x || test x$with_resolve_neigh = xyes; then
	PKG_CHECK_MODULES([LIBNL],[libnl-3.0],[
			   have_libnl=yes
			   AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0])
			   AC_DEFINE([HAVE_LIBNL], [1],  [Use libnl])
			   PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0])
			   LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS"
			   LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS"], [:]
			  );
	if test "$have_libnl" = no; then
		PKG_CHECK_MODULES([LIBNL], [libnl-1], [have_libnl=yes
				  AC_DEFINE([HAVE_LIBNL1], [1], [Use libnl-1])
				  AC_DEFINE([HAVE_LIBNL], [1],  [Use libnl])
				  AC_CHECK_LIB(nl, rtnl_link_vlan_get_id, [],
					AC_MSG_ERROR([rtnl_link_vlan_get_id not found.  libibverbs requires libnl.]))
				 ],[
					AC_MSG_ERROR([libibverbs requires libnl.])
				 ])
	fi
else
    AC_DEFINE([NRESOLVE_NEIGH], 1, [Define to 1 to disable resovle neigh annotations.])
fi
AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS])
AC_SUBST([LIBNL_LIBS])
AM_CONDITIONAL(NO_RESOLVE_NEIGH, test x$with_resolve_neigh = xno)

dnl Checks for libraries
AC_CHECK_LIB(dl, dlsym, [],
    AC_MSG_ERROR([dlsym() not found.  libibverbs requires libdl.]))
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
    AC_MSG_ERROR([pthread_mutex_init() not found.  libibverbs requires libpthread.]))

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER(valgrind/memcheck.h,
    [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
        [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
    [if test $want_valgrind = yes; then
        AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
    fi])
AC_CHECK_HEADERS([fcntl.h sys/socket.h])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
[[
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
]])
AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
[[
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
]])

AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
   [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
        if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
            ac_cv_feature_stream_cloexec_flag="e"
        fi
    fi])
AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])

AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
    [if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
	ac_cv_version_script=yes
    else
	ac_cv_version_script=no
    fi])

if test $ac_cv_version_script = yes; then
    LIBIBVERBS_VERSION_SCRIPT='-Wl,--version-script=$(srcdir)/src/libibverbs.map'
else
    LIBIBVERBS_VERSION_SCRIPT=
fi
AC_SUBST(LIBIBVERBS_VERSION_SCRIPT)

AC_CACHE_CHECK(for .symver assembler support, ac_cv_asm_symver_support,
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
        [[asm("symbol:\n.symver symbol, api@ABI\n");]])],
        [ac_cv_asm_symver_support=yes],
        [ac_cv_asm_symver_support=no])])
if test $ac_cv_asm_symver_support = yes; then
    AC_DEFINE([HAVE_SYMVER_SUPPORT], 1, [assembler has .symver support])
fi

AC_CONFIG_FILES([Makefile libibverbs.spec])
AC_OUTPUT