[ruby-oci8-commit] [455] trunk/ruby-oci8: fix checking code whether 'sys/types.h' is available for Ubuntu 11.10 where sys/types.h is not right under /usr/ include.

nobody at rubyforge.org nobody at rubyforge.org
Fri Oct 21 10:10:10 EDT 2011


Revision: 455
Author:   kubo
Date:     2011-10-21 10:10:10 -0400 (Fri, 21 Oct 2011)

Log Message:
-----------
fix checking code whether 'sys/types.h' is available for Ubuntu 11.10 where sys/types.h is not right under /usr/include.

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

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-10-21 13:26:03 UTC (rev 454)
+++ trunk/ruby-oci8/ChangeLog	2011-10-21 14:10:10 UTC (rev 455)
@@ -1,4 +1,9 @@
 2011-10-21  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: fix checking code whether 'sys/types.h' is
+	    available for Ubuntu 11.10 where sys/types.h is not right under
+	    /usr/include.
+
+2011-10-21  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/oraconf.rb: remove code to get linker options for Oracle 8
 	    and Oracle 8i.
 

Modified: trunk/ruby-oci8/ext/oci8/oraconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-21 13:26:03 UTC (rev 454)
+++ trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-21 14:10:10 UTC (rev 455)
@@ -581,6 +581,7 @@
     check_cc()
     @cc_is_gcc = check_cc_is_gcc()
     @lp64 = check_lp64()
+    check_system_header()
     check_ruby_header()
   end
 
@@ -622,6 +623,15 @@
     end
   end # check_lp64
 
+  def check_system_header
+    if not have_header('sys/types.h')
+      raise <<EOS
+A standard C header file 'sys/types.h' doesn't exist.
+Did you install glibc-devel(redhat) or libc6-dev(debian/ubuntu)?
+EOS
+    end
+  end
+
   def check_ruby_header
     print "checking for ruby header... "
     STDOUT.flush
@@ -643,12 +653,6 @@
 EOS
       end
     end
-    if RUBY_PLATFORM =~ /linux/ and not File.exist?("/usr/include/sys/types.h")
-      raise <<EOS
-Do you install glibc-devel(redhat) or libc6-dev(debian)?
-You need /usr/include/sys/types.h to compile ruby-oci8.
-EOS
-    end
     puts "ok"
     $stdout.flush
   end # check_ruby_header




More information about the ruby-oci8-commit mailing list