* 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
This commit is contained in:
nobu 2009-11-30 07:54:26 +00:00
parent b47e9619f7
commit 09d3587650
6 changed files with 28 additions and 7 deletions

View file

@ -1,3 +1,11 @@
Mon Nov 30 16:54:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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 <nahi@ruby-lang.org>
* test/digest/test_digest_extend.rb: Added tests for current digest

View file

@ -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,

2
dln.c
View file

@ -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;

View file

@ -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

View file

@ -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[];

View file

@ -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