You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ian Holsman <ia...@apache.org> on 2002/03/09 00:53:09 UTC
[PATCH] check for _res global structure
This is the first part to get user configurable timeouts
I'll commit this on monday if no one objects.
the main use for this is so we can configure the DNS timeout
so apache doesn't hang on a horked nameserver.. causing it to
grind to a halt.
--ian
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.415
diff -u -u -r1.415 configure.in
--- configure.in 25 Feb 2002 16:55:10 -0000 1.415
+++ configure.in 8 Mar 2002 23:50:33 -0000
@@ -408,6 +408,7 @@
dnl It should check for LIBS being empty and set LIBS equal to the new
value
dnl without the extra " " in that case, but they didn't do that. So, we
dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance.
+AC_CHECK_LIB(resolv, res_init)
AC_CHECK_LIB(nsl, gethostbyname)
AC_SEARCH_LIBS(gethostname, nsl)
AC_CHECK_LIB(socket, socket)
@@ -1487,6 +1488,7 @@
AC_SUBST(acceptfilter)
AC_CHECK_FUNCS(set_h_errno)
+APR_CHECK_RESOLV_RETRANS
echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}"
dnl # Start of checking for IPv6 support...
@@ -1506,6 +1508,7 @@
APR_CHECK_NEGATIVE_EAI
APR_CHECK_WORKING_GETNAMEINFO
APR_CHECK_SOCKADDR_IN6
+
AC_MSG_CHECKING(if APR supports IPv6)
have_ipv6="0"
if test "$user_disabled_ipv6" = 1; then
Index: build/apr_network.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_network.m4,v
retrieving revision 1.11
diff -u -u -r1.11 apr_network.m4
--- build/apr_network.m4 7 Dec 2001 15:48:05 -0000 1.11
+++ build/apr_network.m4 8 Mar 2002 23:50:33 -0000
@@ -140,6 +140,34 @@
])
dnl
+dnl check for presence of retrans/retry variables in the res_state
structure
+dnl
+AC_DEFUN(APR_CHECK_RESOLV_RETRANS,[
+ AC_CACHE_CHECK(for presence of retrans/retry fields in
res_state/resolv.h , ac_cv_retransretry,[
+ AC_TRY_RUN( [
+#include <sys/types.h>
+#include <inet/ip.h>
+#include <resolv.h>
+/* _res is a global defined in resolv.h */
+void main(void) {
+ _res.retrans = 2;
+ _res.retry = 1;
+ exit(0);
+}
+],[
+ ac_cv_retransretry="yes"
+],[
+ ac_cv_retransretry="no"
+],[
+ ac_cv_retransretry="no"
+])])
+if test "$ac_cv_retransretry" = "yes"; then
+ AC_DEFINE(RESOLV_RETRANSRETRY, 1, [Define if resolv.h's res_state has
the fields retrans/rety])
+fi
+])
+
+
+dnl
dnl check for gethostbyname() which handles numeric address strings
dnl
AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[
Re: Problem building on Tru64 with 2.0.35 w/ suggested change
Posted by Jeff Trawick <tr...@attglobal.net>.
"David Hill" <dd...@zk3.dec.com> writes:
> Hi all,
> Building on Tru64 was broken with 2.0.35 (worked in 2.0.32).
> Compiling libapr fails because ld is called with -pthread instead of
> -lpthread. A suggested change is presented below that fixes it on
> Tru64. Not sure if the clause that follows my additions are still
> required for some other platform or if some other checking needs to be
> done to just do my change for Tru64.
Dave:
For the moment, ignore the possibly-bogus libtool that's in the
tarball and try installing your own libtool (if it isn't already
installed) and run ./buildconf before ./configure.
I build successfully on Tru64 (hudson) all the time using that
mechanism (though I don't start with a tarball, so your verification
will be helpful).
--
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...
Problem building on Tru64 with 2.0.35 w/ suggested change
Posted by David Hill <dd...@zk3.dec.com>.
Hi all,
Building on Tru64 was broken with 2.0.35 (worked in 2.0.32).
Compiling libapr fails because ld is called with -pthread instead of
-lpthread. A suggested change is presented below that fixes it on
Tru64. Not sure if the clause that follows my additions are still
required for some other platform or if some other checking needs to be
done to just do my change for Tru64.
Dave Hill
*** srclib/apr/build/ltmain.sh.orig Tue Apr 9 11:42:58 2002
--- srclib/apr/build/ltmain.sh Tue Apr 9 11:43:29 2002
***************
*** 1096,1101 ****
--- 1096,1107 ----
deplibs="$deplibs $arg"
;;
+ -pthread)
+ # on Tru64, -pthread is a compile option, -lpthread is
+ # the matching ld option
+ deplibs="$deplibs -lpthread"
+ ;;
+
-?thread)
deplibs="$deplibs $arg"
;;