From 11dbedfaad4a9a9521ece2198a8dc491678b1902 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 29 Aug 2007 04:06:12 +0000 Subject: add tag v1_8_6_5001 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_5001@13304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/ext/iconv/extconf.rb | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 ruby_1_8_6/ext/iconv/extconf.rb (limited to 'ruby_1_8_6/ext/iconv/extconf.rb') diff --git a/ruby_1_8_6/ext/iconv/extconf.rb b/ruby_1_8_6/ext/iconv/extconf.rb new file mode 100644 index 0000000000..a9d0cfb5e6 --- /dev/null +++ b/ruby_1_8_6/ext/iconv/extconf.rb @@ -0,0 +1,51 @@ +require 'mkmf' + +dir_config("iconv") + +conf = File.exist?(File.join($srcdir, "config.charset")) +conf = with_config("config-charset", enable_config("config-charset", conf)) + +if have_func("iconv", "iconv.h") or + have_library("iconv", "iconv", "iconv.h") + if checking_for("const of iconv() 2nd argument") do + create_tmpsrc(cpp_include("iconv.h") + "---> iconv(cd,0,0,0,0) <---") + src = xpopen(cpp_command("")) {|f|f.read} + if !(func = src[/^--->\s*(\w+).*\s*<---/, 1]) + Logging::message "iconv function name not found" + false + elsif !(second = src[%r"\b#{func}\s*\(.*?,(.*?),.*?\)\s*;"m, 1]) + Logging::message "prototype for #{func}() not found" + false + else + Logging::message $&+"\n" + /\bconst\b/ =~ second + end + end + $defs.push('-DICONV_INPTR_CONST') + end + if conf + prefix = '$(srcdir)' + prefix = $nmake ? "{#{prefix}}" : "#{prefix}/" + if $extout + wrapper = "$(RUBYARCHDIR)/iconv.rb" + else + wrapper = "./iconv.rb" + $INSTALLFILES = [[wrapper, "$(RUBYARCHDIR)"]] + end + if String === conf + require 'uri' + scheme = URI.parse(conf).scheme + else + conf = "$(srcdir)/config.charset" + end + $cleanfiles << wrapper + end + create_makefile("iconv") + if conf + open("Makefile", "a") do |mf| + mf.print("\nall: #{wrapper}\n\n#{wrapper}: #{prefix}charset_alias.rb") + mf.print(" ", conf) unless scheme + mf.print("\n\t$(RUBY) $(srcdir)/charset_alias.rb #{conf} $@\n") + end + end +end -- cgit v1.2.3