autoconf
[Top][All Lists]
Advanced

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

Re: ac_check_funcs(getloadavg) with gcc 3.3


From: Hanspeter Roth
Subject: Re: ac_check_funcs(getloadavg) with gcc 3.3
Date: Tue, 20 Jan 2004 23:26:11 +0100
User-agent: Mutt/1.4.1i

  On Jan 19 at 15:46, Thomas Dickey spoke:

> On Mon, 19 Jan 2004, Hanspeter Roth wrote:
> 
> > So should the invokation of getloadavg() be moved to a separate C
> > module and then call the C function that calls getloadavg() from a
> > C++ module?
> 
> That might be a better design - it would at least get rid of the problem
> of C++ breaking the configure test.  Since it's not standard, there's
> no guarantee that its prototype is the same across all implementations.
> 
> The various Linux and *BSD platforms tend to make random uncoordinated
> changes to the legacy BSD functions, sprinking const's in their
> prototypes.

It's for icewm. The Linux part is covered by another #ifdef anyway.
So I'm also considering some AC_TRY_LINK check:

AC_MSG_CHECKING([for getloadavg])
AC_TRY_LINK([#include <stdlib.h>],
  [double loadavg[3]; getloadavg(loadavg, 3) == 0;],
  [ AC_MSG_RESULT(yes)
    AC_DEFINE(HAVE_GETLOADAVG, 1, [getloadavg() is available])],
  [ AC_MSG_RESULT(no)  ])

I guess this should avoid conflicts with uncompatible getloadavg()s.
(My primary intend is to support Free-, Net- and OpenBSD.)

There's also AC_FUNC_GETLOADAVG. This would define C_GETLOADAVG if
run by g++ 3.3. But I don't know how it behaves on platforms that
have getloadavg() but on which I have no access to...

-Hanspeter




reply via email to

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