syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
When I build a "versioned" 5.10.1-RC1 on Windows, I find that @INC is set to:
C:/perl/5.10.1/lib C:/perl/site/5.10.1/lib .
I would like to have it slightly different:
C:/perl/5.10.1/lib C:/perl/site/5.10.1/lib C:/perl/site/5.10.0/lib .
What's the best way to do that ?

I see that the Win32 makefiles allow for -Duse_sitecustomize, but having enabled that, I can't find a way to get $Config{sitelibexp}/sitecustomize.pl to do anything useful. In fact, I can't even find any evidence that $Config{sitelibexp}/sitecustomize.pl gets run.

Early in Feb 2006 I asked essentially the same question (on p5p), and ysth suggested:

<quote>
To do this you need to manually do what Configure does for you on linux; edit the appropriate win32/config_H.* file and change:
#define PERL_INC_VERSION_LIST 0
to something like
#define PERL_INC_VERSION_LIST "5.8.8","5.8.7","5.8.6",0
</quote>

That seemed reasonable to me, and I think I tried it out and found that it worked - though I'm now not entirely sure that I ever did put it to the test.

Whatever the case, it certainly doesn't work with 5.10.1-RC1. I'm building with MinGW and I've tried both #define PERL_INC_VERSION_LIST "5.10.0" and #define PERL_INC_VERSION_LIST "5.10.0",0 in win32/config_H.gc without success.

Not sure where to go from here.

Cheers,
Rob

Replies are listed 'Best First'.
Re: "versioned" builds of Win32 perl
by syphilis (Archbishop) on Aug 13, 2009 at 11:45 UTC
    Seems that win32/config.gc also needs amending. I've rewritten the 'd_inc_version_list', 'inc_version_list' and 'inc_version_list_init' entries in that file to:
    d_inc_version_list='define' inc_version_list='5.10.0' inc_version_list_init='"5.10.0",0'
    And, in config_H.gc, I have:
    #define PERL_INC_VERSION_LIST "5.10.0",0
    Perl now produces:
    C:\_32>perl -V:d_inc_version_list d_inc_version_list='define'; C:\_32>perl -V:inc_version_list inc_version_list='5.10.0'; C:\_32>perl -V:inc_version_list_init inc_version_list_init='"5.10.0",0';
    That correlates well with what I get on linux, but still no /perl/site/5.10.0/lib in @INC.
    I might take this up on p5p at some stage ... or I might just forget about it and settle for copying the entire contents of /perl/site/5.10.0/lib into /perl/site/5.10.1/lib.

    Cheers,
    Rob
        I was already including INST_VER. Including INST_ARCH shouldn't be required and just highlights more brokenness - @INC then becomes:
        C:/perl/5.10.1/lib/MSWin32-x64-multi-thread C:/perl/5.10.1/lib C:/perl/site/5.10.1/lib/MSWin32-x64-multi-thread C:/perl/site/5.10.1/lib .
        Still no mention of C:/perl/site/5.10.0/lib, and the architecture should be 'x86' not 'x64'. The 'x64' arises because I'm building on Vista64 - but, having set the WIN64 environment variable to undef, the architecture *should* have been set to 'MSWin32-x86-multi-thread'.

        Cheers,
        Rob