1999-01-19 23:59:32 -05:00
|
|
|
require "mkmf"
|
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
dir_config("readline")
|
2000-05-13 12:13:31 -04:00
|
|
|
have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
|
2000-05-18 00:32:13 -04:00
|
|
|
have_library("ncurses", "tgetnum") or
|
|
|
|
have_library("termcap", "tgetnum") or
|
|
|
|
have_library("curses", "tgetnum")
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
if have_header("readline/readline.h") and
|
|
|
|
have_header("readline/history.h") and
|
|
|
|
have_library("readline", "readline")
|
2001-05-06 11:06:00 -04:00
|
|
|
if have_func("rl_filename_completion_function")
|
2001-09-06 01:14:06 -04:00
|
|
|
$CFLAGS += " -DREADLINE_42_OR_LATER"
|
|
|
|
end
|
|
|
|
if have_func("rl_cleanup_after_signal")
|
|
|
|
$CFLAGS += " -DREADLINE_40_OR_LATER"
|
|
|
|
end
|
|
|
|
if try_link(<<EOF, $libs)
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <readline/readline.h>
|
|
|
|
main() {rl_completion_append_character = 1;}
|
|
|
|
EOF
|
|
|
|
# this feature is implemented in readline-2.1 or later.
|
|
|
|
$CFLAGS += " -DREADLINE_21_OR_LATER"
|
2001-05-06 11:06:00 -04:00
|
|
|
end
|
1999-01-19 23:59:32 -05:00
|
|
|
create_makefile("readline")
|
|
|
|
end
|