You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by ra...@bellglobal.com on 1997/10/14 18:37:20 UTC

include in conf.h?

httpd.h includes conf.h which in turn does a #include <regex.h>

When compiling with WANTHSREGEX=yes, this is a problem.

It is a bit of a chicken-and-egg problem.  When compiling a standalone
module, the module needs to include httpd.h.  The WANTHSREGEX setting is
not determined until the Apache Configure script is run.  httpd.h is not
affected by this.  So, it isn't really possible to know which regex.h to
include in httpd.h/conf.h.  The solution is probably to move things around
a little bit such that the regex.h include is not tied to httpd.h in any
way.

-Rasmus

Re: include in conf.h?

Posted by ra...@bellglobal.com.
> Why don't you just declare WANTHSREGEX=yes for all php stuff?  Like
> Alexei, I wonder why we ever bothered using the system regex.  You'll note
> I didn't bother using the system fnmatch when I stuffed that in.

Oh, I do that.  But when I build my libphp.a and include httpd.h in the
process, the #include <regex.h> is troublesome.  I can't really build
all of PHP under a src/modules directory.  It is just too big and complex to
slide in nicely.  The PHP module has more lines of code than Apache plus
all the bundled modules combined.

I am copying a library file plus a small stub mod_php.c file to the
src/modules/extra directory and building from there.  My double-inclusion
hack solves the problem for the time being, so no worries.

-Rasmus 

Re: include in conf.h?

Posted by Dean Gaudet <dg...@arctic.org>.

On Tue, 14 Oct 1997 rasmus@bellglobal.com wrote:

> > Um... why? I don't understand. <regex.h> should point to whichever
> > regex package you have selected in your Configuration; Apache's or
> > your system's. Unless it's broken again.
> 
> It is really bad form to have <regex.h> point to anything other than the
> /usr/include version.  If you want to include a local regex.h you should
> be using "path/regex.h".  

<> is supposed to search -I paths as well.  If it doesn't on some
compilers then all #include <regex.h>s need to be changed to "regex.h". 

You can't build anything without running Configure first.  Configure sets
up all the -I paths ... 

> If httpd.h is not valid until after ./Configure has been run, then ./Configure
> should be generating it.  And, if it isn't valid until after Configure has
> been run, then how the heck do we build a module?  The module itself may 
> need to modify the Configuration file and in so doing will need
> Configure to be run again which may change the WANTHSREGEX setting.

Modules are supposed to be put underneath src/modules somewhere, which
gets run during the build process.  If you need to configure the module
separately you do have the opportunity during the configure process ... or
you can have a separate stage which also has to be run before compiling
everything.

Make sure you look at my most recent changes to the Makefiles/Configure. 
In particular look at the new proxy subdirectory.  The -I paths are all
inherited properly now.  Including regex when it's in use.

Why don't you just declare WANTHSREGEX=yes for all php stuff?  Like
Alexei, I wonder why we ever bothered using the system regex.  You'll note
I didn't bother using the system fnmatch when I stuffed that in.

Dean


Re: include in conf.h?

Posted by ra...@bellglobal.com.
> Um... why? I don't understand. <regex.h> should point to whichever
> regex package you have selected in your Configuration; Apache's or
> your system's. Unless it's broken again.

It is really bad form to have <regex.h> point to anything other than the
/usr/include version.  If you want to include a local regex.h you should
be using "path/regex.h".  

However, my real point was that there is no way to know which regex.h
library to include at this point since ./Configure has not been run yet.
At least not in my case where I am including httpd.h from a standalone
tree.  I currently have a kludge where I define _REGEX_H and _RX_H in my
own header files to prevent the system regex.h from being included by 
Apache.  This solves the problem for me, but I still think there is a basic
problem here.  

If httpd.h is not valid until after ./Configure has been run, then ./Configure
should be generating it.  And, if it isn't valid until after Configure has
been run, then how the heck do we build a module?  The module itself may 
need to modify the Configuration file and in so doing will need
Configure to be run again which may change the WANTHSREGEX setting.

I guess your point is that -I./regex following by a #include <regex.h> should
pick up the right header file at compile time.  This is not the case, at 
least not with my compiler.  -I./regex followed by #include "regex" will 
however find the right one.

-Rasmus

Re: include in conf.h?

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Tue, 14 Oct 1997 rasmus@bellglobal.com wrote:

> httpd.h includes conf.h which in turn does a #include <regex.h>
> 
> When compiling with WANTHSREGEX=yes, this is a problem.

Um... why? I don't understand. <regex.h> should point to whichever
regex package you have selected in your Configuration; Apache's or
your system's. Unless it's broken again.

Can someone explain to me again why we decided to not just use the
Spencer regex all the time? Wouldn't that have made life easier?

P.S. And we certainly can't get rid of <regex.h> from httpd.h, because
there are functions prototyped in httpd.h which use regexes. And
alloc.h, too. Because Apache uses them. All over the place. So you
can't get rid of them. I can't write complete sentances, apparently,
either.

-- Alexei Kosut <ak...@nueva.pvt.k12.ca.us>