Use header searcher to find readline and linenoise.

This commit is contained in:
take_cheeze
2014-05-01 16:49:00 +09:00
parent b4a702f27d
commit 052fe51279
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -3,7 +3,12 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
spec.author = 'mruby developers'
spec.summary = 'mirb command'
spec.linker.libraries << 'readline' if spec.cc.defines.include? "ENABLE_READLINE"
if spec.build.cc.search_header_path 'readline/readline.h'
spec.cc.defines << "ENABLE_READLINE"
spec.linker.libraries << 'readline'
elsif spec.build.cc.search_header_path 'linenoise.h'
spec.cc.defines << "ENABLE_LINENOISE"
end
spec.bins = %w(mirb)
end
+1 -1
View File
@@ -22,7 +22,7 @@
#define MIRB_WRITE_HISTORY(path) write_history(path)
#define MIRB_READ_HISTORY(path) read_history(path)
#define MIRB_USING_HISTORY() using_history()
#elif ENABLE_LINENOISE
#elif defined(ENABLE_LINENOISE)
#define ENABLE_READLINE
#include <linenoise.h>
#define MIRB_ADD_HISTORY(line) linenoiseHistoryAdd(line)