From: Nobuyoshi Nakada Date: 2008-07-15T21:37:12+09:00 Subject: [ruby-dev:35515] Re: リリース前ToDoリスト なかだです。 At Tue, 15 Jul 2008 21:12:15 +0900, Takao Kouji wrote in [ruby-dev:35514]: > なお、本パッチはconfigureのオプションに--enable-libeditを付けないと、 > 期待通りに動作しません。つまり、修正前のように動作します。 > > --enable-libeditオプションを不要にするため、 > HAVE_EDITLINE_READLINE_Hが定義されているかどうかではなく、 > history_baseの扱いをextconf.rbで判定するようにできれば、 > より良いと思うのですが、その方法は分かりません。 libeditかどうかで判断すればいいのでしょうか。 Index: ext/readline/extconf.rb =================================================================== --- ext/readline/extconf.rb (revision 18073) +++ ext/readline/extconf.rb (working copy) @@ -30,8 +30,9 @@ have_library("ncurses", "tgetnum") || have_library("curses", "tgetnum") +have_libedit = false if enable_libedit unless (have_readline_header("editline/readline.h") || have_readline_header("readline/readline.h")) && - have_library("edit", "readline") + (have_libedit ||= have_library("edit", "readline")) exit end @@ -40,11 +41,17 @@ else have_readline_header("readline/history.h")) && (have_library("readline", "readline") || - have_library("edit", "readline"))) || + (have_libedit ||= have_library("edit", "readline")))) || (have_readline_header("editline/readline.h") && - have_library("edit", "readline")) + (have_libedit ||= have_library("edit", "readline"))) exit end end +if have_libedit + $defs << "-DHISTORY_BASE=(history_base-1)" +else + $defs << "-DHISTORY_BASE=(history_base)" +end + have_readline_func("rl_filename_completion_function") have_readline_func("rl_username_completion_function") -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦