File: ax_f90_module_extension.m4

package info (click to toggle)
libxc 4.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 58,520 kB
  • sloc: ansic: 19,150; perl: 1,157; python: 803; f90: 639; makefile: 317; sh: 107
file content (47 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
dnl @synopsis AX_F90_MODULE_EXTENSION
dnl
dnl Find Fortran 90 modules file extension. The module extension is
dnl stored in the cached variable ax_cv_f90_modext, or "unknown" if the
dnl extension cannot be found.
dnl
dnl @category Fortran
dnl @author Luc Maisonobe <luc@spaceroots.org>
dnl @version 2005-06-17
dnl @license AllPermissive

AC_DEFUN([AX_F90_MODULE_EXTENSION],[
AC_CACHE_CHECK([Fortran 90 modules extension],
ax_cv_f90_modext,
[AC_LANG_PUSH(Fortran)
ax_f90_mod_uppercase=no
i=0
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
  i=`expr $i + 1`
done
mkdir tmpdir_$i
cd tmpdir_$i
AC_COMPILE_IFELSE([module conftest_module
   contains
   subroutine conftest_routine
   write(*,'(a)') 'gotcha!'
   end subroutine conftest_routine
   end module conftest_module
  ],
  [
dnl prune out 'submodule' file .smod from gcc version 6 and later
   ax_cv_f90_modext=`ls | grep -v smod | sed -n 's,conftest_module\.,,p'`
   if test x"$ax_cv_f90_modext" = x ; then
dnl Some F90 compilers put module filename in uppercase letters
     ax_cv_f90_modext=`ls | grep -v SMOD | sed -n 's,CONFTEST_MODULE\.,,p'`
     if test x"$ax_cv_f90_modext" = x ; then
       ax_cv_f90_modext=unknown
     else
       ax_f90_mod_uppercase=yes
     fi
   fi
  ],
  [ax_cv_f90_modext=unknown])
cd ..
rm -fr tmpdir_$i
AC_LANG_POP(Fortran)
])])