From bd333676e49baaa44078269c2c637a7aa994f9a6 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 14 Jun 2009 16:28:23 -0700 Subject: [PATCH] Turned setsockopt checks into a macro. --- configure.ac | 2 +- m4/setsockopt.m4 | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 218df90f..8f67691d 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/m4/setsockopt.m4 b/m4/setsockopt.m4 index 4ca7214c..e37fe2ae 100644 --- a/m4/setsockopt.m4 +++ b/m4/setsockopt.m4 @@ -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 #include #include #include #include - ], [ + ]],[[ 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 #include #include #include #include - ], [ + ]],[[ 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 --------------------------------------------------------------------------- -- 2.30.2