On Mon, 28 Jun 2004, Stas Bekman wrote:
> [EMAIL PROTECTED] wrote:
> [...]
> > 1.1 modperl-2.0/xs/APR/aprext/Makefile.PL
> >
> > Index: Makefile.PL
> > ===================================================================
> > use strict;
> > use warnings;
> >
> > use lib qw(../lib);
> > use ModPerl::BuildMM ();
> > use Apache::Build ();
> >
> > my $srcdir = '../../../src/modules/perl';
> > my @names = map { "modperl_$_" } (qw(error bucket),
> > map { "common_$_" } qw(util log));
>
> ./xs/APR/aprext/Makefile.PL: map { "common_$_" } qw(util log));
> ./xs/APR/APR/Makefile.PL: map { "common_$_" } qw(util log));
>
> Now we have two places where there is the same code, and
> chances are that we will not remember to update one, when
> fixing the other (since aprext is needed for win32 only).
> Therefore we need to abstract that into a function, so
> there is only one source to change (somewhere under
> modperl-2.0/lib/, most likely lib/ModPerl/Code.pm is the
> best fit).
Good idea - how about the following, which defines
src_apr_ext() in ModPerl::Code to return the needed files:
==========================================================
Index: lib/ModPerl/Code.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
retrieving revision 1.123
diff -u -r1.123 Code.pm
--- lib/ModPerl/Code.pm 16 Jun 2004 03:55:47 -0000 1.123
+++ lib/ModPerl/Code.pm 27 Jun 2004 22:33:47 -0000
@@ -1085,6 +1085,13 @@
}
}
+# src/modules/perl/*.c files needed to build APR/APR::* outside
+# of mod_perl.so
+sub src_apr_ext {
+ return map { "modperl_$_" } (qw(error bucket),
+ map { "common_$_" } qw(util log));
+}
+
1;
__END__
Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.22
diff -u -r1.22 Makefile.PL
--- xs/APR/APR/Makefile.PL 26 Jun 2004 19:41:54 -0000 1.22
+++ xs/APR/APR/Makefile.PL 27 Jun 2004 22:33:47 -0000
@@ -3,6 +3,7 @@
use lib qw(../lib);
use ModPerl::BuildMM ();
+require ModPerl::Code;
use Apache::Build ();
use Config;
use File::Spec::Functions;
@@ -62,8 +63,8 @@
# link the following into APR.so so other APR:: modules can be used
# outside of httpd
-my @names = map { "modperl_$_" } (qw(error bucket),
- map { "common_$_" } qw(util log));
+my @names = ModPerl::Code::src_apr_ext();
+
my(@obj, @clean, %src);
for (@names) {
push @obj, join '.', $_, 'o';
Index: xs/APR/aprext/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/aprext/Makefile.PL,v
retrieving revision 1.1
diff -u -r1.1 Makefile.PL
--- xs/APR/aprext/Makefile.PL 26 Jun 2004 19:41:54 -0000 1.1
+++ xs/APR/aprext/Makefile.PL 27 Jun 2004 22:33:47 -0000
@@ -3,11 +3,12 @@
use lib qw(../lib);
use ModPerl::BuildMM ();
+require ModPerl::Code;
use Apache::Build ();
my $srcdir = '../../../src/modules/perl';
-my @names = map { "modperl_$_" } (qw(error bucket),
- map { "common_$_" } qw(util log));
+my @names = ModPerl::Code::src_apr_ext();
+
my(@obj, @clean, %src);
for (@names) {
push @obj, join '.', $_, 'o';
====================================================================
--
best regards,
randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]