Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / m4 / byteorder.m4
1 AC_DEFUN([DETECT_BYTEORDER],
2 [
3 AC_REQUIRE([AC_C_BIGENDIAN])
4 AC_LANG_PUSH([C++])
5 AC_CACHE_CHECK([for htonll], [ac_cv_have_htonll],
6 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
7 [#include <sys/types.h>
8 #include <netinet/in.h>
9 #include <inttypes.h>
10 ], [ return htonll(0) ])],
11 [ ac_cv_have_htonll=yes ],
12 [ ac_cv_have_htonll=no ])
13 ])
14 AC_LANG_POP()
15 AS_IF([test "x$ac_cv_have_htonll" = "xyes"],[
16 AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])])
17
18 AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$ac_cv_have_htonll" = "xno"])
19 ])