diff options
Diffstat (limited to 'ext/curses/extconf.rb')
-rw-r--r-- | ext/curses/extconf.rb | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 9c7ca0e..7bebc1f 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -30,9 +30,9 @@ have_library("tinfo", "tgetent") or have_library("termcap", "tgetent") header_library = nil [ + ["ncursesw/curses.h", ["ncursesw"]], ["ncurses.h", ["ncursesw", "ncurses"]], ["ncurses/curses.h", ["ncurses"]], - ["ncursesw/curses.h", ["ncursesw"]], ["curses_colr/curses.h", ["cur_colr"]], ["curses.h", ["curses", "pdcurses"]], # ["xcurses.h", ["XCurses"]], # XCurses (PDCurses for X11) @@ -57,17 +57,20 @@ if header_library for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm - scrl set setscrreg ungetch + scrl set setscrreg ungetch addnwstr wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr - wresize wscrl wsetscrreg + wresize wscrl wsetscrreg werase redrawwin waddnwstr + touchwin untouchwin wtouchln is_linetouched is_wintouched def_prog_mode reset_prog_mode timeout wtimeout nodelay - init_color wcolor_set use_default_colors newpad) + init_color wcolor_set use_default_colors assume_default_colors + newpad unget_wch get_wch wget_wch PDC_get_key_modifiers) have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase))) end + convertible_int('chtype', [["#undef MOUSE_MOVED\n"]]+curses) or abort flag = "-D_XOPEN_SOURCE_EXTENDED" - if try_static_assert("sizeof(char*)>sizeof(int)", - %w[stdio.h stdlib.h]+curses, - flag) + if checking_for("_XOPEN_SOURCE_EXTENDED") { + try_compile(cpp_include(%w[stdio.h stdlib.h]+curses), flag, :werror => true) + } $defs << flag end have_var("ESCDELAY", curses) @@ -129,8 +132,17 @@ if header_library else warn "unexpected value for --with-curses-version: #{with_curses_version}" end - + + if enable_config("pdcurses-wide") + $defs << '-DPDC_WIDE' + end + + if enable_config("pdcurses-dll") + $defs << '-DPDC_DLL_BUILD' + end + if RUBY_VERSION >= '2.1' + create_header create_makefile("curses") else # curses is part of ruby-core pre-2.1.0, so this gem is not required. But |