diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-03 13:44:30 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-03 13:44:30 +0000 |
commit | ab660694feb8128c8a1c5bdadea21acb5af89810 (patch) | |
tree | f196c62223729288518a84847a9d498e134de3cc /lib | |
parent | a1525108b87dac3032754f4152d37258f3ea4c0c (diff) |
merge revision(s) 41777,41779: [Backport #8593]
* lib/mkmf.rb (have_framework): allow header file to check.
[ruby-core:55745] [Bug #8593]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 6fec4bd8f4..8ea4d8eb32 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1054,9 +1054,17 @@ SRC # the +HAVE_FRAMEWORK_RUBY+ preprocessor macro would be passed to the # compiler. # + # If +fw+ is a pair of the framework name and its header file name + # that header file is checked, instead of the normally used header + # file which is named same as the framework. def have_framework(fw, &b) + if Array === fw + fw, header = *fw + else + header = "#{fw}.h" + end 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)) |