Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_mpip.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_MPIP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for mpiP: Lightweight, Scalable MPI Profiling
  12. # (http://mpip.sourceforge.net/)
  13. #
  14. # Provides a --with-mpiP=DIR option. Searches --with-mpiP location and the
  15. # usual places for mpiP and required libraries. Marks MPIP as a precious
  16. # environment variable.
  17. #
  18. # On success, sets MPIP_LDFLAGS, MPIP_LIBS, #defines HAVE_MPIP, and calls
  19. # ACTION-IF-FOUND. When ACTION-IF-NOT-FOUND is not specified, the default
  20. # behavior is for configure to fail.
  21. #
  22. # LICENSE
  23. #
  24. # Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
  25. #
  26. # This program is free software: you can redistribute it and/or modify it
  27. # under the terms of the GNU General Public License as published by the
  28. # Free Software Foundation, either version 3 of the License, or (at your
  29. # option) any later version.
  30. #
  31. # This program is distributed in the hope that it will be useful, but
  32. # WITHOUT ANY WARRANTY; without even the implied warranty of
  33. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  34. # Public License for more details.
  35. #
  36. # You should have received a copy of the GNU General Public License along
  37. # with this program. If not, see <https://www.gnu.org/licenses/>.
  38. #
  39. # As a special exception, the respective Autoconf Macro's copyright owner
  40. # gives unlimited permission to copy, distribute and modify the configure
  41. # scripts that are the output of Autoconf when processing the Macro. You
  42. # need not follow the terms of the GNU General Public License when using
  43. # or distributing such scripts, even though portions of the text of the
  44. # Macro appear in them. The GNU General Public License (GPL) does govern
  45. # all other use of the material that constitutes the Autoconf Macro.
  46. #
  47. # This special exception to the GPL applies to versions of the Autoconf
  48. # Macro released by the Autoconf Macro Archive. When you make and
  49. # distribute a modified version of the Autoconf Macro, you may extend this
  50. # special exception to the GPL to apply to your modified version as well.
  51. #serial 3
  52. AC_DEFUN([AX_MPIP], [
  53. AC_PREREQ(2.60)
  54. AC_REQUIRE([ACX_MPI])
  55. AC_ARG_VAR([MPIP],[mpiP options])
  56. AC_ARG_WITH(
  57. [mpiP],
  58. [AS_HELP_STRING([--with-mpiP@<:@=DIR@:>@],
  59. [use mpiP profiler; optional install prefix])],
  60. [with_mpiP=$withval],
  61. [with_mpiP=no])
  62. if test "${with_mpiP}" != no ; then
  63. ax_mpiP_save_CC="$CC"
  64. ax_mpiP_save_LDFLAGS="$LDFLAGS"
  65. ax_mpiP_save_LIBS="$LIBS"
  66. MPIP_LDFLAGS=""
  67. MPIP_LIBS="-lmpiP -lbfd -liberty"
  68. if test "${with_mpiP}" != yes; then
  69. if test -d "${with_mpiP}/lib"; then
  70. MPIP_LDFLAGS="-L${with_mpiP}/lib"
  71. else
  72. AC_MSG_WARN([--with-mpiP expected ${with_mpiP}/lib to be a directory])
  73. fi
  74. fi
  75. LDFLAGS="${MPIP_LDFLAGS} ${LDFLAGS}"
  76. CC=$MPICC
  77. AC_LANG_PUSH([C])
  78. AC_CHECK_LIB([mpiP],
  79. [mpiPi],
  80. [ax_mpiP_cv_found=yes],
  81. [ax_mpiP_cv_found=no],
  82. [-lbfd -liberty])
  83. AC_LANG_POP([C])
  84. CC="$ax_mpiP_save_CC"
  85. LDFLAGS="$ax_mpiP_save_LDFLAGS"
  86. LIBS="$ax_mpiP_save_LIBS"
  87. if test "$ax_mpiP_cv_found" = no; then
  88. ifelse([$2],,AC_MSG_ERROR([mpiP not found. Try --with-mpiP=DIR.]),
  89. [$2])
  90. else
  91. AC_DEFINE(HAVE_MPIP,1,[Define if mpiP is available])
  92. AC_SUBST(MPIP_LDFLAGS)
  93. AC_SUBST(MPIP_LIBS)
  94. ifelse([$1],,,[$1])
  95. fi
  96. fi
  97. ])dnl AX_MPIP