diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ext/extmk.rb | 2 | ||||
-rw-r--r-- | instruby.rb | 24 | ||||
-rw-r--r-- | win32/Makefile.sub | 5 | ||||
-rw-r--r-- | win32/README.win32 | 27 | ||||
-rwxr-xr-x | win32/configure.bat | 19 | ||||
-rw-r--r-- | win32/setup.mak | 5 |
7 files changed, 68 insertions, 25 deletions
@@ -2,6 +2,17 @@ Mon Dec 29 02:20:54 2003 Dave Thomas <dave@wireless_3.local.thomases.com> * eval.c: Add RDoc for class Proc, Method, UnboundMethod +Mon Dec 29 02:20:26 2003 NAKAMURA Usaku <usa@ruby-lang.org> + + * instruby.rb: fix install directory if destdir and compile_dir are + not in the same drive. + + * ext/extmk.rb: ditto. + + * win32/Makefile.sub, win32/README.win32, win32/configure.bat, + win32/setup.mak: new configure scheme. use ``configure --prefix=dir'' + instead of ``nmake DESTDIR=dir install''. + Mon Dec 29 00:41:44 2003 Dave Thomas <dave@pragprog.com> * math.c: Add RDoc comments diff --git a/ext/extmk.rb b/ext/extmk.rb index fe777a4ceb..4f2ab88ec5 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -149,7 +149,7 @@ def parse_args() end $continue = $mflags.set?(?k) - $mflags |= ["DESTDIR=#{$destdir}"] + $mflags |= ["DESTDIR=#{$destdir}"] unless $destdir.to_s.empty? end parse_args() diff --git a/instruby.rb b/instruby.rb index c5a906a7c5..9e3d0d3fd5 100644 --- a/instruby.rb +++ b/instruby.rb @@ -71,19 +71,29 @@ def makedirs(dirs) super(dirs, :mode => 0755, :verbose => true) unless dirs.empty? end +def join(dir1, dir2) + # same scheme as DESTDIR of lib/mkmf.rb + drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/ + if dir1.empty? || dir2.scan(drive).empty? + dir1 + dir2 + else + dir1 + $' + end +end + exeext = CONFIG["EXEEXT"] ruby_install_name = CONFIG["ruby_install_name"] rubyw_install_name = CONFIG["rubyw_install_name"] version = CONFIG["ruby_version"] -bindir = $destdir+CONFIG["bindir"] -libdir = $destdir+CONFIG["libdir"] -rubylibdir = $destdir+CONFIG["rubylibdir"] -archlibdir = $destdir+CONFIG["archdir"] -sitelibdir = $destdir+CONFIG["sitelibdir"] -sitearchlibdir = $destdir+CONFIG["sitearchdir"] -mandir = File.join($destdir+CONFIG["mandir"], "man") +bindir = join($destdir, CONFIG["bindir"]) +libdir = join($destdir, CONFIG["libdir"]) +rubylibdir = join($destdir, CONFIG["rubylibdir"]) +archlibdir = join($destdir, CONFIG["archdir"]) +sitelibdir = join($destdir, CONFIG["sitelibdir"]) +sitearchlibdir = join($destdir, CONFIG["sitearchdir"]) +mandir = File.join(join($destdir, CONFIG["mandir"]), "man") configure_args = Shellwords.shellwords(CONFIG["configure_args"]) enable_shared = CONFIG["ENABLE_SHARED"] == 'yes' dll = CONFIG["LIBRUBY_SO"] diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 64829a659c..ddbd3e08a9 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -84,9 +84,6 @@ exec_prefix = $(prefix) !if !defined(libdir) libdir = $(exec_prefix)/lib !endif -!if !defined(DESTDIR) -DESTDIR = $(prefix) -!endif !if !defined(CFLAGS) CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) !endif @@ -305,7 +302,7 @@ s,@FFLAGS@,$(FFLAGS),;t t s,@LDFLAGS@,,;t t s,@LIBS@,$(LIBS),;t t s,@exec_prefix@,$${prefix},;t t -s,@prefix@,,;t t +s,@prefix@,$(prefix),;t t s,@program_transform_name@,s,,,,;t t s,@bindir@,$${exec_prefix}/bin,;t t s,@sbindir@,$${exec_prefix}/sbin,;t t diff --git a/win32/README.win32 b/win32/README.win32 index e7d589759c..dffe7c0808 100644 --- a/win32/README.win32 +++ b/win32/README.win32 @@ -6,11 +6,7 @@ (1) Visual C++ 5.0 or later. -(2) If you want to run `((%nmake clean%))' or `((%nmake distclean%))' - properly, you must install UNIX compatible `((%rm%))' command on - your ((|PATH|)) if you want to clean after compile. - -(3) Please set environment variable (({INCLUDE})), (({LIB})), (({PATH})) +(2) Please set environment variable (({INCLUDE})), (({LIB})), (({PATH})) to run required commands properly from the command line. Note: building ruby requires following commands. @@ -19,11 +15,18 @@ * lib * dumpbin +(3) If you want to build from CVS source, following commands are required. + * byacc + * sed + == How to compile and install (1) Execute win32\configure.bat on your build directory. You can specify the target platform as an argument. For example, run `((%configure i686-mswin32%))' + You can also specify the install directory. + For example, run `((%configure --prefix=<install_directory>%))' + Default of the install directory is /usr . (2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile})) if you want to change the name of the executable files. @@ -36,7 +39,7 @@ (5) Run `((%nmake test%))' -(6) Run `((%nmake DESTDIR=<install_directory> install%))' +(6) Run `((%nmake install%))' This command will create following directories and install files onto them. * <install_directory>\bin @@ -81,10 +84,10 @@ in Japanese, but you can download at least. C: cd \ruby - win32\configure + win32\configure --prefix=/usr/local nmake nmake test - nmake DESTDIR=/usr/local install + nmake install * Build on the relative directory from the ruby source directory. @@ -97,10 +100,10 @@ in Japanese, but you can download at least. cd \ruby mkdir mswin32 cd mswin32 - ..\win32\configure + ..\win32\configure --prefix=/usr/local nmake nmake test - nmake DESTDIR=/usr/local install + nmake install * Build on the different drive. @@ -111,10 +114,10 @@ in Japanese, but you can download at least. D: cd D:\build\ruby - C:\src\ruby\win32\configure + C:\src\ruby\win32\configure --prefix=C:/usr/local nmake nmake test - nmake DESTDIR=C:/usr/local install + nmake install == Bugs diff --git a/win32/configure.bat b/win32/configure.bat index 33dd89307c..d61ae6b3ef 100755 --- a/win32/configure.bat +++ b/win32/configure.bat @@ -10,10 +10,13 @@ echo>> ~tmp~.mak @del ~tmp~.mak echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)/setup.mak \
:loop
if "%1" == "" goto :end
+if "%1" == "--prefix" goto :prefix
if "%1" == "--srcdir" goto :srcdir
if "%1" == "srcdir" goto :srcdir
if "%1" == "--target" goto :target
if "%1" == "target" goto :target
+if "%1" == "-h" goto :help
+if "%1" == "--help" goto :help
echo>> ~tmp~.mak "%1" \
shift
goto :loop
@@ -22,11 +25,27 @@ goto :loop shift
shift
goto :loop
+:prefix
+ echo>> ~tmp~.mak "prefix=%2" \
+ shift
+ shift
+goto :loop
:target
echo>> ~tmp~.mak "%2" \
shift
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]
+ del ~tmp~.mak
+goto :exit
:end
echo>> ~tmp~.mak WIN32DIR=$(@D)
nmake -alf ~tmp~.mak
+:exit
diff --git a/win32/setup.mak b/win32/setup.mak index 5f243685ad..188b418b34 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -9,6 +9,9 @@ srcdir = $(WIN32DIR:/win32=) !else srcdir = $(WIN32DIR)/.. !endif +!if "$(prefix)" == "" +prefix = /usr +!endif OS = mswin32 RT = msvcrt INCLUDE = !include @@ -32,6 +35,7 @@ alpha-$(OS): -prologue- -alpha- -epilogue- @type << > $(MAKEFILE) ### Makefile for ruby $(OS) ### srcdir = $(srcdir:\=/) +prefix = $(prefix:\=/) << @cl -nologo -EP -I$(srcdir) <<"Creating $(MAKEFILE)" >> $(MAKEFILE) #include "version.h" @@ -73,7 +77,6 @@ $(CPU) = $(PROCESSOR_LEVEL) # RT = $(RT) # RUBY_INSTALL_NAME = ruby # RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR) -# prefix = /usr # CFLAGS = -nologo -MD $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) # CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\" # STACK = 0x2000000 |