diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 83401a578a3..ae89b01992b 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -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']