I have an XS module that I now need to use a the Sun Studio 8 compiler. How do I make xs use it?

My Makefile.PL looks like...
use ExtUtils::MakeMaker; $acelib = '/opt/Ace750cRev1/postware/acelib'; WriteMakefile( 'NAME' => 'ACE', 'VERSION_FROM' => 'ACE.pm', 'LIBS' => ["-L$acelib -lace"], 'DEFINE' => '-DSolaris64', 'INC' => "-I$acelib", );
Building the Makefile...
erickn@isfe:/home/erickn/ACE> perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for ACE
Making the extention...
erickn@isfe:/home/erickn/ACE> make cp ace_constants.pl blib/lib/ace_constants.pl cp ACE.pm blib/lib/ACE.pm /home/utils/perl/bin/perl /home/utils/perl/lib/perl5/5.8.0/ExtUtils/xs +ubpp -typemap /home/utils/perl/lib/perl5/5.8.0/ExtUtils/typemap -typ +emap typemap ACE.xs > ACE.xsc && mv ACE.xsc ACE.c gcc -c -I/opt/Ace750cRev1/postware/acelib -I/home/utils/perl/include + -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"3.00\" + -DXS_VERSION=\"3.00\" -fPIC "-I/home/utils/perl/lib/perl5/5.8.0/sun4 +-solaris/CORE" -DSolaris64 ACE.c Running Mkbootstrap for ACE () chmod 644 ACE.bs rm -f blib/arch/auto/ACE/ACE.so LD_RUN_PATH="/opt/Ace750cRev1/postware/acelib" gcc -G -L/home/utils/p +erl/lib ACE.o -o blib/arch/auto/ACE/ACE.so -L/opt/Ace750cRev1/post +ware/acelib -lace chmod 755 blib/arch/auto/ACE/ACE.so cp ACE.bs blib/arch/auto/ACE/ACE.bs chmod 644 blib/arch/auto/ACE/ACE.bs Manifying blib/man3/ACE.3
As you can see it still uses gcc. However I want it to use the new Studio 8 compiler.
Both are available in my path...
erickn@isfe:/home/erickn/ACE> type gcc gcc is /usr/local/bin/gcc erickn@isfe:/home/erickn/ACE> type cc cc is a tracked alias for /usr/local/studio8/SUNWspro/bin/cc
And my $PATH is...
erickn@isfe:/home/erickn/ACE> echo $PATH /usr/local/studio8/SUNWspro/bin:/home/erickn/bin:/home/utils/perl/bin: +/home/utils/perl/scripts:/v0/oracle/bin:/usr/bin:/usr/dt/bin:/usr/ope +nwin/bin:/usr/ccs/bin:/usr/sbin:/usr/ucb:/usr/bin/nsr:/usr/sbin/nsr:/ +usr/local/bin:/usr/local/scripts:/usr/local/mistools:/usr/lib:/opt/op +enssh/bin:/opt/SUNWppro/bin:/usr/annex/bin/SUN/:/opt/vsifax/bin:/usr/ +local/SUNWexplo/bin:/usr/opt/SUNWmd/sbin:/opt/imagemagick/bin:.:/usr/ +local/oracle:/home/oramwh/scripts/forms_drivers:/prod/share/bin:/prod +/dbadmin/util/bin
So, my questions are...
1. Why is it by default using gcc in /usr/local/bin ?
2. How do I make it use cc in /usr/local/studio8/SUNWspro/bin ?

In reply to How to make an XS module with a different C compiler? by mifflin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.