Method: MakeMakefile#enable_config
- Defined in:
- lib/mkmf.rb
#enable_config(config, default = nil) ⇒ Object
Tests for the presence of an --enable-config or --disable-config option. Returns true if the enable option is given, false if the disable option is given, and the default value otherwise.
This can be useful for adding custom definitions, such as debug information.
Example:
if enable_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end
1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 |
# File 'lib/mkmf.rb', line 1612 def enable_config(config, default=nil) if arg_config("--enable-"+config) true elsif arg_config("--disable-"+config) false elsif block_given? yield(config, default) else return default end end |