[ruby-oci8-commit] [453] trunk/ruby-oci8: embed a run-time loading path to the extention library oci8lib_*. so compiled for not only full clients, but also instant clients on Linux and Solaris.

nobody at rubyforge.org nobody at rubyforge.org
Mon Oct 17 08:50:51 EDT 2011


Revision: 453
Author:   kubo
Date:     2011-10-17 08:50:51 -0400 (Mon, 17 Oct 2011)

Log Message:
-----------
embed a run-time loading path to the extention library oci8lib_*.so compiled for not only full clients, but also instant clients on Linux and Solaris.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/oraconf.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-10-09 13:26:27 UTC (rev 452)
+++ trunk/ruby-oci8/ChangeLog	2011-10-17 12:50:51 UTC (rev 453)
@@ -1,3 +1,9 @@
+2011-10-17  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: embed a run-time loading path to the extention
+	    library oci8lib_*.so compiled for not only full clients, but also
+	    instant clients on Linux and Solaris.
+	    (suggested by d c and others.)
+
 2011-10-09  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/ocidatetime.c, lib/oci8/datetime.rb, lib/oci8/object.rb:
 	    add OCI8::BindType::OCITimestamp, OCI8::BindType::LocalDateTime,

Modified: trunk/ruby-oci8/ext/oci8/oraconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-09 13:26:27 UTC (rev 452)
+++ trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-17 12:50:51 UTC (rev 453)
@@ -703,6 +703,19 @@
       end
     end
 
+  else
+    # Unix
+    def get_libs(lib_dir)
+      case RUBY_PLATFORM
+      when /solaris/
+        " -L#{lib_dir} -R#{lib_dir} -lclntsh"
+      when /linux/
+        " -L#{lib_dir} -Wl,-rpath,#{lib_dir} -lclntsh"
+      else
+        " -L#{lib_dir} -lclntsh"
+      end
+    end
+
   end
 end
 
@@ -735,14 +748,7 @@
       else
         lib_dir = "#{@oracle_home}/lib"
       end
-      case RUBY_PLATFORM
-      when /solaris/
-        @libs = " -L#{lib_dir} -R#{lib_dir} -lclntsh"
-      when /linux/
-        @libs = " -L#{lib_dir} -Wl,-rpath,#{lib_dir} -lclntsh"
-      else
-        @libs = " -L#{lib_dir} -lclntsh"
-      end
+      @libs = get_libs(lib_dir)
       return if try_link_oci()
     end
 
@@ -1119,7 +1125,7 @@
         end
         raise 'failed'
       end
-      @libs = " -L#{lib_dir} -lclntsh "
+      @libs = get_libs(lib_dir)
     end
     unless File.exist?("#{inc_dir}/oci.h")
           raise <<EOS




More information about the ruby-oci8-commit mailing list