mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5130 from shuujii/workaround-to-build-mirb-with-Homebrews-readline-on-Mac
Workaround to build `mirb` with Homebrew's readline on Mac; fix #4537
This commit is contained in:
@@ -20,6 +20,15 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
|
||||
spec.linker.libraries << 'edit'
|
||||
else
|
||||
spec.linker.libraries << 'readline'
|
||||
if RUBY_PLATFORM.include?('darwin')
|
||||
# Workaround to build with Homebrew's readline on Mac (#4537)
|
||||
lib_path = spec.build.cc.header_search_paths.find do |include_path|
|
||||
lib_path = File.expand_path("#{include_path}/../lib")
|
||||
break lib_path if File.exist?("#{lib_path}/libreadline.dylib") ||
|
||||
File.exist?("#{lib_path}/libreadline.a")
|
||||
end
|
||||
spec.linker.library_paths << lib_path if lib_path
|
||||
end
|
||||
if spec.build.cc.search_header_path 'curses.h'
|
||||
spec.linker.libraries << 'ncurses'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user