From 09d3587650488063f06647bd7269fcde15078d94 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 30 Nov 2009 07:54:26 +0000 Subject: [PATCH] * configure.in, win32/Makefile.sub (EXECUTABLE_EXTS): moved from dln.c:dln_find_1(). * lib/mkmf.rb (def find_executable0): use EXECUTABLE_EXTS, not only EXEEXT. [ruby-core:26821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ configure.in | 6 ++++++ dln.c | 2 +- lib/mkmf.rb | 10 +++++++--- version.h | 6 +++--- win32/Makefile.sub | 3 +++ 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9491a05c16..4be92bf0ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Nov 30 16:54:22 2009 Nobuyoshi Nakada + + * configure.in, win32/Makefile.sub (EXECUTABLE_EXTS): moved from + dln.c:dln_find_1(). + + * lib/mkmf.rb (def find_executable0): use EXECUTABLE_EXTS, not + only EXEEXT. [ruby-core:26821] + Thu Nov 26 00:01:58 2009 NAKAMURA, Hiroshi * test/digest/test_digest_extend.rb: Added tests for current digest diff --git a/configure.in b/configure.in index c3b251e607..fd6bfc10a7 100644 --- a/configure.in +++ b/configure.in @@ -1606,6 +1606,12 @@ fi LDFLAGS="-L. $LDFLAGS" AC_SUBST(ARCHFILE) +if test "$EXEEXT" = .exe; then + EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"' + AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS) + AC_SUBST(EXECUTABLE_EXTS) +fi + dnl build rdoc index if requested RDOCTARGET="" AC_ARG_ENABLE(install-doc, diff --git a/dln.c b/dln.c index 17e0bdbee4..5dcac8adae 100644 --- a/dln.c +++ b/dln.c @@ -1703,7 +1703,7 @@ dln_find_1(fname, path, fbuf, size, exe_flag) size_t i, fspace; #ifdef DOSISH static const char extension[][5] = { - ".exe", ".com", ".cmd", ".bat", + EXECUTABLE_EXTS, }; size_t j; int is_abs = 0, has_path = 0; diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 378c158c86..ee995bab4b 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1003,10 +1003,12 @@ end # Internal use only. # def find_executable0(bin, path = nil) - ext = config_string('EXEEXT') + exts = config_string('EXECUTABLE_EXTS') {|s| s.split} || config_string('EXEEXT') {|s| [s]} if File.expand_path(bin) == bin return bin if File.executable?(bin) - ext and File.executable?(file = bin + ext) and return file + if exts + exts.each {|ext| File.executable?(file = bin + ext) and return file} + end return nil end if path ||= ENV['PATH'] @@ -1017,7 +1019,9 @@ def find_executable0(bin, path = nil) file = nil path.each do |dir| return file if File.executable?(file = File.join(dir, bin)) - return file if ext and File.executable?(file << ext) + if exts + exts.each {|ext| File.executable?(ext = file + ext) and return ext} + end end nil end diff --git a/version.h b/version.h index 5144b32e1d..f185250111 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.8.8" -#define RUBY_RELEASE_DATE "2009-11-26" +#define RUBY_RELEASE_DATE "2009-11-30" #define RUBY_VERSION_CODE 188 -#define RUBY_RELEASE_CODE 20091126 +#define RUBY_RELEASE_CODE 20091130 #define RUBY_PATCHLEVEL -1 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 8 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 30 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 7871a895b0..9bfa1bd7f0 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -191,6 +191,7 @@ LIBRUBY_LDSHARED = $(LDSHARED) LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -def:$(RUBYDEF) EXEEXT = .exe +EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat" !if !defined(PROGRAM) PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) !endif @@ -408,6 +409,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define DEFAULT_KCODE KCODE_NONE #define DLEXT ".so" #define DLEXT2 ".dll" +#define EXECUTABLE_EXTS $(EXECUTABLE_EXTS) #define RUBY_LIB "/lib/ruby/$(ruby_version)" #define RUBY_SITE_LIB "/lib/ruby/site_ruby" #define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(ruby_version)" @@ -512,6 +514,7 @@ s,@XCFLAGS@,$(XCFLAGS),;t t s,@XLDFLAGS@,$(XLDFLAGS),;t t s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t s,@ARCH_FLAG@,$(ARCH_FLAG),;t t +s,@EXECUTABLE_EXTS@,$(EXECUTABLE_EXTS),;t t s,@STATIC@,$(STATIC),;t t s,@CCDLFLAGS@,,;t t s,@LDSHARED@,$(LDSHARED),;t t