Q for ExtUtils::MakeMaker experts

Discussion in 'Perl Misc' started by kj, May 4, 2006.

  1. kj

    kj Guest

    I have a large distribution that contains one small XS (it is
    essential for performance, but conceptually rather secondary).

    This causes ExtUtils::MakeMaker (or rather ExtUtils::Install) to
    install the *whole* distribution under arch, even though 99% of
    the installation is 100% architecture-independent!

    Granted, there's nothing inherently wrong about this, other that
    it is confusing to the casual observer (who is not even aware of
    this small XS). And it seems perverse. And it annoys me.

    Is there a good way to cajole EU::MM/EU::I into installing only
    the architecture-dependent stuff under the arch directory?

    I have tried all sort of tricks, but the best I have managed has
    come at the expense of a grossly overgrown Makefile.PL, where most
    of the additional code is there only to work around what EU::MM is
    determined to do. This solves a confusing situation by creating
    a new one.

    Thanks!

    kj

    P.S. I'm aware of Module::Builder, but M::B enforces a policy that
    requires the module maintainer to specify a license out of a small
    set of possible choices, which is out of the question for us.
    Besides, even if we could solve the problem above with M::B, we
    use EU::MM for all our other packages (about 15 of them in total),
    and EU::MM is still the Perl standard, we have decided to give
    priority to the EU::MM-based installation option.


    --
    NOTE: In my address everything before the first period is backwards;
    and the last period, and everything after it, should be discarded.
    kj, May 4, 2006
    #1
    1. Advertising

  2. kj

    Sisyphus Guest

    "kj" <> wrote in message
    news:e3due8$7pi$...
    >
    >
    >
    >
    > I have a large distribution that contains one small XS (it is
    > essential for performance, but conceptually rather secondary).
    >
    > This causes ExtUtils::MakeMaker (or rather ExtUtils::Install) to
    > install the *whole* distribution under arch, even though 99% of
    > the installation is 100% architecture-independent!
    >

    ..
    >
    > Is there a good way to cajole EU::MM/EU::I into installing only
    > the architecture-dependent stuff under the arch directory?
    >


    Not sure that I follow this all that well. I'll assume that you've got a
    bundle of modules, and you're wanting to install 99% of them into
    $Config{sitelib}, but that 99% (along with the other 1%) is going into
    $Config{sitearch}.

    In the Makefile.PL you can temporarily override those %Config values by
    placing at the start of the Makefile.PL something like:

    use Config;
    BEGIN {
    my $obj = tied %Config::Config;
    $obj->{sitearch} = $Config::Config{sitelib}
    };
    use ExtUtils::MakeMaker;
    .... etc

    So ... I'm thinking you might be able to change the arch directory to what
    you want by modifying the pertinent Makefile.PL(s) along those lines ....
    but even if that does apply to your situation, I don't know that it can be
    made to work (there's the problem of having the values overwritten for 99%
    of the modules but not for the other 1%) .... and even if it can be made to
    work, that doesn't necessarily mean it's the *best* way to do it.

    (Perhaps $Config{installsitearch} needs to be overwritten instead/also ....
    perhaps there are other %Config keys whose values need to be overwritten
    instead/also.)

    The code in the above BEGIN block is pinched from ExtUtils::FakeConfig - so
    alternatively you could install that module and use it instead.

    I'm no EU::MM expert, btw - and I don't think I needed to point that out :)

    Cheers,
    Rob
    Sisyphus, May 5, 2006
    #2
    1. Advertising

  3. kj

    kj Guest

    In <050520060853356061%> Jim Gibson <> writes:

    >In article <e3due8$7pi$>, kj
    ><> wrote:


    >> I have a large distribution that contains one small XS (it is
    >> essential for performance, but conceptually rather secondary).
    >>
    >> This causes ExtUtils::MakeMaker (or rather ExtUtils::Install) to
    >> install the *whole* distribution under arch, even though 99% of
    >> the installation is 100% architecture-independent!
    >>
    >> Granted, there's nothing inherently wrong about this, other that
    >> it is confusing to the casual observer (who is not even aware of
    >> this small XS). And it seems perverse. And it annoys me.
    >>
    >> Is there a good way to cajole EU::MM/EU::I into installing only
    >> the architecture-dependent stuff under the arch directory?


    >One approach might be to isolate the XS functionality in a small module
    >of its own with its own build and distribution. This module could then
    >become a prerequisite for the rest of your distribution, which would
    >then be 100% architecture-independent.



    Yep, I think this is what I'll end up doing.

    Thanks,


    kj

    --
    NOTE: In my address everything before the first period is backwards;
    and the last period, and everything after it, should be discarded.
    kj, May 5, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jill
    Replies:
    2
    Views:
    123
    James Willmore
    Jan 27, 2004
  2. felipe200112
    Replies:
    0
    Views:
    243
    felipe200112
    Apr 19, 2004
  3. Irving Kimura

    Anything better than ExtUtils::MakeMaker ?

    Irving Kimura, May 11, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    107
    Jon Ericson
    May 14, 2004
  4. Abdul-Wahid Paterson

    installing extra file through ExtUtils::MakeMaker

    Abdul-Wahid Paterson, Nov 8, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    169
    Anno Siegel
    Nov 9, 2004
  5. Replies:
    1
    Views:
    82
    Sisyphus
    Mar 2, 2006
Loading...

Share This Page