Skip to content

Commit

Permalink
Merge pull request #1820 from nobu/bug/MAKEFILE_CONFIG-misuse
Browse files Browse the repository at this point in the history
Fix misuse of MAKEFILE_CONFIG
  • Loading branch information
flavorjones committed Nov 17, 2018
2 parents 464717b + bf41ba0 commit 9c1dc21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,11 @@ def using_system_libraries?
ENV['CFLAGS'] = "#{ENV['CFLAGS']} -I /usr/local/include"
end

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
if ENV['CC']
RbConfig::CONFIG['CC'] = RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC']
end
# use same c compiler for libxml and libxslt
ENV['CC'] = RbConfig::MAKEFILE_CONFIG['CC']
ENV['CC'] = RbConfig::CONFIG['CC']

$LIBS << " #{ENV["LIBS"]}"

Expand Down Expand Up @@ -432,7 +434,7 @@ def using_system_libraries?
$CPPFLAGS << ' "-Idummypath"'
end

if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
if RbConfig::CONFIG['CC'] =~ /gcc/
$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
$CFLAGS << " -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline"
end
Expand Down

0 comments on commit 9c1dc21

Please sign in to comment.