Skip to content

Instantly share code, notes, and snippets.

@akiray03
Created June 24, 2013 02:09
Show Gist options
  • Select an option

  • Save akiray03/5847343 to your computer and use it in GitHub Desktop.

Select an option

Save akiray03/5847343 to your computer and use it in GitHub Desktop.
diff --git a/mrbgems/mruby-bin-mirb/mrbgem.rake b/mrbgems/mruby-bin-mirb/mrbgem.rake
index fd0b202..0cc9bb1 100644
--- a/mrbgems/mruby-bin-mirb/mrbgem.rake
+++ b/mrbgems/mruby-bin-mirb/mrbgem.rake
@@ -2,4 +2,11 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
spec.license = 'MIT'
spec.authors = 'mruby developers'
spec.bins = %w(mirb)
+
+ if MRuby::Build.current && MRuby::Build.current.name == "host"
+ if %w(/usr/include /usr/local/include /usr/pkg/include).any?{|path| File.exist?(File.join path, 'readline') }
+ spec.cc.flags << '-DENABLE_READLINE'
+ spec.linker.libraries << 'readline'
+ end
+ end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment