Commit 58b584c9 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added checks for different net includes.

Checks for sys/ioctl.h, netinet/in.h, net/if.h net/if_types.h and sys/ioctl.h.

darcs-hash:20060125131356-65a35-834618f9ccd25a0f527d860cf549c6e5b53fc5e6.gz
parent dba0c9c4
...@@ -34,12 +34,6 @@ ...@@ -34,12 +34,6 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stddef.h>
#include "su.h" #include "su.h"
#include "su_localinfo.h" #include "su_localinfo.h"
#include "su_module_debug.h" #include "su_module_debug.h"
...@@ -48,19 +42,29 @@ ...@@ -48,19 +42,29 @@
#include <sys/sockio.h> #include <sys/sockio.h>
#endif #endif
#include <netinet/in.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stddef.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <net/if.h> #endif
#if HAVE_NET_IF_H #if HAVE_NET_IF_H
#include <net/if.h>
#endif
#if HAVE_NET_IF_TYPES_H
#include <net/if_types.h> #include <net/if_types.h>
#endif #endif
#if HAVE_IPHLPAPI_H #if HAVE_IPHLPAPI_H
#include <iphlpapi.h> #include <iphlpapi.h>
#define USE_LOCALINFO0 1 #define USE_LOCALINFO0 1
......
...@@ -76,8 +76,11 @@ AC_CHECK_HEADER(pthread.h, ...@@ -76,8 +76,11 @@ AC_CHECK_HEADER(pthread.h,
HAVE_PTHREADS=1; HAVE_PTHREADS=1;
SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads])) SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads]))
AC_CHECK_HEADERS([unistd.h sys/time.h sys/socket.h sys/filio.h]) AC_CHECK_HEADERS([unistd.h sys/time.h])
AC_CHECK_HEADERS([arpa/inet.h netdb.h sys/sockio.h]) AC_CHECK_HEADERS([sys/socket.h sys/ioctl.h sys/filio.h sys/sockio.h])
AC_CHECK_HEADERS([netinet/in.h arpa/inet.h netdb.h net/if.h net/if_types.h])
if test "1${ac_cv_arpa_inet_h}2${ac_cv_netdb_h}3${ac_cv_sys_socket_h}4${ac_cv_net_if_h}" = 1yes2yes3yes4yes; then
AC_TRY_COMPILE([#include <sys/types.h> AC_TRY_COMPILE([#include <sys/types.h>
#include <arpa/inet.h> #include <arpa/inet.h>
...@@ -95,6 +98,8 @@ AC_TRY_COMPILE([#include <sys/types.h> ...@@ -95,6 +98,8 @@ AC_TRY_COMPILE([#include <sys/types.h>
struct ifreq ifreq; int index; index = ifreq.ifr_ifindex; struct ifreq ifreq; int index; index = ifreq.ifr_ifindex;
], AC_DEFINE(HAVE_IFR_IFINDEX, 1, [Define this as 1 if you have ifr_ifindex in <net/if.h>]))dnl ], AC_DEFINE(HAVE_IFR_IFINDEX, 1, [Define this as 1 if you have ifr_ifindex in <net/if.h>]))dnl
fi
dnl =========================================================================== dnl ===========================================================================
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
dnl =========================================================================== dnl ===========================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment