[ruby-oci8-commit] [552] trunk/ruby-oci8: Exports a main function for Solaris x86 (32-bit).

nobody at rubyforge.org nobody at rubyforge.org
Sat Jan 12 07:52:22 UTC 2013


Revision: 552
Author:   kubo
Date:     2013-01-12 07:52:21 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
Exports a main function for Solaris x86 (32-bit).

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/docs/platform-specific-issues.md
    trunk/ruby-oci8/ext/oci8/oci8lib.c

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2013-01-06 12:39:46 UTC (rev 551)
+++ trunk/ruby-oci8/ChangeLog	2013-01-12 07:52:21 UTC (rev 552)
@@ -1,3 +1,11 @@
+2013-01-12  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oci8lib.c: export a main function for Solaris x86 (32-bit).
+	    When a main function is invisible from Oracle instant client
+	    11.2.0.3 for Solaris x86 (32-bit), OCIEnvCreate() fails by
+	    unknown reasons.
+	* docs/platform-specific-issues.md: change the workaround for
+	    Solaris x86 (32-bit) instant client.
+
 2013-01-06  KUBO Takehiro  <kubo at jiubao.org>
 	* NEWS: add changes between 2.1.4 and 2.1.3
 	* VERSION: change the version to 2.1.4.

Modified: trunk/ruby-oci8/docs/platform-specific-issues.md
===================================================================
--- trunk/ruby-oci8/docs/platform-specific-issues.md	2013-01-06 12:39:46 UTC (rev 551)
+++ trunk/ruby-oci8/docs/platform-specific-issues.md	2013-01-12 07:52:21 UTC (rev 552)
@@ -74,20 +74,11 @@
 For example, if the ruby is compiled by gcc, you need gcc. If it is compiled by Oracle Solaris Studio
 (formerly called as Sun Studio), you need Oracle Solaris Studio.
 
-If ruby is compiled by gcc and "require 'oci8'" raises "OCI Library Initialization Error",
-you may need to recompile ruby as follows:
+If "require 'oci8'" raises "OCI Library Initialization Error", ruby-oci8 version is 2.1.4 or lower,
+ruby version is 1.9.3 or upper, and ruby is compiled as an x86 32-bit executable by gcc, you may need
+to add the following code to ext/oci8/oci8lib.c to export a symbol `main`.
 
-    $ bzip2 -dc ruby-1.9.3-pxxx.tar.bz2 | tar xvf -
-    $ cd ruby-1.9.3-pxxx
-    $ vi main.c   # <- Add RUBY_FUNC_EXPORTED just before "int main(..)" as follows:
-    -------------
-    RUBY_FUNC_EXPORTED  /* Add this line */
-    int
-    main(int argc, char **argv)
-    -------------
-    $ ./configure
-    $ make
-    $ make install
+    int main() { return 0; }
 
 If you use Blastwave.org's ruby and want not to install Sun Studio,
 you can edit rbconfig.rb by your self. [(look at here)](http://forum.textdrive.com/viewtopic.php?id=12630)

Modified: trunk/ruby-oci8/ext/oci8/oci8lib.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8lib.c	2013-01-06 12:39:46 UTC (rev 551)
+++ trunk/ruby-oci8/ext/oci8/oci8lib.c	2013-01-12 07:52:21 UTC (rev 552)
@@ -22,6 +22,14 @@
 int oci8_in_finalizer = 0;
 VALUE oci8_cOCIHandle;
 
+#if defined __sun && defined __i386 && defined __GNUC__
+/* When a main function is invisible from Oracle instant
+ * client 11.2.0.3 for Solaris x86 (32-bit), OCIEnvCreate()
+ * fails by unknown reasons. We export it from ruby-oci8 instead
+ * of ruby itself.
+ */
+int main() { return 0; }
+#endif
 
 static VALUE mOCI8BindType;
 static VALUE cOCI8BindTypeBase;



More information about the ruby-oci8-commit mailing list