1999-01-20 07:59:32 +03:00
|
|
|
require "mkmf"
|
|
|
|
|
2005-05-19 18:36:20 +04:00
|
|
|
$readline_headers = ["stdio.h"]
|
|
|
|
|
|
|
|
def have_readline_header(header)
|
|
|
|
if have_header(header)
|
|
|
|
$readline_headers.push(header)
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def have_readline_var(var)
|
|
|
|
return have_var(var, $readline_headers)
|
|
|
|
end
|
|
|
|
|
2008-06-22 09:16:30 +04:00
|
|
|
def have_readline_func(func)
|
|
|
|
return have_func(func, $readline_headers)
|
|
|
|
end
|
|
|
|
|
2004-07-15 18:04:09 +04:00
|
|
|
dir_config('curses')
|
|
|
|
dir_config('ncurses')
|
|
|
|
dir_config('termcap')
|
1999-08-13 09:37:52 +04:00
|
|
|
dir_config("readline")
|
2005-05-19 18:36:20 +04:00
|
|
|
enable_libedit = enable_config("libedit")
|
2000-05-13 20:13:31 +04:00
|
|
|
have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
|
2005-05-19 18:36:20 +04:00
|
|
|
have_library("ncurses", "tgetnum") ||
|
|
|
|
have_library("termcap", "tgetnum") ||
|
2000-05-18 08:32:13 +04:00
|
|
|
have_library("curses", "tgetnum")
|
|
|
|
|
2005-05-19 18:36:20 +04:00
|
|
|
if enable_libedit
|
|
|
|
unless (have_readline_header("editline/readline.h") ||
|
|
|
|
have_readline_header("readline/readline.h")) &&
|
|
|
|
have_library("edit", "readline")
|
|
|
|
exit
|
2001-09-06 09:14:06 +04:00
|
|
|
end
|
2005-05-19 18:36:20 +04:00
|
|
|
else
|
|
|
|
unless ((have_readline_header("readline/readline.h") &&
|
|
|
|
have_readline_header("readline/history.h")) &&
|
|
|
|
(have_library("readline", "readline") ||
|
|
|
|
have_library("edit", "readline"))) ||
|
|
|
|
(have_readline_header("editline/readline.h") &&
|
|
|
|
have_library("edit", "readline"))
|
|
|
|
exit
|
2001-09-06 09:14:06 +04:00
|
|
|
end
|
1999-01-20 07:59:32 +03:00
|
|
|
end
|
2005-05-19 18:36:20 +04:00
|
|
|
|
2008-06-22 09:16:30 +04:00
|
|
|
have_readline_func("rl_filename_completion_function")
|
|
|
|
have_readline_func("rl_username_completion_function")
|
|
|
|
have_readline_func("rl_completion_matches")
|
2005-05-19 18:36:20 +04:00
|
|
|
have_readline_var("rl_deprep_term_function")
|
|
|
|
have_readline_var("rl_completion_append_character")
|
|
|
|
have_readline_var("rl_basic_word_break_characters")
|
|
|
|
have_readline_var("rl_completer_word_break_characters")
|
|
|
|
have_readline_var("rl_basic_quote_characters")
|
|
|
|
have_readline_var("rl_completer_quote_characters")
|
|
|
|
have_readline_var("rl_filename_quote_characters")
|
|
|
|
have_readline_var("rl_attempted_completion_over")
|
|
|
|
have_readline_var("rl_library_version")
|
2008-08-11 12:31:45 +04:00
|
|
|
have_readline_var("rl_editing_mode")
|
2008-02-20 17:43:39 +03:00
|
|
|
# workaround for native windows.
|
|
|
|
/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_event_hook")
|
2008-06-22 09:16:30 +04:00
|
|
|
have_readline_func("rl_cleanup_after_signal")
|
|
|
|
have_readline_func("rl_clear_signals")
|
|
|
|
have_readline_func("rl_vi_editing_mode")
|
|
|
|
have_readline_func("rl_emacs_editing_mode")
|
|
|
|
have_readline_func("replace_history_entry")
|
|
|
|
have_readline_func("remove_history")
|
2008-08-01 19:04:37 +04:00
|
|
|
have_readline_func("clear_history")
|
2005-05-19 18:36:20 +04:00
|
|
|
create_makefile("readline")
|