On 06/05/2012 02:21 AM, Kevin A. McGrail wrote:
On 6/4/2012 7:46 AM, Jan Kaluža wrote:
On 05/09/2012 09:40 AM, Jan Kaluža wrote:
Right, those patches only hardcodes it for httpd-2.4. The next step
should be to probably put #ifdefs around remote_ip. Other things should
be done by source_scan script I believe.
I've splitted the patch into separate patches. This is against
mod_perl-2.0.6. With those patches, mod_perl compiles against
httpd-2.2 and also against httpd-2.4. It's based on the Stefan's work.
http://jkaluza.fedorapeople.org/mod_perl/
I can't repeat your success because I can't compile against 2.4.
The files you are editing below are generated automatically using
following commands:
make source_scan
make xs_generate
If you run those before compilation, it will regenerate the files you've
edited manually according to current httpd-2.4 headers.
This is part of spec file (file used to prepare .rpm packages)
describing how I build mod_perl against httpd-2.4:
CFLAGS="$RPM_OPT_FLAGS -fpic" %{__perl} Makefile.PL </dev/null \
PREFIX=$RPM_BUILD_ROOT/%{_prefix} \
INSTALLDIRS=vendor \
MP_APXS=%{_httpd_apxs} \
MP_APR_CONFIG=%{_bindir}/apr-1-config
make source_scan
make xs_generate
CFLAGS="$RPM_OPT_FLAGS -fpic" %{__perl} Makefile.PL </dev/null \
PREFIX=$RPM_BUILD_ROOT/%{_prefix} \
INSTALLDIRS=vendor \
MP_APXS=%{_httpd_apxs} \
MP_APR_CONFIG=%{_bindir}/apr-1-config
make -C src/modules/perl %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS -fpic"
make
Those configuration variables I pass to Makefile.PL can be skipped
probably. They are there just to find everything properly during the
building and install everything into proper directories to be used later
during packaging.
Specifically, Compiling against Apache 2.4.1 from source, I've tried the
mod_perl 2.0.6 release with these patches on a CentOS 6.2 x64 system
with a little bit of trouble.
Your patches apply cleanly but I throw this error trying to make based
on the following config command: perl Makefile.PL
MP_APXS=/usr/local/apache2/bin/apxs
MP_APR_CONFIG=/usr/local/apache2/bin/apr-1-config
modperl_constants.c: In function 'modperl_constants_lookup_apache2_const':
modperl_constants.c:809: error: 'OPT_INCNOEXEC' undeclared (first use in
this function)
modperl_constants.c:809: error: (Each undeclared identifier is reported
only once
modperl_constants.c:809: error: for each function it appears in.)
make[1]: *** [modperl_constants.lo] Error 1
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/src/modules/perl'
make: *** [modperl_lib] Error 2
Looking at ./src/modules/perl/modperl_constants.c has two references to
OPT_INCNOEXEC.
This comes from ./xs/tables/current/Apache2/ConstantsTable.pm referring
to OPT_INCNOEXEC. If I remove that entry I get a lot further until I get
to this error:
Connection.xs: In function 'XS_Apache2__Connection_remote_addr':
Connection.xs:117: error: 'conn_rec' has no member named 'remote_addr'
Connection.xs: In function 'XS_Apache2__Connection_remote_ip':
Connection.xs:134: error: 'conn_rec' has no member named 'remote_ip'
Connection.xs:138: error: 'conn_rec' has no member named 'remote_ip'
make[3]: *** [Connection.o] Error 1
make[3]: Leaving directory
`/usr/src/mod_perl-2.0.6/WrapXS/Apache2/Connection'
make[2]: *** [subdirs] Error 2
make[2]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS'
make: *** [subdirs] Error 2
To fix those, I edited apache2_structures.map & StructureTable.pm to
change remote_addr and remote_ip to client_addr and client_ip
That got me to:
ServerRec.xs: In function 'XS_Apache2__ServerRec_loglevel':
ServerRec.xs:160: error: 'server_rec' has no member named 'loglevel'
ServerRec.xs:164: error: 'server_rec' has no member named 'loglevel'
make[3]: *** [ServerRec.o] Error 1
make[3]: Leaving directory
`/usr/src/mod_perl-2.0.6/WrapXS/Apache2/ServerRec'
make[2]: *** [subdirs] Error 2
make[2]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS'
make: *** [subdirs] Error 2
To fix that, I changed the /xs/tables/current/Apache2/StructureTable.pm
to point to log.level instead of loglevel.
That got me compiled. A make test fails pretty badly though so not sure
what state tests are in.
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /usr/src/mod_perl-2.0.6/t/TEST
-bugreport -verbose=0
/usr/local/apache2/bin/httpd -d /usr/src/mod_perl-2.0.6/t -f
/usr/src/mod_perl-2.0.6/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.4.1 (event MPM)
waiting 300 seconds for server to start: .[Mon Jun 04 20:00:02.886169
2012] [env:warn] [pid 2704:tid 139952181413632] AH01506: PassEnv
variable LD_LIBRARY_PATH was undefined
[ error] oh crap, server dumped core
[ error] for stacktrace, run: gdb /usr/local/apache2/bin/httpd -core
/usr/src/mod_perl-2.0.6/core.2704
[ error]
server has died with status 255 (t/logs/error_log wasn't created, start
the server in the debug mode)
[ error] oh jeez, server dumped core
[ error] for stacktrace, run: gdb /usr/local/apache2/bin/httpd -core
/usr/src/mod_perl-2.0.6/core.2704
sh: line 1: 2599 Terminated /usr/bin/perl /usr/src/mod_perl-2.0.6/t/TEST
-bugreport -verbose=0
make: *** [run_tests] Error 143
Patch with the extra changes I needed are attached. Perhaps it can help.
If someone can give me direction I can perform more testing, etc.
regards,
KAM
Regards,
Jan Kaluza
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org