diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-27 02:09:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-27 02:09:47 +0000 |
commit | d232a50435a683bef2703f5f8e040154344f322e (patch) | |
tree | a076073147284084682d8ec8402cae5c836811d1 /lib | |
parent | c938de20cd80f18375d2cf198ce58033f2d32be7 (diff) | |
download | ruby-d232a50435a683bef2703f5f8e040154344f322e.tar.gz |
* lib/mkmf.rb (try_header): checks the header depending on
platform.
* lib/mkmf.rb (have_header, find_header): use try_header.
* win32/Makefile.sub (try_header): uses try_compile to get rid of
slow -E option of VC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 54db11829f..2cbbb245a9 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -433,6 +433,10 @@ ensure rm_f "conftest*" end +class Object + alias_method :try_header, (config_string('try_header') || :try_cpp) +end + def cpp_include(header) if header header = [header] unless header.kind_of? Array @@ -806,7 +810,7 @@ end # def have_header(header, &b) checking_for header do - if try_cpp(cpp_include(header), &b) + if try_header(cpp_include(header), &b) $defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-Z___"))) true else @@ -825,13 +829,13 @@ def find_header(header, *paths) message = checking_message(header, paths) header = cpp_include(header) checking_for message do - if try_cpp(header) + if try_header(header) true else found = false paths.each do |dir| opt = "-I#{dir}".quote - if try_cpp(header, opt) + if try_header(header, opt) $INCFLAGS << " " << opt found = true break |