From e2d4680594fda2798bd29b067cc669b4121eea11 Mon Sep 17 00:00:00 2001
From: tdaff
Date: Fri, 18 Dec 2015 11:24:40 -0500
Subject: [PATCH 01/31] fix stop message to work with gfortran < 4.6
fixes #41
---
fsys/fox_m_fsys_abort_flush.F90 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fsys/fox_m_fsys_abort_flush.F90 b/fsys/fox_m_fsys_abort_flush.F90
index 29af292f..90242372 100644
--- a/fsys/fox_m_fsys_abort_flush.F90
+++ b/fsys/fox_m_fsys_abort_flush.F90
@@ -104,7 +104,11 @@ end subroutine abort
i=>null()
Print*,i
#endif
+#if __GNUC__ == 4 && __GNUC_MINOR__ < 6
+ stop 1 ! needed for gfortran < 4.6 to compile
+#else
stop STDERR_FAILURE_STATUS
+#endif
end subroutine pxfabort
From 6680b69157005481036e30c8d011265276013d0e Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Wed, 23 Dec 2015 20:50:16 +0000
Subject: [PATCH 02/31] Turn on travis CI
Add .travis.yml, to enable basic
testing for pull requests.
---
.travis.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 .travis.yml
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..c357c280
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,27 @@
+language: python
+
+python:
+ - 2.7
+
+sudo: false
+
+cache:
+ apt: true
+
+addons:
+ apt:
+ packages:
+ - gfortran-4.9
+
+env:
+ matrix:
+ - >
+ BUILD_SCRIPT="./configure &&
+ make -j 2 && make -j2 check"
+
+install:
+ - export FC=/usr/bin/gfortran-4.9
+
+script:
+ - echo $BUILD_SCRIPT
+ - bash <<<$BUILD_SCRIPT
From d3f26daf0ba13aac881c95bd689b5588e1612603 Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Wed, 23 Dec 2015 20:55:44 +0000
Subject: [PATCH 03/31] Update setup for travis
---
.travis.yml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index c357c280..88d905ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,10 +17,17 @@ env:
matrix:
- >
BUILD_SCRIPT="./configure &&
- make -j 2 && make -j2 check"
+ make -j 2 && make -j 2 check"
install:
+ - |
+ if [[ ! -d "$HOME/.local/bin" ]]; then
+ mkdir "$HOME/.local/bin"
+ fi
+ - export PATH="$HOME/.local/bin:$PATH"
- export FC=/usr/bin/gfortran-4.9
+ - ln -fs /usr/bin/gfortran-4.9 "$HOME/.local/bin/gfortran" && gfortran --version
+ - ls -l /usr/bin/gfortran-4.9
script:
- echo $BUILD_SCRIPT
From af51a85449afe3ec516bb45375af31d5062f7c0c Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Wed, 23 Dec 2015 20:57:34 +0000
Subject: [PATCH 04/31] Try travis again.
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 88d905ff..3757d39c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ env:
install:
- |
if [[ ! -d "$HOME/.local/bin" ]]; then
- mkdir "$HOME/.local/bin"
+ mkdir -p "$HOME/.local/bin"
fi
- export PATH="$HOME/.local/bin:$PATH"
- export FC=/usr/bin/gfortran-4.9
From 07f2a7af45db8d47ad319c39d66b3880129b197a Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Wed, 23 Dec 2015 21:00:14 +0000
Subject: [PATCH 05/31] More travis
---
.travis.yml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 3757d39c..e347517f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,9 +25,10 @@ install:
mkdir -p "$HOME/.local/bin"
fi
- export PATH="$HOME/.local/bin:$PATH"
- - export FC=/usr/bin/gfortran-4.9
- - ln -fs /usr/bin/gfortran-4.9 "$HOME/.local/bin/gfortran" && gfortran --version
- ls -l /usr/bin/gfortran-4.9
+ - export FC=/usr/bin/gfortran-4.9
+ - ln -fs /usr/bin/gfortran-4.9 "$HOME/.local/bin/gfortran"
+ - gfortran --version
script:
- echo $BUILD_SCRIPT
From 53651cf737f5e137b1befa460eb858f6b133dd75 Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Wed, 23 Dec 2015 21:05:59 +0000
Subject: [PATCH 06/31] Travis work...
---
.travis.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index e347517f..b805841c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,9 @@ cache:
addons:
apt:
+ sources:
+ - kalakris-cmake
+ - ubuntu-toolchain-r-test
packages:
- gfortran-4.9
From d2ad4417480ed3ef15fe5d520fca455d5a0e901f Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Sat, 26 Dec 2015 21:49:11 +0000
Subject: [PATCH 07/31] Turn off backtrace on error for CI tests
This means that tests that check that we fail
corretly work, when using a gfortran compiler.
The implementation is a bit of a nasty hack, but
I've not been able to convince the environement
variable to work as documented.
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index b805841c..8d18398c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ addons:
env:
matrix:
- >
- BUILD_SCRIPT="./configure &&
+ BUILD_SCRIPT="FC='gfortran -fno-backtrace' ./configure &&
make -j 2 && make -j 2 check"
install:
From 5e8ec14b30b6145fd695e9462bafb4f826aa8730 Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Tue, 29 Dec 2015 11:13:30 +0000
Subject: [PATCH 08/31] Enable cmake for CI
---
.travis.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 8d18398c..55f8b36c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,13 +15,20 @@ addons:
- ubuntu-toolchain-r-test
packages:
- gfortran-4.9
+ - cmake
env:
matrix:
+ # Using configure and make, run the tests.
- >
BUILD_SCRIPT="FC='gfortran -fno-backtrace' ./configure &&
make -j 2 && make -j 2 check"
+ # Using cmake - just build, tests not working yet.
+ - >
+ BUILD_SCRIPT="mkdir cmake_build/ && cd cmake_build &&
+ cmake ../ && make -j 2"
+
install:
- |
if [[ ! -d "$HOME/.local/bin" ]]; then
From 63b3eef4f117cf221c9b0fdb910ac0cf0a47592d Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Sun, 7 Jan 2018 10:33:16 +0000
Subject: [PATCH 09/31] Make TravisCI show failed if a test fails
Failed tests were not exiting the travis shell with
an error. Add a final step to make this happen.
---
.travis.yml | 2 +-
testcheck.sh | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
create mode 100755 testcheck.sh
diff --git a/.travis.yml b/.travis.yml
index 55f8b36c..d94bf262 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ env:
# Using configure and make, run the tests.
- >
BUILD_SCRIPT="FC='gfortran -fno-backtrace' ./configure &&
- make -j 2 && make -j 2 check"
+ make -j 2 && make -j 2 check && ./testcheck.sh"
# Using cmake - just build, tests not working yet.
- >
diff --git a/testcheck.sh b/testcheck.sh
new file mode 100755
index 00000000..b82fed23
--- /dev/null
+++ b/testcheck.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+# Script to parse the output generated by make checkr.,
+# Exits with non-zero return code if any tests failed.
+# This can be used inside of a CI environment.
+
+for numerr in `grep RESULT check.out | grep Failed: | cut -d " " -f 4`
+ do
+ if [ "$numerr" -ne "0" ]
+ then
+ echo "At least one test failed. Examine check.out for details"
+ exit 1
+ fi
+done
From 42c412a920b03a837846e3edd53b39b6b6fe5164 Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Sun, 7 Jan 2018 10:51:32 +0000
Subject: [PATCH 10/31] Dissable tests for issue #9 and #17
These issues haven't been fixed, but now the
CI actually uses the tests to check for regression
lets dissable them. This way we'll only see failed
tests from the CI for a regression.
Still want to fix these URI parsing bugs at some
point.
---
utils/test/run_tests.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/utils/test/run_tests.sh b/utils/test/run_tests.sh
index 6cc87869..dcbbd0ff 100755
--- a/utils/test/run_tests.sh
+++ b/utils/test/run_tests.sh
@@ -10,8 +10,10 @@ touch passed.score failed.score
./test.sh test_nullURI
./test.sh test_baseURI
./test.sh test_rfc2396
-./test.sh test_rfc2396b
-./test.sh test_URI
+echo "NB: skipping two tests - these fail but should pass!"
+echo "See issues 9 and 17 on github"
+# ./test.sh test_rfc2396b
+# ./test.sh test_URI
echo RESULT utils/ Test Results:
echo RESULT utils/ Passed: `wc -l passed.score| cut -f 1 -d 'p'`
From 5a865f54c9f7b5e1201335c1a2d9c2833814baeb Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Tue, 3 Apr 2018 16:18:16 +0100
Subject: [PATCH 11/31] DOM example of error handling
Add a new example for the DOM showing how the iostat
and ex optional arguments interact.
---
examples/Makefile | 6 ++++--
examples/dom_example_4.f90 | 42 ++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 examples/dom_example_4.f90
diff --git a/examples/Makefile b/examples/Makefile
index 3d8b9420..502b878a 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -6,9 +6,9 @@ default: $(BUILD_TARGETS)
INCFLAGS=`../FoX-config --fcflags`
-EXAMPLES=dom_example_2$(EXEEXT) dom_example_3$(EXEEXT) sax_example$(EXEEXT) sax_example_2$(EXEEXT) wcml_example$(EXEEXT) wxml_example$(EXEEXT) wkml_example$(EXEEXT) wkml_example_2$(EXEEXT)
+EXAMPLES=dom_example_2$(EXEEXT) dom_example_3$(EXEEXT) dom_example_4$(EXEEXT) sax_example$(EXEEXT) sax_example_2$(EXEEXT) wcml_example$(EXEEXT) wxml_example$(EXEEXT) wkml_example$(EXEEXT) wkml_example_2$(EXEEXT)
-dom_lib: sax_lib wxml_lib dom_example_2$(EXEEXT) dom_example_3$(EXEEXT)
+dom_lib: sax_lib wxml_lib dom_example_2$(EXEEXT) dom_example_3$(EXEEXT) dom_example_4$(EXEEXT)
sax_lib: sax_example$(EXEEXT) sax_example_2$(EXEEXT)
wcml_lib: wxml_lib wcml_example$(EXEEXT)
wkml_lib: wxml_lib wkml_example$(EXEEXT) wkml_example_2$(EXEEXT)
@@ -51,6 +51,8 @@ dom_example_2$(EXEEXT): dom_example_2.$(OBJEXT) ../objs/lib/libFoX_dom.$(LIBEXT)
$(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ dom_example_2.$(OBJEXT) $$(../FoX-config --libs --dom)
dom_example_3$(EXEEXT): dom_example_3.$(OBJEXT) ../objs/lib/libFoX_dom.$(LIBEXT) ../objs/lib/libFoX_sax.$(LIBEXT) ../objs/lib/libFoX_wxml.$(LIBEXT) ../objs/lib/libFoX_common.$(LIBEXT) ../objs/lib/libFoX_fsys.$(LIBEXT)
$(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ dom_example_3.$(OBJEXT) $$(../FoX-config --libs --dom)
+dom_example_4$(EXEEXT): dom_example_4.$(OBJEXT) ../objs/lib/libFoX_dom.$(LIBEXT) ../objs/lib/libFoX_sax.$(LIBEXT) ../objs/lib/libFoX_wxml.$(LIBEXT) ../objs/lib/libFoX_common.$(LIBEXT) ../objs/lib/libFoX_fsys.$(LIBEXT)
+ $(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ dom_example_4.$(OBJEXT) $$(../FoX-config --libs --dom)
#
sax_example$(EXEEXT): sax_example.$(OBJEXT) ../objs/lib/libFoX_sax.$(LIBEXT) ../objs/lib/libFoX_common.$(LIBEXT) ../objs/lib/libFoX_fsys.$(LIBEXT)
$(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ sax_example.$(OBJEXT) $$(../FoX-config --libs --sax)
diff --git a/examples/dom_example_4.f90 b/examples/dom_example_4.f90
new file mode 100644
index 00000000..045dcdb3
--- /dev/null
+++ b/examples/dom_example_4.f90
@@ -0,0 +1,42 @@
+program dom_example_4
+
+ ! Example of error handling from the DOM interface
+ !
+ ! Note the need to check the value of the iostat as well
+ ! as ex. If the iostat optional argument is present and
+ ! the file cannot be found that is the variable that gets
+ ! set in the parseFile function. If iostat is not present
+ ! in this case FoX will abort itself reporting that it
+ ! "Cannot open file". This kind of error does not get
+ ! attached to the DOMException.
+ !
+ ! If the file exists but is not well-formed XML the error
+ ! should be reported in the DOMException. One oddity to note
+ ! is that if ex is not present but ios is, you may end up
+ ! with a FoX error code in ios. That only happens if the file
+ ! exists but it not well-formed XML.
+
+ use FoX_dom
+ implicit none
+
+ type(Node), pointer :: myDoc
+ type(DOMException) :: ex
+ integer :: ios
+
+ myDoc => parseFile("h2o.xml", iostat=ios, ex=ex)
+ if (ios.ne.0) then
+ print*, "Problem reading file. iostat was ", ios
+ stop
+
+ elseif (inException(ex)) then
+ print*,"DOM Parse error ", getExceptionCode(ex)
+ stop
+
+ else
+ print*, "Not in exception and file read OK"
+
+ endif
+
+ ! Do something with myDoc
+
+end program dom_example_4
From fe2b056b59915f8bb7b63dfb1d28250150654bb2 Mon Sep 17 00:00:00 2001
From: Antoine Langenfeld
Date: Sun, 8 Jan 2017 09:54:08 +0000
Subject: [PATCH 12/31] Use intel module for abort and flush
For the Intel compiler the functions Abort
and Flush need to ube used from ifport
(the intel Portability Library). Use the
module wrapped in #IFDEFs.
---
fsys/fox_m_fsys_abort_flush.F90 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fsys/fox_m_fsys_abort_flush.F90 b/fsys/fox_m_fsys_abort_flush.F90
index 90242372..2a4d6b4f 100644
--- a/fsys/fox_m_fsys_abort_flush.F90
+++ b/fsys/fox_m_fsys_abort_flush.F90
@@ -45,6 +45,9 @@ module fox_m_fsys_abort_flush
subroutine pxfflush(unit)
#ifdef __NAG__
use f90_unix_io, only : flush
+#endif
+#ifdef __INTEL_COMPILER
+ use ifport, only : flush
#endif
integer, intent(in) :: unit
integer :: i
@@ -79,6 +82,9 @@ subroutine pxfabort()
#ifdef __NAG__
use f90_unix_proc, only : abort
#endif
+#ifdef __INTEL_COMPILER
+ use ifport, only : abort
+#endif
#ifdef F2003
interface
subroutine abort() bind(c)
From ece43315d7d0db071705437e882d5685ebfb4700 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Thu, 26 Oct 2017 09:20:22 +0200
Subject: [PATCH 13/31] modified the config.guess file in order to enable the
configure script to recognise the aarch64 architecture: fix by Jason Woods
---
config/config.guess | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/config.guess b/config/config.guess
index 2b03b482..31f47d25 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -829,7 +829,7 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
- arm*:Linux:*:*)
+ aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
From 71909c595302f70fbdad945461f8c23875c7f978 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Wed, 4 Apr 2018 11:50:00 +0200
Subject: [PATCH 14/31] readding in config the clause for old arm machines
As suggested I reinserted the clause for detecting machines which
report arm*
---
config/config.guess | 3 +++
1 file changed, 3 insertions(+)
diff --git a/config/config.guess b/config/config.guess
index 31f47d25..553ee1dd 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -829,6 +829,9 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
From f11048db871e13b8102fb8f4ca577fa99c25e959 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Fri, 4 Aug 2017 10:30:35 +0200
Subject: [PATCH 15/31] removed the colon for each dimension in len functions
arguments, it was making pgi compilers produce bugged code which tried to
allocate huge amount of memory anytime that a str function was called with an
array argument
---
fsys/fox_m_fsys_format.F90 | 62 +++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/fsys/fox_m_fsys_format.F90 b/fsys/fox_m_fsys_format.F90
index 6d6a6d93..b43a2365 100644
--- a/fsys/fox_m_fsys_format.F90
+++ b/fsys/fox_m_fsys_format.F90
@@ -902,10 +902,10 @@ pure function str_integer_array(ia) result(s)
#ifdef DUMMYLIB
character(len=1) :: s
#else
- character(len=len(ia(:), "d")) :: s
+ character(len=len(ia, "d")) :: s
integer :: j, k, n
-
+
n = 1
do k = 1, size(ia) - 1
j = len(ia(k))
@@ -924,7 +924,7 @@ function str_integer_array_fmt(ia, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ia(:), fmt)) :: s
+ character(len=len(ia, fmt)) :: s
integer :: j, k, n
@@ -944,7 +944,7 @@ pure function str_integer_matrix(ia) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ia(:,:), "d")) :: s
+ character(len=len(ia, "d")) :: s
integer :: j, k, n
@@ -971,7 +971,7 @@ pure function str_integer_matrix_fmt(ia, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ia(:,:), fmt)) :: s
+ character(len=len(ia, fmt)) :: s
integer :: j, k, n
@@ -1015,7 +1015,7 @@ pure function str_logical_array(la) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(la(:))) :: s
+ character(len=len(la)) :: s
integer :: k, n
@@ -1044,7 +1044,7 @@ pure function str_logical_matrix(la) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(la(:,:))) :: s
+ character(len=len(la)) :: s
integer :: j, k, n
@@ -1351,7 +1351,7 @@ pure function str_real_sp_array(xa) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:))) :: s
+ character(len=len(xa)) :: s
integer :: j, k, n
@@ -1369,7 +1369,7 @@ end function str_real_sp_array
pure function str_real_sp_array_fmt(xa, fmt) result(s)
real(sp), dimension(:), intent(in) :: xa
character(len=*), intent(in) :: fmt
- character(len=len(xa(:), fmt)) :: s
+ character(len=len(xa, fmt)) :: s
integer :: j, k, n
@@ -1391,7 +1391,7 @@ function str_real_sp_array_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:), fmt)) :: s
+ character(len=len(xa, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1405,7 +1405,7 @@ end function str_real_sp_array_fmt_chk
pure function str_real_sp_matrix_fmt(xa, fmt) result(s)
real(sp), dimension(:,:), intent(in) :: xa
character(len=*), intent(in) :: fmt
- character(len=len(xa(:,:),fmt)) :: s
+ character(len=len(xa,fmt)) :: s
integer :: i, j, k, n
@@ -1435,7 +1435,7 @@ function str_real_sp_matrix_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:,:),fmt)) :: s
+ character(len=len(xa,fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1451,7 +1451,7 @@ pure function str_real_sp_matrix(xa) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:,:))) :: s
+ character(len=len(xa)) :: s
s = safestr(xa, "")
#endif
@@ -1682,7 +1682,7 @@ pure function str_real_dp_array(xa) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:))) :: s
+ character(len=len(xa)) :: s
integer :: j, k, n
@@ -1700,7 +1700,7 @@ end function str_real_dp_array
pure function str_real_dp_array_fmt(xa, fmt) result(s)
real(dp), dimension(:), intent(in) :: xa
character(len=*), intent(in) :: fmt
- character(len=len(xa(:), fmt)) :: s
+ character(len=len(xa, fmt)) :: s
integer :: j, k, n
@@ -1722,7 +1722,7 @@ function str_real_dp_array_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:), fmt)) :: s
+ character(len=len(xa, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1736,7 +1736,7 @@ end function str_real_dp_array_fmt_chk
function str_real_dp_matrix_fmt(xa, fmt) result(s)
real(dp), dimension(:,:), intent(in) :: xa
character(len=*), intent(in) :: fmt
- character(len=len(xa(:,:),fmt)) :: s
+ character(len=len(xa,fmt)) :: s
integer :: i, j, k, n
@@ -1766,7 +1766,7 @@ function str_real_dp_matrix_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:,:),fmt)) :: s
+ character(len=len(xa,fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1782,7 +1782,7 @@ function str_real_dp_matrix(xa) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(xa(:,:))) :: s
+ character(len=len(xa)) :: s
s = safestr(xa, "")
#endif
@@ -1841,7 +1841,7 @@ end function str_complex_sp
pure function str_complex_sp_array_fmt(ca, fmt) result(s)
complex(sp), dimension(:), intent(in) :: ca
character(len=*), intent(in) :: fmt
- character(len=len(ca(:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
integer :: i, n
@@ -1861,7 +1861,7 @@ function str_complex_sp_array_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -1877,7 +1877,7 @@ pure function str_complex_sp_array(ca) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:))) :: s
+ character(len=len(ca)) :: s
s = safestr(ca, "")
#endif
@@ -1887,7 +1887,7 @@ end function str_complex_sp_array
pure function str_complex_sp_matrix_fmt(ca, fmt) result(s)
complex(sp), dimension(:, :), intent(in) :: ca
character(len=*), intent(in) :: fmt
- character(len=len(ca(:,:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
integer :: i, j, k, n
@@ -1917,7 +1917,7 @@ function str_complex_sp_matrix_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:,:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -1933,7 +1933,7 @@ pure function str_complex_sp_matrix(ca) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:,:))) :: s
+ character(len=len(ca)) :: s
s = safestr(ca, "")
#endif
@@ -1988,7 +1988,7 @@ end function str_complex_dp
pure function str_complex_dp_array_fmt(ca, fmt) result(s)
complex(dp), dimension(:), intent(in) :: ca
character(len=*), intent(in) :: fmt
- character(len=len(ca(:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
integer :: i, n
@@ -2008,7 +2008,7 @@ function str_complex_dp_array_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -2024,7 +2024,7 @@ pure function str_complex_dp_array(ca) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:))) :: s
+ character(len=len(ca)) :: s
s = safestr(ca, "")
#endif
@@ -2034,7 +2034,7 @@ end function str_complex_dp_array
pure function str_complex_dp_matrix_fmt(ca, fmt) result(s)
complex(dp), dimension(:, :), intent(in) :: ca
character(len=*), intent(in) :: fmt
- character(len=len(ca(:,:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
integer :: i, j, k, n
@@ -2064,7 +2064,7 @@ function str_complex_dp_matrix_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:,:), fmt)) :: s
+ character(len=len(ca, fmt)) :: s
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -2080,7 +2080,7 @@ pure function str_complex_dp_matrix(ca) result(s)
character(len=1) :: s
s = " "
#else
- character(len=len(ca(:,:))) :: s
+ character(len=len(ca)) :: s
s = safestr(ca, "")
#endif
From 2230132044c9fbe4c1580d93f23f3a0fc3ee6b81 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Mon, 9 Apr 2018 14:23:17 +0200
Subject: [PATCH 16/31] Added note outlining pgi issues with safestr.
---
fsys/fox_m_fsys_format.F90 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/fsys/fox_m_fsys_format.F90 b/fsys/fox_m_fsys_format.F90
index b43a2365..db8d4963 100644
--- a/fsys/fox_m_fsys_format.F90
+++ b/fsys/fox_m_fsys_format.F90
@@ -14,6 +14,19 @@ module fox_m_fsys_format
!to COUNT their length inline in the specification
!expression, but Pathscale-2.4 gives an error on that.
+!With PGI (all versions up to last PGI 17.10 community edition)
+!all the procedures exported with the safestr interface
+!were either crashing (older versions) or returning an empty string
+!(latest version) because of a compiler bug.
+!This bug made fail all the _Overload tests in wxml/tests.
+! safestr works correctly if all colon are removed from the dimension
+! of the ia array arguments passed to the len functions
+! (see e.g. lines 902 and below).
+! With this format it is instead ifort v.12 to fail, because of a similar and
+! opposite bug fortunately fixed by Intel in the successive versions
+! For sake of compatibility one or the other call is selected with
+! preprocessor directives.
+
use fox_m_fsys_abort_flush, only: pxfflush
use fox_m_fsys_realtypes, only: sp, dp
From 4d2b19c457add819bf410aab32ea97001932d897 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Mon, 9 Apr 2018 13:38:57 +0200
Subject: [PATCH 17/31] fix for PGI make overload to fail on ifort version 12,
introducing a selective preprocessor directive
---
fsys/fox_m_fsys_format.F90 | 125 +++++++++++++++++++++++++++++++++++--
1 file changed, 121 insertions(+), 4 deletions(-)
diff --git a/fsys/fox_m_fsys_format.F90 b/fsys/fox_m_fsys_format.F90
index db8d4963..4508cde9 100644
--- a/fsys/fox_m_fsys_format.F90
+++ b/fsys/fox_m_fsys_format.F90
@@ -21,7 +21,7 @@ module fox_m_fsys_format
!This bug made fail all the _Overload tests in wxml/tests.
! safestr works correctly if all colon are removed from the dimension
! of the ia array arguments passed to the len functions
-! (see e.g. lines 902 and below).
+! (see e.g. lines 918 and below).
! With this format it is instead ifort v.12 to fail, because of a similar and
! opposite bug fortunately fixed by Intel in the successive versions
! For sake of compatibility one or the other call is selected with
@@ -915,7 +915,11 @@ pure function str_integer_array(ia) result(s)
#ifdef DUMMYLIB
character(len=1) :: s
#else
+#if defined (__PGI)
character(len=len(ia, "d")) :: s
+#else
+ character(len=len(ia(:), "d")) :: s
+#endif
integer :: j, k, n
@@ -937,7 +941,11 @@ function str_integer_array_fmt(ia, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ia, fmt)) :: s
+#else
+ character(len=len(ia(:), fmt)) :: s
+#endif
integer :: j, k, n
@@ -957,7 +965,11 @@ pure function str_integer_matrix(ia) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ia, "d")) :: s
+#else
+ character(len=len(ia(:,:), "d")) :: s
+#endif
integer :: j, k, n
@@ -984,7 +996,11 @@ pure function str_integer_matrix_fmt(ia, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ia, fmt)) :: s
+#else
+ character(len=len(ia(:,:), fmt)) :: s
+#endif
integer :: j, k, n
@@ -1028,7 +1044,11 @@ pure function str_logical_array(la) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(la)) :: s
+#else
+ character(len=len(la(:))) :: s
+#endif
integer :: k, n
@@ -1057,7 +1077,11 @@ pure function str_logical_matrix(la) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(la)) :: s
+#else
+ character(len=len(la(:,:))) :: s
+#endif
integer :: j, k, n
@@ -1364,7 +1388,11 @@ pure function str_real_sp_array(xa) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa)) :: s
+#else
+ character(len=len(xa(:))) :: s
+#endif
integer :: j, k, n
@@ -1382,7 +1410,11 @@ end function str_real_sp_array
pure function str_real_sp_array_fmt(xa, fmt) result(s)
real(sp), dimension(:), intent(in) :: xa
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(xa, fmt)) :: s
+#else
+ character(len=len(xa(:), fmt)) :: s
+#endif
integer :: j, k, n
@@ -1404,7 +1436,11 @@ function str_real_sp_array_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa, fmt)) :: s
+#else
+ character(len=len(xa(:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1418,7 +1454,11 @@ end function str_real_sp_array_fmt_chk
pure function str_real_sp_matrix_fmt(xa, fmt) result(s)
real(sp), dimension(:,:), intent(in) :: xa
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(xa,fmt)) :: s
+#else
+ character(len=len(xa(:,:),fmt)) :: s
+#endif
integer :: i, j, k, n
@@ -1448,7 +1488,11 @@ function str_real_sp_matrix_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa,fmt)) :: s
+#else
+ character(len=len(xa(:,:),fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
@@ -1464,7 +1508,11 @@ pure function str_real_sp_matrix(xa) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa)) :: s
+#else
+ character(len=len(xa(:,:))) :: s
+#endif
s = safestr(xa, "")
#endif
@@ -1695,7 +1743,11 @@ pure function str_real_dp_array(xa) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa)) :: s
+#else
+ character(len=len(xa(:))) :: s
+#endif
integer :: j, k, n
@@ -1713,7 +1765,11 @@ end function str_real_dp_array
pure function str_real_dp_array_fmt(xa, fmt) result(s)
real(dp), dimension(:), intent(in) :: xa
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(xa, fmt)) :: s
+#else
+ character(len=len(xa(:), fmt)) :: s
+#endif
integer :: j, k, n
@@ -1735,8 +1791,11 @@ function str_real_dp_array_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa, fmt)) :: s
-
+#else
+ character(len=len(xa(:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
else
@@ -1749,8 +1808,11 @@ end function str_real_dp_array_fmt_chk
function str_real_dp_matrix_fmt(xa, fmt) result(s)
real(dp), dimension(:,:), intent(in) :: xa
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(xa,fmt)) :: s
-
+#else
+ character(len=len(xa(:,:),fmt)) :: s
+#endif
integer :: i, j, k, n
i = len(xa(1,1), fmt)
@@ -1779,8 +1841,11 @@ function str_real_dp_matrix_fmt_chk(xa, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa,fmt)) :: s
-
+#else
+ character(len=len(xa(:,:),fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(xa, fmt)
else
@@ -1795,7 +1860,11 @@ function str_real_dp_matrix(xa) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(xa)) :: s
+#else
+ character(len=len(xa(:,:))) :: s
+#endif
s = safestr(xa, "")
#endif
@@ -1854,7 +1923,11 @@ end function str_complex_sp
pure function str_complex_sp_array_fmt(ca, fmt) result(s)
complex(sp), dimension(:), intent(in) :: ca
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:), fmt)) :: s
+#endif
integer :: i, n
@@ -1874,7 +1947,11 @@ function str_complex_sp_array_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -1890,7 +1967,11 @@ pure function str_complex_sp_array(ca) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca)) :: s
+#else
+ character(len=len(ca(:))) :: s
+#endif
s = safestr(ca, "")
#endif
@@ -1900,7 +1981,11 @@ end function str_complex_sp_array
pure function str_complex_sp_matrix_fmt(ca, fmt) result(s)
complex(sp), dimension(:, :), intent(in) :: ca
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:,:), fmt)) :: s
+#endif
integer :: i, j, k, n
@@ -1930,7 +2015,11 @@ function str_complex_sp_matrix_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:,:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -1946,7 +2035,11 @@ pure function str_complex_sp_matrix(ca) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca)) :: s
+#else
+ character(len=len(ca(:,:))) :: s
+#endif
s = safestr(ca, "")
#endif
@@ -2001,7 +2094,11 @@ end function str_complex_dp
pure function str_complex_dp_array_fmt(ca, fmt) result(s)
complex(dp), dimension(:), intent(in) :: ca
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:), fmt)) :: s
+#endif
integer :: i, n
@@ -2021,7 +2118,11 @@ function str_complex_dp_array_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -2037,7 +2138,11 @@ pure function str_complex_dp_array(ca) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca)) :: s
+#else
+ character(len=len(ca(:))) :: s
+#endif
s = safestr(ca, "")
#endif
@@ -2047,7 +2152,11 @@ end function str_complex_dp_array
pure function str_complex_dp_matrix_fmt(ca, fmt) result(s)
complex(dp), dimension(:, :), intent(in) :: ca
character(len=*), intent(in) :: fmt
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:,:), fmt)) :: s
+#endif
integer :: i, j, k, n
@@ -2077,7 +2186,11 @@ function str_complex_dp_matrix_fmt_chk(ca, fmt) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca, fmt)) :: s
+#else
+ character(len=len(ca(:,:), fmt)) :: s
+#endif
if (checkFmt(fmt)) then
s = safestr(ca, fmt)
@@ -2093,7 +2206,11 @@ pure function str_complex_dp_matrix(ca) result(s)
character(len=1) :: s
s = " "
#else
+#if defined(__PGI)
character(len=len(ca)) :: s
+#else
+ character(len=len(ca(:,:))) :: s
+#endif
s = safestr(ca, "")
#endif
From 9c6716ed75fe96c1b3ea2b9a7e26cde1e9994973 Mon Sep 17 00:00:00 2001
From: Pietro Delugas
Date: Mon, 26 Feb 2018 09:43:52 +0100
Subject: [PATCH 18/31] changed the initialization of IO error codes.
Initializing the IO error codes each time that a xml file
in open for reading may become cumbersome in parallel application
with many processes opening scratch file for tests. In this case
it is preferable to run setup_io just with one node and propagate the
results to all other nodes.
I have redefined setup_io as an interface which refers to 2 module
procedures. setup_io_scracth which is the former setup_io routine and
a setup_io_with_data where err_code eor_code and eof_code are provided
as arguments with which io_err, io_eor and io_eof are initialized.
I have added a private logical variable io_init that is toggled to true by
setup_io on exit. setup_io checks the io_init variable when starting and
in true returns without no further actions.
---
common/m_common_io.F90 | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/common/m_common_io.F90 b/common/m_common_io.F90
index a15a25db..e7724521 100644
--- a/common/m_common_io.F90
+++ b/common/m_common_io.F90
@@ -11,6 +11,11 @@ module m_common_io
integer, save :: io_eor
integer, save :: io_eof
integer, save :: io_err
+ logical, save :: io_init=.false.
+
+ interface setup_io
+ module procedure setup_io_scratch, setup_io_with_data
+ end interface setup_io
public :: io_eor
public :: io_eof
@@ -20,9 +25,23 @@ module m_common_io
contains
- subroutine setup_io()
+ subroutine setup_io_scratch()
+ if (io_init) return
call find_eor_eof(io_eor, io_eof)
- end subroutine setup_io
+ io_init = .true.
+ end subroutine setup_io_scratch
+
+ subroutine setup_io_with_data(err_code, eor_code, eof_code)
+ implicit none
+ integer,intent(in) :: err_code, eor_code, eof_code
+ if (io_init) return
+ io_err = err_code
+ io_eor = eor_code
+ io_eof = eof_code
+ io_init = .true.
+ end subroutine setup_io_with_data
+
+
subroutine get_unit(lun,iostat)
From 2aa8f4d26981c7c022f150326a9eda2ec49addc2 Mon Sep 17 00:00:00 2001
From: Matthew Hambley
Date: Fri, 25 Sep 2020 11:07:20 +0100
Subject: [PATCH 19/31] Fix format string.
---
examples/sax_example.f90 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/sax_example.f90 b/examples/sax_example.f90
index a3595947..87e2d0c9 100644
--- a/examples/sax_example.f90
+++ b/examples/sax_example.f90
@@ -75,7 +75,7 @@ end subroutine endPrefixMapping_handler
subroutine ignorableWhitespace_handler(chars)
character(len=*), intent(in) :: chars
- write(*,'(2a)') str(len(chars))//" characters of ignorable whitespace found"
+ write(*,'(i0, a)') len(chars), "characters of ignorable whitespace found"
end subroutine ignorableWhitespace_handler
subroutine processingInstruction_handler(name, content)
From 126f9b08f5cd23c3b30882972d62223bc2cbffb0 Mon Sep 17 00:00:00 2001
From: Matthew Hambley
Date: Fri, 25 Sep 2020 10:50:27 +0000
Subject: [PATCH 20/31] Require a version of CMake whic can recognise Cray
Fortran.
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27726f9b..d0b6a066 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4 FATAL_ERROR)
+
PROJECT(FoX Fortran)
SET(CMAKE_VERBOSE_MAKEFILE FALSE)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
#======================#
# Enable testing
#======================#
From e42cda93e807f04abcc3bfdf9bdff85551ca267d Mon Sep 17 00:00:00 2001
From: Christoph Honal
Date: Sun, 28 Oct 2018 13:19:15 +0100
Subject: [PATCH 21/31] Add shared libraray and install support to CMake
---
CMakeLists.txt | 20 ++++++++++++++++++--
common/CMakeLists.txt | 13 +------------
dom/CMakeLists.txt | 14 ++------------
examples/CMakeLists.txt | 5 +----
fsys/CMakeLists.txt | 7 +------
sax/CMakeLists.txt | 14 +-------------
utils/CMakeLists.txt | 13 +------------
wcml/CMakeLists.txt | 12 +-----------
wkml/CMakeLists.txt | 13 +------------
wxml/CMakeLists.txt | 12 +-----------
10 files changed, 28 insertions(+), 95 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0b6a066..5adef328 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,7 @@ OPTION(${PROJECT_NAME}_ENABLE_WCML "Enable/disable Chemical Markup Language outp
OPTION(${PROJECT_NAME}_ENABLE_WKML "Enable/disable Keyhole Markup Language output library" ON)
OPTION(${PROJECT_NAME}_ENABLE_DOM "Enable/disable Document Object Model input library" ON)
OPTION(${PROJECT_NAME}_ENABLE_EXAMPLES "Build examples" ON)
+OPTION(BUILD_SHARED_LIBS, OFF)
#======================#
# set another compiler #
@@ -121,6 +122,22 @@ INCLUDE(${${PROJECT_NAME}_SOURCE_DIR}/cmake/CheckAbortIntrinsic.cmake)
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FPPFLAGS}")
+MACRO(MK_LIBS _NAME)
+ ADD_LIBRARY(
+ ${PROJECT_NAME}_${_NAME}
+ ${fox_${_NAME}_srcs}
+ ${fox_${_NAME}_srcs_pp}
+ )
+ SET_PROPERTY(TARGET ${PROJECT_NAME}_${_NAME} PROPERTY POSITION_INDEPENDENT_CODE 1)
+ FOREACH(ARG IN ITEMS ${ARGN})
+ TARGET_LINK_LIBRARIES(
+ ${PROJECT_NAME}_${_NAME}
+ ${PROJECT_NAME}_${ARG}
+ )
+ ENDFOREACH()
+ INSTALL (TARGETS ${PROJECT_NAME}_${_NAME} DESTINATION lib)
+ENDMACRO(MK_LIBS)
+
# Base library directories
ADD_SUBDIRECTORY(${${PROJECT_NAME}_SOURCE_DIR}/fsys)
ADD_SUBDIRECTORY(${${PROJECT_NAME}_SOURCE_DIR}/utils)
@@ -176,7 +193,6 @@ ELSE()
GET_PROPERTY(THE_INCLUDE_DIRS GLOBAL PROPERTY INCLUDE_DIRECTORIES)
STRING(REPLACE "${${PROJECT_NAME}_SOURCE_DIR}/examples" "" NEW_INCLUDE_DIRS "${THE_INCLUDE_DIRS}")
SET_PROPERTY(GLOBAL PROPERTY INCLUDE_DIRECTORIES ${NEW_INCLUDE_DIRS})
-
ENDIF()
-
+INSTALL(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
\ No newline at end of file
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 32ac03a2..650297b9 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -19,15 +19,4 @@ set(fox_common_srcs_pp
m_common_struct.F90
)
-add_library(
- ${PROJECT_NAME}_common STATIC
- ${fox_common_srcs}
- ${fox_common_srcs_pp}
-)
-
-target_link_libraries(
- ${PROJECT_NAME}_common
- ${PROJECT_NAME}_utils
- ${PROJECT_NAME}_fsys
-)
-
+MK_LIBS(common utils fsys)
\ No newline at end of file
diff --git a/dom/CMakeLists.txt b/dom/CMakeLists.txt
index 5d9e9263..aa730cca 100644
--- a/dom/CMakeLists.txt
+++ b/dom/CMakeLists.txt
@@ -79,19 +79,9 @@ set(fox_dom_srcs
m_dom_utils.f90
)
-add_library(
- ${PROJECT_NAME}_dom STATIC
- ${fox_dom_srcs}
- ${fox_dom_srcs_pp}
-)
+MK_LIBS(dom wxml sax)
## add_dependencies(
## fox_dom
## dom_generate
-## )
-
-target_link_libraries(
- ${PROJECT_NAME}_dom
- ${PROJECT_NAME}_wxml
- ${PROJECT_NAME}_sax
-)
+## )
\ No newline at end of file
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index fca3245d..de15db66 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -68,7 +68,4 @@ include_directories(
${${PROJECT_NAME}_BINARY_DIR}/utils
${${PROJECT_NAME}_BINARY_DIR}/fsys
${${PROJECT_NAME}_BINARY_DIR}/sax
-)
-
-
-
+)
\ No newline at end of file
diff --git a/fsys/CMakeLists.txt b/fsys/CMakeLists.txt
index b377c41e..ad965bfb 100644
--- a/fsys/CMakeLists.txt
+++ b/fsys/CMakeLists.txt
@@ -26,9 +26,4 @@ set(fox_fsys_srcs_pp
fox_m_fsys_varstr.F90
)
-add_library(
- ${PROJECT_NAME}_fsys STATIC
- ${fox_fsys_srcs}
- ${fox_fsys_srcs_pp}
-)
-
+MK_LIBS(fsys)
\ No newline at end of file
diff --git a/sax/CMakeLists.txt b/sax/CMakeLists.txt
index dcc0f812..12fc4b70 100644
--- a/sax/CMakeLists.txt
+++ b/sax/CMakeLists.txt
@@ -11,16 +11,4 @@ set(fox_sax_srcs_pp
m_sax_xml_source.F90
)
-
-add_library(
- ${PROJECT_NAME}_sax STATIC
- ${fox_sax_srcs}
- ${fox_sax_srcs_pp}
-)
-
-target_link_libraries(
- ${PROJECT_NAME}_sax
- ${PROJECT_NAME}_common
- ${PROJECT_NAME}_utils
- ${PROJECT_NAME}_fsys
-)
+MK_LIBS(sax common utils fsys)
\ No newline at end of file
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 5cc32249..a43c3a31 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -8,15 +8,4 @@ set(fox_utils_srcs_pp
fox_m_utils_uuid.F90
)
-add_library(
- ${PROJECT_NAME}_utils STATIC
- ${fox_utils_srcs}
- ${fox_utils_srcs_pp}
-)
-
-target_link_libraries(
- ${PROJECT_NAME}_utils
- ${PROJECT_NAME}_fsys
-)
-
-
+MK_LIBS(utils fsys)
\ No newline at end of file
diff --git a/wcml/CMakeLists.txt b/wcml/CMakeLists.txt
index b4eb3552..775a9907 100644
--- a/wcml/CMakeLists.txt
+++ b/wcml/CMakeLists.txt
@@ -91,14 +91,4 @@ set(fox_wcml_srcs_pp
m_wcml_inputdec.F90
)
-add_library(
- ${PROJECT_NAME}_wcml STATIC
- ${fox_wcml_srcs}
- ${fox_wcml_srcs_pp}
-)
-
-target_link_libraries(
- ${PROJECT_NAME}_wcml
- ${PROJECT_NAME}_utils
- ${PROJECT_NAME}_wxml
-)
+MK_LIBS(wcml utils wxml)
\ No newline at end of file
diff --git a/wkml/CMakeLists.txt b/wkml/CMakeLists.txt
index b8990932..dd380d31 100644
--- a/wkml/CMakeLists.txt
+++ b/wkml/CMakeLists.txt
@@ -26,15 +26,4 @@ set(fox_wkml_srcs_pp
m_wkml_chart.F90
)
-add_library(
- ${PROJECT_NAME}_wkml STATIC
- ${fox_wkml_srcs}
- ${fox_wkml_srcs_pp}
-)
-
-target_link_libraries(
- ${PROJECT_NAME}_wkml
- ${PROJECT_NAME}_utils
- ${PROJECT_NAME}_wxml
-)
-
+MK_LIBS(wkml utils wxml)
\ No newline at end of file
diff --git a/wxml/CMakeLists.txt b/wxml/CMakeLists.txt
index 03c8f5a8..5d926f6b 100644
--- a/wxml/CMakeLists.txt
+++ b/wxml/CMakeLists.txt
@@ -19,15 +19,5 @@ set(fox_wxml_srcs_pp
m_wxml_escape.F90
m_wxml_overloads.F90
)
-
-add_library(
- ${PROJECT_NAME}_wxml STATIC
- ${fox_wxml_srcs}
- ${fox_wxml_srcs_pp}
-)
-target_link_libraries(
- ${PROJECT_NAME}_wxml
- ${PROJECT_NAME}_common
- ${PROJECT_NAME}_fsys
-)
+MK_LIBS(wxml common fsys)
\ No newline at end of file
From 248a8602c3380cdcbf54043b2ca4b664916c5149 Mon Sep 17 00:00:00 2001
From: Christoph Honal
Date: Mon, 29 Oct 2018 20:29:20 +0100
Subject: [PATCH 22/31] Add option to suppress non-fatal warnings
---
CMakeLists.txt | 7 +
common/m_common_error.F90 | 420 +++++++++++++++++++-------------------
2 files changed, 218 insertions(+), 209 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5adef328..267304f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,7 @@ OPTION(${PROJECT_NAME}_ENABLE_WCML "Enable/disable Chemical Markup Language outp
OPTION(${PROJECT_NAME}_ENABLE_WKML "Enable/disable Keyhole Markup Language output library" ON)
OPTION(${PROJECT_NAME}_ENABLE_DOM "Enable/disable Document Object Model input library" ON)
OPTION(${PROJECT_NAME}_ENABLE_EXAMPLES "Build examples" ON)
+OPTION(${PROJECT_NAME}_SUPPRESS_WARNINGS "Supress non-fatal warnings" OFF)
OPTION(BUILD_SHARED_LIBS, OFF)
#======================#
@@ -195,4 +196,10 @@ ELSE()
SET_PROPERTY(GLOBAL PROPERTY INCLUDE_DIRECTORIES ${NEW_INCLUDE_DIRS})
ENDIF()
+# supress warnings
+IF(${PROJECT_NAME}_SUPPRESS_WARNINGS)
+ ADD_DEFINITIONS(-DSUPPRESS_WARNINGS)
+ENDIF()
+
+# install modules
INSTALL(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
\ No newline at end of file
diff --git a/common/m_common_error.F90 b/common/m_common_error.F90
index 0a1f1c1a..20598d02 100644
--- a/common/m_common_error.F90
+++ b/common/m_common_error.F90
@@ -1,211 +1,213 @@
module m_common_error
-#ifndef DUMMYLIB
- use fox_m_fsys_abort_flush, only: pxfabort, pxfflush
- use fox_m_fsys_array_str, only: vs_str_alloc
-
- implicit none
- private
-
- integer, parameter :: ERR_NULL = 0
- integer, parameter :: ERR_WARNING = 1
- integer, parameter :: ERR_ERROR = 2
- integer, parameter :: ERR_FATAL = 3
-#endif
- logical, save :: errors_are_fatal = .false.
- logical, save :: warnings_are_fatal = .false.
-
-#ifndef DUMMYLIB
- type error_t
- integer :: severity = ERR_NULL
- integer :: error_code = 0
- character, dimension(:), pointer :: msg => null()
- end type error_t
-
- type error_stack
- type(error_t), dimension(:), pointer :: stack => null()
- end type error_stack
-
- interface FoX_warning
- module procedure FoX_warning_base
- end interface
-
- interface FoX_error
- module procedure FoX_error_base
- end interface
-
- interface FoX_fatal
- module procedure FoX_fatal_base
- end interface
-
- public :: ERR_NULL
- public :: ERR_WARNING
- public :: ERR_ERROR
- public :: ERR_FATAL
-
- public :: error_t
- public :: error_stack
-
- public :: init_error_stack
- public :: destroy_error_stack
-
- public :: FoX_warning
- public :: FoX_error
- public :: FoX_fatal
-
- public :: FoX_warning_base
- public :: FoX_error_base
- public :: FoX_fatal_base
-
- public :: add_error
- public :: in_error
-
-#endif
- public :: FoX_set_fatal_errors
- public :: FoX_get_fatal_errors
- public :: FoX_set_fatal_warnings
- public :: FoX_get_fatal_warnings
-
-contains
-#ifndef DUMMYLIB
-
- subroutine FoX_warning_base(msg)
- ! Emit warning, but carry on.
- character(len=*), intent(in) :: msg
-
- if (warnings_are_fatal) then
- write(0,'(a)') 'FoX warning made fatal'
- call FoX_fatal_base(msg)
- endif
-
- write(0,'(a)') 'WARNING(FoX)'
- write(0,'(a)') msg
- call pxfflush(0)
-
- end subroutine FoX_warning_base
-
-
- subroutine FoX_error_base(msg)
- ! Emit error message and stop.
- ! No clean up is done here, but this can
- ! be overridden to include clean-up routines
- character(len=*), intent(in) :: msg
-
- if (errors_are_fatal) then
- write(0,'(a)') 'FoX error made fatal'
- call FoX_fatal_base(msg)
- endif
-
- write(0,'(a)') 'ERROR(FoX)'
- write(0,'(a)') msg
- call pxfflush(0)
-
- stop
-
- end subroutine FoX_error_base
-
- subroutine FoX_fatal_base(msg)
- !Emit error message and abort with coredump.
- !No clean-up occurs
-
- character(len=*), intent(in) :: msg
-
- write(0,'(a)') 'ABORT(FOX)'
- write(0,'(a)') msg
- call pxfflush(0)
-
- call pxfabort()
-
- end subroutine FoX_fatal_base
-
-
- subroutine init_error_stack(stack)
- type(error_stack), intent(inout) :: stack
-
- allocate(stack%stack(0))
- end subroutine init_error_stack
-
-
- subroutine destroy_error_stack(stack)
- type(error_stack), intent(inout) :: stack
-
- integer :: i
-
- do i = 1, size(stack%stack)
- deallocate(stack%stack(i)%msg)
- enddo
- deallocate(stack%stack)
- end subroutine destroy_error_stack
-
-
- subroutine add_error(stack, msg, severity, error_code)
- type(error_stack), intent(inout) :: stack
- character(len=*), intent(in) :: msg
- integer, intent(in), optional :: severity
- integer, intent(in), optional :: error_code
-
- integer :: i, n
- type(error_t), dimension(:), pointer :: temp_stack
-
- if (.not.associated(stack%stack)) &
- call init_error_stack(stack)
-
- n = size(stack%stack)
-
- temp_stack => stack%stack
- allocate(stack%stack(n+1))
- do i = 1, size(temp_stack)
- stack%stack(i)%msg => temp_stack(i)%msg
- stack%stack(i)%severity = temp_stack(i)%severity
- stack%stack(i)%error_code = temp_stack(i)%error_code
- enddo
- deallocate(temp_stack)
-
- stack%stack(n+1)%msg => vs_str_alloc(msg)
- if (present(severity)) then
- stack%stack(n+1)%severity = severity
- else
- stack%stack(n+1)%severity = ERR_ERROR
- endif
- if (present(error_code)) then
- stack%stack(n+1)%error_code = error_code
- else
- stack%stack(n+1)%error_code = -1
- endif
-
- end subroutine add_error
-
-
- function in_error(stack) result(p)
- type(error_stack), intent(in) :: stack
- logical :: p
-
- if (associated(stack%stack)) then
- p = (size(stack%stack) > 0)
- else
- p = .false.
- endif
- end function in_error
-
-#endif
- subroutine FoX_set_fatal_errors(newvalue)
- logical, intent(in) :: newvalue
- errors_are_fatal = newvalue
- end subroutine FoX_set_fatal_errors
-
- function FoX_get_fatal_errors()
- logical :: FoX_get_fatal_errors
- FoX_get_fatal_errors = errors_are_fatal
- end function FoX_get_fatal_errors
-
- subroutine FoX_set_fatal_warnings(newvalue)
- logical, intent(in) :: newvalue
- warnings_are_fatal = newvalue
- end subroutine FoX_set_fatal_warnings
-
- function FoX_get_fatal_warnings()
- logical :: FoX_get_fatal_warnings
- FoX_get_fatal_warnings = warnings_are_fatal
- end function FoX_get_fatal_warnings
-
-end module m_common_error
+ #ifndef DUMMYLIB
+ use fox_m_fsys_abort_flush, only: pxfabort, pxfflush
+ use fox_m_fsys_array_str, only: vs_str_alloc
+
+ implicit none
+ private
+
+ integer, parameter :: ERR_NULL = 0
+ integer, parameter :: ERR_WARNING = 1
+ integer, parameter :: ERR_ERROR = 2
+ integer, parameter :: ERR_FATAL = 3
+ #endif
+ logical, save :: errors_are_fatal = .false.
+ logical, save :: warnings_are_fatal = .false.
+
+ #ifndef DUMMYLIB
+ type error_t
+ integer :: severity = ERR_NULL
+ integer :: error_code = 0
+ character, dimension(:), pointer :: msg => null()
+ end type error_t
+
+ type error_stack
+ type(error_t), dimension(:), pointer :: stack => null()
+ end type error_stack
+
+ interface FoX_warning
+ module procedure FoX_warning_base
+ end interface
+
+ interface FoX_error
+ module procedure FoX_error_base
+ end interface
+
+ interface FoX_fatal
+ module procedure FoX_fatal_base
+ end interface
+
+ public :: ERR_NULL
+ public :: ERR_WARNING
+ public :: ERR_ERROR
+ public :: ERR_FATAL
+
+ public :: error_t
+ public :: error_stack
+
+ public :: init_error_stack
+ public :: destroy_error_stack
+
+ public :: FoX_warning
+ public :: FoX_error
+ public :: FoX_fatal
+
+ public :: FoX_warning_base
+ public :: FoX_error_base
+ public :: FoX_fatal_base
+
+ public :: add_error
+ public :: in_error
+
+ #endif
+ public :: FoX_set_fatal_errors
+ public :: FoX_get_fatal_errors
+ public :: FoX_set_fatal_warnings
+ public :: FoX_get_fatal_warnings
+
+ contains
+ #ifndef DUMMYLIB
+
+ subroutine FoX_warning_base(msg)
+ ! Emit warning, but carry on.
+ character(len=*), intent(in) :: msg
+
+ if (warnings_are_fatal) then
+ write(0,'(a)') 'FoX warning made fatal'
+ call FoX_fatal_base(msg)
+ endif
+ # if defined(SUPPRESS_WARNINGS)
+ write(0,'(a)') 'WARNING(FoX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
+ # endif
+
+ end subroutine FoX_warning_base
+
+
+ subroutine FoX_error_base(msg)
+ ! Emit error message and stop.
+ ! No clean up is done here, but this can
+ ! be overridden to include clean-up routines
+ character(len=*), intent(in) :: msg
+
+ if (errors_are_fatal) then
+ write(0,'(a)') 'FoX error made fatal'
+ call FoX_fatal_base(msg)
+ endif
+
+ write(0,'(a)') 'ERROR(FoX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
+
+ stop
+
+ end subroutine FoX_error_base
+
+ subroutine FoX_fatal_base(msg)
+ !Emit error message and abort with coredump.
+ !No clean-up occurs
+
+ character(len=*), intent(in) :: msg
+
+ write(0,'(a)') 'ABORT(FOX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
+
+ call pxfabort()
+
+ end subroutine FoX_fatal_base
+
+
+ subroutine init_error_stack(stack)
+ type(error_stack), intent(inout) :: stack
+
+ allocate(stack%stack(0))
+ end subroutine init_error_stack
+
+
+ subroutine destroy_error_stack(stack)
+ type(error_stack), intent(inout) :: stack
+
+ integer :: i
+
+ do i = 1, size(stack%stack)
+ deallocate(stack%stack(i)%msg)
+ enddo
+ deallocate(stack%stack)
+ end subroutine destroy_error_stack
+
+
+ subroutine add_error(stack, msg, severity, error_code)
+ type(error_stack), intent(inout) :: stack
+ character(len=*), intent(in) :: msg
+ integer, intent(in), optional :: severity
+ integer, intent(in), optional :: error_code
+
+ integer :: i, n
+ type(error_t), dimension(:), pointer :: temp_stack
+
+ if (.not.associated(stack%stack)) &
+ call init_error_stack(stack)
+
+ n = size(stack%stack)
+
+ temp_stack => stack%stack
+ allocate(stack%stack(n+1))
+ do i = 1, size(temp_stack)
+ stack%stack(i)%msg => temp_stack(i)%msg
+ stack%stack(i)%severity = temp_stack(i)%severity
+ stack%stack(i)%error_code = temp_stack(i)%error_code
+ enddo
+ deallocate(temp_stack)
+
+ stack%stack(n+1)%msg => vs_str_alloc(msg)
+ if (present(severity)) then
+ stack%stack(n+1)%severity = severity
+ else
+ stack%stack(n+1)%severity = ERR_ERROR
+ endif
+ if (present(error_code)) then
+ stack%stack(n+1)%error_code = error_code
+ else
+ stack%stack(n+1)%error_code = -1
+ endif
+
+ end subroutine add_error
+
+
+ function in_error(stack) result(p)
+ type(error_stack), intent(in) :: stack
+ logical :: p
+
+ if (associated(stack%stack)) then
+ p = (size(stack%stack) > 0)
+ else
+ p = .false.
+ endif
+ end function in_error
+
+ #endif
+ subroutine FoX_set_fatal_errors(newvalue)
+ logical, intent(in) :: newvalue
+ errors_are_fatal = newvalue
+ end subroutine FoX_set_fatal_errors
+
+ function FoX_get_fatal_errors()
+ logical :: FoX_get_fatal_errors
+ FoX_get_fatal_errors = errors_are_fatal
+ end function FoX_get_fatal_errors
+
+ subroutine FoX_set_fatal_warnings(newvalue)
+ logical, intent(in) :: newvalue
+ warnings_are_fatal = newvalue
+ end subroutine FoX_set_fatal_warnings
+
+ function FoX_get_fatal_warnings()
+ logical :: FoX_get_fatal_warnings
+ FoX_get_fatal_warnings = warnings_are_fatal
+ end function FoX_get_fatal_warnings
+
+ end module m_common_error
+
\ No newline at end of file
From 63a945a350c54a028d9464baa74bf04b193d85cd Mon Sep 17 00:00:00 2001
From: Christoph Honal
Date: Mon, 29 Oct 2018 20:37:56 +0100
Subject: [PATCH 23/31] Fix indentation
---
common/m_common_error.F90 | 418 +++++++++++++++++++-------------------
1 file changed, 209 insertions(+), 209 deletions(-)
diff --git a/common/m_common_error.F90 b/common/m_common_error.F90
index 20598d02..f4b9261e 100644
--- a/common/m_common_error.F90
+++ b/common/m_common_error.F90
@@ -1,213 +1,213 @@
module m_common_error
- #ifndef DUMMYLIB
- use fox_m_fsys_abort_flush, only: pxfabort, pxfflush
- use fox_m_fsys_array_str, only: vs_str_alloc
-
- implicit none
- private
-
- integer, parameter :: ERR_NULL = 0
- integer, parameter :: ERR_WARNING = 1
- integer, parameter :: ERR_ERROR = 2
- integer, parameter :: ERR_FATAL = 3
- #endif
- logical, save :: errors_are_fatal = .false.
- logical, save :: warnings_are_fatal = .false.
-
- #ifndef DUMMYLIB
- type error_t
- integer :: severity = ERR_NULL
- integer :: error_code = 0
- character, dimension(:), pointer :: msg => null()
- end type error_t
-
- type error_stack
- type(error_t), dimension(:), pointer :: stack => null()
- end type error_stack
-
- interface FoX_warning
- module procedure FoX_warning_base
- end interface
-
- interface FoX_error
- module procedure FoX_error_base
- end interface
-
- interface FoX_fatal
- module procedure FoX_fatal_base
- end interface
-
- public :: ERR_NULL
- public :: ERR_WARNING
- public :: ERR_ERROR
- public :: ERR_FATAL
-
- public :: error_t
- public :: error_stack
-
- public :: init_error_stack
- public :: destroy_error_stack
-
- public :: FoX_warning
- public :: FoX_error
- public :: FoX_fatal
-
- public :: FoX_warning_base
- public :: FoX_error_base
- public :: FoX_fatal_base
-
- public :: add_error
- public :: in_error
-
- #endif
- public :: FoX_set_fatal_errors
- public :: FoX_get_fatal_errors
- public :: FoX_set_fatal_warnings
- public :: FoX_get_fatal_warnings
-
- contains
- #ifndef DUMMYLIB
-
- subroutine FoX_warning_base(msg)
- ! Emit warning, but carry on.
- character(len=*), intent(in) :: msg
-
- if (warnings_are_fatal) then
- write(0,'(a)') 'FoX warning made fatal'
- call FoX_fatal_base(msg)
- endif
- # if defined(SUPPRESS_WARNINGS)
- write(0,'(a)') 'WARNING(FoX)'
- write(0,'(a)') msg
- call pxfflush(0)
- # endif
-
- end subroutine FoX_warning_base
-
-
- subroutine FoX_error_base(msg)
- ! Emit error message and stop.
- ! No clean up is done here, but this can
- ! be overridden to include clean-up routines
- character(len=*), intent(in) :: msg
-
- if (errors_are_fatal) then
- write(0,'(a)') 'FoX error made fatal'
- call FoX_fatal_base(msg)
- endif
-
- write(0,'(a)') 'ERROR(FoX)'
- write(0,'(a)') msg
- call pxfflush(0)
-
- stop
-
- end subroutine FoX_error_base
-
- subroutine FoX_fatal_base(msg)
- !Emit error message and abort with coredump.
- !No clean-up occurs
-
- character(len=*), intent(in) :: msg
-
- write(0,'(a)') 'ABORT(FOX)'
+#ifndef DUMMYLIB
+ use fox_m_fsys_abort_flush, only: pxfabort, pxfflush
+ use fox_m_fsys_array_str, only: vs_str_alloc
+
+ implicit none
+ private
+
+ integer, parameter :: ERR_NULL = 0
+ integer, parameter :: ERR_WARNING = 1
+ integer, parameter :: ERR_ERROR = 2
+ integer, parameter :: ERR_FATAL = 3
+#endif
+ logical, save :: errors_are_fatal = .false.
+ logical, save :: warnings_are_fatal = .false.
+
+#ifndef DUMMYLIB
+ type error_t
+ integer :: severity = ERR_NULL
+ integer :: error_code = 0
+ character, dimension(:), pointer :: msg => null()
+ end type error_t
+
+ type error_stack
+ type(error_t), dimension(:), pointer :: stack => null()
+ end type error_stack
+
+ interface FoX_warning
+ module procedure FoX_warning_base
+ end interface
+
+ interface FoX_error
+ module procedure FoX_error_base
+ end interface
+
+ interface FoX_fatal
+ module procedure FoX_fatal_base
+ end interface
+
+ public :: ERR_NULL
+ public :: ERR_WARNING
+ public :: ERR_ERROR
+ public :: ERR_FATAL
+
+ public :: error_t
+ public :: error_stack
+
+ public :: init_error_stack
+ public :: destroy_error_stack
+
+ public :: FoX_warning
+ public :: FoX_error
+ public :: FoX_fatal
+
+ public :: FoX_warning_base
+ public :: FoX_error_base
+ public :: FoX_fatal_base
+
+ public :: add_error
+ public :: in_error
+
+#endif
+ public :: FoX_set_fatal_errors
+ public :: FoX_get_fatal_errors
+ public :: FoX_set_fatal_warnings
+ public :: FoX_get_fatal_warnings
+
+contains
+#ifndef DUMMYLIB
+
+ subroutine FoX_warning_base(msg)
+ ! Emit warning, but carry on.
+ character(len=*), intent(in) :: msg
+
+ if (warnings_are_fatal) then
+ write(0,'(a)') 'FoX warning made fatal'
+ call FoX_fatal_base(msg)
+ endif
+#ifndef SUPPRESS_WARNINGS
+ write(0,'(a)') 'WARNING(FoX)'
write(0,'(a)') msg
call pxfflush(0)
-
- call pxfabort()
-
- end subroutine FoX_fatal_base
-
-
- subroutine init_error_stack(stack)
- type(error_stack), intent(inout) :: stack
-
- allocate(stack%stack(0))
- end subroutine init_error_stack
-
-
- subroutine destroy_error_stack(stack)
- type(error_stack), intent(inout) :: stack
-
- integer :: i
-
- do i = 1, size(stack%stack)
- deallocate(stack%stack(i)%msg)
- enddo
- deallocate(stack%stack)
- end subroutine destroy_error_stack
-
-
- subroutine add_error(stack, msg, severity, error_code)
- type(error_stack), intent(inout) :: stack
- character(len=*), intent(in) :: msg
- integer, intent(in), optional :: severity
- integer, intent(in), optional :: error_code
-
- integer :: i, n
- type(error_t), dimension(:), pointer :: temp_stack
-
- if (.not.associated(stack%stack)) &
- call init_error_stack(stack)
-
- n = size(stack%stack)
-
- temp_stack => stack%stack
- allocate(stack%stack(n+1))
- do i = 1, size(temp_stack)
- stack%stack(i)%msg => temp_stack(i)%msg
- stack%stack(i)%severity = temp_stack(i)%severity
- stack%stack(i)%error_code = temp_stack(i)%error_code
- enddo
- deallocate(temp_stack)
-
- stack%stack(n+1)%msg => vs_str_alloc(msg)
- if (present(severity)) then
- stack%stack(n+1)%severity = severity
- else
- stack%stack(n+1)%severity = ERR_ERROR
- endif
- if (present(error_code)) then
- stack%stack(n+1)%error_code = error_code
- else
- stack%stack(n+1)%error_code = -1
- endif
-
- end subroutine add_error
-
-
- function in_error(stack) result(p)
- type(error_stack), intent(in) :: stack
- logical :: p
-
- if (associated(stack%stack)) then
- p = (size(stack%stack) > 0)
- else
- p = .false.
- endif
- end function in_error
-
- #endif
- subroutine FoX_set_fatal_errors(newvalue)
- logical, intent(in) :: newvalue
- errors_are_fatal = newvalue
- end subroutine FoX_set_fatal_errors
-
- function FoX_get_fatal_errors()
- logical :: FoX_get_fatal_errors
- FoX_get_fatal_errors = errors_are_fatal
- end function FoX_get_fatal_errors
-
- subroutine FoX_set_fatal_warnings(newvalue)
- logical, intent(in) :: newvalue
- warnings_are_fatal = newvalue
- end subroutine FoX_set_fatal_warnings
-
- function FoX_get_fatal_warnings()
- logical :: FoX_get_fatal_warnings
- FoX_get_fatal_warnings = warnings_are_fatal
- end function FoX_get_fatal_warnings
-
- end module m_common_error
-
\ No newline at end of file
+#endif
+
+ end subroutine FoX_warning_base
+
+
+ subroutine FoX_error_base(msg)
+ ! Emit error message and stop.
+ ! No clean up is done here, but this can
+ ! be overridden to include clean-up routines
+ character(len=*), intent(in) :: msg
+
+ if (errors_are_fatal) then
+ write(0,'(a)') 'FoX error made fatal'
+ call FoX_fatal_base(msg)
+ endif
+
+ write(0,'(a)') 'ERROR(FoX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
+
+ stop
+
+ end subroutine FoX_error_base
+
+ subroutine FoX_fatal_base(msg)
+ !Emit error message and abort with coredump.
+ !No clean-up occurs
+
+ character(len=*), intent(in) :: msg
+
+ write(0,'(a)') 'ABORT(FOX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
+
+ call pxfabort()
+
+ end subroutine FoX_fatal_base
+
+
+ subroutine init_error_stack(stack)
+ type(error_stack), intent(inout) :: stack
+
+ allocate(stack%stack(0))
+ end subroutine init_error_stack
+
+
+ subroutine destroy_error_stack(stack)
+ type(error_stack), intent(inout) :: stack
+
+ integer :: i
+
+ do i = 1, size(stack%stack)
+ deallocate(stack%stack(i)%msg)
+ enddo
+ deallocate(stack%stack)
+ end subroutine destroy_error_stack
+
+
+ subroutine add_error(stack, msg, severity, error_code)
+ type(error_stack), intent(inout) :: stack
+ character(len=*), intent(in) :: msg
+ integer, intent(in), optional :: severity
+ integer, intent(in), optional :: error_code
+
+ integer :: i, n
+ type(error_t), dimension(:), pointer :: temp_stack
+
+ if (.not.associated(stack%stack)) &
+ call init_error_stack(stack)
+
+ n = size(stack%stack)
+
+ temp_stack => stack%stack
+ allocate(stack%stack(n+1))
+ do i = 1, size(temp_stack)
+ stack%stack(i)%msg => temp_stack(i)%msg
+ stack%stack(i)%severity = temp_stack(i)%severity
+ stack%stack(i)%error_code = temp_stack(i)%error_code
+ enddo
+ deallocate(temp_stack)
+
+ stack%stack(n+1)%msg => vs_str_alloc(msg)
+ if (present(severity)) then
+ stack%stack(n+1)%severity = severity
+ else
+ stack%stack(n+1)%severity = ERR_ERROR
+ endif
+ if (present(error_code)) then
+ stack%stack(n+1)%error_code = error_code
+ else
+ stack%stack(n+1)%error_code = -1
+ endif
+
+ end subroutine add_error
+
+
+ function in_error(stack) result(p)
+ type(error_stack), intent(in) :: stack
+ logical :: p
+
+ if (associated(stack%stack)) then
+ p = (size(stack%stack) > 0)
+ else
+ p = .false.
+ endif
+ end function in_error
+
+#endif
+ subroutine FoX_set_fatal_errors(newvalue)
+ logical, intent(in) :: newvalue
+ errors_are_fatal = newvalue
+ end subroutine FoX_set_fatal_errors
+
+ function FoX_get_fatal_errors()
+ logical :: FoX_get_fatal_errors
+ FoX_get_fatal_errors = errors_are_fatal
+ end function FoX_get_fatal_errors
+
+ subroutine FoX_set_fatal_warnings(newvalue)
+ logical, intent(in) :: newvalue
+ warnings_are_fatal = newvalue
+ end subroutine FoX_set_fatal_warnings
+
+ function FoX_get_fatal_warnings()
+ logical :: FoX_get_fatal_warnings
+ FoX_get_fatal_warnings = warnings_are_fatal
+ end function FoX_get_fatal_warnings
+
+end module m_common_error
+
\ No newline at end of file
From 039de15d5f1f2b2630c70068a67398ad6eb91a06 Mon Sep 17 00:00:00 2001
From: Christoph Honal
Date: Mon, 29 Oct 2018 21:08:45 +0100
Subject: [PATCH 24/31] Fix cmake defines
---
CMakeLists.txt | 5 -----
common/CMakeLists.txt | 4 ++++
common/m_common_error.F90 | 8 ++++----
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 267304f2..92c8b5f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,10 +196,5 @@ ELSE()
SET_PROPERTY(GLOBAL PROPERTY INCLUDE_DIRECTORIES ${NEW_INCLUDE_DIRS})
ENDIF()
-# supress warnings
-IF(${PROJECT_NAME}_SUPPRESS_WARNINGS)
- ADD_DEFINITIONS(-DSUPPRESS_WARNINGS)
-ENDIF()
-
# install modules
INSTALL(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
\ No newline at end of file
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 650297b9..5ee0989e 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -19,4 +19,8 @@ set(fox_common_srcs_pp
m_common_struct.F90
)
+IF(${PROJECT_NAME}_SUPPRESS_WARNINGS)
+ ADD_DEFINITIONS(-DSUPPRESS_WARNINGS)
+ENDIF()
+
MK_LIBS(common utils fsys)
\ No newline at end of file
diff --git a/common/m_common_error.F90 b/common/m_common_error.F90
index f4b9261e..f8518558 100644
--- a/common/m_common_error.F90
+++ b/common/m_common_error.F90
@@ -77,10 +77,10 @@ subroutine FoX_warning_base(msg)
write(0,'(a)') 'FoX warning made fatal'
call FoX_fatal_base(msg)
endif
-#ifndef SUPPRESS_WARNINGS
- write(0,'(a)') 'WARNING(FoX)'
- write(0,'(a)') msg
- call pxfflush(0)
+#if !defined(SUPPRESS_WARNINGS)
+ write(0,'(a)') 'WARNING(FoX)'
+ write(0,'(a)') msg
+ call pxfflush(0)
#endif
end subroutine FoX_warning_base
From ed3f778fe31b306fba6f2e7e9a19eea919463bd8 Mon Sep 17 00:00:00 2001
From: Christoph Honal
Date: Fri, 14 Jun 2019 18:00:53 +0200
Subject: [PATCH 25/31] Add rpath to shared libs
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92c8b5f4..87ceddd2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,6 +122,7 @@ INCLUDE(${${PROJECT_NAME}_SOURCE_DIR}/cmake/CheckAssociatedBug.cmake)
INCLUDE(${${PROJECT_NAME}_SOURCE_DIR}/cmake/CheckAbortIntrinsic.cmake)
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FPPFLAGS}")
+set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
MACRO(MK_LIBS _NAME)
ADD_LIBRARY(
From e14576af41d3e39303f793a9ec42b408fd007e2d Mon Sep 17 00:00:00 2001
From: "J. Henneberg" <6606609+JHenneberg@users.noreply.github.com>
Date: Sun, 15 Sep 2019 14:12:01 +0200
Subject: [PATCH 26/31] - bug fix: added m_wcml_inputdec.F90 to FoX.vfproj
---
FoX.vfproj | 235 +++++++++++++++++++++++++++--------------------------
1 file changed, 118 insertions(+), 117 deletions(-)
diff --git a/FoX.vfproj b/FoX.vfproj
index 2c18321b..fbd1704c 100644
--- a/FoX.vfproj
+++ b/FoX.vfproj
@@ -1,117 +1,118 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 65947d132876b962704e218fd661a75b40350a26 Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Sun, 14 Feb 2021 16:21:14 +0000
Subject: [PATCH 27/31] Try to fix the LICENSE file
The first paragraph of the license should not be a bullet point.
This may (or may not) let github detect the license.
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index 53df0326..7a613fe8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -14,7 +14,7 @@ This version of FoX is:
All rights reserved.
-* Redistribution and use in source and binary forms, with or without
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
From f4489f8649742f38fbbd32a4a0cf296f2e527ff3 Mon Sep 17 00:00:00 2001
From: Noam Bernstein
Date: Wed, 10 Feb 2021 14:22:31 -0500
Subject: [PATCH 28/31] Update to compatibility with modern autoconf (2.69),
relying entirely on autoconf distributed lang.m4 and fortran.m4, and
therefore losing compatibility with old fortran compilers that cannot do
their own preprocessing.
---
FoX-config.in | 4 +-
arch.make.in | 11 +-
config/aclocal.m4 | 3224 -----------------
config/configure.ac | 34 +-
config/m4/fortran.m4 | 3134 ----------------
config/m4/lang.m4 | 90 -
config/makefile | 2 +-
configure | 8085 ++++++++++++++----------------------------
8 files changed, 2688 insertions(+), 11896 deletions(-)
delete mode 100644 config/m4/fortran.m4
delete mode 100644 config/m4/lang.m4
diff --git a/FoX-config.in b/FoX-config.in
index 040fffc5..9e55f91e 100755
--- a/FoX-config.in
+++ b/FoX-config.in
@@ -118,13 +118,13 @@ esac
case $FLAGS in
FC)
- echo @FC_MOD_FLAG@"$moddir"
+ echo @FC_MODINC@"$moddir"
;;
LD)
echo $LIBS
;;
both)
- echo @FC_MOD_FLAG@"$moddir" $LIBS
+ echo @FC_MODINC@"$moddir" $LIBS
esac
exit 0
diff --git a/arch.make.in b/arch.make.in
index 217f8a4a..b7526a6b 100644
--- a/arch.make.in
+++ b/arch.make.in
@@ -17,11 +17,8 @@ FFLAGS=@FCFLAGS@
FPPFLAGS=@FPPFLAGS@
LDFLAGS=@LDFLAGS@
-FCFLAGS_free_f90=@FCFLAGS_free_f90@
-FPPFLAGS_free_F90=@FPPFLAGS_free_F90@
-
INC_PREFIX=-I
-MOD_PREFIX=@FC_MOD_FLAG@
+MOD_PREFIX=@FC_MODINC@
LIB_PREFIX=-L
#
MOD_EXT=@FC_MODEXT@
@@ -30,14 +27,14 @@ INSTALL=@INSTALL@
OBJEXT=@OBJEXT@
EXEEXT=@EXEEXT@
LIBEXT=@LIBEXT@
-LINK_O_FLAG=@LINK_O_FLAG@
+LINK_O_FLAG=-o
#INCFLAGS must be set by the user makefile
#Dependency rules are created by autoconf according to whether
#discrete preprocessing is necessary or not.
.F90.@OBJEXT@:
- @F90_RULE@
+ $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS) $<
.f90.@OBJEXT@:
- $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<
+ $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS) $<
diff --git a/config/aclocal.m4 b/config/aclocal.m4
index b3a83380..74bdd1db 100644
--- a/config/aclocal.m4
+++ b/config/aclocal.m4
@@ -1690,3227 +1690,3 @@ AC_DEFUN([TW_PROG_CYGPATH_W], [
fi
AC_SUBST([CYGPATH_W])
])
-# This file is part of Autoconf. -*- Autoconf -*-
-# Fortran languages support.
-# Copyright (C) 2001, 2003-2005
-# Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-# As a special exception, the Free Software Foundation gives unlimited
-# permission to copy, distribute and modify the configure scripts that
-# are the output of Autoconf. You need not follow the terms of the GNU
-# General Public License when using or distributing such scripts, even
-# though portions of the text of Autoconf appear in them. The GNU
-# General Public License (GPL) does govern all other use of the material
-# that constitutes the Autoconf program.
-#
-# Certain portions of the Autoconf source text are designed to be copied
-# (in certain cases, depending on the input) into the output of
-# Autoconf. We call these the "data" portions. The rest of the Autoconf
-# source text consists of comments plus executable code that decides which
-# of the data portions to output in any given case. We call these
-# comments and executable code the "non-data" portions. Autoconf never
-# copies any of the non-data portions into its output.
-#
-# This special exception to the GPL applies to versions of Autoconf
-# released by the Free Software Foundation. When you make and
-# distribute a modified version of Autoconf, you may extend this special
-# exception to the GPL to apply to your modified version as well, *unless*
-# your modified version has the potential to copy into its output some
-# of the text that was the non-data portion of the version that you started
-# with. (In other words, unless your change moves or copies text from
-# the non-data portions to the data portions.) If your modification has
-# such potential, you must delete any notice of this special exception
-# to the GPL from your modified version.
-#
-# Written by David MacKenzie, with help from
-# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-# Roland McGrath, Noah Friedman, david d zuhn, and many others.
-#
-# Fortran preprocessing support written by Martin Wilck, adapted and
-# extended by Norman Gray and Toby White.
-
-
-# Fortran vs. Fortran 77:
-# This file contains macros for both "Fortran 77" and "Fortran", where
-# the former is the "classic" autoconf Fortran interface and is intended
-# for legacy F77 codes, while the latter is intended to support newer Fortran
-# dialects. Fortran 77 uses environment variables F77, FFLAGS, and FLIBS,
-# while Fortran uses FC, FCFLAGS, and FCLIBS. For each user-callable AC_*
-# macro, there is generally both an F77 and an FC version, where both versions
-# share the same _AC_*_FC_* backend. This backend macro requires that
-# the appropriate language be AC_LANG_PUSH'ed, and uses _AC_LANG_ABBREV and
-# _AC_LANG_PREFIX in order to name cache and environment variables, etc.
-
-
-# _AC_LIST_MEMBER_IF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# ---------------------------------------------------------------------------
-#
-# Processing the elements of a list is tedious in shell programming,
-# as lists tend to be implemented as space delimited strings.
-#
-# This macro searches LIST for ELEMENT, and executes ACTION-IF-FOUND
-# if ELEMENT is a member of LIST, otherwise it executes
-# ACTION-IF-NOT-FOUND.
-AC_DEFUN([_AC_LIST_MEMBER_IF],
-[dnl Do some sanity checking of the arguments.
-m4_if([$1], , [AC_FATAL([$0: missing argument 1])])dnl
-m4_if([$2], , [AC_FATAL([$0: missing argument 2])])dnl
- ac_exists=false
- for ac_i in $2; do
- if test x"$1" = x"$ac_i"; then
- ac_exists=true
- break
- fi
- done
-
- AS_IF([test x"$ac_exists" = xtrue], [$3], [$4])[]dnl
-])# _AC_LIST_MEMBER_IF
-
-
-# _AC_LINKER_OPTION(LINKER-OPTIONS, SHELL-VARIABLE)
-# -------------------------------------------------
-#
-# Specifying options to the compiler (whether it be the C, C++ or
-# Fortran 77 compiler) that are meant for the linker is compiler
-# dependent. This macro lets you give options to the compiler that
-# are meant for the linker in a portable, compiler-independent way.
-#
-# This macro take two arguments, a list of linker options that the
-# compiler should pass to the linker (LINKER-OPTIONS) and the name of
-# a shell variable (SHELL-VARIABLE). The list of linker options are
-# appended to the shell variable in a compiler-dependent way.
-#
-# For example, if the selected language is C, then this:
-#
-# _AC_LINKER_OPTION([-R /usr/local/lib/foo], foo_LDFLAGS)
-#
-# will expand into this if the selected C compiler is gcc:
-#
-# foo_LDFLAGS="-Xlinker -R -Xlinker /usr/local/lib/foo"
-#
-# otherwise, it will expand into this:
-#
-# foo_LDFLAGS"-R /usr/local/lib/foo"
-#
-# You are encouraged to add support for compilers that this macro
-# doesn't currently support.
-# FIXME: Get rid of this macro.
-AC_DEFUN([_AC_LINKER_OPTION],
-[if test "$ac_compiler_gnu" = yes; then
- for ac_link_opt in $1; do
- $2="[$]$2 -Xlinker $ac_link_opt"
- done
-else
- $2="[$]$2 $1"
-fi[]dnl
-])# _AC_LINKER_OPTION
-
-
-
-## ----------------------- ##
-## 1. Language selection. ##
-## ----------------------- ##
-
-
-# -------------------------- #
-# 1d. The Fortran language. #
-# -------------------------- #
-
-
-# AC_LANG(Fortran 77)
-# -------------------
-m4_define([AC_LANG(Fortran 77)],
-[ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-])
-
-
-# AC_LANG(Fortran)
-# ----------------
-m4_define([AC_LANG(Fortran)],
-[ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-])
-
-# AC_LANG(Preprocessed Fortran)
-# --------------------------------
-# We need a separate `preprocessed' language, because not all Fortran
-# compilers have a preprocessor built in. Therefore we may need to
-# resort to an `indirect' compilation, .F->.f->.o, including the
-# generation of a suitable extra build rule. The language extension
-# is set in macro AC_PROG_FPP, to $FPP_SRC_EXT.
-m4_define([AC_LANG(Preprocessed Fortran)],
-[ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-])
-
-
-# AC_LANG_FORTRAN77
-# -----------------
-AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
-
-# _AC_FORTRAN_ASSERT
-# ------------------
-# Current language must be Fortran, Fortran 77, or preprocessed Fortran.
-# FIXME: is there any reason why this can't be AC_LANG_CASE?
-m4_defun([_AC_FORTRAN_ASSERT],
-[m4_if(_AC_LANG, [Fortran], [],
- [m4_if(_AC_LANG, [Fortran 77], [],
- [m4_if(_AC_LANG, [Preprocessed Fortran], []
- [m4_fatal([$0: current language is not Fortran: ] _AC_LANG)])])])])
-
-
-# _AC_LANG_ABBREV(Fortran 77)
-# ---------------------------
-m4_define([_AC_LANG_ABBREV(Fortran 77)], [f77])
-
-# _AC_LANG_ABBREV(Fortran)
-# ------------------------
-m4_define([_AC_LANG_ABBREV(Fortran)], [fc])
-
-# _AC_LANG_ABBREV(Preprocessed Fortran)
-# -------------------------------------
-m4_define([_AC_LANG_ABBREV(Preprocessed Fortran)], [fpp])
-
-
-# _AC_LANG_PREFIX(Fortran 77)
-# ---------------------------
-m4_define([_AC_LANG_PREFIX(Fortran 77)], [F])
-
-# _AC_LANG_PREFIX(Fortran)
-# ------------------------
-m4_define([_AC_LANG_PREFIX(Fortran)], [FC])
-
-# _AC_LANG_PREFIX(Preprocessed Fortran)
-# -------------------------------------
-m4_define([_AC_LANG_PREFIX(Preprocessed Fortran)], [FPP])
-
-
-# _AC_FC
-# ------
-# Return F77, FC or PPFC, depending upon the language.
-AC_DEFUN([_AC_FC],
-[_AC_FORTRAN_ASSERT()dnl
-AC_LANG_CASE([Fortran 77], [F77],
- [Fortran], [FC],
- [Preprocessed Fortran], [PPFC])])
-
-
-## ---------------------- ##
-## 2.Producing programs. ##
-## ---------------------- ##
-
-
-# --------------------- #
-# 2d. Fortran sources. #
-# --------------------- #
-
-# AC_LANG_SOURCE(Fortran 77)(BODY)
-# AC_LANG_SOURCE(Fortran)(BODY)
-# --------------------------------
-# FIXME: Apparently, according to former AC_TRY_COMPILER, the CPP
-# directives must not be included. But AC_TRY_RUN_NATIVE was not
-# avoiding them, so?
-m4_define([AC_LANG_SOURCE(Fortran 77)],
-[$1])
-m4_define([AC_LANG_SOURCE(Fortran)],
-[$1])
-m4_define([AC_LANG_SOURCE(Preprocessed Fortran)],
-[$1])
-
-
-# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
-# -----------------------------------------------
-# Yes, we discard the PROLOGUE.
-m4_define([AC_LANG_PROGRAM(Fortran 77)],
-[m4_ifval([$1],
- [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])dnl
- program main
-$2
- end])
-
-
-# AC_LANG_PROGRAM(Fortran)([PROLOGUE], [BODY])
-# -----------------------------------------------
-# FIXME: can the PROLOGUE be used?
-m4_define([AC_LANG_PROGRAM(Fortran)],
-[m4_ifval([$1],
- [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])dnl
- program main
-$2
- end])
-
-
-# AC_LANG_PROGRAM(Preprocessed Fortran)([PROLOGUE], [BODY])
-# ---------------------------------------------------------
-# FIXME: can the PROLOGUE be used?
-m4_define([AC_LANG_PROGRAM(Preprocessed Fortran)],
-[$1
- program main
-$2
- end])
-
-
-# AC_LANG_CALL(Fortran 77)(PROLOGUE, FUNCTION)
-# --------------------------------------------
-# FIXME: This is a guess, help!
-# FIXME: ...but it's a good guesss -- what's the problem?
-m4_define([AC_LANG_CALL(Fortran 77)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_CALL(Fortran)(PROLOGUE, FUNCTION)
-# --------------------------------------------
-# FIXME: This is a guess, help!
-m4_define([AC_LANG_CALL(Fortran)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_CALL(Preprocessed Fortran)(PROLOGUE, FUNCTION)
-# ------------------------------------------------------
-# FIXME: This is a guess, help!
-m4_define([AC_LANG_CALL(Preprocessed Fortran)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Fortran)(FUNCTION)
-# ----------------------------------------
-# Produce a source which links correctly iff the Fortran FUNCTION exists.
-# Note that the generic AC_LANG_FUNC_LINK_TRY macro is deemed severely
-# broken, and is deprecated. The macro still currently exists, however,
-# and so if macros like AC_CHECK_FUNCS are to work with
-# AC_LANG(Fortran) (and friends), then these macros have to be
-# defined.
-#
-# FIXME: This is a severely broken implementation.
-# It does not distinguish between functions and subroutines, and it
-# ignores any arguments. We don't attempt to cope with argument $1
-# being somethine weird -- either already declared as a Fortran keyword
-# or something needing quoting -- if the user wants to ask dumb
-# questions, they'll get dumb answers.
-m4_define([AC_LANG_FUNC_LINK_TRY(Fortran)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Fortran 77)(FUNCTION)
-# -------------------------------------------
-# Ditto, for language `Fortran 77'
-m4_define([AC_LANG_FUNC_LINK_TRY(Fortran 77)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Preprocessed Fortran)(FUNCTION)
-# -----------------------------------------------------
-# Ditto, for language `Preprocessed Fortran'
-m4_define([AC_LANG_FUNC_LINK_TRY(Preprocessed Fortran)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-
-## -------------------------------------------- ##
-## 3. Looking for Compilers and Preprocessors. ##
-## -------------------------------------------- ##
-
-
-# -------------------------- #
-# 3d. The Fortran compiler. #
-# -------------------------- #
-
-
-# AC_LANG_PREPROC(Fortran 77)
-# ---------------------------
-# Find the Fortran 77 preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Fortran 77)],
-[m4_warn([syntax],
- [$0: No preprocessor defined for ]_AC_LANG)])
-
-# AC_LANG_PREPROC(Fortran)
-# ---------------------------
-# Find the Fortran preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Fortran)],
-[m4_warn([syntax],
- [$0: No preprocessor defined for ]_AC_LANG)])
-
-# AC_LANG_PREPROC(Preprocessed Fortran)
-# -------------------------------------
-# Find the Fortran preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Preprocessed Fortran)],
-[AC_REQUIRE([AC_PROG_FPP])])
-
-
-# AC_LANG_COMPILER(Fortran 77)
-# ----------------------------
-# Find the Fortran 77 compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Fortran 77)],
-[AC_REQUIRE([AC_PROG_F77])])
-
-# AC_LANG_COMPILER(Fortran)
-# -------------------------
-# Find the Fortran compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Fortran)],
-[AC_REQUIRE([AC_PROG_FC])])
-
-# AC_LANG_COMPILER(Preprocessed Fortran)
-# --------------------------------------
-# Find the Fortran compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Preprocessed Fortran)],
-[AC_REQUIRE([AC_PROG_FC])])
-
-
-# ac_cv_prog_g77
-# --------------
-# We used to name the cache variable this way.
-AU_DEFUN([ac_cv_prog_g77],
-[ac_cv_f77_compiler_gnu])
-
-
-# _AC_FC_DIALECT_YEAR([DIALECT])
-# ------------------------------
-# Given a Fortran DIALECT, which is Fortran [YY]YY or simply [YY]YY,
-# convert to a 4-digit year. The dialect must be one of Fortran 77,
-# 90, 95, or 2000, currently. If DIALECT is simply Fortran or the
-# empty string, returns the empty string.
-AC_DEFUN([_AC_FC_DIALECT_YEAR],
-[m4_case(m4_bpatsubsts(m4_tolower([$1]), [fortran],[], [ *],[]),
- [77],[1977], [1977],[1977],
- [90],[1990], [1990],[1990],
- [95],[1995], [1995],[1995],
- [2000],[2000],
- [],[],
- [m4_fatal([unknown Fortran dialect])])])
-
-
-# _AC_PROG_FC([DIALECT], [COMPILERS...])
-# --------------------------------------
-# DIALECT is a Fortran dialect, given by Fortran [YY]YY or simply [YY]YY,
-# and must be one of those supported by _AC_FC_DIALECT_YEAR
-#
-# If DIALECT is supplied, then we search for compilers of that dialect
-# first, and then later dialects. Otherwise, we search for compilers
-# of the newest dialect first, and then earlier dialects in increasing age.
-# This search order is necessarily imperfect because the dialect cannot
-# always be inferred from the compiler name.
-#
-# Known compilers:
-# f77/f90/f95: generic compiler names
-# g77: GNU Fortran 77 compiler
-# gfortran: putative GNU Fortran 95+ compiler (in progress)
-# fort77: native F77 compiler under HP-UX (and some older Crays)
-# frt: Fujitsu F77 compiler
-# pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers
-# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
-# lf95: Lahey-Fujitsu F95 compiler
-# fl32: Microsoft Fortran 77 "PowerStation" compiler
-# af77: Apogee F77 compiler for Intergraph hardware running CLIX
-# epcf90: "Edinburgh Portable Compiler" F90
-# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
-# ifc: Intel Fortran 95 compiler for Linux/x86
-# efc: Intel Fortran 95 compiler for IA64
-#
-# Must check for lf95 before f95 - some Lahey versions ship an f95 binary
-# in the default path that must be avoided.
-#
-# Let's emphasise this: the test here is only whether a program with
-# the given name exists -- there's no test at this point of whether
-# the found program is actually a Fortran compiler, and if the first
-# program named f77 (say) in your path is a script which deletes all
-# your files, that's nothing to do with us....
-#
-# A proper fix would involve being able to go back and try another compiler
-# if the first one fails, but that requires a major reworking of much of
-# autoconf. The same problem arises (with no easy solution) on some Digital
-# compilers: f95 fails on .F files, f90 succeeds.
-#
-# Also, in case it's not obvious, this macro can be called only once: we
-# presume that multiple Fortran variants can be handled by a compiler which
-# can handle the most recent one. If this is not the case -- either you need
-# to give special flags to enable and disable the language features you use
-# in different modules, or in the extreme case use different compilers for
-# different files -- you're going to have to do something clever.
-#
-# FIXME At some point gfortran (as the official Gnu Fortran compiler)
-# should be moved up to be the first choice.
-# However, I don't think it's mature enough at the moment.
-#
-m4_define([_AC_F95_FC], [xlf95 lf95 f95 fort ifort ifc efc pgf95 pathf90 gfortran g95])
-m4_define([_AC_F90_FC], [f90 xlf90 pgf90 epcf90])
-m4_define([_AC_F77_FC], [g77 f77 xlf frt pgf77 fort77 fl32 af77])
-AC_DEFUN([_AC_PROG_FC],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CHECK_TOOLS([]_AC_FC[],
- m4_default([$2],
- m4_case(_AC_FC_DIALECT_YEAR([$1]),
- [1995], [_AC_F95_FC],
- [1990], [_AC_F90_FC _AC_F95_FC],
- [1977], [_AC_F77_FC _AC_F90_FC _AC_F95_FC],
- [_AC_F95_FC _AC_F90_FC _AC_F77_FC])))
-
-# Provide some information about the compiler.
-echo "$as_me:__oline__:" \
- "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
-ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version &AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v &AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V &AS_MESSAGE_LOG_FD])
-rm -f a.out
-
-m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
-m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-_AC_LANG_COMPILER_GNU
-ac_ext=$ac_save_ext
-_AC_PROG_FC_G
-])# _AC_PROG_FC
-
-# AC_FC_MOD_SUFFIX
-# -----------------
-# Determines the form of the filename of modules produced
-# by the Fortran compiler.
-# Tests for all forms of file extension I've (TOHW) found in the
-# wild. Note that at least one compiler (PGI??) changes the
-# case of the basename as well. Whether this happens is
-# encoded in the variable ac_fc_mod_uppercase.
-#
-# This macro depends, of course, on the Fortran compiler producing
-# module files. See comment to AC_FC_MOD_PATH_FLAG.
-#
-# FIXME: This will fail if an F77-only compiler is used.
-# Currently we warn and continue. We should maybe error out.
-#
-AC_DEFUN([AC_FC_MOD_SUFFIX],
-[
-cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
-_ACEOF
-_AC_EVAL_STDERR($ac_compile)
-AC_MSG_CHECKING([for suffix of module files])
-for ac_mod_file in conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod none
-do
- if test -f $ac_mod_file; then
- break;
- fi
-done
-rm -f conftest.$ac_ext conftest.$ac_exe_ext conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod
-#
-FC_MODEXT=
-FC_MODUPPERCASE=no
-case $ac_mod_file in
- conftest.mod)
- FC_MODEXT=mod
- ;;
- conftest.MOD)
- FC_MODEXT=MOD
- ;;
- conftest.M)
- FC_MODEXT=M
- ;;
- CONFTEST.MOD)
- FC_MODEXT=MOD
- FC_MODUPPERCASE=yes
- ;;
- CONFTEST.mod)
- FC_MODEXT=mod
- FC_MODUPPERCASE=yes
- ;;
- none)
- AC_MSG_WARN([Could not find Fortran module file extension.])
- ;;
-esac
-
-AC_MSG_RESULT([$FC_MODEXT])
-AC_MSG_CHECKING([whether module filenames are uppercased])
-AC_MSG_RESULT([$FC_MODUPPERCASE])
-
-AC_SUBST(FC_MODEXT)
-AC_SUBST(FC_MODUPPERCASE)
-])# AC_FC_MOD_SUFFIX
-
-
-# AC_PROG_F77([COMPILERS...])
-# ---------------------------
-# COMPILERS is a space separated list of Fortran 77 compilers to search
-# for. See also _AC_PROG_FC.
-AC_DEFUN([AC_PROG_F77],
-[AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])dnl
-AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-_AC_PROG_FC([Fortran 77], [$1])
-G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_LANG_POP(Fortran 77)dnl
-])# AC_PROG_F77
-
-
-# AC_PROG_FC([COMPILERS...], [DIALECT])
-# -------------------------------------
-# COMPILERS is a space separated list of Fortran 77 compilers to search
-# for, and [DIALECT] is an optional dialect. See also _AC_PROG_FC.
-AC_DEFUN([AC_PROG_FC],
-[AC_BEFORE([$0], [AC_PROG_FPP])dnl
-AC_LANG_PUSH(Fortran)dnl
-AC_ARG_VAR([FC], [Fortran compiler command])dnl
-AC_ARG_VAR([FCFLAGS], [Fortran compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-_AC_PROG_FC([$2], [$1])
-AC_LANG_POP(Fortran)dnl
-])# AC_PROG_FC
-
-
-# _AC_PROG_FC_G
-# -------------
-# Check whether -g works, even if F[C]FLAGS is set, in case the package
-# plays around with F[C]FLAGS (such as to build both debugging and normal
-# versions of a library), tasteless as that idea is.
-m4_define([_AC_PROG_FC_G],
-[_AC_FORTRAN_ASSERT()dnl
-ac_test_FFLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set}
-ac_save_FFLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-_AC_LANG_PREFIX[]FLAGS=
-AC_CACHE_CHECK(whether $[]_AC_FC[] accepts -g, ac_cv_prog_[]_AC_LANG_ABBREV[]_g,
-[_AC_LANG_PREFIX[]FLAGS=-g
-_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_g=yes],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_g=no])
-])
-if test "$ac_test_FFLAGS" = set; then
- _AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_[]_AC_LANG_ABBREV[]_g = yes; then
- if test "x$ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu" = xyes; then
- _AC_LANG_PREFIX[]FLAGS="-g -O2"
- else
- _AC_LANG_PREFIX[]FLAGS="-g"
- fi
-else
- if test "x$ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu" = xyes; then
- _AC_LANG_PREFIX[]FLAGS="-O2"
- else
- _AC_LANG_PREFIX[]FLAGS=
- fi
-fi[]dnl
-])# _AC_PROG_FC_G
-
-
-# _AC_PROG_FC_C_O
-# ---------------
-# Test if the Fortran compiler accepts the options `-c' and `-o'
-# simultaneously, and define `[F77/FC]_NO_MINUS_C_MINUS_O' if it does not.
-#
-# The usefulness of this macro is questionable, as I can't really see
-# why anyone would use it. The only reason I include it is for
-# completeness, since a similar test exists for the C compiler.
-#
-# FIXME: it seems like we could merge the C/Fortran versions of this.
-AC_DEFUN([_AC_PROG_FC_C_O],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([whether $[]_AC_FC[] understands -c and -o together],
- [ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o],
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-# We test twice because some compilers refuse to overwrite an existing
-# `.o' file with `-o', although they will create one.
-ac_try='$[]_AC_FC[] $[]_AC_LANG_PREFIX[]FLAGS -c conftest.$ac_ext -o conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-if AC_TRY_EVAL(ac_try) &&
- test -f conftest.$ac_objext &&
- AC_TRY_EVAL(ac_try); then
- ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o=yes
-else
- ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o=no
-fi
-rm -f conftest*])
-if test $ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o = no; then
- AC_DEFINE([]_AC_FC[]_NO_MINUS_C_MINUS_O, 1,
- [Define to 1 if your Fortran compiler doesn't accept
- -c and -o together.])
-fi
-])# _AC_PROG_FC_C_O
-
-
-# AC_PROG_F77_C_O
-# ---------------
-AC_DEFUN([AC_PROG_F77_C_O],
-[AC_REQUIRE([AC_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_PROG_FC_C_O
-AC_LANG_POP(Fortran 77)dnl
-])# AC_PROG_F77_C_O
-
-
-# AC_PROG_FC_C_O
-# ---------------
-AC_DEFUN([AC_PROG_FC_C_O],
-[AC_REQUIRE([AC_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_PROG_FC_C_O
-AC_LANG_POP(Fortran)dnl
-])# AC_PROG_FC_C_O
-
-
-## ------------------------------- ##
-## 4. Compilers' characteristics. ##
-## ------------------------------- ##
-
-
-# ---------------------------------------- #
-# 4d. Fortran 77 compiler characteristics. #
-# ---------------------------------------- #
-
-
-# _AC_PROG_FC_V_OUTPUT([FLAG = $ac_cv_prog_{f77/fc}_v])
-# -------------------------------------------------
-# Link a trivial Fortran program, compiling with a verbose output FLAG
-# (whose default value, $ac_cv_prog_{f77/fc}_v, is computed by
-# _AC_PROG_FC_V), and return the output in $ac_{f77/fc}_v_output. This
-# output is processed in the way expected by _AC_FC_LIBRARY_LDFLAGS,
-# so that any link flags that are echoed by the compiler appear as
-# space-separated items.
-AC_DEFUN([_AC_PROG_FC_V_OUTPUT],
-[_AC_FORTRAN_ASSERT()dnl
-AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-
-# Compile and link our simple test program by passing a flag (argument
-# 1 to this macro) to the Fortran compiler in order to get
-# "verbose" output that we can then parse for the Fortran linker
-# flags.
-ac_save_FFLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS m4_default([$1], [$ac_cv_prog_[]_AC_LANG_ABBREV[]_v])"
-(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
-ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'`
-echo "$ac_[]_AC_LANG_ABBREV[]_v_output" >&AS_MESSAGE_LOG_FD
-_AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS
-
-rm -f conftest*
-
-# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
-# /foo, /bar, and /baz are search directories for the Fortran linker.
-# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
-ac_[]_AC_LANG_ABBREV[]_v_output="`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
- grep 'LPATH is:' |
- sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $ac_[]_AC_LANG_ABBREV[]_v_output"
-
-case $ac_[]_AC_LANG_ABBREV[]_v_output in
- # If we are using xlf then replace all the commas with spaces.
- *xlfentry*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/,/ /g'` ;;
-
- # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
- # $LIBS confuse us, and the libraries appear later in the output anyway).
- *mGLOB_options_string*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/\"-mGLOB[[^\"]]*\"/ /g'` ;;
-
- # If we are using Cray Fortran then delete quotes.
- # Use "\"" instead of '"' for font-lock-mode.
- # FIXME: a more general fix for quoted arguments with spaces?
- *cft90*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed "s/\"//g"` ;;
-esac
-
-])# _AC_PROG_FC_V_OUTPUT
-
-
-# _AC_PROG_FC_V
-# --------------
-#
-# Determine the flag that causes the Fortran compiler to print
-# information of library and object files (normally -v)
-# Needed for _AC_FC_LIBRARY_FLAGS
-# Some compilers don't accept -v (Lahey: -verbose, xlf: -V, Fujitsu: -###)
-AC_DEFUN([_AC_PROG_FC_V],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([how to get verbose linking output from $[]_AC_FC[]],
- [ac_cv_prog_[]_AC_LANG_ABBREV[]_v],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_v=
-# Try some options frequently used verbose output
-for ac_verb in -v -verbose --verbose -V -\#\#\#; do
- _AC_PROG_FC_V_OUTPUT($ac_verb)
- # look for -l* and *.a constructs in the output
- for ac_arg in $ac_[]_AC_LANG_ABBREV[]_v_output; do
- case $ac_arg in
- [[\\/]]*.a | ?:[[\\/]]*.a | -[[lLRu]]*)
- ac_cv_prog_[]_AC_LANG_ABBREV[]_v=$ac_verb
- break 2 ;;
- esac
- done
-done
-if test -z "$ac_cv_prog_[]_AC_LANG_ABBREV[]_v"; then
- AC_MSG_WARN([cannot determine how to obtain linking information from $[]_AC_FC[]])
-fi],
- [AC_MSG_WARN([compilation failed])])
-])])# _AC_PROG_FC_V
-
-
-# _AC_FC_LIBRARY_LDFLAGS
-# ----------------------
-#
-# Determine the linker flags (e.g. "-L" and "-l") for the Fortran
-# intrinsic and run-time libraries that are required to successfully
-# link a Fortran program or shared library. The output variable
-# FLIBS/FCLIBS is set to these flags.
-#
-# This macro is intended to be used in those situations when it is
-# necessary to mix, e.g. C++ and Fortran, source code into a single
-# program or shared library.
-#
-# For example, if object files from a C++ and Fortran compiler must
-# be linked together, then the C++ compiler/linker must be used for
-# linking (since special C++-ish things need to happen at link time
-# like calling global constructors, instantiating templates, enabling
-# exception support, etc.).
-#
-# However, the Fortran intrinsic and run-time libraries must be
-# linked in as well, but the C++ compiler/linker doesn't know how to
-# add these Fortran libraries. Hence, the macro
-# "AC_F77_LIBRARY_LDFLAGS" was created to determine these Fortran
-# libraries.
-#
-# This macro was packaged in its current form by Matthew D. Langston.
-# However, nearly all of this macro came from the "OCTAVE_FLIBS" macro
-# in "octave-2.0.13/aclocal.m4", and full credit should go to John
-# W. Eaton for writing this extremely useful macro. Thank you John.
-AC_DEFUN([_AC_FC_LIBRARY_LDFLAGS],
-[_AC_FORTRAN_ASSERT()dnl
-_AC_PROG_FC_V
-AC_CACHE_CHECK([for Fortran libraries of $[]_AC_FC[]], ac_cv_[]_AC_LANG_ABBREV[]_libs,
-[if test "x$[]_AC_LANG_PREFIX[]LIBS" != "x"; then
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$[]_AC_LANG_PREFIX[]LIBS" # Let the user override the test.
-else
-
-_AC_PROG_FC_V_OUTPUT
-
-ac_cv_[]_AC_LANG_ABBREV[]_libs=
-
-# Save positional arguments (if any)
-ac_save_positional="$[@]"
-
-set X $ac_[]_AC_LANG_ABBREV[]_v_output
-while test $[@%:@] != 1; do
- shift
- ac_arg=$[1]
- case $ac_arg in
- [[\\/]]*.a | ?:[[\\/]]*.a)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
- ;;
- -bI:*)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
- ;;
- # Ignore these flags.
- -lang* | -lcrt*.o | -lc | -lgcc | -libmil | -LANG:=*)
- ;;
- -lkernel32)
- test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
- ;;
- -[[LRuY]])
- # These flags, when seen by themselves, take an argument.
- # We remove the space between option and argument and re-iterate
- # unless we find an empty arg or a new option (starting with -)
- case $[2] in
- "" | -*);;
- *)
- ac_arg="$ac_arg$[2]"
- shift; shift
- set X $ac_arg "$[@]"
- ;;
- esac
- ;;
- -YP,*)
- for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
- _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- [ac_arg="$ac_arg $ac_j"
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
- done
- ;;
- -[[lLR]]*)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
- ;;
- # Ignore everything else.
- esac
-done
-# restore positional arguments
-set X $ac_save_positional; shift
-
-# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
-# then we insist that the "run path" must be an absolute path (i.e. it
-# must begin with a "/").
-case `(uname -sr) 2>/dev/null` in
- "SunOS 5"*)
- ac_ld_run_path=`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
- sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
- test "x$ac_ld_run_path" != x &&
- _AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_[]_AC_LANG_ABBREV[]_libs)
- ;;
-esac
-fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
-])
-[]_AC_LANG_PREFIX[]LIBS="$ac_cv_[]_AC_LANG_ABBREV[]_libs"
-AC_SUBST([]_AC_LANG_PREFIX[]LIBS)
-])# _AC_FC_LIBRARY_LDFLAGS
-
-
-# AC_F77_LIBRARY_LDFLAGS
-# ----------------------
-AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
-[AC_REQUIRE([AC_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_LIBRARY_LDFLAGS
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_LIBRARY_LDFLAGS
-
-
-# AC_FC_LIBRARY_LDFLAGS
-# ----------------------
-AC_DEFUN([AC_FC_LIBRARY_LDFLAGS],
-[AC_REQUIRE([AC_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_LIBRARY_LDFLAGS
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_LIBRARY_LDFLAGS
-
-
-# _AC_FC_DUMMY_MAIN([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -----------------------------------------------------------
-#
-# Detect name of dummy main routine required by the Fortran libraries,
-# (if any) and define {F77,FC}_DUMMY_MAIN to this name (which should be
-# used for a dummy declaration, if it is defined). On some systems,
-# linking a C program to the Fortran library does not work unless you
-# supply a dummy function called something like MAIN__.
-#
-# Execute ACTION-IF-NOT-FOUND if no way of successfully linking a C
-# program with the {F77,FC} libs is found; default to exiting with an error
-# message. Execute ACTION-IF-FOUND if a dummy routine name is needed
-# and found or if it is not needed (default to defining {F77,FC}_DUMMY_MAIN
-# when needed).
-#
-# What is technically happening is that the Fortran libraries provide
-# their own main() function, which usually initializes Fortran I/O and
-# similar stuff, and then calls MAIN__, which is the entry point of
-# your program. Usually, a C program will override this with its own
-# main() routine, but the linker sometimes complain if you don't
-# provide a dummy (never-called) MAIN__ routine anyway.
-#
-# Of course, programs that want to allow Fortran subroutines to do
-# I/O, etcetera, should call their main routine MAIN__() (or whatever)
-# instead of main(). A separate autoconf test (_AC_FC_MAIN) checks
-# for the routine to use in this case (since the semantics of the test
-# are slightly different). To link to e.g. purely numerical
-# libraries, this is normally not necessary, however, and most C/C++
-# programs are reluctant to turn over so much control to Fortran. =)
-#
-# The name variants we check for are (in order):
-# MAIN__ (g77, MAIN__ required on some systems; IRIX, MAIN__ optional)
-# MAIN_, __main (SunOS)
-# MAIN _MAIN __MAIN main_ main__ _main (we follow DDD and try these too)
-AC_DEFUN([_AC_FC_DUMMY_MAIN],
-[_AC_FORTRAN_ASSERT()dnl
-m4_define(_AC_LANG_PROGRAM_C_[]_AC_FC[]_HOOKS,
-[#ifdef ]_AC_FC[_DUMMY_MAIN
-]AC_LANG_CASE([Fortran], [#ifndef FC_DUMMY_MAIN_EQ_F77])
-[# ifdef __cplusplus
- extern "C"
-# endif
- int ]_AC_FC[_DUMMY_MAIN() { return 1; }
-]AC_LANG_CASE([Fortran], [#endif])
-[#endif
-])
-AC_CACHE_CHECK([for dummy main to link with Fortran libraries],
- ac_cv_[]_AC_LANG_ABBREV[]_dummy_main,
-[ac_[]_AC_LANG_ABBREV[]_dm_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
- ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
- AC_LANG_PUSH(C)dnl
-
- # First, try linking without a dummy main:
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
- [ac_cv_fortran_dummy_main=none],
- [ac_cv_fortran_dummy_main=unknown])
-
- if test $ac_cv_fortran_dummy_main = unknown; then
- for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@define $ac_fortran_dm_var $ac_func]])],
- [ac_cv_fortran_dummy_main=$ac_func; break])
- done
- fi
- AC_LANG_POP(C)dnl
- ac_cv_[]_AC_LANG_ABBREV[]_dummy_main=$ac_cv_fortran_dummy_main
- rm -f conftest*
- LIBS=$ac_[]_AC_LANG_ABBREV[]_dm_save_LIBS
-])
-[]_AC_FC[]_DUMMY_MAIN=$ac_cv_[]_AC_LANG_ABBREV[]_dummy_main
-AS_IF([test "$[]_AC_FC[]_DUMMY_MAIN" != unknown],
- [m4_default([$1],
-[if test $[]_AC_FC[]_DUMMY_MAIN != none; then
- AC_DEFINE_UNQUOTED([]_AC_FC[]_DUMMY_MAIN, $[]_AC_FC[]_DUMMY_MAIN,
- [Define to dummy `main' function (if any) required to
- link to the Fortran libraries.])
- if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
- AC_DEFINE([FC_DUMMY_MAIN_EQ_F77], 1,
- [Define if F77 and FC dummy `main' functions are identical.])
- fi
-fi])],
- [m4_default([$2],
- [AC_MSG_FAILURE([linking to Fortran libraries from C fails])])])
-])# _AC_FC_DUMMY_MAIN
-
-
-# AC_F77_DUMMY_MAIN
-# ----------------------
-AC_DEFUN([AC_F77_DUMMY_MAIN],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_DUMMY_MAIN
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_DUMMY_MAIN
-
-
-# AC_FC_DUMMY_MAIN
-# ----------------------
-AC_DEFUN([AC_FC_DUMMY_MAIN],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_DUMMY_MAIN
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_DUMMY_MAIN
-
-
-# _AC_FC_MAIN
-# -----------
-# Define {F77,FC}_MAIN to name of alternate main() function for use with
-# the Fortran libraries. (Typically, the libraries may define their
-# own main() to initialize I/O, etcetera, that then call your own
-# routine called MAIN__ or whatever.) See _AC_FC_DUMMY_MAIN, above.
-# If no such alternate name is found, just define {F77,FC}_MAIN to main.
-#
-AC_DEFUN([_AC_FC_MAIN],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([for alternate main to link with Fortran libraries],
- ac_cv_[]_AC_LANG_ABBREV[]_main,
-[ac_[]_AC_LANG_ABBREV[]_m_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
- ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
- AC_LANG_PUSH(C)dnl
- ac_cv_fortran_main="main" # default entry point name
- for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@ifdef FC_DUMMY_MAIN_EQ_F77
-@%:@ undef F77_DUMMY_MAIN
-@%:@ undef FC_DUMMY_MAIN
-@%:@else
-@%:@ undef $ac_fortran_dm_var
-@%:@endif
-@%:@define main $ac_func])],
- [ac_cv_fortran_main=$ac_func; break])
- done
- AC_LANG_POP(C)dnl
- ac_cv_[]_AC_LANG_ABBREV[]_main=$ac_cv_fortran_main
- rm -f conftest*
- LIBS=$ac_[]_AC_LANG_ABBREV[]_m_save_LIBS
-])
-if test "$ac_cv_[]_AC_LANG_ABBREV[]_main" = main; then
- AC_DEFINE([]_AC_FC[]_MAIN_IS_MAIN, 1, [True when Fortran main is C main])
-fi
-AC_DEFINE_UNQUOTED([]_AC_FC[]_MAIN, $ac_cv_[]_AC_LANG_ABBREV[]_main,
- [Define to alternate name for `main' routine that is
- called from a `main' in the Fortran libraries.])
-])# _AC_FC_MAIN
-
-
-# AC_F77_MAIN
-# -----------
-AC_DEFUN([AC_F77_MAIN],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_MAIN
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_MAIN
-
-
-# AC_FC_MAIN
-# ----------
-AC_DEFUN([AC_FC_MAIN],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_MAIN
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_MAIN
-
-
-# __AC_FC_NAME_MANGLING
-# ---------------------
-# Test for the name mangling scheme used by the Fortran compiler.
-#
-# Sets ac_cv_{f77,fc}_mangling. The value contains three fields, separated
-# by commas:
-#
-# lower case / upper case:
-# case translation of the Fortran symbols
-# underscore / no underscore:
-# whether the compiler appends "_" to symbol names
-# extra underscore / no extra underscore:
-# whether the compiler appends an extra "_" to symbol names already
-# containing at least one underscore
-#
-AC_DEFUN([__AC_FC_NAME_MANGLING],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([for Fortran name-mangling scheme],
- ac_cv_[]_AC_LANG_ABBREV[]_mangling,
-[AC_COMPILE_IFELSE(
-[ subroutine foobar()
- return
- end
- subroutine foo_bar()
- return
- end],
-[mv conftest.$ac_objext cfortran_test.$ac_objext
-
- ac_save_LIBS=$LIBS
- LIBS="cfortran_test.$ac_objext $LIBS $[]_AC_LANG_PREFIX[]LIBS"
-
- AC_LANG_PUSH(C)dnl
- ac_success=no
- for ac_foobar in foobar FOOBAR; do
- for ac_underscore in "" "_"; do
- ac_func="$ac_foobar$ac_underscore"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
- [ac_success=yes; break 2])
- done
- done
- AC_LANG_POP(C)dnl
-
- if test "$ac_success" = "yes"; then
- case $ac_foobar in
- foobar)
- ac_case=lower
- ac_foo_bar=foo_bar
- ;;
- FOOBAR)
- ac_case=upper
- ac_foo_bar=FOO_BAR
- ;;
- esac
-
- AC_LANG_PUSH(C)dnl
- ac_success_extra=no
- for ac_extra in "" "_"; do
- ac_func="$ac_foo_bar$ac_underscore$ac_extra"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
- [ac_success_extra=yes; break])
- done
- AC_LANG_POP(C)dnl
-
- if test "$ac_success_extra" = "yes"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_case case"
- if test -z "$ac_underscore"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no underscore"
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, underscore"
- fi
- if test -z "$ac_extra"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no extra underscore"
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, extra underscore"
- fi
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
- fi
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
- fi
-
- LIBS=$ac_save_LIBS
- rm -f cfortran_test* conftest*],
- [AC_MSG_FAILURE([cannot compile a simple Fortran program])])
-])
-])# __AC_FC_NAME_MANGLING
-
-# The replacement is empty.
-AU_DEFUN([AC_F77_NAME_MANGLING], [])
-
-
-# _AC_F77_NAME_MANGLING
-# ----------------------
-AC_DEFUN([_AC_F77_NAME_MANGLING],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_REQUIRE([AC_F77_DUMMY_MAIN])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-__AC_FC_NAME_MANGLING
-AC_LANG_POP(Fortran 77)dnl
-])# _AC_F77_NAME_MANGLING
-
-
-# _AC_FC_NAME_MANGLING
-# ----------------------
-AC_DEFUN([_AC_FC_NAME_MANGLING],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_REQUIRE([AC_FC_DUMMY_MAIN])dnl
-AC_LANG_PUSH(Fortran)dnl
-__AC_FC_NAME_MANGLING
-AC_LANG_POP(Fortran)dnl
-])# _AC_FC_NAME_MANGLING
-
-
-# _AC_FC_WRAPPERS
-# ---------------
-# Defines C macros {F77,FC}_FUNC(name,NAME) and {F77,FC}_FUNC_(name,NAME) to
-# properly mangle the names of C identifiers, and C identifiers with
-# underscores, respectively, so that they match the name mangling
-# scheme used by the Fortran compiler.
-AC_DEFUN([_AC_FC_WRAPPERS],
-[_AC_FORTRAN_ASSERT()dnl
-AH_TEMPLATE(_AC_FC[_FUNC],
- [Define to a macro mangling the given C identifier (in lower and upper
- case), which must not contain underscores, for linking with Fortran.])dnl
-AH_TEMPLATE(_AC_FC[_FUNC_],
- [As ]_AC_FC[_FUNC, but for C identifiers containing underscores.])dnl
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in
- "lower case, no underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name]) ;;
- "lower case, no underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;;
- "lower case, underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;;
- "lower case, underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## __]) ;;
- "upper case, no underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME]) ;;
- "upper case, no underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;;
- "upper case, underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;;
- "upper case, underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## __]) ;;
- *)
- AC_MSG_WARN([unknown Fortran name-mangling scheme])
- ;;
-esac
-])# _AC_FC_WRAPPERS
-
-
-# AC_F77_WRAPPERS
-# ---------------
-AC_DEFUN([AC_F77_WRAPPERS],
-[AC_REQUIRE([_AC_F77_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_WRAPPERS
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_WRAPPERS
-
-
-# AC_FC_WRAPPERS
-# --------------
-AC_DEFUN([AC_FC_WRAPPERS],
-[AC_REQUIRE([_AC_FC_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_WRAPPERS
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_WRAPPERS
-
-
-# _AC_FC_FUNC(NAME, [SHELLVAR = NAME])
-# ------------------------------------
-# For a Fortran subroutine of given NAME, define a shell variable
-# $SHELLVAR to the Fortran-mangled name. If the SHELLVAR
-# argument is not supplied, it defaults to NAME.
-AC_DEFUN([_AC_FC_FUNC],
-[_AC_FORTRAN_ASSERT()dnl
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in
- upper*) ac_val="m4_toupper([$1])" ;;
- lower*) ac_val="m4_tolower([$1])" ;;
- *) ac_val="unknown" ;;
-esac
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-m4_if(m4_index([$1],[_]),-1,[],
-[case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
-])
-m4_default([$2],[$1])="$ac_val"
-])# _AC_FC_FUNC
-
-
-# AC_F77_FUNC(NAME, [SHELLVAR = NAME])
-# ------------------------------------
-AC_DEFUN([AC_F77_FUNC],
-[AC_REQUIRE([_AC_F77_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_FUNC([$1],[$2])
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_FUNC
-
-
-# AC_FC_FUNC(NAME, [SHELLVAR = NAME])
-# -----------------------------------
-AC_DEFUN([AC_FC_FUNC],
-[AC_REQUIRE([_AC_FC_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_FUNC([$1],[$2])
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_FUNC
-
-
-# AC_FC_SRCEXT(EXT, [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# -----------------------------------------------------------
-# Set the source-code extension used in Fortran (FC) tests to EXT (which
-# defaults to f). Also, look for any necessary additional FCFLAGS needed
-# to allow this extension, and store them in the output variable
-# FCFLAGS_ (e.g. FCFLAGS_f90 for EXT=f90). If successful,
-# call ACTION-IF-SUCCESS. If unable to compile source code with EXT,
-# call ACTION-IF-FAILURE, which defaults to failing with an error
-# message.
-#
-# (The flags for the current source-code extension, if any, are stored
-# in the FCFLAGS_SRCEXT variable and are automatically used in subsequent
-# autoconf tests.)
-#
-# For ordinary extensions like f90, etcetera, the modified FCFLAGS
-# are currently needed for IBM's xlf* and Intel's ifc (grrr). Unfortunately,
-# xlf* will only take flags to recognize one extension at a time, so if the
-# user wants to compile multiple extensions (.f90 and .f95, say), she
-# will need to use the FCFLAGS_F90 and FCFLAGS_F95 individually rather
-# than just adding them all to FCFLAGS, for example.
-#
-# Also, for Intel's ifc compiler (which does not accept .f95 by default in
-# some versions), the $FCFLAGS_ variable *must* go immediately before
-# the source file on the command line, unlike other $FCFLAGS. Ugh.
-AC_DEFUN([AC_FC_SRCEXT],
-[AC_LANG_PUSH([Fortran])dnl
-AC_MSG_WARN([AC@&t@_FC@&t@_SRCEXT is deprecated. Use AC@&t@_FC_FIXEDFORM([srcext]) or AC@&t@_FC_FREEFORM([srcext]) as appropriate.])
-AC_CACHE_CHECK([for Fortran flag to compile .$1 files],
- ac_cv_fc_srcext_$1,
-[ac_ext=$1
-ac_fc_srcext_FCFLAGS_SRCEXT_save=$FCFLAGS_SRCEXT
-FCFLAGS_SRCEXT=""
-ac_cv_fc_srcext_$1=unknown
-for ac_flag in none -qsuffix=f=$1 -Tf; do
- test "x$ac_flag" != xnone && FCFLAGS_SRCEXT="$ac_flag"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_fc_srcext_$1=$ac_flag; break])
-done
-rm -f conftest.$ac_objext conftest.$1
-FCFLAGS_SRCEXT=$ac_fc_srcext_FCFLAGS_SRCEXT_save
-])
-if test "x$ac_cv_fc_srcext_$1" = xunknown; then
- m4_default([$3],[AC_MSG_ERROR([Fortran could not compile .$1 files])])
-else
- FC_SRCEXT=$1
- if test "x$ac_cv_fc_srcext_$1" = xnone; then
- FCFLAGS_SRCEXT=""
- FCFLAGS_[]$1[]="$FCFLAGS_[]$1[]"
- else
- FCFLAGS_SRCEXT=$ac_cv_fc_srcext_$1
- FCFLAGS_[]$1[]="$FCFLAGS_[]$1[] $ac_cv_fc_srcext_$1"
- fi
- AC_SUBST(FCFLAGS_[]$1)
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_SRCEXT
-
-
-# -------------- #
-# Utility macros #
-# -------------- #
-
-# AC_FC_FIXEDFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# -------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# fixed-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FCFLAGS_fixed_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# The known flags are:
-# -FI: Intel compiler (icc, ecc)
-# -qfixed: IBM compiler (xlf)
-# -fixed: NAG compiler
-# -Mnofree: PGI compiler
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-AC_DEFUN([AC_FC_FIXEDFORM],
-[AC_REQUIRE([AC_PROG_FC])
-AC_LANG_PUSH([Fortran])dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow fixed-form source for .$1 suffix],
- ac_cv_fc_fixedform_$1,
-[ac_cv_fc_fixedform_$1=unknown
-ac_ext=$1
-ac_fc_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none -FI "-qfixed -qsuffix=cpp=$ac_ext" -fixed --fix -Mnofree
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
- ENDP ROGRAM
-],
- [ac_cv_fc_fixedform_$1=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fc_fixedform_FCFLAGS_save
-])
-if test "x$ac_cv_fc_fixedform_$1" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile fixed-form source with .$1 suffix], 77)])
-else
- if test "x$ac_cv_fc_fixedform_$1" != xnone; then
- AC_SUBST(FCFLAGS_fixed_[]$1, "$ac_cv_fc_fixedform_$1")
- fi
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_FIXEDFORM
-
-
-# AC_FC_FREEFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# ------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# free-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FCFLAGS_free_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# For backwards compatibility, this macro may be called without
-# specifying SRCEXT, in which case, a default extension of f90
-# is used. This usage is deprecated.
-#
-# The known flags are:
-# -ffree-form: GNU g77
-# -FR: Intel compiler (icc, ecc)
-# -free: Compaq compiler (fort), NAG compiler
-# -qfree -qsuffix=f=: IBM compiler (xlf) (generates a warning
-# with recent versions)
-# -qfree=f90 -qsuffix=f=: Newer xlf versions
-# --nfix: Lahey compiler
-# -Mfree, -Mfreeform: Portland Group compiler
-# -freeform: SGI compiler
-# -f free: Absoft Fortran
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-AC_DEFUN([AC_FC_FREEFORM],
-[AC_REQUIRE([AC_PROG_FC])
-AC_LANG_PUSH([Fortran])dnl
-dnl default _AC_EXT to 'f90', if no argument is given.
-m4_define([_AC_EXT], m4_if($1, [], f90, $1))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow free-form source for .]_AC_EXT[ suffix],
- ac_cv_fc_freeform_[]_AC_EXT,
-[ac_cv_fc_freeform_[]_AC_EXT=unknown
-ac_ext=_AC_EXT
-ac_fc_freeform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none -ffree-form -FR -free "-qfree=f90" "-qfree=f90 -qsuffix=f=$ac_ext"\
- -qfree "-qfree -qsuffix=f=$ac_ext" -Mfree -Mfreeform \
- -freeform "-f free" --nfix
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-end program],
- [ac_cv_fc_freeform_[]_AC_EXT=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fc_freeform_FCFLAGS_save
-])
-if test "x$ac_cv_fc_freeform_[]_AC_EXT" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile free-form source with .]_AC_EXT[ suffix], 77)])
-else
- if test "x$ac_cv_fc_freeform_[]_AC_EXT" != xnone; then
-dnl if the first argument was absent, then implement the old behaviour,
-dnl and simply append to variable FCFLAGS
- m4_if($1, [],
- [FCFLAGS="$FCFLAGS $ac_cv_fc_freeform_[]_AC_EXT"],
- [AC_SUBST(FCFLAGS_free_[]_AC_EXT, "$ac_cv_fc_freeform_[]_AC_EXT")])
- fi
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_FREEFORM
-
-
-# _AC_FPP_FIXEDFORM_F
-# -------------------
-# Related to AC_FPP_FIXEDFORM, but used only from _AC_PROG_FC_FPP.
-# How do we directly compile a preprocessable .F file?
-# This should be a no-op on all systems except those with case-sensitive
-# filenames, and those which can't do direct compilation anyway.
-# Do not put result into cached variable if it fails.
-AC_DEFUN([_AC_FPP_FIXEDFORM_F],[
-ac_ext=F
-ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none "/fpp" "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=F" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
- ENDP ROGRAM
-#endif
- ],
- [ac_cv_fpp_fixedform_F=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-if test "x$ac_cv_fpp_fixedform_F" = x; then
- AC_MSG_WARN([Cannot compile fixed-form preprocessable Fortran with a .F extension.])
-else
- if test "$ac_cv_fpp_fixedform_F" != none; then
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
- AC_SUBST(FPPFLAGS_fixed_F, "$ac_cv_fpp_fixedform_F")
- fi
-fi
-])# _AC_FPP_FIXEDFORM_F
-
-
-# AC_FPP_FIXEDFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# --------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# preprocessed fixed-format source code, with a source extension of
-# SRCEXT, and puts any necessary flags in FPPFLAGS_fixed_.
-# Call ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# Mostly, this is applicable only when using direct compilation.
-# However the macro also sets FPP_PREPROCESS_EXT and FPP_COMPILE_EXT,
-# based on SRCEXT. SRCEXT can be either 'EXT' or 'EXT1:ext2'; in the
-# first case, the preprocessor extension is 'EXT', and the compile
-# extension 'ext' (ie, the preprocessor extension, lowercased); in the
-# second, the preprocessor extension is 'EXT1' and the compile
-# extension 'ext2'.
-#
-# The known flags are:
-# -x f77-cpp-input: g77
-# -FI -cpp: Intel compiler (ifort)
-# -qfixed -qsuffix=cpp=: IBM compiler (xlf)
-# -fixed -fpp: NAG compiler
-# -lfe "-Cpp" --fix: Lahey compiler
-# -Mnofree: PGI (no flag for preprocessing available)
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-# NB when updating this list of flags, also update those of the previous
-# macro.
-AC_DEFUN([AC_FPP_FIXEDFORM],
-[AC_REQUIRE([AC_PROG_FPP])
-AC_LANG_PUSH([Fortran])dnl
-dnl Extract preprocessor extension _ac_ppext from $1, part preceding any ':'
-m4_define([_ac_ppext], m4_bpatsubst([$1], [:.*]))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow preprocessed fixed-form source for ._ac_ppext suffix],
- ac_cv_fpp_fixedform_[]_ac_ppext,
-[if test $ac_cv_fpp_build_rule = direct; then
- ac_cv_fpp_fixedform_[]_ac_ppext=unknown
- ac_ext=_ac_ppext
- ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
- for ac_flag in none "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=_ac_ppext" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
- do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifndef OK
- ENDP ROGRAM
-#endif
- ],
- [ac_cv_fpp_fixedform_[]_ac_ppext=$ac_flag; break])
- done
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-else
- ac_cv_fpp_fixedform_[]_ac_ppext=none
-fi # test $ac_cv_fpp_build_rule = direct
-])
-if test "x$ac_cv_fpp_fixedform_[]_ac_ppext" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile fixed-form source with ._ac_ppext suffix], 77)])
-else
- if test "x$ac_cv_fpp_fixedform_[]_ac_ppext" != xnone; then
- AC_SUBST(FPPFLAGS_fixed_[]_ac_ppext, "$ac_cv_fpp_fixedform_[]_ac_ppext")
- fi
- $2
-fi
-
-FPP_PREPROCESS_EXT=_ac_ppext
-FPP_COMPILE_EXT=m4_if(m4_index([$1], :), -1,
- m4_tolower([$1]),
- m4_bpatsubst([$1], [.*:]))
-
-AC_LANG_POP([Fortran])dnl
-])# AC_FPP_FIXEDFORM
-
-
-# AC_FPP_FREEFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# ------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# preprocessed free-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FPPFLAGS_free_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# Mostly, this is applicable only when using direct compilation.
-# However the macro also sets FPP_PREPROCESS_EXT and FPP_COMPILE_EXT,
-# based on SRCEXT. SRCEXT can be either 'EXT' or 'EXT1:ext2'; in the
-# first case, the preprocessor extension is 'EXT', and the compile
-# extension 'ext' (ie, the preprocessor extension, lowercased); in the
-# second, the preprocessor extension is 'EXT1' and the compile
-# extension 'ext2'.
-#
-# The known flags are:
-# -ffree-form -x f77-cpp-input: GNU g77
-# -FR -cpp: Intel compiler (ifort) on unix
-# /FR /fpp: Intel compiler (ifort) on windows
-# -free -cpp: Compaq compiler (fort), NAG compiler
-# -qfree -qsuffix=cpp=: IBM compiler (xlf) (generates a warning
-# with recent versions)
-# -qfree=f90 -qsuffix=cpp=: Newer xlf versions
-# --nfix -lfe="Cpp": Lahey compiler
-# -Mfree, -Mfreeform: PGI (no flag for preprocessing available)
-# -freeform: SGI compiler
-# -f free: Absoft Fortran
-# -fpp -free: NAG Fortran
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity. Also, Intel/Windows must be first or it gets
-# confused
-AC_DEFUN([AC_FPP_FREEFORM],
-[AC_REQUIRE([AC_PROG_FPP])
-AC_LANG_PUSH([Fortran])dnl
-dnl Extract preprocessor extension _ac_ppext from $1, part preceding any ':'
-m4_define([_ac_ppext], m4_bpatsubst([$1], [:.*]))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow free-form preprocessed source for ._ac_ppext suffix],
- ac_cv_fpp_freeform_[]_ac_ppext,
-[if test $ac_cv_fpp_build_rule = direct; then
- ac_cv_fpp_freeform_[]_ac_ppext=unknown
- ac_ext=_ac_ppext
- ac_fpp_freeform_FCFLAGS_save=$FCFLAGS
- for ac_flag in none "/FR /fpp" "-ffree-form -x f77-cpp-input" \
- "-FR -cpp" "-free -cpp" "-qfree=f90 -qsuffix=cpp=_ac_ppext"\
- "-qfree -qsuffix=cpp=_ac_ppext" -Mfree -Mfreeform \
- -freeform "-f free" --nfix "-fpp -free"
- do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_freeform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
-end program
-#endif
- ],
- [ac_cv_fpp_freeform_[]_ac_ppext=$ac_flag; break])
- done
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- FCFLAGS=$ac_fpp_freeform_FCFLAGS_save
-else
- ac_cv_fpp_freeform_[]_ac_ppext=none
-fi # test $ac_cv_fpp_build_rule = direct
-])
-if test "x$ac_cv_fpp_freeform_[]_ac_ppext" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile free-form source with ._ac_ppext suffix], 77)])
-else
- if test "x$ac_cv_fpp_freeform_[]_ac_ppext" != xnone; then
- AC_SUBST(FPPFLAGS_free_[]_ac_ppext, "$ac_cv_fpp_freeform_[]_ac_ppext")
- fi
- $2
-fi
-
-FPP_PREPROCESS_EXT=_ac_ppext
-FPP_COMPILE_EXT=m4_if(m4_index([$1], :), -1,
- m4_tolower([$1]),
- m4_bpatsubst([$1], [.*:]))
-
-AC_LANG_POP([Fortran])dnl
-])# AC_FPP_FREEFORM
-
-
-# AC_FC_OPEN_SPECIFIERS(specifier ...)
-# ------------------------------------
-#
-# The Fortran OPEN statement is a rich source of portability problems,
-# since there are numerous common extensions which consiste of extra
-# specifiers, several of which are useful when they are available.
-# For each of the specifiers in the (whitespace-separated) argument
-# list, define HAVE_FC_OPEN_mungedspecifier if the specifier may be
-# given as argument to the OPEN statement. The `mungedspecifier' is the
-# `specifier' converted to uppercase and with all characters outside
-# [a-zA-Z0-9_] deleted. Note that this may include `specifiers' such
-# as "access='append'" and "[access='sequential',recl=1]" (note quoting of
-# comma) to check combinations of specifiers. You may not include a
-# space in the `specifier', even quoted. Each argument must be a
-# maximum of 65 characters in length (to abide by Fortran 77
-# line-length limits).
-#
-dnl Multiple m4_quote instances are necessary in case specifier includes comma.
-dnl In the Fortran OPEN line, include status='scratch' unless status=???
-dnl is in the specifier being tested.
-dnl Put specifier on continuation line, in case it's long.
-AC_DEFUN([AC_FC_OPEN_SPECIFIERS],
- [AC_REQUIRE([AC_PROG_FC])dnl
- AC_LANG_PUSH([Fortran])
- AC_FOREACH([Specifier],
- m4_quote(m4_toupper([$1])),
- [m4_define([mungedspec],
- m4_bpatsubst(m4_quote(Specifier), [[^a-zA-Z0-9_]], []))
- AC_CACHE_CHECK([whether ${FC} supports OPEN specifier ]m4_quote(Specifier),
- [ac_cv_fc_spec_]mungedspec,
- [AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],
- [ OPEN(UNIT=99,]m4_if(m4_bregexp(m4_quote(Specifier), [\/dev/null; then
- ac_cv_fc_literal_backslash=yes
- else
- ac_cv_fc_literal_backslash=no
- fi],
- [AC_MSG_WARN([cannot compile a program with backslashes!])
- ac_cv_fc_literal_backslash=unknown])
- AC_LANG_POP([Fortran])])
- if test $ac_cv_fc_literal_backslash = yes; then
- AC_DEFINE([FC_LITERAL_BACKSLASH], 1,
- [Define to 1 if the Fortran compiler interprets '\\' as a pair of characters, not one])
- fi
-])# AC_FC_LITERAL_BACKSLASH
-
-# AC_FC_MOD_PATH_FLAG
-# -------------------------
-# Check which flag is necessary to alter the compiler's search path
-# for module files.
-# This obviously requires that the compiler has some notion of
-# module files as separate from object files and some sensible
-# method of altering its search path. This will therefore not work
-# on early Cray F90 compilers, or on v5 (and 6?) of ifc.
-#
-# Nearly every compiler I have found uses -Ipath for this purpose;
-# Sun F95 v7.1 (at least), uses -Mpath
-# Lahey uses -mod, but it needs to be called as -mod .\; in order
-# to work properly. (so that module files still get written to
-# the current directory.
-# Absoft uses -p (with compulsory space after)
-#
-AC_DEFUN([AC_FC_MOD_PATH_FLAG],[
- _AC_FORTRAN_ASSERT
- AC_REQUIRE([AC_PROG_FC])
- ac_cv_fc_mod_path_flag=no
- AC_MSG_CHECKING([for flag to alter module search path])
- mkdir conftestdir
- cd conftestdir
- cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
-_ACEOF
- _AC_EVAL_STDERR($ac_compile)
- cd ..
- for i in /I -I -M "-mod .\;" "-p "; do
- if test "$ac_cv_fc_mod_path_flag" = "no"; then
- FCFLAGS_save=$FCFLAGS
- FCFLAGS="$FCFLAGS ${i}conftestdir"
- AC_COMPILE_IFELSE([
- subroutine test
- use conftest
- implicit none
- i = 0
- end subroutine test
-],
- [FC_MOD_FLAG=$i; ac_cv_fc_mod_path_flag=$i],
- [:])
- fi
- FCFLAGS=$FCFLAGS_save
- done
- AC_MSG_RESULT([$ac_cv_fc_mod_path_flag])
- rm -rf conftestdir
- AS_IF([test "$ac_cv_fc_mod_path_flag" != "no"],
- [$1],
- [m4_default([$2],[AC_MSG_ERROR([Cannot find flag to alter module search path])])])
- AC_SUBST(FC_MOD_FLAG)
-])# AC_FC_MOD_PATH_FLAG
-
-# -------------------------------------- #
-# Feature tests for Preprocessed Fortran #
-# -------------------------------------- #
-
-
-# ------------------------------------------#
-# Some test programs for different features #
-# ------------------------------------------#
-
-# _AC_LANG_PROGRAM_FPP_SIMPLE
-# ---------------------------
-# The minimum test program - any compiler supporting
-# preprocessing should handle this
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_SIMPLE],
- [AC_LANG_PROGRAM([@%:@define OK], [dnl
-#ifndef OK
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_SIMPLE
-
-
-# _AC_LANG_PROGRAM_FPP_ONLY
-# ---------------------------
-# Test program for pure preprocessing
-# Note that other macros test for literal strings within this, so check
-# for those if you have to change anything here.
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_ONLY],
- [AC_LANG_PROGRAM([@%:@define OK], [dnl
-#ifdef OK
- REAL A
-#else
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_ONLY
-
-
-# _AC_LANG_PROGRAM_FPP_D
-# ---------------------------
-# Like _AC_LANG_PROGRAM_FPP_SIMPLE, but OK is passed via -D switch
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_D],
-[AC_LANG_PROGRAM([],[
-#ifndef OK
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_D
-
-
-# _AC_LANG_PROGRAM_FPP_I
-# ---------------------------
-# Test for #include statement
-# If unsupported, this should give a type error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_I],
-[AC_LANG_PROGRAM([],[
- IMPLICIT CHARACTER (c)
-! Comments in test programs should be freeform compliant just in case.
-! conftest.inc contains the Fortran statement "REAL cc"
-#include "conftest.inc"
- cc=1.
-])])#_AC_LANG_PROGRAM_FPP_I
-
-
-# _AC_LANG_PROGRAM_FPP_SUBS
-# ---------------------------
-# Test whether cpp symbols are expanded in Fortran code lines
-# If not, this should give a type error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_SUBS],
-[AC_LANG_PROGRAM([
-#define NM xxxx
-], [ IMPLICIT CHARACTER (n)
- REAL xxxx
- NM=1.
-])])#_AC_LANG_PROGRAM_FPP_SUBS
-
-
-# _AC_LANG_PROGRAM_FPP_WRAP
-# ---------------------------
-# Test whether preprocessor breaks lines that become too long due
-# to macro substitution.
-# If not, this gives an "unterminated character constant" error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_WRAP],
-[AC_LANG_PROGRAM([
-#define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
-],[ CHARACTER*80 A
- A=LONG
-])])#_AC_LANG_PROGRAM_FPP_WRAP
-
-
-# _AC_LANG_PROGRAM_FPP_CSTYLE
-# ---------------------------
-# Test program for C style comments
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_CSTYLE],
-[AC_LANG_PROGRAM([],[
- A=1. /* C-style comment */
-])])#_AC_LANG_PROGRAM_FPP_CSTYLE
-
-# _AC_LANG_PROGRAM_FPP_CXXSTYLE
-# ---------------------------
-# Test program for C++ style comments
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_CXXSTYLE],
-[
- PROGRAM MAIN
- CHARACTER*10 C
- C = "abcde" // "fghij"; END PROGRAM
-]
-)#_AC_LANG_PROGRAM_FPP_CXXSTYLE
-
-# ----------------#
-# Internal macros #
-# ----------------#
-
-
-# _AC_PROG_FPP_FEATURES ([feature list])
-# --------------------------------------
-# Parse the feature list from configure.in
-AC_DEFUN([_AC_PROG_FPP_FEATURES],
-[# defaults for needed features
-ac_fpp_need_d=yes
-ac_fpp_need_i=yes
-ac_fpp_need_subs=no
-ac_fpp_need_wrap=no
-ac_fpp_need_cstyle=no
-ac_fpp_need_CSTYLE=no
-ac_fpp_need_cxxstyle=yes
-ac_fpp_need_CXXSTYLE=no
-for _t in $1 nil
-do
- case $_t in
- define) ac_fpp_need_d=yes ;;
- nodefine) ac_fpp_need_d=no ;;
- include) ac_fpp_need_i=yes ;;
- noinclude) ac_fpp_need_i=no ;;
- substitute) ac_fpp_need_subs=yes ;;
- nosubstitute) ac_fpp_need_subs=no ;;
- wrap) ac_fpp_need_wrap=yes ;;
- nowwrap) ac_fpp_need_wrap=no ;;
- cstyle) ac_fpp_need_cstyle=yes ;;
- nocstyle) ac_fpp_need_cstyle=no ;;
- CSTYLE) ac_fpp_need_CSTYLE=yes ;;
- noCSTYLE) ac_fpp_need_CSTYLE=no ;;
- cxxstyle) ac_fpp_need_cxxstyle=yes ;;
- nocxxstyle) ac_fpp_need_cxxstyle=no ;;
- CXXSTYLE) ac_fpp_need_CXXSTYLE=yes ;;
- noCXXSTYLE) ac_fpp_need_CXXSTYLE=no ;;
- nil) ;;
- esac
-done
-# Wrapping requires substitution
-test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes
-# Both CSTYLE and cstyle cannot be requested
-# CSTYLE has precedence, since if it is not fulfilled,
-# compile errors may arise
-test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no
-dnl Similarly for cxxstyle
-test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no
-])# _AC_PROG_FPP_FEATURES
-
-
-# _AC_TEST_FPP_FIXED ([command])
-# ------------------------
-# A helper macro to test correct fpp behaviour
-# It sets ac_cv_prog_fpp and ac_fpp_out
-AC_DEFUN([_AC_TEST_FPP_FIXED],
-[rm -f conftest*
-cat >conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-ac_fpp_command=$1
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f
- ac_fpp_fixed_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_fixed_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_fixed=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- fi
-fi
-rm -f conftest*
-])# _AC_TEST_FPP_FIXED
-
-# _AC_TEST_FPP_FREE ([command])
-# ------------------------
-# A helper macro to test correct fpp behaviour
-# It sets ac_cv_prog_fpp and ac_fpp_out
-AC_DEFUN([_AC_TEST_FPP_FREE],
-[rm -f conftest*
-ac_ext_tmp=$ac_ext
-ac_ext=F90
-cat >conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-ac_fpp_command=$1
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f90 >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f90
- ac_fpp_free_out=
- ac_fpp_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_free_out=' > conftest.f90'
-# Note that the CPP tests only use fixed format
-# so we need to use a .f extension to make the tests
-# work.
- ac_fpp_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_free=$ac_fpp_command
- ac_cv_prog_fpp=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- ac_cv_prog_fpp=
- fi
-fi
-rm -f conftest*
-ac_ext=$ac_ext_tmp
-])# _AC_TEST_FPP_FREE
-
-
-# _AC_PROG_FPP
-# ------------
-# Try to figure out how to preprocess .F files for use with the selected
-# Fortran compiler
-#
-# Must be run after _AC_PROG_FC_CPP
-AC_DEFUN([_AC_PROG_FPP],
-[AC_REQUIRE([_AC_PROG_FC_CPP])dnl
-AC_CACHE_CHECK([how to preprocess Fortran files], ac_cv_prog_fpp,
-[ac_cv_prog_fpp=
-AC_LANG_ASSERT(Preprocessed Fortran)
-
-# Let the user specify FPP
-if test -n "$FPP"; then
- _AC_TEST_FPP_FREE([$FPP])
- if test -z "$ac_cv_prog_fpp"; then
- AC_MSG_WARN([user-specified \$FPP ($FPP) does not work])
- FPP=
- fi
-fi # test -n "$FPP"
-
-# This next should never happen. We don't call this macro
-# if we can already preprocess. If we do find ourselves here, then
-# something has gone badly wrong -- fail before we do some damage.
-if test -z "$ac_cv_prog_fpp" && test $ac_fpp_ok = yes; then
- # Ooops...
- AC_MSG_ERROR([Assertion failure: in _A@&t@C_PROG_FPP when we shouldn't be!])
-fi
-
-# FIXME: should we bother testing for FC+flag preprocessing?
-
-if test -z "$ac_cv_prog_fpp"; then
-# Either the Fortran compiler can't handle cpp, or doesn't have all the
-# features, or can't be used for pure preprocessing.
-# We must find another way for preprocessing.
-# We try the "best" preprocessors first. We know that $FC can't preprocess
-# by itself, but there is a small chance that F77 can be persuaded to
-# preprocess, so we try that.
-# FIXME: The comment above does not agree with the code below - $FC etc.
-# is being checked late, not early?
- for ac_j in 'fpp' "$CPP -x f95-cpp-input" "$CPP -x f77-cpp-input" \
- "$CPP -C -x c" "$CPP -x c" "$CPP" 'cpp' '/lib/cpp' '/usr/ccs/lib/cpp' \
- 'g77 -E' '$CC -E -x f95-cpp-input' '$CC -E -x f77-cpp-input' \
- '$CC -E -x c -C' '$CC -E -x c' '$CC -E' \
- "$FC -F" "$FC -E" "$F77 -F" "$F77 -E" ; do
- _AC_TEST_FPP_FREE([$ac_j])
- test -n "$ac_cv_prog_fpp" && break;
- done
-fi # test -z "$ac_cv_prog_fpp"
-
-if test -z "$ac_cv_prog_fpp"; then
- # This is only fatal if direct compilation doesn't work either
- # but we're only here if direct compilation didn't work.
- AC_MSG_ERROR([cannot find a working Fortran preprocessor])
-fi
-])
-AC_CACHE_CHECK([how to redirect $ac_cv_prog_fpp output],
- ac_cv_fpp_out,
- [ac_cv_fpp_out=$ac_fpp_out])
-FPP=$ac_cv_prog_fpp
-ac_fpp_out=$ac_cv_fpp_out
-])# _AC_PROG_FPP
-
-
-# _AC_PROG_FPP_P
-# --------------
-# Check whether we need to give FPP the -P option, to get it to
-# produce code which FC can read.
-AC_DEFUN([_AC_PROG_FPP_P],
-[AC_CACHE_CHECK([whether $FPP needs the -P option],
-ac_cv_prog_fpp_p,
-[ac_cv_prog_fpp_p=unknown
-AC_LANG_ASSERT(Preprocessed Fortran)
-# This will only be called from AC_PROG_FPP, and as such, the
-# extension *will* be .F90.
-ac_ext=F90
-cat > conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-
-AC_LANG_PUSH(Fortran)
-ac_ext=F90 # previous line will have reset this
-# We must not fail, here, in the case where the filesystem is
-# case-insensitive, so that conftest.F and conftest.f are the same
-# file.
-if test -n "$ac_fpp_out"; then
- # If $ac_fpp_out is non-null, then preprocessor output goes to
- # stdout, which we send to conftest.f _without_ immediately clobbering
- # the input file as it is being read. We do clobber it in the
- # end, however, which is why we copy .FPP_SRC_EXT to .$FPP_SRC_EXT
- # each time.
- ac_tmp='>conftest.tmp && mv conftest.tmp conftest.f90'
-else
- # conftest.F is preprocessed directly to conftest.f. We can
- # assume that the filesystem is case-sensitive, since otherwise
- # this compiler/preprocessor would be simply non-functional on
- # this platform.
- ac_tmp=
-fi
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_tmp"
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.f90 $LIBS'
-
-if AC_TRY_EVAL(ac_cmd) &&
- AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -P"
- if AC_TRY_EVAL(ac_cmd) &&
- AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=-P
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-AC_LANG_POP(Fortran)dnl
-])
-if test "x$ac_cv_prog_fpp_p" = "xunknown"; then
- AC_MSG_ERROR([$FPP cannot produce code that $FC compiles])
-else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_p"
-fi
-])# _AC_PROG_FPP_P
-
-# _AC_PROG_FPP_CSTYLE
-# -------------------
-# Check whether FPP lets C-style comments through to FC
-AC_DEFUN([_AC_PROG_FPP_CSTYLE],
-[AC_CACHE_CHECK([how to pass C-style comments to $FC],
- ac_cv_prog_fpp_cstyle,
-[ac_cv_prog_fpp_cstyle=unknown
-AC_LANG_ASSERT(Preprocessed Fortran)
-cat > conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_CSTYLE
-_ACEOF
-
-AC_LANG_PUSH(Fortran)
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
-if AC_TRY_EVAL(ac_cmd) &&
- cat conftest.f | grep '[[*]]/.*[[*]]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- ac_name=`expr "x$FPP" : 'x\(fpp\)'`
- if test "x$ac_name" = xfpp; then
- ac_flag="-c_com=no"
- else
- ac_flag="-C"
- fi
- FPPFLAGS="$FPPFLAGS $ac_flag"
- ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
- if AC_TRY_EVAL(ac_cmd) &&
- cat conftest.f | grep '/[[*]].*[[*]]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=$ac_flag
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-AC_LANG_POP(Fortran)dnl
-])
-if test "x$ac_cv_prog_fpp_cstyle" = "xunknown"; then
- AC_MSG_WARN([cannot find a way to make $FPP pass C-style comments])
-else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_cstyle"
-fi
-])# _AC_PROG_FPP_CSTYLE
-
-
-# _AC_PROG_FC_CPP
-# ---------------
-# This macro checks whether the chosen preprocessing method
-# has all the requested features.
-#
-# This macro must be called with $ac_fc_testing_fpp set to either
-# direct or indirect; it behaves differently accordingly.
-#
-#FIXME: this is only for fixed form code. Need a separate check for free-form.
-#
-# NB We are definitely using a suffix of .F in this case. If the filesystem
-# is case-insensitive, we may need to force preprocessing.
-#
-# Sets ac_fpp_ok to "no" if a requested feature is unavailable
-#
-AC_DEFUN([_AC_PROG_FC_CPP],
-[ac_fpp_ok=yes
-ac_prog_fc_cpp=no
-ac_prog_fc_cpp_d=no
-ac_prog_fc_cpp_i=no
-ac_prog_fc_cpp_subs=no
-ac_prog_fc_cpp_wrap=no
-ac_prog_fc_cpp_CSTYLE=no
-ac_prog_fc_cpp_cxxstyle=no
-
-AC_LANG_ASSERT(Preprocessed Fortran)
-AC_MSG_CHECKING([for fixed form Fortran preprocessor features])
-
-if test $ac_fc_testing_fpp = direct; then
-# On nearly all systems where direct compilation is possible, a .F file will
-# compile a preprocessable fixed-form file automatically. However,
-# case-insensitive filesystems (eg HFS+ on MacOSX) may get confused.
-# Therefore, we must check for cpp flags.
- _AC_FPP_FIXEDFORM_F
- if test "x$ac_cv_fpp_fixedform_F" != x; then
- ac_prog_fc_cpp=yes
- else
- ac_fpp_ok=no
- fi
-
-# It is possible we've failed the previous test because of a
-# Tru64 bug where the compiler fails when called as 'f95' on
-# a .F file. It works when called as f90.
-#FIXME: this does not protect the user's setting of FC, though
-# we set it back if senesible.
- if test $ac_prog_fc_cpp = no && test $FC = f95; then
- FC=f90
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_SIMPLE],
- [ac_prog_fc_cpp=yes],
- [])
- if test $ac_prog_fc_cpp = no; then
- FC=f95
- ac_fpp_ok=no
- fi
- fi
-
- ac_first_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_fixed_F"
-fi
-
-# We need to skip the following tests if we're trying direct compilation
-# and FC won't preprocess.
-if test $ac_prog_fc_cpp = yes || test $ac_fc_testing_fpp = indirect; then
-
- if test $ac_fpp_need_d = yes; then
-# Nearly everyone uses -D. XLF uses -WF,-D. Ifort on Windows uses /D
- ac_prog_fc_cpp_d=no
- ac_save_FPPFLAGS=$FPPFLAGS
- for fpp_flag_try in "-D" "-WF,-D" "/D"; do
- FPPFLAGS="$FPPFLAGS $fpp_flag_try""OK"
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_D],
- [ac_prog_fc_cpp_d=yes; FPPFLAGS_DEF="$fpp_flag_try"],
- [:])
- FPPFLAGS=$ac_save_FPPFLAGS
- done
- if test $ac_prog_fc_cpp_d = no; then
- ac_fpp_ok=no
- fi
- fi
-#FIXME we should probably do the AC_SUBST somewhere else.
- AC_SUBST(FPPFLAGS_DEF)
-
- if test $ac_fpp_need_i = yes; then
- rm -rf conftst
- mkdir conftst
- cat > conftst/conftest.inc << \_ACEOF
-! This statement overrides the IMPLICIT statement in the program
- REAL cc
-_ACEOF
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -Iconftst"
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_I],
- [ac_prog_fc_cpp_i=yes],
- [ac_fpp_ok=no])
- rm -rf conftst
- FPPFLAGS=$ac_save_FPPFLAGS
- fi
-
- if test $ac_fpp_need_subs = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_SUBS],
- [ac_prog_fc_cpp_subs=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_WRAP],
- [ac_prog_fc_cpp_wrap=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_CSTYLE = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_CSTYLE],
- [ac_prog_fc_cpp_CSTYLE=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_cxxstyle = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_CXXSTYLE],
- [ac_prog_fc_cpp_cxxstyle=yes],
- [ac_fpp_ok=no])
- fi
-
-fi
-if test $ac_fc_testing_fpp = direct; then
- FPPFLAGS=$ac_first_save_FPPFLAGS
-fi
-
-rm -f conftest.*
-
-AC_MSG_RESULT([done.])
-])#_AC_PROG_FC_CPP
-
-
-# _AC_FPP_BUILD_RULE
-# ------------------
-# Figure out how to build from cpp/Fortran sources
-#
-# If we need to use a separate preprocessor, we must override make's
-# `direct' .F.o rule in order to do `indirect' compilation
-# (.F -> .f then .f -> .o).
-#
-# Configure variables set here are as follows. The items in this list
-# are suffixed with `[direct]', `[indirect]' or `[both]'. In the
-# first two cases, the variable has a useful value only in the given
-# mode, and an unspecified, and therefore unreliable, value in the
-# other; in the last, it has a value in both modes.
-#
-# FPP [indirect]
-# The name of a suitable preprocessor.
-#
-# FPP_COMPILE_EXT [both]
-# This contains the file extension which the Fortran compiler will
-# accept as containing source not to be preprocessed. It is most
-# typically 'f' (the default), but could be different if set by a
-# call to AC_FPP_(FIXED|FREE)FORM.
-#
-# FPP_PREPROCESS_EXT [both]
-# The partner of FPP_COMPILE_EXT, containing the file extension
-# which is taken to indicate Fortran source to be preprocessed.
-# The default is 'F', but could be different if set by a
-# call to AC_FPP_(FIXED|FREE)FORM.
-#
-# FPP_MAKE_FLAGS [direct]
-# This is used to include CPP/FPP related flags into the compiler
-# call if we compile directly, and leave them out otherwise.
-#
-# FPP_OUTPUT [both]
-# This is used to redirect FPP output to the .f file in those
-# cases where FPP writes to stdout rather than to a file. It is
-# defined as either "" or ">$@".
-#
-# FPPDIRECT_TRUE, FPPDIRECT_FALSE [both]
-# If the macro decides that we must use `direct' mode, then it
-# sets FPPDIRECT_TRUE to be blank, and FPPDIRECT_FALSE to be '#',
-# or vice versa if we are to use `indirect' mode. These may be
-# used within a Makefile.in as follows:
-# @FPPDIRECT_TRUE@.@FPP_PREPROCESS_EXT@.o:
-# @FPPDIRECT_TRUE@ $(PPFCCOMPILE) -c -o $@ $<
-# @FPPDIRECT_FALSE@.@FPP_PREPROCESS_EXT@.@FPP_COMPILE_EXT:
-# @FPPDIRECT_FALSE@ $(FPP) $(DEFS) ... $< @FPP_OUTPUT@
-# If you use automake, then you may possibly recognise that as an
-# automake conditional (which is predeclared, so you do not need
-# to include AM_CONDITIONAL(FPPDIRECT, ???) in your configure.ac),
-# which might be used more straightforwardly in your Makefile.am
-# as follows:
-# if FPPDIRECT
-# .@FPP_PREPROCESS_EXT@.o:
-# $(PPFCCOMPILE) -c -o $@ $<
-# else !FPPDIRECT
-# .@FPP_PREPROCESS_EXT@.@FPP_COMPILE_EXT:
-# $(FPP) $(DEFS) ... $< @FPP_OUTPUT@
-# endif !FPPDIRECT
-#
-# These are used in Automake's lang_ppfc_finish subroutine.
-#
-# NOTE 1: There would seem to be a problem here with the use of .F as
-# the extension for preprocessed files. On case-insensitive
-# filesystems such as HFS+, as used on MacOS X, foo.F and foo.f are
-# the same file. This means that indirect compilation would lose badly, since
-# converting foo.F to foo.f would clobber the original. This is
-# probably not a problem in practice, since the compilers (g77, gfortran,
-# nag, and xlf) actually likely to be used on OS X -- which is a
-# recent platform, and thus with only recent Fortrans on it -- can all
-# do direct compilation of preprocessable Fortran. Just in case, we
-# check below whether we are in this fatal situation, and collapse
-# noisily if necessary.
-#
-# NOTE 2: Martin Wilck's original version of these macros noted that it
-# was necessary to generate explicit rules for .F -> .o compilations
-# in order to override make's builtin rules in a portable manner
-# (i.e. without using make extensions). Not all makes do chains of
-# implicit rules, so we cannot depend on .F.f, .f.o rules generating
-# a .f file. We need unified .F.o and .F.lo rules, but that's
-# complicated, an alternative is to name the intermediary .f files in
-# the Makefiles. Again, this may not be much of a problem in fact,
-# since the main culprit seems to be Solaris make, but Solaris f77
-# can do direct compilation, so that the issue of chaining rules
-# doesn't arise.
-#
-# NOTE 3: POSIX/Single-Unix states that inference rules can be
-# redefined, and there's no warning against this in Autoconf's section
-# on `Limitations of Make'.
-#
-# NOTE 4: FPP_OUTPUT is set to either "" or ">$@". The latter is OK
-# in an implicit rule, but will potentially lose in an explicit rule,
-# since POSIX does not require that $@ is defined in such a rule, and
-# there are still a few makes which do not define it in that context.
-# As with Note 1, however, this is probably more a theoretical problem
-# than a practical one.
-#
-AC_DEFUN([_AC_FPP_BUILD_RULE],
-[# FPP is defined by this stage. If the processing mode is 'direct', then
-# this will almost certainly be defined as blank, but we should make no
-# committments to this in the documentation, in case we want to change
-# our minds about that in future.
-AC_SUBST(FPP)
-
-# Default the FPP_PREPROCESS_EXT and FPP_COMPILE_EXT to the most usual ones
-FPP_PREPROCESS_EXT=F
-FPP_COMPILE_EXT=f
-
-# Switch on the processing mode, direct/indirect, which has been determined
-# in AC_PROG_FPP before this macro is called. The FPPDIRECT_(TRUE|FALSE)
-# variables implement an automake (configure-time) conditional, which is
-# created, not through an invocation of AM_CONDITIONAL, but implicitly
-# within automake.in (qv).
-if test $ac_cv_fpp_build_rule = direct; then
- # The simple case: the chosen Fortran compiler can handle preprocessing,
- # so we don't need a separate preprocessing stage.
- FPPDIRECT_TRUE=
- FPPDIRECT_FALSE='#'
- # The flags here are those included in the 'compile' field of the
- # 'ppfc' language in automake.in, minus the {AM_,}FCFLAGS variables.
- # It's not _absolutely_ guaranteed that these are the correct ones,
- # and I (NG) would be open to argument about adding both {AM_,}CPPFLAGS and
- # {AM_,}FCFLAGS, but this set appears to work.
- FPP_MAKE_FLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)'
-else
- FPPDIRECT_TRUE='#'
- FPPDIRECT_FALSE=
- FPP_MAKE_FLAGS=
-fi
-
-if test -z "$ac_fpp_out"; then
- FPP_OUTPUT=" "
-else
- FPP_OUTPUT=">\[$]@"
-fi
-
-AC_SUBST(FPPDIRECT_TRUE)
-AC_SUBST(FPPDIRECT_FALSE)
-AC_SUBST(FPP_MAKE_FLAGS)
-AC_SUBST(FPP_PREPROCESS_EXT)
-AC_SUBST(FPP_COMPILE_EXT)
-AC_SUBST(FPP_OUTPUT)
-])# _AC_FPP_BUILD_RULE
-
-
-# _AC_FC_CHECK_CIFS
-# -----------------
-# Check whether the filesystem is case-insensitive (eg, HFS+ on
-# MacOS X). Set ac_cv_fc_cifs=yes if so.
-AC_DEFUN([_AC_FC_CHECK_CIFS],
- [AC_CACHE_CHECK([whether the filesystem is case-insensitive],
- ac_cv_fc_cifs,
- [rm -f conftest.*
- echo wibble >conftest.F
- if test -f conftest.f && test "`cat conftest.f`" = wibble; then
- ac_cv_fc_cifs=yes
- else
- ac_cv_fc_cifs=no
- fi
-])])# _AC_FC_CHECK_CIFS
-
-
-
-# -----------------------
-# User macros
-# -----------------------
-
-# AC_PROG_FPP([required features])
-# --------------------------------------------------
-#
-# [required features] is a space-separated list of features that the Fortran
-# preprocessor must have for the code to compile.
-# It is up to the package maintainer to properly set these requirements.
-#
-# This macro will find out how to compile a preprocessable fixed-form
-# file, with a .F file extension. To the best of my knowledge, such a
-# file is compilable everywhere (albeit flags may be needed on
-# case-insensitive filesystems)
-#
-# This macro should be followed by calling AC_FPP_FIXEDFORM([.srcext])
-# and AC_FPP_FREEFORM([.srcext]) as appropriate for whichever source
-# extensions are used in the user's project.
-#
-# This will fail to give the correct result when fixed-format files may be
-# preprocessed directly by the compiler, but free-format ones
-# may not.
-#
-# Supported features are:
-#
-# include : correctly process #include directives and -I
-# define : correctly process -D
-# substitute: substitute macros in Fortran code
-# (some preprocessors touch only lines starting with #)
-# wrap : wrap lines that become too long through macro substitution
-# fpp is probably the only preprocessor that does this.
-# cstyle : Do not suppress C style comments (-C option in cpp)
-# CSTYLE : *Do* suppress C style comments
-# (e.g. code contains C-style comments, and compiler may not
-# know how to handle them)
-# cxxstyle : Do not suppress C++ style comments (default)
-# CXXSTYLE : *Do* suppress C++ style comments (seems unlikely, but in here
-# for completeness
-#
-# Features can be abbreviated: i, in, inc etc. are equivalent to include.
-# Features can be deselected (feature not needed) by prepending "no",
-# e.g. nodef (=nodefine), now (=nowrap).
-#
-# Default for the feature list is
-# [include define substitute nowrap nocstyle noCSTYLE cxxstyle]
-# Feature requirements corresponding to the defaults may be omitted
-#
-# Note that "wrap" implies "substitute", and CSTYLE and cstyle cannot
-# be requested at the same time. The macro adjusts this automatically.
-#
-# This macro sets and substitutes the variables FPP and FPPFLAGS, and
-# causes to be set FPP_OUTPUT, FPP_MAKE_FLAGS, and FPP_COMPILE_EXT
-# (actually set in macro _AC_FPP_BUILD_RULE)
-#
-# The macro depends on both FC and CPP, because we must possibly fall
-# back on CPP for preprocessing.
-#
-# We presume that there is no preprocessing dependence on the language
-# variant, so that a preprocessor will handle free-form F9x as happily as
-# fixed-form F77.
-#
-AC_DEFUN([AC_PROG_FPP],
-[AC_REQUIRE([AC_PROG_FC])dnl
-dnl We are not going to use AC_REQUIRE(AC_PROG_CPP) here for
-dnl two reasons:
-dnl 1) we don't really need to if FC will preprocess itself
-dnl 2) we can't pass in an optional parameter to change the
-dnl default CPP search order, which we need to.
-dnl AC_REQUIRE([AC_PROG_CPP([cpp])])dnl
-
-# Prefer AC_PROG_FC to AC_PROG_F77
-if test "X$F77" != X; then
- AC_MSG_WARN([Use A@&t@C_PROG_FC with A@&t@C_PROG_FPP, instead of A@&t@C_PROG_F77])
-fi
-
-AC_ARG_VAR([FPP], [Command to preprocess Fortran code])
-AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor])
-# Set up ac_fpp_need_* flags based on features in $1
-_AC_PROG_FPP_FEATURES([$1])
-
-# We first try to use FC for compiling the source directly
-# into object files
-ac_fpp_compile='${FC-fc} -c $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_fpp_link='${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-
-AC_LANG_PUSH(Preprocessed Fortran)
-FPP_SRC_EXT=F
-
-# _AC_PROG_FC_CPP does the actual feature tests, storing results of the
-# checks in non-cv variables like ac_prog_fc_cpp_*, which we copy to cv
-# variables afterwards. This allows this macro to be reusable for other
-# cv variables (see below)
-ac_fc_testing_fpp=direct
-_AC_PROG_FC_CPP
-
-AC_CACHE_CHECK([whether $FC compiles programs with cpp directives],
- ac_cv_prog_fc_cpp,
- [ac_cv_prog_fc_cpp=$ac_prog_fc_cpp])
-
-if test $ac_prog_fc_cpp = yes; then
-
- if test $ac_fpp_need_d = yes; then
- AC_CACHE_CHECK([whether $FC accepts -D],
- ac_cv_prog_fc_cpp_d,
- [ac_cv_prog_fc_cpp_d=$ac_prog_fc_cpp_d])
- fi
-
- if test $ac_fpp_need_i = yes; then
- AC_CACHE_CHECK([whether $FC accepts -I],
- ac_cv_prog_fc_cpp_i,
- [ac_cv_prog_fc_cpp_i=$ac_prog_fc_cpp_i])
- fi
-
- if test $ac_fpp_need_subs = yes; then
- AC_CACHE_CHECK([whether $FC substitutes macros in Fortran code],
- ac_cv_prog_fc_cpp_subs,
- [ac_cv_prog_fc_cpp_subs=$ac_prog_fc_cpp_subs])
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- AC_CACHE_CHECK([whether $FC wraps long lines automatically],
- ac_cv_prog_fc_cpp_wrap,
- [ac_cv_prog_fc_cpp_wrap=$ac_prog_fc_cpp_wrap])
- fi
-
-# Don't need to test if $FC removes C++ comments - that
-# way madness lies.
-
-fi # test $ac_prog_fc_cpp = yes
-
-AC_CACHE_CHECK([whether $FC fulfils requested features],
- ac_cv_prog_fc_cpp_ok,
- [ac_cv_prog_fc_cpp_ok=$ac_fpp_ok])
-
-# Keep the user informed
-AC_MSG_CHECKING([preprocessing mode we may therefore use])
-
-# If so, we don't need to go any further.
-if test $ac_fpp_ok = yes; then
- ac_cv_fpp_build_rule=direct
- AC_MSG_RESULT([direct])
-else
-# indirect compilation
- AC_MSG_RESULT([indirect])
-
-# Now we check how to invoke a preprocessor that outputs Fortran code
-# that FC can understand
-#FIXME: in a joint C/Fortran project, CPP might have already
-# been defined. Here we are potentially (probably) redefining it.
-# I don't think this matters. Not sure, though.
-# In that case, AC_SUBST has already been called on CPP.
-# We don't want to fail if we can't find cpp - we might be able
-# to fall back on fpp.
-#FIXME: actually, we should just prefer cpp to $CPP
- AC_PROG_CPP([cpp],[],[])
-# The next macro sets FPP (unless already set by the user)
-_AC_PROG_FPP
-_AC_PROG_FPP_P
-
-# Before we go any further, check that we're not courting disaster,
-# here, by using indirect compilation (.F -> .f -> .o) on a
-# case-insensitive filesystem. If we are, there's nothing we can do
-# other than fail noisily.
-_AC_FC_CHECK_CIFS
-# Redefine the compile and link commands for indirect compilation
-if test $ac_cv_fc_cifs = yes; then
- if test "x$ac_fpp_out" = x ; then
- AC_MSG_ERROR([Confused in preprocessing on case-insensitive FS - please report to tow@uszla.me.uk])
- fi
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext > conftest.cpp.f && ${FC-fc} -c $FCFLAGS -o conftest.o conftest.cpp.f >&AS_MESSAGE_LOG_FD; rm conftest.cpp.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT > conftest.cpp.f && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.cpp.f $LIBS >&AS_MESSAGE_LOG_FD; rm conftest.cpp.f'
-else
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext '"$ac_fpp_out"' && ${FC-fc} -c $FCFLAGS conftest.f >&AS_MESSAGE_LOG_FD; rm conftest.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT '"$ac_fpp_out"' && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.f $LIBS >&AS_MESSAGE_LOG_FD; rm conftest.f'
-fi
-
- ac_compile=$ac_fpp_compile
- ac_link=$ac_fpp_link
-# Redo all the feature checks for indirect compilation.
- ac_fc_testing_fpp=indirect
- _AC_PROG_FC_CPP
-
-if test $ac_fpp_need_d = yes; then
- AC_CACHE_CHECK([whether $FPP accepts -D],
- ac_cv_prog_fpp_d,
- [ac_cv_prog_fpp_d=$ac_prog_fc_cpp_d])
-fi
-
-if test $ac_fpp_need_i = yes; then
- AC_CACHE_CHECK([whether $FPP accepts -I],
- ac_cv_prog_fpp_i,
- [ac_cv_prog_fpp_i=$ac_prog_fc_cpp_i])
-fi
-
-if test $ac_fpp_need_subs = yes; then
- AC_CACHE_CHECK([whether $FPP substitutes macros in Fortran code],
- ac_cv_prog_fpp_subs,
- [ac_cv_prog_fpp_subs=$ac_prog_fc_cpp_subs])
-fi
-
-if test $ac_fpp_need_wrap = yes; then
- AC_CACHE_CHECK([whether $FPP wraps long lines automatically],
- ac_cv_prog_fpp_wrap,
- [ac_cv_prog_fpp_wrap=$ac_prog_fc_cpp_wrap])
-fi
-
-if test $ac_fpp_need_CSTYLE = yes; then
- AC_CACHE_CHECK([whether $FPP suppresses C-style comments],
- ac_cv_prog_fpp_CSTYLE,
- [ac_cv_prog_fpp_CSTYLE=$ac_prog_fc_cpp_CSTYLE])
-
-elif test $ac_fpp_need_cstyle = yes; then
-# It only makes sense to test this for indirect compilation,
-# i.e., if .f files are generated
- _AC_PROG_FPP_CSTYLE
-fi
-
-if test $ac_fpp_need_cxxstyle = yes; then
- AC_CACHE_CHECK([whether $FPP preserves C++-style comments],
- ac_cv_prog_fpp_cxxstyle,
- [ac_cv_prog_fpp_cxxstyle=$ac_prog_fc_cpp_cxxstyle])
-fi
-
-AC_CACHE_CHECK([whether $FPP fulfils requested features],
- ac_cv_prog_fpp_ok,
- [ac_cv_prog_fpp_ok=$ac_fpp_ok])
-
- ac_cv_fpp_build_rule=indirect
-
-if test ac_fpp_ok = no; then
- AC_MSG_ERROR([Cannot find a Fortran preprocessor with the requested features])
-fi
-
-fi # test ac_fpp_ok != yes
-
-# We have all necessary information.
-# It remains to construct optimal build rules
-# (direct: .F.o or indirect: .F.f)
-# and carry out the substitutions.
-#
-# This is the crucial bit: we switch on ac_cv_fpp_build_rule=direct/indirect,
-# setting and AC_SUBSTing the variables documented in _AC_FPP_BUILD_RULE.
-#
-# Do we actually have all the required information yet, or do we need
-# to look at AC_FC_(FIXED|FREE)FORM results also? I think we're OK:
-# if the compiler can do all the preprocessing itself, then we don't
-# have to do anything (ie, the `direct' branch should be trivial), and
-# if we have to do separate preprocessing, the processor is probably
-# (?) independent of the source language variant.
-_AC_FPP_BUILD_RULE
-
-AC_LANG_POP(Preprocessed Fortran)
-
-])# AC_PROG_FPP
-# _AC_COMPILER_EXEEXT_DEFAULT
-# ---------------------------
-# Check for the extension used for the default name for executables.
-#
-# We do this in order to find out what is the extension we must add for
-# creating executables (see _AC_COMPILER_EXEEXT's comments).
-#
-# Beware of `expr' that may return `0' or `'. Since this macro is
-# the first one in touch with the compiler, it should also check that
-# it compiles properly.
-#
-# On OpenVMS 7.1 system, the DEC C 5.5 compiler when called through a
-# GNV (gnv.sourceforge.net) cc wrapper, produces the output file named
-# `a_out.exe'.
-m4_define([_AC_COMPILER_EXEEXT_DEFAULT],
-[# First try to determine the flag needed to name the executable
-# It is nearly always "-o" but Lahey Fortran wants "-out"
-AC_MSG_CHECKING([for linker flag to name executables])
-for ac_link_obj_flag in "/exe:" "-out " "-o "; do
-AS_IF([_AC_DO_VAR(ac_link)],
-[ac_link_obj_flag_found=yes; break],
-[:])
-done
-if test x$ac_link_obj_flag_found = x ; then
-AC_MSG_FAILURE([Could not determine flag to name executables])
-fi
-AC_MSG_RESULT([$ac_link_obj_flag])
-
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-AC_MSG_CHECKING([for _AC_LANG compiler default output file name])
-ac_link_default=`echo "$ac_link" | sed ['s/ $ac_link_obj_flag *conftest[^ ]*//']`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- _AC_COMPILER_EXEEXT_REJECT ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-AS_IF([_AC_DO_VAR(ac_link_default)],
-[# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files
-do
- test -f "$ac_file" || continue
- case $ac_file in
- _AC_COMPILER_EXEEXT_REJECT )
- ;;
- [[ab]].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-],
- [_AC_MSG_LOG_CONFTEST
-AC_MSG_FAILURE([_AC_LANG compiler cannot create executables], 77)])
-ac_exeext=$ac_cv_exeext
-AC_MSG_RESULT([$ac_file])
-])# _AC_COMPILER_EXEEXT_DEFAULT
diff --git a/config/configure.ac b/config/configure.ac
index 29be2f10..cd26799c 100644
--- a/config/configure.ac
+++ b/config/configure.ac
@@ -12,31 +12,6 @@ dnl
AC_LANG(Fortran)
AC_PROG_FC
dnl
-AC_FC_FREEFORM([f90])
-AC_SUBST(FCFLAGS_free_f90)
-dnl
-AC_LANG_PUSH(Preprocessed Fortran)
-AC_PROG_FPP
-dnl
-AC_FPP_FREEFORM([F90])
-AC_SUBST(FPPFLAGS_free_F90)
-AC_LANG_POP(Preprocessed Fortran)
-dnl
-if test $ac_cv_fpp_build_rule = direct; then
- F90_RULE=['$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $< ']
-elif test $ac_cv_fpp_build_rule = indirect; then
- if test $ac_cv_fc_cifs = yes; then
- F90_RULE=['while [ 0 ]; do FPPFILE=$*.$$RANDOM.f90; if ! test -f $$FPPFILE; then break; fi; done; $(FPP) $(FPPFLAGS) $< > $$FPPFILE && $(FC) -c -o $*.$(OBJEXT) $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $$FPPFILE; rm $$FPPFILE']
- elif test x$FPP_OUTPUT = x; then
- F90_RULE=['$(FPP) $(FPPFLAGS) $< && $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $*.f90; rm $*.f90']
- else
- F90_RULE=['$(FPP) $(FPPFLAGS) $< > $*.f90 && $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $*.f90; rm $*.f90']
- fi
-fi
-dnl Generate dependency rules according to whether we need
-dnl separate preprocessing stage.
-AC_SUBST(F90_RULE)
-dnl
dnl check flag needed to name linked executables
LINK_O_FLAG=$ac_link_obj_flag
AC_SUBST(LINK_O_FLAG)
@@ -156,11 +131,6 @@ dnl
dnl Check for compiler problems
TW_CHECK_ASSOCIATED_BUG([], [DEFS="$DEFS RESTRICTED_ASSOCIATED_BUG"])
dnl
-dnl Fix up DEFS -> FPPFLAGS conversion.
-for i in $DEFS; do
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_DEF$i"
-done
-dnl
dnl Library functionality ...
dnl How to make a static library ...
dnl we should test for this, but I don't know how yet.
@@ -190,8 +160,8 @@ TW_PROG_CYGPATH_W
AC_SUBST(VPATH)
OBJSDIR=`pwd`/objs
AC_SUBST(OBJSDIR)
-AC_FC_MOD_PATH_FLAG
-AC_FC_MOD_SUFFIX
+AC_FC_MODULE_FLAG
+AC_FC_MODULE_EXTENSION
#
AC_SUBST(FPPFLAGS)
AC_SUBST(FFLAGS)
diff --git a/config/m4/fortran.m4 b/config/m4/fortran.m4
deleted file mode 100644
index 904d70f0..00000000
--- a/config/m4/fortran.m4
+++ /dev/null
@@ -1,3134 +0,0 @@
-# This file is part of Autoconf. -*- Autoconf -*-
-# Fortran languages support.
-# Copyright (C) 2001, 2003-2005
-# Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-# As a special exception, the Free Software Foundation gives unlimited
-# permission to copy, distribute and modify the configure scripts that
-# are the output of Autoconf. You need not follow the terms of the GNU
-# General Public License when using or distributing such scripts, even
-# though portions of the text of Autoconf appear in them. The GNU
-# General Public License (GPL) does govern all other use of the material
-# that constitutes the Autoconf program.
-#
-# Certain portions of the Autoconf source text are designed to be copied
-# (in certain cases, depending on the input) into the output of
-# Autoconf. We call these the "data" portions. The rest of the Autoconf
-# source text consists of comments plus executable code that decides which
-# of the data portions to output in any given case. We call these
-# comments and executable code the "non-data" portions. Autoconf never
-# copies any of the non-data portions into its output.
-#
-# This special exception to the GPL applies to versions of Autoconf
-# released by the Free Software Foundation. When you make and
-# distribute a modified version of Autoconf, you may extend this special
-# exception to the GPL to apply to your modified version as well, *unless*
-# your modified version has the potential to copy into its output some
-# of the text that was the non-data portion of the version that you started
-# with. (In other words, unless your change moves or copies text from
-# the non-data portions to the data portions.) If your modification has
-# such potential, you must delete any notice of this special exception
-# to the GPL from your modified version.
-#
-# Written by David MacKenzie, with help from
-# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-# Roland McGrath, Noah Friedman, david d zuhn, and many others.
-#
-# Fortran preprocessing support written by Martin Wilck, adapted and
-# extended by Norman Gray and Toby White.
-
-
-# Fortran vs. Fortran 77:
-# This file contains macros for both "Fortran 77" and "Fortran", where
-# the former is the "classic" autoconf Fortran interface and is intended
-# for legacy F77 codes, while the latter is intended to support newer Fortran
-# dialects. Fortran 77 uses environment variables F77, FFLAGS, and FLIBS,
-# while Fortran uses FC, FCFLAGS, and FCLIBS. For each user-callable AC_*
-# macro, there is generally both an F77 and an FC version, where both versions
-# share the same _AC_*_FC_* backend. This backend macro requires that
-# the appropriate language be AC_LANG_PUSH'ed, and uses _AC_LANG_ABBREV and
-# _AC_LANG_PREFIX in order to name cache and environment variables, etc.
-
-
-# _AC_LIST_MEMBER_IF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# ---------------------------------------------------------------------------
-#
-# Processing the elements of a list is tedious in shell programming,
-# as lists tend to be implemented as space delimited strings.
-#
-# This macro searches LIST for ELEMENT, and executes ACTION-IF-FOUND
-# if ELEMENT is a member of LIST, otherwise it executes
-# ACTION-IF-NOT-FOUND.
-AC_DEFUN([_AC_LIST_MEMBER_IF],
-[dnl Do some sanity checking of the arguments.
-m4_if([$1], , [AC_FATAL([$0: missing argument 1])])dnl
-m4_if([$2], , [AC_FATAL([$0: missing argument 2])])dnl
- ac_exists=false
- for ac_i in $2; do
- if test x"$1" = x"$ac_i"; then
- ac_exists=true
- break
- fi
- done
-
- AS_IF([test x"$ac_exists" = xtrue], [$3], [$4])[]dnl
-])# _AC_LIST_MEMBER_IF
-
-
-# _AC_LINKER_OPTION(LINKER-OPTIONS, SHELL-VARIABLE)
-# -------------------------------------------------
-#
-# Specifying options to the compiler (whether it be the C, C++ or
-# Fortran 77 compiler) that are meant for the linker is compiler
-# dependent. This macro lets you give options to the compiler that
-# are meant for the linker in a portable, compiler-independent way.
-#
-# This macro take two arguments, a list of linker options that the
-# compiler should pass to the linker (LINKER-OPTIONS) and the name of
-# a shell variable (SHELL-VARIABLE). The list of linker options are
-# appended to the shell variable in a compiler-dependent way.
-#
-# For example, if the selected language is C, then this:
-#
-# _AC_LINKER_OPTION([-R /usr/local/lib/foo], foo_LDFLAGS)
-#
-# will expand into this if the selected C compiler is gcc:
-#
-# foo_LDFLAGS="-Xlinker -R -Xlinker /usr/local/lib/foo"
-#
-# otherwise, it will expand into this:
-#
-# foo_LDFLAGS"-R /usr/local/lib/foo"
-#
-# You are encouraged to add support for compilers that this macro
-# doesn't currently support.
-# FIXME: Get rid of this macro.
-AC_DEFUN([_AC_LINKER_OPTION],
-[if test "$ac_compiler_gnu" = yes; then
- for ac_link_opt in $1; do
- $2="[$]$2 -Xlinker $ac_link_opt"
- done
-else
- $2="[$]$2 $1"
-fi[]dnl
-])# _AC_LINKER_OPTION
-
-
-
-## ----------------------- ##
-## 1. Language selection. ##
-## ----------------------- ##
-
-
-# -------------------------- #
-# 1d. The Fortran language. #
-# -------------------------- #
-
-
-# AC_LANG(Fortran 77)
-# -------------------
-m4_define([AC_LANG(Fortran 77)],
-[ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-])
-
-
-# AC_LANG(Fortran)
-# ----------------
-m4_define([AC_LANG(Fortran)],
-[ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-])
-
-# AC_LANG(Preprocessed Fortran)
-# --------------------------------
-# We need a separate `preprocessed' language, because not all Fortran
-# compilers have a preprocessor built in. Therefore we may need to
-# resort to an `indirect' compilation, .F->.f->.o, including the
-# generation of a suitable extra build rule. The language extension
-# is set in macro AC_PROG_FPP, to $FPP_SRC_EXT.
-m4_define([AC_LANG(Preprocessed Fortran)],
-[ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-])
-
-
-# AC_LANG_FORTRAN77
-# -----------------
-AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
-
-# _AC_FORTRAN_ASSERT
-# ------------------
-# Current language must be Fortran, Fortran 77, or preprocessed Fortran.
-# FIXME: is there any reason why this can't be AC_LANG_CASE?
-m4_defun([_AC_FORTRAN_ASSERT],
-[m4_if(_AC_LANG, [Fortran], [],
- [m4_if(_AC_LANG, [Fortran 77], [],
- [m4_if(_AC_LANG, [Preprocessed Fortran], []
- [m4_fatal([$0: current language is not Fortran: ] _AC_LANG)])])])])
-
-
-# _AC_LANG_ABBREV(Fortran 77)
-# ---------------------------
-m4_define([_AC_LANG_ABBREV(Fortran 77)], [f77])
-
-# _AC_LANG_ABBREV(Fortran)
-# ------------------------
-m4_define([_AC_LANG_ABBREV(Fortran)], [fc])
-
-# _AC_LANG_ABBREV(Preprocessed Fortran)
-# -------------------------------------
-m4_define([_AC_LANG_ABBREV(Preprocessed Fortran)], [fpp])
-
-
-# _AC_LANG_PREFIX(Fortran 77)
-# ---------------------------
-m4_define([_AC_LANG_PREFIX(Fortran 77)], [F])
-
-# _AC_LANG_PREFIX(Fortran)
-# ------------------------
-m4_define([_AC_LANG_PREFIX(Fortran)], [FC])
-
-# _AC_LANG_PREFIX(Preprocessed Fortran)
-# -------------------------------------
-m4_define([_AC_LANG_PREFIX(Preprocessed Fortran)], [FPP])
-
-
-# _AC_FC
-# ------
-# Return F77, FC or PPFC, depending upon the language.
-AC_DEFUN([_AC_FC],
-[_AC_FORTRAN_ASSERT()dnl
-AC_LANG_CASE([Fortran 77], [F77],
- [Fortran], [FC],
- [Preprocessed Fortran], [PPFC])])
-
-
-## ---------------------- ##
-## 2.Producing programs. ##
-## ---------------------- ##
-
-
-# --------------------- #
-# 2d. Fortran sources. #
-# --------------------- #
-
-# AC_LANG_SOURCE(Fortran 77)(BODY)
-# AC_LANG_SOURCE(Fortran)(BODY)
-# --------------------------------
-# FIXME: Apparently, according to former AC_TRY_COMPILER, the CPP
-# directives must not be included. But AC_TRY_RUN_NATIVE was not
-# avoiding them, so?
-m4_define([AC_LANG_SOURCE(Fortran 77)],
-[$1])
-m4_define([AC_LANG_SOURCE(Fortran)],
-[$1])
-m4_define([AC_LANG_SOURCE(Preprocessed Fortran)],
-[$1])
-
-
-# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
-# -----------------------------------------------
-# Yes, we discard the PROLOGUE.
-m4_define([AC_LANG_PROGRAM(Fortran 77)],
-[m4_ifval([$1],
- [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])dnl
- program main
-$2
- end])
-
-
-# AC_LANG_PROGRAM(Fortran)([PROLOGUE], [BODY])
-# -----------------------------------------------
-# FIXME: can the PROLOGUE be used?
-m4_define([AC_LANG_PROGRAM(Fortran)],
-[m4_ifval([$1],
- [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])dnl
- program main
-$2
- end])
-
-
-# AC_LANG_PROGRAM(Preprocessed Fortran)([PROLOGUE], [BODY])
-# ---------------------------------------------------------
-# FIXME: can the PROLOGUE be used?
-m4_define([AC_LANG_PROGRAM(Preprocessed Fortran)],
-[$1
- program main
-$2
- end])
-
-
-# AC_LANG_CALL(Fortran 77)(PROLOGUE, FUNCTION)
-# --------------------------------------------
-# FIXME: This is a guess, help!
-# FIXME: ...but it's a good guesss -- what's the problem?
-m4_define([AC_LANG_CALL(Fortran 77)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_CALL(Fortran)(PROLOGUE, FUNCTION)
-# --------------------------------------------
-# FIXME: This is a guess, help!
-m4_define([AC_LANG_CALL(Fortran)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_CALL(Preprocessed Fortran)(PROLOGUE, FUNCTION)
-# ------------------------------------------------------
-# FIXME: This is a guess, help!
-m4_define([AC_LANG_CALL(Preprocessed Fortran)],
-[AC_LANG_PROGRAM([$1],
-[ call $2])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Fortran)(FUNCTION)
-# ----------------------------------------
-# Produce a source which links correctly iff the Fortran FUNCTION exists.
-# Note that the generic AC_LANG_FUNC_LINK_TRY macro is deemed severely
-# broken, and is deprecated. The macro still currently exists, however,
-# and so if macros like AC_CHECK_FUNCS are to work with
-# AC_LANG(Fortran) (and friends), then these macros have to be
-# defined.
-#
-# FIXME: This is a severely broken implementation.
-# It does not distinguish between functions and subroutines, and it
-# ignores any arguments. We don't attempt to cope with argument $1
-# being somethine weird -- either already declared as a Fortran keyword
-# or something needing quoting -- if the user wants to ask dumb
-# questions, they'll get dumb answers.
-m4_define([AC_LANG_FUNC_LINK_TRY(Fortran)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Fortran 77)(FUNCTION)
-# -------------------------------------------
-# Ditto, for language `Fortran 77'
-m4_define([AC_LANG_FUNC_LINK_TRY(Fortran 77)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-# AC_LANG_FUNC_LINK_TRY(Preprocessed Fortran)(FUNCTION)
-# -----------------------------------------------------
-# Ditto, for language `Preprocessed Fortran'
-m4_define([AC_LANG_FUNC_LINK_TRY(Preprocessed Fortran)],
-[AC_LANG_SOURCE(
-[ Program Test
- External $1
- Call $1
- End
-])])
-
-
-
-## -------------------------------------------- ##
-## 3. Looking for Compilers and Preprocessors. ##
-## -------------------------------------------- ##
-
-
-# -------------------------- #
-# 3d. The Fortran compiler. #
-# -------------------------- #
-
-
-# AC_LANG_PREPROC(Fortran 77)
-# ---------------------------
-# Find the Fortran 77 preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Fortran 77)],
-[m4_warn([syntax],
- [$0: No preprocessor defined for ]_AC_LANG)])
-
-# AC_LANG_PREPROC(Fortran)
-# ---------------------------
-# Find the Fortran preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Fortran)],
-[m4_warn([syntax],
- [$0: No preprocessor defined for ]_AC_LANG)])
-
-# AC_LANG_PREPROC(Preprocessed Fortran)
-# -------------------------------------
-# Find the Fortran preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_PREPROC(Preprocessed Fortran)],
-[AC_REQUIRE([AC_PROG_FPP])])
-
-
-# AC_LANG_COMPILER(Fortran 77)
-# ----------------------------
-# Find the Fortran 77 compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Fortran 77)],
-[AC_REQUIRE([AC_PROG_F77])])
-
-# AC_LANG_COMPILER(Fortran)
-# -------------------------
-# Find the Fortran compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Fortran)],
-[AC_REQUIRE([AC_PROG_FC])])
-
-# AC_LANG_COMPILER(Preprocessed Fortran)
-# --------------------------------------
-# Find the Fortran compiler. Must be AC_DEFUN'd to be
-# AC_REQUIRE'able.
-AC_DEFUN([AC_LANG_COMPILER(Preprocessed Fortran)],
-[AC_REQUIRE([AC_PROG_FC])])
-
-
-# ac_cv_prog_g77
-# --------------
-# We used to name the cache variable this way.
-AU_DEFUN([ac_cv_prog_g77],
-[ac_cv_f77_compiler_gnu])
-
-
-# _AC_FC_DIALECT_YEAR([DIALECT])
-# ------------------------------
-# Given a Fortran DIALECT, which is Fortran [YY]YY or simply [YY]YY,
-# convert to a 4-digit year. The dialect must be one of Fortran 77,
-# 90, 95, or 2000, currently. If DIALECT is simply Fortran or the
-# empty string, returns the empty string.
-AC_DEFUN([_AC_FC_DIALECT_YEAR],
-[m4_case(m4_bpatsubsts(m4_tolower([$1]), [fortran],[], [ *],[]),
- [77],[1977], [1977],[1977],
- [90],[1990], [1990],[1990],
- [95],[1995], [1995],[1995],
- [2000],[2000],
- [],[],
- [m4_fatal([unknown Fortran dialect])])])
-
-
-# _AC_PROG_FC([DIALECT], [COMPILERS...])
-# --------------------------------------
-# DIALECT is a Fortran dialect, given by Fortran [YY]YY or simply [YY]YY,
-# and must be one of those supported by _AC_FC_DIALECT_YEAR
-#
-# If DIALECT is supplied, then we search for compilers of that dialect
-# first, and then later dialects. Otherwise, we search for compilers
-# of the newest dialect first, and then earlier dialects in increasing age.
-# This search order is necessarily imperfect because the dialect cannot
-# always be inferred from the compiler name.
-#
-# Known compilers:
-# f77/f90/f95: generic compiler names
-# g77: GNU Fortran 77 compiler
-# gfortran: putative GNU Fortran 95+ compiler (in progress)
-# fort77: native F77 compiler under HP-UX (and some older Crays)
-# frt: Fujitsu F77 compiler
-# pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers
-# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
-# lf95: Lahey-Fujitsu F95 compiler
-# fl32: Microsoft Fortran 77 "PowerStation" compiler
-# af77: Apogee F77 compiler for Intergraph hardware running CLIX
-# epcf90: "Edinburgh Portable Compiler" F90
-# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
-# ifc: Intel Fortran 95 compiler for Linux/x86
-# efc: Intel Fortran 95 compiler for IA64
-#
-# Must check for lf95 before f95 - some Lahey versions ship an f95 binary
-# in the default path that must be avoided.
-#
-# Let's emphasise this: the test here is only whether a program with
-# the given name exists -- there's no test at this point of whether
-# the found program is actually a Fortran compiler, and if the first
-# program named f77 (say) in your path is a script which deletes all
-# your files, that's nothing to do with us....
-#
-# A proper fix would involve being able to go back and try another compiler
-# if the first one fails, but that requires a major reworking of much of
-# autoconf. The same problem arises (with no easy solution) on some Digital
-# compilers: f95 fails on .F files, f90 succeeds.
-#
-# Also, in case it's not obvious, this macro can be called only once: we
-# presume that multiple Fortran variants can be handled by a compiler which
-# can handle the most recent one. If this is not the case -- either you need
-# to give special flags to enable and disable the language features you use
-# in different modules, or in the extreme case use different compilers for
-# different files -- you're going to have to do something clever.
-#
-# FIXME At some point gfortran (as the official Gnu Fortran compiler)
-# should be moved up to be the first choice.
-# However, I don't think it's mature enough at the moment.
-#
-m4_define([_AC_F95_FC], [xlf95 lf95 f95 fort ifort ifc efc pgf95 pathf90 gfortran g95])
-m4_define([_AC_F90_FC], [f90 xlf90 pgf90 epcf90])
-m4_define([_AC_F77_FC], [g77 f77 xlf frt pgf77 fort77 fl32 af77])
-AC_DEFUN([_AC_PROG_FC],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CHECK_TOOLS([]_AC_FC[],
- m4_default([$2],
- m4_case(_AC_FC_DIALECT_YEAR([$1]),
- [1995], [_AC_F95_FC],
- [1990], [_AC_F90_FC _AC_F95_FC],
- [1977], [_AC_F77_FC _AC_F90_FC _AC_F95_FC],
- [_AC_F95_FC _AC_F90_FC _AC_F77_FC])))
-
-# Provide some information about the compiler.
-echo "$as_me:__oline__:" \
- "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
-ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version &AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v &AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V &AS_MESSAGE_LOG_FD])
-rm -f a.out
-
-m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
-m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-_AC_LANG_COMPILER_GNU
-ac_ext=$ac_save_ext
-_AC_PROG_FC_G
-])# _AC_PROG_FC
-
-# AC_FC_MOD_SUFFIX
-# -----------------
-# Determines the form of the filename of modules produced
-# by the Fortran compiler.
-# Tests for all forms of file extension I've (TOHW) found in the
-# wild. Note that at least one compiler (PGI??) changes the
-# case of the basename as well. Whether this happens is
-# encoded in the variable ac_fc_mod_uppercase.
-#
-# This macro depends, of course, on the Fortran compiler producing
-# module files. See comment to AC_FC_MOD_PATH_FLAG.
-#
-# FIXME: This will fail if an F77-only compiler is used.
-# Currently we warn and continue. We should maybe error out.
-#
-AC_DEFUN([AC_FC_MOD_SUFFIX],
-[
-cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
-_ACEOF
-_AC_EVAL_STDERR($ac_compile)
-AC_MSG_CHECKING([for suffix of module files])
-for ac_mod_file in conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod none
-do
- if test -f $ac_mod_file; then
- break;
- fi
-done
-rm -f conftest.$ac_ext conftest.$ac_exe_ext conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod
-#
-FC_MODEXT=
-FC_MODUPPERCASE=no
-case $ac_mod_file in
- conftest.mod)
- FC_MODEXT=mod
- ;;
- conftest.MOD)
- FC_MODEXT=MOD
- ;;
- conftest.M)
- FC_MODEXT=M
- ;;
- CONFTEST.MOD)
- FC_MODEXT=MOD
- FC_MODUPPERCASE=yes
- ;;
- CONFTEST.mod)
- FC_MODEXT=mod
- FC_MODUPPERCASE=yes
- ;;
- none)
- AC_MSG_WARN([Could not find Fortran module file extension.])
- ;;
-esac
-
-AC_MSG_RESULT([$FC_MODEXT])
-AC_MSG_CHECKING([whether module filenames are uppercased])
-AC_MSG_RESULT([$FC_MODUPPERCASE])
-
-AC_SUBST(FC_MODEXT)
-AC_SUBST(FC_MODUPPERCASE)
-])# AC_FC_MOD_SUFFIX
-
-
-# AC_PROG_F77([COMPILERS...])
-# ---------------------------
-# COMPILERS is a space separated list of Fortran 77 compilers to search
-# for. See also _AC_PROG_FC.
-AC_DEFUN([AC_PROG_F77],
-[AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])dnl
-AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-_AC_PROG_FC([Fortran 77], [$1])
-G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_LANG_POP(Fortran 77)dnl
-])# AC_PROG_F77
-
-
-# AC_PROG_FC([COMPILERS...], [DIALECT])
-# -------------------------------------
-# COMPILERS is a space separated list of Fortran 77 compilers to search
-# for, and [DIALECT] is an optional dialect. See also _AC_PROG_FC.
-AC_DEFUN([AC_PROG_FC],
-[AC_BEFORE([$0], [AC_PROG_FPP])dnl
-AC_LANG_PUSH(Fortran)dnl
-AC_ARG_VAR([FC], [Fortran compiler command])dnl
-AC_ARG_VAR([FCFLAGS], [Fortran compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-_AC_PROG_FC([$2], [$1])
-AC_LANG_POP(Fortran)dnl
-])# AC_PROG_FC
-
-
-# _AC_PROG_FC_G
-# -------------
-# Check whether -g works, even if F[C]FLAGS is set, in case the package
-# plays around with F[C]FLAGS (such as to build both debugging and normal
-# versions of a library), tasteless as that idea is.
-m4_define([_AC_PROG_FC_G],
-[_AC_FORTRAN_ASSERT()dnl
-ac_test_FFLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set}
-ac_save_FFLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-_AC_LANG_PREFIX[]FLAGS=
-AC_CACHE_CHECK(whether $[]_AC_FC[] accepts -g, ac_cv_prog_[]_AC_LANG_ABBREV[]_g,
-[_AC_LANG_PREFIX[]FLAGS=-g
-_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_g=yes],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_g=no])
-])
-if test "$ac_test_FFLAGS" = set; then
- _AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_[]_AC_LANG_ABBREV[]_g = yes; then
- if test "x$ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu" = xyes; then
- _AC_LANG_PREFIX[]FLAGS="-g -O2"
- else
- _AC_LANG_PREFIX[]FLAGS="-g"
- fi
-else
- if test "x$ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu" = xyes; then
- _AC_LANG_PREFIX[]FLAGS="-O2"
- else
- _AC_LANG_PREFIX[]FLAGS=
- fi
-fi[]dnl
-])# _AC_PROG_FC_G
-
-
-# _AC_PROG_FC_C_O
-# ---------------
-# Test if the Fortran compiler accepts the options `-c' and `-o'
-# simultaneously, and define `[F77/FC]_NO_MINUS_C_MINUS_O' if it does not.
-#
-# The usefulness of this macro is questionable, as I can't really see
-# why anyone would use it. The only reason I include it is for
-# completeness, since a similar test exists for the C compiler.
-#
-# FIXME: it seems like we could merge the C/Fortran versions of this.
-AC_DEFUN([_AC_PROG_FC_C_O],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([whether $[]_AC_FC[] understands -c and -o together],
- [ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o],
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-# We test twice because some compilers refuse to overwrite an existing
-# `.o' file with `-o', although they will create one.
-ac_try='$[]_AC_FC[] $[]_AC_LANG_PREFIX[]FLAGS -c conftest.$ac_ext -o conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-if AC_TRY_EVAL(ac_try) &&
- test -f conftest.$ac_objext &&
- AC_TRY_EVAL(ac_try); then
- ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o=yes
-else
- ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o=no
-fi
-rm -f conftest*])
-if test $ac_cv_prog_[]_AC_LANG_ABBREV[]_c_o = no; then
- AC_DEFINE([]_AC_FC[]_NO_MINUS_C_MINUS_O, 1,
- [Define to 1 if your Fortran compiler doesn't accept
- -c and -o together.])
-fi
-])# _AC_PROG_FC_C_O
-
-
-# AC_PROG_F77_C_O
-# ---------------
-AC_DEFUN([AC_PROG_F77_C_O],
-[AC_REQUIRE([AC_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_PROG_FC_C_O
-AC_LANG_POP(Fortran 77)dnl
-])# AC_PROG_F77_C_O
-
-
-# AC_PROG_FC_C_O
-# ---------------
-AC_DEFUN([AC_PROG_FC_C_O],
-[AC_REQUIRE([AC_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_PROG_FC_C_O
-AC_LANG_POP(Fortran)dnl
-])# AC_PROG_FC_C_O
-
-
-## ------------------------------- ##
-## 4. Compilers' characteristics. ##
-## ------------------------------- ##
-
-
-# ---------------------------------------- #
-# 4d. Fortran 77 compiler characteristics. #
-# ---------------------------------------- #
-
-
-# _AC_PROG_FC_V_OUTPUT([FLAG = $ac_cv_prog_{f77/fc}_v])
-# -------------------------------------------------
-# Link a trivial Fortran program, compiling with a verbose output FLAG
-# (whose default value, $ac_cv_prog_{f77/fc}_v, is computed by
-# _AC_PROG_FC_V), and return the output in $ac_{f77/fc}_v_output. This
-# output is processed in the way expected by _AC_FC_LIBRARY_LDFLAGS,
-# so that any link flags that are echoed by the compiler appear as
-# space-separated items.
-AC_DEFUN([_AC_PROG_FC_V_OUTPUT],
-[_AC_FORTRAN_ASSERT()dnl
-AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-
-# Compile and link our simple test program by passing a flag (argument
-# 1 to this macro) to the Fortran compiler in order to get
-# "verbose" output that we can then parse for the Fortran linker
-# flags.
-ac_save_FFLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS m4_default([$1], [$ac_cv_prog_[]_AC_LANG_ABBREV[]_v])"
-(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
-ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'`
-echo "$ac_[]_AC_LANG_ABBREV[]_v_output" >&AS_MESSAGE_LOG_FD
-_AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS
-
-rm -f conftest*
-
-# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
-# /foo, /bar, and /baz are search directories for the Fortran linker.
-# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
-ac_[]_AC_LANG_ABBREV[]_v_output="`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
- grep 'LPATH is:' |
- sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $ac_[]_AC_LANG_ABBREV[]_v_output"
-
-case $ac_[]_AC_LANG_ABBREV[]_v_output in
- # If we are using xlf then replace all the commas with spaces.
- *xlfentry*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/,/ /g'` ;;
-
- # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
- # $LIBS confuse us, and the libraries appear later in the output anyway).
- *mGLOB_options_string*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/\"-mGLOB[[^\"]]*\"/ /g'` ;;
-
- # If we are using Cray Fortran then delete quotes.
- # Use "\"" instead of '"' for font-lock-mode.
- # FIXME: a more general fix for quoted arguments with spaces?
- *cft90*)
- ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed "s/\"//g"` ;;
-esac
-
-])# _AC_PROG_FC_V_OUTPUT
-
-
-# _AC_PROG_FC_V
-# --------------
-#
-# Determine the flag that causes the Fortran compiler to print
-# information of library and object files (normally -v)
-# Needed for _AC_FC_LIBRARY_FLAGS
-# Some compilers don't accept -v (Lahey: -verbose, xlf: -V, Fujitsu: -###)
-AC_DEFUN([_AC_PROG_FC_V],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([how to get verbose linking output from $[]_AC_FC[]],
- [ac_cv_prog_[]_AC_LANG_ABBREV[]_v],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-[ac_cv_prog_[]_AC_LANG_ABBREV[]_v=
-# Try some options frequently used verbose output
-for ac_verb in -v -verbose --verbose -V -\#\#\#; do
- _AC_PROG_FC_V_OUTPUT($ac_verb)
- # look for -l* and *.a constructs in the output
- for ac_arg in $ac_[]_AC_LANG_ABBREV[]_v_output; do
- case $ac_arg in
- [[\\/]]*.a | ?:[[\\/]]*.a | -[[lLRu]]*)
- ac_cv_prog_[]_AC_LANG_ABBREV[]_v=$ac_verb
- break 2 ;;
- esac
- done
-done
-if test -z "$ac_cv_prog_[]_AC_LANG_ABBREV[]_v"; then
- AC_MSG_WARN([cannot determine how to obtain linking information from $[]_AC_FC[]])
-fi],
- [AC_MSG_WARN([compilation failed])])
-])])# _AC_PROG_FC_V
-
-
-# _AC_FC_LIBRARY_LDFLAGS
-# ----------------------
-#
-# Determine the linker flags (e.g. "-L" and "-l") for the Fortran
-# intrinsic and run-time libraries that are required to successfully
-# link a Fortran program or shared library. The output variable
-# FLIBS/FCLIBS is set to these flags.
-#
-# This macro is intended to be used in those situations when it is
-# necessary to mix, e.g. C++ and Fortran, source code into a single
-# program or shared library.
-#
-# For example, if object files from a C++ and Fortran compiler must
-# be linked together, then the C++ compiler/linker must be used for
-# linking (since special C++-ish things need to happen at link time
-# like calling global constructors, instantiating templates, enabling
-# exception support, etc.).
-#
-# However, the Fortran intrinsic and run-time libraries must be
-# linked in as well, but the C++ compiler/linker doesn't know how to
-# add these Fortran libraries. Hence, the macro
-# "AC_F77_LIBRARY_LDFLAGS" was created to determine these Fortran
-# libraries.
-#
-# This macro was packaged in its current form by Matthew D. Langston.
-# However, nearly all of this macro came from the "OCTAVE_FLIBS" macro
-# in "octave-2.0.13/aclocal.m4", and full credit should go to John
-# W. Eaton for writing this extremely useful macro. Thank you John.
-AC_DEFUN([_AC_FC_LIBRARY_LDFLAGS],
-[_AC_FORTRAN_ASSERT()dnl
-_AC_PROG_FC_V
-AC_CACHE_CHECK([for Fortran libraries of $[]_AC_FC[]], ac_cv_[]_AC_LANG_ABBREV[]_libs,
-[if test "x$[]_AC_LANG_PREFIX[]LIBS" != "x"; then
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$[]_AC_LANG_PREFIX[]LIBS" # Let the user override the test.
-else
-
-_AC_PROG_FC_V_OUTPUT
-
-ac_cv_[]_AC_LANG_ABBREV[]_libs=
-
-# Save positional arguments (if any)
-ac_save_positional="$[@]"
-
-set X $ac_[]_AC_LANG_ABBREV[]_v_output
-while test $[@%:@] != 1; do
- shift
- ac_arg=$[1]
- case $ac_arg in
- [[\\/]]*.a | ?:[[\\/]]*.a)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
- ;;
- -bI:*)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
- ;;
- # Ignore these flags.
- -lang* | -lcrt*.o | -lc | -lgcc | -libmil | -LANG:=*)
- ;;
- -lkernel32)
- test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
- ;;
- -[[LRuY]])
- # These flags, when seen by themselves, take an argument.
- # We remove the space between option and argument and re-iterate
- # unless we find an empty arg or a new option (starting with -)
- case $[2] in
- "" | -*);;
- *)
- ac_arg="$ac_arg$[2]"
- shift; shift
- set X $ac_arg "$[@]"
- ;;
- esac
- ;;
- -YP,*)
- for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
- _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- [ac_arg="$ac_arg $ac_j"
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
- done
- ;;
- -[[lLR]]*)
- _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
- ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
- ;;
- # Ignore everything else.
- esac
-done
-# restore positional arguments
-set X $ac_save_positional; shift
-
-# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
-# then we insist that the "run path" must be an absolute path (i.e. it
-# must begin with a "/").
-case `(uname -sr) 2>/dev/null` in
- "SunOS 5"*)
- ac_ld_run_path=`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
- sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
- test "x$ac_ld_run_path" != x &&
- _AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_[]_AC_LANG_ABBREV[]_libs)
- ;;
-esac
-fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
-])
-[]_AC_LANG_PREFIX[]LIBS="$ac_cv_[]_AC_LANG_ABBREV[]_libs"
-AC_SUBST([]_AC_LANG_PREFIX[]LIBS)
-])# _AC_FC_LIBRARY_LDFLAGS
-
-
-# AC_F77_LIBRARY_LDFLAGS
-# ----------------------
-AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
-[AC_REQUIRE([AC_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_LIBRARY_LDFLAGS
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_LIBRARY_LDFLAGS
-
-
-# AC_FC_LIBRARY_LDFLAGS
-# ----------------------
-AC_DEFUN([AC_FC_LIBRARY_LDFLAGS],
-[AC_REQUIRE([AC_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_LIBRARY_LDFLAGS
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_LIBRARY_LDFLAGS
-
-
-# _AC_FC_DUMMY_MAIN([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -----------------------------------------------------------
-#
-# Detect name of dummy main routine required by the Fortran libraries,
-# (if any) and define {F77,FC}_DUMMY_MAIN to this name (which should be
-# used for a dummy declaration, if it is defined). On some systems,
-# linking a C program to the Fortran library does not work unless you
-# supply a dummy function called something like MAIN__.
-#
-# Execute ACTION-IF-NOT-FOUND if no way of successfully linking a C
-# program with the {F77,FC} libs is found; default to exiting with an error
-# message. Execute ACTION-IF-FOUND if a dummy routine name is needed
-# and found or if it is not needed (default to defining {F77,FC}_DUMMY_MAIN
-# when needed).
-#
-# What is technically happening is that the Fortran libraries provide
-# their own main() function, which usually initializes Fortran I/O and
-# similar stuff, and then calls MAIN__, which is the entry point of
-# your program. Usually, a C program will override this with its own
-# main() routine, but the linker sometimes complain if you don't
-# provide a dummy (never-called) MAIN__ routine anyway.
-#
-# Of course, programs that want to allow Fortran subroutines to do
-# I/O, etcetera, should call their main routine MAIN__() (or whatever)
-# instead of main(). A separate autoconf test (_AC_FC_MAIN) checks
-# for the routine to use in this case (since the semantics of the test
-# are slightly different). To link to e.g. purely numerical
-# libraries, this is normally not necessary, however, and most C/C++
-# programs are reluctant to turn over so much control to Fortran. =)
-#
-# The name variants we check for are (in order):
-# MAIN__ (g77, MAIN__ required on some systems; IRIX, MAIN__ optional)
-# MAIN_, __main (SunOS)
-# MAIN _MAIN __MAIN main_ main__ _main (we follow DDD and try these too)
-AC_DEFUN([_AC_FC_DUMMY_MAIN],
-[_AC_FORTRAN_ASSERT()dnl
-m4_define(_AC_LANG_PROGRAM_C_[]_AC_FC[]_HOOKS,
-[#ifdef ]_AC_FC[_DUMMY_MAIN
-]AC_LANG_CASE([Fortran], [#ifndef FC_DUMMY_MAIN_EQ_F77])
-[# ifdef __cplusplus
- extern "C"
-# endif
- int ]_AC_FC[_DUMMY_MAIN() { return 1; }
-]AC_LANG_CASE([Fortran], [#endif])
-[#endif
-])
-AC_CACHE_CHECK([for dummy main to link with Fortran libraries],
- ac_cv_[]_AC_LANG_ABBREV[]_dummy_main,
-[ac_[]_AC_LANG_ABBREV[]_dm_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
- ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
- AC_LANG_PUSH(C)dnl
-
- # First, try linking without a dummy main:
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
- [ac_cv_fortran_dummy_main=none],
- [ac_cv_fortran_dummy_main=unknown])
-
- if test $ac_cv_fortran_dummy_main = unknown; then
- for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@define $ac_fortran_dm_var $ac_func]])],
- [ac_cv_fortran_dummy_main=$ac_func; break])
- done
- fi
- AC_LANG_POP(C)dnl
- ac_cv_[]_AC_LANG_ABBREV[]_dummy_main=$ac_cv_fortran_dummy_main
- rm -f conftest*
- LIBS=$ac_[]_AC_LANG_ABBREV[]_dm_save_LIBS
-])
-[]_AC_FC[]_DUMMY_MAIN=$ac_cv_[]_AC_LANG_ABBREV[]_dummy_main
-AS_IF([test "$[]_AC_FC[]_DUMMY_MAIN" != unknown],
- [m4_default([$1],
-[if test $[]_AC_FC[]_DUMMY_MAIN != none; then
- AC_DEFINE_UNQUOTED([]_AC_FC[]_DUMMY_MAIN, $[]_AC_FC[]_DUMMY_MAIN,
- [Define to dummy `main' function (if any) required to
- link to the Fortran libraries.])
- if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
- AC_DEFINE([FC_DUMMY_MAIN_EQ_F77], 1,
- [Define if F77 and FC dummy `main' functions are identical.])
- fi
-fi])],
- [m4_default([$2],
- [AC_MSG_FAILURE([linking to Fortran libraries from C fails])])])
-])# _AC_FC_DUMMY_MAIN
-
-
-# AC_F77_DUMMY_MAIN
-# ----------------------
-AC_DEFUN([AC_F77_DUMMY_MAIN],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_DUMMY_MAIN
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_DUMMY_MAIN
-
-
-# AC_FC_DUMMY_MAIN
-# ----------------------
-AC_DEFUN([AC_FC_DUMMY_MAIN],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_DUMMY_MAIN
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_DUMMY_MAIN
-
-
-# _AC_FC_MAIN
-# -----------
-# Define {F77,FC}_MAIN to name of alternate main() function for use with
-# the Fortran libraries. (Typically, the libraries may define their
-# own main() to initialize I/O, etcetera, that then call your own
-# routine called MAIN__ or whatever.) See _AC_FC_DUMMY_MAIN, above.
-# If no such alternate name is found, just define {F77,FC}_MAIN to main.
-#
-AC_DEFUN([_AC_FC_MAIN],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([for alternate main to link with Fortran libraries],
- ac_cv_[]_AC_LANG_ABBREV[]_main,
-[ac_[]_AC_LANG_ABBREV[]_m_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
- ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
- AC_LANG_PUSH(C)dnl
- ac_cv_fortran_main="main" # default entry point name
- for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@ifdef FC_DUMMY_MAIN_EQ_F77
-@%:@ undef F77_DUMMY_MAIN
-@%:@ undef FC_DUMMY_MAIN
-@%:@else
-@%:@ undef $ac_fortran_dm_var
-@%:@endif
-@%:@define main $ac_func])],
- [ac_cv_fortran_main=$ac_func; break])
- done
- AC_LANG_POP(C)dnl
- ac_cv_[]_AC_LANG_ABBREV[]_main=$ac_cv_fortran_main
- rm -f conftest*
- LIBS=$ac_[]_AC_LANG_ABBREV[]_m_save_LIBS
-])
-if test "$ac_cv_[]_AC_LANG_ABBREV[]_main" = main; then
- AC_DEFINE([]_AC_FC[]_MAIN_IS_MAIN, 1, [True when Fortran main is C main])
-fi
-AC_DEFINE_UNQUOTED([]_AC_FC[]_MAIN, $ac_cv_[]_AC_LANG_ABBREV[]_main,
- [Define to alternate name for `main' routine that is
- called from a `main' in the Fortran libraries.])
-])# _AC_FC_MAIN
-
-
-# AC_F77_MAIN
-# -----------
-AC_DEFUN([AC_F77_MAIN],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_MAIN
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_MAIN
-
-
-# AC_FC_MAIN
-# ----------
-AC_DEFUN([AC_FC_MAIN],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_MAIN
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_MAIN
-
-
-# __AC_FC_NAME_MANGLING
-# ---------------------
-# Test for the name mangling scheme used by the Fortran compiler.
-#
-# Sets ac_cv_{f77,fc}_mangling. The value contains three fields, separated
-# by commas:
-#
-# lower case / upper case:
-# case translation of the Fortran symbols
-# underscore / no underscore:
-# whether the compiler appends "_" to symbol names
-# extra underscore / no extra underscore:
-# whether the compiler appends an extra "_" to symbol names already
-# containing at least one underscore
-#
-AC_DEFUN([__AC_FC_NAME_MANGLING],
-[_AC_FORTRAN_ASSERT()dnl
-AC_CACHE_CHECK([for Fortran name-mangling scheme],
- ac_cv_[]_AC_LANG_ABBREV[]_mangling,
-[AC_COMPILE_IFELSE(
-[ subroutine foobar()
- return
- end
- subroutine foo_bar()
- return
- end],
-[mv conftest.$ac_objext cfortran_test.$ac_objext
-
- ac_save_LIBS=$LIBS
- LIBS="cfortran_test.$ac_objext $LIBS $[]_AC_LANG_PREFIX[]LIBS"
-
- AC_LANG_PUSH(C)dnl
- ac_success=no
- for ac_foobar in foobar FOOBAR; do
- for ac_underscore in "" "_"; do
- ac_func="$ac_foobar$ac_underscore"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
- [ac_success=yes; break 2])
- done
- done
- AC_LANG_POP(C)dnl
-
- if test "$ac_success" = "yes"; then
- case $ac_foobar in
- foobar)
- ac_case=lower
- ac_foo_bar=foo_bar
- ;;
- FOOBAR)
- ac_case=upper
- ac_foo_bar=FOO_BAR
- ;;
- esac
-
- AC_LANG_PUSH(C)dnl
- ac_success_extra=no
- for ac_extra in "" "_"; do
- ac_func="$ac_foo_bar$ac_underscore$ac_extra"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
- [ac_success_extra=yes; break])
- done
- AC_LANG_POP(C)dnl
-
- if test "$ac_success_extra" = "yes"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_case case"
- if test -z "$ac_underscore"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no underscore"
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, underscore"
- fi
- if test -z "$ac_extra"; then
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no extra underscore"
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, extra underscore"
- fi
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
- fi
- else
- ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
- fi
-
- LIBS=$ac_save_LIBS
- rm -f cfortran_test* conftest*],
- [AC_MSG_FAILURE([cannot compile a simple Fortran program])])
-])
-])# __AC_FC_NAME_MANGLING
-
-# The replacement is empty.
-AU_DEFUN([AC_F77_NAME_MANGLING], [])
-
-
-# _AC_F77_NAME_MANGLING
-# ----------------------
-AC_DEFUN([_AC_F77_NAME_MANGLING],
-[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
-AC_REQUIRE([AC_F77_DUMMY_MAIN])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-__AC_FC_NAME_MANGLING
-AC_LANG_POP(Fortran 77)dnl
-])# _AC_F77_NAME_MANGLING
-
-
-# _AC_FC_NAME_MANGLING
-# ----------------------
-AC_DEFUN([_AC_FC_NAME_MANGLING],
-[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl
-AC_REQUIRE([AC_FC_DUMMY_MAIN])dnl
-AC_LANG_PUSH(Fortran)dnl
-__AC_FC_NAME_MANGLING
-AC_LANG_POP(Fortran)dnl
-])# _AC_FC_NAME_MANGLING
-
-
-# _AC_FC_WRAPPERS
-# ---------------
-# Defines C macros {F77,FC}_FUNC(name,NAME) and {F77,FC}_FUNC_(name,NAME) to
-# properly mangle the names of C identifiers, and C identifiers with
-# underscores, respectively, so that they match the name mangling
-# scheme used by the Fortran compiler.
-AC_DEFUN([_AC_FC_WRAPPERS],
-[_AC_FORTRAN_ASSERT()dnl
-AH_TEMPLATE(_AC_FC[_FUNC],
- [Define to a macro mangling the given C identifier (in lower and upper
- case), which must not contain underscores, for linking with Fortran.])dnl
-AH_TEMPLATE(_AC_FC[_FUNC_],
- [As ]_AC_FC[_FUNC, but for C identifiers containing underscores.])dnl
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in
- "lower case, no underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name]) ;;
- "lower case, no underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;;
- "lower case, underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;;
- "lower case, underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## __]) ;;
- "upper case, no underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME]) ;;
- "upper case, no underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;;
- "upper case, underscore, no extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;;
- "upper case, underscore, extra underscore")
- AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
- AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## __]) ;;
- *)
- AC_MSG_WARN([unknown Fortran name-mangling scheme])
- ;;
-esac
-])# _AC_FC_WRAPPERS
-
-
-# AC_F77_WRAPPERS
-# ---------------
-AC_DEFUN([AC_F77_WRAPPERS],
-[AC_REQUIRE([_AC_F77_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_WRAPPERS
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_WRAPPERS
-
-
-# AC_FC_WRAPPERS
-# --------------
-AC_DEFUN([AC_FC_WRAPPERS],
-[AC_REQUIRE([_AC_FC_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_WRAPPERS
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_WRAPPERS
-
-
-# _AC_FC_FUNC(NAME, [SHELLVAR = NAME])
-# ------------------------------------
-# For a Fortran subroutine of given NAME, define a shell variable
-# $SHELLVAR to the Fortran-mangled name. If the SHELLVAR
-# argument is not supplied, it defaults to NAME.
-AC_DEFUN([_AC_FC_FUNC],
-[_AC_FORTRAN_ASSERT()dnl
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in
- upper*) ac_val="m4_toupper([$1])" ;;
- lower*) ac_val="m4_tolower([$1])" ;;
- *) ac_val="unknown" ;;
-esac
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-m4_if(m4_index([$1],[_]),-1,[],
-[case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
-])
-m4_default([$2],[$1])="$ac_val"
-])# _AC_FC_FUNC
-
-
-# AC_F77_FUNC(NAME, [SHELLVAR = NAME])
-# ------------------------------------
-AC_DEFUN([AC_F77_FUNC],
-[AC_REQUIRE([_AC_F77_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran 77)dnl
-_AC_FC_FUNC([$1],[$2])
-AC_LANG_POP(Fortran 77)dnl
-])# AC_F77_FUNC
-
-
-# AC_FC_FUNC(NAME, [SHELLVAR = NAME])
-# -----------------------------------
-AC_DEFUN([AC_FC_FUNC],
-[AC_REQUIRE([_AC_FC_NAME_MANGLING])dnl
-AC_LANG_PUSH(Fortran)dnl
-_AC_FC_FUNC([$1],[$2])
-AC_LANG_POP(Fortran)dnl
-])# AC_FC_FUNC
-
-
-# AC_FC_SRCEXT(EXT, [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# -----------------------------------------------------------
-# Set the source-code extension used in Fortran (FC) tests to EXT (which
-# defaults to f). Also, look for any necessary additional FCFLAGS needed
-# to allow this extension, and store them in the output variable
-# FCFLAGS_ (e.g. FCFLAGS_f90 for EXT=f90). If successful,
-# call ACTION-IF-SUCCESS. If unable to compile source code with EXT,
-# call ACTION-IF-FAILURE, which defaults to failing with an error
-# message.
-#
-# (The flags for the current source-code extension, if any, are stored
-# in the FCFLAGS_SRCEXT variable and are automatically used in subsequent
-# autoconf tests.)
-#
-# For ordinary extensions like f90, etcetera, the modified FCFLAGS
-# are currently needed for IBM's xlf* and Intel's ifc (grrr). Unfortunately,
-# xlf* will only take flags to recognize one extension at a time, so if the
-# user wants to compile multiple extensions (.f90 and .f95, say), she
-# will need to use the FCFLAGS_F90 and FCFLAGS_F95 individually rather
-# than just adding them all to FCFLAGS, for example.
-#
-# Also, for Intel's ifc compiler (which does not accept .f95 by default in
-# some versions), the $FCFLAGS_ variable *must* go immediately before
-# the source file on the command line, unlike other $FCFLAGS. Ugh.
-AC_DEFUN([AC_FC_SRCEXT],
-[AC_LANG_PUSH([Fortran])dnl
-AC_MSG_WARN([AC@&t@_FC@&t@_SRCEXT is deprecated. Use AC@&t@_FC_FIXEDFORM([srcext]) or AC@&t@_FC_FREEFORM([srcext]) as appropriate.])
-AC_CACHE_CHECK([for Fortran flag to compile .$1 files],
- ac_cv_fc_srcext_$1,
-[ac_ext=$1
-ac_fc_srcext_FCFLAGS_SRCEXT_save=$FCFLAGS_SRCEXT
-FCFLAGS_SRCEXT=""
-ac_cv_fc_srcext_$1=unknown
-for ac_flag in none -qsuffix=f=$1 -Tf; do
- test "x$ac_flag" != xnone && FCFLAGS_SRCEXT="$ac_flag"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_fc_srcext_$1=$ac_flag; break])
-done
-rm -f conftest.$ac_objext conftest.$1
-FCFLAGS_SRCEXT=$ac_fc_srcext_FCFLAGS_SRCEXT_save
-])
-if test "x$ac_cv_fc_srcext_$1" = xunknown; then
- m4_default([$3],[AC_MSG_ERROR([Fortran could not compile .$1 files])])
-else
- FC_SRCEXT=$1
- if test "x$ac_cv_fc_srcext_$1" = xnone; then
- FCFLAGS_SRCEXT=""
- FCFLAGS_[]$1[]="$FCFLAGS_[]$1[]"
- else
- FCFLAGS_SRCEXT=$ac_cv_fc_srcext_$1
- FCFLAGS_[]$1[]="$FCFLAGS_[]$1[] $ac_cv_fc_srcext_$1"
- fi
- AC_SUBST(FCFLAGS_[]$1)
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_SRCEXT
-
-
-# -------------- #
-# Utility macros #
-# -------------- #
-
-# AC_FC_FIXEDFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# -------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# fixed-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FCFLAGS_fixed_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# The known flags are:
-# -FI: Intel compiler (icc, ecc)
-# -qfixed: IBM compiler (xlf)
-# -fixed: NAG compiler
-# -Mnofree: PGI compiler
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-AC_DEFUN([AC_FC_FIXEDFORM],
-[AC_REQUIRE([AC_PROG_FC])
-AC_LANG_PUSH([Fortran])dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow fixed-form source for .$1 suffix],
- ac_cv_fc_fixedform_$1,
-[ac_cv_fc_fixedform_$1=unknown
-ac_ext=$1
-ac_fc_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none -FI "-qfixed -qsuffix=cpp=$ac_ext" -fixed --fix -Mnofree
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
- ENDP ROGRAM
-],
- [ac_cv_fc_fixedform_$1=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fc_fixedform_FCFLAGS_save
-])
-if test "x$ac_cv_fc_fixedform_$1" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile fixed-form source with .$1 suffix], 77)])
-else
- if test "x$ac_cv_fc_fixedform_$1" != xnone; then
- AC_SUBST(FCFLAGS_fixed_[]$1, "$ac_cv_fc_fixedform_$1")
- fi
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_FIXEDFORM
-
-
-# AC_FC_FREEFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# ------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# free-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FCFLAGS_free_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# For backwards compatibility, this macro may be called without
-# specifying SRCEXT, in which case, a default extension of f90
-# is used. This usage is deprecated.
-#
-# The known flags are:
-# -ffree-form: GNU g77
-# -FR: Intel compiler (icc, ecc)
-# -free: Compaq compiler (fort), NAG compiler
-# -qfree -qsuffix=f=: IBM compiler (xlf) (generates a warning
-# with recent versions)
-# -qfree=f90 -qsuffix=f=: Newer xlf versions
-# --nfix: Lahey compiler
-# -Mfree, -Mfreeform: Portland Group compiler
-# -freeform: SGI compiler
-# -f free: Absoft Fortran
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-AC_DEFUN([AC_FC_FREEFORM],
-[AC_REQUIRE([AC_PROG_FC])
-AC_LANG_PUSH([Fortran])dnl
-dnl default _AC_EXT to 'f90', if no argument is given.
-m4_define([_AC_EXT], m4_if($1, [], f90, $1))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow free-form source for .]_AC_EXT[ suffix],
- ac_cv_fc_freeform_[]_AC_EXT,
-[ac_cv_fc_freeform_[]_AC_EXT=unknown
-ac_ext=_AC_EXT
-ac_fc_freeform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none -ffree-form -FR -free "-qfree=f90" "-qfree=f90 -qsuffix=f=$ac_ext"\
- -qfree "-qfree -qsuffix=f=$ac_ext" -Mfree -Mfreeform \
- -freeform "-f free" --nfix
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-end program],
- [ac_cv_fc_freeform_[]_AC_EXT=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fc_freeform_FCFLAGS_save
-])
-if test "x$ac_cv_fc_freeform_[]_AC_EXT" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile free-form source with .]_AC_EXT[ suffix], 77)])
-else
- if test "x$ac_cv_fc_freeform_[]_AC_EXT" != xnone; then
-dnl if the first argument was absent, then implement the old behaviour,
-dnl and simply append to variable FCFLAGS
- m4_if($1, [],
- [FCFLAGS="$FCFLAGS $ac_cv_fc_freeform_[]_AC_EXT"],
- [AC_SUBST(FCFLAGS_free_[]_AC_EXT, "$ac_cv_fc_freeform_[]_AC_EXT")])
- fi
- $2
-fi
-AC_LANG_POP([Fortran])dnl
-])# AC_FC_FREEFORM
-
-
-# _AC_FPP_FIXEDFORM_F
-# -------------------
-# Related to AC_FPP_FIXEDFORM, but used only from _AC_PROG_FC_FPP.
-# How do we directly compile a preprocessable .F file?
-# This should be a no-op on all systems except those with case-sensitive
-# filenames, and those which can't do direct compilation anyway.
-# Do not put result into cached variable if it fails.
-AC_DEFUN([_AC_FPP_FIXEDFORM_F],[
-ac_ext=F
-ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none "/fpp" "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=F" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
- ENDP ROGRAM
-#endif
- ],
- [ac_cv_fpp_fixedform_F=$ac_flag; break])
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-if test "x$ac_cv_fpp_fixedform_F" = x; then
- AC_MSG_WARN([Cannot compile fixed-form preprocessable Fortran with a .F extension.])
-else
- if test "$ac_cv_fpp_fixedform_F" != none; then
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
- AC_SUBST(FPPFLAGS_fixed_F, "$ac_cv_fpp_fixedform_F")
- fi
-fi
-])# _AC_FPP_FIXEDFORM_F
-
-
-# AC_FPP_FIXEDFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# --------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# preprocessed fixed-format source code, with a source extension of
-# SRCEXT, and puts any necessary flags in FPPFLAGS_fixed_.
-# Call ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# Mostly, this is applicable only when using direct compilation.
-# However the macro also sets FPP_PREPROCESS_EXT and FPP_COMPILE_EXT,
-# based on SRCEXT. SRCEXT can be either 'EXT' or 'EXT1:ext2'; in the
-# first case, the preprocessor extension is 'EXT', and the compile
-# extension 'ext' (ie, the preprocessor extension, lowercased); in the
-# second, the preprocessor extension is 'EXT1' and the compile
-# extension 'ext2'.
-#
-# The known flags are:
-# -x f77-cpp-input: g77
-# -FI -cpp: Intel compiler (ifort)
-# -qfixed -qsuffix=cpp=: IBM compiler (xlf)
-# -fixed -fpp: NAG compiler
-# -lfe "-Cpp" --fix: Lahey compiler
-# -Mnofree: PGI (no flag for preprocessing available)
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity.
-# NB when updating this list of flags, also update those of the previous
-# macro.
-AC_DEFUN([AC_FPP_FIXEDFORM],
-[AC_REQUIRE([AC_PROG_FPP])
-AC_LANG_PUSH([Fortran])dnl
-dnl Extract preprocessor extension _ac_ppext from $1, part preceding any ':'
-m4_define([_ac_ppext], m4_bpatsubst([$1], [:.*]))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow preprocessed fixed-form source for ._ac_ppext suffix],
- ac_cv_fpp_fixedform_[]_ac_ppext,
-[if test $ac_cv_fpp_build_rule = direct; then
- ac_cv_fpp_fixedform_[]_ac_ppext=unknown
- ac_ext=_ac_ppext
- ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
- for ac_flag in none "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=_ac_ppext" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
- do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifndef OK
- ENDP ROGRAM
-#endif
- ],
- [ac_cv_fpp_fixedform_[]_ac_ppext=$ac_flag; break])
- done
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-else
- ac_cv_fpp_fixedform_[]_ac_ppext=none
-fi # test $ac_cv_fpp_build_rule = direct
-])
-if test "x$ac_cv_fpp_fixedform_[]_ac_ppext" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile fixed-form source with ._ac_ppext suffix], 77)])
-else
- if test "x$ac_cv_fpp_fixedform_[]_ac_ppext" != xnone; then
- AC_SUBST(FPPFLAGS_fixed_[]_ac_ppext, "$ac_cv_fpp_fixedform_[]_ac_ppext")
- fi
- $2
-fi
-
-FPP_PREPROCESS_EXT=_ac_ppext
-FPP_COMPILE_EXT=m4_if(m4_index([$1], :), -1,
- m4_tolower([$1]),
- m4_bpatsubst([$1], [.*:]))
-
-AC_LANG_POP([Fortran])dnl
-])# AC_FPP_FIXEDFORM
-
-
-# AC_FPP_FREEFORM([SRCEXT], [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# ------------------------------------------------------------------
-# Look for compiler flags to make the Fortran (FC) compiler accept
-# preprocessed free-format source code, with a source extension of SRCEXT,
-# and puts any necessary flags in FPPFLAGS_free_. Call
-# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
-# compile fixed-format code using new extension) and ACTION-IF-FAILURE
-# (defaults to failing with an error message) if not.
-#
-# Mostly, this is applicable only when using direct compilation.
-# However the macro also sets FPP_PREPROCESS_EXT and FPP_COMPILE_EXT,
-# based on SRCEXT. SRCEXT can be either 'EXT' or 'EXT1:ext2'; in the
-# first case, the preprocessor extension is 'EXT', and the compile
-# extension 'ext' (ie, the preprocessor extension, lowercased); in the
-# second, the preprocessor extension is 'EXT1' and the compile
-# extension 'ext2'.
-#
-# The known flags are:
-# -ffree-form -x f77-cpp-input: GNU g77
-# -FR -cpp: Intel compiler (ifort) on unix
-# /FR /fpp: Intel compiler (ifort) on windows
-# -free -cpp: Compaq compiler (fort), NAG compiler
-# -qfree -qsuffix=cpp=: IBM compiler (xlf) (generates a warning
-# with recent versions)
-# -qfree=f90 -qsuffix=cpp=: Newer xlf versions
-# --nfix -lfe="Cpp": Lahey compiler
-# -Mfree, -Mfreeform: PGI (no flag for preprocessing available)
-# -freeform: SGI compiler
-# -f free: Absoft Fortran
-# -fpp -free: NAG Fortran
-# We try to test the "more popular" flags first, by some prejudiced
-# notion of popularity. Also, Intel/Windows must be first or it gets
-# confused
-AC_DEFUN([AC_FPP_FREEFORM],
-[AC_REQUIRE([AC_PROG_FPP])
-AC_LANG_PUSH([Fortran])dnl
-dnl Extract preprocessor extension _ac_ppext from $1, part preceding any ':'
-m4_define([_ac_ppext], m4_bpatsubst([$1], [:.*]))dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow free-form preprocessed source for ._ac_ppext suffix],
- ac_cv_fpp_freeform_[]_ac_ppext,
-[if test $ac_cv_fpp_build_rule = direct; then
- ac_cv_fpp_freeform_[]_ac_ppext=unknown
- ac_ext=_ac_ppext
- ac_fpp_freeform_FCFLAGS_save=$FCFLAGS
- for ac_flag in none "/FR /fpp" "-ffree-form -x f77-cpp-input" \
- "-FR -cpp" "-free -cpp" "-qfree=f90 -qsuffix=cpp=_ac_ppext"\
- "-qfree -qsuffix=cpp=_ac_ppext" -Mfree -Mfreeform \
- -freeform "-f free" --nfix "-fpp -free"
- do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_freeform_FCFLAGS_save $ac_flag"
- AC_COMPILE_IFELSE([
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
-end program
-#endif
- ],
- [ac_cv_fpp_freeform_[]_ac_ppext=$ac_flag; break])
- done
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- FCFLAGS=$ac_fpp_freeform_FCFLAGS_save
-else
- ac_cv_fpp_freeform_[]_ac_ppext=none
-fi # test $ac_cv_fpp_build_rule = direct
-])
-if test "x$ac_cv_fpp_freeform_[]_ac_ppext" = xunknown; then
- m4_default([$3],
- [AC_MSG_ERROR([Cannot compile free-form source with ._ac_ppext suffix], 77)])
-else
- if test "x$ac_cv_fpp_freeform_[]_ac_ppext" != xnone; then
- AC_SUBST(FPPFLAGS_free_[]_ac_ppext, "$ac_cv_fpp_freeform_[]_ac_ppext")
- fi
- $2
-fi
-
-FPP_PREPROCESS_EXT=_ac_ppext
-FPP_COMPILE_EXT=m4_if(m4_index([$1], :), -1,
- m4_tolower([$1]),
- m4_bpatsubst([$1], [.*:]))
-
-AC_LANG_POP([Fortran])dnl
-])# AC_FPP_FREEFORM
-
-
-# AC_FC_OPEN_SPECIFIERS(specifier ...)
-# ------------------------------------
-#
-# The Fortran OPEN statement is a rich source of portability problems,
-# since there are numerous common extensions which consiste of extra
-# specifiers, several of which are useful when they are available.
-# For each of the specifiers in the (whitespace-separated) argument
-# list, define HAVE_FC_OPEN_mungedspecifier if the specifier may be
-# given as argument to the OPEN statement. The `mungedspecifier' is the
-# `specifier' converted to uppercase and with all characters outside
-# [a-zA-Z0-9_] deleted. Note that this may include `specifiers' such
-# as "access='append'" and "[access='sequential',recl=1]" (note quoting of
-# comma) to check combinations of specifiers. You may not include a
-# space in the `specifier', even quoted. Each argument must be a
-# maximum of 65 characters in length (to abide by Fortran 77
-# line-length limits).
-#
-dnl Multiple m4_quote instances are necessary in case specifier includes comma.
-dnl In the Fortran OPEN line, include status='scratch' unless status=???
-dnl is in the specifier being tested.
-dnl Put specifier on continuation line, in case it's long.
-AC_DEFUN([AC_FC_OPEN_SPECIFIERS],
- [AC_REQUIRE([AC_PROG_FC])dnl
- AC_LANG_PUSH([Fortran])
- AC_FOREACH([Specifier],
- m4_quote(m4_toupper([$1])),
- [m4_define([mungedspec],
- m4_bpatsubst(m4_quote(Specifier), [[^a-zA-Z0-9_]], []))
- AC_CACHE_CHECK([whether ${FC} supports OPEN specifier ]m4_quote(Specifier),
- [ac_cv_fc_spec_]mungedspec,
- [AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],
- [ OPEN(UNIT=99,]m4_if(m4_bregexp(m4_quote(Specifier), [\/dev/null; then
- ac_cv_fc_literal_backslash=yes
- else
- ac_cv_fc_literal_backslash=no
- fi],
- [AC_MSG_WARN([cannot compile a program with backslashes!])
- ac_cv_fc_literal_backslash=unknown])
- AC_LANG_POP([Fortran])])
- if test $ac_cv_fc_literal_backslash = yes; then
- AC_DEFINE([FC_LITERAL_BACKSLASH], 1,
- [Define to 1 if the Fortran compiler interprets '\\' as a pair of characters, not one])
- fi
-])# AC_FC_LITERAL_BACKSLASH
-
-# AC_FC_MOD_PATH_FLAG
-# -------------------------
-# Check which flag is necessary to alter the compiler's search path
-# for module files.
-# This obviously requires that the compiler has some notion of
-# module files as separate from object files and some sensible
-# method of altering its search path. This will therefore not work
-# on early Cray F90 compilers, or on v5 (and 6?) of ifc.
-#
-# Nearly every compiler I have found uses -Ipath for this purpose;
-# Sun F95 v7.1 (at least), uses -Mpath
-# Lahey uses -mod, but it needs to be called as -mod .\; in order
-# to work properly. (so that module files still get written to
-# the current directory.
-# Absoft uses -p (with compulsory space after)
-#
-AC_DEFUN([AC_FC_MOD_PATH_FLAG],[
- _AC_FORTRAN_ASSERT
- AC_REQUIRE([AC_PROG_FC])
- ac_cv_fc_mod_path_flag=no
- AC_MSG_CHECKING([for flag to alter module search path])
- mkdir conftestdir
- cd conftestdir
- cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
-_ACEOF
- _AC_EVAL_STDERR($ac_compile)
- cd ..
- for i in /I -I -M "-mod .\;" "-p "; do
- if test "$ac_cv_fc_mod_path_flag" = "no"; then
- FCFLAGS_save=$FCFLAGS
- FCFLAGS="$FCFLAGS ${i}conftestdir"
- AC_COMPILE_IFELSE([
- subroutine test
- use conftest
- implicit none
- i = 0
- end subroutine test
-],
- [FC_MOD_FLAG=$i; ac_cv_fc_mod_path_flag=$i],
- [:])
- fi
- FCFLAGS=$FCFLAGS_save
- done
- AC_MSG_RESULT([$ac_cv_fc_mod_path_flag])
- rm -rf conftestdir
- AS_IF([test "$ac_cv_fc_mod_path_flag" != "no"],
- [$1],
- [m4_default([$2],[AC_MSG_ERROR([Cannot find flag to alter module search path])])])
- AC_SUBST(FC_MOD_FLAG)
-])# AC_FC_MOD_PATH_FLAG
-
-# -------------------------------------- #
-# Feature tests for Preprocessed Fortran #
-# -------------------------------------- #
-
-
-# ------------------------------------------#
-# Some test programs for different features #
-# ------------------------------------------#
-
-# _AC_LANG_PROGRAM_FPP_SIMPLE
-# ---------------------------
-# The minimum test program - any compiler supporting
-# preprocessing should handle this
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_SIMPLE],
- [AC_LANG_PROGRAM([@%:@define OK], [dnl
-#ifndef OK
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_SIMPLE
-
-
-# _AC_LANG_PROGRAM_FPP_ONLY
-# ---------------------------
-# Test program for pure preprocessing
-# Note that other macros test for literal strings within this, so check
-# for those if you have to change anything here.
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_ONLY],
- [AC_LANG_PROGRAM([@%:@define OK], [dnl
-#ifdef OK
- REAL A
-#else
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_ONLY
-
-
-# _AC_LANG_PROGRAM_FPP_D
-# ---------------------------
-# Like _AC_LANG_PROGRAM_FPP_SIMPLE, but OK is passed via -D switch
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_D],
-[AC_LANG_PROGRAM([],[
-#ifndef OK
- syntax error
-#endif
-])])#_AC_LANG_PROGRAM_FPP_D
-
-
-# _AC_LANG_PROGRAM_FPP_I
-# ---------------------------
-# Test for #include statement
-# If unsupported, this should give a type error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_I],
-[AC_LANG_PROGRAM([],[
- IMPLICIT CHARACTER (c)
-! Comments in test programs should be freeform compliant just in case.
-! conftest.inc contains the Fortran statement "REAL cc"
-#include "conftest.inc"
- cc=1.
-])])#_AC_LANG_PROGRAM_FPP_I
-
-
-# _AC_LANG_PROGRAM_FPP_SUBS
-# ---------------------------
-# Test whether cpp symbols are expanded in Fortran code lines
-# If not, this should give a type error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_SUBS],
-[AC_LANG_PROGRAM([
-#define NM xxxx
-], [ IMPLICIT CHARACTER (n)
- REAL xxxx
- NM=1.
-])])#_AC_LANG_PROGRAM_FPP_SUBS
-
-
-# _AC_LANG_PROGRAM_FPP_WRAP
-# ---------------------------
-# Test whether preprocessor breaks lines that become too long due
-# to macro substitution.
-# If not, this gives an "unterminated character constant" error
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_WRAP],
-[AC_LANG_PROGRAM([
-#define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
-],[ CHARACTER*80 A
- A=LONG
-])])#_AC_LANG_PROGRAM_FPP_WRAP
-
-
-# _AC_LANG_PROGRAM_FPP_CSTYLE
-# ---------------------------
-# Test program for C style comments
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_CSTYLE],
-[AC_LANG_PROGRAM([],[
- A=1. /* C-style comment */
-])])#_AC_LANG_PROGRAM_FPP_CSTYLE
-
-# _AC_LANG_PROGRAM_FPP_CXXSTYLE
-# ---------------------------
-# Test program for C++ style comments
-AC_DEFUN([_AC_LANG_PROGRAM_FPP_CXXSTYLE],
-[
- PROGRAM MAIN
- CHARACTER*10 C
- C = "abcde" // "fghij"; END PROGRAM
-]
-)#_AC_LANG_PROGRAM_FPP_CXXSTYLE
-
-# ----------------#
-# Internal macros #
-# ----------------#
-
-
-# _AC_PROG_FPP_FEATURES ([feature list])
-# --------------------------------------
-# Parse the feature list from configure.in
-AC_DEFUN([_AC_PROG_FPP_FEATURES],
-[# defaults for needed features
-ac_fpp_need_d=yes
-ac_fpp_need_i=yes
-ac_fpp_need_subs=no
-ac_fpp_need_wrap=no
-ac_fpp_need_cstyle=no
-ac_fpp_need_CSTYLE=no
-ac_fpp_need_cxxstyle=yes
-ac_fpp_need_CXXSTYLE=no
-for _t in $1 nil
-do
- case $_t in
- define) ac_fpp_need_d=yes ;;
- nodefine) ac_fpp_need_d=no ;;
- include) ac_fpp_need_i=yes ;;
- noinclude) ac_fpp_need_i=no ;;
- substitute) ac_fpp_need_subs=yes ;;
- nosubstitute) ac_fpp_need_subs=no ;;
- wrap) ac_fpp_need_wrap=yes ;;
- nowwrap) ac_fpp_need_wrap=no ;;
- cstyle) ac_fpp_need_cstyle=yes ;;
- nocstyle) ac_fpp_need_cstyle=no ;;
- CSTYLE) ac_fpp_need_CSTYLE=yes ;;
- noCSTYLE) ac_fpp_need_CSTYLE=no ;;
- cxxstyle) ac_fpp_need_cxxstyle=yes ;;
- nocxxstyle) ac_fpp_need_cxxstyle=no ;;
- CXXSTYLE) ac_fpp_need_CXXSTYLE=yes ;;
- noCXXSTYLE) ac_fpp_need_CXXSTYLE=no ;;
- nil) ;;
- esac
-done
-# Wrapping requires substitution
-test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes
-# Both CSTYLE and cstyle cannot be requested
-# CSTYLE has precedence, since if it is not fulfilled,
-# compile errors may arise
-test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no
-dnl Similarly for cxxstyle
-test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no
-])# _AC_PROG_FPP_FEATURES
-
-
-# _AC_TEST_FPP_FIXED ([command])
-# ------------------------
-# A helper macro to test correct fpp behaviour
-# It sets ac_cv_prog_fpp and ac_fpp_out
-AC_DEFUN([_AC_TEST_FPP_FIXED],
-[rm -f conftest*
-cat >conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-ac_fpp_command=$1
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f
- ac_fpp_fixed_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_fixed_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_fixed=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- fi
-fi
-rm -f conftest*
-])# _AC_TEST_FPP_FIXED
-
-# _AC_TEST_FPP_FREE ([command])
-# ------------------------
-# A helper macro to test correct fpp behaviour
-# It sets ac_cv_prog_fpp and ac_fpp_out
-AC_DEFUN([_AC_TEST_FPP_FREE],
-[rm -f conftest*
-ac_ext_tmp=$ac_ext
-ac_ext=F90
-cat >conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-ac_fpp_command=$1
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f90 >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f90
- ac_fpp_free_out=
- ac_fpp_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_free_out=' > conftest.f90'
-# Note that the CPP tests only use fixed format
-# so we need to use a .f extension to make the tests
-# work.
- ac_fpp_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_free=$ac_fpp_command
- ac_cv_prog_fpp=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- ac_cv_prog_fpp=
- fi
-fi
-rm -f conftest*
-ac_ext=$ac_ext_tmp
-])# _AC_TEST_FPP_FREE
-
-
-# _AC_PROG_FPP
-# ------------
-# Try to figure out how to preprocess .F files for use with the selected
-# Fortran compiler
-#
-# Must be run after _AC_PROG_FC_CPP
-AC_DEFUN([_AC_PROG_FPP],
-[AC_REQUIRE([_AC_PROG_FC_CPP])dnl
-AC_CACHE_CHECK([how to preprocess Fortran files], ac_cv_prog_fpp,
-[ac_cv_prog_fpp=
-AC_LANG_ASSERT(Preprocessed Fortran)
-
-# Let the user specify FPP
-if test -n "$FPP"; then
- _AC_TEST_FPP_FREE([$FPP])
- if test -z "$ac_cv_prog_fpp"; then
- AC_MSG_WARN([user-specified \$FPP ($FPP) does not work])
- FPP=
- fi
-fi # test -n "$FPP"
-
-# This next should never happen. We don't call this macro
-# if we can already preprocess. If we do find ourselves here, then
-# something has gone badly wrong -- fail before we do some damage.
-if test -z "$ac_cv_prog_fpp" && test $ac_fpp_ok = yes; then
- # Ooops...
- AC_MSG_ERROR([Assertion failure: in _A@&t@C_PROG_FPP when we shouldn't be!])
-fi
-
-# FIXME: should we bother testing for FC+flag preprocessing?
-
-if test -z "$ac_cv_prog_fpp"; then
-# Either the Fortran compiler can't handle cpp, or doesn't have all the
-# features, or can't be used for pure preprocessing.
-# We must find another way for preprocessing.
-# We try the "best" preprocessors first. We know that $FC can't preprocess
-# by itself, but there is a small chance that F77 can be persuaded to
-# preprocess, so we try that.
-# FIXME: The comment above does not agree with the code below - $FC etc.
-# is being checked late, not early?
- for ac_j in 'fpp' "$CPP -x f95-cpp-input" "$CPP -x f77-cpp-input" \
- "$CPP -C -x c" "$CPP -x c" "$CPP" 'cpp' '/lib/cpp' '/usr/ccs/lib/cpp' \
- 'g77 -E' '$CC -E -x f95-cpp-input' '$CC -E -x f77-cpp-input' \
- '$CC -E -x c -C' '$CC -E -x c' '$CC -E' \
- "$FC -F" "$FC -E" "$F77 -F" "$F77 -E" ; do
- _AC_TEST_FPP_FREE([$ac_j])
- test -n "$ac_cv_prog_fpp" && break;
- done
-fi # test -z "$ac_cv_prog_fpp"
-
-if test -z "$ac_cv_prog_fpp"; then
- # This is only fatal if direct compilation doesn't work either
- # but we're only here if direct compilation didn't work.
- AC_MSG_ERROR([cannot find a working Fortran preprocessor])
-fi
-])
-AC_CACHE_CHECK([how to redirect $ac_cv_prog_fpp output],
- ac_cv_fpp_out,
- [ac_cv_fpp_out=$ac_fpp_out])
-FPP=$ac_cv_prog_fpp
-ac_fpp_out=$ac_cv_fpp_out
-])# _AC_PROG_FPP
-
-
-# _AC_PROG_FPP_P
-# --------------
-# Check whether we need to give FPP the -P option, to get it to
-# produce code which FC can read.
-AC_DEFUN([_AC_PROG_FPP_P],
-[AC_CACHE_CHECK([whether $FPP needs the -P option],
-ac_cv_prog_fpp_p,
-[ac_cv_prog_fpp_p=unknown
-AC_LANG_ASSERT(Preprocessed Fortran)
-# This will only be called from AC_PROG_FPP, and as such, the
-# extension *will* be .F90.
-ac_ext=F90
-cat > conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_ONLY
-_ACEOF
-
-AC_LANG_PUSH(Fortran)
-ac_ext=F90 # previous line will have reset this
-# We must not fail, here, in the case where the filesystem is
-# case-insensitive, so that conftest.F and conftest.f are the same
-# file.
-if test -n "$ac_fpp_out"; then
- # If $ac_fpp_out is non-null, then preprocessor output goes to
- # stdout, which we send to conftest.f _without_ immediately clobbering
- # the input file as it is being read. We do clobber it in the
- # end, however, which is why we copy .FPP_SRC_EXT to .$FPP_SRC_EXT
- # each time.
- ac_tmp='>conftest.tmp && mv conftest.tmp conftest.f90'
-else
- # conftest.F is preprocessed directly to conftest.f. We can
- # assume that the filesystem is case-sensitive, since otherwise
- # this compiler/preprocessor would be simply non-functional on
- # this platform.
- ac_tmp=
-fi
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_tmp"
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.f90 $LIBS'
-
-if AC_TRY_EVAL(ac_cmd) &&
- AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -P"
- if AC_TRY_EVAL(ac_cmd) &&
- AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=-P
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-AC_LANG_POP(Fortran)dnl
-])
-if test "x$ac_cv_prog_fpp_p" = "xunknown"; then
- AC_MSG_ERROR([$FPP cannot produce code that $FC compiles])
-else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_p"
-fi
-])# _AC_PROG_FPP_P
-
-# _AC_PROG_FPP_CSTYLE
-# -------------------
-# Check whether FPP lets C-style comments through to FC
-AC_DEFUN([_AC_PROG_FPP_CSTYLE],
-[AC_CACHE_CHECK([how to pass C-style comments to $FC],
- ac_cv_prog_fpp_cstyle,
-[ac_cv_prog_fpp_cstyle=unknown
-AC_LANG_ASSERT(Preprocessed Fortran)
-cat > conftest.$ac_ext << \_ACEOF
-_AC_LANG_PROGRAM_FPP_CSTYLE
-_ACEOF
-
-AC_LANG_PUSH(Fortran)
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
-if AC_TRY_EVAL(ac_cmd) &&
- cat conftest.f | grep '[[*]]/.*[[*]]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- ac_name=`expr "x$FPP" : 'x\(fpp\)'`
- if test "x$ac_name" = xfpp; then
- ac_flag="-c_com=no"
- else
- ac_flag="-C"
- fi
- FPPFLAGS="$FPPFLAGS $ac_flag"
- ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
- if AC_TRY_EVAL(ac_cmd) &&
- cat conftest.f | grep '/[[*]].*[[*]]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=$ac_flag
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-AC_LANG_POP(Fortran)dnl
-])
-if test "x$ac_cv_prog_fpp_cstyle" = "xunknown"; then
- AC_MSG_WARN([cannot find a way to make $FPP pass C-style comments])
-else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_cstyle"
-fi
-])# _AC_PROG_FPP_CSTYLE
-
-
-# _AC_PROG_FC_CPP
-# ---------------
-# This macro checks whether the chosen preprocessing method
-# has all the requested features.
-#
-# This macro must be called with $ac_fc_testing_fpp set to either
-# direct or indirect; it behaves differently accordingly.
-#
-#FIXME: this is only for fixed form code. Need a separate check for free-form.
-#
-# NB We are definitely using a suffix of .F in this case. If the filesystem
-# is case-insensitive, we may need to force preprocessing.
-#
-# Sets ac_fpp_ok to "no" if a requested feature is unavailable
-#
-AC_DEFUN([_AC_PROG_FC_CPP],
-[ac_fpp_ok=yes
-ac_prog_fc_cpp=no
-ac_prog_fc_cpp_d=no
-ac_prog_fc_cpp_i=no
-ac_prog_fc_cpp_subs=no
-ac_prog_fc_cpp_wrap=no
-ac_prog_fc_cpp_CSTYLE=no
-ac_prog_fc_cpp_cxxstyle=no
-
-AC_LANG_ASSERT(Preprocessed Fortran)
-AC_MSG_CHECKING([for fixed form Fortran preprocessor features])
-
-if test $ac_fc_testing_fpp = direct; then
-# On nearly all systems where direct compilation is possible, a .F file will
-# compile a preprocessable fixed-form file automatically. However,
-# case-insensitive filesystems (eg HFS+ on MacOSX) may get confused.
-# Therefore, we must check for cpp flags.
- _AC_FPP_FIXEDFORM_F
- if test "x$ac_cv_fpp_fixedform_F" != x; then
- ac_prog_fc_cpp=yes
- else
- ac_fpp_ok=no
- fi
-
-# It is possible we've failed the previous test because of a
-# Tru64 bug where the compiler fails when called as 'f95' on
-# a .F file. It works when called as f90.
-#FIXME: this does not protect the user's setting of FC, though
-# we set it back if senesible.
- if test $ac_prog_fc_cpp = no && test $FC = f95; then
- FC=f90
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_SIMPLE],
- [ac_prog_fc_cpp=yes],
- [])
- if test $ac_prog_fc_cpp = no; then
- FC=f95
- ac_fpp_ok=no
- fi
- fi
-
- ac_first_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_fixed_F"
-fi
-
-# We need to skip the following tests if we're trying direct compilation
-# and FC won't preprocess.
-if test $ac_prog_fc_cpp = yes || test $ac_fc_testing_fpp = indirect; then
-
- if test $ac_fpp_need_d = yes; then
-# Nearly everyone uses -D. XLF uses -WF,-D. Ifort on Windows uses /D
- ac_prog_fc_cpp_d=no
- ac_save_FPPFLAGS=$FPPFLAGS
- for fpp_flag_try in "-D" "-WF,-D" "/D"; do
- FPPFLAGS="$FPPFLAGS $fpp_flag_try""OK"
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_D],
- [ac_prog_fc_cpp_d=yes; FPPFLAGS_DEF="$fpp_flag_try"],
- [:])
- FPPFLAGS=$ac_save_FPPFLAGS
- done
- if test $ac_prog_fc_cpp_d = no; then
- ac_fpp_ok=no
- fi
- fi
-#FIXME we should probably do the AC_SUBST somewhere else.
- AC_SUBST(FPPFLAGS_DEF)
-
- if test $ac_fpp_need_i = yes; then
- rm -rf conftst
- mkdir conftst
- cat > conftst/conftest.inc << \_ACEOF
-! This statement overrides the IMPLICIT statement in the program
- REAL cc
-_ACEOF
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -Iconftst"
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_I],
- [ac_prog_fc_cpp_i=yes],
- [ac_fpp_ok=no])
- rm -rf conftst
- FPPFLAGS=$ac_save_FPPFLAGS
- fi
-
- if test $ac_fpp_need_subs = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_SUBS],
- [ac_prog_fc_cpp_subs=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_WRAP],
- [ac_prog_fc_cpp_wrap=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_CSTYLE = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_CSTYLE],
- [ac_prog_fc_cpp_CSTYLE=yes],
- [ac_fpp_ok=no])
- fi
-
- if test $ac_fpp_need_cxxstyle = yes; then
- AC_LINK_IFELSE([_AC_LANG_PROGRAM_FPP_CXXSTYLE],
- [ac_prog_fc_cpp_cxxstyle=yes],
- [ac_fpp_ok=no])
- fi
-
-fi
-if test $ac_fc_testing_fpp = direct; then
- FPPFLAGS=$ac_first_save_FPPFLAGS
-fi
-
-rm -f conftest.*
-
-AC_MSG_RESULT([done.])
-])#_AC_PROG_FC_CPP
-
-
-# _AC_FPP_BUILD_RULE
-# ------------------
-# Figure out how to build from cpp/Fortran sources
-#
-# If we need to use a separate preprocessor, we must override make's
-# `direct' .F.o rule in order to do `indirect' compilation
-# (.F -> .f then .f -> .o).
-#
-# Configure variables set here are as follows. The items in this list
-# are suffixed with `[direct]', `[indirect]' or `[both]'. In the
-# first two cases, the variable has a useful value only in the given
-# mode, and an unspecified, and therefore unreliable, value in the
-# other; in the last, it has a value in both modes.
-#
-# FPP [indirect]
-# The name of a suitable preprocessor.
-#
-# FPP_COMPILE_EXT [both]
-# This contains the file extension which the Fortran compiler will
-# accept as containing source not to be preprocessed. It is most
-# typically 'f' (the default), but could be different if set by a
-# call to AC_FPP_(FIXED|FREE)FORM.
-#
-# FPP_PREPROCESS_EXT [both]
-# The partner of FPP_COMPILE_EXT, containing the file extension
-# which is taken to indicate Fortran source to be preprocessed.
-# The default is 'F', but could be different if set by a
-# call to AC_FPP_(FIXED|FREE)FORM.
-#
-# FPP_MAKE_FLAGS [direct]
-# This is used to include CPP/FPP related flags into the compiler
-# call if we compile directly, and leave them out otherwise.
-#
-# FPP_OUTPUT [both]
-# This is used to redirect FPP output to the .f file in those
-# cases where FPP writes to stdout rather than to a file. It is
-# defined as either "" or ">$@".
-#
-# FPPDIRECT_TRUE, FPPDIRECT_FALSE [both]
-# If the macro decides that we must use `direct' mode, then it
-# sets FPPDIRECT_TRUE to be blank, and FPPDIRECT_FALSE to be '#',
-# or vice versa if we are to use `indirect' mode. These may be
-# used within a Makefile.in as follows:
-# @FPPDIRECT_TRUE@.@FPP_PREPROCESS_EXT@.o:
-# @FPPDIRECT_TRUE@ $(PPFCCOMPILE) -c -o $@ $<
-# @FPPDIRECT_FALSE@.@FPP_PREPROCESS_EXT@.@FPP_COMPILE_EXT:
-# @FPPDIRECT_FALSE@ $(FPP) $(DEFS) ... $< @FPP_OUTPUT@
-# If you use automake, then you may possibly recognise that as an
-# automake conditional (which is predeclared, so you do not need
-# to include AM_CONDITIONAL(FPPDIRECT, ???) in your configure.ac),
-# which might be used more straightforwardly in your Makefile.am
-# as follows:
-# if FPPDIRECT
-# .@FPP_PREPROCESS_EXT@.o:
-# $(PPFCCOMPILE) -c -o $@ $<
-# else !FPPDIRECT
-# .@FPP_PREPROCESS_EXT@.@FPP_COMPILE_EXT:
-# $(FPP) $(DEFS) ... $< @FPP_OUTPUT@
-# endif !FPPDIRECT
-#
-# These are used in Automake's lang_ppfc_finish subroutine.
-#
-# NOTE 1: There would seem to be a problem here with the use of .F as
-# the extension for preprocessed files. On case-insensitive
-# filesystems such as HFS+, as used on MacOS X, foo.F and foo.f are
-# the same file. This means that indirect compilation would lose badly, since
-# converting foo.F to foo.f would clobber the original. This is
-# probably not a problem in practice, since the compilers (g77, gfortran,
-# nag, and xlf) actually likely to be used on OS X -- which is a
-# recent platform, and thus with only recent Fortrans on it -- can all
-# do direct compilation of preprocessable Fortran. Just in case, we
-# check below whether we are in this fatal situation, and collapse
-# noisily if necessary.
-#
-# NOTE 2: Martin Wilck's original version of these macros noted that it
-# was necessary to generate explicit rules for .F -> .o compilations
-# in order to override make's builtin rules in a portable manner
-# (i.e. without using make extensions). Not all makes do chains of
-# implicit rules, so we cannot depend on .F.f, .f.o rules generating
-# a .f file. We need unified .F.o and .F.lo rules, but that's
-# complicated, an alternative is to name the intermediary .f files in
-# the Makefiles. Again, this may not be much of a problem in fact,
-# since the main culprit seems to be Solaris make, but Solaris f77
-# can do direct compilation, so that the issue of chaining rules
-# doesn't arise.
-#
-# NOTE 3: POSIX/Single-Unix states that inference rules can be
-# redefined, and there's no warning against this in Autoconf's section
-# on `Limitations of Make'.
-#
-# NOTE 4: FPP_OUTPUT is set to either "" or ">$@". The latter is OK
-# in an implicit rule, but will potentially lose in an explicit rule,
-# since POSIX does not require that $@ is defined in such a rule, and
-# there are still a few makes which do not define it in that context.
-# As with Note 1, however, this is probably more a theoretical problem
-# than a practical one.
-#
-AC_DEFUN([_AC_FPP_BUILD_RULE],
-[# FPP is defined by this stage. If the processing mode is 'direct', then
-# this will almost certainly be defined as blank, but we should make no
-# committments to this in the documentation, in case we want to change
-# our minds about that in future.
-AC_SUBST(FPP)
-
-# Default the FPP_PREPROCESS_EXT and FPP_COMPILE_EXT to the most usual ones
-FPP_PREPROCESS_EXT=F
-FPP_COMPILE_EXT=f
-
-# Switch on the processing mode, direct/indirect, which has been determined
-# in AC_PROG_FPP before this macro is called. The FPPDIRECT_(TRUE|FALSE)
-# variables implement an automake (configure-time) conditional, which is
-# created, not through an invocation of AM_CONDITIONAL, but implicitly
-# within automake.in (qv).
-if test $ac_cv_fpp_build_rule = direct; then
- # The simple case: the chosen Fortran compiler can handle preprocessing,
- # so we don't need a separate preprocessing stage.
- FPPDIRECT_TRUE=
- FPPDIRECT_FALSE='#'
- # The flags here are those included in the 'compile' field of the
- # 'ppfc' language in automake.in, minus the {AM_,}FCFLAGS variables.
- # It's not _absolutely_ guaranteed that these are the correct ones,
- # and I (NG) would be open to argument about adding both {AM_,}CPPFLAGS and
- # {AM_,}FCFLAGS, but this set appears to work.
- FPP_MAKE_FLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)'
-else
- FPPDIRECT_TRUE='#'
- FPPDIRECT_FALSE=
- FPP_MAKE_FLAGS=
-fi
-
-if test -z "$ac_fpp_out"; then
- FPP_OUTPUT=" "
-else
- FPP_OUTPUT=">\[$]@"
-fi
-
-AC_SUBST(FPPDIRECT_TRUE)
-AC_SUBST(FPPDIRECT_FALSE)
-AC_SUBST(FPP_MAKE_FLAGS)
-AC_SUBST(FPP_PREPROCESS_EXT)
-AC_SUBST(FPP_COMPILE_EXT)
-AC_SUBST(FPP_OUTPUT)
-])# _AC_FPP_BUILD_RULE
-
-
-# _AC_FC_CHECK_CIFS
-# -----------------
-# Check whether the filesystem is case-insensitive (eg, HFS+ on
-# MacOS X). Set ac_cv_fc_cifs=yes if so.
-AC_DEFUN([_AC_FC_CHECK_CIFS],
- [AC_CACHE_CHECK([whether the filesystem is case-insensitive],
- ac_cv_fc_cifs,
- [rm -f conftest.*
- echo wibble >conftest.F
- if test -f conftest.f && test "`cat conftest.f`" = wibble; then
- ac_cv_fc_cifs=yes
- else
- ac_cv_fc_cifs=no
- fi
-])])# _AC_FC_CHECK_CIFS
-
-
-
-# -----------------------
-# User macros
-# -----------------------
-
-# AC_PROG_FPP([required features])
-# --------------------------------------------------
-#
-# [required features] is a space-separated list of features that the Fortran
-# preprocessor must have for the code to compile.
-# It is up to the package maintainer to properly set these requirements.
-#
-# This macro will find out how to compile a preprocessable fixed-form
-# file, with a .F file extension. To the best of my knowledge, such a
-# file is compilable everywhere (albeit flags may be needed on
-# case-insensitive filesystems)
-#
-# This macro should be followed by calling AC_FPP_FIXEDFORM([.srcext])
-# and AC_FPP_FREEFORM([.srcext]) as appropriate for whichever source
-# extensions are used in the user's project.
-#
-# This will fail to give the correct result when fixed-format files may be
-# preprocessed directly by the compiler, but free-format ones
-# may not.
-#
-# Supported features are:
-#
-# include : correctly process #include directives and -I
-# define : correctly process -D
-# substitute: substitute macros in Fortran code
-# (some preprocessors touch only lines starting with #)
-# wrap : wrap lines that become too long through macro substitution
-# fpp is probably the only preprocessor that does this.
-# cstyle : Do not suppress C style comments (-C option in cpp)
-# CSTYLE : *Do* suppress C style comments
-# (e.g. code contains C-style comments, and compiler may not
-# know how to handle them)
-# cxxstyle : Do not suppress C++ style comments (default)
-# CXXSTYLE : *Do* suppress C++ style comments (seems unlikely, but in here
-# for completeness
-#
-# Features can be abbreviated: i, in, inc etc. are equivalent to include.
-# Features can be deselected (feature not needed) by prepending "no",
-# e.g. nodef (=nodefine), now (=nowrap).
-#
-# Default for the feature list is
-# [include define substitute nowrap nocstyle noCSTYLE cxxstyle]
-# Feature requirements corresponding to the defaults may be omitted
-#
-# Note that "wrap" implies "substitute", and CSTYLE and cstyle cannot
-# be requested at the same time. The macro adjusts this automatically.
-#
-# This macro sets and substitutes the variables FPP and FPPFLAGS, and
-# causes to be set FPP_OUTPUT, FPP_MAKE_FLAGS, and FPP_COMPILE_EXT
-# (actually set in macro _AC_FPP_BUILD_RULE)
-#
-# The macro depends on both FC and CPP, because we must possibly fall
-# back on CPP for preprocessing.
-#
-# We presume that there is no preprocessing dependence on the language
-# variant, so that a preprocessor will handle free-form F9x as happily as
-# fixed-form F77.
-#
-AC_DEFUN([AC_PROG_FPP],
-[AC_REQUIRE([AC_PROG_FC])dnl
-dnl We are not going to use AC_REQUIRE(AC_PROG_CPP) here for
-dnl two reasons:
-dnl 1) we don't really need to if FC will preprocess itself
-dnl 2) we can't pass in an optional parameter to change the
-dnl default CPP search order, which we need to.
-dnl AC_REQUIRE([AC_PROG_CPP([cpp])])dnl
-
-# Prefer AC_PROG_FC to AC_PROG_F77
-if test "X$F77" != X; then
- AC_MSG_WARN([Use A@&t@C_PROG_FC with A@&t@C_PROG_FPP, instead of A@&t@C_PROG_F77])
-fi
-
-AC_ARG_VAR([FPP], [Command to preprocess Fortran code])
-AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor])
-# Set up ac_fpp_need_* flags based on features in $1
-_AC_PROG_FPP_FEATURES([$1])
-
-# We first try to use FC for compiling the source directly
-# into object files
-ac_fpp_compile='${FC-fc} -c $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_fpp_link='${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
-
-AC_LANG_PUSH(Preprocessed Fortran)
-FPP_SRC_EXT=F
-
-# _AC_PROG_FC_CPP does the actual feature tests, storing results of the
-# checks in non-cv variables like ac_prog_fc_cpp_*, which we copy to cv
-# variables afterwards. This allows this macro to be reusable for other
-# cv variables (see below)
-ac_fc_testing_fpp=direct
-_AC_PROG_FC_CPP
-
-AC_CACHE_CHECK([whether $FC compiles programs with cpp directives],
- ac_cv_prog_fc_cpp,
- [ac_cv_prog_fc_cpp=$ac_prog_fc_cpp])
-
-if test $ac_prog_fc_cpp = yes; then
-
- if test $ac_fpp_need_d = yes; then
- AC_CACHE_CHECK([whether $FC accepts -D],
- ac_cv_prog_fc_cpp_d,
- [ac_cv_prog_fc_cpp_d=$ac_prog_fc_cpp_d])
- fi
-
- if test $ac_fpp_need_i = yes; then
- AC_CACHE_CHECK([whether $FC accepts -I],
- ac_cv_prog_fc_cpp_i,
- [ac_cv_prog_fc_cpp_i=$ac_prog_fc_cpp_i])
- fi
-
- if test $ac_fpp_need_subs = yes; then
- AC_CACHE_CHECK([whether $FC substitutes macros in Fortran code],
- ac_cv_prog_fc_cpp_subs,
- [ac_cv_prog_fc_cpp_subs=$ac_prog_fc_cpp_subs])
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- AC_CACHE_CHECK([whether $FC wraps long lines automatically],
- ac_cv_prog_fc_cpp_wrap,
- [ac_cv_prog_fc_cpp_wrap=$ac_prog_fc_cpp_wrap])
- fi
-
-# Don't need to test if $FC removes C++ comments - that
-# way madness lies.
-
-fi # test $ac_prog_fc_cpp = yes
-
-AC_CACHE_CHECK([whether $FC fulfils requested features],
- ac_cv_prog_fc_cpp_ok,
- [ac_cv_prog_fc_cpp_ok=$ac_fpp_ok])
-
-# Keep the user informed
-AC_MSG_CHECKING([preprocessing mode we may therefore use])
-
-# If so, we don't need to go any further.
-if test $ac_fpp_ok = yes; then
- ac_cv_fpp_build_rule=direct
- AC_MSG_RESULT([direct])
-else
-# indirect compilation
- AC_MSG_RESULT([indirect])
-
-# Now we check how to invoke a preprocessor that outputs Fortran code
-# that FC can understand
-#FIXME: in a joint C/Fortran project, CPP might have already
-# been defined. Here we are potentially (probably) redefining it.
-# I don't think this matters. Not sure, though.
-# In that case, AC_SUBST has already been called on CPP.
-# We don't want to fail if we can't find cpp - we might be able
-# to fall back on fpp.
-#FIXME: actually, we should just prefer cpp to $CPP
- AC_PROG_CPP([cpp],[],[])
-# The next macro sets FPP (unless already set by the user)
-_AC_PROG_FPP
-_AC_PROG_FPP_P
-
-# Before we go any further, check that we're not courting disaster,
-# here, by using indirect compilation (.F -> .f -> .o) on a
-# case-insensitive filesystem. If we are, there's nothing we can do
-# other than fail noisily.
-_AC_FC_CHECK_CIFS
-# Redefine the compile and link commands for indirect compilation
-if test $ac_cv_fc_cifs = yes; then
- if test "x$ac_fpp_out" = x ; then
- AC_MSG_ERROR([Confused in preprocessing on case-insensitive FS - please report to tow@uszla.me.uk])
- fi
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext > conftest.cpp.f && ${FC-fc} -c $FCFLAGS -o conftest.o conftest.cpp.f >&AS_MESSAGE_LOG_FD; rm conftest.cpp.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT > conftest.cpp.f && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.cpp.f $LIBS >&AS_MESSAGE_LOG_FD; rm conftest.cpp.f'
-else
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext '"$ac_fpp_out"' && ${FC-fc} -c $FCFLAGS conftest.f >&AS_MESSAGE_LOG_FD; rm conftest.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT '"$ac_fpp_out"' && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.f $LIBS >&AS_MESSAGE_LOG_FD; rm conftest.f'
-fi
-
- ac_compile=$ac_fpp_compile
- ac_link=$ac_fpp_link
-# Redo all the feature checks for indirect compilation.
- ac_fc_testing_fpp=indirect
- _AC_PROG_FC_CPP
-
-if test $ac_fpp_need_d = yes; then
- AC_CACHE_CHECK([whether $FPP accepts -D],
- ac_cv_prog_fpp_d,
- [ac_cv_prog_fpp_d=$ac_prog_fc_cpp_d])
-fi
-
-if test $ac_fpp_need_i = yes; then
- AC_CACHE_CHECK([whether $FPP accepts -I],
- ac_cv_prog_fpp_i,
- [ac_cv_prog_fpp_i=$ac_prog_fc_cpp_i])
-fi
-
-if test $ac_fpp_need_subs = yes; then
- AC_CACHE_CHECK([whether $FPP substitutes macros in Fortran code],
- ac_cv_prog_fpp_subs,
- [ac_cv_prog_fpp_subs=$ac_prog_fc_cpp_subs])
-fi
-
-if test $ac_fpp_need_wrap = yes; then
- AC_CACHE_CHECK([whether $FPP wraps long lines automatically],
- ac_cv_prog_fpp_wrap,
- [ac_cv_prog_fpp_wrap=$ac_prog_fc_cpp_wrap])
-fi
-
-if test $ac_fpp_need_CSTYLE = yes; then
- AC_CACHE_CHECK([whether $FPP suppresses C-style comments],
- ac_cv_prog_fpp_CSTYLE,
- [ac_cv_prog_fpp_CSTYLE=$ac_prog_fc_cpp_CSTYLE])
-
-elif test $ac_fpp_need_cstyle = yes; then
-# It only makes sense to test this for indirect compilation,
-# i.e., if .f files are generated
- _AC_PROG_FPP_CSTYLE
-fi
-
-if test $ac_fpp_need_cxxstyle = yes; then
- AC_CACHE_CHECK([whether $FPP preserves C++-style comments],
- ac_cv_prog_fpp_cxxstyle,
- [ac_cv_prog_fpp_cxxstyle=$ac_prog_fc_cpp_cxxstyle])
-fi
-
-AC_CACHE_CHECK([whether $FPP fulfils requested features],
- ac_cv_prog_fpp_ok,
- [ac_cv_prog_fpp_ok=$ac_fpp_ok])
-
- ac_cv_fpp_build_rule=indirect
-
-if test ac_fpp_ok = no; then
- AC_MSG_ERROR([Cannot find a Fortran preprocessor with the requested features])
-fi
-
-fi # test ac_fpp_ok != yes
-
-# We have all necessary information.
-# It remains to construct optimal build rules
-# (direct: .F.o or indirect: .F.f)
-# and carry out the substitutions.
-#
-# This is the crucial bit: we switch on ac_cv_fpp_build_rule=direct/indirect,
-# setting and AC_SUBSTing the variables documented in _AC_FPP_BUILD_RULE.
-#
-# Do we actually have all the required information yet, or do we need
-# to look at AC_FC_(FIXED|FREE)FORM results also? I think we're OK:
-# if the compiler can do all the preprocessing itself, then we don't
-# have to do anything (ie, the `direct' branch should be trivial), and
-# if we have to do separate preprocessing, the processor is probably
-# (?) independent of the source language variant.
-_AC_FPP_BUILD_RULE
-
-AC_LANG_POP(Preprocessed Fortran)
-
-])# AC_PROG_FPP
diff --git a/config/m4/lang.m4 b/config/m4/lang.m4
deleted file mode 100644
index 42b9f0de..00000000
--- a/config/m4/lang.m4
+++ /dev/null
@@ -1,90 +0,0 @@
-# _AC_COMPILER_EXEEXT_DEFAULT
-# ---------------------------
-# Check for the extension used for the default name for executables.
-#
-# We do this in order to find out what is the extension we must add for
-# creating executables (see _AC_COMPILER_EXEEXT's comments).
-#
-# Beware of `expr' that may return `0' or `'. Since this macro is
-# the first one in touch with the compiler, it should also check that
-# it compiles properly.
-#
-# On OpenVMS 7.1 system, the DEC C 5.5 compiler when called through a
-# GNV (gnv.sourceforge.net) cc wrapper, produces the output file named
-# `a_out.exe'.
-m4_define([_AC_COMPILER_EXEEXT_DEFAULT],
-[# First try to determine the flag needed to name the executable
-# It is nearly always "-o" but Lahey Fortran wants "-out"
-AC_MSG_CHECKING([for linker flag to name executables])
-for ac_link_obj_flag in "/exe:" "-out " "-o "; do
-AS_IF([_AC_DO_VAR(ac_link)],
-[ac_link_obj_flag_found=yes; break],
-[:])
-done
-if test x$ac_link_obj_flag_found = x ; then
-AC_MSG_FAILURE([Could not determine flag to name executables])
-fi
-AC_MSG_RESULT([$ac_link_obj_flag])
-
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-AC_MSG_CHECKING([for _AC_LANG compiler default output file name])
-ac_link_default=`echo "$ac_link" | sed ['s/ $ac_link_obj_flag *conftest[^ ]*//']`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- _AC_COMPILER_EXEEXT_REJECT ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-AS_IF([_AC_DO_VAR(ac_link_default)],
-[# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files
-do
- test -f "$ac_file" || continue
- case $ac_file in
- _AC_COMPILER_EXEEXT_REJECT )
- ;;
- [[ab]].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-],
- [_AC_MSG_LOG_CONFTEST
-AC_MSG_FAILURE([_AC_LANG compiler cannot create executables], 77)])
-ac_exeext=$ac_cv_exeext
-AC_MSG_RESULT([$ac_file])
-])# _AC_COMPILER_EXEEXT_DEFAULT
diff --git a/config/makefile b/config/makefile
index 900a9f65..cf4a3920 100644
--- a/config/makefile
+++ b/config/makefile
@@ -6,7 +6,7 @@ M4_FILES=m4/TW_CHECK_FC_90.m4 m4/TW_CHECK_FC_95.m4 m4/TW_CHECK_FC_FPP.m4 \
m4/TW_CHECK_FC_TR15581.m4 m4/TW_FC_CHECK_ABORT.m4 \
m4/TW_FC_CHECK_FLUSH.m4 m4/TW_FC_ID.m4 m4/TW_FC_ID_FLAGS.m4 \
m4/TW_FC_KINDS.m4 m4/TW_PROG_CYGPATH_W.m4 m4/TW_FC_CHECK_EOL.m4 \
- m4/fortran.m4 m4/TW_PATH_NETCDF.m4 m4/lang.m4 \
+ m4/TW_PATH_NETCDF.m4 \
m4/TW_CHECK_ASSOCIATED_BUG.m4
../configure: configure.ac aclocal.m4
diff --git a/configure b/configure
index 4269c3e9..e764beeb 100755
--- a/configure
+++ b/configure
@@ -1,62 +1,83 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for FoX 4.1.2.
+# Generated by GNU Autoconf 2.69 for FoX 4.1.2.
#
# Report bugs to .
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -65,20 +86,19 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -89,32 +109,315 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and a.walker@ucl.ac.uk
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
fi
-done
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
-# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -128,13 +431,17 @@ else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -149,414 +456,113 @@ echo X/"$0" |
}
s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
}
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
-if as_func_ret_success; then
- :
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
else
- exitcode=1
- echo positional parameters were not saved.
+ as_ln_s='cp -pR'
fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
fi
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
+test -n "$DJDIR" || exec 7<&0 &1
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 &1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
@@ -569,7 +575,6 @@ cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='FoX'
@@ -577,115 +582,108 @@ PACKAGE_TARNAME='fox'
PACKAGE_VERSION='4.1.2'
PACKAGE_STRING='FoX 4.1.2'
PACKAGE_BUGREPORT='a.walker@ucl.ac.uk'
+PACKAGE_URL=''
ac_unique_file="README"
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+FFLAGS
+FPPFLAGS
+FC_MODEXT
+ac_empty
+FC_MODINC
+OBJSDIR
+VPATH
+CYGPATH_W
+MKDIR_P
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+LIBEXT
+DP_KIND
+SP_KIND
+BUILD_TARGETS
+FFLAGS_MPI
+RANLIB
+LINK_O_FLAG
+OBJEXT
+EXEEXT
+ac_ct_FC
+LDFLAGS
+FCFLAGS
+FC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_debug
+enable_fast
+enable_wxml
+enable_wcml
+enable_wkml
+enable_sax
+enable_dom
+enable_dummy
+'
+ ac_precious_vars='build_alias
host_alias
target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
FC
FCFLAGS
LDFLAGS
-ac_ct_FC
-EXEEXT
-OBJEXT
-FCFLAGS_free_f90
-FPP
-FPPFLAGS
-FPPFLAGS_fixed_F
-FPPFLAGS_DEF
-CC
-CFLAGS
-CPPFLAGS
-ac_ct_CC
-CPP
-FPPDIRECT_TRUE
-FPPDIRECT_FALSE
-FPP_MAKE_FLAGS
-FPP_PREPROCESS_EXT
-FPP_COMPILE_EXT
-FPP_OUTPUT
-FPPFLAGS_free_F90
-F90_RULE
-LINK_O_FLAG
-RANLIB
-FFLAGS_MPI
-BUILD_TARGETS
-SP_KIND
-DP_KIND
-LIBEXT
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-CYGPATH_W
-VPATH
-OBJSDIR
-FC_MOD_FLAG
-FC_MODEXT
-FC_MODUPPERCASE
-FFLAGS
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-FC
-FCFLAGS
-LDFLAGS
-FPP
-FPPFLAGS
-CC
-CFLAGS
-LIBS
-CPPFLAGS
-CPP'
+LIBS'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -741,8 +739,9 @@ do
fi
case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -784,13 +783,20 @@ do
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
@@ -803,13 +809,20 @@ do
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -902,4081 +915,1511 @@ do
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures FoX 4.1.2 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/fox]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of FoX 4.1.2:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-debug Compile with debugging support
- --enable-fast Compile with best known optimization flags
- --enable-wxml Compile wxml subsystem (for XML output)
- --enable-wcml Compile wcml subsystem (for CML output)
- --enable-wkml Compile wkml subsystem (for KML output)
- --enable-sax Compile SAX parser
- --enable-dom Compile dom subsystem (for DOM output)
- --enable-dummy Compile only dummy interfaces
-
-Some influential environment variables:
- FC Fortran compiler command
- FCFLAGS Fortran compiler flags
- LDFLAGS linker flags, e.g. -L if you have libraries in a
- nonstandard directory
- FPP Command to preprocess Fortran code
- FPPFLAGS Flags for the Fortran preprocessor
- CC C compiler command
- CFLAGS C compiler flags
- LIBS libraries to pass to the linker, e.g. -l
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if
- you have headers in a nonstandard directory
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to .
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-FoX configure 4.1.2
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by FoX $as_me 4.1.2, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_aux_dir=
-for ac_dir in config "$srcdir"/config; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in xlf95 lf95 f95 fort ifort ifc efc pgf95 pathf90 gfortran g95 f90 xlf90 pgf90 epcf90 g77 f77 xlf frt pgf77 fort77 fl32 af77
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_FC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$FC"; then
- ac_cv_prog_FC="$FC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-FC=$ac_cv_prog_FC
-if test -n "$FC"; then
- { echo "$as_me:$LINENO: result: $FC" >&5
-echo "${ECHO_T}$FC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$FC" && break
- done
-fi
-if test -z "$FC"; then
- ac_ct_FC=$FC
- for ac_prog in xlf95 lf95 f95 fort ifort ifc efc pgf95 pathf90 gfortran g95 f90 xlf90 pgf90 epcf90 g77 f77 xlf frt pgf77 fort77 fl32 af77
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_FC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_FC"; then
- ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_FC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_FC=$ac_cv_prog_ac_ct_FC
-if test -n "$ac_ct_FC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_FC" >&5
-echo "${ECHO_T}$ac_ct_FC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_FC" && break
-done
-
- if test "x$ac_ct_FC" = x; then
- FC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- FC=$ac_ct_FC
- fi
-fi
-
-
-# Provide some information about the compiler.
-echo "$as_me:1942:" \
- "checking for Fortran compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5
- (eval $ac_compiler --version &5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5
- (eval $ac_compiler -v &5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5
- (eval $ac_compiler -V &5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# First try to determine the flag needed to name the executable
-# It is nearly always "-o" but Lahey Fortran wants "-out"
-{ echo "$as_me:$LINENO: checking for linker flag to name executables" >&5
-echo $ECHO_N "checking for linker flag to name executables... $ECHO_C" >&6; }
-for ac_link_obj_flag in "/exe:" "-out " "-o "; do
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- ac_link_obj_flag_found=yes; break
-else
- :
-fi
-
-done
-if test x$ac_link_obj_flag_found = x ; then
-{ { echo "$as_me:$LINENO: error: Could not determine flag to name executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: Could not determine flag to name executables
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ echo "$as_me:$LINENO: result: $ac_link_obj_flag" >&5
-echo "${ECHO_T}$ac_link_obj_flag" >&6; }
-
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for Fortran compiler default output file name" >&5
-echo $ECHO_N "checking for Fortran compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ $ac_link_obj_flag *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: Fortran compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: Fortran compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the Fortran compiler works" >&5
-echo $ECHO_N "checking whether the Fortran compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run Fortran compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run Fortran compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran compiler... $ECHO_C" >&6; }
-if test "${ac_cv_fc_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_fc_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_fc_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FCFLAGS+set}
-ac_save_FFLAGS=$FCFLAGS
-FCFLAGS=
-{ echo "$as_me:$LINENO: checking whether $FC accepts -g" >&5
-echo $ECHO_N "checking whether $FC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FCFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_fc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_prog_fc_g=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FCFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_fc_g = yes; then
- if test "x$ac_cv_fc_compiler_gnu" = xyes; then
- FCFLAGS="-g -O2"
- else
- FCFLAGS="-g"
- fi
-else
- if test "x$ac_cv_fc_compiler_gnu" = xyes; then
- FCFLAGS="-O2"
- else
- FCFLAGS=
- fi
-fi
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-{ echo "$as_me:$LINENO: checking for Fortran flag needed to allow free-form source for .f90 suffix" >&5
-echo $ECHO_N "checking for Fortran flag needed to allow free-form source for .f90 suffix... $ECHO_C" >&6; }
-if test "${ac_cv_fc_freeform_f90+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_fc_freeform_f90=unknown
-ac_ext=f90
-ac_fc_freeform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none -ffree-form -FR -free "-qfree=f90" "-qfree=f90 -qsuffix=f=$ac_ext"\
- -qfree "-qfree -qsuffix=f=$ac_ext" -Mfree -Mfreeform \
- -freeform "-f free" --nfix
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag"
- cat >conftest.$ac_ext <<_ACEOF
-
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-end program
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_fc_freeform_f90=$ac_flag; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fc_freeform_FCFLAGS_save
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_freeform_f90" >&5
-echo "${ECHO_T}$ac_cv_fc_freeform_f90" >&6; }
-if test "x$ac_cv_fc_freeform_f90" = xunknown; then
- { { echo "$as_me:$LINENO: error: Cannot compile free-form source with .f90 suffix" >&5
-echo "$as_me: error: Cannot compile free-form source with .f90 suffix" >&2;}
- { (exit 77); exit 77; }; }
-else
- if test "x$ac_cv_fc_freeform_f90" != xnone; then
- FCFLAGS_free_f90="$ac_cv_fc_freeform_f90"
-
- fi
-
-fi
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+ oldincludedir=$ac_optarg ;;
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
- test -n "$ac_ct_CC" && break
-done
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
-fi
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
- ac_compiler_gnu=no
-fi
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
-int
-main ()
-{
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
-int
-main ()
-{
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
-int
-main ()
-{
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
-fi
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ esac
+done
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include
-#include
-#include
-#include
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
+test "$silent" = yes && exec 6>/dev/null
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
-# Prefer AC_PROG_FC to AC_PROG_F77
-if test "X$F77" != X; then
- { echo "$as_me:$LINENO: WARNING: Use AC_PROG_FC with AC_PROG_FPP, instead of AC_PROG_F77" >&5
-echo "$as_me: WARNING: Use AC_PROG_FC with AC_PROG_FPP, instead of AC_PROG_F77" >&2;}
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures FoX 4.1.2 to adapt to many kinds of systems.
+Usage: $0 [OPTION]... [VAR=VALUE]...
-# Set up ac_fpp_need_* flags based on features in
-# defaults for needed features
-ac_fpp_need_d=yes
-ac_fpp_need_i=yes
-ac_fpp_need_subs=no
-ac_fpp_need_wrap=no
-ac_fpp_need_cstyle=no
-ac_fpp_need_CSTYLE=no
-ac_fpp_need_cxxstyle=yes
-ac_fpp_need_CXXSTYLE=no
-for _t in nil
-do
- case $_t in
- define) ac_fpp_need_d=yes ;;
- nodefine) ac_fpp_need_d=no ;;
- include) ac_fpp_need_i=yes ;;
- noinclude) ac_fpp_need_i=no ;;
- substitute) ac_fpp_need_subs=yes ;;
- nosubstitute) ac_fpp_need_subs=no ;;
- wrap) ac_fpp_need_wrap=yes ;;
- nowwrap) ac_fpp_need_wrap=no ;;
- cstyle) ac_fpp_need_cstyle=yes ;;
- nocstyle) ac_fpp_need_cstyle=no ;;
- CSTYLE) ac_fpp_need_CSTYLE=yes ;;
- noCSTYLE) ac_fpp_need_CSTYLE=no ;;
- cxxstyle) ac_fpp_need_cxxstyle=yes ;;
- nocxxstyle) ac_fpp_need_cxxstyle=no ;;
- CXXSTYLE) ac_fpp_need_CXXSTYLE=yes ;;
- noCXXSTYLE) ac_fpp_need_CXXSTYLE=no ;;
- nil) ;;
- esac
-done
-# Wrapping requires substitution
-test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes
-# Both CSTYLE and cstyle cannot be requested
-# CSTYLE has precedence, since if it is not fulfilled,
-# compile errors may arise
-test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no
-test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no
-
-
-# We first try to use FC for compiling the source directly
-# into object files
-ac_fpp_compile='${FC-fc} -c $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS conftest.$ac_ext >&5'
-ac_fpp_link='${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FPPFLAGS $FPPFLAGS_SRCEXT $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-FPP_SRC_EXT=F
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
-# _AC_PROG_FC_CPP does the actual feature tests, storing results of the
-# checks in non-cv variables like ac_prog_fc_cpp_*, which we copy to cv
-# variables afterwards. This allows this macro to be reusable for other
-# cv variables (see below)
-ac_fc_testing_fpp=direct
-ac_fpp_ok=yes
-ac_prog_fc_cpp=no
-ac_prog_fc_cpp_d=no
-ac_prog_fc_cpp_i=no
-ac_prog_fc_cpp_subs=no
-ac_prog_fc_cpp_wrap=no
-ac_prog_fc_cpp_CSTYLE=no
-ac_prog_fc_cpp_cxxstyle=no
+Defaults for the options are specified in brackets.
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
-{ echo "$as_me:$LINENO: checking for fixed form Fortran preprocessor features" >&5
-echo $ECHO_N "checking for fixed form Fortran preprocessor features... $ECHO_C" >&6; }
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
-if test $ac_fc_testing_fpp = direct; then
-# On nearly all systems where direct compilation is possible, a .F file will
-# compile a preprocessable fixed-form file automatically. However,
-# case-insensitive filesystems (eg HFS+ on MacOSX) may get confused.
-# Therefore, we must check for cpp flags.
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
-ac_ext=F
-ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none "/fpp" "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=F" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- cat >conftest.$ac_ext <<_ACEOF
-
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
- ENDP ROGRAM
-#endif
+For better control, use the options below.
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/fox]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_fpp_fixedform_F=$ac_flag; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ cat <<\_ACEOF
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-if test "x$ac_cv_fpp_fixedform_F" = x; then
- { echo "$as_me:$LINENO: WARNING: Cannot compile fixed-form preprocessable Fortran with a .F extension." >&5
-echo "$as_me: WARNING: Cannot compile fixed-form preprocessable Fortran with a .F extension." >&2;}
-else
- if test "$ac_cv_fpp_fixedform_F" != none; then
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of FoX 4.1.2:";;
+ esac
+ cat <<\_ACEOF
- fi
-fi
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-debug Compile with debugging support
+ --enable-fast Compile with best known optimization flags
+ --enable-wxml Compile wxml subsystem (for XML output)
+ --enable-wcml Compile wcml subsystem (for CML output)
+ --enable-wkml Compile wkml subsystem (for KML output)
+ --enable-sax Compile SAX parser
+ --enable-dom Compile dom subsystem (for DOM output)
+ --enable-dummy Compile only dummy interfaces
- if test "x$ac_cv_fpp_fixedform_F" != x; then
- ac_prog_fc_cpp=yes
- else
- ac_fpp_ok=no
- fi
+Some influential environment variables:
+ FC Fortran compiler command
+ FCFLAGS Fortran compiler flags
+ LDFLAGS linker flags, e.g. -L if you have libraries in a
+ nonstandard directory
+ LIBS libraries to pass to the linker, e.g. -l
-# It is possible we've failed the previous test because of a
-# Tru64 bug where the compiler fails when called as 'f95' on
-# a .F file. It works when called as f90.
-#FIXME: this does not protect the user's setting of FC, though
-# we set it back if senesible.
- if test $ac_prog_fc_cpp = no && test $FC = f95; then
- FC=f90
- cat >conftest.$ac_ext <<_ACEOF
-#define OK
- program main
-#ifndef OK
- syntax error
-#endif
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
- end
+Report bugs to .
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- if test $ac_prog_fc_cpp = no; then
- FC=f95
- ac_fpp_ok=no
- fi
- fi
-
- ac_first_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_fixed_F"
+ac_status=$?
fi
-# We need to skip the following tests if we're trying direct compilation
-# and FC won't preprocess.
-if test $ac_prog_fc_cpp = yes || test $ac_fc_testing_fpp = indirect; then
-
- if test $ac_fpp_need_d = yes; then
-# Nearly everyone uses -D. XLF uses -WF,-D. Ifort on Windows uses /D
- ac_prog_fc_cpp_d=no
- ac_save_FPPFLAGS=$FPPFLAGS
- for fpp_flag_try in "-D" "-WF,-D" "/D"; do
- FPPFLAGS="$FPPFLAGS $fpp_flag_try""OK"
- cat >conftest.$ac_ext <<_ACEOF
-
- program main
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
-#ifndef OK
- syntax error
-#endif
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_d=yes; FPPFLAGS_DEF="$fpp_flag_try"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
- :
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- FPPFLAGS=$ac_save_FPPFLAGS
- done
- if test $ac_prog_fc_cpp_d = no; then
- ac_fpp_ok=no
- fi
- fi
-#FIXME we should probably do the AC_SUBST somewhere else.
-
-
- if test $ac_fpp_need_i = yes; then
- rm -rf conftst
- mkdir conftst
- cat > conftst/conftest.inc << \_ACEOF
-! This statement overrides the IMPLICIT statement in the program
- REAL cc
-_ACEOF
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -Iconftst"
- cat >conftest.$ac_ext <<_ACEOF
-
- program main
-
- IMPLICIT CHARACTER (c)
-! Comments in test programs should be freeform compliant just in case.
-! conftest.inc contains the Fortran statement "REAL cc"
-#include "conftest.inc"
- cc=1.
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+FoX configure 4.1.2
+generated by GNU Autoconf 2.69
- end
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_i=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
+ exit
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- rm -rf conftst
- FPPFLAGS=$ac_save_FPPFLAGS
- fi
-
- if test $ac_fpp_need_subs = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
-#define NM xxxx
-
- program main
- IMPLICIT CHARACTER (n)
- REAL xxxx
- NM=1.
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+# ac_fn_fc_try_compile LINENO
+# ---------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_fc_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_subs=yes
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_fpp_ok=no
+ ac_retval=1
fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
-#define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
-
- program main
- CHARACTER*80 A
- A=LONG
+} # ac_fn_fc_try_compile
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+# ac_fn_fc_try_link LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_fc_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_wrap=yes
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_fpp_ok=no
+ ac_retval=1
fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_CSTYLE = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
- program main
-
- A=1. /* C-style comment */
+} # ac_fn_fc_try_link
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+# ac_fn_fc_try_run LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_fc_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_CSTYLE=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_cxxstyle = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
- PROGRAM MAIN
- CHARACTER*10 C
- C = "abcde" // "fghij"; END PROGRAM
-
-
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_cxxstyle=yes
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_fpp_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
-fi
-if test $ac_fc_testing_fpp = direct; then
- FPPFLAGS=$ac_first_save_FPPFLAGS
-fi
-
-rm -f conftest.*
-
-{ echo "$as_me:$LINENO: result: done." >&5
-echo "${ECHO_T}done." >&6; }
-
-
-{ echo "$as_me:$LINENO: checking whether $FC compiles programs with cpp directives" >&5
-echo $ECHO_N "checking whether $FC compiles programs with cpp directives... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp=$ac_prog_fc_cpp
+ ac_retval=$ac_status
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp" >&6; }
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-if test $ac_prog_fc_cpp = yes; then
-
- if test $ac_fpp_need_d = yes; then
- { echo "$as_me:$LINENO: checking whether $FC accepts -D" >&5
-echo $ECHO_N "checking whether $FC accepts -D... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp_d+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp_d=$ac_prog_fc_cpp_d
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp_d" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp_d" >&6; }
- fi
+} # ac_fn_fc_try_run
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
- if test $ac_fpp_need_i = yes; then
- { echo "$as_me:$LINENO: checking whether $FC accepts -I" >&5
-echo $ECHO_N "checking whether $FC accepts -I... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp_i+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp_i=$ac_prog_fc_cpp_i
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp_i" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp_i" >&6; }
- fi
+It was created by FoX $as_me 4.1.2, which was
+generated by GNU Autoconf 2.69. Invocation command line was
- if test $ac_fpp_need_subs = yes; then
- { echo "$as_me:$LINENO: checking whether $FC substitutes macros in Fortran code" >&5
-echo $ECHO_N "checking whether $FC substitutes macros in Fortran code... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp_subs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp_subs=$ac_prog_fc_cpp_subs
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp_subs" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp_subs" >&6; }
- fi
+ $ $0 $@
- if test $ac_fpp_need_wrap = yes; then
- { echo "$as_me:$LINENO: checking whether $FC wraps long lines automatically" >&5
-echo $ECHO_N "checking whether $FC wraps long lines automatically... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp_wrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp_wrap=$ac_prog_fc_cpp_wrap
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp_wrap" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp_wrap" >&6; }
- fi
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
-# Don't need to test if $FC removes C++ comments - that
-# way madness lies.
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
-fi # test $ac_prog_fc_cpp = yes
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-{ echo "$as_me:$LINENO: checking whether $FC fulfils requested features" >&5
-echo $ECHO_N "checking whether $FC fulfils requested features... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fc_cpp_ok+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fc_cpp_ok=$ac_fpp_ok
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_cpp_ok" >&5
-echo "${ECHO_T}$ac_cv_prog_fc_cpp_ok" >&6; }
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-# Keep the user informed
-{ echo "$as_me:$LINENO: checking preprocessing mode we may therefore use" >&5
-echo $ECHO_N "checking preprocessing mode we may therefore use... $ECHO_C" >&6; }
+_ASUNAME
-# If so, we don't need to go any further.
-if test $ac_fpp_ok = yes; then
- ac_cv_fpp_build_rule=direct
- { echo "$as_me:$LINENO: result: direct" >&5
-echo "${ECHO_T}direct" >&6; }
-else
-# indirect compilation
- { echo "$as_me:$LINENO: result: indirect" >&5
-echo "${ECHO_T}indirect" >&6; }
-
-# Now we check how to invoke a preprocessor that outputs Fortran code
-# that FC can understand
-#FIXME: in a joint C/Fortran project, CPP might have already
-# been defined. Here we are potentially (probably) redefining it.
-# I don't think this matters. Not sure, though.
-# In that case, AC_SUBST has already been called on CPP.
-# We don't want to fail if we can't find cpp - we might be able
-# to fall back on fpp.
-#FIXME: actually, we should just prefer cpp to $CPP
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer to if __STDC__ is defined, since
- # exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include
-#else
-# include
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
-rm -f conftest.err conftest.$ac_ext
+} >&5
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat >&5 <<_ACEOF
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
+## ----------- ##
+## Core tests. ##
+## ----------- ##
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
+_ACEOF
- done
- ac_cv_prog_CPP=$CPP
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer to if __STDC__ is defined, since
- # exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include
-#else
-# include
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
-rm -f conftest.err conftest.$ac_ext
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
-rm -f conftest.err conftest.$ac_ext
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+ac_signal=0
-# The next macro sets FPP (unless already set by the user)
-{ echo "$as_me:$LINENO: checking how to preprocess Fortran files" >&5
-echo $ECHO_N "checking how to preprocess Fortran files... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp=
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+$as_echo "/* confdefs.h */" > confdefs.h
-# Let the user specify FPP
-if test -n "$FPP"; then
- rm -f conftest*
-ac_ext_tmp=$ac_ext
-ac_ext=F90
-cat >conftest.$ac_ext << \_ACEOF
-#define OK
- program main
-#ifdef OK
- REAL A
-#else
- syntax error
-#endif
+# Predefined preprocessor variables.
- end
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
-ac_fpp_command=$FPP
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f90 >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f90
- ac_fpp_free_out=
- ac_fpp_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_free_out=' > conftest.f90'
-# Note that the CPP tests only use fixed format
-# so we need to use a .f extension to make the tests
-# work.
- ac_fpp_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_free=$ac_fpp_command
- ac_cv_prog_fpp=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- ac_cv_prog_fpp=
- fi
-fi
-rm -f conftest*
-ac_ext=$ac_ext_tmp
- if test -z "$ac_cv_prog_fpp"; then
- { echo "$as_me:$LINENO: WARNING: user-specified \$FPP ($FPP) does not work" >&5
-echo "$as_me: WARNING: user-specified \$FPP ($FPP) does not work" >&2;}
- FPP=
- fi
-fi # test -n "$FPP"
-
-# This next should never happen. We don't call this macro
-# if we can already preprocess. If we do find ourselves here, then
-# something has gone badly wrong -- fail before we do some damage.
-if test -z "$ac_cv_prog_fpp" && test $ac_fpp_ok = yes; then
- # Ooops...
- { { echo "$as_me:$LINENO: error: Assertion failure: in _AC_PROG_FPP when we shouldn't be!" >&5
-echo "$as_me: error: Assertion failure: in _AC_PROG_FPP when we shouldn't be!" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# FIXME: should we bother testing for FC+flag preprocessing?
-
-if test -z "$ac_cv_prog_fpp"; then
-# Either the Fortran compiler can't handle cpp, or doesn't have all the
-# features, or can't be used for pure preprocessing.
-# We must find another way for preprocessing.
-# We try the "best" preprocessors first. We know that $FC can't preprocess
-# by itself, but there is a small chance that F77 can be persuaded to
-# preprocess, so we try that.
-# FIXME: The comment above does not agree with the code below - $FC etc.
-# is being checked late, not early?
- for ac_j in 'fpp' "$CPP -x f95-cpp-input" "$CPP -x f77-cpp-input" \
- "$CPP -C -x c" "$CPP -x c" "$CPP" 'cpp' '/lib/cpp' '/usr/ccs/lib/cpp' \
- 'g77 -E' '$CC -E -x f95-cpp-input' '$CC -E -x f77-cpp-input' \
- '$CC -E -x c -C' '$CC -E -x c' '$CC -E' \
- "$FC -F" "$FC -E" "$F77 -F" "$F77 -E" ; do
- rm -f conftest*
-ac_ext_tmp=$ac_ext
-ac_ext=F90
-cat >conftest.$ac_ext << \_ACEOF
-#define OK
- program main
-#ifdef OK
- REAL A
-#else
- syntax error
-#endif
-
- end
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
-ac_fpp_command=$ac_j
-if eval '$ac_fpp_command conftest.$ac_ext > conftest.log 2>/dev/null'; then
- if test -f conftest.f; then
- if diff conftest.$ac_ext conftest.f90 >/dev/null 2>&1; then
- # ooops -- these two are the same file, indicating that this is a
- # case-insensitive filesystem. So ignore this file.
- ac_tmp=
- else
- ac_tmp=conftest.f90
- ac_fpp_free_out=
- ac_fpp_out=
- fi
- fi
- if test -z "$ac_tmp"; then
- ac_tmp=conftest.log
- ac_fpp_free_out=' > conftest.f90'
-# Note that the CPP tests only use fixed format
-# so we need to use a .f extension to make the tests
-# work.
- ac_fpp_out=' > conftest.f'
- fi
- if grep '^ REAL A' $ac_tmp >/dev/null 2>&1; then
- # we have Fortran! That worked...
- ac_cv_prog_fpp_free=$ac_fpp_command
- ac_cv_prog_fpp=$ac_fpp_command
- fi
- if grep 'syntax error' $ac_tmp >/dev/null 2>&1; then
- # ...oh no it didn't: this line should have been skipped
- ac_cv_prog_fpp_free=
- ac_cv_prog_fpp=
- fi
-fi
-rm -f conftest*
-ac_ext=$ac_ext_tmp
-
- test -n "$ac_cv_prog_fpp" && break;
- done
-fi # test -z "$ac_cv_prog_fpp"
-if test -z "$ac_cv_prog_fpp"; then
- # This is only fatal if direct compilation doesn't work either
- # but we're only here if direct compilation didn't work.
- { { echo "$as_me:$LINENO: error: cannot find a working Fortran preprocessor" >&5
-echo "$as_me: error: cannot find a working Fortran preprocessor" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp" >&6; }
-{ echo "$as_me:$LINENO: checking how to redirect $ac_cv_prog_fpp output" >&5
-echo $ECHO_N "checking how to redirect $ac_cv_prog_fpp output... $ECHO_C" >&6; }
-if test "${ac_cv_fpp_out+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_fpp_out=$ac_fpp_out
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fpp_out" >&5
-echo "${ECHO_T}$ac_cv_fpp_out" >&6; }
-FPP=$ac_cv_prog_fpp
-ac_fpp_out=$ac_cv_fpp_out
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
-{ echo "$as_me:$LINENO: checking whether $FPP needs the -P option" >&5
-echo $ECHO_N "checking whether $FPP needs the -P option... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_p+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_p=unknown
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
-# This will only be called from AC_PROG_FPP, and as such, the
-# extension *will* be .F90.
-ac_ext=F90
-cat > conftest.$ac_ext << \_ACEOF
-#define OK
- program main
-#ifdef OK
- REAL A
-#else
- syntax error
-#endif
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
- end
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-ac_ext=F90 # previous line will have reset this
-# We must not fail, here, in the case where the filesystem is
-# case-insensitive, so that conftest.F and conftest.f are the same
-# file.
-if test -n "$ac_fpp_out"; then
- # If $ac_fpp_out is non-null, then preprocessor output goes to
- # stdout, which we send to conftest.f _without_ immediately clobbering
- # the input file as it is being read. We do clobber it in the
- # end, however, which is why we copy .FPP_SRC_EXT to .$FPP_SRC_EXT
- # each time.
- ac_tmp='>conftest.tmp && mv conftest.tmp conftest.f90'
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
else
- # conftest.F is preprocessed directly to conftest.f. We can
- # assume that the filesystem is case-sensitive, since otherwise
- # this compiler/preprocessor would be simply non-functional on
- # this platform.
- ac_tmp=
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
fi
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_tmp"
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.f90 $LIBS'
-
-if { (eval echo "$as_me:$LINENO: \"$ac_cmd\"") >&5
- (eval $ac_cmd) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -P"
- if { (eval echo "$as_me:$LINENO: \"$ac_cmd\"") >&5
- (eval $ac_cmd) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- ac_cv_prog_fpp_p=-P
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_p" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_p" >&6; }
-if test "x$ac_cv_prog_fpp_p" = "xunknown"; then
- { { echo "$as_me:$LINENO: error: $FPP cannot produce code that $FC compiles" >&5
-echo "$as_me: error: $FPP cannot produce code that $FC compiles" >&2;}
- { (exit 1); exit 1; }; }
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_p"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
fi
-
-# Before we go any further, check that we're not courting disaster,
-# here, by using indirect compilation (.F -> .f -> .o) on a
-# case-insensitive filesystem. If we are, there's nothing we can do
-# other than fail noisily.
-{ echo "$as_me:$LINENO: checking whether the filesystem is case-insensitive" >&5
-echo $ECHO_N "checking whether the filesystem is case-insensitive... $ECHO_C" >&6; }
-if test "${ac_cv_fc_cifs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- rm -f conftest.*
- echo wibble >conftest.F
- if test -f conftest.f && test "`cat conftest.f`" = wibble; then
- ac_cv_fc_cifs=yes
- else
- ac_cv_fc_cifs=no
- fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_cifs" >&5
-echo "${ECHO_T}$ac_cv_fc_cifs" >&6; }
-# Redefine the compile and link commands for indirect compilation
-if test $ac_cv_fc_cifs = yes; then
- if test "x$ac_fpp_out" = x ; then
- { { echo "$as_me:$LINENO: error: Confused in preprocessing on case-insensitive FS - please report to tow@uszla.me.uk" >&5
-echo "$as_me: error: Confused in preprocessing on case-insensitive FS - please report to tow@uszla.me.uk" >&2;}
- { (exit 1); exit 1; }; }
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
fi
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext > conftest.cpp.f && ${FC-fc} -c $FCFLAGS -o conftest.o conftest.cpp.f >&5; rm conftest.cpp.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT > conftest.cpp.f && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.cpp.f $LIBS >&5; rm conftest.cpp.f'
-else
- ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext '"$ac_fpp_out"' && ${FC-fc} -c $FCFLAGS conftest.f >&5; rm conftest.f'
- ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT '"$ac_fpp_out"' && ${FC-fc} $ac_link_obj_flag""conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.f $LIBS >&5; rm conftest.f'
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
- ac_compile=$ac_fpp_compile
- ac_link=$ac_fpp_link
-# Redo all the feature checks for indirect compilation.
- ac_fc_testing_fpp=indirect
- ac_fpp_ok=yes
-ac_prog_fc_cpp=no
-ac_prog_fc_cpp_d=no
-ac_prog_fc_cpp_i=no
-ac_prog_fc_cpp_subs=no
-ac_prog_fc_cpp_wrap=no
-ac_prog_fc_cpp_CSTYLE=no
-ac_prog_fc_cpp_cxxstyle=no
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking for fixed form Fortran preprocessor features" >&5
-echo $ECHO_N "checking for fixed form Fortran preprocessor features... $ECHO_C" >&6; }
-if test $ac_fc_testing_fpp = direct; then
-# On nearly all systems where direct compilation is possible, a .F file will
-# compile a preprocessable fixed-form file automatically. However,
-# case-insensitive filesystems (eg HFS+ on MacOSX) may get confused.
-# Therefore, we must check for cpp flags.
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
-ac_ext=F
-ac_fpp_fixedform_FCFLAGS_save=$FCFLAGS
-for ac_flag in none "/fpp" "-x f77-cpp-input" "-FI -cpp" "-qfixed -qsuffix=cpp=F" "-fixed -fpp" "-lfe \"-Cpp\" --fix"
-do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_fixedform_FCFLAGS_save $ac_flag"
- cat >conftest.$ac_ext <<_ACEOF
-
- PROGRAM FIXEDFORM
-C THIS COMMENT SHOULD CONFUSE FREEFORM COMPILERS
- PRI NT*, 'HELLO '//
- . 'WORLD.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
- ENDP ROGRAM
-#endif
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_fpp_fixedform_F=$ac_flag; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-FCFLAGS=$ac_fpp_fixedform_FCFLAGS_save
-if test "x$ac_cv_fpp_fixedform_F" = x; then
- { echo "$as_me:$LINENO: WARNING: Cannot compile fixed-form preprocessable Fortran with a .F extension." >&5
-echo "$as_me: WARNING: Cannot compile fixed-form preprocessable Fortran with a .F extension." >&2;}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
else
- if test "$ac_cv_fpp_fixedform_F" != none; then
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
- FPPFLAGS_fixed_F="$ac_cv_fpp_fixedform_F"
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
- fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
- if test "x$ac_cv_fpp_fixedform_F" != x; then
- ac_prog_fc_cpp=yes
- else
- ac_fpp_ok=no
- fi
-# It is possible we've failed the previous test because of a
-# Tru64 bug where the compiler fails when called as 'f95' on
-# a .F file. It works when called as f90.
-#FIXME: this does not protect the user's setting of FC, though
-# we set it back if senesible.
- if test $ac_prog_fc_cpp = no && test $FC = f95; then
- FC=f90
- cat >conftest.$ac_ext <<_ACEOF
-#define OK
- program main
-#ifndef OK
- syntax error
-#endif
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp=yes
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FC"; then
+ ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
+$as_echo "$FC" >&6; }
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+ test -n "$FC" && break
+ done
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- if test $ac_prog_fc_cpp = no; then
- FC=f95
- ac_fpp_ok=no
- fi
+if test -z "$FC"; then
+ ac_ct_FC=$FC
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_FC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_FC"; then
+ ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_FC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+ done
+IFS=$as_save_IFS
- ac_first_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_fixed_F"
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-# We need to skip the following tests if we're trying direct compilation
-# and FC won't preprocess.
-if test $ac_prog_fc_cpp = yes || test $ac_fc_testing_fpp = indirect; then
- if test $ac_fpp_need_d = yes; then
-# Nearly everyone uses -D. XLF uses -WF,-D. Ifort on Windows uses /D
- ac_prog_fc_cpp_d=no
- ac_save_FPPFLAGS=$FPPFLAGS
- for fpp_flag_try in "-D" "-WF,-D" "/D"; do
- FPPFLAGS="$FPPFLAGS $fpp_flag_try""OK"
- cat >conftest.$ac_ext <<_ACEOF
+ test -n "$ac_ct_FC" && break
+done
- program main
+ if test "x$ac_ct_FC" = x; then
+ FC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ FC=$ac_ct_FC
+ fi
+fi
-#ifndef OK
- syntax error
-#endif
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_d=yes; FPPFLAGS_DEF="$fpp_flag_try"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- :
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- FPPFLAGS=$ac_save_FPPFLAGS
- done
- if test $ac_prog_fc_cpp_d = no; then
- ac_fpp_ok=no
- fi
- fi
-#FIXME we should probably do the AC_SUBST somewhere else.
-
-
- if test $ac_fpp_need_i = yes; then
- rm -rf conftst
- mkdir conftst
- cat > conftst/conftest.inc << \_ACEOF
-! This statement overrides the IMPLICIT statement in the program
- REAL cc
-_ACEOF
- ac_save_FPPFLAGS=$FPPFLAGS
- FPPFLAGS="$FPPFLAGS -Iconftst"
- cat >conftest.$ac_ext <<_ACEOF
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+rm -f a.out
+cat > conftest.$ac_ext <<_ACEOF
program main
- IMPLICIT CHARACTER (c)
-! Comments in test programs should be freeform compliant just in case.
-! conftest.inc contains the Fortran statement "REAL cc"
-#include "conftest.inc"
- cc=1.
-
end
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_i=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- rm -rf conftst
- FPPFLAGS=$ac_save_FPPFLAGS
- fi
-
- if test $ac_fpp_need_subs = yes; then
- cat >conftest.$ac_ext <<_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler works" >&5
+$as_echo_n "checking whether the Fortran compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#define NM xxxx
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
- program main
- IMPLICIT CHARACTER (n)
- REAL xxxx
- NM=1.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_subs=yes
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
else
- echo "$as_me: failed program was:" >&5
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_fpp_ok=no
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "Fortran compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler default output file name" >&5
+$as_echo_n "checking for Fortran compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_wrap = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
-#define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
-
- program main
- CHARACTER*80 A
- A=LONG
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_wrap=yes
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_CSTYLE = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat > conftest.$ac_ext <<_ACEOF
program main
-
- A=1. /* C-style comment */
+ open(unit=9,file='conftest.out')
+ close(unit=9)
end
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_CSTYLE=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
- if test $ac_fpp_need_cxxstyle = yes; then
- cat >conftest.$ac_ext <<_ACEOF
-
- PROGRAM MAIN
- CHARACTER*10 C
- C = "abcde" // "fghij"; END PROGRAM
-
-
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fpp_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_prog_fc_cpp_cxxstyle=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_fpp_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
-fi
-if test $ac_fc_testing_fpp = direct; then
- FPPFLAGS=$ac_first_save_FPPFLAGS
-fi
-
-rm -f conftest.*
-
-{ echo "$as_me:$LINENO: result: done." >&5
-echo "${ECHO_T}done." >&6; }
-
-
-if test $ac_fpp_need_d = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP accepts -D" >&5
-echo $ECHO_N "checking whether $FPP accepts -D... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_d+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_d=$ac_prog_fc_cpp_d
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_d" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_d" >&6; }
-fi
-
-if test $ac_fpp_need_i = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP accepts -I" >&5
-echo $ECHO_N "checking whether $FPP accepts -I... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_i+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_i=$ac_prog_fc_cpp_i
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_i" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_i" >&6; }
-fi
-
-if test $ac_fpp_need_subs = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP substitutes macros in Fortran code" >&5
-echo $ECHO_N "checking whether $FPP substitutes macros in Fortran code... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_subs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_subs=$ac_prog_fc_cpp_subs
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_subs" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_subs" >&6; }
-fi
-
-if test $ac_fpp_need_wrap = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP wraps long lines automatically" >&5
-echo $ECHO_N "checking whether $FPP wraps long lines automatically... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_wrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_wrap=$ac_prog_fc_cpp_wrap
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_wrap" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_wrap" >&6; }
-fi
-
-if test $ac_fpp_need_CSTYLE = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP suppresses C-style comments" >&5
-echo $ECHO_N "checking whether $FPP suppresses C-style comments... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_CSTYLE+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_CSTYLE=$ac_prog_fc_cpp_CSTYLE
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_CSTYLE" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_CSTYLE" >&6; }
-
-elif test $ac_fpp_need_cstyle = yes; then
-# It only makes sense to test this for indirect compilation,
-# i.e., if .f files are generated
- { echo "$as_me:$LINENO: checking how to pass C-style comments to $FC" >&5
-echo $ECHO_N "checking how to pass C-style comments to $FC... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_cstyle+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_cstyle=unknown
-
-cat > conftest.$ac_ext << \_ACEOF
-
- program main
-
- A=1. /* C-style comment */
-
- end
-_ACEOF
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
-if { (eval echo "$as_me:$LINENO: \"$ac_cmd\"") >&5
- (eval $ac_cmd) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- cat conftest.f | grep '[*]/.*[*]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=
-else
- ac_save_FPPFLAGS=$FPPFLAGS
- ac_name=`expr "x$FPP" : 'x\(fpp\)'`
- if test "x$ac_name" = xfpp; then
- ac_flag="-c_com=no"
- else
- ac_flag="-C"
- fi
- FPPFLAGS="$FPPFLAGS $ac_flag"
- ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
- if { (eval echo "$as_me:$LINENO: \"$ac_cmd\"") >&5
- (eval $ac_cmd) 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- cat conftest.f | grep '/[*].*[*]/' >/dev/null 2>&1; then
- ac_cv_prog_fpp_cstyle=$ac_flag
- fi
- FPPFLAGS=$ac_save_FPPFLAGS
-fi
-rm -f conftest*
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_cstyle" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_cstyle" >&6; }
-if test "x$ac_cv_prog_fpp_cstyle" = "xunknown"; then
- { echo "$as_me:$LINENO: WARNING: cannot find a way to make $FPP pass C-style comments" >&5
-echo "$as_me: WARNING: cannot find a way to make $FPP pass C-style comments" >&2;}
-else
- FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_cstyle"
-fi
-
-fi
-
-if test $ac_fpp_need_cxxstyle = yes; then
- { echo "$as_me:$LINENO: checking whether $FPP preserves C++-style comments" >&5
-echo $ECHO_N "checking whether $FPP preserves C++-style comments... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_cxxstyle+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_cxxstyle=$ac_prog_fc_cpp_cxxstyle
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_cxxstyle" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_cxxstyle" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking whether $FPP fulfils requested features" >&5
-echo $ECHO_N "checking whether $FPP fulfils requested features... $ECHO_C" >&6; }
-if test "${ac_cv_prog_fpp_ok+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_fpp_ok=$ac_fpp_ok
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_fpp_ok" >&5
-echo "${ECHO_T}$ac_cv_prog_fpp_ok" >&6; }
-
- ac_cv_fpp_build_rule=indirect
-
-if test ac_fpp_ok = no; then
- { { echo "$as_me:$LINENO: error: Cannot find a Fortran preprocessor with the requested features" >&5
-echo "$as_me: error: Cannot find a Fortran preprocessor with the requested features" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi # test ac_fpp_ok != yes
-
-# We have all necessary information.
-# It remains to construct optimal build rules
-# (direct: .F.o or indirect: .F.f)
-# and carry out the substitutions.
-#
-# This is the crucial bit: we switch on ac_cv_fpp_build_rule=direct/indirect,
-# setting and AC_SUBSTing the variables documented in _AC_FPP_BUILD_RULE.
-#
-# Do we actually have all the required information yet, or do we need
-# to look at AC_FC_(FIXED|FREE)FORM results also? I think we're OK:
-# if the compiler can do all the preprocessing itself, then we don't
-# have to do anything (ie, the `direct' branch should be trivial), and
-# if we have to do separate preprocessing, the processor is probably
-# (?) independent of the source language variant.
-# FPP is defined by this stage. If the processing mode is 'direct', then
-# this will almost certainly be defined as blank, but we should make no
-# committments to this in the documentation, in case we want to change
-# our minds about that in future.
-
-
-# Default the FPP_PREPROCESS_EXT and FPP_COMPILE_EXT to the most usual ones
-FPP_PREPROCESS_EXT=F
-FPP_COMPILE_EXT=f
-
-# Switch on the processing mode, direct/indirect, which has been determined
-# in AC_PROG_FPP before this macro is called. The FPPDIRECT_(TRUE|FALSE)
-# variables implement an automake (configure-time) conditional, which is
-# created, not through an invocation of AM_CONDITIONAL, but implicitly
-# within automake.in (qv).
-if test $ac_cv_fpp_build_rule = direct; then
- # The simple case: the chosen Fortran compiler can handle preprocessing,
- # so we don't need a separate preprocessing stage.
- FPPDIRECT_TRUE=
- FPPDIRECT_FALSE='#'
- # The flags here are those included in the 'compile' field of the
- # 'ppfc' language in automake.in, minus the {AM_,}FCFLAGS variables.
- # It's not _absolutely_ guaranteed that these are the correct ones,
- # and I (NG) would be open to argument about adding both {AM_,}CPPFLAGS and
- # {AM_,}FCFLAGS, but this set appears to work.
- FPP_MAKE_FLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)'
-else
- FPPDIRECT_TRUE='#'
- FPPDIRECT_FALSE=
- FPP_MAKE_FLAGS=
-fi
-
-if test -z "$ac_fpp_out"; then
- FPP_OUTPUT=" "
-else
- FPP_OUTPUT=">\$@"
-fi
-
-
-
-
-
-
-
-
-
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-
-
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run Fortran compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-{ echo "$as_me:$LINENO: checking for Fortran flag needed to allow free-form preprocessed source for .F90 suffix" >&5
-echo $ECHO_N "checking for Fortran flag needed to allow free-form preprocessed source for .F90 suffix... $ECHO_C" >&6; }
-if test "${ac_cv_fpp_freeform_F90+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test $ac_cv_fpp_build_rule = direct; then
- ac_cv_fpp_freeform_F90=unknown
- ac_ext=F90
- ac_fpp_freeform_FCFLAGS_save=$FCFLAGS
- for ac_flag in none "/FR /fpp" "-ffree-form -x f77-cpp-input" \
- "-FR -cpp" "-free -cpp" "-qfree=f90 -qsuffix=cpp=F90"\
- "-qfree -qsuffix=cpp=F90" -Mfree -Mfreeform \
- -freeform "-f free" --nfix "-fpp -free"
- do
- test "x$ac_flag" != xnone && FCFLAGS="$ac_fpp_freeform_FCFLAGS_save $ac_flag"
- cat >conftest.$ac_ext <<_ACEOF
-
-program freeform
-! FIXME: how to best confuse non-freeform compilers?
-print *, 'Hello ', &
-'world.'
-#ifdef OK2
- choke me
-#endif
-#ifndef OK
-end program
-#endif
+ cat > conftest.$ac_ext <<_ACEOF
+ program main
+ end
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_fpp_freeform_F90=$ac_flag; break
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if ${ac_cv_fc_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- FCFLAGS=$ac_fpp_freeform_FCFLAGS_save
+ end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
else
- ac_cv_fpp_freeform_F90=none
-fi # test $ac_cv_fpp_build_rule = direct
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fpp_freeform_F90" >&5
-echo "${ECHO_T}$ac_cv_fpp_freeform_F90" >&6; }
-if test "x$ac_cv_fpp_freeform_F90" = xunknown; then
- { { echo "$as_me:$LINENO: error: Cannot compile free-form source with .F90 suffix" >&5
-echo "$as_me: error: Cannot compile free-form source with .F90 suffix" >&2;}
- { (exit 77); exit 77; }; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FCFLAGS=${FCFLAGS+set}
+ac_save_FCFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if ${ac_cv_prog_fc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test "x$ac_cv_fpp_freeform_F90" != xnone; then
- FPPFLAGS_free_F90="$ac_cv_fpp_freeform_F90"
-
- fi
+ FCFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+ program main
+ end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+ ac_cv_prog_fc_g=yes
+else
+ ac_cv_prog_fc_g=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-FPP_PREPROCESS_EXT=F90
-FPP_COMPILE_EXT=f90
-
-ac_ext=$FPP_SRC_EXT
-# We need to use variables because compilation depends on whether
-# $F77 supports direct compilation of source with cpp directives
-ac_compile=$ac_fpp_compile
-ac_link=$ac_fpp_link
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
-if test $ac_cv_fpp_build_rule = direct; then
- F90_RULE='$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $< '
-elif test $ac_cv_fpp_build_rule = indirect; then
- if test $ac_cv_fc_cifs = yes; then
- F90_RULE='while [ 0 ]; do FPPFILE=$*.$$RANDOM.f90; if ! test -f $$FPPFILE; then break; fi; done; $(FPP) $(FPPFLAGS) $< > $$FPPFILE && $(FC) -c -o $*.$(OBJEXT) $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $$FPPFILE; rm $$FPPFILE'
- elif test x$FPP_OUTPUT = x; then
- F90_RULE='$(FPP) $(FPPFLAGS) $< && $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $*.f90; rm $*.f90'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FCFLAGS" = set; then
+ FCFLAGS=$ac_save_FCFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-g -O2"
+ else
+ FCFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-O2"
else
- F90_RULE='$(FPP) $(FPPFLAGS) $< > $*.f90 && $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $*.f90; rm $*.f90'
+ FCFLAGS=
fi
fi
+if test $ac_compiler_gnu = yes; then
+ GFC=yes
+else
+ GFC=
+fi
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
LINK_O_FLAG=$ac_link_obj_flag
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -4986,25 +2429,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -5013,10 +2456,10 @@ if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -5026,25 +2469,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
@@ -5052,12 +2495,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
@@ -5067,7 +2506,7 @@ else
fi
# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then
+if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; use_debug=$enableval
else
use_debug=no
@@ -5077,7 +2516,7 @@ if test x$use_debug = xyes; then
FCFLAGS="$FCFLAGS $FFLAGS_DEBUG"
fi
# Check whether --enable-fast was given.
-if test "${enable_fast+set}" = set; then
+if test "${enable_fast+set}" = set; then :
enableval=$enable_fast; use_debug=$enableval
else
use_debug=no
@@ -5161,12 +2600,12 @@ fi
fi
fi
-if test x$FC_ID != x; then
- { echo "$as_me:$LINENO: $FC seems to be a $FC_ID compiler" >&5
-echo "$as_me: $FC seems to be a $FC_ID compiler" >&6;}
+if test x$FC_ID != x; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $FC seems to be a $FC_ID compiler" >&5
+$as_echo "$as_me: $FC seems to be a $FC_ID compiler" >&6;}
else
- FC_ID=unknown; { echo "$as_me:$LINENO: Could not determine type of compiler" >&5
-echo "$as_me: Could not determine type of compiler" >&6;}
+ FC_ID=unknown; { $as_echo "$as_me:${as_lineno-$LINENO}: Could not determine type of compiler" >&5
+$as_echo "$as_me: Could not determine type of compiler" >&6;}
fi
@@ -5175,7 +2614,6 @@ fi
-
case $FC_ID in
Absoft)
@@ -5242,7 +2680,7 @@ esac
# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then
+if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; use_debug=$enableval
else
use_debug=no
@@ -5253,7 +2691,7 @@ if test x$use_debug = xyes; then
fi
# Check whether --enable-fast was given.
-if test "${enable_fast+set}" = set; then
+if test "${enable_fast+set}" = set; then :
enableval=$enable_fast; use_debug=$enableval
else
use_debug=no
@@ -5264,27 +2702,27 @@ if test x$use_debug = xyes; then
fi
CUTDOWN_TARGET=
# Check whether --enable-wxml was given.
-if test "${enable_wxml+set}" = set; then
+if test "${enable_wxml+set}" = set; then :
enableval=$enable_wxml; eval wxml_$enableval=wxml_lib
fi
# Check whether --enable-wcml was given.
-if test "${enable_wcml+set}" = set; then
+if test "${enable_wcml+set}" = set; then :
enableval=$enable_wcml; eval wcml_$enableval=wcml_lib
fi
# Check whether --enable-wkml was given.
-if test "${enable_wkml+set}" = set; then
+if test "${enable_wkml+set}" = set; then :
enableval=$enable_wkml; eval wkml_$enableval=wkml_lib
fi
# Check whether --enable-sax was given.
-if test "${enable_sax+set}" = set; then
+if test "${enable_sax+set}" = set; then :
enableval=$enable_sax; eval sax_$enableval=sax_lib
fi
# Check whether --enable-dom was given.
-if test "${enable_dom+set}" = set; then
+if test "${enable_dom+set}" = set; then :
enableval=$enable_dom; eval dom_$enableval=dom_lib
fi
@@ -5300,7 +2738,7 @@ if test x$wxml_yes$wcml_yes$wkml_yes$sax_yes$dom_yes = x; then
fi
fi
# Check whether --enable-dummy was given.
-if test "${enable_dummy+set}" = set; then
+if test "${enable_dummy+set}" = set; then :
enableval=$enable_dummy; dummy=$enableval
fi
@@ -5315,14 +2753,14 @@ BUILD_TARGETS="$wxml_yes $wcml_yes $wkml_yes $sax_yes $dom_yes"
ac_fc_got_kinds=yes
-{ echo "$as_me:$LINENO: checking for kind number produced by kind(1.0)" >&5
-echo $ECHO_N "checking for kind number produced by kind(1.0)... $ECHO_C" >&6; }
-if test "${ac_cv_fc_real_kind_sp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kind number produced by kind(1.0)" >&5
+$as_echo_n "checking for kind number produced by kind(1.0)... " >&6; }
+if ${ac_cv_fc_real_kind_sp+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
FCFLAGS_save="$FCFLAGS"
@@ -5354,16 +2792,16 @@ else
fi
FCFLAGS="$FCFLAGS_save"
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_real_kind_sp" >&5
-echo "${ECHO_T}$ac_cv_fc_real_kind_sp" >&6; }
-if test $ac_cv_fc_real_kind_sp != no; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_real_kind_sp" >&5
+$as_echo "$ac_cv_fc_real_kind_sp" >&6; }
+if test $ac_cv_fc_real_kind_sp != no; then :
ac_fc_real_kind_sp=$ac_cv_fc_real_kind_sp; :
else
ac_got_kinds=no
@@ -5371,15 +2809,14 @@ else
fi
-
-{ echo "$as_me:$LINENO: checking for kind number produced by kind(1.0d0)" >&5
-echo $ECHO_N "checking for kind number produced by kind(1.0d0)... $ECHO_C" >&6; }
-if test "${ac_cv_fc_real_kind_dp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kind number produced by kind(1.0d0)" >&5
+$as_echo_n "checking for kind number produced by kind(1.0d0)... " >&6; }
+if ${ac_cv_fc_real_kind_dp+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
FCFLAGS_save="$FCFLAGS"
@@ -5411,16 +2848,16 @@ else
fi
FCFLAGS="$FCFLAGS_save"
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_real_kind_dp" >&5
-echo "${ECHO_T}$ac_cv_fc_real_kind_dp" >&6; }
-if test $ac_cv_fc_real_kind_dp != no; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_real_kind_dp" >&5
+$as_echo "$ac_cv_fc_real_kind_dp" >&6; }
+if test $ac_cv_fc_real_kind_dp != no; then :
ac_fc_real_kind_dp=$ac_cv_fc_real_kind_dp; :
else
ac_got_kinds=no
@@ -5428,15 +2865,14 @@ else
fi
-
-{ echo "$as_me:$LINENO: checking for kind number produced by selected_real_kind(6,34)" >&5
-echo $ECHO_N "checking for kind number produced by selected_real_kind(6,34)... $ECHO_C" >&6; }
-if test "${ac_cv_fc_real_kind_ieee_sp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kind number produced by selected_real_kind(6,34)" >&5
+$as_echo_n "checking for kind number produced by selected_real_kind(6,34)... " >&6; }
+if ${ac_cv_fc_real_kind_ieee_sp+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
FCFLAGS_save="$FCFLAGS"
@@ -5468,16 +2904,16 @@ else
fi
FCFLAGS="$FCFLAGS_save"
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_real_kind_ieee_sp" >&5
-echo "${ECHO_T}$ac_cv_fc_real_kind_ieee_sp" >&6; }
-if test $ac_cv_fc_real_kind_ieee_sp != no; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_real_kind_ieee_sp" >&5
+$as_echo "$ac_cv_fc_real_kind_ieee_sp" >&6; }
+if test $ac_cv_fc_real_kind_ieee_sp != no; then :
ac_fc_real_kind_ieee_sp=$ac_cv_fc_real_kind_ieee_sp; :
else
ac_got_kinds=no
@@ -5485,15 +2921,14 @@ else
fi
-
-{ echo "$as_me:$LINENO: checking for kind number produced by selected_real_kind(15,300)" >&5
-echo $ECHO_N "checking for kind number produced by selected_real_kind(15,300)... $ECHO_C" >&6; }
-if test "${ac_cv_fc_real_kind_ieee_dp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kind number produced by selected_real_kind(15,300)" >&5
+$as_echo_n "checking for kind number produced by selected_real_kind(15,300)... " >&6; }
+if ${ac_cv_fc_real_kind_ieee_dp+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
FCFLAGS_save="$FCFLAGS"
@@ -5525,16 +2960,16 @@ else
fi
FCFLAGS="$FCFLAGS_save"
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_fc_real_kind_ieee_dp" >&5
-echo "${ECHO_T}$ac_cv_fc_real_kind_ieee_dp" >&6; }
-if test $ac_cv_fc_real_kind_ieee_dp != no; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_real_kind_ieee_dp" >&5
+$as_echo "$ac_cv_fc_real_kind_ieee_dp" >&6; }
+if test $ac_cv_fc_real_kind_ieee_dp != no; then :
ac_fc_real_kind_ieee_dp=$ac_cv_fc_real_kind_ieee_dp; :
else
ac_got_kinds=no
@@ -5542,26 +2977,23 @@ else
fi
-
-if test $ac_fc_got_kinds != no; then
+if test $ac_fc_got_kinds != no; then :
:
else
- { { echo "$as_me:$LINENO: error: Could not find all Fortran real kinds" >&5
-echo "$as_me: error: Could not find all Fortran real kinds" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "Could not find all Fortran real kinds" "$LINENO" 5
fi
-
SP_KIND=$ac_fc_real_kind_sp
DP_KIND=$ac_fc_real_kind_dp
-{ echo "$as_me:$LINENO: checking how to compile a call to FLUSH" >&5
-echo $ECHO_N "checking how to compile a call to FLUSH... $ECHO_C" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to compile a call to FLUSH" >&5
+$as_echo_n "checking how to compile a call to FLUSH... " >&6; }
tw_flush_ok=no
-cat >conftest.$ac_ext <<_ACEOF
+cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTFLUSH
PRINT*
@@ -5569,38 +3001,15 @@ cat >conftest.$ac_ext <<_ACEOF
END PROGRAM TESTFLUSH
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;DEFS="$DEFS FC_HAVE_FLUSH"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test $tw_flush_ok = no; then
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Vaxlib"
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTFLUSH
PRINT*
@@ -5608,40 +3017,17 @@ if test $tw_flush_ok = no; then
END PROGRAM TESTFLUSH
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_FLUSH"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test $tw_flush_ok = no; then
LDFLAGS=$save_LDFLAGS
fi
fi
if test $tw_flush_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTFLUSH
USE F90_UNIX_IO, ONLY:FLUSH
@@ -5650,37 +3036,14 @@ if test $tw_flush_ok = no; then
END PROGRAM TESTFLUSH
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";DEFS="$DEFS FC_HAVE_FLUSH"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
if test $tw_flush_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTFLUSH
PRINT*
@@ -5688,163 +3051,70 @@ if test $tw_flush_ok = no; then
END PROGRAM TESTFLUSH
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_flush_ok=yes; TW_FLUSH=XLF;tw_method="with underscore"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $tw_method" >&5
-echo "${ECHO_T}$tw_method" >&6; }
-if test $tw_flush_ok = yes; then
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tw_method" >&5
+$as_echo "$tw_method" >&6; }
+if test $tw_flush_ok = yes; then :
+
else
- { echo "$as_me:$LINENO: result: cannot compile call to FLUSH" >&5
-echo "${ECHO_T}cannot compile call to FLUSH" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot compile call to FLUSH" >&5
+$as_echo "cannot compile call to FLUSH" >&6; }
fi
-
-{ echo "$as_me:$LINENO: checking how to compile a call to ABORT" >&5
-echo $ECHO_N "checking how to compile a call to ABORT... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to compile a call to ABORT" >&5
+$as_echo_n "checking how to compile a call to ABORT... " >&6; }
tw_abort_ok=no
if test $tw_abort_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTABORT
CALL ABORT("")
END PROGRAM TESTABORT
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_abort_ok=yes; tw_method="with argument";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_ARG"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
if test $tw_abort_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTABORT
CALL ABORT_
END PROGRAM TESTABORT
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_abort_ok=yes; tw_method="with underscore";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_UNDERSCORE"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
if test $tw_abort_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTABORT
CALL ABORT
END PROGRAM TESTABORT
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_abort_ok=yes; tw_method=default;DEFS="$DEFS FC_HAVE_ABORT"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
if test $tw_abort_ok = no; then
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTABORT
USE F90_UNIX_PROC, ONLY:ABORT
@@ -5852,102 +3122,55 @@ if test $tw_abort_ok = no; then
END PROGRAM TESTABORT
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_abort_ok=yes; tw_method="with f90_unix_proc";DEFS="$DEFS FC_HAVE_ABORT"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
if test $tw_abort_ok = no; then
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Vaxlib"
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
PROGRAM TESTABORT
CALL ABORT
END PROGRAM TESTABORT
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_fc_try_link "$LINENO"; then :
tw_abort_ok=yes; tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_ABORT"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test $tw_abort_ok = no; then
LDFLAGS=$save_LDFLAGS
fi
fi
-{ echo "$as_me:$LINENO: result: $tw_method" >&5
-echo "${ECHO_T}$tw_method" >&6; }
-if test $tw_abort_ok = yes; then
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tw_method" >&5
+$as_echo "$tw_method" >&6; }
+if test $tw_abort_ok = yes; then :
+
else
- { echo "$as_me:$LINENO: result: cannot compile call to ABORT" >&5
-echo "${ECHO_T}cannot compile call to ABORT" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot compile call to ABORT" >&5
+$as_echo "cannot compile call to ABORT" >&6; }
fi
-
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
FCFLAGS_save="$FCFLAGS"
FCFLAGS="$FCFLAGS $FCFLAGS_free_f90"
-{ echo "$as_me:$LINENO: checking for EOR character used by $FC" >&5
-echo $ECHO_N "checking for EOR character used by $FC... $ECHO_C" >&6; }
-if test "$cross_compiling" = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOR character used by $FC" >&5
+$as_echo_n "checking for EOR character used by $FC... " >&6; }
+if test "$cross_compiling" = yes; then :
ac_cv_FC_check_output_eol=EOL_CR
else
- cat >conftest.$ac_ext <<_ACEOF
+ cat > conftest.$ac_ext <<_ACEOF
program output_eol
open(unit=10, file="conf_eol.out")
@@ -5955,31 +3178,10 @@ else
end program
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_fc_try_run "$LINENO"; then :
if ! test -f conf_eol.out; then
-{ { echo "$as_me:$LINENO: error: Could not find test output" >&5
-echo "$as_me: error: Could not find test output" >&2;}
- { (exit 1); exit 1; }; }
+as_fn_error $? "Could not find test output" "$LINENO" 5
elif od -b conf_eol.out | grep 5015 >/dev/null; then
ac_cv_FC_check_output_eol=CRLF
elif od -b conf_eol.out | grep 15 >/dev/null; then
@@ -5991,27 +3193,18 @@ else
fi
rm -rf conf_eol.out
if test $ac_cv_FC_check_output_eol = UNKNOWN; then
- { { echo "$as_me:$LINENO: error: Could not determine line-ending convention" >&5
-echo "$as_me: error: Could not determine line-ending convention" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "Could not determine line-ending convention" "$LINENO" 5
fi
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: Could not execute compiled program" >&5
-echo "$as_me: error: Could not execute compiled program" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "Could not execute compiled program" "$LINENO" 5
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
-{ echo "$as_me:$LINENO: result: $ac_cv_FC_check_output_eol" >&5
-echo "${ECHO_T}$ac_cv_FC_check_output_eol" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_FC_check_output_eol" >&5
+$as_echo "$ac_cv_FC_check_output_eol" >&6; }
case $ac_cv_FC_check_output_eol in
CRLF)
@@ -6022,14 +3215,14 @@ case $ac_cv_FC_check_output_eol in
DEFS="$DEFS FC_EOR_LF";;
esac
-{ echo "$as_me:$LINENO: checking for ASSOCIATED in restricted expression bug" >&5
-echo $ECHO_N "checking for ASSOCIATED in restricted expression bug... $ECHO_C" >&6; }
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ASSOCIATED in restricted expression bug" >&5
+$as_echo_n "checking for ASSOCIATED in restricted expression bug... " >&6; }
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-cat >conftest.$ac_ext <<_ACEOF
+cat > conftest.$ac_ext <<_ACEOF
function test_bug(a) result(b)
integer, pointer :: a
@@ -6038,48 +3231,25 @@ cat >conftest.$ac_ext <<_ACEOF
end function test_bug
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+if ac_fn_fc_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
:
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
DEFS="$DEFS RESTRICTED_ASSOCIATED_BUG"
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
-ac_link='$FC $ac_link_obj_flag""conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-for i in $DEFS; do
- FPPFLAGS="$FPPFLAGS $FPPFLAGS_DEF$i"
-done
case $host_os in
*cygwin*)
if test $FC_ID = G95 -o $FC_ID = Gfortran; then
@@ -6106,22 +3276,23 @@ esac
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
@@ -6129,7 +3300,7 @@ case $as_dir/ in
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -6139,17 +3310,29 @@ case $as_dir/ in
# program-specific install script used by HP pwplus--don't use.
:
else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
fi
fi
done
done
;;
esac
-done
+
+ done
IFS=$as_save_IFS
+rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -6162,8 +3345,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -6173,20 +3356,20 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
+ for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
@@ -6196,11 +3379,12 @@ do
esac
done
done
-done
+ done
IFS=$as_save_IFS
fi
+ test -d ./--version && rmdir ./--version
if test "${ac_cv_path_mkdir+set}" = set; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
@@ -6208,12 +3392,11 @@ fi
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
- test -d ./--version && rmdir ./--version
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
@@ -6231,143 +3414,120 @@ echo "${ECHO_T}$MKDIR_P" >&6; }
OBJSDIR=`pwd`/objs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module inclusion flag" >&5
+$as_echo_n "checking Fortran 90 module inclusion flag... " >&6; }
+if ${ac_cv_fc_module_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
- ac_cv_fc_mod_path_flag=no
- { echo "$as_me:$LINENO: checking for flag to alter module search path" >&5
-echo $ECHO_N "checking for flag to alter module search path... $ECHO_C" >&6; }
- mkdir conftestdir
- cd conftestdir
- cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
+ac_cv_fc_module_flag=unknown
+mkdir conftest.dir
+cd conftest.dir
+cat > conftest.$ac_ext <<_ACEOF
+
+ module conftest_module
+ contains
+ subroutine conftest_routine
+ write(*,'(a)') 'gotcha!'
+ end subroutine
+ end module
_ACEOF
- { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- cd ..
- for i in /I -I -M "-mod .\;" "-p "; do
- if test "$ac_cv_fc_mod_path_flag" = "no"; then
- FCFLAGS_save=$FCFLAGS
- FCFLAGS="$FCFLAGS ${i}conftestdir"
- cat >conftest.$ac_ext <<_ACEOF
-
- subroutine test
- use conftest
- implicit none
- i = 0
- end subroutine test
+if ac_fn_fc_try_compile "$LINENO"; then :
+ cd ..
+ ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
+ # Flag ordering is significant for gfortran and Sun.
+ for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
+ # Add the flag twice to prevent matching an output flag.
+ FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir ${ac_flag}conftest.dir"
+ cat > conftest.$ac_ext <<_ACEOF
+ program main
+ use conftest_module
+ call conftest_routine
+ end program
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_fc_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- FC_MOD_FLAG=$i; ac_cv_fc_mod_path_flag=$i
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_fc_try_compile "$LINENO"; then :
+ ac_cv_fc_module_flag="$ac_flag"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test "$ac_cv_fc_module_flag" != unknown; then
+ break
+ fi
+ done
+ FCFLAGS=$ac_fc_module_flag_FCFLAGS_save
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dir
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
- :
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_flag" >&5
+$as_echo "$ac_cv_fc_module_flag" >&6; }
+if test "$ac_cv_fc_module_flag" != unknown; then
+ FC_MODINC=$ac_cv_fc_module_flag
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- FCFLAGS=$FCFLAGS_save
- done
- { echo "$as_me:$LINENO: result: $ac_cv_fc_mod_path_flag" >&5
-echo "${ECHO_T}$ac_cv_fc_mod_path_flag" >&6; }
- rm -rf conftestdir
- if test "$ac_cv_fc_mod_path_flag" != "no"; then
- :
else
- { { echo "$as_me:$LINENO: error: Cannot find flag to alter module search path" >&5
-echo "$as_me: error: Cannot find flag to alter module search path" >&2;}
- { (exit 1); exit 1; }; }
+ FC_MODINC=
+ as_fn_error $? "unable to find compiler flag for module search path" "$LINENO" 5
fi
+# Ensure trailing whitespace is preserved in a Makefile.
+ac_empty=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module extension" >&5
+$as_echo_n "checking Fortran 90 module extension... " >&6; }
+if ${ac_cv_fc_module_ext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-cat > conftest.$ac_ext << \_ACEOF
- module conftest
- implicit none
- integer :: i
- end module conftest
+mkdir conftest.dir
+cd conftest.dir
+ac_cv_fc_module_ext=unknown
+cat > conftest.$ac_ext <<_ACEOF
+
+ module conftest_module
+ contains
+ subroutine conftest_routine
+ write(*,'(a)') 'gotcha!'
+ end subroutine
+ end module
_ACEOF
-{ (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ echo "$as_me:$LINENO: checking for suffix of module files" >&5
-echo $ECHO_N "checking for suffix of module files... $ECHO_C" >&6; }
-for ac_mod_file in conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod none
-do
- if test -f $ac_mod_file; then
- break;
- fi
-done
-rm -f conftest.$ac_ext conftest.$ac_exe_ext conftest.mod conftest.MOD conftest.M CONFTEST.MOD CONFTEST.mod
-#
-FC_MODEXT=
-FC_MODUPPERCASE=no
-case $ac_mod_file in
- conftest.mod)
- FC_MODEXT=mod
- ;;
- conftest.MOD)
- FC_MODEXT=MOD
- ;;
- conftest.M)
- FC_MODEXT=M
- ;;
- CONFTEST.MOD)
- FC_MODEXT=MOD
- FC_MODUPPERCASE=yes
- ;;
- CONFTEST.mod)
- FC_MODEXT=mod
- FC_MODUPPERCASE=yes
- ;;
- none)
- { echo "$as_me:$LINENO: WARNING: Could not find Fortran module file extension." >&5
-echo "$as_me: WARNING: Could not find Fortran module file extension." >&2;}
- ;;
-esac
-
-{ echo "$as_me:$LINENO: result: $FC_MODEXT" >&5
-echo "${ECHO_T}$FC_MODEXT" >&6; }
-{ echo "$as_me:$LINENO: checking whether module filenames are uppercased" >&5
-echo $ECHO_N "checking whether module filenames are uppercased... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $FC_MODUPPERCASE" >&5
-echo "${ECHO_T}$FC_MODUPPERCASE" >&6; }
-
+if ac_fn_fc_try_compile "$LINENO"; then :
+ ac_cv_fc_module_ext=`ls | sed -n 's,conftest_module\.,,p'`
+ if test x$ac_cv_fc_module_ext = x; then
+ ac_cv_fc_module_ext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+cd ..
+rm -rf conftest.dir
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_ext" >&5
+$as_echo "$ac_cv_fc_module_ext" >&6; }
+FC_MODEXT=$ac_cv_fc_module_ext
+if test "$FC_MODEXT" = unknown; then
+ FC_MODEXT=
+fi
#
@@ -6405,12 +3565,13 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
@@ -6418,8 +3579,8 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -6441,13 +3602,24 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -6464,6 +3636,12 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
t clear
:clear
s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
@@ -6490,27 +3668,33 @@ DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
+U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+case $FC_MODINC in #(
+ *\ ) FC_MODINC=$FC_MODINC'${ac_empty}' ;;
+esac
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -6520,59 +3704,79 @@ cat >$CONFIG_STATUS <<_ACEOF
debug=false
ac_cs_recheck=false
ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -6581,20 +3785,19 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -6605,32 +3808,111 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
-done
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
-# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -6644,13 +3926,17 @@ else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -6665,131 +3951,118 @@ echo X/"$0" |
}
s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
-n*)
- case `echo 'x\c'` in
+ case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -6799,13 +4072,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by FoX $as_me 4.1.2, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -6818,40 +4097,50 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
Configuration files:
$config_files
-Report bugs to ."
+Report bugs to ."
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
FoX config.status 4.1.2
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -6859,20 +4148,25 @@ ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
- --*=*)
+ --*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
*)
ac_option=$1
ac_optarg=$2
@@ -6885,25 +4179,30 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
+ $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
- *) ac_config_targets="$ac_config_targets $1"
+ *) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
@@ -6918,30 +4217,32 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ exec "\$@"
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- echo "$ac_log"
+ $as_echo "$ac_log"
} >&5
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
@@ -6950,9 +4251,7 @@ do
"arch.make") CONFIG_FILES="$CONFIG_FILES arch.make" ;;
"FoX-config") CONFIG_FILES="$CONFIG_FILES FoX-config" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -6973,199 +4272,194 @@ fi
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
+ trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
+ test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-_ACEOF
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-FC!$FC$ac_delim
-FCFLAGS!$FCFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-ac_ct_FC!$ac_ct_FC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-FCFLAGS_free_f90!$FCFLAGS_free_f90$ac_delim
-FPP!$FPP$ac_delim
-FPPFLAGS!$FPPFLAGS$ac_delim
-FPPFLAGS_fixed_F!$FPPFLAGS_fixed_F$ac_delim
-FPPFLAGS_DEF!$FPPFLAGS_DEF$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-CPP!$CPP$ac_delim
-FPPDIRECT_TRUE!$FPPDIRECT_TRUE$ac_delim
-FPPDIRECT_FALSE!$FPPDIRECT_FALSE$ac_delim
-FPP_MAKE_FLAGS!$FPP_MAKE_FLAGS$ac_delim
-FPP_PREPROCESS_EXT!$FPP_PREPROCESS_EXT$ac_delim
-FPP_COMPILE_EXT!$FPP_COMPILE_EXT$ac_delim
-FPP_OUTPUT!$FPP_OUTPUT$ac_delim
-FPPFLAGS_free_F90!$FPPFLAGS_free_F90$ac_delim
-F90_RULE!$F90_RULE$ac_delim
-LINK_O_FLAG!$LINK_O_FLAG$ac_delim
-RANLIB!$RANLIB$ac_delim
-FFLAGS_MPI!$FFLAGS_MPI$ac_delim
-BUILD_TARGETS!$BUILD_TARGETS$ac_delim
-SP_KIND!$SP_KIND$ac_delim
-DP_KIND!$DP_KIND$ac_delim
-LIBEXT!$LIBEXT$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-VPATH!$VPATH$ac_delim
-OBJSDIR!$OBJSDIR$ac_delim
-FC_MOD_FLAG!$FC_MOD_FLAG$ac_delim
-FC_MODEXT!$FC_MODEXT$ac_delim
-FC_MODUPPERCASE!$FC_MODUPPERCASE$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
+rm -f conf$$subs.sh
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' >$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACAWK
_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
s/^[^=]*=[ ]*$//
}'
fi
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
-for ac_tag in :F $CONFIG_FILES
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -7184,7 +4478,7 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
for ac_f
do
case $ac_f in
- -) ac_f="$tmp/stdin";;
+ -) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
@@ -7193,26 +4487,34 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- ac_file_inputs="$ac_file_inputs $ac_f"
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -7222,42 +4524,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -7275,20 +4542,15 @@ echo X"$as_dir" |
q
}
s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
+ as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -7333,12 +4595,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
esac
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
p
q
}
@@ -7346,36 +4608,37 @@ case `sed -n '/datarootdir/ {
/@docdir@/p
/@infodir@/p
/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
+ s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -7386,21 +4649,25 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -7410,11 +4677,13 @@ which seems to be undefined. Please make sure it is defined." >&2;}
done # for ac_tag
-{ (exit 0); exit 0; }
+as_fn_exit 0
_ACEOF
-chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -7434,7 +4703,11 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
chmod +x FoX-config
From fa4fa2f5c0f36d5e97849f9550bab4af2e367d4b Mon Sep 17 00:00:00 2001
From: Noam Bernstein
Date: Tue, 23 Feb 2021 11:19:07 -0500
Subject: [PATCH 29/31] Switch from putting symbols in DEFS to "#define"ing
them in confdefs.h, since that's how the current version of autoconf seems to
want to do things.
---
arch.make.in | 4 ++--
config/aclocal.m4 | 20 ++++++++++----------
config/configure.ac | 10 +++++-----
config/m4/TW_FC_CHECK_ABORT.m4 | 10 +++++-----
config/m4/TW_FC_CHECK_FLUSH.m4 | 6 +++---
config/m4/TW_FC_ID_FLAGS.m4 | 4 ++--
configure | 30 +++++++++++++++---------------
7 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/arch.make.in b/arch.make.in
index b7526a6b..9f42bd19 100644
--- a/arch.make.in
+++ b/arch.make.in
@@ -13,8 +13,8 @@ FPP=@FPP@
FC=@FC@
RANLIB=@RANLIB@
-FFLAGS=@FCFLAGS@
-FPPFLAGS=@FPPFLAGS@
+FFLAGS=@FCFLAGS@ @DEFS@
+FPPFLAGS=@FPPFLAGS@ @DEFS@
LDFLAGS=@LDFLAGS@
INC_PREFIX=-I
diff --git a/config/aclocal.m4 b/config/aclocal.m4
index 74bdd1db..b8c451b1 100644
--- a/config/aclocal.m4
+++ b/config/aclocal.m4
@@ -724,28 +724,28 @@ dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_INTEL])],
- [tw_abort_ok=yes; tw_method="with argument";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_ARG"],
+ [tw_abort_ok=yes; tw_method="with argument";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_ARG 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_XLF])],
- [tw_abort_ok=yes; tw_method="with underscore";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_UNDERSCORE"],
+ [tw_abort_ok=yes; tw_method="with underscore";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_UNDERSCORE 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_BARE])],
- [tw_abort_ok=yes; tw_method=default;DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method=default;echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_NAG])],
- [tw_abort_ok=yes; tw_method="with f90_unix_proc";DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method="with f90_unix_proc";echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
fi
dnl
@@ -757,7 +757,7 @@ if test $tw_abort_ok = no; then
LDFLAGS="$LDFLAGS -Vaxlib"
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_BARE])],
- [tw_abort_ok=yes; tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method="with -Vaxlib";echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
if test $tw_abort_ok = no; then
LDFLAGS=$save_LDFLAGS
@@ -1034,14 +1034,14 @@ tw_flush_ok=no
dnl
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_BARE])],
- [tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;echo "#define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
if test $tw_flush_ok = no; then
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Vaxlib"
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_BARE])],
- [tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";echo "$define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
if test $tw_flush_ok = no; then
LDFLAGS=$save_LDFLAGS
@@ -1050,7 +1050,7 @@ fi
if test $tw_flush_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_NAG])],
- [tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";echo "#define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
fi
if test $tw_flush_ok = no; then
@@ -1284,7 +1284,7 @@ case $FC_ID in
Nag)
FFLAGS_DEBUG="-C=all -g -gline -nan"
- DEFS="$DEFS __NAG__"
+ echo "#define __NAG__ 1" >> confdefs.h
;;
Pathscale)
@@ -1293,7 +1293,7 @@ case $FC_ID in
Portland)
FFLAGS_DEBUG="-g -Mbounds"
FFLAGS_FAST="-fast"
- DEFS="$DEFS PGF90"
+ echo "#define PGF90 1" >> confdefs.h
;;
SGI)
diff --git a/config/configure.ac b/config/configure.ac
index cd26799c..d77296a0 100644
--- a/config/configure.ac
+++ b/config/configure.ac
@@ -97,7 +97,7 @@ AC_ARG_ENABLE([dummy],
AC_HELP_STRING([--enable-dummy], [Compile only dummy interfaces]),
[dummy=$enableval])
if test x$dummy = xyes; then
- DEFS="$DEFS DUMMYLIB"
+ echo "#define DUMMYLIB 1" >> confdefs.h
dnl DUMMYLIB doesnt work with DOM
dom_yes=
fi
@@ -121,15 +121,15 @@ TW_FC_CHECK_ABORT([],[AC_MSG_RESULT([cannot compile call to ABORT])])
TW_FC_CHECK_EOL
case $ac_cv_FC_check_output_eol in
CRLF)
- DEFS="$DEFS FC_EOR_CRLF";;
+ echo "#define FC_EOR_CRLF 1" >> confdefs.h;;
CR)
- DEFS="$DEFS FC_EOR_CR";;
+ echo "#define FC_EOR_CR 1" >> confdefs.h;;
LF)
- DEFS="$DEFS FC_EOR_LF";;
+ echo "#define FC_EOR_LF 1" >> confdefs.h;;
esac
dnl
dnl Check for compiler problems
-TW_CHECK_ASSOCIATED_BUG([], [DEFS="$DEFS RESTRICTED_ASSOCIATED_BUG"])
+TW_CHECK_ASSOCIATED_BUG([], [echo "#define RESTRICTED_ASSOCIATED_BUG 1" >> confdefs.h])
dnl
dnl Library functionality ...
dnl How to make a static library ...
diff --git a/config/m4/TW_FC_CHECK_ABORT.m4 b/config/m4/TW_FC_CHECK_ABORT.m4
index 2d9682ff..27ab27ef 100644
--- a/config/m4/TW_FC_CHECK_ABORT.m4
+++ b/config/m4/TW_FC_CHECK_ABORT.m4
@@ -85,28 +85,28 @@ dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_INTEL])],
- [tw_abort_ok=yes; tw_method="with argument";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_ARG"],
+ [tw_abort_ok=yes; tw_method="with argument";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_ARG 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_XLF])],
- [tw_abort_ok=yes; tw_method="with underscore";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_UNDERSCORE"],
+ [tw_abort_ok=yes; tw_method="with underscore";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_UNDERSCORE 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_BARE])],
- [tw_abort_ok=yes; tw_method=default;DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method=default;echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
fi
dnl
if test $tw_abort_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_NAG])],
- [tw_abort_ok=yes; tw_method="with f90_unix_proc";DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method="with f90_unix_proc";echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
fi
dnl
@@ -118,7 +118,7 @@ if test $tw_abort_ok = no; then
LDFLAGS="$LDFLAGS -Vaxlib"
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_ABORT_BARE])],
- [tw_abort_ok=yes; tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_ABORT"],
+ [tw_abort_ok=yes; tw_method="with -Vaxlib";echo "#define FC_HAVE_ABORT 1" >> confdefs.h],
[])
if test $tw_abort_ok = no; then
LDFLAGS=$save_LDFLAGS
diff --git a/config/m4/TW_FC_CHECK_FLUSH.m4 b/config/m4/TW_FC_CHECK_FLUSH.m4
index cb1bd7d0..fb5331db 100644
--- a/config/m4/TW_FC_CHECK_FLUSH.m4
+++ b/config/m4/TW_FC_CHECK_FLUSH.m4
@@ -78,14 +78,14 @@ tw_flush_ok=no
dnl
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_BARE])],
- [tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;echo "#define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
if test $tw_flush_ok = no; then
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Vaxlib"
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_BARE])],
- [tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";echo "$define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
if test $tw_flush_ok = no; then
LDFLAGS=$save_LDFLAGS
@@ -94,7 +94,7 @@ fi
if test $tw_flush_ok = no; then
AC_LINK_IFELSE(
[AC_LANG_SOURCE([_TW_TRY_FLUSH_NAG])],
- [tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";DEFS="$DEFS FC_HAVE_FLUSH"],
+ [tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";echo "#define FC_HAVE_FLUSH 1" >> confdefs.h],
[])
fi
if test $tw_flush_ok = no; then
diff --git a/config/m4/TW_FC_ID_FLAGS.m4 b/config/m4/TW_FC_ID_FLAGS.m4
index 8927152f..19e38669 100644
--- a/config/m4/TW_FC_ID_FLAGS.m4
+++ b/config/m4/TW_FC_ID_FLAGS.m4
@@ -81,7 +81,7 @@ case $FC_ID in
Nag)
FFLAGS_DEBUG="-C=all -g -gline -nan"
- DEFS="$DEFS __NAG__"
+ echo "#define __NAG__ 1" >> confdefs.h
;;
Pathscale)
@@ -90,7 +90,7 @@ case $FC_ID in
Portland)
FFLAGS_DEBUG="-g -Mbounds"
FFLAGS_FAST="-fast"
- DEFS="$DEFS PGF90"
+ echo "#define PGF90 1" >> confdefs.h
;;
SGI)
diff --git a/configure b/configure
index e764beeb..47a578dd 100755
--- a/configure
+++ b/configure
@@ -2647,7 +2647,7 @@ case $FC_ID in
Nag)
FFLAGS_DEBUG="-C=all -g -gline -nan"
- DEFS="$DEFS __NAG__"
+ echo "#define __NAG__ 1" >> confdefs.h
;;
Pathscale)
@@ -2656,7 +2656,7 @@ case $FC_ID in
Portland)
FFLAGS_DEBUG="-g -Mbounds"
FFLAGS_FAST="-fast"
- DEFS="$DEFS PGF90"
+ echo "#define PGF90 1" >> confdefs.h
;;
SGI)
@@ -2743,7 +2743,7 @@ if test "${enable_dummy+set}" = set; then :
fi
if test x$dummy = xyes; then
- DEFS="$DEFS DUMMYLIB"
+ echo "#define DUMMYLIB 1" >> confdefs.h
dom_yes=
fi
BUILD_TARGETS="$wxml_yes $wcml_yes $wkml_yes $sax_yes $dom_yes"
@@ -3002,7 +3002,7 @@ cat > conftest.$ac_ext <<_ACEOF
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;DEFS="$DEFS FC_HAVE_FLUSH"
+ tw_flush_ok=yes; TW_FLUSH=bare;tw_method=default;echo "#define FC_HAVE_FLUSH 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3018,7 +3018,7 @@ if test $tw_flush_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_FLUSH"
+ tw_flush_ok=yes; TW_FLUSH=INTEL;tw_method="with -Vaxlib";echo "$define FC_HAVE_FLUSH 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3037,7 +3037,7 @@ if test $tw_flush_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";DEFS="$DEFS FC_HAVE_FLUSH"
+ tw_flush_ok=yes; TW_FLUSH=NAG;tw_method="with f90_unix_io";echo "#define FC_HAVE_FLUSH 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3080,7 +3080,7 @@ if test $tw_abort_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_abort_ok=yes; tw_method="with argument";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_ARG"
+ tw_abort_ok=yes; tw_method="with argument";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_ARG 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3094,7 +3094,7 @@ if test $tw_abort_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_abort_ok=yes; tw_method="with underscore";DEFS="$DEFS FC_HAVE_ABORT FC_ABORT_UNDERSCORE"
+ tw_abort_ok=yes; tw_method="with underscore";echo "#define FC_HAVE_ABORT 1" >> confdefs.h; echo "#define FC_ABORT_UNDERSCORE 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3108,7 +3108,7 @@ if test $tw_abort_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_abort_ok=yes; tw_method=default;DEFS="$DEFS FC_HAVE_ABORT"
+ tw_abort_ok=yes; tw_method=default;echo "#define FC_HAVE_ABORT 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3123,7 +3123,7 @@ if test $tw_abort_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_abort_ok=yes; tw_method="with f90_unix_proc";DEFS="$DEFS FC_HAVE_ABORT"
+ tw_abort_ok=yes; tw_method="with f90_unix_proc";echo "#define FC_HAVE_ABORT 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3139,7 +3139,7 @@ if test $tw_abort_ok = no; then
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
- tw_abort_ok=yes; tw_method="with -Vaxlib";DEFS="$DEFS FC_HAVE_ABORT"
+ tw_abort_ok=yes; tw_method="with -Vaxlib";echo "#define FC_HAVE_ABORT 1" >> confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -3208,11 +3208,11 @@ $as_echo "$ac_cv_FC_check_output_eol" >&6; }
case $ac_cv_FC_check_output_eol in
CRLF)
- DEFS="$DEFS FC_EOR_CRLF";;
+ echo "#define FC_EOR_CRLF 1" >> confdefs.h;;
CR)
- DEFS="$DEFS FC_EOR_CR";;
+ echo "#define FC_EOR_CR 1" >> confdefs.h;;
LF)
- DEFS="$DEFS FC_EOR_LF";;
+ echo "#define FC_EOR_LF 1" >> confdefs.h;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ASSOCIATED in restricted expression bug" >&5
@@ -3239,7 +3239,7 @@ $as_echo "no" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- DEFS="$DEFS RESTRICTED_ASSOCIATED_BUG"
+ echo "#define RESTRICTED_ASSOCIATED_BUG 1" >> confdefs.h
fi
From b3e854f2b047b11453db4b735dd77b9c4e5390af Mon Sep 17 00:00:00 2001
From: Andrew Walker
Date: Tue, 23 Feb 2021 17:24:59 +0000
Subject: [PATCH 30/31] Create copy of html documentation for gh-pages
make in DoX will update this. No change to the
documentation at this stage.
---
DoX/Compilation.html | 2 +-
DoX/FoX_DoX.html | 6 +-
DoX/Information.html | 4 +-
DoX/makefile | 1 +
docs/AttributeDictionaries.html | 206 +++++++++
docs/Compilation.html | 209 +++++++++
docs/Debugging.html | 73 +++
docs/DoX.css | 53 +++
docs/Embedding.html | 131 ++++++
docs/FoX.html | 97 ++++
docs/FoX_common.html | 46 ++
docs/FoX_dom.html | 779 ++++++++++++++++++++++++++++++++
docs/FoX_sax.html | 575 +++++++++++++++++++++++
docs/FoX_utils.html | 155 +++++++
docs/FoX_wcml.html | 525 +++++++++++++++++++++
docs/FoX_wkml.html | 441 ++++++++++++++++++
docs/FoX_wxml.html | 453 +++++++++++++++++++
docs/Information.html | 24 +
docs/Licensing.html | 82 ++++
docs/Standards.html | 47 ++
docs/StringConversion.html | 89 ++++
docs/StringFormatting.html | 141 ++++++
docs/Versioning.html | 37 ++
docs/index.html | 97 ++++
24 files changed, 4267 insertions(+), 6 deletions(-)
create mode 100644 docs/AttributeDictionaries.html
create mode 100644 docs/Compilation.html
create mode 100644 docs/Debugging.html
create mode 100644 docs/DoX.css
create mode 100644 docs/Embedding.html
create mode 100644 docs/FoX.html
create mode 100644 docs/FoX_common.html
create mode 100644 docs/FoX_dom.html
create mode 100644 docs/FoX_sax.html
create mode 100644 docs/FoX_utils.html
create mode 100644 docs/FoX_wcml.html
create mode 100644 docs/FoX_wkml.html
create mode 100644 docs/FoX_wxml.html
create mode 100644 docs/Information.html
create mode 100644 docs/Licensing.html
create mode 100644 docs/Standards.html
create mode 100644 docs/StringConversion.html
create mode 100644 docs/StringFormatting.html
create mode 100644 docs/Versioning.html
create mode 100644 docs/index.html
diff --git a/DoX/Compilation.html b/DoX/Compilation.html
index 9f7fbeda..8a1b7a52 100644
--- a/DoX/Compilation.html
+++ b/DoX/Compilation.html
@@ -69,7 +69,7 @@
Testing
To run them all, simply run make check from the top-level directory. This will run the individual testsuites, and collate their results.
-
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
+
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
The testsuites for the SAX and DOM libraries are very extensive, and are somewhat fragile, so are not distributed with FoX. Please contact the author for details.
To run them all, simply run make check from the top-level directory. This will run the individual testsuites, and collate their results.
-
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
+
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
The testsuites for the SAX and DOM libraries are very extensive, and are somewhat fragile, so are not distributed with FoX. Please contact the author for details.
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
+
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
+
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
When parsing XML using the FoX SAX module, attributes are returned contained within a dictionary object.
+
+
This dictionary object implements all the methods described by the SAX interfaces Attributes and Attributes2. Full documentation is available from the SAX Javadoc, but is reproduced here for ease of reference.
+
+
All of the attribute dictionary objects and functions are exported through FoX_sax - you must USE the module to enable them. The dictionary API is described here.
+
+
An attribute dictionary consists of a list of entries, one for each attribute. The entries all have the following pieces of data:
+
+
+
qName - the attribute's full name
+
value - the attribute's value
+
+
+
and for namespaced attributes:
+
+
+
uri - the namespace URI (if any) of the attribute
+
localName - the local name of the attribute
+
+
+
In addition, the following pieces of data will be picked up from a DTD if present:
+
+
+
declared - is the attribute declared in the DTD?
+
specified - is this instance of the attribute specified in the XML document, or is it a default from the DTD?
+
type - the type of the attribute (if declared)
+
+
+
+
+
Derived types
+
+
There is one derived type of interest, dictionary_t.
+
+
It is opaque - that is, it should only be manipulated through the functions described here.
+
+
Functions
+
+
Inspecting the dictionary
+
+
+
getLength
+type(dictionary_t), intent(in) :: dict
+
+
+
Returns an integer with the length of the dictionary, ie the number of dictionary entries.
You will have received the FoX source code as a tar.gz file.
+
+
Unpack it as normal, and change directory into the top-level directory, FoX-$VERSION.
+
+
Requirements for use
+
+
FoX requires a Fortran 95 compiler - not just Fortran 90. All currently available versions of Fortran compilers claim to support F95. If your favoured compiler is not listed as working, I recommend the use of g95, which is free to download and use. And in such a case, please send a bug report to your compiler vendor.
+
+
In the event that you need to write a code targetted at multiple compilers, including some which have bugs preventing FoX compilation, please note the possibility of producing a dummy library.
+
+
Configuration
+
+
+
In order to generate the Makefile, make sure that you have a Fortran compiler in your PATH, and do:
+
+
./configure
+
+
+
This should suffice for most installations. However:
+
+
+
You may not be interested in all of the modules that FoX supplies. For example, you may only be interested in output, not input. If so, you can select which modules you want using --enable-MODULENAME where MODULENAME is one of wxml, wcml, wkml, sax, dom. If none are explicitly enabled, then all will be built. (Alternatively, you can exclude modules one at a time with --disable-MODULENAME) Thus, for example, if you only care about CML output, and not anything else: ./configure --enable-wcml
+
If you have more than one Fortran compiler available, or it is not on your PATH, you can force the choice by doing:
+
+
./configure FC=/path/to/compiler/of/choice
+
It is possible that the configuration fails. In this case
+
+
+
please tell me about it so I can fix it
+
all relevant compiler details are placed in the file arch.make; you may be able to edit that file to allow compilation. Again, if so, please let me know what you need to do.
+
+
By default the resultant files are installed under the objs directory. If you wish them to be installed elsewhere, you may do
+
+
./configure --prefix=/path/to/installation
+
+
+
Note that the configure process encodes the current directory location in several
+places. If you move the FoX directory later on, you will need to re-run configure.
+
+
+
You may be interested in dummy compilation. This is activated with the --enable-dummy switch (but only works for wxml/wcml currently).
+
+
./configure --enable-wcml --enable-dummy
+
+
+
Compilation
+
+
In order to compile the full library, now simply do:
+
+
make
+
+
+
This will build all the requested FoX modules, and the relevant examples
+
+
Testing
+
+
In the full version of the FoX library, there are several testsuites included.
+
+
To run them all, simply run make check from the top-level directory. This will run the individual testsuites, and collate their results.
+
+
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
+
+
The testsuites for the SAX and DOM libraries are very extensive, and are somewhat fragile, so are not distributed with FoX. Please contact the author for details.
+
+
Linking to an existing program
+
+
+
The files all having been compiled and installed, you need to link them into your program.
+
+
+
A script is provided which will provide the appropriate compiler and linker flags for you; this will be created after configuration, in the top-level directory, and is called FoX-config. It may be taken from there and placed anywhere.
+
+
FoX-config takes the following arguments:
+
+
+
--fcflags: return flags for compilation
+
--libs: return flags for linking
+
--wxml: return flags for compiling/linking against wxml
+
--wcml: return flags for compiling/linking against wcml
+
--sax: return flags for compiling/linking against sax
+
+
+
If it is called with no arguments, it will expand to compile & link flags, thusly:
+
+
f95 -o program program.f90 `FoX-config`
+
+
+
For compiling only against FoX, do the following:
+
+
f95 -c `FoX-config --fcflags` sourcefile.f90
+
+
+
For linking only to the FoX library, do:
+
+
f95 -o program `FoX-config --libs` *.o
+
+
+
or similar, according to your compilation scheme.
+
+
Note that by default, FoX-config assumes you are using all modules of the library. If you are only using part, then this can be specified by also passing the name of each module required, like so:
+
+
FoX-config --fcflags --wcml
+
+
+
Compiling a dummy library
+
+
+
+
Because of the shortcomings in some compilers, it is not possible to compile FoX everywhere. Equally, sometimes it is useful to be able to compile a code both with and without support for FoX (perhaps to reduce executable size). Especially where FoX is being used only for additional output, it is useful to be able to run the code and perform computations even without the possibility of XML output.
+
+
For this reason, it is possible to compile a dummy version of FoX. This includes all public interfaces, so that your code will compile and link correctly - however none of the subroutines do anything, so you can retain the same version of your code without having to comment out all FoX calls.
+
+
Because this dummy version of FoX contains nothing except empty subroutines, it compiles and links with all known Fortran 95 compilers, regardless of compiler bugs.
+
+
To compile the dummy code, use the --enable-dummy switch. Note that currently the dummy mode is not yet available for the DOM module.
+
+
Alternative build methods
+
+
The "-full" versions of FoX are also shipped with files
+to help compile the code on using other systems using CMake
+or from within Microsoft Visual Studio. Brief instructions for
+using these files are below.
+
+
CMake
+
+
CMake does not build software itself but generates makefiles or
+projectfiles (depending on the platform), that are then used to
+compile the software, it should thus be a cross platform
+method for building FoX (in theory at least).
+
+
Files needed for building FoX with CMake are included in the
+"-full" distribution. These can:
+
+
+
do similar checks as current build tools to check for example how
+ABORT and FLUSH work,
+wether or not certain bugs in compilers are present,
+
compile FoX into static libraries.
+
generate Fortran files from m4 sources if m4 is present.
+
do out-of-source build, does not interfere with current build system
+
do a parallel build of fox (make -j)
+
+
+
However, CMake cannot, at present, build the run the test suite or
+the packaging scripts used for release. To build FoX with CMake
+the following is needed:
m4 to generate fortran files from m4 sources (optional).
+
+
+
CMake Build instructions (linux):
+Once you installed cmake, go to the main directory of fox
+and create a build directory, and from there, execute cmake thus:
+
+
cd fox/
+
+mkdir build/ && cd build/
+
+cmake ../
+
+make -j
+
+
+
Libaries and module files can then be found in the subdirectories of build.
+
+
Windows
+
+
It is also possible to build FoX from within Microsoft Visual Studio
+and the file FoX.vfproj contains a Visual Studio project for Intel Fortran
+to simplify this process. At time of writing, it is compatible with
+Visual Studio 2011 and Intel Visual Fortran Composer XE 2011.
+
+
The project will build FoX in one of the four
+ configurations: Win32/x64 and debug/release.
+When building FoX for a specific configuration,
+an output library file Fox_debug.lib or Fox.lib
+and associated modules are created in a folder in
+a relative path ../lib or ../libx64 respectively.
+
+
For a given configuration in in your application project
+you will then need to:
+
+
+
In "Fortran" "General" "Additional Include Directories" add
+the respective modules folder (generated above)
+
In "Linker" "General" "Additional library directories" add the
+path to the respective lib or libx64 folder.
+
In "Linker" "Input" "Additional dependencies" add Fox_debug.lib
+or FoX.lib respectively.
+
+
+
Your application should now be able to build and link with FoX.
Following experience integrating FoX_wxml into several codes, here are a few tips for debugging any problems you may encounter.
+
+
Compilation problems
+
+
You may encounter problems at the compiling or linking stage, with error messages along the lines of:
+ 'No Specific Function can be found for this Generic Function'
+(exact phrasing depending on compiler, of course.)
+
+
If this is the case, it is possible that you have accidentally got the arguments to the offending out of order. If so, then use the keyword form of the argument to ensure correctness; that is, instead of doing:
This will prevent argument mismatches, and is recommended practise in any case.
+
+
Runtime problems
+
+
You may encounter run-time issues. FoX performs many run-time checks to ensure the validity of the resultant XML code. In so far as it is possible, FoX will either issue warnings about potential problems, or try and safely handle any errors it encounters. In both cases, warning will be output on stderr, which will hopefully help diagnose the problem.
+
+
Sometimes, however, FoX will encounter a problem it can do nothing about, and must stop. In all cases, it will try and write out an error message highlighting the reason, and generate a backtrace pointing to the offending line. Occasionally though, the compiler will not generate this information, and the error message will be lost.
+
+
If this is the case, you can either investigate the coredump to find the problem, or (if you are on a Mac) look in ~/Library/Logs/CrashReporter to find a human-readable log.
+
+
If this is not enlightening, or you cannot find the problem, then some of the most common issues we have encountered are listed below. Many of them are general Fortran problems, but sometimes are not easily spotted in the context of FoX.
+
+
Incorrect formatting.
+
+
Make sure, whenever you are writing out a real number through one of FoX's routines, and specifying a format, that the format is correct according to StringFormatting. Fortran-style formats are not permitted, and will cause crashes at runtime.
+
+
Array overruns
+
+
If you are outputting arrays or matrices, and are doing so in the traditional Fortran style - by passing both the array and its length to the routine, like so:
where the array length will be passed automatically.
+
+
Uninitialized variables
+
+
If you are passing variables to FoX which have not been initialized, you may well cause a crash. This is especially true, and easy to cause if you are passing in an array which (due to a bug elsewhere) has been partly but not entirely initialized. To diagnose this, try printing out suspect variables just before passing them to FoX, and look for suspiciously wrong values.
+
+
Invalid floating point numbers.
+
+
If during the course of your calculation you accidentally generate Infinities, or NaNs, then passing them to any Fortran subroutine can result in a crash - therefore trying to pass them to FoX for output may result in a crash.
+
+
If you suspect this is happening, try printing out suspect variables before calling FoX.
The recommended way to use FoX is to embed the full source code as a subdirectory, into an existing project.
+
+
In order to do this, you need to do something like the following:
+
+
+
Put the full source code as a top-level subdirectory of the tree, called FoX.
+
Incorporate calls to FoX into the program.
+
Incorporate building FoX into your build process.
+
+
+
To incorporate into the program
+
+
It is probably best to isolate use of XML facilities to a small part of the program. This is easily accomplished for XML input,
+which will generally happen in only one or two places.
+
+
For XML output, this can be more complex. The easiest, and least intrusive way is probably to create a F90 module for your program, looking something like example_xml_module.f90
+
+
Then you must somewhere (probably in your main program), use this module, and call initialize_xml_output() at the start; and then end_xml_output() at the end of the program.
+
+
In any of the subroutines where you want to output data to the xml file, you should then insert use example_xml_module at the beginning of the subroutine. You can then use any of the xml output routines with no further worries, as shown in the examples.
+
+
It is easy to make the use of FoX optional, by the use of preprocessor defines. This can be done simply by wrapping each call to your XML wrapper routines in #ifdef XML, or similar. Alternatively, the use of the dummy FoX interfaces allows you to switch FoX on and off at compile time - see Compilation.
+
+
To incorporate into the build process:
+
+
Configuration
+
+
First, FoX must be configured, to ensure that it is set up correctly for your compiler.
+(See Compilation)
+If your main code has a configure step, then run FoX's configure as part of it.
+
+
If your code doesn't have its own configure step, then the first thing that "make" does
+should be to configure FoX, if it's not already configured. But that should only happen
+once; every time you make your code thereafter, you don't need to re-configure FoX,
+because nothing has changed. To do that, put a target like the following in your
+Makefile.
+
+
FoX/.config:
+ (cd FoX; ./configure FC=$(FC))
+
+
+
(Assuming that your Makefile already has a variable FC which sets the Fortran compiler)
+
+
When FoX configure completes, it "touch"es a file called FoX/.config. That means that
+whenever you re-run your own make, it checks to see if FoX/.config exists - if it does,
+then it knows FoX doesn't need to be re-configured, so it doesn't bother.
+
+
Compilation of FoX
+
+
Then, FoX needs to be compiled before your code (because your modules will depend
+on FoX's modules.) But again, it only needs to be compiled once. You won't be changing
+FoX, you'll only be changing your own code, so recompiling your code doesn't require
+recompiling FoX.
+
+
So, add another target like the following;
+
+
FoX/.FoX: FoX/.config
+ (cd FoX; $(MAKE))
+
+
+
This has a dependency on the configure script as I showed above, but it will only run it
+if the configure script hasn't already been run.
+
+
When FoX is successfully compiled, the last thing its Makefile does is "touch" the file called
+FoX/.FoX. So the above target checks to see if that file exists; and if it does, then it doesn't
+bother recompiling FoX, because it's already compiled. On the very first time you compile
+your code, it will cd into the FoX directory and compile it - but then never again.
+
+
You then need to have that rule be a dependency of your main target; like so:
+
+
MyExecutable: FoX/.FoX
+
+
+
(or whatever your default Makefile rule is).
+
+
which will ensure that before MyExecutable is compiled, make will check to see that FoX
+has been compiled (which most of the time it will be, so nothing further will happen).
+But the first time you compile your code, it will call the FoX target, and FoX will be
+configured & compiled.
+
+
Compiling/linking your code
+
+
You should add this to your FFLAGS (or equivalent - the variable that holds
+flags for compile-time use.
to make sure that you get the path to your modules. (Different compilers have different flags for specifying module
+paths; some use -I, some use -M, etc, if you use the above
+construction it will pick the right one automatically for your compiler.)
+
+
Similarly, for linking, add the following to your LDFLAGS (or equivalent - the variable
+that holds flags for link-time use.)
+
+
LDFLAGS=-lwhatever $$(FoX/FoX-config --libs)
+
+
+
(For full details of the FoX-config script, see Compilation)
+
+
Cleaning up
+
+
Finally - you probably have a clean target in your makefile. Don't tie FoX into this
+target - most of the time when you make clean, you don't want to make clean with
+FoX as well, because there's no need - FoX won't have changed and
+it'll take a couple of minutes to recompile.
+
+
However, you can add a distclean (or something) target, which you use before
+moving your code to another machine, that looks like:
+
+
distclean: clean
+ (cd FoX; $(MAKE) distclean)
+
+
+
and that will ensure that when you do make distclean, even FoX's object files are
+cleaned up. But of course that will mean that you have to reconfigure & recompile
+FoX next time you compile your code
+
+
+
diff --git a/docs/FoX.html b/docs/FoX.html
new file mode 100644
index 00000000..7222c5d0
--- /dev/null
+++ b/docs/FoX.html
@@ -0,0 +1,97 @@
+
+
+
+
+ FoX
+
+
+
+
This documentation is largely reference in nature. For new users it is best to start elsewhere:
+
+
iFaX workshops
+
+
Two workshops, entitled iFaX (Integrating Fortran and XML) have been run teaching the use of FoX, one in January 2007, and one in January 2008. The full documentation and lectures from these may be found at:
These documents describe all publically usable APIs.
+
+
Worked examples of the use of some of these APIs may be found in the examples/ subdirectory, and tutorial-style documentaion is available from the links above.
The subroutine rts performs the reverse function, taking a string (obtained from an XML document) and converts it into a primitive Fortran datatype.
+
The function countrts examinies a string and determines the size of array requiered to hold all its data, once converted to a primitive Fortran datatype.
The final four procedures change the way that errors and warnings are handled when encounterd by any FoX modules. Using these procedures it is possible to convert non-fatal warnings and fatal errors to calls to the internal about routine. This generally has the effect of generating a stack trace or core dump of the program before temination. This is a global setting for all XML documents being manipulated. Two subroutines take a single logical argument to turn on (true) and off (false) the feature for warnings and errors respectivly:
+
+
+
FoX_set_fatal_warnings for warnings
+
FoX_set_fatal_errors for errors
+
+
+
and two functions (without arguments) allow the state to be checked:
+
+
+
FoX_get_fatal_warnings for warnings
+
FoX_get_fatal_errors for errors
+
+
+
Both fatal warnings and errors are off by default. This corresponds to the previous behaviour.
The FoX DOM interface exposes an API as specified by the W3C DOM Working group.
+
+
FoX implements essentially all of DOM Core Levels 1 and 2, (there are a number of minor exceptions which are listed below) and a substantial portion of DOM Core Level 3.
FoX implements all objects and methods mandated in DOM Core Level 1 and 2. (A listing of supported DOM Core Level 3 interfaces is given below.)
+
+
In all cases, the mapping from DOM interface to Fortran implementation is as follows:
+
+
+
All DOM objects are available as Fortran types, and should be referenced only as pointers (though see 7 and 8 below). Thus, to use a Node, it must be declared first as:
+type(Node), pointer :: aNode
+
A flat (non-inheriting) object hierarchy is used. All DOM objects which inherit from Node are represented as Node types.
+
All object method calls are modelled as functions or subroutines with the same name, whose first argument is the object. Thus:
+aNodelist = aNode.getElementsByTagName(tagName)
+should be converted to Fortran as:
+aNodelist => getElementsByTagName(aNode, tagName)
+
All object method calls whose return type is void are modelled as subroutines. Thus:
+aNode.normalize()
+becomes
+call normalize(aNode)
+
All object attributes are modelled as a pair of get/set calls (or only get where the attribute is readonly), with the naming convention being merely to prepend get or set to the attribute name. Thus:
+name = node.nodeName
+node.nodeValue = string
+should be converted to Fortran as
+name = getnodeName(node)
+call setnodeValue(string)
+
Where an object method or attribute getter returns a DOM object, the relevant Fortran function must always be used as a pointer function. Thus:
+aNodelist => getElementsByTagName(aNode, tagName)
+
No special DOMString object is used - all string operations are done on the standard Fortran character strings, and all functions that return DOMStrings return Fortran character strings.
+
Exceptions are modelled by every DOM subroutine/function allowing an optional additional argument, of type DOMException. For further information see (DOM Exceptions.html) below.
+
+
+
String handling
+
+
+
+
The W3C DOM requires that a DOMString object exist, capable of holding Unicode strings; and that all DOM functions accept and emit DOMString objects when string data is to be transferred.
+
+
FoX does not follow this model. Since (as mentioned elsewhere) it is impossible to perform Unicode I/O in standard Fortran, it would be obtuse to require users to manipulate additional objects merely to transfer strings. Therefore, wherever the DOM mandates use of a DOMString, FoX merely uses standard Fortran character strings.
+
+
All functions or subroutines which expect DOMString input arguments should be used with normal character strings.
+All functions which should return DOMString objects will return Fortran character strings.
+
+
Using the FoX DOM library.
+
+
All functions are exposed through the module FoX_DOM. USE this in your program:
+
+
program dom_example
+
+ use FoX_DOM
+ type(Node) :: myDoc
+
+ myDoc => parseFile("fileIn.xml")
+ call serialize(myDoc, "fileOut.xml")
+end program dom_example
+
+
+
Documenting DOM functions
+
+
+
+
This manual will not exhaustively document the functions available through the Fox_DOM interface. Primary documentation may be found in the W3C DOM specifications:`
The systematic rules for translating the DOM interfaces to Fortran are given in the previous section. For completeness, though, there is a list here. The W3C specifications should be consulted for the use of each.
The DOM is written in terms of an object model involving inheritance, but also permits a flattened model. FoX implements this flattened model - all objects descending from the Node are of the opaque type Node. Nodes carry their own type, and attempts to call functions defined on the wrong nodetype (for example, getting the target of a node which is not a PI) will result in a FoX_INVALID_NODE exception.
+
+
The other types available through the FoX DOM are:
+
+
+
DOMConfiguration
+
DOMException
+
DOMImplementation
+
NodeList
+
NamedNodeMap
+
+
+
FoX DOM and pointers
+
+
All DOM objects exposed to the user may only be manipulated through pointers. Attempts to access them directly will result in compile-time or run-time failures according to your environment.
+
+
This should have little effect on the structure of your programs, except that you must always remember, when calling a DOM function, to perform pointer assignment, not direct assignment, thus:
+child => getFirstChild(parent)
+and not
+child = getFirstChild(parent)
+
+
Memory handling
+
+
Fortran offers no garbage collection facility, so unfortunately a small degree of memory
+handling is necessarily exposed to the user.
+
+
However, this has been kept to a minimum. FoX keeps track of all memory allocated and used when calling DOM routines, and keeps references to all DOM objects created.
+
+
The only memory handling that the user needs to take care of is destroying any
+DOM Documents (whether created manually, or by the parse() routine.) All other nodes or node structures created will be destroyed automatically by the relevant destroy() call.
+
+
As a consequence of this, all DOM objects which are part of a given document will become inaccessible after the document object is destroyed.
+
+
Additional functions.
+
+
+
+
Several additional utility functions are provided by FoX.
+
+
Input and output of XML data
+
+
Firstly, to construct a DOM tree, from either a file or a string containing XML data.
filename should be an XML document. It will be opened and parsed into a DOM tree. The parsing is performed by the FoX SAX parser; if the XML document is not well-formed, a PARSE_ERR exception will be raised. configuration is an optional argument - see DOMConfiguration for its meaning.
XMLstring should be a string containing XML data. It will be parsed into a DOM tree. The parsing is performed by the FoX SAX parser; if the XML document is not well-formed, a PARSE_ERR exception will be raised. configuration is an optional argument - see DOMConfiguration for its meaning.
+
+
Both parseFile and parseString return a pointer to a Node object containing the Document Node.`
+
+
Secondly, to output an XML document:
+
+
+
serialize
+arg: Node, pointer
+fileName: string
+
+
+
This will open fileName and serialize the DOM tree by writing into the file. If fileName already exists, it will be overwritten. If an problem arises in serializing the document, then a fatal error will result.
+
+
(Control over serialization options is done through the configuration of the arg's ownerDocument, see below.)
+
+
Finally, to clean up all memory associated with the DOM, it is necessary to call:
+
+
+
destroy
+np: Node, pointer
+
+
+
This will clear up all memory usage associated with the document (or documentType) node passed in.
+
+
Extraction of data from an XML file.
+
+
+
+
The standard DOM functions only deal with string data. When dealing with numerical (or logical) data,
+the following functions may be of use.
+
+
+
extractDataContent
+
extractDataAttribute
+
extractDataAttributeNS
+
+
+
These extract data from, respectively, the text content of an element, from one of its attributes, or from one of its namespaced attributes.
+They are used like so:
+
+
(where p is an element which has been selected by means of the other DOM functions)
+
+
call extractDataContent(p, data)
+
+
+
The subroutine will look at the text contents of the element, and interpret according to the type of data. That is, if data has been declared as an integer, then the contents of p will be read as such an placed into data.
+
+
data may be a string, logical, integer, real, double precision, complex or double complex variable.
+
+
In addition, if data is supplied as a rank-1 or rank-2 variable (ie an array or a matrix) then the data will be read in assuming it to be a space- or comma-separated list of such data items.
+
+
Thus, the array of integers within the XML document:
+
+
<element> 1 2 3 4 5 6 </element>
+
+
+
could be extracted by the following Fortran program:
The extraction may fail of course, if the data is not of the sort specified, or if there are not enough elements to fill the array or matrix. In such a case, this can be detected by the optional arguments num and iostat.
+
+
num will hold the number of items successfully read. Hopefully this should be equal to the expected number of items; but it may be less if reading failed for some reason, or if there were less items than expected in the element.
+
+
iostat will hold an integer - this will be 0 if the extraction went ok; -1 if too few elements were found, 1 if although the read went ok, there were still some elements left over, or 2 if the extraction failed due to either a badly formatted number, or due to the wrong data type being found.
+
+
String arrays
+
+
For all data types apart from strings, arrays and matrices are specified by space- or comma-separated lists. For strings, some additional options are available. By default, arrays will be extracted assuming that separators are spaces (and multiple spaces are ignored). So:
+
+
<element> one two three </element>
+
+
+
will result in the string array (/"one", "two", "three"/).
+
+
However, you may specify an optional argument separator, which specifies another single-character separator to use (and does not ignore multiple spaces). So:
+
+
<element>one, two, three </element>
+
+
+
will result in the string array (/"one", " two", " three "/). (note the leading and trailing spaces).
+
+
Finally, you can also specify an optional logical argument, csv. In this case, the separator is ignored, and the extraction proceeds assuming that the data is a list of comma-separated values. (see: CSV)
+
+
Other utility functions
+
+
+
setFoX_checks
+FoX_checks: logical
+
+
+
This affects whether additional FoX-only checks are made (see DomExceptions below).
+
+
+
getFoX_checks
+arg: DOMImplementation, pointer
+
+
+
Retrieves the current setting of FoX_checks.
+
+
Note that FoX_checks can only be turned on and off globally, not on a per-document basis.
arg must be a Document Node. Calling this function affects whether any nodelists active on the document are treated as live - ie whether updates to the documents are reflected in the contents of nodelists (see DomLiveNodelists below).
+
+
+
getLiveNodeLists
+arg: Node, pointer
+
+
+
Retrieves the current setting of liveNodeLists.
+
+
Note that the live-ness of nodelists is a per-document setting.
+
+
Exception handling
+
+
+
+
Exception handling is important to the DOM. The W3C DOM standards provide not only interfaces to the DOM, but also specify the error handling that should take place when invalid calls are made.
+
+
The DOM specifies these in terms of a DOMException object, which carries a numeric code whose value reports the kind of error generated. Depending upon the features available in a particular computer language, this DOMException object should be generated and thrown, to be caught by the end-user application.
+
+
Fortran of course has no mechanism for throwing and catching exceptions. However, the behaviour of an exception can be modelled using Fortran features.
+
+
FoX defines an opaque DOMException object.
+Every DOM subroutine and function implemented by FoX will take an optional argument, 'ex', of type DOMException.
+
+
If the optional argument is not supplied, any errors within the DOM will cause an immediate abort, with a suitable error message. However, if the optional argument is supplied, then the error will be captured within the DOMException object, and returned to the caller for inspection. It is then up to the application to decide how to proceed.
+
+
Functions for inspecting and manipulating the DOMException object are described below:
+
+
+
inException:
+ex: DOMException
+
+
+
A function returning a logical value, according to whether ex is in exception - that is, whether the last DOM function or subroutine, from which ex returned, caused an error. Note that this will not change the status of the exception.
+
+
+
getExceptionCode
+ex: DOMException
+
+
+
A function returning an integer value, describing the nature of the exception reported in ex. If the integer is 0, then ex does not hold an exception. If the integer is less than 200, then the error encountered was of a type specified by the DOM standard; for a full list, see below, and for explanations, see the various DOM standards. If the integer is 200 or greater, then the code represents a FoX-specific error. See the list below.
+
+
Note that calling getExceptionCode will clean up all memory associated with the DOMException object, and reset the object such that it is no longer in exception.
+
+
Exception handling and memory usage.
+
+
Note that when an Exception is thrown, memory is allocated within the DOMException object. Calling getExceptionCode on a DOMEXception will clean up this memory. If you use the exception-handling interfaces of FoX, then you must check every exception, and ensure you check its code, otherwise your program will leak memory.
+
+
FoX exceptions.
+
+
The W3C DOM interface allows the creation of unserializable XML document in various ways. For example, it permits characters to be added to a text node which would be invalid XML. FoX performs multiple additional checks on all DOM calls to prevent the creation of unserializable trees. These are reported through the DOMException mechanisms noted above, using additional exception codes. However, if for some reason, you want to create such trees, then it is possible to switch off all FoX-only checks. (DOM-mandated checks may not be disabled.) To do this, use the setFoX_checks function described in DomUtilityFunctions.
+
+
Note that FoX does not yet currently check for all ways that a tree may be made non-serializable.
+
+
List of exceptions.
+
+
The following is the list of all exception codes (both specified in the W3C DOM and those related to FoX-only checks) that can be generated by FoX:
+
+
+
INDEX_SIZE_ERR = 1
+
DOMSTRING_SIZE_ERR = 2
+
HIERARCHY_REQUEST_ERR = 3
+
WRONG_DOCUMENT_ERR = 4
+
INVALID_CHARACTER_ERR = 5
+
NO_DATA_ALLOWED_ERR = 6
+
NO_MODIFICATION_ALLOWED_ERR = 7
+
NOT_FOUND_ERR = 8
+
NOT_SUPPORTED_ERR = 9
+
INUSE_ATTRIBUTE_ERR = 10
+
INVALID_STATE_ERR = 11
+
SYNTAX_ERR = 12
+
INVALID_MODIFICATION_ERR = 13
+
NAMESPACE_ERR = 14
+
INVALID_ACCESS_ERR = 15
+
VALIDATION_ERR = 16
+
TYPE_MISMATCH_ERR = 17
+
INVALID_EXPRESSION_ERR = 51
+
TYPE_ERR = 52
+
PARSE_ERR = 81
+
SERIALIZE_ERR = 82
+
FoX_INVALID_NODE = 201
+
FoX_INVALID_CHARACTER = 202
+
FoX_NO_SUCH_ENTITY = 203
+
FoX_INVALID_PI_DATA = 204
+
FoX_INVALID_CDATA_SECTION = 205
+
FoX_HIERARCHY_REQUEST_ERR = 206
+
FoX_INVALID_PUBLIC_ID = 207
+
FoX_INVALID_SYSTEM_ID = 208
+
FoX_INVALID_COMMENT = 209
+
FoX_NODE_IS_NULL = 210
+
FoX_INVALID_ENTITY = 211
+
FoX_INVALID_URI = 212
+
FoX_IMPL_IS_NULL = 213
+
FoX_MAP_IS_NULL = 214
+
FoX_LIST_IS_NULL = 215
+
FoX_INTERNAL_ERROR = 999
+
+
+
Live nodelists
+
+
+
+
The DOM specification requires that all NodeList objects are live - that is, that any change in the document structure is immediately reflected in the contents of any nodelists.
+
+
For example, any nodelists returned by getElementsByTagName or getElementsByTagNameNS must be updated whenever nodes are added to or removed from the document; and the order of nodes in the nodelists must be changed if the document structure changes.
+
+
Though FoX does keep all nodelists live, this can impose a significant performance penalty when manipulating large documents. Therefore, FoX can be instructed to inly use 'dead' nodelists - that is, nodelists which reflect a snapshot of the document structure at the point they were created. To do this, call setLiveNodeLists (see API documentation).
+
+
However, note that the nodes within the nodelist remain live - any changes made to the nodes will be reflected in accessing them through the nodelist.
+
+
Furthermore, since the nodelists are still associated with the document, they and their contents will be rendered inaccessible when the document is destroyed.
+
+
DOM Configuration
+
+
+
+
Multiple valid DOM trees may be produced from a single document. When parsing input, some of these choices are made available to the user.
+
+
By default, the DOM tree presented to the user will be produced according to the following criteria:
+
+
+
there will be no adjacent text nodes
+
Cdata nodes will appear as such in the DOM tree
+
EntityReference nodes will appear in the DOM tree.
+
+
+
However, if another tree is desired, the user may change this. For example, very often you would rather be working with the fully canonicalized tree, with all cdata sections replaced by text nodes and merged, and all entity references replaced with their contents.
+
+
The mechanism for doing this is the optional configuration argument to parseFile and parseString. configuration is a DOMConfiguration object, which may be manipulated by setParameter calls.
+
+
Note that FoX's implementation of DOMConfiguration does not follow the specification precisely. One DOMConfiguration object controls all of parsing, normalization and serialization. It can be used like so:
+
+
use FoX_dom
+implicit none
+type(Node), pointer :: doc
+! Declare a new configuration object
+type(DOMConfiguration), pointer :: config
+! Request full canonicalization
+! ie convert CDATA sections to text sections, remove all entity references etc.
+config => newDOMConfig()
+call setParameter(config, "canonical-form", .true.)
+! Turn on validation
+call setParameter(config, "validate", .true.)
+! parse the document
+doc => parseFile("doc.xml", config)
+
+! Do a whole lot of DOM processing ...
+
+! change the configuration to allow cdata-sections to be preserved.
+call setParameter(getDomConfig(doc), "cdata-sections", .true.)
+! normalize the document again
+call normalizeDocument(doc)
+! change the configuration to influence the output - make sure there is an XML declaration
+call setParameter(getDomConfig(doc), "xml-declaration", .true.)
+! and write the document out.
+call serialize(doc)
+! once everything is done, destroy the doc and config
+call destroy(doc)
+call destroy(config)
+
+
+
The available configuration options are fully explained in:
and are all implemented, with the exceptions of: error-handler, schema-location, and schema-type.
+In total there are 24 implemented configuration options (schema-location and schema-type are not
+implemented). The options known by FoX are as follows:
+
+
+
canonical-form default: false, can be set to true. See note below.
+
cdata-sections default: true, can be changed.
+
check-character-normalization default: false, cannot be changed.
+
comments default: true, can be changed.
+
datatype-normalization default: false, cannot be changed.
+
element-content-whitespace default: true, can be changed.
+
entities default: true, can be changed.
+
error-handler default: false, cannot be changed. This is a breach of the DOM specification.
+
namespaces default: true, can be changed.
+
namespace-declarations default: true, can be changed.
+
normalize-characters default: false, cannot be changed.
+
split-cdata-sections default: true, can be changed.
+
validate default: false, can be changed. See note below.
+
validate-if-schema default: false, can be changed.
+
well-formed default true, cannot be changed.
+
charset-overrides-xml-encoding default false, cannot be changed.
+
disallow-doctype default false, cannot be changed.
+
ignore-unknown-character-denormalizations default true, cannot be changed.
+
resource-resolver default false, cannot be changed.
+
supported-media-types-only default false, cannot be changed.
+
discard-default-content default: true, can be changed.
+
format-pretty-print default: false, cannot be changed.
+
xml-declaration default: true, can be changed.
+
invalid-pretty-print default: false, can be changed. This is a FoX specific extension which works like format-pretty-print but does not preseve the validity of the document.
+
+
+
Setting canonical-form changes the value of entities, cdata-sections, discard-default-content, invalid-pretty-print, and xml-declarationto false and changes namespaces, namespace-declarations, and element-content-whitespace to true. Unsetting canonical-form causes these options to revert to the defalt settings. Changing the values of any of these options has the side effect of unsetting canonical-form (but does not cause the other options to be reset). Setting validate unsets validate-if-schema and vica versa.
+
+
DOM Miscellanea
+
+
+
+
Other issues
+
+
+
As mentioned in the documentation for WXML, it is impossible within Fortran to reliably output lines longer than 1024 characters. While text nodes containing such lines may be created in the DOM, on serialization newlines will be inserted as described in the documentation for WXML.
+
All caveats with regard to the FoX SAX processor apply to reading documents through the DOM interface. In particular, note that documents containing characters beyond the US-ASCII set will not be readable.
+
+
+
It was decided to implement W3C DOM interfaces primarily because they are specified in a language-agnostic fashion, and thus made Fortran implementation possible. A number of criticisms have been levelled at the W3C DOM, but many apply only from the perspective of Java developers. However, more importantly, the W3C DOM suffers from a lack of sufficient error checking so it is very easy to create a DOM tree, or manipulate an existing DOM tree into a state, that cannot be serialized into a legal XML document.
+
+
(Although the Level 3 DOM specifications finally addressed this issue, they did so in a fashion that was neither very useful, nor easily translatable into a Fortran API.)
+
+
Therefore, FoX will by default produce errors about many attempts to manipulate the DOM in such a way as would result in invalid XML. These errors can be switched off if standards-compliant behaviour is wanted. Although extensive, these checks are not complete.
+In particular, the way the W3C DOM mandates namespace handling makes it trivial to produce namespace non-well-formed document trees, and very difficult for the processor to automatically detect the non-well-formedness. Thus a fully well-formed tree is only guaranteed after a suitable normalizeDocument call.
SAX stands for Simple API for XML, and was originally a Java API for reading XML. (Full details at http://saxproject.org). SAX implementations exist for most common modern computer languages.
+
+
FoX includes a SAX implementation, which translates most of the Java API into Fortran, and makes it accessible to Fortran programs, enabling them to read in XML documents in a fashion as close and familiar as possible to other languages.
+
+
SAX is a stream-based, event callback API. Conceptually, running a SAX parser over a document results in the parser generating events as it encounters different XML components, and sends the events to the main program, which can read them and take suitable action.
+
+
Events
+
+
Events are generated when the parser encounters, for example, an element opening tag, or some text, and most events carry some data with them - the name of the tag, or the contents of the text.
+
+
The full list of events is quite extensive, and may be seen below. For most purposes, though, it is unlikely that most users will need more than the 5 most common events, documented here.
+
+
+
startDocument - generated when the parser starts reading the document. No accompanying data.
+
endDocument - generated when the parser reaches the end of the document. No accompanying data.
+
startElement - generated by an element opening tag. Accompanied by tag name, namespace information, and a list of attributes
+
endElement - generated by an element closing tag. Accompanied by tag name, and namespace information.
+
characters - generated by text between tags. Accompanied by contents of text.
+
+
+
Given these events and accompanying information, a program can extract data from an XML document.
+
+
Invoking the parser.
+
+
Any program using the FoX SAX parser must a) use the FoX module, and b) declare a derived type variable to hold the parser, like so:
+
+
use FoX_sax
+ type(xml_t) :: xp
+
+
+
The FoX SAX parser then works by requiring the programmer to write a module containing subroutines to receive any of the events they are interested in, and passing these subroutines to the parser.
+
+
Firstly, the parser must be initialized, by passing it XML data. This can be done either by giving a filename, which the parser will manipulate, or by passing a string containing an XML document. Thus:
+
+
call open_xml_file(xp, "input.xml", iostat)
+
+
+
The iostat variable will report back any errors in opening the file.
+
+
Alternatively,
+
+
call open_xml_string(xp, XMLstring)
+
+
+
where XMLstring is a character variable.
+
+
To now run the parser over the file, you simply do:
+
+
call parse(xp, list_of_event_handlers)
+
+
+
And once you're finished, you can close the file, and clean up the parser, with:
+
+
call close_xml_t(xp)
+
+
+
Options to parser
+
+
It is unlikely that most users will need to operate any of these options, but the following are available for use; all are optional boolean arguments to parse.
+
+
+
namespaces
+Does namespace processing occur? Default is .true., and if on, then any non-namespace-well-formed documents will be rejected, and namespace URI resolution will be performed according to the version of XML in question. If off, then documents will be processed without regard for namespace well-formedness, and no namespace URI resolution will be performed.
+
namespace_prefixes
+Are xmlns attributes reported through the SAX parser? Default is .false.; all such attributes are removed by the parser, and transparent namespace URI resolution is performed. If on, then such attributes will be reported, and treated according to the value of xmlns-uris below. (If namespaces is false, this flag has no effect)
+
validate
+Should validation be performed? Default is .false., no validation checks are made, and the influence of the DTD on the XML Infoset is ignored. (Ill-formed DTD's will still cause fatal errors, of course.) If .true., then validation will be performed, and the Infoset modified accordingly.
+
xmlns_uris
+Should xmlns attributes have a namespace of http://www.w3.org/2000/xmlns/? Default is .false.. If such attributes are reported, they have no namespace. If .true. then they are supplied with the appropriate namespace. (if namespaces or namespace-prefixes are .false., then this flag has no effect.)
+
+
+
Receiving events
+
+
To receive events, you must construct a module containing event handling subroutines. These are subroutines of a prescribed form - the input & output is predetermined by the requirements of the SAX interface, but the body of the subroutine is up to you.
+
+
The required forms are shown in the API documentation below, but here are some simple examples.
+
+
To receive notification of character events, you must write a subroutine which takes as input one string, which will contain the characters received. So:
That does very little - it simply prints out the data it receives. However, since the subroutine is in a module, you can save the data to a module variable, and manipulate it elsewhere; alternatively you can choose to call other subroutines based on the input.
+
+
So, a complete program which reads in all the text from an XML document looks like this:
+
+
module event_handling
+ use FoX_sax
+contains
+
+ subroutine characters_handler(chars)
+ character(len=*), intent(in) :: chars
+
+ print*, chars
+ end subroutine
+end module
+
+program XMLreader
+ use FoX_sax
+ use event_handling
+ type(xml_t) :: xp
+ call open_xml_file(xp, 'input.xml')
+ call parse(xp, characters_handler=characters_handler)
+ call close_xml_t(xp)
+end program
+
+
+
Attribute dictionaries.
+
+
The other likely most common event is the startElement event. Handling this involves writing a subroutine which takes as input three strings (which are the local name, namespace URI, and fully qualified name of the tag) and a dictionary of attributes.
+
+
An attribute dictionary is essentially a set of key:value pairs - where the key is the attributes name, and the value is its value. (When considering namespaces, each attribute also has a URI and localName.)
+
+
Full details of all the dictionary-manipulation routines are given in AttributeDictionaries, but here we shall show the most common.
+
+
+
getLength(dictionary) - returns the number of entries in the dictionary (the number of attributes declared)
+
hasKey(dictionary, qName) (where qName is a string) returns .true. or .false. depending on whether an attribute named qName is present.
+
hasKey(dictionary, URI, localname) (where URI and localname are strings) returns .true. or .false. depending on whether an attribute with the appropriate URI and localname is present.
+
getQName(dictionary, i) (where i is an integer) returns a string containing the key of the ith dictionary entry (ie, the name of the ith attribute.
+
getValue(dictionary, i) (where i is an integer) returns a string containing the value of the ith dictionary entry (ie the value of the ith attribute.
+
getValue(dictionary, URI, localname) (where URI and localname are strings) returns a string containing the value of the attribute with the appropriate URI and localname (if it is present)
+
+
+
So, a simple subroutine to receive a startElement event would look like:
+
+
module event_handling
+
+contains
+
+ subroutine startElement_handler(URI, localname, name,attributes)
+ character(len=*), intent(in) :: URI
+ character(len=*), intent(in) :: localname
+ character(len=*), intent(in) :: name
+ type(dictionary_t), intent(in) :: attributes
+
+ integer :: i
+
+ print*, name
+
+ do i = 1, getLength(attributes)
+ print*, getQName(attributes, i), '=', getValue(attributes, i)
+ enddo
+
+ end subroutine startElement_handler
+end module
+
+program XMLreader
+ use FoX_sax
+ use event_handling
+ type(xml_t) :: xp
+ call open_xml_file(xp, 'input.xml')
+ call parse(xp, startElement_handler=startElement_handler)
+ call close_xml_t(xp)
+end program
+
+
+
Again, this does nothing but print out the name of the element, and the names and values of all of its attributes. However, by using module variables, or calling other subroutines, the data could be manipulated further.
+
+
Error handling
+
+
The SAX parser detects all XML well-formedness errors (and optionally validation errors). By default, when it encounters an error, it will simply halt the program with a suitable error message. However, it is possible to pass in an error handling subroutine if some other behaviour is desired - for example it may be nice to report the error to the user, finish parsing, and carry on with some other task.
+
+
In any case, once an error is encountered, the parser will finish. There is no way to continue reading past an error. (This means that all errors are treated as fatal errors, in the terminology of the XML standard).
+
+
An error handling subroutine works in the same way as any other event handler, with the event data being an error message. Thus, you could write:
+
+
subroutine fatalError_handler(msg)
+ character(len=*), intent(in) :: msg
+
+ print*, "The SAX parser encountered an error:"
+ print*, msg
+ print*, "Never mind, carrying on with the rest of the calcaulation."
+end subroutine
+
+
+
Stopping the parser.
+
+
The parser can be stopped at any time. Simply do (from within one of the callback functions).
+
+
call stop_parser(xp)
+
+
+
(where xp is the XML parser object). The current callback function will be completed, then the parser will be stopped, and control will return to the main program, the parser having finished.
+
+
+
+
Full API
+
+
Derived types
+
+
There is one derived type, xml_t. This is entirely opaque, and is used as a handle for the parser.
This opens a file. xp is initialized, and prepared for parsing. string must contain the name of the file to be opened. iostat reports on the success of opening the file. A value of 0 indicates success.
This prepares to parse a string containing XML data. xp is initialized. string must contain the XML data.
+
close_xml_t
+type(xml_t), intent(inout) :: xp
+
+
+
This closes down the parser (and closes the file, if input was coming from a file.) xp is left uninitialized, ready to be used again if necessary.
+
+
+
parse
+type(xml_t), intent(inout) :: xp
+external :: list of event handlers
+logical, optional, intent(in) :: validate
+
+
This tells xp to start parsing its document.
+
+
+
(Advanced: See above for the list of options that the parse subroutine may take.)
+
+
The full list of event handlers is in the next section. To use them, the interface must be placed in a module, and the body of the subroutine filled in as desired; then it should be specified as an argument to parse as:
+ name_of_event_handler = name_of_user_written_subroutine
+Thus a typical call to parse might look something like:
where mystartelement, myendelement, and mychars are all subroutines written by you according to the interfaces listed below.
+
+
+
+
Callbacks.
+
+
All of the callbacks specified by SAX 2 are implemented. Documentation of the SAX 2 interfaces is available in the JavaDoc at http://saxproject.org, but as the interfaces needed adjustment for Fortran, they are listed here.
+
+
For documentation on the meaning of the callbacks and of their arguments, please refer to the Java SAX documentation.
Triggered when some character data is read from between tags.
+
+
NB Note that all character data is reported, including whitespace. Thus you will probably get a lot of empty characters events in a typical XML document.
+
+
NB Note also that it is not required that a single chunk of character data all come as one event - it may come as multiple consecutive events. You should concatenate the results of subsequent character events before processing.
+
+
+
endDocument_handler
+ subroutine endDocument_handler()
+ end subroutine endDocument_handler
+
+
+
Triggered when the parser reaches the end of the document.
startEntity_handler
+ subroutine startEntity_handler(name)
+ character(len=*), intent(in) :: name
+ end subroutine startEntity_handler
+
+
+
Triggered by the start of entity expansion.
+
+
+
+
Exceptions.
+
+
The FoX SAX implementation implements all of XML 1.0 and 1.1; all of XML Namespaces 1.0 and 1.1; xml:id and xml:base.
+
+
Although FoX tries very hard to work to the letter of the XML and SAX standards, it falls short in a few areas.
+
+
+
FoX will only process documents consisting of nothing but US-ASCII data. It will accept documents labelled with any single byte character set which is identical to US-ASCII in its lower 7 bits (for example, any of the ISO-8859 charsets, or UTF-8) but an error will be generated as soon as any character outside US-ASCII is encountered. (This includes non-ASCII characters present only be character entity reference)
+
As a corollary, UTF-16 documents of any endianness will also be rejected.
+
+
+
(It is impossible to implement IO of non-ASCII documents in a portable fashion using standard Fortran 95, and it is impossible to handle non-ASCII data internally using standard Fortran strings. A fully unicode-capable FoX version is under development, but requires Fortran 2003. Please enquire for further details if you're interested.)
+
+
+
FoX has no network capabilities. Therefore, when external entities are referenced, any entities not available on the local filesystem will not be accessed (specifically, any entities whose URI reference includes a scheme component, where that scheme is not file, will be skipped)
+
+
+
Beyond this, any aspects of the listed XML standards to which FoX fails to do justice to are bugs.
+
+
+
+
What of Java SAX 2 is not included in FoX?
+
+
The difference betweek Java & Fortran means that none of the SAX APIs can be copied directly. However, FoX offers data types, subroutines, and interfaces covering most of the facilities offered by SAX. Where it does not, this is mentioned here.
+
+
org.sax.xml:
+
+
+
Querying/setting of feature flags/property values for the XML parser. The effect of a subset of these may be accessed by options to the parse subroutine.
+
XML filters - Java SAX makes it possible to write filters to intercept the
+flow of events. FoX does not support this.
+
Entity resolution - SAX 2 exports an interface to the application for entity resolution, but FoX does not - all entities are resolved within the parser.
+
Locator - SAX 2 offers an interface to export information regarding object locations within the document, FoX does not.
+
XMLReader - FoX only offers the parse() method - no other methods really make sense in Fortran.
+
AttributeList/DocumentHandler/Parser - FoX only offers namespace aware attributes, not the pre-namespace SAX-1 versions.
FoX_utils is a collection of general utility functions that the rest of FoX depends on, but which may be of independent use. They are documented here.
+
+
All functions are accessible from the FoX_utils module.
+
+
NB Unlike the APIs of WXML, WCML, and SAX, the UTILS APIs may not remain constant between FoX versions. While some effort will be expended to ensure they don't change unnecessarily, no guarantees are made.
+
+
For any end-users interested in the code who are worried about interface changes, it is recommended that the relevant code (all found in the utils/ directory be lifted directly and imported into other projects, rather than accessed through the FoX interfaces.
+
+
Two sets of utility functions are provided; one concerned with UUIDs, and a set concerned with URIs.
+
+
+
+
UUID
+
+
UUIDs (see RFC 4122) are Universally Unique IDentifiers. They are a 128-bit number, represented as a 36-character string. For example:
+
+
f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+
+
+
The intention of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. Thus, anyone can create a UUID and use it to identify something with reasonable confidence that the identifier will never be unintentionally used by anyone for anything else.
+
+
This property also makes them useful as Uniform Resource Names, to refer to a given document without requiring a position in a particular URI scheme. Thus the above UUID could be referred to as
+
+
urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+
+
+
UUIDs are used by WCML to ensure that every document generated has a unique ID. This enables users to go back later on and have confidence that they are examining the same document, regardless of where it might have ended up in file-system hierarchies or databases.
+
+
In addition, UUIDs come in several flavours, one of which stores the time of creation to 100-nanosecond accuracy. This can later be extracted (see, for example this service) to verify creation time.
+
+
This may well be useful for other XML document types, or indeed in non-XML applications. Thus, UUIDs may be generated by the following function, with one optional argument.
+
+
+
generate_UUID
+version: integer
+
+
+
This function returns a 36-character string containing the UUID.
+
+
version identifies the version of UUID to be used (see section 4.1.3 of the RFC). Only versions 0, 1, and 4 are supported. Version 0 generates a nil UUID; version 1 a time-based UUID, and version 4 a pseudo-randomly-generated UUID.
+
+
Version 1 is the default, and is recommended.
+
+
(Note: all pseudo-random-numbers are generated using the high-quality Mersenne Twister algorithm, using the Fortran implementation of Scott Robert Ladd.)
+
+
+
+
URI
+
+
URIs (see RFC 2396) are Universal Resource Identifiers. A URI is a string, containing several components, which identifies a resource. Very often, this resource is a file, and the URI represents the local or network path to this file.
+
+
For example:
+
+
http://www.uszla.me.uk/FoX/DoX/index.html
+
+
+
is a URI pointing to the FoX documentation.
+
+
Equally, however:
+
+
FoX/configure
+
+
+
is a URI reference pointing to the FoX configure script (relative to the current directory, or base URI).
+
+
A string which is a URI reference contains several components, some of which are optional.
+
+
+
scheme - eg, http
+
authority - eg, www.uszla.me.uk
+
path - eg, /FoX/DoX/index.html
+
+
+
In addition, a URI reference may contain userinfo, host, port, query, and fragment information. (see the RFC for full details.)
+
+
The FoX URI library provides the following features:
+
+
+
type(URI)
+This is an opaque Fortran type which is used to hold URI information. The functions described below use this type.
+
parseURI
+This takes one argument, a URI reference, and returns a pointer to a newly-allocated URI object.
+
+
+
If the string provided is not a valid URI reference, then a null pointer is returned; thus this function can be used to check whether a URI is valid.
+
+
+
expressURI
+This takes one argument, a URI object, and returns the (fully-escaped) string representing that URI.
+
rebaseURI
+This takes two arguments, both URI objects, and returns a pointer to a third URI object. It calculates the location of the second URI with reference to the first.
+
+
+
Thus, if the first URI were /FoX/DoX, and the second ../DoX2/index.html, then the resulting URI would be /FoX/DoX2/index.html
+
+
+
destroyURI
+This takes one argument, a pointer to a URI object, and clears up all memory associated with it.
+
+
+
For each component a URI might have (scheme, authority, userinfo, host, port, path, query, fragment) there are two functions for extracting the component:
+
+
+
hasXXX will return a logical variable according to whether the component is defined. (except for path which is always defined, but may be empty)
+
getXXX will return a string containing the value of the component. (except for port which is returned as an integer.
+
+
+
Thus, listing these functions in full:
+
+
+
hasScheme
+Is there a scheme associated with the URI?
+
getScheme
+Return the value of the scheme
+
hasAuthority
+Is there an authority associated with the URI?
+
getAuthority
+Return the value of the authority
+
hasUserinfo
+Is there userinfo associated with the URI?
+
getUserinfo
+Return the value of the userinfo
+
hasHost
+Is there a host associated with the URI?
+
getHost
+Return the value of the host
+
hasPort
+Is there a port associated with the URI?
+
getPort
+Return the value of the port
+
getPath
+Return the value of the path
+
hasQuery
+Is there a query associated with the URI?
+
getQuery
+Return the value of the query
+
hasFragment
+Is there a fragment associated with the URI?
WCML is a library for outputting CML data. It wraps all the necessary XML calls, such that you should never need to touch any WXML calls when outputting CML.
+
+
The CML output is conformant to version 2.4 of the CML schema. The output
+can also be made conformant to the CompChem convention.
+
+
The available functions and their intended use are listed below. Quite deliberately, no reference is made to the actual CML output by each function.
+
+
Wcml is not intended to be a generalized Fortran CML output layer. rather it is intended to be a library which allows the output of a limited set of well-defined syntactical fragments.
This section of the manual will detail the available CML output subroutines.
+
+
Use of WCML
+
+
wcml subroutines can be accessed from within a module or subroutine by inserting
+
+
use FoX_wcml
+
+
+
at the start. This will import all of the subroutines described below, plus the derived type xmlf_t needed to manipulate a CML file.
+
+
No other entities will be imported; public/private Fortran namespaces are very carefully controlled within the library.
+
+
Dictionaries.
+
+
The use of dictionaries with WCML is strongly encouraged. (For those not conversant with dictionaries, a fairly detailed explanation is available at http://www.xml-cml.org/information/dictionaries)
+
+
In brief, dictionaries are used in two ways.
+
+
Identification
+
+
Firstly, to identify and disambiguate output data. Every output function below takes an optional argument, dictRef="". It is intended that every piece of data output is tagged with a dictionary reference, which will look something like nameOfCode:nameOfThing.
+
+
So, for example, in SIESTA, all the energies are output with different dictRefs, looking like: siesta:KohnShamEnergy, or siesta:kineticEnergy, etc. By doing this, we can ensure that later on all these numbers can be usefully identified.
+
+
We hope that ultimately, dictionaries can be written for codes, which will explain what some of these names might mean. However, it is not in any way necessary that this be done - and using dictRef attributes will help merely by giving the ability to disambiguate otherwise indistinguishable quantities.
+
+
We strongly recommend this course of action - if you choose to do follow our recommendation, then you should add a suitable Namespace to your code. That is, immediately aftercmlBeginFile and beforecmlStartCml, you should add something like:
If you don't have a webpage for your code, don't worry; the address is only used as an identifier, so anything that looks like a URL, and which nobody else is using, will suffice.
+
+
Quantification
+
+
Secondly, we use dictionaries for units. This is compulsory (unlike dictRefs above). Any numerical quantity that is output through cmlAddProperty or cmlAddParameter is required to carry units. These are added with the units="" argument to the function. In addition, every other function below which will take numerical arguments also will take optional units, although default will be used if no units are supplied.
+
+
Further details are supplied in section Units below.
+
+
General naming conventions for functions.
+
+
Functions are named in the following way:
+
+
+
All functions begin
+cml
+
To begin and end a section of the CML file,
+a pair of functions will exist:
+
+
+
cmlStartsomething
+
cmlEndsomething
+
+
To output a given quantity/property/concept etc. a function will exist
+cmlAddsomething
+
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
anytype: any of logical, integer, real(sp), real(dp), string
+
+
+
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
+
+
Also note that wherever a real number can be passed in (including through anytype) then the formatting can be specified using the conventions described in StringFormatting
+
+
+
scalar: single item
+
array: one-dimensional array of items
+
matrix: two-dimensional array of items
+
anydim: any of scalar, array, matrix
+
+
+
Where an array is passed in, it may be passed either as an assumed-shape array; that is, as an F90-style array with no necessity for specifying bounds; thusly:
All functions take as their first argument an XML file object, whose keyword is always xf. This file object is initialized by a cmlBeginFile function.
+
+
It is highly recommended that subroutines be called with keywords specified rather than relying on the implicit ordering of arguments. This is robust against changes in the library calling convention; and also stepsides a significant cause of errors when using subroutines with large numbers of arguments.
+
+
+
+
Units
+
+
Note below that the functions cmlAddParameter and cmlAddProperty both require that units be specified for any numerical quantities output.
+
+
If you are trying to output a quantity that is genuinely dimensionless, then you should specify units="units:dimensionless"; or if you are trying to output a countable quantity (eg number of CPUs) then you may specify units="units:countable".
+
+
For other properties, all units should be specified as namespaced quantities. If you are using
+a very few common units, it may be easiest to borrow definitions from the provided dictionaries;
A default units dictionary, containing only the very basic units that wcml needs to know about, which has a namespace of: http://www.uszla.me.uk/FoX/units, and wcml assigns it automatically to the prefix units.
+
+
This is added automatically, so attempts to add it manually will fail.
Otherwise, you should feel at liberty to construct your own namespace;
+declare it using cmlAddNamespace, and markup all your units as:
+
+
units="myNamespace:myunit"
+
+
+
Functions for manipulating the CML file:
+
+
+
cmlBeginFile
+filename: stringscalar: Filename to be opened.
+unit: integerscalar: what unit number should the file be opened on? If you don't
+care, you may specify -1 as the unit number, in which case wcml will make a guess
+(replace): logicalscalar: should the file be replaced if it already exists? default: yes
+
+
+
This takes care of all calls to open a CML output file.
+
+
+
cmlFinishFile
+
+
+
This takes care of all calls to close an open CML output file, once you have finished with it. It is compulsory to call this - if your program finished without calling this, then your CML file will be invalid.
+
+
+
cmlAddNamespace
+prefixstringscalar: prefix to be used
+URIstringscalar: namespace URI to be used
+
+
+
This adds a namespace to a CML file.
+NB This may only ever be called immediately after a cmlBeginFile call, before any
+output has been performed.
+Attempts to do otherwise will result in a runtime error.
+
+
This will be needed if you are adding dictionary references to your output. Thus for siesta, we do:
and then output all our properties and parameters with dictRef="siesta:something".
+
+
+
cmlStartCml
+(fileId) stringscalar: name of originating file. (default: current filename)
+(version) stringscalar: version of CML in use. (default: 2.4)
+(compchem) logicalscalar: add extra namespace declarations needed by the recent compchem CML convention. This provides a minimum level of infrastructure needed to create valid compchem documents. (default: false)
+
cmlEndCml
+
+
+
This pair of functions begin and end the CML output to an existing CML file. It takes care of namespaces.
+
+
Note that unless specified otherwise, there will be a convention attribute added to the cml tag specifying FoX_wcml-2.0 as the convention. (see http://www.uszla.me.uk/FoX for details)
+
+
Start/End sections
+
+
+
cmlStartMetadataList
+(name) stringscalar: name for the metadata list
+(role) stringscalar role which the element plays
+
cmlEndMetadataList
+
+
+
This pair of functions open & close a metadataList, which is a wrapper for metadata items.
+
+
+
cmlStartParameterList
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
cmlEndParameterList
+
+
+
This pair of functions open & close a parameterList, which is a wrapper for input parameters.
+
+
+
cmlStartPropertyList
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
cmlEndPropertyList
+
+
+
This pair of functions open & close a propertyList, which is a wrapper for output properties.
+
+
+
cmlStartKpointList
+
cmlEndKpointList
+
+
+
Start/end a list of k-points (added using cmlAddKpoint below)
+
+
+
cmlStartModule
+(serial) stringscalar: serial id for the module
+(title) stringscalar: title for module element
+(role) stringscalar: role which the element plays
+
+
+
Note that in most cases where you might want to use a serial number, you should probably be using the cmlStartStep subroutine below.
+
+
+
cmlEndModule
+
+
+
This pair of functions open & close a module of a computation which is unordered, or loosely-ordered. For example, METADISE uses one module for each surface examined.
+
+
+
cmlStartStep
+(index) integerscalar: index number for the step. In the absence of an index, steps will be assumed to be consecutively numbered. Specifying this is useful if you wish to output eg every hundredth step.
+(type) stringscalar: what sort of step is this? This should be a namespaced string, for example: siesta:CG is a Conjugate Gradient step in siesta.
+
cmlEndStep
+
+
+
This pair of functions open and close a module of a computation which is strongly ordered. For example, DLPOLY uses steps for each step of the simulation.
+
+
Adding items.
+
+
+
cmlAddMetadata
+name: stringscalar: Identifying string for metadata
+content: characterscalar: Content of metadata
+
+
+
This adds a single item of metadata. Metadata vocabulary is completely uncontrolled within WCML. This means that metadata values may only be strings of characters. If you need your values to contain numbers, then you need to define the representation yourself, and construct your own strings.
+
+
+
cmlAddParameter
+name: stringscalar: Identifying title for parameter
+value:anytypeanydim: value of parameter
+units: stringscalar: units of parameter value (optional for logical/character values, compulsory otherwise; see note above)
+(constraint) stringscalar: Constraint under which the parameter is set (this can be an arbitrary string)
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
+
+
This function adds a tag representing an input parameter
+
+
+
cmlAddProperty
+title: stringscalar
+value: anyanydim
+units: stringscalar units of property value (optional for logical/character values, compulsory otherwise; see note above)
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
+
+
This function adds a tag representing an output property
+
+
Adding geometry information
+
+
+
cmlAddMolecule
+coords: real: a 3xn matrix of real numbers representing atomic coordinates (either fractional or Cartesian) . These must be specified in Angstrom or fractional units (see style below.)
+OR
+x, y, z: real: 3 one-dimensional arrays containing the x, y, and z coordinates of the atoms in the molecule. These must be specified in Angstrom or fractional units (see style below.)
+elements: stringarray: a length-n array of length-2 strings containing IUPAC chemical symbols for the atoms
+(natoms) integerscalar: number of atoms in molecule (default: picked up from length of coords array)
+(occupancies): realarray : a length-n array of the occupancies of each atom.
+(atomRefs): stringarray: a length-n array of strings containing references which may point to IDs elsewhere of, for example, pseudopotentials or basis sets defining the element's behaviour.
+(atomIds): stringarray: a length-n array of strings containing IDs for the atoms.
+(style): stringscalar: cartesian - the coordinates are Cartesian, or fractional - the coordinates are fractional. The default is Cartesian.
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(formula) stringscalar: An IUPAC chemical formula
+(chirality) stringscalar: The chirality of the molecule. No defined vocabulary.
+(role) stringscalar: Role of molecule. No defined vocabulary.
+(bondAtom1Refs) stringarray: Length-m array of references to atomIds at one "end" of a list of bonds.
+(bondAtom2Refs) stringarray: Length-m array of references to atomIds at another "end" of a list of bonds.
+(bondOrders) stringarray: Length-m array of bond orders. See below.
+(bondIds) stringarray: Length-m array of strings containing IDs for bonds.
+(nobondcheck) logicalscalar: Enable (.true., the default) of dissable (.false.) bond validition.
+
+
+
Outputs an atomic configuration. Bonds may be added using the optional arguments bondAtom1Refs, bondAtom2Refs and bondOrders. All these arrays must be the same lenght and all must be present if bonds are to be added. Optionally, bondIds can be used to add Ids to the bond elements. Some valididity constraints are imposed (atomsRefs in the bonds must be defined, bonds cannot be added twice). The meaning of the terms "molecule", "bond" and "bond order" is left loosly defined.
+
+
+
cmlAddLattice
+cell: realmatrix a 3x3 matrix of the unit cell
+(spaceType): stringscalar: real or reciprocal space.
+(latticeType): stringscalar Space group of the lattice. No defined vocabulary
+(units): stringscalar units of (reciprocal) distance that cell vectors is given in;
+default: Angstrom
+
+
+
Outputs information about a unit cell, in lattice-vector form
+
+
+
cmlAddCrystal
+a: realscalar the 'a' parameter (must be in Angstrom)
+b: realscalar the 'b' parameter
+c: realscalar the 'c' parameter
+alpha: realscalar the 'alpha' parameter
+beta: realscalar the 'beta' parameter
+gamma: realscalar the 'gamma' parameter
+(z): integerscalar the 'z' parameter: number of molecules per unit cell.
+(lenunits): stringscalar: Units of length: default is units:angstrom
+(angunits): stringscalar: Units of angle: default is units:degrees
+(lenfmt): stringscalar: format for crystal lengths
+(angfmt): stringscalar: format for crystal angles
+(spaceGroup): stringscalar Space group of the crystal. No defined vocabulary.
+
+
+
Outputs information about a unit cell, in crystallographic form
+
+
Adding eigen-information
+
+
+
cmlStartKPoint
+kpoint: realarray-3 the reciprocal-space coordinates of the k-point
+(weight): realscalar the weight of the kpoint
+(kptfmt): stringscalar numerical formatting for the k-point
+(wtfmt): stringscalar numerical formatting for the weight
+
+
+
Start a kpoint section.
+
+
+
cmlEndKPoint
+
+
+
End a kpoint section.
+
+
+
cmlAddKPoint
+kpoint: realarray-3 the reciprocal-space coordinates of the k-point
+(weight): realscalar the weight of the kpoint
+(kptfmt): stringscalar numerical formatting for the k-point
+(wtfmt): stringscalar numerical formatting for the weight
+
+
+
Add an empty kpoint section.
+
+
+
cmlStartBand
+(spin): stringscalar the spin of this band. Must be either "up" or "down"
+(label): the label of this band.
+
+
+
Start a section describing one band.
+
+
+
cmlEndBand
+
+
+
End a section describing one band.
+
+
+
cmlAddEigenValue
+value: realscalar the eigenvalue
+units: QNamescalar the units of the eigenvalue
+
+
+
Add a single eigenvalue to a band.
+
+
+
cmlAddBandList
+values: realarray the eigenvalues
+spin: stringscalar the spin orientation ("up" or "down")
+units: QNamescalar the units of the eigenvalue
+
+
+
Add a list of eigenvalues for a kpoint
+
+
+
cmlAddEigenValueVector
+value: realscalar the eigenvalue for this band
+units: QNamescalar the units of the eigenvalue
+vector: real/complex3xN matrix the eigenvectors for this band
+(valfmt): stringscalar numerical formatting for the eigenvalue
+(vecfmt): stringscalar numerical formatting for the eigenvector
+
+
+
Add a phononic eigenpoint to the band - which has a single energy, and a 3xN matrix representing the eigenvector.
+
+
Echoing input files
+
+
It is often considered useful to include a direct representation of
+input data within an applications output files. FoX_wcml contains a
+number of procedures to allow this in a CML document based on a specification
+described in a manuscript currently in review (de Jong, Walker and Hanwell
+"From Data to Analysis: Linking NWChem and Avogadro with the Syntax and
+Semantics of Chemical Markup Language".
+The approach is also designed to make data recovery using an
+XSL transform straightforward. File metadata such as the
+original filename is also accessible. We assume that only ASCII
+data must be stored, arbitrary binary files are
+out of scope as are XML documents and non-ASCII textural data.
+Two methods are provided with the
+most appropriate being dependent on the design of the application.
+
+
Using file names
+
+
+
cmlDumpDec
+inputDec: stringscalar or array file name(s) to be used
+linelengths: *integer* *scalar* or *array* miximum number of characters per line
+trimlines: logicalscalar or array should tralining whitespace be removed?
+(iostat): ntegerscalar output argument indicating errors.
+
+
+
In the this approach the single subroutine, cmlDumpInputDec, is called
+with an array of file names as input arguments. In turn each file is
+opened, its contents are written to the CML document in the appropriate
+form, before the file is closed.
+
+
Line by line
+
+
+
cmlStartDecList
+
+
+
Start an outer wrapper for input data.
+
+
+
cmlEndDecList
+
+
+
End the outer wrapper.
+
+
+
cmlStartDec
+filename: stringscalar file name to be used
+
+
+
Start a wrapper for a single "file" or similar concept.
+
+
+
cmlEndDec
+
+
+
End the file wrapper.
+
+
+
cmlAddDecLine
+text: stringscalar A line of text from an input file to add
+
+
+
Put a line of text into the file wrapper.
+
+
The convoluted nature of file handling
+in Fortran combined with the way that some applications read their input
+data means that this approach is not always available (for example, if
+the input file is held open for the duration of the calculation, or if
+data is read from standard input) so an alternative interface with five
+subroutines (cmlStartDecList, cmlStartDec,
+cmlAddDecLine, cmlEndDec and cmlEndDecList)
+is provided. These must be called in order (and usually in two loops,
+one over files, and an inner loop over lines in each file).
+
+
Common arguments
+
+
All cmlAdd and cmlStart routines take the following set of optional arguments:
+
+
+
id: Unique identifying string for element. (Uniqueness is not enforced, though duplicated ids on output are usually an error and may cause later problems)
+
title: Human-readable title of element for display purposes
+
dictRef: reference to disambiguate element. Should be a QName; a namespaced string. An actual dictionary entry may or may not exist. It is not an error for it not to.
+
convention: convention by which the element is to be read.
+(The wording of the definitions for convention is deliberately loose.)
WKML is a library for creating KML
+documents. These documents are intended to be used for "expressing geographic
+annotation and visualization" for maps and Earth browsers such as
+Google Earth or Marble.
+WKML wraps all the necessary XML calls, such that you should never need to touch any
+WXML calls when outputting KML from a Fortran application.
+
+
WKML is intended to produce XML documents that conform to version 2.2 of the Open
+Geospatial Consortium's schema.
+However, the library offers no guarantee that documents produced will be valid as
+only a small subset of the constraints are enforced. The API is designed to minimize
+the possibilty of producing invalid KML in common use cases, and well-formdness is
+maintained by the underlying WXML library.
+
+
The available functions and their intended use are listed below. One useful reference to
+the use of KML is Google's KML documentation.
+
+
Use of WKML
+
+
wkml subroutines can be accessed from within a module or subroutine by inserting
+
+
use FoX_wkml
+
+
+
at the start. This will import all of the subroutines described below, plus the derived type xmlf_t needed to manipulate a KML file.
+
+
No other entities will be imported; public/private Fortran namespaces are very carefully controlled within the library.
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
arguments may be:
+
scalar: single item
+
array: one-dimensional array of items
+
matrix: two-dimensional array of items
+
anydim: any of scalar, array, matrix
+
+
+
All functions take as their first argument an XML file object, whose
+keyword is always xf. This file object is initialized by a kmlBeginFile function.
+
+
It is highly recommended that subroutines be called with keywords
+specified rather than relying on the implicit ordering of arguments.
+This is robust against changes in the library calling convention; and
+also stepsides a significant cause of errors when using subroutines
+with large numbers of arguments.
+
+
Functions for manipulating the KML file:
+
+
+
kmlBeginFile
+fx: xmlf_t: An XML file object
+filename: stringscalar: Filename to be opened.
+unit: integerscalar: what unit number should the file be opened on? If you don't
+care, you may specify -1 as the unit number, in which case wkml will make a guess
+(replace): logicalscalar: should the file be replaced if it already exists? default: yes
+(docName): stringscalar: an optional name for the outermost document element. If absent, "WKML output" will be used
+
+
+
This takes care of all calls to open a KML output file.
+
+
+
kmlFinishFile
+fx: xmlf_t: An XML file object
+
+
+
This takes care of all calls to close an open KML output file, once
+you have finished with it. It is compulsory to call this - if your
+program finished without calling this, then your KML file will be
+invalid.
+
+
+
kmlOpenFolder
+fx: xmlf_t: An XML file object
+(name): stringscalar: an optional name for the new folder.
+(id): stringscalar: an optional xml id for the new folder.
+
+
+
This starts a new folder. Folders are used in KML to organize other
+objects into groups, the visability of these groups can be changed
+in one operation within Google Earth. Folders can be nested.
+
+
+
kmlCloseFolder
+fx: xmlf_t: An XML file object
+
+
+
This closes the current folder.
+
+
+
kmlOpenDocument
+fx: xmlf_t: An XML file object
+name: stringscalar: a name for the new document element.
+(id): stringscalar: an optional xml id for the new document element.
+
+
+
This starts a new document element at this point in the output. Note that no
+checks are currently performed to ensure that this is permitted, for example
+only one document is permitted to be a child of the kml root element. Most
+users should not need to use this subroutine.
+
+
+
kmlCloseDocument
+fx: xmlf_t: An XML file object
+
+
+
This closes the current document element. Do not close the outermose document
+element created with kmlBeginFile, this must be closed with kmlFinishFile.
+Most users should not need to use this subroutine.
+
+
Functions for producing geometrical objects:
+
+
+
kmlCreatePoints
+fx: xmlf_t: An XML file object
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the collection of points
+(color): color_t: Line colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(scale): realscalar: Scaling size for the point icon.
+(description): stringarray: A description for each point.
+(description_numbers): realarray: Numeric description for each point.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
A single function, kmlCreatePoints accepts various combinations of arguments, and will generate a series of individual points to be visualized in Google Earth. In fact, the KML produced will consist of a Folder, containing Placemarks, one for each point. The list of points may be provided in any of the three ways specified above.
+
+
+
kmlCreateLine
+fx: xmlf_t: An XML file object
+(closed): logiclscalar: Should the last point be joined to the first point?
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(tessellate): logicalscalar: If altitude is not specified, should the line produced follow the altitude of the ground below it?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the collection of points
+(color): color_t: Line colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(width): integerscalar: Width of the lines.
+(scale): realscalar: Scaling size for the point icon.
+(description): stringarray: A description for each point.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
A single function, kmlCreateLine accepts various combinations of arguments, and will generate a series of individual points to be visualized as a (closed or open) path in Google Earth. In fact, the KML produced will consist of a LineString, or LinearRing, containing a list of coordinates. The list of points may be provided in any of the three ways specified above.
+
+
+
kmlStartRegion
+fx: xmlf_t: An XML file object
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(tessellate): logicalscalar: If altitude is not specified, should the line produced follow the altitude of the ground below it?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the region
+(fillcolor): color_t: Region colour as a kml color type (See Colours)
+(fillcolorname): stringscalar: Region colour as a name (See Colours)
+(fillcolorhex): string(len=8)scalar: Region colour in hex (See Colours)
+(linecolor): color_t: Line colour as a kml color type (See Colours)
+(linecolorname): stringscalar: Line colour as a name (See Colours)
+(linecolorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(linewidth): integerscalar: Width of the line.
+(description): stringscalar: A description for the region.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
Creates a filled region with the outer boundary described by the list of points. May be followed by one or more calls to kmlAddInnerBoundary and these must be followed by a call to kmlAddInnerBoundary.
+
+
+
kmlEndRegion
+fx: xmlf_t: An XML file object
+
+
+
Ends the specification of a region with or without inner boundaries.
+
+
+
kmlAddInnerBoundary
+fx: xmlf_t: An XML file object
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
Introduces an internal area that is to be excluded from the enclosing region.
+
+
2D fields
+
+
WKML also contains two subroutines to allow scalar fields to be plotted over a geographical
+region. Data is presented to WKML as a collection of values and coordinates and this data
+can be displayed as a set of coloured cells, or as isocontours.
+
+
Data input
+
+
For all 2-D field subroutines both position and value of the data must be specified. The data values
+must always be specified as a rank-2 array, values(:,:). The grid can be specified in three ways
+depending on grid type.
+
+
+
Regular rectangular grid: Specify north, south, east, west. These specify the four corners of the grid (which must be aligned with lines of longitude and latitude).
+
Irregularly spaced rectangular grid. Specify two rank-one arrays, longitude(:) and latitude(:). The grid must be aligned with lines of longitude and latitude so that: Grid-point (i, j) = (longitude(i), latitude(j))
+
Entirely irregular (topologically rectangular) grid. Specify two rank-two arrays, longitude(:,:) and latitude(:,:). The grid may be of any form, aligned with no other projection: Grid-point (i, j) is taken as (longitude(i, j), latitude(i, j))
+
+
+
In all cases, single or double precision data may be used so long as all data is consistent in precision within one call.
+
+
Control over the third dimension
+
+
The third dimension of the data can be visualized in two (not mutually-exclusive) ways;
+firstly by assigning colours according to the value of the tird dimension, and secondly
+by using the altitude of the points as a (suitable scaled) proxy for the third dimension.
+The following optional arguments control this aspect of the visualization (both for cells and for contours)
+
+
+
type(color) :: colormap(:): an array of colours (see Colours) which will be used for painting the various layers
+
real, contour_values(:): an array of values which will be used to divide each layer of the third dimension. Single/double precision according to context.
+
integer :: numvalues: where contourvalues is not specified, this provides that the range of the values by divided into equal sized layers such that there are this many divisors.
+
real :: height: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+
+
+
Where no colormap is provided, one will be autogenerated with the appropriate number of levels
+as calculated from the provided contourvalues. Where no contourvalues are provided, they are
+calculated based on the size of the colormap provided. Where neither colormap nor contour_values
+are provided, a default of 5 levels with an autogenerated colormap will be used.
+
+
Subroutines
+
+
+
kmlCreateCells
+fx: xmlf_t: An XML file object
+and:
+east: realscalar: east edge of data set.
+west: realscalar: west edge of data set.
+south: realscalar: south edge of data set.
+north: realscalar: north edge of data set.
+or:
+longitude: realarray: points in north-south direction where grid lines cross lines of longitude.
+latitude: realarray: points in east-west direction where grid lines cross lines of latitude.
+or:
+longitude: realmatrix: longitude of each point in values matrix.
+latitude: realmatrix: latitude of each point in values matrix.
+and:
+values: realmatrix: data values.
+(colormap): color_tarray: colours used to describe values.
+(height): real(sp)scalar: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+(contourvalues): *real(sp)* *array*: values used to contour data.
+(numlevels): integerscalar: number of data values to show.
+(name): stringscalar: name describing the cells.
+
+
+
This subroutine generates a set of filled pixels over a region of the earth.
+
+
+
kmlCreateContours
+fx: xmlf_t: An XML file object
+and:
+east: realscalar: east edge of data set.
+west: realscalar: west edge of data set.
+south: realscalar: south edge of data set.
+north: realscalar: north edge of data set.
+or:
+longitude: realarray: points in north-south direction where grid lines cross lines of longitude.
+latitude: realarray: points in east-west direction where grid lines cross lines of latitude.
+or:
+longitude: realmatrix: longitude of each point in values matrix.
+latitude: realmatrix: latitude of each point in values matrix.
+and:
+values: realmatrix: data values.
+(colormap): color_tarray: colours used to describe values.
+(height): real(sp)scalar: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+(contourvalues): *real(sp)* *array*: values used to contour data.
+(numlevels): integerscalar: number of data values to show.
+(name): stringscalar: name describing the cells.
+(lines): logicalscalar: should contour lines be shown.
+(regions): logicalscalar: should contour regions be shown.
+
+
+
This subroutine creates a set of contour lines.
+
+
Colours
+
+
KML natively handles all colours as 32-bit values, expressed as 8-digit
+hexadecimal numbers in ABGR (alpha-blue-green-red) channel order. However,
+this is not very friendly. WKML provides a nicer interface to this, and all
+WKML functions which accept colour arguments will accept them in three ways:
+
+
+
(*color) color_t: the colour is passed as a wkml color_t derived type. This type is opaque and is created as described below.
+
(*colorname) string: a free-text string describing a colour. WKML understands any of the approximately 700 colour names used by X11.
A function and a subroutine are provided to maniputate the color_t derived type:
+
+
+
kmlGetCustomColor
+
+
+
This function takes a single argument of type integer or string and returns a color_t derived type. If the argument is a string the
+colour is taken from the set of X11 colours, if it is an integer, i, the ith colour is selected from the X11 list.
+
+
+
kmlSetCustomColor
+myCIcolor_t: This intent(out) variable is set to the chosen colour.
+colorhex *string(len=8): an 8-digit ABGR hexadecimal number.
+
+
+
This functon takes a single argument of type string(len=8) representing an 8-digit AVGR hexadecimal number and returns a color_t derived type representing that colour.
+
+
Several features of wkml make use of "colour maps", arrays of the color_t derived type, which are used to relate numerical values to colours when showing fields of data. These are
+created and used thus:
+
+
program colours
+ use FoX_wkml
+ type(color_t) :: colourmap(10)
+
+ ! Use X11 colours from 101 to 110:
+ colourmap(1:10) = kmlGetCustomColor(101:110)
+ ! Except for number 5 which should be red:
+ colourmap(5) = kmlGetCustomColor("indian red")
+ ! And for number 6 which should be black
+ call kmlSetCustomColor(colourmp(6), "00000000")
+
+end program colours
+
+
+
Styles
+
+
Controling styling in KML can be quite complex. Most of the
+subroutines in WKML allow some control of the generated style
+but they do not ptovide access to the full KML vocabulary which
+allows more complex styling. In order to access the more complex
+styles in KML it is necessary to create KML style maps - objects
+that are defined, named with a styleURL. The styleURL is then used
+to reference to the style defined by the map.
+
+
Styles can be created using the following three subroutines. In each
+case one argument is necessary: id, which must be a string (starting
+with an alphabetic letter, and containing no spaces or punctuation
+marks) which is used later on to reference the style. All other
+arguments are optional.
+
+
+
kmlCreatePointStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(scale): real or integerscalar: A scale factor to set the size of the image displayed at the point (note, if both are present, scale and heading must be of the same type).
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Point colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Point colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
+(heading): real or integerscalar: direction to "point" the point icon in (between 0 and 360 degreesnote, if both are present, scale and heading must be of the same type).
+(iconhref): stringscalar: URL of an icon used to draw the point (e.g. from an http server).
+
+
+
Creates a style that can be used for points.
+
+
+
kmlCreateLineStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(width): integerscalar: width of the line in pixels.
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
+
+
+
Creates a style that can be used for lines.
+
+
+
kmlCreatePolygonStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(fill): logicalscalar: Should the polygon be filled?
+(outline): logicalscalar: Should the polygon have an outline?
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
wxml is a general Fortran XML output library. It offers a Fortran interface, in the form of a number of subroutines, to generate well-formed XML documents. Almost all of the XML features described in XML11 and Namespaces are available, and wxml will diagnose almost all attempts to produce an invalid document. Exceptions below describes where wxml falls short of these aims.
+
+
First, Conventions describes the conventions use in this document.
+
+
Then, Functions lists all of wxml's publically exported functions, in three sections:
+
+
+
Firstly, the very few functions necessary to create the simplest XML document, containing only elements, attributes, and text.
+
Secondly, those functions concerned with XML Namespaces, and how Namespaces affect the behaviour of the first tranche of functions.
+
Thirdly, a set of more rarely used functions required to access some of the more esoteric corners of the XML specification.
+
+
+
Please note that where the documentation below is not clear, it may be useful to look at some of the example files. There is a very simple example in the examples/ subdirectory, but which nevertheless shows the use of most of the features you will use.
+
+
A more elaborate example, using almost all of the XML features found here, is available in the top-level directory as wxml_example.f90. It will be automatically compiled as part of the build porcess.
+
+
+
+
Conventions and notes:
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
anytype: any of logical, integer, real(sp), real(dp), string
+
+
+
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
+
+
It is strongly recommended that the functions be used with keyword arguments rather than replying on implicit ordering.
+
+
Derived type: xmlf_t
+
+
This is an opaque type representing the XML file handle. Each function requires this as an argument, so it knows which file to operate on. (And it is an output of the xml_OpenFile subroutine) Since all subroutines require it, it is not mentioned below.
+
+
+
+
Function listing
+
+
+
+
Frequently used functions
+
+
+
xml_OpenFile
+filename: string: Filename to be opened
+xf: xmlf_t: XML File handle
+(channel): integer: What Fortran file handle should the XML file be attached to?
+default: picked by the library at runtime
+(pretty_print): logical: Should the XML output be formatted to look pretty? (This implies that whitespace is not significant)
+default: false
+(replace): logical: Should the file be replaced if it already exists?
+default: no, stop at runtime if file already exists
+(addDecl): logical: Should an XML declaration be added at the start of the file?
+default: yes
+(namespace): logical: Should wxml prevent the output of namespace-ill-formed documents?
+default: yes
+(validate): logical: Should wxml carry out any checks on the optional VC constraints specified by XML?
+default: no
+(warning): logical: Should wxml emit warnings when it is unable to guarantee well-formedness?
+default: no
+
+
+
Open a file for writing XML
+
+
By default, the XML will have no extraneous text nodes. This can have the effect of it
+looking slightly ugly, since there will be no newlines inserted between tags.
+
+
This behaviour can be changed to produce slightly nicer looking XML, by switching
+on pretty_print. This will insert newlines and spaces between some tags where
+they are unlikely to carry semantics. Note, though, that this does result in
+the XML produced being not quite what was asked for, since extra characters and
+text nodes have been inserted.
+
+
NB: The replace option should be noted. By default, xml_OpenFile will fail with a runtime error if you try and write to an existing file. If you are sure you want to continue on in such a case, then you can specify **replace**=.true. and any existing files will be overwritten. If finer granularity is required over how to proceed in such cases, use the Fortran inquire statement in your code. There is no 'append' functionality by design - any XML file created by appending to an existing file would be invalid.
+
+
+
xml_Close
+xf: xmlf_t: XML File handle
+(empty): Can the file be empty? default: .false.
+
+
+
Close an opened XML file, closing all still-opened tags so that it is well-formed.
+
+
In the normal run of event, trying to close an XML file with no root element will cause an error, since this is not well-formed. However, an optional argument, empty is provided in case it is desirable to close files which may be empty. In this case, a warning will still be emitted, but no fatal error generated.
+
+
+
xml_NewElement
+name: string:
+Name of tag (for namespaced output, you need to include the prefix)
+
+
+
Open a new element tag
+
+
+
xml_EndElement
+name: string:
+Name of tag to be closed (if it doesn't match currently open tag, you'll get an error)
+
+
+
Close an open tag
+
+
+
xml_AddAttribute
+name: string: Name of attribute
+value: anytype: Value of attribute
+(escape): logical: if the attribute value is a string, should the attribute value be escaped?
+default: true
+(type): string: the type of the attribute. This must be one of CDATA, ID, IDREF, IDREFS, NMTOKEN, NMTOKENS, ENTITY, ENTITIES, or NOTATION (always upper case). If specified, this must match any attribute declarations that have been previously declared in the DTD. If unspecified this (as the XML standard requires) defaults to CDATA.
+
+
+
Add an attribute to the currently open tag.
+
+
By default, if the attribute value contains markup characters, they will be escaped automatically by
+wxml before output.
+
+
However, in rare cases you may not wish this to happen - if you wish to output Unicode
+characters, or entity references. In this case, you should set escape=.false. for the relevant
+subroutine call. Note that if you do this, no checking on the validity of the output string iis performed; the onus is on you to ensure well-formedness
+
+
The value to be added may be of any type; it will be converted to text according to FoX's formatting rules,
+and if it is a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which
+case the delimiter may be changed to any other single character using an optional argument).
+
+
NB The type option is only provided so that in the case of an external DTD which FoX is unaware of, the attribute type can be specified (which gives FoX more information to ensure well-formedness and validity). Specifying the type incorrectly may result in spurious error messages)
+
+
+
xml_AddCharacters
+charsanytype:
+The text to be output
+(parsed): logical: Should the output characters be parsed (ie should the library replace '&' with '&' etc?) or unparsed (in which case
+the characters will be surrounded by CDATA tags.
+default: yes
+(delimiter): character(1): If data is a character array, what should the delimiter between elements be on output?
+default: a single space
+(ws_significant): logical: Is any whitespace in the string significant? default: unknown
+
+
+
Add text data. The data to be added may be of any type; they will be converted to text according to FoX's formatting rules,
+and if they are a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which
+case the delimiter may be changed to any other single character using an optional argument).
+
+
+
xml_AddNewline
+
+
+
Within the context of character output, add a (system-dependent) newline character. This function can only
+be called wherever xml_AddCharacters can be called. (Newlines outside of character context are under
+FoX's control, and cannot be manipulated by the user.)
+
+
+
+
Namespace-aware functions:
+
+
+
xml_DeclareNamespace
+nsURIstring: The URI of the namespace
+(prefix) string: The namespace prefix to be used in the document. If absent, then the default namespace is affected.
+
+
+
Add an XML Namespace declaration. This function may be called at any time, and its precise effect depends on when it is called; see below
+
+
+
xml_UndeclareNamespace
+(prefix) string: The namespace prefix to be used in the document. If absent, then the default namespace is affected.
+
+
+
Undeclare an XML namespace. This is equivalent to declaring an namespace with an empty URI, and renders the namespace ineffective for the scope of the declaration. For explanation of its scope, see below.
+
+
NB Use of xml_UndeclareNamespace implies that the resultant document will be compliant with XML Namespaces 1.1, but not 1.0; wxml will issue an error when trying to undeclare namespaces under XML 1.0.
+
+
Scope of namespace functions
+
+
If xml_[Un]declareNamespace is called immediately prior to an xml_NewElement call, then the namespace will be declared in that next element, and will therefore take effect in all child elements.
+
+
If it is called prior to an xml_NewElement call, but that element has namespaced attributes
+
+
To explain by means of example: In order to generate the following XML output:
However, to generate XML input like so:
+
+that is, where the namespace refers to an attribute at the same level,
+then as long as the xml_DeclareNamespace call is made before the element tag is closed (either by xml_EndElement, or by a new element tag being opened, or some text being added etc.) the correct XML will be generated.
+
+
Two previously mentioned functions are affected when used in a namespace-aware fashion.
+
+
+
xml_NewElement, xml_AddAttribute
+
+
+
The element or attribute name is checked, and if it is a QName (ie if it is of the form prefix:tagName) then wxml will check that prefix is a
+registered namespace prefix, and generate an error if not.
+
+
+
+
More rarely used functions:
+
+
If you don't know the purpose of any of these, then you don't need to.
+
+
+
xml_AddXMLDeclaration
+(version) string: XML version to be used.
+default: 1.0
+(encoding) string: character encoding of the document
+default: absent
+(standalone) logical: is this document standalone?
+default: absent
+
+
+
Add XML declaration to the first line of output. If used, then the file must have been opened with addDecl = .false., and this must be the first wxml call to the document.o
+
+
NB The only XML versions available are 1.0 and 1.1. Attempting to specify anything else will result in an error. Specifying version 1.0 results in additional output checks to ensure the resultant document is XML-1.0-conformant.
+
+
NB Note that if the encoding is specified, and is specified to not be UTF-8, then if the specified encoding does not match that supported by the Fortran processor, you may end up with output you do not expect.
+
+
+
xml_AddDOCTYPE
+namestring: DOCTYPE name
+(system) string: DOCTYPE SYSTEM ID
+(public) string: DOCTYPE PUBLIC ID
+
+
+
Add an XML document type declaration. If used, this must be used prior to first xml_NewElement call, and only one such call must be made.
+
+
+
xml_AddInternalEntity
+namestring: name of internal entity
+valuestring: value of internal entity
+
+
+
Define an internal entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddExternalEntity
+namestring: name of external entity
+systemstring: SYSTEM ID of external entity
+(public) string: PUBLIC ID of external entity
+default: absent
+(notation) string: notation for external entity
+default: absent
+
+
+
Define an external entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddParameterEntity
+namestring: name of parameter entity
+(PEdef) string: definition of parameter entity
+default: absent
+(system) string: SYSTEM ID of parameter entity
+default: absent
+(public) string: PUBLIC ID of parameter entity
+default: absent
+
+
+
Define a parameter entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddNotation
+namestring: name of notation
+(system) string: SYSTEM ID of notation
+default: absent
+(public) string: PUBLIC ID of notation
+default: absent
+
+
+
Define a notation for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddElementToDTD
+namestring: name of element
+declarationstring: declaration of element
+
+
+
Add an ELEMENT declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how elements may be added in the content of the XML document.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddAttlistToDTD
+namestring: name of element
+declarationstring: declaration of element
+
+
+
Add an ATTLIST declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how attributes may be added in the content of the XML document.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddPEreferenceToDTD
+namestring: name of PEreference
+
+
+
Add a reference to a Parameter Entity in the DTD. No check is made according to whether the PE exists, has been declared, or may legally be used.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddXMLStylesheet
+href :string:
+address of stylesheet
+type: string:
+type of stylesheet (generally "text/xsl")
+(title): string:
+title of stylesheet
+default: none
+(media): string:
+output media type
+default: none
+(charset): string
+charset of media type
+default:none
+(alternate): string:
+alternate
+default:none
+
+
+
Add XML stylesheet processing instruction, as described in [Stylesheets]. If used, this call must be made before the first xml_NewElement call.
+
+
+
xml_AddXMLPI
+name: string:
+name of PI
+(data): string:
+data for PI
+(xml): logical: (see below)
+default: false
+(ws_significant): logical: if this is a PI containing only data, then is any whitespace in the data significant? default: unknown
+
+
+
Add an XML Processing Instruction.
+
+
If data is present, nothing further can be added to the PI. If it is not present, then pseudoattributes may be added using the call below.
+Normally, the name is checked to ensure that it is XML-compliant. This requires that PI targets not start with [Xx][Mm][Ll], because such names are reserved. However, some are defined by later W3 specificataions. If you wish to use such PI targets, then set xml=.true. when outputting them.
+
+
The output PI will look like:
+<?name data?>
+
+
+
xml_AddPseudoAttribute
+name: string:
+Name of pseudoattribute
+value: anytype:
+Value of pseudoattribute
+(ws_significant): logical: If there is any whitespace in the value of this pseudoattribute, is is significant?
+
+
+
Add a pseudoattribute to the currently open PI.
+
+
+
xml_AddComment
+comment: string
+Contents of comment
+(ws_significant): logical: is any whitespace in the comment string significant? default: unknown
+
+
+
Add an XML comment.
+
+
+
xml_AddEntityReference
+entityref: Entity reference.
+
+
+
This may be used anywhere that xml_AddCharacters may be, and will insert an entity reference into the contents of the XML document at that point. Note that if the entity inserted is a character entity, its validity well be checked according to the rules of XML-1.1, not 1.0.
+
+
If the entity reference is not a character entity, then no check is made of its validity, and a warning will be issued
+
+
Functions to query XML file objects
+
+
These functions may be of use in building wrapper libraries:
+
+
+
xmlf_Name result(string)
+
+
+
Return the filename of an open XML file
+
+
+
xmlf_OpenTag result(string)
+
+
+
Return the currently open tag of the current XML file (or the empty string if none is open)
+
+
+
xmlf_GetPretty_print result(logical)
+
+
+
Return the current value of pretty_print.
+
+
+
xmlf_SetPretty_print
+NewValue: logical
+
+
+
Set the current value of pretty_print to the NewValue. This may be useful in a mixed namespace
+document where pretty printing the output may change the meaning under one of the namespaces.
+
+
Exceptions
+
+
+
+
Below are explained areas where wxml fails to implement the whole of XML 1.0/1.1. These are divided into two lists; where wxml does not permit the generation of a particular well-formed XML document, and where it does permit the generation of a particular non-well-formed document.
+
+
Ways in which wxml renders it impossible to produce a certain sort of well-formed XML document:
+
+
+
Unicode support is limited. Due to the limitations of Fortran, wxml is unable to manipulate characters outwith 7-bit US-ASCII. wxml will ensure that characters corresponding to those in 7-bit ASCII are output correctly within the constraints of the version of XML in use, for a UTF-8 encoding. Attempts to directly output any other characters will have undefined effects. Output of other unicode characters is possible through the use of character entities.
+
Due to the constraints of the Fortran IO specification, it is impossible to output arbitrary long strings without carriage returns. The size of the limit varies between processors, but may be as low as 1024 characters. To avoid overrunning this limit, wxml will by default insert carriage returns before every new element, and if an unbroken string of attribute or text data is requested greater than 1024 characters, then carriage returns will be inserted as appropriate; within whitespace if possible; to ensure it is broken up into smaller sections to fit within the limits.
+
+
+
wxml will try very hard to ensure that output is well-formed. However, it is possible to fool wxml into producing ill-formed XML documents. Avoid doing so if possible; for completeness these ways are listed here. In all cases where ill-formedness is a possibility, a warning can be issued. These warnings can be verbose, so are off by default, but if they are desired, they can be switched on by manipulating the warning argument to xml_OpenFile.
+
+
+
If you specify a non-default text encoding, and then run FoX on a platform which does not use this encoding, then the result will be nonsense, and more than likely ill-formed. FoX will issue a warning in this case.
+
When adding any text, if any characters are passed in (regardless of character set) which do not have equivalants within 7-bit ASCII, then the results are processor-dependent, and may result in an invalid document on output. A warning will be issued if this occurs. If you need a guarantee that such characters will be passed correctly, use character entities.
+
If any parameter entities are referenced, no checks are made that the document after parameter-entity-expansion is well-formed. A warning will be issued.
+
+
+
Validity constraints
+
+
Finally, note that constraints on XML documents are divided into two sets - well-formedness constraints (WFC) and validity constraints (VC). The above only applies to WFC checks. wxml can make some minimal checks on VCs, but this is by no means complete, nor is it intended to be. These checks are off by default, but may be switched on by manipulating the validate argument to xml_OpenFile.
+
+
+
diff --git a/docs/Information.html b/docs/Information.html
new file mode 100644
index 00000000..9c4b837e
--- /dev/null
+++ b/docs/Information.html
@@ -0,0 +1,24 @@
+
+
+
+
+ Information
+
+
+
+
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
FoX is licensed under the agreement below. This is intended to make it as freely available as possible, subject only to retaining copyright notices and acknowledgements.
+
+
If for any reason this license causes issues with your intended use of the code, please contect the author.
+
+
The license can also be found within the distributed source, in the file FoX/LICENSE
Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+
+
Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
Neither the name of the copyright holder nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
Third-party code.
+
+
In addition, FoX includes a random number library, written by Scott Robert Ladd, which is licensed as follows:
+
+
! This computer program source file is supplied "AS IS". Scott Robert
+! Ladd (hereinafter referred to as "Author") disclaims all warranties,
+! expressed or implied, including, without limitation, the warranties
+! of merchantability and of fitness for any purpose. The Author
+! assumes no liability for direct, indirect, incidental, special,
+! exemplary, or consequential damages, which may result from the use
+! of this software, even if advised of the possibility of such damage.
+!
+! The Author hereby grants anyone permission to use, copy, modify, and
+! distribute this source code, or portions hereof, for any purpose,
+! without fee, subject to the following restrictions:
+!
+! 1. The origin of this source code must not be misrepresented.
+!
+! 2. Altered versions must be plainly marked as such and must not
+! be misrepresented as being the original source.
+!
+! 3. This Copyright notice may not be removed or altered from any
+! source or altered source distribution.
+!
+! The Author specifically permits (without fee) and encourages the use
+! of this source code for entertainment, education, or decoration. If
+! you use this source code in a product, acknowledgment is not required
+! but would be appreciated.
Two procedures are provided to simplify reading data retreved from XML documents into Fortran variables. The subroutine rts performs the data conversion step and the function countrts can be used to allocate an array of the correct size for the incomming data.
+
+
rts subroutine
+
+
The rts subroutine can be imported from FoX_common. In its simplest form, it is called in this fashion:
+
+
call rts(string, data)
+
+
+
string is a simple Fortran string (probably retrieved from an XML file.)
+
+
data is any native Fortran datatype: logical, character, integer, real, double precision, complex, double complex, and may be a scalar, 1D or 2D array.
+
+
rts will attempt to parse the contents of string into the appropriate datatype, and return the value in data.
+
+
Additional information or error handling is accomplished with the following optional arguments:
+
+
num
+
+
num is an integer; on returning from the function it indicates the number of data items read before either:
+
+
+
an error occurred
+
the string was exhausted of data items
+
data was filled.
+
+
+
iostat
+
+
iostat is an integer, which on return from the function has the values:
+
+
+
0 for no problems
+
-1 if too few elements were found in string to fill up data
+
1 if data was filled, but there were still data items left in string
+
2 if the characters found in string could not be converted to the appropriate type for data.
+
+
+
NB if iostat is not specified, and a non-zero value is returned, then the program will stop with an error message.
+
+
String formatting
+
+
When string is expected to be an array of strings, the following options are used to break string into its constituent elements:
+
+
+
By default it is assumed that the elements are separated by whitespace, and that multiple whitespace characters are not significant. No zero-length elements are possible, nor are elements containing whitespace.
+
An optional argument, separator may be specified, which is a single character. In this case, each element consists of all characters between subsequent occurences of the separator. Zero-length elements are possible, but no escaping mechanism is possible.
+
Alternatively, an optional logical argument csv may be specified. In this case, the value of delimiter is ignored, and the string is parsed as a Comma-Separated-Value string, according to RFC 4180.
+
+
+
Numerical formatting.
+
+
Numbers are expected to be formatted according to the usual conventions for Fortran input.
+
+
Complex number formatting.
+
+
Complex numbers may be formatted according to either normal Fortran conventions (comma-separated pairs) or CMLComp conventions
+
+
Logical variable formatting.
+
+
Logical variables must be encoded according to the conventions of XML Schema Datatypes - that is, True may be written as "true" or "1", and False may be written as "false" or "0".
+
+
countrts function
+
+
The countrts function can also be imported from FoX_common. In its simplest form, it is called in this fashion:
+
+
countrts(string, datatype)
+
+
+
string is a simple Fortran string (probably retrived from an XML file)
+
+
datatype is a scalar argument of any native Fortran datatype (logical, character, integer, real, double precision, complex or double complex).
+
+
The function returns a default integer equal to the number of elements that rts would
+return if called with a sufficently large array of the same type as datatype. countrts returns 0 to indicate that characters were found in the string that could not be converted. If datatype is a character, the optional arguments seperator and csv are avalable as described in "string formatting" above. The countrts function is pure and can be used as a specification function.
Many of the routines in wxml, and indeed in wcml which is built on top of wxml, are overloaded so that data may be passed to the same routine as string, integer, logical, real, or complex data.
+
+
In such cases, a few notes on the conversion of non-textual data to text is in order. The
+standard Fortran I/O formatting routines do not offer the control required for useful XML output, so FoX performs all its own formatting.
+
+
This formatting is done internally through a function which is also available publically to the user, str.
+
+
To use this in your program, import it via:
+
+
use FoX_common, only; str
+
+
+
and use it like so:
+
+
print*, str(data)
+
+
+
In addition, for ease of use, the // concatenation operator is overloaded, such that strings can easily be formed by concatenation of strings to other datatypes. To use this you must import it via:
+
+
use FoX_common, only: operator(//)
+
+
+
and use it like so:
+
+
integer :: data
+ print*, "This is a number "//data
+
+
+
This will work for all native Fortran data types - but no floating point formatting is available as described below with concatenation, only with str()
+
+
You may pass data of the following primitive types to str:
+
+
Scalar data
+
+
Character (default kind)
+
+
Character data is returned unchanged.
+
+
Logical (default kind)
+
+
Logical data is output such that True values are converted to the string 'true', and False to the string 'false'.
+
+
Integer (default kind)
+
+
Integer data is converted to the standard decimal representation.
+
+
Real numbers (single and double precision)
+
+
Real numbers, both single and double precision, are converted to strings in one of two ways, with some control offered to the user. The output will conform to the real number formats specified by XML Schema Datatypes.
+
+
This may be done in one of two ways:
+
+
+
Exponential notation, with variable number of significant figures. Format strings of the form "sn" are accepted, where n is the number of significant figures.
+
+
Thus the number 111, when output with various formats, will produce the following output:
+
+
+
+
+
s1
1e2
+
+
s2
1.1e2
+
+
s3
1.11e2
+
+
s4
1.110e2
+
+
+
+
The number of significant figures should lie between 1 and the number of digits precision provided by the real kind. If a larger or smaller number is specified, output will be truncated accordingly. If unspecified, then a sensible default will be chosen.
+
+
This format is not permitted by XML Schema Datatypes 1.0, though it is in 2.0
+
+
+
Non-exponential notation, with variable number of digits after the decimal point. Format strings of the form "rn", where n is the number of digits after the decimal point.
+
+
Thus the number 3.14159, when output with various formats, will produce the following output:
+
+
+
+
+
r0
3
+
+
r1
3.1
+
+
r2
3.14
+
+
r3
3.142
+
+
+
+
The number of decimal places must lie between 0 and whatever would output the maximum digits precision for that real kind. If a larger or smaller number is specified, output will be truncated accorsingly. If unspecified, then a sensible default will be chosen.
+
+
This format is the only one permitted by XML Schema Datatypes 1.0
+
+
If no format is specified, then a default of exponential notation will be used.
+
+
If a format is specified not conforming to either of the two forms above, a run-time error will be generated.
+
+
NB Since by using FoX or str, you are passing real numbers through various functions, this means that
+ they must be valid real numbers. A corollary of this is that if you pass in +/-Infinity, or NaN, then
+ the behaviour of FoX is unpredictable, and may well result in a crash. This is a consequence of the
+ Fortran standard, which strictly disallows doing anything at all with such numbers, including even
+ just passing them to a subroutine.
+
+
Complex numbers (single and double precision)
+
+
Complex numbers will be output as pairs of real numbers, in the following way:
+
+
(1.0e0)+i(1.0e0)
+
+
where the two halves can be formatted in the way described for 'Real numbers' above; only one format may be specified, and it will apply to both.
+
+
All the caveats described above apply for complex number as well; that is, output of complex numbers either of whose components are infinite or NaN is illegal in Fortran, and more than likely will cause a crash in FoX.
+
+
Arrays and matrices
+
+
All of the above types of data may be passed in as arrays and matrices as well. In this case, a string containing all the individual elements will be returned, ordered as they would be in memory, each element separated by a single space.
+
+
If the data is character data, then there is an additional option to str, delimiter which may be any single-character string, and will replace a space as the delimiter.
+
+
wxml/wcml wrappers.
+
+
All functions in wxml which can accept arbitrary data (roughly, wherever you put anything that is not an XML name; attribute values, pseudo-attribute values, character data) will take scalars, arrays, and matrices of any of the above data types, with fmt= and delimiter= optional arguments where appropriate.
+
+
Similarly, wcml functions which can accept varied data will behave similarly.
This documentation describes version 4.1 of the FoX library.
+
+
This version includes output modules for general XML, and for CML; and a fully validating XML parser, exposed through a Fortran version of the SAX2 input parser and a Fortran mapping of the W3C DOM interface.
+
+
This is a stable branch, which will be maintained with important bugfixes.
+
+
+
+
FoX Changes
+
+
As of FoX-3.0, there is one user-visible change that should be noted.
+
+
Configuration/compilation
+
+
In previous versions of FoX, the configure script was accessible as config/configure. Version 3.0 now follows common practice by placing the script in the main directory, so it is now called as ./configure.
+
+
Previous versions of FoX made it quite hard to compile only portions of the library (eg only the CML output portion; or just the SAX input). This is now possible by specifying arguments to the configuration script. For example,
+
+
./configure --enable-wcml
+
+
will cause the generated Makefile to only compile the CML writing module and its dependencies.
This documentation is largely reference in nature. For new users it is best to start elsewhere:
+
+
iFaX workshops
+
+
Two workshops, entitled iFaX (Integrating Fortran and XML) have been run teaching the use of FoX, one in January 2007, and one in January 2008. The full documentation and lectures from these may be found at:
These documents describe all publically usable APIs.
+
+
Worked examples of the use of some of these APIs may be found in the examples/ subdirectory, and tutorial-style documentaion is available from the links above.
This documentation is largely reference in nature. For new users it is best to start elsewhere:
+
+
iFaX workshops
+
+
Two workshops, entitled iFaX (Integrating Fortran and XML) have been run teaching the use of FoX, one in January 2007, and one in January 2008. The full documentation and lectures from these may be found at:
These documents describe all publically usable APIs.
+
+
Worked examples of the use of some of these APIs may be found in the examples/ subdirectory, and tutorial-style documentaion is available from the links above.
This documentation describes version 4.1 of the FoX library.
+
+
This version includes output modules for general XML, and for CML; and a fully validating XML parser, exposed through a Fortran version of the SAX2 input parser and a Fortran mapping of the W3C DOM interface.
+
+
This is a stable branch, which will be maintained with important bugfixes.
+
+
+
+
FoX Changes
+
+
As of FoX-3.0, there is one user-visible change that should be noted.
+
+
Configuration/compilation
+
+
In previous versions of FoX, the configure script was accessible as config/configure. Version 3.0 now follows common practice by placing the script in the main directory, so it is now called as ./configure.
+
+
Previous versions of FoX made it quite hard to compile only portions of the library (eg only the CML output portion; or just the SAX input). This is now possible by specifying arguments to the configuration script. For example,
+
+
./configure --enable-wcml
+
+
will cause the generated Makefile to only compile the CML writing module and its dependencies.
You will have received the FoX source code as a tar.gz file.
+
+
Unpack it as normal, and change directory into the top-level directory, FoX-$VERSION.
+
+
Requirements for use
+
+
FoX requires a Fortran 95 compiler - not just Fortran 90. All currently available versions of Fortran compilers claim to support F95. If your favoured compiler is not listed as working, I recommend the use of g95, which is free to download and use. And in such a case, please send a bug report to your compiler vendor.
+
+
In the event that you need to write a code targetted at multiple compilers, including some which have bugs preventing FoX compilation, please note the possibility of producing a dummy library.
+
+
Configuration
+
+
+
In order to generate the Makefile, make sure that you have a Fortran compiler in your PATH, and do:
+
+
./configure
+
+
+
This should suffice for most installations. However:
+
+
+
You may not be interested in all of the modules that FoX supplies. For example, you may only be interested in output, not input. If so, you can select which modules you want using --enable-MODULENAME where MODULENAME is one of wxml, wcml, wkml, sax, dom. If none are explicitly enabled, then all will be built. (Alternatively, you can exclude modules one at a time with --disable-MODULENAME) Thus, for example, if you only care about CML output, and not anything else: ./configure --enable-wcml
+
If you have more than one Fortran compiler available, or it is not on your PATH, you can force the choice by doing:
+
+
./configure FC=/path/to/compiler/of/choice
+
It is possible that the configuration fails. In this case
+
+
+
please tell me about it so I can fix it
+
all relevant compiler details are placed in the file arch.make; you may be able to edit that file to allow compilation. Again, if so, please let me know what you need to do.
+
+
By default the resultant files are installed under the objs directory. If you wish them to be installed elsewhere, you may do
+
+
./configure --prefix=/path/to/installation
+
+
+
Note that the configure process encodes the current directory location in several
+places. If you move the FoX directory later on, you will need to re-run configure.
+
+
+
You may be interested in dummy compilation. This is activated with the --enable-dummy switch (but only works for wxml/wcml currently).
+
+
./configure --enable-wcml --enable-dummy
+
+
+
Compilation
+
+
In order to compile the full library, now simply do:
+
+
make
+
+
+
This will build all the requested FoX modules, and the relevant examples
+
+
Testing
+
+
In the full version of the FoX library, there are several testsuites included.
+
+
To run them all, simply run make check from the top-level directory. This will run the individual testsuites, and collate their results.
+
+
If any failures occur (unrelated to known compiler issues, see the up-to-date list), please send a message to the mailing list (fox-discuss@googlegroups.com) with details of compiler, hardware platform, and the nature of the failure.
+
+
The testsuites for the SAX and DOM libraries are very extensive, and are somewhat fragile, so are not distributed with FoX. Please contact the author for details.
+
+
Linking to an existing program
+
+
+
The files all having been compiled and installed, you need to link them into your program.
+
+
+
A script is provided which will provide the appropriate compiler and linker flags for you; this will be created after configuration, in the top-level directory, and is called FoX-config. It may be taken from there and placed anywhere.
+
+
FoX-config takes the following arguments:
+
+
+
--fcflags: return flags for compilation
+
--libs: return flags for linking
+
--wxml: return flags for compiling/linking against wxml
+
--wcml: return flags for compiling/linking against wcml
+
--sax: return flags for compiling/linking against sax
+
+
+
If it is called with no arguments, it will expand to compile & link flags, thusly:
+
+
f95 -o program program.f90 `FoX-config`
+
+
+
For compiling only against FoX, do the following:
+
+
f95 -c `FoX-config --fcflags` sourcefile.f90
+
+
+
For linking only to the FoX library, do:
+
+
f95 -o program `FoX-config --libs` *.o
+
+
+
or similar, according to your compilation scheme.
+
+
Note that by default, FoX-config assumes you are using all modules of the library. If you are only using part, then this can be specified by also passing the name of each module required, like so:
+
+
FoX-config --fcflags --wcml
+
+
+
Compiling a dummy library
+
+
+
+
Because of the shortcomings in some compilers, it is not possible to compile FoX everywhere. Equally, sometimes it is useful to be able to compile a code both with and without support for FoX (perhaps to reduce executable size). Especially where FoX is being used only for additional output, it is useful to be able to run the code and perform computations even without the possibility of XML output.
+
+
For this reason, it is possible to compile a dummy version of FoX. This includes all public interfaces, so that your code will compile and link correctly - however none of the subroutines do anything, so you can retain the same version of your code without having to comment out all FoX calls.
+
+
Because this dummy version of FoX contains nothing except empty subroutines, it compiles and links with all known Fortran 95 compilers, regardless of compiler bugs.
+
+
To compile the dummy code, use the --enable-dummy switch. Note that currently the dummy mode is not yet available for the DOM module.
+
+
Alternative build methods
+
+
The "-full" versions of FoX are also shipped with files
+to help compile the code on using other systems using CMake
+or from within Microsoft Visual Studio. Brief instructions for
+using these files are below.
+
+
CMake
+
+
CMake does not build software itself but generates makefiles or
+projectfiles (depending on the platform), that are then used to
+compile the software, it should thus be a cross platform
+method for building FoX (in theory at least).
+
+
Files needed for building FoX with CMake are included in the
+"-full" distribution. These can:
+
+
+
do similar checks as current build tools to check for example how
+ABORT and FLUSH work,
+wether or not certain bugs in compilers are present,
+
compile FoX into static libraries.
+
generate Fortran files from m4 sources if m4 is present.
+
do out-of-source build, does not interfere with current build system
+
do a parallel build of fox (make -j)
+
+
+
However, CMake cannot, at present, build the run the test suite or
+the packaging scripts used for release. To build FoX with CMake
+the following is needed:
m4 to generate fortran files from m4 sources (optional).
+
+
+
CMake Build instructions (linux):
+Once you installed cmake, go to the main directory of fox
+and create a build directory, and from there, execute cmake thus:
+
+
cd fox/
+
+mkdir build/ && cd build/
+
+cmake ../
+
+make -j
+
+
+
Libaries and module files can then be found in the subdirectories of build.
+
+
Windows
+
+
It is also possible to build FoX from within Microsoft Visual Studio
+and the file FoX.vfproj contains a Visual Studio project for Intel Fortran
+to simplify this process. At time of writing, it is compatible with
+Visual Studio 2011 and Intel Visual Fortran Composer XE 2011.
+
+
The project will build FoX in one of the four
+ configurations: Win32/x64 and debug/release.
+When building FoX for a specific configuration,
+an output library file Fox_debug.lib or Fox.lib
+and associated modules are created in a folder in
+a relative path ../lib or ../libx64 respectively.
+
+
For a given configuration in in your application project
+you will then need to:
+
+
+
In "Fortran" "General" "Additional Include Directories" add
+the respective modules folder (generated above)
+
In "Linker" "General" "Additional library directories" add the
+path to the respective lib or libx64 folder.
+
In "Linker" "Input" "Additional dependencies" add Fox_debug.lib
+or FoX.lib respectively.
+
+
+
Your application should now be able to build and link with FoX.
+
+
+
Using FoX in your own project.
+
+
The recommended way to use FoX is to embed the full source code as a subdirectory, into an existing project.
+
+
In order to do this, you need to do something like the following:
+
+
+
Put the full source code as a top-level subdirectory of the tree, called FoX.
+
Incorporate calls to FoX into the program.
+
Incorporate building FoX into your build process.
+
+
+
To incorporate into the program
+
+
It is probably best to isolate use of XML facilities to a small part of the program. This is easily accomplished for XML input,
+which will generally happen in only one or two places.
+
+
For XML output, this can be more complex. The easiest, and least intrusive way is probably to create a F90 module for your program, looking something like example_xml_module.f90
+
+
Then you must somewhere (probably in your main program), use this module, and call initialize_xml_output() at the start; and then end_xml_output() at the end of the program.
+
+
In any of the subroutines where you want to output data to the xml file, you should then insert use example_xml_module at the beginning of the subroutine. You can then use any of the xml output routines with no further worries, as shown in the examples.
+
+
It is easy to make the use of FoX optional, by the use of preprocessor defines. This can be done simply by wrapping each call to your XML wrapper routines in #ifdef XML, or similar. Alternatively, the use of the dummy FoX interfaces allows you to switch FoX on and off at compile time - see Compilation.
+
+
To incorporate into the build process:
+
+
Configuration
+
+
First, FoX must be configured, to ensure that it is set up correctly for your compiler.
+(See Compilation)
+If your main code has a configure step, then run FoX's configure as part of it.
+
+
If your code doesn't have its own configure step, then the first thing that "make" does
+should be to configure FoX, if it's not already configured. But that should only happen
+once; every time you make your code thereafter, you don't need to re-configure FoX,
+because nothing has changed. To do that, put a target like the following in your
+Makefile.
+
+
FoX/.config:
+ (cd FoX; ./configure FC=$(FC))
+
+
+
(Assuming that your Makefile already has a variable FC which sets the Fortran compiler)
+
+
When FoX configure completes, it "touch"es a file called FoX/.config. That means that
+whenever you re-run your own make, it checks to see if FoX/.config exists - if it does,
+then it knows FoX doesn't need to be re-configured, so it doesn't bother.
+
+
Compilation of FoX
+
+
Then, FoX needs to be compiled before your code (because your modules will depend
+on FoX's modules.) But again, it only needs to be compiled once. You won't be changing
+FoX, you'll only be changing your own code, so recompiling your code doesn't require
+recompiling FoX.
+
+
So, add another target like the following;
+
+
FoX/.FoX: FoX/.config
+ (cd FoX; $(MAKE))
+
+
+
This has a dependency on the configure script as I showed above, but it will only run it
+if the configure script hasn't already been run.
+
+
When FoX is successfully compiled, the last thing its Makefile does is "touch" the file called
+FoX/.FoX. So the above target checks to see if that file exists; and if it does, then it doesn't
+bother recompiling FoX, because it's already compiled. On the very first time you compile
+your code, it will cd into the FoX directory and compile it - but then never again.
+
+
You then need to have that rule be a dependency of your main target; like so:
+
+
MyExecutable: FoX/.FoX
+
+
+
(or whatever your default Makefile rule is).
+
+
which will ensure that before MyExecutable is compiled, make will check to see that FoX
+has been compiled (which most of the time it will be, so nothing further will happen).
+But the first time you compile your code, it will call the FoX target, and FoX will be
+configured & compiled.
+
+
Compiling/linking your code
+
+
You should add this to your FFLAGS (or equivalent - the variable that holds
+flags for compile-time use.
to make sure that you get the path to your modules. (Different compilers have different flags for specifying module
+paths; some use -I, some use -M, etc, if you use the above
+construction it will pick the right one automatically for your compiler.)
+
+
Similarly, for linking, add the following to your LDFLAGS (or equivalent - the variable
+that holds flags for link-time use.)
+
+
LDFLAGS=-lwhatever $$(FoX/FoX-config --libs)
+
+
+
(For full details of the FoX-config script, see Compilation)
+
+
Cleaning up
+
+
Finally - you probably have a clean target in your makefile. Don't tie FoX into this
+target - most of the time when you make clean, you don't want to make clean with
+FoX as well, because there's no need - FoX won't have changed and
+it'll take a couple of minutes to recompile.
+
+
However, you can add a distclean (or something) target, which you use before
+moving your code to another machine, that looks like:
+
+
distclean: clean
+ (cd FoX; $(MAKE) distclean)
+
+
+
and that will ensure that when you do make distclean, even FoX's object files are
+cleaned up. But of course that will mean that you have to reconfigure & recompile
+FoX next time you compile your code
+
+
+
Standards compliance
+
+
FoX is written with reference to the following standards:
The subroutine rts performs the reverse function, taking a string (obtained from an XML document) and converts it into a primitive Fortran datatype.
+
The function countrts examinies a string and determines the size of array requiered to hold all its data, once converted to a primitive Fortran datatype.
The final four procedures change the way that errors and warnings are handled when encounterd by any FoX modules. Using these procedures it is possible to convert non-fatal warnings and fatal errors to calls to the internal about routine. This generally has the effect of generating a stack trace or core dump of the program before temination. This is a global setting for all XML documents being manipulated. Two subroutines take a single logical argument to turn on (true) and off (false) the feature for warnings and errors respectivly:
+
+
+
FoX_set_fatal_warnings for warnings
+
FoX_set_fatal_errors for errors
+
+
+
and two functions (without arguments) allow the state to be checked:
+
+
+
FoX_get_fatal_warnings for warnings
+
FoX_get_fatal_errors for errors
+
+
+
Both fatal warnings and errors are off by default. This corresponds to the previous behaviour.
+
+
+
String handling in FoX
+
+
Many of the routines in wxml, and indeed in wcml which is built on top of wxml, are overloaded so that data may be passed to the same routine as string, integer, logical, real, or complex data.
+
+
In such cases, a few notes on the conversion of non-textual data to text is in order. The
+standard Fortran I/O formatting routines do not offer the control required for useful XML output, so FoX performs all its own formatting.
+
+
This formatting is done internally through a function which is also available publically to the user, str.
+
+
To use this in your program, import it via:
+
+
use FoX_common, only; str
+
+
+
and use it like so:
+
+
print*, str(data)
+
+
+
In addition, for ease of use, the // concatenation operator is overloaded, such that strings can easily be formed by concatenation of strings to other datatypes. To use this you must import it via:
+
+
use FoX_common, only: operator(//)
+
+
+
and use it like so:
+
+
integer :: data
+ print*, "This is a number "//data
+
+
+
This will work for all native Fortran data types - but no floating point formatting is available as described below with concatenation, only with str()
+
+
You may pass data of the following primitive types to str:
+
+
Scalar data
+
+
Character (default kind)
+
+
Character data is returned unchanged.
+
+
Logical (default kind)
+
+
Logical data is output such that True values are converted to the string 'true', and False to the string 'false'.
+
+
Integer (default kind)
+
+
Integer data is converted to the standard decimal representation.
+
+
Real numbers (single and double precision)
+
+
Real numbers, both single and double precision, are converted to strings in one of two ways, with some control offered to the user. The output will conform to the real number formats specified by XML Schema Datatypes.
+
+
This may be done in one of two ways:
+
+
+
Exponential notation, with variable number of significant figures. Format strings of the form "sn" are accepted, where n is the number of significant figures.
+
+
Thus the number 111, when output with various formats, will produce the following output:
+
+
+
+
+
s1
1e2
+
+
s2
1.1e2
+
+
s3
1.11e2
+
+
s4
1.110e2
+
+
+
+
The number of significant figures should lie between 1 and the number of digits precision provided by the real kind. If a larger or smaller number is specified, output will be truncated accordingly. If unspecified, then a sensible default will be chosen.
+
+
This format is not permitted by XML Schema Datatypes 1.0, though it is in 2.0
+
+
+
Non-exponential notation, with variable number of digits after the decimal point. Format strings of the form "rn", where n is the number of digits after the decimal point.
+
+
Thus the number 3.14159, when output with various formats, will produce the following output:
+
+
+
+
+
r0
3
+
+
r1
3.1
+
+
r2
3.14
+
+
r3
3.142
+
+
+
+
The number of decimal places must lie between 0 and whatever would output the maximum digits precision for that real kind. If a larger or smaller number is specified, output will be truncated accorsingly. If unspecified, then a sensible default will be chosen.
+
+
This format is the only one permitted by XML Schema Datatypes 1.0
+
+
If no format is specified, then a default of exponential notation will be used.
+
+
If a format is specified not conforming to either of the two forms above, a run-time error will be generated.
+
+
NB Since by using FoX or str, you are passing real numbers through various functions, this means that
+ they must be valid real numbers. A corollary of this is that if you pass in +/-Infinity, or NaN, then
+ the behaviour of FoX is unpredictable, and may well result in a crash. This is a consequence of the
+ Fortran standard, which strictly disallows doing anything at all with such numbers, including even
+ just passing them to a subroutine.
+
+
Complex numbers (single and double precision)
+
+
Complex numbers will be output as pairs of real numbers, in the following way:
+
+
(1.0e0)+i(1.0e0)
+
+
where the two halves can be formatted in the way described for 'Real numbers' above; only one format may be specified, and it will apply to both.
+
+
All the caveats described above apply for complex number as well; that is, output of complex numbers either of whose components are infinite or NaN is illegal in Fortran, and more than likely will cause a crash in FoX.
+
+
Arrays and matrices
+
+
All of the above types of data may be passed in as arrays and matrices as well. In this case, a string containing all the individual elements will be returned, ordered as they would be in memory, each element separated by a single space.
+
+
If the data is character data, then there is an additional option to str, delimiter which may be any single-character string, and will replace a space as the delimiter.
+
+
wxml/wcml wrappers.
+
+
All functions in wxml which can accept arbitrary data (roughly, wherever you put anything that is not an XML name; attribute values, pseudo-attribute values, character data) will take scalars, arrays, and matrices of any of the above data types, with fmt= and delimiter= optional arguments where appropriate.
+
+
Similarly, wcml functions which can accept varied data will behave similarly.
+
+
+
String conversion
+
+
Two procedures are provided to simplify reading data retreved from XML documents into Fortran variables. The subroutine rts performs the data conversion step and the function countrts can be used to allocate an array of the correct size for the incomming data.
+
+
rts subroutine
+
+
The rts subroutine can be imported from FoX_common. In its simplest form, it is called in this fashion:
+
+
call rts(string, data)
+
+
+
string is a simple Fortran string (probably retrieved from an XML file.)
+
+
data is any native Fortran datatype: logical, character, integer, real, double precision, complex, double complex, and may be a scalar, 1D or 2D array.
+
+
rts will attempt to parse the contents of string into the appropriate datatype, and return the value in data.
+
+
Additional information or error handling is accomplished with the following optional arguments:
+
+
num
+
+
num is an integer; on returning from the function it indicates the number of data items read before either:
+
+
+
an error occurred
+
the string was exhausted of data items
+
data was filled.
+
+
+
iostat
+
+
iostat is an integer, which on return from the function has the values:
+
+
+
0 for no problems
+
-1 if too few elements were found in string to fill up data
+
1 if data was filled, but there were still data items left in string
+
2 if the characters found in string could not be converted to the appropriate type for data.
+
+
+
NB if iostat is not specified, and a non-zero value is returned, then the program will stop with an error message.
+
+
String formatting
+
+
When string is expected to be an array of strings, the following options are used to break string into its constituent elements:
+
+
+
By default it is assumed that the elements are separated by whitespace, and that multiple whitespace characters are not significant. No zero-length elements are possible, nor are elements containing whitespace.
+
An optional argument, separator may be specified, which is a single character. In this case, each element consists of all characters between subsequent occurences of the separator. Zero-length elements are possible, but no escaping mechanism is possible.
+
Alternatively, an optional logical argument csv may be specified. In this case, the value of delimiter is ignored, and the string is parsed as a Comma-Separated-Value string, according to RFC 4180.
+
+
+
Numerical formatting.
+
+
Numbers are expected to be formatted according to the usual conventions for Fortran input.
+
+
Complex number formatting.
+
+
Complex numbers may be formatted according to either normal Fortran conventions (comma-separated pairs) or CMLComp conventions
+
+
Logical variable formatting.
+
+
Logical variables must be encoded according to the conventions of XML Schema Datatypes - that is, True may be written as "true" or "1", and False may be written as "false" or "0".
+
+
countrts function
+
+
The countrts function can also be imported from FoX_common. In its simplest form, it is called in this fashion:
+
+
countrts(string, datatype)
+
+
+
string is a simple Fortran string (probably retrived from an XML file)
+
+
datatype is a scalar argument of any native Fortran datatype (logical, character, integer, real, double precision, complex or double complex).
+
+
The function returns a default integer equal to the number of elements that rts would
+return if called with a sufficently large array of the same type as datatype. countrts returns 0 to indicate that characters were found in the string that could not be converted. If datatype is a character, the optional arguments seperator and csv are avalable as described in "string formatting" above. The countrts function is pure and can be used as a specification function.
+
+
+
WXML
+
+
wxml is a general Fortran XML output library. It offers a Fortran interface, in the form of a number of subroutines, to generate well-formed XML documents. Almost all of the XML features described in XML11 and Namespaces are available, and wxml will diagnose almost all attempts to produce an invalid document. Exceptions below describes where wxml falls short of these aims.
+
+
First, Conventions describes the conventions use in this document.
+
+
Then, Functions lists all of wxml's publically exported functions, in three sections:
+
+
+
Firstly, the very few functions necessary to create the simplest XML document, containing only elements, attributes, and text.
+
Secondly, those functions concerned with XML Namespaces, and how Namespaces affect the behaviour of the first tranche of functions.
+
Thirdly, a set of more rarely used functions required to access some of the more esoteric corners of the XML specification.
+
+
+
Please note that where the documentation below is not clear, it may be useful to look at some of the example files. There is a very simple example in the examples/ subdirectory, but which nevertheless shows the use of most of the features you will use.
+
+
A more elaborate example, using almost all of the XML features found here, is available in the top-level directory as wxml_example.f90. It will be automatically compiled as part of the build porcess.
+
+
+
+
Conventions and notes:
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
anytype: any of logical, integer, real(sp), real(dp), string
+
+
+
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
+
+
It is strongly recommended that the functions be used with keyword arguments rather than replying on implicit ordering.
+
+
Derived type: xmlf_t
+
+
This is an opaque type representing the XML file handle. Each function requires this as an argument, so it knows which file to operate on. (And it is an output of the xml_OpenFile subroutine) Since all subroutines require it, it is not mentioned below.
+
+
+
+
Function listing
+
+
+
+
Frequently used functions
+
+
+
xml_OpenFile
+filename: string: Filename to be opened
+xf: xmlf_t: XML File handle
+(channel): integer: What Fortran file handle should the XML file be attached to?
+default: picked by the library at runtime
+(pretty_print): logical: Should the XML output be formatted to look pretty? (This implies that whitespace is not significant)
+default: false
+(replace): logical: Should the file be replaced if it already exists?
+default: no, stop at runtime if file already exists
+(addDecl): logical: Should an XML declaration be added at the start of the file?
+default: yes
+(namespace): logical: Should wxml prevent the output of namespace-ill-formed documents?
+default: yes
+(validate): logical: Should wxml carry out any checks on the optional VC constraints specified by XML?
+default: no
+(warning): logical: Should wxml emit warnings when it is unable to guarantee well-formedness?
+default: no
+
+
+
Open a file for writing XML
+
+
By default, the XML will have no extraneous text nodes. This can have the effect of it
+looking slightly ugly, since there will be no newlines inserted between tags.
+
+
This behaviour can be changed to produce slightly nicer looking XML, by switching
+on pretty_print. This will insert newlines and spaces between some tags where
+they are unlikely to carry semantics. Note, though, that this does result in
+the XML produced being not quite what was asked for, since extra characters and
+text nodes have been inserted.
+
+
NB: The replace option should be noted. By default, xml_OpenFile will fail with a runtime error if you try and write to an existing file. If you are sure you want to continue on in such a case, then you can specify **replace**=.true. and any existing files will be overwritten. If finer granularity is required over how to proceed in such cases, use the Fortran inquire statement in your code. There is no 'append' functionality by design - any XML file created by appending to an existing file would be invalid.
+
+
+
xml_Close
+xf: xmlf_t: XML File handle
+(empty): Can the file be empty? default: .false.
+
+
+
Close an opened XML file, closing all still-opened tags so that it is well-formed.
+
+
In the normal run of event, trying to close an XML file with no root element will cause an error, since this is not well-formed. However, an optional argument, empty is provided in case it is desirable to close files which may be empty. In this case, a warning will still be emitted, but no fatal error generated.
+
+
+
xml_NewElement
+name: string:
+Name of tag (for namespaced output, you need to include the prefix)
+
+
+
Open a new element tag
+
+
+
xml_EndElement
+name: string:
+Name of tag to be closed (if it doesn't match currently open tag, you'll get an error)
+
+
+
Close an open tag
+
+
+
xml_AddAttribute
+name: string: Name of attribute
+value: anytype: Value of attribute
+(escape): logical: if the attribute value is a string, should the attribute value be escaped?
+default: true
+(type): string: the type of the attribute. This must be one of CDATA, ID, IDREF, IDREFS, NMTOKEN, NMTOKENS, ENTITY, ENTITIES, or NOTATION (always upper case). If specified, this must match any attribute declarations that have been previously declared in the DTD. If unspecified this (as the XML standard requires) defaults to CDATA.
+
+
+
Add an attribute to the currently open tag.
+
+
By default, if the attribute value contains markup characters, they will be escaped automatically by
+wxml before output.
+
+
However, in rare cases you may not wish this to happen - if you wish to output Unicode
+characters, or entity references. In this case, you should set escape=.false. for the relevant
+subroutine call. Note that if you do this, no checking on the validity of the output string iis performed; the onus is on you to ensure well-formedness
+
+
The value to be added may be of any type; it will be converted to text according to FoX's formatting rules,
+and if it is a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which
+case the delimiter may be changed to any other single character using an optional argument).
+
+
NB The type option is only provided so that in the case of an external DTD which FoX is unaware of, the attribute type can be specified (which gives FoX more information to ensure well-formedness and validity). Specifying the type incorrectly may result in spurious error messages)
+
+
+
xml_AddCharacters
+charsanytype:
+The text to be output
+(parsed): logical: Should the output characters be parsed (ie should the library replace '&' with '&' etc?) or unparsed (in which case
+the characters will be surrounded by CDATA tags.
+default: yes
+(delimiter): character(1): If data is a character array, what should the delimiter between elements be on output?
+default: a single space
+(ws_significant): logical: Is any whitespace in the string significant? default: unknown
+
+
+
Add text data. The data to be added may be of any type; they will be converted to text according to FoX's formatting rules,
+and if they are a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which
+case the delimiter may be changed to any other single character using an optional argument).
+
+
+
xml_AddNewline
+
+
+
Within the context of character output, add a (system-dependent) newline character. This function can only
+be called wherever xml_AddCharacters can be called. (Newlines outside of character context are under
+FoX's control, and cannot be manipulated by the user.)
+
+
+
+
Namespace-aware functions:
+
+
+
xml_DeclareNamespace
+nsURIstring: The URI of the namespace
+(prefix) string: The namespace prefix to be used in the document. If absent, then the default namespace is affected.
+
+
+
Add an XML Namespace declaration. This function may be called at any time, and its precise effect depends on when it is called; see below
+
+
+
xml_UndeclareNamespace
+(prefix) string: The namespace prefix to be used in the document. If absent, then the default namespace is affected.
+
+
+
Undeclare an XML namespace. This is equivalent to declaring an namespace with an empty URI, and renders the namespace ineffective for the scope of the declaration. For explanation of its scope, see below.
+
+
NB Use of xml_UndeclareNamespace implies that the resultant document will be compliant with XML Namespaces 1.1, but not 1.0; wxml will issue an error when trying to undeclare namespaces under XML 1.0.
+
+
Scope of namespace functions
+
+
If xml_[Un]declareNamespace is called immediately prior to an xml_NewElement call, then the namespace will be declared in that next element, and will therefore take effect in all child elements.
+
+
If it is called prior to an xml_NewElement call, but that element has namespaced attributes
+
+
To explain by means of example: In order to generate the following XML output:
However, to generate XML input like so:
+
+that is, where the namespace refers to an attribute at the same level,
+then as long as the xml_DeclareNamespace call is made before the element tag is closed (either by xml_EndElement, or by a new element tag being opened, or some text being added etc.) the correct XML will be generated.
+
+
Two previously mentioned functions are affected when used in a namespace-aware fashion.
+
+
+
xml_NewElement, xml_AddAttribute
+
+
+
The element or attribute name is checked, and if it is a QName (ie if it is of the form prefix:tagName) then wxml will check that prefix is a
+registered namespace prefix, and generate an error if not.
+
+
+
+
More rarely used functions:
+
+
If you don't know the purpose of any of these, then you don't need to.
+
+
+
xml_AddXMLDeclaration
+(version) string: XML version to be used.
+default: 1.0
+(encoding) string: character encoding of the document
+default: absent
+(standalone) logical: is this document standalone?
+default: absent
+
+
+
Add XML declaration to the first line of output. If used, then the file must have been opened with addDecl = .false., and this must be the first wxml call to the document.o
+
+
NB The only XML versions available are 1.0 and 1.1. Attempting to specify anything else will result in an error. Specifying version 1.0 results in additional output checks to ensure the resultant document is XML-1.0-conformant.
+
+
NB Note that if the encoding is specified, and is specified to not be UTF-8, then if the specified encoding does not match that supported by the Fortran processor, you may end up with output you do not expect.
+
+
+
xml_AddDOCTYPE
+namestring: DOCTYPE name
+(system) string: DOCTYPE SYSTEM ID
+(public) string: DOCTYPE PUBLIC ID
+
+
+
Add an XML document type declaration. If used, this must be used prior to first xml_NewElement call, and only one such call must be made.
+
+
+
xml_AddInternalEntity
+namestring: name of internal entity
+valuestring: value of internal entity
+
+
+
Define an internal entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddExternalEntity
+namestring: name of external entity
+systemstring: SYSTEM ID of external entity
+(public) string: PUBLIC ID of external entity
+default: absent
+(notation) string: notation for external entity
+default: absent
+
+
+
Define an external entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddParameterEntity
+namestring: name of parameter entity
+(PEdef) string: definition of parameter entity
+default: absent
+(system) string: SYSTEM ID of parameter entity
+default: absent
+(public) string: PUBLIC ID of parameter entity
+default: absent
+
+
+
Define a parameter entity for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddNotation
+namestring: name of notation
+(system) string: SYSTEM ID of notation
+default: absent
+(public) string: PUBLIC ID of notation
+default: absent
+
+
+
Define a notation for the document. If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddElementToDTD
+namestring: name of element
+declarationstring: declaration of element
+
+
+
Add an ELEMENT declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how elements may be added in the content of the XML document.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddAttlistToDTD
+namestring: name of element
+declarationstring: declaration of element
+
+
+
Add an ATTLIST declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how attributes may be added in the content of the XML document.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddPEreferenceToDTD
+namestring: name of PEreference
+
+
+
Add a reference to a Parameter Entity in the DTD. No check is made according to whether the PE exists, has been declared, or may legally be used.
+
+
If used, this call must be made after xml_AddDOCTYPE and before the first xml_NewElement call.
+
+
+
xml_AddXMLStylesheet
+href :string:
+address of stylesheet
+type: string:
+type of stylesheet (generally "text/xsl")
+(title): string:
+title of stylesheet
+default: none
+(media): string:
+output media type
+default: none
+(charset): string
+charset of media type
+default:none
+(alternate): string:
+alternate
+default:none
+
+
+
Add XML stylesheet processing instruction, as described in [Stylesheets]. If used, this call must be made before the first xml_NewElement call.
+
+
+
xml_AddXMLPI
+name: string:
+name of PI
+(data): string:
+data for PI
+(xml): logical: (see below)
+default: false
+(ws_significant): logical: if this is a PI containing only data, then is any whitespace in the data significant? default: unknown
+
+
+
Add an XML Processing Instruction.
+
+
If data is present, nothing further can be added to the PI. If it is not present, then pseudoattributes may be added using the call below.
+Normally, the name is checked to ensure that it is XML-compliant. This requires that PI targets not start with [Xx][Mm][Ll], because such names are reserved. However, some are defined by later W3 specificataions. If you wish to use such PI targets, then set xml=.true. when outputting them.
+
+
The output PI will look like:
+<?name data?>
+
+
+
xml_AddPseudoAttribute
+name: string:
+Name of pseudoattribute
+value: anytype:
+Value of pseudoattribute
+(ws_significant): logical: If there is any whitespace in the value of this pseudoattribute, is is significant?
+
+
+
Add a pseudoattribute to the currently open PI.
+
+
+
xml_AddComment
+comment: string
+Contents of comment
+(ws_significant): logical: is any whitespace in the comment string significant? default: unknown
+
+
+
Add an XML comment.
+
+
+
xml_AddEntityReference
+entityref: Entity reference.
+
+
+
This may be used anywhere that xml_AddCharacters may be, and will insert an entity reference into the contents of the XML document at that point. Note that if the entity inserted is a character entity, its validity well be checked according to the rules of XML-1.1, not 1.0.
+
+
If the entity reference is not a character entity, then no check is made of its validity, and a warning will be issued
+
+
Functions to query XML file objects
+
+
These functions may be of use in building wrapper libraries:
+
+
+
xmlf_Name result(string)
+
+
+
Return the filename of an open XML file
+
+
+
xmlf_OpenTag result(string)
+
+
+
Return the currently open tag of the current XML file (or the empty string if none is open)
+
+
+
xmlf_GetPretty_print result(logical)
+
+
+
Return the current value of pretty_print.
+
+
+
xmlf_SetPretty_print
+NewValue: logical
+
+
+
Set the current value of pretty_print to the NewValue. This may be useful in a mixed namespace
+document where pretty printing the output may change the meaning under one of the namespaces.
+
+
Exceptions
+
+
+
+
Below are explained areas where wxml fails to implement the whole of XML 1.0/1.1. These are divided into two lists; where wxml does not permit the generation of a particular well-formed XML document, and where it does permit the generation of a particular non-well-formed document.
+
+
Ways in which wxml renders it impossible to produce a certain sort of well-formed XML document:
+
+
+
Unicode support is limited. Due to the limitations of Fortran, wxml is unable to manipulate characters outwith 7-bit US-ASCII. wxml will ensure that characters corresponding to those in 7-bit ASCII are output correctly within the constraints of the version of XML in use, for a UTF-8 encoding. Attempts to directly output any other characters will have undefined effects. Output of other unicode characters is possible through the use of character entities.
+
Due to the constraints of the Fortran IO specification, it is impossible to output arbitrary long strings without carriage returns. The size of the limit varies between processors, but may be as low as 1024 characters. To avoid overrunning this limit, wxml will by default insert carriage returns before every new element, and if an unbroken string of attribute or text data is requested greater than 1024 characters, then carriage returns will be inserted as appropriate; within whitespace if possible; to ensure it is broken up into smaller sections to fit within the limits.
+
+
+
wxml will try very hard to ensure that output is well-formed. However, it is possible to fool wxml into producing ill-formed XML documents. Avoid doing so if possible; for completeness these ways are listed here. In all cases where ill-formedness is a possibility, a warning can be issued. These warnings can be verbose, so are off by default, but if they are desired, they can be switched on by manipulating the warning argument to xml_OpenFile.
+
+
+
If you specify a non-default text encoding, and then run FoX on a platform which does not use this encoding, then the result will be nonsense, and more than likely ill-formed. FoX will issue a warning in this case.
+
When adding any text, if any characters are passed in (regardless of character set) which do not have equivalants within 7-bit ASCII, then the results are processor-dependent, and may result in an invalid document on output. A warning will be issued if this occurs. If you need a guarantee that such characters will be passed correctly, use character entities.
+
If any parameter entities are referenced, no checks are made that the document after parameter-entity-expansion is well-formed. A warning will be issued.
+
+
+
Validity constraints
+
+
Finally, note that constraints on XML documents are divided into two sets - well-formedness constraints (WFC) and validity constraints (VC). The above only applies to WFC checks. wxml can make some minimal checks on VCs, but this is by no means complete, nor is it intended to be. These checks are off by default, but may be switched on by manipulating the validate argument to xml_OpenFile.
+
+
+
WCML
+
+
WCML is a library for outputting CML data. It wraps all the necessary XML calls, such that you should never need to touch any WXML calls when outputting CML.
+
+
The CML output is conformant to version 2.4 of the CML schema. The output
+can also be made conformant to the CompChem convention.
+
+
The available functions and their intended use are listed below. Quite deliberately, no reference is made to the actual CML output by each function.
+
+
Wcml is not intended to be a generalized Fortran CML output layer. rather it is intended to be a library which allows the output of a limited set of well-defined syntactical fragments.
This section of the manual will detail the available CML output subroutines.
+
+
Use of WCML
+
+
wcml subroutines can be accessed from within a module or subroutine by inserting
+
+
use FoX_wcml
+
+
+
at the start. This will import all of the subroutines described below, plus the derived type xmlf_t needed to manipulate a CML file.
+
+
No other entities will be imported; public/private Fortran namespaces are very carefully controlled within the library.
+
+
Dictionaries.
+
+
The use of dictionaries with WCML is strongly encouraged. (For those not conversant with dictionaries, a fairly detailed explanation is available at http://www.xml-cml.org/information/dictionaries)
+
+
In brief, dictionaries are used in two ways.
+
+
Identification
+
+
Firstly, to identify and disambiguate output data. Every output function below takes an optional argument, dictRef="". It is intended that every piece of data output is tagged with a dictionary reference, which will look something like nameOfCode:nameOfThing.
+
+
So, for example, in SIESTA, all the energies are output with different dictRefs, looking like: siesta:KohnShamEnergy, or siesta:kineticEnergy, etc. By doing this, we can ensure that later on all these numbers can be usefully identified.
+
+
We hope that ultimately, dictionaries can be written for codes, which will explain what some of these names might mean. However, it is not in any way necessary that this be done - and using dictRef attributes will help merely by giving the ability to disambiguate otherwise indistinguishable quantities.
+
+
We strongly recommend this course of action - if you choose to do follow our recommendation, then you should add a suitable Namespace to your code. That is, immediately aftercmlBeginFile and beforecmlStartCml, you should add something like:
If you don't have a webpage for your code, don't worry; the address is only used as an identifier, so anything that looks like a URL, and which nobody else is using, will suffice.
+
+
Quantification
+
+
Secondly, we use dictionaries for units. This is compulsory (unlike dictRefs above). Any numerical quantity that is output through cmlAddProperty or cmlAddParameter is required to carry units. These are added with the units="" argument to the function. In addition, every other function below which will take numerical arguments also will take optional units, although default will be used if no units are supplied.
+
+
Further details are supplied in section Units below.
+
+
General naming conventions for functions.
+
+
Functions are named in the following way:
+
+
+
All functions begin
+cml
+
To begin and end a section of the CML file,
+a pair of functions will exist:
+
+
+
cmlStartsomething
+
cmlEndsomething
+
+
To output a given quantity/property/concept etc. a function will exist
+cmlAddsomething
+
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
anytype: any of logical, integer, real(sp), real(dp), string
+
+
+
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
+
+
Also note that wherever a real number can be passed in (including through anytype) then the formatting can be specified using the conventions described in StringFormatting
+
+
+
scalar: single item
+
array: one-dimensional array of items
+
matrix: two-dimensional array of items
+
anydim: any of scalar, array, matrix
+
+
+
Where an array is passed in, it may be passed either as an assumed-shape array; that is, as an F90-style array with no necessity for specifying bounds; thusly:
All functions take as their first argument an XML file object, whose keyword is always xf. This file object is initialized by a cmlBeginFile function.
+
+
It is highly recommended that subroutines be called with keywords specified rather than relying on the implicit ordering of arguments. This is robust against changes in the library calling convention; and also stepsides a significant cause of errors when using subroutines with large numbers of arguments.
+
+
+
+
Units
+
+
Note below that the functions cmlAddParameter and cmlAddProperty both require that units be specified for any numerical quantities output.
+
+
If you are trying to output a quantity that is genuinely dimensionless, then you should specify units="units:dimensionless"; or if you are trying to output a countable quantity (eg number of CPUs) then you may specify units="units:countable".
+
+
For other properties, all units should be specified as namespaced quantities. If you are using
+a very few common units, it may be easiest to borrow definitions from the provided dictionaries;
A default units dictionary, containing only the very basic units that wcml needs to know about, which has a namespace of: http://www.uszla.me.uk/FoX/units, and wcml assigns it automatically to the prefix units.
+
+
This is added automatically, so attempts to add it manually will fail.
Otherwise, you should feel at liberty to construct your own namespace;
+declare it using cmlAddNamespace, and markup all your units as:
+
+
units="myNamespace:myunit"
+
+
+
Functions for manipulating the CML file:
+
+
+
cmlBeginFile
+filename: stringscalar: Filename to be opened.
+unit: integerscalar: what unit number should the file be opened on? If you don't
+care, you may specify -1 as the unit number, in which case wcml will make a guess
+(replace): logicalscalar: should the file be replaced if it already exists? default: yes
+
+
+
This takes care of all calls to open a CML output file.
+
+
+
cmlFinishFile
+
+
+
This takes care of all calls to close an open CML output file, once you have finished with it. It is compulsory to call this - if your program finished without calling this, then your CML file will be invalid.
+
+
+
cmlAddNamespace
+prefixstringscalar: prefix to be used
+URIstringscalar: namespace URI to be used
+
+
+
This adds a namespace to a CML file.
+NB This may only ever be called immediately after a cmlBeginFile call, before any
+output has been performed.
+Attempts to do otherwise will result in a runtime error.
+
+
This will be needed if you are adding dictionary references to your output. Thus for siesta, we do:
and then output all our properties and parameters with dictRef="siesta:something".
+
+
+
cmlStartCml
+(fileId) stringscalar: name of originating file. (default: current filename)
+(version) stringscalar: version of CML in use. (default: 2.4)
+(compchem) logicalscalar: add extra namespace declarations needed by the recent compchem CML convention. This provides a minimum level of infrastructure needed to create valid compchem documents. (default: false)
+
cmlEndCml
+
+
+
This pair of functions begin and end the CML output to an existing CML file. It takes care of namespaces.
+
+
Note that unless specified otherwise, there will be a convention attribute added to the cml tag specifying FoX_wcml-2.0 as the convention. (see http://www.uszla.me.uk/FoX for details)
+
+
Start/End sections
+
+
+
cmlStartMetadataList
+(name) stringscalar: name for the metadata list
+(role) stringscalar role which the element plays
+
cmlEndMetadataList
+
+
+
This pair of functions open & close a metadataList, which is a wrapper for metadata items.
+
+
+
cmlStartParameterList
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
cmlEndParameterList
+
+
+
This pair of functions open & close a parameterList, which is a wrapper for input parameters.
+
+
+
cmlStartPropertyList
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
cmlEndPropertyList
+
+
+
This pair of functions open & close a propertyList, which is a wrapper for output properties.
+
+
+
cmlStartKpointList
+
cmlEndKpointList
+
+
+
Start/end a list of k-points (added using cmlAddKpoint below)
+
+
+
cmlStartModule
+(serial) stringscalar: serial id for the module
+(title) stringscalar: title for module element
+(role) stringscalar: role which the element plays
+
+
+
Note that in most cases where you might want to use a serial number, you should probably be using the cmlStartStep subroutine below.
+
+
+
cmlEndModule
+
+
+
This pair of functions open & close a module of a computation which is unordered, or loosely-ordered. For example, METADISE uses one module for each surface examined.
+
+
+
cmlStartStep
+(index) integerscalar: index number for the step. In the absence of an index, steps will be assumed to be consecutively numbered. Specifying this is useful if you wish to output eg every hundredth step.
+(type) stringscalar: what sort of step is this? This should be a namespaced string, for example: siesta:CG is a Conjugate Gradient step in siesta.
+
cmlEndStep
+
+
+
This pair of functions open and close a module of a computation which is strongly ordered. For example, DLPOLY uses steps for each step of the simulation.
+
+
Adding items.
+
+
+
cmlAddMetadata
+name: stringscalar: Identifying string for metadata
+content: characterscalar: Content of metadata
+
+
+
This adds a single item of metadata. Metadata vocabulary is completely uncontrolled within WCML. This means that metadata values may only be strings of characters. If you need your values to contain numbers, then you need to define the representation yourself, and construct your own strings.
+
+
+
cmlAddParameter
+name: stringscalar: Identifying title for parameter
+value:anytypeanydim: value of parameter
+units: stringscalar: units of parameter value (optional for logical/character values, compulsory otherwise; see note above)
+(constraint) stringscalar: Constraint under which the parameter is set (this can be an arbitrary string)
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
+
+
This function adds a tag representing an input parameter
+
+
+
cmlAddProperty
+title: stringscalar
+value: anyanydim
+units: stringscalar units of property value (optional for logical/character values, compulsory otherwise; see note above)
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(role) stringscalar role which the element plays
+
+
+
This function adds a tag representing an output property
+
+
Adding geometry information
+
+
+
cmlAddMolecule
+coords: real: a 3xn matrix of real numbers representing atomic coordinates (either fractional or Cartesian) . These must be specified in Angstrom or fractional units (see style below.)
+OR
+x, y, z: real: 3 one-dimensional arrays containing the x, y, and z coordinates of the atoms in the molecule. These must be specified in Angstrom or fractional units (see style below.)
+elements: stringarray: a length-n array of length-2 strings containing IUPAC chemical symbols for the atoms
+(natoms) integerscalar: number of atoms in molecule (default: picked up from length of coords array)
+(occupancies): realarray : a length-n array of the occupancies of each atom.
+(atomRefs): stringarray: a length-n array of strings containing references which may point to IDs elsewhere of, for example, pseudopotentials or basis sets defining the element's behaviour.
+(atomIds): stringarray: a length-n array of strings containing IDs for the atoms.
+(style): stringscalar: cartesian - the coordinates are Cartesian, or fractional - the coordinates are fractional. The default is Cartesian.
+(ref) stringscalar: Reference an id attribute of another element (generally deprecated)
+(formula) stringscalar: An IUPAC chemical formula
+(chirality) stringscalar: The chirality of the molecule. No defined vocabulary.
+(role) stringscalar: Role of molecule. No defined vocabulary.
+(bondAtom1Refs) stringarray: Length-m array of references to atomIds at one "end" of a list of bonds.
+(bondAtom2Refs) stringarray: Length-m array of references to atomIds at another "end" of a list of bonds.
+(bondOrders) stringarray: Length-m array of bond orders. See below.
+(bondIds) stringarray: Length-m array of strings containing IDs for bonds.
+(nobondcheck) logicalscalar: Enable (.true., the default) of dissable (.false.) bond validition.
+
+
+
Outputs an atomic configuration. Bonds may be added using the optional arguments bondAtom1Refs, bondAtom2Refs and bondOrders. All these arrays must be the same lenght and all must be present if bonds are to be added. Optionally, bondIds can be used to add Ids to the bond elements. Some valididity constraints are imposed (atomsRefs in the bonds must be defined, bonds cannot be added twice). The meaning of the terms "molecule", "bond" and "bond order" is left loosly defined.
+
+
+
cmlAddLattice
+cell: realmatrix a 3x3 matrix of the unit cell
+(spaceType): stringscalar: real or reciprocal space.
+(latticeType): stringscalar Space group of the lattice. No defined vocabulary
+(units): stringscalar units of (reciprocal) distance that cell vectors is given in;
+default: Angstrom
+
+
+
Outputs information about a unit cell, in lattice-vector form
+
+
+
cmlAddCrystal
+a: realscalar the 'a' parameter (must be in Angstrom)
+b: realscalar the 'b' parameter
+c: realscalar the 'c' parameter
+alpha: realscalar the 'alpha' parameter
+beta: realscalar the 'beta' parameter
+gamma: realscalar the 'gamma' parameter
+(z): integerscalar the 'z' parameter: number of molecules per unit cell.
+(lenunits): stringscalar: Units of length: default is units:angstrom
+(angunits): stringscalar: Units of angle: default is units:degrees
+(lenfmt): stringscalar: format for crystal lengths
+(angfmt): stringscalar: format for crystal angles
+(spaceGroup): stringscalar Space group of the crystal. No defined vocabulary.
+
+
+
Outputs information about a unit cell, in crystallographic form
+
+
Adding eigen-information
+
+
+
cmlStartKPoint
+kpoint: realarray-3 the reciprocal-space coordinates of the k-point
+(weight): realscalar the weight of the kpoint
+(kptfmt): stringscalar numerical formatting for the k-point
+(wtfmt): stringscalar numerical formatting for the weight
+
+
+
Start a kpoint section.
+
+
+
cmlEndKPoint
+
+
+
End a kpoint section.
+
+
+
cmlAddKPoint
+kpoint: realarray-3 the reciprocal-space coordinates of the k-point
+(weight): realscalar the weight of the kpoint
+(kptfmt): stringscalar numerical formatting for the k-point
+(wtfmt): stringscalar numerical formatting for the weight
+
+
+
Add an empty kpoint section.
+
+
+
cmlStartBand
+(spin): stringscalar the spin of this band. Must be either "up" or "down"
+(label): the label of this band.
+
+
+
Start a section describing one band.
+
+
+
cmlEndBand
+
+
+
End a section describing one band.
+
+
+
cmlAddEigenValue
+value: realscalar the eigenvalue
+units: QNamescalar the units of the eigenvalue
+
+
+
Add a single eigenvalue to a band.
+
+
+
cmlAddBandList
+values: realarray the eigenvalues
+spin: stringscalar the spin orientation ("up" or "down")
+units: QNamescalar the units of the eigenvalue
+
+
+
Add a list of eigenvalues for a kpoint
+
+
+
cmlAddEigenValueVector
+value: realscalar the eigenvalue for this band
+units: QNamescalar the units of the eigenvalue
+vector: real/complex3xN matrix the eigenvectors for this band
+(valfmt): stringscalar numerical formatting for the eigenvalue
+(vecfmt): stringscalar numerical formatting for the eigenvector
+
+
+
Add a phononic eigenpoint to the band - which has a single energy, and a 3xN matrix representing the eigenvector.
+
+
Echoing input files
+
+
It is often considered useful to include a direct representation of
+input data within an applications output files. FoX_wcml contains a
+number of procedures to allow this in a CML document based on a specification
+described in a manuscript currently in review (de Jong, Walker and Hanwell
+"From Data to Analysis: Linking NWChem and Avogadro with the Syntax and
+Semantics of Chemical Markup Language".
+The approach is also designed to make data recovery using an
+XSL transform straightforward. File metadata such as the
+original filename is also accessible. We assume that only ASCII
+data must be stored, arbitrary binary files are
+out of scope as are XML documents and non-ASCII textural data.
+Two methods are provided with the
+most appropriate being dependent on the design of the application.
+
+
Using file names
+
+
+
cmlDumpDec
+inputDec: stringscalar or array file name(s) to be used
+linelengths: *integer* *scalar* or *array* miximum number of characters per line
+trimlines: logicalscalar or array should tralining whitespace be removed?
+(iostat): ntegerscalar output argument indicating errors.
+
+
+
In the this approach the single subroutine, cmlDumpInputDec, is called
+with an array of file names as input arguments. In turn each file is
+opened, its contents are written to the CML document in the appropriate
+form, before the file is closed.
+
+
Line by line
+
+
+
cmlStartDecList
+
+
+
Start an outer wrapper for input data.
+
+
+
cmlEndDecList
+
+
+
End the outer wrapper.
+
+
+
cmlStartDec
+filename: stringscalar file name to be used
+
+
+
Start a wrapper for a single "file" or similar concept.
+
+
+
cmlEndDec
+
+
+
End the file wrapper.
+
+
+
cmlAddDecLine
+text: stringscalar A line of text from an input file to add
+
+
+
Put a line of text into the file wrapper.
+
+
The convoluted nature of file handling
+in Fortran combined with the way that some applications read their input
+data means that this approach is not always available (for example, if
+the input file is held open for the duration of the calculation, or if
+data is read from standard input) so an alternative interface with five
+subroutines (cmlStartDecList, cmlStartDec,
+cmlAddDecLine, cmlEndDec and cmlEndDecList)
+is provided. These must be called in order (and usually in two loops,
+one over files, and an inner loop over lines in each file).
+
+
Common arguments
+
+
All cmlAdd and cmlStart routines take the following set of optional arguments:
+
+
+
id: Unique identifying string for element. (Uniqueness is not enforced, though duplicated ids on output are usually an error and may cause later problems)
+
title: Human-readable title of element for display purposes
+
dictRef: reference to disambiguate element. Should be a QName; a namespaced string. An actual dictionary entry may or may not exist. It is not an error for it not to.
+
convention: convention by which the element is to be read.
+(The wording of the definitions for convention is deliberately loose.)
+
+
+
+
WKML
+
+
WKML is a library for creating KML
+documents. These documents are intended to be used for "expressing geographic
+annotation and visualization" for maps and Earth browsers such as
+Google Earth or Marble.
+WKML wraps all the necessary XML calls, such that you should never need to touch any
+WXML calls when outputting KML from a Fortran application.
+
+
WKML is intended to produce XML documents that conform to version 2.2 of the Open
+Geospatial Consortium's schema.
+However, the library offers no guarantee that documents produced will be valid as
+only a small subset of the constraints are enforced. The API is designed to minimize
+the possibilty of producing invalid KML in common use cases, and well-formdness is
+maintained by the underlying WXML library.
+
+
The available functions and their intended use are listed below. One useful reference to
+the use of KML is Google's KML documentation.
+
+
Use of WKML
+
+
wkml subroutines can be accessed from within a module or subroutine by inserting
+
+
use FoX_wkml
+
+
+
at the start. This will import all of the subroutines described below, plus the derived type xmlf_t needed to manipulate a KML file.
+
+
No other entities will be imported; public/private Fortran namespaces are very carefully controlled within the library.
+
+
Conventions used below.
+
+
+
Function names are in monospace
+
argument names are in bold
+
optional argument names are in (parenthesized bold)
+
argument types are in italic and may consist of:
+
string: string of arbitrary (unless otherwise specified) length
+
integer: default integer
+
real(sp): single precision real number
+
real(dp): double precision real number
+
logical: default logical
+
real: either of real(sp) or real(dp)
+
arguments may be:
+
scalar: single item
+
array: one-dimensional array of items
+
matrix: two-dimensional array of items
+
anydim: any of scalar, array, matrix
+
+
+
All functions take as their first argument an XML file object, whose
+keyword is always xf. This file object is initialized by a kmlBeginFile function.
+
+
It is highly recommended that subroutines be called with keywords
+specified rather than relying on the implicit ordering of arguments.
+This is robust against changes in the library calling convention; and
+also stepsides a significant cause of errors when using subroutines
+with large numbers of arguments.
+
+
Functions for manipulating the KML file:
+
+
+
kmlBeginFile
+fx: xmlf_t: An XML file object
+filename: stringscalar: Filename to be opened.
+unit: integerscalar: what unit number should the file be opened on? If you don't
+care, you may specify -1 as the unit number, in which case wkml will make a guess
+(replace): logicalscalar: should the file be replaced if it already exists? default: yes
+(docName): stringscalar: an optional name for the outermost document element. If absent, "WKML output" will be used
+
+
+
This takes care of all calls to open a KML output file.
+
+
+
kmlFinishFile
+fx: xmlf_t: An XML file object
+
+
+
This takes care of all calls to close an open KML output file, once
+you have finished with it. It is compulsory to call this - if your
+program finished without calling this, then your KML file will be
+invalid.
+
+
+
kmlOpenFolder
+fx: xmlf_t: An XML file object
+(name): stringscalar: an optional name for the new folder.
+(id): stringscalar: an optional xml id for the new folder.
+
+
+
This starts a new folder. Folders are used in KML to organize other
+objects into groups, the visability of these groups can be changed
+in one operation within Google Earth. Folders can be nested.
+
+
+
kmlCloseFolder
+fx: xmlf_t: An XML file object
+
+
+
This closes the current folder.
+
+
+
kmlOpenDocument
+fx: xmlf_t: An XML file object
+name: stringscalar: a name for the new document element.
+(id): stringscalar: an optional xml id for the new document element.
+
+
+
This starts a new document element at this point in the output. Note that no
+checks are currently performed to ensure that this is permitted, for example
+only one document is permitted to be a child of the kml root element. Most
+users should not need to use this subroutine.
+
+
+
kmlCloseDocument
+fx: xmlf_t: An XML file object
+
+
+
This closes the current document element. Do not close the outermose document
+element created with kmlBeginFile, this must be closed with kmlFinishFile.
+Most users should not need to use this subroutine.
+
+
Functions for producing geometrical objects:
+
+
+
kmlCreatePoints
+fx: xmlf_t: An XML file object
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the collection of points
+(color): color_t: Line colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(scale): realscalar: Scaling size for the point icon.
+(description): stringarray: A description for each point.
+(description_numbers): realarray: Numeric description for each point.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
A single function, kmlCreatePoints accepts various combinations of arguments, and will generate a series of individual points to be visualized in Google Earth. In fact, the KML produced will consist of a Folder, containing Placemarks, one for each point. The list of points may be provided in any of the three ways specified above.
+
+
+
kmlCreateLine
+fx: xmlf_t: An XML file object
+(closed): logiclscalar: Should the last point be joined to the first point?
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(tessellate): logicalscalar: If altitude is not specified, should the line produced follow the altitude of the ground below it?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the collection of points
+(color): color_t: Line colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(width): integerscalar: Width of the lines.
+(scale): realscalar: Scaling size for the point icon.
+(description): stringarray: A description for each point.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
A single function, kmlCreateLine accepts various combinations of arguments, and will generate a series of individual points to be visualized as a (closed or open) path in Google Earth. In fact, the KML produced will consist of a LineString, or LinearRing, containing a list of coordinates. The list of points may be provided in any of the three ways specified above.
+
+
+
kmlStartRegion
+fx: xmlf_t: An XML file object
+(extrude): logicalscalar: If altitude is non-zero, should the point be connected to the ground?
+(tessellate): logicalscalar: If altitude is not specified, should the line produced follow the altitude of the ground below it?
+(altitudeMode): logicalscalar: If altitude is specified, is it relativeToGround or absolute?
+(name): stringscalar: A name for the region
+(fillcolor): color_t: Region colour as a kml color type (See Colours)
+(fillcolorname): stringscalar: Region colour as a name (See Colours)
+(fillcolorhex): string(len=8)scalar: Region colour in hex (See Colours)
+(linecolor): color_t: Line colour as a kml color type (See Colours)
+(linecolorname): stringscalar: Line colour as a name (See Colours)
+(linecolorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(linewidth): integerscalar: Width of the line.
+(description): stringscalar: A description for the region.
+(styleURL): stringscalar: Location of style specification (see Style Handling)
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
Creates a filled region with the outer boundary described by the list of points. May be followed by one or more calls to kmlAddInnerBoundary and these must be followed by a call to kmlAddInnerBoundary.
+
+
+
kmlEndRegion
+fx: xmlf_t: An XML file object
+
+
+
Ends the specification of a region with or without inner boundaries.
+
+
+
kmlAddInnerBoundary
+fx: xmlf_t: An XML file object
+and:
+longitude: realarray: longitude of each point in degrees
+latitude: realarray: latitude of each point in degrees
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 2xN array with the longitude of each point in the first row, and the latitude in the second row. In degrees.
+(altitude): realarray: altitude of each point in metres
+or:
+location: realmatrix: rank-two 3xN array with the longitude of each point in the first row, the latitude in the second row, and the altitude in the third row. Longitude and latitude in degrees and altitude in metres.
+
+
+
Introduces an internal area that is to be excluded from the enclosing region.
+
+
2D fields
+
+
WKML also contains two subroutines to allow scalar fields to be plotted over a geographical
+region. Data is presented to WKML as a collection of values and coordinates and this data
+can be displayed as a set of coloured cells, or as isocontours.
+
+
Data input
+
+
For all 2-D field subroutines both position and value of the data must be specified. The data values
+must always be specified as a rank-2 array, values(:,:). The grid can be specified in three ways
+depending on grid type.
+
+
+
Regular rectangular grid: Specify north, south, east, west. These specify the four corners of the grid (which must be aligned with lines of longitude and latitude).
+
Irregularly spaced rectangular grid. Specify two rank-one arrays, longitude(:) and latitude(:). The grid must be aligned with lines of longitude and latitude so that: Grid-point (i, j) = (longitude(i), latitude(j))
+
Entirely irregular (topologically rectangular) grid. Specify two rank-two arrays, longitude(:,:) and latitude(:,:). The grid may be of any form, aligned with no other projection: Grid-point (i, j) is taken as (longitude(i, j), latitude(i, j))
+
+
+
In all cases, single or double precision data may be used so long as all data is consistent in precision within one call.
+
+
Control over the third dimension
+
+
The third dimension of the data can be visualized in two (not mutually-exclusive) ways;
+firstly by assigning colours according to the value of the tird dimension, and secondly
+by using the altitude of the points as a (suitable scaled) proxy for the third dimension.
+The following optional arguments control this aspect of the visualization (both for cells and for contours)
+
+
+
type(color) :: colormap(:): an array of colours (see Colours) which will be used for painting the various layers
+
real, contour_values(:): an array of values which will be used to divide each layer of the third dimension. Single/double precision according to context.
+
integer :: numvalues: where contourvalues is not specified, this provides that the range of the values by divided into equal sized layers such that there are this many divisors.
+
real :: height: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+
+
+
Where no colormap is provided, one will be autogenerated with the appropriate number of levels
+as calculated from the provided contourvalues. Where no contourvalues are provided, they are
+calculated based on the size of the colormap provided. Where neither colormap nor contour_values
+are provided, a default of 5 levels with an autogenerated colormap will be used.
+
+
Subroutines
+
+
+
kmlCreateCells
+fx: xmlf_t: An XML file object
+and:
+east: realscalar: east edge of data set.
+west: realscalar: west edge of data set.
+south: realscalar: south edge of data set.
+north: realscalar: north edge of data set.
+or:
+longitude: realarray: points in north-south direction where grid lines cross lines of longitude.
+latitude: realarray: points in east-west direction where grid lines cross lines of latitude.
+or:
+longitude: realmatrix: longitude of each point in values matrix.
+latitude: realmatrix: latitude of each point in values matrix.
+and:
+values: realmatrix: data values.
+(colormap): color_tarray: colours used to describe values.
+(height): real(sp)scalar: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+(contourvalues): *real(sp)* *array*: values used to contour data.
+(numlevels): integerscalar: number of data values to show.
+(name): stringscalar: name describing the cells.
+
+
+
This subroutine generates a set of filled pixels over a region of the earth.
+
+
+
kmlCreateContours
+fx: xmlf_t: An XML file object
+and:
+east: realscalar: east edge of data set.
+west: realscalar: west edge of data set.
+south: realscalar: south edge of data set.
+north: realscalar: north edge of data set.
+or:
+longitude: realarray: points in north-south direction where grid lines cross lines of longitude.
+latitude: realarray: points in east-west direction where grid lines cross lines of latitude.
+or:
+longitude: realmatrix: longitude of each point in values matrix.
+latitude: realmatrix: latitude of each point in values matrix.
+and:
+values: realmatrix: data values.
+(colormap): color_tarray: colours used to describe values.
+(height): real(sp)scalar: where this is specified, the generated visualization will vary in height as well as colour. The value of this variable will be used to as a multiplicative prefactor to scale the data before visualization.
+(contourvalues): *real(sp)* *array*: values used to contour data.
+(numlevels): integerscalar: number of data values to show.
+(name): stringscalar: name describing the cells.
+(lines): logicalscalar: should contour lines be shown.
+(regions): logicalscalar: should contour regions be shown.
+
+
+
This subroutine creates a set of contour lines.
+
+
Colours
+
+
KML natively handles all colours as 32-bit values, expressed as 8-digit
+hexadecimal numbers in ABGR (alpha-blue-green-red) channel order. However,
+this is not very friendly. WKML provides a nicer interface to this, and all
+WKML functions which accept colour arguments will accept them in three ways:
+
+
+
(*color) color_t: the colour is passed as a wkml color_t derived type. This type is opaque and is created as described below.
+
(*colorname) string: a free-text string describing a colour. WKML understands any of the approximately 700 colour names used by X11.
A function and a subroutine are provided to maniputate the color_t derived type:
+
+
+
kmlGetCustomColor
+
+
+
This function takes a single argument of type integer or string and returns a color_t derived type. If the argument is a string the
+colour is taken from the set of X11 colours, if it is an integer, i, the ith colour is selected from the X11 list.
+
+
+
kmlSetCustomColor
+myCIcolor_t: This intent(out) variable is set to the chosen colour.
+colorhex *string(len=8): an 8-digit ABGR hexadecimal number.
+
+
+
This functon takes a single argument of type string(len=8) representing an 8-digit AVGR hexadecimal number and returns a color_t derived type representing that colour.
+
+
Several features of wkml make use of "colour maps", arrays of the color_t derived type, which are used to relate numerical values to colours when showing fields of data. These are
+created and used thus:
+
+
program colours
+ use FoX_wkml
+ type(color_t) :: colourmap(10)
+
+ ! Use X11 colours from 101 to 110:
+ colourmap(1:10) = kmlGetCustomColor(101:110)
+ ! Except for number 5 which should be red:
+ colourmap(5) = kmlGetCustomColor("indian red")
+ ! And for number 6 which should be black
+ call kmlSetCustomColor(colourmp(6), "00000000")
+
+end program colours
+
+
+
Styles
+
+
Controling styling in KML can be quite complex. Most of the
+subroutines in WKML allow some control of the generated style
+but they do not ptovide access to the full KML vocabulary which
+allows more complex styling. In order to access the more complex
+styles in KML it is necessary to create KML style maps - objects
+that are defined, named with a styleURL. The styleURL is then used
+to reference to the style defined by the map.
+
+
Styles can be created using the following three subroutines. In each
+case one argument is necessary: id, which must be a string (starting
+with an alphabetic letter, and containing no spaces or punctuation
+marks) which is used later on to reference the style. All other
+arguments are optional.
+
+
+
kmlCreatePointStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(scale): real or integerscalar: A scale factor to set the size of the image displayed at the point (note, if both are present, scale and heading must be of the same type).
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Point colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Point colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
+(heading): real or integerscalar: direction to "point" the point icon in (between 0 and 360 degreesnote, if both are present, scale and heading must be of the same type).
+(iconhref): stringscalar: URL of an icon used to draw the point (e.g. from an http server).
+
+
+
Creates a style that can be used for points.
+
+
+
kmlCreateLineStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(width): integerscalar: width of the line in pixels.
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
+
+
+
Creates a style that can be used for lines.
+
+
+
kmlCreatePolygonStyle
+fx: xmlf_t: An XML file object
+id: stringscalar: A URL for the style
+(fill): logicalscalar: Should the polygon be filled?
+(outline): logicalscalar: Should the polygon have an outline?
+(color): color_t: Point colour as a kml color type (See Colours)
+(colorname): stringscalar: Line colour as a name (See Colours)
+(colorhex): string(len=8)scalar: Line colour in hex (See Colours)
+(colormode): string(len=6)scalar: A string, either normal or random - if random, the colour will be randomly changed. See the KML documentation
+
+
+
Creates a style that can be used for a polygon.
+
+
+
+
+
Debugging with FoX.
+
+
Following experience integrating FoX_wxml into several codes, here are a few tips for debugging any problems you may encounter.
+
+
Compilation problems
+
+
You may encounter problems at the compiling or linking stage, with error messages along the lines of:
+ 'No Specific Function can be found for this Generic Function'
+(exact phrasing depending on compiler, of course.)
+
+
If this is the case, it is possible that you have accidentally got the arguments to the offending out of order. If so, then use the keyword form of the argument to ensure correctness; that is, instead of doing:
This will prevent argument mismatches, and is recommended practise in any case.
+
+
Runtime problems
+
+
You may encounter run-time issues. FoX performs many run-time checks to ensure the validity of the resultant XML code. In so far as it is possible, FoX will either issue warnings about potential problems, or try and safely handle any errors it encounters. In both cases, warning will be output on stderr, which will hopefully help diagnose the problem.
+
+
Sometimes, however, FoX will encounter a problem it can do nothing about, and must stop. In all cases, it will try and write out an error message highlighting the reason, and generate a backtrace pointing to the offending line. Occasionally though, the compiler will not generate this information, and the error message will be lost.
+
+
If this is the case, you can either investigate the coredump to find the problem, or (if you are on a Mac) look in ~/Library/Logs/CrashReporter to find a human-readable log.
+
+
If this is not enlightening, or you cannot find the problem, then some of the most common issues we have encountered are listed below. Many of them are general Fortran problems, but sometimes are not easily spotted in the context of FoX.
+
+
Incorrect formatting.
+
+
Make sure, whenever you are writing out a real number through one of FoX's routines, and specifying a format, that the format is correct according to StringFormatting. Fortran-style formats are not permitted, and will cause crashes at runtime.
+
+
Array overruns
+
+
If you are outputting arrays or matrices, and are doing so in the traditional Fortran style - by passing both the array and its length to the routine, like so:
where the array length will be passed automatically.
+
+
Uninitialized variables
+
+
If you are passing variables to FoX which have not been initialized, you may well cause a crash. This is especially true, and easy to cause if you are passing in an array which (due to a bug elsewhere) has been partly but not entirely initialized. To diagnose this, try printing out suspect variables just before passing them to FoX, and look for suspiciously wrong values.
+
+
Invalid floating point numbers.
+
+
If during the course of your calculation you accidentally generate Infinities, or NaNs, then passing them to any Fortran subroutine can result in a crash - therefore trying to pass them to FoX for output may result in a crash.
+
+
If you suspect this is happening, try printing out suspect variables before calling FoX.
+
+
+
SAX
+
+
SAX stands for Simple API for XML, and was originally a Java API for reading XML. (Full details at http://saxproject.org). SAX implementations exist for most common modern computer languages.
+
+
FoX includes a SAX implementation, which translates most of the Java API into Fortran, and makes it accessible to Fortran programs, enabling them to read in XML documents in a fashion as close and familiar as possible to other languages.
+
+
SAX is a stream-based, event callback API. Conceptually, running a SAX parser over a document results in the parser generating events as it encounters different XML components, and sends the events to the main program, which can read them and take suitable action.
+
+
Events
+
+
Events are generated when the parser encounters, for example, an element opening tag, or some text, and most events carry some data with them - the name of the tag, or the contents of the text.
+
+
The full list of events is quite extensive, and may be seen below. For most purposes, though, it is unlikely that most users will need more than the 5 most common events, documented here.
+
+
+
startDocument - generated when the parser starts reading the document. No accompanying data.
+
endDocument - generated when the parser reaches the end of the document. No accompanying data.
+
startElement - generated by an element opening tag. Accompanied by tag name, namespace information, and a list of attributes
+
endElement - generated by an element closing tag. Accompanied by tag name, and namespace information.
+
characters - generated by text between tags. Accompanied by contents of text.
+
+
+
Given these events and accompanying information, a program can extract data from an XML document.
+
+
Invoking the parser.
+
+
Any program using the FoX SAX parser must a) use the FoX module, and b) declare a derived type variable to hold the parser, like so:
+
+
use FoX_sax
+ type(xml_t) :: xp
+
+
+
The FoX SAX parser then works by requiring the programmer to write a module containing subroutines to receive any of the events they are interested in, and passing these subroutines to the parser.
+
+
Firstly, the parser must be initialized, by passing it XML data. This can be done either by giving a filename, which the parser will manipulate, or by passing a string containing an XML document. Thus:
+
+
call open_xml_file(xp, "input.xml", iostat)
+
+
+
The iostat variable will report back any errors in opening the file.
+
+
Alternatively,
+
+
call open_xml_string(xp, XMLstring)
+
+
+
where XMLstring is a character variable.
+
+
To now run the parser over the file, you simply do:
+
+
call parse(xp, list_of_event_handlers)
+
+
+
And once you're finished, you can close the file, and clean up the parser, with:
+
+
call close_xml_t(xp)
+
+
+
Options to parser
+
+
It is unlikely that most users will need to operate any of these options, but the following are available for use; all are optional boolean arguments to parse.
+
+
+
namespaces
+Does namespace processing occur? Default is .true., and if on, then any non-namespace-well-formed documents will be rejected, and namespace URI resolution will be performed according to the version of XML in question. If off, then documents will be processed without regard for namespace well-formedness, and no namespace URI resolution will be performed.
+
namespace_prefixes
+Are xmlns attributes reported through the SAX parser? Default is .false.; all such attributes are removed by the parser, and transparent namespace URI resolution is performed. If on, then such attributes will be reported, and treated according to the value of xmlns-uris below. (If namespaces is false, this flag has no effect)
+
validate
+Should validation be performed? Default is .false., no validation checks are made, and the influence of the DTD on the XML Infoset is ignored. (Ill-formed DTD's will still cause fatal errors, of course.) If .true., then validation will be performed, and the Infoset modified accordingly.
+
xmlns_uris
+Should xmlns attributes have a namespace of http://www.w3.org/2000/xmlns/? Default is .false.. If such attributes are reported, they have no namespace. If .true. then they are supplied with the appropriate namespace. (if namespaces or namespace-prefixes are .false., then this flag has no effect.)
+
+
+
Receiving events
+
+
To receive events, you must construct a module containing event handling subroutines. These are subroutines of a prescribed form - the input & output is predetermined by the requirements of the SAX interface, but the body of the subroutine is up to you.
+
+
The required forms are shown in the API documentation below, but here are some simple examples.
+
+
To receive notification of character events, you must write a subroutine which takes as input one string, which will contain the characters received. So:
That does very little - it simply prints out the data it receives. However, since the subroutine is in a module, you can save the data to a module variable, and manipulate it elsewhere; alternatively you can choose to call other subroutines based on the input.
+
+
So, a complete program which reads in all the text from an XML document looks like this:
+
+
module event_handling
+ use FoX_sax
+contains
+
+ subroutine characters_handler(chars)
+ character(len=*), intent(in) :: chars
+
+ print*, chars
+ end subroutine
+end module
+
+program XMLreader
+ use FoX_sax
+ use event_handling
+ type(xml_t) :: xp
+ call open_xml_file(xp, 'input.xml')
+ call parse(xp, characters_handler=characters_handler)
+ call close_xml_t(xp)
+end program
+
+
+
Attribute dictionaries.
+
+
The other likely most common event is the startElement event. Handling this involves writing a subroutine which takes as input three strings (which are the local name, namespace URI, and fully qualified name of the tag) and a dictionary of attributes.
+
+
An attribute dictionary is essentially a set of key:value pairs - where the key is the attributes name, and the value is its value. (When considering namespaces, each attribute also has a URI and localName.)
+
+
Full details of all the dictionary-manipulation routines are given in AttributeDictionaries, but here we shall show the most common.
+
+
+
getLength(dictionary) - returns the number of entries in the dictionary (the number of attributes declared)
+
hasKey(dictionary, qName) (where qName is a string) returns .true. or .false. depending on whether an attribute named qName is present.
+
hasKey(dictionary, URI, localname) (where URI and localname are strings) returns .true. or .false. depending on whether an attribute with the appropriate URI and localname is present.
+
getQName(dictionary, i) (where i is an integer) returns a string containing the key of the ith dictionary entry (ie, the name of the ith attribute.
+
getValue(dictionary, i) (where i is an integer) returns a string containing the value of the ith dictionary entry (ie the value of the ith attribute.
+
getValue(dictionary, URI, localname) (where URI and localname are strings) returns a string containing the value of the attribute with the appropriate URI and localname (if it is present)
+
+
+
So, a simple subroutine to receive a startElement event would look like:
+
+
module event_handling
+
+contains
+
+ subroutine startElement_handler(URI, localname, name,attributes)
+ character(len=*), intent(in) :: URI
+ character(len=*), intent(in) :: localname
+ character(len=*), intent(in) :: name
+ type(dictionary_t), intent(in) :: attributes
+
+ integer :: i
+
+ print*, name
+
+ do i = 1, getLength(attributes)
+ print*, getQName(attributes, i), '=', getValue(attributes, i)
+ enddo
+
+ end subroutine startElement_handler
+end module
+
+program XMLreader
+ use FoX_sax
+ use event_handling
+ type(xml_t) :: xp
+ call open_xml_file(xp, 'input.xml')
+ call parse(xp, startElement_handler=startElement_handler)
+ call close_xml_t(xp)
+end program
+
+
+
Again, this does nothing but print out the name of the element, and the names and values of all of its attributes. However, by using module variables, or calling other subroutines, the data could be manipulated further.
+
+
Error handling
+
+
The SAX parser detects all XML well-formedness errors (and optionally validation errors). By default, when it encounters an error, it will simply halt the program with a suitable error message. However, it is possible to pass in an error handling subroutine if some other behaviour is desired - for example it may be nice to report the error to the user, finish parsing, and carry on with some other task.
+
+
In any case, once an error is encountered, the parser will finish. There is no way to continue reading past an error. (This means that all errors are treated as fatal errors, in the terminology of the XML standard).
+
+
An error handling subroutine works in the same way as any other event handler, with the event data being an error message. Thus, you could write:
+
+
subroutine fatalError_handler(msg)
+ character(len=*), intent(in) :: msg
+
+ print*, "The SAX parser encountered an error:"
+ print*, msg
+ print*, "Never mind, carrying on with the rest of the calcaulation."
+end subroutine
+
+
+
Stopping the parser.
+
+
The parser can be stopped at any time. Simply do (from within one of the callback functions).
+
+
call stop_parser(xp)
+
+
+
(where xp is the XML parser object). The current callback function will be completed, then the parser will be stopped, and control will return to the main program, the parser having finished.
+
+
+
+
Full API
+
+
Derived types
+
+
There is one derived type, xml_t. This is entirely opaque, and is used as a handle for the parser.
This opens a file. xp is initialized, and prepared for parsing. string must contain the name of the file to be opened. iostat reports on the success of opening the file. A value of 0 indicates success.
This prepares to parse a string containing XML data. xp is initialized. string must contain the XML data.
+
close_xml_t
+type(xml_t), intent(inout) :: xp
+
+
+
This closes down the parser (and closes the file, if input was coming from a file.) xp is left uninitialized, ready to be used again if necessary.
+
+
+
parse
+type(xml_t), intent(inout) :: xp
+external :: list of event handlers
+logical, optional, intent(in) :: validate
+
+
This tells xp to start parsing its document.
+
+
+
(Advanced: See above for the list of options that the parse subroutine may take.)
+
+
The full list of event handlers is in the next section. To use them, the interface must be placed in a module, and the body of the subroutine filled in as desired; then it should be specified as an argument to parse as:
+ name_of_event_handler = name_of_user_written_subroutine
+Thus a typical call to parse might look something like:
where mystartelement, myendelement, and mychars are all subroutines written by you according to the interfaces listed below.
+
+
+
+
Callbacks.
+
+
All of the callbacks specified by SAX 2 are implemented. Documentation of the SAX 2 interfaces is available in the JavaDoc at http://saxproject.org, but as the interfaces needed adjustment for Fortran, they are listed here.
+
+
For documentation on the meaning of the callbacks and of their arguments, please refer to the Java SAX documentation.
Triggered when some character data is read from between tags.
+
+
NB Note that all character data is reported, including whitespace. Thus you will probably get a lot of empty characters events in a typical XML document.
+
+
NB Note also that it is not required that a single chunk of character data all come as one event - it may come as multiple consecutive events. You should concatenate the results of subsequent character events before processing.
+
+
+
endDocument_handler
+ subroutine endDocument_handler()
+ end subroutine endDocument_handler
+
+
+
Triggered when the parser reaches the end of the document.
startEntity_handler
+ subroutine startEntity_handler(name)
+ character(len=*), intent(in) :: name
+ end subroutine startEntity_handler
+
+
+
Triggered by the start of entity expansion.
+
+
+
+
Exceptions.
+
+
The FoX SAX implementation implements all of XML 1.0 and 1.1; all of XML Namespaces 1.0 and 1.1; xml:id and xml:base.
+
+
Although FoX tries very hard to work to the letter of the XML and SAX standards, it falls short in a few areas.
+
+
+
FoX will only process documents consisting of nothing but US-ASCII data. It will accept documents labelled with any single byte character set which is identical to US-ASCII in its lower 7 bits (for example, any of the ISO-8859 charsets, or UTF-8) but an error will be generated as soon as any character outside US-ASCII is encountered. (This includes non-ASCII characters present only be character entity reference)
+
As a corollary, UTF-16 documents of any endianness will also be rejected.
+
+
+
(It is impossible to implement IO of non-ASCII documents in a portable fashion using standard Fortran 95, and it is impossible to handle non-ASCII data internally using standard Fortran strings. A fully unicode-capable FoX version is under development, but requires Fortran 2003. Please enquire for further details if you're interested.)
+
+
+
FoX has no network capabilities. Therefore, when external entities are referenced, any entities not available on the local filesystem will not be accessed (specifically, any entities whose URI reference includes a scheme component, where that scheme is not file, will be skipped)
+
+
+
Beyond this, any aspects of the listed XML standards to which FoX fails to do justice to are bugs.
+
+
+
+
What of Java SAX 2 is not included in FoX?
+
+
The difference betweek Java & Fortran means that none of the SAX APIs can be copied directly. However, FoX offers data types, subroutines, and interfaces covering most of the facilities offered by SAX. Where it does not, this is mentioned here.
+
+
org.sax.xml:
+
+
+
Querying/setting of feature flags/property values for the XML parser. The effect of a subset of these may be accessed by options to the parse subroutine.
+
XML filters - Java SAX makes it possible to write filters to intercept the
+flow of events. FoX does not support this.
+
Entity resolution - SAX 2 exports an interface to the application for entity resolution, but FoX does not - all entities are resolved within the parser.
+
Locator - SAX 2 offers an interface to export information regarding object locations within the document, FoX does not.
+
XMLReader - FoX only offers the parse() method - no other methods really make sense in Fortran.
+
AttributeList/DocumentHandler/Parser - FoX only offers namespace aware attributes, not the pre-namespace SAX-1 versions.
+
+
+
org.sax.xml.ext:
+
+
+
EntityResolver2 - not implemented
+
Locator2 - not implemented
+
+
+
org.sax.xml.helpers:
+
+
+
None of these helper methods are implemented.
+
+
+
+
Attributes dictionaries.
+
+
When parsing XML using the FoX SAX module, attributes are returned contained within a dictionary object.
+
+
This dictionary object implements all the methods described by the SAX interfaces Attributes and Attributes2. Full documentation is available from the SAX Javadoc, but is reproduced here for ease of reference.
+
+
All of the attribute dictionary objects and functions are exported through FoX_sax - you must USE the module to enable them. The dictionary API is described here.
+
+
An attribute dictionary consists of a list of entries, one for each attribute. The entries all have the following pieces of data:
+
+
+
qName - the attribute's full name
+
value - the attribute's value
+
+
+
and for namespaced attributes:
+
+
+
uri - the namespace URI (if any) of the attribute
+
localName - the local name of the attribute
+
+
+
In addition, the following pieces of data will be picked up from a DTD if present:
+
+
+
declared - is the attribute declared in the DTD?
+
specified - is this instance of the attribute specified in the XML document, or is it a default from the DTD?
+
type - the type of the attribute (if declared)
+
+
+
+
+
Derived types
+
+
There is one derived type of interest, dictionary_t.
+
+
It is opaque - that is, it should only be manipulated through the functions described here.
+
+
Functions
+
+
Inspecting the dictionary
+
+
+
getLength
+type(dictionary_t), intent(in) :: dict
+
+
+
Returns an integer with the length of the dictionary, ie the number of dictionary entries.
If a single string is passed in, returns true unless the attribute with that {uri,localName} is a default value from the DTD.
+
+
+
DOM
+
+
Overview
+
+
The FoX DOM interface exposes an API as specified by the W3C DOM Working group.
+
+
FoX implements essentially all of DOM Core Levels 1 and 2, (there are a number of minor exceptions which are listed below) and a substantial portion of DOM Core Level 3.
FoX implements all objects and methods mandated in DOM Core Level 1 and 2. (A listing of supported DOM Core Level 3 interfaces is given below.)
+
+
In all cases, the mapping from DOM interface to Fortran implementation is as follows:
+
+
+
All DOM objects are available as Fortran types, and should be referenced only as pointers (though see 7 and 8 below). Thus, to use a Node, it must be declared first as:
+type(Node), pointer :: aNode
+
A flat (non-inheriting) object hierarchy is used. All DOM objects which inherit from Node are represented as Node types.
+
All object method calls are modelled as functions or subroutines with the same name, whose first argument is the object. Thus:
+aNodelist = aNode.getElementsByTagName(tagName)
+should be converted to Fortran as:
+aNodelist => getElementsByTagName(aNode, tagName)
+
All object method calls whose return type is void are modelled as subroutines. Thus:
+aNode.normalize()
+becomes
+call normalize(aNode)
+
All object attributes are modelled as a pair of get/set calls (or only get where the attribute is readonly), with the naming convention being merely to prepend get or set to the attribute name. Thus:
+name = node.nodeName
+node.nodeValue = string
+should be converted to Fortran as
+name = getnodeName(node)
+call setnodeValue(string)
+
Where an object method or attribute getter returns a DOM object, the relevant Fortran function must always be used as a pointer function. Thus:
+aNodelist => getElementsByTagName(aNode, tagName)
+
No special DOMString object is used - all string operations are done on the standard Fortran character strings, and all functions that return DOMStrings return Fortran character strings.
+
Exceptions are modelled by every DOM subroutine/function allowing an optional additional argument, of type DOMException. For further information see (#DOM Exceptions) below.
+
+
+
String handling
+
+
+
+
The W3C DOM requires that a DOMString object exist, capable of holding Unicode strings; and that all DOM functions accept and emit DOMString objects when string data is to be transferred.
+
+
FoX does not follow this model. Since (as mentioned elsewhere) it is impossible to perform Unicode I/O in standard Fortran, it would be obtuse to require users to manipulate additional objects merely to transfer strings. Therefore, wherever the DOM mandates use of a DOMString, FoX merely uses standard Fortran character strings.
+
+
All functions or subroutines which expect DOMString input arguments should be used with normal character strings.
+All functions which should return DOMString objects will return Fortran character strings.
+
+
Using the FoX DOM library.
+
+
All functions are exposed through the module FoX_DOM. USE this in your program:
+
+
program dom_example
+
+ use FoX_DOM
+ type(Node) :: myDoc
+
+ myDoc => parseFile("fileIn.xml")
+ call serialize(myDoc, "fileOut.xml")
+end program dom_example
+
+
+
Documenting DOM functions
+
+
+
+
This manual will not exhaustively document the functions available through the Fox_DOM interface. Primary documentation may be found in the W3C DOM specifications:`
The systematic rules for translating the DOM interfaces to Fortran are given in the previous section. For completeness, though, there is a list here. The W3C specifications should be consulted for the use of each.
The DOM is written in terms of an object model involving inheritance, but also permits a flattened model. FoX implements this flattened model - all objects descending from the Node are of the opaque type Node. Nodes carry their own type, and attempts to call functions defined on the wrong nodetype (for example, getting the target of a node which is not a PI) will result in a FoX_INVALID_NODE exception.
+
+
The other types available through the FoX DOM are:
+
+
+
DOMConfiguration
+
DOMException
+
DOMImplementation
+
NodeList
+
NamedNodeMap
+
+
+
FoX DOM and pointers
+
+
All DOM objects exposed to the user may only be manipulated through pointers. Attempts to access them directly will result in compile-time or run-time failures according to your environment.
+
+
This should have little effect on the structure of your programs, except that you must always remember, when calling a DOM function, to perform pointer assignment, not direct assignment, thus:
+child => getFirstChild(parent)
+and not
+child = getFirstChild(parent)
+
+
Memory handling
+
+
Fortran offers no garbage collection facility, so unfortunately a small degree of memory
+handling is necessarily exposed to the user.
+
+
However, this has been kept to a minimum. FoX keeps track of all memory allocated and used when calling DOM routines, and keeps references to all DOM objects created.
+
+
The only memory handling that the user needs to take care of is destroying any
+DOM Documents (whether created manually, or by the parse() routine.) All other nodes or node structures created will be destroyed automatically by the relevant destroy() call.
+
+
As a consequence of this, all DOM objects which are part of a given document will become inaccessible after the document object is destroyed.
+
+
Additional functions.
+
+
+
+
Several additional utility functions are provided by FoX.
+
+
Input and output of XML data
+
+
Firstly, to construct a DOM tree, from either a file or a string containing XML data.
filename should be an XML document. It will be opened and parsed into a DOM tree. The parsing is performed by the FoX SAX parser; if the XML document is not well-formed, a PARSE_ERR exception will be raised. configuration is an optional argument - see DOMConfiguration for its meaning.
XMLstring should be a string containing XML data. It will be parsed into a DOM tree. The parsing is performed by the FoX SAX parser; if the XML document is not well-formed, a PARSE_ERR exception will be raised. configuration is an optional argument - see DOMConfiguration for its meaning.
+
+
Both parseFile and parseString return a pointer to a Node object containing the Document Node.`
+
+
Secondly, to output an XML document:
+
+
+
serialize
+arg: Node, pointer
+fileName: string
+
+
+
This will open fileName and serialize the DOM tree by writing into the file. If fileName already exists, it will be overwritten. If an problem arises in serializing the document, then a fatal error will result.
+
+
(Control over serialization options is done through the configuration of the arg's ownerDocument, see below.)
+
+
Finally, to clean up all memory associated with the DOM, it is necessary to call:
+
+
+
destroy
+np: Node, pointer
+
+
+
This will clear up all memory usage associated with the document (or documentType) node passed in.
+
+
Extraction of data from an XML file.
+
+
+
+
The standard DOM functions only deal with string data. When dealing with numerical (or logical) data,
+the following functions may be of use.
+
+
+
extractDataContent
+
extractDataAttribute
+
extractDataAttributeNS
+
+
+
These extract data from, respectively, the text content of an element, from one of its attributes, or from one of its namespaced attributes.
+They are used like so:
+
+
(where p is an element which has been selected by means of the other DOM functions)
+
+
call extractDataContent(p, data)
+
+
+
The subroutine will look at the text contents of the element, and interpret according to the type of data. That is, if data has been declared as an integer, then the contents of p will be read as such an placed into data.
+
+
data may be a string, logical, integer, real, double precision, complex or double complex variable.
+
+
In addition, if data is supplied as a rank-1 or rank-2 variable (ie an array or a matrix) then the data will be read in assuming it to be a space- or comma-separated list of such data items.
+
+
Thus, the array of integers within the XML document:
+
+
<element> 1 2 3 4 5 6 </element>
+
+
+
could be extracted by the following Fortran program:
The extraction may fail of course, if the data is not of the sort specified, or if there are not enough elements to fill the array or matrix. In such a case, this can be detected by the optional arguments num and iostat.
+
+
num will hold the number of items successfully read. Hopefully this should be equal to the expected number of items; but it may be less if reading failed for some reason, or if there were less items than expected in the element.
+
+
iostat will hold an integer - this will be 0 if the extraction went ok; -1 if too few elements were found, 1 if although the read went ok, there were still some elements left over, or 2 if the extraction failed due to either a badly formatted number, or due to the wrong data type being found.
+
+
String arrays
+
+
For all data types apart from strings, arrays and matrices are specified by space- or comma-separated lists. For strings, some additional options are available. By default, arrays will be extracted assuming that separators are spaces (and multiple spaces are ignored). So:
+
+
<element> one two three </element>
+
+
+
will result in the string array (/"one", "two", "three"/).
+
+
However, you may specify an optional argument separator, which specifies another single-character separator to use (and does not ignore multiple spaces). So:
+
+
<element>one, two, three </element>
+
+
+
will result in the string array (/"one", " two", " three "/). (note the leading and trailing spaces).
+
+
Finally, you can also specify an optional logical argument, csv. In this case, the separator is ignored, and the extraction proceeds assuming that the data is a list of comma-separated values. (see: CSV)
+
+
Other utility functions
+
+
+
setFoX_checks
+FoX_checks: logical
+
+
+
This affects whether additional FoX-only checks are made (see DomExceptions below).
+
+
+
getFoX_checks
+arg: DOMImplementation, pointer
+
+
+
Retrieves the current setting of FoX_checks.
+
+
Note that FoX_checks can only be turned on and off globally, not on a per-document basis.
arg must be a Document Node. Calling this function affects whether any nodelists active on the document are treated as live - ie whether updates to the documents are reflected in the contents of nodelists (see DomLiveNodelists below).
+
+
+
getLiveNodeLists
+arg: Node, pointer
+
+
+
Retrieves the current setting of liveNodeLists.
+
+
Note that the live-ness of nodelists is a per-document setting.
+
+
Exception handling
+
+
+
+
Exception handling is important to the DOM. The W3C DOM standards provide not only interfaces to the DOM, but also specify the error handling that should take place when invalid calls are made.
+
+
The DOM specifies these in terms of a DOMException object, which carries a numeric code whose value reports the kind of error generated. Depending upon the features available in a particular computer language, this DOMException object should be generated and thrown, to be caught by the end-user application.
+
+
Fortran of course has no mechanism for throwing and catching exceptions. However, the behaviour of an exception can be modelled using Fortran features.
+
+
FoX defines an opaque DOMException object.
+Every DOM subroutine and function implemented by FoX will take an optional argument, 'ex', of type DOMException.
+
+
If the optional argument is not supplied, any errors within the DOM will cause an immediate abort, with a suitable error message. However, if the optional argument is supplied, then the error will be captured within the DOMException object, and returned to the caller for inspection. It is then up to the application to decide how to proceed.
+
+
Functions for inspecting and manipulating the DOMException object are described below:
+
+
+
inException:
+ex: DOMException
+
+
+
A function returning a logical value, according to whether ex is in exception - that is, whether the last DOM function or subroutine, from which ex returned, caused an error. Note that this will not change the status of the exception.
+
+
+
getExceptionCode
+ex: DOMException
+
+
+
A function returning an integer value, describing the nature of the exception reported in ex. If the integer is 0, then ex does not hold an exception. If the integer is less than 200, then the error encountered was of a type specified by the DOM standard; for a full list, see below, and for explanations, see the various DOM standards. If the integer is 200 or greater, then the code represents a FoX-specific error. See the list below.
+
+
Note that calling getExceptionCode will clean up all memory associated with the DOMException object, and reset the object such that it is no longer in exception.
+
+
Exception handling and memory usage.
+
+
Note that when an Exception is thrown, memory is allocated within the DOMException object. Calling getExceptionCode on a DOMEXception will clean up this memory. If you use the exception-handling interfaces of FoX, then you must check every exception, and ensure you check its code, otherwise your program will leak memory.
+
+
FoX exceptions.
+
+
The W3C DOM interface allows the creation of unserializable XML document in various ways. For example, it permits characters to be added to a text node which would be invalid XML. FoX performs multiple additional checks on all DOM calls to prevent the creation of unserializable trees. These are reported through the DOMException mechanisms noted above, using additional exception codes. However, if for some reason, you want to create such trees, then it is possible to switch off all FoX-only checks. (DOM-mandated checks may not be disabled.) To do this, use the setFoX_checks function described in DomUtilityFunctions.
+
+
Note that FoX does not yet currently check for all ways that a tree may be made non-serializable.
+
+
List of exceptions.
+
+
The following is the list of all exception codes (both specified in the W3C DOM and those related to FoX-only checks) that can be generated by FoX:
+
+
+
INDEX_SIZE_ERR = 1
+
DOMSTRING_SIZE_ERR = 2
+
HIERARCHY_REQUEST_ERR = 3
+
WRONG_DOCUMENT_ERR = 4
+
INVALID_CHARACTER_ERR = 5
+
NO_DATA_ALLOWED_ERR = 6
+
NO_MODIFICATION_ALLOWED_ERR = 7
+
NOT_FOUND_ERR = 8
+
NOT_SUPPORTED_ERR = 9
+
INUSE_ATTRIBUTE_ERR = 10
+
INVALID_STATE_ERR = 11
+
SYNTAX_ERR = 12
+
INVALID_MODIFICATION_ERR = 13
+
NAMESPACE_ERR = 14
+
INVALID_ACCESS_ERR = 15
+
VALIDATION_ERR = 16
+
TYPE_MISMATCH_ERR = 17
+
INVALID_EXPRESSION_ERR = 51
+
TYPE_ERR = 52
+
PARSE_ERR = 81
+
SERIALIZE_ERR = 82
+
FoX_INVALID_NODE = 201
+
FoX_INVALID_CHARACTER = 202
+
FoX_NO_SUCH_ENTITY = 203
+
FoX_INVALID_PI_DATA = 204
+
FoX_INVALID_CDATA_SECTION = 205
+
FoX_HIERARCHY_REQUEST_ERR = 206
+
FoX_INVALID_PUBLIC_ID = 207
+
FoX_INVALID_SYSTEM_ID = 208
+
FoX_INVALID_COMMENT = 209
+
FoX_NODE_IS_NULL = 210
+
FoX_INVALID_ENTITY = 211
+
FoX_INVALID_URI = 212
+
FoX_IMPL_IS_NULL = 213
+
FoX_MAP_IS_NULL = 214
+
FoX_LIST_IS_NULL = 215
+
FoX_INTERNAL_ERROR = 999
+
+
+
Live nodelists
+
+
+
+
The DOM specification requires that all NodeList objects are live - that is, that any change in the document structure is immediately reflected in the contents of any nodelists.
+
+
For example, any nodelists returned by getElementsByTagName or getElementsByTagNameNS must be updated whenever nodes are added to or removed from the document; and the order of nodes in the nodelists must be changed if the document structure changes.
+
+
Though FoX does keep all nodelists live, this can impose a significant performance penalty when manipulating large documents. Therefore, FoX can be instructed to inly use 'dead' nodelists - that is, nodelists which reflect a snapshot of the document structure at the point they were created. To do this, call setLiveNodeLists (see API documentation).
+
+
However, note that the nodes within the nodelist remain live - any changes made to the nodes will be reflected in accessing them through the nodelist.
+
+
Furthermore, since the nodelists are still associated with the document, they and their contents will be rendered inaccessible when the document is destroyed.
+
+
DOM Configuration
+
+
+
+
Multiple valid DOM trees may be produced from a single document. When parsing input, some of these choices are made available to the user.
+
+
By default, the DOM tree presented to the user will be produced according to the following criteria:
+
+
+
there will be no adjacent text nodes
+
Cdata nodes will appear as such in the DOM tree
+
EntityReference nodes will appear in the DOM tree.
+
+
+
However, if another tree is desired, the user may change this. For example, very often you would rather be working with the fully canonicalized tree, with all cdata sections replaced by text nodes and merged, and all entity references replaced with their contents.
+
+
The mechanism for doing this is the optional configuration argument to parseFile and parseString. configuration is a DOMConfiguration object, which may be manipulated by setParameter calls.
+
+
Note that FoX's implementation of DOMConfiguration does not follow the specification precisely. One DOMConfiguration object controls all of parsing, normalization and serialization. It can be used like so:
+
+
use FoX_dom
+implicit none
+type(Node), pointer :: doc
+! Declare a new configuration object
+type(DOMConfiguration), pointer :: config
+! Request full canonicalization
+! ie convert CDATA sections to text sections, remove all entity references etc.
+config => newDOMConfig()
+call setParameter(config, "canonical-form", .true.)
+! Turn on validation
+call setParameter(config, "validate", .true.)
+! parse the document
+doc => parseFile("doc.xml", config)
+
+! Do a whole lot of DOM processing ...
+
+! change the configuration to allow cdata-sections to be preserved.
+call setParameter(getDomConfig(doc), "cdata-sections", .true.)
+! normalize the document again
+call normalizeDocument(doc)
+! change the configuration to influence the output - make sure there is an XML declaration
+call setParameter(getDomConfig(doc), "xml-declaration", .true.)
+! and write the document out.
+call serialize(doc)
+! once everything is done, destroy the doc and config
+call destroy(doc)
+call destroy(config)
+
+
+
The available configuration options are fully explained in:
and are all implemented, with the exceptions of: error-handler, schema-location, and schema-type.
+In total there are 24 implemented configuration options (schema-location and schema-type are not
+implemented). The options known by FoX are as follows:
+
+
+
canonical-form default: false, can be set to true. See note below.
+
cdata-sections default: true, can be changed.
+
check-character-normalization default: false, cannot be changed.
+
comments default: true, can be changed.
+
datatype-normalization default: false, cannot be changed.
+
element-content-whitespace default: true, can be changed.
+
entities default: true, can be changed.
+
error-handler default: false, cannot be changed. This is a breach of the DOM specification.
+
namespaces default: true, can be changed.
+
namespace-declarations default: true, can be changed.
+
normalize-characters default: false, cannot be changed.
+
split-cdata-sections default: true, can be changed.
+
validate default: false, can be changed. See note below.
+
validate-if-schema default: false, can be changed.
+
well-formed default true, cannot be changed.
+
charset-overrides-xml-encoding default false, cannot be changed.
+
disallow-doctype default false, cannot be changed.
+
ignore-unknown-character-denormalizations default true, cannot be changed.
+
resource-resolver default false, cannot be changed.
+
supported-media-types-only default false, cannot be changed.
+
discard-default-content default: true, can be changed.
+
format-pretty-print default: false, cannot be changed.
+
xml-declaration default: true, can be changed.
+
invalid-pretty-print default: false, can be changed. This is a FoX specific extension which works like format-pretty-print but does not preseve the validity of the document.
+
+
+
Setting canonical-form changes the value of entities, cdata-sections, discard-default-content, invalid-pretty-print, and xml-declarationto false and changes namespaces, namespace-declarations, and element-content-whitespace to true. Unsetting canonical-form causes these options to revert to the defalt settings. Changing the values of any of these options has the side effect of unsetting canonical-form (but does not cause the other options to be reset). Setting validate unsets validate-if-schema and vica versa.
+
+
DOM Miscellanea
+
+
+
+
Other issues
+
+
+
As mentioned in the documentation for WXML, it is impossible within Fortran to reliably output lines longer than 1024 characters. While text nodes containing such lines may be created in the DOM, on serialization newlines will be inserted as described in the documentation for WXML.
+
All caveats with regard to the FoX SAX processor apply to reading documents through the DOM interface. In particular, note that documents containing characters beyond the US-ASCII set will not be readable.
+
+
+
It was decided to implement W3C DOM interfaces primarily because they are specified in a language-agnostic fashion, and thus made Fortran implementation possible. A number of criticisms have been levelled at the W3C DOM, but many apply only from the perspective of Java developers. However, more importantly, the W3C DOM suffers from a lack of sufficient error checking so it is very easy to create a DOM tree, or manipulate an existing DOM tree into a state, that cannot be serialized into a legal XML document.
+
+
(Although the Level 3 DOM specifications finally addressed this issue, they did so in a fashion that was neither very useful, nor easily translatable into a Fortran API.)
+
+
Therefore, FoX will by default produce errors about many attempts to manipulate the DOM in such a way as would result in invalid XML. These errors can be switched off if standards-compliant behaviour is wanted. Although extensive, these checks are not complete.
+In particular, the way the W3C DOM mandates namespace handling makes it trivial to produce namespace non-well-formed document trees, and very difficult for the processor to automatically detect the non-well-formedness. Thus a fully well-formed tree is only guaranteed after a suitable normalizeDocument call.
+
+
+
UTILS
+
+
FoX_utils is a collection of general utility functions that the rest of FoX depends on, but which may be of independent use. They are documented here.
+
+
All functions are accessible from the FoX_utils module.
+
+
NB Unlike the APIs of WXML, WCML, and SAX, the UTILS APIs may not remain constant between FoX versions. While some effort will be expended to ensure they don't change unnecessarily, no guarantees are made.
+
+
For any end-users interested in the code who are worried about interface changes, it is recommended that the relevant code (all found in the utils/ directory be lifted directly and imported into other projects, rather than accessed through the FoX interfaces.
+
+
Two sets of utility functions are provided; one concerned with UUIDs, and a set concerned with URIs.
+
+
+
+
UUID
+
+
UUIDs (see RFC 4122) are Universally Unique IDentifiers. They are a 128-bit number, represented as a 36-character string. For example:
+
+
f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+
+
+
The intention of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. Thus, anyone can create a UUID and use it to identify something with reasonable confidence that the identifier will never be unintentionally used by anyone for anything else.
+
+
This property also makes them useful as Uniform Resource Names, to refer to a given document without requiring a position in a particular URI scheme. Thus the above UUID could be referred to as
+
+
urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+
+
+
UUIDs are used by WCML to ensure that every document generated has a unique ID. This enables users to go back later on and have confidence that they are examining the same document, regardless of where it might have ended up in file-system hierarchies or databases.
+
+
In addition, UUIDs come in several flavours, one of which stores the time of creation to 100-nanosecond accuracy. This can later be extracted (see, for example this service) to verify creation time.
+
+
This may well be useful for other XML document types, or indeed in non-XML applications. Thus, UUIDs may be generated by the following function, with one optional argument.
+
+
+
generate_UUID
+version: integer
+
+
+
This function returns a 36-character string containing the UUID.
+
+
version identifies the version of UUID to be used (see section 4.1.3 of the RFC). Only versions 0, 1, and 4 are supported. Version 0 generates a nil UUID; version 1 a time-based UUID, and version 4 a pseudo-randomly-generated UUID.
+
+
Version 1 is the default, and is recommended.
+
+
(Note: all pseudo-random-numbers are generated using the high-quality Mersenne Twister algorithm, using the Fortran implementation of Scott Robert Ladd.)
+
+
+
+
URI
+
+
URIs (see RFC 2396) are Universal Resource Identifiers. A URI is a string, containing several components, which identifies a resource. Very often, this resource is a file, and the URI represents the local or network path to this file.
+
+
For example:
+
+
http://www.uszla.me.uk/FoX/DoX/index.html
+
+
+
is a URI pointing to the FoX documentation.
+
+
Equally, however:
+
+
FoX/configure
+
+
+
is a URI reference pointing to the FoX configure script (relative to the current directory, or base URI).
+
+
A string which is a URI reference contains several components, some of which are optional.
+
+
+
scheme - eg, http
+
authority - eg, www.uszla.me.uk
+
path - eg, /FoX/DoX/index.html
+
+
+
In addition, a URI reference may contain userinfo, host, port, query, and fragment information. (see the RFC for full details.)
+
+
The FoX URI library provides the following features:
+
+
+
type(URI)
+This is an opaque Fortran type which is used to hold URI information. The functions described below use this type.
+
parseURI
+This takes one argument, a URI reference, and returns a pointer to a newly-allocated URI object.
+
+
+
If the string provided is not a valid URI reference, then a null pointer is returned; thus this function can be used to check whether a URI is valid.
+
+
+
expressURI
+This takes one argument, a URI object, and returns the (fully-escaped) string representing that URI.
+
rebaseURI
+This takes two arguments, both URI objects, and returns a pointer to a third URI object. It calculates the location of the second URI with reference to the first.
+
+
+
Thus, if the first URI were /FoX/DoX, and the second ../DoX2/index.html, then the resulting URI would be /FoX/DoX2/index.html
+
+
+
destroyURI
+This takes one argument, a pointer to a URI object, and clears up all memory associated with it.
+
+
+
For each component a URI might have (scheme, authority, userinfo, host, port, path, query, fragment) there are two functions for extracting the component:
+
+
+
hasXXX will return a logical variable according to whether the component is defined. (except for path which is always defined, but may be empty)
+
getXXX will return a string containing the value of the component. (except for port which is returned as an integer.
+
+
+
Thus, listing these functions in full:
+
+
+
hasScheme
+Is there a scheme associated with the URI?
+
getScheme
+Return the value of the scheme
+
hasAuthority
+Is there an authority associated with the URI?
+
getAuthority
+Return the value of the authority
+
hasUserinfo
+Is there userinfo associated with the URI?
+
getUserinfo
+Return the value of the userinfo
+
hasHost
+Is there a host associated with the URI?
+
getHost
+Return the value of the host
+
hasPort
+Is there a port associated with the URI?
+
getPort
+Return the value of the port
+
getPath
+Return the value of the path
+
hasQuery
+Is there a query associated with the URI?
+
getQuery
+Return the value of the query
+
hasFragment
+Is there a fragment associated with the URI?
FoX is the work of Toby White <tow@uszla.me.uk>, and all bug reports/complaints/bouquets of roses should be sent to him. Andrew Walker <andrew.walker@bristol.ac.uk> currently looks after maintenance of FoX.
FoX is licensed under the agreement below. This is intended to make it as freely available as possible, subject only to retaining copyright notices and acknowledgements.
+
+
If for any reason this license causes issues with your intended use of the code, please contect the author.
+
+
The license can also be found within the distributed source, in the file FoX/LICENSE
Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+
+
Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
Neither the name of the copyright holder nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
Third-party code.
+
+
In addition, FoX includes a random number library, written by Scott Robert Ladd, which is licensed as follows:
+
+
! This computer program source file is supplied "AS IS". Scott Robert
+! Ladd (hereinafter referred to as "Author") disclaims all warranties,
+! expressed or implied, including, without limitation, the warranties
+! of merchantability and of fitness for any purpose. The Author
+! assumes no liability for direct, indirect, incidental, special,
+! exemplary, or consequential damages, which may result from the use
+! of this software, even if advised of the possibility of such damage.
+!
+! The Author hereby grants anyone permission to use, copy, modify, and
+! distribute this source code, or portions hereof, for any purpose,
+! without fee, subject to the following restrictions:
+!
+! 1. The origin of this source code must not be misrepresented.
+!
+! 2. Altered versions must be plainly marked as such and must not
+! be misrepresented as being the original source.
+!
+! 3. This Copyright notice may not be removed or altered from any
+! source or altered source distribution.
+!
+! The Author specifically permits (without fee) and encourages the use
+! of this source code for entertainment, education, or decoration. If
+! you use this source code in a product, acknowledgment is not required
+! but would be appreciated.