Added checks for BSD-compliant protocol constants.
authorJack Pappas <jackp@server.fake>
Sun, 10 Feb 2013 02:40:48 +0000 (21:40 -0500)
committerJack Pappas <jackp@server.fake>
Sun, 10 Feb 2013 02:40:48 +0000 (21:40 -0500)
Fixed the checks for a couple of Linux-specific constants so they work correctly (they included the wrong header).
Added a check for the Linux-specific constant IP_PMTUDISC_DO; this'll be used with IP_MTU_DISCOVER in a future patch to make Linux sockets match BSD/OSX/Windows behavior.

configure.in

index c6f3f3c010aa2442ee8dbd8b3c8dbf12188d2b4d..6f8db16e078b827507a29414f4786d5bc7ef88dd 100644 (file)
@@ -1226,6 +1226,51 @@ if test x$target_win32 = xno; then
                AC_MSG_RESULT(no)
        ])
 
+       dnl *****************************
+       dnl *** Checks for IPPROTO_IP ***
+       dnl *****************************
+       AC_MSG_CHECKING(for IPPROTO_IP)
+       AC_TRY_COMPILE([#include <netinet/in.h>], [
+               int level = IPPROTO_IP;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IPPROTO_IP, 1, [Have IPPROTO_IP])
+       ], [
+               # We'll have to use getprotobyname
+               AC_MSG_RESULT(no)
+       ])
+
+       dnl *******************************
+       dnl *** Checks for IPPROTO_IPV6 ***
+       dnl *******************************
+       AC_MSG_CHECKING(for IPPROTO_IPV6)
+       AC_TRY_COMPILE([#include <netinet/in.h>], [
+               int level = IPPROTO_IPV6;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IPPROTO_IPV6, 1, [Have IPPROTO_IPV6])
+       ], [
+               # We'll have to use getprotobyname
+               AC_MSG_RESULT(no)
+       ])
+
+       dnl ******************************
+       dnl *** Checks for IPPROTO_TCP ***
+       dnl ******************************
+       AC_MSG_CHECKING(for IPPROTO_TCP)
+       AC_TRY_COMPILE([#include <netinet/in.h>], [
+               int level = IPPROTO_TCP;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IPPROTO_TCP, 1, [Have IPPROTO_TCP])
+       ], [
+               # We'll have to use getprotobyname
+               AC_MSG_RESULT(no)
+       ])
+
        dnl *****************************
        dnl *** Checks for SOL_IP     ***
        dnl *****************************
@@ -1275,7 +1320,7 @@ if test x$target_win32 = xno; then
        dnl *** Checks for IP_PKTINFO ***
        dnl *****************************
        AC_MSG_CHECKING(for IP_PKTINFO)
-       AC_TRY_COMPILE([#include <netdb.h>], [
+       AC_TRY_COMPILE([#include <linux/in.h>], [
                int level = IP_PKTINFO;
        ], [
                # Yes, we have it...
@@ -1299,11 +1344,25 @@ if test x$target_win32 = xno; then
                AC_MSG_RESULT(no)
        ])
 
+       dnl **********************************
+       dnl *** Checks for IP_DONTFRAG     ***
+       dnl **********************************
+       AC_MSG_CHECKING(for IP_DONTFRAG)
+       AC_TRY_COMPILE([#include <netinet/in.h>], [
+               int level = IP_DONTFRAG;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP_DONTFRAG, 1, [Have IP_DONTFRAG])
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
        dnl **********************************
        dnl *** Checks for IP_DONTFRAGMENT ***
        dnl **********************************
        AC_MSG_CHECKING(for IP_DONTFRAGMENT)
-       AC_TRY_COMPILE([#include <netdb.h>], [
+       AC_TRY_COMPILE([#include <Ws2ipdef.h>], [
                int level = IP_DONTFRAGMENT;
        ], [
                # Yes, we have it...
@@ -1317,7 +1376,7 @@ if test x$target_win32 = xno; then
        dnl *** Checks for IP_MTU_DISCOVER ***
        dnl **********************************
        AC_MSG_CHECKING(for IP_MTU_DISCOVER)
-       AC_TRY_COMPILE([#include <netdb.h>], [
+       AC_TRY_COMPILE([#include <linux/in.h>], [
                int level = IP_MTU_DISCOVER;
        ], [
                # Yes, we have it...
@@ -1327,6 +1386,20 @@ if test x$target_win32 = xno; then
                AC_MSG_RESULT(no)
        ])
 
+       dnl **********************************
+       dnl *** Checks for  IP_PMTUDISC_DO ***
+       dnl **********************************
+       AC_MSG_CHECKING(for IP_PMTUDISC_DO)
+       AC_TRY_COMPILE([#include <linux/in.h>], [
+               int level = IP_PMTUDISC_DO;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP_PMTUDISC_DO, 1, [Have IP_PMTUDISC_DO])
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
        dnl *********************************
        dnl *** Check for struct ip_mreqn ***
        dnl *********************************
@@ -3454,4 +3527,4 @@ echo "
 "
 if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
    AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
-fi
+fi
\ No newline at end of file