Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to install Term::ReadKey on a Solaris 8 box. Like most Solaris 8 machines, I have gcc instead of the hideously expensive Sun compiler. I've compiled Perl 5.6.1 and installed it, and installed a number of other modules via CPAN. But when I try to install Term::ReadKey, it fails because it tries to use cc for some reason instead of gcc. And sure enough, if I look at /usr/perl5/5.00503/sun4-solaris/Config.pm, it lists cc instead of gcc. My question is thus multifold:

How can I change this compiler setting? I recognize it's not just as simple as changing it to gcc, because compiler flags also need to change. I tried the -fPIC setting, but either I didn't do it right or that's not enough (-xdepend causes problems, too). There has to be a more elegant way, like re-running some config script somewhere.

And just out of curiosity, if I'm running 5.6.1, why is 5.00503 in my path? Is it because of the binary compatibility?

Replies are listed 'Best First'.
Re: cc/gcc config settings on Solaris
by zengargoyle (Deacon) on Mar 28, 2002 at 00:19 UTC

    I have a hunch. When you typed: 'perl -MCPAN -eshell' to install Term::ReadKey you weren't using perl 5.6.1, instead you were using the old perl 5.00503. Therefore CPAN (the 5.00503 version) tried to use cc instead of gcc.

    Try building again, but before 'perl -MCPAN -eshell' try: 'perl -v' to make sure you're using the right version of perl.

      Thanks, that was it. I rebuilt and reinstalled (actually I think it didn't install properly the first time around, but I've slept since then) and everything is hunky dory now.
Re: cc/gcc config settings on Solaris
by beernuts (Pilgrim) on Mar 29, 2002 at 21:47 UTC
    You're on the right path with your compiler settings. I had to change '-xO3 -xdepend' to just '-O3' and '-KPIC' to '-fPIC' (as you've done). YMMV, as I'm not a compiler guru, tho. But, it works like a champ for me

    -beernuts