summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-04 15:25:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-04 15:25:46 +0000
commit5d5723095915d1fff2efda4c4195e4c804c1a351 (patch)
tree7a4a3c38644876bbabdf5b2e08de2ff521697197 /lib
parent4e681d978a02d704cc5511be71d8dca1d4cf2bb1 (diff)
mkmf.rb: header in framework
* 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/trunk@41777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 7f472f42eb..a35be75142 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1081,9 +1081,13 @@ SRC
# the +HAVE_FRAMEWORK_RUBY+ preprocessor macro would be passed to the
# compiler.
#
- def have_framework(fw, &b)
+ # 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, header), &b)
+ header ||= "#{fw}.h"
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))