Unverified Commit eb68adaf authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5367 from dearblue/libedit

Support libedit on mirb for FreeBSD
parents 03eb3b5e 15a7d5be
...@@ -5,6 +5,8 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| ...@@ -5,6 +5,8 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
if spec.build.cc.search_header_path 'readline/readline.h' if spec.build.cc.search_header_path 'readline/readline.h'
spec.cc.defines << "MRB_USE_READLINE" 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 spec.build.cc.search_header_path 'termcap.h'
if MRUBY_BUILD_HOST_IS_CYGWIN || MRUBY_BUILD_HOST_IS_OPENBSD if MRUBY_BUILD_HOST_IS_CYGWIN || MRUBY_BUILD_HOST_IS_OPENBSD
if spec.build.cc.search_header_path 'termcap.h' if spec.build.cc.search_header_path 'termcap.h'
...@@ -33,6 +35,11 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| ...@@ -33,6 +35,11 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
spec.linker.libraries << 'ncurses' spec.linker.libraries << 'ncurses'
end end
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' elsif spec.build.cc.search_header_path 'linenoise.h'
spec.cc.defines << "MRB_USE_LINENOISE" spec.cc.defines << "MRB_USE_LINENOISE"
end end
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#endif #endif
#ifdef MRB_USE_READLINE #ifdef MRB_USE_READLINE
#include <readline/readline.h> #include MRB_READLINE_HEADER
#include <readline/history.h> #include MRB_READLINE_HISTORY
#define MIRB_ADD_HISTORY(line) add_history(line) #define MIRB_ADD_HISTORY(line) add_history(line)
#define MIRB_READLINE(ch) readline(ch) #define MIRB_READLINE(ch) readline(ch)
#if !defined(RL_READLINE_VERSION) || RL_READLINE_VERSION < 0x600 #if !defined(RL_READLINE_VERSION) || RL_READLINE_VERSION < 0x600
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment