httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: APACHE20 problem with string.h and strings.h
Date Tue, 30 Jan 2001 12:08:32 GMT
jean-frederic clere <jfrederic.clere@fujitsu.siemens.es> writes:

> Yes, the problem is in apr_general.h where there is "unsupported"
> prototyping...
> +++
> #if
> (!APR_HAVE_BZERO)                                                           
> #define bzero(a,b)
> memset(a,0,b)                                                
> #endif                                                                          
> +++
> I would to prevent it when there is a strings.h that contains bzero.

In srclib/apr/configure.in, we have

  AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] )

I have found other cases where AC_CHECK_FUNCS()  doesn't work for some
function on some platform because that platform requires a header
file.  Maybe this will help?  It works for me on Linux/glibc.

Test this code on your platform and see if it results in happiness.

Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.220
diff -u -r1.220 configure.in
--- configure.in	2001/01/28 12:18:38	1.220
+++ configure.in	2001/01/30 11:57:38
@@ -251,7 +251,7 @@
 fi
 AC_CHECK_FUNCS(hstrerror)
 AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ])
-AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] )
+APR_CHECK_BZERO
 
 AC_SUBST(fork)
 AC_SUBST(have_inet_addr)
Index: helpers/apr-conf.m4
===================================================================
RCS file: /home/cvspublic/apr/helpers/apr-conf.m4,v
retrieving revision 1.3
diff -u -r1.3 apr-conf.m4
--- helpers/apr-conf.m4	2001/01/09 11:05:49	1.3
+++ helpers/apr-conf.m4	2001/01/30 11:57:52
@@ -534,3 +534,31 @@
     AC_MSG_RESULT([$ac_cv_h_errno_cflags])
   fi
 ])
+
+dnl
+dnl check for bzero
+dnl Some platforms need strings.h to be included in order to detect
+dnl bzero, so we can't use AC_CHECK_FUNCS
+dnl
+AC_DEFUN(APR_CHECK_BZERO,[
+AC_CACHE_CHECK(for bzero, ac_cv_func_bzero,[
+AC_TRY_COMPILE([
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <string.h>
+],[
+bzero(0,0);
+],[
+    ac_cv_func_bzero=yes
+],[
+    ac_cv_func_bzero=no
+])
+])
+
+if test "$ac_cv_func_bzero" = "yes"; then
+  have_bzero="1"
+else
+  have_bzero="0"
+fi
+])

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message