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.

60 lines
1.7KB

  1. # ============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_f90_module_extension.html
  3. # ============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_F90_MODULE_EXTENSION
  8. #
  9. # DESCRIPTION
  10. #
  11. # Find Fortran 90 modules file extension. The module extension is stored
  12. # in the cached variable ax_f90_modext, or "unknown" if the extension
  13. # cannot be found.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
  18. # Copyright (c) 2009 Alexander Pletzer <pletzer@txcorp.com>
  19. #
  20. # Copying and distribution of this file, with or without modification, are
  21. # permitted in any medium without royalty provided the copyright notice
  22. # and this notice are preserved. This file is offered as-is, without any
  23. # warranty.
  24. #serial 12
  25. AC_DEFUN([AX_F90_MODULE_EXTENSION],[
  26. AC_CACHE_CHECK([fortran 90 modules extension],
  27. ax_cv_f90_modext,
  28. [AC_LANG_PUSH(Fortran)
  29. i=0
  30. while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
  31. i=`expr $i + 1`
  32. done
  33. mkdir tmpdir_$i
  34. cd tmpdir_$i
  35. AC_COMPILE_IFELSE([
  36. !234567
  37. module conftest_module
  38. contains
  39. subroutine conftest_routine
  40. write(*,'(a)') 'gotcha!'
  41. end subroutine conftest_routine
  42. end module conftest_module
  43. ],
  44. [ax_cv_f90_modext=`ls | sed -n 's,conftest_module\.,,p'`
  45. if test x$ax_cv_f90_modext = x ; then
  46. dnl Some F90 compilers put module filename in uppercase letters
  47. ax_cv_f90_modext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'`
  48. if test x$ax_cv_f90_modext = x ; then
  49. ax_cv_f90_modext=""
  50. fi
  51. fi
  52. ],
  53. [ax_cv_f90_modext=""])
  54. cd ..
  55. rm -fr tmpdir_$i
  56. AC_LANG_POP(Fortran)
  57. ])])