1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(libibverbs, 1.1.4, general@lists.openfabrics.org)
5 AC_CONFIG_SRCDIR([src/ibverbs.h])
6 AC_CONFIG_AUX_DIR(config)
7 AC_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE(libibverbs, 1.1.4)
9 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 dnl Checks for programs
19 AC_ARG_WITH([valgrind],
20 AC_HELP_STRING([--with-valgrind],
21 [Enable Valgrind annotations (small runtime overhead, default NO)]))
22 if test x$with_valgrind = x || test x$with_valgrind = xno; then
24 AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
27 if test -d $with_valgrind; then
28 CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
32 dnl Checks for programs
36 dnl Checks for libraries
37 AC_CHECK_LIB(dl, dlsym, [],
38 AC_MSG_ERROR([dlsym() not found. libibverbs requires libdl.]))
39 AC_CHECK_LIB(pthread, pthread_mutex_init, [],
40 AC_MSG_ERROR([pthread_mutex_init() not found. libibverbs requires libpthread.]))
42 dnl Checks for header files.
44 AC_CHECK_HEADER(valgrind/memcheck.h,
45 [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
46 [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
47 [if test $want_valgrind = yes; then
48 AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
51 dnl Checks for typedefs, structures, and compiler characteristics.
54 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
55 [if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
56 ac_cv_version_script=yes
58 ac_cv_version_script=no
61 if test $ac_cv_version_script = yes; then
62 LIBIBVERBS_VERSION_SCRIPT='-Wl,--version-script=$(srcdir)/src/libibverbs.map'
64 LIBIBVERBS_VERSION_SCRIPT=
66 AC_SUBST(LIBIBVERBS_VERSION_SCRIPT)
68 AC_CACHE_CHECK(for .symver assembler support, ac_cv_asm_symver_support,
69 [AC_TRY_COMPILE(, [asm("symbol:\n.symver symbol, api@ABI\n");],
70 ac_cv_asm_symver_support=yes,
71 ac_cv_asm_symver_support=no)])
72 if test $ac_cv_asm_symver_support = yes; then
73 AC_DEFINE([HAVE_SYMVER_SUPPORT], 1, [assembler has .symver support])
76 AC_CONFIG_FILES([Makefile libibverbs.spec])