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.

72 lines
2.1KB

  1. # ============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_f90_internal_headmod.html
  3. # ============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_F90_INTERNAL_HEADMOD(MESSAGE, FILE-REGEXP, FLAG, FUNCTION-BODY, OUTPUT-VAR[, SEARCH-PATH [, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Internal macro used by AX_F90_HEADER and AX_F90_MODULE.
  12. #
  13. # LICENSE
  14. #
  15. # Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
  16. #
  17. # Copying and distribution of this file, with or without modification, are
  18. # permitted in any medium without royalty provided the copyright notice
  19. # and this notice are preserved. This file is offered as-is, without any
  20. # warranty.
  21. #serial 10
  22. AC_DEFUN([AX_F90_INTERNAL_HEADMOD],[
  23. AS_VAR_PUSHDEF([ax_include],[ax_cv_f90_headmod_$2])
  24. AC_MSG_CHECKING([$1])
  25. AC_LANG_PUSH(Fortran)
  26. AS_VAR_SET(ax_include,"not found")
  27. if test "x$6" = x ; then
  28. ax_search="$prefix:$ac_default_prefix"
  29. for ax_base in "" `echo $LD_LIBRARY_PATH | tr ':' '\012'` ; do
  30. if test "x$ax_base" != x ; then
  31. changequote(,)dnl
  32. ax_base=`echo $ax_base | sed 's,/[^/]*$,,'`
  33. changequote([,])dnl
  34. ax_search="${ax_search}:${ax_base}"
  35. fi
  36. done
  37. else
  38. ax_search="$6"
  39. fi
  40. for ax_base in `echo $ax_search | tr ':' '\012'` ; do
  41. if test "AS_VAR_GET(ax_include)" = "not found" ; then
  42. for ax_mod in "" `find $ax_base -follow -name $2 -print` ; do
  43. if test "x$ax_mod" != x ; then
  44. changequote(,)dnl
  45. ax_dir=`echo $ax_mod | sed 's,/[^/]*$,,'`
  46. changequote([,])dnl
  47. ax_save_FCFLAGS="$FCFLAGS"
  48. FCFLAGS="$ax_save_FCFLAGS $3$ax_dir"
  49. AC_COMPILE_IFELSE([subroutine conftest_routine
  50. $4
  51. end subroutine conftest_routine
  52. ],AS_VAR_SET(ax_include,"$3$ax_dir"),[])
  53. FCFLAGS="$ax_save_FCFLAGS"
  54. fi
  55. done
  56. fi
  57. done
  58. AC_LANG_POP(Fortran)
  59. AC_MSG_RESULT([AS_VAR_GET(ax_include)])
  60. if test "AS_VAR_GET(ax_include)" = "not found"; then
  61. $5=""
  62. $8
  63. else
  64. $5="AS_VAR_GET(ax_include)"
  65. $7
  66. fi
  67. AC_SUBST($5)
  68. AS_VAR_POPDEF([ax_include])
  69. ])