apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@locus.apache.org
Subject cvs commit: apr aclocal.m4 configure.in
Date Thu, 30 Nov 2000 08:04:03 GMT
brane       00/11/30 00:04:03

  Modified:    .        aclocal.m4 configure.in
  Log:
  Check if h_errno is declared in netdb.h and whether any flags
  are required to make it visible. For instance, HP-UX 10.20 requires
  _XOPEN_SOURCE_EXTENDED.
  
  Revision  Changes    Path
  1.31      +51 -0     apr/aclocal.m4
  
  Index: aclocal.m4
  ===================================================================
  RCS file: /home/cvs/apr/aclocal.m4,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- aclocal.m4	2000/11/11 06:05:58	1.30
  +++ aclocal.m4	2000/11/30 08:04:03	1.31
  @@ -431,5 +431,56 @@
     fi
   ])
   
  +dnl
  +dnl APR_CHECK_H_ERRNO_FLAG
  +dnl
  +dnl checks which flags are necessary for <netdb.h> to define h_errno
  +dnl
  +AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[
  +  if test x$1 != x; then
  +    CFLAGS="-D$1 $CFLAGS"
  +  fi
  +  AC_TRY_COMPILE([
  +#ifdef HAVE_NETDB_H
  +#include <netdb.h>
  +#endif
  +],[
  +int h_e = h_errno;
  +],[
  +  if test x$1 != x; then
  +    ac_cv_h_errno_cflags="$1"
  +  else
  +    ac_cv_h_errno_cflags=yes
  +  fi
  +],[
  +  ac_cv_h_errno_cflags=no
  +])])
  +AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[
  +  AC_MSG_CHECKING([for h_errno in netdb.h])
  +  AC_CACHE_VAL(ac_cv_h_errno_cflags,[
  +    APR_H_ERRNO_COMPILE_CHECK
  +    if test "$ac_cv_h_errno_cflags" = "no"; then
  +      ac_save="$CFLAGS"
  +      for flag in _XOPEN_SOURCE_EXTENDED; do
  +        APR_H_ERRNO_COMPILE_CHECK($flag)
  +        if test "$ac_cv_h_errno_cflags" != "no"; then
  +          break
  +        fi
  +      done
  +      CFLAGS="$ac_save"
  +    fi
  +  ])
  +  if test "$ac_cv_h_errno_cflags" != "no"; then
  +    if test "$ac_cv_h_errno_cflags" != "yes"; then
  +      CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS"
  +      AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags])
  +    else
  +      AC_MSG_RESULT([$ac_cv_h_errno_cflags])
  +    fi
  +  else
  +    AC_MSG_RESULT([$ac_cv_h_errno_cflags])
  +  fi
  +])
  +
   sinclude(apr_common.m4)
   sinclude(hints.m4)
  
  
  
  1.176     +9 -1      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.175
  retrieving revision 1.176
  diff -u -r1.175 -r1.176
  --- configure.in	2000/11/29 19:35:52	1.175
  +++ configure.in	2000/11/30 08:04:03	1.176
  @@ -265,7 +265,7 @@
   AC_CHECK_HEADERS(limits.h)
   AC_CHECK_HEADERS(malloc.h)
   AC_CHECK_HEADERS(memory.h)
  -AC_CHECK_HEADERS(netdb.h)
  +AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0")
   AC_CHECK_HEADERS(osreldate.h)
   AC_CHECK_HEADERS(process.h)
   AC_CHECK_HEADERS(pwd.h)
  @@ -323,6 +323,14 @@
   AC_SUBST(signalh)
   AC_SUBST(sys_waith)
   AC_SUBST(pthreadh)
  +
  +dnl #----------------------------- Checking for h_errno in <netdb.h>
  +if test "$netdbh" = "1"; then
  +  APR_CHECK_H_ERRNO_FLAG
  +  if test "$ac_cv_h_errno_cflags" = "no"; then
  +    AC_MSG_ERROR([can not find h_errno in netdb.h])
  +  fi
  +fi
   
   dnl #----------------------------- Checks for standard typedefs
   AC_TYPE_OFF_T
  
  
  

Mime
View raw message