1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(libibumad, 1.3.0, general@lists.openfabrics.org)
5 AC_CONFIG_SRCDIR([src/umad.c])
6 AC_CONFIG_AUX_DIR(config)
7 AM_CONFIG_HEADER(config.h)
10 AC_SUBST(RELEASE, ${RELEASE:-unknown})
11 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
13 dnl the library version info is available in the file: libibumad.ver
14 ibumad_api_version=`grep LIBVERSION $srcdir/libibumad.ver | sed 's/LIBVERSION=//'`
15 if test -z $ibumad_api_version; then
16 ibumad_api_version=1:0:0
18 AC_SUBST(ibumad_api_version)
20 AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries],
21 [ if test x$enableval = xno ; then
26 AC_ARG_WITH([valgrind],
27 AC_HELP_STRING([--with-valgrind],
28 [Enable Valgrind annotations (small runtime overhead, default NO)]))
29 if test x$with_valgrind = x || test x$with_valgrind = xno; then
31 AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
34 if test -d $with_valgrind; then
35 CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
39 dnl Checks for programs
47 if test "$disable_libcheck" != "yes"
49 dnl Checks for libraries
50 AC_CHECK_LIB(ibcommon, sys_read_string, [],
51 AC_MSG_ERROR([sys_read_string() not found. libibumad requires libibcommon.]))
54 dnl Checks for header files.
57 AC_CHECK_HEADERS([fcntl.h netinet/in.h stdlib.h string.h sys/ioctl.h unistd.h])
58 if test "$disable_libcheck" != "yes"
60 AC_CHECK_HEADER(infiniband/common.h, [],
61 AC_MSG_ERROR([<infiniband/common.h> not found. libibumad requires libibcommon.])
65 dnl Checks for library functions
66 AC_PROG_GCC_TRADITIONAL
68 AC_CHECK_FUNCS([memset])
70 dnl Checks for typedefs, structures, and compiler characteristics.
73 AC_CHECK_HEADER(valgrind/memcheck.h,
74 [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
75 [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
76 [if test $want_valgrind = yes; then
77 AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
80 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
81 if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
82 ac_cv_version_script=yes
84 ac_cv_version_script=no
87 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
89 AC_CONFIG_FILES([Makefile libibumad.spec])