From: "nobu (Nobuyoshi Nakada)" Date: 2013-07-04T16:36:39+09:00 Subject: [ruby-core:55793] [ruby-trunk - Bug #8593][Feedback] MKMF have_framework check assumes the framework and header are identically named Issue #8593 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Feedback How about passing the header name by an optional argument? have_framework("SDL2", header: "SDL.h") diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 7f472f4..464cbbf 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1081,9 +1081,9 @@ SRC # the +HAVE_FRAMEWORK_RUBY+ preprocessor macro would be passed to the # compiler. # - def have_framework(fw, &b) + def have_framework(fw, header: "#{fw}.h", &b) checking_for fw do - src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}" + src = cpp_include("#{fw}/#{header}") << "\n" "int main(void){return 0;}" opt = " -framework #{fw}" if try_link(src, "-ObjC#{opt}", &b) $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp)) ---------------------------------------- Bug #8593: MKMF have_framework check assumes the framework and header are identically named https://bugs.ruby-lang.org/issues/8593#change-40289 Author: karljs (Karl Smeltzer) Status: Feedback Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN I am working on a Ruby extension in which the C code links against SDL2.0 on OSX. This is distributed as an OSX framework (SDL2.framework directory) but the primary header file is simply SDL.h and not SDL2.h When I add have_framework('SDL2') to my extconf.rb file, it fails the check because it only tests for SDL2/SDL2.h If I create a symlink named SDL2.h in the same directory, then the check passes and everything builds correctly. -- http://bugs.ruby-lang.org/