Patrick Welche wrote:
> A side issue, but related(?): the "checking for Fortran 77
> name-mangling scheme" which fails for me (NetBSD-1.5V/i386,
> egcs-2.91.66) is probably because:
>     /usr/lib/libg2c.so: undefined reference to `MAIN__'
> Jason Beegan suggested adding
>       void MAIN__(void) { abort(); }
> to the fortran program defining the subroutine foobar() (which would
> then be called from C as foobar_())

Hi, this concerns me.  First of all, this is not a bug in the
name-mangling checks, it is a bug in AC_PROG_F77_LIBRARY_LDFLAGS, which is
supposed to figure out how to link C programs to Fortran code/libraries.

I don't like the solution of adding a dummy MAIN__() to the C program (I
assume you don't mean the Fortran program!), because that would mean that
*every* C program linking to Fortran code would have to be changed.

It's much better if we can just figure out a proper LDFLAGS so that MAIN__
is not needed.  (I'm surprised there is trouble here, since gcc on
GNU/Linux has no problems.)  Any suggestions on what the flags are and how
to detect them?

Steven


Reply via email to