From: Mike S. <log...@pe...> - 2003-05-13 18:05:30
|
On Tue, 13 May 2003, Mathieu Arnold wrote: > Well, finding them dinamically adds time when perl Makefile.PL, a static > list needs to be changed only when you add or delete modules. Unless you > often add and delete modules from it, I think it depends on what you > believe deeply in yourself of what "the right thing is". I do believe that > a static list is good enough. I'd rather avoid creating a maintenance trap for well-behaving perl versions. How about that: Index: Makefile.PL =================================================================== RCS file: /cvsroot/log4perl/Log-Log4perl/Makefile.PL,v retrieving revision 1.7 diff -a -u -r1.7 Makefile.PL --- Makefile.PL 27 Nov 2002 06:34:58 -0000 1.7 +++ Makefile.PL 13 May 2003 18:03:21 -0000 @@ -49,4 +49,35 @@ # Un-comment this if you add C files to link with later: # 'OBJECT' => '$(O_FILES)', # link all the C files too 'clean' => {FILES => "*.tar.gz *.ppd pod2htm*"}, + get_man3pods(), ); + +########################################## +sub get_man3pods { +########################################## + # Only done for 5.6.0, 5.005 etc. + return () if $] >= 5.0061; + + print <<EOT; +################################################## +# Detected buggy MakeMaker version, creating man # +# pages manually # +################################################## +EOT + require File::Find; + + my @pms = (); + + File::Find::find(sub { + push @pms, $File::Find::name if /\.pm$/ + }, "lib"); + + return('MAN3PODS', { + map { my @comps = split /\//, $_; + shift @comps; + my $csep = join '::', @comps; + $csep =~ s/\.pm$//; + ($_, "\$(INST_MAN3DIR)/$csep.\$(MAN3EXT)"); + } @pms + }); +} -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |
From: Mathieu A. <ma...@ma...> - 2003-05-13 18:44:51
|
--Le 13/05/2003 11:29 -0700, Mike Schilli =E9crivait : | On Tue, 13 May 2003, Mathieu Arnold wrote: |=20 |> Well, finding them dinamically adds time when perl Makefile.PL, a static |> list needs to be changed only when you add or delete modules. Unless you |> often add and delete modules from it, I think it depends on what you |> believe deeply in yourself of what "the right thing is". I do believe |> that a static list is good enough. |=20 | I'd rather avoid creating a maintenance trap for well-behaving perl | versions. How about that: Well, you'd rather do it for every perl version. If you really want to do it this way, no need to let MakeMaker do it afterwards. btw, perl 5.6.1 does not do it right, and it's version string is 5.006001, only 5.8.0 does it right. It looks good though. | Index: Makefile.PL | = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | RCS file: /cvsroot/log4perl/Log-Log4perl/Makefile.PL,v | retrieving revision 1.7 | diff -a -u -r1.7 Makefile.PL | --- Makefile.PL 27 Nov 2002 06:34:58 -0000 1.7 | +++ Makefile.PL 13 May 2003 18:03:21 -0000 | @@ -49,4 +49,35 @@ | # Un-comment this if you add C files to link with later: | # 'OBJECT' =3D> '$(O_FILES)', # link all the C files too | 'clean' =3D> {FILES =3D> "*.tar.gz *.ppd pod2htm*"}, | + get_man3pods(), | ); | + | +########################################## | +sub get_man3pods { | +########################################## | + # Only done for 5.6.0, 5.005 etc. | + return () if $] >=3D 5.0061; | + | + print <<EOT; | +################################################## | +# Detected buggy MakeMaker version, creating man # | +# pages manually # | +################################################## | +EOT | + require File::Find; | + | + my @pms =3D (); | + | + File::Find::find(sub { | + push @pms, $File::Find::name if /\.pm$/ | + }, "lib"); | + | + return('MAN3PODS', { | + map { my @comps =3D split /\//, $_; | + shift @comps; | + my $csep =3D join '::', @comps; | + $csep =3D~ s/\.pm$//; | + ($_, "\$(INST_MAN3DIR)/$csep.\$(MAN3EXT)"); | + } @pms | + }); | +} |=20 | -- Mike |=20 | Mike Schilli | log...@pe... | http://perlmeister.com | http://log4perl.sourceforge.net --=20 Mathieu Arnold |
From: Mike S. <log...@pe...> - 2003-05-14 01:42:42
|
On Tue, 13 May 2003, Mathieu Arnold wrote: > Well, you'd rather do it for every perl version. If you really want to do > it this way, no need to let MakeMaker do it afterwards. If 5.8.0 isn't broken, we shouldn't fix it, reason for this is that later versions might behave differently (like the MAN3PODS param could be broken) and it comforts me to know that I'm not breaking anything by fixing something that actually works :) > btw, perl 5.6.1 does not do it right, and it's version string is 5.006001, > only 5.8.0 does it right. Good point, I've changed the conditional to check for < 5.8.0. Checked in. Thanks for your help! -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |