SmartOS fixes, and some new packages.

I've had to change stdenv/generic/setup.sh - or patch every package using configure and libtool.
Hopefully these changes are acceptable to the community.