autoconf-patches
[Top][All Lists]
Advanced

[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: Thu, 28 Jun 2001 14:56:07 -0400 (EDT)

On 28 Jun 2001, Akim Demaille wrote:
> | 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.
> 
> I have not understood why you don't systematically check for such a
> main.  After all, the user is still free to use it or not, but why
> should she have to know this macro exists, and to know she needs to
> include it in configure.ac.
> 
> I'm very much in favor of having this run by default.

AC_F77_WRAPPERS does run this by default; configure.ac will be unmodified
in most cases.  However, the user still needs to know that the macro/check
exists, because she has to modify her C program to declare a
F77_DUMMY_MAIN function if that symbol is defined.  I couldn't think of
any way to do this transparently, although suggestions are welcome, of
course.

(See also the texinfo documentation patch.)

> This main is not expected to be run, right?  So maybe abort would be
> more adequate?

That's true...however, I wasn't sure how portable abort() is, and
AC_LANG_PROGRAM(C) has to be utterly safe or it will hose everything.
(In any case, should one use abort() or exit(1)?)

> Can't we set up say AC_LIBOBJ(fortran_main) which would define this
> guy?

That wouldn't help with link tests, since autoconf itself does not compile
and link to the sources for LIBOBJS.  (Nor does it solve the transparency
problem, since the user would still have to provide fortran_main.c.)

> | +[AC_LANG_PUSH(C)dnl
> | + ac_save_LIBS=$LIBS
> 
> Watch out, ac_save_LIBS is heavily used, and we already had some
> conflicts on it!  Please, take something even more private.

Okay.

> | + # First, try linking without a dummy main:
> | + AC_TRY_LINK([],[],ac_cv_f77_dummy_main=none,ac_cv_f77_dummy_main=unknown)
> 
> If you feel brave enough, please use AC_LINK_IFELSE, AC_TRY_LINK is to
> be obsoleted.

Okay.

Steven





reply via email to

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