You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Randy Kobes <ra...@theoryx5.uwinnipeg.ca> on 2001/12/20 22:56:14 UTC

modperl-2 tests on Win32

Hi,
      Running the modperl-2 tests on Win32 runs into
problems of not finding things in @INC. I think this is
because when @INC is set in the add_inc sub of
Apache-Test/lib/Apache/TestConfig.pm, the "lib.pm" that's
being picked up is not Perl's system lib.pm but rather
mod_perl's Lib.pm in blib/lib (Win32 filenames aren't
case sensitive). I'm not sure the best way to handle this,
but this diff:

****************************************************************
Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file:
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.
pm,v
retrieving revision 1.116
diff -u -r1.116 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm 2001/12/20 17:30:54 1.116
+++ Apache-Test/lib/Apache/TestConfig.pm 2001/12/20 21:53:30
@@ -1173,6 +1173,7 @@

 sub add_inc {
     my $self = shift;
+    delete $INC{'lib.pm'} if ($INC{'lib.pm'} and $INC{'lib.pm'} =~
/^blib/);
     require lib;
     # make sure that the Apache-Test dev libs will be first in @INC,
     # followed by modperl's lib, followed by blib and finally core

****************************************************************
seems to work.

As well, the Win98 "shell" doesn't like the syntax
     do_something > to_somewhere && do_something_else
This is used in building libmodperl. This diff:

****************************************************************
Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.75
diff -u -r1.75 Build.pm
--- lib/Apache/Build.pm 2001/12/05 02:22:24 1.75
+++ lib/Apache/Build.pm 2001/12/20 21:44:58
@@ -892,8 +892,8 @@
 .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s

 .c.lo:
- $(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) \
- -c $< && $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
+        $(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) -c $<
+        $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo

 .c$(MODPERL_OBJ_EXT):
  $(MODPERL_CC) $(MODPERL_CCFLAGS) -c $<

****************************************************************
lets things compile on Win98. I know it's not equivalent ...

best regards,
randy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: modperl-2 tests on Win32

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 21 Dec 2001, Doug MacEachern wrote:

> ah, that makes sense.  i don't really like the name APR::Lib anyhow,
> thinking changing it to APR::Util would be the right thing todo.
> because even if we fixup the test %INC, Lib.pm would still get installed
> in the wrong place.

OK, that's great ... It's actually nice that the problem with
%INC was so simple, and remembering to delete the blib/lib/Lib.pm
is no problem until that change comes about ...

> i was suggesting we change the '&&' to ';', does that not work either?

Sorry, I forgot to mention that - ';' is used as a directory separator
in PATH. I'm not sure what, if anything, DOS uses to separate
commands on the same line ... But even if there was something,
I think it would still get confused with the arguments passed
to the command, and try to incorporate that character as part
of the command ... The DOS shell is really pretty awful ...

best regards,
randy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: modperl-2 tests on Win32

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 21 Dec 2001, Randy Kobes wrote:
 
> There is a blib/lib/Lib.pm, which is identical to
> blib/lib/APR/Lib.pm. I think what's happened is that the
> Makefile.PL in WrapXS/APR/ sees a 'Lib' subdirectory, and,
> ignoring the case, treats it like a 'lib' subdirectory and
> dutifully copies the files in WrapXS/APR/Lib to blib/lib. I
> wasn't aware before that these shouldn't be copied there .. I
> guess one solution is to write a MY::libscan to prevent this?

ah, that makes sense.  i don't really like the name APR::Lib anyhow,
thinking changing it to APR::Util would be the right thing todo.
because even if we fixup the test %INC, Lib.pm would still get installed
in the wrong place.
 
> This would be neat, but I think Win9? is still too dumb
> to understand this ... The '&&' does work for simple
> things like
>     cd .. && dir
> but the problem with the above in the Makefile is that it treats
> the '&&' as a source file argument to 'cl'. It may be possible to

i was suggesting we change the '&&' to ';', does that not work either?

> Just for future reference, on Win32 $^O is 'MSWin32'; to tell the
> difference between Win9? and NT one can use Win32::IsWin95()
> [true for Win9?] and Win32::IsWinNT() [true for NT and 2K],
> which come with the Win32 module.

ok, thanks.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: modperl-2 tests on Win32

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Thu, 20 Dec 2001, Doug MacEachern wrote:

> On Thu, 20 Dec 2001, Randy Kobes wrote:
>
> > Hi,
> >       Running the modperl-2 tests on Win32 runs into
> > problems of not finding things in @INC. I think this is
> > because when @INC is set in the add_inc sub of
> > Apache-Test/lib/Apache/TestConfig.pm, the "lib.pm" that's
> > being picked up is not Perl's system lib.pm but rather
> > mod_perl's Lib.pm in blib/lib (Win32 filenames aren't
> > case sensitive). I'm not sure the best way to handle this,
> > but this diff:
>
> hmm, there shouldn't be a blib/lib/Lib.pm
> can you see exactly what that is?  there should be a blib/lib/APR/Lib.pm

There is a blib/lib/Lib.pm, which is identical to
blib/lib/APR/Lib.pm. I think what's happened is that the
Makefile.PL in WrapXS/APR/ sees a 'Lib' subdirectory, and,
ignoring the case, treats it like a 'lib' subdirectory and
dutifully copies the files in WrapXS/APR/Lib to blib/lib. I
wasn't aware before that these shouldn't be copied there .. I
guess one solution is to write a MY::libscan to prevent this?

>
> > As well, the Win98 "shell" doesn't like the syntax
> >      do_something > to_somewhere && do_something_else
> > This is used in building libmodperl. This diff:
>
> wonder if we could do something like below, and make '&&' be ';' if $^O is
> win98?  what is the value of $^O for Win98?
>
> Index: lib/Apache/Build.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
> retrieving revision 1.75
> diff -u -r1.75 Build.pm
> --- lib/Apache/Build.pm	2001/12/05 02:22:24	1.75
> +++ lib/Apache/Build.pm	2001/12/21 01:56:09
> @@ -870,6 +870,8 @@
>                                           $self->apxs(-q => $q));
>      }
>
> +    print $fh $self->canon_make_attr(sh_and => '&&');
> +
>      my $xs_targ = $self->make_xs($fh);
>
>      print $fh <<'EOF';
> @@ -893,7 +895,7 @@
>
>  .c.lo:
>  	$(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) \
> -	-c $< && $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
> +	-c $< $(MODPERL_SH_AND) $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
>
>  .c$(MODPERL_OBJ_EXT):
>  	$(MODPERL_CC) $(MODPERL_CCFLAGS) -c $<
>
>

This would be neat, but I think Win9? is still too dumb
to understand this ... The '&&' does work for simple
things like
    cd .. && dir
but the problem with the above in the Makefile is that it treats
the '&&' as a source file argument to 'cl'. It may be possible to
get around this with quoting the arguments, but I haven't found
the right combination that works, and chances are it would break
Unix ... This isn't terribly important now, as it's just for
Win9? (actually, I'm not sure about XP) - it's fine as is on NT
and Win2K.

Just for future reference, on Win32 $^O is 'MSWin32'; to tell the
difference between Win9? and NT one can use Win32::IsWin95()
[true for Win9?] and Win32::IsWinNT() [true for NT and 2K],
which come with the Win32 module.

best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: modperl-2 tests on Win32

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 20 Dec 2001, Randy Kobes wrote:

> Hi,
>       Running the modperl-2 tests on Win32 runs into
> problems of not finding things in @INC. I think this is
> because when @INC is set in the add_inc sub of
> Apache-Test/lib/Apache/TestConfig.pm, the "lib.pm" that's
> being picked up is not Perl's system lib.pm but rather
> mod_perl's Lib.pm in blib/lib (Win32 filenames aren't
> case sensitive). I'm not sure the best way to handle this,
> but this diff:

hmm, there shouldn't be a blib/lib/Lib.pm
can you see exactly what that is?  there should be a blib/lib/APR/Lib.pm
 
> As well, the Win98 "shell" doesn't like the syntax
>      do_something > to_somewhere && do_something_else
> This is used in building libmodperl. This diff:

wonder if we could do something like below, and make '&&' be ';' if $^O is
win98?  what is the value of $^O for Win98?

Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.75
diff -u -r1.75 Build.pm
--- lib/Apache/Build.pm	2001/12/05 02:22:24	1.75
+++ lib/Apache/Build.pm	2001/12/21 01:56:09
@@ -870,6 +870,8 @@
                                          $self->apxs(-q => $q));
     }
 
+    print $fh $self->canon_make_attr(sh_and => '&&');
+
     my $xs_targ = $self->make_xs($fh);
 
     print $fh <<'EOF';
@@ -893,7 +895,7 @@
 
 .c.lo:
 	$(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) \
-	-c $< && $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
+	-c $< $(MODPERL_SH_AND) $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
 
 .c$(MODPERL_OBJ_EXT):
 	$(MODPERL_CC) $(MODPERL_CCFLAGS) -c $<


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org