F77_GETARG - Statement to get an argument i into string s F77_IARGC - Routine to return the number of arguments FXX_MODULE - Module command when using Fortran 90 compiler F77_GETARGDECL - Declaration of routine used for F77_GETARG F77_GETARG_FFLAGS - Flags needed when compiling/linking F77_GETARG_LDFLAGS - Flags needed when linkingIf F77_GETARG has a value, then that value and the values for these other symbols will be used instead. If no approach is found, all of these variables will have empty values. If no other approach works and a file f77argdef is in the directory, that file will be sourced for the values of the above four variables.
In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable and F77_GETARG_LDFLAGS to the LDFLAGS variable, to ensure that tests are performed on the compiler version that will be used.
AC_SUBST is called for all six variables.
One complication is that on systems with multiple Fortran compilers, some libraries used by one Fortran compiler may have been (mis)placed in a common location. We have had trouble with libg2c in particular. To work around this, we test whether iargc etc. work first. This will catch most systems and will speed up the tests.
Next, the libraries are only added if they are needed to complete a link; they aren't added just because they exist.