Amanda waite wrote: > Jeff Trawick wrote: >> Amanda Waite wrote: >>> CXX is implicitly set to 'g++' on OpenSolaris boxes when using gmake >>> or /usr/gnu/bin/make. eventmachine calls 'make' and so on >>> OpenSolaris, if /usr/gnu/bin is in the PATH and before /usr/ccs/bin >>> it will build ok without the need to set environment variables. >>> That's what we have for OpenSolaris. >>> >>> On Nevada/Solaris, there is no /usr/gnu/bin/make and so you have to >>> set CXX by hand or build with gmake. For a predictable environment >>> like Solaris it may be possible to coerce CXX to be set to >>> /usr/sfw/bin/g++ when building gems. Usually we install EventMachine >>> like this: >>> >>> CXX=/usr/sfw/bin/g++ gem install eventmachine >>> >>> Which I'm sure one of us has blogged about. You can force it to be >>> set it in rbconfig.rb with ENV["CXX"] = "/usr/sfw/bin/g++" (at the >>> end of the file) but there is no specific CXX variable in rbconfig.rb. >> >> First, thanks for your hints. >> >> AFAICT, none of the 150 most popular gems use GNU make features; >> there's just that side-effect of GNU make's idea of CXX. > > I've been through the same exercise that you did today a few times > over the last couple of years, but never on Solaris with WebStack. > You're right, there's no reason to favour GNU make over Solaris Make, > it's just that on Nevada/OpenSolaris it can be unpredictable given > that there's 4 make commands on the system with two of them actually > named 'make'. > > BTW: Thin only requires CXX to be set because it installs > EventMachine, same difference to an end user though > >> >> This is a little less straightforward than I might have expected. >> How should we document it for the OpenSolaris Web Stack? >> >> "The installation of Ruby native extensions requires the SUNWgcc >> package. gem is preconfigured to use gcc for C language extensions. >> Set the CXX environment variable to /usr/sfw/bin/g++ when installing >> C++ language extensions, such as eventmachine and thin. > > That looks ok, I'd rather it was unnecessary to have to read docs just > to install a gem but given what I'm going to say in response to your > last question it may be the only solution. > > BTW: > http://blogs.sun.com/mandy/entry/building_eventmachine_on_opensolaris_and
I'll raise the doc issue as part of reviews of the 2009.06 guide. > >> >> Example: >> >> # CXX=/usr/sfw/bin/g++ gem install eventmachine >> >> --/-- >> >> When this issue was encountered previously, was it considered more >> proper to >> >> 1) install SUNWgmake and adjust the path >> 2) set CXX >> 3) make rbconfig work out of the box >> >> (I'm not getting a read on how you think it should work.) > > Option 2) is preferred. Option 1) is a non-option really, it's too > cumbersome to be useful, read docs, install package, set PATH. Option > 3) Maybe it's just my personal prejudice. Given that under normal > circumstances rbconfig.rb will always have the last say on the > settings that are used to build a gem, if CXX is set there then it > can't be overridden. If this was a Ruby specific variable then I'd be > less concerned but maybe someone one day will want a Ruby app to pick > up CXX as set in the user's environment. > > Raise a bug for it, I'll see if there's a way that it can be done that > will satisfy my concerns without requiring the end user to google or > otherwise refer to docs. 6849363 opened Thanks for your help.
