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

ruby-changes:12455

From: nagai <ko1@a...>
Date: Thu, 16 Jul 2009 23:35:24 +0900 (JST)
Subject: [ruby-changes:12455] Ruby:r24155 (ruby_1_8): * ext/tk/extconf.rb,ext/tk/config_list.in: ignore paths which includes

nagai	2009-07-16 23:35:07 +0900 (Thu, 16 Jul 2009)

  New Revision: 24155

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

  Log:
    * ext/tk/extconf.rb,ext/tk/config_list.in: ignore paths which includes
      white space characters on Windows.[ruby-dev:38794]
    * ext/tk/lib/tk.rb: works on Cygwin (limitation:: Tk.mainloop works on
      the main thread only).

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/tk/config_list.in
    branches/ruby_1_8/ext/tk/extconf.rb
    branches/ruby_1_8/ext/tk/lib/tk.rb

Index: ruby_1_8/ext/tk/config_list.in
===================================================================
--- ruby_1_8/ext/tk/config_list.in	(revision 24154)
+++ ruby_1_8/ext/tk/config_list.in	(revision 24155)
@@ -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: ruby_1_8/ext/tk/lib/tk.rb
===================================================================
--- ruby_1_8/ext/tk/lib/tk.rb	(revision 24154)
+++ ruby_1_8/ext/tk/lib/tk.rb	(revision 24155)
@@ -1178,7 +1178,10 @@
       if WITH_RUBY_VM ### check Ruby 1.9 !!!!!!!
         # *** NEED TO FIX ***
         ip = TclTkIp.new(name, opts)
-        if ip._invoke_without_enc('tk', 'windowingsystem') == 'aqua' &&
+        if RUBY_PLATFORM =~ /cygwin/
+          RUN_EVENTLOOP_ON_MAIN_THREAD = true
+          INTERP = ip
+        elsif ip._invoke_without_enc('tk', 'windowingsystem') == 'aqua' &&
             (TclTkLib.get_version<=>[8,4,TclTkLib::RELEASE_TYPE::FINAL,6]) > 0
           # *** KNOWN BUG ***
           #   Main event loop thread of TkAqua (> Tk8.4.9) must be the main
@@ -5636,7 +5639,7 @@
 #Tk.freeze
 
 module Tk
-  RELEASE_DATE = '2009-07-12'.freeze
+  RELEASE_DATE = '2009-07-16'.freeze
 
   autoload :AUTO_PATH,        'tk/variable'
   autoload :TCL_PACKAGE_PATH, 'tk/variable'
Index: ruby_1_8/ext/tk/extconf.rb
===================================================================
--- ruby_1_8/ext/tk/extconf.rb	(revision 24154)
+++ ruby_1_8/ext/tk/extconf.rb	(revision 24155)
@@ -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'] && 
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 24154)
+++ ruby_1_8/ChangeLog	(revision 24155)
@@ -1,3 +1,11 @@
+Thu Jul 16 23:32:16 2009  Hidetoshi NAGAI  <nagai@a...>
+
+	* ext/tk/extconf.rb,ext/tk/config_list.in: ignore paths which includes
+	  white space characters on Windows.[ruby-dev:38794]
+
+	* ext/tk/lib/tk.rb: works on Cygwin (limitation:: Tk.mainloop works on
+	  the main thread only).
+
 Wed Jul 15 06:21:50 2009  Hidetoshi NAGAI  <nagai@a...>
 
 	* ext/tk/extconf.rb: --with-{tcl,tk}-dir doesn't work.[ruby-dev:38782]

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

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