[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
Re: [PATCH] lib/mkmf.rb: have_bin()/find_bin()
From:
Sean Chittenden <sean@...>
Date:
2002-08-14 18:11:06 UTC
List:
ruby-core #323
> |Looks fine to me, but I wonder if both are necessary, have_bin > |seems to work good enough even if it were an alias of find_bin. > > I feel like "bin" in have_bin and find_bin (BTW, why both?) is better > to be replaced by "executable". executable works for me, I can update the patch. The reason for both was to keep inline with the style of having both find and have. I suppose you could alias them. Anyway, I've included a slightly updated patch that allows a user to specify a path. If adding an alias is important for API's sake, it's very possible to do. :~) -sc -- Sean Chittenden
Attachments (1)
patch
(857 Bytes, text/x-diff)
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/08/14 18:09:19 @@ -351,6 +351,30 @@ return true end +def find_executable(bin, path = nil) + printf "checking for %s... ", bin + STDOUT.flush + + if path.nil? + path = ENV['PATH'].split(Config::CONFIG['PATH_SEPARATOR']) + else + path = path.split(Config::CONFIG['PATH_SEPARATOR']) + end + + bin += Config::CONFIG['EXEEXT'] + for dir in path + 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