File: ax_f90_module_case.m4

package info (click to toggle)
libfdf 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 552 kB
  • sloc: f90: 4,028; perl: 805; python: 174; sh: 116; makefile: 99
file content (71 lines) | stat: -rw-r--r-- 2,219 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ===========================================================================
#        ax_f90_module_case.m4
# ===========================================================================
#
# SYNOPSIS
#
#   AX_F90_MODULE_CASE
#
# DESCRIPTION
#
#   Find Fortran 90 modules file case. The module case is stored
#   in the cached variable ax_f90_mod_case, or "unknown" if the case
#   cannot be found. Two additional cache variables, containing "yes",
#   "no", or "unknown", are created as well: ax_f90_mod_lowercase and
#   ax_f90_mod_uppercase.
#
# LAST MODIFICATION
#
#   2011-08-31
#
# COPYLEFT
#
#   Copyright (C) 2011 Yann Pouillon <yann.pouillon@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.

AC_DEFUN([AX_F90_MODULE_CASE],[
AC_REQUIRE([AX_F90_MODULE_EXTENSION])
AC_CACHE_CHECK([fortran 90 modules case],
ax_cv_f90_mod_case,
[AC_LANG_PUSH([Fortran])
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([
!234567
            module conftest_module
            contains
            subroutine conftest_routine
            write(*,'(a)') 'gotcha!'
            end subroutine conftest_routine
            end module conftest_module
    ],
    [ax_cv_f90_mod_case=`ls | sed -n "s,conftest_module\.$ax_cv_f90_modext,,p"`
      if test x$ax_cv_f90_mod_case = x ; then
          ax_cv_f90_mod_case=`ls | sed -n "s,CONFTEST_MODULE\.$ax_cv_f90_modext,,p"`
          if test x$ax_cv_f90_mod_case = x ; then
              ax_cv_f90_mod_case="unknown"
              ax_cv_f90_mod_lowercase="unknown"
              ax_cv_f90_mod_uppercase="unknown"
          else
            ax_cv_f90_mod_case="upper"
            ax_cv_f90_mod_lowercase="no"
            ax_cv_f90_mod_uppercase="yes"
          fi
      else
          ax_cv_f90_mod_case="lower"
          ax_cv_f90_mod_lowercase="yes"
          ax_cv_f90_mod_uppercase="no"
      fi
    ],
    [ax_cv_f90_mod_case=""; ax_cv_f90_mod_lowercase=""; ax_cv_mod_uppercase=""])
cd ..
rm -fr tmpdir_$i
AC_LANG_POP([Fortran])
])]) # AX_F90_MODULE_CASE