From f10b6000896446b8426110ab5b4e4823c04a2d2d 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: http://svn.ruby-lang.org/repos/ruby/trunk@5659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bcc32/Makefile.sub | 60 +++++++++++++++++++++++++++++++++++++++++++++-------- bcc32/configure.bat | 49 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 97 insertions(+), 12 deletions(-) (limited to 'bcc32') diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index 5c2a744d3..7c748ce47 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -91,9 +91,27 @@ exec_prefix = $(prefix) !ifndef libdir libdir = $(exec_prefix)/lib !endif +!if !defined(datadir) +datadir = $(prefix)/share +!endif !ifndef DESTDIR DESTDIR = $(prefix) !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 !ifndef CFLAGS CFLAGS = -q $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- !endif @@ -135,6 +153,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 ORGLIBPATH = $(LIB) @@ -194,10 +214,11 @@ SCRIPT_ARGS = "--dest-dir=$(DESTDIR)" \ "--make=$(MAKE)" \ "--mflags=$(MFLAGS)" \ "--make-flags=$(MAKEFLAGS)" +EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension="$(EXTS)" --extstatic="$(EXTSTATIC)" all: miniruby$(EXEEXT) rbconfig.rb \ $(LIBRUBY) $(MISCLIBS) - .\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) $(SCRIPT_ARGS) + @$(MINIRUBY) $(srcdir)ext/extmk.rb $(EXTMK_ARGS) ruby: $(PROGRAM) rubyw: $(WPROGRAM) @@ -400,9 +421,9 @@ s,@srcdir@,$(srcdir),;t t s,@top_srcdir@,$(srcdir),;t t | -miniruby$(EXEEXT): $(LIBRUBY_A) $(MAINOBJ) dmyext.obj +miniruby$(EXEEXT): $(LIBRUBY_A) $(MAINOBJ) @echo $(LIBS) - $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) dmyext.obj,$@,nul,$(LIBRUBY_A) $(LIBS) + $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBY_A) $(LIBS) $(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res @@ -424,13 +445,27 @@ $(LIBRUBY_SO) $(LIBRUBY): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res $(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT) $(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A) -install: rbconfig.rb +install: install-nodoc $(RDOCTARGET) +install-all: install-nodoc install-doc + +install-nodoc: install-local install-ext +install-local: rbconfig.rb $(MINIRUBY) $(srcdir)instruby.rb $(SCRIPT_ARGS) - $(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) install +install-ext: rbconfig.rb + $(MINIRUBY) $(srcdir)ext/extmk.rb $(EXTMK_ARGS) install -what-where no-install: rbconfig.rb +what-where-all no-install-all: no-install no-install-doc +what-where no-install: no-install-local no-install-ext +what-where-local: no-install-local +no-install-local: rbconfig.rb $(MINIRUBY) $(srcdir)instruby.rb -n $(SCRIPT_ARGS) - $(MINIRUBY) $(srcdir)ext/extmk.rb -n $(SCRIPT_ARGS) install +what-where-ext: no-install-ext +no-install-ext: rbconfig.rb + $(MINIRUBY) $(srcdir)ext/extmk.rb -n $(EXTMK_ARGS) install + +install-doc: $(PROGRAM) + @echo Generating RDoc documentation + $(RUNRUBY) "$(srcdir)bin/rdoc" --all --ri --op "$(RIDATADIR)" "$(srcdir)" clean: clean-ext clean-local @@ -447,7 +482,7 @@ clean-local: @if exist *.il? del *.il? clean-ext: - @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) clean + @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(EXTMK_ARGS) clean distclean: distclean-ext distclean-local @@ -481,7 +516,7 @@ distclean-local: clean-local @if exist miniruby$(EXEEXT) del miniruby$(EXEEXT) distclean-ext: - @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) distclean + @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(EXTMK_ARGS) distclean realclean: distclean @if exist parse.c del parse.c @@ -490,6 +525,13 @@ realclean: distclean test: miniruby$(EXEEXT) NUL @$(MINIRUBY) $(srcdir)rubytest.rb +test-all: + $(RUNRUBY) -C "$(srcdir)test" runner.rb --runner=$(TESTUI) $(TESTS) + +extconf: + $(MINIRUBY) -run -e mkdir -- -p "$(EXTCONFDIR)" + $(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS) + rbconfig.rb: miniruby$(EXEEXT) config.status @$(MINIRUBY) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \ -install_name=$(RUBY_INSTALL_NAME) \ diff --git a/bcc32/configure.bat b/bcc32/configure.bat index 449b6e25b..6ca467d79 100644 --- a/bcc32/configure.bat +++ b/bcc32/configure.bat @@ -15,18 +15,61 @@ if "%1" == "--srcdir" goto :srcdir if "%1" == "srcdir" goto :srcdir if "%1" == "--target" goto :target if "%1" == "target" goto :target - echo>> ~tmp~.mak "%1" +if "%1" == "--program-suffix" goto :suffix +if "%1" == "--program-name" goto :progname +if "%1" == "--enable-install-doc" goto :enable-rdoc +if "%1" == "--disable-install-doc" goto :disable-rdoc +if "%1" == "-h" goto :help +if "%1" == "--help" goto :help + echo>> ~tmp~.mak "%1" \ shift goto :loop :srcdir - echo>> ~tmp~.mak "srcdir=%2" + echo>> ~tmp~.mak -D"srcdir=%2" \ + shift + shift +goto :loop +:suffix + echo>> ~tmp~.mak -D"RUBY_SUFFIX=%2" \ + shift + shift +goto :loop +:installname + echo>> ~tmp~.mak -D"RUBY_INSTALL_NAME=%2" \ + shift + shift +goto :loop +:soname + echo>> ~tmp~.mak -D"RUBY_SO_NAME=%2" \ shift shift goto :loop :target - echo>> ~tmp~.mak %2 + echo>> ~tmp~.mak %2 \ + shift shift +goto :loop +:enable-rdoc + echo>> ~tmp~.mak -D"RDOCTARGET=install-doc" \ + shift +goto :loop +:disable-rdoc + echo>> ~tmp~.mak -D"RDOCTARGET=install-nodoc" \ shift goto :loop +:help + echo Configuration: + echo --help display this help + echo --srcdir=DIR find the sources in DIR [configure dir or `..'] + echo Installation directories: + echo --prefix=PREFIX install files in PREFIX [/usr] + echo System types: + 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 +echo.>> ~tmp~.mak make -s -f ~tmp~.mak -- cgit