ruby-changes:36129
From: nobu <ko1@a...>
Date: Fri, 31 Oct 2014 17:07:57 +0900 (JST)
Subject: [ruby-changes:36129] nobu:r48210 (trunk): win32/setup.mak: get target architecture from the compiler
nobu 2014-10-31 17:07:50 +0900 (Fri, 31 Oct 2014) New Revision: 48210 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48210 Log: win32/setup.mak: get target architecture from the compiler * win32/Makefile.sub, win32/setup.mak (MACHINE): get target architecture from the compiler, instead of environment variable at build time, which is irrelevant to runtime environment, and not set when running in cygwin sshd. Modified files: trunk/win32/Makefile.sub trunk/win32/setup.mak Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 48209) +++ win32/Makefile.sub (revision 48210) @@ -86,11 +86,10 @@ BASERUBY = ruby https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L86 TEST_RUNNABLE = yes !endif -!if !defined(PROCESSOR_ARCHITECTURE) -PROCESSOR_ARCHITECTURE = x86 +!if !defined(MACHINE) +MACHINE = x86 !endif -MACHINE = $(PROCESSOR_ARCHITECTURE) -!if "$(PROCESSOR_ARCHITECTURE)" == "x86" +!if "$(MACHINE)" == "x86" !if !defined(PROCESSOR_LEVEL) PROCESSOR_LEVEL = 5 !endif @@ -103,8 +102,8 @@ PROCESSOR_FLAG = -G$(PROCESSOR_LEVEL) https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L102 CPU = i$(PROCESSOR_LEVEL)86 ARCH = i386 !else -CPU = $(PROCESSOR_ARCHITECTURE) -ARCH = $(PROCESSOR_ARCHITECTURE) +CPU = $(MACHINE) +ARCH = $(MACHINE) !endif !if !defined(DEBUGFLAGS) DEBUGFLAGS = -Zi Index: win32/setup.mak =================================================================== --- win32/setup.mak (revision 48209) +++ win32/setup.mak (revision 48210) @@ -19,7 +19,6 @@ MAKE = $(MAKE) -f $(MAKEFILE) https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L19 !else MAKEFILE = Makefile !endif -ARCH = PROCESSOR_ARCHITECTURE CPU = PROCESSOR_LEVEL CC = cl -nologo CPP = $(CC) -EP @@ -146,42 +145,28 @@ RUBY_SO_NAME = $(RUBY_SO_NAME) https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L145 << -generic-: nul -!if defined($(ARCH)) || defined($(CPU)) - @type << >>$(MAKEFILE) -!if defined($(ARCH)) -!if "$(PROCESSOR_ARCHITECTURE)" == "AMD64" -$(ARCH) = x64 -!elseif "$(PROCESSOR_ARCHITECTURE)" == "IA64" -$(ARCH) = ia64 -!elseif defined(PROCESSOR_ARCHITEW6432) -$(BANG)if "$$(TARGET_OS)" == "mswin64" -!if "$(PROCESSOR_ARCHITECTURE)" == "IA64" -$(ARCH) = ia64 -!else -$(ARCH) = x64 -!endif -$(BANG)else -$(ARCH) = $(PROCESSOR_ARCHITECTURE) -$(BANG)endif -!else -$(ARCH) = $(PROCESSOR_ARCHITECTURE) -!endif -!endif -!if defined($(CPU)) -$(CPU) = $(PROCESSOR_LEVEL) -!endif - + @$(CPP) <<conftest.c 2>nul | findstr = >>$(MAKEFILE) +#if defined _M_X64 +MACHINE = x64 +#elif defined _M_IA64 +MACHINE = ia64 +#else +MACHINE = x86 +#endif << +!if defined($(CPU)) + @$(APPEND) $(CPU) = $(PROCESSOR_LEVEL) !endif + @$(APPEND) -alpha-: nul - @echo $(ARCH) = alpha>>$(MAKEFILE) + @echo MACHINE = alpha>>$(MAKEFILE) -x64-: nul - @echo $(ARCH) = x64>>$(MAKEFILE) + @echo MACHINE = x64>>$(MAKEFILE) -ia64-: nul - @echo $(ARCH) = ia64>>$(MAKEFILE) + @echo MACHINE = ia64>>$(MAKEFILE) -ix86-: nul - @echo $(ARCH) = x86>>$(MAKEFILE) + @echo MACHINE = x86>>$(MAKEFILE) -i386-: -ix86- @echo $(CPU) = 3>>$(MAKEFILE) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/