Skip to content

Commit

Permalink
see ChangeLog.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
eban committed May 29, 2000
1 parent bbd798c commit 27351b9
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 78 deletions.
20 changes: 20 additions & 0 deletions ChangeLog
@@ -1,3 +1,23 @@
Sun May 28 21:37:13 2000 WATANABE Hirofumi <eban@os.rim.or.jp>

* eval.c: bug fix: DLEXT2.

Sun May 28 19:21:43 2000 WATANABE Hirofumi <eban@os.rim.or.jp>

* win32/win32.c: use ruby's glob.

* dir.c: "glob" exported and renamed to "rb_glob".

* ruby.h: ditto.

* main.c: turn off command line mingw32's globbing.

Wed May 25 22:25:13 2000 WATANABE Hirofumi <eban@os.rim.or.jp>

* ext/extmk.rb.in: use "ftools" instead of "rm -f".

* lib/mkmf.rb: ditto.

Wed May 24 23:17:50 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>

* win32/Makefile: remove unnecessary mv and rm command call.
Expand Down
12 changes: 6 additions & 6 deletions dir.c
Expand Up @@ -558,8 +558,8 @@ extract_elem(path)
# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
#endif

static void
glob(path, func, arg)
void
rb_glob(path, func, arg)
char *path;
void (*func)();
VALUE arg;
Expand Down Expand Up @@ -598,7 +598,7 @@ glob(path, func, arg)
recursive = 1;
buf = ALLOC_N(char, strlen(base)+strlen(m)+3);
sprintf(buf, "%s%s%s", base, (*base)?"":".", m);
glob(buf, func, arg);
rb_glob(buf, func, arg);
free(buf);
}
dirp = opendir(dir);
Expand All @@ -614,7 +614,7 @@ glob(path, func, arg)
continue;
buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+strlen(m)+6);
sprintf(buf, "%s%s%s/**%s", base, (BASE)?"/":"", dp->d_name, m);
glob(buf, func, arg);
rb_glob(buf, func, arg);
free(buf);
continue;
}
Expand Down Expand Up @@ -643,7 +643,7 @@ glob(path, func, arg)
char *t = ALLOC_N(char, len+mlen+1);

sprintf(t, "%s%s", link->path, m);
glob(t, func, arg);
rb_glob(t, func, arg);
free(t);
}
tmp = link;
Expand All @@ -669,7 +669,7 @@ push_globs(ary, s)
VALUE ary;
char *s;
{
glob(s, push_pattern, ary);
rb_glob(s, push_pattern, ary);
}

static void
Expand Down
14 changes: 12 additions & 2 deletions eval.c
Expand Up @@ -4970,8 +4970,11 @@ rb_f_require(obj, fname)
strcpy(ext, DLEXT);
file = feature = buf;
}
file = rb_find_file(file);
if (file) goto load_dyna;
#ifdef DLEXT2
else if (strcmp(ext, DLEXT2) != 0) {
file = feature = RSTRING(fname)->ptr;
if (strcmp(ext, DLEXT2) != 0) {
buf = ALLOCA_N(char, strlen(file)+sizeof(DLEXT2)+4);
strcpy(buf, feature);
ext = strrchr(buf, '.');
Expand All @@ -4980,15 +4983,22 @@ rb_f_require(obj, fname)
strcpy(ext, DLEXT2);
file = feature = buf;
}
#endif
file = rb_find_file(file);
if (file) goto load_dyna;
#endif
}
else if (strcmp(DLEXT, ext) == 0) {
feature = RSTRING(fname)->ptr;
file = rb_find_file(feature);
if (file) goto load_dyna;
}
#ifdef DLEXT2
else if (strcmp(DLEXT2, ext) == 0) {
feature = RSTRING(fname)->ptr;
file = rb_find_file(feature);
if (file) goto load_dyna;
}
#endif
}
buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5);
strcpy(buf, RSTRING(fname)->ptr);
Expand Down
36 changes: 24 additions & 12 deletions ext/extmk.rb.in
Expand Up @@ -32,6 +32,17 @@ $:.push $top_srcdir+"/lib"

require 'find'

def rm_f(*files)
targets = []
for file in files
targets.concat Dir[file]
end
if not targets.empty?
File::chmod 0777, *targets
File::unlink *targets
end
end

def older(file1, file2)
if !File.exist?(file1) then
return true
Expand Down Expand Up @@ -85,7 +96,7 @@ def try_link(src, opt="")
begin
try_link0(src, opt)
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -96,7 +107,7 @@ def try_cpp(src, opt="")
begin
xsystem(format(CPP, $CFLAGS, opt))
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -107,7 +118,7 @@ def egrep_cpp(pat, src, opt="")
begin
xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, opt))
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -123,7 +134,7 @@ def try_run(src, opt="")
nil
end
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand Down Expand Up @@ -318,7 +329,7 @@ end
def create_makefile(target)
$target = target

system "rm -f conftest*"
rm_f "conftest*"
if "@DLEXT@" == $OBJEXT
libs = $libs.split
for lib in libs
Expand Down Expand Up @@ -406,15 +417,16 @@ TARGET = #{target}
DLLIB = $(TARGET).#{$static ? $LIBEXT : "@DLEXT@"}
RUBY = #{ruby_interpreter} -I$(topdir) -I$(hdrdir)/lib
RM = $(RUBY) -r ftools -e "File::rm_f *Dir[ARGV.join ' ']"
EXEEXT = @EXEEXT@
all: $(DLLIB)
clean:; @rm -f *.#{$OBJEXT} *.so *.sl *.#{$LIBEXT} $(DLLIB)
@rm -f *.ilk *.exp *.pdb *.bak
@rm -f Makefile extconf.h conftest.*
@rm -f core ruby$(EXEEXT) *~
clean:; @$(RM) *.#{$OBJEXT} *.so *.sl *.#{$LIBEXT} $(DLLIB)
@$(RM) *.ilk *.exp *.pdb *.bak
@$(RM) Makefile extconf.h conftest.*
@$(RM) core ruby$(EXEEXT) *~
realclean: clean
EOS
Expand Down Expand Up @@ -558,7 +570,7 @@ def extmake(target)
$extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == ""
end
ensure
system "rm -f conftest*"
rm_f "conftest*"
Dir.chdir ".."
end
end
Expand Down Expand Up @@ -648,7 +660,7 @@ if $extlist.size > 0
Dir.chdir ".."

if older(ruby, "#{$top_srcdir}/ext/@setup@") or older(ruby, miniruby)
system("rm -f #{ruby}")
rm_f ruby
end

$extobjs = "ext/extinit.#{$OBJEXT} " + $extobjs
Expand All @@ -659,7 +671,7 @@ if $extlist.size > 0
else
Dir.chdir ".."
if older(ruby, miniruby)
system("rm -f #{ruby}")
rm_f ruby
system("#{$make} #{ruby}")
end
end
Expand Down
30 changes: 21 additions & 9 deletions lib/mkmf.rb
Expand Up @@ -41,6 +41,17 @@
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
CPP = "#{CONFIG['CPP']} -E -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"

def rm_f(*files)
targets = []
for file in files
targets.concat Dir[file]
end
if not targets.empty?
File::chmod 0777, *targets
File::unlink *targets
end
end

$orgerr = $stderr.dup
$orgout = $stdout.dup
def xsystem command
Expand All @@ -67,7 +78,7 @@ def try_link(src, opt="")
begin
try_link0(src, opt)
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -78,7 +89,7 @@ def try_cpp(src, opt="")
begin
xsystem(format(CPP, $CFLAGS, opt))
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -89,7 +100,7 @@ def egrep_cpp(pat, src, opt="")
begin
xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, opt))
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand All @@ -105,7 +116,7 @@ def try_run(src, opt="")
nil
end
ensure
system "rm -f conftest*"
rm_f "conftest*"
end
end

Expand Down Expand Up @@ -317,7 +328,7 @@ def dir_config(target)

def create_makefile(target)
print "creating Makefile\n"
system "rm -f conftest*"
rm_f "conftest*"
STDOUT.flush
if CONFIG["DLEXT"] == $OBJEXT
libs = $libs.split
Expand Down Expand Up @@ -387,15 +398,16 @@ def create_makefile(target)
DLLIB = $(TARGET).#{CONFIG["DLEXT"]}
RUBY = #{CONFIG["ruby_install_name"]}
RM = $(RUBY) -r ftools -e 'File::rm_f *Dir[ARGV.join " "]'
EXEEXT = #{CONFIG["EXEEXT"]}
all: $(DLLIB)
clean:; @rm -f *.#{$OBJEXT} *.so *.sl *.a $(DLLIB)
@rm -f $(TARGET).lib $(TARGET).exp
@rm -f Makefile extconf.h conftest.*
@rm -f core ruby$(EXEEXT) *~
clean:; @$(RM) *.#{$OBJEXT} *.so *.sl *.a $(DLLIB)
@$(RM) $(TARGET).lib $(TARGET).exp
@$(RM) Makefile extconf.h conftest.*
@$(RM) core ruby$(EXEEXT) *~
realclean: clean
Expand Down
4 changes: 4 additions & 0 deletions main.c
Expand Up @@ -20,6 +20,10 @@ unsigned int _stklen = 0x180000;
int _stacksize = 262144;
#endif

#if defined __MINGW32__
int _CRT_glob = 0;
#endif

#if defined(__MACOS__) && defined(__MWERKS__)
#include <console.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions ruby.h
Expand Up @@ -389,6 +389,8 @@ void xfree _((void*));
#define MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n))
#define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))

void rb_glob _((char*,void(*)(),VALUE));

VALUE rb_define_class _((const char*,VALUE));
VALUE rb_define_module _((const char*));
VALUE rb_define_class_under _((VALUE, const char*, VALUE));
Expand Down
4 changes: 2 additions & 2 deletions version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4"
#define RUBY_RELEASE_DATE "2000-05-25"
#define RUBY_RELEASE_DATE "2000-05-28"
#define RUBY_VERSION_CODE 154
#define RUBY_RELEASE_CODE 20000525
#define RUBY_RELEASE_CODE 20000528

0 comments on commit 27351b9

Please sign in to comment.