How to tell CPAN about path to make and cc

限于喜欢 提交于 2020-01-22 19:09:09

问题


Running Perl 5.10 CPAN on Solaris with opencsw.org packages, Makefile.PL from packages can't find the correct path and cc (gcc).

I found the path to make and set it to gmake, but I can't find any setting for cc.

I thought I once set this in CPAN/Config.pm (or with o config ...) but can no longer find any setting and don't have enough patience to wade through the thicket to figure out where such a basic thing gets set.

Does anyone know?


回答1:


cpan doesn't need to know where gcc or equivalent is, because it isn't cpan's job to call it directly. Usually it's Makefile.PL or Build.PL that needs to know that, and it usually will accept the compiler to use as a command line argument. If you add PERLMAINCC=/compiler/to/use to o conf makepl_arg that should do it.




回答2:


Extensions need to be built with the same tools as Perl itself, and Perl remembers what those tools are.

If you have since deleted or moved them, that could be a problem.

But more likely, you haven't installed the package(s) from your distro that provides them. Install the missing packages.




回答3:


In cpan_home/CPAN/Config.pm (or via o conf):

'make_arg' => q[CC=/path/to/c-compiler]


来源:https://stackoverflow.com/questions/8734980/how-to-tell-cpan-about-path-to-make-and-cc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!