1 | #AX_FC_VERSION_OUTPUT([FLAG = $ac_cv_prog_fc_version]) |
---|
2 | # ------------------------------------------------- |
---|
3 | # Link a trivial Fortran program, compiling with a version output FLAG |
---|
4 | # (which default value, $ac_cv_prog_fc_version, is computed by |
---|
5 | # AX_FC_VERSION), and return the output in $ac_fc_version_output. |
---|
6 | AC_DEFUN([AX_FC_VERSION_OUTPUT], |
---|
7 | [AC_REQUIRE([AC_PROG_FC])dnl |
---|
8 | AC_LANG_PUSH(Fortran)dnl |
---|
9 | |
---|
10 | AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) |
---|
11 | |
---|
12 | # Compile and link our simple test program by passing a flag (argument |
---|
13 | # 1 to this macro) to the Fortran 90 compiler in order to get "version" output |
---|
14 | ac_save_FCFLAGS=$FCFLAGS |
---|
15 | FCFLAGS="$FCFLAGS m4_default([$1], [$ac_cv_prog_fc_version])" |
---|
16 | (eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD |
---|
17 | ac_fc_version_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'` |
---|
18 | echo "$ac_fc_version_output" >&AS_MESSAGE_LOG_FD |
---|
19 | FCFLAGS=$ac_save_FCFLAGS |
---|
20 | |
---|
21 | rm -f conftest.* |
---|
22 | AC_LANG_POP(Fortran)dnl |
---|
23 | |
---|
24 | ])# AX_FC_VERSION_OUTPUT |
---|
25 | |
---|
26 | # AX_FC_VERSION |
---|
27 | # -------------- |
---|
28 | # |
---|
29 | AC_DEFUN([AX_FC_VERSION], |
---|
30 | [AC_CACHE_CHECK([how to get the version output from $FC], |
---|
31 | [ac_cv_prog_fc_version], |
---|
32 | [AC_LANG_ASSERT(Fortran) |
---|
33 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], |
---|
34 | [ac_cv_prog_fc_version= |
---|
35 | # Try some options frequently used verbose output |
---|
36 | for ac_version in -V -version --version +version -qversion; do |
---|
37 | AX_FC_VERSION_OUTPUT($ac_version) |
---|
38 | # look for "copyright" constructs in the output |
---|
39 | for ac_arg in $ac_fc_version_output; do |
---|
40 | case $ac_arg in |
---|
41 | COPYRIGHT | copyright | Copyright | '(c)' | '(C)' | Compiler | Compilers | Version | Version:) |
---|
42 | ac_cv_prog_fc_version=$ac_version |
---|
43 | break 2 ;; |
---|
44 | esac |
---|
45 | done |
---|
46 | done |
---|
47 | if test -z "$ac_cv_prog_fc_version"; then |
---|
48 | AC_MSG_WARN([cannot determine how to obtain version information from $FC]) |
---|
49 | fi], |
---|
50 | [AC_MSG_WARN([compilation failed])]) |
---|
51 | ])])# AX_FC_VERSION |
---|