From: Albert C. <rub...@ml...> - 2006-04-21 11:22:36
|
On Fri, Apr 21, 2006 at 07:50:31AM +0100, Jeremy Henty wrote: > On Thu, Apr 20, 2006 at 12:08:10PM -0500, Albert Chin wrote: > > On Thu, Apr 13, 2006 at 03:51:17PM +0100, Jeremy Henty wrote: > > > > The real need for the cxx.rb hack is so that feature tests for C++ > > > code are compiled with g++ . However you can do that much more > > > easily simply by setting CONFTEST_C = "conftest.cc", so that the > > > .cc extension tells gcc that the test source is C++ . I have > > > committed this change to CVS. > > > > What if you wish to build with the OS vendor C++ compiler? > > I am hoping these changes will make that happen automatically. On > GNU/Linux the Makefile compiles *.cc to *.c using $(CXX) . The CXX > variable isn't defined in the Makefile , so I assume GNU make supplies > the correct value. To compile the feature tests extconf.rb uses $(CC) > , which is set to gcc in rbconfig.rb . Luckily gcc knows that *.cc > files are C++ . If things work the same way on your OS then you're > done! I can't be sure that they'll work because I don't have access > to other OSes. If you can send me the Makefile and mkmf.log that your > Ruby-FLTK build creates I can check whether your OS does things the > same way as mine. (It would be useful to see rbconfig.rb too.) Unfortunately, neither the Solaris C compiler will recognize .cc as a C++ file and call CC nor will the HP-UX C compiler. That's why we need a way to explicitly set the C++ compiler used for the tests in extconf.rb. -- albert chin (ch...@th...) |