Fix ntohll test.. we need to link, not just compile ;-)
[m6w6/libmemcached] / m4 / byteorder.m4
1 AC_DEFUN([DETECT_BYTEORDER],
2 [
3 AC_REQUIRE([AC_C_BIGENDIAN])
4 AC_CACHE_CHECK([for htonll], [ac_cv_have_htonll],
5 [AC_TRY_LINK([
6 #include <sys/types.h>
7 #include <netinet/in.h>
8 #include <inttypes.h>
9 ], [
10 return htonll(0);
11 ],
12 [ ac_cv_have_htonll=yes ],
13 [ ac_cv_have_htonll=no ])
14 ])
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 ])