[ruby-oci8-commit] [493] trunk/ruby-oci8: create map files of oci8lib_*. so on mingw32 in case of analyzing a core (minidump) file.

nobody at rubyforge.org nobody at rubyforge.org
Thu Jan 19 09:15:36 EST 2012


Revision: 493
Author:   kubo
Date:     2012-01-19 09:15:36 -0500 (Thu, 19 Jan 2012)

Log Message:
-----------
create map files of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/extconf.rb
    trunk/ruby-oci8/pre-distclean.rb
    trunk/ruby-oci8/ruby-oci8.gemspec

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-01-19 13:42:25 UTC (rev 492)
+++ trunk/ruby-oci8/ChangeLog	2012-01-19 14:15:36 UTC (rev 493)
@@ -1,4 +1,8 @@
 2012-01-19  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/extconf.rb, pre-distclean.rb, ruby-oci8.gemspec: create map files
+	    of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file.
+
+2012-01-19  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/apiwrap.yml, ext/oci8/stmt.c, lib/oci8/oci8.rb,
 	  lib/oci8/properties.rb: enable statement caching per session in OCI layer
 	    if the Oracle client is 9iR2 or upper.

Modified: trunk/ruby-oci8/ext/oci8/extconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/extconf.rb	2012-01-19 13:42:25 UTC (rev 492)
+++ trunk/ruby-oci8/ext/oci8/extconf.rb	2012-01-19 14:15:36 UTC (rev 493)
@@ -136,9 +136,8 @@
 
 # Config::CONFIG["ruby_version"] indicates the ruby API version.
 #  1.8   - ruby 1.8.x
-#  1.9.1 - ruby 1.9.1 and 1.9.2
-#  1.9.x - ruby 1.9.x future version which will break the API compatibility
-so_basename += Config::CONFIG["ruby_version"].gsub(/\W/, '')
+#  1.9.1 - ruby 1.9.1, 1.9.2 and 2.0.0-dev at the present time.
+so_basename += RbConfig::CONFIG["ruby_version"].gsub(/\W/, '')
 
 $defs << "-DInit_oci8lib=Init_#{so_basename}"
 $defs << "-Doci8lib=#{so_basename}"
@@ -174,6 +173,23 @@
 
 create_apiwrap()
 
+case RUBY_PLATFORM
+when /mingw32/
+  # Drop '-s' option from LDSHARED and explicitly run 'strip' to get the map file.
+  if RbConfig::MAKEFILE_CONFIG["LDSHARED"].gsub!(/-s\b/, '')
+    alias :oci8_configuration_orig :configuration
+    def configuration(*args)
+      oci8_configuration_orig(*args) << <<EOS
+
+# Dirty hack to get the map file.
+all__: all
+	nm $(DLLIB) | grep ' [TtBb] _[A-Za-z]' > $(TARGET).map
+	strip -s $(DLLIB)
+EOS
+    end
+  end
+end
+
 create_makefile(so_basename)
 
 exit 0

Modified: trunk/ruby-oci8/pre-distclean.rb
===================================================================
--- trunk/ruby-oci8/pre-distclean.rb	2012-01-19 13:42:25 UTC (rev 492)
+++ trunk/ruby-oci8/pre-distclean.rb	2012-01-19 14:15:36 UTC (rev 493)
@@ -1,7 +1,7 @@
 rm_f "#{curr_objdir}/lib/oci8.rb"
+rm_f "#{curr_objdir}/ext/oci8/oci8lib_18.map"
+rm_f "#{curr_objdir}/ext/oci8/oci8lib_191.map"
 if RUBY_PLATFORM =~ /cygwin/
   rm_f "#{curr_objdir}/ext/oci8/OCI.def"
   rm_f "#{curr_objdir}/ext/oci8/libOCI.a"
-else
-  rm_f "#{curr_objdir}/ext/oci8/oracle_objs.a"
 end

Modified: trunk/ruby-oci8/ruby-oci8.gemspec
===================================================================
--- trunk/ruby-oci8/ruby-oci8.gemspec	2012-01-19 13:42:25 UTC (rev 492)
+++ trunk/ruby-oci8/ruby-oci8.gemspec	2012-01-19 14:15:36 UTC (rev 493)
@@ -54,6 +54,10 @@
     else
       raise "No compiled binary are found. Run make in advance."
     end
+    # add map files to analyze a core (minidump) file.
+    so_files << 'ext/oci8/oci8lib_18.map' if has_1_8 and 'ext/coi8/oci8lib_18.map'
+    so_files << 'ext/oci8/oci8lib_191.map' if has_1_9_1 and 'ext/coi8/oci8lib_191.map'
+
     FileUtils.copy so_files, 'lib', :preserve => true
     files.reject! do |fname|
       fname =~ /^ext/




More information about the ruby-oci8-commit mailing list