mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/curses/extconf.rb: Implement
--with-curses-version={function,variable} configure option for cross-compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a0fa43b094
commit
5e9dc52be5
2 changed files with 54 additions and 30 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Apr 25 23:16:28 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/curses/extconf.rb: Implement
|
||||||
|
--with-curses-version={function,variable} configure option for
|
||||||
|
cross-compiling.
|
||||||
|
|
||||||
Thu Apr 25 18:15:46 2013 Tanaka Akira <akr@fsij.org>
|
Thu Apr 25 18:15:46 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/extconf.rb: Don't use WIDE getaddrinfo by default.
|
* ext/socket/extconf.rb: Don't use WIDE getaddrinfo by default.
|
||||||
|
|
|
@ -77,9 +77,26 @@ if header_library
|
||||||
# SVR4 curses has a (undocumented) variable char *curses_version.
|
# SVR4 curses has a (undocumented) variable char *curses_version.
|
||||||
# ncurses and PDcurses has a function char *curses_version().
|
# ncurses and PDcurses has a function char *curses_version().
|
||||||
# Note that the original BSD curses doesn't provide version information.
|
# Note that the original BSD curses doesn't provide version information.
|
||||||
|
#
|
||||||
|
# configure option:
|
||||||
|
# --with-curses-version=function for SVR4
|
||||||
|
# --with-curses-version=variable for ncurses and PDcurses
|
||||||
|
# (not given) automatically determined
|
||||||
|
|
||||||
|
case with_curses_version = with_config("curses-version")
|
||||||
|
when "function"
|
||||||
|
$defs << '-DHAVE_FUNC_CURSES_VERSION'
|
||||||
|
when "variable"
|
||||||
|
$defs << '-DHAVE_VAR_CURSES_VERSION'
|
||||||
|
when nil
|
||||||
|
function_p = nil
|
||||||
|
variable_p = nil
|
||||||
|
if [header, library].any? {|v| /ncurses|pdcurses|xcurses/i =~ v }
|
||||||
|
function_p = true
|
||||||
|
end
|
||||||
|
if !CROSS_COMPILING
|
||||||
prolog = cpp_include(curses)
|
prolog = cpp_include(curses)
|
||||||
if checking_for(checking_message('function curses_version', curses)) {
|
function_p = checking_for(checking_message('function curses_version', curses)) {
|
||||||
try_run(<<-"End")
|
try_run(<<-"End")
|
||||||
#{prolog}
|
#{prolog}
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -89,10 +106,7 @@ if header_library
|
||||||
}
|
}
|
||||||
End
|
End
|
||||||
}
|
}
|
||||||
$defs << '-DHAVE_FUNC_CURSES_VERSION'
|
variable_p = checking_for(checking_message('variable curses_version', curses)) {
|
||||||
end
|
|
||||||
|
|
||||||
if checking_for(checking_message('variable curses_version', curses)) {
|
|
||||||
try_run(<<-"End")
|
try_run(<<-"End")
|
||||||
#{prolog}
|
#{prolog}
|
||||||
extern char *curses_version;
|
extern char *curses_version;
|
||||||
|
@ -109,7 +123,11 @@ if header_library
|
||||||
}
|
}
|
||||||
End
|
End
|
||||||
}
|
}
|
||||||
$defs << '-DHAVE_VAR_CURSES_VERSION'
|
end
|
||||||
|
$defs << '-DHAVE_FUNC_CURSES_VERSION' if function_p
|
||||||
|
$defs << '-DHAVE_VAR_CURSES_VERSION' if variable_p
|
||||||
|
else
|
||||||
|
warn "unexpeted value for --with-curses-version: #{with_curses_version}"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_makefile("curses")
|
create_makefile("curses")
|
||||||
|
|
Loading…
Add table
Reference in a new issue