| 1 |
MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| |
| 2 |
spec.license = 'MIT' |
| 3 |
spec.author = 'mruby developers' |
| 4 |
spec.summary = 'mirb command' |
| 5 |
|
| 6 |
if spec.build.cc.search_header_path 'readline/readline.h' |
| 7 |
spec.cc.defines << "MRB_USE_READLINE" |
| 8 |
spec.cc.defines << "MRB_READLINE_HEADER='<readline/readline.h>'" |
| 9 |
spec.cc.defines << "MRB_READLINE_HISTORY='<readline/history.h>'" |
| 10 |
if spec.build.cc.search_header_path 'termcap.h' |
| 11 |
if MRUBY_BUILD_HOST_IS_CYGWIN || MRUBY_BUILD_HOST_IS_OPENBSD |
| 12 |
if spec.build.cc.search_header_path 'termcap.h' |
| 13 |
if MRUBY_BUILD_HOST_IS_CYGWIN then |
| 14 |
spec.linker.libraries << 'ncurses' |
| 15 |
else |
| 16 |
spec.linker.libraries << 'termcap' |
| 17 |
end |
| 18 |
end |
| 19 |
end |
| 20 |
end |
| 21 |
if RUBY_PLATFORM.include?('netbsd') |
| 22 |
spec.linker.libraries << 'edit' |
| 23 |
else |
| 24 |
spec.linker.libraries << 'readline' |
| 25 |
if RUBY_PLATFORM.include?('darwin') |
| 26 |
# Workaround to build with Homebrew's readline on Mac (#4537) |
| 27 |
lib_path = spec.build.cc.header_search_paths.find do |include_path| |
| 28 |
lib_path = File.expand_path("#{include_path}/../lib") |
| 29 |
break lib_path if File.exist?("#{lib_path}/libreadline.dylib") || |
| 30 |
File.exist?("#{lib_path}/libreadline.a") |
| 31 |
end |
| 32 |
spec.linker.library_paths << lib_path if lib_path |
| 33 |
end |
| 34 |
if spec.build.cc.search_header_path 'curses.h' |
| 35 |
spec.linker.libraries << 'ncurses' |
| 36 |
end |
| 37 |
end |
| 38 |
elsif spec.build.cc.search_header_path 'edit/readline/readline.h' |
| 39 |
spec.cc.defines << "MRB_USE_READLINE" |
| 40 |
spec.cc.defines << "MRB_READLINE_HEADER='<edit/readline/readline.h>'" |
| 41 |
spec.cc.defines << "MRB_READLINE_HISTORY='<edit/readline/history.h>'" |
| 42 |
spec.linker.libraries << "edit" |
| 43 |
elsif spec.build.cc.search_header_path 'linenoise.h' |
| 44 |
spec.cc.defines << "MRB_USE_LINENOISE" |
| 45 |
end |
| 46 |
|
| 47 |
spec.bins = %w(mirb) |
| 48 |
spec.add_dependency('mruby-compiler', :core => 'mruby-compiler') |
| 49 |
end |