Compiling Nokogiri gem on Solaris 10 with Sun Studio28 Jan 2010
It turns out the nokogiri build script makes a few too many assumptions:
- it tests for Solaris-ness by checking target_os is solaris2 where on Solaris 10 it is solaris2.10
- it assumes gcc and sets a bunch of invalid CFLAGS such as -Wall
- it doesn't let me specify a custom lib/include directories - it failed to find my iconv because of this (furthermore after adding the paths manually misleadingly it still said it couldn't find them but the problem was the options passed to cc were incorrect)
- further down the line something decided it knew where Sun Studio was. It was wrong. to be fair this probably wasn't nokogiri's fault.
I've ended up using gcc for compiling ruby related things which knocks out problems 2-4.
However I started seeing problems with a vasprintf symbol not found (similar to this problem). The problem is the same as my point 1 above (in ext/nokogiri/extconf.rb line:22):
# ruby -rrbconfig -e "puts Config::CONFIG['target_os']" solaris2.10
It's fixed by this commit