You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bill Stoddard <st...@raleigh.ibm.com> on 2000/01/21 15:59:21 UTC

ap_ac_config.h, os.h & ap_config_auto*.h

There appears to be a lot of overlap in the purpose of each of these config
files and I don't grok where we are going. On Windows, os.h contains a lot
of stuff that could go into a new file, ap_config_auto_windows.h. Or we
could just leave platform specific defines in os.h for platforms that do not
support autoconf.  I think I prefer the former.

Ryan, you mentioned that httpd.h could no longer include ap_config.h.  Why?
Is there a problem with including ap_config_auto*.h in httpd.h? Some of the
defines are required by httpd.h.

Bill

________________________________________________
Bill Stoddard stoddard@raleigh.ibm.com

Come to the first official Apache Software Foundation
Conference!  <http://ApacheCon.Com/>




Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Manoj Kasichainula <ma...@io.com>.
On Fri, Jan 21, 2000 at 02:06:18PM -0500, rbb@apache.org wrote:
> I've been argueing for this for about two months now.  Everytime it has
> come up that Apache was leaking macros.  When I finally come around to
> thinking that Apache may be okay without the AP_USE_HSREGEX type macros,
> thigns change.  I should learn to stick to my guns.  :-)

Keep sticking, because I have mine too.

All of the regex functions and structures exposed to modules should be
ap_ protected. We don't want the HS regex functions to collide with
the system's. In fact, I thought we were already doing this.

Since the functions are definitely being provided by Apache, there
should be no conditional #including necessary, hence no AP_USE_HSREGEX
necessary.

Now, there could be other reasons for exporting conditional macros to
the outside world (and the solutions I mentioned earlier are the best
ones, I think). But, since Apache should really be exporting a
completely platform and configuration-independant API, I am guessing
that this won't be necessary.


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by rb...@apache.org.
> 
> Almost sounds like we need a solution similar to APR (with its HAVE_FOO
> and APR_HAVE_FOO). Have a header that defines AP_USE_HSREGEX separately
> from the other autoconf values. Does that seem right?

I've been argueing for this for about two months now.  Everytime it has
come up that Apache was leaking macros.  When I finally come around to
thinking that Apache may be okay without the AP_USE_HSREGEX type macros,
thigns change.  I should learn to stick to my guns.  :-)

I respectfully suggest that implementing AP_USE_HSREGEX should be done the
same way that APR did it, because it makes things much easier to
understand when porting the code.  Unfortunately, this will also break the
always use #ifdef rule.

Ryan


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Greg Stein <gs...@lyra.org>.
In Apache 1.3, the USE_HSREGEX is defined on the command line for the
compilation.

In our new autoconf world, this has shifted to ap_config_auto.h. If we
can't include that into httpd.h, then Bill's righ... we've got a problem
when we try to export the regex stuff to users of httpd.h.

Almost sounds like we need a solution similar to APR (with its HAVE_FOO
and APR_HAVE_FOO). Have a header that defines AP_USE_HSREGEX separately
from the other autoconf values. Does that seem right?

Cheers,
-g

On Fri, 21 Jan 2000, Bill Stoddard wrote:

> This macro is defined in ap_config_auto.h, which is not included in httpd.h.
> By just blind luck the Linux case uses regex.h.
> 
> Bill
> ----- Original Message -----
> From: <rb...@apache.org>
> To: <ne...@apache.org>
> Sent: Friday, January 21, 2000 1:17 PM
> Subject: Re: ap_ac_config.h, os.h & ap_config_auto*.h
> 
> 
> >
> > I don't know.  Where is it defined on Linux?  I don't currently have
> > access to a linux box with the code on it.  This WORKS on Linux, I have
> > compiled it multiple times.  It is possible that this macro isn't
> > currently supported.  I don't have all the answers right now, because I
> > can't get to the code.
> >
> > If I can do some work later today, I'll respond with a better answer then.
> > Or, you could ask Manoj, he should also be able to answer this question.
> >
> > Ryan
> >
> >
> >
> > On Fri, 21 Jan 2000, Bill Stoddard wrote:
> >
> > > Ryan,
> > > Thanks for the explanation. Now a question.  In httpd.h, there is the
> > > following piece of code:
> > >
> > > /* Regexes */
> > > #ifdef AP_USE_HSREGEX
> > > #include "hsregex.h"
> > > #else
> > > #include <regex.h>
> > > #endif
> > >
> > > If httpd.h cannot include ap_config, then where should AP_USE_HSREGEX be
> > > defined?
> > >
> > > Bill
> > >
> > >
> >
> >
> > Come to the first official Apache Software Foundation
> > Conference!!!   <http://ApacheCon.Com/>
> >
> >
> ____________________________________________________________________________
> ___
> > Ryan Bloom                        rbb@ntrnet.net
> > 2121 Stonehenge Dr. Apt #3
> > Raleigh, NC 27615 Ryan Bloom -- thinker, adventurer, artist,
> >      writer, but mostly, friend.
> > --------------------------------------------------------------------------
> -----
> >
> 

-- 
Greg Stein, http://www.lyra.org/


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Bill Stoddard <st...@raleigh.ibm.com>.
This macro is defined in ap_config_auto.h, which is not included in httpd.h.
By just blind luck the Linux case uses regex.h.

Bill
----- Original Message -----
From: <rb...@apache.org>
To: <ne...@apache.org>
Sent: Friday, January 21, 2000 1:17 PM
Subject: Re: ap_ac_config.h, os.h & ap_config_auto*.h


>
> I don't know.  Where is it defined on Linux?  I don't currently have
> access to a linux box with the code on it.  This WORKS on Linux, I have
> compiled it multiple times.  It is possible that this macro isn't
> currently supported.  I don't have all the answers right now, because I
> can't get to the code.
>
> If I can do some work later today, I'll respond with a better answer then.
> Or, you could ask Manoj, he should also be able to answer this question.
>
> Ryan
>
>
>
> On Fri, 21 Jan 2000, Bill Stoddard wrote:
>
> > Ryan,
> > Thanks for the explanation. Now a question.  In httpd.h, there is the
> > following piece of code:
> >
> > /* Regexes */
> > #ifdef AP_USE_HSREGEX
> > #include "hsregex.h"
> > #else
> > #include <regex.h>
> > #endif
> >
> > If httpd.h cannot include ap_config, then where should AP_USE_HSREGEX be
> > defined?
> >
> > Bill
> >
> >
>
>
> Come to the first official Apache Software Foundation
> Conference!!!   <http://ApacheCon.Com/>
>
>
____________________________________________________________________________
___
> Ryan Bloom                        rbb@ntrnet.net
> 2121 Stonehenge Dr. Apt #3
> Raleigh, NC 27615 Ryan Bloom -- thinker, adventurer, artist,
>      writer, but mostly, friend.
> --------------------------------------------------------------------------
-----
>


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by rb...@apache.org.
I don't know.  Where is it defined on Linux?  I don't currently have
access to a linux box with the code on it.  This WORKS on Linux, I have
compiled it multiple times.  It is possible that this macro isn't
currently supported.  I don't have all the answers right now, because I
can't get to the code.

If I can do some work later today, I'll respond with a better answer then.
Or, you could ask Manoj, he should also be able to answer this question.

Ryan



On Fri, 21 Jan 2000, Bill Stoddard wrote:

> Ryan,
> Thanks for the explanation. Now a question.  In httpd.h, there is the
> following piece of code:
> 
> /* Regexes */
> #ifdef AP_USE_HSREGEX
> #include "hsregex.h"
> #else
> #include <regex.h>
> #endif
> 
> If httpd.h cannot include ap_config, then where should AP_USE_HSREGEX be
> defined?
> 
> Bill
> 
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Bill Stoddard <st...@raleigh.ibm.com>.
Ryan,
Thanks for the explanation. Now a question.  In httpd.h, there is the
following piece of code:

/* Regexes */
#ifdef AP_USE_HSREGEX
#include "hsregex.h"
#else
#include <regex.h>
#endif

If httpd.h cannot include ap_config, then where should AP_USE_HSREGEX be
defined?

Bill


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by David Reid <ab...@dial.pipex.com>.
I'd have thought so.

----- Original Message -----
From: "Brian Havard" <br...@kheldar.apana.org.au>
To: <ne...@apache.org>
Sent: Sunday, January 23, 2000 11:48 AM
Subject: Re: ap_ac_config.h, os.h & ap_config_auto*.h


> On Fri, 21 Jan 2000 10:32:37 -0500 (EST), rbb@apache.org wrote:
>
> >httpd.h can not include any config header file because those header files
> >aren't public, but httpd.h is.
>
> Err, httpd.h contains:
>
> /* Regexes */
> #ifdef AP_USE_HSREGEX
> #include "hsregex.h"
> #else
> #include <regex.h>
> #endif
>
> but as far as I can see, AP_USE_HSREGEX is only defined in
ap_config_auto.h
> I think someone's a bit confused (besides me that is).
>
> Shouldn't --enable-hsregex be the default if no system regex is found?
>
> --
>
____________________________________________________________________________
__
>  |  Brian Havard                 |  "He is not the messiah!
|
>  |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of
Brian |
>  -------------------------------------------------------------------------
-----
>


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Manoj Kasichainula <ma...@io.com>.
On Fri, Jan 28, 2000 at 06:18:12PM -0800, Greg Stein wrote:
> On Fri, 28 Jan 2000, Manoj Kasichainula wrote:
> > All our regex functions should be ap_ wrapped, hence always exported
> > by Apache, so we won't need an AP_USE_HSREGEX in the first place.
> 
> That adds a maintenance burden on us when we need to integrate patches or
> updates from the original distribution.

We don't have to change the regex code itself. We just add a wrapper
to the regex code in Apache. Then, the Apache binary has its binding
to whatever regex library is in use already set up, and modules just
use the Apache code.

In fact, this has already done to a certain extent since May. We're
already stubbing out regexec() to avoid collisions between HS regex
and what the system provides. (Search for ap_regexec in
src/main/util.c in 1.3 and 2.0.) All I'm suggesting is to extend this
to all the regex functions. I'm surprised we don't already have to.

> (okay, maybe it doesn't apply to hsregex... I don't think I've seen a
>  checkin there in the year I've been watching :-)

Speaking of that, PHP has made changes to their regex libraries to fix
64-bit system problems (IIRC). We should either incoprorate those
changes or switch to a new regex library. I vote for the latter:
either the new HS regex stuff in Tcl (is there an actual tarball
relase for that?) or PCRE.

> As a general policy, I don't think we should be altering our bundled libs
> if we can avoid it. Keep it minimal...

Agreed.


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Manoj Kasichainula <ma...@io.com>.
On Fri, Jan 28, 2000 at 10:00:32PM -0500, rbb@apache.org wrote:
> On Fri, 28 Jan 2000, Manoj Kasichainula wrote:
> > Is there a problem with the solution I sent out last week?
> 
> I wouldn't know, I didn't get that message.  :-)  At least, I don't
> remember getting it.

*shrug* I sent it out on the 21st, and it's in the archives. 

> > All our regex functions should be ap_ wrapped, hence always exported
> > by Apache, so we won't need an AP_USE_HSREGEX in the first place.
> 
> That doesn't fix the underlying problem.  There are macros that are
> generated by autoconf that we can't export, but which all modules need.

Yes it does. It fixes it by not requiring the inclusion of
ap_config.h in the first place.

My programmer's intuition tells me that if Apache has to export such
macros at all, then we're doing something wrong. APR is different,
because it has to provide OS-specific interfaces. Apache has no such
requirement. I'm fully open (and cautiously expecting) to being proven
wrong.

I'd like to export an API (giggle) to modules which is as system and
compile-option-independant as possible. 

Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by rb...@apache.org.
On Fri, 28 Jan 2000, Manoj Kasichainula wrote:

> On Fri, Jan 28, 2000 at 12:46:32PM -0500, rbb@apache.org wrote:
> > Okay, I've looked into the whole HSREGEX issue now.  I don't see a real
> > problem.  As long as we always include ap_config.h before we include
> > httpd.h, this is defined correctly.  This may not work for external
> > modules like php that may try to use thid definition.  I need to look into
> > this still.  I am about to commit code to fix this so that AP_USE_HSREGEX
> > is defined correctly on all platforms.
> 
> Is there a problem with the solution I sent out last week?

I wouldn't know, I didn't get that message.  :-)  At least, I don't
remember getting it.

> 
> All our regex functions should be ap_ wrapped, hence always exported
> by Apache, so we won't need an AP_USE_HSREGEX in the first place.

That doesn't fix the underlying problem.  There are macros that are
generated by autoconf that we can't export, but which all modules need.
When I return from SF, I am going to look into creating a module specific
header file.

Ryan


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Greg Stein <gs...@lyra.org>.
On Fri, 28 Jan 2000, Manoj Kasichainula wrote:
> On Fri, Jan 28, 2000 at 12:46:32PM -0500, rbb@apache.org wrote:
> > Okay, I've looked into the whole HSREGEX issue now.  I don't see a real
> > problem.  As long as we always include ap_config.h before we include
> > httpd.h, this is defined correctly.  This may not work for external
> > modules like php that may try to use thid definition.  I need to look into
> > this still.  I am about to commit code to fix this so that AP_USE_HSREGEX
> > is defined correctly on all platforms.
> 
> Is there a problem with the solution I sent out last week?
> 
> All our regex functions should be ap_ wrapped, hence always exported
> by Apache, so we won't need an AP_USE_HSREGEX in the first place.

That adds a maintenance burden on us when we need to integrate patches or
updates from the original distribution.

(okay, maybe it doesn't apply to hsregex... I don't think I've seen a
 checkin there in the year I've been watching :-)


As a general policy, I don't think we should be altering our bundled libs
if we can avoid it. Keep it minimal...

Re: ap_config.h. I'm with Ben. If httpd.h needs it, then I think it should
include it. If httpd.h *can't* include it, then why? I'm presuming because
it has conflicting symbols that third party modules might not want. But if
they can't include it, then httpd.h will be incorrect (by definition).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Manoj Kasichainula <ma...@io.com>.
On Fri, Jan 28, 2000 at 12:46:32PM -0500, rbb@apache.org wrote:
> Okay, I've looked into the whole HSREGEX issue now.  I don't see a real
> problem.  As long as we always include ap_config.h before we include
> httpd.h, this is defined correctly.  This may not work for external
> modules like php that may try to use thid definition.  I need to look into
> this still.  I am about to commit code to fix this so that AP_USE_HSREGEX
> is defined correctly on all platforms.

Is there a problem with the solution I sent out last week?

All our regex functions should be ap_ wrapped, hence always exported
by Apache, so we won't need an AP_USE_HSREGEX in the first place.


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by rb...@apache.org.
Okay, I've looked into the whole HSREGEX issue now.  I don't see a real
problem.  As long as we always include ap_config.h before we include
httpd.h, this is defined correctly.  This may not work for external
modules like php that may try to use thid definition.  I need to look into
this still.  I am about to commit code to fix this so that AP_USE_HSREGEX
is defined correctly on all platforms.

For Windows, we still just make this defintion in the hand-generated
configuration header file.

Ryan

On Sun, 23 Jan 2000, Brian Havard wrote:

> On Fri, 21 Jan 2000 10:32:37 -0500 (EST), rbb@apache.org wrote:
> 
> >httpd.h can not include any config header file because those header files
> >aren't public, but httpd.h is.  
> 
> Err, httpd.h contains:
> 
> /* Regexes */
> #ifdef AP_USE_HSREGEX
> #include "hsregex.h"
> #else
> #include <regex.h>
> #endif
> 
> but as far as I can see, AP_USE_HSREGEX is only defined in ap_config_auto.h
> I think someone's a bit confused (besides me that is).
> 
> Shouldn't --enable-hsregex be the default if no system regex is found?
> 
> -- 
>  ______________________________________________________________________________
>  |  Brian Havard                 |  "He is not the messiah!                   |
>  |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
>  ------------------------------------------------------------------------------
> 
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------



Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Fri, 21 Jan 2000 10:32:37 -0500 (EST), rbb@apache.org wrote:

>httpd.h can not include any config header file because those header files
>aren't public, but httpd.h is.  

Err, httpd.h contains:

/* Regexes */
#ifdef AP_USE_HSREGEX
#include "hsregex.h"
#else
#include <regex.h>
#endif

but as far as I can see, AP_USE_HSREGEX is only defined in ap_config_auto.h
I think someone's a bit confused (besides me that is).

Shouldn't --enable-hsregex be the default if no system regex is found?

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: ap_ac_config.h, os.h & ap_config_auto*.h

Posted by rb...@apache.org.
Okay, here's the rundown.

ap_config.h is basically a wrapper that will go away in time, it includes
ap_ac_config.h.  In time, this will become ap_ac_config.h, but we are
waiting until things become a bit more stable with the configuration.

ap_ac_config.h is a hand-written configuration header that basically
generates most of the Apache macros.  Anything that we need to define by
hand goes in this header.  This header includes ap_config_auto.h.

ap_config_auto.h is the autoconf generated header file.  We have no
control over this header file.  The ap_config_auto.h.in file is generated
for us, as is the ap_config_auto.h file.  This information is generated
based on what tests are used in the configure step.

httpd.h can not include any config header file because those header files
aren't public, but httpd.h is.  Every module out there include httpd.h, if
httpd.h includes any of the config headers, then the macros defined by
those headers become public knowledge, and we have macro collision.
Consider PHP, PHP uses autoconf, and checks for the crypt function.
Therefore, HAVE_CRYPT is defined for PHP.  Apache makes the same check,
and this macor is defined in ap_config_auto.h.  If httpd includes ANY of
the header files, then Apache's HAVE_CRYPT will be defined when PHP tries
to include httpd.h, and we get collision.

httpd.h does not need any information from the configuration headers.  I
know this because it currently works on Linux, where httpd isn't including
any config header file.  What Windows needs to do, is create
ap_config_win32.h, which mimics ap_config_auto.h almost exactly, only the
values are correct for Win32 platforms.

If this isn't clear, I would be more than happy to answer any left over
questions.

Ryan

On Fri, 21 Jan 2000, Bill Stoddard wrote:

> There appears to be a lot of overlap in the purpose of each of these config
> files and I don't grok where we are going. On Windows, os.h contains a lot
> of stuff that could go into a new file, ap_config_auto_windows.h. Or we
> could just leave platform specific defines in os.h for platforms that do not
> support autoconf.  I think I prefer the former.
> 
> Ryan, you mentioned that httpd.h could no longer include ap_config.h.  Why?
> Is there a problem with including ap_config_auto*.h in httpd.h? Some of the
> defines are required by httpd.h.
> 
> Bill
> 
> ________________________________________________
> Bill Stoddard stoddard@raleigh.ibm.com
> 
> Come to the first official Apache Software Foundation
> Conference!  <http://ApacheCon.Com/>
> 
> 
> 
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------