apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r421071 - in /apr/apr/trunk: build/apr_network.m4 configure.in
Date Wed, 12 Jul 2006 01:39:57 GMT
Author: jerenkrantz
Date: Tue Jul 11 18:39:56 2006
New Revision: 421071

URL: http://svn.apache.org/viewvc?rev=421071&view=rev
Log:
Move the autoconf check for type 'in_addr' into a macro, and improve it to work
for Windows as well.

Originally titled: [patch 11/17] struct in_addr

Submitted by: John Mark Vandenberg
Reviewed by: Justin Erenkrantz

Modified:
    apr/apr/trunk/build/apr_network.m4
    apr/apr/trunk/configure.in

Modified: apr/apr/trunk/build/apr_network.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/apr_network.m4?rev=421071&r1=421070&r2=421071&view=diff
==============================================================================
--- apr/apr/trunk/build/apr_network.m4 (original)
+++ apr/apr/trunk/build/apr_network.m4 Tue Jul 11 18:39:56 2006
@@ -18,6 +18,29 @@
 dnl
 
 dnl
+dnl check for type in_addr
+dnl
+AC_DEFUN(APR_TYPE_IN_ADDR,[
+  AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[
+  AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+],[
+ struct in_addr arg;
+ arg.s_addr = htonl(INADDR_ANY);
+], [ ac_cv_type_in_addr="yes"] , [
+ac_cv_type_in_addr="no"])
+])
+])
+
+dnl
 dnl check for working getaddrinfo()
 dnl
 dnl Note that if the system doesn't have gai_strerror(), we

Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=421071&r1=421070&r2=421071&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Tue Jul 11 18:39:56 2006
@@ -1930,17 +1930,12 @@
 
 dnl ----------------------------- Checking for Networking Support 
 echo "${nl}Checking for Networking support..."
-AC_MSG_CHECKING(for in_addr in netinet/in.h)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <netinet/in.h>
-],[
-struct in_addr arg;
-arg.s_addr = htonl(INADDR_ANY);
-], [ have_in_addr="1" 
-msg=yes ] , [ have_in_addr="0"
-msg=no ])
-AC_MSG_RESULT([$msg])
+APR_TYPE_IN_ADDR
+if test "$ac_cv_type_in_addr" = "yes"; then
+  have_in_addr="1"
+else
+  have_in_addr="0"
+fi
 
 AC_MSG_CHECKING([if fd == socket on this platform])
 if test "x$file_as_socket" != "x0" ; then



Mime
View raw message