Skip to content

Commit

Permalink
Fix a couple of issues on OpenBSD
Browse files Browse the repository at this point in the history
If the base compiler or compiler specified by CC is clang, then
don't require egcc.

Add /usr/local/include as an include directory when compiling.

With these changes, the current release of OpenBSD should be
able to install nokogiri using gem install.
  • Loading branch information
jeremyevans committed Nov 1, 2017
1 parent 7eb8cf0 commit 6b65ecb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,11 @@ def using_system_libraries?
end

if openbsd? && !using_system_libraries?
ENV['CC'] ||= find_executable('egcc') or
abort "Please install gcc 4.9+ from ports using `pkg_add -v gcc`"
if `#{ENV['CC'] || '/usr/bin/cc'} -v 2>&1` !~ /clang/
ENV['CC'] ||= find_executable('egcc') or
abort "Please install gcc 4.9+ from ports using `pkg_add -v gcc`"
end
ENV['CFLAGS'] = "#{ENV['CFLAGS']} -I /usr/local/include"
end

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
Expand Down

0 comments on commit 6b65ecb

Please sign in to comment.