* ext/curses/extconf.rb: restore $libs and $defs for each

header/library choice.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-02-20 12:09:25 +00:00
Родитель faf4c9db80
Коммит 9f6f0788d2
2 изменённых файлов: 27 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Mon Feb 20 21:08:00 2012 Tanaka Akira <akr@fsij.org>
* ext/curses/extconf.rb: restore $libs and $defs for each
header/library choice.
Mon Feb 20 19:57:26 2012 Tanaka Akira <akr@fsij.org>
* ext/dbm/extconf.rb: weaken header/library consistency check if db is

Просмотреть файл

@ -1,5 +1,16 @@
require 'mkmf'
def transact
old_libs = $libs.dup
old_defs = $defs.dup
result = yield
if !result
$libs = old_libs
$defs = old_defs
end
result
end
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
@ -9,14 +20,21 @@ headers = []
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
have_library("tinfo", "tgetent") or have_library("termcap", "tgetent")
if have_header(*curses=%w"ncurses.h") and (have_library("ncursesw", "initscr") or have_library("ncurses", "initscr"))
curses = nil
if transact { have_header(*curses=%w"ncurses.h") and
(have_library("ncursesw", "initscr") or
have_library("ncurses", "initscr")) }
make=true
elsif have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr")
elsif transact { have_header(*curses=%w"ncurses/curses.h") and
have_library("ncurses", "initscr") }
make=true
elsif have_header(*curses=%w"curses_colr/curses.h") and have_library("cur_colr", "initscr")
elsif transact { have_header(*curses=%w"curses_colr/curses.h") and
have_library("cur_colr", "initscr") }
curses.unshift("varargs.h")
make=true
elsif have_header(*curses=%w"curses.h") and have_library("curses", "initscr")
elsif transact { have_header(*curses=%w"curses.h") and
have_library("curses", "initscr") }
make=true
end