How can I set library and include paths for Makefile.PL for a single installation?

后端 未结 2 1998
渐次进展
渐次进展 2021-02-03 12:25

How can I tell CPAN to give Makefile.PL one specific argument in one specific installation?

Specifically. I want to install XML::LibXML, and

相关标签:
2条回答
  • 2021-02-03 13:04

    In the CPAN shell, you can set the values that you need:

    $ cpan
    cpan shell -- CPAN exploration and modules installation (v1.9205)
    ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)
    
    cpan[1]> o conf makepl_arg
        makepl_arg         []
    Type 'o conf' to view all configuration items
    
    
    cpan[2]> o conf makepl_arg "LIBS=-L/foo/bar INC=-I/foo/bar/include"
        makepl_arg         [LIBS=-L/foo/bar INC=-I/foo/bar/include]
    Please use 'o conf commit' to make the config permanent!
    
    cpan[3]> install Some::Module
    

    With the cpan command, you can use the -j switch to load a custom configuration file. You can start with the -J switch to dump the configuration, then change the values you want and reload it:

     $ cpan -J > my_config.pm
     .... edit file ....
     $ cpan -j my_config.pm -i Some::Module
    

    However, I suspect that rafl's suspicions are right.

    0 讨论(0)
  • 2021-02-03 13:26

    The Makefile.PL is looking for libxml2.so. That's usually a symlink to your actual libxml2 shared object, like libxml2.so.2.6.32. If for some reason this symlink isn't around because you deleted it, your vendor didn't ship it with its libxml2 header package (e.g. libxml2-dev on Debian/Ubuntu/etc), you will need to create it yourself.

    You don't need to pass any specific argument to Makefile.PL here. It's already looking in the right places. The things it's looking for simply aren't there.

    0 讨论(0)
提交回复
热议问题