Project

General

Profile

Actions

Bug #4074

closed

mkmf hardcoding prevents ObjC/ObjC++ ruby extensions from building properly

Added by sgonyea (Scott Gonyea) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
Backport:
[ruby-core:33260]

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

mkmf_objc_objcpp-sgonyea.patch (1.41 KB) mkmf_objc_objcpp-sgonyea.patch sgonyea (Scott Gonyea), 11/20/2010 07:43 AM
Actions #1

Updated by Anonymous over 13 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

Actions

Also available in: Atom PDF

Like0
Like0