summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-28 17:25:31 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-28 17:25:31 +0000
commit923b55d35b560d11f13eea802a0f246a3c908ae6 (patch)
tree78f49d70fe2e0acd2a70e9a4c2fa062a858cf02f /win32
parentbb2030498a14f28686472fb93fe492192f48c606 (diff)
* 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''. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.sub5
-rw-r--r--win32/README.win3227
-rwxr-xr-xwin32/configure.bat19
-rw-r--r--win32/setup.mak5
4 files changed, 39 insertions, 17 deletions
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