[Top][All Lists]

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

C/Fortran glue code

From: Peter Eisentraut
Subject: C/Fortran glue code
Date: Wed, 29 May 2002 18:36:36 +0200 (CEST)

Autoconf inserts this code into C program to allow linking against Fortran

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }

However, this isn't necessary if the user never called AC_F77_DUMMY_MAIN.
Therefore I suggest that this code be omitted in that case, so the
configure script is shorter and config.log is easier to read.

I have found the following ChangeLog entry which appears to have had the
same idea, but in fact it doesn't do what it says --
_AC_LANG_PROGRAM_C_F77_HOOKS isn't used anywhere.

2001-07-18  Akim Demaille  <address@hidden>

        The C-Fortran 77 hooks are available only once AC_F77_DUMMY_MAIN
        was run, while they are needed also when it is expanded.
        Reported by Nicolas Joly.

        * aclang.m4 (AC_F77_DUMMY_MAIN): Define _AC_LANG_PROGRAM_C_F77_HOOKS.
        (AC_LANG_PROGRAM(C)): Use it instead of depending upon
        AC_F77_DUMMY_MAIN being expanded.

Thus, I propose the attached patch.

Peter Eisentraut   address@hidden

Attachment: patch
Description: Patch

reply via email to

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