1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-01-27 02:09:47 +00:00
parent c938de20cd
commit d232a50435
3 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,13 @@
Tue Jan 27 11:09:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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.
Tue Jan 27 11:03:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (distclean-enc, realclean-enc): do not call clean of

View file

@ -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

View file

@ -654,6 +654,7 @@ s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t
s,@configure_input@,$$configure_input,;t t
s,@srcdir@,$(srcdir),;t t
s,@top_srcdir@,$(srcdir),;t t
s,@try_header@,try_compile,;t t
<<KEEP
miniruby: miniruby$(EXEEXT)