[#237] object.c ruby.h (fwd) — Robert Skarwecki <skaav@...>

Hello everybody,

42 messages 2002/07/24
[#239] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/24

At Thu, 25 Jul 2002 00:02:28 +0900,

[#240] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/24

GOTO Kentaro <gotoken@notwork.org> writes:

[#246] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/25

At Thu, 25 Jul 2002 05:05:46 +0900,

[#247] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

GOTO Kentaro <gotoken@notwork.org> writes:

[#248] Re: [PATCH] object.c ruby.h (fwd) — nobu.nokada@... 2002/07/25

Hi,

[#249] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

nobu.nokada@softhome.net writes:

[#250] Re: [PATCH] object.c ruby.h (fwd) — nobu.nokada@... 2002/07/25

Hi,

[#252] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/25

At Fri, 26 Jul 2002 03:11:02 +0900,

[#253] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

GOTO Kentaro <gotoken@notwork.org> writes:

Re: [PATCH] lib/mkfm.rb: have_bin()/find_bin()

From: nobu.nokada@...
Date: 2002-07-07 23:42:32 UTC
List: ruby-core #218
Hi,

At Mon, 8 Jul 2002 07:45:21 +0900,
Sean Chittenden wrote:
> > This could be me over looking something, but in mkmf.rb, there is no
> > reliable way to test for an external binary, such as net-snmp-config,
> > which contains much of the linking/compiling information.  Anyway, the
> > attached implements have_bin() and find_bin() methods.  Comments?  -sc

I guess it's better to use CONFIG["EXEEXT"] and
CONFIG["PATH_SEPARATOR"].

> Index: lib/mkmf.rb
> ===================================================================
> RCS file: /src/ruby/lib/mkmf.rb,v
> retrieving revision 1.87
> diff -u -r1.87 mkmf.rb
> --- lib/mkmf.rb	2002/06/28 14:42:46	1.87
> +++ lib/mkmf.rb	2002/07/07 22:42:25
> @@ -351,6 +351,42 @@
>    return true
>  end
>  
> +def have_bin(bin)
> +  printf "checking for %s... ", bin
> +  STDOUT.flush
> +
  +  bin += CONFIG['EXEEXT']
  +  for dir in ENV['PATH'].split(CONFIG['PATH_SEPARATOR'])
> +    file = File.join(dir, bin)
> +    if FileTest.executable?(file)
> +      print "yes\n"
> +      return true
> +    else
> +      next
> +    end
> +  end
> +  print "no\n"
> +  return false
> +end
> +
> +def find_bin(bin)
> +  printf "checking for %s... ", bin
> +  STDOUT.flush
> +
  +  bin += CONFIG['EXEEXT']
  +  for dir in ENV['PATH'].split(CONFIG['PATH_SEPARATOR'])
> +    file = File.join(dir, bin)
> +    if FileTest.executable?(file)
> +      print "yes\n"
> +      return file
> +    else
> +      next
> +    end
> +  end
> +  print "no\n"
> +  return nil
> +end
> +
>  def arg_config(config, default=nil)
>    $configure_args.fetch(config, default)
>  end

In This Thread