OSDN Git Service

Change configure.in for IP_TRANSPARENT check.
authortanuma <tanuma@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 17 Jun 2010 11:21:52 +0000 (11:21 +0000)
committertanuma <tanuma@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 17 Jun 2010 11:21:52 +0000 (11:21 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10117 1ed66053-1c2d-0410-8867-f7571e6e31d3

config.h.in
configure
configure.in
l7vsd/include/l7vsadm.h
l7vsd/include/tcp_socket_option.h

index fd50ddb..199183d 100644 (file)
@@ -3,6 +3,10 @@
 /* Define to 1 if you have the `alarm' function. */
 #undef HAVE_ALARM
 
+/* Define to 1 if you have the declaration of `IP_TRANSPARENT', and to 0 if
+   you don't. */
+#undef HAVE_DECL_IP_TRANSPARENT
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
index d0b8c46..2f9ce1e 100755 (executable)
--- a/configure
+++ b/configure
 done
 
 
+# Checks for declarations.
+echo "$as_me:$LINENO: checking whether IP_TRANSPARENT is declared" >&5
+echo $ECHO_N "checking whether IP_TRANSPARENT is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_IP_TRANSPARENT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+       #include <sys/socket.h>
+       #include <linux/in.h>
+
+
+int
+main ()
+{
+#ifndef IP_TRANSPARENT
+  char *p = (char *) IP_TRANSPARENT;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_IP_TRANSPARENT=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_IP_TRANSPARENT=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_IP_TRANSPARENT" >&5
+echo "${ECHO_T}$ac_cv_have_decl_IP_TRANSPARENT" >&6
+if test $ac_cv_have_decl_IP_TRANSPARENT = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_IP_TRANSPARENT 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_IP_TRANSPARENT 0
+_ACEOF
+
+
+fi
+
+
+
 # Checks for typedefs, structures, and compiler characteristics.
 echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
index 83f197c..633291f 100644 (file)
@@ -29,6 +29,12 @@ AC_CHECK_LIB(boost_system-mt, main, :,
 # Checks for header files.
 AC_CHECK_HEADERS([limits.h unistd.h])
 
+# Checks for declarations.
+AC_CHECK_DECLS([IP_TRANSPARENT], [], [], [[
+       #include <sys/socket.h>
+       #include <linux/in.h>
+]])
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
 AC_C_CONST
index 2df4692..ae40e6f 100644 (file)
@@ -32,6 +32,7 @@
 #include <sstream>
 #include "error_code.h"
 #include "l7vs_command.h"
+#include "tcp_socket_option.h"
 
 #ifndef     L7VS_MODULE_PATH
 #define L7VS_MODULE_PATH    "./"
index 1c755b2..67852e8 100644 (file)
 
 #ifndef TCP_SOCKET_OPTION_H
 #define TCP_SOCKET_OPTION_H
+
+#include "config.h"
+#if HAVE_DECL_IP_TRANSPARENT && !defined(IP_TRANSPARENT)
+#define IP_TRANSPARENT          19
+#endif
+
 namespace l7vs
 {
 //! tcp_socket_option