mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix ncurses linking issues
The build configuration for `mruby` assumes only the `ncurses` library needs to be linked because `tinfo` is implicitly pulled in. In environments where ncurses is available only as a static library, `tinfo` needs to be linked explicitly (needed for functions like `tputs`. This patch fixes that by linking `tinfo` if available. It also fixes the build for environments where only the `ncursesw` version of the library (including wide character support) is present, while still giving preference to the `ncurses` version (without wide character support).
This commit is contained in:
@@ -33,6 +33,14 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
|
||||
end
|
||||
if spec.build.cc.search_header_path 'curses.h'
|
||||
spec.linker.libraries << 'ncurses'
|
||||
if spec.build.cc.search_header_path 'term.h'
|
||||
spec.linker.libraries << 'tinfo'
|
||||
end
|
||||
elsif spec.build.cc.search_header_path 'ncursesw/curses.h'
|
||||
spec.linker.libraries << 'ncursesw'
|
||||
if spec.build.cc.search_header_path 'ncursesw/term.h'
|
||||
spec.linker.libraries << 'tinfow'
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif spec.build.cc.search_header_path 'edit/readline/readline.h'
|
||||
|
||||
Reference in New Issue
Block a user