httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: [PATCH] fix AC_CHECK_DEFINE_FILES to work on FreeBSD's /bin/sh
Date Fri, 29 Sep 2000 17:05:34 GMT

Looks good to me.  I actually tested the original on glibc Linux and
non-glibc linux, so I assumed everything was fine when it worked on both
platforms.  :-(

Ryan

On Fri, 29 Sep 2000, Jeff Trawick wrote:

> My FreeBSD 3.4 box is not happy with Ryan's new AC_CHECK_DEFINE_FILES
> test.  (Linux isn't either, but at least configure does the required
> test with /bin/sh->/bin/bash.  I anticipate that other shells get
> upset too.)
> 
> Here is how the macro expands when it is used to look for POLLIN:
> 
>   echo $ac_n "checking for POLLIN in
> #include <poll.h>
> #include <sys/poll.h>  ""... $ac_c" 1>&AC_FD_MSG
> echo "configure:8723: checking for POLLIN in
> #include <poll.h>
> #include <sys/poll.h>  " >&AC_FD_CC
> if eval "test \"`echo '$''{'ac_cv_define_POLLIN'+set}'`\" = set"; then
>   echo $ac_n "(cached) $ac_c" 1>&6
> else
> 
> and here is the error message:       
> 
> /usr/home/trawick/regress/apache-2.0/src/lib/apr/configure: 8720:
> Syntax error: Bad fd number
> (line 8720 is the second line of the piece of lib/apr/configure above)
> 
> The problem is that the AC_FD_MSG and AC_FD_CC variables weren't
> replaced.  They aren't replaced on Linux either, but
> /bin/sh->/bin/bash on linux doesn't get upset with the command `echo
> "gobble" >&AC_FD_MSG', simply creating a file AC_FD_MSG, but on
> FreeBSD /bin/sh gets upset with such a command.
> 
> The following patch is more of a side-step of the whole issue because
> at the time I coded it I was confused about the cause of the message.
> 
> I'll try to see why AC_FD_MSG and AC_FD_CC aren't replaced before
> committing...  any complaints about the following in case I don't
> figure it out?
> 
> Index: lib/apr/aclocal.m4
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/aclocal.m4,v
> retrieving revision 1.26
> diff -u -r1.26 aclocal.m4
> --- aclocal.m4	2000/09/29 04:26:24	1.26
> +++ aclocal.m4	2000/09/29 15:26:32
> @@ -12,12 +12,16 @@
>  dnl ##
>  AC_DEFUN(AC_CHECK_DEFINE_FILES,[
>    AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[
> -    AC_EGREP_CPP(YES_IS_DEFINED, [
> -    $2
> -    #ifdef $1
> -    YES_IS_DEFINED
> -    #endif
> -    ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
> +    ac_cv_define_$1=no
> +    for curhdr in $2
> +    do
> +      AC_EGREP_CPP(YES_IS_DEFINED, [
> +      #include <$curhdr>
> +      #ifdef $1
> +      YES_IS_DEFINED
> +      #endif
> +      ], ac_cv_define_$1=yes)
> +    done
>    ])
>    if test "$ac_cv_define_$1" = "yes"; then
>      AC_DEFINE(HAVE_$1)
> Index: lib/apr/configure.in
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/configure.in,v
> retrieving revision 1.152
> diff -u -r1.152 configure.in
> --- configure.in	2000/09/29 04:26:24	1.152
> +++ configure.in	2000/09/29 15:26:33
> @@ -598,9 +598,7 @@
>  AC_CHECK_DEFINE(isascii, ctype.h)
>  # We are assuming that if the platform doesn't have POLLIN, it doesn't have
>  # any POLL definitions.
> -AC_CHECK_DEFINE_FILES(POLLIN, [
> -#include <poll.h>
> -#include <sys/poll.h> ] )
> +AC_CHECK_DEFINE_FILES(POLLIN, [poll.h sys/poll.h] )
>  
>  pthreadser="0"
>  if test "$threads" = "1"; then
> 
> -- 
> Jeff Trawick | trawick@ibm.net | PGP public key at web site:
>      http://www.geocities.com/SiliconValley/Park/9289/
>           Born in Roswell... married an alien...
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message