Nick Kew wrote: > On Tue, 24 Feb 2009 12:01:03 -0500 > Jeff Trawick <Jeffrey.Trawick at Sun.COM> wrote: > > >> Seema Alevoor wrote: >> >>> Hi, >>> >>> Webrev for the following CRs is at >>> http://cr.opensolaris.org/~seema/6761354/ >>> 6774187 APR and HTTPD build files contain hard-coded compiler path >>> >> This issue bugs me a bit. Installing SUNWgcc puts cc in the default >> PATH, and that cc won't handle our cflags (and apxs/apr-1-config >> should use a compiler matching the build anyway). >> >> Two compilers are delivered with OpenSolaris: >> SUNWgcc in /usr/gnu/bin and sunstudioexpress in >> /opt/SunStudioExpress/prod/bin >> > > Too many versions. On my 2008.11 it's /opt/SUNWspro/bin. > Apache gets gcc by default. > > >> The latter is the one which is suitable for use. The current >> hard-coding of /opt/SUNWspro doesn't match either of those. >> >> A few possible changes: >> [chop] >> This issue is worth discussion to see if there are more ideas and >> select the best trade-offs. >> > > How about punting the definition of CC to an included file, to narrow > it down to one place the path needs setting. Then run a test in there: > try different CC paths on a HelloWorld, and set it to whatever works > or complain and bail out if nothing worked. > > Or maybe it isn't even necessary to compile HelloWorld, and it might > be sufficient to test that $(candidate-CC) is an executable? >
(also Basant's message about finding normal places for SunStudio, but not overriding the user's PATH if it points to a different install) one problem is that we need SunStudio; that's what Apache/APR were built with, and that's what are CFLAGS/CPPFLAGS require (to switch from SunStudio you need to edit the flags in config_vars.mk and apr-1-config (32-bit and 64-bit versions potentially)) assume apr-1-config is the sole definition of CC for a sec, and we modify apxs to look there instead of config_vars.mk I think the following is essentially one of Seema's suggestions: for "apr-1-config --cc", it checks if cc in path is something besides SunStudio if no SunStudio cc is in path, return canonical location of SunStudio (or search); if canonical location doesn't exist, user can decipher the eventual error message reasonably well meanwhile, we run cc an extra time whenever somebody runs "apr-1-config --cc" or apxs :( Meanwhile, Seema also suggests: >We can also handle this with a two step approach. >For this release, have it as "cc" without additional checks and let us document >the need for Sun Studio compiler in the path. >Then in the subsequent release, add additional checks to reduce the possibility >of non-Sun compiler usage. I guess I'm convinced after looking at the choices and at the same time thinking about the required patches :( This stuff is hard to follow to begin with, then we have our patches on top to deal with our own build requirements. --/-- I noticed some time ago that Prashant made available from his blog an alternate rbconfig.rb file to allow Ruby extensions to build with gcc (IIRC, the default then was SunStudio but some extensions required gcc). The equivalent for us would be a couple of files (config_vars.mk and apr-1-config?) somebody has edited for/tested with OpenSolaris delivery of gcc.