Skip to content

Commit

Permalink
extconf.rb: use Rbconfig::CONFIG instead of mkmf CONFIG
Browse files Browse the repository at this point in the history
In mkmf.rb CONFIG is defined as CONFIG is defined as RbConfig::MAKEFILE_CONFIG
and RbConfig::MAKEFILE_CONFIG is almost same as RbConfig::CONFIG
except that RbConfig::MAKEFILE_CONFIG uses reference for other variables.

Using CONFIG in extconf.rb causes error with ruby3.2 because now
CONFIG['host_os'] uses reference for target_os variable, and extconf.rb
expects that this variable is all expanded. So instead, use RbConfig::CONFIG .

Closes apalmblad#30
  • Loading branch information
mtasaka committed Dec 1, 2022
1 parent f135b3f commit eab4aba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
else; ''
end

implementation = case CONFIG['host_os']
implementation = case RbConfig::CONFIG['host_os']
when /linux/i; 'shadow'
when /sunos|solaris/i; 'shadow'
when /freebsd|mirbsd|netbsd|openbsd/i; 'pwd'
Expand Down

0 comments on commit eab4aba

Please sign in to comment.