diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-28 20:26:33 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-28 20:26:33 +0900 |
| commit | eb68adafa1d28ac6adc78057624ba315d7fe2790 (patch) | |
| tree | 64a113a0ad69ba627e9e50b3615749cf19b44a6c | |
| parent | 03eb3b5e87ea18bfbfe3731a23ae103ab48198a4 (diff) | |
| parent | 15a7d5be3d75d85d357fcf7ee6581f09181c3c2c (diff) | |
| download | mruby-eb68adafa1d28ac6adc78057624ba315d7fe2790.tar.gz mruby-eb68adafa1d28ac6adc78057624ba315d7fe2790.zip | |
Merge pull request #5367 from dearblue/libedit
Support libedit on mirb for FreeBSD
| -rw-r--r-- | mrbgems/mruby-bin-mirb/mrbgem.rake | 7 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mrbgems/mruby-bin-mirb/mrbgem.rake b/mrbgems/mruby-bin-mirb/mrbgem.rake index fa0947cfa..c31ac7ae9 100644 --- a/mrbgems/mruby-bin-mirb/mrbgem.rake +++ b/mrbgems/mruby-bin-mirb/mrbgem.rake @@ -5,6 +5,8 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| if spec.build.cc.search_header_path 'readline/readline.h' spec.cc.defines << "MRB_USE_READLINE" + spec.cc.defines << "MRB_READLINE_HEADER='<readline/readline.h>'" + spec.cc.defines << "MRB_READLINE_HISTORY='<readline/history.h>'" if spec.build.cc.search_header_path 'termcap.h' if MRUBY_BUILD_HOST_IS_CYGWIN || MRUBY_BUILD_HOST_IS_OPENBSD if spec.build.cc.search_header_path 'termcap.h' @@ -33,6 +35,11 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| spec.linker.libraries << 'ncurses' end end + elsif spec.build.cc.search_header_path 'edit/readline/readline.h' + spec.cc.defines << "MRB_USE_READLINE" + spec.cc.defines << "MRB_READLINE_HEADER='<edit/readline/readline.h>'" + spec.cc.defines << "MRB_READLINE_HISTORY='<edit/readline/history.h>'" + spec.linker.libraries << "edit" elsif spec.build.cc.search_header_path 'linenoise.h' spec.cc.defines << "MRB_USE_LINENOISE" end diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index 243666acd..8cc756174 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -39,8 +39,8 @@ #endif #ifdef MRB_USE_READLINE -#include <readline/readline.h> -#include <readline/history.h> +#include MRB_READLINE_HEADER +#include MRB_READLINE_HISTORY #define MIRB_ADD_HISTORY(line) add_history(line) #define MIRB_READLINE(ch) readline(ch) #if !defined(RL_READLINE_VERSION) || RL_READLINE_VERSION < 0x600 |
