1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-10-31 08:07:50 +00:00
parent 26c13db6e6
commit 74ec76990a
2 changed files with 20 additions and 36 deletions

View file

@ -86,11 +86,10 @@ BASERUBY = ruby
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)
CPU = i$(PROCESSOR_LEVEL)86
ARCH = i386
!else
CPU = $(PROCESSOR_ARCHITECTURE)
ARCH = $(PROCESSOR_ARCHITECTURE)
CPU = $(MACHINE)
ARCH = $(MACHINE)
!endif
!if !defined(DEBUGFLAGS)
DEBUGFLAGS = -Zi

View file

@ -19,7 +19,6 @@ MAKE = $(MAKE) -f $(MAKEFILE)
!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)
<<
-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)