From ff9c34b3f410bb41c78d9220c738be86fe8474a7 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 9 Feb 2004 08:48:55 +0000 Subject: * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub, configure.in, runruby.rb: run rdoc, test and so on with compiled extension libraries. [ruby-dev:22688] * ext/extmk.rb, lib/mkmf.rb: make extension libraries in separated directory, similar to the actual directory structure. * lib/fileutils.rb (FileUtils.copy_file): use the mode of the original file to create new file. * lib/rdoc/ri/ri_paths.rb (RI::Paths::SYSDIR): get rid of unexpected influence by envirionment variable. * bcc32/configure.bat, win32/configure.bat: add install-doc options. * win32/win32.c, win32/win32.h (rb_w32_fstat): fix Borland C runtime bug which returns wrong mode. [ruby-dev:22846] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/Makefile.sub | 62 ++++++++++++++++++++++++++++++++++++++++++++--------- win32/configure.bat | 28 ++++++++++++++++++++++++ win32/win32.c | 18 ++++++++++++++++ win32/win32.h | 2 ++ 4 files changed, 100 insertions(+), 10 deletions(-) (limited to 'win32') diff --git a/win32/Makefile.sub b/win32/Makefile.sub index e69ae82458..253f5f5823 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -84,6 +84,24 @@ exec_prefix = $(prefix) !if !defined(libdir) libdir = $(exec_prefix)/lib !endif +!if !defined(datadir) +datadir = $(prefix)/share +!endif +!ifndef EXTOUT +EXTOUT = .ext +!endif +!ifndef RIDATADIR +RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system +!endif +!ifndef TESTUI +TESTUI = console +!endif +!ifndef TESTS +TESTS = +!endif +!ifndef RDOCTARGET +RDOCTARGET = install-doc +!endif !if !defined(CFLAGS) CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) !endif @@ -121,6 +139,8 @@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT) RUBYDEF = $(RUBY_SO_NAME).def MINIRUBY = .\miniruby$(EXEEXT) +RUNRUBY = .\ruby$(EXEEXT) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" -- +EXTCONF = extconf.rb !if !defined(STACK) STACK = 0x2000000 @@ -187,10 +207,11 @@ SCRIPT_ARGS = "--dest-dir=$(DESTDIR)" \ "--make=$(MAKE)" \ "--mflags=$(MFLAGS)" \ "--make-flags=$(MAKEFLAGS)" +EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension="$(EXTS)" --extstatic="$(EXTSTATIC)" all: ext miniruby$(EXEEXT) rbconfig.rb \ $(LIBRUBY) $(MISCLIBS) - @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic=$(EXTSTATIC) $(SCRIPT_ARGS) + @$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) ext: @mkdir $@ @@ -352,7 +373,7 @@ s,@EXEEXT@,.exe,;t t s,@OBJEXT@,obj,;t t s,@XCFLAGS@,$(XCFLAGS),;t t s,@XLDFLAGS@,$(XLDFLAGS),;t t -s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH) -def:$$(DEFFILE),;t t +s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH) -def:$$(DEFFILE) -implib:$$(*F:.so=).lib,;t t s,@ARCH_FLAG@,$(ARCH_FLAG),;t t s,@STATIC@,$(STATIC),;t t s,@CCDLFLAGS@,,;t t @@ -402,9 +423,9 @@ s,@srcdir@,$(srcdir),;t t s,@top_srcdir@,$(srcdir),;t t <> ~tmp~.mak "%1" \ @@ -31,6 +35,21 @@ goto :loop shift shift goto :loop +:suffix + echo>> ~tmp~.mak "RUBY_SUFFIX=%2" \ + shift + shift +goto :loop +:installname + echo>> ~tmp~.mak "RUBY_INSTALL_NAME=%2" \ + shift + shift +goto :loop +:soname + echo>> ~tmp~.mak "RUBY_SO_NAME=%2" \ + shift + shift +goto :loop :target echo>> ~tmp~.mak "%2" \ shift @@ -40,6 +59,14 @@ goto :loop echo>> ~tmp~.mak "EXTSTATIC=static" \ shift goto :loop +:enable-rdoc + echo>> ~tmp~.mak "RDOCTARGET=install-doc" \ + shift +goto :loop +:disable-rdoc + echo>> ~tmp~.mak "RDOCTARGET=install-nodoc" \ + shift +goto :loop :help echo Configuration: echo --help display this help @@ -50,6 +77,7 @@ goto :loop echo --target=TARGET configure for TARGET [i386-mswin32] echo Optional Package: echo --with-static-linked-ext link external modules statically + echo --disable-install-doc do not install rdoc indexes during install del ~tmp~.mak goto :exit :end diff --git a/win32/win32.c b/win32/win32.c index 28fb467768..43c69078d4 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2731,6 +2731,24 @@ isUNCRoot(const char *path) return 0; } +#ifdef __BORLANDC__ +#undef fstat +int +rb_w32_fstat(int fd, struct stat *st) +{ + BY_HANDLE_FILE_INFORMATION info; + int ret = fstat(fd, st); + + if (ret) return ret; + st->st_mode &= ~(S_IWGRP | S_IWOTH); + if (GetFileInformationByHandle((HANDLE)_get_osfhandle(fd), &info) && + !(info.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) { + st->st_mode |= S_IWUSR; + } + return ret; +} +#endif + int rb_w32_stat(const char *path, struct stat *st) { diff --git a/win32/win32.h b/win32/win32.h index 7122ec9a20..33aa60619c 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -113,6 +113,8 @@ extern "C++" { #define write(h, b, l) _write(h, b, l) #define _open _sopen #define sopen _sopen +#undef fstat +#define fstat(fd,st) rb_w32_fstat(fd,st) #endif #define fsync(h) _commit(h) #undef stat -- cgit v1.2.3