1# -*- shell-script -*-
2#
3# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4#                         University Research and Technology
5#                         Corporation.  All rights reserved.
6# Copyright (c) 2004-2005 The University of Tennessee and The University
7#                         of Tennessee Research Foundation.  All rights
8#                         reserved.
9# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10#                         University of Stuttgart.  All rights reserved.
11# Copyright (c) 2004-2005 The Regents of the University of California.
12#                         All rights reserved.
13# Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
14# $COPYRIGHT$
15#
16# Additional copyrights may follow
17#
18# $HEADER$
19#
20
21# MCA_oob_ud_CONFIG([action-if-found], [action-if-not-found])
22# -----------------------------------------------------------
23AC_DEFUN([MCA_orte_oob_ud_CONFIG],[
24    # We need to know if we have verbs support
25    AC_REQUIRE([OPAL_CHECK_VERBS_DIR])
26
27    AC_CONFIG_FILES([orte/mca/oob/ud/Makefile])
28
29    # JMS Still have problems with AC_ARG ENABLE not yet having been
30    # called or CHECK_WITHDIR'ed.
31
32    orte_oob_ud_check_save_CPPFLAGS=$CPPFLAGS
33    orte_oob_ud_check_save_LDFLAGS=$LDFLAGS
34    orte_oob_ud_check_save_LIBS=$LIBS
35
36    OPAL_CHECK_PACKAGE([orte_oob_ud],
37                       [infiniband/verbs.h],
38                       [ibverbs],
39                       [ibv_open_device],
40                       [],
41                       [$opal_verbs_dir],
42                       [$opal_verbs_libdir],
43                       [orte_oob_ud_check_happy=yes],
44                       [orte_oob_ud_check_happy=no])
45
46    CPPFLAGS=$orte_oob_ud_check_save_CPPFLAGS
47    LDFLAGS=$orte_oob_ud_check_save_LDFLAGS
48    LIBS=$orte_oob_ud_check_save_LIBS
49
50    AS_IF([test "$orte_oob_ud_check_happy" = "yes" && test "$opal_want_verbs" != "no"],
51          [$1],
52          [AS_IF([test "$opal_want_verbs" = "yes"],
53                 [AC_MSG_WARN([--with-verbs specified, but cannot build this component])
54                  AC_MSG_ERROR([Cannot continue])
55                 ])
56           $2])
57
58    # substitute in the things needed to build this component
59    AC_SUBST([orte_oob_ud_CFLAGS])
60    AC_SUBST([orte_oob_ud_CPPFLAGS])
61    AC_SUBST([orte_oob_ud_LDFLAGS])
62    AC_SUBST([orte_oob_ud_LIBS])
63])dnl
64