This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Defining a HAVE_J0 in config.h for gfortran?
On Wed, Aug 11, 2004 at 09:19:08PM -0700, Richard Henderson wrote:
> On Wed, Aug 11, 2004 at 08:27:45PM -0700, Steve Kargl wrote:
> > I'm contemplating adding j0, j0f, j1, j1f, y0, y0f, y1, and y1f
> > intrinsic functions to gfortran for compatibility with g77. In
> > gcc/libgfortran I can modify configure.ac with a line similar to
> >
> > AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
> >
> > to check that j0 is present in libm. I however need the HAVE_J0
> > symbol in gcc/gcc/fortran. There is no configure.ac in this
> > directory, so I need some other way to define HAVE_J0. Any pointers
> > would be appreciate.
>
> You don't want anything in the front end. Define the intrinsics
> all the time (modulo standards conformance).
That will make things easier; although I was trying to keep the
frontend clean of undefined intrinsics.
> If they do come out unresolved for a particular system, then they
> do. Unlike the other intrinsics being discussed, the bessel functions
> are not required for other Fortran standard conformance.
I know the bessel functions are not part of the Fortran standard.
Unfortunately, we need backwards compatibility with g77 and the author
of g77 made libg2c the kitchen sink of Fortran extensions. If g77
detects the presences of the bessel functions, it includes them; otherwise
it does not.
> I don't know that we should be trying to remedy every deficiency in the
> system libm...
Are stubs acceptable? That is, if j0 isn't in libm, can I do (in
psuedo-code)
j0(arg) {
printf("Extension: j0 Bessel function is unsupported.\n");
exit(1);
}
in libgfortran.
--
Steve