Issue #5517 has been updated by Heesob Park.


From the log, I noticed the line #188 of configure.bat
echo>>confargs.c !ifndef CONFIGURE_ARGS

output "ifndef CONFIGURE_ARGS" without "!" for some reason.

I guess this issue is related with the V option of CMD.EXE.
According to the help message:

/V:ON   Enable delayed environment variable expansion using ! as the
        delimiter. For example, /V:ON would allow !var! to expand the
        variable var at execution time.  The var syntax expands variables
        at input time, which is quite a different thing when inside of a FOR
        loop.

Here is a test case

C:\Tmp>type a.bat
@echo off
echo !ifndef CONFIGURE_ARGS
		
C:\Tmp>cmd /v:on
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Tmp>a.bat
ifndef CONFIGURE_ARGS

C:\Tmp>cmd /v:off
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Tmp>a.bat
!ifndef CONFIGURE_ARGS

In order to workaround this issue, you can use "setlocal DISABLEDELAYEDEXPANSION" in front of batch file.
C:\Tmp>type a.bat
@echo off
@setlocal DISABLEDELAYEDEXPANSION
echo !ifndef CONFIGURE_ARGS

C:\Tmp>cmd /v:on
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Tmp>a.bat
!ifndef CONFIGURE_ARGS

C:\Tmp>cmd /v:off
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Tmp>a.bat
!ifndef CONFIGURE_ARGS


----------------------------------------
Bug #5517: Unable to build trunk/ruby_1_9_3 with Windows SDK for Windows 7
http://redmine.ruby-lang.org/issues/5517

Author: Jon Forums
Status: Open
Priority: Normal
Assignee: Usaku NAKAMURA
Category: build
Target version: 1.9.3
ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]


While attempting to build with Windows SDK for Windows 7 (7.1), 7.1.7600.0.30514 I get the following error:

C:\Users\Jon\Documents\RubyDev\ruby-git\build>..\win32\configure.bat --prefix=c:\projects\ruby193-mswin
--target=i686-mswin32 --disable-install-doc --disable-win95
~setup~.mak(4) : fatal error U1034: syntax error : separator missing
Stop.


### BUILD ENVIRONMENT ###

C:\Users\Jon\Documents\RubyDev\ruby-git\build>ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]

C:\Users\Jon\Documents\RubyDev\ruby-git\build>bison --version
bison (GNU Bison) 2.4.2

C:\Users\Jon\Documents\RubyDev\ruby-git\build>sed --version
GNU sed version 4.2.1

C:\Users\Jon\Documents\RubyDev\ruby-git\build>nmake /?
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01

C:\Users\Jon\Documents\RubyDev\ruby-git\build>cl /?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86

C:\Users\Jon\Documents\RubyDev\ruby-git\build>lib /?
Microsoft (R) Library Manager Version 10.00.30319.01

C:\Users\Jon\Documents\RubyDev\ruby-git\build>dumpbin /?
Microsoft (R) COFF/PE Dumper Version 10.00.30319.01


# file: ~setup~.mak


ifndef CONFIGURE_ARGS






configure_args = --prefix=c:\projects\ruby193-mswin --target=i686-mswin32 --disable-install-doc --disable-win95
endif

####
conf = ..\win32\configure.bat
$(conf): nul
	@del ~setup~.mak
	@-$(MAKE) -l$(MAKEFLAGS) -f $(@D)/setup.mak \
	"prefix=c:\projects\ruby193-mswin" \
	"i686-mswin32" \
	"RDOCTARGET=nodoc" \
	"ENABLE_WIN95=no" \
	WIN32DIR=$(@D:\=/)
	@if exist Makefile.old del Makefile.old
	@if exist Makefile ren Makefile Makefile.old
	@ren Makefile.new Makefile




-- 
http://redmine.ruby-lang.org