[前][次][番号順一覧][スレッド一覧]

ruby-changes:27967

From: nobu <ko1@a...>
Date: Sun, 31 Mar 2013 15:40:48 +0900 (JST)
Subject: [ruby-changes:27967] nobu:r40019 (trunk): win32/configure.bat: option arguments

nobu	2013-03-31 15:40:37 +0900 (Sun, 31 Mar 2013)

  New Revision: 40019

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40019

  Log:
    win32/configure.bat: option arguments
    
    * win32/configure.bat: try to fix option arguments split by commas and
      equals here.  this batch file no longer run with old command.com.
    * tool/mkconfig.rb: no hacks for cmd.exe.

  Modified files:
    trunk/ChangeLog
    trunk/tool/mkconfig.rb
    trunk/win32/configure.bat

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40018)
+++ ChangeLog	(revision 40019)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar 31 15:40:30 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* win32/configure.bat: try to fix option arguments split by commas and
+	  equals here.  this batch file no longer run with old command.com.
+
+	* tool/mkconfig.rb: no hacks for cmd.exe.
+
 Sun Mar 31 13:47:04 2013  Tanaka Akira  <akr@f...>
 
 	* numeric.c (rb_num2ulong_internal): New function similar to
Index: win32/configure.bat
===================================================================
--- win32/configure.bat	(revision 40018)
+++ win32/configure.bat	(revision 40019)
@@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L1
 @echo off
 @setlocal disabledelayedexpansion
+set witharg=
 
 echo> ~tmp~.mak ####
 echo>> ~tmp~.mak conf = %0
@@ -9,6 +10,7 @@ echo>> ~tmp~.mak 	@-$(MAKE) -l$(MAKEFLAG https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L10
 if exist pathlist.tmp del pathlist.tmp
 echo>confargs.tmp #define CONFIGURE_ARGS \
 :loop
+set opt=%1
 if "%1" == "" goto :end
 if "%1" == "--prefix" goto :prefix
 if "%1" == "--srcdir" goto :srcdir
@@ -31,23 +33,20 @@ if "%1" == "--extout" goto :extout https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L33
 if "%1" == "--path" goto :path
 if "%1" == "--with-baseruby" goto :baseruby
 if "%1" == "--with-ntver" goto :ntver
-echo %1| findstr "^--with-.*-dir$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--with-.*-include$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--with-.*-lib$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--with-ext$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--with-extensions$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--without-ext$" > nul
-if not errorlevel 1 goto :witharg
-echo %1| findstr "^--without-extensions$" > nul
-if not errorlevel 1 goto :witharg
+if "%1" == "--without-ext" goto :witharg
+if "%1" == "--without-extensions" goto :witharg
+if "%opt:~0,10%" == "--without-" goto :withoutarg
+if "%opt:~0,7%" == "--with-" goto :witharg
 if "%1" == "-h" goto :help
 if "%1" == "--help" goto :help
-  echo>>confargs.tmp %1 \
+  if "%opt:~0,1%" == "-" (
+    echo>>confargs.tmp  %1 \
+    set witharg=
+  ) else if "%witharg" == "" (
+    echo>>confargs.tmp  %1 \
+  ) else (
+    echo>>confargs.tmp ,%1\
+  )
   shift
 goto :loop
 :srcdir
@@ -58,31 +57,31 @@ goto :loop https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L57
 goto :loop
 :prefix
   echo>> ~tmp~.mak 	"prefix=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :pprefix
   echo>> ~tmp~.mak 	"PROGRAM_PREFIX=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :suffix
   echo>> ~tmp~.mak 	"PROGRAM_SUFFIX=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :installname
   echo>> ~tmp~.mak 	"RUBY_INSTALL_NAME=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :soname
   echo>> ~tmp~.mak 	"RUBY_SO_NAME=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
@@ -134,31 +133,36 @@ goto :loop https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L133
 goto :loop
 :ntver
   echo>> ~tmp~.mak 	"NTVER=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :extout
   echo>> ~tmp~.mak 	"EXTOUT=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :path
   echo>>pathlist.tmp %~2;\
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :baseruby
   echo>> ~tmp~.mak 	"BASERUBY=%~2" \
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2 \
   shift
   shift
 goto :loop
 :witharg
-  echo>>confargs.tmp %1=%2 \
+  echo>>confargs.tmp  %1=%2\
+  set witharg=1
+  shift
   shift
+goto :loop
+:withoutarg
+  echo>>confargs.tmp  %1 \
   shift
 goto :loop
 :help
Index: tool/mkconfig.rb
===================================================================
--- tool/mkconfig.rb	(revision 40018)
+++ tool/mkconfig.rb	(revision 40019)
@@ -116,12 +116,6 @@ File.foreach "config.status" do |line| https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L116
     eq = win32 && vars[name] ? '<< "\n"' : '='
     vars[name] = val
     if name == "configure_args"
-      if win32
-        val.gsub!(/\G(--[-a-z0-9]+)((=\S+)|(?:\s+(?!-)\S+)+)?(\s*)/) {
-          _, opt, list, arg, sep = *$~
-          "#{opt}#{arg || list && list.sub(/^\s+/, '=').tr_s(' ', ',')}#{sep}"
-        }
-      end
       val.gsub!(/--with-out-ext/, "--without-ext")
     end
     val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]