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
|
2007-11-15 05:50:34 -05:00
|
|
|
headers = []
|
2008-11-21 13:35:11 -05:00
|
|
|
|
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")
|
2009-01-14 02:19:58 -05:00
|
|
|
if have_header(*curses=%w"ncurses.h") and (have_library("ncursesw", "initscr") or 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
|
2008-12-08 23:31:41 -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 wcolor_set use_default_colors)
|
2007-11-15 05:50:34 -05:00
|
|
|
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
|
1998-01-16 07:13:05 -05:00
|
|
|
end
|
2003-08-18 12:24:42 -04:00
|
|
|
flag = "-D_XOPEN_SOURCE_EXTENDED"
|
2008-07-23 00:53:39 -04:00
|
|
|
if try_static_assert("sizeof(char*)>sizeof(int)", %w[stdio.h stdlib.h]+curses , flag)
|
2003-08-18 12:24:42 -04:00
|
|
|
$defs << flag
|
|
|
|
end
|
2008-11-21 13:35:11 -05:00
|
|
|
have_var("ESCDELAY", curses)
|
2008-12-08 23:31:41 -05:00
|
|
|
have_var("TABSIZE", curses)
|
1998-01-16 07:13:05 -05:00
|
|
|
create_makefile("curses")
|
|
|
|
end
|