diff options
| author | KOBAYASHI Shuji <[email protected]> | 2020-11-14 16:14:21 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2020-11-14 16:30:45 +0900 |
| commit | 06a8e502fa7518a0f416b4e6ab86c5815c57925d (patch) | |
| tree | fab3a2e4aebb648a738360a614df8a2f70b4ea26 | |
| parent | 7fb62670a9a8b06066e39048ab792594e8fc2bff (diff) | |
| download | mruby-06a8e502fa7518a0f416b4e6ab86c5815c57925d.tar.gz mruby-06a8e502fa7518a0f416b4e6ab86c5815c57925d.zip | |
Workaround to build `mirb` with Homebrew's readline on Mac; fix #4537
| -rw-r--r-- | mrbgems/mruby-bin-mirb/mrbgem.rake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mirb/mrbgem.rake b/mrbgems/mruby-bin-mirb/mrbgem.rake index a74871d81..a4ae6840a 100644 --- a/mrbgems/mruby-bin-mirb/mrbgem.rake +++ b/mrbgems/mruby-bin-mirb/mrbgem.rake @@ -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 |
