1999-01-19 23:59:39 -05:00
|
|
|
require 'mkmf'
|
|
|
|
|
2001-12-31 12:48:33 -05:00
|
|
|
dir_config('curses')
|
|
|
|
dir_config('ncurses')
|
|
|
|
dir_config('termcap')
|
2001-02-18 03:18:47 -05:00
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
make=false
|
2000-05-13 12:13:31 -04:00
|
|
|
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
|
2003-07-04 03:31:10 -04:00
|
|
|
have_library("tinfo", "tgetent") or have_library("termcap", "tgetent")
|
2003-08-18 12:24:42 -04:00
|
|
|
if have_header(*curses=%w"ncurses.h") and have_library("ncurses", "initscr")
|
1999-08-13 01:37:52 -04:00
|
|
|
make=true
|
2003-08-18 12:24:42 -04:00
|
|
|
elsif have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr")
|
1999-08-13 01:37:52 -04:00
|
|
|
make=true
|
2003-08-18 12:24:42 -04:00
|
|
|
elsif 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")
|
1999-08-13 01:37:52 -04:00
|
|
|
make=true
|
1998-01-16 07:13:05 -05:00
|
|
|
end
|
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
if make
|
2003-12-17 01:38:18 -05:00
|
|
|
for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color)
|
1998-01-16 07:13:05 -05:00
|
|
|
have_func(f)
|
|
|
|
end
|
2003-08-18 12:24:42 -04:00
|
|
|
flag = "-D_XOPEN_SOURCE_EXTENDED"
|
|
|
|
src = "int test_var[(sizeof(char*)>sizeof(int))*2-1];"
|
|
|
|
if try_compile(cpp_include(%w[stdio.h stdlib.h]+curses)+src , flag)
|
|
|
|
$defs << flag
|
|
|
|
end
|
1998-01-16 07:13:05 -05:00
|
|
|
create_makefile("curses")
|
|
|
|
end
|