mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
* ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
68a117d8e2
commit
c5fe339b55
2 changed files with 21 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Jun 25 15:33:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
|
||||||
|
|
||||||
|
* ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715]
|
||||||
|
|
||||||
Fri Jun 25 02:04:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jun 25 02:04:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* {bcc32,win32,wince}/setup.mak: remove RUBY_EXTERN lines when
|
* {bcc32,win32,wince}/setup.mak: remove RUBY_EXTERN lines when
|
||||||
|
|
|
@ -5,22 +5,26 @@ dir_config("iconv")
|
||||||
conf = File.exist?(File.join($srcdir, "config.charset"))
|
conf = File.exist?(File.join($srcdir, "config.charset"))
|
||||||
conf = with_config("config-charset", enable_config("config-charset", conf))
|
conf = with_config("config-charset", enable_config("config-charset", conf))
|
||||||
|
|
||||||
if have_header("iconv.h")
|
if have_func("iconv", "iconv.h") or
|
||||||
if !try_compile("", "-Werror") or checking_for("iconv() 2nd argument is const") do
|
have_library("iconv", "iconv") {|s| s.sub(/(?=\n\/\*top\*\/)/, "#include <iconv.h>")}
|
||||||
!try_compile('
|
if checking_for("const of iconv() 2nd argument") do
|
||||||
#include <iconv.h>
|
create_tmpsrc(cpp_include("iconv.h") + "---> iconv(cd,0,0,0,0) <---")
|
||||||
size_t
|
src = xpopen(cpp_command("")) {|f|f.read}
|
||||||
test(iconv_t cd, char **inptr, size_t *inlen, char **outptr, size_t *outlen)
|
if !(func = src[/^--->\s*(\w+).*\s*<---/, 1])
|
||||||
{
|
Logging::message "iconv function name not found"
|
||||||
return iconv(cd, inptr, inlen, outptr, outlen);
|
false
|
||||||
}
|
elsif !(second = src[%r"\b#{func}\s*\(.*?,(.*?),.*?\)\s*;"m, 1])
|
||||||
', "-Werror")
|
Logging::message "prototype for #{func}() not found"
|
||||||
|
false
|
||||||
|
else
|
||||||
|
Logging::message $&+"\n"
|
||||||
|
/\bconst\b/ =~ second
|
||||||
|
end
|
||||||
end
|
end
|
||||||
$defs.push('-DICONV_INPTR_CAST=""')
|
$defs.push('-DICONV_INPTR_CAST=""')
|
||||||
else
|
else
|
||||||
$defs.push('-DICONV_INPTR_CAST="(char **)"')
|
$defs.push('-DICONV_INPTR_CAST="(char **)"')
|
||||||
end
|
end
|
||||||
have_library("iconv")
|
|
||||||
if conf
|
if conf
|
||||||
prefix = '$(srcdir)'
|
prefix = '$(srcdir)'
|
||||||
prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
|
prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue