なかだです。

At Wed, 13 Apr 2005 14:45:09 +0900,
U.Nakamura wrote in [ruby-dev:26043]:
> | mkmf.rbのようにドライブレターをDESTDIRのデフォルト値として分離
> | できればいいんですが、command.comとnmake.exeだけじゃ難しそうで
> | す。
> 
> なので、この方法がベストだとは思います。
> 手段がないのだけが問題ですねえ。

これでどうでしょう。まだ試してませんが。


Index: bcc32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/bcc32/Makefile.sub,v retrieving revision 1.71 diff -U2 -p -r1.71 Makefile.sub --- bcc32/Makefile.sub 3 Mar 2005 09:44:32 -0000 1.71 +++ bcc32/Makefile.sub 13 Apr 2005 04:28:34 -0000 @@ -429,5 +429,5 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_ post-install-ext:: $(MINIRUBY) -I$(srcdir)lib -rrbconfig -rfileutils \ - -e 'FileUtils.rm_f(Dir[File.join(Config::CONFIG["archdir"],"**","*.tds")])' + -e 'FileUtils.rm_f(Dir[File.join(ARGV+[Config::CONFIG["archdir"],"**","*.tds"])])' "$(DESTDIR)" clean-local:: Index: bcc32/setup.mak =================================================================== RCS file: /cvs/ruby/src/ruby/bcc32/setup.mak,v retrieving revision 1.13 diff -U2 -p -r1.13 setup.mak --- bcc32/setup.mak 16 Nov 2004 08:37:59 -0000 1.13 +++ bcc32/setup.mak 13 Apr 2005 14:26:46 -0000 @@ -31,10 +31,11 @@ i686-$(OS): -prologue- -i686- -epilogue- alpha-$(OS): -prologue- -alpha- -epilogue- --prologue-: nul +-prologue-: -basic-vars- -prefix- -version- + +-basic-vars-: nul @echo Creating $(MAKEFILE) @type > $(MAKEFILE) &&| \#\#\# Makefile for ruby $(OS) \#\#\# srcdir = $(srcdir:\=/) -prefix = $(prefix:\=/) EXTSTATIC = $(EXTSTATIC) !if defined(RDOCTARGET) @@ -42,4 +43,25 @@ RDOCTARGET = $(RDOCTARGET) !endif | + +-prefix-: nul + @type >prefix.c &&| +#include <ctype.h> +#include <stdio.h> +int main(int argc, char **argv) +{ + char *prefix = argv[1]; + if (isalpha(prefix[0]) && prefix[1] == ':') { + printf("DESTDIR = %c:\n", prefix[0]); + prefix += 2; + } + printf("prefix = %s\n", prefix); + return 0; +} +| + @$(CC) prefix.c > nul + @.\prefix "$(prefix:\=/)" >> $(MAKEFILE) + @del prefix.* + +-version-: nul @cpp32 -I$(srcdir) -P- -DRUBY_EXTERN="//" -o$(MAKEFILE) > nul &&| \#include "version.h" Index: win32/setup.mak =================================================================== RCS file: /cvs/ruby/src/ruby/win32/setup.mak,v retrieving revision 1.22 diff -U2 -p -r1.22 setup.mak --- win32/setup.mak 13 Apr 2005 10:25:41 -0000 1.22 +++ win32/setup.mak 13 Apr 2005 14:18:59 -0000 @@ -33,5 +33,5 @@ i686-$(OS): -prologue- -i686- -epilogue- alpha-$(OS): -prologue- -alpha- -epilogue- --prologue-: -basic-vars- -system-vars- -version- +-prologue-: -basic-vars- -prefix- -system-vars- -version- -basic-vars-: nul @@ -39,5 +39,4 @@ alpha-$(OS): -prologue- -alpha- -epilogu ### Makefile for ruby $(OS) ### srcdir = $(srcdir:\=/) -prefix = $(prefix:\=/) EXTSTATIC = $(EXTSTATIC) !if defined(RDOCTARGET) @@ -46,4 +45,22 @@ RDOCTARGET = $(RDOCTARGET) << +-prefix-: nul + @$(CC) <<prefix.c > nul +#include <ctype.h> +#include <stdio.h> +int main(int argc, char **argv) +{ + char *prefix = argv[1]; + if (isalpha(prefix[0]) && prefix[1] == ':') { + printf("DESTDIR = %c:\n", prefix[0]); + prefix += 2; + } + printf("prefix = %s\n", prefix); + return 0; +} +<< + @.\prefix "$(prefix:\=/)" >> $(MAKEFILE) + @del split.* + -system-vars-: -osname- -runtime- Index: wince/setup.mak =================================================================== RCS file: /cvs/ruby/src/ruby/wince/setup.mak,v retrieving revision 1.9 diff -U2 -p -r1.9 setup.mak --- wince/setup.mak 2 Apr 2005 13:35:02 -0000 1.9 +++ wince/setup.mak 13 Apr 2005 14:33:38 -0000 @@ -1,4 +1,8 @@ # -*- makefile -*- +!ifndef RUBY +RUBY = ruby +!endif + !if "$(srcdir)" != "" WIN32DIR = $(srcdir)/win32 @@ -47,9 +51,10 @@ armv4t-.net41-wince: -prologue- -armv4t- armv4i-sig3-wince: -prologue- -armv4i- -sig3- -epilogue- --prologue-: nul +-prologue-: -basic-vars- -prefix- -version- + +-basic-vars-: nul @type << > $(MAKEFILE) ### Makefile for ruby $(OS) ### srcdir = $(srcdir:\=/) -prefix = $(prefix:\=/) EXTSTATIC = $(EXTSTATIC) !if defined(RDOCTARGET) @@ -57,4 +62,11 @@ RDOCTARGET = $(RDOCTARGET) !endif << + +-prefix-: nul + @$(RUBY) -e 'prefix=ARGV[0]' \ + -e 'puts "DESTDIR = #{$$&}" if prefix.sub!(/\A\w:/, "")' \ + -e 'puts "prefix = #{prefix}"' "$(prefix:\=/)" >> $(MAKEFILE) + +-version-: nul @$(CPP) -I$(srcdir) -DRUBY_EXTERN="//" <<"Creating $(MAKEFILE)" >> $(MAKEFILE) #include "version.h"
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦