Author: hwright
Date: Mon Jan 4 14:39:46 2010
New Revision: 895643
URL: http://svn.apache.org/viewvc?rev=895643&view=rev
Log:
Merge r876165 from trunk:
* r876175
Allow use of APR 1.x when testing Ruby bindings on Windows.
Justification:
Makes possible testing of the Ruby bindings built with the recommended
version of APR.
Votes:
+1: joeswatosh
+0: hwright
Modified:
subversion/branches/1.6.x/ (props changed)
subversion/branches/1.6.x/STATUS
subversion/branches/1.6.x/subversion/bindings/swig/ruby/test/windows_util.rb
Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 4 14:39:46 2010
@@ -50,4 +50,4 @@
/subversion/branches/tc_url_rev:870696-870828
/subversion/branches/tree-conflicts:864636-869499
/subversion/branches/tree-conflicts-notify:870271-870353
-/subversion/trunk:875976,875980-875981,876054-876056,876092,876299,876306,876427,876440,876450,876507,876571,879688,880274-880275,880370,880474,880525-880526,881905,884842,886164,886197,888979,889081,889840
+/subversion/trunk:875976,875980-875981,876054-876056,876092,876175,876299,876306,876427,876440,876450,876507,876571,879688,880274-880275,880370,880474,880525-880526,881905,884842,886164,886197,888979,889081,889840
Modified: subversion/branches/1.6.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=895643&r1=895642&r2=895643&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Mon Jan 4 14:39:46 2010
@@ -186,12 +186,3 @@
Approved changes:
=================
-
- * r876175
- Allow use of APR 1.x when testing Ruby bindings on Windows.
- Justification:
- Makes possible testing of the Ruby bindings built with the recommended
- version of APR.
- Votes:
- +1: joeswatosh
- +0: hwright
Modified:
subversion/branches/1.6.x/subversion/bindings/swig/ruby/test/windows_util.rb
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/bindings/swig/ruby/test/windows_util.rb?rev=895643&r1=895642&r2=895643&view=diff
==============================================================================
---
subversion/branches/1.6.x/subversion/bindings/swig/ruby/test/windows_util.rb
(original)
+++
subversion/branches/1.6.x/subversion/bindings/swig/ruby/test/windows_util.rb
Mon Jan 4 14:39:46 2010
@@ -67,9 +67,19 @@
service_control('delete') if service_exists?
FileUtils.rm_rf(svnserve_dir)
end
- targets = %w(svnserve.exe libsvn_subr-1.dll libsvn_repos-1.dll
+
+ config = SetupEnvironment.gen_make_opts
+ apr_version_include = Pathname.new(config["--with-apr"]) +
+ 'include' + 'apr_version.h'
+ %r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)' =~
apr_version_include.read
+ apr_major_version = $1 == '0' ? '' : "-#{$1}"
+
+ targets = %W(svnserve.exe libsvn_subr-1.dll libsvn_repos-1.dll
libsvn_fs-1.dll libsvn_delta-1.dll
- libaprutil.dll libapr.dll libapriconv.dll sqlite3.dll
libdb44.dll libdb44d.dll)
+ libaprutil#{apr_major_version}.dll
+ libapr#{apr_major_version}.dll
+ libapriconv#{apr_major_version}.dll
+ sqlite3.dll libdb44.dll libdb44d.dll)
ENV["PATH"].split(";").each do |path|
found_targets = []
targets.each do |target|
@@ -82,6 +92,9 @@
targets -= found_targets
break if targets.empty?
end
+ # Remove optional targets instead of raising below. If they are
really
+ # needed, svnserve won't start anyway.
+ targets -= %W[libapriconv#{apr_major_version}.dll sqlite3.dll]
unless targets.empty?
raise "can't find libraries to work svnserve: #{targets.join(' ')}"
end
@@ -128,6 +141,7 @@
module SetupEnvironment
def setup_test_environment(top_dir, base_dir, ext_dir)
+ @@top_dir = top_dir
build_type = ENV["BUILD_TYPE"] || "Release"
@@ -157,6 +171,30 @@
end
end
+ def gen_make_opts
+ @gen_make_opts ||= begin
+ lines = []
+ gen_make_opts = File.join(@@top_dir, "gen-make.opts")
+ lines = File.read(gen_make_opts).to_a if File.exists?(gen_make_opts)
+ config = Hash.new do |hash, key|
+ if /^--with-(.*)$/ =~ key
+ hash[key] = File.join(@@top_dir, $1)
+ end
+ end
+
+ lines.each do |line|
+ name, value = line.chomp.split(/\s*=\s*/, 2)
+ if value
+ config[name] = Pathname.new(value).absolute? ?
+ value :
+ File.join(@@top_dir, value)
+ end
+ end
+ config
+ end
+ end
+ module_function :gen_make_opts
+
private
def setup_dll_wrapper_util(dll_dir, util)
libsvn_swig_ruby_dll_dir = File.join(dll_dir, "libsvn_swig_ruby")
@@ -174,17 +212,8 @@
add_path.call(#{libsvn_swig_ruby_dll_dir.dump})
EOC
end
-
+
def add_depended_dll_path_to_dll_wrapper_util(top_dir, build_type, util)
- lines = []
- gen_make_opts = File.join(top_dir, "gen-make.opts")
- lines = File.read(gen_make_opts).to_a if File.exists?(gen_make_opts)
- config = {}
- lines.each do |line|
- name, value = line.chomp.split(/\s*=\s*/, 2)
- config[name] = value if value
- end
-
[
["apr", build_type],
["apr-util", build_type],
@@ -192,11 +221,8 @@
["berkeley-db", "bin"],
["sqlite", "bin"],
].each do |lib, sub_dir|
- lib_dir = Pathname.new(config["--with-#{lib}"] || lib)
- dll_dir = lib_dir.absolute? ?
- lib_dir :
- Pathname.new(top_dir) + lib_dir
- dll_dir += sub_dir
+ lib_dir = Pathname.new(gen_make_opts["--with-#{lib}"])
+ dll_dir = lib_dir + sub_dir
dll_dir = dll_dir.expand_path
util.puts("add_path.call(#{dll_dir.to_s.dump})")
end