mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@25964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9713d84b5b
commit
7b5ea0ec2f
5 changed files with 25 additions and 4 deletions
|
@ -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]
|
||||||
|
|
||||||
Mon Nov 30 11:00:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Nov 30 11:00:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (parser_yylex): suppress an extra error message after
|
* parse.y (parser_yylex): suppress an extra error message after
|
||||||
|
|
|
@ -2175,6 +2175,12 @@ fi
|
||||||
LDFLAGS="-L. $LDFLAGS"
|
LDFLAGS="-L. $LDFLAGS"
|
||||||
AC_SUBST(ARCHFILE)
|
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 }
|
dnl }
|
||||||
dnl build section {
|
dnl build section {
|
||||||
|
|
||||||
|
|
2
dln.c
2
dln.c
|
@ -1552,7 +1552,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
|
||||||
size_t i, fspace;
|
size_t i, fspace;
|
||||||
#ifdef DOSISH
|
#ifdef DOSISH
|
||||||
static const char extension[][5] = {
|
static const char extension[][5] = {
|
||||||
".exe", ".com", ".cmd", ".bat",
|
EXECUTABLE_EXTS,
|
||||||
};
|
};
|
||||||
size_t j;
|
size_t j;
|
||||||
int is_abs = 0, has_path = 0;
|
int is_abs = 0, has_path = 0;
|
||||||
|
|
10
lib/mkmf.rb
10
lib/mkmf.rb
|
@ -1123,10 +1123,12 @@ end
|
||||||
# Internal use only.
|
# Internal use only.
|
||||||
#
|
#
|
||||||
def find_executable0(bin, path = nil)
|
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
|
if File.expand_path(bin) == bin
|
||||||
return bin if File.executable?(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
|
return nil
|
||||||
end
|
end
|
||||||
if path ||= ENV['PATH']
|
if path ||= ENV['PATH']
|
||||||
|
@ -1137,7 +1139,9 @@ def find_executable0(bin, path = nil)
|
||||||
file = nil
|
file = nil
|
||||||
path.each do |dir|
|
path.each do |dir|
|
||||||
return file if File.executable?(file = File.join(dir, bin))
|
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
|
end
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -242,6 +242,7 @@ LIBRUBY_LDSHARED = $(LDSHARED)
|
||||||
LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF)
|
LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF)
|
||||||
|
|
||||||
EXEEXT = .exe
|
EXEEXT = .exe
|
||||||
|
EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat"
|
||||||
!if !defined(PROGRAM)
|
!if !defined(PROGRAM)
|
||||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||||
!endif
|
!endif
|
||||||
|
@ -563,6 +564,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
|
||||||
#define DEFAULT_KCODE KCODE_NONE
|
#define DEFAULT_KCODE KCODE_NONE
|
||||||
#define LOAD_RELATIVE 1
|
#define LOAD_RELATIVE 1
|
||||||
#define DLEXT ".so"
|
#define DLEXT ".so"
|
||||||
|
#define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
|
||||||
#define RUBY_LIB_VERSION_STYLE 3 /* full */
|
#define RUBY_LIB_VERSION_STYLE 3 /* full */
|
||||||
#define RUBY_LIB_PREFIX "/lib/$(RUBY_BASE_NAME)"
|
#define RUBY_LIB_PREFIX "/lib/$(RUBY_BASE_NAME)"
|
||||||
#define RUBY_LIB RUBY_LIB_PREFIX"/"RUBY_LIB_VERSION
|
#define RUBY_LIB RUBY_LIB_PREFIX"/"RUBY_LIB_VERSION
|
||||||
|
@ -662,6 +664,7 @@ s,@LIBOBJS@,$(LIBOBJS),;t t
|
||||||
s,@ALLOCA@,$(ALLOCA),;t t
|
s,@ALLOCA@,$(ALLOCA),;t t
|
||||||
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
|
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
|
||||||
s,@EXEEXT@,.exe,;t t
|
s,@EXEEXT@,.exe,;t t
|
||||||
|
s,@EXECUTABLE_EXTS@,$(EXECUTABLE_EXTS),;t t
|
||||||
s,@OBJEXT@,$(OBJEXT),;t t
|
s,@OBJEXT@,$(OBJEXT),;t t
|
||||||
s,@XCFLAGS@,$(XCFLAGS),;t t
|
s,@XCFLAGS@,$(XCFLAGS),;t t
|
||||||
s,@XLDFLAGS@,$(XLDFLAGS),;t t
|
s,@XLDFLAGS@,$(XLDFLAGS),;t t
|
||||||
|
|
Loading…
Reference in a new issue