8

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?

Lawrence I. Siden
  • 9,191
  • 10
  • 43
  • 56

3 Answers3

10

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.

Dan
  • 10,531
  • 2
  • 36
  • 55
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.

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • I'm on Solaris 10 and my distro is opencsw.org. Perl 5.8 is from the original Solaris package, but Perl 5.10 which is first in my path is from OpenCSW. I also have gcc and gmake installed and can run them from the command-line. – Lawrence I. Siden Jan 05 '12 at 06:38
2

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

'make_arg' => q[CC=/path/to/c-compiler]
daxim
  • 39,270
  • 4
  • 65
  • 132
Lawrence I. Siden
  • 9,191
  • 10
  • 43
  • 56
  • Ran into this problem in a cluster environment trying to build Net::SSLeay where the system `cc` was too old and didn't support the `-fstack-protector-strong` option. Setting `make_arg` to `CC=gcc` (a newer version in my `$PATH`) was the correct solution in this case. – TheDudeAbides Feb 09 '18 at 22:09