[#38782] [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

15 messages 2009/07/14
[#38784] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — Hidetoshi NAGAI <nagai@...> 2009/07/14

永井@知能.九工大です.

[#38790] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — "U.Nakamura" <usa@...> 2009/07/15

こんにちは、なかむら(う)です。

[#38791] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — Hidetoshi NAGAI <nagai@...> 2009/07/15

永井@知能.九工大です.

[#38792] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — "U.Nakamura" <usa@...> 2009/07/15

こんにちは、なかむら(う)です。

[#38793] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — Hidetoshi NAGAI <nagai@...> 2009/07/15

永井@知能.九工大です.

[#38794] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries. — "U.Nakamura" <usa@...> 2009/07/15

こんにちは、なかむら(う)です。

[#38843] 複素数リテラルについて — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

32 messages 2009/07/21
[#38855] Re: 複素数リテラルについて — Yusuke ENDOH <mame@...> 2009/07/22

遠藤です。

[#38857] Re: 複素数リテラルについて — Tadayoshi Funaba <tadf@...> 2009/07/22

> は十分検討されたのでしょうか。積極的に反対なわけではないですが、

[#38912] String#valid_encoding?にオプションが欲しい — Fujioka <fuj@...>

xibbarこと藤岡です。(なぜか届かないので再送します)

19 messages 2009/07/27
[#38918] Re: String#valid_encoding?にオプションが欲しい — "NARUSE, Yui" <naruse@...> 2009/07/27

成瀬です。

[#38925] Re: String#valid_encoding?にオプションが欲しい — Fujioka <fuj@...> 2009/07/27

xibbarです。

[#38927] Re: String#valid_encoding?にオプションが欲しい — Fujioka <fuj@...> 2009/07/28

xibbarです。

[#38914] [Bug #1819] Ruby-1.9.1を使用しDB(MySQL)接続時にエラー — Ryouhei Saita 斉田 <redmine@...>

Bug #1819: Ruby-1.9.1を使用しDB(MySQL)接続時にエラー

11 messages 2009/07/27

[#38932] Enumerator#peek — Tanaka Akira <akr@...>

Enumerator#peek を新設するのはどうでしょうか。

16 messages 2009/07/28

[ruby-dev:38799] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries.

From: Hidetoshi NAGAI <nagai@...>
Date: 2009-07-15 14:09:44 UTC
List: ruby-dev #38799
永井@知能.九工大です.

From: Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Subject: [ruby-dev:38796] Re: [Bug:trunk] Re: [ruby-cvs:31281] Ruby:r24063 (trunk): * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries.
Date: Wed, 15 Jul 2009 22:25:09 +0900
Message-ID: <20090715.222411.74735746.nagai@ai.kyutech.ac.jp>
> では Windows 環境用にはTcl/Tk の検索先を増やす
> (空白入りのパスは含めない) 以外には特別なことをせず,
> 従来通りとするように方針を変更します.

以下のパッチではいかがでしょうか.

Index: ext/tk/config_list.in
===================================================================
--- ext/tk/config_list.in	(revision 24110)
+++ ext/tk/config_list.in	(working copy)
@@ -1,6 +1,6 @@
 ##############################################
 # configure options for Ruby/Tk
-# release date:  2009-07-12
+# release date:  2009-07-15
 ##############################################
 with tk-old-extconf
 with ActiveTcl
@@ -33,3 +33,4 @@
 enable pthread
 enable tcl-thread
 with tclConfig-file
+enable space-on-tk-libpath
Index: ext/tk/extconf.rb
===================================================================
--- ext/tk/extconf.rb	(revision 24111)
+++ ext/tk/extconf.rb	(working copy)
@@ -1,6 +1,6 @@
 ##############################################################
 # extconf.rb for tcltklib
-# release date: 2009-07-12
+# release date: 2009-07-15
 ##############################################################
 require 'mkmf'
 
@@ -214,6 +214,11 @@
     }
   end
 
+  unless TkLib_Config["space-on-tk-libpath"]
+    path_head.delete_if{|path| path =~ / /}
+    path_dirs.delete_if{|path| path =~ / /}
+  end
+
   [path_head, path_dirs]
 end
 
@@ -418,6 +423,10 @@
       dirs << File.expand_path(File.join(dir, '..'))
     }
 
+    unless TkLib_Config["space-on-tk-libpath"]
+      dirs.delete_if{|path| path =~ / /}
+    end
+
     config_dir.concat(dirs.zip(dirs))
 
   elsif framework = find_macosx_framework()
@@ -627,7 +636,14 @@
 
   path_list = check_NG_path(path_list)
 
-  path_list.each{|path| $LIBPATH |= [path.strip] }
+  if is_win32?
+    # exist-dir only
+    path_list.each{|path|
+      path = path.strip; $LIBPATH |= [path] if File.directory?(path)
+    }
+  else
+    path_list.each{|path| $LIBPATH |= [path.strip] }
+  end
 end
 
 def find_tcl(tcllib, stubs, version, *opt_paths)
@@ -646,6 +662,10 @@
     "/Tcl/lib", "/Program Files/Tcl/lib"
   ].find_all{|dir| File.directory?(dir)}
 
+  unless TkLib_Config["space-on-tk-libpath"]
+    default_paths.delete_if{|path| path =~ / /}
+  end
+
   if (paths = opt_paths.compact).empty?
     if TclConfig_Info['config_file_path']
       # use definisions on tclConfig.sh
@@ -654,9 +674,11 @@
 
       unless stubs
         #*** Probably, TCL_LIBS is a subset of TK_LIBS. ***
-        # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
-        # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
-        $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC']
+        unless is_win32? # ignore tclConfig on Windows
+          # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
+          # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
+          $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC']
+        end
         return true
       end
 
@@ -666,9 +688,11 @@
         return false
       else
         #*** Probably, TCL_LIBS is a subset of TK_LIBS. ***
-        # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
-        # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
-        $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
+        unless is_win32? # ignore tclConfig on Windows
+          # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
+          # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
+          $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
+        end
         return true
       end
     end
@@ -742,6 +766,10 @@
     "/Tcl/lib", "/Program Files/Tcl/lib"
   ].find_all{|dir| File.directory?(dir)}
 
+  unless TkLib_Config["space-on-tk-libpath"]
+    default_paths.delete_if{|path| path =~ / /}
+  end
+
   if (paths = opt_paths.compact).empty?
     if TkConfig_Info['config_file_path']
       # use definisions on tkConfig.sh
@@ -749,9 +777,12 @@
       $LIBPATH |= [$2] unless $2.empty?
 
       unless stubs
-        $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
-        # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
-        $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC']
+        unless is_win32? # ignore tclConfig on Windows
+          # $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
+          $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS'] unless is_win32?
+          # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
+          $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC'] unless is_win32?
+        end
         return true
       end
 
@@ -759,9 +790,12 @@
         puts "#{TkConfig_Info['config_file_path']} tells us that your Tcl/Tk library doesn't support stub."
         return false
       else
-        $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
-        # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
-        $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
+        unless is_win32? # ignore tclConfig on Windows
+          # $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
+          $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS']
+          # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
+          $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
+        end
         return true
       end
     end
@@ -818,6 +852,10 @@
     "/Tcl/include", "/Program Files/Tcl/include"
   ].find_all{|dir| File.directory?(dir)}
 
+  unless TkLib_Config["space-on-tk-libpath"]
+    base_dir.delete_if{|path| path =~ / /}
+  end
+
   if TclConfig_Info['TCL_INCLUDE_SPEC'] && 
       have_tcl_h = try_cpp('tcl.h', TclConfig_Info['TCL_INCLUDE_SPEC'])
     $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC']
@@ -1123,6 +1161,10 @@
 end
 TkLib_Config["ActiveTcl"] = activeTcl
 
+# allow space chars on a libpath
+TkLib_Config["space-on-tk-libpath"] = 
+  enable_config("space-on-tk-libpath", ! is_win32?)
+
 # enable Tcl/Tk stubs?
 =begin
 if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] && 


-- 
永井 秀利  (nagai@ai.kyutech.ac.jp)
九州工業大学 大学院情報工学研究院 知能情報工学研究系 知能情報メディア部門

In This Thread