On Mon, Jan 03, 2005 at 01:29:10PM -0600, [EMAIL PROTECTED] wrote:
> Please let me know if I'm being too dense or too, er, flippant here, I've 

No, you seem to be spot on.

>  The 2.7 doesn't have Sun's cc/CC (too expensive) and so 
> (config/init/hints/solaris.pl):
> my $link = Configure::Data->get('link');
> # Going to assume Sun's compiler
> # In which case we need to link with the C++ compiler (CC) rather than the
> # C compiler (cc)
> $link =~ s/\bcc\b/CC/;
> Configure::Data->set('link', $link);
> ...
> choked early on:
> Determining what C compiler and linker to 
> use.........................done.
> Determining if your C compiler is actually gcc......Linker failed (see 
> test.ldo)
> 
> test.ldo
> Can't exec "CC": No such file or directory at lib/Parrot/Configure/Step.pm 
> line 279.
> 
> which seems to say its not doing whatever that link stuff is doing, its 
> not working for the CC/g++ switch. Changing that subst:
> # C compiler (cc)
> #$link =~ s/\bcc\b/CC/;
> # YAassumption - g++
> $link =~ s/\bcc\b/g++/;
> Configure::Data->set('link', $link);

I think I might have been at least part responsible for that code to use
CC for linking. The problem is that the linker really needs to be set
correctly (either way) later on. I tried this (the machine I have only
has the Sun compiler):

# If we're using Sun's compiler then we need to link with the C++ compiler (CC)
# rather than the C compiler (cc)
# If it turns out we're using gcc, then we need to make sure we're linking
# with g++, not gcc.  We can't make this decision until later, because the
# gcc test hasn't been run yet.
my $solaris_cb = sub {
  my ($key, $gccversion) = @_;
  my $link = Configure::Data->get('link');
  if ($gccversion) {
    $link =~ s/g?cc/g\+\+/;
  } else {
    $link =~ s/\bcc\b/CC/;
  }
  Configure::Data->set('link', $link);
  Configure::Data->deltrigger("gccversion", "solaris_hints");
};

Configure::Data->settrigger("gccversion", "solaris_hints", $solaris_cb);


but it seems that that doesn't change 'link':

$ grep ^LINK Makefile LINK      = ccache cc -D_XPG6
LINKFLAGS =  -xarch=v9 -L/usr/lib/sparcv9 -L/usr/ccs/lib/sparcv9 
-L/opt/SUNWspro/prod/lib/v9 -L/usr/local/lib   -g 


(should be CC)

so I'm inferring that that callback didn't get called when gccversion is
false. So this gets me to limit of my Parrot Configure knowledge - how do
we run a callback unconditionally after gccversion is known, independent
of its value?

Nicholas Clark

Reply via email to