httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Reid" <da...@jetnet.co.uk>
Subject [PATCH] Allow detection of inet_addr & inet_network on BONE
Date Sat, 16 Sep 2000 11:32:34 GMT
This changes the tests used to detect both inet_addr & inet_network so 
they work on BONE.  These should work on other platforms as they're not 
complicated.  I also took the opportunity to add some sonsistency to the 
way we use have_ in the apr.h.in file.  I haven't touched the others but 
maybe we should?  If no-one else gets there first I'll try to look at it 
soon.

If I don't hear any shouts I'll commit at the end of the weekend.

david

Index: aclocal.m4
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/aclocal.m4,v
retrieving revision 1.24
diff -u -u -r1.24 aclocal.m4
--- aclocal.m4  2000/06/30 01:56:48     1.24
+++ aclocal.m4  2000/09/16 10:30:32
@@ -273,5 +273,55 @@
 fi
 ])

+AC_DEFUN(APR_CHECK_INET_ADDR,[
+AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+],[
+inet_addr("127.0.0.1");
+],[
+    ac_cv_func_inet_addr=yes
+],[
+    ac_cv_func_inet_addr=no
+])
+])
+
+if test "$ac_cv_func_inet_addr" = "yes"; then
+  have_inet_addr=1
+else
+  have_inet_addr=0
+fi
+])
+
+AC_DEFUN(APR_CHECK_INET_NETWORK,[
+AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+],[
+inet_network("127.0.0.1");
+],[
+    ac_cv_func_inet_network=yes
+],[
+    ac_cv_func_inet_network=no
+])
+])
+
+if test "$ac_cv_func_inet_network" = "yes"; then
+  have_inet_network=1
+else
+  have_inet_network=0
+fi
+])
+
 sinclude(apr_common.m4)
 sinclude(hints.m4)
Index: configure.in
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
retrieving revision 1.148
diff -u -u -r1.148 configure.in
--- configure.in        2000/09/15 16:28:17     1.148
+++ configure.in        2000/09/16 10:30:36
@@ -222,8 +222,8 @@
 AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ])
 AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ])
 AC_CHECK_FUNCS(getpass)
-AC_CHECK_FUNC(inet_addr, [ inet_addr="1" ], [ inet_addr="0" ])
-AC_CHECK_FUNC(inet_network, [ inet_network="1" ], [ inet_network="0" ])
+APR_CHECK_INET_ADDR
+APR_CHECK_INET_NETWORK
 AC_CHECK_FUNC(_getch)
 AC_CHECK_FUNCS(gmtime_r localtime_r)
 AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ])
@@ -237,8 +237,8 @@

 AC_SUBST(sendfile)
 AC_SUBST(fork)
-AC_SUBST(inet_addr)
-AC_SUBST(inet_network)
+AC_SUBST(have_inet_addr)
+AC_SUBST(have_inet_network)
 AC_SUBST(have_sigaction)
 AC_SUBST(have_setrlimit)
 AC_SUBST(have_getrlimit)
Index: include/apr.h.in
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
retrieving revision 1.40
diff -u -u -r1.40 apr.h.in
--- include/apr.h.in    2000/08/23 23:28:47     1.40
+++ include/apr.h.in    2000/09/16 10:30:42
@@ -59,8 +59,8 @@
 #define APR_MEM_BASED_SHM       @mem_based@

 #define APR_HAVE_IN_ADDR        @have_in_addr@
-#define APR_HAVE_INET_ADDR      @inet_addr@
-#define APR_HAVE_INET_NETWORK   @inet_network@
+#define APR_HAVE_INET_ADDR      @have_inet_addr@
+#define APR_HAVE_INET_NETWORK   @have_inet_network@
 #define APR_HAVE_UNION_SEMUN    @have_union_semun@
 #define APR_HAVE_STRUCT_RLIMIT  @struct_rlimit@
 #define APR_HAVE_SETRLIMIT      @have_setrlimit@  



Mime
View raw message