Graham Dumpleton wrote:

On 20/04/2006, at 12:39 AM, Jim Gallacher wrote:

[EMAIL PROTECTED] wrote:

Author: grahamd
Date: Sun Apr 16 03:49:39 2006
New Revision: 394455

> URL: http://svn.apache.org/viewcvs?rev=394455&view=rev

+1 Debian Sid, apache 2.2.0, python 2.4.2

-1 Debian Sid, apache 2.0.55, python 2.3.5

Compilation fails with this output:

make[1]: Entering directory `/tmp/mod_python/src'

Compiling for DSO.

/usr/bin/apxs2 -I/tmp/mod_python/src/include -I/usr/include/apache2 -I/usr/include/python2.3 -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c hlistobject.c -L/usr/lib/python2.3/config -Xlinker -export-dynamic -lm -lpython2.3 -lpthread -ldl -lutil -lm /usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread -I/usr/include/apache2 -I/usr/include/apr-0 -I/usr/include/apr-0 -I/usr/include -I/tmp/mod_python/src/include -I/usr/include/apache2 -I/usr/include/python2.3 -c -o mod_python.lo mod_python.c && touch mod_python.slo
In file included from mod_python.c:28:
/tmp/mod_python/src/include/mod_python.h:65: error: syntax error before 'ap_regex_t' /tmp/mod_python/src/include/mod_python.h:65: warning: useless type name in empty declaration
In file included from mod_python.c:28:
/tmp/mod_python/src/include/mod_python.h:66:1: warning: "AP_REG_EXTENDED" redefined


The AP_REG_EXTENDED macro shouldn't exist in Apache 2.0.55. It, along
with ap_regex_t only came along in Apache 2.1.? sometime.

The code in mod_python.h which tries to accommodate the change is:

#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
typedef regex_t ap_regex_t;
#define AP_REG_EXTENDED REG_EXTENDED
#define AP_REG_ICASE REG_ICASE
#endif

The regex_t type comes from pcreposix.h which is include by httpd.h
which is included in mod_python.h prior to this point.

Either how I am using AP_MODULE_MAGIC_AT_LEAST is wrong, of you must be
picking up a wrong header file somehow.

Bar ensuring you did a make distclean between builds, not sure what
else to suggest.

Strange.

It's not strange, it's Debian!

The apache shipped with debian is heavily patched, including a backport of apache/include/ap_regex.h and removal of apache/include/pcreposix.h. As a result ap_regex_t, AP_REG_EXTENDED and AP_REG_ICASE are all defined, while regex_t, REG_EXTENDED and REG_ICASE are all missing. Hence my compilation error.

I don't know to what extent Debian-derived distributions such as Ubuntu use the stock Debian patches, but I wouldn't be suprised if we had compilation problems there as well. It's not too much of a stretch to think a similar patch may be applied in other distributions such as Redhat either.

If Nick (or should I say Ubuntu Nick to distiguish him from the other Nicks hanging around here?) has a free minute perhaps he could try compiling svn trunk to see what happens.

I'm not sure about the most elegant way to handle this situation. Perhaps something like:

#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
#ifndef(AP_REG_EXTENDED)
typedef regex_t ap_regex_t;
#define AP_REG_EXTENDED REG_EXTENDED
#define AP_REG_ICASE REG_ICASE
#endif
#endif

Or maybe just skip the use of AP_MODULE_MAGIC_AT_LEAST entirely in this case and depend on the #ifndef?

Jim

Reply via email to