apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apr/build apr_hints.m4
Date Fri, 01 Jun 2001 14:35:08 GMT
Justin Erenkrantz <jerenkrantz@ebuilt.com> writes:

> On Fri, Jun 01, 2001 at 12:35:50AM -0000, orlikowski@apache.org wrote:
> > orlikowski    01/05/31 17:35:49
> > 
> >   Modified:    build    apr_hints.m4
> >   Log:
> >   Linux needs these options for the posix rwlocks to work.
> >   Normally, _SVID_SOURCE and _BSD_SOURCE are defined by default.
> >   However, we must re-define them if we define _XOPEN_SOURCE, which is needed for
the rwlock definitions.
> >   
> >   Revision  Changes    Path
> >   1.14      +4 -2      apr/build/apr_hints.m4
> >   
> >   Index: apr_hints.m4
> >   ===================================================================
> >   RCS file: /home/cvs/apr/build/apr_hints.m4,v
> >   retrieving revision 1.13
> >   retrieving revision 1.14
> >   diff -u -r1.13 -r1.14
> >   --- apr_hints.m4	2001/05/13 11:03:59	1.13
> >   +++ apr_hints.m4	2001/06/01 00:35:48	1.14
> >   @@ -115,9 +115,11 @@
> >    	;;
> >        *-linux-*)
> >            case `uname -r` in
> >   -	    2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2])
> >   +	    2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
> >   +	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE]) 
> >    	           ;;
> >   -	    2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2])
> >   +	    2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
> >   +	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE])
> >    	           ;;
> >    	    1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
> >    	           ;;

Victor,

These have to do with glibc version, not kernel version...  Maybe it
will work fine, but it doesn't help anybody to understand why it is
there.

> Won't this break 2.4?  I talked to Roy before I left today and I might
> add something that does a AC_TRY_COMPILE (after seeing if
> pthread_rwlock_init is present) and punt from there (i.e. add these
> CPPFLAGS if the compile fails).  

About autodetection...

Is this what you mean?

a) see if pthread_rwlock_init is present; if not, punt
b) see if pthread_rwlock_t is defined; if not, turn on those 
   CPPFLAGS and try again

Any kind of libc feature test macros need to be turned on ASAP,
because they could influence the outcome of other tests (whether or
not we find an interface or which flavor of an interface we find).
I don't think we can wait until this point in autoconfiguration to
start turning on libc feature test macros.  Maybe it will work on
some glibc version with the current set of tests, but I don't think it
is cool in general.  It seems to me that as soon as you change libc
feature test macros you need to start over at ground zero.

I think I'd feel safest with something like Victor's change but which
looks at the glibc version instead of the kernel version.

-- 
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