2007-11-14 02:39:16 +03:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2010-09-18 03:04:06 +04:00
|
|
|
# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
|
2012-06-13 14:38:28 +04:00
|
|
|
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
2007-11-14 02:39:16 +03:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
# OMPI_CHECK_SCTP(prefix, [action-if-found], [action-if-not-found])
|
|
|
|
# --------------------------------------------------------
|
|
|
|
# check if SCTP support can be found. sets prefix_{CPPFLAGS,
|
|
|
|
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
|
|
|
|
# support, otherwise executes action-if-not-found
|
|
|
|
AC_DEFUN([OMPI_CHECK_SCTP],[
|
|
|
|
AC_ARG_WITH([sctp],
|
2012-06-13 14:38:28 +04:00
|
|
|
[AC_HELP_STRING([--with-sctp(=DIR)],
|
|
|
|
[Build SCTP support, searching for libraries in DIR])])
|
2009-01-29 20:59:04 +03:00
|
|
|
OMPI_CHECK_WITHDIR([sctp], [$with_sctp], [include/netinet/sctp.h])
|
2007-11-14 02:39:16 +03:00
|
|
|
AC_ARG_WITH([sctp-libdir],
|
2012-06-13 14:38:28 +04:00
|
|
|
[AC_HELP_STRING([--with-sctp-libdir=DIR],
|
|
|
|
[Search for SCTP libraries in DIR])])
|
2007-11-14 02:39:16 +03:00
|
|
|
|
|
|
|
btl_sctp_CFLAGS="`echo $CFLAGS`"
|
2008-04-28 08:19:10 +04:00
|
|
|
#only try to build this on Solaris, Linux, Mac OS X, or some BSD variant
|
2007-11-14 02:39:16 +03:00
|
|
|
ompi_sctp_try_to_build="no"
|
2008-04-28 08:19:10 +04:00
|
|
|
ompi_sctp_api_libname="sctp"
|
2007-11-14 02:39:16 +03:00
|
|
|
case "$host" in
|
|
|
|
*linux*)
|
2012-06-13 14:38:28 +04:00
|
|
|
ompi_sctp_try_to_build="yes"
|
2007-12-15 06:28:10 +03:00
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_USE_ONE_TO_ONE_SOCKET, 0,
|
|
|
|
[Default value for socket style to use with SCTP BTL])
|
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_CONCATENATES_IOVS, 0,
|
|
|
|
[False if you can use iovec's directly with SCTP BTL])
|
2012-06-13 14:38:28 +04:00
|
|
|
;;
|
2007-11-14 02:39:16 +03:00
|
|
|
*bsd*)
|
2012-06-13 14:38:28 +04:00
|
|
|
case "$host" in
|
2012-09-13 17:25:04 +04:00
|
|
|
*freebsd[789]*|*freebsd1[0-9]*)
|
|
|
|
# FreeBSD >= 7 has SCTP in an unpatched default kernel with
|
2012-06-13 14:38:28 +04:00
|
|
|
# the SCTP API contained within libc.
|
|
|
|
ompi_sctp_api_libname="c"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# keep the default lib (sctp not c)
|
|
|
|
;;
|
|
|
|
esac
|
2008-04-28 08:19:10 +04:00
|
|
|
|
2007-11-14 02:39:16 +03:00
|
|
|
# only add -DFREEBSD once to get extra sin_len field
|
|
|
|
btl_sctp_CFLAGS="`echo $btl_sctp_CFLAGS | sed 's/-DFREEBSD//g'`"
|
|
|
|
btl_sctp_CFLAGS="$btl_sctp_CFLAGS -DFREEBSD"
|
2012-06-13 14:38:28 +04:00
|
|
|
ompi_sctp_try_to_build="yes"
|
2007-12-15 06:28:10 +03:00
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_USE_ONE_TO_ONE_SOCKET, 0,
|
|
|
|
[Default value for socket style to use with SCTP BTL])
|
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_CONCATENATES_IOVS, 0,
|
|
|
|
[False if you can use iovec's directly with SCTP BTL])
|
2012-06-13 14:38:28 +04:00
|
|
|
AC_MSG_WARN([Adding -DFREEBSD to set extra sin_len field in sockaddr.])
|
|
|
|
;;
|
2007-11-17 05:56:27 +03:00
|
|
|
# Mac OS X support for SCTP NKE. Adjustments should look like *bsd*...
|
|
|
|
*darwin*)
|
|
|
|
# only add -DFREEBSD once to get extra sin_len field
|
|
|
|
btl_sctp_CFLAGS="`echo $btl_sctp_CFLAGS | sed 's/-DFREEBSD//g'`"
|
|
|
|
btl_sctp_CFLAGS="$btl_sctp_CFLAGS -DFREEBSD"
|
2012-06-13 14:38:28 +04:00
|
|
|
ompi_sctp_try_to_build="yes"
|
2007-12-15 06:28:10 +03:00
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_USE_ONE_TO_ONE_SOCKET, 0,
|
|
|
|
[Default value for socket style to use with SCTP BTL])
|
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_CONCATENATES_IOVS, 0,
|
|
|
|
[False if you can use iovec's directly with SCTP BTL])
|
2012-06-13 14:38:28 +04:00
|
|
|
AC_MSG_WARN([Adding -DFREEBSD to set extra sin_len field in sockaddr.])
|
|
|
|
;;
|
2007-12-15 06:28:10 +03:00
|
|
|
*solaris*)
|
|
|
|
# Solaris SCTP stack makes different assumptions about one-to-many
|
|
|
|
# sockets so change the default to use one-to-one sockets
|
2012-06-13 14:38:28 +04:00
|
|
|
ompi_sctp_try_to_build="yes"
|
2007-12-15 06:28:10 +03:00
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_USE_ONE_TO_ONE_SOCKET, 1,
|
|
|
|
[Default value for socket style to use with SCTP BTL])
|
|
|
|
AC_DEFINE(OMPI_MCA_BTL_SCTP_CONCATENATES_IOVS, 1,
|
|
|
|
[False if you can use iovec's directly with SCTP BTL])
|
2012-06-13 14:38:28 +04:00
|
|
|
;;
|
2007-11-14 02:39:16 +03:00
|
|
|
*)
|
2012-06-13 14:38:28 +04:00
|
|
|
AC_MSG_WARN([Only build sctp BTL on Solaris, Linux, Mac OS X, and BSD variants])
|
|
|
|
;;
|
2007-11-14 02:39:16 +03:00
|
|
|
esac
|
|
|
|
|
2009-01-29 20:59:04 +03:00
|
|
|
OMPI_CHECK_WITHDIR([sctp-libdir], [$with_sctp_libdir], [lib${ompi_sctp_api_libname}.*])
|
|
|
|
|
2007-11-14 02:39:16 +03:00
|
|
|
AS_IF([test "$with_sctp" != "no" -a "$ompi_sctp_try_to_build" = "yes"],
|
2012-06-13 14:38:28 +04:00
|
|
|
[AS_IF([test ! -z "$with_sctp" -a "$with_sctp" != "yes"],
|
|
|
|
[ompi_check_sctp_dir="$with_sctp"])
|
|
|
|
AS_IF([test ! -z "$with_sctp_libdir" -a "$with_sctp_libdir" != "yes"],
|
|
|
|
[ompi_check_sctp_libdir="$with_sctp_libdir"])
|
|
|
|
AC_CHECK_HEADERS([netinet/in.h])
|
|
|
|
OMPI_CHECK_PACKAGE([$1],
|
|
|
|
[netinet/sctp.h],
|
|
|
|
[$ompi_sctp_api_libname],
|
|
|
|
[sctp_recvmsg],
|
|
|
|
[],
|
|
|
|
[$ompi_check_sctp_dir],
|
|
|
|
[$ompi_check_sctp_libdir],
|
|
|
|
[ompi_check_sctp_happy="yes"],
|
|
|
|
[ompi_check_sctp_happy="no"],
|
|
|
|
[
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
],
|
|
|
|
[ompi_check_sctp_happy="no"])
|
2007-11-14 02:39:16 +03:00
|
|
|
|
|
|
|
AS_IF([test "$ompi_check_sctp_happy" = "yes"],
|
2012-06-13 14:38:28 +04:00
|
|
|
[$2],
|
|
|
|
[AS_IF([test ! -z "$with_sctp" -a "$with_sctp" != "no"],
|
|
|
|
[AC_MSG_ERROR([SCTP support requested but not found. Aborting])])
|
|
|
|
$3])
|
2007-11-14 02:39:16 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# MCA_btl_sctp_CONFIG([action-if-found], [action-if-not-found])
|
|
|
|
# -----------------------------------------------------------
|
2010-09-18 03:04:06 +04:00
|
|
|
AC_DEFUN([MCA_ompi_btl_sctp_CONFIG],[
|
|
|
|
AC_CONFIG_FILES([ompi/mca/btl/sctp/Makefile])
|
|
|
|
|
2007-11-14 02:39:16 +03:00
|
|
|
OMPI_CHECK_SCTP([btl_sctp],
|
|
|
|
[btl_sctp_happy="yes"],
|
|
|
|
[btl_sctp_happy="no"])
|
|
|
|
|
|
|
|
AS_IF([test "$btl_sctp_happy" = "yes"],
|
2013-01-29 04:00:43 +04:00
|
|
|
[$1],
|
2007-11-14 02:39:16 +03:00
|
|
|
[$2])
|
|
|
|
|
|
|
|
|
|
|
|
# substitute in the things needed to build sctp
|
|
|
|
AC_SUBST([btl_sctp_CFLAGS])
|
|
|
|
AC_SUBST([btl_sctp_CPPFLAGS])
|
|
|
|
AC_SUBST([btl_sctp_LDFLAGS])
|
|
|
|
AC_SUBST([btl_sctp_LIBS])
|
|
|
|
])dnl
|