[Patch] libgfortran: do not assume libm
Tobias Burnus
tobias.burnus@physik.fu-berlin.de
Tue Mar 20 09:49:00 GMT 2012
Hi Tristan,
> I am starting to build fortran for VMS.
Thanks for the patch and this endeavor.
> The first serious issue was with libgfortran/configure. It checks for
> several math functions, but directly in libm using AC_CHECK_LIB.
> But there is on such things as libm on VMS systems
I think after building you will run into the same issue when using
gfortran. The linking of -lm is hardcoded in gcc/fortran/gfortranspec.c
(search there for MATH_LIBRARY).
And it is hard coded in libgfortran/libgfortran.spec.in and in the
as-needed check of libgfortran/acinclude.m4 within a libquadmath check.
Talking about libquadmath, its libquadmath/configure.ac has the same issue.
* * *
To your patch:
First, I am far from being a configure expert and thus would like if
a build maintainer could have a look (or Janne, who seems to have also
more experience.)
I don't understand the purpose of the line:
+# Check for libm
+AC_CHECK_LIB([m],[sin])
Except of printing to stdout and to the logs whether -lm is available and
contains "sin", it doesn't seem to do anything. If that's the purpose, I think
it needs a better comment. If not, I would like to know its purpose.
Otherwise, the patch looks fine to me - but as written, I would like if
someone else (build maintainer, Janne, ...) could have a look.
Tobias
More information about the Fortran
mailing list