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.

53 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_fc_check_define.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_FC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro checks to see if the Fortran pre-processor has a symbol
  12. # defined.
  13. #
  14. # Consider a usage like:
  15. #
  16. # AC_FC_PP_DEFINE()
  17. # AX_FC_CHECK_DEFINE(__BIGGEST_ALIGNMENT__, [],
  18. # AX_APPEND_FLAG([${FC_DEFINE}__BIGGEST_ALIGNMENT__=64],
  19. # [FCFLAGS]))
  20. #
  21. # LICENSE
  22. #
  23. # Copyright (c) 2016 Timothy Brown <tbrown@freeshell.org>
  24. #
  25. # Copying and distribution of this file, with or without modification, are
  26. # permitted in any medium without royalty provided the copyright notice
  27. # and this notice are preserved. This file is offered as-is, without any
  28. # warranty.
  29. #serial 2
  30. AC_DEFUN([AX_FC_CHECK_DEFINE], [
  31. AS_VAR_PUSHDEF([ax_var],[ax_cv_defined_$1])dnl
  32. AC_LANG_PUSH([Fortran])
  33. ax_fc_check_define_srcext_save=$ac_fc_srcext
  34. AC_FC_PP_SRCEXT([F])
  35. AC_CACHE_CHECK([if $1 is defined], [ax_var],
  36. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
  37. #ifdef $1
  38. integer :: ok
  39. #else
  40. choke me
  41. #endif
  42. ]])],
  43. [AS_VAR_SET([ax_var], yes)],
  44. [AS_VAR_SET([ax_var], no)]))
  45. AS_IF([test AS_VAR_GET([ax_var]) != "no"], [$2], [$3])
  46. ac_fc_srcext=$ax_fc_check_define_srcext_save
  47. AC_LANG_POP()dnl
  48. AS_VAR_POPDEF([ax_var])dnl
  49. ])