Michael G Schwern <[EMAIL PROTECTED]> wrote on 01/04/2005 05:12:32 PM:
> Ahh, $(MMS$SOURCE_LIST) is a list of all dependencies. I think it can be > safely removed. The logic is this: > > if ($self->{MYEXTLIB}) { > push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(OBJECT)',"\n"); > } else { > push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST)',"\n"); > } That is not quite correct. As it turns out $(MMS$SOURCE_LIST) is a comma separated list of filenames without types (in the language of RMS file parsing TYPEs are also known as "extensions" in the Windows centric world). This difference is crucial to the use of LIBRARY as I'll demonstrate below. > Since the only time $(MMS$SOURCE_LIST) is used is when $(MYEXTLIB) is empty > and the only important dependencies are $(OBJECT) and $(MYEXTLIB) the list is > always going to be $(OBJECT) so both branches are effectively the same. So > this should solve the problem while keeping the dependency. > > > --- lib/ExtUtils/MM_VMS.pm (revision 4204) > +++ lib/ExtUtils/MM_VMS.pm (local) > @@ -994,11 +991,7 @@ > # if there was a library to copy, then we can't use MMS$SOURCE_LIST, > # 'cause it's a library and you can't stick them in other libraries. > # In that case, we use $OBJECT instead and hope for the best > - if ($self->{MYEXTLIB}) { > - push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(OBJECT)',"\n"); > - } else { > - push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST)',"\ > n"); > - } > + push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(OBJECT)',"\n"); > > push @m, "\t\$(NOECHO) \$(PERL) -e 1 >\$(INST_ARCHAUTODIR)extralibs.ld\n"; > foreach $lib (split ' ', $self->{EXTRALIBS}) { Unfortunately it looks like this will break builds for extensions that have more than one file listed in $(OBJECT). Among them would be Bit::Vector 6.3, Compress::Zlib 1.33, Date::Calc 5.3, DBD::mysql 2.903_1 (gleaned from my local list of extensions, the list is potentially larger). To illustrate how the LIBRARY/OBJECT/REPLACE command chokes on a space separated list of obj files let me start with a clean directory into which I copy the bitvector.obj and vector.obj files from the place where my cpan modules are built and create a bare bones descrip.mms file that uses your proposal: $ type descrip.mms PERL = perl OBJECT = bitvector.obj vector.obj BASEEXT = TESTIT LIB_EXT = .olb INST_STATIC = $(BASEEXT)$(LIB_EXT) all :: $(INST_STATIC) write sys$output "all up to date now" $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET) write sys$output "$(MMS$SOURCE_LIST)" Library/Object/Replace $(MMS$TARGET) $(OBJECT) $(NOECHO) $(PERL) -e 1 >$(INST_ARCHAUTODIR)extralibs.ld Here is a test run of that: $ mmk If F$Search("TESTIT.OLB").eqs."" Then Library/Object/Create TESTIT.OLB write sys$output "BITVECTOR.OBJ,VECTOR.OBJ" BITVECTOR.OBJ,VECTOR.OBJ Library/Object/Replace TESTIT.OLB bitvector.obj vector.obj %DCL-W-MAXPARM, too many parameters - reenter command with fewer parameters \VECTOR\ %MMK-F-ERRUPD, error status %X00038098 occurred when updating target TESTIT.OLB Note that it created TESTIT.OLB but failed to insert anything in it: $ directory/size testit.olb Directory USER:[PPRYMMER.MAKEMAKER] TESTIT.OLB;1 214 Total of 1 file, 214 blocks. On the other hand if I alter my descrip.mms to incorporate the special $(MMS$SOURCE_LIST) macro I obtain the following result: --- descrip.mms;-1 Wed Jan 5 11:04:17 2005 +++ descrip.mms Wed Jan 5 11:07:47 2005 @@ -11,5 +11,5 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET) write sys$output "$(MMS$SOURCE_LIST)" - Library/Object/Replace $(MMS$TARGET) $(OBJECT) + Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST) $(NOECHO) $(PERL) -e 1 >$(INST_ARCHAUTODIR)extralibs.ld This works OK as demonstrated below: $ delete testit.olb; $ mmk If F$Search("TESTIT.OLB").eqs."" Then Library/Object/Create TESTIT.OLB write sys$output "BITVECTOR.OBJ,VECTOR.OBJ" BITVECTOR.OBJ,VECTOR.OBJ Library/Object/Replace TESTIT.OLB BITVECTOR.OBJ,VECTOR.OBJ perl -e 1 >extralibs.ld write sys$output "all up to date now" all up to date now $ directory/size testit.olb Directory USER:[PPRYMMER.MAKEMAKER] TESTIT.OLB;1 1091 Total of 1 file, 1091 blocks. Note that TESTIT.OLB now has both modules inside it (hence it occupies more disk space). You seem dead set on having .exists as a dependent somehow, I'd recommend removing it from the $(INST_STATIC) dependents and I noted that in the descrip.mms for Bit::Vector there is a rule for $(OBJECT) to depend on .exists like so: $ search dga2:[cpan_modules.bit-vector-6_3]descrip.mms "$(INST_STATIC) :"/win=(3,4) # Rely on suffix rule for update action $(OBJECT) : $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET) Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST) $(NOECHO) $(PERL) -e 1 >$(INST_ARCHAUTODIR)extralibs.ld That descrip.mms was written out by MakeMaker 6.17 and Bit::Vector was buildable by it. If 6.25_08 gets released I'll see about patching it, otherwise I may try to prepare a patch for 6.25_07 (but don't wait too long for me). Peter Prymmer