2008-02-12 11:46:27 +03:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
2008-04-23 15:50:42 +04:00
|
|
|
# Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
2008-02-12 11:46:27 +03:00
|
|
|
# University of Stuttgart. All rights reserved.
|
2008-06-04 15:46:50 +04:00
|
|
|
# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
2008-02-12 11:46:27 +03:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
AC_DEFUN([MCA_memchecker_valgrind_COMPILE_MODE], [
|
|
|
|
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
|
|
|
|
$4="static"
|
|
|
|
AC_MSG_RESULT([$$4])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# MCA_memchecker_valgrind_CONFIG([action-if-found], [action-if-not-found])
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
AC_DEFUN([MCA_memchecker_valgrind_CONFIG],[
|
2008-10-21 07:27:43 +04:00
|
|
|
OMPI_VAR_SCOPE_PUSH([opal_memchecker_valgrind_save_CPPFLAGS opal_memchecker_valgrind_happy opal_memchecker_valgrind_CPPFLAGS])
|
2008-02-12 11:46:27 +03:00
|
|
|
|
2008-05-20 03:13:31 +04:00
|
|
|
AC_ARG_WITH([valgrind],
|
|
|
|
[AC_HELP_STRING([--with-valgrind(=DIR)],
|
|
|
|
[Directory where the valgrind software is installed])])
|
2008-02-12 11:46:27 +03:00
|
|
|
|
2008-10-18 03:04:39 +04:00
|
|
|
memchecker_valgrind_CPPFLAGS=
|
2008-10-21 07:27:43 +04:00
|
|
|
opal_memchecker_valgrind_CPPFLAGS=
|
|
|
|
opal_memchecker_valgrind_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
opal_memchecker_valgrind_happy=no
|
2008-06-04 15:46:50 +04:00
|
|
|
AS_IF([test "$with_valgrind" != "no"],
|
|
|
|
[AS_IF([test ! -z "$with_valgrind" -a "$with_valgrind" != "yes"],
|
|
|
|
[CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
|
|
|
|
opal_memchecker_valgrind_CPPFLAGS="-I$with_valgrind/include"])
|
|
|
|
AC_CHECK_HEADERS([valgrind/valgrind.h],
|
|
|
|
[AC_MSG_CHECKING([for VALGRIND_CHECK_MEM_IS_ADDRESSABLE])
|
|
|
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
|
|
|
|
#include "valgrind/memcheck.h"
|
|
|
|
]],
|
|
|
|
[[char buffer = 0xff;
|
|
|
|
VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&buffer, sizeof(buffer));]]),
|
|
|
|
[AC_MSG_RESULT([yes])
|
2008-10-21 07:27:43 +04:00
|
|
|
opal_memchecker_valgrind_happy=yes],
|
2008-06-04 15:58:41 +04:00
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([Need Valgrind version 3.2.0 or later. Can not build component.])]
|
|
|
|
[AC_MSG_RESULT([cross-compiling; assume yes...?])
|
2008-10-18 03:04:39 +04:00
|
|
|
AC_MSG_WARN([OMPI will fail to compile if you do not have Valgrind version 3.2.0 or later])
|
2008-10-21 07:27:43 +04:00
|
|
|
opal_memchecker_valgrind_happy=yes]),
|
2008-06-04 15:46:50 +04:00
|
|
|
],
|
|
|
|
[AC_MSG_WARN([valgrind.h not found])
|
|
|
|
AC_MSG_WARN([Cannot compile this component])])])
|
2008-10-21 07:27:43 +04:00
|
|
|
CPPFLAGS="$opal_memchecker_valgrind_save_CPPFLAGS"
|
2008-02-12 11:46:27 +03:00
|
|
|
|
2008-10-21 07:27:43 +04:00
|
|
|
AS_IF([test "$opal_memchecker_valgrind_happy" = "yes"],
|
|
|
|
[memchecker_valgrind_CPPFLAGS=$opal_memchecker_valgrind_CPPFLAGS
|
2008-10-18 03:04:39 +04:00
|
|
|
$1],[$2])
|
|
|
|
|
|
|
|
AC_SUBST([memchecker_valgrind_CPPFLAGS])
|
|
|
|
|
|
|
|
OMPI_VAR_SCOPE_POP
|
2008-02-12 11:46:27 +03:00
|
|
|
])dnl
|