Installing yajl on Solaris 10 with gem (native exension)

Hi all,
I am having trouble getting gem to install yajl on my Solaris 10
instance. I am trying to install chef but gem cannot build the native
extension. I have been chipping away at this for the best part of 2
days.

The problem is down to mkmf’s insistence on building a makefile without
using environment variables to configure it. I can find now useful way
to control mkmf.

Firstly, it insisted on using /opt/SUNWspro/bin/cc. I could not tell it
to use anything else so eventually resorted to symlinking to gcc.
Then, gcc complained about the -xarch=386 option.
So, I installed Sun Studio Compiler 12.1 and get the message below about
not understanding -Wall.

So, is there a method of controlling mkmf from gem?

Many thanks,
Edward

Output:
ERROR: Error installing chef:
ERROR: Failed to build gem native extension.

    /opt/csw/bin/ruby18 extconf.rb

creating Makefile

make
/opt/SUNWspro/bin/cc -I. -I/opt/csw/lib/ruby/1.8/i386-solaris2.9
-I/opt/csw/lib/ruby/1.8/i386-solaris2.9 -I. -I/opt/csw/include
-D_FILE_OFFSET_BITS=64 -KPIC -xO3 -m32 -xarch=386 -KPIC -Wall
-funroll-loops -c yajl.c
cc: -W option with unknown program all
make: *** [yajl.o] Error 1

Gem files will remain installed in
/opt/csw/lib/ruby/gems/1.8/gems/yajl-ruby-0.8.2 for inspection.
Results logged to
/opt/csw/lib/ruby/gems/1.8/gems/yajl-ruby-0.8.2/ext/yajl/gem_make.out