diff options
author | Julian Cummings <cummings@cacr.caltech.edu> | 2007-08-04 23:02:42 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2007-08-04 23:02:42 +0200 |
commit | e0e50ad7d0979e07ec6816387a372004263ef4b4 (patch) | |
tree | b66cf4721b17dd966ec6c384c35afe8cb29793fc /m4/ax_f90_module_flag.m4 | |
parent | cdd131fc556a478da356721211b057c65b52c55a (diff) | |
download | autoconf-archive-e0e50ad7d0979e07ec6816387a372004263ef4b4.tar.gz |
AX_F90_MODULE_FLAG: support -module PGI compiler flag
I have "-module " to the list of compiler options that is tried
in order to support the PGI Fortran compiler. Without this
change, the PGI compiler actually accepts "-I" and passes the
test. However, this option is actually meant for setting the
include file search path to find files that are included with the
Fortran INCLUDE statement. Although the -I flag works in this
case because there are no -module options on the command line,
things will not work correctly if the user does bring in the
-module option on the actual compile command line.
Diffstat (limited to 'm4/ax_f90_module_flag.m4')
-rw-r--r-- | m4/ax_f90_module_flag.m4 | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/m4/ax_f90_module_flag.m4 b/m4/ax_f90_module_flag.m4 index 24d463d..9fd8327 100644 --- a/m4/ax_f90_module_flag.m4 +++ b/m4/ax_f90_module_flag.m4 @@ -9,12 +9,22 @@ # Find Fortran 90 modules inclusion flag. The module inclusion flag # is stored in the cached variable ax_f90_modflag. An error is # triggered if the flag cannot be found. Supported are the -I GNU -# compilers flag, the -M SUN compilers flag, and the -p Absoft Pro -# Fortran compiler flag. +# compilers flag, the -M SUN compilers flag, the -p flag for Absoft +# Pro Fortran compilers, and the -module flag for the PGI Fortran +# compiler. +# +# Note that on the PGI compiler the first directory specified with +# -module is also the directory where any module files that are +# produced will be written out. So if this flag is used and the first +# directory specified does not have write permissions, an error will +# occur. The most sensible thing to do is is to place +# "$(ax_f90_modflag)." on the compile line first to put the current +# directory at the front of the list before any other module file +# directories. # # LAST MODIFICATION # -# 2007-05-12 +# 2007-08-04 # # COPYLEFT # @@ -47,7 +57,7 @@ AC_COMPILE_IFELSE([ ],[],[]) cd .. ax_f90_modflag="not found" -for ax_flag in "-I " "-M" "-p"; do +for ax_flag in "-module " "-I " "-M" "-p"; do if test "$ax_f90_modflag" = "not found" ; then ax_save_FCFLAGS="$FCFLAGS" FCFLAGS="$ax_save_FCFLAGS ${ax_flag}tmpdir_$i" |