1# -*- shell-script -*-
2#
3# Copyright (c) 2004-2006 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) 2010      Cisco Systems, Inc.  All rights reserved.
14# Copyright (c) 2013      Sandia National Laboratories.  All rights reserved.
15# $COPYRIGHT$
16#
17# Additional copyrights may follow
18#
19# $HEADER$
20#
21
22# MCA_ompi_mtl_portals4_POST_CONFIG(will_build)
23# ----------------------------------------
24# Only require the tag if we're actually going to be built
25AC_DEFUN([MCA_ompi_mtl_portals4_POST_CONFIG], [
26    AS_IF([test "$1" = "1"], [OMPI_REQUIRE_ENDPOINT_TAG([PORTALS4])])
27])dnl
28
29# MCA_mtl_portals4_CONFIG(action-if-can-compile,
30#                        [action-if-cant-compile])
31# ------------------------------------------------
32AC_DEFUN([MCA_ompi_mtl_portals4_CONFIG],[
33    AC_CONFIG_FILES([ompi/mca/mtl/portals4/Makefile])
34
35    OPAL_CHECK_PORTALS4([mtl_portals4],
36                     [mtl_portals4_happy="yes"],
37                     [mtl_portals4_happy="no"])
38
39    AS_IF([test "$mtl_portals4_happy" = "yes"],
40          [$1],
41          [$2])
42
43    # need to propogate CPPFLAGS to all of OMPI
44    AS_IF([test "$DIRECT_mtl" = "portals4"],
45          [mtl_portals4_WRAPPER_EXTRA_CPPFLAGS="$mtl_portals4_CPPFLAGS"
46           CPPFLAGS="$CPPFLAGS $mtl_portals4_CPPFLAGS"])
47
48    AC_ARG_ENABLE([mtl-portals4-flow-control],
49       [AC_HELP_STRING([--enable-mtl-portals4-flow-control],
50           [enable flow control for Portals 4 MTL (default: disabled)])])
51    AC_MSG_CHECKING([whether to enable flow control])
52    if test "$enable_mtl_portals4_flow_control" != "no"; then
53        AC_MSG_RESULT([yes])
54        mtl_portals4_flow_control_enabled=1
55    else
56        AC_MSG_RESULT([no])
57        mtl_portals4_flow_control_enabled=0
58    fi
59    AC_DEFINE_UNQUOTED([OMPI_MTL_PORTALS4_FLOW_CONTROL],
60        [$mtl_portals4_flow_control_enabled],
61        [Enable flow control for Portals4 MTL])
62    AM_CONDITIONAL([OMPI_MTL_PORTALS4_FLOW_CONTROL],
63        [test "$mtl_portals4_flow_control_enabled" = "1"])
64
65    # substitute in the things needed to build portals4
66    AC_SUBST([mtl_portals4_CPPFLAGS])
67    AC_SUBST([mtl_portals4_LDFLAGS])
68    AC_SUBST([mtl_portals4_LIBS])
69])dnl
70