|
Packit Service |
c5cf8c |
# This macro set originally copied from hwloc.
|
|
Packit Service |
c5cf8c |
# MPICH modifications:
|
|
Packit Service |
c5cf8c |
# - renamed macro to PAC_CHECK_VISIBILITY
|
|
Packit Service |
c5cf8c |
# - removed C compiler vendor check
|
|
Packit Service |
c5cf8c |
# - sed -e 's/HWLOC/MPICH/gI'
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Copyright © 2004-2005 The Trustees of Indiana University and Indiana
|
|
Packit Service |
c5cf8c |
# University Research and Technology
|
|
Packit Service |
c5cf8c |
# Corporation. All rights reserved.
|
|
Packit Service |
c5cf8c |
# Copyright © 2004-2005 The University of Tennessee and The University
|
|
Packit Service |
c5cf8c |
# of Tennessee Research Foundation. All rights
|
|
Packit Service |
c5cf8c |
# reserved.
|
|
Packit Service |
c5cf8c |
# Copyright © 2004-2007 High Performance Computing Center Stuttgart,
|
|
Packit Service |
c5cf8c |
# University of Stuttgart. All rights reserved.
|
|
Packit Service |
c5cf8c |
# Copyright © 2004-2005 The Regents of the University of California.
|
|
Packit Service |
c5cf8c |
# All rights reserved.
|
|
Packit Service |
c5cf8c |
# Copyright © 2006-2007 Cisco Systems, Inc. All rights reserved.
|
|
Packit Service |
c5cf8c |
# and renamed/modified for hwloc:
|
|
Packit Service |
c5cf8c |
# Copyright © 2009 Inria. All rights reserved.
|
|
Packit Service |
c5cf8c |
# Copyright © 2009-2010 Université Bordeaux
|
|
Packit Service |
c5cf8c |
# Copyright © 2010-2012 Cisco Systems, Inc. All rights reserved.
|
|
Packit Service |
c5cf8c |
# See COPYING in top-level directory.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Redistribution and use in source and binary forms, with or without
|
|
Packit Service |
c5cf8c |
# modification, are permitted provided that the following conditions are
|
|
Packit Service |
c5cf8c |
# met:
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# - Redistributions of source code must retain the above copyright
|
|
Packit Service |
c5cf8c |
# notice, this list of conditions and the following disclaimer.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# - Redistributions in binary form must reproduce the above copyright
|
|
Packit Service |
c5cf8c |
# notice, this list of conditions and the following disclaimer listed
|
|
Packit Service |
c5cf8c |
# in this license in the documentation and/or other materials
|
|
Packit Service |
c5cf8c |
# provided with the distribution.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# - Neither the name of the copyright holders nor the names of its
|
|
Packit Service |
c5cf8c |
# contributors may be used to endorse or promote products derived from
|
|
Packit Service |
c5cf8c |
# this software without specific prior written permission.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# The copyright holders provide no reassurances that the source code
|
|
Packit Service |
c5cf8c |
# provided does not infringe any patent, copyright, or any other
|
|
Packit Service |
c5cf8c |
# intellectual property rights of third parties. The copyright holders
|
|
Packit Service |
c5cf8c |
# disclaim any liability to any recipient for claims brought against
|
|
Packit Service |
c5cf8c |
# recipient by any third party for infringement of that parties
|
|
Packit Service |
c5cf8c |
# intellectual property rights.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit Service |
c5cf8c |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit Service |
c5cf8c |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
Packit Service |
c5cf8c |
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
Packit Service |
c5cf8c |
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
Packit Service |
c5cf8c |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
Packit Service |
c5cf8c |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
Packit Service |
c5cf8c |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
Packit Service |
c5cf8c |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Packit Service |
c5cf8c |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit Service |
c5cf8c |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
# PAC_CHECK_VISIBILITY
|
|
Packit Service |
c5cf8c |
# --------------------------------------------------------
|
|
Packit Service |
c5cf8c |
AC_DEFUN([PAC_CHECK_VISIBILITY],[
|
|
Packit Service |
c5cf8c |
# Be safe for systems that have ancient Autoconf's (e.g., RHEL5)
|
|
Packit Service |
c5cf8c |
m4_ifdef([AC_PROG_GREP],
|
|
Packit Service |
c5cf8c |
[AC_REQUIRE([AC_PROG_GREP])],
|
|
Packit Service |
c5cf8c |
[GREP=grep])
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
# Check if the compiler has support for visibility, like some
|
|
Packit Service |
c5cf8c |
# versions of gcc, icc, Sun Studio cc.
|
|
Packit Service |
c5cf8c |
AC_ARG_ENABLE(visibility,
|
|
Packit Service |
c5cf8c |
AC_HELP_STRING([--enable-visibility],
|
|
Packit Service |
c5cf8c |
[enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it)]))
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
case ${target} in
|
|
Packit Service |
c5cf8c |
*-*-aix*|*-*-mingw*|*-*-cygwin*|*-*-hpux*)
|
|
Packit Service |
c5cf8c |
enable_visibility=no
|
|
Packit Service |
c5cf8c |
;;
|
|
Packit Service |
c5cf8c |
esac
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
mpich_visibility_define=0
|
|
Packit Service |
c5cf8c |
mpich_msg="whether to enable symbol visibility"
|
|
Packit Service |
c5cf8c |
if test "$enable_visibility" = "no"; then
|
|
Packit Service |
c5cf8c |
AC_MSG_CHECKING([$mpich_msg])
|
|
Packit Service |
c5cf8c |
AC_MSG_RESULT([no (disabled)])
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
CFLAGS_orig=$CFLAGS
|
|
Packit Service |
c5cf8c |
mpich_add=-fvisibility=hidden
|
|
Packit Service |
c5cf8c |
CFLAGS="$CFLAGS_orig $mpich_add -Werror"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
AC_MSG_CHECKING([if $CC supports $mpich_add])
|
|
Packit Service |
c5cf8c |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
__attribute__((visibility("default"))) int foo;
|
|
Packit Service |
c5cf8c |
]],[[fprintf(stderr, "Hello, world\n");]])],
|
|
Packit Service |
c5cf8c |
[AS_IF([test -s conftest.err],
|
|
Packit Service |
c5cf8c |
[$GREP -iq visibility conftest.err
|
|
Packit Service |
c5cf8c |
# If we find "visibility" in the stderr, then
|
|
Packit Service |
c5cf8c |
# assume it doesn't work
|
|
Packit Service |
c5cf8c |
AS_IF([test "$?" = "0"], [mpich_add=])])
|
|
Packit Service |
c5cf8c |
], [mpich_add=])
|
|
Packit Service |
c5cf8c |
AS_IF([test "$mpich_add" = ""],
|
|
Packit Service |
c5cf8c |
[AC_MSG_RESULT([no])],
|
|
Packit Service |
c5cf8c |
[AC_MSG_RESULT([yes])])
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
CFLAGS=$CFLAGS_orig
|
|
Packit Service |
c5cf8c |
VISIBILITY_CFLAGS=$mpich_add
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if test "$mpich_add" != "" ; then
|
|
Packit Service |
c5cf8c |
mpich_visibility_define=1
|
|
Packit Service |
c5cf8c |
AC_MSG_CHECKING([$mpich_msg])
|
|
Packit Service |
c5cf8c |
AC_MSG_RESULT([yes (via $mpich_add)])
|
|
Packit Service |
c5cf8c |
elif test "$enable_visibility" = "yes"; then
|
|
Packit Service |
c5cf8c |
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
AC_MSG_CHECKING([$mpich_msg])
|
|
Packit Service |
c5cf8c |
AC_MSG_RESULT([no (unsupported)])
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
unset mpich_add
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$mpich_visibility_define],
|
|
Packit Service |
c5cf8c |
[Whether C compiler supports symbol visibility or not])
|
|
Packit Service |
c5cf8c |
])
|