[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fortran linking on NetBSD (was: autoconf-2.50 docs...)

From: Steven G. Johnson
Subject: Re: Fortran linking on NetBSD (was: autoconf-2.50 docs...)
Date: Tue, 26 Jun 2001 10:13:30 -0400 (EDT)

Hi, the attached diff file contains a patch for the problem reported by
Jason Beegan on NetBSD.  In short, in order to link to the Fortran
libraries on some systems, one *must* define a dummy routine called
something like MAIN__ (see the comments in the code and documentation for
more detail).

This is, in some sense, a fairly major change, as most users of the
current AC_F77_WRAPPERS should alter their code to take advantage of this
new macro.  Also, I had to modify AC_LANG_PROGRAM(C) to define the dummy
main, if it is known; otherwise, any link test against Fortran libraries
will fail.  However, I don't see any viable alternative.

Please let me know what you think.


2001-06-26  Steven G. Johnson  <address@hidden>

        Add alternate 'main' routine detection for linking C/C++ with Fortran,
        fixing link failures for e.g. AC_F77_WRAPPERS on NetBSD.

        * aclang.m4 (AC_F77_DUMMY_MAIN): New macro to detect whether a
        dummy alternate main is required even if the user provides her own
        (AC_F77_MAIN): New macro to detect whether it is possible to
        provide an alternate 'main' function name, using the 'main' from
        the Fortran libraries.
        (AC_LANG_PROGRAM(C)): Use F77_DUMMY_MAIN, if it is defined, so that
        cross-language link tests can be performed successfully.
        (_AC_F77_NAME_MANGLING): Require AC_F77_DUMMY_MAIN.  Also put $FLIBS
        after $LIBS, for consistency; this should be the general rule since
        the user may want to link to Fortran libraries that require $FLIBS.
        * autoconf.texi: Document AC_F77_DUMMY_MAIN and AC_F77_MAIN.

Attachment: diff.out
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]