diff --git a/ChangeLog b/ChangeLog index a03adcba92..42943a3332 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Jan 27 11:09:45 2009 Nobuyoshi Nakada + + * 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 * common.mk (distclean-enc, realclean-enc): do not call clean of 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 diff --git a/win32/Makefile.sub b/win32/Makefile.sub index ce3bbff0d2..f20009726f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -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 <