autoconf
[Top][All Lists]
Advanced

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

Re: `CHECK_LIB', `CHECK_FUNC' and macros


From: Stephane Bortzmeyer
Subject: Re: `CHECK_LIB', `CHECK_FUNC' and macros
Date: Fri, 28 May 2004 13:29:22 +0200
User-agent: Mutt/1.5.5.1+cvs20040105i

On Fri, May 28, 2004 at 12:03:11PM +0200,
 Ludovic Courtès <address@hidden> wrote 
 a message of 48 lines which said:

> Both `AC_CHECK_LIB' and `AC_CHECK_FUNC' check whether a *symbol* can be
> found in the given library (or in one of `$LIBS').  However, on Tru64
> UNIX 5.1 (aka. Digital UNIX, OSF1, ...) <pthread.h> does the following:
...
> The same problem might very well arise with other headers/libraries,
> unless some standard defines which symbols are mandatory.  What do
> people think about it?

The network interface (getaddrinfo and friends) has the same problem
on Tru64. IMHO, autoconf should allow to include a header in test
testing program. My workaround:

dnl Some Unices like Tru64 or Mac OS X has getaddrinfo() or
dnl getnameinfo() but has it renamed in libc as something else so we
dnl must include <netdb.h> to get the redefinition. (Stolen from rsync)
dnl autoconf AC_CHECK_FUNCS does not allow headers to be easily included :-(
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop, ,
        [AC_MSG_CHECKING([$ac_func again by including <netdb.h>])
        AC_TRY_LINK([#include <sys/types.h>
        #include <sys/socket.h>
        #include <netdb.h>],[$ac_func(NULL, NULL, NULL, NULL);],
                [AC_MSG_RESULT([yes])],
                [AC_MSG_ERROR([Missing mandatory function - echoping now uses 
the new network functions (RFC 2133) which are mandatory for IPv6])]
                )])
                






reply via email to

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