问题
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