なかだです。

At Sun, 17 Apr 2005 17:39:08 +0900,
H.Yamamoto wrote in [ruby-dev:26078]:
> 最終的なパッチは、
> 
> [ruby-dev:26049] {bcc32,win32,wince}/setup.mak
> 
> [ruby-dev:26076] ext/extmk.rb
> 
> ということになるでしょうか。一応、bcc32 と win32 の動作を確認しました。

ext/extmk.rbのほうは入れておきました。

Borland makeはコマンドラインよりもMakefile中のマクロ定義のほう
が優先されるので、Makefileに追加するマクロはすべて!ifndef 〜
!endifで囲む必要がありそうです。

[ruby-dev:26072]からのNULLマクロの話は、bcb5tool.hlpを見る限り
では、未定義マクロとNULLマクロは区別されるように書いてあるんで
すけどねぇ。


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 19 Apr 2005 08:26:52 -0000 @@ -15,5 +15,5 @@ prefix = /usr OS = bccwin32 RT = $(OS) -INCLUDE = !include +BANG = ! APPEND = echo>>$(MAKEFILE) !ifdef MAKEFILE @@ -31,15 +31,51 @@ i686-$(OS): -prologue- -i686- -epilogue- alpha-$(OS): -prologue- -alpha- -epilogue- --prologue-: nul +-prologue-: -basic-vars- -prefix- -system-vars- -version- + +-basic-vars-: nul @echo Creating $(MAKEFILE) @type > $(MAKEFILE) &&| \#\#\# Makefile for ruby $(OS) \#\#\# srcdir = $(srcdir:\=/) -prefix = $(prefix:\=/) + +$(BANG)ifndef EXTSTATIC EXTSTATIC = $(EXTSTATIC) +$(BANG)endif !if defined(RDOCTARGET) +$(BANG)ifndef RDOCTARGET RDOCTARGET = $(RDOCTARGET) +$(BANG)endif !endif | + +-prefix-: nul + @type > prefix.c &&| +\#include <ctype.h> +\#include <stdio.h> + +\#define vardef(name, form) "!ifndef " \#name "\n" \#name " = " form "\n!endif\n" + +int main(int argc, char **argv) +{ + char *prefix = argv[1]; + if (isalpha(prefix[0]) && prefix[1] == ':') { + printf(vardef(DESTDIR, "%c:"), prefix[0]); + prefix += 2; + } + printf(vardef(prefix, "%s"), prefix); + return 0; +} +| + @$(CC) prefix.c > nul + @.\prefix "$(prefix:\=/)" >> $(MAKEFILE) + @del prefix.* + +-system-vars-: -osname- + +-osname-: nul + @$(APPEND) OS = $(OS) + @$(APPEND) RT = $(RT) + +-version-: nul @cpp32 -I$(srcdir) -P- -DRUBY_EXTERN="//" -o$(MAKEFILE) > nul &&| \#include "version.h" @@ -81,6 +117,4 @@ PROCESSOR_LEVEL = $(PROCESSOR_LEVEL) @type >> $(MAKEFILE) &&| -\# OS = $(OS) -\# RT = $(RT) \# RUBY_INSTALL_NAME = ruby \# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR) @@ -91,5 +125,5 @@ PROCESSOR_LEVEL = $(PROCESSOR_LEVEL) \# RFLAGS = $$(iconinc) \# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib -$(INCLUDE) $$(srcdir)bcc32/Makefile.sub +$(BANG)include $$(srcdir)/bcc32/Makefile.sub | @$(srcdir:/=\)\win32\rm.bat config.h config.status 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 15 Apr 2005 08:21:51 -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 prefix.* + -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 15 Apr 2005 06:26:16 -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はできる。 中田 伸悦