randyk 2003/11/05 00:29:17
Modified: . Makefile.PL xs/APR/APR Makefile.PL Log: Reviewed by: stas For Win32, (apr|apu)-config needs a .bat extension for the -x test in looking for the existence of the apr libraries. Revision Changes Path 1.128 +2 -1 modperl-2.0/Makefile.PL Index: Makefile.PL =================================================================== RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.127 retrieving revision 1.128 diff -u -r1.127 -r1.128 --- Makefile.PL 4 Nov 2003 20:27:22 -0000 1.127 +++ Makefile.PL 5 Nov 2003 08:29:17 -0000 1.128 @@ -95,8 +95,9 @@ # overrides any local definition, not sure what's the right fix, for # now just define it here (should it define PASTHRU_DEFINE instead?) if (my $apr_bindir = $build->apr_bindir()) { + my $ext = WIN32 ? '.bat' : ''; my @apr_libs = grep $_, map { -x $_ && qx{$_ --link-ld} } - map { qq{$apr_bindir/$_-config} } qw(apr apu); + map { qq{$apr_bindir/$_-config$ext} } qw(apr apu); $opt_define = '-DMP_HAVE_APR_LIBS' if @apr_libs; } 1.18 +10 -2 modperl-2.0/xs/APR/APR/Makefile.PL Index: Makefile.PL =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Makefile.PL 22 Aug 2003 19:16:50 -0000 1.17 +++ Makefile.PL 5 Nov 2003 08:29:17 -0000 1.18 @@ -3,18 +3,26 @@ use lib qw(../lib); use ModPerl::BuildMM (); +use Apache::Build (); use Config; +use constant WIN32 => Apache::Build::WIN32; + my $libs = ''; if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) { - # XXX: this works only with libapr 0.9.2+ (not on win32) + # XXX: this works only with libapr 0.9.2+ + my $ext = WIN32 ? '.bat' : ''; my @libs = grep $_, map { -x $_ && qx{$_ --link-ld --libs} } - map { qq{$apr_bindir/$_-config} } qw(apr apu); + map { qq{$apr_bindir/$_-config$ext} } qw(apr apu); chomp @libs; $libs = join ' ', @libs; } +if (WIN32) { + $libs =~ s{/libpath:}{-L}g; + $libs =~ s{(\w+)\.lib}{-l$1}g; +} ModPerl::BuildMM::WriteMakefile( 'NAME' => 'APR',