Remove extra white space in get command.
[m6w6/libmemcached] / m4 / byteorder.m4
index b6bd84a8f18b5c00912d18765a6e3d3b66cf1b93..7366822bb63586fb4d4a207ad89ba012e372df4c 100644 (file)
@@ -1,41 +1,19 @@
 AC_DEFUN([DETECT_BYTEORDER],
-[
-    AC_MSG_CHECKING([for htonll])
-    have_htoll="no"
-    AC_RUN_IFELSE([
-       AC_LANG_PROGRAM([
-#include <sys/types.h>
+    [
+    AC_REQUIRE([AC_C_BIGENDIAN])
+    AC_LANG_PUSH([C++])
+    AC_CACHE_CHECK([for htonll], [ac_cv_have_htonll],
+      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+          [#include <sys/types.h>
 #include <netinet/in.h>
 #include <inttypes.h>
-       ], [
-          return htonll(0);
-       ])            
-    ], [
-      have_htoll="yes"
-      AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])
-    ])
+      ], [ return htonll(0) ])],
+        [ ac_cv_have_htonll=yes ],
+        [ ac_cv_have_htonll=no ])
+      ])
+    AC_LANG_POP()
+    AS_IF([test "x$ac_cv_have_htonll" = "xyes"],[
+      AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])])
 
-    AC_MSG_RESULT([$have_htoll])
-    AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$have_htoll" == "xno"])
-    AC_MSG_CHECKING([byteorder])
-    have_htoll="no"
-    AC_RUN_IFELSE([
-       AC_LANG_PROGRAM([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <inttypes.h>
-       ], [
-if (htonl(5) != 5) {
-   return 1;
-}
-       ])            
-    ], [
-       AC_MSG_RESULT([big endian])
-       AC_DEFINE([BYTEORDER_BIG_ENDIAN], [1], [Enable big endian byteorder])
-    ], [
-       AC_MSG_RESULT([little endian])
-       AC_DEFINE([BYTEORDER_LITTLE_ENDIAN], [1], [Enable little endian byteorder])
+    AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$ac_cv_have_htonll" = "xno"])
     ])
-])
-
-DETECT_BYTEORDER