The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
AC_DEFUN([DETECT_BYTEORDER],
[
    AC_REQUIRE([AC_C_BIGENDIAN])
    AC_CACHE_CHECK([for htonll],[av_cv_have_htonll],[

    AC_RUN_IFELSE([
       AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
#include <inttypes.h>
       ]],[[
          return htonll(0);
       ]])            
    ], [
      ac_cv_have_htonll=yes
    ],[
      ac_cv_have_htonll=no
    ])])

    AS_IF([test "x$ac_cv_have_htonll" = "xyes"],[
      AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])])

    AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$ac_cv_have_htonll" = "xno"])
])