>
>Thanks Nick. Committed with a few minor tweaks.
>
The following patch fixes the linking of Apache2:: and ModPerl:: extensions on
Cygwin, when building a static mod_perl.a.
Some notes on the patch:
We have to link Apache2::* and ModPerl::* to mod_perl.a and DynaLoader.a,
but -lmod_perl and -lDynaLoader don't work, and we can't supply the full paths,
because MakeMaker doesn't allow this. I workaround this by making a symlink to
mod_perl.a (called libmod_perl.a) and copy DynaLoader.a to libDynaLoader.a (I
don't create a symlink, because, when running make clean, the real DynaLoader.a
may get deleted).
The APR::* extensions are not affected, because in both cases we link them
against aprext.
Also other small fixes are added.
Note: This path still doesn't fix the dynamic build on Cygwin.
Index: lib/Apache2/Build.pm
===================================================================
--- lib/Apache2/Build.pm (revision 167901)
+++ lib/Apache2/Build.pm (working copy)
@@ -1059,6 +1059,10 @@
for ($self->apu_config_path, $self->apr_config_path) {
if (my $link = $_ && -x $_ && qx{$_ --link-ld --libs}) {
chomp $link;
+
+ # Change '/path/to/libanything.la' to '-L/path/to -lanything'
+ $link =~ s|(\S*)/lib([^.\s]+)\.\S+|-L$1 -l$2|g;
+
if ($self->httpd_is_source_tree) {
my @libs;
while ($link =~ m/-L(\S+)/g) {
@@ -1546,7 +1550,8 @@
sub modperl_libs_cygwin {
my $self = shift;
- "-L$self->{cwd}/src/modules/perl -l$self->{MP_LIBNAME}";
+ return "-L$self->{cwd}/src/modules/perl -l$self->{MP_LIBNAME}" if
$self->is_dynamic;
+ $self->modperl_static_libs_cygwin;
}
sub modperl_libs {
@@ -1556,7 +1561,31 @@
$libs->($self);
}
-# returns the directory and name of the aprext lib built under blib/
+my $modperl_static_libs_cygwin = '';
+sub modperl_static_libs_cygwin {
+ my $self = shift;
+
+ return $modperl_static_libs_cygwin if $modperl_static_libs_cygwin;
+
+ my $dyna_filepath = $self->perl_config('archlibexp') .
'/auto/DynaLoader/DynaLoader.a';
+ my $modperl_path = "$self->{cwd}/src/modules/perl";
+ # Create symlink to mod_perl.a, but copy DynaLoader.a, because when
running make clean
+ # the real DynaLoader.a may get deleted.
+ qx{ln -s $modperl_path/$self->{MP_LIBNAME}.a
$modperl_path/lib$self->{MP_LIBNAME}.a};
+ qx{cp $dyna_filepath $modperl_path/libDynaLoader.a};
+
+ $modperl_static_libs_cygwin = join ' ',
+ "-L$modperl_path",
+ "-l$self->{MP_LIBNAME}",
+ '-lDynaLoader',
+ $self->apru_link_flags,
+ '-L' . catdir($self->perl_config('archlibexp'), 'CORE'),
+ '-lperl';
+
+ $modperl_static_libs_cygwin;
+}
+
+# returns the directory and name of the aprext lib built under blib/
sub mp_apr_blib {
my $self = shift;
return unless (my $mp_apr_lib = $self->{MP_APR_LIB});
@@ -1831,7 +1860,7 @@
my $flags = $self->otherldflags_default;
unless ($self->{MP_STATIC_EXTS}) {
- $flags .= join ' ', $self->apru_link_flags;
+ $flags .= join ' ', '', $self->apru_link_flags;
}
$flags;
-----------------------------------------------------------------
http://host.GBG.bg - лидер в Уеб Хостинг решения и регистрация на Домейн имена
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]