Bug #4074
closedmkmf hardcoding prevents ObjC/ObjC++ ruby extensions from building properly
Description
=begin
Sent to the ruby-core list on Oct 8, 2010. Submitting patch / ticket.
This is in regards to patch 28765 (Jul 27, 2010). The patch notes are rather blasé:
* lib/mkmf.rb (have_framework): added.
http://github.com/ruby/ruby/commit/444b943e354725bf623a050c88a4a8bd3f926c74
But it's a pretty big change, as it makes writing Ruby Extensions in Objective-C a far less stressful experience. Prior to this patch, only ".c" files would be compiled with C compiler flags--as it was otherwise hard-coded as such, in mkmf.rb.
I've attached a patch, to make mkmf.rb closer to what I think makes sense. Specifically:
- Adds support for the comedy-option known as Objective-C++ (.mm file extension)
- Banishes the hardcoding of file-extensions, when generating compiler options, as I feel it leads to very unexpected behavior.
- I may simply be ignorant, and I'd love to hear some thoughts... But it seems that a "COMPILE_OBJC" constant, in mkmf, isn't all that necessary.
ie, I can't really think of a case where you'd want to compile your C and your ObjC code (or C++ and ObjC++), differently from each other.
If it is necessary, then there will be a need for COMPILE_C, COMPILE_CXX, COMPILE_OBJC, and a COMPILE_OBJCXX. My own opinion, in that case, is mkmf.rb could use some minor changes to make this whole process much more intuitive.
=end
Files
Updated by Anonymous over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r29842.
Scott, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end