[collectd] [PATCH] configure.in: have_htonll should depend on linker check

Manuel Luis Sanmartín Rozada manuel.luis at gmail.com
Tue May 4 16:04:28 CEST 2010


On Tue, May 4, 2010 at 10:17 AM, Max Henkel <henkel at gmx.at> wrote:
> Hello all!

Hello.

>
> During cross-compiling I've observed, that commit 35602ac1 introduced
> an unresolvable (regarding cross-compiling) configure error. According
> to the AIX documentation htonll is located in the "ISODE Library"
> and thus the linking should fail, if it is not available. Hence it

IBM (http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.commtechref/doc/commtrf2/htonll.htm)
says: The htonll subroutine is defined in the net/nh.h file as a null
macro if the host byte order is the same as the network byte order.

so... you don't need any library: AIX is big endian.
If you see /usr/include/netinet/in.h
    382 #if BYTE_ORDER == BIG_ENDIAN
    383 #ifndef htonll
    384 #define htonll(hostlong) (hostlong)
    385 #endif

or /usr/include/net/nh.h
    47  #if BYTE_ORDER == BIG_ENDIAN
    48  #ifndef ntohll
    49  #define ntohll(x)       (x)
    50  #endif

> might not be necessary to run a test program. Otherwise an option
> like fp-layout would be desirable. Could someone check this on AIX?

I test the patch in aix 6.1 and It works: detecting the htonll.

>
> Best regards,
>
> Max
> ---
>  configure.in |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/configure.in b/configure.in
> index 88ff302..7a22b8b 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -967,7 +967,7 @@ fi
>  AC_MSG_CHECKING([if have htonll defined])
>
>     have_htonll="no"
> -    AC_RUN_IFELSE([
> +    AC_LINK_IFELSE([
>        AC_LANG_PROGRAM([
>  #include <sys/types.h>
>  #include <netinet/in.h>
> --
> 1.7.0
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
>



More information about the collectd mailing list