On Tue, 29 Jul 2003, Stas Bekman wrote:

> Randy Kobes wrote:
> [...]
> > I'll take a look at this tonight as well - it'd probably
> > be easier to change, for Win32, the assumption of the
> > name of the httpd binary when apxs is present.
>
> Thanks Randy!

Thanks for looking this over, Stas - I know you're really busy
right now ... I've attached a diff incorporating the earlier
suggestions - this one also has an additional fix to adjust the
file names to be cleaned on Win32, which are different.

As far getting the right name for the Win32 binary goes with apxs
present, I don't think there's an ideal solution ... To
summarize, the problem is that apxs -q TARGET ( = httpd) is used
in Apache-Test for the name of the apache binary, whereas in
other places (in apxs itself, for example) it's used to represent
"httpd".conf. What I ended up doing here is following the
Apache-Test convention of setting $vars->{target} to Apache.exe
for Win32 - this means overwriting the apxs value, which isn't
great, but I guess as long as the same convention is followed
throughout the package, it should be OK.

-- 
best regards,
randy
? s.diff
? s.txt
Index: TestConfig.pm
===================================================================
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.166
diff -u -r1.166 TestConfig.pm
--- TestConfig.pm       29 Jul 2003 15:19:24 -0000      1.166
+++ TestConfig.pm       30 Jul 2003 02:50:32 -0000
@@ -283,7 +283,7 @@
     $self->{APXS} = $self->default_apxs;
 
     return unless $self->{APXS};
-
+    $self->{APXS} =~ s {/}{\\}g if WIN32;
     my $vars = $self->{vars};
 
     $vars->{bindir}   ||= $self->apxs('BINDIR', 1);
@@ -300,7 +300,8 @@
     my $self = shift;
     my $vars = $self->{vars};
 
-    $vars->{target} ||= (WIN32 ? 'Apache.exe' : 'httpd');
+    $vars->{target} ||= 'httpd';
+    $vars->{target} = 'Apache.exe' if WIN32;
 
     unless ($vars->{httpd}) {
         #sbindir should be bin/ with the default layout
Index: TestConfigC.pm
===================================================================
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigC.pm,v
retrieving revision 1.20
diff -u -r1.20 TestConfigC.pm
--- TestConfigC.pm      31 Mar 2003 06:58:40 -0000      1.20
+++ TestConfigC.pm      30 Jul 2003 02:50:32 -0000
@@ -9,6 +9,8 @@
 use Apache::TestTrace;
 use File::Find qw(finddepth);
 
+use constant WIN32 => Apache::TestConfig::WIN32;
+
 sub cmodule_find {
     my($self, $mod) = @_;
 
@@ -76,7 +78,7 @@
 EOF
 }
 
-my %lib_dir = (1 => "", 2 => ".libs/");
+my %lib_dir = WIN32 ? (1 => "", 2 => "") : (1 => "", 2 => ".libs/");
 
 sub cmodules_build_so {
     my($self, $name) = @_;
@@ -135,6 +137,11 @@
 
     my $lib = $self->cmodules_build_so($name);
 
+    my $extras = WIN32 ? ' -llibhttpd -p ' : '';
+    my $rm = WIN32 ? '@erase' : 'rm -rf';
+    my $goners = join ' ', ( map {$name . '.' . $_}
+        (WIN32 ? qw(exp lib so lo) : qw(o lo slo la)) );
+
     my $fh = Symbol::gensym();
     open $fh, ">$makefile" or die "open $makefile: $!";
 
@@ -143,10 +150,10 @@
 all: $lib
 
 $lib: $name.c
-       \$(APXS) $dversion -I$self->{cmodules_dir} -c $name.c
+       \$(APXS) $dversion -I$self->{cmodules_dir} $extras -c $name.c
 
 clean:
-       -rm -rf $name.o $name.lo $name.slo $name.la .libs
+       -$rm $goners .libs
 EOF
 
     close $fh or die "close $makefile: $!";

Reply via email to