Turned setsockopt checks into a macro.
authorMonty Taylor <mordred@inaugust.com>
Sun, 14 Jun 2009 23:28:23 +0000 (16:28 -0700)
committerMonty Taylor <mordred@inaugust.com>
Sun, 14 Jun 2009 23:28:23 +0000 (16:28 -0700)
configure.ac
m4/setsockopt.m4

index 218df90f891264562e937a7ff600bd7bec2e0071..8f67691d0ebaa274abbb1520ab5d3c25deceb957 100644 (file)
@@ -151,11 +151,11 @@ AC_SEARCH_LIBS(floorf, m)
 DETECT_BYTEORDER
 ENABLE_UTILLIB
 ENABLE_DTRACE
+SETSOCKOPT_SANITY
 
 sinclude(m4/pod2man.m4)
 sinclude(m4/protocol_binary.m4)
 sinclude(m4/memcached.m4)
-sinclude(m4/setsockopt.m4)
 sinclude(m4/hsieh.m4)
 
 dnl TODO: Remove this define once we are using 2.61 across the board.
index 4ca7214cff9595dd1d6c1342f5b1e8809e3b2881..e37fe2ae7c0e9b0df3e3d2081af6dc1bea628ca7 100644 (file)
@@ -1,15 +1,16 @@
 dnl ---------------------------------------------------------------------------
-dnl Macro: SETSOCKOPT_TEST
+dnl Macro: SETSOCKOPT_SANITY
 dnl ---------------------------------------------------------------------------
-AC_LANG(C)
-AC_RUN_IFELSE([ 
-   AC_LANG_PROGRAM([
+AC_DEFUN([SETSOCKOPT_SANITY],[
+  AC_LANG_PUSH([C])
+  AC_RUN_IFELSE([ 
+    AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <time.h>
 #include <sys/time.h>
 #include <errno.h>
-   ][
+   ]],[[
      int sock = socket(AF_INET, SOCK_STREAM, 0);
      struct timeval waittime;
    
@@ -23,17 +24,17 @@ AC_RUN_IFELSE([
        }
      }
      return 0;
-   ])
-   ], AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working SO_SNDTIMEO])
+   ]])],
+   [AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working SO_SNDTIMEO])]
 
-AC_RUN_IFELSE([ 
-   AC_LANG_PROGRAM([
+  AC_RUN_IFELSE([ 
+    AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <time.h>
 #include <sys/time.h>
 #include <errno.h>
-   ], [
+    ]],[[
      int sock = socket(AF_INET, SOCK_STREAM, 0);
      struct timeval waittime;
    
@@ -47,9 +48,10 @@ AC_RUN_IFELSE([
        }
      }
      return 0;
-   ])
-   ], AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working SO_RCVTIMEO])) 
+   ]])], [AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working SO_RCVTIMEO])]) 
 
+  AC_LANG_POP
+])
 dnl ---------------------------------------------------------------------------
-dnl End Macro: SETSOCKOPT_TEST
+dnl End Macro: SETSOCKOPT_SANITY
 dnl ---------------------------------------------------------------------------