Passing arguments to extconf.rb

Hello list,

To get a --debug flag accepted by extconf.rb, I’ve put this function in
it:

def have_flag(flag)
if $configure_args[’–’+flag]
$defs.push("-D#{flag.upcase}")
return true
end
return false
end

Does anyone know if this functionality was already hiding somewhere and if
not, whether I should use “$configure_args”. It isn’t documented
anywhere…

(I think this hasn’t been discussed to death yet :slight_smile: )

Danny

Hi,

To get a --debug flag accepted by extconf.rb, I’ve put this function in
it:

def have_flag(flag)
if $configure_args[’–’+flag]
$defs.push("-D#{flag.upcase}")
return true
end
return false
end

mkmf.rb has arg_config, but it doesn’t change any global status
including $defs.

How about this?

def have_flag(flag, default)
return false if arg_config("–no-#{flag}")
return false unless val = arg_config("–#{flag}", default)
flag = “-D” << flag.tr(’-a-z’, ‘_A-Z’)
flag << “=#{val}” if String === val
$defs.push(flag)
true
end

···

At Sun, 4 Aug 2002 03:36:27 +0900, Danny van Bruggen wrote:


Nobu Nakada